openaire-library/dashboard/plugins/wrapper/plugin-wrapper.component.ts

50 lines
2.7 KiB
TypeScript

import {Component, Input, OnInit} from '@angular/core';
import {Plugin} from "../../../utils/entities/adminTool/plugin";
import {PluginTemplate} from "../../../utils/entities/adminTool/pluginTemplate";
@Component({
selector: 'plugin-wrapper',
template: `
<ng-container *ngIf="pluginTemplate && pluginObject">
<div>
<ng-container *ngIf="pluginTemplate.code == 'openaire-products'">
<plugin-openaire-products [plugin]="plugin" [pluginTemplate]="pluginTemplate" [pluginObject]="pluginObject" ></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>
</ng-container>
<ng-container *ngIf="pluginTemplate.code == 'gateway-information'">
<plugin-gateway-information [plugin]="plugin" [pluginTemplate]="pluginTemplate" [pluginObject]="pluginObject" ></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>
</ng-container>
<ng-container *ngIf="pluginTemplate.code == 'learn-and-connect'">
<plugin-learn-and-connect [plugin]="plugin" [pluginTemplate]="pluginTemplate" [pluginObject]="pluginObject" ></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>
</ng-container>
<ng-container *ngIf="pluginTemplate.code == 'suggested-repositories'">
<plugin-suggested-repositories [plugin]="plugin" [pluginTemplate]="pluginTemplate" [pluginObject]="pluginObject" ></plugin-suggested-repositories>
</ng-container>
<ng-container *ngIf="pluginTemplate.code == 'featured-datasets'">
<plugin-featured-datasets [plugin]="plugin" [pluginTemplate]="pluginTemplate" [pluginObject]="pluginObject" ></plugin-featured-datasets>
</ng-container>
<ng-container *ngIf="pluginTemplate.code == 'organizations'">
<plugin-organizations [plugin]="plugin" [pluginTemplate]="pluginTemplate" [pluginObject]="pluginObject" ></plugin-organizations>
</ng-container>
</div>
</ng-container>
`
})
export class PluginWrapperComponent implements OnInit {
@Input() plugin:Plugin;
@Input() pluginObject;
@Input() pluginTemplate:PluginTemplate;
ngOnInit(): void {
}
}