[develop | DONE | CHANGED ] update catalogue services Ids

This commit is contained in:
argirok 2024-11-04 13:51:42 +02:00
parent 44452ac9ee
commit b044383f33
2 changed files with 3 additions and 7 deletions

View File

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

View File

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