diff --git a/cache-interceptor.service.ts b/cache-interceptor.service.ts index 12f5c557..a3a67d32 100644 --- a/cache-interceptor.service.ts +++ b/cache-interceptor.service.ts @@ -49,6 +49,11 @@ export class CacheInterceptorService implements HttpInterceptor { } public checkForCachedRequests(url){ + // Do not call cache when it is not enabled at all. + // This property is not correctly used here. A new property should be introduced. For now it is ok. + if (!properties.useLongCache) { + return false; + } if(url.indexOf("refine=true") !== -1 || url.indexOf("/count?format=json") !== -1 || url.indexOf("relresulttype%3Dpublication") !== -1) { return this.cachingRequests.some(partUrl => (url.indexOf(partUrl) !== -1)); } diff --git a/claims/claim-utils/claimContextSearchForm.component.html b/claims/claim-utils/claimContextSearchForm.component.html index 2983f18a..bd7195c0 100644 --- a/claims/claim-utils/claimContextSearchForm.component.html +++ b/claims/claim-utils/claimContextSearchForm.component.html @@ -1,5 +1,5 @@
-
+
diff --git a/claims/claim-utils/claimContextSearchForm.component.ts b/claims/claim-utils/claimContextSearchForm.component.ts index bd73e074..95289d97 100644 --- a/claims/claim-utils/claimContextSearchForm.component.ts +++ b/claims/claim-utils/claimContextSearchForm.component.ts @@ -18,6 +18,7 @@ declare var UIkit: any; }) export class ClaimContextSearchFormComponent { + @Input() public centerAlign: boolean = false; @Input() public results:ClaimEntity[]; @Input() public sources; @Input() public properties: EnvProperties; diff --git a/claims/claim-utils/claimHelper.class.ts b/claims/claim-utils/claimHelper.class.ts index c6dc154c..9b914ab5 100644 --- a/claims/claim-utils/claimHelper.class.ts +++ b/claims/claim-utils/claimHelper.class.ts @@ -168,7 +168,7 @@ export class ShowOptions { this.basketShowSources = false; } showLinkTo() { - console.log(this.linkTo, "showLinkTo") + // console.log(this.linkTo, "showLinkTo") this.show = this.linkTo; this.basketswitchToLinkTo(); HelperFunctions.scroll(); diff --git a/claims/claim-utils/claimProjectSearchForm.component.html b/claims/claim-utils/claimProjectSearchForm.component.html index 658a9f93..3734b038 100644 --- a/claims/claim-utils/claimProjectSearchForm.component.html +++ b/claims/claim-utils/claimProjectSearchForm.component.html @@ -1,4 +1,4 @@ -
+
diff --git a/claims/claim-utils/claimProjectSearchForm.component.ts b/claims/claim-utils/claimProjectSearchForm.component.ts index 1f9b3bcb..01e6d8c0 100644 --- a/claims/claim-utils/claimProjectSearchForm.component.ts +++ b/claims/claim-utils/claimProjectSearchForm.component.ts @@ -21,6 +21,7 @@ declare var UIkit:any; }) export class ClaimProjectsSearchFormComponent { public query = ''; + @Input() public centerAlign: boolean = false; @Input() public selectedProjects:ClaimEntity[]=[] ; public elementRef; diff --git a/claims/claim-utils/claimResultSearchForm.component.html b/claims/claim-utils/claimResultSearchForm.component.html index ab0c8642..b2e66b11 100644 --- a/claims/claim-utils/claimResultSearchForm.component.html +++ b/claims/claim-utils/claimResultSearchForm.component.html @@ -1,4 +1,4 @@ -
+
@@ -8,7 +8,7 @@
+ [searchInputClass]="'inner background'" (searchEmitter)="search(true)">
diff --git a/claims/claim-utils/claimResultSearchForm.component.ts b/claims/claim-utils/claimResultSearchForm.component.ts index fa31b7a2..b99f5e2a 100644 --- a/claims/claim-utils/claimResultSearchForm.component.ts +++ b/claims/claim-utils/claimResultSearchForm.component.ts @@ -23,6 +23,7 @@ export class ClaimResultSearchFormComponent { source: string = "datacite"; type: string = "dataset"; showSearchResults: boolean = false; + @Input() public centerAlign: boolean = false; @Input() public select: boolean = true; @Input() public keyword: string = ''; @Input() public selectedResults: ClaimEntity[]; diff --git a/claims/claim-utils/claimResults.component.ts b/claims/claim-utils/claimResults.component.ts index 3b6177e2..815dabf9 100644 --- a/claims/claim-utils/claimResults.component.ts +++ b/claims/claim-utils/claimResults.component.ts @@ -6,13 +6,9 @@ declare var UIkit: any; @Component({ selector: 'claim-results', template: ` -
-
-
-
- {{(!entity.result) ? entity.type : ((entity.result && entity.result.source == 'openaire') ? entity.type : (entity.result && entity.result.source + ' result'))}} -
+
+
@@ -20,27 +16,29 @@ declare var UIkit: any;
- -
-
-
`, - +
+ ` }) export class ClaimResultsComponent { @Input() results: ClaimEntity[]; @Input() selectedResults: ClaimEntity[]; @Input() localStoragePrefix: string = ""; @Input() basketLimit; - + + ngOnInit() { + } + public isSelected(item: ClaimEntity) { return !!this.selectedResults.find(result => item.id === result.id); } diff --git a/claims/claim-utils/displayClaims/displayClaims.component.html b/claims/claim-utils/displayClaims/displayClaims.component.html index 8eba3930..2c5dd4eb 100644 --- a/claims/claim-utils/displayClaims/displayClaims.component.html +++ b/claims/claim-utils/displayClaims/displayClaims.component.html @@ -16,7 +16,7 @@
-
diff --git a/claims/claim-utils/displayClaims/displayClaims.component.ts b/claims/claim-utils/displayClaims/displayClaims.component.ts index 0f9b03ad..84e90ca7 100644 --- a/claims/claim-utils/displayClaims/displayClaims.component.ts +++ b/claims/claim-utils/displayClaims/displayClaims.component.ts @@ -240,7 +240,7 @@ export class DisplayClaimsComponent implements OnInit, OnDestroy { handleErrors(err, message) { NotificationHandler.rise(message, "danger"); - console.error("Dispaly Claims (component): " + message + " " + (err && err.error ? err.error : '')); + console.error("Display Claims (component): " + message + " " + (err && err.error ? err.error : '')); } goTo(page: number = 1) { @@ -290,7 +290,7 @@ export class DisplayClaimsComponent implements OnInit, OnDestroy { } changeKeyword() { - if (this.filterForm.get("keyword") && (this.filterForm.get("keyword").value.length >= 3 || this.filterForm.get("keyword").value.length == 0)) { + if (this.filterForm.get("keyword") && (this.filterForm.get("keyword").value?.length >= 3 || this.filterForm.get("keyword").value?.length == 0)) { this.searchTermStream.next(this.filterForm.get("keyword").value); } } diff --git a/claims/claim-utils/service/searchDatacite.service.ts b/claims/claim-utils/service/searchDatacite.service.ts index 52854ed5..4361462f 100644 --- a/claims/claim-utils/service/searchDatacite.service.ts +++ b/claims/claim-utils/service/searchDatacite.service.ts @@ -50,7 +50,6 @@ export class SearchDataciteService { static parse(response): ClaimEntity[] { const results: ClaimEntity[] = []; - console.log(response); for (let i = 0; i < response.length; i++) { const item = response[i]; const entity: ClaimEntity = new ClaimEntity(); diff --git a/claims/directLinking/directLinking.component.ts b/claims/directLinking/directLinking.component.ts index b555d63d..caa334f9 100644 --- a/claims/directLinking/directLinking.component.ts +++ b/claims/directLinking/directLinking.component.ts @@ -10,6 +10,7 @@ import {Subscriber} from "rxjs"; import {properties} from "../../../../environments/environment"; import {OpenaireEntities} from "../../utils/properties/searchFields"; import {StringUtils} from "../../utils/string-utils.class"; +import {ClaimProjectsSearchFormComponent} from "../claim-utils/claimProjectSearchForm.component"; @Component({ @@ -152,6 +153,7 @@ export class DirectLinkingComponent { entity.type = "project"; entity.title = project.projectName; entity.project = new ClaimProject(); + entity.project.url = properties.searchLinkToProject + entity.id; entity.project.acronym = project.projectAcronym; entity.project.code = project.code; entity.project.endDate = project.endDate; diff --git a/claims/linking/linkingGeneric.component.html b/claims/linking/linkingGeneric.component.html index a5a7062d..9d0b1379 100644 --- a/claims/linking/linkingGeneric.component.html +++ b/claims/linking/linkingGeneric.component.html @@ -1,20 +1,61 @@ + +
+ + +
+
+
+ Basket reached the size limit. No more entities can be added. +
+ + +
+ No entities to link with the sources. Start adding entities from the left panel. +
+ +
+
+ +
-
+
- - - + @@ -37,16 +78,18 @@
+

Link source to

@@ -54,12 +97,14 @@ [properties]=properties [localStoragePrefix]="localStoragePrefix+'results'" [basketLimit]="basketLimit" [showOptions]="showOptions" + [centerAlign]="!!inlineEntity" >
@@ -69,78 +114,70 @@
- -
-
-
- - - + +
+
Source
+ + +
+

+
+
Link source to ({{(results.length) | number}})
+ +
+
+ + + +
+
+
+ + + -
-
-
- No Sources added yet. Start adding sources from the left panel. Or upload a DOI's CSV file.
-
- Basket reached the size limit. No more sources can be added. +
+
+ No Sources added yet. Start adding sources from the left panel. Or upload a DOI's CSV file. +
+
+ Basket reached the size limit. No more sources can be added. +
+ +
- - - -
-
-
-
-
- - -
-
-
- Basket reached the size limit. No more entities can be added. -
- - -
- No entities to link with the sources. Start adding entities from the left panel. -
- +
+
+
-
+
-
STEP {{inlineEntity ? '2' : '3'}} - FINALISE AND FINISH
+
STEP {{inlineEntity ? '2' : '3'}} - SUMMARISE
diff --git a/claims/linking/linkingGeneric.component.ts b/claims/linking/linkingGeneric.component.ts index 6e184a17..4d132a72 100644 --- a/claims/linking/linkingGeneric.component.ts +++ b/claims/linking/linkingGeneric.component.ts @@ -13,6 +13,9 @@ import {Subscriber} from "rxjs"; import {properties} from "../../../../environments/environment"; import {Breadcrumb} from "../../utils/breadcrumbs/breadcrumbs.component"; import {OpenaireEntities} from "../../utils/properties/searchFields"; +import {StringUtils} from "../../utils/string-utils.class"; +import {RouterHelper} from "../../utils/routerHelper.class"; +import { Location } from '@angular/common'; @Component({ selector: 'linking-generic', @@ -44,10 +47,12 @@ export class LinkingGenericComponent { @ViewChild(AlertModal) alert; public pageContents = null; @Input() breadcrumbs: Breadcrumb[] = []; + public routerHelper: RouterHelper = new RouterHelper(); constructor (private _router: Router, private route: ActivatedRoute, private entitySearch:EntitiesSearchService, private _meta: Meta, private _title: Title, private _piwikService:PiwikService, - private seoService: SEOService, private helper: HelperService, private cdr: ChangeDetectorRef ) { + private seoService: SEOService, private helper: HelperService, private cdr: ChangeDetectorRef, + private location: Location) { } subscriptions = []; @@ -161,6 +166,7 @@ export class LinkingGenericComponent { this.showOptions.show = 'claim'; } this.cdr.detectChanges(); + HelperFunctions.scroll(true); console.log('stepHasChanged', stepId, this.showOptions.show) } @@ -193,5 +199,14 @@ export class LinkingGenericComponent { } } } - + + private getEntityName (entityType:string, plural:boolean) { + return StringUtils.getEntityName(entityType, plural); + } + + back(): void { + if(typeof document !== 'undefined') { + this.location.back(); + } + } } diff --git a/claims/linking/selected/ClaimEntityMetadata.component.less b/claims/linking/selected/ClaimEntityMetadata.component.less new file mode 100644 index 00000000..33e65cd1 --- /dev/null +++ b/claims/linking/selected/ClaimEntityMetadata.component.less @@ -0,0 +1,11 @@ +@import (reference) "~src/assets/openaire-theme/less/_import-variables"; + +.claim-entity-metadata { + + & > *:not(:last-child):not(.other-separator)::after { + content: "\2022"; + font-weight: normal; + margin-left: @global-xsmall-margin; + margin-right: @global-xsmall-margin; + } +} diff --git a/claims/linking/selected/ClaimEntityProjectMetadata.component.ts b/claims/linking/selected/ClaimEntityProjectMetadata.component.ts index fa83b344..0b90acc6 100644 --- a/claims/linking/selected/ClaimEntityProjectMetadata.component.ts +++ b/claims/linking/selected/ClaimEntityProjectMetadata.component.ts @@ -4,18 +4,28 @@ import {ClaimEntity} from '../../claim-utils/claimHelper.class'; @Component({ selector: 'claim-project-metadata', template: ` -
-
- Funder: {{entity.project.funderName}} -
-
- GrandID: {{entity.project.code}} -
-
- Duration: {{(entity.project.startDate) ? entity.project.startDate : 'Unknown'}}{{'-' + ((entity.project.endDate) ? entity.project.endDate : 'Unknown')}} -
-
- ` + + +
+
+ Funder: {{entity.project.funderName}} +
+
+ Project Code: {{entity.project.code}} +
+
+
+ `, + styleUrls: ['ClaimEntityMetadata.component.less'] }) diff --git a/claims/linking/selected/ClaimEntityResultMetadata.component.ts b/claims/linking/selected/ClaimEntityResultMetadata.component.ts index c74bb953..d4db19f4 100644 --- a/claims/linking/selected/ClaimEntityResultMetadata.component.ts +++ b/claims/linking/selected/ClaimEntityResultMetadata.component.ts @@ -4,29 +4,37 @@ import {ClaimEntity} from '../../claim-utils/claimHelper.class'; @Component({ selector: 'claim-result-metadata', template: ` -
-
- Authors: {{sliceArray(entity.result.authors)}} -
-
- Editors: {{sliceArray(entity.result.editors)}} -
-
- - Publisher: {{entity.result.publisher}} +
+ + +
+ {{sliceArray(entity.result.authors)}} +
+
+ + {{getProjectDurationMessage(entity)}} +
- ` + `, + styleUrls: ['ClaimEntityMetadata.component.less'] }) diff --git a/claims/linking/selected/ClaimEntityTitle.component.ts b/claims/linking/selected/ClaimEntityTitle.component.ts index 5cc65e33..12231e53 100644 --- a/claims/linking/selected/ClaimEntityTitle.component.ts +++ b/claims/linking/selected/ClaimEntityTitle.component.ts @@ -1,64 +1,67 @@ import {Component, Input} from '@angular/core'; import {ClaimEntity} from '../../claim-utils/claimHelper.class'; -import {StringUtils} from "../../../utils/string-utils.class"; @Component({ selector: 'claim-title', - template: - ` -
- - insert_drive_file - - assignment_turned_in - - people - -
- - {{entity.title ? sliceString(entity.title) : '[No title available]'}} - {{entity.title ? sliceString(entity.title) : '[No title available]'}} - - - - {{(entity.project.acronym ? '[' + entity.project.acronym + '] ' : '') + entity.title}} - - - {{(entity.project.acronym ? sliceString(entity.project.acronym):sliceString(entity.title))}} - + template: ` +
+ + + insert_drive_file + + + assignment_turned_in + + + people + + +
+
+ + {{entity.title ? sliceString(entity.title) : '[No title available]'}} - - - {{(entity.project.acronym ? '[' + entity.project.acronym + '] ' : '') + entity.title}} - - - {{(entity.project.acronym ? sliceString(entity.project.acronym):sliceString(entity.title))}} - - - - - - - - {{entity.context.community }} > {{entity.context.category}} > - - {{entity.context.concept.label}} - + + {{entity.title ? sliceString(entity.title) : '[No title available]'}} + + + + + {{(entity.project.acronym ? '[' + entity.project.acronym + '] ' : '') + entity.title}} + + + {{(entity.project.acronym ? sliceString(entity.project.acronym):sliceString(entity.title))}} + + + + + {{(entity.project.acronym ? '[' + entity.project.acronym + '] ' : '') + entity.title}} + + + {{(entity.project.acronym ? sliceString(entity.project.acronym):sliceString(entity.title))}} + + + + + + {{entity.context.community }} > {{entity.context.category}} > + + + {{entity.context.concept.label}} + + +
-
+
` }) export class ClaimEntityTitleComponent { - - @Input() entity: ClaimEntity; @Input() slice:boolean = false; @Input() sliceSize:number = 45; @@ -66,14 +69,13 @@ export class ClaimEntityTitleComponent { @Input() showIcon: boolean = false; ngOnInit() { - - } + sliceString(mystr:string): string { - if(this.slice){ + if(this.slice){ // return StringUtils.sliceString(mystr,this.sliceSize); - } - return mystr; + } + return mystr; } } diff --git a/claims/linking/selected/metadataPreview.component.html b/claims/linking/selected/metadataPreview.component.html index f5b5221f..2a8f38c3 100644 --- a/claims/linking/selected/metadataPreview.component.html +++ b/claims/linking/selected/metadataPreview.component.html @@ -12,8 +12,8 @@
SOURCES ({{sources.length + (inlineEntity ? 1 : 0) | number}}) - Edit + Edit sources
    @@ -51,10 +51,10 @@
    • -
      +
      Link couldn't be saved
      @@ -157,8 +157,8 @@ LINK TO ({{results.length | number}}) - Edit + Edit entities
      @@ -174,7 +174,7 @@
    • -
      +
      Link couldn't be saved
      diff --git a/dashboard/sharedComponents/sidebar/layout.service.ts b/dashboard/sharedComponents/sidebar/layout.service.ts index 447d7a5f..39a2eaa8 100644 --- a/dashboard/sharedComponents/sidebar/layout.service.ts +++ b/dashboard/sharedComponents/sidebar/layout.service.ts @@ -75,6 +75,11 @@ export class LayoutService { private isMobileSubject: BehaviorSubject = new BehaviorSubject(false); /** Active sidebar Item*/ private activeSidebarItemSubject: BehaviorSubject = new BehaviorSubject(null); + /** + * Add hasMenuSearchBar: false/ nothing on data of route config, if the search bar in the menu should not appear, otherwise true. + */ + private hasMenuSearchBarSubject: BehaviorSubject = new BehaviorSubject(false); + private subscriptions: any[] = []; ngOnDestroy() { @@ -166,6 +171,12 @@ export class LayoutService { } else { this.setActiveMenuItem(''); } + if (data['hasMenuSearchBar'] !== undefined && + data['hasMenuSearchBar'] === true) { + this.setHasMenuSearchBar(true); + } else { + this.setHasMenuSearchBar(false); + } } })); this.setObserver(); @@ -292,4 +303,12 @@ export class LayoutService { setActiveSidebarItem(value: SidebarItem) { this.activeSidebarItemSubject.next(value); } + + get hasMenuSearchBar(): Observable { + return this.hasMenuSearchBarSubject.asObservable(); + } + + setHasMenuSearchBar(value: boolean) { + this.hasMenuSearchBarSubject.next(value); + } } diff --git a/deposit/searchDataprovidersToDeposit.component.ts b/deposit/searchDataprovidersToDeposit.component.ts index 5f1fd039..6269c412 100644 --- a/deposit/searchDataprovidersToDeposit.component.ts +++ b/deposit/searchDataprovidersToDeposit.component.ts @@ -29,7 +29,8 @@ import {SearchForm} from "../searchPages/searchUtils/newSearchPage.component";
      -
      +
      diff --git a/fos/fos.component.html b/fos/fos.component.html index 27479019..70b3e068 100644 --- a/fos/fos.component.html +++ b/fos/fos.component.html @@ -18,7 +18,7 @@ We have integrated a Field-of-Science (FoS) taxonomy into our dataset to organize and discover research more effectively. Using the full capabilities of the OpenAIRE Graph (full-texts, citations, references, venues) we apply AI and bring forward any multidisciplinarity potential.
      - Our work is based on the work from our partner Athena Research Center: SciNoBo : A Hierarchical Multi-Label Classifier of Scientific Publications - https://doi.org/10.1145/3487553.3524677 + Our work is based on the work from our partner Athena Research Center: SciNoBo : a novel system classifying scholarly communication in a dynamically constructed hierarchical Field-of-Science taxonomy - https://doi.org/10.3389/frma.2023.1149834
      +
      +
    • + [title]="'Share this '+openaireEntities.DATASOURCE+' in your social networks'" + [attr.uk-tooltip]="'pos: right; cls: uk-active uk-text-small uk-padding-small'"> @@ -42,20 +42,13 @@
-
+
--> -
-
- -
- -
-
+
-
+ -
+
-
- - -
- - - - - - - - - - - -
- -
- - - {{dataProviderInfo.compatibility.info}} - {{dataProviderInfo.compatibility.name}} - - - {{dataProviderInfo.compatibility.info}} - - {{dataProviderInfo.compatibility.info}} in OpenAIRE - - - - {{dataProviderInfo.compatibility.name}} - - -
-
- -
- OpenAIRE Text Mining -
-
- - -
- {{country}} -
-
-
- -
- Thematic -
-
-
- - - - - -
- +
+ +
+ +
+ +
+
+ +
+
+
+
- -
-
- - - - - - - - - - - - - - - - - - - - - - -
-
- -
-
-
-
-
- No summary information available -
-
-
- -
-
-
Description
-
-
-
- -
-
- -
    - -
- -
- -
Collected full-texts
- {{dataProviderInfo.aggregationStatus.fulltexts | number}} -
- -
Results with funding information
- {{dataProviderInfo.fundedContent | number}} -
-
- - -
-
Countries
- {{dataProviderInfo.countries.join(", ")}} -
- -
-
Jurisdiction
- {{dataProviderInfo.jurisdiction}} -
- -
-
Content policy
- {{dataProviderInfo.contentpolicy}} -
- - -
-
-
Subjects
- {{dataProviderInfo.subjects.slice(0, lessBtnSubjects ? dataProviderInfo.subjects.length : thresholdSubjects).join(", ")}} - ... -
- + +
+ +
+
+ -
-
-
- - +
+
+
+
+
+ + +
+ +
+
+
+
+
+ + + +
+ +
+
+
+
+
+
+ +
+ {{formatNumber(measure.value)}} +
+
+
+
-
- - - -
- - +
+
+ + + + + + + + + + + + + + + + + + + + + + + +
- - - -
- - -
-
- - -
- - -
-
- - -
- - -
-
- - -
- - -
-
- - -
- - -
-
- - + + + + + + + + + + + + + + + + + + + + + + -
- - -
-
- - - -
-
Statistics
- -
- - -
-
-
-
-
- - + + + + + + + + +
+
+ +
+
@@ -455,6 +325,187 @@
+ +
+ +
+ + + +
+ +
+ +
+
+ +
+ Summary + +
+
+
+ +
+ {{openaireEntities.PROJECTS}} + +
+
+
+ +
+ {{openaireEntities.DATASOURCES}} + +
+
+
+ +
+ {{openaireEntities.PUBLICATIONS}} + +
+
+
+ +
+ {{openaireEntities.DATASETS}} + +
+
+
+ +
+ {{openaireEntities.SOFTWARE}} + +
+
+
+ +
+ {{openaireEntities.OTHER}} + +
+
+
+ +
+ Related {{openaireEntities.DATASOURCES}} + +
+
+
+ +
+ Statistics + +
+
+
+
+
+
+ +
+
+ + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ @@ -468,8 +519,8 @@ -
+ [large]="true"> +
@@ -495,3 +546,324 @@ {{dataProviderInfo.subjects.join(", ")}} + + +
+
+
+
+ No summary information available +
+
+
+ +
+
+
Description
+
+
+
+ +
+
+ + + + +
+ +
Collected full-texts
+ {{dataProviderInfo.aggregationStatus.fulltexts | number}} +
+ +
Results with funding information
+ {{dataProviderInfo.fundedContent | number}} +
+
+ + +
+
Countries
+ {{dataProviderInfo.countries.join(", ")}} +
+ +
+
Jurisdiction
+ {{dataProviderInfo.jurisdiction}} +
+ +
+
Content policy
+ {{dataProviderInfo.contentpolicy}} +
+
+ + +
+
+
Subjects
+ + {{dataProviderInfo.subjects.slice(0, lessBtnSubjects ? dataProviderInfo.subjects.length : thresholdSubjects).join(", ")}} + ... + + + {{dataProviderInfo.subjects.join(", ")}} + +
+ + +
+
+
+
+
+ +
+
Detailed information @
+ + + {{provenance}} + + + {{provenance}} + + [{{i}}] + + + , + +
+
+ +
+
+
+
+
+ + +
+ + +
+
+ + +
+ + +
+
+ + +
+ + +
+
+ + +
+ + +
+
+ + +
+ + +
+
+ + +
+ + +
+
+ + +
+ + +
+
+ + +
+
Statistics
+ +
+ + +
+
+
+ + +
+ +
    + +
  • +
    +
    +
    +
    + + OpenAIRE UsageCounts + +
    + Usage by + + UsageCounts + +
    +
    + + + + + + + + + + +
    + + + {{measure.name}} + + {{formatNumber(measure.value)}} +
    +
    +
    +
    +
  • + +
  • +
    +
    + +
    +
    {{formatNumber(measure.value)}}
    +
    {{measure.name}}
    +
    +
    +
    + +
    + + +
    +
    + +
    +
    +
    +
    + Powered by + + OpenAIRE UsageCounts + +
    +
  • +
+
+
+ + + + diff --git a/landingPages/dataProvider/dataProvider.component.ts b/landingPages/dataProvider/dataProvider.component.ts index b5ed9e75..77305de6 100644 --- a/landingPages/dataProvider/dataProvider.component.ts +++ b/landingPages/dataProvider/dataProvider.component.ts @@ -1,4 +1,4 @@ -import {ChangeDetectorRef, Component, ElementRef, HostListener, Input, ViewChild} from '@angular/core'; +import {ChangeDetectorRef, Component, ElementRef, Input, ViewChild} from '@angular/core'; import {ActivatedRoute, Router} from '@angular/router'; import {Meta, Title} from '@angular/platform-browser'; @@ -25,9 +25,12 @@ import {SearchResult} from "../../utils/entities/searchResult"; import {ResultPreview} from "../../utils/result-preview/result-preview"; import {IndexInfoService} from "../../utils/indexInfo.service"; import {properties} from "../../../../environments/environment"; -import {Subscriber} from "rxjs"; -import {TabComponent} from "../../utils/tabs/tab.component"; +import {Subscriber, Subscription, zip} from "rxjs"; import {OpenaireEntities} from "../../utils/properties/searchFields"; +import {MetricsService} from '../../services/metrics.service'; +import {NumberUtils} from '../../utils/number-utils.class'; +import {LayoutService} from '../../dashboard/sharedComponents/sidebar/layout.service'; +import {FullScreenModalComponent} from '../../utils/modal/full-screen-modal/full-screen-modal.component'; declare var ResizeObserver; @@ -64,16 +67,21 @@ export class DataProviderComponent { public metricsClicked: boolean; public viewsFrameUrl: string; public downloadsFrameUrl: string; - public totalViews: number; - public totalDownloads: number; - public pageViews: number; + /** @deprecated*/ + public totalViews: number = null; + /** @deprecated*/ + public totalDownloads: number = null; + public hasViews: boolean = false; + public hasDownloads: boolean = false; + // public pageViews: number; // Statistics tab variables public statsClicked: boolean = false; // @ViewChild('statisticsModal') statisticsModal; // @ViewChild('relatedDatasourcesModal') relatedDatasourcesModal; - @ViewChild('addThisModal') addThisModal + @ViewChild('addThisModal') addThisModal; + @ViewChild('addThisFsModal') addThisFsModal: FullScreenModalComponent; // Variables for publications, research data, projects, datasources, related datasources tabs public fetchPublications: FetchResearchResults; @@ -144,9 +152,25 @@ export class DataProviderComponent { // public shouldSticky: boolean = true; subscriptions = []; + private sub: Subscription; properties: EnvProperties = properties; public openaireEntities = OpenaireEntities; + public isMobile: boolean = false; + public mobileContent: "info" | "metrics" | "actions" = "info"; + public tabMobile: string = ""; + public viewAllMobile: string = ""; + // Full screen modals for small screens (mobile) + @ViewChild('summaryFsModal') summaryFsModal: FullScreenModalComponent; + @ViewChild('projectsFsModal') projectsFsModal: FullScreenModalComponent; + @ViewChild('dataprovidersFsModal') dataprovidersFsModal: FullScreenModalComponent; + @ViewChild('publicationsFsModal') publicationsFsModal: FullScreenModalComponent; + @ViewChild('datasetsFsModal') datasetsFsModal: FullScreenModalComponent; + @ViewChild('softwareFsModal') softwareFsModal: FullScreenModalComponent; + @ViewChild('otherFsModal') otherFsModal: FullScreenModalComponent; + @ViewChild('relatedDatasourcesFsModal') relatedDatasourcesFsModal: FullScreenModalComponent; + @ViewChild('statisticsFsModal') statisticsFsModal: FullScreenModalComponent; + constructor(private _dataproviderService: DataProviderService, private _piwikService: PiwikService, private route: ActivatedRoute, @@ -160,7 +184,9 @@ export class DataProviderComponent { private helper: HelperService, private _location: Location, private indexInfoService: IndexInfoService, - private cdr: ChangeDetectorRef) { + private metricsService: MetricsService, + private cdr: ChangeDetectorRef, + private layoutService: LayoutService) { this.fetchPublications = new FetchResearchResults(this._searchResearchResultsService); this.fetchDatasets = new FetchResearchResults(this._searchResearchResultsService); this.fetchSoftware = new FetchResearchResults(this._searchResearchResultsService); @@ -171,6 +197,9 @@ export class DataProviderComponent { } ngOnInit() { + this.subscriptions.push(this.layoutService.isMobile.subscribe(isMobile => { + this.isMobile = isMobile; + })); if (typeof document !== 'undefined') { this.subscriptions.push(this.indexInfoService.getLastIndexDate(this.properties).subscribe(lastIndexUpdate => { if (lastIndexUpdate) { @@ -328,7 +357,8 @@ export class DataProviderComponent { this.subscriptions.forEach(subscription => { if (subscription instanceof Subscriber) { subscription.unsubscribe(); - } else if (subscription instanceof (ResizeObserver || IntersectionObserver)) { + } else if ((typeof ResizeObserver != 'undefined' && subscription instanceof ResizeObserver) || + (typeof IntersectionObserver != 'undefined' && subscription instanceof IntersectionObserver)) { subscription.disconnect(); } }); @@ -366,6 +396,7 @@ export class DataProviderComponent { this.seoService.createLinkForCanonicalURL(this.properties.domain +this.properties.baseLink + this._router.url); if (typeof document !== 'undefined') { this.getDataProviderAggregationStatus(this.dataProviderInfo.originalId); + // this.getCollectedFulltexts(); this.countResultsWithFundingInfo(); } else { this.aggregationStatusIsInitialized = true; @@ -381,6 +412,23 @@ export class DataProviderComponent { } this.showLoading = false; + + this.hasViews = false; + this.hasDownloads = false; + + // ensure that if the API call to index does not have metrics, we get them from old metrics service call + if(this.dataProviderInfo && !this.dataProviderInfo.measure) { + this.getMetrics(); + } else if(this.dataProviderInfo && this.dataProviderInfo.measure && this.dataProviderInfo.measure.counts) { + this.dataProviderInfo.measure.counts.forEach(measure => { + if(measure.name == "views" && measure.value > 0) { + this.hasViews = true; + } + if(measure.name == "downloads" && measure.value > 0) { + this.hasDownloads = true; + } + }); + } this.cdr.detectChanges(); // if (this.dataProviderInfo.tabs != undefined && this.dataProviderInfo.tabs.length > 0) { @@ -423,6 +471,20 @@ export class DataProviderComponent { )); } + // private getCollectedFulltexts() { + // this.subscriptions.push(this._dataproviderService.getCollectedFulltexts(this.datasourceId).subscribe( + // (data: string) => { + // this.dataProviderInfo.aggregationStatus = {"fulltexts": data}; + // this.aggregationStatusIsInitialized = true; + // }, + // err => { + // //console.log(err); + // this.aggregationStatusIsInitialized = true; + // this.handleError("Error getting "+this.getTypeName()+" collected fulltexts for id: " + this.datasourceId, err); + // } + // )); + // } + private countResultsWithFundingInfo() { this.subscriptions.push(this._searchResearchResultsService.countCollectedResultsWithFundingInfo(this.datasourceId).subscribe( fundedContent => { @@ -680,11 +742,33 @@ export class DataProviderComponent { public metricsResults($event) { this.totalViews = $event.totalViews; this.totalDownloads = $event.totalDownloads; - this.pageViews = $event.pageViews; + // this.pageViews = $event.pageViews; } + private getMetrics() { + let obs; + obs = zip(this.metricsService.getMetricsNumber(this.datasourceId, "usagestats.views.repository.local", this.properties), + this.metricsService.getMetricsNumber(this.datasourceId, "usagestats.downloads.repository.local", this.properties)); + this.sub = obs.subscribe(data => { + if((data[0] && data[0] > 0) || (data[1] && data[1] > 0)) { + this.dataProviderInfo.measure = {counts: []}; + if(data[0] && data[0] > 0) { + this.dataProviderInfo.measure.counts.push({name: 'views', order: 0, icon: 'visibility', value: data[0]}); + this.hasViews = true; + } + if(data[1] && data[1] > 0) { + this.dataProviderInfo.measure.counts.push({name: 'downloads', order: 1, icon: 'downloads', value: data[1]}); + this.hasDownloads = true; + } + this.cdr.detectChanges(); + } + }); + } + public get hasMetrics(): boolean { - return !(this.totalViews != null && this.totalDownloads != null && this.pageViews != null) || this.totalViews > 0 || this.totalDownloads > 0 || this.pageViews > 0; + // return !(this.totalViews != null && this.totalDownloads != null) || this.totalViews > 0 || this.totalDownloads > 0; + // return (this.totalViews != null && this.totalViews > 0) || (this.totalDownloads != null && this.totalDownloads > 0); + return this.dataProviderInfo.measure?.counts?.length > 0; } // public openStatistics() { @@ -715,7 +799,13 @@ export class DataProviderComponent { if(this.dataProviderInfo.organizations.length <= this.thresholdOrganizations*2) { this.lessBtnOrganizations = true; } else { - this.openOrganizationsModal(); + if(this.isMobile) { + this.summaryFsModal.title += " - Organizations"; + this.summaryFsModal.back = true; + this.viewAllMobile = "organizations"; + } else { + this.openOrganizationsModal(); + } } } @@ -731,7 +821,13 @@ export class DataProviderComponent { if(this.dataProviderInfo.subjects.length <= this.thresholdSubjects*2) { this.lessBtnSubjects = true; } else { - this.openSubjectsModal(); + if(this.isMobile) { + this.summaryFsModal.title += " - Subjects"; + this.summaryFsModal.back = true; + this.viewAllMobile = "subjects"; + } else { + this.openSubjectsModal(); + } } } @@ -795,7 +891,6 @@ export class DataProviderComponent { // ((!!this.dataProviderInfo.aggregationStatus.fulltexts && parseInt(this.dataProviderInfo.aggregationStatus.fulltexts) != -1) // || (!!this.dataProviderInfo.aggregationStatus.fundedContent && parseInt(this.dataProviderInfo.aggregationStatus.fundedContent) != -1) // || !!this.dataProviderInfo.aggregationStatus.lastUpdateDate)); - return (!!this.dataProviderInfo.aggregationStatus && ((!!this.dataProviderInfo.aggregationStatus.fulltexts && parseInt(this.dataProviderInfo.aggregationStatus.fulltexts) != -1))); } @@ -837,12 +932,56 @@ export class DataProviderComponent { return StringUtils.getEntityName(this.type, false); } + public viewAllDescriptionClicked() { + if(this.isMobile) { + this.summaryFsModal.title += " - Description"; + this.summaryFsModal.back = true; + this.viewAllMobile = "description"; + } else { + this.openDescriptionModal(); + } + } + public openDescriptionModal() { this.descriptionModal.alertFooter = false; this.descriptionModal.alertTitle = "Description"; this.descriptionModal.open(); } + public clickedUsageMetrics() { + setTimeout( () => { + this.metricsClicked = true; + }); + } + + public formatNumber(num: number | string) { + let formatted = NumberUtils.roundNumber(+num); + return formatted.number + formatted.size; + } + + public cancelSummaryClicked() { + this.summaryFsModal.title = "Summary"; + this.summaryFsModal.back = false; + this.lessBtnOrganizations = false; + this.viewAllMobile = ""; + } + + public openFsModal(fsModal: FullScreenModalComponent, title: string) { + fsModal.title = title; + fsModal.okButton = false; + fsModal.stayOpenInBack = true; + fsModal.open(); + this.tabMobile = title; + } + + public getMetricsTooltip(value: string) { + if (value == 'downloads') { + return "
OpenAIRE UsageCountsDownloads provided by UsageCounts
"; + } else if (value == 'views') { + return "
OpenAIRE UsageCountsViews provided by UsageCounts
"; + } + } + public addEoscPrevInParams(obj) { if(properties.adminToolsPortalType == "eosc" && this.prevPath) { let splitted: string[] = this.prevPath.split("?"); diff --git a/landingPages/dataProvider/dataProvider.module.ts b/landingPages/dataProvider/dataProvider.module.ts index f791ebbe..5aa044ba 100644 --- a/landingPages/dataProvider/dataProvider.module.ts +++ b/landingPages/dataProvider/dataProvider.module.ts @@ -34,6 +34,9 @@ import {IconsService} from "../../utils/icons/icons.service"; import {graph} from "../../utils/icons/icons"; import {LoadingModalModule} from "../../utils/modal/loadingModal.module"; import {ResultLandingUtilsModule} from "../landing-utils/resultLandingUtils.module"; +import {FullScreenModalModule} from '../../utils/modal/full-screen-modal/full-screen-modal.module'; +import {SafeHtmlPipeModule} from '../../utils/pipes/safeHTMLPipe.module'; +import {EntityActionsModule} from "../../utils/entity-actions/entity-actions.module"; @NgModule({ imports: @@ -42,7 +45,8 @@ import {ResultLandingUtilsModule} from "../landing-utils/resultLandingUtils.modu DataProvidersServiceModule, ProjectsServiceModule, SearchResearchResultsServiceModule, PagingModule, Schema2jsonldModule, SEOServiceModule, ShowPublisherModule, HelperModule, LandingHeaderModule, AlertModalModule, NoLoadPaging, FeedbackModule, - TabsModule, SearchTabModule, LoadingModule, IconsModule, LoadingModalModule, ResultLandingUtilsModule + TabsModule, SearchTabModule, LoadingModule, IconsModule, LoadingModalModule, ResultLandingUtilsModule, + FullScreenModalModule, SafeHtmlPipeModule, EntityActionsModule ], declarations: [StatisticsTabComponent, diff --git a/landingPages/dataProvider/dataProvider.service.ts b/landingPages/dataProvider/dataProvider.service.ts index 8973f7da..49d3e911 100644 --- a/landingPages/dataProvider/dataProvider.service.ts +++ b/landingPages/dataProvider/dataProvider.service.ts @@ -83,6 +83,11 @@ export class DataProviderService { .pipe(map(res => this.parseDataproviderAggregationStatus(res))); } + // getCollectedFulltexts(datasourceId: string) { + // return this.http.get(properties.pdfStatisticsAPIURL+"/api/stats/getNumberOfPayloadsForDatasource?datasourceId="+datasourceId) + // .pipe(map(res => res)) + // } + private handleError (error: HttpErrorResponse) { // in a real world app, we may send the error to some remote logging infrastructure // instead of just logging it to the console @@ -360,9 +365,12 @@ export class DataProviderService { this.dataProviderInfo.journal['lissn'] = data[6]['lissn']; this.dataProviderInfo.journal['eissn'] = data[6]['eissn']; - }else{ + }else { this.dataProviderInfo.journal = null; - this.dataProviderInfo.journal = {"journal": "", "issn": "", "lissn": "", "eissn": ""}; + // this.dataProviderInfo.journal = {"journal": "", "issn": "", "lissn": "", "eissn": ""}; + } + if (data[0]?.measure) { + this.dataProviderInfo.measure = this.parsingFunctions.parseMeasures(data[0].measure); } return this.dataProviderInfo; diff --git a/landingPages/landing-utils/addThis.component.ts b/landingPages/landing-utils/addThis.component.ts index fdd89ac0..fde71692 100644 --- a/landingPages/landing-utils/addThis.component.ts +++ b/landingPages/landing-utils/addThis.component.ts @@ -1,59 +1,84 @@ import { - ChangeDetectorRef, Component, - EventEmitter, - Inject, + Inject, Input, OnInit, - Output, RendererFactory2, - ViewChild, ViewEncapsulation } from '@angular/core'; import {ActivatedRoute} from '@angular/router'; import {DOCUMENT} from "@angular/common"; import {Subscriber} from "rxjs"; -interface addthis { - layers: Refresh; - init: Function; - toolbox: Function; -} - -interface Refresh { - refresh: Function; -} - -declare var addthis: addthis; +declare var a2a; @Component({ selector: 'addThis', template: ` -
-
- Do the share buttons not appear? Please make sure, any blocking addon is disabled, and then reload the page. -
+
+ + + + + + + +
+
+ Do the share buttons not appear? Please make sure, any blocking addon is disabled, and then reload the page. +
` }) export class AddThisComponent implements OnInit { - subs=[]; + subs = []; showWarning = false; - constructor(private route: ActivatedRoute, @Inject(DOCUMENT) private document, private rendererFactory: RendererFactory2) {} + @Input() url: string = null; + + constructor(private route: ActivatedRoute, @Inject(DOCUMENT) private document, private rendererFactory: RendererFactory2) { + } + public ngOnDestroy() { - for(let value of this.subs){ + for (let value of this.subs) { if (value instanceof Subscriber) { value.unsubscribe(); } else if (value instanceof Function) { value(); } } + // + // if(typeof document !== 'undefined') { + // const renderer = this.rendererFactory.createRenderer(this.document, { + // id: '-1', + // encapsulation: ViewEncapsulation.None, + // styles: [], + // data: {} + // }); + // const head = this.document.body; + // if (head === null) { + // throw new Error(' not found within DOCUMENT.'); + // } + // + // + // let script = null; + // head.childNodes.forEach(node => { + // if(node.id === "addToAnyScript") { + // // script = node; + // node.remove(); + // } + // }) + // // let script = head.nativeElement.getElementById("script"); + // // if(script) { + // // renderer.removeChild(head, script); + // // script.remove(); + // // } + // } } + ngOnInit() { this.subs.push(this.route.queryParams.subscribe(data => { this.showWarning = false; try { - if (!this.document.getElementById('addThisScript') && typeof document !== 'undefined') { - // console.log(" create script AddThis"); + if (!this.document.getElementById('addToAnyScript') && typeof document !== 'undefined') { const renderer = this.rendererFactory.createRenderer(this.document, { id: '-1', encapsulation: ViewEncapsulation.None, @@ -65,24 +90,23 @@ export class AddThisComponent implements OnInit { throw new Error(' not found within DOCUMENT.'); } const script = renderer.createElement('script'); - renderer.setAttribute(script, "id", "addThisScript"); - renderer.setAttribute(script, "src", "https://s7.addthis.com/js/300/addthis_widget.js#pubid=ra-559d24521cd8c080"); + renderer.setAttribute(script, "id", "addToAnyScript"); + renderer.setAttribute(script, "src", "https://static.addtoany.com/menu/page.js"); renderer.setAttribute(script, "type", "text/javascript"); renderer.appendChild(head, script); } if (typeof document !== 'undefined') { - if(typeof addthis !== 'undefined' && addthis.layers && addthis.layers.refresh) { - // console.log("Add This: Call Refresh") - addthis.layers.refresh(); + if(typeof a2a !== 'undefined' && this.document.getElementById('addToAny'+(this.url ? ('_'+this.url) : '')) && !this.document.getElementById('addToAny'+(this.url ? ('_'+this.url) : '')).innerText) { + a2a.init_all(); } } this.subs.push(setTimeout(() => { - if(this.document.getElementById('addThis') && !this.document.getElementById('addThis').innerText){ + if (this.document.getElementById('addToAny'+(this.url ? ('_'+this.url) : '')) && !this.document.getElementById('addToAny'+(this.url ? ('_'+this.url) : '')).innerText) { this.showWarning = true; } }, 4000)); - }catch (e) { - // console.error(e) + } catch (e) { + // console.error(e) } })); diff --git a/landingPages/landing-utils/availableOn.component.ts b/landingPages/landing-utils/availableOn.component.ts index 6c97de66..f89ef4e0 100644 --- a/landingPages/landing-utils/availableOn.component.ts +++ b/landingPages/landing-utils/availableOn.component.ts @@ -1,31 +1,60 @@ -import {Component, EventEmitter, Input, Output} from '@angular/core'; +import {Component, ElementRef, EventEmitter, Input, Output, ViewChild} from '@angular/core'; import {HostedByCollectedFrom} from "../../utils/result-preview/result-preview"; import {properties} from "../../../../environments/environment"; +import {StringUtils} from '../../utils/string-utils.class'; +import {FullScreenModalComponent} from "../../utils/modal/full-screen-modal/full-screen-modal.component"; + +declare var UIkit; import {RouterHelper} from "../../utils/routerHelper.class"; @Component({ selector: 'availableOn', template: ` -
- - - {{title}} - - - Download from - - View less - View all {{availableOn.length}} sources -
+ + + -
-
- - + +
+ +
@@ -56,36 +85,19 @@ import {RouterHelper} from "../../utils/routerHelper.class";
-
- - - - - - - - - - - - - - - - - - - - +
` }) export class AvailableOnComponent { + @Input() isMobile: boolean = false; + @Input() usedBy: "search" | "landing" = "search"; @Input() prevPath: string = ""; @Input() availableOn: HostedByCollectedFrom[]; - @Input() viewAll: boolean = false; - @Output() viewAllClicked = new EventEmitter(); - public lessBtn: boolean = false; + /** @deprecated */ + @Output() viewAllClicked = new EventEmitter(); + @ViewChild("dropElement") dropElement: ElementRef; + @ViewChild("availableListFsModal") availableListFsModal: FullScreenModalComponent; public threshold: number = 1; public dataProviderUrl = properties.searchLinkToDataProvider.split('?')[0]; public title: string = "Download from"; @@ -93,39 +105,39 @@ export class AvailableOnComponent { constructor() { } - - ngOnInit() {} - - public removeUnknown(value: string): string { - if (value.toLowerCase() === 'unknown') { - return null; - } - return value; + + ngOnInit() { } - public getKeys( map) { + public getKeys(map) { return Array.from(map.keys()); } - public viewAllClick() { - if(this.availableOn.length <= this.threshold*2) { - this.viewAll = true; - this.lessBtn = true; - } else { - this.viewAll = true; - this.viewAllClicked.emit('availableOn'); - } - } - - public viewLessClick() { - this.viewAll = false; - this.viewAllClicked.emit(""); - } - public isUrl(str: string): boolean { return str.startsWith('http://') || str.startsWith('https://') || str.startsWith('//') || str.startsWith('www.'); } + get isOpen() { + return (typeof document !== 'undefined') && this.dropElement && UIkit.drop(this.dropElement.nativeElement).isActive(); + } + + public sliceString(str: string, size: number) { + return StringUtils.sliceString(str, size) + } + + public openAvailableListFsModal() { + this.availableListFsModal.title = "Sources"; + this.availableListFsModal.okButton = false; + this.availableListFsModal.open(); + } + + public getAccessLabel(accessRight) : string { + if(accessRight) { + return (accessRight + (accessRight.toLowerCase().endsWith(" access") ? "" : " access")); + } + return "Not available access"; + } + public addEoscPrevInParams(obj) { if(properties.adminToolsPortalType == "eosc" && this.prevPath) { let splitted: string[] = this.prevPath.split("?"); diff --git a/landingPages/landing-utils/citeThis/citeThis.component.ts b/landingPages/landing-utils/citeThis/citeThis.component.ts index 20354042..457f64fc 100644 --- a/landingPages/landing-utils/citeThis/citeThis.component.ts +++ b/landingPages/landing-utils/citeThis/citeThis.component.ts @@ -13,6 +13,7 @@ import {DOCUMENT} from "@angular/common"; import {EnvProperties} from "../../../utils/properties/env-properties"; import {properties} from "../../../../../environments/environment"; import {PiwikService} from "../../../utils/piwik/piwik.service"; +import {ResultPreview} from "../../../utils/result-preview/result-preview"; declare var Cite: any; // Based on https://citation.js.org/api/tutorial-getting_started.html browser release @@ -53,7 +54,7 @@ export class CiteThisComponent implements OnInit, OnDestroy { properties:EnvProperties; public citationText: string; public citation: Citation = new Citation(); - @Input() result: ResultLandingInfo; + @Input() result: any; @Input() id: string; @Input() type: string = "article"; @Input() piwikSiteId; @@ -256,7 +257,7 @@ export class CiteThisComponent implements OnInit, OnDestroy { /** * Based on this and citeproc library https://citation.js.org/api/tutorial-plugins.html - * if the template doesn;t exist add the CSL xml and the library will produce the citation + * if the template doesn't exist add the CSL xml and the library will produce the citation * @param template */ diff --git a/landingPages/landing-utils/entity-metadata.component.less b/landingPages/landing-utils/entity-metadata.component.less new file mode 100644 index 00000000..9f8db1b5 --- /dev/null +++ b/landingPages/landing-utils/entity-metadata.component.less @@ -0,0 +1,11 @@ +@import (reference) "~src/assets/openaire-theme/less/_import-variables"; + +.entity-metadata { + + & > *:not(:last-child):not(.other-separator)::after { + content: "\2022"; + font-weight: normal; + margin-left: @global-xsmall-margin; + margin-right: @global-xsmall-margin; + } +} diff --git a/landingPages/landing-utils/entity-metadata.component.ts b/landingPages/landing-utils/entity-metadata.component.ts new file mode 100644 index 00000000..f306d388 --- /dev/null +++ b/landingPages/landing-utils/entity-metadata.component.ts @@ -0,0 +1,263 @@ +import {Component, Input} from "@angular/core"; +import {EnvProperties} from "../../utils/properties/env-properties"; +import {properties} from "../../../../environments/environment"; +import {OpenaireEntities} from "../../utils/properties/searchFields"; +import {Organization, Project} from "../../utils/result-preview/result-preview"; +import {RouterHelper} from "../../utils/routerHelper.class"; + +@Component({ + selector: 'entity-metadata', + template: ` + + `, + styleUrls: ['entity-metadata.component.less'] +}) +export class EntityMetadataComponent { + @Input() entityType: string; + @Input() types: string[]; + @Input() year: string; // search result + @Input() startDate: number; // project landing + @Input() startYear: string; // search result + @Input() endDate: number; // project landing + @Input() endYear: string; // search result + @Input() currentDate: number; // project landing + @Input() status: string; // project landing + @Input() openAccessMandatePublications: boolean // project landing + @Input() openAccessMandateDatasets: boolean // project landing + @Input() date: Date; + @Input() embargoEndDate: Date | string; + @Input() underCuration: boolean = false; + @Input() publisher; // showPublisher component + @Input() journal; // showPublisher component + @Input() countries; + @Input() languages; + @Input() programmingLanguages; + @Input() compatibilityString: string; + @Input() compatibility; // data provider landing + @Input() aggregationStatus; // data provider landing + @Input() thematic: boolean; // data provider landing + @Input() type; // data provider landing + @Input() provenanceAction: string; // search result + @Input() relationName: string; // search result + @Input() projects: Project[]; + @Input() organizations: Organization[]; + @Input() subjects: string[]; + @Input() prevPath: string = ""; + + properties: EnvProperties = properties; + public openaireEntities = OpenaireEntities; + public routerHelper: RouterHelper = new RouterHelper(); + + public removeUnknown(array: string[], type: boolean = false): string[] { + if (type) { + return this.removeDuplicates(array).filter(value => value.toLowerCase() !== 'unknown'); + } else { + return array.filter(value => value.toLowerCase() !== 'unknown'); + } + } + + public removeDuplicates(array: string[]): string[] { + return array.filter(value => value.toLowerCase() !== this.entityType); + } + + public buildCurationTooltip(): string { + let tooltipContent: string = "
"; + + tooltipContent += "
Record in preview
"; + tooltipContent += "

Bibliographic record accepted by the system, but not yet processed by
OpenAIRE tools for information quality improvement and de-duplication

"; + + tooltipContent += "
"; + return tooltipContent; + } + + get projectNames(): string[] { + if (this.projects && this.projects.length > 0) { + return this.projects.map(project => { + let value = project.funderShortname ? project.funderShortname : project.funderName; + if (project.acronym || project.title) { + value = value + ' | ' + (project.acronym ? project.acronym : + (project.title.length > 25 ? (project.title.slice(0, 25) + '...'): project.title)); + } + if(project.code) { + value = value + ' (' + project.code + ')'; + } + return value; + }); + } + return []; + } + + get organizationNames(): string[] { + if (this.organizations && this.organizations.length > 0) { + return this.organizations.map(organization => organization.name); + } + return []; + } + + public addEoscPrevInParams(obj) { + if(properties.adminToolsPortalType == "eosc" && this.prevPath) { + return this.routerHelper.addQueryParam("pv", this.prevPath, obj); + } + return obj; + } +} diff --git a/landingPages/landing-utils/fos.component.ts b/landingPages/landing-utils/fos.component.ts index 7f004327..39eaa6c5 100644 --- a/landingPages/landing-utils/fos.component.ts +++ b/landingPages/landing-utils/fos.component.ts @@ -6,45 +6,75 @@ import {StringUtils} from "../../utils/string-utils.class"; @Component({ selector: 'fos', template: ` -
Beta
-
- - - {{title}} - - {{title}} - - - View all - - - View all & feedback - - Feedback -
-
- ` }) export class FosComponent { - @Input() subjects: string[]; + @Input() subjects: {"id": string, "label": string}[]; @Input() viewAll: boolean = false; @Output() viewAllClicked = new EventEmitter(); - @Output() feedbackClicked = new EventEmitter(); + @Output() suggestClicked = new EventEmitter(); public lessBtn: boolean = false; public threshold: number = 2; public routerHelper: RouterHelper = new RouterHelper(); @@ -66,8 +96,8 @@ export class FosComponent { this.viewAllClicked.emit(""); } - public feedbackClick() { - this.feedbackClicked.emit(""); + public suggestClick() { + this.suggestClicked.emit('fos'); } public urlEncodeAndQuote(str: string): string { diff --git a/landingPages/landing-utils/fundedBy.component.ts b/landingPages/landing-utils/fundedBy.component.ts index 2938557d..4b1a7c67 100644 --- a/landingPages/landing-utils/fundedBy.component.ts +++ b/landingPages/landing-utils/fundedBy.component.ts @@ -7,72 +7,94 @@ import {RouterHelper} from "../../utils/routerHelper.class"; @Component({ selector: 'fundedBy', template: ` -
+
{{title}} - {{title}} - View less + {{title}} + View less View all + (click)="viewAllClick();" class="view-more-less-link uk-link-text">View all
-
+
- - - {{item['funderShortname'] ? item['funderShortname'] : item['funderName']}} - [no funder available] - | {{ item['acronym'] ? item['acronym'] : item['title']}} - - -
-
- Project - +
+
+ + + + +
+ +
+
+
+ + + {{item['funderShortname'] ? item['funderShortname'] : item['funderName']}} + [no funder available] + | {{ item['acronym'] ? item['acronym'] : item['title']}} + + + +
+ Project +
+ + {{item['acronym'] ? item['acronym'] : item['title']}} + + {{item['acronym'] ? item['acronym'] : item['title']}} -
- {{item.title}} -
-
-
    -
  • - Funder: - {{item.funderName ? item.funderName : item.funderShortname}} - +
    + {{item.title}} +
    +
+
    +
  • + Funder: + {{item.funderName ? item.funderName : item.funderShortname}} + ({{item.funderShortname}}) -
  • -
  • - Project Code: {{item.code}} -
  • -
  • - Funding stream: {{item.funding}} -
  • -
-
- Validated by funder - | - {{item.provenanceAction}} -
-
-
- , -
-
+ +
  • + Project Code: {{item.code}} +
  • +
  • + Funding stream: {{item.funding}} +
  • + +
    + Validated by funder + | + {{item.provenanceAction}} +
    +
    + ` }) export class FundedByComponent { + @Input() isMobile: boolean = false; @Input() prevPath: string = ""; @Input() fundedByProjects: Project[]; @Input() viewAll: boolean = false; diff --git a/landingPages/landing-utils/landing-header/landing-header.component.ts b/landingPages/landing-utils/landing-header/landing-header.component.ts index 30fedcf6..11ab1c0c 100644 --- a/landingPages/landing-utils/landing-header/landing-header.component.ts +++ b/landingPages/landing-utils/landing-header/landing-header.component.ts @@ -4,100 +4,61 @@ import {Author} from "../../../utils/result-preview/result-preview"; import {AlertModal} from "../../../utils/modal/alert"; @Component({ - selector: 'landing-header', - template: ` -
    -
    - - {{entityType}} - - - {{(entityType?' . ':'') + removeUnknown(types, true).join(' . ')}} - - - - {{' . '}} - - - {{'from '}} - - - {{'until '}} - - - {{startDate | date: 'yyyy'}} - - - {{' - '}} - - - {{endDate | date: 'yyyy'}} - - - - {{' . ' + status}} - - - {{' . ' + year}} - - - . Embargo end date: {{embargoEndDate | date: 'dd MMM yyyy'}} - - - . Under curation - -
    -
    - -
    - -
    -
    -
    - -
    -
    ` + selector: 'landing-header', + template: ` +
    +
    + +
    + +
    +
    +
    + +
    +
    + +
    +
    + ` }) export class LandingHeaderComponent { - @Input() entityType: string; - @Input() properties: EnvProperties; - @Input() types: string[]; - @Input() startDate: number; // project landing - @Input() endDate: number; // project landing - @Input() status: string; // project landing - @Input() year: string; - @Input() embargoEndDate: Date; - @Input() title: string; - @Input() subTitle: string; - @Input() authors: Author[]; - @Input() authorLimit: number = 7; - @Input() showAllAuthors: boolean = true; - @Input() underCuration: boolean = false; - @Input() modal: AlertModal; - @Input() titleClass: string = null; - @Input() isTitleH1:boolean =true; - @Input() isSticky: boolean = false; - public removeUnknown(array: string[], type: boolean = false): string[] { - if (type) { - return this.removeDuplicates(array).filter(value => value.toLowerCase() !== 'unknown'); - } else { - return array.filter(value => value.toLowerCase() !== 'unknown'); - } - } - - public removeDuplicates(array: string[]): string[] { - return array.filter(value => value.toLowerCase() !== this.entityType); - } - - public buildCurationTooltip(): string { - let tooltipContent: string = "
    "; - - tooltipContent += "
    Record in preview
    "; - tooltipContent += "

    Bibliographic record accepted by the system, but not yet processed by
    OpenAIRE tools for information quality improvement and de-duplication

    "; - - tooltipContent += "
    "; - return tooltipContent; - } + @Input() isMobile: boolean = false; + @Input() entityType: string; + @Input() properties: EnvProperties; + @Input() types: string[]; + @Input() startDate: number; // project landing + @Input() endDate: number; // project landing + @Input() currentDate: number; // project landing + @Input() status: string; // project landing + @Input() openAccessMandatePublications: boolean // project landing + @Input() openAccessMandateDatasets: boolean // project landing + @Input() date: Date; + @Input() embargoEndDate: Date; + @Input() title: string; + @Input() subTitle: string; + @Input() authors: Author[]; + @Input() authorLimit: number = 7; + @Input() showAllAuthors: boolean = true; + @Input() underCuration: boolean = false; + @Input() modal: AlertModal; + @Input() titleClass: string = null; + @Input() isSticky: boolean = false; + @Input() publisher; // showPublisher component + @Input() journal; // showPublisher component + @Input() languages; + @Input() programmingLanguages; + @Input() compatibility; // data provider landing + @Input() aggregationStatus; // data provider landing + @Input() thematic: boolean; // data provider landing + @Input() type; // data provider landing + @Input() prevPath: string = ""; } diff --git a/landingPages/landing-utils/landing-header/landing-header.module.ts b/landingPages/landing-utils/landing-header/landing-header.module.ts index d607e391..9435afa8 100644 --- a/landingPages/landing-utils/landing-header/landing-header.module.ts +++ b/landingPages/landing-utils/landing-header/landing-header.module.ts @@ -3,10 +3,14 @@ import {LandingHeaderComponent} from "./landing-header.component"; import {CommonModule} from "@angular/common"; import {LandingModule} from "../landing.module"; import {ShowAuthorsModule} from "../../../utils/authors/showAuthors.module"; +import {IconsModule} from "src/app/openaireLibrary/utils/icons/icons.module"; +import {ShowPublisherModule} from "../showPublisher.module"; +import {RouterModule} from "@angular/router"; +import {ResultLandingUtilsModule} from "../resultLandingUtils.module"; @NgModule({ - imports: [CommonModule, LandingModule, ShowAuthorsModule], + imports: [CommonModule, LandingModule, ShowAuthorsModule, IconsModule, ShowPublisherModule, RouterModule, ResultLandingUtilsModule], declarations: [LandingHeaderComponent], exports: [LandingHeaderComponent] }) -export class LandingHeaderModule {} \ No newline at end of file +export class LandingHeaderModule {} diff --git a/landingPages/landing-utils/parsingFunctions.class.ts b/landingPages/landing-utils/parsingFunctions.class.ts index ef502b3b..fd2c3b12 100644 --- a/landingPages/landing-utils/parsingFunctions.class.ts +++ b/landingPages/landing-utils/parsingFunctions.class.ts @@ -1,5 +1,5 @@ -import {HostedByCollectedFrom, Journal, Project, RelationResult} from "../../utils/result-preview/result-preview"; -import {Context, Reference} from "../../utils/entities/resultLandingInfo"; +import {HostedByCollectedFrom, Project, RelationResult} from "../../utils/result-preview/result-preview"; +import {Context, Measure, Metric, Reference} from "../../utils/entities/resultLandingInfo"; import {Injectable} from '@angular/core'; import {properties} from "../../../../environments/environment"; import {StringUtils} from "../../utils/string-utils.class"; @@ -15,18 +15,17 @@ export class ParsingFunctions { {label: 'EOSC::Twitter Data', link: 'https://' + (properties.environment != 'production'?'beta.':'') + 'search.marketplace.eosc-portal.eu/search/service?q=*&fq=tag_list:%22EOSC%5C:%5C:Twitter%20Data%22', value: 'Twitter Data'}, {label: 'EOSC::Data Cube', link: 'https://' + (properties.environment != 'production'?'beta.':'') + 'search.marketplace.eosc-portal.eu/search/service?q=*&fq=tag_list:%22EOSC%5C:%5C:Data%20Cube%22', value: 'Data Cube'} ] - public notebookInSubjects: boolean = false; private notebookKeyword: string = "eosc jupyter notebook"; private notebook_label: string = "EOSC"; private notebook_value: string = "EOSC Jupyter Notebook"; - public open = 'lock_open'; - public closed = 'lock'; - public unknown = 'question_mark'; + public open = 'open_access'; + public closed = 'closed_access'; + public unknown = 'unknown_access'; private instanceWithDoiExists: boolean = false; - + constructor() { } @@ -49,10 +48,10 @@ export class ParsingFunctions { fundedByProject['acronym'] = relation.acronym; fundedByProject['title'] = relation.title; fundedByProject['code'] = relation.code; - if(relation.validated && relation.validated.date) { + if (relation.validated && relation.validated.date) { fundedByProject['validated'] = true; } - fundedByProject['provenanceAction'] = relation.provenanceaction; + fundedByProject['provenanceAction'] = relation.provenanceaction; } else { fundedByProject['id'] = ""; fundedByProject['acronym'] = ""; @@ -156,7 +155,7 @@ export class ParsingFunctions { // publication & dataset landing : for downloadFrom addPublisherToHostedBy_collectedFrom(hostedBy_collectedFrom: HostedByCollectedFrom[], - publisher: string, journal: Journal, + publisher: string, journal: string, identifiers: Map/*, title: { "name": string, "url": string, "accessMode": string}*/) { if (!this.instanceWithDoiExists && publisher && identifiers != null && identifiers.has('doi')) { if (hostedBy_collectedFrom == null) { @@ -171,14 +170,14 @@ export class ParsingFunctions { years: [], accessRightIcon: "" }; - - if (journal && journal.journal) { + + if (journal) { available.downloadNames.push(publisher + "/ " + journal['journal']); } else { available.downloadNames.push(publisher); } - - available.downloadUrl = properties.doiURL + identifiers.get("doi")[0];; + + available.downloadUrl = properties.doiURL + identifiers.get("doi")[0]; available.accessRightIcon = this.unknown; /* if(title != undefined && title['url'] == "") { @@ -250,13 +249,13 @@ export class ParsingFunctions { mapStructure.get(key)['accessMode'].push(""); } } - + parseHostedBy_collectedFrom(hostedBy_collectedFrom: HostedByCollectedFrom[], instance: any, url: string, globalAccessRight: string) { - if(!url) { + if (!url) { return; } - + let available: HostedByCollectedFrom = { "downloadNames": [], "downloadUrl": null, @@ -278,34 +277,34 @@ export class ParsingFunctions { } } available.downloadNames = Array.from(downloadNames); - + if (available.downloadNames.length == 0) { available.downloadNames.push(url.substring(0, 30) + '...'); // substring(from, to); } } - + if (instance.hasOwnProperty("collectedfrom")) { let length = Array.isArray(instance['collectedfrom']) ? instance['collectedfrom'].length : 1; for (let i = 0; i < length; i++) { let collectedFrom = Array.isArray(instance['collectedfrom']) ? instance['collectedfrom'][i] : instance['collectedfrom']; - if(collectedFrom.name && collectedFrom.id) { + if (collectedFrom.name && collectedFrom.id) { available.collectedNamesAndIds.set(String(collectedFrom.name), collectedFrom.id); } } } - + if (instance.hasOwnProperty("instancetype")) { let types: Set = new Set(); let length = Array.isArray(instance['instancetype']) ? instance['instancetype'].length : 1; for (let i = 0; i < length; i++) { let instanceType = Array.isArray(instance['instancetype']) ? instance['instancetype'][i] : instance['instancetype']; - if(instanceType.classname && instanceType.classname.toLowerCase() !== "unknown") { + if (instanceType.classname && instanceType.classname.toLowerCase() !== "unknown") { types.add(instanceType.classname); } } available.types = Array.from(types); } - + if (instance.hasOwnProperty("dateofacceptance")) { let years: Set = new Set(); let length = Array.isArray(instance['dateofacceptance']) ? instance['dateofacceptance'].length : 1; @@ -316,17 +315,17 @@ export class ParsingFunctions { } available.years = Array.from(years); } - + available['downloadUrl'] = url; - if(url.includes("doi.org/")) { + if (url.includes("doi.org/")) { this.instanceWithDoiExists = true; } - + if (instance.hasOwnProperty("accessright")) { let length = Array.isArray(instance['accessright']) ? instance['accessright'].length : 1; for (let i = 0; i < length; i++) { let accessRight = Array.isArray(instance['accessright']) ? instance['accessright'][i] : instance['accessright']; - + if (this.changeBestAccessMode(available.accessRight, accessRight)) { available.accessRight = accessRight.classname; if (this.changeBestAccessMode(globalAccessRight, accessRight)) { @@ -334,28 +333,66 @@ export class ParsingFunctions { } } } - + } if (available.accessRight) { if (available.accessRight.toLowerCase().indexOf('open') !== -1) { available.accessRightIcon = this.open; - } else if (available.accessRight.toLowerCase().indexOf('not available') !== -1) { + } + else if (available.accessRight.toLowerCase().indexOf('not available') !== -1) { available.accessRightIcon = this.unknown; - } else { + } + else { available.accessRightIcon = this.closed; } } else { available.accessRightIcon = this.unknown; } - - if(instance.hasOwnProperty("license")) { + + if (instance.hasOwnProperty("license")) { available.license = Array.isArray(instance['license']) ? instance['license'][0] : instance['license']; } - + hostedBy_collectedFrom.push(available); } + compareHostedByCollectedFrom(a: HostedByCollectedFrom, b: HostedByCollectedFrom) { + let firstAccessRight: string = (a.accessRight ? a.accessRight.toLowerCase() : null); + let secondAccessRight: string = (b.accessRight ? b.accessRight.toLowerCase() : null); + + if (firstAccessRight === secondAccessRight) { + return 0; + } else { + if (firstAccessRight === 'open access') { + return -1; + } else if (secondAccessRight === 'open access') { + return 1; + } else if (firstAccessRight === "open source") { + return -1; + } else if (secondAccessRight === "open source") { + return 1; + } else if (firstAccessRight === "embargo") { + return -1; + } else if (secondAccessRight === "embargo") { + return 1; + } else if (firstAccessRight === "restricted") { + return -1; + } else if (secondAccessRight === "restricted") { + return 1; + } else if (firstAccessRight === "closed access") { + return -1; + } else if (secondAccessRight === "closed access") { + return 1; + } else if (firstAccessRight === "not available") { + return -1; + } else if (secondAccessRight === "not available") { + return 1; + } + } + return 0; + } + // publication & dataset landing : for downloadFrom and publishedIn changeBestAccessMode(currentAccessMode: string, accessMode: any): boolean { if (!accessMode) { @@ -404,7 +441,7 @@ export class ParsingFunctions { if (researchResults == undefined) { researchResults = []; } - + let researchResult: RelationResult = { name: "", id: "", @@ -415,10 +452,10 @@ export class ParsingFunctions { provenanceAction: provenanceAction, relationName: relationName }; - + // researchResult.relationName = relation.to.class; - - if(relation['resulttype']) { + + if (relation['resulttype']) { if (relation['resulttype'].classname == "publication") { researchResult['class'] = "publication"; } else if (relation['resulttype'].classname == "dataset") { @@ -430,10 +467,10 @@ export class ParsingFunctions { } } researchResult['id'] = relation['to'].content; - if(Array.isArray(relation['title'])) { - for(let i=0; i()); } - identifiers.get(pid.classid).push(pid.content+""); + identifiers.get(pid.classid).push(pid.content + ""); } } else { for (let i = 0; i < pid.length; i++) { @@ -489,54 +526,54 @@ export class ParsingFunctions { if (!identifiers.has(pid[i].classid)) { identifiers.set(pid[i].classid, new Array()); } - identifiers.get(pid[i].classid).push(pid[i].content+""); + identifiers.get(pid[i].classid).push(pid[i].content + ""); } } } return identifiers; } - + // publication & dataset landing : for subjects and otherSubjects and classifiedSubjects parseEoscSubjects(_subjects: any): any[] { let eoscSubjectsFound = []; let setOfEoscSubjects: Set = new Set(); - + let subject; let length = Array.isArray(_subjects) ? _subjects.length : 1; - + for (let i = 0; i < length; i++) { subject = Array.isArray(_subjects) ? _subjects[i] : _subjects; - let content: string = subject.code+""; + let content: string = subject.code + ""; let checkAndAddEoscSubjectResp = this.checkAndAddEoscSubject(setOfEoscSubjects, eoscSubjectsFound, subject, content); let found: boolean = checkAndAddEoscSubjectResp["found"]; - if(found) { + if (found) { setOfEoscSubjects = checkAndAddEoscSubjectResp["setOfEoscSubject"]; eoscSubjectsFound = checkAndAddEoscSubjectResp["eoscSubjectsFound"]; } } - + return eoscSubjectsFound; } - + // publication & dataset landing : for subjects and otherSubjects and classifiedSubjects - parseAllSubjects(_subjects: any, vocabulary: any): [string[], Map, Map, string[], string[], ] { + parseAllSubjects(_subjects: any, vocabulary: any): [string[], Map, Map, string[], string[],] { // let eoscSubjectsFound = []; let subjects: string[]; let otherSubjects: Map; let classifiedSubjects: Map; let fos: string[]; let sdg: string[]; - + let setOfEoscSubjects: Set = new Set(); - + let subject; let length = Array.isArray(_subjects) ? _subjects.length : 1; - + for (let i = 0; i < length; i++) { subject = Array.isArray(_subjects) ? _subjects[i] : _subjects; if (subject.classid != "") { if (subject.classid == "keyword") { - let content: string = subject.content+""; + let content: string = subject.content + ""; // let checkAndAddEoscSubjectResp = this.checkAndAddEoscSubject(setOfEoscSubjects, eoscSubjectsFound, subject, content); // let found: boolean = checkAndAddEoscSubjectResp["found"]; // if(found) { @@ -550,22 +587,22 @@ export class ParsingFunctions { // } } else if (!vocabulary || vocabulary[subject.classid] || subject.classid === "SDG" || subject.classid === "FOS") { // if (subject.inferred && subject.inferred == true) { - if(subject.classid === "SDG") { + if (subject.classid === "SDG") { if (sdg == undefined) { sdg = new Array(); } - sdg.push(subject.content+""); - } else if(subject.classid === "FOS") { + sdg.push(subject.content + ""); + } else if (subject.classid === "FOS") { if (fos == undefined) { fos = new Array(); } - fos.push(subject.content+""); + fos.push(subject.content + ""); } else { if (classifiedSubjects == undefined) { classifiedSubjects = new Map(); } - - let content: string = subject.content+""; + + let content: string = subject.content + ""; // let checkAndAddEoscSubjectResp = this.checkAndAddEoscSubject(setOfEoscSubjects, eoscSubjectsFound, subject, content); // let found: boolean = checkAndAddEoscSubjectResp["found"]; // if(found) { @@ -579,7 +616,7 @@ export class ParsingFunctions { // } } } else { - let content: string = subject.content+""; + let content: string = subject.content + ""; // let checkAndAddEoscSubjectResp = this.checkAndAddEoscSubject(setOfEoscSubjects, eoscSubjectsFound, subject, content); // let found: boolean = checkAndAddEoscSubjectResp["found"]; // if(found) { @@ -597,11 +634,11 @@ export class ParsingFunctions { } return [subjects, otherSubjects, classifiedSubjects, fos, sdg]; } - + checkAndAddEoscSubject(setOfEoscSubjects: Set, eoscSubjectsFound, subject, content) { let found: boolean = false; - - if(!setOfEoscSubjects.has(content)) { + + if (!setOfEoscSubjects.has(content)) { // looping through our declared array this.eoscSubjects.forEach(item => { if (content && content == item.label) { @@ -616,7 +653,7 @@ export class ParsingFunctions { parseContexts(_contexts: any): Context[] { let contexts = new Array(); - + let position = 0; let labels = ""; let context; @@ -637,10 +674,10 @@ export class ParsingFunctions { let length1 = Array.isArray(category['concept']) ? category['concept'].length : 1; for (let j = 0; j < length1; j++) { categoryConcept = Array.isArray(category['concept']) ? category['concept'][j] : category['concept']; - + // initalize if there is concept label or this is the last concept of the category and there were no concepts // otherwise we could have multiple entries for the same category but without concepts - if(categoryConcept.label || (numOfConcepts == 0 && j == (length1 - 1))) { + if (categoryConcept.label || (numOfConcepts == 0 && j == (length1 - 1))) { contexts[position] = { "labelContext": "", "idContext": "", "labelCategory": "", "idCategory": "", @@ -652,15 +689,17 @@ export class ParsingFunctions { contexts[position]['idCategory'] = category.id; contexts[position]['labelConcept'] = categoryConcept.label ? categoryConcept.label : null; contexts[position]['idConcept'] = categoryConcept.label ? categoryConcept.id : null; - + position++; numOfConcepts++; } } - } else if(category.label || (numOfCategories == 0 && z == (length2 - 1))) { - contexts[position] = {"labelContext": "", "idContext": "", - "labelCategory": "", "idCategory": "", - "labelConcept": "", "idConcept": ""}; + } else if (category.label || (numOfCategories == 0 && z == (length2 - 1))) { + contexts[position] = { + "labelContext": "", "idContext": "", + "labelCategory": "", "idCategory": "", + "labelConcept": "", "idConcept": "" + }; contexts[position]['labelContext'] = context.label; contexts[position]['idContext'] = context.id; contexts[position]['labelCategory'] = category.label ? category.label : null; @@ -672,9 +711,11 @@ export class ParsingFunctions { } } } else { - contexts[position] = {"labelContext": "", "idContext": "", - "labelCategory": "", "idCategory": "", - "labelConcept": "", "idConcept": ""}; + contexts[position] = { + "labelContext": "", "idContext": "", + "labelCategory": "", "idCategory": "", + "labelConcept": "", "idConcept": "" + }; contexts[position]['labelContext'] = context.label; contexts[position]['idContext'] = context.id; contexts[position]['labelCategory'] = null; @@ -688,11 +729,15 @@ export class ParsingFunctions { } return contexts; } - public static getEnermapsConceptId(contexts: any): string{ - let enermapsconcepts = contexts.filter(c=> {return c.idCategory == "enermaps::selection" && c.idConcept}); - return enermapsconcepts && enermapsconcepts.length > 0?enermapsconcepts[0].idConcept.split("enermaps::selection::")[1]:null; + + public static getEnermapsConceptId(contexts: any): string { + let enermapsconcepts = contexts.filter(c => { + return c.idCategory == "enermaps::selection" && c.idConcept + }); + return enermapsconcepts && enermapsconcepts.length > 0 ? enermapsconcepts[0].idConcept.split("enermaps::selection::")[1] : null; // return "hotmaps_heat_tot_curr_density" } + parseTypes(types: string[], uniqueTypes: Set, instance: any) { if (instance && instance.hasOwnProperty("instancetype") && instance['instancetype'].classname) { if (!uniqueTypes.has(instance['instancetype'].classname)) { @@ -704,7 +749,7 @@ export class ParsingFunctions { parseLanguages(_languages: any) { var languages = new Array(); - + if (!Array.isArray(_languages)) { if (_languages.classname != "Undetermined" && _languages.classname) { languages.push(_languages.classname); @@ -727,7 +772,7 @@ export class ParsingFunctions { countries.push(_countries.classname); } } else { - for (let i = 0; i < countries.length; i++) { + for (let i = 0; i < _countries.length; i++) { if (_countries[i].classname != "Undetermined" && _countries[i].classname) { countries.push(_countries[i].classname); } @@ -758,10 +803,10 @@ export class ParsingFunctions { citations = Array.isArray(citations) ? citations : [citations]; citations.forEach(citation => { let reference: Reference = {name: null, ids: []}; - if(citation.rawText) { + if (citation.rawText) { reference.name = citation.rawText; } - if(citation.id) { + if (citation.id) { let ids: any[] = Array.isArray(citation.id) ? citation.id : [citation.id]; ids.forEach(id => { reference.ids.push({ @@ -775,35 +820,123 @@ export class ParsingFunctions { }); return references; } - static parseRelCanonicalId(record, type){ - try{ - if(record["result"]["metadata"]["oaf:entity"][("oaf:"+type)]["children"] && record["result"]["metadata"]["oaf:entity"][("oaf:"+type)]["children"][type]){ - for(let child of record["result"]["metadata"]["oaf:entity"][("oaf:"+type)]["children"][type]){ + + static parseRelCanonicalId(record, type) { + try { + if (record["result"]["metadata"]["oaf:entity"][("oaf:" + type)]["children"] && record["result"]["metadata"]["oaf:entity"][("oaf:" + type)]["children"][type]) { + for (let child of record["result"]["metadata"]["oaf:entity"][("oaf:" + type)]["children"][type]) { return child["objidentifier"]; } } - }catch(e){ + } catch (e) { // console.error(e); } - return record["result"]["header"]["dri:objIdentifier"]; - + return record["result"]["header"]["dri:objIdentifier"]; + } - - parseDescription(description, stripHTML: boolean = false):string { + + parseDescription(description, stripHTML: boolean = false): string { let abstracts = []; - if(!Array.isArray(description)) { + if (!Array.isArray(description)) { abstracts = [description ? String(description) : ""]; } else { - abstracts = description.map( x => String(x)); + abstracts = description.map(x => String(x)); } - try{ - abstracts = abstracts.map( x => StringUtils.HTMLToString(x)); - } catch (e) {} - abstracts = abstracts.sort((a,b) => b.length - a.length); - if(stripHTML) { - return abstracts.join(' '); - } else { - return abstracts.length > 0 ? ('

    ' + abstracts.join('

    ') + '

    ') : abstracts.join(' '); - } + try { + abstracts = abstracts.map(x => StringUtils.HTMLToString(x)); + } catch (e) { + } + abstracts = abstracts.sort((a, b) => b.length - a.length); + if (stripHTML) { + return abstracts.join(' '); + } else { + return abstracts.length > 0 ? ('

    ' + abstracts.join('

    ') + '

    ') : abstracts.join(' '); + } + } + + parseMeasures(elements: any[]): Measure { + if (elements && elements.length) { + let bip: Metric[] = []; + let counts: Metric[] = []; + let measure: Measure = {}; + elements.forEach(element => { + if (element.id == 'views') { + counts.push({name: 'views', icon: 'visibility', value: element.count, order: 0}); + measure.views = element.count; + } + if (element.id == 'downloads') { + counts.push({name: 'downloads', icon: 'download', value: element.count, order: 1}); + measure.downloads = element.count; + } + if (element.id == 'influence_alt') { + bip.push({name: 'citations', icon: 'cite', value: element.score, order: 2}); + measure.citations = element.score; + } + if (element.id == 'popularity') { + let metric: Metric = {name: 'popularity', icon: 'fire', value: null, order: 3}; + if (element.class == 'C1') { + metric.value = 'Top 0.01%'; + } else if (element.class == 'C2') { + metric.value = 'Top 0.1%'; + } else if (element.class == 'C3') { + metric.value = 'Top 1%'; + } else if (element.class == 'C4') { + metric.value = 'Top 10%'; + } else if (element.class == 'A') { + metric.value = 'Exceptional'; + } else if (element.class == 'B') { + metric.value = 'Substantial'; + } else { + metric.value = 'Average'; + } + measure.popularity = metric.value; + bip.push(metric); + } + if (element.id == 'influence') { + let metric: Metric = {name: 'influence', icon: 'landmark', value: null, order: 4}; + if (element.class == 'C1') { + metric.value = 'Top 0.01%'; + } else if (element.class == 'C2') { + metric.value = 'Top 0.1%'; + } else if (element.class == 'C3') { + metric.value = 'Top 1%'; + } else if (element.class == 'C4') { + metric.value = 'Top 10%'; + } else if (element.class == 'A') { + metric.value = 'Exceptional'; + } else if (element.class == 'B') { + metric.value = 'Substantial'; + } else { + metric.value = 'Average'; + } + measure.influence = metric.value; + bip.push(metric); + } + if (element.id == 'impulse') { + let metric: Metric = {name: 'impulse', icon: 'rocket', value: null, order: 5}; + if (element.class == 'C1') { + metric.value = 'Top 0.01%'; + } else if (element.class == 'C2') { + metric.value = 'Top 0.1%'; + } else if (element.class == 'C3') { + metric.value = 'Top 1%'; + } else if (element.class == 'C4') { + metric.value = 'Top 10%'; + } else if (element.class == 'A') { + metric.value = 'Exceptional'; + } else if (element.class == 'B') { + metric.value = 'Substantial'; + } else { + metric.value = 'Average'; + } + measure.impulse = metric.value; + bip.push(metric); + } + }); + measure.bip = bip.sort((a, b) => a.order - b.order); + measure.counts = counts.sort((a, b) => a.order - b.order); + return measure; + } + return null; } } diff --git a/landingPages/landing-utils/relatedTo.component.ts b/landingPages/landing-utils/relatedTo.component.ts index b9c64222..06532bc1 100644 --- a/landingPages/landing-utils/relatedTo.component.ts +++ b/landingPages/landing-utils/relatedTo.component.ts @@ -13,17 +13,18 @@ import {OpenaireEntities} from "../../utils/properties/searchFields"; selector: 'relatedTo, [relatedTo]', template: ` -
    +
    {{title}} - {{title}} - View less + {{title}} + View less View all + (click)="viewAllClick();" class="view-more-less-link uk-link-text">View all
    -
    +
    {{community.labelContext}} @@ -44,6 +45,7 @@ import {OpenaireEntities} from "../../utils/properties/searchFields"; }) export class RelatedToComponent implements OnInit { + @Input() mobileView: boolean = false; @Input() contexts: Context[]; @Input() viewAll: boolean = false; @Output() viewAllClicked = new EventEmitter(); diff --git a/landingPages/landing-utils/resultLandingUtils.module.ts b/landingPages/landing-utils/resultLandingUtils.module.ts index 988991e6..ebf29782 100644 --- a/landingPages/landing-utils/resultLandingUtils.module.ts +++ b/landingPages/landing-utils/resultLandingUtils.module.ts @@ -16,23 +16,34 @@ import {FosComponent} from "./fos.component"; import {SdgComponent} from "./sdg.component"; import {IconsModule} from "../../utils/icons/icons.module"; import {AlertModalModule} from "../../utils/modal/alertModal.module"; +import { SearchInputModule } from '../../sharedComponents/search-input/search-input.module'; +import {EntityMetadataComponent} from "./entity-metadata.component"; +import {IconsService} from "../../utils/icons/icons.service"; +import {closed_access, open_access, unknown_access} from "../../utils/icons/icons"; +import {FullScreenModalModule} from "../../utils/modal/full-screen-modal/full-screen-modal.module"; @NgModule({ imports: [ - CommonModule, FormsModule, RouterModule, PagingModule, ShowPublisherModule, IconsModule, AlertModalModule + CommonModule, FormsModule, RouterModule, PagingModule, ShowPublisherModule, IconsModule, AlertModalModule, + SearchInputModule, FullScreenModalModule ], declarations: [ ShowIdentifiersComponent,ShowSubjectsComponent, FundedByComponent,AvailableOnComponent,TabTableComponent, - RelatedToComponent, FosComponent, SdgComponent + RelatedToComponent, FosComponent, SdgComponent, + EntityMetadataComponent ], providers:[ ], exports: [ ShowIdentifiersComponent, ShowSubjectsComponent, FundedByComponent,AvailableOnComponent, TabTableComponent, ShowPublisherComponent, - RelatedToComponent, FosComponent, SdgComponent + RelatedToComponent, FosComponent, SdgComponent, EntityMetadataComponent ] }) -export class ResultLandingUtilsModule { } +export class ResultLandingUtilsModule { + constructor(private iconsService: IconsService) { + this.iconsService.registerIcons([open_access, closed_access, unknown_access]); + } +} diff --git a/landingPages/landing-utils/sdg-fos-suggest/sdg-fos-suggest.component.ts b/landingPages/landing-utils/sdg-fos-suggest/sdg-fos-suggest.component.ts new file mode 100644 index 00000000..6c0d059a --- /dev/null +++ b/landingPages/landing-utils/sdg-fos-suggest/sdg-fos-suggest.component.ts @@ -0,0 +1,176 @@ +import {ChangeDetectorRef, Component, Input, ViewChild} from "@angular/core"; +import {FormBuilder, UntypedFormGroup, Validators} from "@angular/forms"; +import {SdgSelectionComponent} from "../../../sdg/sdg-selection/sdg-selection.component"; +import {FosSelectionComponent} from "../../../fos/fos-selection/fos-selection.component"; +import {properties} from "../../../../../environments/environment"; +import {EnvProperties} from "../../../utils/properties/env-properties"; +import {EmailService} from "../../../utils/email/email.service"; +import {Subscription} from "rxjs"; +import {Composer} from "../../../utils/email/composer"; +import {AlertModal} from "../../../utils/modal/alert"; +import {StringUtils} from "../../../utils/string-utils.class"; + +@Component({ + selector: 'sdg-fos-suggest', + template: ` + + + +
    +
    + +
    Thank you for your feedback.
    +
    Before sending us your options, would you like to leave us your e-mail to notify you about the reporting status?
    +
    + (Optional) +
    +
    + + +
    +
    + +

    Your feedback is successfully received and it will soon be reviewed by our graph experts!

    + +
    + +
    +
    +
    + ` +}) +export class SdgFosSuggestComponent { + @Input() entityType: string; + @Input() title; + public subjectType: "fos" | "sdg" = "sdg"; + public subjects; + public properties: EnvProperties = properties; + public selectionStep1: boolean = true; + @ViewChild("selectionModal") selectionModal: AlertModal; + @ViewChild("selection") selection: SdgSelectionComponent | FosSelectionComponent; + public form: UntypedFormGroup; + public url: string = null; + + public sending: boolean = false; + public sent: boolean = false; + public error: boolean = false; + subscriptions: Subscription[] = []; + + constructor(private emailService: EmailService, private fb: FormBuilder, private cdr: ChangeDetectorRef) {} + + ngOnInit() { + if (typeof window !== "undefined") { + this.url = window.location.href; + } + this.init(); + } + + ngOnDestroy() { + this.subscriptions.forEach(subscription => { + if (subscription instanceof Subscription) { + subscription.unsubscribe(); + } + }); + } + + init() { + this.form = this.fb.group({ + name: this.fb.control(this.title), + url: this.fb.control(this.url), + email: this.fb.control('', Validators.email), + subjects: this.fb.control([]), + recaptcha: this.fb.control('', Validators.required), + }); + } + + public openSelectionModal() { + this.sent = false; + this.sending = false; + this.error = false; + this.selectionStep1 = true; + this.init(); + + this.selectionModal.cancelButton = false; + if(this.subjectType == "sdg") { + this.selectionModal.alertTitle = "Please select SDGs that are the most relevant for this "+this.getEntityName(this.entityType)+"."; + } else { + this.selectionModal.alertTitle = "Please select Fields of Science that are the most relevant for this "+this.getEntityName(this.entityType)+"."; + } + this.selectionModal.okButtonText = "Next"; + this.selectionModal.stayOpen = true; + this.cdr.detectChanges(); + this.selectionModal.open(); + } + + public modalOutput() { + this.selectionModal.previousButton = true; + this.selectionModal.okButtonText = "Send feedback"; + + if(this.selectionStep1) { + this.selectionStep1 = false; + if(this.subjectType == "sdg") { + this.selectionModal.alertTitle = "Please send your feedback on most relevant SDGs for this "+this.getEntityName(this.entityType)+"."; + } else { + this.selectionModal.alertTitle = "Please send your feedback on most relevant Fields of Science for this "+this.getEntityName(this.entityType)+"."; + } + } else { + this.sending = true; + // email functionality + this.form.get("subjects").setValue(this.selection.getSelectedSubjects().map(subject => subject.id)); + this.subscriptions.push(this.emailService.contact(this.properties, + Composer.composeEmailForSdgsSuggestion(this.form.value, [this.properties.feedbackmail], this.subjectType), this.form.get('recaptcha').value).subscribe(sent => { + this.error = !sent; + if (sent) { + if (this.form.get('email').value !== '') { + this.subscriptions.push(this.emailService.contact(this.properties, + Composer.composeEmailForUserAfterFeedback([this.form.get('email').value])).subscribe(sent => { + if (sent) { + //console.log('An email has been sent to user ' + this.form.get('email').value); + } + })); + } + this.init(); + this.sent = true; + + this.selectionModal.alertTitle = "Thank you for your feedback"; + this.selectionModal.okButtonText = "OK"; + this.selectionModal.previousButton = false; + this.selectionModal.stayOpen = false; + } + this.sending = false; + }, error => { + console.log(error); + this.error = true; + this.sending = false; + })); + } + } + + public modalCancel() { + if(this.subjectType == "sdg") { + this.selectionModal.alertTitle = "Please select SDGs that are the most relevant for this "+this.getEntityName(this.entityType)+"."; + } else { + this.selectionModal.alertTitle = "Please select Fields of Science that are the most relevant for this "+this.getEntityName(this.entityType)+"."; + } + this.selectionStep1 = true; + this.selectionModal.previousButton = false; + this.selectionModal.okButtonText = "Next"; + this.selectionModal.stayOpen = true; + this.error = false; + } + + public handleRecaptcha(captchaResponse: string) { + this.form.get('recaptcha').setValue(captchaResponse); + } + + private getEntityName (entityType:string) { + return StringUtils.getEntityName(entityType, false); + } +} \ No newline at end of file diff --git a/landingPages/landing-utils/sdg-fos-suggest/sdg-fos-suggest.module.ts b/landingPages/landing-utils/sdg-fos-suggest/sdg-fos-suggest.module.ts new file mode 100644 index 00000000..13ddd8fc --- /dev/null +++ b/landingPages/landing-utils/sdg-fos-suggest/sdg-fos-suggest.module.ts @@ -0,0 +1,29 @@ +import {CommonModule} from "@angular/common"; +import {NgModule} from "@angular/core"; +import {FormsModule} from "@angular/forms"; +import {RecaptchaModule} from "ng-recaptcha"; +import {SdgSelectionModule} from "../../../sdg/sdg-selection/sdg-selection.module"; +import {FosSelectionModule} from "../../../fos/fos-selection/fos-selection.module"; +import {InputModule} from "../../../sharedComponents/input/input.module"; +import {SdgFosSuggestComponent} from "./sdg-fos-suggest.component"; +import {AlertModalModule} from "../../../utils/modal/alertModal.module"; +import {IconsModule} from "../../../utils/icons/icons.module"; +import {LoadingModule} from "../../../utils/loading/loading.module"; + +@NgModule({ + imports: [ + CommonModule, FormsModule, InputModule, SdgSelectionModule, FosSelectionModule, RecaptchaModule, AlertModalModule, IconsModule, LoadingModule + ], + declarations: [ + SdgFosSuggestComponent + ], + providers: [ + + ], + exports: [ + SdgFosSuggestComponent + ] +}) +export class SdgFosSuggestModule { + +} \ No newline at end of file diff --git a/landingPages/landing-utils/sdg.component.ts b/landingPages/landing-utils/sdg.component.ts index 3be35a5d..d16b40be 100644 --- a/landingPages/landing-utils/sdg.component.ts +++ b/landingPages/landing-utils/sdg.component.ts @@ -6,41 +6,68 @@ import {StringUtils} from "../../utils/string-utils.class"; @Component({ selector: 'sdg', template: ` -
    Beta
    -
    - -
    - sdg_colors -
    - +
    +
    Beta
    +
    + + + {{title}} + + + {{title}} + ({{subjects.length}}) + + + View all + + + View all & suggest + Suggest +
    + +
    +
    +
    Beta
    +
    + sdg_colors + SDGs: +
    + {{subject}} + ,   +
    + +
    +
    + + View all + + +
    -
    +
    ` }) @@ -48,9 +75,9 @@ export class SdgComponent { @Input() subjects: string[]; @Input() viewAll: boolean = false; @Output() viewAllClicked = new EventEmitter(); - @Output() feedbackClicked = new EventEmitter(); + @Output() suggestClicked = new EventEmitter(); public lessBtn: boolean = false; - public threshold: number = 4; + public threshold: number = 2; public routerHelper: RouterHelper = new RouterHelper(); public properties = properties; public title: string = "SDGs"; @@ -70,8 +97,8 @@ export class SdgComponent { this.viewAllClicked.emit(""); } - public feedbackClick() { - this.feedbackClicked.emit(""); + public suggestClick() { + this.suggestClicked.emit('sdg'); } public urlEncodeAndQuote(str: string): string { diff --git a/landingPages/landing-utils/showIdentifiers.component.ts b/landingPages/landing-utils/showIdentifiers.component.ts index 2e3dcff5..2391f877 100644 --- a/landingPages/landing-utils/showIdentifiers.component.ts +++ b/landingPages/landing-utils/showIdentifiers.component.ts @@ -47,14 +47,21 @@ import {properties} from "../../../../environments/environment"; View all
    - +
    + + +
    + +
    +
    ` }) export class ShowIdentifiersComponent implements AfterViewInit { + @Input() isMobile: boolean = false; @Input() identifiers: Map; @Input() showViewAll: boolean = false; large: Map = new Map(); @@ -121,9 +128,15 @@ export class ShowIdentifiersComponent implements AfterViewInit { } public openIdentifiersModal() { - this.identifiersModal.cancelButton = false; - this.identifiersModal.okButton = false; - this.identifiersModal.alertTitle = "Persistent Identifiers"; - this.identifiersModal.open(); + if(this.isMobile) { + this.identifiersModal.okButton = false; + this.identifiersModal.title = "Persistent Identifiers"; + this.identifiersModal.open(); + } else { + this.identifiersModal.cancelButton = false; + this.identifiersModal.okButton = false; + this.identifiersModal.alertTitle = "Persistent Identifiers"; + this.identifiersModal.open(); + } } } diff --git a/landingPages/landing-utils/showPublisher.component.ts b/landingPages/landing-utils/showPublisher.component.ts index 55d96ffe..004c146a 100644 --- a/landingPages/landing-utils/showPublisher.component.ts +++ b/landingPages/landing-utils/showPublisher.component.ts @@ -4,77 +4,74 @@ import {EnvProperties} from "../../utils/properties/env-properties"; @Component({ selector: 'showPublisher, [showPublisher]', template: ` -
    - - Published: - {{publishDate | date: 'dd MMM yyyy' : 'UTC'}} - - - Journal: - {{journal['journal']}} - , - - - volume - {{journal['volume'] | number}} - {{journal['volume']}} - - , - - - - issue - {{journal['issue'] | number}} - {{journal['issue']}} - - , - - - {{(journal['start_page'] && journal['end_page']) ? 'pages' : 'page'}} - - {{journal['start_page'] | number}} - {{journal['start_page']}} - - - - - {{journal['end_page'] | number}} - {{journal['end_page']}} - - - ( - - issn: {{journal['issn']}} - , - - - eissn: {{journal['eissn']}} - , - - - lissn: {{journal['lissn']}} - , - - - - - Copyright policy - - - ) - -
    -
    - Publisher: {{publisher}} -
    + + + + {{journal['journal']}} + , + + + volume + {{journal['volume'] | number}} + {{journal['volume']}} + + , + + + + issue + {{journal['issue'] | number}} + {{journal['issue']}} + + , + + + {{(journal['start_page'] && journal['end_page']) ? 'pages' : 'page'}} + + {{journal['start_page'] | number}} + {{journal['start_page']}} + + - + + {{journal['end_page'] | number}} + {{journal['end_page']}} + + + ( + + issn: {{journal['issn']}} + , + + + eissn: {{journal['eissn']}} + , + + + lissn: {{journal['lissn']}} + , + + + + + Copyright policy + + + ) + + + + + + {{publisher}} + ` }) export class ShowPublisherComponent { - @Input() publishDate: Date; @Input() publisher; @Input() journal; //@Input() sherpaUrl = 'http://www.sherpa.ac.uk/romeo/search.php?issn='; diff --git a/landingPages/landing-utils/showPublisher.module.ts b/landingPages/landing-utils/showPublisher.module.ts index 3da1cc5c..8a8d0549 100644 --- a/landingPages/landing-utils/showPublisher.module.ts +++ b/landingPages/landing-utils/showPublisher.module.ts @@ -1,10 +1,11 @@ import {NgModule} from '@angular/core'; import {CommonModule} from '@angular/common'; import {ShowPublisherComponent} from "./showPublisher.component"; +import {IconsModule} from '../../utils/icons/icons.module'; @NgModule({ imports: [ - CommonModule + CommonModule, IconsModule ], declarations: [ ShowPublisherComponent diff --git a/landingPages/landing-utils/showSubjects.component.ts b/landingPages/landing-utils/showSubjects.component.ts index 2eab7611..31767075 100644 --- a/landingPages/landing-utils/showSubjects.component.ts +++ b/landingPages/landing-utils/showSubjects.component.ts @@ -1,9 +1,9 @@ import { ChangeDetectorRef, Component, - ElementRef, + ElementRef, EventEmitter, HostListener, - Input, + Input, Output, QueryList, ViewChild, ViewChildren @@ -13,24 +13,24 @@ import {properties} from "../../../../environments/environment"; @Component({ selector: 'showSubjects', template: ` - -
    + +
    Subjects by Vocabulary
    - + -
    - View all + - -
    - Subjects + +
    + Keywords
    - -
    - View all + + @@ -49,7 +49,7 @@ import {properties} from "../../../../environments/environment";
    - +
    @@ -94,7 +94,7 @@ import {properties} from "../../../../environments/environment";
    - +
    @@ -104,12 +104,16 @@ import {properties} from "../../../../environments/environment"; }) export class ShowSubjectsComponent { + @Input() isMobile: boolean = false; @Input() subjects: string[]; @Input() otherSubjects: Map; @Input() classifiedSubjects: Map; @Input() eoscSubjects: any[]; isLarge: boolean = false; isClassifiedLarge: boolean = false; + @Input() viewAllSubjects: boolean = false; + @Input() viewAllClassifiedSubjects: boolean = false; + @Output() viewAllClicked = new EventEmitter(); properties = properties; specialSubjects = []; @ViewChildren("content", { read: ElementRef }) content: QueryList; @@ -206,4 +210,28 @@ export class ShowSubjectsComponent { this.subjectsByVocabularyModal.alertTitle = "Subjects by Vocabulary"; this.subjectsByVocabularyModal.open(); } + + public viewAllSubjectsClicked() { + if(this.isMobile) { + this.viewAllSubjects = true; + this.viewAllClicked.emit({ + subtitle: 'Keywords', + id: 'subjects' + }); + } else { + this.openSubjectsModal(); + } + } + + public viewAllSubjectsByVocabularyClicked() { + if(this.isMobile) { + this.viewAllClassifiedSubjects = true; + this.viewAllClicked.emit({ + subtitle: 'Subjects by Vocabulary', + id: 'classifiedSubjects' + }); + } else { + this.openSubjectsByVocabularyModal(); + } + } } diff --git a/landingPages/landing-utils/showTitle.component.ts b/landingPages/landing-utils/showTitle.component.ts index 09e0dab2..584d7fcd 100644 --- a/landingPages/landing-utils/showTitle.component.ts +++ b/landingPages/landing-utils/showTitle.component.ts @@ -1,52 +1,56 @@ -import {Component, Input} from '@angular/core'; -import {ActivatedRoute} from '@angular/router'; +import {Component, ElementRef, Input, ViewChild} from '@angular/core'; @Component({ - selector: 'showTitle', - template: ` -

    - -

    - -
    - - - - - [no title available] - - - - - - [no title available] - -
    -
    - -
    -
    - No title available -
    -
    - ` + selector: 'showTitle', + template: ` +

    + +

    - }) + +
    + + + + + [no title available] + + + + + + [no title available] + +
    +
    + +
    +
    + No title available +
    +
    + ` +}) export class ShowTitleComponent { @Input() titleName: string; @Input() title: { [key: string]: string }; @Input() iconClass:string; @Input() classNames: string = ""; + @Input() isSticky: boolean = false; + @ViewChild("titleDiv") titleDiv: ElementRef; constructor () {} + get showTitleTooltip():boolean { + return !!this.titleDiv && (this.titleDiv.nativeElement.clientHeight >= 5 * 21); + } } diff --git a/landingPages/organization/deletedByInference/deletedByInference.component.ts b/landingPages/organization/deletedByInference/deletedByInference.component.ts index b2b6ecc6..9502348c 100644 --- a/landingPages/organization/deletedByInference/deletedByInference.component.ts +++ b/landingPages/organization/deletedByInference/deletedByInference.component.ts @@ -27,7 +27,7 @@ import {HelperFunctions} from "../../../utils/HelperFunctions.class";
    • + [isCard]="false" [prevPath]="prevPath" [isDeletedByInferenceModal]="true">
    -
    + +
    +
    +
    --> + -
    -
    - -
    - -
    -
    +
    - -
    + +
    -
    - - -
    - - - - -
    -
    - - - +
    + +
    + +
    + +
    +
    + + +
    + - -
    -
    - - - - - - - - - - - - - - - - - -
    -
    - -
    -
    - - -
    -
    - - -
    -
    - - -
    -
    - - -
    -
    - - -
    -
    - - -
    -
    -
    - -
    - - - - -
    +
    +
    + +
    + + +
    + + + + +
    + + +
    + + + + + + + + +
    + + + +
    + Country: {{organizationInfo.country}} +
    +
    +
    + +
    +
    + + + + + + + + + + + + + + + + + +
    +
    + +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    +
    + +
    + + + +
    +
    +
    @@ -240,6 +274,114 @@
    + +
    + +
    + + +
    +
    + +
    + Funding / {{openaireEntities.PROJECTS}} + +
    +
    +
    + +
    + {{openaireEntities.DATASOURCES}} + +
    +
    +
    + +
    + {{openaireEntities.PUBLICATIONS}} + +
    +
    +
    + +
    + {{openaireEntities.DATASETS}} + +
    +
    +
    + +
    + {{openaireEntities.SOFTWARE}} + +
    +
    +
    + +
    + {{openaireEntities.OTHER}} + +
    +
    +
    +
    +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    +
    + + +
    +
    + @@ -259,96 +401,180 @@
    -
    -
    - Content report -
    -
      -
    • - -
    • -
    • - -
    • -
    • - -
    • -
    • - -
    • -
    • - -
    • -
    -
    - No reports available -
    -
    -
    -
    - Funder report -
    -
    -
    -
    -
    -
      -
    • - -
    • -
    • - -
    • -
    -
    -
    -
    - No reports available -
    -
    +
    - + + + + +
    +
    + Content report +
    +
      +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    +
    + No reports available +
    +
    +
    +
    + Funder report +
    +
    +
    +
    +
    +
      +
    • + +
    • +
    • + +
    • +
    +
    +
    +
    + No reports available +
    +
    +
    + + + + + + + + + + + + + + + + +
    +
    Do you wish to download a CSV file? Note that this process may take a while.
    +
    + + +
    +
    +
    + +
    There was an error in csv downloading. Please try again later.
    +
    + + +
    + + +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    diff --git a/landingPages/organization/organization.component.ts b/landingPages/organization/organization.component.ts index 75c242b4..5cd600ac 100644 --- a/landingPages/organization/organization.component.ts +++ b/landingPages/organization/organization.component.ts @@ -26,6 +26,8 @@ import {Subscriber} from "rxjs"; import {properties} from "../../../../environments/environment"; import {OpenaireEntities} from '../../utils/properties/searchFields'; import {Option} from '../../sharedComponents/input/input.component'; +import {LayoutService} from '../../dashboard/sharedComponents/sidebar/layout.service'; +import {FullScreenModalComponent} from "../../utils/modal/full-screen-modal/full-screen-modal.component"; declare var ResizeObserver; @@ -71,17 +73,23 @@ export class OrganizationComponent { // Active tab variable for responsiveness public activeTab: string = ""; - - @ViewChild('downloadReportsModal') downloadReportsModal; + @ViewChild('fsModal') fsModal: FullScreenModalComponent; + + @ViewChild('downloadReportsModal') downloadReportsModal; + @ViewChild('downloadReportsFsModal') downloadReportsFsModal: FullScreenModalComponent; // @ViewChild('downloadReportModal') downloadReportModal; // @ViewChild('downloadFunderReportModal') downloadFunderReportModal; @ViewChild('addThisModal') addThisModal; + @ViewChild('addThisFsModal') addThisFsModal: FullScreenModalComponent; @ViewChild(ModalLoading) loading: ModalLoading; // Alert box when CSV: Project Publications for a funder is requested @ViewChild('AlertModalApplyAll') alertApplyAll; + @ViewChild('AlertFsModalApplyAll') alertFsApplyAll; + // Alert box when something is wrong with CSV requests @ViewChild('AlertModalCsvError') alertCsvError; + @ViewChild('AlertFsModalCsvError') alertFsCsvError; public routerHelper: RouterHelper = new RouterHelper(); public errorCodes: ErrorCodes = new ErrorCodes(); @@ -121,10 +129,13 @@ export class OrganizationComponent { public feedbackFields: string [] = ['Name', 'Country', 'Other']; @ViewChild('AlertModalDeletedByInference') alertModalDeletedByInference; + @ViewChild('AlertModalDeletedByInferenceFS') alertModalDeletedByInferenceFS; // @ViewChild('projectsModal') projectsModal; public deleteByInferenceOpened: boolean = false; - + public isMobile: boolean = false; + public mobileContent: "info" | "actions" = "info"; + public viewAllMobile: string = ""; constructor(private element: ElementRef, private _organizationService: OrganizationService, @@ -141,7 +152,8 @@ export class OrganizationComponent { private seoService: SEOService, private _location: Location, private indexInfoService: IndexInfoService, - private cdr: ChangeDetectorRef) { + private cdr: ChangeDetectorRef, + private layoutService: LayoutService) { this.fetchProjects = new FetchProjects(this._searchProjectsService); this.fetchDataproviders = new FetchDataproviders(this._searchDataprovidersService); this.fetchPublications = new FetchResearchResults(this._searchResearchResultsService); @@ -151,19 +163,21 @@ export class OrganizationComponent { } ngOnInit() { - - this.properties = properties; - if (typeof document !== 'undefined') { - this.subscriptions.push(this.indexInfoService.getLastIndexDate(this.properties).subscribe(lastIndexUpdate => { - if (lastIndexUpdate) { - this.indexUpdateDate = new Date(lastIndexUpdate); - } - })); - } - //this.getDivContents(); - this.getPageContents(); - this.updateUrl(this.properties.domain + this.properties.baseLink + this._router.url); - this.seoService.createLinkForCanonicalURL(this.properties.domain +this.properties.baseLink + this._router.url); + this.subscriptions.push(this.layoutService.isMobile.subscribe(isMobile => { + this.isMobile = isMobile; + })); + this.properties = properties; + if (typeof document !== 'undefined') { + this.subscriptions.push(this.indexInfoService.getLastIndexDate(this.properties).subscribe(lastIndexUpdate => { + if (lastIndexUpdate) { + this.indexUpdateDate = new Date(lastIndexUpdate); + } + })); + } + //this.getDivContents(); + this.getPageContents(); + this.updateUrl(this.properties.domain + this.properties.baseLink + this._router.url); + this.seoService.createLinkForCanonicalURL(this.properties.domain +this.properties.baseLink + this._router.url); this.subscriptions.push(this.route.queryParams.subscribe(params => { this.organizationInfo = null; @@ -266,7 +280,8 @@ export class OrganizationComponent { this.subscriptions.forEach(subscription => { if (subscription instanceof Subscriber) { subscription.unsubscribe(); - } else if (subscription instanceof (ResizeObserver || IntersectionObserver)) { + } else if ((typeof ResizeObserver != 'undefined' && subscription instanceof ResizeObserver) || + (typeof IntersectionObserver != 'undefined' && subscription instanceof IntersectionObserver)) { subscription.disconnect(); } }); @@ -628,13 +643,19 @@ export class OrganizationComponent { } public confirmOpenApplyAll(contentType: string, contentFileName: string) { - this.alertApplyAll.cancelButton = true; - this.alertApplyAll.okButton = true; - this.alertApplyAll.alertTitle = "CSV FILE"; - this.alertApplyAll.message = "Do you wish to download a CSV file? Note that this process may take a while."; - this.alertApplyAll.okButtonText = "Yes"; - this.alertApplyAll.cancelButtonText = "No"; - this.alertApplyAll.open(); + if(this.isMobile) { + this.alertFsApplyAll.title = "CSV FILE"; + this.alertFsApplyAll.okButton = false; + this.alertFsApplyAll.open(); + } else { + this.alertApplyAll.cancelButton = true; + this.alertApplyAll.okButton = true; + this.alertApplyAll.alertTitle = "CSV FILE"; + this.alertApplyAll.message = "Do you wish to download a CSV file? Note that this process may take a while."; + this.alertApplyAll.okButtonText = "Yes"; + this.alertApplyAll.cancelButtonText = "No"; + this.alertApplyAll.open(); + } this.funderId = this.funder.id; this.funderCount = this.funder.number; this.funderContentType = contentType; @@ -646,12 +667,19 @@ export class OrganizationComponent { } public confirmOpenCsvError() { - this.alertCsvError.cancelButton = false; - this.alertCsvError.okButton = true; - this.alertCsvError.alertTitle = "ERROR DOWNLOADING CSV FILE"; - this.alertCsvError.message = "There was an error in csv downloading. Please try again later."; - this.alertCsvError.okButtonText = "OK"; - this.alertCsvError.open(); + if(this.isMobile) { + this.alertFsCsvError.okButton = true; + this.alertFsCsvError.okButtonText = "OK"; + this.alertFsCsvError.title = "ERROR DOWNLOADING CSV FILE"; + this.alertFsCsvError.open(); + } else { + this.alertCsvError.cancelButton = false; + this.alertCsvError.okButton = true; + this.alertCsvError.alertTitle = "ERROR DOWNLOADING CSV FILE"; + this.alertCsvError.message = "There was an error in csv downloading. Please try again later."; + this.alertCsvError.okButtonText = "OK"; + this.alertCsvError.open(); + } } encodeURI(input: string): string { @@ -686,7 +714,7 @@ export class OrganizationComponent { } openDownloadReportsModal() { - this.funder = this.fetchProjects.funders[0]; + // this.funder = this.fetchProjects.funders[0]; this.downloadReportsModal.cancelButton = false; this.downloadReportsModal.okButton = false; this.downloadReportsModal.alertTitle = "Download"; @@ -808,7 +836,7 @@ export class OrganizationComponent { for(let funder of this.fetchProjects.funders) { this.funderOptions.push({"label": funder.name, "value": funder}); } - this.funder = this.funderOptions[0]; + this.funder = this.funderOptions[0].value; } } @@ -816,11 +844,18 @@ export class OrganizationComponent { HelperFunctions.scroll(); } + public openFsModal(fsModal: FullScreenModalComponent, title: string) { + fsModal.title = title; + fsModal.okButton = false; + fsModal.stayOpenInBack = true; + fsModal.open(); + } + public get eoscBackLink() { - if(this.prevPath && this.referrer && ((this.referrer == "https://eosc-search-service.grid.cyfronet.pl/") || (this.referrer == "https://beta.search.marketplace.eosc-portal.eu/") || (this.referrer == "https://search.marketplace.eosc-portal.eu/"))) { - return this.referrer+this.prevPath; + if (this.prevPath && this.referrer && ((this.referrer == "https://eosc-search-service.grid.cyfronet.pl/") || (this.referrer == "https://beta.search.marketplace.eosc-portal.eu/") || (this.referrer == "https://search.marketplace.eosc-portal.eu/"))) { + return this.referrer + this.prevPath; } else { - return "https://"+(this.properties.environment == "beta" ? "beta." : "")+"search.marketplace.eosc-portal.eu/"; + return "https://" + (this.properties.environment == "beta" ? "beta." : "") + "search.marketplace.eosc-portal.eu/"; } } } diff --git a/landingPages/organization/organization.module.ts b/landingPages/organization/organization.module.ts index dea59de7..a367d897 100644 --- a/landingPages/organization/organization.module.ts +++ b/landingPages/organization/organization.module.ts @@ -30,7 +30,10 @@ import {LoadingModule} from '../../utils/loading/loading.module'; import {IconsModule} from '../../utils/icons/icons.module'; import {InputModule} from '../../sharedComponents/input/input.module'; import {IconsService} from '../../utils/icons/icons.service'; -import {graph} from "../../utils/icons/icons"; +import {graph, versions} from "../../utils/icons/icons"; +import {FullScreenModalModule} from "../../utils/modal/full-screen-modal/full-screen-modal.module"; +import {EGIDataTransferModule} from "../../utils/dataTransfer/transferData.module"; +import {EntityActionsModule} from "../../utils/entity-actions/entity-actions.module"; @NgModule({ @@ -48,7 +51,7 @@ import {graph} from "../../utils/icons/icons"; Schema2jsonldModule, SEOServiceModule, HelperModule, OrganizationsDeletedByInferenceModule, LandingHeaderModule, FeedbackModule, MatSelectModule, - TabsModule, SearchTabModule, LoadingModule, IconsModule, InputModule + TabsModule, SearchTabModule, LoadingModule, IconsModule, InputModule, FullScreenModalModule, EGIDataTransferModule, EntityActionsModule ], declarations: [ OrganizationComponent, @@ -60,6 +63,6 @@ import {graph} from "../../utils/icons/icons"; }) export class OrganizationModule { constructor(private iconsService: IconsService) { - this.iconsService.registerIcons([graph]); + this.iconsService.registerIcons([graph, versions]); } } diff --git a/landingPages/project/project.component.html b/landingPages/project/project.component.html index d5134ff0..daaa617c 100644 --- a/landingPages/project/project.component.html +++ b/landingPages/project/project.component.html @@ -1,5 +1,6 @@ -
    -
    + +
    +
    --> -
    -
    - -
    - -
    -
    +
    -
    + -
    +
    -
    - -
    - - - - - +
    - - - -
    - +
    + +
    + +
    +
    + +
    +
    +
    +
    - - Open Access mandate for {{openaireEntities.PUBLICATIONS}} and {{openaireEntities.DATASETS}} - -
    - - -
    - - Open Access mandate for {{openaireEntities.PUBLICATIONS}} - -
    -
    - -
    - - Open Access mandate for {{openaireEntities.DATASETS}} - -
    -
    - -
    - - {{projectInfo.funding.funderName}} - -
    -
    - - - - - -
    -
    -
    -
    - - Funder: - {{projectInfo.funding.funderName}} - - - Project code: - {{projectInfo.funding.code}} - - - Call for proposal: - {{projectInfo.funding.callIdentifier}} - -
    -
    - - Funded under: - {{projectInfo.funding.fundingStream}} - - - Overall Budget: - {{projectInfo.funding.budget | number}} - {{projectInfo.funding.currency}} - - - Funder Contribution: - {{projectInfo.funding.contribution | number}} - {{projectInfo.funding.currency}} - -
    -
    -
    - - Status: - {{projectInfo.status}} - -
    -
    - - -
    - - {{projectInfo.startDate | date: 'dd MMM yyyy'}} (Started) - - - {{projectInfo.endDate | date: 'dd MMM yyyy'}} - (Ended) - (Ending) - -
    -
    - -
    -
    Open Access mandate
    -
    - - {{openaireEntities.PUBLICATIONS}}: - No - - - {{openaireEntities.DATASETS}}: - No -
    -
    +
    - -
    -
    - - - - - - - - - - - - -
    -
    - -
    -
    -
    -
    -
    -
    -
    - No summary information available +
    + +
    + +
    +
    +
    + + + + + + + + + + + +
    +
    +
    + + Funder: + {{projectInfo.funding.funderName}} + + + Project code: + {{projectInfo.funding.code}} + + + Call for proposal: + {{projectInfo.funding.callIdentifier}} + +
    +
    + + Funded under: + {{projectInfo.funding.fundingStream}} + + + Overall Budget: + {{projectInfo.funding.budget | number}} + {{projectInfo.funding.currency}} + + + Funder Contribution: + {{projectInfo.funding.contribution | number}} + {{projectInfo.funding.currency}} +
    -
    - -
    -
    -
    Description
    -
    -
    + + + +
    +
    Open Access mandate
    +
    + + {{openaireEntities.PUBLICATIONS}}: + No + + + {{openaireEntities.DATASETS}}: + No + +
    +
    +
    +
    +
    +
    +
    +
    +
    + + +
    + +
    +
    +
    +
    +
    + + + +
    + +
    +
    +
    - +
    +
    + +
    + {{formatNumber(measure.value)}} +
    +
    -
    -
    - -
    Partners
    -
    - - -
    - View less -
    -
    -
    +
    + Metrics badge
    - - -
    - - + +
    +
    + + + + + + + + + + + + + +
    - - - -
    - - -
    -
    - -
    - - -
    -
    - -
    - - -
    -
    - - - - -
    -
    Statistics
    - -
    -
    -
    -
    Produced - {{openaireEntities.RESULTS}} per year -
    - -
    -
    -
    -
    -
    Access mode of - {{openaireEntities.RESULTS}} -
    - -
    -
    -
    -
    -
    - {{openaireEntities.RESULTS}} per datasource -
    - -
    -
    -
    -
    -
    -
    - -
    - - +
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + +
    +
    +
    @@ -506,6 +441,183 @@
    + +
    + +
    + + +
    +
    + +
    + Summary + +
    +
    +
    + +
    + {{openaireEntities.PUBLICATIONS}} + +
    +
    +
    + +
    + {{openaireEntities.DATASETS}} + +
    +
    +
    + +
    + {{openaireEntities.SOFTWARE}} + +
    +
    +
    + +
    + {{openaireEntities.OTHER}} + +
    +
    +
    + +
    + DMPs + +
    +
    +
    + +
    + Statistics + +
    +
    +
    +
    +
    +
    + +
    +
    + + +
    +
    + + + + + Deposit + + +
    +
    + + +
    +
    + + +
    +
    + + + + + Link to + + +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + @@ -518,51 +630,11 @@ -
    -
    -
    -
    -
    {{getDynamicContent(embed_research_results_type)}}
    - -
    - -
    - For further information contact us at - {{properties.helpdeskEmail}} -
    -
    -
    +
    -
    -
    -
    -
    - - -
    - -
    - No reports available -
    -
    -
    +
    -
    + [large]="true"> +
    @@ -612,3 +684,306 @@ ... + + +
    +
    +
    +
    +
    +
    + No summary information available +
    +
    +
    + +
    +
    +
    Description
    +
    +
    +
    + +
    +
    +
    +
    +
    + +
    Partners
    + +
    +
    +
    +
    +
    +
    +
    + + +
    + + +
    +
    + + +
    + + +
    +
    + + +
    + + +
    +
    + + +
    + + +
    +
    + + + + + + +
    +
    Statistics
    + +
    +
    +
    +
    Produced + {{openaireEntities.RESULTS}} per year +
    + +
    +
    +
    +
    +
    Access mode of + {{openaireEntities.RESULTS}} +
    + +
    +
    +
    +
    +
    + {{openaireEntities.RESULTS}} per datasource +
    + +
    +
    +
    +
    +
    + + +
    + +
      + +
    • +
      +
      +
      +
      + + OpenAIRE UsageCounts + +
      + Usage by + + UsageCounts + +
      +
      + + + + + + + + + + +
      + + + {{measure.name}} + + {{formatNumber(measure.value)}} +
      +
      +
      +
      +
    • + +
    • +
      +
      + +
      +
      {{formatNumber(measure.value)}}
      +
      {{measure.name}}
      +
      +
      +
      + +
      + + +
      +
      + +
      +
      +
      +
      + Powered by + + OpenAIRE UsageCounts + +
      +
    • +
    +
    +
    + + + + + + + + + + + + + + +
    +
    +
    +
    +
    {{getDynamicContent(embed_research_results_type)}}
    + +
    + +
    + For further information contact us at + {{properties.helpdeskEmail}} +
    +
    +
    +
    + + +
    +
    +
    +
    + + +
    + +
    + No reports available +
    +
    +
    +
    diff --git a/landingPages/project/project.component.ts b/landingPages/project/project.component.ts index a992f455..00774cd7 100644 --- a/landingPages/project/project.component.ts +++ b/landingPages/project/project.component.ts @@ -1,4 +1,4 @@ -import {ChangeDetectorRef, Component, ElementRef, HostListener, Input, ViewChild} from '@angular/core'; +import {ChangeDetectorRef, Component, ElementRef, Input, ViewChild} from '@angular/core'; import {ActivatedRoute, Router} from '@angular/router'; import {Meta, Title} from '@angular/platform-browser'; @@ -25,10 +25,14 @@ import {StringUtils} from "../../utils/string-utils.class"; import {ResultPreview} from "../../utils/result-preview/result-preview"; import {SearchResult} from "../../utils/entities/searchResult"; import {IndexInfoService} from "../../utils/indexInfo.service"; -import {Subscriber} from "rxjs"; +import {Subscriber, Subscription, zip} from "rxjs"; import {properties} from "../../../../environments/environment"; import {Option} from "../../sharedComponents/input/input.component"; import {OpenaireEntities} from "../../utils/properties/searchFields"; +import {MetricsService} from '../../services/metrics.service'; +import {NumberUtils} from '../../utils/number-utils.class'; +import {LayoutService} from '../../dashboard/sharedComponents/sidebar/layout.service'; +import {FullScreenModalComponent} from '../../utils/modal/full-screen-modal/full-screen-modal.component'; declare var ResizeObserver; @@ -51,9 +55,13 @@ export class ProjectComponent { public metricsClicked: boolean; public viewsFrameUrl: string; public downloadsFrameUrl: string; - public totalViews: number; - public totalDownloads: number; - public pageViews: number; + /** @deprecated*/ + public totalViews: number = null; + /** @deprecated*/ + public totalDownloads: number = null; + public hasViews: boolean = false; + public hasDownloads: boolean = false; + // public pageViews: number; // Statistics tab variables public statsClicked: boolean; @@ -86,8 +94,11 @@ export class ProjectComponent { // @ViewChild('statisticsModal') statisticsModal; // @ViewChild('linkProjectModal') linkProjectModal; @ViewChild('embedResultsModal') embedResultsModal; + @ViewChild('embedResultsFsModal') embedResultsFsModal: FullScreenModalComponent; @ViewChild('downloadReportModal') downloadReportModal; - @ViewChild('addThisModal') addThisModal + @ViewChild('downloadReportFsModal') downloadReportFsModal: FullScreenModalComponent; + @ViewChild('addThisModal') addThisModal; + @ViewChild('addThisFsModal') addThisFsModal: FullScreenModalComponent; // Request results for publications, research data and software only the one time (first time tab is clicked) private reloadPublications: boolean = true; @@ -163,9 +174,23 @@ export class ProjectComponent { // public shouldSticky: boolean = true; subscriptions = []; + private sub: Subscription; properties: EnvProperties; public openaireEntities = OpenaireEntities; + public isMobile: boolean = false; + public mobileContent: "info" | "metrics" | "actions" = "info"; + public tabMobile: string = ""; + public viewAllMobile: string = ""; + // Full screen modals for small screens (mobile) + @ViewChild('summaryFsModal') summaryFsModal: FullScreenModalComponent; + @ViewChild('publicationsFsModal') publicationsFsModal: FullScreenModalComponent; + @ViewChild('datasetsFsModal') datasetsFsModal: FullScreenModalComponent; + @ViewChild('softwareFsModal') softwareFsModal: FullScreenModalComponent; + @ViewChild('otherFsModal') otherFsModal: FullScreenModalComponent; + @ViewChild('dmpsFsModal') dmpsFsModal: FullScreenModalComponent; + @ViewChild('statisticsFsModal') statisticsFsModal: FullScreenModalComponent; + constructor(private route: ActivatedRoute, private _router: Router, private _location: Location, @@ -179,24 +204,26 @@ export class ProjectComponent { private _reportsService: ReportsService, private htmlService: HtmlProjectReportService, private indexInfoService: IndexInfoService, - private cdr: ChangeDetectorRef) {} + private metricsService: MetricsService, + private cdr: ChangeDetectorRef, + private layoutService: LayoutService) {} ngOnInit() { - - this.properties = properties; - if (typeof document !== 'undefined') { - this.subscriptions.push(this.indexInfoService.getLastIndexDate(this.properties).subscribe(lastIndexUpdate => { - if (lastIndexUpdate) { - this.indexUpdateDate = new Date(lastIndexUpdate); - } - })); - } - //this.getDivContents(); - this.getPageContents(); - this.updateUrl(this.properties.domain + this.properties.baseLink + this._router.url); - this.seoService.createLinkForCanonicalURL(this.properties.domain +this.properties.baseLink + this._router.url); - - + this.subscriptions.push(this.layoutService.isMobile.subscribe(isMobile => { + this.isMobile = isMobile; + })); + this.properties = properties; + if (typeof document !== 'undefined') { + this.subscriptions.push(this.indexInfoService.getLastIndexDate(this.properties).subscribe(lastIndexUpdate => { + if (lastIndexUpdate) { + this.indexUpdateDate = new Date(lastIndexUpdate); + } + })); + } + //this.getDivContents(); + this.getPageContents(); + this.updateUrl(this.properties.domain + this.properties.baseLink + this._router.url); + this.seoService.createLinkForCanonicalURL(this.properties.domain +this.properties.baseLink + this._router.url); this.subscriptions.push(this.route.queryParams.subscribe(params => { this.stickyHeader = false; this.metricsClicked = false; @@ -353,7 +380,8 @@ export class ProjectComponent { this.subscriptions.forEach(subscription => { if (subscription instanceof Subscriber) { subscription.unsubscribe(); - } else if (subscription instanceof (ResizeObserver || IntersectionObserver)) { + } else if ((typeof ResizeObserver != 'undefined' && subscription instanceof ResizeObserver) || + (typeof IntersectionObserver != 'undefined' && subscription instanceof IntersectionObserver)) { subscription.disconnect(); } }); @@ -510,6 +538,23 @@ export class ProjectComponent { startDate: this.projectInfo.startDate, endDate: this.projectInfo.endDate }; + + this.hasViews = false; + this.hasDownloads = false; + + // ensure that if the API call to index does not have metrics, we get them from old metrics service call + if(this.projectInfo && !this.projectInfo.measure) { + this.getMetrics(); + } else if(this.projectInfo && this.projectInfo.measure && this.projectInfo.measure.counts) { + this.projectInfo.measure.counts.forEach(measure => { + if(measure.name == "views" && measure.value > 0) { + this.hasViews = true; + } + if(measure.name == "downloads" && measure.value > 0) { + this.hasDownloads = true; + } + }) + } //old // this.viewsFrameUrl = this.properties.framesAPIURL + 'merge.php?com=query&data=[{"query":"projRepoViews","projTitle":"' + this.projectId + '","table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":"","color":"","type":"chart","size":200,"sort":"xaxis","xStyle":{"r":-30,"s":"6","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"","yaxisheaders":["Monthly views"],"generalxaxis":"","theme":0,"in":[]}]&info_types=["column"]&stacking=&steps=false&fontFamily=Courier&spacing=[5,0,0,0]&style=[{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"000000","size":""},{"color":"000000","size":""}]&backgroundColor=rgba(255,255,255,1)&colors[]=rgba(124, 181, 236, 1)&colors[]=rgba(67, 67, 72, 1)&colors[]=rgba(144, 237, 125, 1)&colors[]=rgba(247, 163, 92, 1)&colors[]=rgba(128, 133, 233, 1)&colors[]=rgba(241, 92, 128, 1)&colors[]=rgba(228, 211, 84, 1)&colors[]=rgba(43, 144, 143, 1)&colors[]=rgba(244, 91, 91, 1)&colors[]=rgba(145, 232, 225, 1)&xlinew=0&ylinew=1&legends=true&tooltips=true&persistent=false'; // @@ -567,11 +612,35 @@ export class ProjectComponent { public metricsResults($event) { this.totalViews = $event.totalViews; this.totalDownloads = $event.totalDownloads; - this.pageViews = $event.pageViews; + // this.pageViews = $event.pageViews; } + private getMetrics() { + let obs; + obs = zip(this.metricsService.getMetricsNumber(this.projectId, "usagestats.projects.views", this.properties), + this.metricsService.getMetricsNumber(this.projectId, "usagestats.projects.downloads", this.properties)); + this.sub = obs.subscribe(data => { + if((data[0] && data[0] > 0) || (data[1] && data[1] > 0)) { + this.projectInfo.measure = {counts: []}; + if(data[0] && data[0] > 0) { + this.projectInfo.measure.counts.push({name: 'views', order: 0, icon: 'visibility', value: data[0]}); + this.hasViews = true; + } + if(data[1] && data[1] > 0) { + this.projectInfo.measure.counts.push({name: 'downloads', order: 1, icon: 'downloads', value: data[1]}); + this.hasDownloads = true; + } + + this.cdr.detectChanges(); + } + // this.totalViews = data[0]; + // this.totalDownloads = data[1]; + }); + } + public get hasMetrics(): boolean { - return !(this.totalViews != null && this.totalDownloads != null && this.pageViews != null) || this.totalViews > 0 || this.totalDownloads > 0||this.pageViews > 0; + // return !(this.totalViews != null && this.totalDownloads != null) || this.totalViews > 0 || this.totalDownloads > 0; + return this.projectInfo.measure?.counts?.length > 0; } public viewAllOrganizationsClick() { @@ -583,6 +652,13 @@ export class ProjectComponent { } } + public viewAllOrganizationsMobileClicked() { + this.summaryFsModal.title += " - Partners"; + this.summaryFsModal.back = true; + this.lessBtnOrganizations = true; + this.viewAllMobile = "organizations"; + } + public openOrganizationsModal() { this.organizationsModal.cancelButton = false; this.organizationsModal.okButton = false; @@ -971,12 +1047,56 @@ export class ProjectComponent { ]; } + public viewAllDescriptionClicked() { + if(this.isMobile) { + this.summaryFsModal.title += " - Description"; + this.summaryFsModal.back = true; + this.viewAllMobile = "description"; + } else { + this.openDescriptionModal(); + } + } + public openDescriptionModal() { this.descriptionModal.alertFooter = false; this.descriptionModal.alertTitle = "Description"; this.descriptionModal.open(); } + public clickedUsageMetrics() { + setTimeout( () => { + this.metricsClicked = true; + }); + } + + public formatNumber(num: number | string) { + let formatted = NumberUtils.roundNumber(+num); + return formatted.number + formatted.size; + } + + public cancelSummaryClicked() { + this.summaryFsModal.title = "Summary"; + this.summaryFsModal.back = false; + this.lessBtnOrganizations = false; + this.viewAllMobile = ""; + } + + public openFsModal(fsModal: FullScreenModalComponent, title: string) { + fsModal.title = title; + fsModal.okButton = false; + fsModal.stayOpenInBack = true; + fsModal.open(); + this.tabMobile = title; + } + + public getMetricsTooltip(value: string) { + if (value == 'downloads') { + return "
    OpenAIRE UsageCountsDownloads provided by UsageCounts
    "; + } else if (value == 'views') { + return "
    OpenAIRE UsageCountsViews provided by UsageCounts
    "; + } + } + public addEoscPrevInParams(obj) { if(properties.adminToolsPortalType == "eosc" && this.prevPath) { let splitted: string[] = this.prevPath.split("?"); diff --git a/landingPages/project/project.module.ts b/landingPages/project/project.module.ts index 496a07af..a85a3a9c 100644 --- a/landingPages/project/project.module.ts +++ b/landingPages/project/project.module.ts @@ -3,7 +3,7 @@ import {NgModule} from '@angular/core'; import {CommonModule} from '@angular/common'; import {FormsModule} from '@angular/forms'; import {RouterModule} from '@angular/router'; -import { MatSelectModule } from "@angular/material/select"; +import {MatSelectModule} from "@angular/material/select"; import {ProjectComponent} from './project.component'; import {ProjectServiceModule} from './projectService.module'; @@ -31,7 +31,11 @@ import {LoadingModule} from "../../utils/loading/loading.module"; import {IconsModule} from "../../utils/icons/icons.module"; import {InputModule} from "../../sharedComponents/input/input.module"; import {IconsService} from "../../utils/icons/icons.service"; -import {graph, link} from "../../utils/icons/icons"; +import {graph, link, link_to, open_access} from "../../utils/icons/icons"; +import {FullScreenModalModule} from '../../utils/modal/full-screen-modal/full-screen-modal.module'; +import {SafeHtmlPipeModule} from '../../utils/pipes/safeHTMLPipe.module'; +import {EGIDataTransferModule} from "../../utils/dataTransfer/transferData.module"; +import {EntityActionsModule} from "../../utils/entity-actions/entity-actions.module"; @NgModule({ imports: [ @@ -41,7 +45,8 @@ import {graph, link} from "../../utils/icons/icons"; SearchResearchResultsServiceModule, ProjectServiceModule, Schema2jsonldModule, SEOServiceModule, HelperModule, LandingHeaderModule, MatSelectModule, FeedbackModule, AltMetricsModule, - TabsModule, SearchTabModule, LoadingModule, IconsModule, InputModule + TabsModule, SearchTabModule, LoadingModule, IconsModule, InputModule, + FullScreenModalModule, SafeHtmlPipeModule, EGIDataTransferModule, EntityActionsModule ], declarations: [ ProjectComponent @@ -55,6 +60,6 @@ import {graph, link} from "../../utils/icons/icons"; }) export class ProjectModule { constructor(private iconsService: IconsService) { - this.iconsService.registerIcons([link, graph]) + this.iconsService.registerIcons([link, graph, link_to, open_access]) } } diff --git a/landingPages/project/project.service.ts b/landingPages/project/project.service.ts index 17084a51..f1224980 100644 --- a/landingPages/project/project.service.ts +++ b/landingPages/project/project.service.ts @@ -236,6 +236,10 @@ export class ProjectService { this.projectInfo.urlInfo = "Detailed project information (CORDIS)"; } + if (data[0]?.measure) { + this.projectInfo.measure = this.parsingFunctions.parseMeasures(data[0].measure); + } + return this.projectInfo; } diff --git a/landingPages/result/deletedByInference/deletedByInference.component.ts b/landingPages/result/deletedByInference/deletedByInference.component.ts index 608de6e4..69a47dab 100644 --- a/landingPages/result/deletedByInference/deletedByInference.component.ts +++ b/landingPages/result/deletedByInference/deletedByInference.component.ts @@ -24,10 +24,11 @@ import {HelperFunctions} from "../../../utils/HelperFunctions.class"; [page]="page" [pageSize]="pageSize" [totalResults]="results.length"> -
      +
      • + [showOrcid]="false" [isCard]="false" [prevPath]="prevPath" [showInline]="true" + [isDeletedByInferenceModal]="true">
      -
      + +
      +
      --> -
      -
      - -
      - -
      -
      +
      -
      + -
      +
      -
      - - - -
      - - +
      - -
      - - - - - - - -
      - - -
      -
      - -
      -
      - - - - - - View all {{resultLandingInfo.deletedByInferenceIds.length}} versions - - - - - -
      - -
      - {{resultLandingInfo.accessMode}} - +
      + +
      + +
      +
      + +
      +
      +
      +
      + +
      + + +
      + + +
      +
      + +
      +
      - - - -
      - {{language}} -
      -
      -
      - - -
      - {{programmingLanguage}} -
      -
      -
      -
      -
      - -
      - -
      - -
      - -
      - - {{(resultLandingInfo.countries.length === 1) ? 'Country: ' : 'Countries: '}} - - {{resultLandingInfo.countries.join(", ")}}
      - -
      -
      - + +
      + + + +
      + + + + +
      + + + + + + + +
      + + +
      +
      + +
      +
      + + + + [date]="resultLandingInfo.dateofacceptance" [embargoEndDate]="resultLandingInfo.embargoEndDate" + [publisher]="resultLandingInfo.publisher" [journal]="resultLandingInfo.journal" + [languages]="resultLandingInfo.languages" [programmingLanguages]="resultLandingInfo.programmingLanguages" + [prevPath]="prevPath"> - - - - - - - - - - - - + + + +
      + +
      + +
      + + + +
      -
      - -
      - -
      -
      -
      - No summary information available -
      -
      -
      - -
      -
      -
      Abstract
      -
      -
      -
      - -
      -
      -
      - - -
      - -
      -
      Related {{openaireEntities.ORGANIZATIONS}}
      - - -
      - View less -
      -
      -
      + +
      +
      + + + + + + + + + + + + + + + + + +
      - - -
      - - -
      -

      - {{item.name}} - - - [{{getReferenceIdName(id)}} - OpenAIRE] - - -

      +
      + +
      + + + + + + + + + + + - - -
      - - - - - -
      - - -
      - - -
      -
      - {{keyIn}} -
      - - {{keyIn}} - -
      -
      -
      + + +
      +
      - - -
      - - -
      -
      - Enermaps tool preview - + + +
      +
      -
        - -
      • - {{detail[0]}}: - - - {{word}} - {{word}} - - -
      • -
        -
      -
      - -
      -
      - - -
      + + + + +
      +
      + +
      +
      +
      + [class.uk-animation-right]="viewAll">
      @@ -434,15 +357,15 @@
      - + class="uk-offcanvas-switcher uk-flex uk-flex-center uk-flex-middle uk-hidden@m" + (click)="rightSidebarOffcanvasClicked = true;"> +
      @@ -452,30 +375,90 @@ -
      - -
      -
      - Compatible EOSC Services -
      - -
      - eosc_logo -
      -
      - {{subject.value}} + +
      +
      +
      +
      +
      + + +
      + +
      +
      +
      + + +
      + +
      +
      +
      +
      +
      + + + + + + + + + + +
      +
      + + + +
      + {{formatNumber(measure.value)}} +
      +
      + +
      + {{measure.value}} +
      +
      +
      +
      + + +
      + {{formatNumber(measure.value)}} +
      +
      +
      +
      + Metrics badge +
      +
      +
      +
      + +
      +
      - +
      - +
      @@ -483,14 +466,15 @@ [prevPath]="prevPath">
      -
      +
      + (viewAllClicked)="viewAll=$event" (noCommunities)="noCommunities = true">
      -
      - -
      +
      @@ -500,9 +484,280 @@ [properties]="properties" [entityType]="getTypeName()" [fields]="feedbackFields" [(showForm)]="showFeedback" [preSelectedField]="feedbackPreSelectedField">
      + + +
      + +
      +
      + + {{getAccessLabel(resultLandingInfo.hostedBy_collectedFrom[0].accessRight)}} +
      + + +
      + +
      + +
      + +
      + +
      + +
      + +
      +
      +
      +
      + +
      + Summary + +
      +
      +
      + +
      + Subjects + +
      +
      +
      + +
      + References + +
      +
      +
      + +
      + Related Research + +
      +
      +
      + +
      + External Databases + +
      +
      +
      + +
      + Compatible EOSC Services + +
      +
      + +
      + Funded by + +
      +
      +
      + +
      + Related to Research Communities + +
      +
      +
      + +
      + Enermaps Tool + +
      +
      +
      +
      +
      +
      + +
      +
      + + +
      +
      + + +
      +
      + + +
      +
      + + +
      +
      + + +
      +
      + + + + + Link to + + +
      +
      + +
      + + + + + + + + + + + + + + + + + + +
      + +
      +
      + + +
      + +
      +
      + + + + + + + + + + + + + + + + + + + + +
      + +
      +
      + + + + + + + + + + + + + + + +
      +
      + + #AlertModalDeletedByInference large="true"> - + @@ -538,9 +792,23 @@ - -
      + +
      +
      + + + + + + + + +
      + +
      @@ -561,9 +829,9 @@ class="uk-margin-bottom">
      {{header}}
      + input type="select" placeholder="Filter by relation" inputClass="flat x-small" + [options]="relatedClassFilters" [(value)]="relatedClassSelected" + (valueChange)="relatedClassChanged()">
      • - @@ -586,3 +854,384 @@
      + + +
      +
      +
      + No summary information available +
      +
      +
      + +
      +
      +
      Abstract
      +
      +
      +
      + +
      +
      +
      +
      + {{(resultLandingInfo.countries.length === 1) ? 'Country ' : 'Countries '}} +
      +
      + {{resultLandingInfo.countries.join(", ")}} +
      +
      + +
      +
      Related {{openaireEntities.ORGANIZATIONS}}
      + + +
      + View less +
      +
      +
      +
      +
      + + +
      + + +
      +
      + + +
      + + +
      +

      + {{item.name}} + + + [{{getReferenceIdName(id)}} + OpenAIRE] + + +

      +
      + + +
      +
      + + + + +
      + + +
      +
      + {{keyIn}} +
      + + {{keyIn}} + +
      +
      +
      +
      + + +
      + + +
      + Compatible EOSC Services +
      + +
      + eosc_logo + +
      +
      + + +
      + Enermaps tool preview + +
      +
        + +
      • + {{detail[0]}}: + + + {{word}} + {{word}} + + +
      • +
        +
      +
      + + +
      + +
        + +
      • +
        +
        +
        +
        +
        + + BIP! + +
        + Impact by + + BIP! + +
        +
        + + + + + + + + + + +
        + + + {{measure.name}} + + + {{isNumber(measure.value) ? formatNumber(measure.value) : measure.value}} +
        +
        +
        +
        +
        + +
        +
        +
        +
        +
        + + OpenAIRE UsageCounts + +
        + Usage by + + UsageCounts + +
        +
        + + + + + + + + + + +
        + + + {{measure.name}} + + {{formatNumber(measure.value)}} +
        +
        +
        +
        +
        +
      • + +
      • +
        +
        + + + + + + + + + + +
        + + + {{measure.name}} + + + {{isNumber(measure.value) ? formatNumber(measure.value) : measure.value}} +
        +
        +
        + +
        +
        +
        + Powered by + + BIP! + BIP! + +
        +
      • + +
      • + +
      • + +
      • +
        +
        + +
        +
        {{formatNumber(measure.value)}}
        +
        {{measure.name}}
        +
        +
        +
        + +
        + + +
        +
        + +
        +
        +
        +
        + Powered by + + OpenAIRE UsageCounts + +
        +
      • +
      +
      +
      + + +
      +
      +
      +
      +
      + + + + + + + + + + + + + + + diff --git a/landingPages/result/resultLanding.component.ts b/landingPages/result/resultLanding.component.ts index 1df4c97d..f7624597 100644 --- a/landingPages/result/resultLanding.component.ts +++ b/landingPages/result/resultLanding.component.ts @@ -1,4 +1,4 @@ -import {ChangeDetectorRef, Component, ElementRef, EventEmitter, HostListener, Input, Output, ViewChild} from '@angular/core'; +import {ChangeDetectorRef, Component, ElementRef, Input, ViewChild} from '@angular/core'; import {ActivatedRoute, Router} from '@angular/router'; import {Meta, Title} from '@angular/platform-browser'; @@ -18,13 +18,16 @@ import {IndexInfoService} from "../../utils/indexInfo.service"; import {Identifier, StringUtils} from "../../utils/string-utils.class"; import {properties} from "../../../../environments/environment"; import {ISVocabulariesService} from "../../utils/staticAutoComplete/ISVocabularies.service"; -import {forkJoin, Observable, Subscription, zip} from "rxjs"; -import {AnnotationComponent} from "../annotation/annotation.component"; +import {Subscription} from "rxjs"; import {ParsingFunctions} from "../landing-utils/parsingFunctions.class"; import {ConnectHelper} from "../../connect/connectHelper"; import {UserManagementService} from "../../services/user-management.service"; import {OpenaireEntities} from "../../utils/properties/searchFields"; import {Option} from "../../sharedComponents/input/input.component"; +import {NumberUtils} from '../../utils/number-utils.class'; +import {FullScreenModalComponent} from "../../utils/modal/full-screen-modal/full-screen-modal.component"; +import {SdgFosSuggestComponent} from '../landing-utils/sdg-fos-suggest/sdg-fos-suggest.component'; +import {LayoutService} from "../../dashboard/sharedComponents/sidebar/layout.service"; declare var ResizeObserver; @@ -42,8 +45,11 @@ export class ResultLandingComponent { enermapsId; // @ViewChild('linkModal') linkModal; @ViewChild('citeModal') citeModal; + @ViewChild('citeFsModal') citeFsModal; @ViewChild('addThisModal') addThisModal; + @ViewChild('addThisFsModal') addThisFsModal; @ViewChild('AlertModalDeletedByInference') alertModalDeletedByInference; + @ViewChild('AlertModalDeletedByInferenceFS') alertModalDeletedByInferenceFS; // @ViewChild('relationModal') relationModal; public deleteByInferenceOpened: boolean = false; @Input() public resultFromInput: boolean = false; @@ -72,9 +78,14 @@ export class ResultLandingComponent { public hasAltMetrics: boolean = false; public viewsFrameUrl: string; public downloadsFrameUrl: string; + /** @deprecated*/ public totalViews: number = null; + /** @deprecated*/ public totalDownloads: number = null; + public hasViews: boolean = false; + public hasDownloads: boolean = false; public pageViews: number = null; + public bipFrameUrl: string; // Custom tab paging variables public referencesPage: number = 1; @@ -114,7 +125,7 @@ export class ResultLandingComponent { 'Title', 'Authors', 'Access rights', 'Publisher information', 'Funding Information', 'Persistent identifiers', 'Sustainable Development Goals (SDGs)', - 'Fields of Science and Technology (FOS)', 'Other']; + 'Fields of Science (FoS)', 'Other']; public pidsArrayString: string = ""; public identifier: Identifier; @@ -142,7 +153,26 @@ export class ResultLandingComponent { // public shouldSticky: boolean = true; + public mobileContent: "info" | "metrics" | "actions" = "info"; + public tabMobile: string = ""; + public viewAllMobile: string = ""; public viewAll: string = ""; + @ViewChild("sdgFosSuggest") sdgFosSuggest: SdgFosSuggestComponent; + + public isMobile: boolean = false; + // Full screen modals for small screens (mobile) + @ViewChild('summaryFsModal') summaryFsModal: FullScreenModalComponent; + @ViewChild('subjectsFsModal') subjectsFsModal: FullScreenModalComponent; + @ViewChild('referencesFsModal') referencesFsModal: FullScreenModalComponent; + @ViewChild('relatedResearchFsModal') relatedResearchFsModal: FullScreenModalComponent; + @ViewChild('bioentitiesFsModal') bioentitiesFsModal: FullScreenModalComponent; + @ViewChild('compatibleEOSCFsModal') compatibleEOSCFsModal: FullScreenModalComponent; + @ViewChild('fundedByFsModal') fundedByFsModal: FullScreenModalComponent; + @ViewChild('relatedCommunitiesFsModal') relatedCommunitiesFsModal: FullScreenModalComponent; + @ViewChild('enermapsToolFsModal') enermapsToolFsModal: FullScreenModalComponent; + @ViewChild('sdgsFsModal') sdgsFsModal: FullScreenModalComponent; + @ViewChild('fosFsModal') fosFsModal: FullScreenModalComponent; + public noCommunities: boolean = false; public rightSidebarOffcanvasClicked: boolean = false; @@ -161,10 +191,14 @@ export class ResultLandingComponent { private cdr: ChangeDetectorRef, private _location: Location, private indexInfoService: IndexInfoService, - private userManagementService: UserManagementService) { + private userManagementService: UserManagementService, + private layoutService: LayoutService) { } ngOnInit() { + this.subscriptions.push(this.layoutService.isMobile.subscribe(isMobile => { + this.isMobile = isMobile; + })); this.subscriptions.push(this.userManagementService.getUserInfo().subscribe(user => { this.isLoggedIn = !!user; }, error => { this.isLoggedIn = false} )); @@ -347,7 +381,8 @@ export class ResultLandingComponent { subscription.unsubscribe(); } else if (subscription instanceof Function) { subscription(); - } else if (subscription instanceof (ResizeObserver || IntersectionObserver)) { + } else if ((typeof ResizeObserver != 'undefined' && subscription instanceof ResizeObserver) || + (typeof IntersectionObserver != 'undefined' && subscription instanceof IntersectionObserver)) { subscription.disconnect(); } }); @@ -470,6 +505,7 @@ export class ResultLandingComponent { this.viewsFrameUrl = this.properties.statisticsFrameNewAPIURL + 'chart?json=' + encodeURIComponent('{"library":"HighCharts","chartDescription":{"queries":[{"name":"Monthly views","type":"column","query":{"name":"usagestats.results.views.monthly", "parameters":["' + this.id + '"], "profile":"OpenAIRE All-inclusive" }}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":"Monthly views"},"subtitle":{},"yAxis":{"title":{"text":""}},"xAxis":{"title":{}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":false},"plotOptions":{"series":{"dataLabels":{"enabled":false}}},"legend":{"enabled":false},"credits":{"href":null,"enabled":true,"text":""}}}'); this.downloadsFrameUrl = this.properties.statisticsFrameNewAPIURL + 'chart?json=' + encodeURIComponent('{"library":"HighCharts","chartDescription":{"queries":[{"name":"Monthly downloads","type":"column","query":{"name":"usagestats.results.downloads.monthly", "parameters":["' + this.id + '"], "profile":"OpenAIRE All-inclusive" }}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":"Monthly downloads"},"subtitle":{},"yAxis":{"title":{"text":""}},"xAxis":{"title":{}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":false},"plotOptions":{"series":{"dataLabels":{"enabled":false}}},"legend":{"enabled":false},"credits":{"href":null,"enabled":true,"text":""}}}'); + this.bipFrameUrl = this.properties.bipFrameAPIURL + this.id + (properties.environment == "beta" ? "&src=beta" : ""); let pid:Identifier = Identifier.getPIDFromIdentifiers(this.resultLandingInfo.identifiers); if (this.type == "result") { // no type was specified - update URL based this.resultLandingInfo.resultType this.updateUrlWithType(pid); @@ -515,7 +551,7 @@ export class ResultLandingComponent { this.enermapsId = ParsingFunctions.getEnermapsConceptId(this.resultLandingInfo.contexts); } - + this.relatedClassFilters = [{"label": "All relations", "value": ""}]; if(this.resultLandingInfo.relatedClassFilters.size > 1) { for (let relClass of this.resultLandingInfo.relatedClassFilters) { this.relatedClassFilters.push({"label": HelperFunctions.getVocabularyLabel(relClass, this.relationsVocabulary), "value": relClass}); @@ -526,6 +562,19 @@ export class ResultLandingComponent { this.relatedClassSelected = ""; this.filteredRelatedResults = this.resultLandingInfo.relatedResults; + this.hasViews = false; + this.hasDownloads = false; + if(this.resultLandingInfo.measure && this.resultLandingInfo.measure.counts) { + this.resultLandingInfo.measure.counts.forEach(measure => { + if(measure.name == "views" && measure.value > 0) { + this.hasViews = true; + } + if(measure.name == "downloads" && measure.value > 0) { + this.hasDownloads = true; + } + }) + } + this.showLoading = false; this.setActiveTab(); @@ -555,14 +604,12 @@ export class ResultLandingComponent { public get hasPrimaryInfo(): boolean { return !!this.resultLandingInfo && ( (!!this.resultLandingInfo.description && this.resultLandingInfo.description.length > 0) - || !!this.resultLandingInfo.subjects - || (this.resultLandingInfo.classifiedSubjects && this.resultLandingInfo.classifiedSubjects.size > 0) || (!!this.resultLandingInfo.organizations && this.resultLandingInfo.organizations.length > 0)); } public get hasRightSidebarInfo(): boolean { return (this.resultLandingInfo.eoscSubjects && this.resultLandingInfo.eoscSubjects.length - && (properties.adminToolsPortalType == 'explore' || properties.adminToolsPortalType == 'eosc')) + && properties.adminToolsPortalType == 'eosc') || (this.resultLandingInfo.sdg && this.resultLandingInfo.sdg.length > 0) || @@ -571,8 +618,10 @@ export class ResultLandingComponent { (this.resultLandingInfo.fundedByProjects && this.resultLandingInfo.fundedByProjects.length > 0) || (this.resultLandingInfo.contexts && this.resultLandingInfo.contexts.length > 0 && !this.noCommunities) - || - (this.resultLandingInfo.hostedBy_collectedFrom && this.resultLandingInfo.hostedBy_collectedFrom.length > 0); + || + (this.resultLandingInfo.measure && Object.keys(this.resultLandingInfo.measure).length > 0); + // || + // (this.resultLandingInfo.hostedBy_collectedFrom && this.resultLandingInfo.hostedBy_collectedFrom.length > 0); } public get metricsCalculated(): boolean { @@ -903,6 +952,32 @@ export class ResultLandingComponent { } } + public viewAllSubjectsMobileClicked(event) { + this.subjectsFsModal.title += " - "+event['subtitle']; + this.subjectsFsModal.back = true; + this.viewAllMobile = event['id']; + } + + public viewAllOrganizationsMobileClicked() { + this.summaryFsModal.title += " - Related "+this.openaireEntities.ORGANIZATIONS; + this.summaryFsModal.back = true; + this.lessBtnOrganizations = true; + this.viewAllMobile = "organizations"; + } + + public cancelSummaryClicked() { + this.summaryFsModal.title = "Summary"; + this.summaryFsModal.back = false; + this.lessBtnOrganizations = false; + this.viewAllMobile = ""; + } + + public cancelSubjectsClicked() { + this.subjectsFsModal.title = "Subjects"; + this.subjectsFsModal.back = false; + this.viewAllMobile = ""; + } + public openOrganizationsModal() { this.organizationsModal.cancelButton = false; this.organizationsModal.okButton = false; @@ -917,12 +992,145 @@ export class ResultLandingComponent { this.viewAll = ""; } + public sdgsFsModalCancelled() { + if(this.viewAllMobile == "sdg") { + this.viewAllMobile = ""; + } else { + this.viewAllMobile = "sdg"; + } + } + + public fosFsModalCancelled() { + if(this.viewAllMobile == "fos") { + this.viewAllMobile = ""; + } else { + this.viewAllMobile = "fos"; + } + } + + public suggestMobileClicked(value: string) { + if(this.viewAllMobile == 'sdg' || this.viewAllMobile == 'fos') { + this.sdgsFsModal.title += " - Suggest"; + this.sdgsFsModal.back = true; + this.sdgFosSuggest.subjects=this.resultLandingInfo.sdg; + this.sdgFosSuggest.subjectType="sdg"; + this.viewAllMobile = "sdgSuggest"; + } + if(value == 'sdg') { + this.sdgFosSuggest.subjects=this.resultLandingInfo.sdg; + this.sdgFosSuggest.subjectType="sdg"; + } else if(value == 'fos') { + this.sdgFosSuggest.subjects=this.resultLandingInfo.fos; + this.sdgFosSuggest.subjectType="fos"; + } + } + + public suggestClicked(value: string) { + if(value == 'sdg') { + this.sdgFosSuggest.subjects=this.resultLandingInfo.sdg; + this.sdgFosSuggest.subjectType="sdg"; + } else if(value == 'fos') { + this.sdgFosSuggest.subjects=this.resultLandingInfo.fos; + this.sdgFosSuggest.subjectType="fos"; + } + this.cdr.detectChanges(); + this.sdgFosSuggest.openSelectionModal(); + } + + public viewAllDescriptionClicked() { + if(this.isMobile) { + this.summaryFsModal.title += " - Abstract"; + this.summaryFsModal.back = true; + this.viewAllMobile = "description"; + } else { + this.openDescriptionModal(); + } + } + public openDescriptionModal() { this.descriptionModal.alertFooter = false; this.descriptionModal.alertTitle = "Abstract"; this.descriptionModal.open(); } + public clickedUsageMetrics() { + setTimeout( () => { + this.metricsClicked = true; + }); + } + + public formatNumber(num: number | string) { + let formatted = NumberUtils.roundNumber(+num); + return formatted.number + formatted.size; + } + + // private openSdgSelectionModal() { + // this.sdgSelectionModal.cancelButton = false; + // this.sdgSelectionModal.alertTitle = "Please select SDGs that are the most relevant for this publication."; + // this.sdgSelectionModal.okButtonText = "Next"; + // this.sdgSelectionModal.stayOpen = true; + // this.sdgSelectionModal.open(); + // } + + public openFsModal(fsModal: FullScreenModalComponent, title: string) { + fsModal.title = title; + fsModal.okButton = false; + fsModal.stayOpenInBack = true; + fsModal.open(); + this.tabMobile = title; + } + /*private openFosSelectionModal() { + this.fosSelectionModal.cancelButton = false; + this.fosSelectionModal.alertTitle = "Please select FOS that are the most relevant for this publication."; + this.fosSelectionModal.open(); + } + + public sdgModalOutput() { + this.sdgFosSuggest.sdgModalOutput(); + }*/ + public closeFsModal(fsModal: FullScreenModalComponent) { + fsModal.cancel(); + } + + public getMetricsTooltip(value: string, compact: boolean) { + if (compact) { + if (value == 'citations') { + return "
      This is an alternative to the \"Influence\" indicator, which also reflects the overall/total impact of an article in the research community at large, based on the underlying citation network (diachronically).
      "; + } else if (value == 'popularity') { + return "
      This indicator reflects the \"current\" impact/attention (the \"hype\") of an article in the research community at large, based on the underlying citation network.
      "; + } else if (value == 'influence') { + return "
      This indicator reflects the overall/total impact of an article in the research community at large, based on the underlying citation network (diachronically).
      "; + } else if (value == 'impulse') { + return "
      This indicator reflects the initial momentum of an article directly after its publication, based on the underlying citation network.
      "; + } + } else { + if (value == 'citations') { + return "
      This is an alternative to the \"Influence\" indicator, which also reflects the overall/total impact of an article in the research community at large, based on the underlying citation network (diachronically).
      BIP!Citations provided by BIP!
      "; + } else if (value == 'popularity') { + return "
      This indicator reflects the \"current\" impact/attention (the \"hype\") of an article in the research community at large, based on the underlying citation network.
      BIP!Popularity provided by BIP!
      "; + } else if (value == 'influence') { + return "
      This indicator reflects the overall/total impact of an article in the research community at large, based on the underlying citation network (diachronically).
      BIP!Influence provided by BIP!
      "; + } else if (value == 'impulse') { + return "
      This indicator reflects the initial momentum of an article directly after its publication, based on the underlying citation network.
      BIP!Impulse provided by BIP!
      "; + } else if (value == 'downloads') { + return "
      OpenAIRE UsageCountsDownloads provided by UsageCounts
      "; + } else if (value == 'views') { + return "
      OpenAIRE UsageCountsViews provided by UsageCounts
      "; + } + } + } + + public isNumber(value): boolean { + return typeof value === 'number'; + } + + public getAccessLabel(accessRight) : string { + if (accessRight) { + return (accessRight + (accessRight.toLowerCase().endsWith(" access") ? "" : " access")); + } + return "Not available access"; + } + public getEoscParams() { let params = ""; if(this.prevPath) { @@ -953,5 +1161,4 @@ export class ResultLandingComponent { return "https://"+(this.properties.environment == "beta" ? "beta." : "")+"search.marketplace.eosc-portal.eu/"; } } - } diff --git a/landingPages/result/resultLanding.module.ts b/landingPages/result/resultLanding.module.ts index 3a901b22..2df31ec0 100644 --- a/landingPages/result/resultLanding.module.ts +++ b/landingPages/result/resultLanding.module.ts @@ -1,26 +1,26 @@ -import {NgModule} from '@angular/core'; -import {CommonModule} from '@angular/common'; -import {FormsModule} from '@angular/forms'; -import {RouterModule} from '@angular/router'; +import {NgModule} from '@angular/core'; +import {CommonModule} from '@angular/common'; +import {FormsModule} from '@angular/forms'; +import {RouterModule} from '@angular/router'; -import {SharedModule} from '../../../openaireLibrary/shared/shared.module'; -import {MetricsModule} from '../landing-utils/metrics/metrics.module'; -import {LandingModule} from '../landing-utils/landing.module'; -import {CiteThisModule} from '../landing-utils/citeThis/citeThis.module'; -import {IFrameModule} from '../../utils/iframe.module'; -import {AltMetricsModule} from '../../utils/altmetrics.module'; -import {PagingModule} from '../../utils/paging.module'; +import {SharedModule} from '../../../openaireLibrary/shared/shared.module'; +import {MetricsModule} from '../landing-utils/metrics/metrics.module'; +import {LandingModule} from '../landing-utils/landing.module'; +import {CiteThisModule} from '../landing-utils/citeThis/citeThis.module'; +import {IFrameModule} from '../../utils/iframe.module'; +import {AltMetricsModule} from '../../utils/altmetrics.module'; +import {PagingModule} from '../../utils/paging.module'; -import {ResultLandingService} from './resultLanding.service'; -import {ResultLandingComponent} from './resultLanding.component'; -import {Schema2jsonldModule} from '../../sharedComponents/schema2jsonld/schema2jsonld.module'; -import { SEOServiceModule } from '../../sharedComponents/SEO/SEOService.module'; +import {ResultLandingService} from './resultLanding.service'; +import {ResultLandingComponent} from './resultLanding.component'; +import {Schema2jsonldModule} from '../../sharedComponents/schema2jsonld/schema2jsonld.module'; +import {SEOServiceModule} from '../../sharedComponents/SEO/SEOService.module'; -import {DeletedByInferenceModule} from './deletedByInference/deletedByInference.module'; -import {ShowAuthorsModule} from "../../utils/authors/showAuthors.module"; -import {HelperModule} from "../../utils/helper/helper.module"; -import {ResultLandingUtilsModule} from "../landing-utils/resultLandingUtils.module"; -import {AlertModalModule} from "../../utils/modal/alertModal.module"; +import {DeletedByInferenceModule} from './deletedByInference/deletedByInference.module'; +import {ShowAuthorsModule} from "../../utils/authors/showAuthors.module"; +import {HelperModule} from "../../utils/helper/helper.module"; +import {ResultLandingUtilsModule} from "../landing-utils/resultLandingUtils.module"; +import {AlertModalModule} from "../../utils/modal/alertModal.module"; import {AnnotationModule} from "../annotation/annotation.module"; import {LandingHeaderModule} from "../landing-utils/landing-header/landing-header.module"; import {NoLoadPaging} from "../../searchPages/searchUtils/no-load-paging.module"; @@ -33,9 +33,14 @@ import {MatFormFieldModule} from "@angular/material/form-field"; import {MatSelectModule} from "@angular/material/select"; import {IconsModule} from "../../utils/icons/icons.module"; import {IconsService} from "../../utils/icons/icons.service"; -import {graph, link, quotes} from "../../utils/icons/icons"; +import {cite, fire, graph, landmark, link, link_to, quotes, rocket, versions} from "../../utils/icons/icons"; import {InputModule} from "../../sharedComponents/input/input.module"; import {EGIDataTransferModule} from "../../utils/dataTransfer/transferData.module"; +import {RecaptchaModule} from 'ng-recaptcha'; +import {SdgFosSuggestModule} from '../landing-utils/sdg-fos-suggest/sdg-fos-suggest.module'; +import {FullScreenModalModule} from "../../utils/modal/full-screen-modal/full-screen-modal.module"; +import {SafeHtmlPipeModule} from '../../utils/pipes/safeHTMLPipe.module'; +import {EntityActionsModule} from "../../utils/entity-actions/entity-actions.module"; @NgModule({ imports: [ @@ -44,7 +49,8 @@ import {EGIDataTransferModule} from "../../utils/dataTransfer/transferData.modul MetricsModule, AltMetricsModule, Schema2jsonldModule, SEOServiceModule, DeletedByInferenceModule, ShowAuthorsModule, HelperModule, ResultLandingUtilsModule, AlertModalModule, AnnotationModule, LandingHeaderModule, NoLoadPaging, ResultPreviewModule, FeedbackModule, TabsModule, LoadingModule, - OrcidModule, MatFormFieldModule, MatSelectModule, IconsModule, InputModule, EGIDataTransferModule + OrcidModule, MatFormFieldModule, MatSelectModule, IconsModule, InputModule, EGIDataTransferModule, RecaptchaModule, + SdgFosSuggestModule, FullScreenModalModule, SafeHtmlPipeModule, EntityActionsModule ], declarations: [ ResultLandingComponent @@ -58,6 +64,6 @@ import {EGIDataTransferModule} from "../../utils/dataTransfer/transferData.modul }) export class ResultLandingModule { constructor(private iconsService: IconsService) { - this.iconsService.registerIcons([link, graph, quotes]) + this.iconsService.registerIcons([link, graph, quotes, cite, link_to, versions, rocket, fire, landmark]) } } diff --git a/landingPages/result/resultLanding.service.ts b/landingPages/result/resultLanding.service.ts index f240ebeb..49c24532 100644 --- a/landingPages/result/resultLanding.service.ts +++ b/landingPages/result/resultLanding.service.ts @@ -13,7 +13,7 @@ import {HelperFunctions} from "../../utils/HelperFunctions.class"; @Injectable() export class ResultLandingService { - constructor(private http: HttpClient ) { + constructor(private http: HttpClient) { this.parsingFunctions = new ParsingFunctions(); } @@ -39,7 +39,7 @@ export class ResultLandingService { } else if (identifier) { // pid = "10.3389/fphys.2014.00466"; let url = properties.searchAPIURLLAst + "resources2"; - url += "?pid="+encodeURIComponent(identifier.id) + "&pidtype=" + identifier.class + "&type="; + url += "?pid=" + encodeURIComponent(identifier.id) + "&pidtype=" + identifier.class + "&type="; if (type === 'publication') { url += 'publications'; } else if (type === 'dataset') { @@ -56,50 +56,50 @@ export class ResultLandingService { } } - getResultLandingInfo (id: string, identifier: Identifier, type: string, - subjectsVocabulary: any, - properties: EnvProperties): any { + getResultLandingInfo(id: string, identifier: Identifier, type: string, + subjectsVocabulary: any, + properties: EnvProperties): any { let url: string = this.buildResultLandingInfoUrl(id, identifier, type); let finalUrl: string = (properties.useCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url; return this.http.get(finalUrl) - .pipe(map(res => { - if(!id && identifier) { - if(!res['results'] || res['results'].length == 0) { - throw new HttpErrorResponse({ - status: 404, - statusText: "Not found", - url: finalUrl, - error: "Http failure response for "+finalUrl+": 404 Not Found" - }); + .pipe(map(res => { + if (!id && identifier) { + if (!res['results'] || res['results'].length == 0) { + throw new HttpErrorResponse({ + status: 404, + statusText: "Not found", + url: finalUrl, + error: "Http failure response for " + finalUrl + ": 404 Not Found" + }); + } + return res['results'][0]; + } else { + return res; } - return res['results'][0]; - } else { - return res; - } - })) - .pipe(map(res => [res['result']['header']['dri:status'], res['result']['metadata']['oaf:entity'], res])) - .pipe(map(res => [ - res[1]['oaf:result'], // 0 - res[1]['oaf:result']['title'], // 1 - res[1]['oaf:result']['rels']['rel'], // 2 - res[1]['oaf:result']['children'], // 3 - res[1]['oaf:result']['pid'], // 4 - res[1]['oaf:result']['journal'], // 5 - res[1]['oaf:result']['language'], // 6 - res[1]['oaf:result']['eoscifguidelines'], // 7 - res[1]['oaf:result']['subject'], // 8 - res[1]['oaf:result']['context'], // 9 - res[1]['oaf:result']['creator'], // 10 - res[1]['oaf:result']['country'] , // 11 - res[1]['oaf:result']['programmingLanguage'], // 12 - software - //res[1]['oaf:result']['resulttype'], - (res[1]['extraInfo'] !== undefined && res[1]['extraInfo']['references'] !== undefined) - ? res[1]['extraInfo']['references']['reference'] : null, // 13 - res[0], // 14 - res[2], // 15 - ])) - .pipe(map(res => this.parseResultLandingInfo(res, subjectsVocabulary, properties))); + })) + .pipe(map(res => [res['result']['header']['dri:status'], res['result']['metadata']['oaf:entity'], res])) + .pipe(map(res => [ + res[1]['oaf:result'], // 0 + res[1]['oaf:result']['title'], // 1 + res[1]['oaf:result']['rels']['rel'], // 2 + res[1]['oaf:result']['children'], // 3 + res[1]['oaf:result']['pid'], // 4 + res[1]['oaf:result']['journal'], // 5 + res[1]['oaf:result']['language'], // 6 + res[1]['oaf:result']['eoscifguidelines'], // 7 + res[1]['oaf:result']['subject'], // 8 + res[1]['oaf:result']['context'], // 9 + res[1]['oaf:result']['creator'], // 10 + res[1]['oaf:result']['country'], // 11 + res[1]['oaf:result']['programmingLanguage'], // 12 - software + //res[1]['oaf:result']['resulttype'], + (res[1]['extraInfo'] !== undefined && res[1]['extraInfo']['references'] !== undefined) + ? res[1]['extraInfo']['references']['reference'] : null, // 13 + res[0], // 14 + res[2], // 15 + ])) + .pipe(map(res => this.parseResultLandingInfo(res, subjectsVocabulary, properties))); } // getProvenanceActionVocabulary (properties: EnvProperties): any { @@ -118,16 +118,15 @@ export class ResultLandingService { // return provenanceActionVocabulary; // } - private handleError (error: HttpErrorResponse) { + private handleError(error: HttpErrorResponse) { // in a real world app, we may send the error to some remote logging infrastructure // instead of just logging it to the console console.log(error); - return throwError(error || 'Server error'); + return throwError(error || 'Server error'); } - parseResultLandingInfo (data: any, subjectsVocabulary: any, properties: EnvProperties): any { + parseResultLandingInfo(data: any, subjectsVocabulary: any, properties: EnvProperties): any { this.resultLandingInfo = new ResultLandingInfo(); - // res this.resultLandingInfo.record = data[15]; this.resultLandingInfo.objIdentifier = data[15]["result"]["header"]["dri:objIdentifier"]; @@ -137,25 +136,25 @@ export class ResultLandingService { // res['result']['metadata']['oaf:entity']['oaf:result'] if (data[0] != null) { let date: string = (data[0].dateofacceptance ? data[0].dateofacceptance : '') + ''; // transform to string in case it is an integer - this.resultLandingInfo.date = (date && (date).indexOf('-') !== -1) ? date.split('-')[0] : date; - this.resultLandingInfo.dateofacceptance = data[0].dateofacceptance?Dates.getDate(data[0].dateofacceptance):null; + this.resultLandingInfo.date = (date && (date).indexOf('-') !== -1) ? date.split('-')[0] : date; + this.resultLandingInfo.dateofacceptance = data[0].dateofacceptance ? Dates.getDate(data[0].dateofacceptance) : null; this.resultLandingInfo.publisher = data[0].publisher; - this.resultLandingInfo.description = this.parsingFunctions.parseDescription(data[0] && data[0].description?data[0].description:[]); - this.resultLandingInfo.embargoEndDate = data[0].embargoenddate?Dates.getDate(data[0].embargoenddate):null; + this.resultLandingInfo.description = this.parsingFunctions.parseDescription(data[0] && data[0].description ? data[0].description : []); + this.resultLandingInfo.embargoEndDate = data[0].embargoenddate ? Dates.getDate(data[0].embargoenddate) : null; } - if(data[0]['bestaccessright'] && data[0]['bestaccessright'].hasOwnProperty("classname")) { + if (data[0]['bestaccessright'] && data[0]['bestaccessright'].hasOwnProperty("classname")) { this.resultLandingInfo.accessMode = data[0]['bestaccessright'].classname; } // res['result']['metadata']['oaf:entity']['oaf:result']['title'] - if(data[1] != null) { - if(Array.isArray(data[1])) { - for(let i=0; i(); @@ -227,26 +226,24 @@ export class ResultLandingService { let length = Array.isArray(data[3]['instance']) ? data[3]['instance'].length : 1; - for(let i=0; i { - let firstAccessRight: string = (a.accessRight ? a.accessRight.toLowerCase() : null); - let secondAccessRight: string = (b.accessRight ? b.accessRight.toLowerCase() : null); - - if (firstAccessRight === secondAccessRight) { - return 0; - } else { - if (firstAccessRight === 'open access') { - return -1; - } else if (secondAccessRight === 'open access') { - return 1; - } else if (firstAccessRight === "open source") { - return -1; - } else if (secondAccessRight === "open source") { - return 1; - } else if (firstAccessRight === "embargo") { - return -1; - } else if (secondAccessRight === "embargo") { - return 1; - } else if (firstAccessRight === "restricted") { - return -1; - } else if (secondAccessRight === "restricted") { - return 1; - } else if (firstAccessRight === "closed access") { - return -1; - } else if (secondAccessRight === "closed access") { - return 1; - } else if (firstAccessRight === "not available") { - return -1; - } else if (secondAccessRight === "not available") { - return 1; - } - } - return 0; - }); + this.resultLandingInfo.hostedBy_collectedFrom.sort(this.parsingFunctions.compareHostedByCollectedFrom); } - if(data[3].hasOwnProperty("externalreference")) { + if (data[3].hasOwnProperty("externalreference")) { let externalResults: Map> = this.parseBioentitiesAndSoftware(data[3]); this.resultLandingInfo.bioentities = externalResults; } } // res['result']['metadata']['oaf:entity']['oaf:result']['pid'] - if(data[4] != null) { + if (data[4] != null) { this.resultLandingInfo.identifiers = this.parsingFunctions.parseIdentifiers(data[4]); } // res['result']['metadata']['oaf:entity']['oaf:result']['journal'] - if(data[5] != null) { - this.resultLandingInfo.journal = {"journal": "", "issn": "", "lissn": "", "eissn": "", "issue": "", "volume": "", "start_page": "", "end_page": ""} + if (data[5] != null) { + this.resultLandingInfo.journal = { + "journal": "", + "issn": "", + "lissn": "", + "eissn": "", + "issue": "", + "volume": "", + "start_page": "", + "end_page": "" + } this.resultLandingInfo.journal['journal'] = data[5].content; this.resultLandingInfo.journal['issn'] = data[5].issn; @@ -317,7 +289,7 @@ export class ResultLandingService { } // res['result']['metadata']['oaf:entity']['oaf:result']['language'] - if(data[6] != null) { + if (data[6] != null) { this.resultLandingInfo.languages = this.parsingFunctions.parseLanguages(data[6]); // let languagesAndCodes: string[][] = this.parsingFunctions.parseLanguages(data[6]); // this.resultLandingInfo.languages = languagesAndCodes[0]; @@ -325,27 +297,31 @@ export class ResultLandingService { } // res['result']['metadata']['oaf:entity']['oaf:result']['country'] - if(data[11] != null) { + if (data[11] != null) { this.resultLandingInfo.countries = this.parsingFunctions.parseCountries(data[11]); } // res['result']['metadata']['oaf:entity']['oaf:result']['eoscifguidelines'] - if(data[7] != null) { + if (data[7] != null) { this.resultLandingInfo.eoscSubjects = this.parsingFunctions.parseEoscSubjects(data[7]); } // res['result']['metadata']['oaf:entity']['oaf:result']['subject'] - if(data[8] != null) { + if (data[8] != null) { let subjectResults: [string[], Map, Map, string[], string[]] = this.parsingFunctions.parseAllSubjects(data[8], subjectsVocabulary); this.resultLandingInfo.subjects = subjectResults[0]; this.resultLandingInfo.otherSubjects = subjectResults[1]; this.resultLandingInfo.classifiedSubjects = subjectResults[2]; - this.resultLandingInfo.fos = subjectResults[3]; - if(this.resultLandingInfo.fos) { - this.resultLandingInfo.fos.sort((a, b) => a.localeCompare(b)) + if (subjectResults[3]) { + subjectResults[3].forEach(element => { + this.resultLandingInfo.fos.push({id: element, label: element.replace(/^\d+/, '').trim()}); + }); + } + if (this.resultLandingInfo.fos) { + this.resultLandingInfo.fos.sort((a, b) => a.id.localeCompare(b.id)); } this.resultLandingInfo.sdg = subjectResults[4]; - if(this.resultLandingInfo.sdg) { + if (this.resultLandingInfo.sdg) { this.resultLandingInfo.sdg.sort((a, b) => { return HelperFunctions.sortSDGs(a, b); }) @@ -357,50 +333,54 @@ export class ResultLandingService { } this.resultLandingInfo.hostedBy_collectedFrom = this.parsingFunctions.addPublisherToHostedBy_collectedFrom( - this.resultLandingInfo.hostedBy_collectedFrom, this.resultLandingInfo.publisher, - this.resultLandingInfo.journal, this.resultLandingInfo.identifiers); + this.resultLandingInfo.hostedBy_collectedFrom, this.resultLandingInfo.publisher, + this.resultLandingInfo.journal?.journal, this.resultLandingInfo.identifiers); // res['result']['metadata']['oaf:entity']['oaf:result']['programmingLanguage'] - if(data[12] != null) { + if (data[12] != null) { this.resultLandingInfo.programmingLanguages = this.parsingFunctions.parseProgrammingLanguages(data[12]); } // res['result']['metadata']['oaf:entity']['extraInfo']['references']['reference'] - if(data[13] != null) { + if (data[13] != null) { this.resultLandingInfo.references = this.parsingFunctions.parseReferences(data[13]); } // res['result']['metadata']['oaf:entity']['oaf:result']['context'] - if(data[9] != null) { + if (data[9] != null) { this.resultLandingInfo.contexts = this.parsingFunctions.parseContexts(data[9]); } // res['result']['header']['dri:status'] - if(data[14] != null && data[14] == "under curation") { + if (data[14] != null && data[14] == "under curation") { this.resultLandingInfo.underCurationMessage = true; } else { this.resultLandingInfo.underCurationMessage = false; } // res['result']['metadata']['oaf:entity']['oaf:result']['creator'] - if(data[10] != null) { - if(this.resultLandingInfo.authors == undefined) { - this.resultLandingInfo.authors = new Array<{"fullName": string, "orcid": string, "orcid_pending": string}>(); + if (data[10] != null) { + if (this.resultLandingInfo.authors == undefined) { + this.resultLandingInfo.authors = new Array<{ "fullName": string, "orcid": string, "orcid_pending": string }>(); } let authors = data[10]; let length = Array.isArray(authors) ? authors.length : 1; - for(let i=0; i> { + parseBioentitiesAndSoftware(children: any): Map> { let bioentities: Map>; let length = Array.isArray(children['externalreference']) ? children['externalreference'].length : 1; let externalreference; - for(let i=0; i>(); } - if(!bioentities.has(externalreference.sitename)) { + if (!bioentities.has(externalreference.sitename)) { bioentities.set(externalreference.sitename, new Map()); } bioentities.get(externalreference.sitename).set(externalreference.refidentifier, externalreference.url); @@ -471,10 +457,10 @@ export class ResultLandingService { } getEnermapsDetails(id: string) { - let url = properties.enermapsURL+"/api/db/metadata?shared_id=eq."+id; - return this.http.get((properties.useLongCache)? (properties.cacheUrl+encodeURIComponent(url)): url) - // return this.http.get(url) - .pipe(map(res => this.parseEnermapsDetails(res))); + let url = properties.enermapsURL + "/api/db/metadata?shared_id=eq." + id; + return this.http.get((properties.useLongCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url) + // return this.http.get(url) + .pipe(map(res => this.parseEnermapsDetails(res))); } parseEnermapsDetails(response: any) { @@ -483,9 +469,9 @@ export class ResultLandingService { let entries = []; let keys = metadata ? Object.keys(metadata) : null; - for(let key of keys) { - if(key != "shared_id" && key && metadata[key]) { - entries.push([key+"", metadata[key]+""]); + for (let key of keys) { + if (key != "shared_id" && key && metadata[key]) { + entries.push([key + "", metadata[key] + ""]); } } return entries; diff --git a/orcid/orcid-work.component.ts b/orcid/orcid-work.component.ts index 3f0ccc69..34173f0c 100644 --- a/orcid/orcid-work.component.ts +++ b/orcid/orcid-work.component.ts @@ -11,100 +11,98 @@ import {ExternalIDV3_0, WorkV3_0} from "./orcidWork"; import {EnvProperties} from "../utils/properties/env-properties"; import {UserManagementService} from "../services/user-management.service"; import {OpenaireEntities} from "../utils/properties/searchFields"; +import {FullScreenModalComponent} from "../utils/modal/full-screen-modal/full-screen-modal.component"; declare var UIkit: any; @Component({ selector: 'orcid-work', template: ` - + - - - - - Add to  - - ORCID  - orcid  - - - - - - - - - - Delete from  - - ORCID  -   - - - - - - - - - + - - + + + Claim - - + + + + Remove + + + + + - +
      {{requestGrantMessage}}
      - - - - - + + + + + - - - - + + + + - - - - - - + + + + + +
      + + +
      {{requestGrantMessage}}
      + +
      @@ -113,27 +111,29 @@ declare var UIkit: any;  ACTIONS - - - + View ORCID work - - + Update ORCID work @@ -143,8 +143,9 @@ declare var UIkit: any; - - Add to ORCID + + Claim @@ -153,8 +154,9 @@ declare var UIkit: any; - - Delete from ORCID + + Remove @@ -173,9 +175,9 @@ declare var UIkit: any;
      {{work.title?.title?.value}}
      {{work.title?.subtitle?.value}}
      - +
      {{work['journal-title']?.value}}
      - +
      @@ -209,11 +211,11 @@ declare var UIkit: any; {{work['short-description']}}

      - +
      - +
      @@ -223,24 +225,26 @@ declare var UIkit: any; (contributor['contributor-attributes'] && contributor['contributor-attributes']['contributor-role']) || (contributor['contributor-attributes'] && contributor['contributor-attributes']['contributor-sequence']) - || + || (contributor['contributor-orcid'] && contributor['contributor-orcid']['path']) )"> ( - + {{contributor['contributor-attributes']['contributor-role']}} - , - + {{contributor['contributor-attributes']['contributor-sequence']}} - - , + , {{contributor['contributor-orcid']?.path}} @@ -261,33 +265,58 @@ declare var UIkit: any;
      - This {{openaireEntities.RESULT}} is the result of merged {{openaireEntities.RESULTS}} in OpenAIRE. + This {{openaireEntities.RESULT}} is the result of merged {{openaireEntities.RESULTS}} in OpenAIRE.

      - You have already added {{this.putCodes?.length}} works in your ORCID record related to the merged {{openaireEntities.RESULT}}. + You have already added {{this.putCodes?.length}} works in your ORCID record + related to the merged {{openaireEntities.RESULT}}.
      If you continue with delete action, all these works will be deleted.
      - If you continue with update action, all these works will be deleted and a new merged work will be added instead. + If you continue with update action, all these works will be deleted and a new merged work will be added + instead.
      - - - - - + + + + + - - - - - + + + + +
      + + +
      + This {{openaireEntities.RESULT}} is the result of merged {{openaireEntities.RESULTS}} in OpenAIRE. +

      + You have already added {{this.putCodes?.length}} works in your ORCID record + related to the merged {{openaireEntities.RESULT}}. +
      + If you continue with delete action, all these works will be deleted. +
      +
      + If you continue with update action, all these works will be deleted and a new merged work will be added + instead. +
      +
      + + +
      ` }) export class OrcidWorkComponent { + @Input() isMobile: boolean = false; @Input() resultId: string = ""; @Input() resultTitle: string = ""; @Input() resultLandingInfo: ResultLandingInfo; @@ -299,54 +328,56 @@ export class OrcidWorkComponent { @Input() updateDates: string[] = []; @Input() givenPutCode: boolean = false; @Input() pageType: string = "search"; - + public subscriptions: Subscription[] = []; @ViewChild('workModal') workModal; // @ViewChild('saveWorkModal') saveWorkModal; @ViewChild('grantModal') grantModal; + @ViewChild('grantFsModal') grantFsModal: FullScreenModalComponent; // @ViewChild('messageModal') messageModal; @ViewChild('propagationModal') propagationModal; + @ViewChild('propagationFsModal') propagationFsModal; public requestGrant: boolean = false; public requestGrantMessage: string = "Please grant OpenAIRE to access and update your ORCID works."; private tokenUrl: string; public message: string = ""; public showLoading: boolean = false; - + public works: any[] = []; public orcidWorks: any[] = []; public window: any; - + public isLoggedIn: boolean = false; - + public currentAction: string = ""; - + public hoverAdd: boolean = false; public hoverDelete: boolean = false; - + public properties: EnvProperties = properties; public openaireEntities = OpenaireEntities; - + constructor(private route: ActivatedRoute, private _router: Router, private orcidService: OrcidService, private resultLandingService: ResultLandingService, private userManagementService: UserManagementService) { - if(typeof document !== 'undefined') { + if (typeof document !== 'undefined') { this.tokenUrl = properties.orcidTokenURL - + "client_id="+properties.orcidClientId + + "client_id=" + properties.orcidClientId // + "&response_type=code&scope=/activities/update" // + "&response_type=code&scope=/authenticate /activities/update /person/update /read-limited" + "&response_type=code&scope=/activities/update /read-limited" - + "&redirect_uri="+location.origin+"/orcid?source=openaire"; + + "&redirect_uri=" + location.origin + "/orcid?source=openaire"; } } - + ngOnInit() { this.subscriptions.push(this.userManagementService.getUserInfo().subscribe(user => { if (user) { this.isLoggedIn = true; - if(!this.givenPutCode) { + if (!this.givenPutCode) { this.getPutCode(); } } else { @@ -356,7 +387,7 @@ export class OrcidWorkComponent { this.isLoggedIn = false; })); } - + ngOnDestroy() { this.subscriptions.forEach(subscription => { if (subscription instanceof Subscriber) { @@ -365,16 +396,16 @@ export class OrcidWorkComponent { } }); } - + public showUpdateDatesInTooltip() { const monthNames = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]; let response: string = ""; - if(this.updateDates != null && this.updateDates.length > 0) { + if (this.updateDates != null && this.updateDates.length > 0) { response += "

      Last update in ORCID
      "; - for(let i=0; i { let identifiersMap: Map = new Map(); - for(let identifier of identifiers) { - if(!identifiersMap.has(identifier['external-id-type'])) { + for (let identifier of identifiers) { + if (!identifiersMap.has(identifier['external-id-type'])) { identifiersMap.set(identifier['external-id-type'], new Array()); } identifiersMap.get(identifier['external-id-type']).push(identifier['external-id-value']); } return identifiersMap; } - + openGrantWindow() { - if(!Session.isLoggedIn()){ + if (!Session.isLoggedIn()) { //this.userValidMessage = "User session has expired. Please login again."; - this._router.navigate(['/user-info'], { queryParams: { "errorCode": LoginErrorCodes.NOT_VALID, "redirectUrl": this._router.url} }); + this._router.navigate(['/user-info'], { + queryParams: { + "errorCode": LoginErrorCodes.NOT_VALID, + "redirectUrl": this._router.url + } + }); } else { // this.tokenUrl = location.origin+"/orcid"; this.window = window.open(this.tokenUrl, '_blank', 'location=yes,height=700,width=540,left=500,top=100,scrollbars=yes,status=yes'); // this.requestGrant = false; this.closeGrantModal(); - + let self = this; window.onmessage = function (ev) { if (ev.isTrusted && ev.origin == location.origin && ev.data == 'success') { @@ -426,17 +462,17 @@ export class OrcidWorkComponent { } } } - + private getPutCode() { this.subscriptions.push(this.orcidService.getPutCode(this.pids).subscribe( putCodes => { this.putCodes = putCodes; }, error => { - + } )) } - + private getResultLandingInfo(action: string) { this.subscriptions.push(this.resultLandingService.getResultLandingInfo(this.resultId, null, this.type, null, properties).subscribe( resultLandingInfo => { @@ -448,7 +484,7 @@ export class OrcidWorkComponent { } this.pids = pidsArray.join(); } - if(action == "save") { + if (action == "save") { this.saveWork(); } else if (action == "update") { this.updateWork(); @@ -460,18 +496,23 @@ export class OrcidWorkComponent { } )) } - + public saveWorkPreparation() { - if(!Session.isLoggedIn()){ + if (!Session.isLoggedIn()) { //this.userValidMessage = "User session has expired. Please login again."; - this._router.navigate(['/user-info'], { queryParams: { "errorCode": LoginErrorCodes.NOT_VALID, "redirectUrl": this._router.url} }); + this._router.navigate(['/user-info'], { + queryParams: { + "errorCode": LoginErrorCodes.NOT_VALID, + "redirectUrl": this._router.url + } + }); } else { - + if (this.requestGrant) { this.openGrantModal("Add, delete or edit work in your ORCID record"); } else { this.showLoading = true; - + if (this.resultLandingInfo) { this.saveWork(); } else { @@ -480,42 +521,42 @@ export class OrcidWorkComponent { } } } - + private saveWork() { this.subscriptions.push(this.orcidService.saveWork(this.resultLandingInfo, this.pids).subscribe( response => { - + // for testing only // this.openGrantModal("Add work in your ORCID record"); // this.requestGrant = true; // this.requestGrantMessage = "Please grant OpenAIRE to access and update your ORCID record and works."; - - if(response == null) { + + if (response == null) { this.handleError(null); console.error("Error posting landing info: null"); } else { - this.putCodes.push(""+response['put-code']); + this.putCodes.push("" + response['put-code']); this.creationDates.push(response['created-date']['value']); this.updateDates.push(response['last-modified-date']['value']); - + // this.closeGrantModal(); // this.message = "You have successfully added work with pids: "+this.pids+" in your ORCID record!"; - this.message = "You have successfully added work \""+this.resultTitle+"\" in your ORCID record!"; + this.message = "You have successfully added work \"" + this.resultTitle + "\" in your ORCID record!"; // this.openMessageModal("Work added successfully"); - + // message: 'You have successfully added work with pids: '+this.pids+' in your ORCID record!', UIkit.notification({ - message: 'You have successfully added work "'+this.resultTitle+'" in your ORCID record!' - // + - // '

      Manager your ORCID links' + message: 'You have successfully added work "' + this.resultTitle + '" in your ORCID record!' + // + + // '

      Manager your ORCID links' , - // '

      Manager your ORCID links', - // '

      Manager your ORCID links', + // '

      Manager your ORCID links', + // '

      Manager your ORCID links', status: 'success', timeout: 6000, pos: 'bottom-right' }); - + this.showLoading = false; } }, @@ -525,23 +566,28 @@ export class OrcidWorkComponent { } )); } - + goToOrcidLinksPage() { this._router.navigate([this.properties.myOrcidLinksPage]); } - + private updateWorkPreparation() { - if(!Session.isLoggedIn()){ - this._router.navigate(['/user-info'], { queryParams: { "errorCode": LoginErrorCodes.NOT_VALID, "redirectUrl": this._router.url} }); + if (!Session.isLoggedIn()) { + this._router.navigate(['/user-info'], { + queryParams: { + "errorCode": LoginErrorCodes.NOT_VALID, + "redirectUrl": this._router.url + } + }); } else { - + if (this.requestGrant) { this.openGrantModal("Add, delete or edit work in your ORCID record"); - } else if(this.putCodes.length > 1) { + } else if (this.putCodes.length > 1) { this.openPropagationModal("Update ORCID work"); } else { this.showLoading = true; - + if (this.resultLandingInfo) { this.updateWork(); } else { @@ -550,18 +596,18 @@ export class OrcidWorkComponent { } } } - + private updateWork() { this.subscriptions.push(this.orcidService.updateWork(this.resultLandingInfo, this.pids, this.putCodes[0]).subscribe( response => { - if(response) { + if (response) { this.updateDates[0] = response['last-modified-date'].value; - + // message: 'You have successfully updated work with pids: ' + this.pids + ' in your ORCID record!', UIkit.notification({ message: 'You have successfully updated work "' + this.resultTitle + '" in your ORCID record!' - // + - // '

      Manager your ORCID links' + // + + // '

      Manager your ORCID links' , status: 'success', timeout: 6000, @@ -576,36 +622,41 @@ export class OrcidWorkComponent { } )); } - + public confirmedPropagation() { this.propagationModal.cancel(); - + this.deleteWorks(true); //} // if(this.currentAction == "update") { // this.saveWork(); // } } - + public getOrcidWorks() { - if(!Session.isLoggedIn()){ - this._router.navigate(['/user-info'], { queryParams: { "errorCode": LoginErrorCodes.NOT_VALID, "redirectUrl": this._router.url} }); + if (!Session.isLoggedIn()) { + this._router.navigate(['/user-info'], { + queryParams: { + "errorCode": LoginErrorCodes.NOT_VALID, + "redirectUrl": this._router.url + } + }); } else { this.showLoading = true; this.subscriptions.push(this.orcidService.getOrcidWorks(this.putCodes).subscribe( (response) => { let error: boolean = true; - if(response && response['bulk']) { + if (response && response['bulk']) { response = response['bulk'].filter(res => { return (!res.error && res.work); }); - if(response && response.length > 0) { + if (response && response.length > 0) { error = false; this.orcidWorks = response; this.openWorkModal(); } } - if(error) { + if (error) { UIkit.notification({ message: 'There was an error getting this work.
      Please make sure you have not deleted it from your ORCID iD.', status: 'warning', @@ -622,20 +673,25 @@ export class OrcidWorkComponent { )); } } - - + + public deleteWorks(confirmed: boolean = false) { - if(!Session.isLoggedIn()){ - this._router.navigate(['/user-info'], { queryParams: { "errorCode": LoginErrorCodes.NOT_VALID, "redirectUrl": this._router.url} }); + if (!Session.isLoggedIn()) { + this._router.navigate(['/user-info'], { + queryParams: { + "errorCode": LoginErrorCodes.NOT_VALID, + "redirectUrl": this._router.url + } + }); } else { - + if (this.requestGrant) { this.openGrantModal("Add, delete or edit work in your ORCID record"); - } else if(this.putCodes.length > 1 && !confirmed) { + } else if (this.putCodes.length > 1 && !confirmed) { this.openPropagationModal("Delete ORCID work"); } else { this.showLoading = true; - + if (!this.resultLandingInfo && this.identifiers) { let pidsArray: string[] = []; for (let key of Array.from(this.identifiers.keys())) { @@ -643,11 +699,11 @@ export class OrcidWorkComponent { } this.pids = pidsArray.join(); } - + this.subscriptions.push(this.orcidService.deleteWorks(this.putCodes).subscribe( deletedPutCodes => { let deletedAll: boolean = true; - + if (deletedPutCodes) { for (let i = 0; i < deletedPutCodes.length; i++) { let deletedPutCode = deletedPutCodes[i]; @@ -663,24 +719,24 @@ export class OrcidWorkComponent { } else { deletedAll = false; } - + if (!deletedAll) { this.handleError(null); console.error("Error deleting landing info: null"); } else { - if(this.currentAction == "update") { + if (this.currentAction == "update") { this.saveWork(); } else { // this.closeGrantModal(); // this.message = "You have successfully deleted work with pids: " + this.pids + " from your ORCID record!"; this.message = "You have successfully deleted work \"" + this.resultTitle + "\" from your ORCID record!"; // this.openMessageModal("Work deleted successfully"); - + // message: 'You have successfully deleted work with pids: ' + this.pids + ' from your ORCID record!', UIkit.notification({ message: 'You have successfully deleted work "' + this.resultTitle + '" from your ORCID record!' - // + - // '

      Manager your ORCID links' + // + + // '

      Manager your ORCID links' , status: 'success', timeout: 6000, @@ -698,31 +754,37 @@ export class OrcidWorkComponent { } } } - + openGrantModal(title: string) { - this.grantModal.cancelButton = true; - this.grantModal.okButton = true; - this.grantModal.okButtonText = "Grant OpenAIRE"; - this.grantModal.okButtonLeft = false; - this.grantModal.alertTitle = title; - this.grantModal.open(); + if(this.isMobile) { + this.grantFsModal.okButton = false; + this.grantFsModal.title = title; + this.grantFsModal.open(); + } else { + this.grantModal.cancelButton = true; + this.grantModal.okButton = true; + this.grantModal.okButtonText = "Grant OpenAIRE"; + this.grantModal.okButtonLeft = false; + this.grantModal.alertTitle = title; + this.grantModal.open(); + } } - + closeGrantModal() { this.grantModal.cancel(); } - + openWorkModal() { this.workModal.cancelButton = false; this.workModal.okButton = false; this.workModal.alertTitle = "Work in your ORCID record"; this.workModal.open(); } - + closeWorkModal() { this.workModal.cancel(); } - + // openMessageModal(title: string) { // this.messageModal.cancelButton = false; // this.messageModal.okButton = false; @@ -733,52 +795,58 @@ export class OrcidWorkComponent { // closeMessageModal() { // this.messageModal.cancel(); // } - + openPropagationModal(title: string) { - this.propagationModal.cancelButton = true; - this.propagationModal.okButton = true; - this.propagationModal.okButtonText = "Continue"; - this.propagationModal.okButtonLeft = false; - this.propagationModal.alertTitle = title; - this.propagationModal.open(); + if(this.isMobile) { + this.propagationFsModal.okButton = false; + this.propagationFsModal.title = title; + this.propagationFsModal.open(); + } else { + this.propagationModal.cancelButton = true; + this.propagationModal.okButton = true; + this.propagationModal.okButtonText = "Continue"; + this.propagationModal.okButtonLeft = false; + this.propagationModal.alertTitle = title; + this.propagationModal.open(); + } } - + closePropagationModal() { this.propagationModal.cancel(); } - + handleError(error) { - if(error && error.status == "401") { + if (error && error.status == "401") { this.openGrantModal("Add, delete or edit work in your ORCID record"); this.requestGrant = true; this.requestGrantMessage = "Please grant OpenAIRE to access and update your ORCID record and works. "; - // + "If you have already granted OpenAIRE, you just need to login again to ORCID!"; - } else if(error && error.status == "403") { + // + "If you have already granted OpenAIRE, you just need to login again to ORCID!"; + } else if (error && error.status == "403") { this.openGrantModal("Add, delete or edit work in your ORCID record"); this.requestGrant = true; this.requestGrantMessage = "Please login again to ORCID." // this.openGrantModal(); } else { this.message = ""; - if(error && error.status == "409") { + if (error && error.status == "409") { this.message = "There is already a work in your ORCID record with the same information of the work you are trying to add now.

      "; } - if(this.currentAction == "get") { + if (this.currentAction == "get") { // this.message += "There was an error getting work with pids: " + this.pids + " from your ORCID record.
      Please try again later."; this.message += "There was an error getting work \"" + this.resultTitle + "\" from your ORCID record.
      Please try again later."; - } else if(this.currentAction == "add") { + } else if (this.currentAction == "add") { // this.message += "There was an error adding work with pids: "+this.pids+" to your ORCID record.
      Please try again later."; - this.message += "There was an error adding work with pids: \""+this.pids+"\" to your ORCID record.
      Please try again later."; - } else if(this.currentAction == "update") { + this.message += "There was an error adding work with pids: \"" + this.pids + "\" to your ORCID record.
      Please try again later."; + } else if (this.currentAction == "update") { // this.message += "There was an error updating work with pids: "+this.pids+" to your ORCID record.
      Please try again later."; - this.message += "There was an error updating work \""+this.resultTitle+"\" to your ORCID record.
      Please try again later."; - } else if(this.currentAction == "delete") { + this.message += "There was an error updating work \"" + this.resultTitle + "\" to your ORCID record.
      Please try again later."; + } else if (this.currentAction == "delete") { // this.message += "There was an error deleting work with pids: "+this.pids+" from your ORCID record.
      Please try again later."; - this.message += "There was an error deleting work \""+this.resultTitle+"\" from your ORCID record.
      Please try again later."; + this.message += "There was an error deleting work \"" + this.resultTitle + "\" from your ORCID record.
      Please try again later."; } else { this.message += "There was an error. Please try again later." } - + UIkit.notification({ message: this.message, status: 'danger', @@ -789,28 +857,28 @@ export class OrcidWorkComponent { } this.showLoading = false; } - + get tooltipAdd() { return "Add this work to your ORCID record" + ((properties.environment == "beta") ? ". The action will affect your real ORCID iD." : ""); } - + get tooltipDelete() { return "Delete this work from your ORCID record" + ((properties.environment == "beta") ? ". The action will affect your real ORCID iD." : ""); } - + get tooltipNoPid() { return "Only resources with a PID (persistent identifier) like DOI, handle, PMID can be added or deleted from your ORCID record"; } - + get tooltipNoLoggedInUser() { - return "Add or delete a work from your ORCID record. Please log in first." + return "Add or delete a work from your ORCID record. Please log in first." } - + hoverEvent($event, action: string = "add") { - if(action == "add") { + if (action == "add") { this.hoverAdd = $event.type == "mouseover"; this.hoverDelete = false; - } else if(action == "delete") { + } else if (action == "delete") { this.hoverDelete = $event.type == "mouseover"; this.hoverAdd = false; } diff --git a/orcid/orcid.module.ts b/orcid/orcid.module.ts index 9ff2bdfd..fd8428e0 100644 --- a/orcid/orcid.module.ts +++ b/orcid/orcid.module.ts @@ -15,11 +15,12 @@ import {ResultLandingUtilsModule} from '../landingPages/landing-utils/resultLand import {IconsModule} from '../utils/icons/icons.module'; import {IconsService} from "../utils/icons/icons.service"; import {orcid_add, orcid_bin} from "../utils/icons/icons"; +import {FullScreenModalModule} from "../utils/modal/full-screen-modal/full-screen-modal.module"; @NgModule({ imports: [ CommonModule, RouterModule, AlertModalModule, LoadingModule, ResultLandingUtilsModule, - IconsModule + IconsModule, FullScreenModalModule ], declarations: [ OrcidComponent, diff --git a/sdg/sdg.component.less b/sdg/sdg.component.less index d24ff52d..56f50806 100644 --- a/sdg/sdg.component.less +++ b/sdg/sdg.component.less @@ -3,7 +3,7 @@ @sdgs: #E6233D, #DF9F00, #19A220, #D70023, #FF0B00, #00BFE8, #FFC300, #B10240, #FF5D00, #F50D86, #FF8A00, #CA8A03, #2B772B, #0098DF, #00B91C, #0069A2, #1C336A; -custom-sdg-dot:after { +.custom-sdg-dot:after { content: ""; background-image: url("~src/assets/common-assets/sdg/sdg-dot-img.svg"); display: inline-block; diff --git a/searchPages/find/searchAll.component.html b/searchPages/find/searchAll.component.html index 51873f56..ba82eb23 100644 --- a/searchPages/find/searchAll.component.html +++ b/searchPages/find/searchAll.component.html @@ -10,12 +10,13 @@
      @@ -26,9 +27,10 @@
      -
      -
      + description="Search for {{openaireEntities.RESULTS}} ({{openaireEntities.PUBLICATIONS}}, {{openaireEntities.DATASETS}}, {{openaireEntities.SOFTWARE}}, {{openaireEntities.OTHER}}), {{openaireEntities.PROJECTS}}, {{openaireEntities.ORGANIZATIONS}}, {{openaireEntities.DATASOURCES}} in the OpenAIRE Graph. "> +
      +
        @@ -37,7 +39,7 @@
      • {{resultsName}} - + ({{fetchPublications.searchUtils.totalResults | number}})
      • @@ -48,7 +50,7 @@
      • {{projectName}} - + ({{fetchProjects.searchUtils.totalResults | number}})
      • @@ -59,7 +61,7 @@
      • {{dataSourcesName}} - + ({{fetchDataproviders.searchUtils.totalResults | number}})
      • @@ -70,7 +72,7 @@
      • {{servicesName}} - + ({{fetchServices.searchUtils.totalResults | number}})
      • @@ -81,7 +83,7 @@
      • {{organizationsName}} - + ({{fetchOrganizations.searchUtils.totalResults | number}})
      • @@ -99,25 +101,25 @@ + [simpleSearchLink]="properties.searchLinkToResults" [customFilter]="customFilter"> + [simpleSearchLink]="properties.searchLinkToProjects" [customFilter]="customFilter"> + [simpleSearchLink]="properties.searchLinkToOrganizations" [customFilter]="customFilter"> + [simpleSearchLink]="properties.searchLinkToDataProviders" [customFilter]="customFilter"> diff --git a/searchPages/find/searchAll.component.ts b/searchPages/find/searchAll.component.ts index 67b16706..990d5de7 100644 --- a/searchPages/find/searchAll.component.ts +++ b/searchPages/find/searchAll.component.ts @@ -32,12 +32,15 @@ import {SearchDataProvidersComponent} from "../searchDataProviders.component"; import {NewSearchPageComponent, SearchForm} from "../searchUtils/newSearchPage.component"; import {properties} from "../../../../environments/environment"; import {Breadcrumb} from "../../utils/breadcrumbs/breadcrumbs.component"; +import {LayoutService} from "../../dashboard/sharedComponents/sidebar/layout.service"; @Component({ selector: 'search-all', templateUrl: 'searchAll.component.html' }) export class SearchAllComponent { + isMobile: boolean = false; + reload:{result:boolean, projects:boolean, datasources: boolean, services: boolean, organizations:boolean} = {result:true, projects:true, datasources: true, services: true, organizations:true}; public pageTitle = "Search in OpenAIRE" @@ -78,14 +81,16 @@ export class SearchAllComponent { showDataProviders: boolean = false; showServices: boolean = false; showOrganizations: boolean = false; - advancedSearchLink: string = "/search/advanced/publications"; + advancedSearchLink: string = properties.searchLinkToAdvancedResults; properties: EnvProperties; + offset: number; public openaireEntities = OpenaireEntities; @Input() logoURL; @Input() name; @Input() customFilter: SearchCustomFilter = null; @Input() piwikSiteId = null; - @Input() formPlaceholderText = "Search for "+OpenaireEntities.RESULTS+", "+OpenaireEntities.PROJECTS+", "+OpenaireEntities.DATASOURCES+" & "+OpenaireEntities.ORGANIZATIONS+" in OpenAIRE"; + @Input() formPlaceholderText = "Search in Explore" + // @Input() formPlaceholderText = "Search for "+OpenaireEntities.RESULTS+", "+OpenaireEntities.PROJECTS+", "+OpenaireEntities.DATASOURCES+" & "+OpenaireEntities.ORGANIZATIONS+" in OpenAIRE"; @Input() searchForm: SearchForm = {class: 'search-form', dark: true} @Input() breadcrumbs: Breadcrumb[] = []; @@ -125,6 +130,7 @@ export class SearchAllComponent { private _title: Title, private _piwikService: PiwikService, private config: ConfigurationService, + private layoutService: LayoutService, private seoService: SEOService, private router: Router, private cdr:ChangeDetectorRef) { this.fetchPublications = new FetchResearchResults(this._searchResearchResultsService); this.fetchDataproviders = new FetchDataproviders(this._searchDataprovidersService); @@ -141,8 +147,7 @@ export class SearchAllComponent { public ngOnInit() { - - var description = "Search for "+OpenaireEntities.RESULTS+" ("+OpenaireEntities.PUBLICATIONS+", "+OpenaireEntities.DATASETS+", "+OpenaireEntities.SOFTWARE+", "+OpenaireEntities.OTHER+"), "+OpenaireEntities.PROJECTS+", "+OpenaireEntities.ORGANIZATIONS+", "+OpenaireEntities.DATASOURCES+" in the OpenAIRE Research Graph. "; + var description = "Search for "+OpenaireEntities.RESULTS+" ("+OpenaireEntities.PUBLICATIONS+", "+OpenaireEntities.DATASETS+", "+OpenaireEntities.SOFTWARE+", "+OpenaireEntities.OTHER+"), "+OpenaireEntities.PROJECTS+", "+OpenaireEntities.ORGANIZATIONS+", "+OpenaireEntities.DATASOURCES+" in the OpenAIRE Graph. "; var title = "OpenAIRE |Search for "+OpenaireEntities.RESULTS+", "+OpenaireEntities.PROJECTS+", "+OpenaireEntities.DATASOURCES+" & "+OpenaireEntities.ORGANIZATIONS; this.properties = properties; var url = this.properties.domain + this.properties.baseLink + this._router.url; @@ -195,46 +200,78 @@ export class SearchAllComponent { this.showDataProviders = true; this.showServices = false; } + this.loadAll(); } - this.loadAll(); + this.subs.push(this.layoutService.isMobile.subscribe(isMobile => { + this.isMobile = isMobile; + + if (typeof document !== 'undefined') { + if(!this.isMobile && document.getElementById("main-menu")) { + this.offset = Number.parseInt(getComputedStyle(document.documentElement).getPropertyValue('--header-height')); + this.cdr.detectChanges(); + } else { + this.offset = 0; + this.cdr.detectChanges(); + } + } + })) } loadAll() { this.reloadTabs(); - this.subs.push(this.route.queryParams.subscribe(params => { - this.parameters = Object.assign({}, params); - this.keyword = (params['keyword']) ? params['keyword'] : (params["q"] ? params["q"] : (params["f0"] && params["f0"] == "q" && params["fv0"]?params["fv0"]:"")); + this.subs.push(this.route.queryParams.subscribe(queryParams => { + this.parameters = Object.assign({}, queryParams); + this.keyword = (queryParams['keyword']) ? queryParams['keyword'] : (queryParams["q"] ? queryParams["q"] : (queryParams["f0"] && queryParams["f0"] == "q" && queryParams["fv0"]?queryParams["fv0"]:"")); this.selectedFields[0].value = StringUtils.URIDecode(this.keyword); - this.quickFilter.selected = ((params['qf']== undefined || params["qf"] == "true") == true); - if (params["type"] && params["type"].length > 0) { - this.resultTypes['publication'] = (params["type"].split(",").indexOf("publications") != -1); - this.resultTypes['dataset'] = (params["type"].split(",").indexOf("datasets") != -1); - this.resultTypes['software'] = (params["type"].split(",").indexOf("software") != -1); - this.resultTypes['other'] = (params["type"].split(",").indexOf("other") != -1); + this.quickFilter.selected = ((queryParams['qf']== undefined || queryParams["qf"] == "true") == true); + if (queryParams["type"] && queryParams["type"].length > 0) { + this.resultTypes['publication'] = (queryParams["type"].split(",").indexOf("publications") != -1); + this.resultTypes['dataset'] = (queryParams["type"].split(",").indexOf("datasets") != -1); + this.resultTypes['software'] = (queryParams["type"].split(",").indexOf("software") != -1); + this.resultTypes['other'] = (queryParams["type"].split(",").indexOf("other") != -1); } - if(this.activeEntity == null && (!params["active"] || params["active"].length ==0)){ - this.activeEntity = this.getDefaultEntityToShow(); - }else if(params["active"] && params["active"].length >0 ){ - this.activeEntity = ((["result","projects","organizations","datasources","services"]).indexOf(params["active"])!= -1)?params["active"]:this.getDefaultEntityToShow(); - }else if (this.activeEntity !=null && (!params["active"] || params["active"].length ==0)){ - this.parameters["active"]=this.activeEntity; - if((typeof document !== 'undefined') && location.search && location.search.indexOf("active=") == -1){ - this.location.go(location.pathname, ((location.search)?(location.search+"&"):("?")) +"active=" + this.activeEntity); + let active = null; + if (queryParams["active"] && queryParams["active"].length > 0) { + active = ((["result","projects","organizations","datasources","services"]).indexOf(queryParams["active"])!= -1)?queryParams["active"]:null; + delete this.parameters['active']; + } + this.subs.push(this.route.params.subscribe(params => { + if(this.activeEntity == null && (!params["entity"] || params["entity"].length == 0)){ + if (active) { + this.activeEntity = active; + if((typeof document !== 'undefined')){ + if (active == "result") { + active = "research-outcomes"; + } + let query = location.search.replace(/(active=)([^&]*)&?/, ''); + this.location.go(location.pathname + '/' + active, query == '?' ? '' : query); + } + } else { + this.activeEntity = this.getDefaultEntityToShow(); + } + } else if(params["entity"] && params["entity"].length > 0 ){ + let entity = params["entity"]; + if(entity == "research-outcomes") { + entity = "result"; + } else if (entity == "dataproviders") { + entity = "datasources"; + } + this.activeEntity = ((["result","projects","organizations","datasources","services"]).indexOf(entity)!= -1)?entity:this.getDefaultEntityToShow(); } - } - if (this.activeEntity == "result") { - this.searchResults(); - } else if (this.activeEntity == "projects") { - this.searchProjects(); - } else if (this.activeEntity == "datasources") { - this.searchDataProviders(); - } else if (this.activeEntity == "services") { - this.searchServices(); - } else if (this.activeEntity == "organizations") { - this.searchOrganizations(); - } - this.count(); + if (this.activeEntity == "result") { + this.searchResults(); + } else if (this.activeEntity == "projects") { + this.searchProjects(); + } else if (this.activeEntity == "datasources") { + this.searchDataProviders(); + } else if (this.activeEntity == "services") { + this.searchServices(); + } else if (this.activeEntity == "organizations") { + this.searchOrganizations(); + } + this.count(); + })); })); } @@ -265,7 +302,9 @@ export class SearchAllComponent { } public searchResults() { - this.advancedSearchLink = this.properties.searchLinkToAdvancedPublications;//"/search/advanced/publications"; + this.advancedSearchLink = this.properties.searchLinkToAdvancedResults;//"/search/advanced/research-outcomes"; + this.formPlaceholderText = "Search by title, author, abstract, DOI, orcid..."; + if (this.reload[this.activeEntity] && this.fetchPublications.searchUtils.status != this.errorCodes.NONE) { this.reload[this.activeEntity] = false; @@ -276,6 +315,8 @@ export class SearchAllComponent { public searchProjects() { this.advancedSearchLink = this.properties.searchLinkToAdvancedProjects;//"/search/advanced/projects"; + this.formPlaceholderText = "Search by title, acronym, project code..."; + if (this.reload[this.activeEntity] && this.fetchProjects.searchUtils.status != this.errorCodes.NONE ) { this.reload[this.activeEntity] = false; @@ -285,6 +326,8 @@ export class SearchAllComponent { public searchDataProviders() { this.advancedSearchLink = this.properties.searchLinkToAdvancedDataProviders;//"/search/advanced/dataproviders"; + this.formPlaceholderText = "Search by name, description, subject..."; + if ( this.reload[this.activeEntity] && this.fetchDataproviders.searchUtils.status != this.errorCodes.NONE) { this.reload[this.activeEntity] = false; @@ -294,6 +337,8 @@ export class SearchAllComponent { public searchServices() { this.advancedSearchLink = this.properties.searchLinkToAdvancedServices;//"/search/advanced/services"; + this.formPlaceholderText = "Search by name, description, subject..."; + if ( this.reload[this.activeEntity] && this.fetchServices.searchUtils.status != this.errorCodes.NONE) { this.reload[this.activeEntity] = false; @@ -303,6 +348,8 @@ export class SearchAllComponent { public searchOrganizations() { this.advancedSearchLink = this.properties.searchLinkToAdvancedOrganizations;//"/search/advanced/organizations"; + this.formPlaceholderText = "Search by organization name..."; + if (this.reload[this.activeEntity] && this.fetchOrganizations.searchUtils.status != this.errorCodes.NONE) { this.reload[this.activeEntity] = false; @@ -532,33 +579,38 @@ export class SearchAllComponent { } } - entityChanged(entity){ - if(this.activeEntity == "result") { - this.resultTypes = {publication: true, dataset: true, software: true, other: true}; - } - if(this.activeEntity == "result" && this.searchResearchResultsComponent){ - this.searchResearchResultsComponent.ngOnDestroy(); - }else if(this.activeEntity == "projects" && this.searchProjectsComponent){ - this.searchProjectsComponent.ngOnDestroy(); - }else if(this.activeEntity == "datasources" && this.searchDataprovidersComponent){ - this.searchDataprovidersComponent.ngOnDestroy(); - }else if(this.activeEntity == "services" && this.searchDataprovidersComponent){ - this.searchDataprovidersComponent.ngOnDestroy(); - }else if(this.activeEntity == "organizations" && this.searchOrganizationsComponent){ - this.searchOrganizationsComponent.ngOnDestroy(); - } - this.activeEntity = entity; + entityChanged(entity) { + if (this.activeEntity !== entity) { + if (this.activeEntity == "result") { + this.resultTypes = {publication: true, dataset: true, software: true, other: true}; + } + if (this.activeEntity == "result" && this.searchResearchResultsComponent) { + this.searchResearchResultsComponent.ngOnDestroy(); + } else if (this.activeEntity == "projects" && this.searchProjectsComponent) { + this.searchProjectsComponent.ngOnDestroy(); + } else if (this.activeEntity == "datasources" && this.searchDataprovidersComponent) { + this.searchDataprovidersComponent.ngOnDestroy(); + } else if (this.activeEntity == "services" && this.searchDataprovidersComponent) { + this.searchDataprovidersComponent.ngOnDestroy(); + } else if (this.activeEntity == "organizations" && this.searchOrganizationsComponent) { + this.searchOrganizationsComponent.ngOnDestroy(); + } + this.activeEntity = entity; this.parameters = {}; - this.reload[entity]= true; - this.parameters["active"] = entity; - if ( this.keyword.length > 0) { - this.parameters["fv0"] = this.keyword; - this.parameters["f0"] = "q"; - } - if(this.customFilter){ - this.parameters = this.customFilter.getParameters(this.parameters); - } - this.router.navigate(["/search/find"], {queryParams: this.parameters}); + this.reload[entity] = true; + if (this.keyword.length > 0) { + this.parameters["fv0"] = this.keyword; + this.parameters["f0"] = "q"; + } + if (this.customFilter) { + this.parameters = this.customFilter.getParameters(this.parameters); + } + if (entity == "result") { + entity = "research-outcomes"; + this.parameters["resultbestaccessright"] = '"' + encodeURIComponent("Open Access") + '"'; + } + this.router.navigate(["/search/find", entity], {queryParams: this.parameters}); } + } } diff --git a/searchPages/searchDataProviders.component.ts b/searchPages/searchDataProviders.component.ts index 40dd7ca5..8dad1735 100644 --- a/searchPages/searchDataProviders.component.ts +++ b/searchPages/searchDataProviders.component.ts @@ -35,7 +35,7 @@ import {properties} from "../../../environments/environment"; [includeOnlyResultsAndFilter]="includeOnlyResultsAndFilter" [piwikSiteId]=piwikSiteId [hasPrefix]="hasPrefix" [searchForm]="searchForm" - [entitiesSelection]="type=='all' || type == 'services'" [showSwitchSearchLink]="showSwitchSearchLink" + [entitiesSelection]="false" [showSwitchSearchLink]="showSwitchSearchLink" [filters]="filters" [simpleView]="simpleView" formPlaceholderText="Search by name, description, subject..." [showResultCount]="true" [showIndexInfo]="type!='deposit'" diff --git a/searchPages/searchUtils/advancedSearchForm.component.html b/searchPages/searchUtils/advancedSearchForm.component.html index 570cd7db..84d87fcb 100644 --- a/searchPages/searchUtils/advancedSearchForm.component.html +++ b/searchPages/searchUtils/advancedSearchForm.component.html @@ -82,7 +82,7 @@ [id]="'autocomplete-'+i"> - + Search - ({{selectedFields.length}} Rules) + @@ -146,7 +146,8 @@
        - + Advanced search @@ -163,25 +164,29 @@
        - + + -
        --> +
        + + +
        - - - -
        + [searchInputClass]="'inner background'" [placeholder]="formPlaceholderText" (searchEmitter)="simpleKeywordChanged()"> + + + +
        - - - + [searchInputClass]="'inner background'" [placeholder]="formPlaceholderText" (searchEmitter)="simpleKeywordChanged()"> + + +
        diff --git a/searchPages/searchUtils/advancedSearchForm.component.ts b/searchPages/searchUtils/advancedSearchForm.component.ts index 1b1fc5ce..8a046930 100644 --- a/searchPages/searchUtils/advancedSearchForm.component.ts +++ b/searchPages/searchUtils/advancedSearchForm.component.ts @@ -116,7 +116,7 @@ export class AdvancedSearchFormComponent implements OnInit, OnDestroy, OnChanges simpleKeywordChanged() { // this.selectedFields[0].value = $event.value; - if (this.selectedEntity == this.entityType) { + if ((this.selectedEntity == this.entityType) || !this.entitiesSelection) { this.queryChanged(); } else { this.router.navigate([this.selectedEntitySimpleUrl], {queryParams: {q: this.selectedFields[0].value, op: "and"}}); diff --git a/searchPages/searchUtils/newSearchPage.component.html b/searchPages/searchUtils/newSearchPage.component.html index 385ff5c0..09d3b471 100644 --- a/searchPages/searchUtils/newSearchPage.component.html +++ b/searchPages/searchUtils/newSearchPage.component.html @@ -71,6 +71,15 @@
        + + + + +
        @@ -91,25 +100,43 @@ Filters temporarily unavailable. Please try again later.
          -
        • - +
        • +
        • -
        • - +
        • + +
        • - -
        • - +
        • + +
        • + +
        • +
        • + +
        • + + + + + +
        • +
          + +
        • + +
        • +
          +
        • + +
        @@ -139,12 +166,23 @@
      +
      + +
      +
      @@ -171,7 +209,7 @@ [advancedSearchLinkParameters]="this.routerHelper.createQueryParams(this.parameterNames, this.parameterValues)" [simpleView]="simpleView" [formPlaceholderText]="formPlaceholderText" [isMobile]="mobile" [resultTypes]="resultTypes" [quickFilter]="quickFilter" [entitiesSelection]="entitiesSelection" - [showSwitchSearchLink]="showSwitchSearchLink" [customFilter]="customFilter" (filtersClicked)="showOffCanvas = $event" + [showSwitchSearchLink]="showSwitchSearchLink" [customFilter]="customFilter" >
      @@ -191,16 +229,16 @@
      -
      - - -
      + + + + +
      - +
      @@ -252,14 +290,20 @@ [href]="openaireLink+this.routerHelper.createQueryParamsString(this.parameterNames, this.parameterValues)" target="_blank"> OpenAIRE - Explore.
      -
      +
      -
      +
      {{searchUtils.totalResults|number}} - {{type}}, page - {{searchUtils.page | number}} - of {{(totalPages(searchUtils.totalResults)|number)}} + {{type}} + + for + {{searchTerm}} + + + ({{advancedSearchTerms}} rule{{advancedSearchTerms == 1 ? '' : 's'}} applied) + {{oldTotalResults|number}} @@ -267,9 +311,10 @@ {{searchUtils.page | number}} of {{(totalPages(oldTotalResults)|number)}} -
      +
      -
      +