From fc58070b427121f2600a6ff8254d6bf561fbbb3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C5=BEe=20Fortun?= Date: Mon, 13 Nov 2023 15:17:56 +0100 Subject: [PATCH] Fix potential alterations modal loop --- .../Admin/Module/DalSchemaAlterations.vue | 28 +++++++------------ .../compose/src/views/Admin/Modules/Edit.vue | 21 ++++++-------- locale/en/corteza-webapp-compose/module.yaml | 2 +- 3 files changed, 19 insertions(+), 32 deletions(-) diff --git a/client/web/compose/src/components/Admin/Module/DalSchemaAlterations.vue b/client/web/compose/src/components/Admin/Module/DalSchemaAlterations.vue index 172abc795..e18e9eb02 100644 --- a/client/web/compose/src/components/Admin/Module/DalSchemaAlterations.vue +++ b/client/web/compose/src/components/Admin/Module/DalSchemaAlterations.vue @@ -6,8 +6,7 @@ body-class="p-0 border-top-0 position-relative" header-class="p-3 pb-0 border-bottom-0" no-fade - @hide="$emit('hide')" - @change="$emit('change', $event)" + v-on="$listeners" > {{ canResolveAlterations ? $t('general:label.cancel') : $t('general:label.close') }} @@ -151,7 +149,7 @@ v-if="canResolveAlterations" variant="primary" :disabled="processing" - :borderless="false" + size="md" @confirmed="onResolve()" > {{ $t('resolveAuto') }} @@ -217,17 +215,11 @@ export default { }, watch: { - modal: { - immediate: true, - handler (show = false) { - this.showModal = show - }, - }, - batch: { - immediate: true, handler (batch) { - this.load(batch) + if (batch) { + this.load(batch) + } }, }, }, @@ -290,8 +282,8 @@ export default { return this.$SystemAPI.dalSchemaAlterationList({ batchID }).then(({ set }) => { this.alterations = set - if (!this.alterations.length) { - this.$emit('hide') + if (this.alterations.length) { + this.showModal = true } }).catch(this.toastErrorHandler(this.$t('notification:module.schemaAlterations.load.error'))) .finally(() => { diff --git a/client/web/compose/src/views/Admin/Modules/Edit.vue b/client/web/compose/src/views/Admin/Modules/Edit.vue index 3cadf6785..2628c78c1 100644 --- a/client/web/compose/src/views/Admin/Modules/Edit.vue +++ b/client/web/compose/src/views/Admin/Modules/Edit.vue @@ -417,11 +417,9 @@