adapt config for url search

This commit is contained in:
FrancescoMolinaro
2023-12-18 12:22:05 +01:00
parent 9351b582cc
commit c386a4d505
4 changed files with 12 additions and 5 deletions

View File

@@ -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;

View File

@@ -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,
};
}

View File

@@ -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
*/

View File

@@ -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,
},