From 6f8d0de55dc9c3c1cdb17329a8560ee8453c639a Mon Sep 17 00:00:00 2001 From: Alex Grozav Date: Tue, 22 Nov 2022 13:26:03 +0200 Subject: [PATCH] feat: Show toast when saving workflow sharing settings (#4684) --- .../src/components/WorkflowShareModal.ee.vue | 17 ++++++++++++++--- .../editor-ui/src/plugins/i18n/locales/en.json | 2 ++ 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/packages/editor-ui/src/components/WorkflowShareModal.ee.vue b/packages/editor-ui/src/components/WorkflowShareModal.ee.vue index 6300f8625c..bd403d397d 100644 --- a/packages/editor-ui/src/components/WorkflowShareModal.ee.vue +++ b/packages/editor-ui/src/components/WorkflowShareModal.ee.vue @@ -205,9 +205,20 @@ export default mixins( }); }; - const workflowId = await saveWorkflowPromise(); - await this.workflowsEEStore.saveWorkflowSharedWith({ workflowId, sharedWith: this.sharedWith }); - this.loading = false; + try { + const workflowId = await saveWorkflowPromise(); + await this.workflowsEEStore.saveWorkflowSharedWith({ workflowId, sharedWith: this.sharedWith }); + + this.$showMessage({ + title: this.$locale.baseText('workflows.shareModal.onSave.success.title'), + type: 'success', + }); + } catch (error) { + this.$showError(error, this.$locale.baseText('workflows.shareModal.onSave.error.title')); + } finally { + this.modalBus.$emit('close'); + this.loading = false; + } }, async onAddSharee(userId: string) { const { id, firstName, lastName, email } = this.usersStore.getUserById(userId)!; diff --git a/packages/editor-ui/src/plugins/i18n/locales/en.json b/packages/editor-ui/src/plugins/i18n/locales/en.json index a8074024a9..e97aa8f8e8 100644 --- a/packages/editor-ui/src/plugins/i18n/locales/en.json +++ b/packages/editor-ui/src/plugins/i18n/locales/en.json @@ -1378,6 +1378,8 @@ "workflows.shareModal.list.delete.confirm.message": "This might cause the workflow to stop working: if {name} is the only user with access to credentials used in this workflow, those credentials will also be removed from {workflow}.", "workflows.shareModal.list.delete.confirm.confirmButtonText": "Remove access", "workflows.shareModal.list.delete.confirm.cancelButtonText": "Cancel", + "workflows.shareModal.onSave.success.title": "Workflow sharing settings have been saved", + "workflows.shareModal.onSave.error.title": "There was a problem saving sharing settings", "workflows.shareModal.saveBeforeClose.title": "Save sharing changes?", "workflows.shareModal.saveBeforeClose.message": "You have unsaved changes. Do you want to save them before closing?", "workflows.shareModal.saveBeforeClose.confirmButtonText": "Save",