mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-08 10:34:15 +00:00
Added a method to retrieve filename on upload bitstream
This commit is contained in:
@@ -163,8 +163,7 @@ export class UploadSectionComponent extends SectionModelComponent implements OnI
|
|||||||
fileList.forEach((file) => {
|
fileList.forEach((file) => {
|
||||||
this.fileList.push(file);
|
this.fileList.push(file);
|
||||||
this.fileIndexes.push(file.uuid);
|
this.fileIndexes.push(file.uuid);
|
||||||
const fileName = file.metadata['dc.title'][0].display || file.uuid;
|
this.fileNames.push(this.getFileName(file));
|
||||||
this.fileNames.push(fileName);
|
|
||||||
});
|
});
|
||||||
sectionStatus = true;
|
sectionStatus = true;
|
||||||
}
|
}
|
||||||
@@ -177,6 +176,18 @@ export class UploadSectionComponent extends SectionModelComponent implements OnI
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private getFileName(fileData: any): string {
|
||||||
|
const metadataName: string = this.configMetadataForm.rows[0].fields[0].selectableMetadata[0].metadata;
|
||||||
|
let title: string;
|
||||||
|
if (isNotEmpty(fileData.metadata) && isNotEmpty(fileData.metadata[metadataName])) {
|
||||||
|
title = fileData.metadata[metadataName][0].display;
|
||||||
|
} else {
|
||||||
|
title = fileData.uuid;
|
||||||
|
}
|
||||||
|
|
||||||
|
return title;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Method provided by Angular. Invoked when the instance is destroyed.
|
* Method provided by Angular. Invoked when the instance is destroyed.
|
||||||
*/
|
*/
|
||||||
|
Reference in New Issue
Block a user