mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-17 15:03:07 +00:00
[DURACOM-282] fix error when discarding submission with no uploaded files
This commit is contained in:
@@ -227,20 +227,21 @@ export class SubmissionSectionUploadComponent extends SectionModelComponent {
|
|||||||
this.changeDetectorRef.detectChanges();
|
this.changeDetectorRef.detectChanges();
|
||||||
}),
|
}),
|
||||||
|
|
||||||
|
|
||||||
// retrieve submission's bitstream data from state
|
// retrieve submission's bitstream data from state
|
||||||
combineLatest([this.configMetadataForm$,
|
combineLatest([
|
||||||
this.bitstreamService.getUploadedFilesData(this.submissionId, this.sectionData.id)]).pipe(
|
this.configMetadataForm$,
|
||||||
filter(([configMetadataForm, { files }]: [SubmissionFormsModel, WorkspaceitemSectionUploadObject]) => {
|
this.bitstreamService.getUploadedFilesData(this.submissionId, this.sectionData.id),
|
||||||
return isNotEmpty(configMetadataForm) && isNotEmpty(files);
|
]).pipe(
|
||||||
|
filter(([configMetadataForm, sectionUploadObject]: [SubmissionFormsModel, WorkspaceitemSectionUploadObject]) => {
|
||||||
|
return isNotEmpty(configMetadataForm) && isNotEmpty(sectionUploadObject);
|
||||||
}),
|
}),
|
||||||
distinctUntilChanged())
|
distinctUntilChanged(),
|
||||||
.subscribe(([configMetadataForm, { primary, files }]: [SubmissionFormsModel, WorkspaceitemSectionUploadObject]) => {
|
).subscribe(([configMetadataForm, { primary, files }]: [SubmissionFormsModel, WorkspaceitemSectionUploadObject]) => {
|
||||||
this.primaryBitstreamUUID = primary;
|
this.primaryBitstreamUUID = primary;
|
||||||
this.fileList = files;
|
this.fileList = files;
|
||||||
this.fileNames = Array.from(files, file => this.getFileName(configMetadataForm, file));
|
this.fileNames = Array.from(files, file => this.getFileName(configMetadataForm, file));
|
||||||
},
|
this.changeDetectorRef.detectChanges();
|
||||||
),
|
}),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user