From 1aef879a62bdfcccffccdec2d2113987367bf859 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Fri, 18 Sep 2020 12:01:57 +0100 Subject: [PATCH 1/3] Improve workflow block tagline rendering and support pretty printing enum bindings --- .../WorkflowBuilder/flowchart/FlowItem.svelte | 25 ++----- .../flowchart/WorkflowBlockTagline.svelte | 67 ++++++++++++++++--- 2 files changed, 61 insertions(+), 31 deletions(-) diff --git a/packages/builder/src/components/workflow/WorkflowBuilder/flowchart/FlowItem.svelte b/packages/builder/src/components/workflow/WorkflowBuilder/flowchart/FlowItem.svelte index a67b15cd8a..38085cac89 100644 --- a/packages/builder/src/components/workflow/WorkflowBuilder/flowchart/FlowItem.svelte +++ b/packages/builder/src/components/workflow/WorkflowBuilder/flowchart/FlowItem.svelte @@ -1,5 +1,5 @@
+ on:click={() => onSelect(block)}>
{#if block.type === 'TRIGGER'} @@ -49,13 +32,13 @@

- +

From 68c84438daf980e9a816814caf0e8b8081456762 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Fri, 18 Sep 2020 16:13:42 +0100 Subject: [PATCH 2/3] Fix part of workflow cypress tests --- .../integration/createWorkflow.spec.js | 25 ++++++++++++------- .../SetupPanel/WorkflowBlockSetup.svelte | 2 +- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/packages/builder/cypress/integration/createWorkflow.spec.js b/packages/builder/cypress/integration/createWorkflow.spec.js index 833777f106..50fbcb4445 100644 --- a/packages/builder/cypress/integration/createWorkflow.spec.js +++ b/packages/builder/cypress/integration/createWorkflow.spec.js @@ -21,17 +21,25 @@ context("Create a workflow", () => { // Add trigger cy.get("[data-cy=add-workflow-component]").click() cy.get("[data-cy=RECORD_SAVED]").click() - cy.get(".budibase__input").select("dog") + cy.get("[data-cy=workflow-block-setup]").within(() => { + cy.get("select") + .first() + .select("dog") + }) // Create action cy.get("[data-cy=SAVE_RECORD]").click() - cy.get(".budibase__input").select("dog") - cy.get(".container input") - .first() - .type("goodboy") - cy.get(".container input") - .eq(1) - .type("11") + cy.get("[data-cy=workflow-block-setup]").within(() => { + cy.get("select") + .first() + .select("dog") + cy.get("input") + .first() + .type("goodboy") + cy.get("input") + .eq(1) + .type("11") + }) // Save cy.contains("Save Workflow").click() @@ -44,7 +52,6 @@ context("Create a workflow", () => { it("should add record when a new record is added", () => { cy.contains("backend").click() - cy.addRecord(["Rover", 15]) cy.reload() cy.contains("goodboy").should("have.text", "goodboy") diff --git a/packages/builder/src/components/workflow/SetupPanel/WorkflowBlockSetup.svelte b/packages/builder/src/components/workflow/SetupPanel/WorkflowBlockSetup.svelte index f6f12c04f6..7227d0fdde 100644 --- a/packages/builder/src/components/workflow/SetupPanel/WorkflowBlockSetup.svelte +++ b/packages/builder/src/components/workflow/SetupPanel/WorkflowBlockSetup.svelte @@ -44,7 +44,7 @@ } -
+
{block.name}
{#each inputs as [key, value]}
From aa057187667da4dbd4fcbdb102b2abc66fdcd411 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Fri, 18 Sep 2020 16:14:37 +0100 Subject: [PATCH 3/3] Prevent datetime and boolean fields showing in workflow block setup until these are handled properly --- .../SetupPanel/ParamInputs/RecordSelector.svelte | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/packages/builder/src/components/workflow/SetupPanel/ParamInputs/RecordSelector.svelte b/packages/builder/src/components/workflow/SetupPanel/ParamInputs/RecordSelector.svelte index ab65676674..da812e456c 100644 --- a/packages/builder/src/components/workflow/SetupPanel/ParamInputs/RecordSelector.svelte +++ b/packages/builder/src/components/workflow/SetupPanel/ParamInputs/RecordSelector.svelte @@ -12,17 +12,6 @@ // Ensure any nullish modelId values get set to empty string so // that the select works $: if (value?.modelId == null) value = { modelId: "" } - - function setParsedValue(evt, field) { - const fieldSchema = model?.schema[field] - if (fieldSchema) { - if (fieldSchema.type === "number") { - value[field] = parseInt(evt.target.value) - return - } - } - value[field] = evt.target.value - }
@@ -49,12 +38,12 @@ {/each} - {:else} + {:else if schema.type === "string"} setParsedValue(e, field)} label={field} + type={schema.type} {bindings} /> {/if}