[develop | DONE | CHANGED] monitor component: handle the case the fos requests gets an error
This commit is contained in:
parent
7dbcaeea1b
commit
a834890ddb
|
@ -62,7 +62,18 @@ export class MonitorComponent extends MonitorIndicatorStakeholderBaseComponent {
|
|||
}
|
||||
this.subscriptions.push(this.searchResearchResultsService.advancedSearchResults("publication", null, 1, 0, null, this.properties,
|
||||
"&refine=true&fields=fos&type=publications", ["fos"], customFilterParams).subscribe(res => {
|
||||
this.filters = this.postProcessingFosFilters(res[2]);
|
||||
this.init(res[2]);
|
||||
}, error =>{
|
||||
this.init(null)
|
||||
}));
|
||||
}
|
||||
}));
|
||||
}
|
||||
}));
|
||||
}));
|
||||
}
|
||||
init(fos){
|
||||
this.filters = this.postProcessingFosFilters(fos);
|
||||
this.title = this.stakeholder.name;
|
||||
this.description = this.stakeholder.name;
|
||||
this.subscriptions.push(this._route.params.subscribe(params => {
|
||||
|
@ -76,14 +87,7 @@ export class MonitorComponent extends MonitorIndicatorStakeholderBaseComponent {
|
|||
this.setMetadata();
|
||||
}));
|
||||
}));
|
||||
}));
|
||||
}
|
||||
}));
|
||||
}
|
||||
}));
|
||||
}));
|
||||
}
|
||||
|
||||
hasPermission(visibility: Visibility): boolean {
|
||||
return true;
|
||||
}
|
||||
|
@ -95,6 +99,7 @@ export class MonitorComponent extends MonitorIndicatorStakeholderBaseComponent {
|
|||
|
||||
postProcessingFosFilters(refineFilters:Filter[]){
|
||||
let filters:Filter[] = [];
|
||||
if(refineFilters) {
|
||||
for (let filter of refineFilters) {
|
||||
if (filter.filterId == "fos") {
|
||||
let fos: Filter = {...filter};
|
||||
|
@ -111,6 +116,7 @@ export class MonitorComponent extends MonitorIndicatorStakeholderBaseComponent {
|
|||
filters.push(filter);
|
||||
}
|
||||
}
|
||||
}
|
||||
let publiclyFunded:Filter = new Filter();
|
||||
publiclyFunded.title = "Publicly funded";
|
||||
|
||||
|
|
Loading…
Reference in New Issue