From 1a994e387f57e5abc2e53a1e4ce428d41d4e2223 Mon Sep 17 00:00:00 2001 From: Alex Grozav Date: Tue, 22 Nov 2022 12:59:27 +0200 Subject: [PATCH] feat: Show toast when saving workflow sharing settings --- .../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 d5e6e8ab57004..7eeffc18d04c5 100644 --- a/packages/editor-ui/src/components/WorkflowShareModal.ee.vue +++ b/packages/editor-ui/src/components/WorkflowShareModal.ee.vue @@ -204,9 +204,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 b3781d9298cf2..ceea44dea4c59 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.save": "Save", "workflows.shareModal.changesHint": "You made changes", "workflows.shareModal.notAvailable": "Sharing workflows with others is currently available only on n8n cloud, our hosted offering.",