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-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-02-22 10:09:20 +01:00
|
|
|
<ng-container *ngIf="pluginTemplate.code == 'openaire-products'">
|
|
|
|
<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-02-22 11:15:21 +01:00
|
|
|
<plugin-search-deposit-link-form [plugin]="plugin" [pluginTemplate]="pluginTemplate" [pluginObject]="pluginObject" (valuesChanged)="changed.emit($event)" [editTemplate]="editTemplate"></plugin-search-deposit-link-form>
|
2024-02-22 10:09:20 +01:00
|
|
|
</ng-container>
|
|
|
|
<ng-container *ngIf="pluginTemplate.code == 'learn-and-connect'">
|
2024-02-28 12:07:31 +01:00
|
|
|
<plugin-learn-and-connect-form [plugin]="plugin" [pluginTemplate]="pluginTemplate" [pluginObject]="pluginObject" (valuesChanged)="changed.emit($event)" [editTemplate]="editTemplate" [editSubmenuOpen]="editSubmenuOpen"></plugin-learn-and-connect-form>
|
2024-02-22 10:09:20 +01:00
|
|
|
</ng-container>
|
|
|
|
<ng-container *ngIf="pluginTemplate.code == 'how-to-use'">
|
2024-02-28 12:07:31 +01:00
|
|
|
<plugin-how-to-use-form [plugin]="plugin" [pluginTemplate]="pluginTemplate" [pluginObject]="pluginObject" (valuesChanged)="changed.emit($event)" [editTemplate]="editTemplate" [editSubmenuOpen]="editSubmenuOpen"></plugin-how-to-use-form>
|
2024-02-22 10:09:20 +01:00
|
|
|
</ng-container>
|
|
|
|
<ng-container *ngIf="pluginTemplate.code == 'suggested-repositories'">
|
|
|
|
<plugin-suggested-repositories [plugin]="plugin" [pluginTemplate]="pluginTemplate" [pluginObject]="pluginObject" (valuesChanged)="changed.emit($event)" [editTemplate]="editTemplate"></plugin-suggested-repositories>
|
|
|
|
</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-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-02-22 10:09:20 +01:00
|
|
|
|
|
|
|
ngOnInit(): void {
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|