update file formatters to use exportEntityTypes importEntityTypes
This commit is contained in:
parent
3ec12fdf59
commit
ed96403d25
|
@ -61,7 +61,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>gr.cite.opendmp</groupId>
|
<groupId>gr.cite.opendmp</groupId>
|
||||||
<artifactId>file-transformer-base</artifactId>
|
<artifactId>file-transformer-base</artifactId>
|
||||||
<version>0.0.11</version>
|
<version>0.0.12</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>gr.cite</groupId>
|
<groupId>gr.cite</groupId>
|
||||||
|
|
|
@ -1,18 +1,24 @@
|
||||||
package eu.eudat.model.file;
|
package eu.eudat.model.file;
|
||||||
|
|
||||||
|
import eu.eudat.file.transformer.enums.FileTransformerEntityType;
|
||||||
import eu.eudat.file.transformer.models.misc.FileFormat;
|
import eu.eudat.file.transformer.models.misc.FileFormat;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public class RepositoryFileFormat {
|
public class RepositoryFileFormat {
|
||||||
private String format;
|
private String format;
|
||||||
private Boolean hasLogo;
|
private Boolean hasLogo;
|
||||||
private String icon;
|
private String icon;
|
||||||
private String repositoryId;
|
private String repositoryId;
|
||||||
|
|
||||||
public RepositoryFileFormat(String repositoryId, FileFormat format) {
|
private List<FileTransformerEntityType> entityTypes;
|
||||||
|
|
||||||
|
public RepositoryFileFormat(String repositoryId, FileFormat format, List<FileTransformerEntityType> entityTypes) {
|
||||||
this.repositoryId = repositoryId;
|
this.repositoryId = repositoryId;
|
||||||
this.format = format.getFormat();
|
this.format = format.getFormat();
|
||||||
this.hasLogo = format.getHasLogo();
|
this.hasLogo = format.getHasLogo();
|
||||||
this.icon = format.getIcon();
|
this.icon = format.getIcon();
|
||||||
|
this.entityTypes = entityTypes;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getFormat() {
|
public String getFormat() {
|
||||||
|
@ -46,4 +52,12 @@ public class RepositoryFileFormat {
|
||||||
public void setRepositoryId(String repositoryId) {
|
public void setRepositoryId(String repositoryId) {
|
||||||
this.repositoryId = repositoryId;
|
this.repositoryId = repositoryId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<FileTransformerEntityType> getEntityTypes() {
|
||||||
|
return entityTypes;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEntityTypes(List<FileTransformerEntityType> entityTypes) {
|
||||||
|
this.entityTypes = entityTypes;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -91,7 +91,7 @@ public class FileTransformerServiceImpl implements FileTransformerService {
|
||||||
List<FileTransformerConfiguration> configurations = this.getAvailableConfigurations();
|
List<FileTransformerConfiguration> configurations = this.getAvailableConfigurations();
|
||||||
if(configurations != null){
|
if(configurations != null){
|
||||||
for (FileTransformerConfiguration configuration : configurations){
|
for (FileTransformerConfiguration configuration : configurations){
|
||||||
if (configuration != null && configuration.getExportVariants() != null) formats.addAll(configuration.getExportVariants().stream().map(x-> new RepositoryFileFormat(configuration.getFileTransformerId(), x)).toList());
|
if (configuration != null && configuration.getExportVariants() != null) formats.addAll(configuration.getExportVariants().stream().map(x-> new RepositoryFileFormat(configuration.getFileTransformerId(), x, configuration.getExportEntityTypes())).toList());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return formats;
|
return formats;
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
export enum FileTransformerEntityType {
|
||||||
|
Dmp = 0,
|
||||||
|
Description = 1
|
||||||
|
}
|
|
@ -1,6 +1,9 @@
|
||||||
|
import { FileTransformerEntityType } from "@app/core/common/enum/file-transformer-entity-type";
|
||||||
|
|
||||||
export interface RepositoryFileFormat {
|
export interface RepositoryFileFormat {
|
||||||
format: string;
|
format: string;
|
||||||
hasLogo: boolean;
|
hasLogo: boolean;
|
||||||
icon: string;
|
icon: string;
|
||||||
repositoryId: string;
|
repositoryId: string;
|
||||||
|
entityTypes: FileTransformerEntityType[];
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,7 @@ import { MatomoService } from '../matomo/matomo-service';
|
||||||
import { FileUtils } from '../utilities/file-utils.service';
|
import { FileUtils } from '../utilities/file-utils.service';
|
||||||
import { AuthService } from '../auth/auth.service';
|
import { AuthService } from '../auth/auth.service';
|
||||||
import { RepositoryFileFormat } from '@app/core/model/file/file-format.model';
|
import { RepositoryFileFormat } from '@app/core/model/file/file-format.model';
|
||||||
|
import { FileTransformerEntityType } from '@app/core/common/enum/file-transformer-entity-type';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class FileTransformerService extends BaseService {
|
export class FileTransformerService extends BaseService {
|
||||||
|
@ -32,6 +33,13 @@ export class FileTransformerService extends BaseService {
|
||||||
return this._availableFormats;
|
return this._availableFormats;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public availableFormatsFor(entityType: FileTransformerEntityType) {
|
||||||
|
if (this.availableFormats) {
|
||||||
|
return this.availableFormats.filter(x => x.entityTypes.includes(entityType));
|
||||||
|
}
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
init() {
|
init() {
|
||||||
this._loading = true;
|
this._loading = true;
|
||||||
// console.log('init');
|
// console.log('init');
|
||||||
|
|
|
@ -34,7 +34,7 @@
|
||||||
<mat-icon [disabled]="isDirty()" style="width: 14px;">expand_more</mat-icon>
|
<mat-icon [disabled]="isDirty()" style="width: 14px;">expand_more</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
<mat-menu #exportMenu="matMenu" xPosition="before">
|
<mat-menu #exportMenu="matMenu" xPosition="before">
|
||||||
<button mat-menu-item *ngFor='let fileTransformer of fileTransformerService.availableFormats' (click)="fileTransformerService.exportDescription(formGroup.get('id').value, fileTransformer.repositoryId, fileTransformer.format)">
|
<button mat-menu-item *ngFor='let fileTransformer of fileTransformerService.availableFormatsFor(fileTransformerEntityTypeEnum.Description)' (click)="fileTransformerService.exportDescription(formGroup.get('id').value, fileTransformer.repositoryId, fileTransformer.format)">
|
||||||
<i class="fa pr-2" [ngClass]="fileTransformer.icon ? fileTransformer.icon : 'fa-file-o'"></i>
|
<i class="fa pr-2" [ngClass]="fileTransformer.icon ? fileTransformer.icon : 'fa-file-o'"></i>
|
||||||
<span>{{'GENERAL.FILE-TRANSFORMER.' + fileTransformer?.format?.toUpperCase() | translate}}</span>
|
<span>{{'GENERAL.FILE-TRANSFORMER.' + fileTransformer?.format?.toUpperCase() | translate}}</span>
|
||||||
</button>
|
</button>
|
||||||
|
|
|
@ -46,6 +46,7 @@ import { FileTransformerService } from '@app/core/services/file-transformer/file
|
||||||
import { DmpBlueprintDefinitionSection } from '@app/core/model/dmp-blueprint/dmp-blueprint';
|
import { DmpBlueprintDefinitionSection } from '@app/core/model/dmp-blueprint/dmp-blueprint';
|
||||||
import { DescriptionTemplate } from '@app/core/model/description-template/description-template';
|
import { DescriptionTemplate } from '@app/core/model/description-template/description-template';
|
||||||
import { DmpDescriptionTemplate } from '@app/core/model/dmp/dmp';
|
import { DmpDescriptionTemplate } from '@app/core/model/dmp/dmp';
|
||||||
|
import { FileTransformerEntityType } from '@app/core/common/enum/file-transformer-entity-type';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-description-editor-component',
|
selector: 'app-description-editor-component',
|
||||||
|
@ -59,6 +60,7 @@ export class DescriptionEditorComponent extends BaseEditor<DescriptionEditorMode
|
||||||
isDeleted = false;
|
isDeleted = false;
|
||||||
item: Description;
|
item: Description;
|
||||||
fieldsetIdWithFocus: string;
|
fieldsetIdWithFocus: string;
|
||||||
|
fileTransformerEntityTypeEnum = FileTransformerEntityType;
|
||||||
|
|
||||||
viewOnly = false;
|
viewOnly = false;
|
||||||
lockStatus: Boolean;
|
lockStatus: Boolean;
|
||||||
|
@ -641,7 +643,7 @@ export class DescriptionEditorComponent extends BaseEditor<DescriptionEditorMode
|
||||||
this.descriptionIsOnceSaved = true;
|
this.descriptionIsOnceSaved = true;
|
||||||
if (this.formGroup.get('status').value == DescriptionStatus.Finalized) this.isFinalized = true;
|
if (this.formGroup.get('status').value == DescriptionStatus.Finalized) this.isFinalized = true;
|
||||||
},
|
},
|
||||||
error => {
|
error => {
|
||||||
if (this.formGroup.get('status').value == DescriptionStatus.Finalized){
|
if (this.formGroup.get('status').value == DescriptionStatus.Finalized){
|
||||||
this.formGroup.get('status').setValue(DescriptionStatus.Draft);
|
this.formGroup.get('status').setValue(DescriptionStatus.Draft);
|
||||||
this.uiNotificationService.snackBarNotification(this.language.instant('GENERAL.SNACK-BAR.UNSUCCESSFUL-FINALIZE'), SnackBarNotificationLevel.Error);
|
this.uiNotificationService.snackBarNotification(this.language.instant('GENERAL.SNACK-BAR.UNSUCCESSFUL-FINALIZE'), SnackBarNotificationLevel.Error);
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
<div class="description-card-actions">
|
<div class="description-card-actions">
|
||||||
<a class="col-auto border-right pointer" *ngIf="fileTransformerService.availableFormats && fileTransformerService.availableFormats.length > 0" [matMenuTriggerFor]="exportMenu"><span class="material-icons icon-align pr-2">open_in_new</span>{{'DESCRIPTION-LISTING.ACTIONS.EXPORT' | translate}}</a>
|
<a class="col-auto border-right pointer" *ngIf="fileTransformerService.availableFormatsFor(fileTransformerEntityTypeEnum.Description) && fileTransformerService.availableFormatsFor(fileTransformerEntityTypeEnum.Description).length > 0" [matMenuTriggerFor]="exportMenu"><span class="material-icons icon-align pr-2">open_in_new</span>{{'DESCRIPTION-LISTING.ACTIONS.EXPORT' | translate}}</a>
|
||||||
<a class="col-auto border-right pointer" *ngIf="canInviteDmpUsers" (click)="openShareDialog()"><span class="material-icons icon-align pr-2">group_add</span>{{'DESCRIPTION-LISTING.ACTIONS.INVITE-SHORT' | translate}}</a>
|
<a class="col-auto border-right pointer" *ngIf="canInviteDmpUsers" (click)="openShareDialog()"><span class="material-icons icon-align pr-2">group_add</span>{{'DESCRIPTION-LISTING.ACTIONS.INVITE-SHORT' | translate}}</a>
|
||||||
<a class="col-auto border-right pointer" *ngIf="isAuthenticated()" (click)="copyToDmp(description)"><span class="material-icons icon-align pr-2">file_copy</span>{{'DESCRIPTION-LISTING.ACTIONS.COPY-DESCRIPTION' | translate}}</a>
|
<a class="col-auto border-right pointer" *ngIf="isAuthenticated()" (click)="copyToDmp(description)"><span class="material-icons icon-align pr-2">file_copy</span>{{'DESCRIPTION-LISTING.ACTIONS.COPY-DESCRIPTION' | translate}}</a>
|
||||||
<a class="col-auto border-right pointer" *ngIf="canDelete" (click)="deleteClicked(description.id)"><span class="material-icons icon-align pr-2">delete</span>{{ 'DESCRIPTION-LISTING.ACTIONS.DELETE' | translate }}</a>
|
<a class="col-auto border-right pointer" *ngIf="canDelete" (click)="deleteClicked(description.id)"><span class="material-icons icon-align pr-2">delete</span>{{ 'DESCRIPTION-LISTING.ACTIONS.DELETE' | translate }}</a>
|
||||||
|
@ -38,7 +38,7 @@
|
||||||
</button>
|
</button>
|
||||||
</mat-menu>
|
</mat-menu>
|
||||||
<mat-menu #exportMenu="matMenu" xPosition="before">
|
<mat-menu #exportMenu="matMenu" xPosition="before">
|
||||||
<button mat-menu-item *ngFor='let fileTransformer of fileTransformerService.availableFormats' (click)="fileTransformerService.exportDescription(description.id, fileTransformer.repositoryId, fileTransformer.format)">
|
<button mat-menu-item *ngFor='let fileTransformer of fileTransformerService.availableFormatsFor(fileTransformerEntityTypeEnum.Description)' (click)="fileTransformerService.exportDescription(description.id, fileTransformer.repositoryId, fileTransformer.format)">
|
||||||
<i class="fa pr-2" [ngClass]="fileTransformer.icon ? fileTransformer.icon : 'fa-file-o'"></i>
|
<i class="fa pr-2" [ngClass]="fileTransformer.icon ? fileTransformer.icon : 'fa-file-o'"></i>
|
||||||
<span>{{'GENERAL.FILE-TRANSFORMER.' + fileTransformer.format.toUpperCase() | translate}}</span>
|
<span>{{'GENERAL.FILE-TRANSFORMER.' + fileTransformer.format.toUpperCase() | translate}}</span>
|
||||||
</button>
|
</button>
|
||||||
|
|
|
@ -27,6 +27,7 @@ import { takeUntil } from 'rxjs/operators';
|
||||||
import { DescriptionStatus } from '../../../../core/common/enum/description-status';
|
import { DescriptionStatus } from '../../../../core/common/enum/description-status';
|
||||||
import { DescriptionCopyDialogComponent } from '../../description-copy-dialog/description-copy-dialog.component';
|
import { DescriptionCopyDialogComponent } from '../../description-copy-dialog/description-copy-dialog.component';
|
||||||
import { AppPermission } from '@app/core/common/enum/permission.enum';
|
import { AppPermission } from '@app/core/common/enum/permission.enum';
|
||||||
|
import { FileTransformerEntityType } from '@app/core/common/enum/file-transformer-entity-type';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-description-listing-item-component',
|
selector: 'app-description-listing-item-component',
|
||||||
|
@ -44,6 +45,7 @@ export class DescriptionListingItemComponent extends BaseComponent implements On
|
||||||
isDeleted: boolean;
|
isDeleted: boolean;
|
||||||
isUserOwner: boolean;
|
isUserOwner: boolean;
|
||||||
descriptionStatusEnum = DescriptionStatus;
|
descriptionStatusEnum = DescriptionStatus;
|
||||||
|
fileTransformerEntityTypeEnum = FileTransformerEntityType;
|
||||||
dmpAccessTypeEnum = DmpAccessType;
|
dmpAccessTypeEnum = DmpAccessType;
|
||||||
canDelete: boolean = false;
|
canDelete: boolean = false;
|
||||||
canEdit: boolean = false;
|
canEdit: boolean = false;
|
||||||
|
|
|
@ -147,7 +147,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
<ng-container *ngIf="fileTransformerService.availableFormats.length > 0">
|
<ng-container *ngIf="fileTransformerService.availableFormatsFor(fileTransformerEntityTypeEnum.Description).length > 0">
|
||||||
<div class="row mb-3 align-items-center">
|
<div class="row mb-3 align-items-center">
|
||||||
<div class="col-auto pr-0">
|
<div class="col-auto pr-0">
|
||||||
<button mat-mini-fab class="frame-btn" [matMenuTriggerFor]="exportMenu">
|
<button mat-mini-fab class="frame-btn" [matMenuTriggerFor]="exportMenu">
|
||||||
|
@ -160,7 +160,7 @@
|
||||||
</div>
|
</div>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
<mat-menu #exportMenu="matMenu" xPosition="before">
|
<mat-menu #exportMenu="matMenu" xPosition="before">
|
||||||
<button mat-menu-item *ngFor='let fileTransformer of fileTransformerService.availableFormats' (click)="fileTransformerService.exportDescription(description.id, fileTransformer.repositoryId, fileTransformer.format)">
|
<button mat-menu-item *ngFor='let fileTransformer of fileTransformerService.availableFormatsFor(fileTransformerEntityTypeEnum.Description)' (click)="fileTransformerService.exportDescription(description.id, fileTransformer.repositoryId, fileTransformer.format)">
|
||||||
<i class="fa pr-2" [ngClass]="fileTransformer.icon ? fileTransformer.icon : 'fa-file-o'"></i>
|
<i class="fa pr-2" [ngClass]="fileTransformer.icon ? fileTransformer.icon : 'fa-file-o'"></i>
|
||||||
<span>{{'GENERAL.FILE-TRANSFORMER.' + fileTransformer.format.toUpperCase() | translate}}</span>
|
<span>{{'GENERAL.FILE-TRANSFORMER.' + fileTransformer.format.toUpperCase() | translate}}</span>
|
||||||
</button>
|
</button>
|
||||||
|
|
|
@ -40,6 +40,7 @@ import { PopupNotificationDialogComponent } from '@app/library/notification/popu
|
||||||
import { IsActive } from '@app/core/common/enum/is-active.enum';
|
import { IsActive } from '@app/core/common/enum/is-active.enum';
|
||||||
import { DmpInvitationDialogComponent } from '@app/ui/dmp/invitation/dialog/dmp-invitation-dialog.component';
|
import { DmpInvitationDialogComponent } from '@app/ui/dmp/invitation/dialog/dmp-invitation-dialog.component';
|
||||||
import { DmpBlueprint, DmpBlueprintDefinition, DmpBlueprintDefinitionSection } from '@app/core/model/dmp-blueprint/dmp-blueprint';
|
import { DmpBlueprint, DmpBlueprintDefinition, DmpBlueprintDefinitionSection } from '@app/core/model/dmp-blueprint/dmp-blueprint';
|
||||||
|
import { FileTransformerEntityType } from '@app/core/common/enum/file-transformer-entity-type';
|
||||||
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
|
@ -62,6 +63,7 @@ export class DescriptionOverviewComponent extends BaseComponent implements OnIni
|
||||||
dmpAccessTypeEnum = DmpAccessType;
|
dmpAccessTypeEnum = DmpAccessType;
|
||||||
dmpStatusEnum = DmpStatus;
|
dmpStatusEnum = DmpStatus;
|
||||||
dmpUserRoleEnum = DmpUserRole;
|
dmpUserRoleEnum = DmpUserRole;
|
||||||
|
fileTransformerEntityTypeEnum = FileTransformerEntityType;
|
||||||
|
|
||||||
canEdit = false;
|
canEdit = false;
|
||||||
canDelete = false;
|
canDelete = false;
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
<a class="d-flex justify-content-center pb-3 show-more" *ngIf="dmp.descriptions?.length > 3" [routerLink]="isPublic ? ['/explore-plans/overview/public/' + dmp.id] : ['/plans/overview/' + dmp.id]"><u>{{'GENERAL.ACTIONS.SHOW-MORE' | translate}}</u></a>
|
<a class="d-flex justify-content-center pb-3 show-more" *ngIf="dmp.descriptions?.length > 3" [routerLink]="isPublic ? ['/explore-plans/overview/public/' + dmp.id] : ['/plans/overview/' + dmp.id]"><u>{{'GENERAL.ACTIONS.SHOW-MORE' | translate}}</u></a>
|
||||||
</a>
|
</a>
|
||||||
<div class="dmp-card-actions">
|
<div class="dmp-card-actions">
|
||||||
<a class="col-auto border-right pointer" *ngIf="canExportDmp(dmp) && fileTransformerService.availableFormats.length > 0" [matMenuTriggerFor]="exportMenu"><span class="material-icons icon-align pr-2">open_in_new</span>{{'DMP-LISTING.ACTIONS.EXPORT' | translate}}</a>
|
<a class="col-auto border-right pointer" *ngIf="canExportDmp(dmp) && fileTransformerService.availableFormatsFor(fileTransformerEntityTypeEnum.Dmp).length > 0" [matMenuTriggerFor]="exportMenu"><span class="material-icons icon-align pr-2">open_in_new</span>{{'DMP-LISTING.ACTIONS.EXPORT' | translate}}</a>
|
||||||
<a class="col-auto border-right pointer" *ngIf="isDraftDmp(dmp) && canEditDmp(dmp)" [routerLink]="['/plans/edit/' + dmp.id]" target="_blank"><span class="material-icons icon-align">add</span>{{'DMP-LISTING.ACTIONS.ADD-DESCRIPTION-SHORT' | translate}}</a>
|
<a class="col-auto border-right pointer" *ngIf="isDraftDmp(dmp) && canEditDmp(dmp)" [routerLink]="['/plans/edit/' + dmp.id]" target="_blank"><span class="material-icons icon-align">add</span>{{'DMP-LISTING.ACTIONS.ADD-DESCRIPTION-SHORT' | translate}}</a>
|
||||||
<a class="col-auto border-right pointer" *ngIf="canInviteDmpUsers(dmp)" (click)="inviteToDmp()"><span class="material-icons icon-align pr-2">group_add</span>{{'DMP-LISTING.ACTIONS.INVITE-SHORT' | translate}}</a>
|
<a class="col-auto border-right pointer" *ngIf="canInviteDmpUsers(dmp)" (click)="inviteToDmp()"><span class="material-icons icon-align pr-2">group_add</span>{{'DMP-LISTING.ACTIONS.INVITE-SHORT' | translate}}</a>
|
||||||
<a class="col-auto border-right pointer" *ngIf="canCloneDmp(dmp)" (click)="cloneClicked()"><span class="material-icons icon-align pr-2">filter_none</span>{{'DMP-LISTING.ACTIONS.CLONE' | translate}}</a>
|
<a class="col-auto border-right pointer" *ngIf="canCloneDmp(dmp)" (click)="cloneClicked()"><span class="material-icons icon-align pr-2">filter_none</span>{{'DMP-LISTING.ACTIONS.CLONE' | translate}}</a>
|
||||||
|
@ -38,7 +38,7 @@
|
||||||
<a class="col-auto pointer" *ngIf="isAuthenticated()" [matMenuTriggerFor]="actionsMenu"><span class="material-icons icon-align pl-2">more_horiz</span></a>
|
<a class="col-auto pointer" *ngIf="isAuthenticated()" [matMenuTriggerFor]="actionsMenu"><span class="material-icons icon-align pl-2">more_horiz</span></a>
|
||||||
</div>
|
</div>
|
||||||
<mat-menu #exportMenu="matMenu" xPosition="before">
|
<mat-menu #exportMenu="matMenu" xPosition="before">
|
||||||
<button mat-menu-item *ngFor='let fileTransformer of fileTransformerService.availableFormats' (click)="fileTransformerService.exportDmp(dmp.id, fileTransformer.repositoryId, fileTransformer.format)">
|
<button mat-menu-item *ngFor='let fileTransformer of fileTransformerService.availableFormatsFor(fileTransformerEntityTypeEnum.Dmp)' (click)="fileTransformerService.exportDmp(dmp.id, fileTransformer.repositoryId, fileTransformer.format)">
|
||||||
<i class="fa pr-2" [ngClass]="fileTransformer.hasLogo ? fileTransformer.icon : 'fa-file-o'"></i>
|
<i class="fa pr-2" [ngClass]="fileTransformer.hasLogo ? fileTransformer.icon : 'fa-file-o'"></i>
|
||||||
<span>{{'GENERAL.FILE-TRANSFORMER.' + fileTransformer.format.toUpperCase() | translate}}</span>
|
<span>{{'GENERAL.FILE-TRANSFORMER.' + fileTransformer.format.toUpperCase() | translate}}</span>
|
||||||
</button>
|
</button>
|
||||||
|
|
|
@ -27,6 +27,7 @@ import { CloneDmpDialogComponent } from '../../clone-dialog/dmp-clone-dialog.com
|
||||||
import { DmpInvitationDialogComponent } from '../../invitation/dialog/dmp-invitation-dialog.component';
|
import { DmpInvitationDialogComponent } from '../../invitation/dialog/dmp-invitation-dialog.component';
|
||||||
import { NewVersionDmpDialogComponent } from '../../new-version-dialog/dmp-new-version-dialog.component';
|
import { NewVersionDmpDialogComponent } from '../../new-version-dialog/dmp-new-version-dialog.component';
|
||||||
import { AppPermission } from '@app/core/common/enum/permission.enum';
|
import { AppPermission } from '@app/core/common/enum/permission.enum';
|
||||||
|
import { FileTransformerEntityType } from '@app/core/common/enum/file-transformer-entity-type';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-dmp-listing-item-component',
|
selector: 'app-dmp-listing-item-component',
|
||||||
|
@ -44,6 +45,7 @@ export class DmpListingItemComponent extends BaseComponent implements OnInit {
|
||||||
isFinalized: boolean;
|
isFinalized: boolean;
|
||||||
isPublished: boolean;
|
isPublished: boolean;
|
||||||
dmpStatusEnum = DmpStatus;
|
dmpStatusEnum = DmpStatus;
|
||||||
|
fileTransformerEntityTypeEnum = FileTransformerEntityType;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private router: Router,
|
private router: Router,
|
||||||
|
|
|
@ -196,7 +196,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
<ng-container *ngIf="canExportDmp() && fileTransformerService.availableFormats.length > 0">
|
<ng-container *ngIf="canExportDmp() && fileTransformerService.availableFormatsFor(fileTransformerEntityTypeEnum.Dmp).length > 0">
|
||||||
<div class="row mb-3 align-items-center">
|
<div class="row mb-3 align-items-center">
|
||||||
<div class="col-auto pr-0">
|
<div class="col-auto pr-0">
|
||||||
<button mat-mini-fab class="frame-btn" [matMenuTriggerFor]="exportMenu">
|
<button mat-mini-fab class="frame-btn" [matMenuTriggerFor]="exportMenu">
|
||||||
|
@ -221,7 +221,7 @@
|
||||||
</div>
|
</div>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
<mat-menu #exportMenu="matMenu" xPosition="before">
|
<mat-menu #exportMenu="matMenu" xPosition="before">
|
||||||
<button mat-menu-item *ngFor='let fileTransformer of fileTransformerService.availableFormats' (click)="fileTransformerService.exportDmp(dmp.id, fileTransformer.repositoryId, fileTransformer.format)">
|
<button mat-menu-item *ngFor='let fileTransformer of fileTransformerService.availableFormatsFor(fileTransformerEntityTypeEnum.Dmp)' (click)="fileTransformerService.exportDmp(dmp.id, fileTransformer.repositoryId, fileTransformer.format)">
|
||||||
<i class="fa pr-2" [ngClass]="fileTransformer.icon ? fileTransformer.icon : 'fa-file-o'"></i>
|
<i class="fa pr-2" [ngClass]="fileTransformer.icon ? fileTransformer.icon : 'fa-file-o'"></i>
|
||||||
<span>{{'GENERAL.FILE-TRANSFORMER.' + fileTransformer?.format?.toUpperCase() | translate}}</span>
|
<span>{{'GENERAL.FILE-TRANSFORMER.' + fileTransformer?.format?.toUpperCase() | translate}}</span>
|
||||||
</button>
|
</button>
|
||||||
|
|
|
@ -46,6 +46,7 @@ import { ReferenceType } from '@app/core/model/reference-type/reference-type';
|
||||||
import { IsActive } from '@app/core/common/enum/is-active.enum';
|
import { IsActive } from '@app/core/common/enum/is-active.enum';
|
||||||
import { DmpFinalizeDialogComponent, DmpFinalizeDialogOutput } from '../dmp-finalize-dialog/dmp-finalize-dialog.component';
|
import { DmpFinalizeDialogComponent, DmpFinalizeDialogOutput } from '../dmp-finalize-dialog/dmp-finalize-dialog.component';
|
||||||
import { DmpEditorResolver } from '../dmp-editor-blueprint/dmp-editor.resolver';
|
import { DmpEditorResolver } from '../dmp-editor-blueprint/dmp-editor.resolver';
|
||||||
|
import { FileTransformerEntityType } from '@app/core/common/enum/file-transformer-entity-type';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-dmp-overview',
|
selector: 'app-dmp-overview',
|
||||||
|
@ -67,6 +68,7 @@ export class DmpOverviewComponent extends BaseComponent implements OnInit {
|
||||||
textMessage: any;
|
textMessage: any;
|
||||||
pastVersions: Dmp[]; //TODO: get these from the backend
|
pastVersions: Dmp[]; //TODO: get these from the backend
|
||||||
selectedModel: EntityDoi;
|
selectedModel: EntityDoi;
|
||||||
|
fileTransformerEntityTypeEnum = FileTransformerEntityType;
|
||||||
|
|
||||||
@ViewChild('doi')
|
@ViewChild('doi')
|
||||||
doi: ElementRef;
|
doi: ElementRef;
|
||||||
|
|
Loading…
Reference in New Issue