Skip to content

Commit

Permalink
adapt config for url search
Browse files Browse the repository at this point in the history
  • Loading branch information
FrancescoMolinaro committed Dec 18, 2023
1 parent 9351b58 commit c386a4d
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down Expand Up @@ -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;
Expand Down
4 changes: 3 additions & 1 deletion src/config/default-app-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
}
2 changes: 1 addition & 1 deletion src/config/quality-assurance.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
4 changes: 3 additions & 1 deletion src/environments/environment.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},

Expand Down

0 comments on commit c386a4d

Please sign in to comment.