[plugins-functionality | WIP ] updates and fixes after initial beta release

This commit is contained in:
argirok 2024-03-28 12:37:00 +02:00
parent 25051df626
commit a1b49630db
18 changed files with 114 additions and 79 deletions

View File

@ -4,7 +4,7 @@
</h3>
<ul *ngIf="subcommunities" class="uk-subnav uk-subnav-pill uk-flex uk-flex-center">
<li *ngFor="let item of subcommunities.slice(0,15)" class="uk-margin-small-bottom">
<a [routerLink]="properties.searchLinkToAdvancedResults" [queryParams]="{f0:'conceptname', fv0:item.label}">
<a [routerLink]="properties.searchLinkToAdvancedResults" [queryParams]="{f0:'conceptname', fv0:item.label}" [class.uk-disabled] =previewInAdmin>
<!--{{item.category}} : {{item.subCommunityId}} - --> {{item.label}}
</a>
</li>

View File

@ -26,7 +26,7 @@
<ng-container *ngFor="let result of results.slice((page-1)*slideItems,(page)*slideItems)">
<result-preview [properties]="properties" [showOrganizations]="true"
[showSubjects]="true" [result]="result" [showEnermaps]="true"
[isCard]="true" [showEntityActions]="false">
[isCard]="true" [showEntityActions]="false" [class.uk-disabled] =previewInAdmin>
</result-preview>
</ng-container>
</div>

View File

@ -73,7 +73,7 @@
<ng-container *ngIf="community">
<div *ngIf="isRouteEnabled('/curators') && isVisible('curators')"
class="uk-text-small uk-margin-xsmall-bottom">
class="uk-text-small uk-margin-xsmall-bottom" [class.uk-disabled] =previewInAdmin>
<curators [longView]="false"></curators>
</div>
<div *ngIf="community.date && isVisible('date')" class="uk-text-small">
@ -86,7 +86,7 @@
class="uk-flex uk-flex-column uk-margin-bottom info-number">
<a class="uk-h5 uk-margin-remove" [queryParams]=params
routerLinkActive="router-link-active"
[routerLink]="searchLinkToProjects">
[routerLink]="searchLinkToProjects" [class.uk-disabled] =previewInAdmin>
{{projectTotal|number}}
</a>
<span class="uk-flex uk-flex-middle uk-text-small">
@ -94,7 +94,7 @@
<a *ngIf="projectsCalculated && (projectTotal && projectTotal > 0 && isEntityEnabled('project') && isRouteEnabled(searchLinkToProjects))"
[title]="buildProjectsTooltip()"
[attr.uk-tooltip]="'pos: bottom-right; delay: 10;'"
class="uk-link-reset uk-margin-xsmall-left">
class="uk-link-reset uk-margin-xsmall-left" [class.uk-disabled] =previewInAdmin>
<icon [name]="'help_outline'" [type]="'outlined'" [ratio]="0.8" [flex]="true"
[customClass]="'uk-text-muted'"></icon>
</a>
@ -105,7 +105,7 @@
class="uk-flex uk-flex-column info-number">
<a class="uk-h5 uk-margin-remove" [queryParams]=params
routerLinkActive="router-link-active"
[routerLink]="searchLinkToDataProviders">
[routerLink]="searchLinkToDataProviders" [class.uk-disabled] =previewInAdmin>
{{contentProviderTotal|number}}
</a>
<span class="uk-flex uk-flex-middle uk-text-small">
@ -113,7 +113,7 @@
<a *ngIf="contentProvidersCalculated && (contentProviderTotal && contentProviderTotal > 0 && isEntityEnabled('datasource') && isRouteEnabled(searchLinkToDataProviders))"
[title]="buildContentProvidersTooltip()"
[attr.uk-tooltip]="'pos: bottom-right; delay: 10;'"
class="uk-link-reset uk-margin-xsmall-left">
class="uk-link-reset uk-margin-xsmall-left" [class.uk-disabled] =previewInAdmin>
<icon [name]="'help_outline'" [type]="'outlined'" [ratio]="0.8" [flex]="true"
[customClass]="'uk-text-muted'"></icon>
</a>
@ -125,14 +125,14 @@
&& isVisible('communities')"
class="uk-flex uk-flex-column uk-margin-bottom info-number">
<a class="uk-h5 uk-margin-remove" [queryParams]=params
routerLinkActive="router-link-active" [routerLink]="shareInZenodoPage">
routerLinkActive="router-link-active" [routerLink]="shareInZenodoPage" [class.uk-disabled] =previewInAdmin>
{{zenodoCommunityIdS.length + ((masterZenodoCommunity) ? 1 : 0)}}
</a>
<span class="uk-flex uk-flex-middle uk-text-small">
Linked Zenodo Communities
<a [title]="buildZenodoCommunitiesTooltip()"
[attr.uk-tooltip]="'pos: bottom-right; delay: 10;'"
class="uk-link-reset uk-margin-xsmall-left">
class="uk-link-reset uk-margin-xsmall-left" [class.uk-disabled] =previewInAdmin>
<icon [name]="'help_outline'" [type]="'outlined'" [ratio]="0.8" [flex]="true"
[customClass]="'uk-text-muted'"></icon>
</a>
@ -142,7 +142,7 @@
*ngIf="isRouteEnabled('/subjects') && displayedAllSubjects && displayedAllSubjects.length > 0 && isVisible('subjects')"
class="uk-flex uk-flex-column uk-margin-bottom info-number">
<a class="uk-h5 uk-margin-remove"
routerLinkActive="router-link-active" [routerLink]="'/subjects'">
routerLinkActive="router-link-active" [routerLink]="'/subjects'" [class.uk-disabled] =previewInAdmin>
{{displayedAllSubjects.length}}
</a>
<span class="uk-text-small">
@ -162,7 +162,7 @@
<icon [name]="'description'" [type]="'outlined'" [ratio]="2" [flex]="true"
[customClass]="'uk-margin-small-right uk-text-secondary'"></icon>
<a [queryParams]="getParamsForSearchLink('publications')"
[routerLink]="properties.searchLinkToAdvancedResults"
[routerLink]="properties.searchLinkToAdvancedResults" [class.uk-disabled] =previewInAdmin
class="uk-link-reset uk-flex uk-flex-column">
<span class="uk-text-xsmall">
{{openaireEntities.PUBLICATIONS}}
@ -178,7 +178,7 @@
<icon [name]="'database'" [type]="'outlined'" [ratio]="2" [flex]="true"
[customClass]="'uk-margin-small-right uk-text-secondary'"></icon>
<a [queryParams]="getParamsForSearchLink('datasets')" [routerLink]="properties.searchLinkToAdvancedResults"
class="uk-link-reset uk-flex uk-flex-column">
class="uk-link-reset uk-flex uk-flex-column" [class.uk-disabled] =previewInAdmin>
<span class="uk-text-xsmall">
{{openaireEntities.DATASETS}}
</span>
@ -205,7 +205,7 @@
<icon [name]="'integration_instructions'" [type]="'outlined'" [ratio]="2" [flex]="true"
[customClass]="'uk-margin-small-right uk-text-secondary'"></icon>
<a [queryParams]="getParamsForSearchLink('software')" [routerLink]="properties.searchLinkToAdvancedResults"
class="uk-link-reset uk-flex uk-flex-column">
class="uk-link-reset uk-flex uk-flex-column" [class.uk-disabled] =previewInAdmin>
<span class="uk-text-xsmall">
{{openaireEntities.SOFTWARE}}
</span>
@ -220,7 +220,7 @@
<icon [name]="'apps'" [type]="'outlined'" [ratio]="2" [flex]="true"
[customClass]="'uk-margin-small-right uk-text-secondary'"></icon>
<a [queryParams]="getParamsForSearchLink('other')" [routerLink]="properties.searchLinkToAdvancedResults"
class="uk-link-reset uk-flex uk-flex-column">
class="uk-link-reset uk-flex uk-flex-column" [class.uk-disabled] =previewInAdmin>
<span class="uk-text-xsmall">
{{openaireEntities.OTHER}}
</span>

View File

@ -17,7 +17,7 @@
<div class="uk-text-center uk-margin-bottom description">
{{card.description}}
</div>
<a *ngFor="let url of card.urlsArray" [href]="card.url"
<a *ngFor="let url of card.urlsArray" [href]="card.url" [class.uk-hidden]="!(url.url && url.url.length > 0)"
class="uk-display-inline-block uk-text-uppercase uk-button uk-button-text uk-text-default"
[target]="url.target">
{{url.linkText}}

View File

@ -18,7 +18,8 @@
<div class="uk-text-center uk-margin-bottom description">
{{card.description}}
</div>
<a *ngFor="let url of card.urls" [href]="url.url" class="uk-display-inline-block uk-text-uppercase uk-button uk-button-text uk-text-default" [target]="url.target">
<a *ngFor="let url of card.urlsArray" [href]="url.url" class="uk-display-inline-block uk-text-uppercase uk-button uk-button-text uk-text-default" [target]="url.target"
[class.uk-hidden]="!(url.url && url.url.length > 0)">
{{url.linkText}}
</a>
</div>

View File

@ -44,14 +44,6 @@ import {PluginBaseFormComponent, PluginEditEvent} from "../../utils/base-plugin.
</a>
</div>
<!--<div class="uk-text-small">
Enable
<plugin-field-edit [value]=" pluginObject.cardInfoArray[selectedIndex].show"
type="boolean" field="cardInfoArray" (editClicked)="pluginEditEvent = $event"
(changed)="cardShowChanged(selectedIndex,$event)">
</plugin-field-edit>
</div>-->
<div class="uk-margin-top">
<plugin-field-edit [value]="pluginObject.cardInfoArray[selectedIndex].title"
type="text" field="title"
@ -62,16 +54,19 @@ import {PluginBaseFormComponent, PluginEditEvent} from "../../utils/base-plugin.
type="text" field="description"
(changed)="cardValueChanged(selectedIndex, $event)"></plugin-field-edit>
</div>
<!--<div class="uk-margin-top">
<plugin-field-edit [value]=" pluginObject.cardInfoArray[selectedIndex].urlsArray"
type="text" field="url"
(changed)="cardValueChanged(selectedIndex, $event)"></plugin-field-edit>
</div>
<div class="uk-margin-top">
<plugin-field-edit [value]=" pluginObject.cardInfoArray[selectedIndex].urlsArray"
type="text" field="linkText" placeholder="Link text"
(changed)="cardValueChanged(selectedIndex, $event)"></plugin-field-edit>
</div>-->
<ng-container *ngFor="let cardUrl of pluginObject.cardInfoArray[selectedIndex].urlsArray; let j = index ">
<div class=" uk-margin-top uk-text-meta uk-text-xsmall"> Link #{{j + 1}}</div>
<div class="uk-margin-small-top">
<plugin-field-edit [value]=" cardUrl.url"
type="text" field="url"
(changed)="cardUrlValueChanged(selectedIndex, j, $event)"></plugin-field-edit>
</div>
<div class="uk-margin-top">
<plugin-field-edit [value]=" cardUrl.linkText"
type="text" field="linkText" placeholder="Link text"
(changed)="cardUrlValueChanged(selectedIndex, j, $event)"></plugin-field-edit>
</div>
</ng-container>
</ng-container>
</div>
@ -105,6 +100,17 @@ export class PluginLearnAndConnectFormComponent extends PluginBaseFormComponent<
$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;

View File

@ -38,6 +38,10 @@ export class PluginOpenAIREProducts extends PluginBaseInfo{
</ul>
<ul class="uk-slider-nav uk-dotnav uk-flex-center uk-margin-medium-top"></ul>
</div>
<div *ngIf="showErrorMessage" class="uk-text-muted uk-text-center">
No products info available
</div>
</div>
`,
@ -50,19 +54,23 @@ export class PluginOpenaireProductsComponent extends PluginBaseComponent<PluginO
servicesToShow = [];
slides = 1;
slideItems = 3;
api= "https://catalogue.openaire.eu/api/catalogue-resources?from=0&quantity=100&order=asc&orderField=name";
showErrorMessage = false;
constructor(private http:HttpClient) {
super()
}
ngOnInit(): void {
super.ngOnInit();
if(!this.services) {
this.subscriptions.push(this.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(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();

View File

@ -23,6 +23,10 @@ import {PluginBaseFormComponent, PluginEditEvent} from "../../utils/base-plugin.
{{service.name}}
</div>
</ng-container>
<div *ngIf="showErrorMessage" class="uk-text-muted uk-text-center">
No products info available
</div>
</div>
@ -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;
}))
}

View File

@ -1,5 +1,5 @@
<div *ngIf=" portal && isRouteEnabled('/organizations')" class="plugin-featured-datasets uk-container uk-container-large uk-section">
<affiliations [longView]="false" [getAffiliationsFromAPI]="true" [communityFirstPage]="true"></affiliations>
<affiliations [longView]="false" [getAffiliationsFromAPI]="true" [communityFirstPage]="true" [class.uk-disabled] =previewInAdmin></affiliations>
</div>
<div *ngIf="!portal " class="uk-text-muted uk-text-center">

View File

@ -16,6 +16,10 @@
{{card.title}}
</div>
<div class="uk-text-small">{{card.description}}</div>
<a *ngFor="let url of card.urlsArray" [route]="url.url" class="uk-display-inline-block uk-text-uppercase uk-button uk-button-text uk-text-default" [target]="url.target"
[class.uk-hidden]="!(url.url && url.url.length > 0)">
{{url.linkText}}
</a>
</slider-nav-item>
</ng-container>
</ng-container>

View File

@ -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},
];

View File

@ -44,14 +44,6 @@ import {PluginBaseFormComponent, PluginEditEvent} from "../../utils/base-plugin.
</a>
</div>
<!--<div class="uk-text-small">
Enable
<plugin-field-edit [value]=" pluginObject.cardInfoArray[selectedIndex].show"
type="boolean" field="cardInfoArray" (editClicked)="pluginEditEvent = $event"
(changed)="cardShowChanged(selectedIndex,$event)">
</plugin-field-edit>
</div>-->
<div class="uk-margin-top">
<plugin-field-edit [value]="pluginObject.cardInfoArray[selectedIndex].title"
type="text" field="title"
@ -62,19 +54,23 @@ import {PluginBaseFormComponent, PluginEditEvent} from "../../utils/base-plugin.
type="text" field="description"
(changed)="cardValueChanged(selectedIndex, $event)"></plugin-field-edit>
</div>
<div class="uk-margin-top">
<plugin-field-edit [value]=" pluginObject.cardInfoArray[selectedIndex].url"
type="text" field="url"
(changed)="cardValueChanged(selectedIndex, $event)"></plugin-field-edit>
</div>
<div class="uk-margin-top">
<plugin-field-edit [value]=" pluginObject.cardInfoArray[selectedIndex].linkText"
type="text" field="linkText" placeholder="Link text"
(changed)="cardValueChanged(selectedIndex, $event)"></plugin-field-edit>
</div>
<ng-container *ngFor="let cardUrl of pluginObject.cardInfoArray[selectedIndex].urlsArray; let j = index ">
<div class=" uk-margin-top uk-text-meta uk-text-xsmall"> Link #{{j + 1}}</div>
<div class="uk-margin-small-top">
<plugin-field-edit [value]=" cardUrl.url"
type="text" field="url"
(changed)="cardUrlValueChanged(selectedIndex, j, $event)"></plugin-field-edit>
</div>
<div class="uk-margin-top">
<plugin-field-edit [value]=" cardUrl.linkText"
type="text" field="linkText" placeholder="Link text"
(changed)="cardUrlValueChanged(selectedIndex, j, $event)"></plugin-field-edit>
</div>
</ng-container>
</ng-container>
</div>
`,
@ -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);

View File

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

View File

@ -166,7 +166,7 @@
<div class="uk-accordion-content">
<ng-container *ngIf="pluginGroup.openPreview">
<plugin-wrapper [pluginTemplate]="pluginGroup.template" [plugin]="pluginGroup.plugin"
[pluginObject]="pluginGroup.plugin.object"></plugin-wrapper>
[pluginObject]="pluginGroup.plugin.object" [previewInAdmin]="true"></plugin-wrapper>
</ng-container>
</div>
</li>
@ -243,7 +243,7 @@
<plugin-wrapper *ngIf="this.templateForm" [pluginTemplate]="selectedTemplate"
[plugin]="this.templateForm.getRawValue()"
[pluginObject]="this.selectedPlugin.object"
class="uk-width-1-1"></plugin-wrapper>
class="uk-width-1-1" [previewInAdmin]="true"></plugin-wrapper>
</ng-container>
</div>
</div>

View File

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

View File

@ -54,6 +54,7 @@ export class PluginInfoCards{
@Input() plugin:Plugin;
@Input() pluginTemplate:PluginTemplate;
@Input() pluginObject:T;
@Input() previewInAdmin:boolean = false;
subscriptions = [];
constructor() {

View File

@ -20,7 +20,7 @@ import {PluginUtils} from "../utils/pluginUtils";
<plugin-gateway-information-form [plugin]="plugin" [pluginTemplate]="pluginTemplate" [pluginObject]="pluginObject" (valuesChanged)="changed.emit($event)" [editTemplate]="editTemplate"></plugin-gateway-information-form>
</ng-container>
<ng-container *ngIf="pluginTemplate.code == 'search-deposit-link'">
<plugin-search-deposit-link-form [plugin]="plugin" [pluginTemplate]="pluginTemplate" [pluginObject]="pluginObject" (valuesChanged)="changed.emit($event)" [editTemplate]="editTemplate"></plugin-search-deposit-link-form>
<plugin-search-deposit-link-form [plugin]="plugin" [pluginTemplate]="pluginTemplate" [pluginObject]="pluginObject" (valuesChanged)="changed.emit($event)" [editTemplate]="editTemplate" [editSubmenuOpen]="editSubmenuOpen"></plugin-search-deposit-link-form>
</ng-container>
<ng-container *ngIf="pluginTemplate.code == 'learn-and-connect'">
<plugin-learn-and-connect-form [plugin]="plugin" [pluginTemplate]="pluginTemplate" [pluginObject]="pluginObject" (valuesChanged)="changed.emit($event)" [editTemplate]="editTemplate" [editSubmenuOpen]="editSubmenuOpen"></plugin-learn-and-connect-form>

View File

@ -9,37 +9,37 @@ import {PluginUtils} from "../utils/pluginUtils";
<ng-container *ngIf="pluginTemplate && pluginObject">
<div *ngIf="pluginTemplate.code && pluginUtils.availablePluginCodes.indexOf(pluginTemplate.code) != -1; else noplugin">
<ng-container *ngIf="pluginTemplate.code == 'openaire-products'">
<plugin-openaire-products [plugin]="plugin" [pluginTemplate]="pluginTemplate" [pluginObject]="pluginObject" ></plugin-openaire-products>
<plugin-openaire-products [plugin]="plugin" [pluginTemplate]="pluginTemplate" [pluginObject]="pluginObject" [previewInAdmin]="previewInAdmin" ></plugin-openaire-products>
</ng-container>
<ng-container *ngIf="pluginTemplate.code == 'discover-by-subcommunity'">
<plugin-discover-by-subcommunity [plugin]="plugin" [pluginTemplate]="pluginTemplate" [pluginObject]="pluginObject" ></plugin-discover-by-subcommunity>
<plugin-discover-by-subcommunity [plugin]="plugin" [pluginTemplate]="pluginTemplate" [pluginObject]="pluginObject" [previewInAdmin]="previewInAdmin" ></plugin-discover-by-subcommunity>
</ng-container>
<ng-container *ngIf="pluginTemplate.code == 'gateway-information'">
<plugin-gateway-information [plugin]="plugin" [pluginTemplate]="pluginTemplate" [pluginObject]="pluginObject" ></plugin-gateway-information>
<plugin-gateway-information [plugin]="plugin" [pluginTemplate]="pluginTemplate" [pluginObject]="pluginObject" [previewInAdmin]="previewInAdmin" ></plugin-gateway-information>
</ng-container>
<ng-container *ngIf="pluginTemplate.code == 'search-deposit-link'">
<plugin-search-deposit-link [plugin]="plugin" [pluginTemplate]="pluginTemplate" [pluginObject]="pluginObject" ></plugin-search-deposit-link>
<plugin-search-deposit-link [plugin]="plugin" [pluginTemplate]="pluginTemplate" [pluginObject]="pluginObject" [previewInAdmin]="previewInAdmin" ></plugin-search-deposit-link>
</ng-container>
<ng-container *ngIf="pluginTemplate.code == 'learn-and-connect'">
<plugin-learn-and-connect [plugin]="plugin" [pluginTemplate]="pluginTemplate" [pluginObject]="pluginObject" ></plugin-learn-and-connect>
<plugin-learn-and-connect [plugin]="plugin" [pluginTemplate]="pluginTemplate" [pluginObject]="pluginObject" [previewInAdmin]="previewInAdmin" ></plugin-learn-and-connect>
</ng-container>
<ng-container *ngIf="pluginTemplate.code == 'how-to-use'">
<plugin-how-to-use [plugin]="plugin" [pluginTemplate]="pluginTemplate" [pluginObject]="pluginObject" ></plugin-how-to-use>
<plugin-how-to-use [plugin]="plugin" [pluginTemplate]="pluginTemplate" [pluginObject]="pluginObject" [previewInAdmin]="previewInAdmin" ></plugin-how-to-use>
</ng-container>
<ng-container *ngIf="pluginTemplate.code == 'suggested-repositories'">
<plugin-suggested-repositories [plugin]="plugin" [pluginTemplate]="pluginTemplate" [pluginObject]="pluginObject" ></plugin-suggested-repositories>
<plugin-suggested-repositories [plugin]="plugin" [pluginTemplate]="pluginTemplate" [pluginObject]="pluginObject" [previewInAdmin]="previewInAdmin" ></plugin-suggested-repositories>
</ng-container>
<ng-container *ngIf="pluginTemplate.code == 'featured-datasets'">
<plugin-featured-datasets [plugin]="plugin" [pluginTemplate]="pluginTemplate" [pluginObject]="pluginObject" ></plugin-featured-datasets>
<plugin-featured-datasets [plugin]="plugin" [pluginTemplate]="pluginTemplate" [pluginObject]="pluginObject" [previewInAdmin]="previewInAdmin" ></plugin-featured-datasets>
</ng-container>
<ng-container *ngIf="pluginTemplate.code == 'organizations'">
<plugin-organizations [plugin]="plugin" [pluginTemplate]="pluginTemplate" [pluginObject]="pluginObject" ></plugin-organizations>
<plugin-organizations [plugin]="plugin" [pluginTemplate]="pluginTemplate" [pluginObject]="pluginObject" [previewInAdmin]="previewInAdmin" ></plugin-organizations>
</ng-container>
<ng-container *ngIf="pluginTemplate.code == 'graph-info'">
<plugin-graph-info [plugin]="plugin" [pluginTemplate]="pluginTemplate" [pluginObject]="pluginObject" ></plugin-graph-info>
<plugin-graph-info [plugin]="plugin" [pluginTemplate]="pluginTemplate" [pluginObject]="pluginObject" [previewInAdmin]="previewInAdmin" ></plugin-graph-info>
</ng-container>
<ng-container *ngIf="pluginTemplate.code == 'stats'">
<plugin-stats [plugin]="plugin" [pluginTemplate]="pluginTemplate" [pluginObject]="pluginObject" ></plugin-stats>
<plugin-stats [plugin]="plugin" [pluginTemplate]="pluginTemplate" [pluginObject]="pluginObject" [previewInAdmin]="previewInAdmin" ></plugin-stats>
</ng-container>
</div>
<ng-template #noplugin>
@ -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 {