diff --git a/packages/builder/cypress/integration/createAutomation.spec.js b/packages/builder/cypress/integration/createAutomation.spec.js
index c2a22c4f9..92d1f907b 100644
--- a/packages/builder/cypress/integration/createAutomation.spec.js
+++ b/packages/builder/cypress/integration/createAutomation.spec.js
@@ -14,35 +14,26 @@ context("Create a automation", () => {
cy.createTestTableWithData()
cy.contains("automate").click()
- cy.contains("Create New Automation").click()
+ cy.get("[data-cy=new-automation]").click()
cy.get(".modal").within(() => {
cy.get("input").type("Add Row")
- cy.get(".buttons")
- .contains("Create")
- .click()
+ cy.get(".buttons").contains("Create").click()
})
// Add trigger
- cy.get("[data-cy=add-automation-component]").click()
- cy.get("[data-cy=ROW_SAVED]").click()
- cy.get("[data-cy=automation-block-setup]").within(() => {
- cy.get("select")
- .first()
- .select("dog")
+ cy.contains("Trigger").click()
+ cy.contains("Row Saved").click()
+ cy.get(".setup").within(() => {
+ cy.get("select").first().select("dog")
})
// Create action
- cy.get("[data-cy=CREATE_ROW]").click()
- cy.get("[data-cy=automation-block-setup]").within(() => {
- cy.get("select")
- .first()
- .select("dog")
- cy.get("input")
- .first()
- .type("goodboy")
- cy.get("input")
- .eq(1)
- .type("11")
+ cy.contains("Action").click()
+ cy.contains("Create Row").click()
+ cy.get(".setup").within(() => {
+ cy.get("select").first().select("dog")
+ cy.get("input").first().type("goodboy")
+ cy.get("input").eq(1).type("11")
})
// Save
@@ -50,7 +41,7 @@ context("Create a automation", () => {
// Activate Automation
cy.get("[data-cy=activate-automation]").click()
- cy.get(".stop-button.highlighted").should("be.visible")
+ cy.get(".ri-stop-circle-fill.highlighted").should("be.visible")
})
it("should add row when a new row is added", () => {
diff --git a/packages/builder/cypress/integration/createComponents.spec.js b/packages/builder/cypress/integration/createComponents.spec.js
index bf978d3e3..6931fdb86 100644
--- a/packages/builder/cypress/integration/createComponents.spec.js
+++ b/packages/builder/cypress/integration/createComponents.spec.js
@@ -1,54 +1,60 @@
-xcontext('Create Components', () => {
+xcontext("Create Components", () => {
+ before(() => {
+ cy.server()
+ cy.visit("localhost:4001/_builder")
+ // https://on.cypress.io/type
+ cy.createApp("Table App", "Table App Description")
+ cy.createTable("dog", "name", "age")
+ cy.addRow("bob", "15")
+ })
- before(() => {
- cy.server()
- cy.visit('localhost:4001/_builder')
- // https://on.cypress.io/type
- cy.createApp('Table App', 'Table App Description')
- cy.createTable('dog', 'name', 'age')
- cy.addRow('bob', '15')
- })
+ // https://on.cypress.io/interacting-with-elements
+ it("should add a container", () => {
+ cy.navigateToFrontend()
+ cy.get(".switcher > :nth-child(2)").click()
+ cy.contains("Container").click()
+ })
+ it("should add a headline", () => {
+ cy.addHeadlineComponent("An Amazing headline!")
- // https://on.cypress.io/interacting-with-elements
- it('should add a container', () => {
- cy.contains('frontend').click()
- cy.get('.switcher > :nth-child(2)').click()
+ getIframeBody().contains("An Amazing headline!")
+ })
+ it("change the font size of the headline", () => {
+ cy.contains("Typography").click()
+ cy.get("[data-cy=font-size-prop-control]").click()
+ cy.contains("60px").click()
+ cy.contains("Design").click()
- cy.contains('Container').click()
- })
- it('should add a headline', () => {
- cy.addHeadlineComponent('An Amazing headline!')
-
- getIframeBody().contains('An Amazing headline!')
- })
- it('change the font size of the headline', () => {
- cy.contains('Typography').click()
- cy.get('[data-cy=font-size-prop-control]').click()
- cy.contains("60px").click()
- cy.contains('Design').click()
-
- getIframeBody().contains('An Amazing headline!').should('have.css', 'font-size', '60px')
- })
+ getIframeBody()
+ .contains("An Amazing headline!")
+ .should("have.css", "font-size", "60px")
+ })
})
const getIframeDocument = () => {
- return cy
- .get('iframe')
- // Cypress yields jQuery element, which has the real
- // DOM element under property "0".
- // From the real DOM iframe element we can get
- // the "document" element, it is stored in "contentDocument" property
- // Cypress "its" command can access deep properties using dot notation
- // https://on.cypress.io/its
- .its('0.contentDocument').should('exist')
+ return (
+ cy
+ .get("iframe")
+ // Cypress yields jQuery element, which has the real
+ // DOM element under property "0".
+ // From the real DOM iframe element we can get
+ // the "document" element, it is stored in "contentDocument" property
+ // Cypress "its" command can access deep properties using dot notation
+ // https://on.cypress.io/its
+ .its("0.contentDocument")
+ .should("exist")
+ )
}
const getIframeBody = () => {
- // get the document
- return getIframeDocument()
- // automatically retries until body is loaded
- .its('body').should('not.be.undefined')
- // wraps "body" DOM element to allow
- // chaining more Cypress commands, like ".find(...)"
- .then(cy.wrap)
-}
\ No newline at end of file
+ // get the document
+ return (
+ getIframeDocument()
+ // automatically retries until body is loaded
+ .its("body")
+ .should("not.be.undefined")
+ // wraps "body" DOM element to allow
+ // chaining more Cypress commands, like ".find(...)"
+ .then(cy.wrap)
+ )
+}
diff --git a/packages/builder/cypress/integration/createTable.spec.js b/packages/builder/cypress/integration/createTable.spec.js
index 0715d61c0..fdad39b95 100644
--- a/packages/builder/cypress/integration/createTable.spec.js
+++ b/packages/builder/cypress/integration/createTable.spec.js
@@ -8,7 +8,7 @@ context("Create a Table", () => {
cy.createTable("dog")
// Check if Table exists
- cy.get(".title span").should("have.text", "dog")
+ cy.get(".table-title h1").should("have.text", "dog")
})
it("adds a new column to the table", () => {
@@ -26,9 +26,7 @@ context("Create a Table", () => {
.trigger("mouseover")
.find(".ri-pencil-line")
.click({ force: true })
- cy.get(".actions input")
- .first()
- .type("updated")
+ cy.get(".actions input").first().type("updated")
// Unset table display column
cy.contains("display column").click()
cy.contains("Save Column").click()
@@ -36,7 +34,8 @@ context("Create a Table", () => {
})
it("edits a row", () => {
- cy.get("button").contains("Edit").click()
+ cy.contains("button", "Edit").click({ force: true })
+ cy.wait(1000)
cy.get(".modal input").type("Updated")
cy.contains("Save").click()
cy.contains("RoverUpdated").should("have.text", "RoverUpdated")
@@ -50,10 +49,10 @@ context("Create a Table", () => {
})
it("deletes a column", () => {
- cy
- .contains("header", "name")
- .trigger("mouseover")
- .find(".ri-pencil-line").click({ force: true })
+ cy.contains("header", "name")
+ .trigger("mouseover")
+ .find(".ri-pencil-line")
+ .click({ force: true })
cy.contains("Delete").click()
cy.wait(50)
cy.get(".buttons").contains("Delete").click()
@@ -61,9 +60,7 @@ context("Create a Table", () => {
})
it("deletes a table", () => {
- cy.contains("div", "dog")
- .get(".ri-more-line")
- .click()
+ cy.contains(".nav-item", "dog").get(".actions").invoke("show").click()
cy.get("[data-cy=delete-table]").click()
cy.contains("Delete Table").click()
cy.contains("dog").should("not.exist")
diff --git a/packages/builder/cypress/integration/createView.spec.js b/packages/builder/cypress/integration/createView.spec.js
index ca0dd60f8..60bd8c15d 100644
--- a/packages/builder/cypress/integration/createView.spec.js
+++ b/packages/builder/cypress/integration/createView.spec.js
@@ -22,10 +22,12 @@ context("Create a View", () => {
cy.get("input").type("Test View")
cy.contains("Save View").click()
})
- cy.get(".title").contains("Test View")
+ cy.get(".table-title h1").contains("Test View")
cy.get("[data-cy=table-header]").then($headers => {
expect($headers).to.have.length(3)
- const headers = Array.from($headers).map(header => header.textContent.trim())
+ const headers = Array.from($headers).map(header =>
+ header.textContent.trim()
+ )
expect(headers).to.deep.eq(["group", "age", "rating"])
})
})
@@ -33,14 +35,8 @@ context("Create a View", () => {
it("filters the view by age over 10", () => {
cy.contains("Filter").click()
cy.contains("Add Filter").click()
- cy.get(".menu-container")
- .find("select")
- .first()
- .select("age")
- cy.get(".menu-container")
- .find("select")
- .eq(1)
- .select("More Than")
+ cy.get(".menu-container").find("select").first().select("age")
+ cy.get(".menu-container").find("select").eq(1).select("More Than")
cy.get(".menu-container").find("input").type(18)
cy.contains("Save").click()
cy.get("[role=rowgroup] .ag-row").get($values => {
@@ -53,20 +49,16 @@ context("Create a View", () => {
cy.viewport("macbook-15")
cy.contains("Calculate").click()
- cy.get(".menu-container")
- .find("select")
- .eq(0)
- .select("Statistics")
+ cy.get(".menu-container").find("select").eq(0).select("Statistics")
cy.wait(50)
- cy.get(".menu-container")
- .find("select")
- .eq(1)
- .select("age")
+ cy.get(".menu-container").find("select").eq(1).select("age")
cy.contains("Save").click()
cy.get(".ag-center-cols-viewport").scrollTo("100%")
cy.get("[data-cy=table-header]").then($headers => {
expect($headers).to.have.length(7)
- const headers = Array.from($headers).map(header => header.textContent.trim())
+ const headers = Array.from($headers).map(header =>
+ header.textContent.trim()
+ )
expect(headers).to.deep.eq([
"field",
"sum",
@@ -78,16 +70,10 @@ context("Create a View", () => {
])
})
cy.get(".ag-cell").then($values => {
- const values = Array.from($values).map(header => header.textContent.trim())
- expect(values).to.deep.eq([
- "age",
- "155",
- "20",
- "49",
- "5",
- "5347",
- "31",
- ])
+ const values = Array.from($values).map(header =>
+ header.textContent.trim()
+ )
+ expect(values).to.deep.eq(["age", "155", "20", "49", "5", "5347", "31"])
})
})
@@ -102,8 +88,7 @@ context("Create a View", () => {
cy.contains("Students").should("be.visible")
cy.contains("Teachers").should("be.visible")
- cy
- .get(".ag-row[row-index=0]")
+ cy.get(".ag-row[row-index=0]")
.find(".ag-cell")
.then($values => {
const values = Array.from($values).map(value => value.textContent)
@@ -120,10 +105,11 @@ context("Create a View", () => {
})
it("renames a view", () => {
- cy.contains("[data-cy=table-nav-item]", "Test View")
- .find(".ri-more-line")
+ cy.contains(".nav-item", "Test View")
+ .find(".actions")
+ .invoke("show")
.click()
- cy.contains("Edit").click()
+ cy.get("[data-cy=edit-view]").click()
cy.get(".menu-container").within(() => {
cy.get("input").type(" Updated")
cy.contains("Save").click()
@@ -132,11 +118,11 @@ context("Create a View", () => {
})
it("deletes a view", () => {
- cy.contains("[data-cy=table-nav-item]", "Test View Updated").click()
- cy.contains("[data-cy=table-nav-item]", "Test View Updated")
- .find(".ri-more-line")
+ cy.contains(".nav-item", "Test View Updated")
+ .find(".actions")
+ .invoke("show")
.click()
- cy.contains("Delete").click()
+ cy.get("[data-cy=delete-view]").click()
cy.contains("Delete View").click()
cy.contains("TestView Updated").should("not.be.visible")
})
diff --git a/packages/builder/cypress/support/commands.js b/packages/builder/cypress/support/commands.js
index b2a41d9d4..f82ff3082 100644
--- a/packages/builder/cypress/support/commands.js
+++ b/packages/builder/cypress/support/commands.js
@@ -51,7 +51,7 @@ Cypress.Commands.add("createApp", name => {
.click()
.type("test")
cy.contains("Submit").click()
- cy.contains("Create New Table", {
+ cy.get("[data-cy=new-table]", {
timeout: 20000,
}).should("be.visible")
})
@@ -65,7 +65,7 @@ Cypress.Commands.add("createTestTableWithData", () => {
Cypress.Commands.add("createTable", tableName => {
// Enter table name
- cy.contains("Create New Table").click()
+ cy.get("[data-cy=new-table]").click()
cy.get(".modal").within(() => {
cy.get("input")
.first()
@@ -79,9 +79,7 @@ Cypress.Commands.add("createTable", tableName => {
Cypress.Commands.add("addColumn", (tableName, columnName, type) => {
// Select Table
- cy.get(".root")
- .contains(tableName)
- .click()
+ cy.contains(".nav-item", tableName).click()
cy.contains("Create New Column").click()
// Configure column
@@ -155,7 +153,7 @@ Cypress.Commands.add("navigateToFrontend", () => {
})
Cypress.Commands.add("createScreen", (screenName, route) => {
- cy.contains("Create New Screen").click()
+ cy.get("[data-cy=new-screen]").click()
cy.get(".modal").within(() => {
cy.get("input")
.eq(0)
diff --git a/packages/builder/src/budibase.css b/packages/builder/src/budibase.css
index 6dc786f52..1426a7bee 100644
--- a/packages/builder/src/budibase.css
+++ b/packages/builder/src/budibase.css
@@ -85,14 +85,6 @@
box-sizing: border-box;
}
-.preview-pane {
- grid-column: 2;
- margin: 80px 60px;
- background: #fff;
- border-radius: 5px;
- box-shadow: 0 0px 6px rgba(0, 0, 0, 0.05);
-}
-
.budibase__table {
border: 1px solid var(--grey-4);
background: #fff;
diff --git a/packages/builder/src/builderStore/fetchBindableProperties.js b/packages/builder/src/builderStore/fetchBindableProperties.js
index 64755606c..9a193112f 100644
--- a/packages/builder/src/builderStore/fetchBindableProperties.js
+++ b/packages/builder/src/builderStore/fetchBindableProperties.js
@@ -106,11 +106,15 @@ const contextToBindables = (tables, walkResult) => context => {
}
}
+ const stringType = { type: "string" }
return (
Object.entries(schema)
.map(newBindable)
// add _id and _rev fields - not part of schema, but always valid
- .concat([newBindable(["_id", "string"]), newBindable(["_rev", "string"])])
+ .concat([
+ newBindable(["_id", stringType]),
+ newBindable(["_rev", stringType]),
+ ])
)
}
diff --git a/packages/builder/src/builderStore/getNewComponentName.js b/packages/builder/src/builderStore/getNewComponentName.js
index 9ab8ef16d..a4565c229 100644
--- a/packages/builder/src/builderStore/getNewComponentName.js
+++ b/packages/builder/src/builderStore/getNewComponentName.js
@@ -2,7 +2,9 @@ import { walkProps } from "./storeUtils"
import { get_capitalised_name } from "../helpers"
export default function(component, state) {
- const capitalised = get_capitalised_name(component)
+ const capitalised = get_capitalised_name(
+ component.name || component._component
+ )
const matchingComponents = []
diff --git a/packages/builder/src/builderStore/store/index.js b/packages/builder/src/builderStore/store/index.js
index 4e7b089f5..906968230 100644
--- a/packages/builder/src/builderStore/store/index.js
+++ b/packages/builder/src/builderStore/store/index.js
@@ -371,7 +371,7 @@ const addChildComponent = store => (componentToAdd, presetProps = {}) => {
const component = getComponentDefinition(state, componentToAdd)
const instanceId = get(backendUiStore).selectedDatabase._id
- const instanceName = getNewComponentName(componentToAdd, state)
+ const instanceName = getNewComponentName(component, state)
const newComponent = createProps(
component,
diff --git a/packages/builder/src/components/automation/AutomationBuilder/AutomationBuilder.svelte b/packages/builder/src/components/automation/AutomationBuilder/AutomationBuilder.svelte
index c832ddd8b..f8a3699f4 100644
--- a/packages/builder/src/components/automation/AutomationBuilder/AutomationBuilder.svelte
+++ b/packages/builder/src/components/automation/AutomationBuilder/AutomationBuilder.svelte
@@ -1,12 +1,12 @@
-
@@ -61,6 +69,7 @@ flex-direction: row; justify-content: flex-start; align-items: center; + gap: var(--spacing-xs); } header span { flex: 1 1 auto; @@ -74,7 +83,13 @@ } header i { font-size: 20px; - margin-right: 5px; + } + header i.delete { + opacity: 0.5; + } + header i.delete:hover { + cursor: pointer; + opacity: 1; } .ACTION { diff --git a/packages/builder/src/components/automation/AutomationBuilder/flowchart/api.js b/packages/builder/src/components/automation/AutomationBuilder/flowchart/api.js deleted file mode 100644 index e69de29bb..000000000 diff --git a/packages/builder/src/components/automation/AutomationBuilder/flowchart/index.js b/packages/builder/src/components/automation/AutomationBuilder/flowchart/index.js deleted file mode 100644 index e69de29bb..000000000 diff --git a/packages/builder/src/components/automation/AutomationPanel/AutomationList.svelte b/packages/builder/src/components/automation/AutomationPanel/AutomationList.svelte new file mode 100644 index 000000000..c4a39d69b --- /dev/null +++ b/packages/builder/src/components/automation/AutomationPanel/AutomationList.svelte @@ -0,0 +1,34 @@ + + +