From b54dbb00f8315ebb23e4dd31519ca9601faf1607 Mon Sep 17 00:00:00 2001 From: Katrin Yordanova Date: Wed, 20 Sep 2023 15:44:08 +0300 Subject: [PATCH] Refactor props and data property naming in CButtonSubmit and eveywhere it's used to match current naming conventions --- .../src/components/Admin/EditorToolbar.vue | 24 ++++----- .../components/Namespaces/Reminders/Edit.vue | 4 +- .../components/Namespaces/Reminders/index.vue | 8 +-- client/web/compose/src/mixins/pages.js | 6 +-- .../compose/src/views/Admin/Charts/Edit.vue | 40 +++++++------- .../compose/src/views/Admin/Modules/Edit.vue | 46 ++++++++-------- .../compose/src/views/Admin/Pages/Builder.vue | 47 ++++++++-------- .../compose/src/views/Admin/Pages/Edit.vue | 43 +++++++-------- .../web/compose/src/views/Namespace/Edit.vue | 54 +++++++++---------- .../src/components/button/CButtonSubmit.vue | 8 +-- 10 files changed, 141 insertions(+), 139 deletions(-) diff --git a/client/web/compose/src/components/Admin/EditorToolbar.vue b/client/web/compose/src/components/Admin/EditorToolbar.vue index 7ffe505fb1..f0754aae4c 100644 --- a/client/web/compose/src/components/Admin/EditorToolbar.vue +++ b/client/web/compose/src/components/Admin/EditorToolbar.vue @@ -14,7 +14,7 @@ @@ -37,7 +37,7 @@ @@ -167,7 +167,7 @@ export default { default: false, }, - buttonSaveProcessing: { + processingSave: { type: Boolean, default: false, }, diff --git a/client/web/compose/src/components/Namespaces/Reminders/index.vue b/client/web/compose/src/components/Namespaces/Reminders/index.vue index 62d96d34ba..a8dfd237fd 100644 --- a/client/web/compose/src/components/Namespaces/Reminders/index.vue +++ b/client/web/compose/src/components/Namespaces/Reminders/index.vue @@ -14,7 +14,7 @@ :edit="edit" :users="users" :disable-save="disableSave" - :button-save-processing="buttonSaveProcessing" + :processing-save="processingSave" class="flex-fill" @dismiss="onDismiss" @back="onCancel()" @@ -40,7 +40,7 @@ export default { reminders: [], edit: null, disableSave: false, - buttonSaveProcessing: false, + processingSave: false, } }, @@ -81,7 +81,7 @@ export default { onSave (r) { this.disableSave = true - this.buttonSaveProcessing = true + this.processingSave = true const endpoint = r.reminderID && r.reminderID !== NoID ? 'reminderUpdate' : 'reminderCreate' this.$SystemAPI[endpoint](r).then(() => { @@ -91,7 +91,7 @@ export default { this.$Reminder.prefetch() }).finally(() => { this.disableSave = false - this.buttonSaveProcessing = false + this.processingSave = false }) }, diff --git a/client/web/compose/src/mixins/pages.js b/client/web/compose/src/mixins/pages.js index bbea14887e..71d91b45e7 100644 --- a/client/web/compose/src/mixins/pages.js +++ b/client/web/compose/src/mixins/pages.js @@ -4,7 +4,7 @@ import { fetchID } from 'corteza-webapp-compose/src/lib/block' export default { data () { return { - buttonCloneProcessing: false, + processingClone: false, } }, @@ -24,7 +24,7 @@ export default { }, handleClone () { - this.buttonCloneProcessing = true + this.processingClone = true const { namespaceID = NoID } = this.namespace const pattern = /\([0-9]+\)/ @@ -85,7 +85,7 @@ export default { this.$router.push({ name: this.$route.name, params: { pageID } }) }) .catch(this.toastErrorHandler(this.$t('notification:page.cloneFailed'))) - .finally(() => { this.buttonCloneProcessing = false }) + .finally(() => { this.processingClone = false }) }, cloneLayouts (pageID) { diff --git a/client/web/compose/src/views/Admin/Charts/Edit.vue b/client/web/compose/src/views/Admin/Charts/Edit.vue index aa44520033..3a8ef11cd8 100644 --- a/client/web/compose/src/views/Admin/Charts/Edit.vue +++ b/client/web/compose/src/views/Admin/Charts/Edit.vue @@ -271,7 +271,7 @@ > { - this.buttonProcessing = false + this.processing = false if (closeOnSuccess) { - this.buttonSaveAndCloseProcessing = false + this.processingSaveAndClose = false return } - this.buttonSaveProcessing = false + this.processingSave = false }) } else { this.updateChart(c).then((chart) => { @@ -665,26 +665,26 @@ export default { }) .catch(this.toastErrorHandler(this.$t('notification:chart.saveFailed'))) .finally(() => { - this.buttonProcessing = false + this.processing = false if (closeOnSuccess) { - this.buttonSaveAndCloseProcessing = false + this.processingSaveAndClose = false return } - this.buttonSaveProcessing = false + this.processingSave = false }) } }, handleDelete () { - this.buttonProcessing = true + this.processing = true this.deleteChart(this.chart).then(() => { this.toastSuccess(this.$t('notification:chart.deleted')) this.$router.push({ name: 'admin.charts' }) }) .catch(this.toastErrorHandler(this.$t('notification:chart.deleteFailed'))) - .finally(() => { this.buttonProcessing = false }) + .finally(() => { this.processing = false }) }, redirect () { diff --git a/client/web/compose/src/views/Admin/Modules/Edit.vue b/client/web/compose/src/views/Admin/Modules/Edit.vue index c20be35abc..18d4f91458 100644 --- a/client/web/compose/src/views/Admin/Modules/Edit.vue +++ b/client/web/compose/src/views/Admin/Modules/Edit.vue @@ -438,9 +438,9 @@ { - this.buttonProcessing = false + this.processing = false if (closeOnSuccess) { - this.buttonSaveAndCloseProcessing = false + this.processingSaveAndClose = false return } - this.buttonSaveProcessing = false + this.processingSave = false }) } else { this.updateModule({ ...this.module, resourceTranslationLanguage }).then(module => { @@ -835,19 +835,19 @@ export default { } }).catch(this.toastErrorHandler(this.$t('notification:module.saveFailed'))) .finally(() => { - this.buttonProcessing = false + this.processing = false if (closeOnSuccess) { - this.buttonSaveAndCloseProcessing = false + this.processingSaveAndClose = false return } - this.buttonSaveProcessing = false + this.processingSave = false }) } }, handleDelete () { - this.buttonProcessing = true + this.processing = true this.deleteModule(this.module).then(() => { const moduleRecordPage = this.pages.find(p => p.moduleID === this.module.moduleID) @@ -857,7 +857,7 @@ export default { }).catch(this.toastErrorHandler(this.$t('notification:module.deleteFailed'))) .finally(() => { this.toastSuccess(this.$t('notification:module.deleted')) - this.buttonProcessing = false + this.processing = false this.$router.push({ name: 'admin.modules' }) }) }, @@ -871,13 +871,13 @@ export default { }) .catch(this.toastErrorHandler(this.$t('notification:connection.read-failed'))) .finally(() => { - this.buttonProcessing = false + this.processing = false }) } }, async fetchSensitivityLevels () { - this.buttonProcessing = true + this.processing = true return this.$SystemAPI.dalSensitivityLevelList() .then(({ set = [] }) => { @@ -885,7 +885,7 @@ export default { }) .catch(this.toastErrorHandler(this.$t('notification:sensitivity-level.fetch-failed'))) .finally(() => { - this.buttonProcessing = false + this.processing = false }) }, @@ -897,9 +897,9 @@ export default { this.module = undefined this.initialModuleState = undefined this.hasRecords = true - this.buttonProcessing = false - this.buttonSaveAndCloseProcessing = false - this.buttonSaveProcessing = false + this.processing = false + this.processingSaveAndClose = false + this.processingSave = false this.federationSettings = {} this.discoverySettings = {} this.abortableRequests = [] diff --git a/client/web/compose/src/views/Admin/Pages/Builder.vue b/client/web/compose/src/views/Admin/Pages/Builder.vue index 0aa7759839..674a37d4d3 100644 --- a/client/web/compose/src/views/Admin/Pages/Builder.vue +++ b/client/web/compose/src/views/Admin/Pages/Builder.vue @@ -255,10 +255,10 @@ { - this.buttonProcessing = false + this.processing = false if (closeOnSuccess) { - this.buttonSaveAndCloseProcessing = false + this.processingSaveAndClose = false return } - this.buttonSaveProcessing = false + this.processingSave = false }).catch(this.toastErrorHandler(this.$t('notification:page.page-layout.save.failed'))) }, handleCloneLayout () { - this.buttonProcessing = true - this.buttonCloneProcessing = true + this.processing = true + this.processingClone = true const layout = { ...this.layout.clone(), @@ -842,13 +842,13 @@ export default { this.toastSuccess(this.$t('notification:page.page-layout.clone.success')) }) }).finally(() => { - this.buttonProcessing = false - this.buttonCloneProcessing = false + this.processing = false + this.processingClone = false }).catch(this.toastErrorHandler(this.$t('notification:page.page-layout.clone.failed'))) }, handleDeleteLayout () { - this.buttonProcessing = true + this.processing = true this.deletePageLayout({ ...this.layout }).then(() => { return this.fetchPageLayouts() @@ -856,7 +856,7 @@ export default { this.setLayout() this.toastSuccess(this.$t('notification:page.page-layout.delete.success')) }).finally(() => { - this.buttonProcessing = false + this.processing = false }).catch(this.toastErrorHandler(this.$t('notification:page.page-layout.delete.failed'))) }, @@ -990,9 +990,10 @@ export default { setDefaultValues () { this.title = '' - this.buttonProcessing = false - this.buttonSaveAndCloseProcessing = false - this.buttonSaveProcessing = false + this.processing = false + this.processingSaveAndClose = false + this.processingSave = false + this.processingClone = false this.processingLayout = false this.page = undefined this.layout = undefined diff --git a/client/web/compose/src/views/Admin/Pages/Edit.vue b/client/web/compose/src/views/Admin/Pages/Edit.vue index 05ee0f660b..6face62be0 100644 --- a/client/web/compose/src/views/Admin/Pages/Edit.vue +++ b/client/web/compose/src/views/Admin/Pages/Edit.vue @@ -46,7 +46,7 @@
@@ -749,7 +749,7 @@ label-class="text-primary" >
@@ -795,10 +795,10 @@ :hide-clone="hideClone" :hide-save="hideSave" :disable-save="disableSave" - :button-processing="buttonProcessing" - :button-save-processing="buttonSaveProcessing" - :button-save-and-close-processing="buttonSaveAndCloseProcessing" - :button-clone-processing="buttonCloneProcessing" + :processing="processing" + :processing-save="processingSave" + :processing-save-and-close="processingSaveAndClose" + :processing-clone="processingClone" @clone="handleClone()" @delete="handleDeletePage()" @save="handleSave()" @@ -879,10 +879,10 @@ export default { data () { return { - buttonProcessing: false, - buttonSaveProcessing: false, - buttonSaveAndCloseProcessing: false, - buttonCloneProcessing: false, + processing: false, + processingSave: false, + processingSaveAndClose: false, + processingClone: false, page: new compose.Page(), initialPageState: new compose.Page(), @@ -1046,7 +1046,7 @@ export default { this.removedLayouts = new Set() if (pageID) { - this.buttonProcessing = true + this.processing = true const { namespaceID } = this.namespace this.findPageByID({ namespaceID, pageID, force: true }).then((page) => { @@ -1055,7 +1055,7 @@ export default { return this.fetchAttachments() }).then(this.fetchLayouts) .finally(() => { - this.buttonProcessing = false + this.processing = false }).catch(this.toastErrorHandler(this.$t('notification:page.loadFailed'))) } }, @@ -1163,12 +1163,12 @@ export default { }, handleSave ({ closeOnSuccess = false } = {}) { - this.buttonProcessing = true + this.processing = true if (closeOnSuccess) { - this.buttonSaveAndCloseProcessing = true + this.processingSaveAndClose = true } else { - this.buttonSaveProcessing = true + this.processingSave = true } /** @@ -1195,13 +1195,13 @@ export default { this.$router.push(this.previousPage || { name: 'admin.pages' }) } }).finally(() => { - this.buttonProcessing = false + this.processing = false if (closeOnSuccess) { - this.buttonSaveAndCloseProcessing = false + this.processingSaveAndClose = false return } - this.buttonSaveProcessing = false + this.processingSave = false }).catch(this.toastErrorHandler(this.$t('notification:page.saveFailed'))) }, @@ -1295,9 +1295,10 @@ export default { }, setDefaultValues () { - this.buttonProcessing = false - this.buttonSaveAndCloseProcessing = false - this.buttonSaveProcessing = false + this.processing = false + this.processingSaveAndClose = false + this.processingSave = false + this.processingClone = false this.page = {} this.initialPageState = {} this.showIconModal = false diff --git a/client/web/compose/src/views/Namespace/Edit.vue b/client/web/compose/src/views/Namespace/Edit.vue index 69420e929d..eb8293c331 100644 --- a/client/web/compose/src/views/Namespace/Edit.vue +++ b/client/web/compose/src/views/Namespace/Edit.vue @@ -274,9 +274,9 @@
{ - this.buttonProcessing = false + this.processing = false }) }, @@ -775,9 +775,9 @@ export default { }, setDefaultValues () { - this.buttonProcessing = false - this.buttonSaveAndCloseProcessing = false - this.buttonSaveProcessing = false + this.processing = false + this.processingSaveAndClose = false + this.processingSave = false this.namespace = undefined this.initialNamespaceState = undefined this.namespaceAssets = {} diff --git a/lib/vue/src/components/button/CButtonSubmit.vue b/lib/vue/src/components/button/CButtonSubmit.vue index 05902319b2..76365e1e71 100644 --- a/lib/vue/src/components/button/CButtonSubmit.vue +++ b/lib/vue/src/components/button/CButtonSubmit.vue @@ -4,7 +4,7 @@ type="submit" :variant="variant" :disabled="disabled || processing || success" - :size="buttonSize" + :size="size" :title="title" :class="buttonClass" @click.prevent="$emit('submit')" @@ -23,7 +23,7 @@ - {{ buttonText }} + {{ text }} @@ -62,12 +62,12 @@ export default { default: '', }, - buttonText: { + text: { type: String, default: '', }, - buttonSize: { + size: { type: String, default: 'md', },