From 027819bae08f31d8e8dc10fe5024a8844907df47 Mon Sep 17 00:00:00 2001 From: Michael Shanks Date: Thu, 8 Oct 2020 16:15:12 +0100 Subject: [PATCH] merge from master - including fixes --- .../integration/createAutomation.spec.js | 9 +- .../cypress/integration/createTable.spec.js | 115 ++++--- .../cypress/integration/createView.spec.js | 207 ++++++------ packages/builder/cypress/support/commands.js | 61 ++-- packages/builder/package.json | 5 +- packages/builder/src/App.svelte | 3 +- packages/builder/src/budibase.css | 4 + .../builderStore/fetchBindableProperties.js | 22 +- .../AutomationBuilder.svelte | 6 +- .../flowchart/FlowChart.svelte | 16 + .../AutomationList/AutomationList.svelte | 27 +- .../CreateAutomationModal.svelte | 79 ++--- .../AutomationPanel/AutomationPanel.svelte | 7 +- .../SetupPanel/AutomationBlockSetup.svelte | 11 +- .../SetupPanel/DeleteAutomationModal.svelte | 89 ----- .../ParamInputs/RecordSelector.svelte | 50 ++- .../automation/SetupPanel/SetupPanel.svelte | 37 ++- .../DataTable/AttachmentList.svelte | 0 .../backend/DataTable/ModelDataTable.svelte | 39 +++ .../DataTable/RecordFieldControl.svelte | 34 ++ .../DataTable/RelationshipDataTable.svelte | 40 +++ .../DataTable/Table.svelte} | 187 ++++++----- .../DataTable/TablePagination.svelte | 43 ++- .../backend/DataTable/ViewDataTable.svelte | 44 +++ .../{database => backend}/DataTable/api.js | 0 .../DataTable/buttons/CalculateButton.svelte | 19 ++ .../buttons/CreateColumnButton.svelte} | 11 +- .../DataTable/buttons/CreateRowButton.svelte | 16 + .../DataTable/buttons/CreateViewButton.svelte | 17 + .../DataTable/buttons/ExportButton.svelte | 20 ++ .../DataTable/buttons/FilterButton.svelte | 23 ++ .../DataTable/buttons/GroupByButton.svelte | 19 ++ .../modals/CreateEditRecordModal.svelte | 46 +++ .../popovers/CalculatePopover.svelte} | 44 +-- .../DataTable/popovers/ColumnPopover.svelte} | 56 +++- .../popovers/CreateEditColumnPopover.svelte | 144 ++++++++ .../popovers/CreateViewPopover.svelte} | 48 +-- .../DataTable/popovers/ExportPopover.svelte | 61 ++++ .../DataTable/popovers/FilterPopover.svelte} | 152 ++++----- .../DataTable/popovers/GroupByPopover.svelte} | 55 +--- .../DataTable/popovers/RowPopover.svelte | 94 ++++++ .../ModelNavigator/ListItem.svelte | 15 +- .../ModelNavigator/ModelNavigator.svelte | 36 +- .../ModelNavigator/TableDataImport.svelte | 4 +- .../modals/CreateTableModal.svelte | 48 +++ .../popovers/EditTablePopover.svelte | 141 ++++++++ .../popovers/EditViewPopover.svelte} | 115 +++---- .../components/common/ConfirmDialog.svelte | 54 +-- .../src/components/common/DatePicker.svelte | 4 +- .../src/components/common/ErrorsBox.svelte | 20 +- .../common/LinkedRecordSelector.svelte | 127 +++----- .../Notification/NotificationDisplay.svelte | 28 +- .../src/components/common/NumberBox.svelte | 1 - .../src/components/common/ValuesList.svelte | 32 +- .../database/DataTable/LinkedRecord.svelte | 124 ------- .../database/DataTable/Table.svelte | 149 --------- .../database/DataTable/ViewDataTable.svelte | 55 ---- .../components/database/DataTable/index.js | 1 - .../DataTable/modals/CreateEditColumn.svelte | 161 --------- .../DataTable/modals/CreateEditRecord.svelte | 93 ------ .../DataTable/modals/DeleteRecord.svelte | 61 ---- .../DataTable/modals/DeleteTable.svelte | 64 ---- .../DataTable/modals/DeleteView.svelte | 62 ---- .../modals/RecordFieldControl.svelte | 75 ----- .../database/DataTable/modals/index.js | 2 - .../database/DataTable/popovers/Column.svelte | 35 -- .../DataTable/popovers/EditRow.svelte | 103 ------ .../database/DataTable/popovers/Export.svelte | 71 ---- .../nav/ModelNavigator/CreateTable.svelte | 113 ------- .../nav/ModelNavigator/EditTable.svelte | 137 -------- .../builder/src/components/nav/NavItem.svelte | 20 -- .../src/components/settings/Link.svelte | 32 +- .../src/components/settings/Modal.svelte | 99 ------ .../components/settings/SettingsModal.svelte | 52 +++ .../src/components/settings/UserRow.svelte | 18 +- .../components/settings/tabs/APIKeys.svelte | 24 +- .../settings/tabs/DangerZone.svelte | 55 ++-- .../components/settings/tabs/General.svelte | 7 +- .../src/components/settings/tabs/Users.svelte | 70 +--- .../src/components/start/AppCard.svelte | 45 +-- .../src/components/start/AppList.svelte | 6 +- .../components/start/CreateAppModal.svelte | 22 +- .../src/components/start/Steps/Info.svelte | 21 +- .../src/components/start/Steps/User.svelte | 4 +- .../src/components/start/TemplateList.svelte | 15 +- .../userInterface/BindableInput.svelte | 4 +- .../userInterface/BindingDropdown.svelte | 45 ++- .../ComponentDropdownMenu.svelte | 60 ++-- .../ComponentsHierarchyChildren.svelte | 9 +- .../EventsEditor/EventEditorModal.svelte | 71 +--- .../EventsEditor/EventPropertyControl.svelte | 18 +- .../EventsEditor/EventsEditor.svelte | 46 +-- .../EventsEditor/actions/CreateRecord.svelte | 2 +- .../EventsEditor/actions/NavigateTo.svelte | 2 +- .../EventsEditor/actions/UpdateRecord.svelte | 2 +- .../userInterface/FrontendNavigatePane.svelte | 52 +-- .../GenericBindingPopover.svelte | 26 +- .../userInterface/ModelViewSelect.svelte | 51 ++- ...NewScreen.svelte => NewScreenModal.svelte} | 91 ++---- .../userInterface/PropertyControl.svelte | 16 +- .../userInterface/PropertyGroup.svelte | 2 - .../userInterface/ScreenDropdownMenu.svelte | 81 ++--- .../userInterface/UserInterfaceRoot.svelte | 29 +- .../builder/src/constants/backend/index.js | 39 +-- .../src/pages/[application]/_reset.svelte | 94 +++--- .../[application]/automate/_layout.svelte | 2 +- .../[application]/backend/_layout.svelte | 16 +- .../model/[selectedModel]/index.svelte | 14 +- .../[selectedField]/index.svelte | 9 + .../[selectedRecord]/index.svelte | 6 + .../[selectedModel]/relationship/index.svelte | 6 + .../backend/model/_layout.svelte | 9 +- .../[application]/backend/model/index.svelte | 13 +- .../backend/view/[selectedView]/index.svelte | 13 +- packages/builder/src/pages/_layout.svelte | 61 ++-- packages/builder/src/pages/index.svelte | 86 ++--- packages/builder/yarn.lock | 267 ++++++++++++++- packages/server/package.json | 2 +- packages/server/src/api/controllers/client.js | 2 +- .../server/src/api/controllers/instance.js | 5 + packages/server/src/api/controllers/model.js | 71 ++-- packages/server/src/api/controllers/record.js | 168 +++++++--- .../server/src/api/controllers/view/index.js | 34 +- packages/server/src/api/routes/record.js | 5 + .../server/src/api/routes/tests/model.spec.js | 10 +- .../src/automations/queue/inMemoryQueue.js | 44 --- .../src/automations/steps/createRecord.js | 12 +- .../src/automations/steps/deleteRecord.js | 12 +- .../src/automations/steps/updateRecord.js | 8 +- packages/server/src/automations/triggers.js | 24 +- .../src/db/linkedRecords/LinkController.js | 307 ++++++++++++++++++ packages/server/src/db/linkedRecords/index.js | 120 +++++++ .../server/src/db/linkedRecords/linkUtils.js | 92 ++++++ packages/server/src/events/index.js | 41 ++- .../src/utilities/queue/inMemoryQueue.js | 78 +++++ packages/server/yarn.lock | 7 +- packages/standard-components/package.json | 10 +- .../standard-components/src/DataForm.svelte | 259 +-------------- .../src/DataFormWide.svelte | 246 +------------- .../standard-components/src/DataTable.svelte | 29 +- .../standard-components/src/ErrorsBox.svelte | 31 ++ packages/standard-components/src/Form.svelte | 197 +++++++++++ .../src/LinkedRecordSelector.svelte | 65 ++++ .../src/RecordDetail.svelte | 15 +- .../src/attachments/AttachmentList.svelte | 2 +- packages/standard-components/src/fetchData.js | 23 +- packages/standard-components/src/helpers.js | 1 + yarn.lock | 86 +---- 148 files changed, 3645 insertions(+), 3984 deletions(-) delete mode 100644 packages/builder/src/components/automation/SetupPanel/DeleteAutomationModal.svelte rename packages/builder/src/components/{database => backend}/DataTable/AttachmentList.svelte (100%) create mode 100644 packages/builder/src/components/backend/DataTable/ModelDataTable.svelte create mode 100644 packages/builder/src/components/backend/DataTable/RecordFieldControl.svelte create mode 100644 packages/builder/src/components/backend/DataTable/RelationshipDataTable.svelte rename packages/builder/src/components/{database/DataTable/ModelDataTable.svelte => backend/DataTable/Table.svelte} (50%) rename packages/builder/src/components/{database => backend}/DataTable/TablePagination.svelte (57%) create mode 100644 packages/builder/src/components/backend/DataTable/ViewDataTable.svelte rename packages/builder/src/components/{database => backend}/DataTable/api.js (100%) create mode 100644 packages/builder/src/components/backend/DataTable/buttons/CalculateButton.svelte rename packages/builder/src/components/{database/DataTable/popovers/Row.svelte => backend/DataTable/buttons/CreateColumnButton.svelte} (63%) create mode 100644 packages/builder/src/components/backend/DataTable/buttons/CreateRowButton.svelte create mode 100644 packages/builder/src/components/backend/DataTable/buttons/CreateViewButton.svelte create mode 100644 packages/builder/src/components/backend/DataTable/buttons/ExportButton.svelte create mode 100644 packages/builder/src/components/backend/DataTable/buttons/FilterButton.svelte create mode 100644 packages/builder/src/components/backend/DataTable/buttons/GroupByButton.svelte create mode 100644 packages/builder/src/components/backend/DataTable/modals/CreateEditRecordModal.svelte rename packages/builder/src/components/{database/DataTable/popovers/Calculate.svelte => backend/DataTable/popovers/CalculatePopover.svelte} (71%) rename packages/builder/src/components/{database/DataTable/popovers/ColumnHeader.svelte => backend/DataTable/popovers/ColumnPopover.svelte} (56%) create mode 100644 packages/builder/src/components/backend/DataTable/popovers/CreateEditColumnPopover.svelte rename packages/builder/src/components/{database/DataTable/popovers/View.svelte => backend/DataTable/popovers/CreateViewPopover.svelte} (58%) create mode 100644 packages/builder/src/components/backend/DataTable/popovers/ExportPopover.svelte rename packages/builder/src/components/{database/DataTable/popovers/Filter.svelte => backend/DataTable/popovers/FilterPopover.svelte} (55%) rename packages/builder/src/components/{database/DataTable/popovers/GroupBy.svelte => backend/DataTable/popovers/GroupByPopover.svelte} (56%) create mode 100644 packages/builder/src/components/backend/DataTable/popovers/RowPopover.svelte rename packages/builder/src/components/{nav => backend}/ModelNavigator/ListItem.svelte (74%) rename packages/builder/src/components/{nav => backend}/ModelNavigator/ModelNavigator.svelte (74%) rename packages/builder/src/components/{nav => backend}/ModelNavigator/TableDataImport.svelte (97%) create mode 100644 packages/builder/src/components/backend/ModelNavigator/modals/CreateTableModal.svelte create mode 100644 packages/builder/src/components/backend/ModelNavigator/popovers/EditTablePopover.svelte rename packages/builder/src/components/{nav/ModelNavigator/EditView.svelte => backend/ModelNavigator/popovers/EditViewPopover.svelte} (51%) delete mode 100644 packages/builder/src/components/database/DataTable/LinkedRecord.svelte delete mode 100644 packages/builder/src/components/database/DataTable/Table.svelte delete mode 100644 packages/builder/src/components/database/DataTable/ViewDataTable.svelte delete mode 100644 packages/builder/src/components/database/DataTable/index.js delete mode 100644 packages/builder/src/components/database/DataTable/modals/CreateEditColumn.svelte delete mode 100644 packages/builder/src/components/database/DataTable/modals/CreateEditRecord.svelte delete mode 100644 packages/builder/src/components/database/DataTable/modals/DeleteRecord.svelte delete mode 100644 packages/builder/src/components/database/DataTable/modals/DeleteTable.svelte delete mode 100644 packages/builder/src/components/database/DataTable/modals/DeleteView.svelte delete mode 100644 packages/builder/src/components/database/DataTable/modals/RecordFieldControl.svelte delete mode 100644 packages/builder/src/components/database/DataTable/modals/index.js delete mode 100644 packages/builder/src/components/database/DataTable/popovers/Column.svelte delete mode 100644 packages/builder/src/components/database/DataTable/popovers/EditRow.svelte delete mode 100644 packages/builder/src/components/database/DataTable/popovers/Export.svelte delete mode 100644 packages/builder/src/components/nav/ModelNavigator/CreateTable.svelte delete mode 100644 packages/builder/src/components/nav/ModelNavigator/EditTable.svelte delete mode 100644 packages/builder/src/components/nav/NavItem.svelte delete mode 100644 packages/builder/src/components/settings/Modal.svelte create mode 100644 packages/builder/src/components/settings/SettingsModal.svelte rename packages/builder/src/components/userInterface/{CreateScreen/NewScreen.svelte => NewScreenModal.svelte} (57%) create mode 100644 packages/builder/src/pages/[application]/backend/model/[selectedModel]/relationship/[selectedRecord]/[selectedField]/index.svelte create mode 100644 packages/builder/src/pages/[application]/backend/model/[selectedModel]/relationship/[selectedRecord]/index.svelte create mode 100644 packages/builder/src/pages/[application]/backend/model/[selectedModel]/relationship/index.svelte delete mode 100644 packages/server/src/automations/queue/inMemoryQueue.js create mode 100644 packages/server/src/db/linkedRecords/LinkController.js create mode 100644 packages/server/src/db/linkedRecords/index.js create mode 100644 packages/server/src/db/linkedRecords/linkUtils.js create mode 100644 packages/server/src/utilities/queue/inMemoryQueue.js create mode 100644 packages/standard-components/src/ErrorsBox.svelte create mode 100644 packages/standard-components/src/Form.svelte create mode 100644 packages/standard-components/src/LinkedRecordSelector.svelte create mode 100644 packages/standard-components/src/helpers.js diff --git a/packages/builder/cypress/integration/createAutomation.spec.js b/packages/builder/cypress/integration/createAutomation.spec.js index 10556989de..26af4fac71 100644 --- a/packages/builder/cypress/integration/createAutomation.spec.js +++ b/packages/builder/cypress/integration/createAutomation.spec.js @@ -15,8 +15,12 @@ context("Create a automation", () => { cy.contains("automate").click() cy.contains("Create New Automation").click() - cy.get("input").type("Add Record") - cy.contains("Save").click() + cy.get(".modal").within(() => { + cy.get("input").type("Add Record") + cy.get(".buttons") + .contains("Create") + .click() + }) // Add trigger cy.get("[data-cy=add-automation-component]").click() @@ -46,7 +50,6 @@ context("Create a automation", () => { // Activate Automation cy.get("[data-cy=activate-automation]").click() - cy.contains("Add Record").should("be.visible") cy.get(".stop-button.highlighted").should("be.visible") }) diff --git a/packages/builder/cypress/integration/createTable.spec.js b/packages/builder/cypress/integration/createTable.spec.js index 6958eb5d37..d7ae805b27 100644 --- a/packages/builder/cypress/integration/createTable.spec.js +++ b/packages/builder/cypress/integration/createTable.spec.js @@ -1,70 +1,65 @@ -context('Create a Table', () => { - before(() => { - cy.visit('localhost:4001/_builder') - cy.createApp('Table App', 'Table App Description') - }) +context("Create a Table", () => { + before(() => { + cy.visit("localhost:4001/_builder") + cy.createApp("Table App", "Table App Description") + }) - it('should create a new Table', () => { - cy.createTable('dog') + it("should create a new Table", () => { + cy.createTable("dog") - // Check if Table exists - cy.get('.title').should('contain.text', 'dog') - }) + // Check if Table exists + cy.get(".title span").should("have.text", "dog") + }) - it('adds a new column to the table', () => { - cy.addColumn('dog', 'name', 'Plain Text') + it("adds a new column to the table", () => { + cy.addColumn("dog", "name", "Text") + cy.contains("name").should("be.visible") + }) - cy.contains('name').should("be.visible") - }) + it("creates a record in the table", () => { + cy.addRecord(["Rover"]) + cy.contains("Rover").should("be.visible") + }) - it('creates a record in the table', () => { - cy.addRecord(["Rover"]) + it("updates a column on the table", () => { + cy.contains("name").click() + cy.get("[data-cy='edit-column-header']").click() + cy.get(".actions input") + .first() + .type("updated") + cy.get("select").select("Text") + cy.contains("Save Column").click() + cy.contains("nameupdated").should("have.text", "nameupdated") + }) - cy.contains('Rover').should("be.visible") - }) + it("edits a record", () => { + cy.get("tbody .ri-more-line").click() + cy.get("[data-cy=edit-row]").click() + cy.get(".modal input").type("Updated") + cy.contains("Save").click() + cy.contains("RoverUpdated").should("have.text", "RoverUpdated") + }) - it('updates a column on the table', () => { - cy.contains("name").click() - cy.get("[data-cy='edit-column-header']").click() + it("deletes a record", () => { + cy.get("tbody .ri-more-line").click() + cy.get("[data-cy=delete-row]").click() + cy.contains("Delete Row").click() + cy.contains("RoverUpdated").should("not.exist") + }) - cy.get("[placeholder=Name]").type("updated") - cy.get("select").select("Plain Text") - - cy.contains("Save Column").click() - - cy.contains('nameupdated').should('have.text', 'nameupdated ') - }) - - it('edits a record', () => { - cy.get("tbody .ri-more-line").click() - cy.get("[data-cy=edit-row]").click() - cy.get(".actions input").type("Updated") - cy.contains("Save").click() - - cy.contains('RoverUpdated').should('have.text', 'RoverUpdated') - }) - - it('deletes a record', () => { - cy.get("tbody .ri-more-line").click() - cy.get("[data-cy=delete-row]").click() - cy.get(".modal-actions").contains("Delete").click() - - cy.contains('RoverUpdated').should('not.exist') - }) - - it('deletes a column', () => { - cy.contains("name").click() - cy.get("[data-cy='delete-column-header']").click() - - cy.contains('nameupdated').should('not.exist') - }) - - it('deletes a table', () => { - cy.contains("div", "dog").get(".ri-more-line").click() - cy.get("[data-cy=delete-table]").click() - cy.get(".modal-actions").contains("Delete").click() - - cy.contains('dog').should('not.exist') - }) + it("deletes a column", () => { + cy.contains("name").click() + cy.get("[data-cy='delete-column-header']").click() + cy.contains("Delete Column").click() + cy.contains("nameupdated").should("not.exist") + }) + it("deletes a table", () => { + cy.contains("div", "dog") + .get(".ri-more-line") + .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 81af40c7f7..8f0c9565c8 100644 --- a/packages/builder/cypress/integration/createView.spec.js +++ b/packages/builder/cypress/integration/createView.spec.js @@ -1,91 +1,100 @@ +context("Create a View", () => { + before(() => { + cy.visit("localhost:4001/_builder") + cy.createApp("View App", "View App Description") + cy.createTable("data") + cy.addColumn("data", "group", "Text") + cy.addColumn("data", "age", "Number") + cy.addColumn("data", "rating", "Number") -context('Create a View', () => { - before(() => { - cy.visit('localhost:4001/_builder') - cy.createApp('View App', 'View App Description') - cy.createTable('data') - cy.addColumn('data', 'group', 'Plain Text') - cy.addColumn('data', 'age', 'Number') - cy.addColumn('data', 'rating', 'Number') + // 6 Records + cy.addRecord(["Students", 25, 1]) + cy.addRecord(["Students", 20, 3]) + cy.addRecord(["Students", 18, 6]) + cy.addRecord(["Students", 25, 2]) + cy.addRecord(["Teachers", 49, 5]) + cy.addRecord(["Teachers", 36, 3]) + }) - // 6 Records - cy.addRecord(["Students", 25, 1]) - cy.addRecord(["Students", 20, 3]) - cy.addRecord(["Students", 18, 6]) - cy.addRecord(["Students", 25, 2]) - cy.addRecord(["Teachers", 49, 5]) - cy.addRecord(["Teachers", 36, 3]) - }) - - it('creates a view', () => { - cy.contains("Create New View").click() - cy.get("[placeholder='View Name']").type("Test View") + it("creates a view", () => { + cy.contains("Create New View").click() + cy.get(".menu-container").within(() => { + cy.get("input").type("Test View") cy.contains("Save View").click() - cy.get(".title").contains("Test View") - cy.get("thead th").should(($headers) => { - expect($headers).to.have.length(3) - const headers = $headers.map((i, header) => Cypress.$(header).text()) - expect(headers.get()).to.deep.eq([ - "group", - "age", - "rating" - ]) - }) - }); - - 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("input[placeholder='age']").type(18) - cy.contains("Save").click() - cy.get("tbody tr").should(($values) => { - expect($values).to.have.length(5) - }) - }); - - it('creates a stats calculation view based on age', () => { - cy.contains("Calculate").click() - // we may reinstate this - have commented this dropdown for now as there is only one option - //cy.get(".menu-container").find("select").first().select("Statistics") - cy.get(".menu-container").find("select").eq(0).select("age") - cy.contains("Save").click() - cy.get("thead th").should(($headers) => { - expect($headers).to.have.length(7) - const headers = $headers.map((i, header) => Cypress.$(header).text()) - expect(headers.get()).to.deep.eq([ - "field", - "sum", - "min", - "max", - "count", - "sumsqr", - "avg", - ]) - }) - cy.get("tbody td").should(($values) => { - const values = $values.map((i, value) => Cypress.$(value).text()) - expect(values.get()).to.deep.eq([ - "age", - "155", - "20", - "49", - "5", - "5347", - "31" - ]) - }) }) + cy.get(".title").contains("Test View") + cy.get("thead th div").should($headers => { + expect($headers).to.have.length(3) + const headers = $headers.map((i, header) => Cypress.$(header).text()) + expect(headers.get()).to.deep.eq(["group", "age", "rating"]) + }) + }) - it('groups the view by group', () => { - cy.contains("Group By").click() - cy.get("select").select("group") - cy.contains("Save").click() - cy.contains("Students").should("be.visible") - cy.contains("Teachers").should("be.visible") + 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("input").type(18) + cy.contains("Save").click() + cy.get("tbody tr").should($values => { + expect($values).to.have.length(5) + }) + }) - cy.get("tbody tr").first().find("td").should(($values) => { + it("creates a stats calculation view based on age", () => { + cy.contains("Calculate").click() + // we may reinstate this - have commented this dropdown for now as there is only one option + //cy.get(".menu-container").find("select").first().select("Statistics") + cy.get(".menu-container") + .find("select") + .eq(0) + .select("age") + cy.contains("Save").click() + cy.get("thead th div").should($headers => { + expect($headers).to.have.length(7) + const headers = $headers.map((i, header) => Cypress.$(header).text()) + expect(headers.get()).to.deep.eq([ + "field", + "sum", + "min", + "max", + "count", + "sumsqr", + "avg", + ]) + }) + cy.get("tbody td").should($values => { + const values = $values.map((i, value) => Cypress.$(value).text()) + expect(values.get()).to.deep.eq([ + "age", + "155", + "20", + "49", + "5", + "5347", + "31", + ]) + }) + }) + + it("groups the view by group", () => { + cy.contains("Group By").click() + cy.get("select").select("group") + cy.contains("Save").click() + cy.contains("Students").should("be.visible") + cy.contains("Teachers").should("be.visible") + + cy.get("tbody tr") + .first() + .find("td") + .should($values => { const values = $values.map((i, value) => Cypress.$(value).text()) expect(values.get()).to.deep.eq([ "Students", @@ -94,24 +103,30 @@ context('Create a View', () => { "25", "3", "1650", - "23.333333333333332" + "23.333333333333332", ]) }) - }) + }) - it('renames a view', () => { - cy.contains("[data-cy=model-nav-item]", "Test View").find(".ri-more-line").click() - cy.contains("Edit").click() - cy.get("[placeholder='View Name']").type(" Updated") + it("renames a view", () => { + cy.contains("[data-cy=model-nav-item]", "Test View") + .find(".ri-more-line") + .click() + cy.contains("Edit").click() + cy.get(".menu-container").within(() => { + cy.get("input").type(" Updated") cy.contains("Save").click() - cy.contains("Test View Updated").should("be.visible") }) + cy.contains("Test View Updated").should("be.visible") + }) - it('deletes a view', () => { - cy.contains("[data-cy=model-nav-item]", "Test View Updated").click() - cy.contains("[data-cy=model-nav-item]", "Test View Updated").find(".ri-more-line").click() - cy.contains("Delete").click() - cy.get(".content").contains("button", "Delete").click() - cy.contains("TestView Updated").should("not.be.visible") - }) + it("deletes a view", () => { + cy.contains("[data-cy=model-nav-item]", "Test View Updated").click() + cy.contains("[data-cy=model-nav-item]", "Test View Updated") + .find(".ri-more-line") + .click() + cy.contains("Delete").click() + cy.contains("Delete View").click() + cy.contains("TestView Updated").should("not.be.visible") + }) }) diff --git a/packages/builder/cypress/support/commands.js b/packages/builder/cypress/support/commands.js index 82f87032fa..79fd83875d 100644 --- a/packages/builder/cypress/support/commands.js +++ b/packages/builder/cypress/support/commands.js @@ -59,16 +59,21 @@ Cypress.Commands.add("createApp", name => { Cypress.Commands.add("createTestTableWithData", () => { cy.createTable("dog") - cy.addColumn("dog", "name", "Plain Text") + cy.addColumn("dog", "name", "Text") cy.addColumn("dog", "age", "Number") }) Cypress.Commands.add("createTable", tableName => { // Enter model name cy.contains("Create New Table").click() - cy.get("[placeholder='Table Name']").type(tableName) - - cy.contains("Save").click() + cy.get(".modal").within(() => { + cy.get("input") + .first() + .type(tableName) + cy.get(".buttons") + .contains("Create") + .click() + }) cy.contains(tableName).should("be.visible") }) @@ -77,25 +82,31 @@ Cypress.Commands.add("addColumn", (tableName, columnName, type) => { cy.contains(tableName).click() cy.contains("Create New Column").click() - cy.get("[placeholder=Name]").type(columnName) - cy.get("select").select(type) - - cy.contains("Save Column") - - cy.contains("Save").click() + // Configure column + cy.get(".menu-container").within(() => { + cy.get("input") + .first() + .type(columnName) + cy.get("select").select(type) + cy.contains("Save").click() + }) }) Cypress.Commands.add("addRecord", values => { cy.contains("Create New Row").click() - for (let i = 0; i < values.length; i++) { - cy.get(".actions input") - .eq(i) - .type(values[i]) - } + cy.get(".modal").within(() => { + for (let i = 0; i < values.length; i++) { + cy.get("input") + .eq(i) + .type(values[i]) + } - // Save - cy.contains("Save").click() + // Save + cy.get(".buttons") + .contains("Create") + .click() + }) }) Cypress.Commands.add("createUser", (username, password, accessLevel) => { @@ -114,7 +125,9 @@ Cypress.Commands.add("createUser", (username, password, accessLevel) => { .select(accessLevel) // Save - cy.get(".create-button > button").click() + cy.get(".inputs") + .contains("Create") + .click() }) Cypress.Commands.add("addHeadlineComponent", text => { @@ -138,12 +151,12 @@ Cypress.Commands.add("navigateToFrontend", () => { }) Cypress.Commands.add("createScreen", (screenName, route) => { - cy.get(".newscreen").click() - cy.get("[data-cy=new-screen-dialog] input:first").type(screenName) - if (route) { - cy.get("[data-cy=new-screen-dialog] input:last").type(route) - } - cy.get("[data-cy=create-screen-footer]").within(() => { + cy.contains("Create New Screen").click() + cy.get(".modal").within(() => { + cy.get("input:first").type(screenName) + if (route) { + cy.get("input:last").type(route) + } cy.contains("Create Screen").click() }) cy.get(".nav-items-container").within(() => { diff --git a/packages/builder/package.json b/packages/builder/package.json index d34472e353..0fb2d5a6f0 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -63,7 +63,7 @@ } }, "dependencies": { - "@budibase/bbui": "^1.34.6", + "@budibase/bbui": "^1.41.0", "@budibase/client": "^0.1.25", "@budibase/colorpicker": "^1.0.1", "@fortawesome/fontawesome-free": "^5.14.0", @@ -79,7 +79,6 @@ "shortid": "^2.2.15", "svelte-loading-spinners": "^0.1.1", "svelte-portal": "^0.1.0", - "svelte-simple-modal": "^0.4.2", "yup": "^0.29.2" }, "devDependencies": { @@ -113,7 +112,7 @@ "rollup-plugin-terser": "^7.0.2", "rollup-plugin-url": "^2.2.2", "start-server-and-test": "^1.11.0", - "svelte": "^3.24.1", + "svelte": "^3.29.0", "svelte-jester": "^1.0.6" }, "gitHead": "115189f72a850bfb52b65ec61d932531bf327072" diff --git a/packages/builder/src/App.svelte b/packages/builder/src/App.svelte index 16156d7af7..a5016db114 100644 --- a/packages/builder/src/App.svelte +++ b/packages/builder/src/App.svelte @@ -1,9 +1,8 @@ +{#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}
{#each blocks as block, idx (block.id)}
diff --git a/packages/builder/src/components/automation/SetupPanel/ParamInputs/RecordSelector.svelte b/packages/builder/src/components/automation/SetupPanel/ParamInputs/RecordSelector.svelte index d560107642..d002aaa0a1 100644 --- a/packages/builder/src/components/automation/SetupPanel/ParamInputs/RecordSelector.svelte +++ b/packages/builder/src/components/automation/SetupPanel/ParamInputs/RecordSelector.svelte @@ -28,42 +28,34 @@
{#if schemaFields.length} -
+
{#each schemaFields as [field, schema]} -
- {#if schemaHasOptions(schema)} -
{field}
- - {:else if schema.type === 'string' || schema.type === 'number'} - - {/if} -
+ {#if schemaHasOptions(schema)} + + {:else if schema.type === 'string' || schema.type === 'number'} + + {/if} {/each}
{/if} diff --git a/packages/builder/src/components/automation/SetupPanel/SetupPanel.svelte b/packages/builder/src/components/automation/SetupPanel/SetupPanel.svelte index 39ffaa370b..f2b7a8b711 100644 --- a/packages/builder/src/components/automation/SetupPanel/SetupPanel.svelte +++ b/packages/builder/src/components/automation/SetupPanel/SetupPanel.svelte @@ -1,27 +1,19 @@
@@ -93,11 +93,18 @@ on:click={saveAutomation}> Save Automation - + {/if}
-
+ diff --git a/packages/builder/src/components/database/DataTable/TablePagination.svelte b/packages/builder/src/components/backend/DataTable/TablePagination.svelte similarity index 57% rename from packages/builder/src/components/database/DataTable/TablePagination.svelte rename to packages/builder/src/components/backend/DataTable/TablePagination.svelte index 508ee60b23..1435148ebc 100644 --- a/packages/builder/src/components/database/DataTable/TablePagination.svelte +++ b/packages/builder/src/components/backend/DataTable/TablePagination.svelte @@ -1,14 +1,11 @@ + + + + + {#if view.calculation} + + {/if} + +
diff --git a/packages/builder/src/components/database/DataTable/api.js b/packages/builder/src/components/backend/DataTable/api.js similarity index 100% rename from packages/builder/src/components/database/DataTable/api.js rename to packages/builder/src/components/backend/DataTable/api.js diff --git a/packages/builder/src/components/backend/DataTable/buttons/CalculateButton.svelte b/packages/builder/src/components/backend/DataTable/buttons/CalculateButton.svelte new file mode 100644 index 0000000000..efe3dcd79d --- /dev/null +++ b/packages/builder/src/components/backend/DataTable/buttons/CalculateButton.svelte @@ -0,0 +1,19 @@ + + +
+ + + Calculate + +
+ + + diff --git a/packages/builder/src/components/database/DataTable/popovers/Row.svelte b/packages/builder/src/components/backend/DataTable/buttons/CreateColumnButton.svelte similarity index 63% rename from packages/builder/src/components/database/DataTable/popovers/Row.svelte rename to packages/builder/src/components/backend/DataTable/buttons/CreateColumnButton.svelte index 843c636063..7ddced256e 100644 --- a/packages/builder/src/components/database/DataTable/popovers/Row.svelte +++ b/packages/builder/src/components/backend/DataTable/buttons/CreateColumnButton.svelte @@ -1,20 +1,21 @@
-
Add New Row
- +
Create Column
+
diff --git a/packages/builder/src/components/database/DataTable/popovers/View.svelte b/packages/builder/src/components/backend/DataTable/popovers/CreateViewPopover.svelte similarity index 58% rename from packages/builder/src/components/database/DataTable/popovers/View.svelte rename to packages/builder/src/components/backend/DataTable/popovers/CreateViewPopover.svelte index 90208a0025..8cd0785044 100644 --- a/packages/builder/src/components/database/DataTable/popovers/View.svelte +++ b/packages/builder/src/components/backend/DataTable/popovers/CreateViewPopover.svelte @@ -1,19 +1,11 @@ -
- - - Create New View - -
- +
Create View
-
- -
-
- + + - +
diff --git a/packages/builder/src/components/backend/DataTable/popovers/ExportPopover.svelte b/packages/builder/src/components/backend/DataTable/popovers/ExportPopover.svelte new file mode 100644 index 0000000000..0d52689a6e --- /dev/null +++ b/packages/builder/src/components/backend/DataTable/popovers/ExportPopover.svelte @@ -0,0 +1,61 @@ + + +
+
Export Data
+ + +
+ + diff --git a/packages/builder/src/components/database/DataTable/popovers/Filter.svelte b/packages/builder/src/components/backend/DataTable/popovers/FilterPopover.svelte similarity index 55% rename from packages/builder/src/components/database/DataTable/popovers/Filter.svelte rename to packages/builder/src/components/backend/DataTable/popovers/FilterPopover.svelte index fbf3b59db1..3d6241f0ab 100644 --- a/packages/builder/src/components/database/DataTable/popovers/Filter.svelte +++ b/packages/builder/src/components/backend/DataTable/popovers/FilterPopover.svelte @@ -1,13 +1,5 @@ -
- - - Filter - -
- +
Filter
-
- {#each view.filters as filter, idx} - {#if idx === 0} -

Where

- {:else} - + + {#each CONJUNCTIONS as conjunction} + + {/each} + + {/if} + - {/if} - - - {#if filter.key && isMultipleChoice(filter.key)} - - {#each fieldOptions(filter.key) as option} - + {#each CONDITIONS as condition} + {/each} - {:else if filter.key && isDate(filter.key)} - - {:else if filter.key && isNumber(filter.key)} - - {:else} - - {/if} - removeFilter(idx)} /> - {/each} -
-
+ {#if filter.key && isMultipleChoice(filter.key)} + + {:else if filter.key && isDate(filter.key)} + + {:else if filter.key && isNumber(filter.key)} + + {:else} + + {/if} + removeFilter(idx)} /> + {/each} +
+ {/if} + diff --git a/packages/builder/src/components/nav/ModelNavigator/ListItem.svelte b/packages/builder/src/components/backend/ModelNavigator/ListItem.svelte similarity index 74% rename from packages/builder/src/components/nav/ModelNavigator/ListItem.svelte rename to packages/builder/src/components/backend/ModelNavigator/ListItem.svelte index 54d9eef0e9..31dd5b5ac4 100644 --- a/packages/builder/src/components/nav/ModelNavigator/ListItem.svelte +++ b/packages/builder/src/components/backend/ModelNavigator/ListItem.svelte @@ -19,26 +19,24 @@ diff --git a/packages/builder/src/components/nav/ModelNavigator/ModelNavigator.svelte b/packages/builder/src/components/backend/ModelNavigator/ModelNavigator.svelte similarity index 74% rename from packages/builder/src/components/nav/ModelNavigator/ModelNavigator.svelte rename to packages/builder/src/components/backend/ModelNavigator/ModelNavigator.svelte index a055c0dc67..627acab415 100644 --- a/packages/builder/src/components/nav/ModelNavigator/ModelNavigator.svelte +++ b/packages/builder/src/components/backend/ModelNavigator/ModelNavigator.svelte @@ -1,16 +1,12 @@ + + + + + +
+ + +
+
+
diff --git a/packages/builder/src/components/backend/ModelNavigator/popovers/EditTablePopover.svelte b/packages/builder/src/components/backend/ModelNavigator/popovers/EditTablePopover.svelte new file mode 100644 index 0000000000..028b78a1e8 --- /dev/null +++ b/packages/builder/src/components/backend/ModelNavigator/popovers/EditTablePopover.svelte @@ -0,0 +1,141 @@ + + +
+ +
+ + {#if editing} +
+
Edit Table
+ + +
+ + +
+
+ {:else} +
    +
  • + + Edit +
  • +
  • + + Delete +
  • +
+ {/if} +
+ + + diff --git a/packages/builder/src/components/nav/ModelNavigator/EditView.svelte b/packages/builder/src/components/backend/ModelNavigator/popovers/EditViewPopover.svelte similarity index 51% rename from packages/builder/src/components/nav/ModelNavigator/EditView.svelte rename to packages/builder/src/components/backend/ModelNavigator/popovers/EditViewPopover.svelte index 7faf9b980e..bd1e184e06 100644 --- a/packages/builder/src/components/nav/ModelNavigator/EditView.svelte +++ b/packages/builder/src/components/backend/ModelNavigator/popovers/EditViewPopover.svelte @@ -1,20 +1,18 @@ -
+
- + {#if editing} -
Edit View
-
- -
-
-
+
+
Edit View
+ +
-
-
-
-
+ +
{:else}
  • Edit
  • -
  • +
  • Delete
{/if} + diff --git a/packages/builder/src/components/common/ConfirmDialog.svelte b/packages/builder/src/components/common/ConfirmDialog.svelte index 31e2d3ad86..2cd27573f4 100644 --- a/packages/builder/src/components/common/ConfirmDialog.svelte +++ b/packages/builder/src/components/common/ConfirmDialog.svelte @@ -1,57 +1,31 @@ - -

{title}

- - {body} - - + + +
{body}
+
diff --git a/packages/builder/src/components/common/DatePicker.svelte b/packages/builder/src/components/common/DatePicker.svelte index ec9d41a17b..913e00fc75 100644 --- a/packages/builder/src/components/common/DatePicker.svelte +++ b/packages/builder/src/components/common/DatePicker.svelte @@ -11,6 +11,4 @@ } -
- -
+ diff --git a/packages/builder/src/components/common/ErrorsBox.svelte b/packages/builder/src/components/common/ErrorsBox.svelte index 0e565a4ad8..9e29784c66 100644 --- a/packages/builder/src/components/common/ErrorsBox.svelte +++ b/packages/builder/src/components/common/ErrorsBox.svelte @@ -5,9 +5,25 @@ {#if hasErrors} -
+
{#each errors as error} -
{error.dataPath} {error.message}
+
{error.dataPath} {error.message}
{/each}
{/if} + + diff --git a/packages/builder/src/components/common/LinkedRecordSelector.svelte b/packages/builder/src/components/common/LinkedRecordSelector.svelte index 2976ffd913..e7cf245eb8 100644 --- a/packages/builder/src/components/common/LinkedRecordSelector.svelte +++ b/packages/builder/src/components/common/LinkedRecordSelector.svelte @@ -2,101 +2,52 @@ import { onMount } from "svelte" import { backendUiStore } from "builderStore" import api from "builderStore/api" + import { Select, Label, Multiselect } from "@budibase/bbui" + import { capitalise } from "../../helpers" - export let modelId - export let linkName - export let linked = [] + export let schema + export let linkedRecords = [] let records = [] - let model = {} - let linkedRecords = new Set(linked) + $: label = capitalise(schema.name) + $: linkedModelId = schema.modelId + $: linkedModel = $backendUiStore.models.find( + model => model._id === linkedModelId + ) + $: fetchRecords(linkedModelId) - $: linked = [...linkedRecords] - $: FIELDS_TO_HIDE = [$backendUiStore.selectedModel.name] - $: schema = $backendUiStore.selectedModel.schema - - async function fetchRecords() { - const FETCH_RECORDS_URL = `/api/${modelId}/records` - const response = await api.get(FETCH_RECORDS_URL) - const modelResponse = await api.get(`/api/models/${modelId}`) - - model = await modelResponse.json() - records = await response.json() - } - - function linkRecord(id) { - if (linkedRecords.has(id)) { - linkedRecords.delete(id) - } else { - linkedRecords.add(id) + async function fetchRecords(linkedModelId) { + const FETCH_RECORDS_URL = `/api/${linkedModelId}/records` + try { + const response = await api.get(FETCH_RECORDS_URL) + records = await response.json() + } catch (error) { + console.log(error) + records = [] } - - linkedRecords = linkedRecords } - onMount(() => { - fetchRecords() - }) + function getPrettyName(record) { + return record[linkedModel.primaryDisplay || "_id"] + } -
-
-

{linkName}

-
- {#each records as record} -
linkRecord(record._id)}> -
- {#each Object.keys(model.schema).filter(key => !FIELDS_TO_HIDE.includes(key)) as key} -
- {model.schema[key].name} -

{record[key]}

-
- {/each} -
-
- {/each} -
- - +{#if linkedModel.primaryDisplay == null} + + +{:else} + + {#each records as record} + + {/each} + +{/if} diff --git a/packages/builder/src/components/common/Notification/NotificationDisplay.svelte b/packages/builder/src/components/common/Notification/NotificationDisplay.svelte index 425eb60fb2..ad32f228cb 100644 --- a/packages/builder/src/components/common/Notification/NotificationDisplay.svelte +++ b/packages/builder/src/components/common/Notification/NotificationDisplay.svelte @@ -1,7 +1,7 @@ -
    +
    {#each $notificationStore.notifications as notification (notification.id)} -
  • + transition:fly={{ y: -30 }}>
    {notification.message}
    {#if notification.icon} {/if} -
  • +
    {/each} -
+
diff --git a/packages/builder/src/components/database/DataTable/LinkedRecord.svelte b/packages/builder/src/components/database/DataTable/LinkedRecord.svelte deleted file mode 100644 index 0cbf9ab307..0000000000 --- a/packages/builder/src/components/database/DataTable/LinkedRecord.svelte +++ /dev/null @@ -1,124 +0,0 @@ - - -
- {records.length} - {#if open} -
-
-

{field.name}

- -
- {#each records as record} -
-
- {#each Object.keys(model.schema).filter(key => !FIELDS_TO_HIDE.includes(key)) as key} -
- {model.schema[key].name} -

{record[key]}

-
- {/each} -
-
- {/each} -
- {/if} -
- - diff --git a/packages/builder/src/components/database/DataTable/Table.svelte b/packages/builder/src/components/database/DataTable/Table.svelte deleted file mode 100644 index 5b167c71f7..0000000000 --- a/packages/builder/src/components/database/DataTable/Table.svelte +++ /dev/null @@ -1,149 +0,0 @@ - - -
-
-

{title}

-
- -
-
- - - - {#each columns as header} - - {/each} - - - - {#if paginatedData.length === 0} -
No Data.
- {/if} - {#each paginatedData as row} - - {#each columns as header} - - {/each} - - {/each} - -
{header}
- {#if schema[header].type === 'attachment'} - - {:else}{getOr('', header, row)}{/if} -
- -
- - diff --git a/packages/builder/src/components/database/DataTable/ViewDataTable.svelte b/packages/builder/src/components/database/DataTable/ViewDataTable.svelte deleted file mode 100644 index 164683ef5f..0000000000 --- a/packages/builder/src/components/database/DataTable/ViewDataTable.svelte +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - {#if view.calculation} - - {/if} - -
diff --git a/packages/builder/src/components/database/DataTable/index.js b/packages/builder/src/components/database/DataTable/index.js deleted file mode 100644 index bd9df8885c..0000000000 --- a/packages/builder/src/components/database/DataTable/index.js +++ /dev/null @@ -1 +0,0 @@ -export { default } from "./ModelDataTable.svelte" diff --git a/packages/builder/src/components/database/DataTable/modals/CreateEditColumn.svelte b/packages/builder/src/components/database/DataTable/modals/CreateEditColumn.svelte deleted file mode 100644 index 1e5e23823c..0000000000 --- a/packages/builder/src/components/database/DataTable/modals/CreateEditColumn.svelte +++ /dev/null @@ -1,161 +0,0 @@ - - -
- - - - -
-
- - -
- - {#if field.type === 'string' && field.constraints} - - - {:else if field.type === 'datetime' && field.constraints} - - - {:else if field.type === 'number' && field.constraints} - - - {:else if field.type === 'link'} -
- - -
- {/if} -
- -
-
-
- -
-
- -
-
- - diff --git a/packages/builder/src/components/database/DataTable/modals/CreateEditRecord.svelte b/packages/builder/src/components/database/DataTable/modals/CreateEditRecord.svelte deleted file mode 100644 index 8edecd913c..0000000000 --- a/packages/builder/src/components/database/DataTable/modals/CreateEditRecord.svelte +++ /dev/null @@ -1,93 +0,0 @@ - - -
- -
- {#each modelSchema as [key, meta]} -
- {#if meta.type === 'link'} - - {:else} - - {/if} -
- {/each} -
-
-
-
- -
-
- -
-
- - diff --git a/packages/builder/src/components/database/DataTable/modals/DeleteRecord.svelte b/packages/builder/src/components/database/DataTable/modals/DeleteRecord.svelte deleted file mode 100644 index 4b4d51329e..0000000000 --- a/packages/builder/src/components/database/DataTable/modals/DeleteRecord.svelte +++ /dev/null @@ -1,61 +0,0 @@ - - -
-
-
- -

Delete Record

-
-

- Are you sure you want to delete this record? All of your data will be - permanently removed. This action cannot be undone. -

-
- -
- - diff --git a/packages/builder/src/components/database/DataTable/modals/DeleteTable.svelte b/packages/builder/src/components/database/DataTable/modals/DeleteTable.svelte deleted file mode 100644 index c47b9e632a..0000000000 --- a/packages/builder/src/components/database/DataTable/modals/DeleteTable.svelte +++ /dev/null @@ -1,64 +0,0 @@ - - -
-
-
- -

Delete Table

-
-

- Are you sure you want to delete this table? All of your data will be - permanently removed. This action cannot be undone. -

-
- -
- - diff --git a/packages/builder/src/components/database/DataTable/modals/DeleteView.svelte b/packages/builder/src/components/database/DataTable/modals/DeleteView.svelte deleted file mode 100644 index 9d6c11cdb0..0000000000 --- a/packages/builder/src/components/database/DataTable/modals/DeleteView.svelte +++ /dev/null @@ -1,62 +0,0 @@ - - -
-
-
- -

Delete View

-
-

- Are you sure you want to delete this view? All of your data will be - permanently removed. This action cannot be undone. -

-
- -
- - diff --git a/packages/builder/src/components/database/DataTable/modals/RecordFieldControl.svelte b/packages/builder/src/components/database/DataTable/modals/RecordFieldControl.svelte deleted file mode 100644 index 991a5fea63..0000000000 --- a/packages/builder/src/components/database/DataTable/modals/RecordFieldControl.svelte +++ /dev/null @@ -1,75 +0,0 @@ - - -{#if type === 'select'} - -{:else if type === 'date'} - - -{:else if type === 'file'} - - -{:else} - {#if type === 'checkbox'} - - {/if} - -{/if} - - diff --git a/packages/builder/src/components/database/DataTable/modals/index.js b/packages/builder/src/components/database/DataTable/modals/index.js deleted file mode 100644 index af0b3cd70b..0000000000 --- a/packages/builder/src/components/database/DataTable/modals/index.js +++ /dev/null @@ -1,2 +0,0 @@ -export { default as DeleteRecordModal } from "./DeleteRecord.svelte" -export { default as CreateEditRecordModal } from "./CreateEditRecord.svelte" diff --git a/packages/builder/src/components/database/DataTable/popovers/Column.svelte b/packages/builder/src/components/database/DataTable/popovers/Column.svelte deleted file mode 100644 index 2047a9a31b..0000000000 --- a/packages/builder/src/components/database/DataTable/popovers/Column.svelte +++ /dev/null @@ -1,35 +0,0 @@ - - -
- -
- -
Create Column
- -
- - diff --git a/packages/builder/src/components/database/DataTable/popovers/EditRow.svelte b/packages/builder/src/components/database/DataTable/popovers/EditRow.svelte deleted file mode 100644 index a5a04c79c8..0000000000 --- a/packages/builder/src/components/database/DataTable/popovers/EditRow.svelte +++ /dev/null @@ -1,103 +0,0 @@ - - -
- -
- - {#if editing} -
Edit Row
- - {:else} -
    -
  • - - Edit -
  • -
  • - - Delete -
  • -
- {/if} -
- - diff --git a/packages/builder/src/components/database/DataTable/popovers/Export.svelte b/packages/builder/src/components/database/DataTable/popovers/Export.svelte deleted file mode 100644 index 00514edb9c..0000000000 --- a/packages/builder/src/components/database/DataTable/popovers/Export.svelte +++ /dev/null @@ -1,71 +0,0 @@ - - -
- - - Export - -
- -
Export Format
- -
- - -
-
- - diff --git a/packages/builder/src/components/nav/ModelNavigator/CreateTable.svelte b/packages/builder/src/components/nav/ModelNavigator/CreateTable.svelte deleted file mode 100644 index fe723843b3..0000000000 --- a/packages/builder/src/components/nav/ModelNavigator/CreateTable.svelte +++ /dev/null @@ -1,113 +0,0 @@ - - -
- -
- -
-
Create Table
- - - - - -
-
-
- -
-
- -
-
-
- - diff --git a/packages/builder/src/components/nav/ModelNavigator/EditTable.svelte b/packages/builder/src/components/nav/ModelNavigator/EditTable.svelte deleted file mode 100644 index e7926063dd..0000000000 --- a/packages/builder/src/components/nav/ModelNavigator/EditTable.svelte +++ /dev/null @@ -1,137 +0,0 @@ - - -
- -
- - {#if editing} -
Edit Table
-
- -
-
-
- -
-
- -
-
- {:else} -
    -
  • - - Edit -
  • -
  • - - Delete -
  • -
- {/if} -
- - diff --git a/packages/builder/src/components/nav/NavItem.svelte b/packages/builder/src/components/nav/NavItem.svelte deleted file mode 100644 index 002c4e0802..0000000000 --- a/packages/builder/src/components/nav/NavItem.svelte +++ /dev/null @@ -1,20 +0,0 @@ - - -
$goto(href)} - class="budibase__nav-item backend-nav-item" - class:selected={$isActive(href)}> - {label} -
- - diff --git a/packages/builder/src/components/settings/Link.svelte b/packages/builder/src/components/settings/Link.svelte index 9d669bc7b2..3bb6d6e40d 100644 --- a/packages/builder/src/components/settings/Link.svelte +++ b/packages/builder/src/components/settings/Link.svelte @@ -1,32 +1,17 @@ - + + + + diff --git a/packages/builder/src/components/settings/SettingsModal.svelte b/packages/builder/src/components/settings/SettingsModal.svelte new file mode 100644 index 0000000000..44ab581521 --- /dev/null +++ b/packages/builder/src/components/settings/SettingsModal.svelte @@ -0,0 +1,52 @@ + + + +
+ + + +
+
+ + diff --git a/packages/builder/src/components/settings/UserRow.svelte b/packages/builder/src/components/settings/UserRow.svelte index 43ffc33fe2..30b03d9755 100644 --- a/packages/builder/src/components/settings/UserRow.svelte +++ b/packages/builder/src/components/settings/UserRow.svelte @@ -14,7 +14,7 @@ bind:value={user.username} name="Name" placeholder="Username" /> - @@ -37,19 +37,7 @@ .inputs { display: grid; justify-items: stretch; - grid-gap: 18px; - grid-template-columns: 1fr 1fr 1fr; - } - .inputs :global(input) { - padding: 10px 12px; - border-radius: var(--rounded-small); - } - .inputs :global(select) { - padding: 9px 12px; - border-radius: var(--rounded-small); - } - .inputs :global(button) { - border-radius: var(--rounded-small); - height: initial; + grid-gap: var(--spacing-m); + grid-template-columns: 1fr 1fr 140px; } diff --git a/packages/builder/src/components/settings/tabs/APIKeys.svelte b/packages/builder/src/components/settings/tabs/APIKeys.svelte index 7645548348..8a3c9fc710 100644 --- a/packages/builder/src/components/settings/tabs/APIKeys.svelte +++ b/packages/builder/src/components/settings/tabs/APIKeys.svelte @@ -1,8 +1,6 @@
-
- updateKey(['budibase', e.detail])} - thin - edit - value={keys.budibase} - label="Budibase" /> -
+ updateKey(['budibase', e.detail])} + thin + edit + value={keys.budibase} + label="Budibase API Key" />
diff --git a/packages/builder/src/components/settings/tabs/DangerZone.svelte b/packages/builder/src/components/settings/tabs/DangerZone.svelte index e87c5c4cd9..ee592ec6b1 100644 --- a/packages/builder/src/components/settings/tabs/DangerZone.svelte +++ b/packages/builder/src/components/settings/tabs/DangerZone.svelte @@ -1,6 +1,6 @@
-

- Type DELETE into the textbox, then click the following button to delete your - web app: -

+ + Type + DELETE + into the textbox, then click the following button to delete your entire web + app. + (value = e.target.value)} on:input={e => (value = e.target.value)} thin disabled={loading} placeholder="" /> - - +
+ +
diff --git a/packages/builder/src/components/settings/tabs/General.svelte b/packages/builder/src/components/settings/tabs/General.svelte index 7069dd2812..04d4672d50 100644 --- a/packages/builder/src/components/settings/tabs/General.svelte +++ b/packages/builder/src/components/settings/tabs/General.svelte @@ -22,19 +22,18 @@ thin edit value={$store.name} - label="Name" /> + label="App Name" />