2024-02-22 10:09:20 +01:00
|
|
|
import {Component, EventEmitter, Input, OnInit, Output} from '@angular/core';
|
|
|
|
import {Plugin} from "../../../utils/entities/adminTool/plugin";
|
|
|
|
import {PluginTemplate} from "../../../utils/entities/adminTool/pluginTemplate";
|
2024-02-28 12:07:31 +01:00
|
|
|
import {PluginEditEvent} from "../utils/base-plugin.form.component";
|
2024-03-11 12:29:29 +01:00
|
|
|
import {PluginUtils} from "../utils/pluginUtils";
|
2024-02-22 10:09:20 +01:00
|
|
|
|
|
|
|
@Component({
|
|
|
|
selector: 'plugin-wrapper-form',
|
|
|
|
template: `
|
2024-02-28 12:07:31 +01:00
|
|
|
<div class="uk-margin-small-right uk-margin-top" *ngIf="pluginObject">
|
2024-03-11 12:29:29 +01:00
|
|
|
<ng-container *ngIf="pluginTemplate.code && pluginUtils.availablePluginCodes.indexOf(pluginTemplate.code) != -1; else noplugin">
|
|
|
|
|
|
|
|
<ng-container *ngIf="pluginTemplate.code == 'openaire-products'">
|
2024-02-22 10:09:20 +01:00
|
|
|
<plugin-openaire-products-form [pluginTemplate]="pluginTemplate" [plugin]="plugin" [pluginObject]="pluginObject" (valuesChanged)="changed.emit($event)" [editTemplate]="editTemplate"></plugin-openaire-products-form>
|
|
|
|
</ng-container>
|
|
|
|
<ng-container *ngIf="pluginTemplate.code == 'discover-by-subcommunity'">
|
|
|
|
<plugin-discover-by-subcommunity-form [plugin]="plugin" [pluginTemplate]="pluginTemplate" [pluginObject]="pluginObject" (valuesChanged)="changed.emit($event)" [editTemplate]="editTemplate"></plugin-discover-by-subcommunity-form>
|
|
|
|
</ng-container>
|
|
|
|
<ng-container *ngIf="pluginTemplate.code == 'gateway-information'">
|
|
|
|
<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'">
|
2024-03-28 11:37:00 +01:00
|
|
|
<plugin-search-deposit-link-form [plugin]="plugin" [pluginTemplate]="pluginTemplate" [pluginObject]="pluginObject" (valuesChanged)="changed.emit($event)" [editTemplate]="editTemplate" [editSubmenuOpen]="editSubmenuOpen"></plugin-search-deposit-link-form>
|
2024-02-22 10:09:20 +01:00
|
|
|
</ng-container>
|
|
|
|
<ng-container *ngIf="pluginTemplate.code == 'suggested-repositories'">
|
2024-03-01 09:32:38 +01:00
|
|
|
<plugin-suggested-repositories-form [plugin]="plugin" [pluginTemplate]="pluginTemplate" [pluginObject]="pluginObject" (valuesChanged)="changed.emit($event)" [editTemplate]="editTemplate"></plugin-suggested-repositories-form>
|
2024-02-22 10:09:20 +01:00
|
|
|
</ng-container>
|
|
|
|
<ng-container *ngIf="pluginTemplate.code == 'featured-datasets'">
|
|
|
|
<plugin-featured-datasets-form [plugin]="plugin" [pluginTemplate]="pluginTemplate" [pluginObject]="pluginObject" (valuesChanged)="changed.emit($event)" [editTemplate]="editTemplate"></plugin-featured-datasets-form>
|
|
|
|
</ng-container>
|
2024-02-28 12:07:31 +01:00
|
|
|
<ng-container *ngIf="pluginTemplate.code == 'organizations'">
|
|
|
|
<plugin-organizations-form [plugin]="plugin" [pluginTemplate]="pluginTemplate" [pluginObject]="pluginObject" (valuesChanged)="changed.emit($event)" [editTemplate]="editTemplate"></plugin-organizations-form>
|
|
|
|
</ng-container>
|
2024-05-22 10:09:18 +02:00
|
|
|
<ng-container *ngIf="pluginTemplate.code == 'graph-info' || pluginTemplate.code == 'paragraph-info'">
|
2024-03-11 12:29:29 +01:00
|
|
|
<plugin-graph-info-form [plugin]="plugin" [pluginTemplate]="pluginTemplate" [pluginObject]="pluginObject" (valuesChanged)="changed.emit($event)" [editTemplate]="editTemplate"></plugin-graph-info-form>
|
|
|
|
</ng-container>
|
2024-03-13 08:03:58 +01:00
|
|
|
<ng-container *ngIf="pluginTemplate.code == 'stats'">
|
|
|
|
<plugin-stats-form [plugin]="plugin" [pluginTemplate]="pluginTemplate" [pluginObject]="pluginObject" (valuesChanged)="changed.emit($event)" [editTemplate]="editTemplate"></plugin-stats-form>
|
|
|
|
</ng-container>
|
2024-04-25 14:26:36 +02:00
|
|
|
<ng-container *ngIf="pluginTemplate.code == 'search-bar'">
|
|
|
|
<plugin-search-bar-form [plugin]="plugin" [pluginTemplate]="pluginTemplate" [pluginObject]="pluginObject" (valuesChanged)="changed.emit($event)" [editTemplate]="editTemplate"></plugin-search-bar-form>
|
|
|
|
</ng-container>
|
|
|
|
<ng-container *ngIf="pluginTemplate.code == 'card-info' || pluginTemplate.code == 'learn-and-connect' || pluginTemplate.code == 'how-to-use'">
|
|
|
|
<plugin-card-info-form [plugin]="plugin" [pluginTemplate]="pluginTemplate" [pluginObject]="pluginObject" (valuesChanged)="changed.emit($event)" [editTemplate]="editTemplate" [editSubmenuOpen]="editSubmenuOpen"></plugin-card-info-form>
|
|
|
|
</ng-container>
|
2024-05-22 10:09:18 +02:00
|
|
|
<ng-container *ngIf="pluginTemplate.code == 'html-section'">
|
|
|
|
<plugin-html-section-form [plugin]="plugin" [pluginTemplate]="pluginTemplate" [pluginObject]="pluginObject" (valuesChanged)="changed.emit($event)" [editTemplate]="editTemplate"></plugin-html-section-form>
|
|
|
|
</ng-container>
|
2024-03-11 12:29:29 +01:00
|
|
|
</ng-container>
|
|
|
|
<ng-template #noplugin>
|
|
|
|
<div class="uk-text-muted uk-text-center">
|
|
|
|
No plugin available
|
|
|
|
</div>
|
|
|
|
</ng-template>
|
2024-02-22 10:09:20 +01:00
|
|
|
</div>
|
|
|
|
|
|
|
|
`,
|
|
|
|
styleUrls: ["edit-plugin.css"]
|
|
|
|
})
|
|
|
|
export class PluginEditWrapperComponent implements OnInit {
|
|
|
|
|
|
|
|
@Input() plugin:Plugin;
|
|
|
|
@Input() pluginTemplate:PluginTemplate;
|
|
|
|
@Input() editTemplate:boolean;
|
|
|
|
@Input() pluginObject;
|
|
|
|
@Output() changed:EventEmitter<PluginEditEvent> = new EventEmitter();
|
2024-02-28 12:07:31 +01:00
|
|
|
@Input() editSubmenuOpen;
|
2024-03-11 12:29:29 +01:00
|
|
|
pluginUtils = new PluginUtils();
|
2024-02-22 10:09:20 +01:00
|
|
|
|
|
|
|
ngOnInit(): void {
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|