disallow bindings selection for other actions

This commit is contained in:
Peter Clement 2022-02-15 15:05:36 +00:00
parent ca53ee4069
commit 5b46ef6120
2 changed files with 20 additions and 16 deletions

View File

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

View File

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