mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
[ADF-1358] Upload Dialog - Uploaded indicator should take in consideration cancelled files (#2197)
* indicate the number of files completed over cancelled ones * changed test names
This commit is contained in:
committed by
Mario Romano
parent
f2db536148
commit
4ec188141b
@@ -87,8 +87,8 @@ export class FileUploadingListComponent {
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if all the files are not in the Progress state.
|
||||
* @returns {boolean} - false if there is at least one file in Progress
|
||||
* Checks if all the files are uploaded
|
||||
* @returns {boolean} - false if there is at least one file in Progress | Starting | Pending
|
||||
*/
|
||||
isUploadCompleted(): boolean {
|
||||
return !this.isUploadCancelled() &&
|
||||
@@ -102,8 +102,8 @@ export class FileUploadingListComponent {
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if all the files are not in the Progress state.
|
||||
* @returns {boolean} - false if there is at least one file in Progress
|
||||
* Check if all the files are Cancelled | Aborted | Error.
|
||||
* @returns {boolean} - false if there is at least one file in uploading states
|
||||
*/
|
||||
isUploadCancelled(): boolean {
|
||||
return !!this.files.length &&
|
||||
@@ -115,12 +115,20 @@ export class FileUploadingListComponent {
|
||||
);
|
||||
}
|
||||
|
||||
uploadErrorFiles(): FileModel[] {
|
||||
return this.files.filter((item) => item.status === FileUploadStatus.Error);
|
||||
/**
|
||||
* Gets all the files with status Error.
|
||||
* @returns {boolean} - false if there is none
|
||||
*/
|
||||
get uploadErrorFiles(): FileModel[] {
|
||||
return this.files.filter(({status}) => status === FileUploadStatus.Error);
|
||||
}
|
||||
|
||||
totalErrorFiles(): number {
|
||||
return this.files.filter((item) => item.status === FileUploadStatus.Error).length;
|
||||
/**
|
||||
* Gets all the files with status Cancelled.
|
||||
* @returns {boolean} - false if there is none
|
||||
*/
|
||||
get uploadCancelledFiles(): FileModel[] {
|
||||
return this.files.filter(({status}) => status === FileUploadStatus.Cancelled);
|
||||
}
|
||||
|
||||
private onRemoveSuccess(file: FileModel): void {
|
||||
|
Reference in New Issue
Block a user