[develop | DONE | CHANGED ] update catalogue services Ids
This commit is contained in:
parent
44452ac9ee
commit
b044383f33
|
@ -4,7 +4,7 @@ import {HttpClient} from "@angular/common/http";
|
|||
|
||||
export class PluginOpenAIREProducts extends PluginBaseInfo{
|
||||
title:string ="OpenAIRE services for your community";
|
||||
serviceIdsArray = ["argos","zenodo","amnesia"];
|
||||
serviceIdsArray = ["openaire.argos","cern.zenodo","athenarc.amnesia"];
|
||||
compare(oldObject): any {
|
||||
return super.compare(oldObject);
|
||||
}
|
||||
|
|
|
@ -38,17 +38,13 @@ import {PluginBaseFormComponent, PluginEditEvent} from "../../utils/base-plugin.
|
|||
export class PluginOpenaireProductsFormComponent extends PluginBaseFormComponent<PluginOpenAIREProducts>{
|
||||
default = new PluginOpenAIREProducts();
|
||||
services = [];
|
||||
excludedServiceIds = ["openaire_login","research_community_dashboard"]
|
||||
excludedServiceIds = ["openaire.aai","openaire.connect"]
|
||||
api= "https://catalogue.openaire.eu/api/catalogue-resources?from=0&quantity=100&order=asc&orderField=name";
|
||||
showErrorMessage = false;
|
||||
constructor(http:HttpClient) {
|
||||
super()
|
||||
this.subscriptions.push(http.get( this.properties.cacheUrl + encodeURIComponent(this.api)).subscribe(res =>{
|
||||
this.services = res["results"].map( x=> {
|
||||
x.id = x.id.split("openaire.")[1]
|
||||
return x;
|
||||
});
|
||||
this.services = this.services.filter(x=> this.excludedServiceIds.indexOf(x.id) ==-1);
|
||||
this.services = res["results"].filter(x=> this.excludedServiceIds.indexOf(x.id) ==-1);
|
||||
}, error => {
|
||||
this.showErrorMessage = true;
|
||||
}))
|
||||
|
|
Loading…
Reference in New Issue