Skip to content
Snippets Groups Projects
Unverified Commit c8ba834d authored by Bekerle, Patrizio's avatar Bekerle, Patrizio :fire:
Browse files

Implement more detailed upload indicator (#1)

parent 7338bfd1
No related branches found
No related tags found
No related merge requests found
Pipeline #9680 passed with warnings
......@@ -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",
......
......@@ -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",
......
......@@ -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>
......
Subproject commit 564b17bf0b128d1ba7b4bbddf9b3c1123a2450c9
Subproject commit ac58867f0a921fbdebda78b6bf78b58b69779f4c
Subproject commit 8984c0757938e0fde820c2f93cf73c1aace999a6
Subproject commit b2056506a45ce8f1e378c931af004d92688cc5fe
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment