From c386a4d505a7b26321c23d961bb476dba8e0067d Mon Sep 17 00:00:00 2001 From: FrancescoMolinaro Date: Mon, 18 Dec 2023 12:22:05 +0100 Subject: [PATCH] adapt config for url search --- .../qa/events/quality-assurance-events.component.ts | 7 +++++-- src/config/default-app-config.ts | 4 +++- src/config/quality-assurance.config.ts | 2 +- src/environments/environment.test.ts | 4 +++- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/app/notifications/qa/events/quality-assurance-events.component.ts b/src/app/notifications/qa/events/quality-assurance-events.component.ts index a54186f9571..c22c28f41e9 100644 --- a/src/app/notifications/qa/events/quality-assurance-events.component.ts +++ b/src/app/notifications/qa/events/quality-assurance-events.component.ts @@ -99,7 +99,7 @@ export class QualityAssuranceEventsComponent implements OnInit, OnDestroy { /** * The quality assurance source base url for project search */ - public sourceUrlForProjectSearch = environment.qualityAssuranceConfig.sourceUrlForProjectSearch; + public sourceUrlForProjectSearch: string; /** * The FindListOptions object */ @@ -136,7 +136,10 @@ export class QualityAssuranceEventsComponent implements OnInit, OnDestroy { this.isEventPageLoading.next(true); this.activatedRoute.paramMap.pipe( - map((params) => params.get('topicId')), + tap((params) => { + this.sourceUrlForProjectSearch = environment.qualityAssuranceConfig.sourceUrlMapForProjectSearch[params.get('sourceId')]; + }), + map((params) => params.get('topicId')), take(1), switchMap((id: string) => { const regEx = /!/g; diff --git a/src/config/default-app-config.ts b/src/config/default-app-config.ts index 16de9b2e1c7..2c5a37ab3ef 100644 --- a/src/config/default-app-config.ts +++ b/src/config/default-app-config.ts @@ -435,7 +435,9 @@ export class DefaultAppConfig implements AppConfig { }; qualityAssuranceConfig: QualityAssuranceConfig = { - sourceUrlForProjectSearch: 'https://explore.openaire.eu/search/project?projectId=', + sourceUrlMapForProjectSearch: { + openaire: 'https://explore.openaire.eu/search/project?projectId=' + }, pageSize: 5, }; } diff --git a/src/config/quality-assurance.config.ts b/src/config/quality-assurance.config.ts index 10f4106d7f4..7b2723f9d96 100644 --- a/src/config/quality-assurance.config.ts +++ b/src/config/quality-assurance.config.ts @@ -9,7 +9,7 @@ export class QualityAssuranceConfig implements Config { /** * Url for project search on quality assurance resource */ - public sourceUrlForProjectSearch: string; + public sourceUrlMapForProjectSearch: {[key: string]: string}; /** * default count of QA sources to load */ diff --git a/src/environments/environment.test.ts b/src/environments/environment.test.ts index e882527ee80..8b906764620 100644 --- a/src/environments/environment.test.ts +++ b/src/environments/environment.test.ts @@ -307,7 +307,9 @@ export const environment: BuildConfig = { sortDirection:'ASC', }, qualityAssuranceConfig: { - sourceUrlForProjectSearch: 'https://explore.openaire.eu/search/project?projectId=', + sourceUrlMapForProjectSearch: { + openaire: 'https://explore.openaire.eu/search/project?projectId=' + }, pageSize: 5, },