From e7c02e2fb8c4d73e30efd8a05acb6819767aceeb Mon Sep 17 00:00:00 2001 From: Peter Clement Date: Tue, 8 Feb 2022 14:52:08 +0000 Subject: [PATCH 01/49] allow use of plain inputs for automations enabling use of bindings in all types --- .../builderStore/store/automation/index.js | 7 ++ .../FlowChart/ConfigModal.svelte | 25 ++++ .../FlowChart/FlowChart.svelte | 17 +++ .../FlowChart/FlowItem.svelte | 1 - .../automation/SetupPanel/RowSelector.svelte | 111 +++++++++--------- .../SetupPanel/RowSelectorTypes.svelte | 64 ++++++++++ 6 files changed, 171 insertions(+), 54 deletions(-) create mode 100644 packages/builder/src/components/automation/AutomationBuilder/FlowChart/ConfigModal.svelte create mode 100644 packages/builder/src/components/automation/SetupPanel/RowSelectorTypes.svelte diff --git a/packages/builder/src/builderStore/store/automation/index.js b/packages/builder/src/builderStore/store/automation/index.js index 7bd0ccca22..e2b9e53eda 100644 --- a/packages/builder/src/builderStore/store/automation/index.js +++ b/packages/builder/src/builderStore/store/automation/index.js @@ -45,6 +45,7 @@ const automationActions = store => ({ return state }) }, + save: async automation => { const UPDATE_AUTOMATION_URL = `/api/automations` const response = await api.put(UPDATE_AUTOMATION_URL, automation) @@ -119,6 +120,12 @@ const automationActions = store => ({ name: block.name, }) }, + toggleFieldControl: value => { + store.update(state => { + state.selectedAutomation.automation.rowFieldControl = value + return state + }) + }, deleteAutomationBlock: block => { store.update(state => { const idx = diff --git a/packages/builder/src/components/automation/AutomationBuilder/FlowChart/ConfigModal.svelte b/packages/builder/src/components/automation/AutomationBuilder/FlowChart/ConfigModal.svelte new file mode 100644 index 0000000000..26a95f8860 --- /dev/null +++ b/packages/builder/src/components/automation/AutomationBuilder/FlowChart/ConfigModal.svelte @@ -0,0 +1,25 @@ + + + + + diff --git a/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowChart.svelte b/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowChart.svelte index 2d6881d652..f39bc2d337 100644 --- a/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowChart.svelte +++ b/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowChart.svelte @@ -12,9 +12,12 @@ notifications, Modal, } from "@budibase/bbui" + import ConfigModal from "./ConfigModal.svelte" export let automation export let onSelect + + let configModal let testDataModal let blocks let confirmDeleteDialog @@ -59,6 +62,16 @@
{automation.name}
+
+
+ +
+
+ + + +
diff --git a/packages/client/src/stores/rowSelection.js b/packages/client/src/stores/rowSelection.js index 13d54a1b88..3d1f2038aa 100644 --- a/packages/client/src/stores/rowSelection.js +++ b/packages/client/src/stores/rowSelection.js @@ -1,18 +1,20 @@ import { writable } from "svelte/store" const createRowSelectionStore = () => { - const store = writable([]) + const store = writable({}) - function update(rows) { + function updateSelection(componentId, selectedRows) { store.update(state => { - state = [...rows] + state[componentId] = [...selectedRows] return state }) } + return { subscribe: store.subscribe, + set: store.set, actions: { - update, + updateSelection, }, } } From 4a119afb15805119b03736bd0d191c32118ef595 Mon Sep 17 00:00:00 2001 From: Peter Clement Date: Tue, 22 Feb 2022 15:56:11 +0000 Subject: [PATCH 17/49] simplify add all method --- packages/bbui/src/Table/Table.svelte | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/packages/bbui/src/Table/Table.svelte b/packages/bbui/src/Table/Table.svelte index 727bfd6c91..48983e8514 100644 --- a/packages/bbui/src/Table/Table.svelte +++ b/packages/bbui/src/Table/Table.svelte @@ -222,15 +222,7 @@ } if (e.detail) { - let rowsToAdd = [] - rows.map(x => - selectedRows - .map(y => rows.map(x => x._id).indexOf(y._id)) - .includes(true) - ? null - : rowsToAdd.push(x) - ) - selectedRows = [...selectedRows, ...rowsToAdd] + selectedRows = [...selectedRows, ...rows] } else { //remove every object from selectedRows that is not in rows let filtered = selectedRows.filter(el => From 9b3cedd4574538a4ba46d59d7379708273eee976 Mon Sep 17 00:00:00 2001 From: Peter Clement Date: Tue, 22 Feb 2022 16:14:19 +0000 Subject: [PATCH 18/49] remove console log --- .../automation/AutomationBuilder/FlowChart/FlowItem.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowItem.svelte b/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowItem.svelte index 0b3344b609..69dd67724a 100644 --- a/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowItem.svelte +++ b/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowItem.svelte @@ -31,7 +31,7 @@ $: rowControl = $automationStore.selectedAutomation.automation.rowControl $: showBindingPicker = block.stepId === "CREATE_ROW" || block.stepId === "UPDATE_ROW" - $: console.log(showBindingPicker) + $: testResult = $automationStore.selectedAutomation.testResults?.steps.filter( step => (block.id ? step.id === block.id : step.stepId === block.stepId) ) From d7d75594025fb130e56864e2fdfbc74b2e941485 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Thu, 24 Feb 2022 09:12:14 +0000 Subject: [PATCH 19/49] Don't show checkbox label if no label specified --- packages/bbui/src/Form/Core/Checkbox.svelte | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/bbui/src/Form/Core/Checkbox.svelte b/packages/bbui/src/Form/Core/Checkbox.svelte index a5b366c262..8384c8ca09 100644 --- a/packages/bbui/src/Form/Core/Checkbox.svelte +++ b/packages/bbui/src/Form/Core/Checkbox.svelte @@ -47,7 +47,9 @@ - {text || ""} + {#if text} + {text} + {/if} From 04624ece07f9d7f90b45cda21dab9bf3a73822ec Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Thu, 24 Feb 2022 09:14:16 +0000 Subject: [PATCH 21/49] Fix selecting all rows and fix table click events clashing with row selection --- packages/bbui/src/Table/Table.svelte | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/packages/bbui/src/Table/Table.svelte b/packages/bbui/src/Table/Table.svelte index 20633a3a29..c9d7f12339 100644 --- a/packages/bbui/src/Table/Table.svelte +++ b/packages/bbui/src/Table/Table.svelte @@ -219,14 +219,19 @@ } const toggleSelectAll = e => { - if (e.detail) { - selectedRows = [...selectedRows, ...rows] + const select = !!e.detail + if (select) { + // Add any rows which are not already in selected rows + rows.forEach(row => { + if (selectedRows.findIndex(x => x._id === row._id) === -1) { + selectedRows.push(row) + } + }) } else { - //remove every object from selectedRows that is not in rows - let filtered = selectedRows.filter(el => + // Remove any rows from selected rows that are in the current data set + selectedRows = selectedRows.filter(el => rows.every(f => f._id !== el._id) ) - selectedRows = filtered } } @@ -335,13 +340,16 @@ {#if showEditColumn}
{ + toggleSelectRow(row) + e.stopPropagation() + }} > selectedRow._id === row._id ) !== -1} - onToggleSelection={() => toggleSelectRow(row)} onEdit={e => editRow(e, row)} {allowSelectRows} {allowEditRows} From defe725bcc4fae437101798c3eaa4827cb0d5c8f Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Thu, 24 Feb 2022 09:15:37 +0000 Subject: [PATCH 22/49] Fix table selection defaulting to true, reset selected rows when unmounting tables, remove position absolute on row selection text --- .../src/components/app/table/Table.svelte | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/packages/client/src/components/app/table/Table.svelte b/packages/client/src/components/app/table/Table.svelte index 6d04597978..f5f591688f 100644 --- a/packages/client/src/components/app/table/Table.svelte +++ b/packages/client/src/components/app/table/Table.svelte @@ -3,6 +3,7 @@ import { Table } from "@budibase/bbui" import SlotRenderer from "./SlotRenderer.svelte" import { UnsortableTypes } from "../../../constants" + import { onDestroy } from "svelte" export let dataProvider export let columns @@ -38,13 +39,13 @@ dataProvider?.id, ActionTypes.SetDataProviderSorting ) - $: { rowSelectionStore.actions.updateSelection( $component.id, selectedRows.map(row => row._id) ) } + const getFields = (schema, customColumns, showAutoColumns) => { // Check for an invalid column selection let invalid = false @@ -125,6 +126,10 @@ const split = linkURL.split("/:") routeStore.actions.navigate(`${split[0]}/${id}`, linkPeek) } + + onDestroy(() => { + rowSelectionStore.actions.updateSelection($component.id, []) + })
@@ -136,7 +141,7 @@ {quiet} {compact} {customRenderers} - {allowSelectRows} + allowSelectRows={!!allowSelectRows} bind:selectedRows allowEditRows={false} allowEditColumns={false} @@ -148,8 +153,10 @@ > - {#if allowSelectRows} -
{selectedRows.length} record(s) selected
+ {#if allowSelectRows && selectedRows.length} +
+ {selectedRows.length} row{selectedRows.length === 1 ? "" : "s"} selected +
{/if}
@@ -159,7 +166,6 @@ } .row-count { - margin-top: calc(1.4 * var(--spacing-xl)); - position: absolute; + margin-top: var(--spacing-l); } From 08d6e104c7db4ecc420d1aa93553d4ac1314a0ae Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Thu, 24 Feb 2022 09:16:35 +0000 Subject: [PATCH 23/49] Fix missing prop from table block and add fixed context provider ID for tables inside table blocks to support row selection bindings --- packages/client/src/components/app/blocks/TableBlock.svelte | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/client/src/components/app/blocks/TableBlock.svelte b/packages/client/src/components/app/blocks/TableBlock.svelte index 39d9be9a41..70980669b6 100644 --- a/packages/client/src/components/app/blocks/TableBlock.svelte +++ b/packages/client/src/components/app/blocks/TableBlock.svelte @@ -18,6 +18,7 @@ export let quiet export let compact export let size + export let allowSelectRows export let linkRows export let linkURL export let linkColumn @@ -157,6 +158,7 @@ > Date: Thu, 24 Feb 2022 09:17:27 +0000 Subject: [PATCH 24/49] Fix table row selection bindings not being generated, add row selection bindings for table blocks, update readable text for row selection bindings --- .../builder/src/builderStore/dataBinding.js | 39 ++++++++++++------- 1 file changed, 25 insertions(+), 14 deletions(-) diff --git a/packages/builder/src/builderStore/dataBinding.js b/packages/builder/src/builderStore/dataBinding.js index 4ff608b480..b4d1c0d1c1 100644 --- a/packages/builder/src/builderStore/dataBinding.js +++ b/packages/builder/src/builderStore/dataBinding.js @@ -32,7 +32,7 @@ export const getBindableProperties = (asset, componentId) => { const urlBindings = getUrlBindings(asset) const deviceBindings = getDeviceBindings() const stateBindings = getStateBindings() - const rowBindings = getRowBindings(asset, componentId) + const rowBindings = getRowBindings(asset) return [ ...contextBindings, ...urlBindings, @@ -320,22 +320,33 @@ const getDeviceBindings = () => { /** * Gets all row bindings that are globally available. */ -const getRowBindings = () => { - let tables = [] - getAllAssets().forEach(asset => { - tables = findAllMatchingComponents(asset.props, component => - component._component.endsWith("table") - ) - }) - +const getRowBindings = asset => { let bindings = [] if (get(store).clientFeatures?.rowSelection) { + // Add bindings for table components + let tables = findAllMatchingComponents(asset.props, component => + component._component.endsWith("table") + ) const safeState = makePropSafe("rowSelection") - bindings = tables.map(table => ({ - type: "context", - runtimeBinding: `${safeState}.${makePropSafe(table._id)}`, - readableBinding: `${table._instanceName}.Rows`, - })) + bindings = bindings.concat( + tables.map(table => ({ + type: "context", + runtimeBinding: `${safeState}.${makePropSafe(table._id)}`, + readableBinding: `${table._instanceName}.Selected rows`, + })) + ) + + // Add bindings for table blocks + let tableBlocks = findAllMatchingComponents(asset.props, component => + component._component.endsWith("tableblock") + ) + bindings = bindings.concat( + tableBlocks.map(block => ({ + type: "context", + runtimeBinding: `${safeState}.${makePropSafe(block._id + "-table")}`, + readableBinding: `${block._instanceName}.Selected rows`, + })) + ) } return bindings } From 0338e8c7b574c9cb791069438d4714e095b9a0a5 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Fri, 25 Feb 2022 08:25:56 +0000 Subject: [PATCH 25/49] Ensure data binding generation doesn't crash if no asset is selected --- packages/builder/src/builderStore/dataBinding.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/builder/src/builderStore/dataBinding.js b/packages/builder/src/builderStore/dataBinding.js index b4d1c0d1c1..60cce2b1fd 100644 --- a/packages/builder/src/builderStore/dataBinding.js +++ b/packages/builder/src/builderStore/dataBinding.js @@ -32,14 +32,14 @@ export const getBindableProperties = (asset, componentId) => { const urlBindings = getUrlBindings(asset) const deviceBindings = getDeviceBindings() const stateBindings = getStateBindings() - const rowBindings = getRowBindings(asset) + const selectedRowsBindings = getSelectedRowsBindings(asset) return [ ...contextBindings, ...urlBindings, ...stateBindings, ...userBindings, ...deviceBindings, - ...rowBindings, + ...selectedRowsBindings, ] } @@ -318,13 +318,13 @@ const getDeviceBindings = () => { } /** - * Gets all row bindings that are globally available. + * Gets all selected rows bindings for tables in the current asset. */ -const getRowBindings = asset => { +const getSelectedRowsBindings = asset => { let bindings = [] if (get(store).clientFeatures?.rowSelection) { // Add bindings for table components - let tables = findAllMatchingComponents(asset.props, component => + let tables = findAllMatchingComponents(asset?.props, component => component._component.endsWith("table") ) const safeState = makePropSafe("rowSelection") @@ -337,7 +337,7 @@ const getRowBindings = asset => { ) // Add bindings for table blocks - let tableBlocks = findAllMatchingComponents(asset.props, component => + let tableBlocks = findAllMatchingComponents(asset?.props, component => component._component.endsWith("tableblock") ) bindings = bindings.concat( From 63e64f0da17c7887e85f8cd02a043fd9f54ee3bd Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Fri, 25 Feb 2022 13:40:23 +0000 Subject: [PATCH 26/49] Try to fix cypress tests again --- packages/builder/cypress/support/commands.js | 22 +++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/packages/builder/cypress/support/commands.js b/packages/builder/cypress/support/commands.js index 40fe6706c9..bc5bfb9626 100644 --- a/packages/builder/cypress/support/commands.js +++ b/packages/builder/cypress/support/commands.js @@ -172,17 +172,19 @@ Cypress.Commands.add("addRow", values => { Cypress.Commands.add("addRowMultiValue", values => { cy.contains("Create row").click() - cy.get(".spectrum-Form-itemField") - .click() - .then(() => { - cy.get(".spectrum-Popover").within(() => { - for (let i = 0; i < values.length; i++) { - cy.get(".spectrum-Menu-item").eq(i).click() - } + cy.get(".spectrum-Modal").within(() => { + cy.get(".spectrum-Form-itemField") + .click() + .then(() => { + cy.get(".spectrum-Popover").within(() => { + for (let i = 0; i < values.length; i++) { + cy.get(".spectrum-Menu-item").eq(i).click() + } + }) + cy.get(".spectrum-Dialog-grid").click("top") + cy.get(".spectrum-ButtonGroup").contains("Create").click() }) - cy.get(".spectrum-Dialog-grid").click("top") - cy.get(".spectrum-ButtonGroup").contains("Create").click() - }) + }) }) Cypress.Commands.add("createUser", email => { From 2786f657c74b61e0f4c33a7d0a9db85983251291 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Fri, 25 Feb 2022 14:18:26 +0000 Subject: [PATCH 27/49] Improve REST query naming in navigation --- .../DatasourceNavigator.svelte | 8 +++-- packages/builder/src/helpers/data/utils.js | 30 +++++++++++++++++++ 2 files changed, 36 insertions(+), 2 deletions(-) diff --git a/packages/builder/src/components/backend/DatasourceNavigator/DatasourceNavigator.svelte b/packages/builder/src/components/backend/DatasourceNavigator/DatasourceNavigator.svelte index 661c125377..45ff66a901 100644 --- a/packages/builder/src/components/backend/DatasourceNavigator/DatasourceNavigator.svelte +++ b/packages/builder/src/components/backend/DatasourceNavigator/DatasourceNavigator.svelte @@ -8,7 +8,11 @@ import EditQueryPopover from "./popovers/EditQueryPopover.svelte" import NavItem from "components/common/NavItem.svelte" import TableNavigator from "components/backend/TableNavigator/TableNavigator.svelte" - import { customQueryIconText, customQueryIconColor } from "helpers/data/utils" + import { + customQueryIconText, + customQueryIconColor, + customQueryText, + } from "helpers/data/utils" import ICONS from "./icons" import { notifications } from "@budibase/bbui" @@ -137,7 +141,7 @@ icon="SQLQuery" iconText={customQueryIconText(datasource, query)} iconColor={customQueryIconColor(datasource, query)} - text={query.name} + text={customQueryText(datasource, query)} opened={$queries.selected === query._id} selected={$queries.selected === query._id} on:click={() => onClickQuery(query)} diff --git a/packages/builder/src/helpers/data/utils.js b/packages/builder/src/helpers/data/utils.js index 0e99109189..8fe7b617a2 100644 --- a/packages/builder/src/helpers/data/utils.js +++ b/packages/builder/src/helpers/data/utils.js @@ -109,6 +109,36 @@ export function customQueryIconColor(datasource, query) { } } +export function customQueryText(datasource, query) { + if (!query.name || datasource.source !== IntegrationTypes.REST) { + return query.name + } + + // Remove protocol + let name = query.name + if (name.includes("://")) { + name = name.split("://")[1] + } + + // If no path, return the full name + if (!name.includes("/")) { + return name + } + + // Remove trailing slash + if (name.endsWith("/")) { + name = name.slice(0, -1) + } + + // Only use path + const split = name.split("/") + if (split[1]) { + return `/${split.slice(1).join("/")}` + } else { + return split[0] + } +} + export function flipHeaderState(headersActivity) { if (!headersActivity) { return {} From 43042052249c3942ac16669e6af223fa10a372c8 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Fri, 25 Feb 2022 14:29:25 +0000 Subject: [PATCH 28/49] Handle leading double slash when displaying REST queries in navigation --- packages/builder/src/helpers/data/utils.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/builder/src/helpers/data/utils.js b/packages/builder/src/helpers/data/utils.js index 8fe7b617a2..47a8075070 100644 --- a/packages/builder/src/helpers/data/utils.js +++ b/packages/builder/src/helpers/data/utils.js @@ -116,8 +116,8 @@ export function customQueryText(datasource, query) { // Remove protocol let name = query.name - if (name.includes("://")) { - name = name.split("://")[1] + if (name.includes("//")) { + name = name.split("//")[1] } // If no path, return the full name From 02c688539a2fcb00bbc6cf332c0b6bcd85bfb5f6 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Fri, 25 Feb 2022 16:24:36 +0000 Subject: [PATCH 29/49] Pls cypress --- .../integration/datasources/rest.spec.js | 80 ++++----- .../queryLevelTransformers.spec.js | 154 ++++++++++-------- packages/builder/cypress/support/commands.js | 4 +- 3 files changed, 132 insertions(+), 106 deletions(-) diff --git a/packages/builder/cypress/integration/datasources/rest.spec.js b/packages/builder/cypress/integration/datasources/rest.spec.js index f39d174831..58ba74795a 100644 --- a/packages/builder/cypress/integration/datasources/rest.spec.js +++ b/packages/builder/cypress/integration/datasources/rest.spec.js @@ -1,43 +1,45 @@ import filterTests from "../../support/filterTests" -filterTests(['smoke', 'all'], () => { - context("REST Datasource Testing", () => { - before(() => { - cy.login() - cy.createTestApp() - }) - - const datasource = "REST" - const restUrl = "https://api.openbrewerydb.org/breweries" - - it("Should add REST data source with incorrect API", () => { - // Select REST data source - cy.selectExternalDatasource(datasource) - // Enter incorrect api & attempt to send query - cy.wait(500) - cy.get(".spectrum-Button").contains("Add query").click({ force: true }) - cy.intercept('**/preview').as('queryError') - cy.get("input").clear().type("random text") - cy.get(".spectrum-Button").contains("Send").click({ force: true }) - // Intercept Request after button click & apply assertions - cy.wait("@queryError") - cy.get("@queryError").its('response.body') - .should('have.property', 'message', 'Invalid URL: http://random text?') - cy.get("@queryError").its('response.body') - .should('have.property', 'status', 400) - }) - - it("should add and configure a REST datasource", () => { - // Select REST datasource and create query - cy.selectExternalDatasource(datasource) - cy.wait(500) - // createRestQuery confirms query creation - cy.createRestQuery("GET", restUrl) - // Confirm status code response within REST datasource - cy.get(".spectrum-FieldLabel") - .contains("Status") - .children() - .should('contain', 200) - }) +filterTests(["smoke", "all"], () => { + context("REST Datasource Testing", () => { + before(() => { + cy.login() + cy.createTestApp() }) + + const datasource = "REST" + const restUrl = "https://api.openbrewerydb.org/breweries" + + it("Should add REST data source with incorrect API", () => { + // Select REST data source + cy.selectExternalDatasource(datasource) + // Enter incorrect api & attempt to send query + cy.wait(500) + cy.get(".spectrum-Button").contains("Add query").click({ force: true }) + cy.intercept("**/preview").as("queryError") + cy.get("input").clear().type("random text") + cy.get(".spectrum-Button").contains("Send").click({ force: true }) + // Intercept Request after button click & apply assertions + cy.wait("@queryError") + cy.get("@queryError") + .its("response.body") + .should("have.property", "message", "Invalid URL: http://random text?") + cy.get("@queryError") + .its("response.body") + .should("have.property", "status", 400) + }) + + it("should add and configure a REST datasource", () => { + // Select REST datasource and create query + cy.selectExternalDatasource(datasource) + cy.wait(500) + // createRestQuery confirms query creation + cy.createRestQuery("GET", restUrl, "/breweries") + // Confirm status code response within REST datasource + cy.get(".spectrum-FieldLabel") + .contains("Status") + .children() + .should("contain", 200) + }) + }) }) diff --git a/packages/builder/cypress/integration/queryLevelTransformers.spec.js b/packages/builder/cypress/integration/queryLevelTransformers.spec.js index d6d4278eb4..e96a6dba29 100644 --- a/packages/builder/cypress/integration/queryLevelTransformers.spec.js +++ b/packages/builder/cypress/integration/queryLevelTransformers.spec.js @@ -1,115 +1,139 @@ import filterTests from "../support/filterTests" -filterTests(['smoke', 'all'], () => { +filterTests(["smoke", "all"], () => { context("Query Level Transformers", () => { before(() => { cy.login() cy.deleteApp("Cypress Tests") cy.createApp("Cypress Tests") }) - + it("should write a transformer function", () => { - // Add REST datasource - contains API for breweries - const datasource = "REST" - const restUrl = "https://api.openbrewerydb.org/breweries" - cy.selectExternalDatasource(datasource) - cy.createRestQuery("GET", restUrl) - cy.get(".spectrum-Tabs-itemLabel").contains("Transformer").click() - // Get Transformer Function from file - cy.readFile("cypress/support/queryLevelTransformerFunction.js").then((transformerFunction) => { + // Add REST datasource - contains API for breweries + const datasource = "REST" + const restUrl = "https://api.openbrewerydb.org/breweries" + cy.selectExternalDatasource(datasource) + cy.createRestQuery("GET", restUrl, "/breweries") + cy.get(".spectrum-Tabs-itemLabel").contains("Transformer").click() + // Get Transformer Function from file + cy.readFile("cypress/support/queryLevelTransformerFunction.js").then( + transformerFunction => { cy.get(".CodeMirror textarea") - // Highlight current text and overwrite with file contents - .type(Cypress.platform === 'darwin' ? '{cmd}a' : '{ctrl}a', { force: true }) - .type(transformerFunction, { parseSpecialCharSequences: false }) - }) - // Send Query - cy.intercept('**/queries/preview').as('query') - cy.get(".spectrum-Button").contains("Send").click({ force: true }) - cy.wait("@query") - // Assert against Status Code, body, & body rows - cy.get("@query").its('response.statusCode') - .should('eq', 200) - cy.get("@query").its('response.body').should('not.be.empty') - cy.get("@query").its('response.body.rows').should('not.be.empty') - }) - + // Highlight current text and overwrite with file contents + .type(Cypress.platform === "darwin" ? "{cmd}a" : "{ctrl}a", { + force: true, + }) + .type(transformerFunction, { parseSpecialCharSequences: false }) + } + ) + // Send Query + cy.intercept("**/queries/preview").as("query") + cy.get(".spectrum-Button").contains("Send").click({ force: true }) + cy.wait("@query") + // Assert against Status Code, body, & body rows + cy.get("@query").its("response.statusCode").should("eq", 200) + cy.get("@query").its("response.body").should("not.be.empty") + cy.get("@query").its("response.body.rows").should("not.be.empty") + }) + it("should add data to the previous query", () => { // Add REST datasource - contains API for breweries const datasource = "REST" const restUrl = "https://api.openbrewerydb.org/breweries" cy.selectExternalDatasource(datasource) - cy.createRestQuery("GET", restUrl) + cy.createRestQuery("GET", restUrl, "/breweries") cy.get(".spectrum-Tabs-itemLabel").contains("Transformer").click() // Get Transformer Function with Data from file - cy.readFile("cypress/support/queryLevelTransformerFunctionWithData.js").then((transformerFunction) => { + cy.readFile( + "cypress/support/queryLevelTransformerFunctionWithData.js" + ).then(transformerFunction => { //console.log(transformerFunction[1]) cy.get(".CodeMirror textarea") - // Highlight current text and overwrite with file contents - .type(Cypress.platform === 'darwin' ? '{cmd}a' : '{ctrl}a', { force: true }) - .type(transformerFunction, { parseSpecialCharSequences: false }) + // Highlight current text and overwrite with file contents + .type(Cypress.platform === "darwin" ? "{cmd}a" : "{ctrl}a", { + force: true, + }) + .type(transformerFunction, { parseSpecialCharSequences: false }) }) // Send Query - cy.intercept('**/queries/preview').as('query') + cy.intercept("**/queries/preview").as("query") cy.get(".spectrum-Button").contains("Send").click({ force: true }) cy.wait("@query") // Assert against Status Code, body, & body rows - cy.get("@query").its('response.statusCode') - .should('eq', 200) - cy.get("@query").its('response.body').should('not.be.empty') - cy.get("@query").its('response.body.rows').should('not.be.empty') + cy.get("@query").its("response.statusCode").should("eq", 200) + cy.get("@query").its("response.body").should("not.be.empty") + cy.get("@query").its("response.body.rows").should("not.be.empty") }) - + it("should run an invalid query within the transformer section", () => { // Add REST datasource - contains API for breweries const datasource = "REST" const restUrl = "https://api.openbrewerydb.org/breweries" cy.selectExternalDatasource(datasource) - cy.createRestQuery("GET", restUrl) + cy.createRestQuery("GET", restUrl, "/breweries") cy.get(".spectrum-Tabs-itemLabel").contains("Transformer").click() // Clear the code box and add "test" cy.get(".CodeMirror textarea") - .type(Cypress.platform === 'darwin' ? '{cmd}a' : '{ctrl}a', { force: true }) - .type("test") + .type(Cypress.platform === "darwin" ? "{cmd}a" : "{ctrl}a", { + force: true, + }) + .type("test") // Run Query and intercept - cy.intercept('**/preview').as('queryError') + cy.intercept("**/preview").as("queryError") cy.get(".spectrum-Button").contains("Send").click({ force: true }) cy.wait("@queryError") cy.wait(500) // Assert against message and status for the query error - cy.get("@queryError").its('response.body').should('have.property', 'message', "test is not defined") - cy.get("@queryError").its('response.body').should('have.property', 'status', 400) + cy.get("@queryError") + .its("response.body") + .should("have.property", "message", "test is not defined") + cy.get("@queryError") + .its("response.body") + .should("have.property", "status", 400) }) - + xit("should run an invalid query via POST request", () => { // POST request with transformer as null - cy.request({method: 'POST', - url: `${Cypress.config().baseUrl}/api/queries/`, - body: {fields : {"headers":{},"queryString":null,"path":null}, - parameters : [], - schema : {}, - name : "test", - queryVerb : "read", - transformer : null, - datasourceId: "test"}, - // Expected 400 error - Transformer must be a string - failOnStatusCode: false}).then((response) => { + cy.request({ + method: "POST", + url: `${Cypress.config().baseUrl}/api/queries/`, + body: { + fields: { headers: {}, queryString: null, path: null }, + parameters: [], + schema: {}, + name: "test", + queryVerb: "read", + transformer: null, + datasourceId: "test", + }, + // Expected 400 error - Transformer must be a string + failOnStatusCode: false, + }).then(response => { expect(response.status).to.equal(400) - expect(response.body.message).to.include('Invalid body - "transformer" must be a string') + expect(response.body.message).to.include( + 'Invalid body - "transformer" must be a string' + ) }) }) - + xit("should run an empty query", () => { // POST request with Transformer as an empty string - cy.request({method: 'POST', - url: `${Cypress.config().baseUrl}/api/queries/preview`, - body: {fields : {"headers":{},"queryString":null,"path":null}, - queryVerb : "read", - transformer : "", - datasourceId: "test"}, - // Expected 400 error - Transformer is not allowed to be empty - failOnStatusCode: false}).then((response) => { + cy.request({ + method: "POST", + url: `${Cypress.config().baseUrl}/api/queries/preview`, + body: { + fields: { headers: {}, queryString: null, path: null }, + queryVerb: "read", + transformer: "", + datasourceId: "test", + }, + // Expected 400 error - Transformer is not allowed to be empty + failOnStatusCode: false, + }).then(response => { expect(response.status).to.equal(400) - expect(response.body.message).to.include('Invalid body - "transformer" is not allowed to be empty') + expect(response.body.message).to.include( + 'Invalid body - "transformer" is not allowed to be empty' + ) }) }) }) diff --git a/packages/builder/cypress/support/commands.js b/packages/builder/cypress/support/commands.js index 40fe6706c9..8e205f7d67 100644 --- a/packages/builder/cypress/support/commands.js +++ b/packages/builder/cypress/support/commands.js @@ -435,7 +435,7 @@ Cypress.Commands.add("addDatasourceConfig", (datasource, skipFetch) => { } }) -Cypress.Commands.add("createRestQuery", (method, restUrl) => { +Cypress.Commands.add("createRestQuery", (method, restUrl, queryPrettyName) => { // addExternalDatasource should be called prior to this // Configures REST datasource & sends query cy.wait(1000) @@ -450,5 +450,5 @@ Cypress.Commands.add("createRestQuery", (method, restUrl) => { cy.get(".spectrum-Button").contains("Save").click({ force: true }) cy.get(".hierarchy-items-container") .should("contain", method) - .and("contain", restUrl) + .and("contain", queryPrettyName) }) From 4f5d3fc446838674b9791e832ba219bdb74dac83 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Fri, 25 Feb 2022 21:26:08 +0000 Subject: [PATCH 30/49] Fix incorrect syntax for showing a notification while executing custom queries --- packages/client/src/utils/buttonActions.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/client/src/utils/buttonActions.js b/packages/client/src/utils/buttonActions.js index 72c8f9c083..ca7be60151 100644 --- a/packages/client/src/utils/buttonActions.js +++ b/packages/client/src/utils/buttonActions.js @@ -127,7 +127,7 @@ const queryExecutionHandler = async action => { // Trigger a notification and invalidate the datasource as long as this // was not a readable query if (!query.readable) { - API.notifications.error.success("Query executed successfully") + notificationStore.actions.success("Query executed successfully") await dataSourceStore.actions.invalidateDataSource(query.datasourceId) } From 47d8a1e6285b0a98aa48ea0d07a31ce8b3b91fbe Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Fri, 25 Feb 2022 21:29:02 +0000 Subject: [PATCH 31/49] Add error notification if executing a query in a button action fails --- packages/client/src/utils/buttonActions.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/client/src/utils/buttonActions.js b/packages/client/src/utils/buttonActions.js index ca7be60151..fec966725b 100644 --- a/packages/client/src/utils/buttonActions.js +++ b/packages/client/src/utils/buttonActions.js @@ -133,6 +133,10 @@ const queryExecutionHandler = async action => { return { result } } catch (error) { + notificationStore.actions.error( + "An error occurred while executing the query" + ) + // Abort next actions return false } From 4a16d695ee29ba45ea96709332ff8792081e3bff Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Mon, 28 Feb 2022 08:22:58 +0000 Subject: [PATCH 32/49] v1.0.76 --- lerna.json | 2 +- packages/backend-core/package.json | 2 +- packages/bbui/package.json | 2 +- packages/builder/package.json | 10 +++++----- packages/cli/package.json | 2 +- packages/client/package.json | 8 ++++---- packages/frontend-core/package.json | 4 ++-- packages/server/package.json | 8 ++++---- packages/string-templates/package.json | 2 +- packages/worker/package.json | 6 +++--- 10 files changed, 23 insertions(+), 23 deletions(-) diff --git a/lerna.json b/lerna.json index 3769058ae0..df9628e3b8 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "1.0.75", + "version": "1.0.76", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index bb8b875a8f..5b0f29320b 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/backend-core", - "version": "1.0.75", + "version": "1.0.76", "description": "Budibase backend core libraries used in server and worker", "main": "src/index.js", "author": "Budibase", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index 1fd0ff68e2..1d3186b302 100644 --- a/packages/bbui/package.json +++ b/packages/bbui/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/bbui", "description": "A UI solution used in the different Budibase projects.", - "version": "1.0.75", + "version": "1.0.76", "license": "MPL-2.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", diff --git a/packages/builder/package.json b/packages/builder/package.json index d9d9baed7e..209d3493c9 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "1.0.75", + "version": "1.0.76", "license": "GPL-3.0", "private": true, "scripts": { @@ -64,10 +64,10 @@ } }, "dependencies": { - "@budibase/bbui": "^1.0.75", - "@budibase/client": "^1.0.75", - "@budibase/frontend-core": "^1.0.75", - "@budibase/string-templates": "^1.0.75", + "@budibase/bbui": "^1.0.76", + "@budibase/client": "^1.0.76", + "@budibase/frontend-core": "^1.0.76", + "@budibase/string-templates": "^1.0.76", "@sentry/browser": "5.19.1", "@spectrum-css/page": "^3.0.1", "@spectrum-css/vars": "^3.0.1", diff --git a/packages/cli/package.json b/packages/cli/package.json index 491432250e..03ba035c7a 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "1.0.75", + "version": "1.0.76", "description": "Budibase CLI, for developers, self hosting and migrations.", "main": "src/index.js", "bin": { diff --git a/packages/client/package.json b/packages/client/package.json index 437c85a8fe..166edbc0bf 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "1.0.75", + "version": "1.0.76", "license": "MPL-2.0", "module": "dist/budibase-client.js", "main": "dist/budibase-client.js", @@ -19,9 +19,9 @@ "dev:builder": "rollup -cw" }, "dependencies": { - "@budibase/bbui": "^1.0.75", - "@budibase/frontend-core": "^1.0.75", - "@budibase/string-templates": "^1.0.75", + "@budibase/bbui": "^1.0.76", + "@budibase/frontend-core": "^1.0.76", + "@budibase/string-templates": "^1.0.76", "regexparam": "^1.3.0", "rollup-plugin-polyfill-node": "^0.8.0", "shortid": "^2.2.15", diff --git a/packages/frontend-core/package.json b/packages/frontend-core/package.json index bc59939f25..1d9f9efbb9 100644 --- a/packages/frontend-core/package.json +++ b/packages/frontend-core/package.json @@ -1,12 +1,12 @@ { "name": "@budibase/frontend-core", - "version": "1.0.75", + "version": "1.0.76", "description": "Budibase frontend core libraries used in builder and client", "author": "Budibase", "license": "MPL-2.0", "svelte": "src/index.js", "dependencies": { - "@budibase/bbui": "^1.0.75", + "@budibase/bbui": "^1.0.76", "lodash": "^4.17.21", "svelte": "^3.46.2" } diff --git a/packages/server/package.json b/packages/server/package.json index 0c6b7b4388..a71f16f76b 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "1.0.75", + "version": "1.0.76", "description": "Budibase Web Server", "main": "src/index.ts", "repository": { @@ -73,9 +73,9 @@ "license": "GPL-3.0", "dependencies": { "@apidevtools/swagger-parser": "^10.0.3", - "@budibase/backend-core": "^1.0.75", - "@budibase/client": "^1.0.75", - "@budibase/string-templates": "^1.0.75", + "@budibase/backend-core": "^1.0.76", + "@budibase/client": "^1.0.76", + "@budibase/string-templates": "^1.0.76", "@bull-board/api": "^3.7.0", "@bull-board/koa": "^3.7.0", "@elastic/elasticsearch": "7.10.0", diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index 4237b8db76..e755f01915 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "1.0.75", + "version": "1.0.76", "description": "Handlebars wrapper for Budibase templating.", "main": "src/index.cjs", "module": "dist/bundle.mjs", diff --git a/packages/worker/package.json b/packages/worker/package.json index 5f9984ddb6..aa605e681e 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/worker", "email": "hi@budibase.com", - "version": "1.0.75", + "version": "1.0.76", "description": "Budibase background service", "main": "src/index.ts", "repository": { @@ -34,8 +34,8 @@ "author": "Budibase", "license": "GPL-3.0", "dependencies": { - "@budibase/backend-core": "^1.0.75", - "@budibase/string-templates": "^1.0.75", + "@budibase/backend-core": "^1.0.76", + "@budibase/string-templates": "^1.0.76", "@koa/router": "^8.0.0", "@sentry/node": "^6.0.0", "@techpass/passport-openidconnect": "^0.3.0", From e0df3787ca31e688d6908424bcb744188fceedc8 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Mon, 28 Feb 2022 08:37:59 +0000 Subject: [PATCH 33/49] Make view UI read only and limit rows to 10 --- .../src/components/backend/DataTable/ViewDataTable.svelte | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/builder/src/components/backend/DataTable/ViewDataTable.svelte b/packages/builder/src/components/backend/DataTable/ViewDataTable.svelte index 10c6703623..cf525f3ef3 100644 --- a/packages/builder/src/components/backend/DataTable/ViewDataTable.svelte +++ b/packages/builder/src/components/backend/DataTable/ViewDataTable.svelte @@ -57,7 +57,8 @@ {data} {loading} {type} - allowEditing={!view?.calculation} + allowEditing={false} + rowCount={10} bind:hideAutocolumns > From 87403f6a99df479b771aa52ec69579306f47b674 Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Mon, 28 Feb 2022 12:19:05 +0000 Subject: [PATCH 34/49] v1.0.77 --- lerna.json | 2 +- packages/backend-core/package.json | 2 +- packages/bbui/package.json | 2 +- packages/builder/package.json | 10 +++++----- packages/cli/package.json | 2 +- packages/client/package.json | 8 ++++---- packages/frontend-core/package.json | 4 ++-- packages/server/package.json | 8 ++++---- packages/string-templates/package.json | 2 +- packages/worker/package.json | 6 +++--- 10 files changed, 23 insertions(+), 23 deletions(-) diff --git a/lerna.json b/lerna.json index df9628e3b8..493fcef77b 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "1.0.76", + "version": "1.0.77", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index 5b0f29320b..1682a29468 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/backend-core", - "version": "1.0.76", + "version": "1.0.77", "description": "Budibase backend core libraries used in server and worker", "main": "src/index.js", "author": "Budibase", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index 1d3186b302..0105df3fc1 100644 --- a/packages/bbui/package.json +++ b/packages/bbui/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/bbui", "description": "A UI solution used in the different Budibase projects.", - "version": "1.0.76", + "version": "1.0.77", "license": "MPL-2.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", diff --git a/packages/builder/package.json b/packages/builder/package.json index 209d3493c9..4a8ad7b832 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "1.0.76", + "version": "1.0.77", "license": "GPL-3.0", "private": true, "scripts": { @@ -64,10 +64,10 @@ } }, "dependencies": { - "@budibase/bbui": "^1.0.76", - "@budibase/client": "^1.0.76", - "@budibase/frontend-core": "^1.0.76", - "@budibase/string-templates": "^1.0.76", + "@budibase/bbui": "^1.0.77", + "@budibase/client": "^1.0.77", + "@budibase/frontend-core": "^1.0.77", + "@budibase/string-templates": "^1.0.77", "@sentry/browser": "5.19.1", "@spectrum-css/page": "^3.0.1", "@spectrum-css/vars": "^3.0.1", diff --git a/packages/cli/package.json b/packages/cli/package.json index 03ba035c7a..adf6834143 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "1.0.76", + "version": "1.0.77", "description": "Budibase CLI, for developers, self hosting and migrations.", "main": "src/index.js", "bin": { diff --git a/packages/client/package.json b/packages/client/package.json index 166edbc0bf..41dd1b1142 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "1.0.76", + "version": "1.0.77", "license": "MPL-2.0", "module": "dist/budibase-client.js", "main": "dist/budibase-client.js", @@ -19,9 +19,9 @@ "dev:builder": "rollup -cw" }, "dependencies": { - "@budibase/bbui": "^1.0.76", - "@budibase/frontend-core": "^1.0.76", - "@budibase/string-templates": "^1.0.76", + "@budibase/bbui": "^1.0.77", + "@budibase/frontend-core": "^1.0.77", + "@budibase/string-templates": "^1.0.77", "regexparam": "^1.3.0", "rollup-plugin-polyfill-node": "^0.8.0", "shortid": "^2.2.15", diff --git a/packages/frontend-core/package.json b/packages/frontend-core/package.json index 1d9f9efbb9..fc5ccd8d99 100644 --- a/packages/frontend-core/package.json +++ b/packages/frontend-core/package.json @@ -1,12 +1,12 @@ { "name": "@budibase/frontend-core", - "version": "1.0.76", + "version": "1.0.77", "description": "Budibase frontend core libraries used in builder and client", "author": "Budibase", "license": "MPL-2.0", "svelte": "src/index.js", "dependencies": { - "@budibase/bbui": "^1.0.76", + "@budibase/bbui": "^1.0.77", "lodash": "^4.17.21", "svelte": "^3.46.2" } diff --git a/packages/server/package.json b/packages/server/package.json index a71f16f76b..d00f3d38d4 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "1.0.76", + "version": "1.0.77", "description": "Budibase Web Server", "main": "src/index.ts", "repository": { @@ -73,9 +73,9 @@ "license": "GPL-3.0", "dependencies": { "@apidevtools/swagger-parser": "^10.0.3", - "@budibase/backend-core": "^1.0.76", - "@budibase/client": "^1.0.76", - "@budibase/string-templates": "^1.0.76", + "@budibase/backend-core": "^1.0.77", + "@budibase/client": "^1.0.77", + "@budibase/string-templates": "^1.0.77", "@bull-board/api": "^3.7.0", "@bull-board/koa": "^3.7.0", "@elastic/elasticsearch": "7.10.0", diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index e755f01915..43eb469bd5 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "1.0.76", + "version": "1.0.77", "description": "Handlebars wrapper for Budibase templating.", "main": "src/index.cjs", "module": "dist/bundle.mjs", diff --git a/packages/worker/package.json b/packages/worker/package.json index aa605e681e..5e5762eb56 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/worker", "email": "hi@budibase.com", - "version": "1.0.76", + "version": "1.0.77", "description": "Budibase background service", "main": "src/index.ts", "repository": { @@ -34,8 +34,8 @@ "author": "Budibase", "license": "GPL-3.0", "dependencies": { - "@budibase/backend-core": "^1.0.76", - "@budibase/string-templates": "^1.0.76", + "@budibase/backend-core": "^1.0.77", + "@budibase/string-templates": "^1.0.77", "@koa/router": "^8.0.0", "@sentry/node": "^6.0.0", "@techpass/passport-openidconnect": "^0.3.0", From c4ebc85f3cf80bf77a9e9eb87236b9c650d4f991 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Mon, 28 Feb 2022 15:00:45 +0000 Subject: [PATCH 35/49] Fix soft bricking app when closing nested modals using escape key --- packages/bbui/src/Modal/Modal.svelte | 57 ++++++++++++++++------------ 1 file changed, 33 insertions(+), 24 deletions(-) diff --git a/packages/bbui/src/Modal/Modal.svelte b/packages/bbui/src/Modal/Modal.svelte index f805dec0ad..706ee56bb2 100644 --- a/packages/bbui/src/Modal/Modal.svelte +++ b/packages/bbui/src/Modal/Modal.svelte @@ -54,34 +54,43 @@ - - -{#if visible && inline} -
- -
-{:else if visible} +{#if inline} + {#if visible} +
+ +
+ {/if} +{:else} + -
-