openaire-library/dashboard/plugins/wrapper/plugin-edit-wrapper.compone...

55 lines
3.7 KiB
TypeScript
Raw Normal View History

import {Component, EventEmitter, Input, OnInit, Output} from '@angular/core';
import {Plugin} from "../../../utils/entities/adminTool/plugin";
import {PluginTemplate} from "../../../utils/entities/adminTool/pluginTemplate";
import {PluginEditEvent} from "../utils/base-plugin.form.component";
@Component({
selector: 'plugin-wrapper-form',
template: `
<div class="uk-margin-small-right uk-margin-top" *ngIf="pluginObject">
<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'">
<plugin-search-deposit-link-form [plugin]="plugin" [pluginTemplate]="pluginTemplate" [pluginObject]="pluginObject" (valuesChanged)="changed.emit($event)" [editTemplate]="editTemplate"></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>
</ng-container>
<ng-container *ngIf="pluginTemplate.code == 'how-to-use'">
<plugin-how-to-use-form [plugin]="plugin" [pluginTemplate]="pluginTemplate" [pluginObject]="pluginObject" (valuesChanged)="changed.emit($event)" [editTemplate]="editTemplate" [editSubmenuOpen]="editSubmenuOpen"></plugin-how-to-use-form>
</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>
<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>
</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();
@Input() editSubmenuOpen;
ngOnInit(): void {
}
}