Adds misisng button of advanced export on Finalized DMP.
This commit is contained in:
parent
f5458de003
commit
b5f400deed
|
@ -5,10 +5,14 @@
|
|||
</div>
|
||||
<div class="col-auto close-btn" (click)="close()"><mat-icon>close</mat-icon></div>
|
||||
</div>
|
||||
<div class="row d-flex flex-row">
|
||||
<div *ngIf="!isFinalized()" class="row d-flex flex-row">
|
||||
<div class="col-3"><button mat-raised-button type="button" (click)="downloadXML()" >{{ data.XMLButton }}</button></div>
|
||||
<div class="col-3"><button mat-raised-button type="button" (click)="downloadDocument()">{{ data.documentButton }}</button></div>
|
||||
<div class="col-3"><button mat-raised-button type="button" (click)="downloadPdf()">{{ data.pdfButton }}</button></div>
|
||||
<div class="col-3"><button mat-raised-button type="button" (click)="downloadJson()">{{ data.jsonButton }}</button></div>
|
||||
</div>
|
||||
<div *ngIf="isFinalized()" class="row d-flex flex-row">
|
||||
<div class="col-6"><button mat-raised-button type="button" (click)="downloadDocument()">{{ data.documentButton }}</button></div>
|
||||
<div class="col-6"><button mat-raised-button type="button" (click)="downloadPdf()">{{ data.pdfButton }}</button></div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -36,4 +36,8 @@ export class ExportMethodDialogComponent implements OnInit {
|
|||
downloadJson() {
|
||||
this.dialogRef.close("json");
|
||||
}
|
||||
|
||||
isFinalized() {
|
||||
return this.data.isFinalized;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,6 +24,15 @@
|
|||
<mat-icon>save_alt</mat-icon>{{ 'DMP-LISTING.ACTIONS.ADV-EXP' | translate }}
|
||||
</button>
|
||||
</mat-menu>
|
||||
<button *ngIf="isFinalizedDmp(dmp)" mat-icon-button [matMenuTriggerFor]="actionsMenuFinalized" class="ml-auto more-icon"
|
||||
(click)="$event.stopImmediatePropagation();">
|
||||
<mat-icon class="more-horiz">more_horiz</mat-icon>
|
||||
</button>
|
||||
<mat-menu #actionsMenuFinalized="matMenu">
|
||||
<button mat-menu-item (click)="advancedClickedFinalized()" class="menu-item">
|
||||
<mat-icon>save_alt</mat-icon>{{ 'DMP-LISTING.ACTIONS.ADV-EXP' | translate }}
|
||||
</button>
|
||||
</mat-menu>
|
||||
<button mat-raised-button color="primary" (click)="downloadPDF(dmp.id)" class="lightblue-btn ml-2">
|
||||
<mat-icon>save_alt</mat-icon> {{ 'DMP-LISTING.ACTIONS.EXPORT' | translate }}
|
||||
</button>
|
||||
|
|
|
@ -157,6 +157,25 @@ export class DmpOverviewComponent extends BaseComponent implements OnInit {
|
|||
});
|
||||
}
|
||||
|
||||
advancedClickedFinalized() {
|
||||
const dialogRef = this.dialog.open(ExportMethodDialogComponent, {
|
||||
maxWidth: '250px',
|
||||
data: {
|
||||
message: "Download as:",
|
||||
documentButton: "Document",
|
||||
pdfButton: "PDF",
|
||||
isFinalized: true
|
||||
}
|
||||
});
|
||||
dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe(result => {
|
||||
if (result == "pdf") {
|
||||
this.downloadPDF(this.dmp.id);
|
||||
} else if (result == "doc") {
|
||||
this.downloadDocx(this.dmp.id);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
onCallbackSuccess(): void {
|
||||
this.uiNotificationService.snackBarNotification(this.isNew ? this.language.instant('GENERAL.SNACK-BAR.SUCCESSFUL-CREATION') : this.language.instant('GENERAL.SNACK-BAR.SUCCESSFUL-UPDATE'), SnackBarNotificationLevel.Success);
|
||||
this.router.navigate(['/plans']);
|
||||
|
|
Loading…
Reference in New Issue