Skip to content
Snippets Groups Projects
Commit 35e459e7 authored by Bekerle, Patrizio's avatar Bekerle, Patrizio :fire: Committed by Reiter, Christoph
Browse files

Implement alwaysSendFile attribute (VPU/Apps/Signature#4)

parent 4a93569b
No related branches found
No related tags found
No related merge requests found
...@@ -21,6 +21,7 @@ export class FileUpload extends ScopedElementsMixin(VPULitElement) { ...@@ -21,6 +21,7 @@ export class FileUpload extends ScopedElementsMixin(VPULitElement) {
this.text = ''; this.text = '';
this.buttonLabel = ''; this.buttonLabel = '';
this.uploadInProgress = false; this.uploadInProgress = false;
this.alwaysSendFile = false;
} }
static get scopedElements() { static get scopedElements() {
...@@ -40,6 +41,7 @@ export class FileUpload extends ScopedElementsMixin(VPULitElement) { ...@@ -40,6 +41,7 @@ export class FileUpload extends ScopedElementsMixin(VPULitElement) {
text: { type: String }, text: { type: String },
buttonLabel: { type: String, attribute: 'button-label'}, buttonLabel: { type: String, attribute: 'button-label'},
uploadInProgress: { type: Boolean, attribute: false}, uploadInProgress: { type: Boolean, attribute: false},
alwaysSendFile: { type: Boolean, attribute: 'always-send-file'},
}; };
} }
...@@ -186,7 +188,7 @@ export class FileUpload extends ScopedElementsMixin(VPULitElement) { ...@@ -186,7 +188,7 @@ export class FileUpload extends ScopedElementsMixin(VPULitElement) {
.then((response) => { .then((response) => {
/* Done. Inform the user */ /* Done. Inform the user */
console.log(`Status: ${response.status} for file ${file.name}`); console.log(`Status: ${response.status} for file ${file.name}`);
this.sendFinishedEvent(response, file, response.status !== 201); this.sendFinishedEvent(response, file, response.status !== 201 || this.alwaysSendFile);
}) })
.catch((response) => { .catch((response) => {
/* Error. Inform the user */ /* Error. Inform the user */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment