diff --git a/ng2-components/ng2-alfresco-upload/i18n/en.json b/ng2-components/ng2-alfresco-upload/i18n/en.json index 06a8fad630..7c6b12cc2f 100644 --- a/ng2-components/ng2-alfresco-upload/i18n/en.json +++ b/ng2-components/ng2-alfresco-upload/i18n/en.json @@ -2,7 +2,8 @@ "FILE_UPLOAD": { "BUTTON": { "UPLOAD_FILE": "Upload file", - "UPLOAD_FOLDER": "Upload folder" + "UPLOAD_FOLDER": "Upload folder", + "CANCEL": "CANCEL" }, "MESSAGES": { "COMPLETED": "uploads complete", diff --git a/ng2-components/ng2-alfresco-upload/i18n/it.json b/ng2-components/ng2-alfresco-upload/i18n/it.json index 6e38ded16c..e5b64499e8 100644 --- a/ng2-components/ng2-alfresco-upload/i18n/it.json +++ b/ng2-components/ng2-alfresco-upload/i18n/it.json @@ -2,7 +2,8 @@ "FILE_UPLOAD": { "BUTTON": { "UPLOAD_FILE": "Carica un file", - "UPLOAD_FOLDER": "Carica una cartella" + "UPLOAD_FOLDER": "Carica una cartella", + "CANCEL": "CANCELLA" }, "MESSAGES": { "COMPLETED": "caricamenti completati", diff --git a/ng2-components/ng2-alfresco-upload/src/components/file-uploading-list.component.css b/ng2-components/ng2-alfresco-upload/src/components/file-uploading-list.component.css index 6b7bdc155b..5b1b71ce5c 100644 --- a/ng2-components/ng2-alfresco-upload/src/components/file-uploading-list.component.css +++ b/ng2-components/ng2-alfresco-upload/src/components/file-uploading-list.component.css @@ -5,4 +5,34 @@ .cursor { cursor: pointer; +} + +.body-dialog-header { + display: -webkit-box; + display: -moz-box; + display: -ms-flexbox; + display: -webkit-flex; + display: flex; + background-color: #f5f5f5; + border-bottom: solid 1px #eee; + height: 30px; + line-height: 30px; +} + +.body-dialog-action { + -webkit-flex: 1 1 auto; + flex: 1 1 auto; + overflow: hidden; + padding: 0 18px; + text-overflow: ellipsis; + white-space: nowrap; + word-wrap: break-word; +} + +.body-dialog-cancel { + -webkit-flex: none; + flex: none; + display: inline; + padding-right: 13px; + text-align: right; } \ No newline at end of file diff --git a/ng2-components/ng2-alfresco-upload/src/components/file-uploading-list.component.html b/ng2-components/ng2-alfresco-upload/src/components/file-uploading-list.component.html index 221b612fa2..a988633254 100644 --- a/ng2-components/ng2-alfresco-upload/src/components/file-uploading-list.component.html +++ b/ng2-components/ng2-alfresco-upload/src/components/file-uploading-list.component.html @@ -1,3 +1,8 @@ +
{{'FILE_UPLOAD.FILE_INFO.NAME' | translate}} | diff --git a/ng2-components/ng2-alfresco-upload/src/components/file-uploading-list.component.ts b/ng2-components/ng2-alfresco-upload/src/components/file-uploading-list.component.ts index f451a6d2df..f0c8c95a95 100644 --- a/ng2-components/ng2-alfresco-upload/src/components/file-uploading-list.component.ts +++ b/ng2-components/ng2-alfresco-upload/src/components/file-uploading-list.component.ts @@ -61,4 +61,30 @@ export class FileUploadingListComponent { }); file[0].setAbort(); } + + /** + * Call the abort method for each file + */ + cancelAllFiles() { + this.filesUploadingList.forEach((uploadingFileModel: FileModel) => { + uploadingFileModel.setAbort(); + }); + } + + /** + * Verify if all the files are in state done or abort + * @returns {boolean} - false if there is a file in progress + */ + isUploadCompleted() { + let isPending = false; + let isAllCompleted = true; + for (let i = 0; i < this.filesUploadingList.length && !isPending; i++) { + let uploadingFileModel = this.filesUploadingList[i]; + if (!uploadingFileModel.done && !uploadingFileModel.abort) { + isPending = true; + isAllCompleted = false; + } + } + return isAllCompleted; + } }
---|