[pluginsFunctionality | DONE | FIXED] Plugin Openaire services: fix no services appear
This commit is contained in:
parent
d2cc0b0f33
commit
f5850aa781
|
@ -12,10 +12,10 @@ export class PluginOpenAIREProducts extends PluginBaseInfo{
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'plugin-openaire-products',
|
selector: 'plugin-openaire-products',
|
||||||
template: `
|
template: `
|
||||||
<div *ngIf="pluginObject" class="uk-container uk-section">
|
<div *ngIf="pluginObject " class="uk-container uk-section">
|
||||||
<h3>{{pluginObject.title}} </h3>
|
<h3>{{pluginObject.title}} </h3>
|
||||||
|
|
||||||
<div *ngIf="services" uk-slider class="uk-slider">
|
<div *ngIf="services && servicesToShow" uk-slider class="uk-slider">
|
||||||
<ul *ngIf="slides" class="uk-slider-items" uk-height-match="target: .uk-card; row: false">
|
<ul *ngIf="slides" class="uk-slider-items" uk-height-match="target: .uk-card; row: false">
|
||||||
<li *ngFor="let slide of [].constructor(slides); let i=index" class="uk-width-1-1 uk-padding">
|
<li *ngFor="let slide of [].constructor(slides); let i=index" class="uk-width-1-1 uk-padding">
|
||||||
<div class="uk-grid uk-child-width-1-3@m uk-child-width-1-1" uk-grid uk-scrollspy="target: [uk-scrollspy-class]; cls: uk-animation-fade; repeat: true">
|
<div class="uk-grid uk-child-width-1-3@m uk-child-width-1-1" uk-grid uk-scrollspy="target: [uk-scrollspy-class]; cls: uk-animation-fade; repeat: true">
|
||||||
|
@ -51,7 +51,7 @@ export class PluginOpenAIREProducts extends PluginBaseInfo{
|
||||||
export class PluginOpenaireProductsComponent extends PluginBaseComponent<PluginOpenAIREProducts>{
|
export class PluginOpenaireProductsComponent extends PluginBaseComponent<PluginOpenAIREProducts>{
|
||||||
services = null;
|
services = null;
|
||||||
excludedServiceIds = ["openaire_login","research_community_dashboard"]
|
excludedServiceIds = ["openaire_login","research_community_dashboard"]
|
||||||
servicesToShow = [];
|
servicesToShow = null;
|
||||||
slides = 1;
|
slides = 1;
|
||||||
slideItems = 3;
|
slideItems = 3;
|
||||||
api= "https://catalogue.openaire.eu/api/catalogue-resources?from=0&quantity=100&order=asc&orderField=name";
|
api= "https://catalogue.openaire.eu/api/catalogue-resources?from=0&quantity=100&order=asc&orderField=name";
|
||||||
|
@ -64,7 +64,9 @@ export class PluginOpenaireProductsComponent extends PluginBaseComponent<PluginO
|
||||||
if(!this.services) {
|
if(!this.services) {
|
||||||
this.subscriptions.push(this.http.get( this.properties.cacheUrl + encodeURIComponent(this.api)).subscribe(res =>{
|
this.subscriptions.push(this.http.get( this.properties.cacheUrl + encodeURIComponent(this.api)).subscribe(res =>{
|
||||||
this.services = res["results"].map( x=> {
|
this.services = res["results"].map( x=> {
|
||||||
x.id = x.id.split("openaire.")[1]
|
if(x.id.indexOf("openaire.")!=-1){
|
||||||
|
x.id = x.id.split("openaire.")[1]
|
||||||
|
}
|
||||||
return x;
|
return x;
|
||||||
});
|
});
|
||||||
this.services = this.services.filter(x=> this.excludedServiceIds.indexOf(x.id) ==-1);
|
this.services = this.services.filter(x=> this.excludedServiceIds.indexOf(x.id) ==-1);
|
||||||
|
|
Loading…
Reference in New Issue