From 2964458191a02046a1806bd413e67ebf1308c2f8 Mon Sep 17 00:00:00 2001 From: Alex Grozav Date: Wed, 14 Dec 2022 15:50:31 +0200 Subject: [PATCH] feat: Update workflow overwriting message (#4917) * feat: Update workflow overwriting message * fix: remove unused import --- .../editor-ui/src/mixins/workflowHelpers.ts | 17 +++++++++++------ .../editor-ui/src/plugins/i18n/locales/en.json | 6 +++--- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/packages/editor-ui/src/mixins/workflowHelpers.ts b/packages/editor-ui/src/mixins/workflowHelpers.ts index 6a8f883d0a..c77af046af 100644 --- a/packages/editor-ui/src/mixins/workflowHelpers.ts +++ b/packages/editor-ui/src/mixins/workflowHelpers.ts @@ -46,7 +46,7 @@ import { ITag, IUpdateInformation, TargetItem, -} from '../../Interface'; +} from '../Interface'; import { externalHooks } from '@/mixins/externalHooks'; import { restApi } from '@/mixins/restApi'; @@ -66,9 +66,9 @@ import { IWorkflowSettings } from 'n8n-workflow'; import { useNDVStore } from '@/stores/ndv'; import { useTemplatesStore } from '@/stores/templates'; import { useNodeTypesStore } from '@/stores/nodeTypes'; -import useWorkflowsEEStore from '@/stores/workflows.ee'; -import { useUsersStore } from '@/stores/users'; -import { ICredentialMap, ICredentialsResponse, IUsedCredential } from '@/Interface'; +import { useWorkflowsEEStore } from "@/stores/workflows.ee"; +import { useUsersStore } from "@/stores/users"; +import { ICredentialsResponse } from '@/Interface'; let cachedWorkflowKey: string | null = ''; let cachedWorkflow: Workflow | null = null; @@ -481,7 +481,6 @@ export const workflowHelpers = mixins(externalHooks, nodeHelpers, restApi, showM if (nodeType !== null) { // Node-Type is known so we can save the parameters correctly - const nodeParameters = NodeHelpers.getNodeParameters( nodeType.properties, node.parameters, @@ -828,8 +827,14 @@ export const workflowHelpers = mixins(externalHooks, nodeHelpers, restApi, showM this.uiStore.removeActiveAction('workflowSaving'); if (error.errorCode === 100) { + const url = this.$router.resolve({ name: VIEWS.WORKFLOW, params: { name: currentWorkflow }}).href; + const overwrite = await this.confirmMessage( - this.$locale.baseText('workflows.concurrentChanges.confirmMessage.message'), + this.$locale.baseText('workflows.concurrentChanges.confirmMessage.message', { + interpolate: { + url, + }, + }), this.$locale.baseText('workflows.concurrentChanges.confirmMessage.title'), null, this.$locale.baseText('workflows.concurrentChanges.confirmMessage.confirmButtonText'), diff --git a/packages/editor-ui/src/plugins/i18n/locales/en.json b/packages/editor-ui/src/plugins/i18n/locales/en.json index 241f2f84b3..73a95b235c 100644 --- a/packages/editor-ui/src/plugins/i18n/locales/en.json +++ b/packages/editor-ui/src/plugins/i18n/locales/en.json @@ -1422,10 +1422,10 @@ "workflows.shareModal.info.sharee": "Only {workflowOwnerName} can change who this workflow is shared with", "workflows.shareModal.info.sharee.fallback": "the owner", "workflows.roles.editor": "Editor", - "workflows.concurrentChanges.confirmMessage.title": "Workflow was edited by someone else", - "workflows.concurrentChanges.confirmMessage.message": "Another user made an edit to this workflow since you last saved it. Do you want to overwrite their changes?", + "workflows.concurrentChanges.confirmMessage.title": "Workflow was changed by someone else", + "workflows.concurrentChanges.confirmMessage.message": "Someone saved this workflow while you were editing it. You can view their version (in new tab).

Overwrite their changes with yours?", "workflows.concurrentChanges.confirmMessage.cancelButtonText": "Cancel", - "workflows.concurrentChanges.confirmMessage.confirmButtonText": "Overwrite then save", + "workflows.concurrentChanges.confirmMessage.confirmButtonText": "Overwrite and Save", "importCurlModal.title": "Import cURL command", "importCurlModal.input.label": "cURL Command", "importCurlModal.input.placeholder": "Paste the cURL command here",