diff --git a/client/web/admin/src/components/Apigw/CFiltersStepper.vue b/client/web/admin/src/components/Apigw/CFiltersStepper.vue index 4e84419c14..a8a642f59c 100644 --- a/client/web/admin/src/components/Apigw/CFiltersStepper.vue +++ b/client/web/admin/src/components/Apigw/CFiltersStepper.vue @@ -53,10 +53,11 @@ :filters="getSelectedFiltersByStep" @addFilter="onAddFilter" /> - @@ -65,7 +66,6 @@ diff --git a/client/web/reporter/src/components/index.js b/client/web/reporter/src/components/index.js index 38ee1b8fa5..a356083eb7 100644 --- a/client/web/reporter/src/components/index.js +++ b/client/web/reporter/src/components/index.js @@ -50,3 +50,4 @@ Vue.component('font-awesome-icon', FontAwesomeIcon) Vue.component('font-awesome-layers', FontAwesomeLayers) Vue.component('c-permissions-button', components.CPermissionsButton) Vue.component('c-input-confirm', components.CInputConfirm) +Vue.component('c-button-submit', components.CButtonSubmit) diff --git a/client/web/reporter/src/mixins/report.js b/client/web/reporter/src/mixins/report.js index ed1349e326..18eb281807 100644 --- a/client/web/reporter/src/mixins/report.js +++ b/client/web/reporter/src/mixins/report.js @@ -4,6 +4,7 @@ export default { data () { return { processing: false, + processingSave: false, report: undefined, } }, @@ -25,6 +26,7 @@ export default { async handleSave () { this.processing = true + this.processingSave = true const { blocks } = this.report @@ -53,6 +55,7 @@ export default { .catch(this.toastErrorHandler(this.$t('notification:report.createFailed'))) .finally(() => { this.processing = false + this.processingSave = false }) } else { return this.$SystemAPI.reportUpdate(report) @@ -65,6 +68,7 @@ export default { .catch(this.toastErrorHandler(this.$t('notification:report.updateFailed'))) .finally(() => { this.processing = false + this.processingSave = false }) } }, diff --git a/client/web/reporter/src/views/Layout.vue b/client/web/reporter/src/views/Layout.vue index 09cddec616..2f6077ba87 100644 --- a/client/web/reporter/src/views/Layout.vue +++ b/client/web/reporter/src/views/Layout.vue @@ -131,7 +131,7 @@ export default { disabledRoutes: [ 'report.list', 'report.create', - 'report.edit' + 'report.edit', ], } }, diff --git a/client/web/reporter/src/views/Report/Builder.vue b/client/web/reporter/src/views/Report/Builder.vue index 4cf5d8658e..be745a7ad0 100644 --- a/client/web/reporter/src/views/Report/Builder.vue +++ b/client/web/reporter/src/views/Report/Builder.vue @@ -247,16 +247,13 @@ + + @@ -421,6 +429,8 @@ export default { data () { return { processing: false, + processingSave: false, + showReport: true, report: undefined, @@ -807,9 +817,8 @@ export default { this.datasources.showConfigurator = true }, - saveDatasources (hideEvent) { + saveDatasources () { // Prevent closing of modal and manually close it when request is complete - hideEvent.preventDefault() this.datasources.processing = true const sources = this.datasources.tempItems @@ -822,7 +831,7 @@ export default { report.scenarios = this.report.scenarios this.report = new system.Report(report) this.refreshReport() - this.datasources.showConfigurator = false + this.hideDatasourceConfigurator() this.toastSuccess(this.$t('notification:report.datasources.updated')) }).catch(this.toastErrorHandler(this.$t('notification:report.datasources.updateFailed'))) .finally(() => { @@ -832,6 +841,8 @@ export default { // Blocks handleReportSave () { + this.processingSave = true + this.report.blocks = this.reportBlocks.map(({ moved, x, y, w, h, i, ...p }) => { return { ...p, key: `${i}`, xywh: [x, y, w, h] } }) @@ -842,6 +853,9 @@ export default { this.refreshReport() this.unsavedBlocks.clear() }) + .finally(() => { + this.processingSave = false + }) }, mapBlocks () { diff --git a/client/web/reporter/src/views/Report/Edit.vue b/client/web/reporter/src/views/Report/Edit.vue index f7a3303c88..a3e8065a31 100644 --- a/client/web/reporter/src/views/Report/Edit.vue +++ b/client/web/reporter/src/views/Report/Edit.vue @@ -168,6 +168,7 @@ :delete-disabled="!canDelete" :save-disabled="!canSave" :processing="processing" + :processing-save="processingSave" @delete="handleDelete" @save="handleSave" /> diff --git a/client/web/workflow/src/components/WorkflowEditor.vue b/client/web/workflow/src/components/WorkflowEditor.vue index e97e670553..e3354392ac 100644 --- a/client/web/workflow/src/components/WorkflowEditor.vue +++ b/client/web/workflow/src/components/WorkflowEditor.vue @@ -196,26 +196,18 @@ class="d-flex flex-column flex-shrink position-absolute fixed-bottom m-2" style="z-index: 1; width: 20vw;" > - - - Saving - - - {{ $t('editor:detected-changes') + `${canUpdateWorkflow ? this.$t('editor:click-to-save') : ''}` }} - - + @submit="saveWorkflow()" + />
- - {{ $t('editor:save') }} - + :processing="processingSave" + :text="$t('editor:save')" + class="ml-auto" + @submit="saveWorkflow()" + />
diff --git a/client/web/workflow/src/components/index.js b/client/web/workflow/src/components/index.js index 91b1e9c692..a1f0ec19e4 100644 --- a/client/web/workflow/src/components/index.js +++ b/client/web/workflow/src/components/index.js @@ -9,3 +9,4 @@ Vue.component('font-awesome-icon', FontAwesomeIcon) Vue.component('font-awesome-layers', FontAwesomeLayers) Vue.component('c-permissions-button', components.CPermissionsButton) Vue.component('c-input-confirm', components.CInputConfirm) +Vue.component('c-button-submit', components.CButtonSubmit) diff --git a/lib/vue/src/components/index.ts b/lib/vue/src/components/index.ts index 55f757687d..6e5f3c2f82 100644 --- a/lib/vue/src/components/index.ts +++ b/lib/vue/src/components/index.ts @@ -19,6 +19,7 @@ export { CInputCheckbox, CInputColorPicker, CAceEditor, + CButtonSubmit, } from './input' export { diff --git a/lib/vue/src/components/input/button/CButtonSubmit.vue b/lib/vue/src/components/input/button/CButtonSubmit.vue new file mode 100644 index 0000000000..b278cda8f2 --- /dev/null +++ b/lib/vue/src/components/input/button/CButtonSubmit.vue @@ -0,0 +1,115 @@ + + + + + diff --git a/lib/vue/src/components/input/button/index.ts b/lib/vue/src/components/input/button/index.ts new file mode 100644 index 0000000000..d03f49a83a --- /dev/null +++ b/lib/vue/src/components/input/button/index.ts @@ -0,0 +1 @@ +export { default as CButtonSubmit } from './CButtonSubmit.vue' diff --git a/lib/vue/src/components/input/index.ts b/lib/vue/src/components/input/index.ts index 2de29dfbf3..b7b65055b8 100644 --- a/lib/vue/src/components/input/index.ts +++ b/lib/vue/src/components/input/index.ts @@ -8,3 +8,6 @@ export { default as CRichTextInput } from './CRichTextInput/index.vue' export { default as CInputCheckbox } from './CInputCheckbox.vue' export { default as CInputColorPicker } from './CInputColorPicker.vue' export { default as CAceEditor } from './CAceEditor.vue' +export { + CButtonSubmit +} from './button' \ No newline at end of file diff --git a/lib/vue/src/components/permissions/CPermissionsModal.vue b/lib/vue/src/components/permissions/CPermissionsModal.vue index 319f74ef27..fc80c48375 100644 --- a/lib/vue/src/components/permissions/CPermissionsModal.vue +++ b/lib/vue/src/components/permissions/CPermissionsModal.vue @@ -7,15 +7,10 @@ :title="translatedTitle" lazy scrollable - :ok-disabled="submitDisabled" - :ok-title="labels.save" - :cancel-title="labels.cancel" - cancel-variant="light" no-fade body-class="d-flex flex-column p-0" class="h-100 overflow-hidden" @hide="onHide" - @ok="onSubmit" > + + + @@ -399,6 +430,7 @@ export default { this.fetchRules(roleID) }).finally(() => { this.processing = false + this.onHide() }) }, diff --git a/locale/en/corteza-webapp-workflow/editor.yaml b/locale/en/corteza-webapp-workflow/editor.yaml index 47c4fa6384..1d9b8c20a9 100644 --- a/locale/en/corteza-webapp-workflow/editor.yaml +++ b/locale/en/corteza-webapp-workflow/editor.yaml @@ -24,6 +24,7 @@ reset: Reset 'required-namespace': Namespace required 'required-namespace-and-module': Namespace and Module required save: Save +saving: Saving spinning: Spinning 'test-in-progress': "Testing in progress. If your workflow includes Prompt or Delay steps, it may be waiting for them to complete" 'unsupported-browser': Browser is not supported!