diff --git a/src/i18n/de/translation.json b/src/i18n/de/translation.json index 8e1589db2c92d7fc9e6d060823a48dd89c368287..b5b493d244e9ef6f7518426d75c6c5fb8e2f2d5e 100644 --- a/src/i18n/de/translation.json +++ b/src/i18n/de/translation.json @@ -13,7 +13,8 @@ "upload-button-label": "PDF Dateien auswählen", "download-file-button-title": "Signiertes PDF herunterladen", "error-files-label": "Fehlgeschlagene Signiervorgänge", - "re-upload-file-button-title": "Erneut hochladen" + "re-upload-file-button-title": "Erneut hochladen", + "upload-status-file-text": "({{fileSize}}) wird hochgeladen..." }, "welcome": { "headline": "Willkommen beim Amtssignaturservice der TU Graz", diff --git a/src/i18n/en/translation.json b/src/i18n/en/translation.json index b3ed3e2f81ac9cacc207735ad663e28789a0c9b1..d3ae60f3bf65a8b74c9b1ba9a3170d8e46fdbb66 100644 --- a/src/i18n/en/translation.json +++ b/src/i18n/en/translation.json @@ -13,7 +13,8 @@ "upload-button-label": "Select PDF files", "download-file-button-title": "Download signed PDF", "error-files-label": "Failed signing processes", - "re-upload-file-button-title": "Upload again" + "re-upload-file-button-title": "Upload again", + "upload-status-file-text": "({{fileSize}}) is currently uploading..." }, "welcome": { "headline": "Welcome to the official signature service of the TU Graz", diff --git a/src/vpu-signature-pdf-upload.js b/src/vpu-signature-pdf-upload.js index 89736e04a105fc4b7878d27171cf512ed2a90176..c70e07537f3a51527a1463742b99091912aaa8d0 100644 --- a/src/vpu-signature-pdf-upload.js +++ b/src/vpu-signature-pdf-upload.js @@ -23,6 +23,8 @@ class SignaturePdfUpload extends VPUSignatureLitElement { this.errorFiles = []; this.errorFilesCount = 0; this.uploadInProgress = false; + this.uploadStatusFileName = ""; + this.uploadStatusText = ""; } static get properties() { @@ -34,6 +36,8 @@ class SignaturePdfUpload extends VPUSignatureLitElement { errorFiles: { type: Array, attribute: false }, errorFilesCount: { type: Number, attribute: false }, uploadInProgress: { type: Boolean, attribute: false }, + uploadStatusFileName: { type: String, attribute: false }, + uploadStatusText: { type: String, attribute: false }, }; } @@ -43,6 +47,7 @@ class SignaturePdfUpload extends VPUSignatureLitElement { this.updateComplete.then(()=>{ const fileUpload = this._("#file-upload"); fileUpload.addEventListener('vpu-fileupload-all-start', this.onAllUploadStarted.bind(this)); + fileUpload.addEventListener('vpu-fileupload-file-start', this.onFileUploadStarted.bind(this)); fileUpload.addEventListener('vpu-fileupload-file-finished', this.onFileUploadFinished.bind(this)); fileUpload.addEventListener('vpu-fileupload-all-finished', this.onAllUploadFinished.bind(this)); }); @@ -56,6 +61,18 @@ class SignaturePdfUpload extends VPUSignatureLitElement { this.uploadInProgress = true; } + /** + * @param ev + */ + onFileUploadStarted(ev) { + console.log(ev); + this.uploadStatusFileName = ev.detail.fileName; + this.uploadStatusText = i18n.t('pdf-upload.upload-status-file-text', { + fileName: ev.detail.fileName, + fileSize: humanFileSize(ev.detail.fileSize, false), + }); + } + /** * @param ev */ @@ -192,6 +209,12 @@ class SignaturePdfUpload extends VPUSignatureLitElement { background-color: lightpink; border-color: lightcoral; } + + .notification vpu-mini-spinner { + position: relative; + top: 2px; + margin-right: 5px; + } `; } @@ -238,7 +261,8 @@ class SignaturePdfUpload extends VPUSignatureLitElement { </div> <div class="field notification is-info ${classMap({hidden: !this.uploadInProgress})}"> <vpu-mini-spinner></vpu-mini-spinner> - Upload in progress... + <strong>${this.uploadStatusFileName}</strong> + ${this.uploadStatusText} </div> <div class="files-block field ${classMap({hidden: this.signedFilesCount === 0})}"> <label class="label">${i18n.t('pdf-upload.signed-files-label')}</label> diff --git a/vendor/common b/vendor/common index 564b17bf0b128d1ba7b4bbddf9b3c1123a2450c9..ac58867f0a921fbdebda78b6bf78b58b69779f4c 160000 --- a/vendor/common +++ b/vendor/common @@ -1 +1 @@ -Subproject commit 564b17bf0b128d1ba7b4bbddf9b3c1123a2450c9 +Subproject commit ac58867f0a921fbdebda78b6bf78b58b69779f4c diff --git a/vendor/file-upload b/vendor/file-upload index 8984c0757938e0fde820c2f93cf73c1aace999a6..b2056506a45ce8f1e378c931af004d92688cc5fe 160000 --- a/vendor/file-upload +++ b/vendor/file-upload @@ -1 +1 @@ -Subproject commit 8984c0757938e0fde820c2f93cf73c1aace999a6 +Subproject commit b2056506a45ce8f1e378c931af004d92688cc5fe