2019-03-05 12:59:34 +01:00
|
|
|
import { Component, Inject } from '@angular/core';
|
2019-09-23 10:17:03 +02:00
|
|
|
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
|
2019-03-05 12:59:34 +01:00
|
|
|
import { DmpService } from '../../../../../core/services/dmp/dmp.service';
|
|
|
|
|
|
|
|
@Component({
|
|
|
|
selector: 'dmp-upload-dialogue',
|
|
|
|
templateUrl: './dmp-upload-dialogue.component.html',
|
|
|
|
styleUrls: ['./dmp-upload-dialogue.component.scss']
|
|
|
|
})
|
|
|
|
export class DmpUploadDialogue {
|
|
|
|
dmpTitle: string;
|
|
|
|
|
|
|
|
|
|
|
|
constructor(
|
|
|
|
public dialogRef: MatDialogRef<DmpUploadDialogue>,
|
|
|
|
@Inject(MAT_DIALOG_DATA) public data: any,
|
|
|
|
) {}
|
|
|
|
|
|
|
|
cancel() {
|
|
|
|
this.data.success = false;
|
|
|
|
this.dialogRef.close(this.data);
|
|
|
|
}
|
|
|
|
|
|
|
|
confirm() {
|
|
|
|
this.data.success = true;
|
|
|
|
this.data.dmpTitle = this.dmpTitle;
|
|
|
|
this.dialogRef.close(this.data);
|
|
|
|
}
|
|
|
|
|
|
|
|
uploadFile(event) {
|
|
|
|
const fileList: FileList = event.target.files
|
|
|
|
this.data.fileList = fileList;
|
|
|
|
if (this.data.fileList.length > 0) {
|
|
|
|
this.dmpTitle = fileList.item(0).name;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|