From c4429f5dd760d09c5fb498f359a76ee3c80c6b17 Mon Sep 17 00:00:00 2001 From: Stefan Zermatten Date: Thu, 3 Mar 2022 15:54:44 +0200 Subject: [PATCH] Item quantity adjustment button now shows loading while in progress --- app/imports/ui/components/IncrementButton.vue | 4 +++- .../components/inventory/ItemListTile.vue | 18 +++++++++++++----- .../ui/properties/viewers/AttributeViewer.vue | 16 +++++++++++----- .../ui/properties/viewers/ItemViewer.vue | 18 ++++++++++++++---- 4 files changed, 41 insertions(+), 15 deletions(-) diff --git a/app/imports/ui/components/IncrementButton.vue b/app/imports/ui/components/IncrementButton.vue index 3d7ad623..865ec7bb 100644 --- a/app/imports/ui/components/IncrementButton.vue +++ b/app/imports/ui/components/IncrementButton.vue @@ -10,11 +10,12 @@ @@ -42,6 +43,7 @@ export default { type: Number, required: true, }, + loading: Boolean, }, data(){return { open: false diff --git a/app/imports/ui/properties/components/inventory/ItemListTile.vue b/app/imports/ui/properties/components/inventory/ItemListTile.vue index 8a7a599d..d6e64249 100644 --- a/app/imports/ui/properties/components/inventory/ItemListTile.vue +++ b/app/imports/ui/properties/components/inventory/ItemListTile.vue @@ -28,12 +28,9 @@ color="primary" :disabled="context.editPermission === false" :value="model.quantity" + :loading="incrementLoading" @change="changeQuantity" - > - - $vuetify.icons.abacus - - + /> { + this.incrementLoading = false; + if (error){ + snackbar({text: error.reason}); + console.error(error); + } }); } }, diff --git a/app/imports/ui/properties/viewers/AttributeViewer.vue b/app/imports/ui/properties/viewers/AttributeViewer.vue index b1225c8c..8e9cc4a4 100644 --- a/app/imports/ui/properties/viewers/AttributeViewer.vue +++ b/app/imports/ui/properties/viewers/AttributeViewer.vue @@ -31,12 +31,9 @@ tile color="primary" :value="model.value" + :loading="damagePropertyLoading" @change="damageProperty" - > - - $vuetify.icons.abacus - - + /> { + this.damagePropertyLoading = false; + if (error){ + snackbar({text: error.reason}); + console.error(error); + } }); }, }, diff --git a/app/imports/ui/properties/viewers/ItemViewer.vue b/app/imports/ui/properties/viewers/ItemViewer.vue index d03e2afb..d5f07aab 100644 --- a/app/imports/ui/properties/viewers/ItemViewer.vue +++ b/app/imports/ui/properties/viewers/ItemViewer.vue @@ -15,11 +15,10 @@ large outlined color="primary" + :loading="incrementLoading" :value="model.quantity" @change="changeQuantity" - > - $vuetify.icons.abacus - + /> { + this.incrementLoading = false; + if (error){ + snackbar({text: error.reason}); + console.error(error); + } }); - } + }, } }