diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9030158c46..72ad1fb6e9 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -12,8 +12,6 @@ Budibase is a monorepo managed by [lerna](https://github.com/lerna/lerna). Lerna - **packages/client** - A module that runs in the browser responsible for reading JSON definition and creating living, breathing web apps from it. -- **packages/cli** - The budibase CLI. This is the main module that gets downloaded from NPM and is responsible for creating and managing apps, as well as running the budibase server. - - **packages/server** - The budibase server. This [Koa](https://koajs.com/) app is responsible for serving the JS for the builder and budibase apps, as well as providing the API for interaction with the database and file system. @@ -95,14 +93,9 @@ then `cd ` into your local copy. ### 4. Initialising Budibase and Creating a Budibase App -`yarn initialise` will initialise your budibase installation. A Budibase apps folder will have been created in `~/.budibase`. You can also just start up the budibase electron app and it should initialise budibase for you. +Starting up the budibase electron app should initialise budibase for you. A Budibase apps folder will have been created in `~/.budibase`. -This is a blank apps folder, so you will need to create yourself an app. - -``` -cd packages/server -yarn run budi new your-app-name -``` +This is a blank apps folder, so you will need to create yourself an app, you can do this by clicking "Create New App" from the budibase builder. This will create a new budibase application in the `~/.budibase/` directory, and NPM install the component libraries for that application. Let's start building your app with the budibase builder! @@ -116,16 +109,6 @@ To run the budibase server and builder in dev mode (i.e. with live reloading): This will enable watch mode for both the builder app, server, client library and any component libraries. -### Running Commands from /server Directory - -Notice that when inside `packages/server`, you can use any Budibase CLI command via yarn: - -e.g. `yarn budi new mikes_app` == `budi new mikes_app` - -This will use the CLI directly from `packages/cli`, rather than your globally installed `budi` - - - ## Data Storage When you are running locally, budibase stores data on disk using [PouchDB](https://pouchdb.com/), as well as some JSON on local files. After setting up budibase, you can find all of this data in the `~/.budibase` directory. diff --git a/lerna.json b/lerna.json index 9d0f9c2a80..c3c28d7881 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "0.2.6", + "version": "0.3.1", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/builder/cypress/integration/createAutomation.spec.js b/packages/builder/cypress/integration/createAutomation.spec.js index c2a22c4f9b..92d1f907bd 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 bf978d3e3a..6931fdb86b 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 0715d61c0b..fdad39b956 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 ca0dd60f8b..60bd8c15d1 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/setup.js b/packages/builder/cypress/setup.js index a6dab69583..f56374ea35 100644 --- a/packages/builder/cypress/setup.js +++ b/packages/builder/cypress/setup.js @@ -4,8 +4,8 @@ // 3. Runs the server using said folder const rimraf = require("rimraf") -const { join } = require("path") -const run = require("../../cli/src/commands/run/runHandler") +const { join, resolve } = require("path") +// const run = require("../../cli/src/commands/run/runHandler") const initialiseBudibase = require("../../server/src/utilities/initialiseBudibase") const homedir = join(require("os").homedir(), ".budibase") @@ -16,9 +16,22 @@ process.env.BUDIBASE_API_KEY = "6BE826CB-6B30-4AEC-8777-2E90464633DE" process.env.NODE_ENV = "cypress" process.env.ENABLE_ANALYTICS = "false" +async function run(dir) { + process.env.BUDIBASE_DIR = resolve(dir) + require("dotenv").config({ path: resolve(dir, ".env") }) + + // dont make this a variable or top level require + // it will cause environment module to be loaded prematurely + const server = require("../../server/src/app") + server.on("close", () => console.log("Server Closed")) +} + initialiseBudibase({ dir: homedir, clientId: "cypress-test" }) .then(() => { delete require.cache[require.resolve("../../server/src/environment")] - run({ dir: homedir }) + const xPlatHomeDir = homedir.startsWith("~") + ? join(homedir(), homedir.substring(1)) + : homedir + run(xPlatHomeDir) }) .catch(e => console.error(e)) diff --git a/packages/builder/cypress/support/commands.js b/packages/builder/cypress/support/commands.js index b2a41d9d41..f82ff30827 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/package.json b/packages/builder/package.json index 671aaaa5c8..3aae8af2d6 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "0.2.6", + "version": "0.3.1", "license": "AGPL-3.0", "private": true, "scripts": { @@ -64,7 +64,7 @@ }, "dependencies": { "@budibase/bbui": "^1.47.0", - "@budibase/client": "^0.2.6", + "@budibase/client": "^0.3.1", "@budibase/colorpicker": "^1.0.1", "@budibase/svelte-ag-grid": "^0.0.16", "@fortawesome/fontawesome-free": "^5.14.0", diff --git a/packages/builder/src/budibase.css b/packages/builder/src/budibase.css index 6dc786f522..1426a7beed 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 64755606c3..9a193112fb 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 9ab8ef16dc..a4565c2296 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 ead1721896..897dbd96d5 100644 --- a/packages/builder/src/builderStore/store/index.js +++ b/packages/builder/src/builderStore/store/index.js @@ -132,10 +132,10 @@ const setPackage = (store, initial) => async pkg => { ...Object.values(unauth_screens), ] initial.builtins = [getBuiltin("##builtin/screenslot")] - initial.appInstances = pkg.application.instances + initial.appInstance = pkg.application.instance initial.appId = pkg.application._id store.set(initial) - await backendUiStore.actions.database.select(initial.appInstances[0]) + await backendUiStore.actions.database.select(initial.appInstance) return initial } @@ -346,7 +346,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 c832ddd8bc..f8a3699f4d 100644 --- a/packages/builder/src/components/automation/AutomationBuilder/AutomationBuilder.svelte +++ b/packages/builder/src/components/automation/AutomationBuilder/AutomationBuilder.svelte @@ -1,12 +1,12 @@ -
+{#if automation} + -
- +{:else if automationCount === 0} + Create your first automation to get started +{:else}Select an automation to edit{/if} diff --git a/packages/builder/src/components/automation/AutomationBuilder/BlockList.svelte b/packages/builder/src/components/automation/AutomationBuilder/BlockList.svelte new file mode 100644 index 0000000000..de3e9660ad --- /dev/null +++ b/packages/builder/src/components/automation/AutomationBuilder/BlockList.svelte @@ -0,0 +1,136 @@ + + +
+ {#each tabs as tab, idx} +
onChangeTab(idx)} + class:active={idx === selectedIndex}> + {#if tab.icon}{/if} + {tab.label} + +
+ {/each} +
+ (selectedIndex = null)} + bind:this={popover} + {anchor} + align="left"> + + {#each blocks as [stepId, blockDefinition]} + addBlockToAutomation(stepId, blockDefinition)} /> + {/each} + + + + + + + diff --git a/packages/builder/src/components/automation/AutomationBuilder/flowchart/Arrow.svelte b/packages/builder/src/components/automation/AutomationBuilder/FlowChart/Arrow.svelte similarity index 100% rename from packages/builder/src/components/automation/AutomationBuilder/flowchart/Arrow.svelte rename to packages/builder/src/components/automation/AutomationBuilder/FlowChart/Arrow.svelte diff --git a/packages/builder/src/components/automation/AutomationBuilder/flowchart/AutomationBlockTagline.svelte b/packages/builder/src/components/automation/AutomationBuilder/FlowChart/AutomationBlockTagline.svelte similarity index 100% rename from packages/builder/src/components/automation/AutomationBuilder/flowchart/AutomationBlockTagline.svelte rename to packages/builder/src/components/automation/AutomationBuilder/FlowChart/AutomationBlockTagline.svelte diff --git a/packages/builder/src/components/automation/AutomationBuilder/flowchart/FlowChart.svelte b/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowChart.svelte similarity index 66% rename from packages/builder/src/components/automation/AutomationBuilder/flowchart/FlowChart.svelte rename to packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowChart.svelte index 09a0d097de..48bafb8cd3 100644 --- a/packages/builder/src/components/automation/AutomationBuilder/flowchart/FlowChart.svelte +++ b/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowChart.svelte @@ -3,7 +3,6 @@ import Arrow from "./Arrow.svelte" import { flip } from "svelte/animate" import { fade, fly } from "svelte/transition" - import { automationStore } from "builderStore" export let automation export let onSelect @@ -18,16 +17,9 @@ blocks = blocks.concat(automation.definition.steps || []) } } - $: automationCount = $automationStore.automations?.length ?? 0 -{#if automationCount === 0} - Create your first automation to get started -{:else if automation == null} - Select an automation to edit -{:else if !blocks.length} - Add some steps to your automation to get started -{/if} +{#if !blocks.length}Add a trigger to your automation to get started{/if}
{#each blocks as block, idx (block.id)}
diff --git a/packages/builder/src/components/automation/AutomationBuilder/flowchart/FlowItem.svelte b/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowItem.svelte similarity index 84% rename from packages/builder/src/components/automation/AutomationBuilder/flowchart/FlowItem.svelte rename to packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowItem.svelte index 2c78875eb1..a96e85d582 100644 --- a/packages/builder/src/components/automation/AutomationBuilder/flowchart/FlowItem.svelte +++ b/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowItem.svelte @@ -10,6 +10,11 @@ $: steps = $automationStore.selectedAutomation?.automation?.definition?.steps ?? [] $: blockIdx = steps.findIndex(step => step.id === block.id) + $: allowDeleteTrigger = !steps.length + + function deleteStep() { + automationStore.actions.deleteAutomationBlock(block) + }
{#if block.type === 'TRIGGER'}Trigger{:else}Step {blockIdx + 1}{/if}
+ {#if block.type !== 'TRIGGER' || allowDeleteTrigger} + + {/if}

@@ -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 e69de29bb2..0000000000 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 e69de29bb2..0000000000 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 0000000000..c4a39d69b9 --- /dev/null +++ b/packages/builder/src/components/automation/AutomationPanel/AutomationList.svelte @@ -0,0 +1,34 @@ + + +

+ {#each $automationStore.automations as automation, idx} + 0} + icon="ri-stackshare-line" + text={automation.name} + selected={automation._id === selectedAutomationId} + on:click={() => automationStore.actions.select(automation)}> + + + {/each} +
+ + diff --git a/packages/builder/src/components/automation/AutomationPanel/AutomationList/AutomationList.svelte b/packages/builder/src/components/automation/AutomationPanel/AutomationList/AutomationList.svelte deleted file mode 100644 index 328c0d6122..0000000000 --- a/packages/builder/src/components/automation/AutomationPanel/AutomationList/AutomationList.svelte +++ /dev/null @@ -1,79 +0,0 @@ - - -
- -
    - {#each $automationStore.automations as automation} -
  • automationStore.actions.select(automation)}> - - {automation.name} -
  • - {/each} -
-
- - - - - diff --git a/packages/builder/src/components/automation/AutomationPanel/AutomationPanel.svelte b/packages/builder/src/components/automation/AutomationPanel/AutomationPanel.svelte index 9a29025d56..e09803e130 100644 --- a/packages/builder/src/components/automation/AutomationPanel/AutomationPanel.svelte +++ b/packages/builder/src/components/automation/AutomationPanel/AutomationPanel.svelte @@ -1,50 +1,44 @@ - - (selectedTab = 'AUTOMATIONS')}> - Automations - - {#if $automationStore.selectedAutomation} - (selectedTab = 'ADD')}> - Steps - - {/if} - - -{#if selectedTab === 'AUTOMATIONS'} - -{:else if selectedTab === 'ADD'} - -{/if} +
+

Automations

+ +
+ + + + diff --git a/packages/builder/src/components/automation/AutomationPanel/BlockList/BlockList.svelte b/packages/builder/src/components/automation/AutomationPanel/BlockList/BlockList.svelte deleted file mode 100644 index 1455f60ef1..0000000000 --- a/packages/builder/src/components/automation/AutomationPanel/BlockList/BlockList.svelte +++ /dev/null @@ -1,48 +0,0 @@ - - -
- -
- {#each blocks as [stepId, blockDefinition]} - - {/each} -
-
- - diff --git a/packages/builder/src/components/automation/AutomationPanel/AutomationList/CreateAutomationModal.svelte b/packages/builder/src/components/automation/AutomationPanel/CreateAutomationModal.svelte similarity index 100% rename from packages/builder/src/components/automation/AutomationPanel/AutomationList/CreateAutomationModal.svelte rename to packages/builder/src/components/automation/AutomationPanel/CreateAutomationModal.svelte diff --git a/packages/builder/src/components/automation/AutomationPanel/EditAutomationPopover.svelte b/packages/builder/src/components/automation/AutomationPanel/EditAutomationPopover.svelte new file mode 100644 index 0000000000..a3ec5b2ae5 --- /dev/null +++ b/packages/builder/src/components/automation/AutomationPanel/EditAutomationPopover.svelte @@ -0,0 +1,88 @@ + + +
+
+ +
+ + + + + +
+ + Are you sure you wish to delete the automation + {automation.name}? + This action cannot be undone. + + + diff --git a/packages/builder/src/components/automation/AutomationPanel/index.js b/packages/builder/src/components/automation/AutomationPanel/index.js deleted file mode 100644 index 3ba95ab3b6..0000000000 --- a/packages/builder/src/components/automation/AutomationPanel/index.js +++ /dev/null @@ -1,3 +0,0 @@ -export { default as AutomationPanel } from "./AutomationPanel.svelte" -export { default as BlockList } from "./BlockList/BlockList.svelte" -export { default as AutomationList } from "./AutomationList/AutomationList.svelte" diff --git a/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte b/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte index 3d7150eb7a..8bb4dc36dd 100644 --- a/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte +++ b/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte @@ -1,10 +1,10 @@ -
-
{block.name}
- {#each inputs as [key, value]} -
- - {#if value.type === 'string' && value.enum} - - {:else if value.customType === 'password'} - - {:else if value.customType === 'table'} - - {:else if value.customType === 'row'} - - {:else if value.customType === 'webhookUrl'} - - {:else if value.type === 'string' || value.type === 'number'} - - {/if} -
- {/each} - {#if stepId === 'WEBHOOK'} - - {/if} -
+
{block.name}
+{#each inputs as [key, value]} +
+ + {#if value.type === 'string' && value.enum} + + {:else if value.customType === 'password'} + + {:else if value.customType === 'table'} + + {:else if value.customType === 'row'} + + {:else if value.customType === 'webhookUrl'} + + {:else if value.type === 'string' || value.type === 'number'} + + {/if} +
+{/each} +{#if stepId === 'WEBHOOK'} + +{/if} diff --git a/packages/builder/src/components/automation/SetupPanel/ParamInputs/TableSelector.svelte b/packages/builder/src/components/automation/SetupPanel/TableSelector.svelte similarity index 88% rename from packages/builder/src/components/automation/SetupPanel/ParamInputs/TableSelector.svelte rename to packages/builder/src/components/automation/SetupPanel/TableSelector.svelte index ba0b55cc85..9727fa1d51 100644 --- a/packages/builder/src/components/automation/SetupPanel/ParamInputs/TableSelector.svelte +++ b/packages/builder/src/components/automation/SetupPanel/TableSelector.svelte @@ -6,7 +6,7 @@
- {#each $backendUiStore.tables as table} diff --git a/packages/builder/src/components/automation/SetupPanel/index.js b/packages/builder/src/components/automation/SetupPanel/index.js deleted file mode 100644 index ccfbddaf1c..0000000000 --- a/packages/builder/src/components/automation/SetupPanel/index.js +++ /dev/null @@ -1 +0,0 @@ -export { default as SetupPanel } from "./SetupPanel.svelte" diff --git a/packages/builder/src/components/automation/Shared/CreateWebhookModal.svelte b/packages/builder/src/components/automation/Shared/CreateWebhookModal.svelte index 246c313819..8be9400caf 100644 --- a/packages/builder/src/components/automation/Shared/CreateWebhookModal.svelte +++ b/packages/builder/src/components/automation/Shared/CreateWebhookModal.svelte @@ -3,12 +3,8 @@ import WebhookDisplay from "./WebhookDisplay.svelte" import { ModalContent } from "@budibase/bbui" import { onMount, onDestroy } from "svelte" - import { cloneDeep } from "lodash/fp" - import analytics from "analytics" const POLL_RATE_MS = 2500 - const DEFAULT_SCHEMA_OUTPUT = "Any input allowed" - let name let interval let finished = false let schemaURL @@ -88,8 +84,7 @@ text-decoration: none; } p { - margin-top: 0; - padding-top: 0; + margin: 0; text-align: justify; } .finished-text { diff --git a/packages/builder/src/components/automation/Shared/WebhookDisplay.svelte b/packages/builder/src/components/automation/Shared/WebhookDisplay.svelte index cac9a58397..5b9293bc8c 100644 --- a/packages/builder/src/components/automation/Shared/WebhookDisplay.svelte +++ b/packages/builder/src/components/automation/Shared/WebhookDisplay.svelte @@ -1,7 +1,7 @@ -
-
-

{title}

-
- - {#if selectedRows.length > 0} - - {/if} -
+
+
+

{title}

+ {#if loading} +
+ +
+ {/if}
+
+ + {#if selectedRows.length > 0} + + {/if} +
+
+
(selectedRows = detail)} /> -
+
diff --git a/packages/builder/src/components/backend/TableNavigator/modals/CreateTableModal.svelte b/packages/builder/src/components/backend/TableNavigator/modals/CreateTableModal.svelte index dd691e9e80..146f881b2b 100644 --- a/packages/builder/src/components/backend/TableNavigator/modals/CreateTableModal.svelte +++ b/packages/builder/src/components/backend/TableNavigator/modals/CreateTableModal.svelte @@ -2,8 +2,7 @@ import { goto } from "@sveltech/routify" import { backendUiStore, store } from "builderStore" import { notifier } from "builderStore/store/notifications" - import { Button, Input, Label, ModalContent, Modal } from "@budibase/bbui" - import Spinner from "components/common/Spinner.svelte" + import { Input, Label, ModalContent } from "@budibase/bbui" import TableDataImport from "../TableDataImport.svelte" import analytics from "analytics" import screenTemplates from "builderStore/store/screenTemplates" @@ -22,12 +21,6 @@ let dataImport let error = "" - function resetState() { - name = "" - dataImport = undefined - error = "" - } - function checkValid(evt) { const tableName = evt.target.value if ($backendUiStore.models?.some(model => model.name === tableName)) { @@ -84,23 +77,20 @@ } - - - - -
- - -
-
-
+ + +
+ + +
+
diff --git a/packages/builder/src/components/backend/TableNavigator/popovers/EditTablePopover.svelte b/packages/builder/src/components/backend/TableNavigator/popovers/EditTablePopover.svelte index 25f74671fd..c794999ac7 100644 --- a/packages/builder/src/components/backend/TableNavigator/popovers/EditTablePopover.svelte +++ b/packages/builder/src/components/backend/TableNavigator/popovers/EditTablePopover.svelte @@ -1,11 +1,9 @@ -
- +
+
+ +
+ + {#if editing} +
+
Edit Table
+ +
+ + +
+
+ {:else} + + + + + {/if} +
- - {#if editing} -
-
Edit Table
- -
- - -
-
- {:else} -
    -
  • - - Edit -
  • -
  • - - Delete -
  • -
- {/if} -
+ title="Confirm Deletion"> Are you sure you wish to delete the table {table.name}? The following will also be deleted: @@ -155,29 +157,4 @@ justify-content: flex-end; gap: var(--spacing-m); } - - ul { - list-style: none; - margin: 0; - padding: var(--spacing-s) 0; - } - - li { - display: flex; - font-family: var(--font-sans); - font-size: var(--font-size-xs); - color: var(--ink); - padding: var(--spacing-s) var(--spacing-m); - margin: auto 0px; - align-items: center; - cursor: pointer; - } - - li:hover { - background-color: var(--grey-2); - } - - li:active { - color: var(--blue); - } diff --git a/packages/builder/src/components/backend/TableNavigator/popovers/EditViewPopover.svelte b/packages/builder/src/components/backend/TableNavigator/popovers/EditViewPopover.svelte index 9c165355d2..331f336d4e 100644 --- a/packages/builder/src/components/backend/TableNavigator/popovers/EditViewPopover.svelte +++ b/packages/builder/src/components/backend/TableNavigator/popovers/EditViewPopover.svelte @@ -2,9 +2,9 @@ import { goto } from "@sveltech/routify" import { backendUiStore } from "builderStore" import { notifier } from "builderStore/store/notifications" - import { DropdownMenu, Button, Icon, Input, Select } from "@budibase/bbui" - import { FIELDS } from "constants/backend" + import { DropdownMenu, Button, Input } from "@budibase/bbui" import ConfirmDialog from "components/common/ConfirmDialog.svelte" + import { DropdownContainer, DropdownItem } from "components/common/Dropdowns" export let view @@ -46,38 +46,42 @@ } -
- +
+
+ +
+ + {#if editing} +
+
Edit View
+ +
+ + +
+
+ {:else} + + + + + {/if} +
- - {#if editing} -
-
Edit View
- -
- - -
-
- {:else} -
    -
  • - - Edit -
  • -
  • - - Delete -
  • -
- {/if} -
+ title="Confirm Deletion" /> diff --git a/packages/builder/src/components/common/ActionButton.svelte b/packages/builder/src/components/common/ActionButton.svelte deleted file mode 100644 index 3af21e4398..0000000000 --- a/packages/builder/src/components/common/ActionButton.svelte +++ /dev/null @@ -1,70 +0,0 @@ - - - - - diff --git a/packages/builder/src/components/common/Button.svelte b/packages/builder/src/components/common/Button.svelte deleted file mode 100644 index a5fe3752a2..0000000000 --- a/packages/builder/src/components/common/Button.svelte +++ /dev/null @@ -1,171 +0,0 @@ - - - - - diff --git a/packages/builder/src/components/common/ButtonGroup.svelte b/packages/builder/src/components/common/ButtonGroup.svelte deleted file mode 100644 index 7b57ea34cc..0000000000 --- a/packages/builder/src/components/common/ButtonGroup.svelte +++ /dev/null @@ -1,15 +0,0 @@ - - -
- -
- - diff --git a/packages/builder/src/components/common/Dropdowns/DropdownContainer.svelte b/packages/builder/src/components/common/Dropdowns/DropdownContainer.svelte new file mode 100644 index 0000000000..0e881a4795 --- /dev/null +++ b/packages/builder/src/components/common/Dropdowns/DropdownContainer.svelte @@ -0,0 +1,13 @@ + + + diff --git a/packages/builder/src/components/common/Dropdowns/DropdownItem.svelte b/packages/builder/src/components/common/Dropdowns/DropdownItem.svelte new file mode 100644 index 0000000000..66a384fc90 --- /dev/null +++ b/packages/builder/src/components/common/Dropdowns/DropdownItem.svelte @@ -0,0 +1,70 @@ + + + + + diff --git a/packages/builder/src/components/common/Dropdowns/index.js b/packages/builder/src/components/common/Dropdowns/index.js new file mode 100644 index 0000000000..a95e303ec7 --- /dev/null +++ b/packages/builder/src/components/common/Dropdowns/index.js @@ -0,0 +1,2 @@ +export { default as DropdownContainer } from "./DropdownContainer.svelte" +export { default as DropdownItem } from "./DropdownItem.svelte" diff --git a/packages/builder/src/components/common/Dropzone.svelte b/packages/builder/src/components/common/Dropzone.svelte index 53cd606143..be93829084 100644 --- a/packages/builder/src/components/common/Dropzone.svelte +++ b/packages/builder/src/components/common/Dropzone.svelte @@ -1,11 +1,13 @@ + + + + diff --git a/packages/builder/src/components/common/NumberBox.svelte b/packages/builder/src/components/common/NumberBox.svelte deleted file mode 100644 index 106b9e67d2..0000000000 --- a/packages/builder/src/components/common/NumberBox.svelte +++ /dev/null @@ -1,36 +0,0 @@ - - -
- - -
- - diff --git a/packages/builder/src/components/common/Switcher.svelte b/packages/builder/src/components/common/Switcher.svelte deleted file mode 100644 index 707bbfcc64..0000000000 --- a/packages/builder/src/components/common/Switcher.svelte +++ /dev/null @@ -1,76 +0,0 @@ - - -
-
- {#each tabs as tab} - - {/each} -
- -
- {#if selectedIndex === 0} - - {:else if selectedIndex === 1} - - {:else if selectedIndex === 2} - - {:else if selectedIndex === 3} - - {/if} -
-
- - diff --git a/packages/builder/src/components/common/core.js b/packages/builder/src/components/common/core.js deleted file mode 100644 index 19a3c9afed..0000000000 --- a/packages/builder/src/components/common/core.js +++ /dev/null @@ -1,3 +0,0 @@ -import { flow } from "lodash/fp" - -export const pipe = (arg, funcs) => flow(funcs)(arg) diff --git a/packages/builder/src/components/common/eventHandlers.js b/packages/builder/src/components/common/eventHandlers.js deleted file mode 100644 index 2e7a62ac3e..0000000000 --- a/packages/builder/src/components/common/eventHandlers.js +++ /dev/null @@ -1,13 +0,0 @@ -import { eventHandlers } from "../../../../client/src/state/eventHandlers" -export { EVENT_TYPE_MEMBER_NAME } from "../../../../client/src/state/eventHandlers" - -export const allHandlers = () => { - const handlersObj = eventHandlers() - - const handlers = Object.keys(handlersObj).map(name => ({ - name, - ...handlersObj[name], - })) - - return handlers -} diff --git a/packages/builder/src/components/settings/Link.svelte b/packages/builder/src/components/settings/Link.svelte index 3bb6d6e40d..f28dbae038 100644 --- a/packages/builder/src/components/settings/Link.svelte +++ b/packages/builder/src/components/settings/Link.svelte @@ -1,32 +1,36 @@ - - - +
+ +
diff --git a/packages/builder/src/components/settings/TabTitle.svelte b/packages/builder/src/components/settings/TabTitle.svelte deleted file mode 100644 index 8e2a2d6c13..0000000000 --- a/packages/builder/src/components/settings/TabTitle.svelte +++ /dev/null @@ -1,13 +0,0 @@ -

- -

- - diff --git a/packages/builder/src/components/start/CreateAppModal.svelte b/packages/builder/src/components/start/CreateAppModal.svelte index 7ee707d490..4118c2b9e7 100644 --- a/packages/builder/src/components/start/CreateAppModal.svelte +++ b/packages/builder/src/components/start/CreateAppModal.svelte @@ -7,9 +7,8 @@ import Spinner from "components/common/Spinner.svelte" import { API, Info, User } from "./Steps" import Indicator from "./Indicator.svelte" - import { Input, TextArea, Button } from "@budibase/bbui" + import { Button } from "@budibase/bbui" import { goto } from "@sveltech/routify" - import { AppsIcon, InfoIcon, CloseIcon } from "components/common/Icons/" import { fade } from "svelte/transition" import { post } from "builderStore/api" import analytics from "analytics" diff --git a/packages/builder/src/components/userInterface/AppPreview/CurrentItemPreview.svelte b/packages/builder/src/components/userInterface/AppPreview/CurrentItemPreview.svelte index 85c50711ae..fd7270cdfa 100644 --- a/packages/builder/src/components/userInterface/AppPreview/CurrentItemPreview.svelte +++ b/packages/builder/src/components/userInterface/AppPreview/CurrentItemPreview.svelte @@ -2,7 +2,7 @@ import { store, backendUiStore } from "builderStore" import { map, join } from "lodash/fp" import iframeTemplate from "./iframeTemplate" - import { pipe } from "components/common/core" + import { pipe } from "../../../helpers" let iframe let styles = "" diff --git a/packages/builder/src/components/userInterface/BindableInput.svelte b/packages/builder/src/components/userInterface/BindableInput.svelte index 5ba0798718..bb73dfd80d 100644 --- a/packages/builder/src/components/userInterface/BindableInput.svelte +++ b/packages/builder/src/components/userInterface/BindableInput.svelte @@ -43,7 +43,7 @@ width: 24px; background: var(--grey-4); right: var(--spacing-s); - bottom: 9px; + bottom: 5px; } button:hover { background: var(--grey-5); diff --git a/packages/builder/src/components/userInterface/CategoryTab.svelte b/packages/builder/src/components/userInterface/CategoryTab.svelte index 15335cbb87..ba3f4e920d 100644 --- a/packages/builder/src/components/userInterface/CategoryTab.svelte +++ b/packages/builder/src/components/userInterface/CategoryTab.svelte @@ -18,9 +18,13 @@ diff --git a/packages/builder/src/components/userInterface/ComponentPropertiesPanel.svelte b/packages/builder/src/components/userInterface/ComponentPropertiesPanel.svelte index 1331ce0bdb..475b864542 100644 --- a/packages/builder/src/components/userInterface/ComponentPropertiesPanel.svelte +++ b/packages/builder/src/components/userInterface/ComponentPropertiesPanel.svelte @@ -63,41 +63,31 @@ } -
- (selectedCategory = category)} - {categories} - {selectedCategory} /> + (selectedCategory = category)} + {categories} + {selectedCategory} /> - {#if displayName} -
{componentInstance._instanceName}
+{#if displayName} +
{componentInstance._instanceName}
+{/if} + +
+ {#if selectedCategory.value === 'design'} + + {:else if selectedCategory.value === 'settings'} + {/if} - -
- {#if selectedCategory.value === 'design'} - - {:else if selectedCategory.value === 'settings'} - - {/if} -
diff --git a/packages/builder/src/components/userInterface/ComponentsHierarchy.svelte b/packages/builder/src/components/userInterface/ComponentsHierarchy.svelte index add2a99d6a..48fe72f8d6 100644 --- a/packages/builder/src/components/userInterface/ComponentsHierarchy.svelte +++ b/packages/builder/src/components/userInterface/ComponentsHierarchy.svelte @@ -1,13 +1,12 @@
- + diff --git a/packages/builder/src/components/userInterface/EventsEditor/EventEditorModal.svelte b/packages/builder/src/components/userInterface/EventsEditor/EventEditorModal.svelte index 0e45f2fcac..2fc19bd6b8 100644 --- a/packages/builder/src/components/userInterface/EventsEditor/EventEditorModal.svelte +++ b/packages/builder/src/components/userInterface/EventsEditor/EventEditorModal.svelte @@ -1,14 +1,7 @@ - - - +
+ +
diff --git a/packages/builder/src/components/userInterface/FlatButton.svelte b/packages/builder/src/components/userInterface/FlatButton.svelte index f27a2902ee..0d7cd280d7 100644 --- a/packages/builder/src/components/userInterface/FlatButton.svelte +++ b/packages/builder/src/components/userInterface/FlatButton.svelte @@ -22,23 +22,22 @@ diff --git a/packages/builder/src/components/userInterface/IconSelect/IconSelect.svelte b/packages/builder/src/components/userInterface/IconSelect/IconSelect.svelte index 6141702439..fe3a029716 100644 --- a/packages/builder/src/components/userInterface/IconSelect/IconSelect.svelte +++ b/packages/builder/src/components/userInterface/IconSelect/IconSelect.svelte @@ -1,291 +1,291 @@ - - -
- -
- -
-
-
- {#each alphabet as letter, idx} - switchLetter(letter)}> - {letter} - - {#if idx !== alphabet.length - 1}-{/if} - {/each} -
-
-
- -
- -
-
-
- pageClick(false)}> - - - {pagerText} - pageClick(true)}> - - -
-
-
- {#if pagedIcons.length > 0} -
- {#if !loading} - {#each pagedIcons as icon} -
(value = icon.value)}> -
- -
-
{icon.label}
-
- {/each} - {/if} -
- {:else} -
-
- {`There is no icons for this ${searchTerm ? 'search' : 'page'}`} -
-
- {/if} -
-
- - + + +
+ +
+ +
+
+
+ {#each alphabet as letter, idx} + switchLetter(letter)}> + {letter} + + {#if idx !== alphabet.length - 1}-{/if} + {/each} +
+
+
+ +
+ +
+
+
+ pageClick(false)}> + + + {pagerText} + pageClick(true)}> + + +
+
+
+ {#if pagedIcons.length > 0} +
+ {#if !loading} + {#each pagedIcons as icon} +
(value = icon.value)}> +
+ +
+
{icon.label}
+
+ {/each} + {/if} +
+ {:else} +
+
+ {`There is no icons for this ${searchTerm ? 'search' : 'page'}`} +
+
+ {/if} +
+
+ + diff --git a/packages/builder/src/components/userInterface/ItemTab/Item.svelte b/packages/builder/src/components/userInterface/ItemTab/Item.svelte deleted file mode 100644 index 7d118afe61..0000000000 --- a/packages/builder/src/components/userInterface/ItemTab/Item.svelte +++ /dev/null @@ -1,50 +0,0 @@ - - -
-
-
-
{item.name}
-
-
- - diff --git a/packages/builder/src/components/userInterface/ItemTab/Tab.svelte b/packages/builder/src/components/userInterface/ItemTab/Tab.svelte deleted file mode 100644 index 090fad1dc1..0000000000 --- a/packages/builder/src/components/userInterface/ItemTab/Tab.svelte +++ /dev/null @@ -1,52 +0,0 @@ - - -{#if !list.isCategory} - -{/if} -{#each list.children as item} - {#if !item.showOnPages || item.showOnPages.includes($store.currentPageName)} - handleClick(item)} /> - {/if} -{/each} - - diff --git a/packages/builder/src/components/userInterface/OptionSelect.svelte b/packages/builder/src/components/userInterface/OptionSelect.svelte index aac5c44c07..d9f5964b30 100644 --- a/packages/builder/src/components/userInterface/OptionSelect.svelte +++ b/packages/builder/src/components/userInterface/OptionSelect.svelte @@ -13,6 +13,7 @@ let select let selectMenu let icon + let width = 0 let selectAnchor = null let dimensions = { top: 0, bottom: 0, left: 0 } @@ -91,6 +92,7 @@ "transform-origin": `center ${positionSide}`, [positionSide]: `${dimensions[positionSide]}px`, left: `${dimensions.left.toFixed(0)}px`, + width: `${width}px`, }) $: isOptionsObject = options.every(o => typeof o === "object") @@ -108,6 +110,7 @@
span { color: var(--ink); font-weight: 400; - width: 140px; overflow-x: hidden; + text-overflow: ellipsis; + white-space: nowrap; + font-size: var(--font-size-xs); + flex: 1 1 auto; } .bb-select-anchor > i { @@ -208,7 +212,6 @@ box-sizing: border-box; flex-direction: column; opacity: 0; - width: 160px; z-index: 2; color: var(--ink); font-weight: 400; @@ -237,7 +240,7 @@ padding: 5px 0px; cursor: pointer; padding-left: 10px; - font-size: var(--font-size-s); + font-size: var(--font-size-xs); } li:hover { diff --git a/packages/builder/src/components/userInterface/PageLayout.svelte b/packages/builder/src/components/userInterface/PageLayout.svelte index cebd445ce7..c6ac3b5290 100644 --- a/packages/builder/src/components/userInterface/PageLayout.svelte +++ b/packages/builder/src/components/userInterface/PageLayout.svelte @@ -1,21 +1,9 @@ -
- - - - - Master Screen -
+ {#if $store.currentPreviewItem.name === _layout.title && _layout.component.props._children} {/if} - - diff --git a/packages/builder/src/components/userInterface/PagesList.svelte b/packages/builder/src/components/userInterface/PagesList.svelte index df8bdf7d99..51fcce3889 100644 --- a/packages/builder/src/components/userInterface/PagesList.svelte +++ b/packages/builder/src/components/userInterface/PagesList.svelte @@ -43,24 +43,23 @@ button { cursor: pointer; - padding: 0px 16px; - height: 36px; + padding: 0 var(--spacing-m); + height: 32px; text-align: center; background: #ffffff; color: var(--grey-7); border-radius: 5px; - font-family: inter; - font-size: 14px; - font-weight: 400; + font-size: var(--font-size-xs); + font-weight: 500; transition: all 0.3s; text-rendering: optimizeLegibility; border: none !important; - transition: 0.2s; outline: none; + font-family: var(--font-sans); } .active { - background: var(--grey-3); + background: var(--grey-2); color: var(--ink); } diff --git a/packages/builder/src/components/userInterface/PropertyControl.svelte b/packages/builder/src/components/userInterface/PropertyControl.svelte index 8d21e6fc82..823dcf6183 100644 --- a/packages/builder/src/components/userInterface/PropertyControl.svelte +++ b/packages/builder/src/components/userInterface/PropertyControl.svelte @@ -119,16 +119,14 @@ position: relative; display: flex; flex-flow: row; - margin: 8px 0; align-items: center; } - .label { display: flex; align-items: center; font-size: 12px; font-weight: 400; - flex: 0 0 100px; + flex: 0 0 80px; text-align: left; color: var(--ink); margin-right: auto; @@ -149,7 +147,7 @@ height: 90%; width: 2rem; background: var(--grey-2); - right: 10px; + right: 4px; --spacing-s: 0; border-left: 0.5px solid var(--grey-3); outline-color: var(--blue); diff --git a/packages/builder/src/components/userInterface/PropertyGroup.svelte b/packages/builder/src/components/userInterface/PropertyGroup.svelte index 0da68c51d0..2fb304f5c8 100644 --- a/packages/builder/src/components/userInterface/PropertyGroup.svelte +++ b/packages/builder/src/components/userInterface/PropertyGroup.svelte @@ -13,14 +13,26 @@ $: style = componentInstance["_styles"][styleCategory] || {} - - {#each properties as props} - onStyleChanged(styleCategory, key, value)} - props={{ ...excludeProps(props, ['control', 'label']) }} /> - {/each} + +
+ {#each properties as props} + onStyleChanged(styleCategory, key, value)} + props={{ ...excludeProps(props, ['control', 'label']) }} /> + {/each} +
+ + diff --git a/packages/builder/src/components/userInterface/PropertyPanelControls/Input.svelte b/packages/builder/src/components/userInterface/PropertyPanelControls/Input.svelte index 1721c1bbb2..3abdb3ecd3 100644 --- a/packages/builder/src/components/userInterface/PropertyPanelControls/Input.svelte +++ b/packages/builder/src/components/userInterface/PropertyPanelControls/Input.svelte @@ -8,4 +8,4 @@ export let name, value, placeholder, type - + diff --git a/packages/builder/src/components/userInterface/ScreenDropdownMenu.svelte b/packages/builder/src/components/userInterface/ScreenDropdownMenu.svelte index 7ae8bbf432..75e2483f31 100644 --- a/packages/builder/src/components/userInterface/ScreenDropdownMenu.svelte +++ b/packages/builder/src/components/userInterface/ScreenDropdownMenu.svelte @@ -2,9 +2,8 @@ import { goto } from "@sveltech/routify" import { store } from "builderStore" import ConfirmDialog from "components/common/ConfirmDialog.svelte" - import api from "builderStore/api" - import Portal from "svelte-portal" import { DropdownMenu } from "@budibase/bbui" + import { DropdownContainer, DropdownItem } from "components/common/Dropdowns" export let screen @@ -12,10 +11,6 @@ let dropdown let anchor - const hideDropdown = () => { - dropdown.hide() - } - const deleteScreen = () => { store.deleteScreens(screen, $store.currentPageName) // update the page if required @@ -29,79 +24,27 @@ } -
{}}> +
dropdown.show()}>
-
    -
  • confirmDeleteDialog.show()}> - - Delete -
  • -
+ + confirmDeleteDialog.show()} /> +
- + + +
+ + + {/each} + +
+ + diff --git a/packages/builder/src/components/userInterface/SettingsView.svelte b/packages/builder/src/components/userInterface/SettingsView.svelte index d821f1f2e2..2aacbd261b 100644 --- a/packages/builder/src/components/userInterface/SettingsView.svelte +++ b/packages/builder/src/components/userInterface/SettingsView.svelte @@ -85,53 +85,65 @@ } -{#if screenOrPageInstance} - {#each screenOrPageDefinition as def} - - {/each} -{/if} - -{#if displayNameField} - - {#if duplicateName} - Name must be unique - {/if} -{/if} - -{#if panelDefinition && panelDefinition.length > 0} - {#each panelDefinition as definition} - {#if canRenderControl(definition.key, definition.dependsOn)} +
+ {#if screenOrPageInstance} + {#each screenOrPageDefinition as def} + bindable={false} + control={def.control} + label={def.label} + key={def.key} + value={screenOrPageInstance[def.key]} + onChange={onScreenPropChange} + props={{ ...excludeProps(def, ['control', 'label']) }} /> + {/each} + {/if} + + {#if displayNameField} + + {#if duplicateName} + Name must be unique {/if} - {/each} -{:else} -
This component does not have any settings.
-{/if} + {/if} + + {#if panelDefinition && panelDefinition.length > 0} + {#each panelDefinition as definition} + {#if canRenderControl(definition.key, definition.dependsOn)} + + {/if} + {/each} + {:else} +
+ This component doesn't have any additional settings. +
+ {/if} +
+ + + + + + + + diff --git a/packages/builder/src/components/userInterface/UserInterfaceRoot.svelte b/packages/builder/src/components/userInterface/UserInterfaceRoot.svelte deleted file mode 100644 index 0bf8095e41..0000000000 --- a/packages/builder/src/components/userInterface/UserInterfaceRoot.svelte +++ /dev/null @@ -1,193 +0,0 @@ - - -
-
-
- - -
- -
- - -
-
-
- -
- {#if $store.currentFrontEndType === 'screen' || $store.currentFrontEndType === 'page'} -
- -
- {/if} -
- - - - - - - - diff --git a/packages/builder/src/components/userInterface/pagesParsing/searchComponents.js b/packages/builder/src/components/userInterface/pagesParsing/searchComponents.js index 7ac0dd20ba..9979d4dcc6 100644 --- a/packages/builder/src/components/userInterface/pagesParsing/searchComponents.js +++ b/packages/builder/src/components/userInterface/pagesParsing/searchComponents.js @@ -1,5 +1,5 @@ import { isUndefined, filter, some, includes } from "lodash/fp" -import { pipe } from "components/common/core" +import { pipe } from "../../../helpers" const normalString = s => (s || "").trim().toLowerCase() diff --git a/packages/builder/src/components/userInterface/pagesParsing/splitRootComponentName.js b/packages/builder/src/components/userInterface/pagesParsing/splitRootComponentName.js index dffec1c652..1776ddf230 100644 --- a/packages/builder/src/components/userInterface/pagesParsing/splitRootComponentName.js +++ b/packages/builder/src/components/userInterface/pagesParsing/splitRootComponentName.js @@ -1,5 +1,5 @@ import { split, last } from "lodash/fp" -import { pipe } from "components/common/core" +import { pipe } from "../../../helpers" export const splitName = fullname => { const componentName = pipe(fullname, [split("/"), last]) diff --git a/packages/builder/src/components/userInterface/temporaryPanelStructure.js b/packages/builder/src/components/userInterface/temporaryPanelStructure.js index db1079b8ee..1c4bc632a6 100644 --- a/packages/builder/src/components/userInterface/temporaryPanelStructure.js +++ b/packages/builder/src/components/userInterface/temporaryPanelStructure.js @@ -20,118 +20,154 @@ import { all } from "./propertyCategories.js" export default { categories: [ { - name: "Basic", + _component: "@budibase/standard-components/container", + name: "Container", + description: "This component contains things within itself", + icon: "ri-layout-column-line", + commonProps: {}, + children: [], + properties: { + design: { ...all }, + settings: [ + { + key: "type", + label: "Type", + control: OptionSelect, + options: [ + "article", + "aside", + "details", + "div", + "figure", + "figcaption", + "footer", + "header", + "main", + "mark", + "nav", + "paragraph", + "summary", + ], + }, + ], + }, + }, + { + name: "Grid", + _component: "@budibase/standard-components/datagrid", + description: + "a datagrid component with functionality to add, remove and edit rows.", + icon: "ri-grid-line", + properties: { + design: { ...all }, + settings: [ + { + label: "Source", + key: "datasource", + control: TableViewSelect, + }, + { + label: "Detail URL", + key: "detailUrl", + control: DetailScreenSelect, + }, + { + label: "Editable", + key: "editable", + valueKey: "checked", + control: Checkbox, + }, + { + label: "Theme", + key: "theme", + control: OptionSelect, + options: [ + "alpine", + "alpine-dark", + "balham", + "balham-dark", + "material", + ], + placeholder: "alpine", + }, + { + label: "Height", + key: "height", + defaultValue: "500", + control: Input, + }, + { + label: "Pagination", + key: "pagination", + valueKey: "checked", + control: Checkbox, + }, + ], + }, + children: [], + }, + { + name: "Repeater", + _component: "@budibase/standard-components/list", + description: "Renders all children once per row, of a given table", + icon: "ri-list-check-2", + properties: { + design: { ...all }, + settings: [ + { + label: "Data", + key: "datasource", + control: TableViewSelect, + }, + ], + }, + children: [], + }, + { + _component: "@budibase/standard-components/button", + name: "Button", + description: "A basic html button that is ready for styling", + icon: "ri-share-box-line", + children: [], + properties: { + design: { + ...all, + }, + settings: [ + { label: "Text", key: "text", control: Input }, + { + label: "Disabled", + key: "disabled", + valueKey: "checked", + control: Checkbox, + }, + { label: "On Click", key: "onClick", control: Event }, + ], + }, + }, + { + name: "Form", + icon: "ri-file-edit-line", isCategory: true, children: [ { - _component: "@budibase/standard-components/container", - name: "Container", - description: "This component contains things within itself", - icon: "ri-layout-row-line", - commonProps: {}, - children: [], + _component: "@budibase/standard-components/dataform", + name: "Form Basic", + icon: "ri-file-edit-line", properties: { design: { ...all }, - settings: [ - { - key: "type", - label: "Type", - control: OptionSelect, - options: [ - "article", - "aside", - "details", - "div", - "figure", - "figcaption", - "footer", - "header", - "main", - "mark", - "nav", - "paragraph", - "summary", - ], - }, - ], + settings: [], }, }, { - _component: "@budibase/standard-components/embed", - icon: "ri-code-line", - name: "Embed", - description: "Embed content from 3rd party sources", + _component: "@budibase/standard-components/dataformwide", + name: "Form Wide", + icon: "ri-file-edit-line", properties: { - design: { - ...all, - }, - settings: [{ label: "Embed", key: "embed", control: Input }], + design: { ...all }, + settings: [], }, }, - { - name: "Text", - description: "This is a simple text component", - icon: "ri-t-box-line", - commonProps: {}, - children: [ - { - _component: "@budibase/standard-components/heading", - name: "Headline", - description: "A component for displaying heading text", - icon: "ri-heading", - properties: { - design: { ...all }, - settings: [ - { - key: "text", - label: "Text", - control: Input, - }, - { - key: "type", - label: "Type", - control: OptionSelect, - options: ["h1", "h2", "h3", "h4", "h5", "h6"], - }, - ], - }, - }, - { - _component: "@budibase/standard-components/text", - name: "Paragraph", - description: "A component for displaying paragraph text.", - icon: "ri-paragraph", - properties: { - design: { ...all }, - settings: [ - { - label: "Text", - key: "text", - control: Input, - }, - { - label: "Type", - key: "type", - control: OptionSelect, - options: [ - "none", - "bold", - "strong", - "italic", - "emphasis", - "mark", - "small", - "del", - "ins", - "sub", - "sup", - ], - }, - ], - }, - }, - ], - }, { _component: "@budibase/standard-components/input", name: "Textfield", @@ -152,24 +188,777 @@ export default { }, }, { - _component: "@budibase/standard-components/button", - name: "Button", - description: "A basic html button that is ready for styling", - icon: "ri-share-box-line", + _component: "@budibase/standard-components/datepicker", + name: "Date Picker", + description: "A basic date picker component", + icon: "ri-calendar-line", children: [], properties: { - design: { - ...all, - }, + design: { ...all }, + settings: [ + { label: "Placeholder", key: "placeholder", control: Input }, + ], + }, + }, + ], + }, + { + name: "Card", + icon: "ri-archive-drawer-line", + isCategory: true, + children: [ + { + _component: "@budibase/standard-components/stackedlist", + name: "Stacked List", + icon: "ri-archive-drawer-line", + description: + "A basic card component that can contain content and actions.", + children: [], + properties: { + design: { ...all }, settings: [ - { label: "Text", key: "text", control: Input }, { - label: "Disabled", - key: "disabled", + label: "Image", + key: "imageUrl", + control: Input, + placeholder: "{{{context.Image}}}", + }, + { + label: "Heading", + key: "heading", + control: Input, + placeholder: "{{context.Heading}}", + }, + { + label: "Text 1", + key: "text1", + control: Input, + placeholder: "{{context.Text 1}}", + }, + { + label: "Text 2", + key: "text2", + control: Input, + placeholder: "{{context.Text 2}}", + }, + { + label: "Text 3", + key: "text3", + control: Input, + placeholder: "{{context.Text 3}}", + }, + { + label: "Link URL", + key: "destinationUrl", + control: ScreenSelect, + placeholder: "/table/_id", + }, + ], + }, + }, + { + _component: "@budibase/standard-components/card", + name: "Vertical", + description: + "A basic card component that can contain content and actions.", + icon: "ri-layout-column-line", + children: [], + properties: { + design: { ...all }, + settings: [ + { + label: "Image", + key: "imageUrl", + control: Input, + placeholder: "Image", + }, + { + label: "Heading", + key: "heading", + control: Input, + placeholder: "Heading", + }, + { + label: "Description", + key: "description", + control: Input, + placeholder: "Description", + }, + { + label: "Link Text", + key: "linkText", + control: Input, + placeholder: "Link Text", + }, + { + label: "Link Url", + key: "linkUrl", + control: ScreenSelect, + placeholder: "Link URL", + }, + { + label: "Link Color", + key: "color", + control: Input, + placeholder: "Link Color", + }, + { + label: "Hover Color", + key: "linkHoverColor", + control: Input, + placeholder: "Hover Color", + }, + { + label: "Image Height", + key: "imageHeight", + control: OptionSelect, + options: ["12rem", "16rem", "20rem", "24rem"], + placeholder: "Image Height", + }, + { + label: "Card Width", + key: "cardWidth", + control: OptionSelect, + options: ["16rem", "20rem", "24rem"], + placeholder: "Card Width", + }, + ], + }, + }, + { + _component: "@budibase/standard-components/cardhorizontal", + name: "Horizontal", + description: + "A basic card component that can contain content and actions.", + icon: "ri-layout-row-line", + children: [], + properties: { + design: { ...all }, + settings: [ + { + label: "Image", + key: "imageUrl", + control: Input, + placeholder: "Image", + }, + { + label: "Heading", + key: "heading", + control: Input, + placeholder: "Heading", + }, + { + label: "Description", + key: "description", + control: Input, + placeholder: "Description", + }, + { + label: "Subtext", + key: "subtext", + control: Input, + placeholder: "Subtext", + }, + { + label: "Link Text", + key: "linkText", + control: Input, + placeholder: "Link Text", + }, + { + label: "Link Url", + key: "linkUrl", + control: ScreenSelect, + placeholder: "Link URL", + }, + { + label: "Link Color", + key: "color", + control: Input, + placeholder: "Link Color", + }, + { + label: "Hover Color", + key: "linkHoverColor", + control: Input, + placeholder: "Hover Color", + }, + { + label: "Card Width", + key: "cardWidth", + control: OptionSelect, + options: [ + "24rem", + "28rem", + "32rem", + "40rem", + "48rem", + "60rem", + "100%", + ], + placeholder: "Card Height", + }, + { + label: "Image Width", + key: "imageWidth", + control: OptionSelect, + options: ["8rem", "12rem", "16rem"], + placeholder: "Image Width", + }, + { + label: "Image Height", + key: "imageHeight", + control: OptionSelect, + options: ["8rem", "12rem", "16rem", "auto"], + placeholder: "Image Height", + }, + ], + }, + }, + ], + }, + { + name: "Chart", + icon: "ri-bar-chart-2-line", + isCategory: true, + children: [ + { + name: "Donut", + _component: "@budibase/standard-components/donut", + description: "Donut chart", + icon: "ri-pie-chart-fill", + properties: { + settings: [ + { + label: "Data", + key: "datasource", + control: TableViewSelect, + }, + { + label: "Name Field", + key: "nameKey", + dependsOn: "datasource", + control: TableViewFieldSelect, + }, + { + label: "Value Field", + key: "valueKey", + dependsOn: "datasource", + control: TableViewFieldSelect, + }, + { + label: "Animate Chart", + key: "isAnimated", valueKey: "checked", control: Checkbox, }, - { label: "onClick", key: "onClick", control: Event }, + { + label: "Hover Highlight", + key: "hasHoverAnimation", + valueKey: "checked", + control: Checkbox, + }, + { + label: "Keep Last Hover", + key: "hasLastHoverSliceHighlighted", + valueKey: "checked", + control: Checkbox, + }, + { + label: "Colors", + key: "color", + control: OptionSelect, + options: [ + "britecharts", + "blueGreen", + "green", + "grey", + "orange", + "pink", + "purple", + "red", + "teal", + "yellow", + ], + }, + { + label: "External Radius", + key: "externalRadius", + control: Input, + }, + { + label: "Internal Radius", + key: "internalRadius", + control: Input, + }, + { + label: "Radius Offset", + key: "radiusHoverOffset ", + control: Input, + }, + { + label: "Show Legend", + key: "useLegend ", + valueKey: "checked", + control: Checkbox, + }, + { + label: "Horizontal Legend", + key: "horizontalLegend", + valueKey: "checked", + control: Checkbox, + }, + { + label: "Legend Width", + key: "legendWidth", + control: Input, + }, + ], + }, + }, + { + name: "Bar", + _component: "@budibase/standard-components/bar", + description: "Bar chart", + icon: "ri-bar-chart-fill", + properties: { + settings: [ + { + label: "Data", + key: "datasource", + control: TableViewSelect, + }, + { + label: "Name Label", + key: "nameLabel", + dependsOn: "datasource", + control: TableViewFieldSelect, + }, + { + label: "Value Label", + key: "valueLabel", + dependsOn: "datasource", + control: TableViewFieldSelect, + }, + { + label: "Y Axis Label", + key: "yAxisLabel", + control: Input, + }, + { + label: "X Axis Label", + key: "xAxisLabel", + control: Input, + }, + { + label: "X Axis Label Offset", + key: "xAxisLabelOffset", + control: Input, + }, + { + label: "Y Axis Label Offset", + key: "yAxisLabelOffset", + control: Input, + }, + { + label: "Enable Labels", + key: "enableLabels", + control: Checkbox, + valueKey: "checked", + }, + { + label: "Colors", + key: "color", + control: OptionSelect, + options: [ + { label: "Normal", value: "britecharts" }, + { label: "Blue Green", value: "blueGreen" }, + { label: "Green", value: "green" }, + { label: "Grey", value: "grey" }, + { label: "Orange", value: "orange" }, + { label: "Pink", value: "pink" }, + { label: "Purple", value: "purple" }, + { label: "Red", value: "red" }, + { label: "Teal", value: "teal" }, + { label: "Yellow", value: "yellow" }, + ], + }, + { + label: "Gradients", + key: "gradient", + control: OptionSelect, + options: [ + { value: "", label: "None" }, + { value: "bluePurple", label: "Blue Purple" }, + { value: "greenBlue", label: "Green Blue" }, + { value: "orangePink", label: "Orange Pink" }, + ], + }, + { + label: "Highlight Single Bar", + key: "hasSingleBarHighlight", + control: Checkbox, + valueKey: "checked", + }, + { + label: "Width", + key: "width", + control: Input, + }, + { + label: "Height", + key: "height", + control: Input, + }, + { + label: "Animate", + key: "isAnimate", + control: Checkbox, + valueKey: "checked", + }, + { + label: "Horizontal", + key: "isHorizontal", + control: Checkbox, + valueKey: "checked", + }, + { + label: "Label Number Format", + key: "labelsNumberFormat", + control: Input, + }, + ], + }, + }, + { + name: "Grouped Bar", + _component: "@budibase/standard-components/groupedbar", + description: "Groupedbar chart", + icon: "ri-bar-chart-grouped-fill", + properties: { + settings: [ + { + label: "Data", + key: "datasource", + control: TableViewSelect, + }, + { + label: "Name Label", + key: "nameLabel", + dependsOn: "datasource", + control: TableViewFieldSelect, + }, + { + label: "Group Label", + key: "groupLabel", + dependsOn: "datasource", + control: TableViewFieldSelect, + }, + { + label: "Value Label", + key: "valueLabel", + dependsOn: "datasource", + control: TableViewFieldSelect, + }, + { + label: "Color", + key: "color", + control: OptionSelect, + options: [ + "britecharts", + "blueGreen", + "green", + "grey", + "orange", + "pink", + "purple", + "red", + "teal", + "yellow", + ], + }, + { + label: "Height", + key: "height", + control: Input, + }, + { + label: "Width", + key: "width", + control: Input, + }, + { + label: "Aspect Ratio", + key: "aspectRatio", + control: Input, + }, + { + label: "Grid", + key: "grid", + control: OptionSelect, + options: ["vertical", "horizontal", "full"], + }, + { + label: "Value Label", + key: "valueLabel", + control: Input, + }, + { + label: "Y Ticks", + key: "yTicks", + control: Input, + }, + { + label: "Y Tick Text Offset", + key: "yTickTextOffset", + control: Input, + }, + { + label: "Is Animated", + key: "isAnimated", + valueKey: "checked", + control: Checkbox, + }, + { + label: "Is Horizontal", + key: "isHorizontal", + valueKey: "checked", + control: Checkbox, + }, + { + label: "Tooltip Title", + key: "tooltipTitle", + control: Input, + }, + ], + }, + }, + { + name: "Line", + _component: "@budibase/standard-components/line", + description: "Line chart", + icon: "ri-line-chart-line", + properties: { + settings: [ + { + label: "Data", + key: "datasource", + control: TableViewSelect, + }, + { + label: "Value Label", + key: "valueLabel", + dependsOn: "datasource", + control: TableViewFieldSelect, + }, + { + label: "Topic Label", + key: "topicLabel", + dependsOn: "datasource", + control: TableViewFieldSelect, + }, + { + label: "Date Label", + key: "dateLabel", + dependsOn: "datasource", + control: TableViewFieldSelect, + }, + { + label: "Colors", + key: "color", + control: OptionSelect, + options: [ + "britecharts", + "blueGreen", + "green", + "grey", + "orange", + "pink", + "purple", + "red", + "teal", + "yellow", + ], + }, + { + label: "Gradients", + key: "lineGradient", + control: OptionSelect, + options: [ + { value: "", label: "None" }, + { value: "bluePurple", label: "Blue Purple" }, + { value: "greenBlue", label: "Green Blue" }, + { value: "orangePink", label: "Orange Pink" }, + ], + }, + { + label: "Line Curve", + key: "lineCurve", + control: OptionSelect, + options: [ + "linear", + "basis", + "natural", + "monotoneX", + "monotoneY", + "step", + "stepAfter", + "stepBefore", + "cardinal", + "catmullRom", + ], + }, + { + label: "X Axis Value Type", + key: "xAxisValueType", + control: OptionSelect, + options: ["date", "number"], + }, + { + label: "Grid", + key: "grid", + control: OptionSelect, + options: ["vertical", "horizontal", "full"], + }, + { + label: "X Axis Label", + key: "xAxisLabel", + control: Input, + }, + { + label: "Y Axis Label", + key: "yAxisLabel", + control: Input, + }, + { + label: "Show All Datapoints", + key: "shouldShowAllDataPoints", + valueKey: "checked", + control: Checkbox, + }, + { + label: "Width", + key: "width", + control: Input, + }, + { + label: "Height", + key: "height", + control: Input, + }, + { + label: "Is Animated", + key: "isAnimated", + control: Checkbox, + valueKey: "checked", + }, + { + label: "Locale", + key: "locale", + control: OptionSelect, + options: ["en-GB", "en-US"], + }, + { + label: "X Axis Value Type", + key: "xAxisValueType", + control: OptionSelect, + options: ["date", "numeric"], + }, + { + label: "X Axis Format", + key: "xAxisFormat", + control: OptionSelect, + options: [ + "day-month", + "minute-hour", + "hour-daymonth", + "month-year", + "custom", + ], + }, + { + label: "X Axis Custom Format", + key: "xAxisCustomFormat", + control: Input, + }, + { + label: "Tooltip Title", + key: "tooltipTitle", + control: Input, + }, + { + label: "X Ticks", + key: "xTicks", + control: Input, + }, + { + label: "Y Ticks", + key: "yTicks", + control: Input, + }, + ], + }, + }, + ], + }, + { + name: "Elements", + icon: "ri-paragraph", + isCategory: true, + children: [ + { + _component: "@budibase/standard-components/heading", + name: "Headline", + icon: "ri-heading", + description: "A component for displaying heading text", + properties: { + design: { ...all }, + settings: [ + { + key: "text", + label: "Text", + control: Input, + }, + { + key: "type", + label: "Type", + control: OptionSelect, + options: ["h1", "h2", "h3", "h4", "h5", "h6"], + }, + ], + }, + }, + { + _component: "@budibase/standard-components/text", + name: "Paragraph", + description: "A component for displaying paragraph text.", + icon: "ri-paragraph", + properties: { + design: { ...all }, + settings: [ + { + label: "Text", + key: "text", + control: Input, + }, + { + label: "Type", + key: "type", + control: OptionSelect, + options: [ + "none", + "bold", + "strong", + "italic", + "emphasis", + "mark", + "small", + "del", + "ins", + "sub", + "sup", + ], + }, ], }, }, @@ -184,6 +973,26 @@ export default { settings: [{ label: "URL", key: "url", control: Input }], }, }, + { + _component: "@budibase/standard-components/link", + name: "Link", + description: "A basic link component for internal and external links", + icon: "ri-link", + children: [], + properties: { + design: { ...all }, + settings: [ + { label: "Text", key: "text", control: Input }, + { label: "Url", key: "url", control: ScreenSelect }, + { + label: "New Tab", + key: "openInNewTab", + valueKey: "checked", + control: Checkbox, + }, + ], + }, + }, { _component: "@budibase/standard-components/icon", name: "Icon", @@ -220,880 +1029,22 @@ export default { }, }, { - _component: "@budibase/standard-components/link", - name: "Link", - description: "A basic link component for internal and external links", - icon: "ri-link", - children: [], + _component: "@budibase/standard-components/embed", + icon: "ri-code-line", + name: "Embed", + description: "Embed content from 3rd party sources", properties: { - design: { ...all }, - settings: [ - { label: "Text", key: "text", control: Input }, - { label: "Url", key: "url", control: ScreenSelect }, - { - label: "Open New Tab", - key: "openInNewTab", - valueKey: "checked", - control: Checkbox, - }, - ], - }, - }, - { - _component: "@budibase/standard-components/datepicker", - name: "Date Picker", - description: "A basic date picker component", - icon: "ri-calendar-line", - children: [], - properties: { - design: { ...all }, - settings: [ - { label: "Placeholder", key: "placeholder", control: Input }, - ], + design: { + ...all, + }, + settings: [{ label: "Embed", key: "embed", control: Input }], }, }, ], }, { - name: "Blocks", - isCategory: true, - children: [ - { - name: "List", - _component: "@budibase/standard-components/list", - description: "Renders all children once per row, of a given table", - icon: "ri-file-list-line", - properties: { - design: { ...all }, - settings: [ - { - label: "Data", - key: "datasource", - control: TableViewSelect, - }, - ], - }, - children: [], - }, - { - name: "Grid", - _component: "@budibase/standard-components/datagrid", - description: - "a datagrid component with functionality to add, remove and edit rows.", - icon: "ri-file-list-line", - properties: { - design: { ...all }, - settings: [ - { - label: "Source", - key: "datasource", - control: TableViewSelect, - }, - { - label: "Detail URL", - key: "detailUrl", - control: DetailScreenSelect, - }, - { - label: "Editable", - key: "editable", - valueKey: "checked", - control: Checkbox, - }, - { - label: "Theme", - key: "theme", - control: OptionSelect, - options: [ - "alpine", - "alpine-dark", - "balham", - "balham-dark", - "material", - ], - placeholder: "alpine", - }, - { - label: "Height", - key: "height", - defaultValue: "500", - control: Input, - }, - { - label: "Pagination", - key: "pagination", - valueKey: "checked", - control: Checkbox, - }, - ], - }, - children: [], - }, - { - _component: "@budibase/standard-components/stackedlist", - name: "Stacked List", - description: - "A basic card component that can contain content and actions.", - icon: "ri-archive-drawer-line", - children: [], - properties: { - design: { ...all }, - settings: [ - { - label: "Image", - key: "imageUrl", - control: Input, - placeholder: "{{{context.Image}}}", - }, - { - label: "Heading", - key: "heading", - control: Input, - placeholder: "{{context.Heading}}", - }, - { - label: "Text 1", - key: "text1", - control: Input, - placeholder: "{{context.Text 1}}", - }, - { - label: "Text 2", - key: "text2", - control: Input, - placeholder: "{{context.Text 2}}", - }, - { - label: "Text 3", - key: "text3", - control: Input, - placeholder: "{{context.Text 3}}", - }, - { - label: "destinationUrl", - key: "destinationUrl", - control: ScreenSelect, - placeholder: "/table/_id", - }, - ], - }, - }, - { - name: "Card", - description: "Card components", - icon: "ri-layout-bottom-line", - commonProps: {}, - children: [ - { - _component: "@budibase/standard-components/card", - name: "Vertical", - description: - "A basic card component that can contain content and actions.", - icon: "ri-layout-column-line", - children: [], - properties: { - design: { ...all }, - settings: [ - { - label: "Image", - key: "imageUrl", - control: Input, - placeholder: "Image", - }, - { - label: "Heading", - key: "heading", - control: Input, - placeholder: "Heading", - }, - { - label: "Description", - key: "description", - control: Input, - placeholder: "Description", - }, - { - label: "Link Text", - key: "linkText", - control: Input, - placeholder: "Link Text", - }, - { - label: "Link Url", - key: "linkUrl", - control: ScreenSelect, - placeholder: "Link URL", - }, - { - label: "Link Color", - key: "color", - control: Input, - placeholder: "Link Color", - }, - { - label: "Hover Color", - key: "linkHoverColor", - control: Input, - placeholder: "Hover Color", - }, - { - label: "Image Height", - key: "imageHeight", - control: OptionSelect, - options: ["12rem", "16rem", "20rem", "24rem"], - placeholder: "Image Height", - }, - { - label: "Card Width", - key: "cardWidth", - control: OptionSelect, - options: ["16rem", "20rem", "24rem"], - placeholder: "Card Width", - }, - ], - }, - }, - { - _component: "@budibase/standard-components/cardhorizontal", - name: "Horizontal", - description: - "A basic card component that can contain content and actions.", - icon: "ri-layout-row-line", - children: [], - properties: { - design: { ...all }, - settings: [ - { - label: "Image", - key: "imageUrl", - control: Input, - placeholder: "Image", - }, - { - label: "Heading", - key: "heading", - control: Input, - placeholder: "Heading", - }, - { - label: "Description", - key: "description", - control: Input, - placeholder: "Description", - }, - { - label: "Subtext", - key: "subtext", - control: Input, - placeholder: "Subtext", - }, - { - label: "Link Text", - key: "linkText", - control: Input, - placeholder: "Link Text", - }, - { - label: "Link Url", - key: "linkUrl", - control: ScreenSelect, - placeholder: "Link URL", - }, - { - label: "Link Color", - key: "color", - control: Input, - placeholder: "Link Color", - }, - { - label: "Hover Color", - key: "linkHoverColor", - control: Input, - placeholder: "Hover Color", - }, - { - label: "Card Width", - key: "cardWidth", - control: OptionSelect, - options: [ - "24rem", - "28rem", - "32rem", - "40rem", - "48rem", - "60rem", - "100%", - ], - placeholder: "Card Height", - }, - { - label: "Image Width", - key: "imageWidth", - control: OptionSelect, - options: ["8rem", "12rem", "16rem"], - placeholder: "Image Width", - }, - { - label: "Image Height", - key: "imageHeight", - control: OptionSelect, - options: ["8rem", "12rem", "16rem", "auto"], - placeholder: "Image Height", - }, - ], - }, - }, - ], - }, - { - name: "Form", - description: "A component that generates a form from your data.", - icon: "ri-file-edit-line", - commonProps: {}, - children: [ - { - _component: "@budibase/standard-components/dataform", - name: "Form Basic", - icon: "ri-file-edit-line", - properties: { - design: { ...all }, - settings: [], - }, - }, - { - _component: "@budibase/standard-components/dataformwide", - name: "Form Wide", - icon: "ri-file-edit-line", - properties: { - design: { ...all }, - settings: [], - }, - }, - ], - }, - { - name: "Chart", - description: "Shiny chart", - icon: "ri-bar-chart-fill", - children: [ - { - name: "Donut", - _component: "@budibase/standard-components/donut", - description: "Donut chart", - icon: "ri-pie-chart-fill", - properties: { - settings: [ - { - label: "Data", - key: "datasource", - control: TableViewSelect, - }, - { - label: "Name Field", - key: "nameKey", - dependsOn: "datasource", - control: TableViewFieldSelect, - }, - { - label: "Value Field", - key: "valueKey", - dependsOn: "datasource", - control: TableViewFieldSelect, - }, - { - label: "Animate Chart", - key: "isAnimated", - valueKey: "checked", - control: Checkbox, - }, - { - label: "Hover Highlight", - key: "hasHoverAnimation", - valueKey: "checked", - control: Checkbox, - }, - { - label: "Keep Last Hover", - key: "hasLastHoverSliceHighlighted", - valueKey: "checked", - control: Checkbox, - }, - { - label: "Colors", - key: "color", - control: OptionSelect, - options: [ - "britecharts", - "blueGreen", - "green", - "grey", - "orange", - "pink", - "purple", - "red", - "teal", - "yellow", - ], - }, - { - label: "External Radius", - key: "externalRadius", - control: Input, - }, - { - label: "Internal Radius", - key: "internalRadius", - control: Input, - }, - { - label: "Radius Offset", - key: "radiusHoverOffset ", - control: Input, - }, - { - label: "Show Legend", - key: "useLegend ", - valueKey: "checked", - control: Checkbox, - }, - { - label: "Horizontal Legend", - key: "horizontalLegend", - valueKey: "checked", - control: Checkbox, - }, - { - label: "Legend Width", - key: "legendWidth", - control: Input, - }, - ], - }, - }, - { - name: "Bar", - _component: "@budibase/standard-components/bar", - description: "Bar chart", - icon: "ri-bar-chart-fill", - properties: { - settings: [ - { - label: "Data", - key: "datasource", - control: TableViewSelect, - }, - { - label: "Name Label", - key: "nameLabel", - dependsOn: "datasource", - control: TableViewFieldSelect, - }, - { - label: "Value Label", - key: "valueLabel", - dependsOn: "datasource", - control: TableViewFieldSelect, - }, - { - label: "Y Axis Label", - key: "yAxisLabel", - control: Input, - }, - { - label: "X Axis Label", - key: "xAxisLabel", - control: Input, - }, - { - label: "X Axis Label Offset", - key: "xAxisLabelOffset", - control: Input, - }, - { - label: "Y Axis Label Offset", - key: "yAxisLabelOffset", - control: Input, - }, - { - label: "Enable Labels", - key: "enableLabels", - control: Checkbox, - valueKey: "checked", - }, - { - label: "Colors", - key: "color", - control: OptionSelect, - options: [ - { label: "Normal", value: "britecharts" }, - { label: "Blue Green", value: "blueGreen" }, - { label: "Green", value: "green" }, - { label: "Grey", value: "grey" }, - { label: "Orange", value: "orange" }, - { label: "Pink", value: "pink" }, - { label: "Purple", value: "purple" }, - { label: "Red", value: "red" }, - { label: "Teal", value: "teal" }, - { label: "Yellow", value: "yellow" }, - ], - }, - { - label: "Gradients", - key: "gradient", - control: OptionSelect, - options: [ - { value: "", label: "None" }, - { value: "bluePurple", label: "Blue Purple" }, - { value: "greenBlue", label: "Green Blue" }, - { value: "orangePink", label: "Orange Pink" }, - ], - }, - { - label: "Highlight Single Bar", - key: "hasSingleBarHighlight", - control: Checkbox, - valueKey: "checked", - }, - { - label: "Width", - key: "width", - control: Input, - }, - { - label: "Height", - key: "height", - control: Input, - }, - { - label: "Animate", - key: "isAnimate", - control: Checkbox, - valueKey: "checked", - }, - { - label: "Horizontal", - key: "isHorizontal", - control: Checkbox, - valueKey: "checked", - }, - { - label: "Label Number Format", - key: "labelsNumberFormat", - control: Input, - }, - ], - }, - }, - { - name: "Groupedbar", - _component: "@budibase/standard-components/groupedbar", - description: "Groupedbar chart", - icon: "ri-bar-chart-grouped-fill", - properties: { - settings: [ - { - label: "Data", - key: "datasource", - control: TableViewSelect, - }, - { - label: "Name Label", - key: "nameLabel", - dependsOn: "datasource", - control: TableViewFieldSelect, - }, - { - label: "Group Label", - key: "groupLabel", - dependsOn: "datasource", - control: TableViewFieldSelect, - }, - { - label: "Value Label", - key: "valueLabel", - dependsOn: "datasource", - control: TableViewFieldSelect, - }, - { - label: "Color", - key: "color", - control: OptionSelect, - options: [ - "britecharts", - "blueGreen", - "green", - "grey", - "orange", - "pink", - "purple", - "red", - "teal", - "yellow", - ], - }, - { - label: "Height", - key: "height", - control: Input, - }, - { - label: "Width", - key: "width", - control: Input, - }, - { - label: "Aspect Ratio", - key: "aspectRatio", - control: Input, - }, - { - label: "Grid", - key: "grid", - control: OptionSelect, - options: ["vertical", "horizontal", "full"], - }, - { - label: "Value Label", - key: "valueLabel", - control: Input, - }, - { - label: "Y Ticks", - key: "yTicks", - control: Input, - }, - { - label: "Y Tick Text Offset", - key: "yTickTextOffset", - control: Input, - }, - { - label: "Is Animated", - key: "isAnimated", - valueKey: "checked", - control: Checkbox, - }, - { - label: "Is Horizontal", - key: "isHorizontal", - valueKey: "checked", - control: Checkbox, - }, - { - label: "Tooltip Title", - key: "tooltipTitle", - control: Input, - }, - ], - }, - }, - { - name: "Line", - _component: "@budibase/standard-components/line", - description: "Line chart", - icon: "ri-line-chart-fill", - properties: { - settings: [ - { - label: "Data", - key: "datasource", - control: TableViewSelect, - }, - { - label: "Value Label", - key: "valueLabel", - dependsOn: "datasource", - control: TableViewFieldSelect, - }, - { - label: "Topic Label", - key: "topicLabel", - dependsOn: "datasource", - control: TableViewFieldSelect, - }, - { - label: "Date Label", - key: "dateLabel", - dependsOn: "datasource", - control: TableViewFieldSelect, - }, - { - label: "Colors", - key: "color", - control: OptionSelect, - options: [ - "britecharts", - "blueGreen", - "green", - "grey", - "orange", - "pink", - "purple", - "red", - "teal", - "yellow", - ], - }, - { - label: "Gradients", - key: "lineGradient", - control: OptionSelect, - options: [ - { value: "", label: "None" }, - { value: "bluePurple", label: "Blue Purple" }, - { value: "greenBlue", label: "Green Blue" }, - { value: "orangePink", label: "Orange Pink" }, - ], - }, - { - label: "Line Curve", - key: "lineCurve", - control: OptionSelect, - options: [ - "linear", - "basis", - "natural", - "monotoneX", - "monotoneY", - "step", - "stepAfter", - "stepBefore", - "cardinal", - "catmullRom", - ], - }, - { - label: "X Axis Value Type", - key: "xAxisValueType", - control: OptionSelect, - options: ["date", "number"], - }, - { - label: "Grid", - key: "grid", - control: OptionSelect, - options: ["vertical", "horizontal", "full"], - }, - { - label: "X Axis Label", - key: "xAxisLabel", - control: Input, - }, - { - label: "Y Axis Label", - key: "yAxisLabel", - control: Input, - }, - { - label: "Show All Datapoints", - key: "shouldShowAllDataPoints", - valueKey: "checked", - control: Checkbox, - }, - { - label: "Width", - key: "width", - control: Input, - }, - { - label: "Height", - key: "height", - control: Input, - }, - { - label: "Is Animated", - key: "isAnimated", - control: Checkbox, - valueKey: "checked", - }, - { - label: "Locale", - key: "locale", - control: OptionSelect, - options: ["en-GB", "en-US"], - }, - { - label: "X Axis Value Type", - key: "xAxisValueType", - control: OptionSelect, - options: ["date", "numeric"], - }, - { - label: "X Axis Format", - key: "xAxisFormat", - control: OptionSelect, - options: [ - "day-month", - "minute-hour", - "hour-daymonth", - "month-year", - "custom", - ], - }, - { - label: "X Axis Custom Format", - key: "xAxisCustomFormat", - control: Input, - }, - { - label: "Tooltip Title", - key: "tooltipTitle", - control: Input, - }, - { - label: "X Ticks", - key: "xTicks", - control: Input, - }, - { - label: "Y Ticks", - key: "yTicks", - control: Input, - }, - ], - }, - }, - ], - }, - // { - // name: "Data List", - // _component: "@budibase/standard-components/datalist", - // description: "Shiny list", - // icon: "ri-file-list-line", - // properties: { - // design: { ...all }, - // settings: [{ label: "Table", key: "table", control: TableSelect }], - // }, - // children: [], - // }, - { - name: "Row Detail", - _component: "@budibase/standard-components/rowdetail", - description: - "Loads a row, using an id from the URL, which can be used with {{ context }}, in children", - icon: "ri-profile-line", - properties: { - design: { ...all }, - settings: [{ label: "Table", key: "table", control: TableSelect }], - }, - children: [], - }, - { - name: "New Row", - _component: "@budibase/standard-components/newrow", - description: - "Sets up a new row for creation, which can be used with {{ context }}, in children", - icon: "ri-profile-line", - properties: { - design: { ...all }, - settings: [{ label: "Table", key: "table", control: TableSelect }], - }, - children: [], - }, - ], - }, - { - name: "Layouts", + name: "Other", + icon: "ri-more-2-line", isCategory: true, children: [ { @@ -1152,6 +1103,30 @@ export default { ], }, }, + { + name: "Row Detail", + _component: "@budibase/standard-components/rowdetail", + description: + "Loads a row, using an id from the URL, which can be used with {{ context }}, in children", + icon: "ri-profile-line", + properties: { + design: { ...all }, + settings: [{ label: "Table", key: "table", control: TableSelect }], + }, + children: [], + }, + { + name: "New Row", + _component: "@budibase/standard-components/newrow", + description: + "Sets up a new row for creation, which can be used with {{ context }}, in children", + icon: "ri-profile-line", + properties: { + design: { ...all }, + settings: [{ label: "Table", key: "table", control: TableSelect }], + }, + children: [], + }, ], }, ], diff --git a/packages/builder/src/helpers.js b/packages/builder/src/helpers.js index 9bfd48a3cd..89c7a0a6aa 100644 --- a/packages/builder/src/helpers.js +++ b/packages/builder/src/helpers.js @@ -1,5 +1,5 @@ -import { last } from "lodash/fp" -import { pipe } from "components/common/core" +import { last, flow } from "lodash/fp" + export const buildStyle = styles => { let str = "" for (let s in styles) { @@ -15,6 +15,8 @@ export const convertCamel = str => { return str.replace(/[A-Z]/g, match => `-${match.toLowerCase()}`) } +export const pipe = (arg, funcs) => flow(funcs)(arg) + export const capitalise = s => s.substring(0, 1).toUpperCase() + s.substring(1) export const get_name = s => (!s ? "" : last(s.split("/"))) diff --git a/packages/builder/src/index.html b/packages/builder/src/index.html index 69deda72ff..7f4339b974 100644 --- a/packages/builder/src/index.html +++ b/packages/builder/src/index.html @@ -15,7 +15,7 @@ - + diff --git a/packages/builder/src/pages/[application]/_reset.svelte b/packages/builder/src/pages/[application]/_reset.svelte index fb2b233e2c..7d0724facd 100644 --- a/packages/builder/src/pages/[application]/_reset.svelte +++ b/packages/builder/src/pages/[application]/_reset.svelte @@ -67,23 +67,27 @@
+
+ + + +
+
+ + + +
- { document.cookie = 'budibase:token=; Path=/; Expires=Thu, 01 Jan 1970 00:00:01 GMT;' window.open(`/${application}`) }}> - - - - - - - + Preview +
@@ -122,7 +126,7 @@ flex: 0 0 auto; height: 60px; background: #fff; - padding: 0px 20px 0 20px; + padding: 0 20px; display: flex; box-sizing: border-box; justify-content: space-between; @@ -168,20 +172,19 @@ font-weight: 500; } - .topnavitemright { + .topnavitemright a { cursor: pointer; color: var(--grey-7); - margin: 0 20px 0 0; - font-weight: 500; - font-size: 1rem; - height: 100%; + margin: 0 12px 0 0; display: flex; - flex: 1; + flex-direction: row; + justify-content: center; align-items: center; - box-sizing: border-box; + height: 24px; + width: 24px; } - .topnavitemright:hover { + .topnavitemright a:hover { color: var(--ink); font-weight: 500; } @@ -207,10 +210,13 @@ text-transform: capitalize; } - .help { - font-size: 24px; + i { + font-size: 18px; color: var(--grey-7); } + i:hover { + color: var(--ink); + } .beta { position: absolute; diff --git a/packages/builder/src/pages/[application]/automate/_layout.svelte b/packages/builder/src/pages/[application]/automate/_layout.svelte index 95cf31e2c8..08d64474f4 100644 --- a/packages/builder/src/pages/[application]/automate/_layout.svelte +++ b/packages/builder/src/pages/[application]/automate/_layout.svelte @@ -1,6 +1,7 @@ @@ -12,28 +13,39 @@
{#if $automationStore.selectedAutomation} - diff --git a/packages/builder/src/pages/[application]/automate/index.svelte b/packages/builder/src/pages/[application]/automate/index.svelte index 36d04677cd..1a15ed48c6 100644 --- a/packages/builder/src/pages/[application]/automate/index.svelte +++ b/packages/builder/src/pages/[application]/automate/index.svelte @@ -1,5 +1,5 @@ diff --git a/packages/builder/src/pages/[application]/data/_layout.svelte b/packages/builder/src/pages/[application]/data/_layout.svelte index 1ac92b84c9..4bfb984c3b 100644 --- a/packages/builder/src/pages/[application]/data/_layout.svelte +++ b/packages/builder/src/pages/[application]/data/_layout.svelte @@ -1,6 +1,4 @@ @@ -18,18 +16,27 @@ .root { height: calc(100vh - 60px); display: grid; - grid-template-columns: 300px minmax(0, 1fr); - background: var(--grey-1); - line-height: 1; + grid-template-columns: 260px minmax(0, 1fr); + background: var(--grey-2); } .content { flex: 1 1 auto; - padding: var(--spacing-xl) 40px; + padding: var(--spacing-l) 40px; overflow-y: auto; + display: flex; + flex-direction: column; + justify-content: flex-start; + align-items: stretch; + gap: var(--spacing-l); } .nav { overflow-y: auto; background: var(--white); - padding: var(--spacing-xl); + padding: var(--spacing-l) var(--spacing-xl); + display: flex; + flex-direction: column; + justify-content: flex-start; + align-items: stretch; + gap: var(--spacing-l); } diff --git a/packages/builder/src/pages/[application]/data/table/[selectedTable]/index.svelte b/packages/builder/src/pages/[application]/data/table/[selectedTable]/index.svelte index b7ee09a4f3..c71edee2df 100644 --- a/packages/builder/src/pages/[application]/data/table/[selectedTable]/index.svelte +++ b/packages/builder/src/pages/[application]/data/table/[selectedTable]/index.svelte @@ -11,7 +11,8 @@ diff --git a/packages/builder/src/pages/[application]/data/table/_layout.svelte b/packages/builder/src/pages/[application]/data/table/_layout.svelte index 3f8b33a095..2eea0be4c2 100644 --- a/packages/builder/src/pages/[application]/data/table/_layout.svelte +++ b/packages/builder/src/pages/[application]/data/table/_layout.svelte @@ -3,10 +3,6 @@ import { goto, leftover } from "@sveltech/routify" import { onMount } from "svelte" - async function selectTable(table) { - backendUiStore.actions.tables.select(table) - } - onMount(async () => { // navigate to first table in list, if not already selected // and this is the final url (i.e. no selectedTable) @@ -20,13 +16,4 @@ }) -
- -
- - + diff --git a/packages/builder/src/pages/[application]/data/table/index.svelte b/packages/builder/src/pages/[application]/data/table/index.svelte index 15ed1e299b..6c661bca59 100644 --- a/packages/builder/src/pages/[application]/data/table/index.svelte +++ b/packages/builder/src/pages/[application]/data/table/index.svelte @@ -27,7 +27,8 @@ diff --git a/packages/builder/src/pages/[application]/data/view/[selectedView]/index.svelte b/packages/builder/src/pages/[application]/data/view/[selectedView]/index.svelte index 3f592e6148..312e799005 100644 --- a/packages/builder/src/pages/[application]/data/view/[selectedView]/index.svelte +++ b/packages/builder/src/pages/[application]/data/view/[selectedView]/index.svelte @@ -11,7 +11,8 @@ diff --git a/packages/builder/src/pages/[application]/design/_layout.svelte b/packages/builder/src/pages/[application]/design/_layout.svelte index 0aae313ccd..c4c67c796e 100644 --- a/packages/builder/src/pages/[application]/design/_layout.svelte +++ b/packages/builder/src/pages/[application]/design/_layout.svelte @@ -1,26 +1,21 @@
-
- - -
- -
-
- -
-
- +
{#if $store.currentPageName && $store.currentPageName.length > 0} - + +
+ +
{/if}
@@ -64,7 +50,6 @@
{/if} -
@@ -72,35 +57,48 @@