Skip to content

Commit

Permalink
Refactor props and data property naming in CButtonSubmit and eveywher…
Browse files Browse the repository at this point in the history
…e it's used to match current naming conventions
  • Loading branch information
katrinDY committed Sep 20, 2023
1 parent d3b0690 commit b54dbb0
Show file tree
Hide file tree
Showing 10 changed files with 141 additions and 139 deletions.
24 changes: 12 additions & 12 deletions client/web/compose/src/components/Admin/EditorToolbar.vue
Expand Up @@ -14,7 +14,7 @@
<b-button
data-test-id="button-back-without-save"
variant="link"
:disabled="buttonProcessing"
:disabled="processing"
class="text-dark back mr-auto"
@click="$emit('back')"
>
Expand All @@ -37,7 +37,7 @@
<c-input-confirm
v-if="!hideDelete"
v-b-tooltip.hover
:disabled="disableDelete || buttonProcessing"
:disabled="disableDelete || processing"
size="lg"
size-confirm="lg"
variant="danger"
Expand All @@ -50,9 +50,9 @@
<c-button-submit
v-if="!hideClone"
data-test-id="button-clone"
:disabled="disableClone || buttonCloneProcessing"
:disabled="disableClone || processingClone"
:title="cloneTooltip"
:processing="buttonCloneProcessing"
:processing="processingClone"
:variant="'light'"
:button-text="$t('label.saveAsCopy')"
:button-size="'lg'"
Expand All @@ -62,8 +62,8 @@
<c-button-submit
v-if="!hideSave"
data-test-id="button-save-and-close"
:disabled="disableSave || buttonSaveAndCloseProcessing"
:processing="buttonSaveAndCloseProcessing"
:disabled="disableSave || processingSaveAndClose"
:processing="processingSaveAndClose"
:variant="'light'"
:button-text="$t('label.saveAndClose')"
:button-size="'lg'"
Expand All @@ -73,8 +73,8 @@
<c-button-submit
v-if="!hideSave"
data-test-id="button-save"
:disabled="disableSave || buttonSaveProcessing"
:processing="buttonSaveProcessing"
:disabled="disableSave || processingSave"
:processing="processingSave"
:button-text="$t('label.save')"
:button-size="'lg'"
class="ml-2"
Expand All @@ -101,22 +101,22 @@ export default {
inheritAttrs: true,
props: {
buttonProcessing: {
processing: {
type: Boolean,
default: false,
},
buttonSaveProcessing: {
processingSave: {
type: Boolean,
default: false,
},
buttonSaveAndCloseProcessing: {
processingSaveAndClose: {
type: Boolean,
default: false,
},
buttonCloneProcessing: {
processingClone: {
type: Boolean,
default: false,
},
Expand Down
Expand Up @@ -123,7 +123,7 @@
<c-button-submit
data-test-id="button-save"
:disabled="disableSave"
:processing="buttonSaveProcessing"
:processing="processingSave"
:button-text="$t('label.save')"
@submit="$emit('save', reminder)"
/>
Expand Down Expand Up @@ -167,7 +167,7 @@ export default {
default: false,
},
buttonSaveProcessing: {
processingSave: {
type: Boolean,
default: false,
},
Expand Down
Expand Up @@ -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()"
Expand All @@ -40,7 +40,7 @@ export default {
reminders: [],
edit: null,
disableSave: false,
buttonSaveProcessing: false,
processingSave: false,
}
},
Expand Down Expand Up @@ -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(() => {
Expand All @@ -91,7 +91,7 @@ export default {
this.$Reminder.prefetch()
}).finally(() => {
this.disableSave = false
this.buttonSaveProcessing = false
this.processingSave = false
})
},
Expand Down
6 changes: 3 additions & 3 deletions client/web/compose/src/mixins/pages.js
Expand Up @@ -4,7 +4,7 @@ import { fetchID } from 'corteza-webapp-compose/src/lib/block'
export default {
data () {
return {
buttonCloneProcessing: false,
processingClone: false,
}
},

Expand All @@ -24,7 +24,7 @@ export default {
},

handleClone () {
this.buttonCloneProcessing = true
this.processingClone = true
const { namespaceID = NoID } = this.namespace
const pattern = /\([0-9]+\)/

Expand Down Expand Up @@ -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) {
Expand Down
40 changes: 20 additions & 20 deletions client/web/compose/src/views/Admin/Charts/Edit.vue
Expand Up @@ -271,7 +271,7 @@
>
<b-button
:title="$t('edit.loadData')"
:disabled="buttonProcessing || !reportsValid"
:disabled="processing || !reportsValid"
variant="outline-light"
size="lg"
class="d-flex align-items-center text-primary ml-auto border-0 px-2 mt-2 mr-2"
Expand All @@ -297,9 +297,9 @@

<portal to="admin-toolbar">
<editor-toolbar
:button-processing="buttonProcessing"
:button-save-processing="buttonSaveProcessing"
:button-save-and-close-processing="buttonSaveAndCloseProcessing"
:processing="processing"
:processing-save="processingSave"
:processing-save-and-close="processingSaveAndClose"
:hide-delete="hideDelete"
:hide-save="hideSave"
hide-clone
Expand Down Expand Up @@ -374,9 +374,9 @@ export default {
return {
chart: undefined,
initialChartState: undefined,
buttonProcessing: false,
buttonSaveProcessing: false,
buttonSaveAndCloseProcessing: false,
processing: false,
processingSave: false,
processingSaveAndClose: false,
editReportIndex: undefined,
checkboxLabel: {
Expand Down Expand Up @@ -605,7 +605,7 @@ export default {
},
update () {
this.buttonProcessing = true
this.processing = true
this.$refs.chart.updateChart()
},
Expand All @@ -614,16 +614,16 @@ export default {
}, 300),
onUpdated () {
this.buttonProcessing = false
this.processing = false
},
handleSave ({ closeOnSuccess = false } = {}) {
this.buttonProcessing = true
this.processing = true
if (closeOnSuccess) {
this.buttonSaveAndCloseProcessing = true
this.processingSaveAndClose = true
} else {
this.buttonSaveProcessing = true
this.processingSave = true
}
/**
Expand All @@ -646,13 +646,13 @@ 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
})
} else {
this.updateChart(c).then((chart) => {
Expand All @@ -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 () {
Expand Down

0 comments on commit b54dbb0

Please sign in to comment.