From 717ead02b2f154c3a91e799ed5701ea23b54f7e8 Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Fri, 23 Sep 2022 12:24:15 +0300 Subject: [PATCH] Make some fixes after update to angular 12 --- claims/claim-utils/service/contexts.service.ts | 4 ++-- connect/community/community.service.ts | 4 ++-- monitor/services/resources.service.ts | 2 +- monitor/services/stakeholder.service.ts | 4 ++-- orcid/orcid.component.ts | 2 +- searchPages/searchResearchResults.component.ts | 4 ++-- utils/configuration/configuration.service.ts | 6 +++--- utils/staticAutoComplete/ISVocabularies.service.ts | 10 +++++----- 8 files changed, 18 insertions(+), 18 deletions(-) diff --git a/claims/claim-utils/service/contexts.service.ts b/claims/claim-utils/service/contexts.service.ts index 5491cd2d..45f40de1 100644 --- a/claims/claim-utils/service/contexts.service.ts +++ b/claims/claim-utils/service/contexts.service.ts @@ -7,7 +7,7 @@ import {properties} from "../../../../../environments/environment"; @Injectable({ providedIn: 'root' }) export class ContextsService { private communitiesSubject: BehaviorSubject = new BehaviorSubject(null); - private promise: Promise; + private promise: Promise; private sub: Subscription = null; constructor(private http: HttpClient=null ) { @@ -34,7 +34,7 @@ export class ContextsService { public initCommunities() { let url = properties.contextsAPI + 's/'; - this.promise = new Promise((resolve => { + this.promise = new Promise((resolve => { this.sub = this.http.get((properties.useLongCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url) .pipe(map(res => this.parseCommunities(res, true) )) .subscribe( diff --git a/connect/community/community.service.ts b/connect/community/community.service.ts index af4caa0f..7bbc5fd5 100644 --- a/connect/community/community.service.ts +++ b/connect/community/community.service.ts @@ -11,7 +11,7 @@ export class CommunityService { public community: BehaviorSubject = new BehaviorSubject(null); public communityId: string = null; - private promise: Promise = null; + private promise: Promise = null; private subs = []; constructor(private http: HttpClient) {} @@ -40,7 +40,7 @@ export class CommunityService { getCommunity(communityId: string, refresh = false) { if (this.communityId !== communityId || !this.community.value || refresh) { this.communityId = communityId; - this.promise = new Promise((resolve, reject) => { + this.promise = new Promise((resolve, reject) => { this.subs.push(this.getCommunityInfo(communityId).subscribe(community => { this.community.next(community); resolve(); diff --git a/monitor/services/resources.service.ts b/monitor/services/resources.service.ts index bb10767e..5708b11a 100644 --- a/monitor/services/resources.service.ts +++ b/monitor/services/resources.service.ts @@ -40,7 +40,7 @@ export class ResourcesService { "", "", false, [], null, {})); items.push(ResourcesService.setLink(new MenuItem("indicator-themes", "Indicator Themes", "", "", false, [], null, {}, null, null, null, null, '_self'), prefix + "/indicators/themes", portal)); - let promise = new Promise(resolve => { + let promise = new Promise(resolve => { this.isPagesEnabled().subscribe(status => { ResourcesService.types.forEach((type, index) => { if (status[index]) { diff --git a/monitor/services/stakeholder.service.ts b/monitor/services/stakeholder.service.ts index 27cfdfe5..8b546afd 100644 --- a/monitor/services/stakeholder.service.ts +++ b/monitor/services/stakeholder.service.ts @@ -23,7 +23,7 @@ export interface Reorder { export class StakeholderService { private stakeholderSubject: BehaviorSubject = null; - private promise: Promise; + private promise: Promise; private sub; constructor(private http: HttpClient, private route: ActivatedRoute) { @@ -46,7 +46,7 @@ export class StakeholderService { getStakeholder(alias: string): Observable { if (!this.stakeholderSubject.value || this.stakeholderSubject.value.alias !== alias) { - this.promise = new Promise((resolve, reject) => { + this.promise = new Promise((resolve, reject) => { this.sub = this.http.get(properties.monitorServiceAPIURL + '/stakeholder/' + encodeURIComponent(alias), CustomOptions.registryOptions()).pipe(map(stakeholder => { return this.formalize(this.checkIsUpload(stakeholder)); })).subscribe(stakeholder => { diff --git a/orcid/orcid.component.ts b/orcid/orcid.component.ts index c5bc05fb..2ae4a8cd 100644 --- a/orcid/orcid.component.ts +++ b/orcid/orcid.component.ts @@ -91,7 +91,7 @@ export class OrcidComponent { this.message = "
Thank you for connecting your ORCID iD with OpenAIRE!
" + "
This window will automatically close and you will be ready to link OpenAIRE research results with your ORCID iD.
"; if(window && window.opener) { - window.opener.postMessage("success"); + window.opener.postMessage("success", "*"); window.close(); } setTimeout(() => { diff --git a/searchPages/searchResearchResults.component.ts b/searchPages/searchResearchResults.component.ts index 37419da8..20faaf4f 100644 --- a/searchPages/searchResearchResults.component.ts +++ b/searchPages/searchResearchResults.component.ts @@ -97,7 +97,7 @@ export class SearchResearchResultsComponent { @Input() stickyForm:boolean = false; private timeoutId; - private promise: Promise = null; + private promise: Promise = null; private publicCommunities = null; @Input() usedBy: string = "search"; @@ -194,7 +194,7 @@ export class SearchResearchResultsComponent { } public getPublicCommunities() { - this.promise = new Promise(resolve => { + this.promise = new Promise(resolve => { this._contextService.getPublicCommunitiesByState().subscribe( data => { if(this.publicCommunities == null) { diff --git a/utils/configuration/configuration.service.ts b/utils/configuration/configuration.service.ts index 7096ed49..33a11e28 100644 --- a/utils/configuration/configuration.service.ts +++ b/utils/configuration/configuration.service.ts @@ -11,7 +11,7 @@ import {properties} from "../../../../environments/environment"; export class ConfigurationService { private communityInformation: BehaviorSubject = new BehaviorSubject(null); private sub: Subscription = null; - private promise: Promise = null; + private promise: Promise = null; constructor(private http: HttpClient) { } @@ -36,7 +36,7 @@ export class ConfigurationService { } public initStaticCommunityInformation(communityInformation: Portal) { - this.promise = new Promise((resolve => { + this.promise = new Promise((resolve => { this.communityInformation.next(communityInformation); resolve(); })); @@ -45,7 +45,7 @@ export class ConfigurationService { public initCommunityInformation(properties: EnvProperties, community: string) { if (community == null) return; let url = properties.adminToolsAPIURL + "/" + properties.adminToolsPortalType + "/" + community + "/full"; - this.promise = new Promise((resolve => { + this.promise = new Promise((resolve => { this.sub = this.http.get((properties.useLongCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url).subscribe( (communityInformation: Portal) => { this.communityInformation.next(communityInformation); diff --git a/utils/staticAutoComplete/ISVocabularies.service.ts b/utils/staticAutoComplete/ISVocabularies.service.ts index 833d6ea9..13529713 100644 --- a/utils/staticAutoComplete/ISVocabularies.service.ts +++ b/utils/staticAutoComplete/ISVocabularies.service.ts @@ -13,7 +13,7 @@ export class ISVocabulariesService { private subjectsVocabulary: BehaviorSubject = new BehaviorSubject(null); private relationsVocabulary: BehaviorSubject = new BehaviorSubject(null); private subscriptions = []; - private vocabulariesPromises: Map> = new Map>(); + private vocabulariesPromises: Map> = new Map>(); constructor(private http: HttpClient) {} ngOnDestroy() { @@ -72,7 +72,7 @@ export class ISVocabulariesService { this.vocabularies.set(vocabularyName, new BehaviorSubject(null)); if(!this.vocabulariesPromises.has(vocabularyName)) { this.vocabulariesPromises.set(vocabularyName, - new Promise(resolve => { + new Promise(resolve => { this.subscriptions.push(this.getVocabularyFromService(vocabularyName, properties).subscribe( vocabularyRes => { this.vocabularies.get(vocabularyName).next(vocabularyRes); @@ -183,7 +183,7 @@ export class ISVocabulariesService { async getProvenanceActionVocabularyFromServiceAsync (vocabularyName: string, properties: EnvProperties): Promise<{}> { if(!this.provenanceActionVocabulary || !this.provenanceActionVocabulary.getValue()) { - await new Promise(resolve => { + await new Promise(resolve => { this.subscriptions.push(this.getProvenanceActionVocabularyFromService(vocabularyName, properties).subscribe( vocabularyRes => { this.provenanceActionVocabulary.next(vocabularyRes); @@ -223,7 +223,7 @@ export class ISVocabulariesService { async getSubjectsVocabularyFromServiceAsync (vocabularyName: string, properties: EnvProperties): Promise<{}> { if(!this.subjectsVocabulary || !this.subjectsVocabulary.getValue()) { - await new Promise(resolve => { + await new Promise(resolve => { this.subscriptions.push(this.getSubjectsVocabularyFromService(vocabularyName, properties).subscribe( vocabularyRes => { // console.log(vocabularyRes); @@ -267,7 +267,7 @@ export class ISVocabulariesService { async getRelationsVocabularyFromServiceAsync (vocabularyName: string, properties: EnvProperties): Promise<{}> { if(!this.relationsVocabulary || !this.relationsVocabulary.getValue()) { - await new Promise(resolve => { + await new Promise(resolve => { this.subscriptions.push(this.getRelationsVocabularyFromService(vocabularyName, properties).subscribe( vocabularyRes => { this.relationsVocabulary.next(vocabularyRes);