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-02-22 10:09:20 +01:00
|
|
|
<plugin-openaire-products [plugin]="plugin" [pluginTemplate]="pluginTemplate" [pluginObject]="pluginObject" ></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-02-22 10:09:20 +01:00
|
|
|
<plugin-discover-by-subcommunity [plugin]="plugin" [pluginTemplate]="pluginTemplate" [pluginObject]="pluginObject" ></plugin-discover-by-subcommunity>
|
2024-01-31 10:05:46 +01:00
|
|
|
</ng-container>
|
|
|
|
<ng-container *ngIf="pluginTemplate.code == 'gateway-information'">
|
2024-02-22 10:09:20 +01:00
|
|
|
<plugin-gateway-information [plugin]="plugin" [pluginTemplate]="pluginTemplate" [pluginObject]="pluginObject" ></plugin-gateway-information>
|
2024-01-31 10:05:46 +01:00
|
|
|
</ng-container>
|
|
|
|
<ng-container *ngIf="pluginTemplate.code == 'search-deposit-link'">
|
2024-02-22 10:09:20 +01:00
|
|
|
<plugin-search-deposit-link [plugin]="plugin" [pluginTemplate]="pluginTemplate" [pluginObject]="pluginObject" ></plugin-search-deposit-link>
|
2024-01-31 10:05:46 +01:00
|
|
|
</ng-container>
|
|
|
|
<ng-container *ngIf="pluginTemplate.code == 'learn-and-connect'">
|
2024-02-22 10:09:20 +01:00
|
|
|
<plugin-learn-and-connect [plugin]="plugin" [pluginTemplate]="pluginTemplate" [pluginObject]="pluginObject" ></plugin-learn-and-connect>
|
2024-01-31 10:05:46 +01:00
|
|
|
</ng-container>
|
|
|
|
<ng-container *ngIf="pluginTemplate.code == 'how-to-use'">
|
2024-02-22 10:09:20 +01:00
|
|
|
<plugin-how-to-use [plugin]="plugin" [pluginTemplate]="pluginTemplate" [pluginObject]="pluginObject" ></plugin-how-to-use>
|
2024-01-31 10:05:46 +01:00
|
|
|
</ng-container>
|
|
|
|
<ng-container *ngIf="pluginTemplate.code == 'suggested-repositories'">
|
2024-02-22 10:09:20 +01:00
|
|
|
<plugin-suggested-repositories [plugin]="plugin" [pluginTemplate]="pluginTemplate" [pluginObject]="pluginObject" ></plugin-suggested-repositories>
|
2024-01-31 10:05:46 +01:00
|
|
|
</ng-container>
|
|
|
|
<ng-container *ngIf="pluginTemplate.code == 'featured-datasets'">
|
2024-02-22 10:09:20 +01:00
|
|
|
<plugin-featured-datasets [plugin]="plugin" [pluginTemplate]="pluginTemplate" [pluginObject]="pluginObject" ></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'">
|
|
|
|
<plugin-organizations [plugin]="plugin" [pluginTemplate]="pluginTemplate" [pluginObject]="pluginObject" ></plugin-organizations>
|
|
|
|
</ng-container>
|
2024-03-11 12:29:29 +01:00
|
|
|
<ng-container *ngIf="pluginTemplate.code == 'graph-info'">
|
|
|
|
<plugin-graph-info [plugin]="plugin" [pluginTemplate]="pluginTemplate" [pluginObject]="pluginObject" ></plugin-graph-info>
|
|
|
|
</ng-container>
|
2024-03-13 08:03:58 +01:00
|
|
|
<ng-container *ngIf="pluginTemplate.code == 'stats'">
|
|
|
|
<plugin-stats [plugin]="plugin" [pluginTemplate]="pluginTemplate" [pluginObject]="pluginObject" ></plugin-stats>
|
|
|
|
</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-11 12:29:29 +01:00
|
|
|
pluginUtils = new PluginUtils();
|
2024-01-19 09:53:17 +01:00
|
|
|
ngOnInit(): void {
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|