diff --git a/claims/linking/linkingGeneric.component.html b/claims/linking/linkingGeneric.component.html index 9a62d971..a5a7062d 100644 --- a/claims/linking/linkingGeneric.component.html +++ b/claims/linking/linkingGeneric.component.html @@ -35,8 +35,7 @@
-
-
+
-
-
-
- -
-
-
- - - +
+
+
+
+ +
+
+
+ + + -
-
-
- 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. +
+
+
+ +
+
+
+ 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. +
+
-
-
-
diff --git a/connect/communityGuard/connectAdminLoginGuard.guard.ts b/connect/communityGuard/connectAdminLoginGuard.guard.ts index e718cd8e..6a1765de 100644 --- a/connect/communityGuard/connectAdminLoginGuard.guard.ts +++ b/connect/communityGuard/connectAdminLoginGuard.guard.ts @@ -22,7 +22,7 @@ export class ConnectAdminLoginGuard implements CanActivate, CanActivateChild { check(community: string, path: string): Observable | boolean { let errorCode = LoginErrorCodes.NOT_LOGIN; - const authorized = this.userManagementService.getUserInfo(false).pipe(take(1), map(user => { + const authorized = this.userManagementService.getUserInfo().pipe(take(1), map(user => { if (user) { if (Session.isPortalAdministrator(user) || Session.isCommunityCurator(user) || Session.isManager('community', community, user)) { return of(true); diff --git a/connect/communityGuard/connectSubscriber.guard.ts b/connect/communityGuard/connectSubscriber.guard.ts index 19eea1f8..aac13b37 100644 --- a/connect/communityGuard/connectSubscriber.guard.ts +++ b/connect/communityGuard/connectSubscriber.guard.ts @@ -30,7 +30,7 @@ export class ConnectSubscriberGuard implements CanActivate, CanActivateChild { } else { community = ConnectHelper.getCommunityFromDomain(properties.domain); } - const authorized = this.userManagementService.getUserInfo(false).pipe(take(1), map(user => { + const authorized = this.userManagementService.getUserInfo().pipe(take(1), map(user => { if (user) { if (Session.isSubscribedTo('community', community, user)) { return of(true); diff --git a/landingPages/landing-utils/fundedBy.component.ts b/landingPages/landing-utils/fundedBy.component.ts index 663b163b..634998e1 100644 --- a/landingPages/landing-utils/fundedBy.component.ts +++ b/landingPages/landing-utils/fundedBy.component.ts @@ -58,10 +58,10 @@ import {HelperFunctions} from '../../utils/HelperFunctions.class'; Funding stream: {{item.funding}} -
+
Validated by funder | - {{getVocabularyLabel(item.provenanceAction, provenanceActionVocabulary)}} + {{item.provenanceAction}}
@@ -80,6 +80,7 @@ export class FundedByComponent { public url = properties.searchLinkToProject.split('?')[0]; public title: string = "Funded by"; @Input() provenanceActionVocabulary = null; + public provenancesCalculated: boolean[] = []; public viewAllClick() { if(this.fundedByProjects.length <= this.threshold*2) { @@ -96,7 +97,11 @@ export class FundedByComponent { this.viewAllClicked.emit(""); } - public getVocabularyLabel(value: any, vocabulary: any) { - return HelperFunctions.getVocabularyLabel(value, vocabulary); + public getVocabularyLabel(item: any, vocabulary: any, index: number) { + if(!this.provenancesCalculated[index]) { + this.provenancesCalculated[index] = true; + item.provenanceAction = HelperFunctions.getVocabularyLabel(item.provenanceAction, vocabulary, false); + } + return item.provenanceAction; } } diff --git a/landingPages/landing-utils/parsingFunctions.class.ts b/landingPages/landing-utils/parsingFunctions.class.ts index 262fc020..3563e839 100644 --- a/landingPages/landing-utils/parsingFunctions.class.ts +++ b/landingPages/landing-utils/parsingFunctions.class.ts @@ -273,7 +273,7 @@ export class ParsingFunctions { for (let i = 0; i < length; i++) { let hostedBy = Array.isArray(instance['hostedby']) ? instance['hostedby'][i] : instance['hostedby']; if (hostedBy.name && hostedBy.name != "other resources" && hostedBy.name != "Unknown Repository") { - downloadNames.add(hostedBy.name); + downloadNames.add(String(hostedBy.name)); } } available.downloadNames = Array.from(downloadNames); @@ -288,7 +288,7 @@ export class ParsingFunctions { for (let i = 0; i < length; i++) { let collectedFrom = Array.isArray(instance['collectedfrom']) ? instance['collectedfrom'][i] : instance['collectedfrom']; if(collectedFrom.name && collectedFrom.id) { - available.collectedNamesAndIds.set(collectedFrom.name, collectedFrom.id); + available.collectedNamesAndIds.set(String(collectedFrom.name), collectedFrom.id); } } } @@ -399,42 +399,6 @@ export class ParsingFunctions { } // publication & dataset & software & orp landing : for relatedResearchResults - parseRelatedResearchResults(relatedResearchResults: RelationResult[], relation: any, provenanceAction: string): - RelationResult[] { - if (relatedResearchResults == undefined) { - relatedResearchResults = [] - } - relatedResearchResults.push(this.parseRelatedOrSimilarResearchResult(relation, "trust", provenanceAction)); - return relatedResearchResults; - } - - // publication & dataset & software & orp landing : for supplementaryResearchResults - parseSupplementaryResearchResults(supplementaryResearchResults: RelationResult[], relation: any): RelationResult[] { - if (supplementaryResearchResults == undefined) { - supplementaryResearchResults = []; - } - supplementaryResearchResults.push(this.parseRelatedOrSimilarResearchResult(relation, "trust")); - return supplementaryResearchResults; - } - - // publication & dataset & software & orp landing : for supplementedByResearchResults - parseSupplementedByResearchResults(supplementedByResearchResults: RelationResult[], relation: any): RelationResult[] { - if (supplementedByResearchResults == undefined) { - supplementedByResearchResults = []; - } - supplementedByResearchResults.push(this.parseRelatedOrSimilarResearchResult(relation, "trust")); - return supplementedByResearchResults; - } - - // publication & dataset & software & orp landing : for similarResearchResults - parseSimilarResearchResults(similarResearchResults: RelationResult[], relation: any): RelationResult[] { - if (similarResearchResults == undefined) { - similarResearchResults = []; - } - similarResearchResults.push(this.parseRelatedOrSimilarResearchResult(relation, "similarity")); - return similarResearchResults; - } - parseResults(researchResults: RelationResult[], relation, provenanceAction: string, relationName: string): RelationResult[] { if (researchResults == undefined) { researchResults = []; @@ -465,8 +429,17 @@ export class ParsingFunctions { } } researchResult['id'] = relation['to'].content; - let titleName = Array.isArray(relation['title']) ? relation['title'][0].content : (relation['title']?relation['title'].content:null); - researchResult['name'] = titleName; + if(Array.isArray(relation['title'])) { + for(let i=0; i - + @@ -97,7 +97,7 @@ import {properties} from "../../../../environments/environment";
- +
` diff --git a/landingPages/result/resultLanding.service.ts b/landingPages/result/resultLanding.service.ts index 3bb8d720..55b4f30a 100644 --- a/landingPages/result/resultLanding.service.ts +++ b/landingPages/result/resultLanding.service.ts @@ -87,7 +87,7 @@ export class ResultLandingService { res[1]['oaf:result']['pid'], // 4 res[1]['oaf:result']['journal'], // 5 res[1]['oaf:result']['language'], // 6 - res[1]['oaf:result']['eoscifgiudelines'], // 7 + res[1]['oaf:result']['eoscifguidelines'], // 7 res[1]['oaf:result']['subject'], // 8 res[1]['oaf:result']['context'], // 9 res[1]['oaf:result']['creator'], // 10 diff --git a/login/adminLoginGuard.guard.ts b/login/adminLoginGuard.guard.ts index 5c5fb990..0548fb3b 100644 --- a/login/adminLoginGuard.guard.ts +++ b/login/adminLoginGuard.guard.ts @@ -22,7 +22,7 @@ export class AdminLoginGuard implements CanActivate, CanActivateChild { check(data: Data, path: string): Observable { let errorCode = LoginErrorCodes.NOT_LOGIN; - return this.userManagementService.getUserInfo(false).pipe(map(user => { + return this.userManagementService.getUserInfo().pipe(map(user => { if (user) { errorCode = LoginErrorCodes.NOT_ADMIN; } diff --git a/login/claimsCuratorGuard.guard.ts b/login/claimsCuratorGuard.guard.ts index 724f0f0a..2bfce277 100644 --- a/login/claimsCuratorGuard.guard.ts +++ b/login/claimsCuratorGuard.guard.ts @@ -15,7 +15,7 @@ export class ClaimsCuratorGuard implements CanActivate { check(path: string): Observable | boolean { let errorCode = LoginErrorCodes.NOT_LOGIN; - return this.userManagementService.getUserInfo(false).pipe(map(user => { + return this.userManagementService.getUserInfo().pipe(map(user => { if (user) { errorCode = LoginErrorCodes.NOT_ADMIN; } diff --git a/login/loginGuard.guard.ts b/login/loginGuard.guard.ts index 99faad2c..59e72592 100644 --- a/login/loginGuard.guard.ts +++ b/login/loginGuard.guard.ts @@ -22,7 +22,7 @@ export class LoginGuard implements CanActivate, CanLoad, CanActivateChild { } check(path: string): Observable | boolean { - return this.userManagementService.getUserInfo(false).pipe(map(user => { + return this.userManagementService.getUserInfo().pipe(map(user => { return user !== null; }),tap(isLoggedIn => { if(!isLoggedIn) { diff --git a/login/user.component.ts b/login/user.component.ts index d364684f..1f6ee1d8 100644 --- a/login/user.component.ts +++ b/login/user.component.ts @@ -43,8 +43,8 @@ export class UserComponent { this.loginUrl = this.properties.loginUrl; if (typeof document !== 'undefined') { this.server = false; - this.subscriptions.push(this.userManagementsService.getUserInfo(false).subscribe(user => { - this.user = user; + this.userManagementsService.updateUserInfo(() => { + this.user = this.userManagementsService.user; this.loggedIn = !!this.user; this.errorMessage = ""; this.loading = true; @@ -58,7 +58,7 @@ export class UserComponent { this.loading = false; } })); - })); + }); } } diff --git a/monitor/indicators/indicator-themes.component.ts b/monitor/indicators/indicator-themes.component.ts index a583c0c6..06071c58 100644 --- a/monitor/indicators/indicator-themes.component.ts +++ b/monitor/indicators/indicator-themes.component.ts @@ -26,7 +26,7 @@ import {Subscriber} from "rxjs";
Indicator themes that we are covering in the Monitor dashboards.

Please be aware that this is the current set, which will be enriched as requests and data are coming into the - OpenAIRE Research Graph. We are in your disposal to add more indicator themes that may fit your needs. + OpenAIRE Research Graph. We are at your disposal to add more indicator themes that may fit your needs.

Check out the indicator pages (for funders, diff --git a/monitor/methodology/terminology.component.ts b/monitor/methodology/terminology.component.ts index 0c999908..111e30df 100644 --- a/monitor/methodology/terminology.component.ts +++ b/monitor/methodology/terminology.component.ts @@ -1,4 +1,4 @@ -import {Component, OnDestroy, OnInit} from "@angular/core"; +import {ChangeDetectorRef, Component, OnDestroy, OnInit, ViewChild} from "@angular/core"; import {Subscription} from "rxjs"; import {Meta, Title} from "@angular/platform-browser"; import {ActivatedRoute, Router} from "@angular/router"; @@ -7,9 +7,19 @@ import {SEOService} from "../../sharedComponents/SEO/SEO.service"; import {properties} from "../../../../environments/environment"; import {Breadcrumb} from "../../utils/breadcrumbs/breadcrumbs.component"; +declare var ResizeObserver; + @Component({ selector: 'terminology', template: ` +

+
+ + More information for + OpenAIRE Research Graph + . +
+
@@ -361,7 +371,7 @@ import {Breadcrumb} from "../../utils/breadcrumbs/breadcrumbs.component";

APC information is obtained from DOAJ using DOAJ’s exportable version of the journal metadata (https://doaj.org/docs/public-data-dump/). - We used it to determine whether a particular fully OA journal charges APCs.

+ We use it to determine whether a particular fully OA journal charges APCs.


@@ -435,12 +445,12 @@ import {Breadcrumb} from "../../utils/breadcrumbs/breadcrumbs.component"; -
+
` @@ -450,12 +460,16 @@ export class TerminologyComponent implements OnInit, OnDestroy { private subscriptions: any[] = []; public openaireEntities = OpenaireEntities; public breadcrumbs: Breadcrumb[] = [{name: 'home', route: '/'}, {name: 'Resources'}, {name: 'Terminology and construction', keepFormat: true}]; + public graph_offset: number = 0; + public graph_height: number = 0; + @ViewChild("graph_element") graph_element; constructor(private seoService: SEOService, private meta: Meta, private router: Router, private route: ActivatedRoute, - private title: Title) { + private title: Title, + private cdr: ChangeDetectorRef) { } ngOnInit() { @@ -467,6 +481,20 @@ export class TerminologyComponent implements OnInit, OnDestroy { this.breadcrumbs[0].name = (params['stakeholder']?'dashboard':'home'); })); } + + ngAfterViewInit() { + if (typeof document !== 'undefined') { + if(this.graph_element) { + this.observeGraphElement(); + } + } + } + + ngAfterContentChecked() { + if(this.graph_element && typeof document !== 'undefined') { + this.graph_offset = this.calcGraphOffset(this.graph_element.nativeElement); + } + } ngOnDestroy() { this.subscriptions.forEach(subscription => { @@ -475,6 +503,24 @@ export class TerminologyComponent implements OnInit, OnDestroy { } }); } + + public observeGraphElement() { + let resizeObs = new ResizeObserver(entries => { + entries.forEach(entry => { + setTimeout(() => { + this.graph_offset = this.calcGraphOffset(entry.target); + this.cdr.detectChanges(); + }); + }) + }); + this.subscriptions.push(resizeObs); + resizeObs.observe(this.graph_element.nativeElement); + } + + calcGraphOffset(element) { + this.graph_height = element.offsetHeight; + return window.innerHeight-this.graph_height; + } metaTags(title, description) { const url = properties.domain + properties.baseLink + this.router.url; diff --git a/role-verification/role-verification.component.ts b/role-verification/role-verification.component.ts index 609ecd29..c45184f8 100644 --- a/role-verification/role-verification.component.ts +++ b/role-verification/role-verification.component.ts @@ -103,7 +103,7 @@ export class RoleVerificationComponent implements OnInit, OnDestroy, AfterViewIn ngAfterViewInit() { this.subs.push(this.route.queryParams.subscribe(params => { if (params && params['verify']) { - this.subs.push(this.userManagementService.getUserInfo(false).subscribe(user => { + this.subs.push(this.userManagementService.getUserInfo().subscribe(user => { this.user = user; if (this.user) { this.subs.push(this.userRegistryService.getInvitation(params['verify']).subscribe(verification => { diff --git a/searchPages/find/searchAll.component.ts b/searchPages/find/searchAll.component.ts index bc8f5a0d..a9ed7ce3 100644 --- a/searchPages/find/searchAll.component.ts +++ b/searchPages/find/searchAll.component.ts @@ -103,7 +103,7 @@ export class SearchAllComponent { resultTypes = {publication: true, dataset: true, software: true, other: true}; //adv Search Form - public fieldIds: string[] = this.searchFields.RESULT_ADVANCED_FIELDS; + public fieldIds: string[] = this.searchFields.getResultAdvancedFields(); public fieldIdsMap = this.searchFields.RESULT_FIELDS; public selectedFields: AdvancedField[] = []; diff --git a/searchPages/searchResearchResults.component.ts b/searchPages/searchResearchResults.component.ts index e15e3657..37419da8 100644 --- a/searchPages/searchResearchResults.component.ts +++ b/searchPages/searchResearchResults.component.ts @@ -62,7 +62,7 @@ export class SearchResearchResultsComponent { public searchUtils: SearchUtilsClass = new SearchUtilsClass(); public searchFields: SearchFields = new SearchFields(); - public fieldIds: string[] = this.searchFields.RESULT_ADVANCED_FIELDS; + public fieldIds: string[] = this.searchFields.getResultAdvancedFields(); public fieldIdsMap = this.searchFields.RESULT_FIELDS; public rangeFields: string[][] = this.searchFields.RESULT_RANGE_FIELDS; public selectedFields: AdvancedField[] = []; diff --git a/searchPages/searchUtils/newSearchPage.component.ts b/searchPages/searchUtils/newSearchPage.component.ts index 2605c255..69163faa 100644 --- a/searchPages/searchUtils/newSearchPage.component.ts +++ b/searchPages/searchUtils/newSearchPage.component.ts @@ -6,7 +6,7 @@ import { OnChanges, OnDestroy, OnInit, - Output, SimpleChanges, + SimpleChanges, ViewChild } from '@angular/core'; import {Location} from '@angular/common'; @@ -985,7 +985,7 @@ export class NewSearchPageComponent implements OnInit, OnDestroy, OnChanges { } } if (doisParams.length > 0) { - params += this.createQuotedKeywordQuery(value, id, operatorId, countParams, true, true, includes) + (includes?(" or " + doisParams + ")"):")"); + params += this.createQuotedKeywordQuery(value, id, operatorId, countParams, true, true, includes) + " or " + doisParams; } else { //if it is PIDs but no doisquery produced, forced to use quotes as the query will fail due to special characters params += this.createQuotedKeywordQuery(value, id, operatorId, countParams, true, diff --git a/services/user-management.service.ts b/services/user-management.service.ts index d6a1ccd5..d7b640eb 100644 --- a/services/user-management.service.ts +++ b/services/user-management.service.ts @@ -16,22 +16,11 @@ export class UserManagementService { private readonly getUserInfoSubject: AdvancedAsyncSubject = new AdvancedAsyncSubject(); public fixRedirectURL: string = null; private redirectUrl: string = null; - private readonly promise: Promise; private subscription; private readonly routerSubscription; - constructor(private http: HttpClient, private router: Router) { - this.promise = new Promise((resolve => { - this.updateUserInfo(resolve); - })); - this.routerSubscription = this.router.events.subscribe(event => { - if (event instanceof NavigationEnd) { - const token = COOKIE.getCookie('AccessToken'); - if (!token && this.getUserInfoSubject.getValue() !== null) { - this.getUserInfoSubject.next(null); - } - } - }); + constructor(private http: HttpClient) { + this.updateUserInfo(); } clearSubscriptions() { @@ -43,12 +32,12 @@ export class UserManagementService { } } - public getUserInfo(subject: boolean = true): Observable { - if (subject) { - return this.getUserInfoSubject.asObservable(); - } else { - return from(this.getUserInfoAsync()); - } + public get user(): User { + return this.getUserInfoSubject.getValue(); + } + + public getUserInfo(): Observable { + return this.getUserInfoSubject.asObservable(); } public updateUserInfo(resolve: Function = null) { @@ -67,14 +56,6 @@ export class UserManagementService { }); } - private async getUserInfoAsync(): Promise { - await this.promise; - if (this.subscription) { - this.subscription.unsubscribe(); - } - return this.getUserInfoSubject.getValue(); - } - private parseUserInfo(info: any) { const user: User = new User(); user.id = (info.sub && info.sub.indexOf('@')) ? info.sub.substring(0, info.sub.indexOf('@')) : info.sub; @@ -144,6 +125,7 @@ export class UserManagementService { public logout() { this.setRedirectUrl(); Session.removeUser(); + this.getUserInfoSubject.next(null); window.location.href = properties.logoutUrl + "?redirect=" + this.redirectUrl; } } diff --git a/utils/HelperFunctions.class.ts b/utils/HelperFunctions.class.ts index 981fdf21..1b629fb0 100644 --- a/utils/HelperFunctions.class.ts +++ b/utils/HelperFunctions.class.ts @@ -72,11 +72,17 @@ export class HelperFunctions { return Object.keys(value).map(key => value[key]); } - public static getVocabularyLabel(value: any, vocabulary: any) { + public static getVocabularyLabel(value: any, vocabulary: any, returnIfNotFound: boolean = true) { + if(value == undefined || value == null) { + return null; + } if(vocabulary && value in vocabulary) { return vocabulary[value]; } - return value; + if(returnIfNotFound) { + return value; + } + return null; } public static sortSDGs(sgd1: string, sdg2: string): number { diff --git a/utils/modal/alert.ts b/utils/modal/alert.ts index 02b154b7..be4bb605 100644 --- a/utils/modal/alert.ts +++ b/utils/modal/alert.ts @@ -20,14 +20,14 @@ declare var UIkit: any;
-