diff --git a/dashboard/plugins/components/discover-by-subcommunity/plugin-discover-by-subcommunity.component.html b/dashboard/plugins/components/discover-by-subcommunity/plugin-discover-by-subcommunity.component.html index 562d0aed..dd72bf7a 100644 --- a/dashboard/plugins/components/discover-by-subcommunity/plugin-discover-by-subcommunity.component.html +++ b/dashboard/plugins/components/discover-by-subcommunity/plugin-discover-by-subcommunity.component.html @@ -4,7 +4,7 @@ +
+ No products info available + +
`, @@ -50,19 +54,23 @@ export class PluginOpenaireProductsComponent extends PluginBaseComponent{ + this.subscriptions.push(this.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.calculatePages(); + }, error => { + this.showErrorMessage = true; })) }else{ this.calculatePages(); diff --git a/dashboard/plugins/components/openaireProducts/plugin-openaire-products.form.component.ts b/dashboard/plugins/components/openaireProducts/plugin-openaire-products.form.component.ts index eb817a61..7dfc5292 100644 --- a/dashboard/plugins/components/openaireProducts/plugin-openaire-products.form.component.ts +++ b/dashboard/plugins/components/openaireProducts/plugin-openaire-products.form.component.ts @@ -23,6 +23,10 @@ import {PluginBaseFormComponent, PluginEditEvent} from "../../utils/base-plugin. {{service.name}} +
+ No products info available + +
@@ -35,14 +39,18 @@ export class PluginOpenaireProductsFormComponent extends PluginBaseFormComponent default = new PluginOpenAIREProducts(); services = []; excludedServiceIds = ["openaire_login","research_community_dashboard"] + 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("https://explore.openaire.eu/cache/get?url="+ encodeURIComponent("https://catalogue.openaire.eu/api/catalogue-resources?from=0&quantity=100&order=asc&orderField=name")).subscribe(res =>{ + 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); + }, error => { + this.showErrorMessage = true; })) } diff --git a/dashboard/plugins/components/organizations/plugin-organizations.component.html b/dashboard/plugins/components/organizations/plugin-organizations.component.html index 9f0676ab..a6f00c7d 100644 --- a/dashboard/plugins/components/organizations/plugin-organizations.component.html +++ b/dashboard/plugins/components/organizations/plugin-organizations.component.html @@ -1,5 +1,5 @@
diff --git a/dashboard/plugins/components/search-deposit-link/plugin-search-deposit-link.component.html b/dashboard/plugins/components/search-deposit-link/plugin-search-deposit-link.component.html index 48ec6083..5e2a8e3e 100644 --- a/dashboard/plugins/components/search-deposit-link/plugin-search-deposit-link.component.html +++ b/dashboard/plugins/components/search-deposit-link/plugin-search-deposit-link.component.html @@ -16,6 +16,10 @@ {{card.title}}
{{card.description}}
+ + {{url.linkText}} + diff --git a/dashboard/plugins/components/search-deposit-link/plugin-search-deposit-link.component.ts b/dashboard/plugins/components/search-deposit-link/plugin-search-deposit-link.component.ts index 0b9cdba0..41092115 100644 --- a/dashboard/plugins/components/search-deposit-link/plugin-search-deposit-link.component.ts +++ b/dashboard/plugins/components/search-deposit-link/plugin-search-deposit-link.component.ts @@ -11,11 +11,11 @@ export class PluginSearchDepositLink extends PluginBaseInfo{ image:'https://' + (properties.environment == 'production'?'':'beta.') + 'connect.openaire.eu/assets/connect-assets/home/4.png',show:true}, {tag: "DEPOSIT YOUR RESEARCH OUTCOME", title: "Publish your research in Open Access.", description:"" - , urlsArray:[ new PluginURL("/participate/deposit/learn-how","Start searching", null, true)], + , urlsArray:[ new PluginURL("/participate/deposit/learn-how","Deposit your research", null, true)], image:'https://' + (properties.environment == 'production'?'':'beta.') + 'connect.openaire.eu/assets/connect-assets/home/1.png',show:true}, {tag: "LINK YOUR RESEARCH", title: "Contribute to your community.", description:"" - , urlsArray:[ new PluginURL("/participate/claim","Start searching", null, true)], + , urlsArray:[ new PluginURL("/participate/claim","Link your Research searching", null, true)], image:'https://' + (properties.environment == 'production'?'':'beta.') + 'connect.openaire.eu/assets/connect-assets/home/2.png',show:true}, ]; diff --git a/dashboard/plugins/components/search-deposit-link/plugin-search-deposit-link.form.component.ts b/dashboard/plugins/components/search-deposit-link/plugin-search-deposit-link.form.component.ts index f2c2838d..5371c57c 100644 --- a/dashboard/plugins/components/search-deposit-link/plugin-search-deposit-link.form.component.ts +++ b/dashboard/plugins/components/search-deposit-link/plugin-search-deposit-link.form.component.ts @@ -44,14 +44,6 @@ import {PluginBaseFormComponent, PluginEditEvent} from "../../utils/base-plugin. -
-
- -
-
- -
+ +
Link #{{j + 1}}
+
+ +
+
+ +
+
+ `, @@ -95,10 +91,8 @@ export class PluginSearchDepositLinkFormComponent extends PluginBaseFormComponen } cardShowChanged(i, $event: PluginEditEvent) { - this.pluginObject.cardInfoArray[i].show = $event.value; $event.value = this.pluginObject.cardInfoArray; - this.valuesChanged.emit({field: $event.field, value: $event.value, type: 'parent'}) } @@ -107,6 +101,18 @@ export class PluginSearchDepositLinkFormComponent extends PluginBaseFormComponen $event.value = this.pluginObject.cardInfoArray; this.valuesChanged.emit({field: "cardInfoArray", value: $event.value, type: 'parent'}) } + cardUrlValueChanged(i, j, $event: PluginEditEvent) { + if (this.editTemplate) { + this.pluginObject.cardInfoArray[i].urlsArray[j][$event.field] = $event.value; + $event.value = this.pluginObject.cardInfoArray; + } else { + this.pluginObject.cardInfoArray[i].urlsArray[j][$event.field] = $event.value; + $event.value = this.pluginObject.cardInfoArray; + } + + this.valuesChanged.emit({field: "cardInfoArray", value: $event.value, type: 'parent'}) + } + edit(i) { this.selectedIndex = i; this.toggleSubMenu(true); diff --git a/dashboard/plugins/plugins-form/pluginsForm.component.ts b/dashboard/plugins/plugins-form/pluginsForm.component.ts index e845ba2f..376e1aa7 100644 --- a/dashboard/plugins/plugins-form/pluginsForm.component.ts +++ b/dashboard/plugins/plugins-form/pluginsForm.component.ts @@ -250,7 +250,7 @@ export class PluginsFormComponent implements OnInit { this.savePlugin(plugin,update, this.index) } public savePlugin(plugin, update, index){ - this.subscriptions.push(this._pluginsService.savePlugin(plugin, this.properties.adminToolsAPIURL).subscribe( + this.subscriptions.push(this._pluginsService.savePlugin(plugin, this.properties.adminToolsAPIURL, this.selectedCommunityPid).subscribe( saved => { this.savedSuccessfully(saved, update, index); this.editView = false; @@ -365,7 +365,7 @@ export class PluginsFormComponent implements OnInit { this.index = i; this.selectedTemplate = this.pluginsByPlacement.get(placement)[i].template; if(id) { - this.subscriptions.push(this._pluginsService.togglePlugin(id, status, this.properties.adminToolsAPIURL).subscribe( + this.subscriptions.push(this._pluginsService.togglePlugin(id, status, this.properties.adminToolsAPIURL, this.selectedCommunityPid).subscribe( () => { this.pluginsByPlacement.get(placement)[i].plugin.active = status; @@ -406,7 +406,7 @@ export class PluginsFormComponent implements OnInit { } public move(plugin: Plugin, up:boolean, index, placement) { if(plugin._id) { - this.subscriptions.push(this._pluginsService.updatePluginOrder(plugin, this.properties.adminToolsAPIURL, up ? -1 : 1).subscribe( + this.subscriptions.push(this._pluginsService.updatePluginOrder(plugin, this.properties.adminToolsAPIURL, up ? -1 : 1, this.selectedCommunityPid).subscribe( saved => { this.pluginsByPlacement.get(placement)[index].plugin = saved; }, diff --git a/dashboard/plugins/plugins.component.html b/dashboard/plugins/plugins.component.html index b39f3395..d94a1afc 100644 --- a/dashboard/plugins/plugins.component.html +++ b/dashboard/plugins/plugins.component.html @@ -166,7 +166,7 @@
+ [pluginObject]="pluginGroup.plugin.object" [previewInAdmin]="true">
@@ -243,7 +243,7 @@ + class="uk-width-1-1" [previewInAdmin]="true"> diff --git a/dashboard/plugins/plugins.component.ts b/dashboard/plugins/plugins.component.ts index 572cf52c..f7a6200f 100644 --- a/dashboard/plugins/plugins.component.ts +++ b/dashboard/plugins/plugins.component.ts @@ -259,7 +259,7 @@ export class PluginsComponent implements OnInit { this.savePlugin(plugin,update, this.index) } public savePlugin(plugin, update, index){ - this.subscriptions.push(this._pluginsService.savePlugin(plugin, this.properties.adminToolsAPIURL).subscribe( + this.subscriptions.push(this._pluginsService.savePlugin(plugin, this.properties.adminToolsAPIURL, this.selectedCommunityPid).subscribe( saved => { this.savedSuccessfully(saved, update, index); this.editView = false; @@ -374,7 +374,7 @@ export class PluginsComponent implements OnInit { this.index = i; this.selectedTemplate = this.pluginsByPlacement.get(placement)[i].template; if(id) { - this.subscriptions.push(this._pluginsService.togglePlugin(id, status, this.properties.adminToolsAPIURL).subscribe( + this.subscriptions.push(this._pluginsService.togglePlugin(id, status, this.properties.adminToolsAPIURL, this.selectedCommunityPid).subscribe( () => { this.pluginsByPlacement.get(placement)[i].plugin.active = status; @@ -415,7 +415,7 @@ export class PluginsComponent implements OnInit { } public move(plugin: Plugin, up:boolean, index, placement) { if(plugin._id) { - this.subscriptions.push(this._pluginsService.updatePluginOrder(plugin, this.properties.adminToolsAPIURL, up ? -1 : 1).subscribe( + this.subscriptions.push(this._pluginsService.updatePluginOrder(plugin, this.properties.adminToolsAPIURL, up ? -1 : 1, this.selectedCommunityPid).subscribe( saved => { this.pluginsByPlacement.get(placement)[index].plugin = saved; }, diff --git a/dashboard/plugins/utils/base-plugin.component.ts b/dashboard/plugins/utils/base-plugin.component.ts index 8af6e719..21db00dd 100644 --- a/dashboard/plugins/utils/base-plugin.component.ts +++ b/dashboard/plugins/utils/base-plugin.component.ts @@ -54,6 +54,7 @@ export class PluginInfoCards{ @Input() plugin:Plugin; @Input() pluginTemplate:PluginTemplate; @Input() pluginObject:T; + @Input() previewInAdmin:boolean = false; subscriptions = []; constructor() { diff --git a/dashboard/plugins/wrapper/plugin-edit-wrapper.component.ts b/dashboard/plugins/wrapper/plugin-edit-wrapper.component.ts index 453576c8..37098681 100644 --- a/dashboard/plugins/wrapper/plugin-edit-wrapper.component.ts +++ b/dashboard/plugins/wrapper/plugin-edit-wrapper.component.ts @@ -20,7 +20,7 @@ import {PluginUtils} from "../utils/pluginUtils"; - + diff --git a/dashboard/plugins/wrapper/plugin-wrapper.component.ts b/dashboard/plugins/wrapper/plugin-wrapper.component.ts index 729c6a77..8a0753ef 100644 --- a/dashboard/plugins/wrapper/plugin-wrapper.component.ts +++ b/dashboard/plugins/wrapper/plugin-wrapper.component.ts @@ -9,37 +9,37 @@ import {PluginUtils} from "../utils/pluginUtils";
- + - + - + - + - + - + - + - + - + - + - +
@@ -54,6 +54,7 @@ export class PluginWrapperComponent implements OnInit { @Input() plugin:Plugin; @Input() pluginObject; @Input() pluginTemplate:PluginTemplate; + @Input() previewInAdmin:boolean = false; pluginUtils = new PluginUtils(); ngOnInit(): void {