mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[AAE-3543] Attach button enabled only when all files uploaded (#6731)
* [AAE-3543] Attach button enabled only when all files uploaded * [AAE-3543] Add unit tests * [AAE-3543] Corrected name of unit test * [AAE-3543] Merged isQueueFinishedUploading() with isUploading() * [AAE-3543] Added spacing to unit tests
This commit is contained in:
@@ -88,11 +88,14 @@ export class UploadService {
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether the service is uploading a file.
|
||||
* @returns True if a file is uploading, false otherwise
|
||||
* Checks whether the service still has files uploading or awaiting upload.
|
||||
* @returns True if files in the queue are still uploading, false otherwise
|
||||
*/
|
||||
isUploading(): boolean {
|
||||
return !!this.activeTask;
|
||||
const finishedFileStates = [FileUploadStatus.Complete, FileUploadStatus.Cancelled, FileUploadStatus.Aborted, FileUploadStatus.Error, FileUploadStatus.Deleted];
|
||||
return this.queue.reduce((stillUploading: boolean, currentFile: FileModel) => {
|
||||
return stillUploading || finishedFileStates.indexOf(currentFile.status) === -1;
|
||||
}, false);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user