2019-09-23 10:17:03 +02:00
|
|
|
|
|
|
|
import {of as observableOf, Observable } from 'rxjs';
|
2019-05-21 15:42:28 +02:00
|
|
|
import { Component, OnInit } from '@angular/core';
|
2019-09-20 17:27:54 +02:00
|
|
|
import { MatDialog } from '@angular/material/dialog';
|
2019-07-01 11:35:09 +02:00
|
|
|
import { ActivatedRoute, Params, Router } from '@angular/router';
|
2019-05-21 15:42:28 +02:00
|
|
|
import { TranslateService } from '@ngx-translate/core';
|
2019-07-01 11:35:09 +02:00
|
|
|
import * as FileSaver from 'file-saver';
|
|
|
|
import { takeUntil } from 'rxjs/operators';
|
|
|
|
import { BaseComponent } from '../../../core/common/base/base.component';
|
|
|
|
import { DatasetStatus } from '../../../core/common/enum/dataset-status';
|
|
|
|
import { DmpStatus } from '../../../core/common/enum/dmp-status';
|
2019-05-21 15:42:28 +02:00
|
|
|
import { Principal } from '../../../core/model/auth/Principal';
|
|
|
|
import { DatasetOverviewModel } from '../../../core/model/dataset/dataset-overview';
|
2019-07-01 11:35:09 +02:00
|
|
|
import { DmpOverviewModel } from '../../../core/model/dmp/dmp-overview';
|
|
|
|
import { UserInfoListingModel } from '../../../core/model/user/user-info-listing';
|
|
|
|
import { AuthService } from '../../../core/services/auth/auth.service';
|
|
|
|
import { DmpService } from '../../../core/services/dmp/dmp.service';
|
|
|
|
import { SnackBarNotificationLevel, UiNotificationService } from '../../../core/services/notification/ui-notification-service';
|
2019-05-21 15:42:28 +02:00
|
|
|
import { ConfirmationDialogComponent } from '../../../library/confirmation-dialog/confirmation-dialog.component';
|
2019-05-22 11:52:53 +02:00
|
|
|
import { BreadcrumbItem } from '../../misc/breadcrumb/definition/breadcrumb-item';
|
2019-07-01 11:35:09 +02:00
|
|
|
import { DmpFinalizeDialogComponent, DmpFinalizeDialogInput, DmpFinalizeDialogOutput } from '../editor/dmp-finalize-dialog/dmp-finalize-dialog.component';
|
|
|
|
import { DatasetsToBeFinalized } from '../../../core/model/dataset/datasets-toBeFinalized';
|
2019-05-21 15:42:28 +02:00
|
|
|
|
|
|
|
@Component({
|
|
|
|
selector: 'app-dmp-overview',
|
|
|
|
templateUrl: './dmp-overview.component.html',
|
|
|
|
styleUrls: ['./dmp-overview.component.scss']
|
|
|
|
})
|
|
|
|
export class DmpOverviewComponent extends BaseComponent implements OnInit {
|
|
|
|
|
|
|
|
dmp: DmpOverviewModel;
|
|
|
|
isNew = true;
|
2019-07-01 11:35:09 +02:00
|
|
|
isFinalized = false;
|
2019-07-18 16:16:12 +02:00
|
|
|
isPublicView = true;
|
2019-07-01 11:35:09 +02:00
|
|
|
hasPublishButton: boolean = true;
|
2019-09-23 10:17:03 +02:00
|
|
|
breadCrumbs: Observable<BreadcrumbItem[]> = observableOf();
|
2019-05-21 15:42:28 +02:00
|
|
|
|
|
|
|
constructor(
|
|
|
|
private route: ActivatedRoute,
|
|
|
|
private router: Router,
|
|
|
|
private dmpService: DmpService,
|
|
|
|
private translate: TranslateService,
|
|
|
|
private authentication: AuthService,
|
|
|
|
private dialog: MatDialog,
|
|
|
|
private language: TranslateService,
|
|
|
|
private uiNotificationService: UiNotificationService
|
|
|
|
) {
|
|
|
|
super();
|
|
|
|
}
|
|
|
|
|
|
|
|
ngOnInit() {
|
|
|
|
// Gets dmp data using parameter id
|
|
|
|
this.route.params
|
|
|
|
.pipe(takeUntil(this._destroyed))
|
|
|
|
.subscribe((params: Params) => {
|
|
|
|
const itemId = params['id'];
|
2019-06-11 10:25:32 +02:00
|
|
|
const publicId = params['publicId'];
|
2019-05-21 15:42:28 +02:00
|
|
|
if (itemId != null) {
|
|
|
|
this.isNew = false;
|
2019-07-18 16:16:12 +02:00
|
|
|
this.isPublicView = false;
|
2019-05-21 15:42:28 +02:00
|
|
|
this.dmpService.getOverviewSingle(itemId)
|
|
|
|
.pipe(takeUntil(this._destroyed))
|
|
|
|
.subscribe(data => {
|
|
|
|
this.dmp = data;
|
2019-05-23 15:00:11 +02:00
|
|
|
const breadCrumbs = [];
|
2019-06-07 13:03:10 +02:00
|
|
|
breadCrumbs.push({ parentComponentName: null, label: this.language.instant('NAV-BAR.MY-DMPS'), url: "/plans" });
|
|
|
|
breadCrumbs.push({ parentComponentName: 'DmpListingComponent', label: this.dmp.label, url: '/plans/overview/' + this.dmp.id });
|
2019-09-23 10:17:03 +02:00
|
|
|
this.breadCrumbs = observableOf(breadCrumbs);
|
2019-05-21 15:42:28 +02:00
|
|
|
})
|
|
|
|
}
|
2019-06-11 10:25:32 +02:00
|
|
|
else if (publicId != null) {
|
|
|
|
this.isNew = false;
|
2019-07-01 11:35:09 +02:00
|
|
|
this.isFinalized = true;
|
2019-07-18 16:16:12 +02:00
|
|
|
this.isPublicView = true;
|
2019-06-11 10:25:32 +02:00
|
|
|
this.dmpService.getOverviewSinglePublic(publicId)
|
|
|
|
.pipe(takeUntil(this._destroyed))
|
|
|
|
.subscribe(data => {
|
|
|
|
this.dmp = data;
|
|
|
|
const breadCrumbs = [];
|
2019-07-18 16:26:53 +02:00
|
|
|
breadCrumbs.push({ parentComponentName: null, label: this.language.instant('NAV-BAR.PUBLIC-DMPS'), url: "/explore-plans" });
|
2019-06-11 10:25:32 +02:00
|
|
|
breadCrumbs.push({ parentComponentName: 'DmpListingComponent', label: this.dmp.label, url: '/plans/publicOverview/' + this.dmp.id });
|
2019-09-23 10:17:03 +02:00
|
|
|
this.breadCrumbs = observableOf(breadCrumbs);
|
2019-06-11 10:25:32 +02:00
|
|
|
});
|
|
|
|
}
|
2019-05-21 15:42:28 +02:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
editClicked(dmp: DmpOverviewModel) {
|
|
|
|
this.router.navigate(['/plans/edit/' + dmp.id]);
|
|
|
|
}
|
|
|
|
|
|
|
|
cloneClicked(dmp: DmpOverviewModel) {
|
|
|
|
this.router.navigate(['/plans/clone/' + dmp.id]);
|
|
|
|
}
|
|
|
|
|
2019-10-04 10:53:30 +02:00
|
|
|
grantClicked(grantId: String) {
|
|
|
|
// ----------- UNCOMMENT TO ADD AGAIN GRANTS --------
|
|
|
|
// this.router.navigate(['/grants/edit/' + grantId]);
|
|
|
|
}
|
2019-05-21 15:42:28 +02:00
|
|
|
|
|
|
|
datasetClicked(datasetId: String) {
|
2019-08-21 16:53:19 +02:00
|
|
|
if (this.isPublicView) {
|
|
|
|
this.router.navigate(['/datasets/publicEdit/' + datasetId]);
|
|
|
|
} else {
|
|
|
|
this.router.navigate(['/datasets/edit/' + datasetId]);
|
|
|
|
}
|
2019-05-21 15:42:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
datasetsClicked(dmpId: String) {
|
2019-07-01 11:35:09 +02:00
|
|
|
if (!this.isFinalized)
|
2019-07-18 16:16:12 +02:00
|
|
|
this.router.navigate(['/plans/edit/' + dmpId], { queryParams: { tab: "datasetDescriptions" } });
|
2019-06-11 10:25:32 +02:00
|
|
|
else
|
|
|
|
this.router.navigate(['/explore'], { queryParams: { dmpId: dmpId } });
|
2019-05-21 15:42:28 +02:00
|
|
|
}
|
|
|
|
|
2019-05-22 11:52:53 +02:00
|
|
|
goToUri(uri: string) {
|
2019-05-21 15:42:28 +02:00
|
|
|
window.open(uri, "_blank");
|
|
|
|
}
|
|
|
|
|
|
|
|
deleteClicked() {
|
|
|
|
const dialogRef = this.dialog.open(ConfirmationDialogComponent, {
|
|
|
|
maxWidth: '300px',
|
|
|
|
data: {
|
|
|
|
message: this.language.instant('GENERAL.CONFIRMATION-DIALOG.DELETE-ITEM'),
|
2019-05-22 15:36:24 +02:00
|
|
|
confirmButton: this.language.instant('GENERAL.CONFIRMATION-DIALOG.ACTIONS.DELETE'),
|
2019-06-26 11:24:06 +02:00
|
|
|
cancelButton: this.language.instant('GENERAL.CONFIRMATION-DIALOG.ACTIONS.CANCEL'),
|
|
|
|
isDeleteConfirmation: true
|
2019-05-21 15:42:28 +02:00
|
|
|
}
|
|
|
|
});
|
|
|
|
dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe(result => {
|
|
|
|
if (result) {
|
|
|
|
this.dmpService.delete(this.dmp.id)
|
|
|
|
.pipe(takeUntil(this._destroyed))
|
|
|
|
.subscribe(
|
2019-09-20 17:27:54 +02:00
|
|
|
complete => { this.onCallbackSuccess() },
|
|
|
|
error => this.onDeleteCallbackError(error)
|
2019-05-21 15:42:28 +02:00
|
|
|
);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
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']);
|
|
|
|
}
|
|
|
|
|
|
|
|
onDeleteCallbackError(error) {
|
|
|
|
this.uiNotificationService.snackBarNotification(error.error.message ? error.error.message : this.language.instant('GENERAL.SNACK-BAR.UNSUCCESSFUL-DELETE'), SnackBarNotificationLevel.Error);
|
|
|
|
}
|
|
|
|
|
|
|
|
downloadXml(id: string) {
|
|
|
|
this.dmpService.downloadXML(id)
|
|
|
|
.pipe(takeUntil(this._destroyed))
|
|
|
|
.subscribe(response => {
|
|
|
|
const blob = new Blob([response.body], { type: 'application/xml' });
|
|
|
|
const filename = this.getFilenameFromContentDispositionHeader(response.headers.get('Content-Disposition'));
|
|
|
|
|
|
|
|
FileSaver.saveAs(blob, filename);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
downloadDocx(id: string) {
|
|
|
|
this.dmpService.downloadDocx(id)
|
|
|
|
.pipe(takeUntil(this._destroyed))
|
|
|
|
.subscribe(response => {
|
|
|
|
const blob = new Blob([response.body], { type: 'application/msword' });
|
|
|
|
const filename = this.getFilenameFromContentDispositionHeader(response.headers.get('Content-Disposition'));
|
|
|
|
|
|
|
|
FileSaver.saveAs(blob, filename);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
downloadPDF(id: string) {
|
|
|
|
this.dmpService.downloadPDF(id)
|
|
|
|
.pipe(takeUntil(this._destroyed))
|
|
|
|
.subscribe(response => {
|
|
|
|
const blob = new Blob([response.body], { type: 'application/pdf' });
|
|
|
|
const filename = this.getFilenameFromContentDispositionHeader(response.headers.get('Content-Disposition'));
|
|
|
|
|
|
|
|
FileSaver.saveAs(blob, filename);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2019-06-04 16:55:23 +02:00
|
|
|
downloadJson(id: string) {
|
|
|
|
this.dmpService.downloadJson(id)
|
|
|
|
.pipe(takeUntil(this._destroyed))
|
|
|
|
.subscribe(response => {
|
|
|
|
const blob = new Blob([response.body], { type: 'application/json' });
|
|
|
|
const filename = this.getFilenameFromContentDispositionHeader(response.headers.get('Content-Disposition'));
|
|
|
|
FileSaver.saveAs(blob, filename);
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
2019-05-21 15:42:28 +02:00
|
|
|
getFilenameFromContentDispositionHeader(header: string): string {
|
|
|
|
const regex: RegExp = new RegExp(/filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/g);
|
|
|
|
|
|
|
|
const matches = header.match(regex);
|
|
|
|
let filename: string;
|
|
|
|
for (let i = 0; i < matches.length; i++) {
|
|
|
|
const match = matches[i];
|
|
|
|
if (match.includes('filename="')) {
|
|
|
|
filename = match.substring(10, match.length - 1);
|
|
|
|
break;
|
|
|
|
} else if (match.includes('filename=')) {
|
|
|
|
filename = match.substring(9);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return filename;
|
|
|
|
}
|
|
|
|
|
|
|
|
roleDisplay(value: UserInfoListingModel[]) {
|
|
|
|
const principal: Principal = this.authentication.current();
|
|
|
|
let role: number;
|
|
|
|
if (principal) {
|
|
|
|
value.forEach(element => {
|
|
|
|
if (principal.id === element.id) {
|
|
|
|
role = element.role;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
if (role === 0) {
|
|
|
|
return this.translate.instant('DMP-LISTING.OWNER');
|
|
|
|
}
|
|
|
|
else if (role === 1) {
|
|
|
|
return this.translate.instant('DMP-LISTING.MEMBER');
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
return this.translate.instant('DMP-LISTING.OWNER');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-07-01 11:35:09 +02:00
|
|
|
isDraftDataset(dataset: DatasetOverviewModel) {
|
|
|
|
return dataset.status == DatasetStatus.Draft;
|
|
|
|
}
|
|
|
|
|
|
|
|
isDraftDmp(dmp: DmpOverviewModel) {
|
|
|
|
return dmp.status == DmpStatus.Draft;
|
|
|
|
}
|
|
|
|
|
|
|
|
isFinalizedDmp(dmp: DmpOverviewModel) {
|
|
|
|
return dmp.status == DmpStatus.Finalized;
|
|
|
|
}
|
|
|
|
|
2019-07-18 16:16:12 +02:00
|
|
|
isPublishedDMP(dmp: DmpOverviewModel) {
|
|
|
|
return (dmp.status == DmpStatus.Finalized && dmp.isPublic);
|
|
|
|
}
|
|
|
|
|
2019-07-05 13:01:24 +02:00
|
|
|
hasDoi(dmp: DmpOverviewModel) {
|
|
|
|
return dmp.doi == null ? true : false;
|
|
|
|
}
|
|
|
|
|
|
|
|
getDoi(dmp: DmpOverviewModel) {
|
|
|
|
const dialogRef = this.dialog.open(ConfirmationDialogComponent, {
|
|
|
|
maxWidth: '600px',
|
2019-09-27 10:09:29 +02:00
|
|
|
restoreFocus: false,
|
2019-07-05 13:01:24 +02:00
|
|
|
data: {
|
|
|
|
message: this.language.instant('GENERAL.CONFIRMATION-DIALOG.ZENODO-DOI'),
|
|
|
|
confirmButton: this.language.instant('GENERAL.CONFIRMATION-DIALOG.ACTIONS.CONFIRM'),
|
|
|
|
cancelButton: this.language.instant('GENERAL.CONFIRMATION-DIALOG.ACTIONS.CANCEL'),
|
|
|
|
}
|
|
|
|
});
|
|
|
|
dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe(result => {
|
|
|
|
if (result) {
|
|
|
|
this.dmpService.getDoi(dmp.id)
|
|
|
|
.pipe(takeUntil(this._destroyed))
|
|
|
|
.subscribe(
|
2019-09-20 17:27:54 +02:00
|
|
|
complete => {
|
|
|
|
this.onDOICallbackSuccess();
|
|
|
|
this.dmp.doi = complete;
|
|
|
|
},
|
|
|
|
error => this.onDeleteCallbackError(error)
|
2019-07-05 13:01:24 +02:00
|
|
|
);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
onDOICallbackSuccess(): void {
|
|
|
|
this.uiNotificationService.snackBarNotification(this.language.instant('DMP-EDITOR.SNACK-BAR.SUCCESSFUL-DOI'), SnackBarNotificationLevel.Success);
|
|
|
|
}
|
|
|
|
|
|
|
|
onDOICallbackError(error) {
|
|
|
|
this.uiNotificationService.snackBarNotification(error.error.message ? error.error.message : this.language.instant('DMP-EDITOR.SNACK-BAR.UNSUCCESSFUL-DOI'), SnackBarNotificationLevel.Error);
|
|
|
|
}
|
|
|
|
|
2019-07-01 11:35:09 +02:00
|
|
|
showPublishButton(dmp: DmpOverviewModel) {
|
|
|
|
return this.isFinalizedDmp(dmp) && !dmp.isPublic && this.hasPublishButton;
|
|
|
|
}
|
|
|
|
|
|
|
|
publish(dmpId: String) {
|
2019-09-20 17:27:54 +02:00
|
|
|
const dialogRef = this.dialog.open(ConfirmationDialogComponent, {
|
2019-11-06 15:30:15 +01:00
|
|
|
maxWidth: '500px',
|
2019-09-27 10:09:29 +02:00
|
|
|
restoreFocus: false,
|
2019-09-20 17:27:54 +02:00
|
|
|
data: {
|
|
|
|
message: this.language.instant('GENERAL.CONFIRMATION-DIALOG.PUBLISH-ITEM'),
|
2019-10-09 10:45:47 +02:00
|
|
|
privacyPolicyNames: this.language.instant('GENERAL.CONFIRMATION-DIALOG.PRIVACY-POLICY-NAMES'),
|
2019-09-20 17:27:54 +02:00
|
|
|
confirmButton: this.language.instant('GENERAL.CONFIRMATION-DIALOG.ACTIONS.CONFIRM'),
|
|
|
|
cancelButton: this.language.instant('GENERAL.CONFIRMATION-DIALOG.ACTIONS.CANCEL'),
|
|
|
|
isDeleteConfirmation: false
|
|
|
|
}
|
|
|
|
});
|
|
|
|
dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe(result => {
|
|
|
|
if (result) {
|
|
|
|
this.dmpService.publish(dmpId)
|
|
|
|
.pipe(takeUntil(this._destroyed))
|
|
|
|
.subscribe(() => { this.hasPublishButton = false });
|
|
|
|
}
|
|
|
|
});
|
2019-07-01 11:35:09 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
finalize(dmp: DmpOverviewModel) {
|
|
|
|
|
|
|
|
const dialogInputModel: DmpFinalizeDialogInput = {
|
|
|
|
dmpLabel: this.dmp.label,
|
|
|
|
dmpDescription: this.dmp.description,
|
|
|
|
datasets: this.dmp.datasets.map(x => {
|
|
|
|
return { label: x.label, id: x.id, status: x.status }
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
const dialogRef = this.dialog.open(DmpFinalizeDialogComponent, {
|
|
|
|
maxWidth: '500px',
|
2019-09-27 10:09:29 +02:00
|
|
|
restoreFocus: false,
|
2019-07-01 11:35:09 +02:00
|
|
|
data: {
|
|
|
|
dialogInputModel: dialogInputModel,
|
|
|
|
message: this.language.instant('GENERAL.CONFIRMATION-DIALOG.FINALIZE-ITEM'),
|
|
|
|
confirmButton: this.language.instant('DMP-FINALISE-DIALOG.SUBMIT'),
|
|
|
|
cancelButton: this.language.instant('GENERAL.CONFIRMATION-DIALOG.ACTIONS.CANCEL'),
|
|
|
|
}
|
|
|
|
});
|
|
|
|
dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe((result: DmpFinalizeDialogOutput) => {
|
|
|
|
if (result && !result.cancelled) {
|
|
|
|
var datasetsToBeFinalized: DatasetsToBeFinalized = {
|
|
|
|
uuids: result.datasetsToBeFinalized
|
|
|
|
};
|
|
|
|
this.dmpService.finalize(datasetsToBeFinalized, this.dmp.id)
|
|
|
|
.pipe(takeUntil(this._destroyed))
|
|
|
|
.subscribe(
|
2019-09-20 17:27:54 +02:00
|
|
|
complete => {
|
|
|
|
this.dmp.status = DmpStatus.Finalized;
|
|
|
|
this.onCallbackSuccess()
|
|
|
|
},
|
|
|
|
error => this.onFinalizeCallbackError(error)
|
2019-07-01 11:35:09 +02:00
|
|
|
);
|
|
|
|
}
|
|
|
|
});
|
2019-05-21 15:42:28 +02:00
|
|
|
}
|
2019-07-05 14:57:28 +02:00
|
|
|
|
|
|
|
onFinalizeCallbackError(error) {
|
|
|
|
this.uiNotificationService.snackBarNotification(error.error.message ? error.error.message : this.language.instant('DMP-EDITOR.SNACK-BAR.UNSUCCESSFUL-FINALIZE'), SnackBarNotificationLevel.Error);
|
|
|
|
}
|
2019-07-18 12:17:34 +02:00
|
|
|
|
|
|
|
newVersion(id: String, label: String) {
|
|
|
|
this.router.navigate(['/plans/new_version/' + id, { dmpLabel: label }]);
|
|
|
|
}
|
|
|
|
|
|
|
|
viewVersions(rowId: String, rowLabel: String) {
|
|
|
|
this.router.navigate(['/plans/versions/' + rowId], { queryParams: { groupLabel: rowLabel } });
|
|
|
|
}
|
2019-09-25 11:44:22 +02:00
|
|
|
|
|
|
|
// advancedClicked() {
|
|
|
|
// const dialogRef = this.dialog.open(ExportMethodDialogComponent, {
|
|
|
|
// maxWidth: '500px',
|
|
|
|
// data: {
|
|
|
|
// message: "Download as:",
|
|
|
|
// XMLButton: "XML",
|
|
|
|
// documentButton: "Document",
|
|
|
|
// pdfButton: "PDF",
|
|
|
|
// jsonButton: "JSON"
|
|
|
|
// }
|
|
|
|
// });
|
|
|
|
// dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe(result => {
|
|
|
|
// if (result == "pdf") {
|
|
|
|
// this.downloadPDF(this.dmp.id);
|
|
|
|
// } else if (result == "xml") {
|
|
|
|
// this.downloadXml(this.dmp.id);
|
|
|
|
// } else if (result == "doc") {
|
|
|
|
// this.downloadDocx(this.dmp.id);
|
|
|
|
// } else if (result == "json") {
|
|
|
|
// this.downloadJson(this.dmp.id);
|
|
|
|
// }
|
|
|
|
// });
|
|
|
|
// }
|
|
|
|
|
|
|
|
// 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);
|
|
|
|
// }
|
|
|
|
// });
|
|
|
|
// }
|
|
|
|
|
2019-05-21 15:42:28 +02:00
|
|
|
}
|