From 0c8944568277dbb69f2fb94ee7f1d75bd8e52066 Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Thu, 25 Jul 2019 15:21:57 +0200 Subject: [PATCH] :bug: Fix bug that workflow names could have spaces in beginning and end --- packages/cli/src/Server.ts | 1 + packages/editor-ui/src/components/mixins/workflowHelpers.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/cli/src/Server.ts b/packages/cli/src/Server.ts index c9893e6ca8..b4b90e839c 100644 --- a/packages/cli/src/Server.ts +++ b/packages/cli/src/Server.ts @@ -181,6 +181,7 @@ class App { const newWorkflowData = req.body; + newWorkflowData.name = newWorkflowData.name.trim(); newWorkflowData.createdAt = this.getCurrentDate(); newWorkflowData.updatedAt = this.getCurrentDate(); diff --git a/packages/editor-ui/src/components/mixins/workflowHelpers.ts b/packages/editor-ui/src/components/mixins/workflowHelpers.ts index 7b8e5fb377..ffef68b209 100644 --- a/packages/editor-ui/src/components/mixins/workflowHelpers.ts +++ b/packages/editor-ui/src/components/mixins/workflowHelpers.ts @@ -399,7 +399,7 @@ export const workflowHelpers = mixins( if (currentWorkflow === undefined || withNewName === true) { // Workflow is new or is supposed to get saved under a new name // so create a new entry in database - workflowData.name = workflowName as string; + workflowData.name = workflowName.trim() as string; if (withNewName === true) { // If an existing workflow gets resaved with a new name