2024-02-28 12:07:31 +01:00
|
|
|
import {Component, Input, OnInit} from '@angular/core';
|
2024-01-19 09:53:17 +01:00
|
|
|
import {Plugin} from "../../../utils/entities/adminTool/plugin";
|
|
|
|
import {PluginTemplate} from "../../../utils/entities/adminTool/pluginTemplate";
|
2024-03-11 12:29:29 +01:00
|
|
|
import {PluginUtils} from "../utils/pluginUtils";
|
2024-01-19 09:53:17 +01:00
|
|
|
|
|
|
|
@Component({
|
|
|
|
selector: 'plugin-wrapper',
|
|
|
|
template: `
|
2024-02-22 10:09:20 +01:00
|
|
|
<ng-container *ngIf="pluginTemplate && pluginObject">
|
2024-03-11 12:29:29 +01:00
|
|
|
<div *ngIf="pluginTemplate.code && pluginUtils.availablePluginCodes.indexOf(pluginTemplate.code) != -1; else noplugin">
|
2024-01-19 09:53:17 +01:00
|
|
|
<ng-container *ngIf="pluginTemplate.code == 'openaire-products'">
|
2024-03-28 11:37:00 +01:00
|
|
|
<plugin-openaire-products [plugin]="plugin" [pluginTemplate]="pluginTemplate" [pluginObject]="pluginObject" [previewInAdmin]="previewInAdmin" ></plugin-openaire-products>
|
2024-01-19 09:53:17 +01:00
|
|
|
</ng-container>
|
2024-01-31 10:05:46 +01:00
|
|
|
<ng-container *ngIf="pluginTemplate.code == 'discover-by-subcommunity'">
|
2024-03-28 11:37:00 +01:00
|
|
|
<plugin-discover-by-subcommunity [plugin]="plugin" [pluginTemplate]="pluginTemplate" [pluginObject]="pluginObject" [previewInAdmin]="previewInAdmin" ></plugin-discover-by-subcommunity>
|
2024-01-31 10:05:46 +01:00
|
|
|
</ng-container>
|
|
|
|
<ng-container *ngIf="pluginTemplate.code == 'gateway-information'">
|
2024-03-28 11:37:00 +01:00
|
|
|
<plugin-gateway-information [plugin]="plugin" [pluginTemplate]="pluginTemplate" [pluginObject]="pluginObject" [previewInAdmin]="previewInAdmin" ></plugin-gateway-information>
|
2024-01-31 10:05:46 +01:00
|
|
|
</ng-container>
|
|
|
|
<ng-container *ngIf="pluginTemplate.code == 'search-deposit-link'">
|
2024-03-28 11:37:00 +01:00
|
|
|
<plugin-search-deposit-link [plugin]="plugin" [pluginTemplate]="pluginTemplate" [pluginObject]="pluginObject" [previewInAdmin]="previewInAdmin" ></plugin-search-deposit-link>
|
2024-01-31 10:05:46 +01:00
|
|
|
</ng-container>
|
|
|
|
<ng-container *ngIf="pluginTemplate.code == 'suggested-repositories'">
|
2024-03-28 11:37:00 +01:00
|
|
|
<plugin-suggested-repositories [plugin]="plugin" [pluginTemplate]="pluginTemplate" [pluginObject]="pluginObject" [previewInAdmin]="previewInAdmin" ></plugin-suggested-repositories>
|
2024-01-31 10:05:46 +01:00
|
|
|
</ng-container>
|
|
|
|
<ng-container *ngIf="pluginTemplate.code == 'featured-datasets'">
|
2024-03-28 11:37:00 +01:00
|
|
|
<plugin-featured-datasets [plugin]="plugin" [pluginTemplate]="pluginTemplate" [pluginObject]="pluginObject" [previewInAdmin]="previewInAdmin" ></plugin-featured-datasets>
|
2024-01-31 10:05:46 +01:00
|
|
|
</ng-container>
|
2024-02-28 12:07:31 +01:00
|
|
|
<ng-container *ngIf="pluginTemplate.code == 'organizations'">
|
2024-03-28 11:37:00 +01:00
|
|
|
<plugin-organizations [plugin]="plugin" [pluginTemplate]="pluginTemplate" [pluginObject]="pluginObject" [previewInAdmin]="previewInAdmin" ></plugin-organizations>
|
2024-02-28 12:07:31 +01:00
|
|
|
</ng-container>
|
2024-05-22 10:09:18 +02:00
|
|
|
<ng-container *ngIf="pluginTemplate.code == 'graph-info' || pluginTemplate.code == 'paragraph-info'">
|
2024-03-28 11:37:00 +01:00
|
|
|
<plugin-graph-info [plugin]="plugin" [pluginTemplate]="pluginTemplate" [pluginObject]="pluginObject" [previewInAdmin]="previewInAdmin" ></plugin-graph-info>
|
2024-03-11 12:29:29 +01:00
|
|
|
</ng-container>
|
2024-03-13 08:03:58 +01:00
|
|
|
<ng-container *ngIf="pluginTemplate.code == 'stats'">
|
2024-03-28 11:37:00 +01:00
|
|
|
<plugin-stats [plugin]="plugin" [pluginTemplate]="pluginTemplate" [pluginObject]="pluginObject" [previewInAdmin]="previewInAdmin" ></plugin-stats>
|
2024-03-13 08:03:58 +01:00
|
|
|
</ng-container>
|
2024-04-25 14:26:36 +02:00
|
|
|
<ng-container *ngIf="pluginTemplate.code == 'search-bar'">
|
|
|
|
<plugin-search-bar [plugin]="plugin" [pluginTemplate]="pluginTemplate" [pluginObject]="pluginObject" [previewInAdmin]="previewInAdmin" ></plugin-search-bar>
|
|
|
|
</ng-container>
|
|
|
|
<ng-container *ngIf="pluginTemplate.code == 'card-info' || pluginTemplate.code == 'learn-and-connect' || pluginTemplate.code == 'how-to-use'">
|
|
|
|
<plugin-card-info [plugin]="plugin" [pluginTemplate]="pluginTemplate" [pluginObject]="pluginObject" [previewInAdmin]="previewInAdmin" ></plugin-card-info>
|
|
|
|
</ng-container>
|
2024-05-22 10:09:18 +02:00
|
|
|
<ng-container *ngIf="pluginTemplate.code == 'html-section'">
|
|
|
|
<plugin-html-section [plugin]="plugin" [pluginTemplate]="pluginTemplate" [pluginObject]="pluginObject" [previewInAdmin]="previewInAdmin" ></plugin-html-section>
|
|
|
|
</ng-container>
|
2024-01-19 09:53:17 +01:00
|
|
|
</div>
|
2024-03-11 12:29:29 +01:00
|
|
|
<ng-template #noplugin>
|
|
|
|
<div class="uk-text-muted uk-text-center">
|
|
|
|
No plugin available
|
|
|
|
</div>
|
|
|
|
</ng-template>
|
2024-01-19 09:53:17 +01:00
|
|
|
</ng-container>
|
2024-02-22 10:09:20 +01:00
|
|
|
`
|
2024-01-19 09:53:17 +01:00
|
|
|
})
|
|
|
|
export class PluginWrapperComponent implements OnInit {
|
|
|
|
@Input() plugin:Plugin;
|
2024-02-22 10:09:20 +01:00
|
|
|
@Input() pluginObject;
|
2024-01-19 09:53:17 +01:00
|
|
|
@Input() pluginTemplate:PluginTemplate;
|
2024-03-28 11:37:00 +01:00
|
|
|
@Input() previewInAdmin:boolean = false;
|
2024-03-11 12:29:29 +01:00
|
|
|
pluginUtils = new PluginUtils();
|
2024-01-19 09:53:17 +01:00
|
|
|
ngOnInit(): void {
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|