You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
argos/dmp-frontend/src/app/ui/dmp/listing/criteria/upload-dialogue/dmp-upload-dialogue.compone...

38 lines
921 B
TypeScript

import { Component, Inject } from '@angular/core';
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
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;
}
}
}