Browse Source

disallow bindings selection for other actions

master
Peter Clement 5 years ago
parent
commit
439043c6da
  1. 8
      packages/builder/cypress/integration/createAutomation.spec.js
  2. 28
      packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowItem.svelte

8
packages/builder/cypress/integration/createAutomation.spec.js

@ -19,19 +19,19 @@ context("Create a automation", () => {
// Setup trigger
cy.contains("Setup").click()
cy.get(".spectrum-Picker-label").click()
cy.get(".spectrum-Picker-label").first().click()
cy.wait(500)
cy.contains("dog").click()
cy.wait(2000)
// Create action
cy.get(".block > .spectrum-Icon").click()
cy.get(".block > .spectrum-Icon").first().click()
cy.get(".modal-inner-wrapper").within(() => {
cy.wait(1000)
cy.contains("Create Row").trigger('mouseover').click().click()
cy.get(".spectrum-Button--cta").click()
})
cy.contains("Setup").click()
cy.get(".spectrum-Picker-label").click()
cy.get(".spectrum-Picker-label").first().click()
cy.contains("dog").click()
cy.get(".spectrum-Textfield-input")
.first()
@ -43,7 +43,7 @@ context("Create a automation", () => {
cy.get(".modal-inner-wrapper").within(() => {
cy.wait(1000)
cy.get(".spectrum-Picker-label").click()
cy.get(".spectrum-Picker-label").first().click()
cy.contains("dog").click()
cy.wait(1000)
cy.get(".spectrum-Textfield-input")

28
packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowItem.svelte

@ -29,7 +29,9 @@
let blockComplete
$: rowControl = $automationStore.selectedAutomation.automation.rowControl
$: showBindingPicker =
block.stepId === "CREATE_ROW" || block.stepId === "UPDATE_ROW"
$: console.log(showBindingPicker)
$: testResult = $automationStore.selectedAutomation.testResults?.steps.filter(
step => (block.id ? step.id === block.id : step.stepId === block.stepId)
)
@ -153,17 +155,19 @@
</ActionButton>
{#if !isTrigger}
<div class="block-options">
<div>
<Select
on:change={toggleFieldControl}
quiet
defaultValue="Use values"
autoWidth
value={rowControl ? "Use bindings" : "Use values"}
options={["Use values", "Use bindings"]}
placeholder={null}
/>
</div>
{#if showBindingPicker}
<div>
<Select
on:change={toggleFieldControl}
quiet
defaultValue="Use values"
autoWidth
value={rowControl ? "Use bindings" : "Use values"}
options={["Use values", "Use bindings"]}
placeholder={null}
/>
</div>
{/if}
<div class="delete-padding" on:click={() => deleteStep()}>
<Icon name="DeleteOutline" />
</div>

Loading…
Cancel
Save