add file transformer service to description editor

This commit is contained in:
amentis 2024-03-27 12:22:33 +02:00
parent c5b1c89a7e
commit c6a38efd83
2 changed files with 6 additions and 12 deletions

View File

@ -32,17 +32,9 @@
<mat-icon [disabled]="isDirty()" style="width: 14px;">expand_more</mat-icon>
</button>
<mat-menu #exportMenu="matMenu" xPosition="before">
<button mat-menu-item (click)="downloadPDF(formGroup.get('id').value)">
<i class="fa fa-file-pdf-o pr-2"></i>
<span>{{'GENERAL.FILE-TRANSFORMER.PDF' | translate}}</span>
</button>
<button mat-menu-item (click)="downloadDOCX(formGroup.get('id').value)">
<i class="fa fa-file-word-o pr-2"></i>
<span>{{'GENERAL.FILE-TRANSFORMER.DOCX' | translate}}</span>
</button>
<button mat-menu-item (click)="downloadXML(formGroup.get('id').value)">
<i class="fa fa-file-code-o pr-2"></i>
<span>{{'GENERAL.FILE-TRANSFORMER.XML' | translate}}</span>
<button mat-menu-item *ngFor='let fileTransformer of fileTransformerService.availableFormats' (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>
<span>{{'GENERAL.FILE-TRANSFORMER.' + fileTransformer?.format?.toUpperCase() | translate}}</span>
</button>
</mat-menu>
</div>

View File

@ -42,6 +42,7 @@ import { TableOfContentsComponent } from './table-of-contents/table-of-contents.
import { FormValidationErrorsDialogComponent } from '@common/forms/form-validation-errors-dialog/form-validation-errors-dialog.component';
import { ConfigurationService } from '@app/core/services/configuration/configuration.service';
import { LockTargetType } from '@app/core/common/enum/lock-target-type';
import { FileTransformerService } from '@app/core/services/file-transformer/file-transformer.service';
@Component({
selector: 'app-description-editor-component',
@ -104,7 +105,8 @@ export class DescriptionEditorComponent extends BaseEditor<DescriptionEditorMode
private fileUtils: FileUtils,
private matomoService: MatomoService,
private dmpService: DmpService,
public visibilityRulesService: VisibilityRulesService
public visibilityRulesService: VisibilityRulesService,
public fileTransformerService: FileTransformerService,
) {
super(dialog, language, formService, router, uiNotificationService, httpErrorHandlingService, filterService, datePipe, route, queryParamsService, lockService, authService, configurationService);