diff --git a/connect/community/communityInfo.ts b/connect/community/communityInfo.ts index 1185f8d1..8a8469ce 100644 --- a/connect/community/communityInfo.ts +++ b/connect/community/communityInfo.ts @@ -1,5 +1,4 @@ import {StringUtils} from "../../utils/string-utils.class"; -import {properties} from "../../../../environments/environment"; import {SelectionCriteria} from "../../utils/entities/contentProvider"; export class CommunityInfo { @@ -36,6 +35,11 @@ export class CommunityInfo { } return response; } + + public isOpen() { + return !(this.membership && this.membership === 'byInvitation'); + } + public isPublic(){ return this.status == "all" || this.status == "PUBLIC"; } diff --git a/connect/connectHelper.ts b/connect/connectHelper.ts index 0e65047a..d53a63a3 100644 --- a/connect/connectHelper.ts +++ b/connect/connectHelper.ts @@ -1,6 +1,7 @@ import {HttpParams} from '@angular/common/http'; import {properties} from "../../../environments/environment"; import {Session} from "../login/utils/helper.class"; +import {CommunityInfo} from "./community/communityInfo"; export class ConnectHelper { @@ -53,7 +54,12 @@ export class ConnectHelper { } - public static isPrivate(community, user) { - return community && (community.isPrivate() || (community.isRestricted() && !(Session.isPortalAdministrator(user) || Session.isCommunityCurator(user) || Session.isManager("community", community.communityId, user)))) + public static isPrivate(community: CommunityInfo, user) { + return community && (community.isPrivate() || (community.isRestricted() && !( + Session.isPortalAdministrator(user) || + Session.isCommunityCurator(user) || + Session.isManager("community", community.communityId, user) || + (!community.isOpen() && Session.isMember('community', community.communityId, user)) + ))) } } diff --git a/landingPages/landing-utils/availableOn.component.ts b/landingPages/landing-utils/availableOn.component.ts index 9a1d217c..23c8ef1e 100644 --- a/landingPages/landing-utils/availableOn.component.ts +++ b/landingPages/landing-utils/availableOn.component.ts @@ -11,44 +11,59 @@ import {RouterHelper} from "../../utils/routerHelper.class"; selector: 'availableOn', template: ` -
- - - - - - - {{sliceString(availableOn[0].downloadNames.join("; "), 20)}} - - - - - -
- -
-
- - - - {{sliceString(availableOn[0].downloadNames.join("; "), 20)}} - - +
+ +

+ @@ -79,6 +94,14 @@ import {RouterHelper} from "../../utils/routerHelper.class"; {{instance.license}}
+
+ Full-Text: + + {{instance.fulltext}} + + {{instance.fulltext}} +
Data sources: -
+
@@ -404,7 +404,7 @@
-
+ @@ -422,14 +422,14 @@
- -
+
{{formatNumber(measure.value)}}
- -
+ +
{{measure.value}}
@@ -611,7 +611,7 @@
-
+
-
@@ -119,12 +119,8 @@ export class RoleVerificationComponent implements OnInit, OnDestroy, AfterViewIn ngAfterViewInit() { this.subscriptions.push(this.userManagementService.getUserInfo().subscribe(user => { this.user = user; - if (this.paramsSubscription instanceof Subscription) { - this.paramsSubscription.unsubscribe(); - } this.paramsSubscription = this.route.queryParams.subscribe(params => { if (params) { - this.isMember = !!params['isMember']; this.cdr.detectChanges(); if(params['verify'] && !this.isMember) { if (this.user) { @@ -133,7 +129,7 @@ export class RoleVerificationComponent implements OnInit, OnDestroy, AfterViewIn if (this.user.email === this.verification.email.toLowerCase() && this.id === this.verification.entity && this.type === this.verification.type) { if (this.verification.verificationType === 'manager') { this.openManagerModal(); - } else if (this.verification.verificationType === 'member' && this.service === "monitor") { + } else if (this.verification.verificationType === 'member') { this.openMemberModal(); } else { this.openErrorModal(); @@ -217,6 +213,9 @@ export class RoleVerificationComponent implements OnInit, OnDestroy, AfterViewIn this.managerModal.cancel(); this.error = null; this.userManagementService.updateUserInfo(() => { + if (this.paramsSubscription instanceof Subscription) { + this.paramsSubscription.unsubscribe(); + } if (this.service === "monitor") { this.loading = false; this.router.navigate(['/admin/' + this.verification.entity]); @@ -254,8 +253,12 @@ export class RoleVerificationComponent implements OnInit, OnDestroy, AfterViewIn this.clearCacheService.clearCache('Members updated'); this.loading = false; this.error = null; + this.isMember = true; this.userManagementService.updateUserInfo(() => { - this.router.navigate([], {queryParams: {'verify': null, 'isMember': true}}); + if (this.paramsSubscription instanceof Subscription) { + this.paramsSubscription.unsubscribe(); + } + this.cancel(); }); }, error => { this.loading = false; @@ -271,6 +274,7 @@ export class RoleVerificationComponent implements OnInit, OnDestroy, AfterViewIn } cancel() { - this.router.navigate([], {queryParams: {'verify': null, 'isMember': null}}); + this.isMember = false; + this.router.navigate([]); } } diff --git a/sharedComponents/search-input/search-input.component.ts b/sharedComponents/search-input/search-input.component.ts index ea7e87df..63fc7d03 100644 --- a/sharedComponents/search-input/search-input.component.ts +++ b/sharedComponents/search-input/search-input.component.ts @@ -90,6 +90,7 @@ export class SearchInputComponent implements OnInit, AfterViewInit { ngAfterViewInit() { if(typeof document !== 'undefined') { this.ratio = Number.parseFloat(getComputedStyle(this.searchInput.nativeElement).getPropertyValue('--search-input-icon-ratio')); + this.cdr.detectChanges(); } } diff --git a/utils/email/composer.ts b/utils/email/composer.ts index 6fead2f0..d2df6d38 100644 --- a/utils/email/composer.ts +++ b/utils/email/composer.ts @@ -302,21 +302,23 @@ export class Composer { return message; } - public static composeEmailForCommunityDashboard(name: string, recipient: string) { + public static composeEmailForCommunityDashboard(name: string, role: "manager" | "member", recipient: string) { let email: Email = new Email(); email.subject = 'OpenAIRE Connect | ' + name; - email.body = this.composeMessageForCommunityDashboard(name); + email.body = this.composeMessageForCommunityDashboard(name, role); email.recipient = recipient; return email; } - public static composeMessageForCommunityDashboard(name: string, user: string = null, invitation: any = null) { + public static composeMessageForCommunityDashboard(name: string, role: "manager" | "member", user: string = null, invitation: any = null) { let message = '

Dear ((__user__)),

' + - '

You have been invited to be a manager of the OpenAIRE Research Community Dashboard for the ' + name + '.

' + + '

You have been invited to be a ' + role + ' of the OpenAIRE Research Community Dashboard for the ' + name + '.

' + '

Click this URL and use the verification code below to accept the invitation.

' + '

The verification code is ((__code__)).

' + + (role === 'manager'? '

As a manager of the OpenAIRE Research Community Dashboard, you will have access to the administration part of the dashboard, ' + - 'where you will be able to customize and manage the content of the ' + name + '.

' + + 'where you will be able to customize and manage the content of the ' + name + '.

': + '

As a member of the OpenAIRE Research Community Dashboard, you will have access to the community dashboard and link research results with projects, communities and other research projects.

') + '

Please contact us at ' + properties.helpdeskEmail + ' if you have any questions or concerns.

' + '

Kind Regards
The OpenAIRE Team

' + diff --git a/utils/entity-actions/entity-actions.component.ts b/utils/entity-actions/entity-actions.component.ts index 53cc9cc7..96d7ea49 100644 --- a/utils/entity-actions/entity-actions.component.ts +++ b/utils/entity-actions/entity-actions.component.ts @@ -16,7 +16,7 @@ import {EnvProperties} from "../properties/env-properties"; routerLinkActive="router-link-active" routerLink="/participate/direct-claim" [title]="'Link '+openaireEntities.RESULTS+' with a '+openaireEntities.PROJECT+', a '+openaireEntities.COMMUNITY+' or other '+openaireEntities.RESULTS+' and make the new information available in OpenAIRE information space.'" [attr.uk-tooltip]="'pos: bottom; cls: uk-active uk-text-small uk-padding-small uk-width-medium'" - class="uk-flex uk-flex-middle uk-button-link uk-text-bolder" [ngClass]="isMobile ? 'uk-margin-left uk-margin-xsmall-bottom' : 'uk-flex-center'"> + class="uk-flex uk-flex-middle uk-button-link" [ngClass]="isMobile ? 'uk-margin-left uk-margin-xsmall-bottom' : 'uk-text-bolder uk-flex-center'"> Link to @@ -25,15 +25,15 @@ import {EnvProperties} from "../properties/env-properties"; - + class="uk-flex uk-flex-middle uk-button-link" [ngClass]="isMobile ? 'uk-margin-left uk-margin-xsmall-bottom' : 'uk-text-bolder uk-flex-center'"> + Share
@@ -41,7 +41,7 @@ import {EnvProperties} from "../properties/env-properties"; + class="uk-flex uk-flex-middle uk-button-link" [ngClass]="isMobile ? 'uk-margin-left uk-margin-xsmall-bottom' : 'uk-text-bolder uk-flex-center'"> Deposit @@ -50,7 +50,7 @@ import {EnvProperties} from "../properties/env-properties"; + class="uk-flex uk-flex-middle uk-button-link" [ngClass]="isMobile ? 'uk-margin-left uk-margin-xsmall-bottom' : 'uk-text-bolder uk-flex-center'"> Embed diff --git a/utils/fetchEntitiesClasses/fetchResearchResults.class.ts b/utils/fetchEntitiesClasses/fetchResearchResults.class.ts index 1090aeae..ce05a800 100644 --- a/utils/fetchEntitiesClasses/fetchResearchResults.class.ts +++ b/utils/fetchEntitiesClasses/fetchResearchResults.class.ts @@ -12,6 +12,7 @@ export class FetchResearchResults { private errorMessages: ErrorMessagesComponent; public results =[]; + public allResults =[]; // in case of paging public requestComplete: Subject; @@ -88,7 +89,8 @@ export class FetchResearchResults { this.subscriptions.push(this._searchResearchResultsService.advancedSearchResults(resultType, "", page, size, "resultdateofacceptance,descending", properties, "&type=results&fq=communityid=" + communityId +(contextId?'&fq=categoryid=' + encodeURIComponent(contextId):'')).subscribe( data => { this.searchUtils.totalResults = data[0]; - this.results = data[1]; + this.allResults = data[1]; + this.results = data[1].slice(0, 5) ; this.searchUtils.status = this.errorCodes.DONE; if(this.searchUtils.totalResults == 0 ){ diff --git a/utils/properties/environments/environment.all.ts b/utils/properties/environments/environment.all.ts new file mode 100644 index 00000000..020b7e89 --- /dev/null +++ b/utils/properties/environments/environment.all.ts @@ -0,0 +1,25 @@ +import {EnvProperties} from "../env-properties"; + +export let common: EnvProperties = { + swhURL: "https://archive.softwareheritage.org/", + // searchCrossrefAPIURL: "https://api.crossref.org/works", + // searchDataciteAPIURL: "https://api.datacite.org/works", + // searchOrcidURL: "https://pub.orcid.org/v2.1/", + // orcidURL: "https://orcid.org/", + // doiURL: "https://doi.org/", + // pmcURL: "http://europepmc.org/articles/", + // pmidURL: "https://www.ncbi.nlm.nih.gov/pubmed/", + // handleURL: "http://hdl.handle.net/", + // cordisURL: "http://cordis.europa.eu/projects/", + // openDoarURL: "http://v2.sherpa.ac.uk/id/repository/", + // r3DataURL: "http://service.re3data.org/repository/", + // fairSharingURL: "https://fairsharing.org/", + // sherpaURL: "http://sherpa.ac.uk/romeo/issn/", + // sherpaURLSuffix: "/", + // zenodo: "https://zenodo.org/", + // openAccess: "https://www.openaire.eu/support/faq#article-id-234", + // openAccessRepo: "https://www.openaire.eu/support/faq#article-id-310", + // fp7Guidlines: "https://www.openaire.eu/open-access-in-fp7-seventh-research-framework-programme", + // h2020Guidlines: "https://www.openaire.eu/oa-publications/h2020/open-access-in-horizon-2020", + // ercGuidlines: "http://erc.europa.eu/sites/default/files/document/file/ERC_Open_Access_Guidelines-revised_2014.pdf", +} \ No newline at end of file diff --git a/utils/properties/environments/environment.beta.ts b/utils/properties/environments/environment.beta.ts new file mode 100644 index 00000000..520b88e2 --- /dev/null +++ b/utils/properties/environments/environment.beta.ts @@ -0,0 +1,6 @@ +import {EnvProperties} from "../env-properties"; + +export let commonBeta: EnvProperties = { + // searchAPIURLLAst: "http://beta.services.openaire.eu/search/v2/api/", + // searchResourcesAPIURL: "https://beta.services.openaire.eu/search/v2/api/resources", +} \ No newline at end of file diff --git a/utils/properties/environments/environment.prod.ts b/utils/properties/environments/environment.prod.ts new file mode 100644 index 00000000..a2aa22f8 --- /dev/null +++ b/utils/properties/environments/environment.prod.ts @@ -0,0 +1,6 @@ +import {EnvProperties} from "../env-properties"; + +export let commonProd: EnvProperties = { + // searchAPIURLLAst: "https://services.openaire.eu/search/v2/api/", + // searchResourcesAPIURL: "https://services.openaire.eu/search/v2/api/resources", +} \ No newline at end of file diff --git a/utils/properties/environments/environment.test.ts b/utils/properties/environments/environment.test.ts new file mode 100644 index 00000000..81abb978 --- /dev/null +++ b/utils/properties/environments/environment.test.ts @@ -0,0 +1,6 @@ +import {EnvProperties} from "../env-properties"; + +export let commonTest: EnvProperties = { + // searchAPIURLLAst: "https://services.openaire.eu/shadowSearch/v2/api/", + // searchResourcesAPIURL: "https://services.openaire.eu/shadowSearch/v2/api/resources", +} \ No newline at end of file diff --git a/utils/properties/environments/environment.ts b/utils/properties/environments/environment.ts new file mode 100644 index 00000000..69e7ceb1 --- /dev/null +++ b/utils/properties/environments/environment.ts @@ -0,0 +1,6 @@ +import {EnvProperties} from "../env-properties"; + +export let commonDev: EnvProperties = { + // searchAPIURLLAst: "http://beta.services.openaire.eu/search/v2/api/", + // searchResourcesAPIURL: "https://beta.services.openaire.eu/search/v2/api/resources", +} \ No newline at end of file diff --git a/utils/result-preview/result-preview.ts b/utils/result-preview/result-preview.ts index b7a2450b..11ee68c5 100644 --- a/utils/result-preview/result-preview.ts +++ b/utils/result-preview/result-preview.ts @@ -11,6 +11,7 @@ export interface HostedByCollectedFrom { years: string[]; accessRightIcon: string; license?: string; + fulltext?: string; } export interface Journal { diff --git a/utils/tabs/contents/search-tab.component.ts b/utils/tabs/contents/search-tab.component.ts index 7383f76e..e8656ed1 100644 --- a/utils/tabs/contents/search-tab.component.ts +++ b/utils/tabs/contents/search-tab.component.ts @@ -1,4 +1,4 @@ -import {Component, Input} from '@angular/core'; +import {Component, Input, SimpleChanges} from '@angular/core'; import {EnvProperties} from "../../properties/env-properties"; import {ErrorCodes} from "../../properties/errorCodes"; import {OpenaireEntities} from "../../properties/searchFields"; @@ -41,7 +41,7 @@ import {StringUtils} from "../../string-utils.class"; @@ -67,7 +67,6 @@ export class SearchTabComponent { @Input() properties: EnvProperties; @Input() customTitle; @Input() showEnermaps: boolean; - @Input() currentPage: number = null; public errorCodes: ErrorCodes = new ErrorCodes(); @@ -75,10 +74,6 @@ export class SearchTabComponent { return StringUtils.getEntityName(entityType, true); } - get results() { - return this.currentPage ? this.fetch.results.slice((this.currentPage - 1) * this.searchNumber, this.currentPage * this.searchNumber) : this.fetch.results; - } - get paramsForExternalUrl() { let parameters: string = ""; Object.keys(this.params).forEach(paramKey => {