From e8e549d44ba68392ec4469fe4ae86498689a100b Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Wed, 11 May 2022 13:33:45 +0100 Subject: [PATCH 01/16] Addresses issue mentioned in #5664 - relationship formula isn't write if column contains a space. --- .../components/backend/DataTable/formula.js | 2 +- packages/server/yarn.lock | 45 +++++-------------- packages/worker/yarn.lock | 45 +++++-------------- 3 files changed, 25 insertions(+), 67 deletions(-) diff --git a/packages/builder/src/components/backend/DataTable/formula.js b/packages/builder/src/components/backend/DataTable/formula.js index ea024cdf81..9fd5949178 100644 --- a/packages/builder/src/components/backend/DataTable/formula.js +++ b/packages/builder/src/components/backend/DataTable/formula.js @@ -60,7 +60,7 @@ export function getBindings({ ) const label = path == null ? column : `${path}.0.${column}` - const binding = path == null ? `[${column}]` : `${path}.0.[${column}]` + const binding = path == null ? `[${column}]` : `[${path}].0.[${column}]` // only supply a description for relationship paths const description = path == null diff --git a/packages/server/yarn.lock b/packages/server/yarn.lock index dd402c4361..04e01ee091 100644 --- a/packages/server/yarn.lock +++ b/packages/server/yarn.lock @@ -1014,15 +1014,15 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@1.0.150": - version "1.0.150" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.0.150.tgz#a48beb1e38f5e3e09473235fd2b7f35a05a15342" - integrity sha512-ceQVPnypKFurQMJgghky+MxtiF3x4b7rIzYhXv6Y+QfIb7IdY6wvv9o+dD3GPwNZJCRFSFizPR4YLBXdL+2+yw== +"@budibase/backend-core@1.0.153": + version "1.0.153" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.0.153.tgz#43d44648848ac7b46ae073f94b6f7bef8370c639" + integrity sha512-JT5DiVLygI/frgSOmIARqUwOpt5JMlTyrZRBdRgD1Y4QkwRa3+298SM90L3kYc4wclPW72/h5Z5Wtrgm5Bpv+Q== dependencies: "@techpass/passport-openidconnect" "^0.3.0" aws-sdk "^2.901.0" bcryptjs "^2.4.3" - cls-hooked "^4.2.2" + emitter-listener "^1.1.2" ioredis "^4.27.1" jsonwebtoken "^8.5.1" koa-passport "^4.1.4" @@ -1091,12 +1091,12 @@ svelte-flatpickr "^3.2.3" svelte-portal "^1.0.0" -"@budibase/pro@1.0.150": - version "1.0.150" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.0.150.tgz#06384561b67130bb2a93f0119921bd35d2be245c" - integrity sha512-Wlam8b5nhSeuNEj5Bb3ro1DKGX81mxxsjKMmxT4rbTqZrzuHSlTkxJ59IvUQqKuyp+cqfP6Rq/i4UXrhK0cg9Q== +"@budibase/pro@1.0.153": + version "1.0.153" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.0.153.tgz#a08e5b1111ad968baf6abb0be05433067c3fa845" + integrity sha512-ySEydGwLkw6PvJUMQaizytMKsP0N19e/HvTlWnr2lH1/hLep48V6k5s/3+iwQr+5GQV01hXkFEt/zK13IHSVVg== dependencies: - "@budibase/backend-core" "1.0.150" + "@budibase/backend-core" "1.0.153" node-fetch "^2.6.1" "@budibase/standard-components@^0.9.139": @@ -3420,13 +3420,6 @@ astral-regex@^1.0.0: resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-1.0.0.tgz#6c8c3fb827dd43ee3918f27b82782ab7658a6fd9" integrity sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg== -async-hook-jl@^1.7.6: - version "1.7.6" - resolved "https://registry.yarnpkg.com/async-hook-jl/-/async-hook-jl-1.7.6.tgz#4fd25c2f864dbaf279c610d73bf97b1b28595e68" - integrity sha512-gFaHkFfSxTjvoxDMYqDuGHlcRyUuamF8s+ZTtJdDzqjws4mCt7v0vuV79/E2Wr2/riMQgtG4/yUtXWs1gZ7JMg== - dependencies: - stack-chain "^1.3.7" - async-limiter@~1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/async-limiter/-/async-limiter-1.0.1.tgz#dd379e94f0db8310b08291f9d64c3209766617fd" @@ -4220,15 +4213,6 @@ clone-response@1.0.2, clone-response@^1.0.2: dependencies: mimic-response "^1.0.0" -cls-hooked@^4.2.2: - version "4.2.2" - resolved "https://registry.yarnpkg.com/cls-hooked/-/cls-hooked-4.2.2.tgz#ad2e9a4092680cdaffeb2d3551da0e225eae1908" - integrity sha512-J4Xj5f5wq/4jAvcdgoGsL3G103BtWpZrMo8NEinRltN+xpTZdI+M38pyQqhuFU/P792xkMFvnKSf+Lm81U1bxw== - dependencies: - async-hook-jl "^1.7.6" - emitter-listener "^1.0.1" - semver "^5.4.1" - cluster-key-slot@1.1.0, cluster-key-slot@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/cluster-key-slot/-/cluster-key-slot-1.1.0.tgz#30474b2a981fb12172695833052bc0d01336d10d" @@ -5066,7 +5050,7 @@ electron-to-chromium@^1.4.17: resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.71.tgz#17056914465da0890ce00351a3b946fd4cd51ff6" integrity sha512-Hk61vXXKRb2cd3znPE9F+2pLWdIOmP7GjiTj45y6L3W/lO+hSnUSUhq+6lEaERWBdZOHbk2s3YV5c9xVl3boVw== -emitter-listener@^1.0.1: +emitter-listener@^1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/emitter-listener/-/emitter-listener-1.1.2.tgz#56b140e8f6992375b3d7cb2cab1cc7432d9632e8" integrity sha512-Bt1sBAGFHY9DKY+4/2cV6izcKJUf5T7/gkdmkxzX/qv9CcGH8xSwVRW5mtX03SWJtRTWSOpzCuWN9rBFYZepZQ== @@ -11590,7 +11574,7 @@ semver-diff@^3.1.1: dependencies: semver "^6.3.0" -"semver@2 || 3 || 4 || 5", semver@^5.1.0, semver@^5.4.1, semver@^5.5.0, semver@^5.6.0, semver@^5.7.1: +"semver@2 || 3 || 4 || 5", semver@^5.1.0, semver@^5.5.0, semver@^5.6.0, semver@^5.7.1: version "5.7.1" resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== @@ -11984,11 +11968,6 @@ sshpk@^1.7.0: safer-buffer "^2.0.2" tweetnacl "~0.14.0" -stack-chain@^1.3.7: - version "1.3.7" - resolved "https://registry.yarnpkg.com/stack-chain/-/stack-chain-1.3.7.tgz#d192c9ff4ea6a22c94c4dd459171e3f00cea1285" - integrity sha1-0ZLJ/06moiyUxN1FkXHj8AzqEoU= - stack-trace@0.0.x: version "0.0.10" resolved "https://registry.yarnpkg.com/stack-trace/-/stack-trace-0.0.10.tgz#547c70b347e8d32b4e108ea1a2a159e5fdde19c0" diff --git a/packages/worker/yarn.lock b/packages/worker/yarn.lock index a58efbdbcb..6ce18575bb 100644 --- a/packages/worker/yarn.lock +++ b/packages/worker/yarn.lock @@ -293,15 +293,15 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@1.0.150": - version "1.0.150" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.0.150.tgz#a48beb1e38f5e3e09473235fd2b7f35a05a15342" - integrity sha512-ceQVPnypKFurQMJgghky+MxtiF3x4b7rIzYhXv6Y+QfIb7IdY6wvv9o+dD3GPwNZJCRFSFizPR4YLBXdL+2+yw== +"@budibase/backend-core@1.0.153": + version "1.0.153" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.0.153.tgz#43d44648848ac7b46ae073f94b6f7bef8370c639" + integrity sha512-JT5DiVLygI/frgSOmIARqUwOpt5JMlTyrZRBdRgD1Y4QkwRa3+298SM90L3kYc4wclPW72/h5Z5Wtrgm5Bpv+Q== dependencies: "@techpass/passport-openidconnect" "^0.3.0" aws-sdk "^2.901.0" bcryptjs "^2.4.3" - cls-hooked "^4.2.2" + emitter-listener "^1.1.2" ioredis "^4.27.1" jsonwebtoken "^8.5.1" koa-passport "^4.1.4" @@ -321,12 +321,12 @@ uuid "^8.3.2" zlib "^1.0.5" -"@budibase/pro@1.0.150": - version "1.0.150" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.0.150.tgz#06384561b67130bb2a93f0119921bd35d2be245c" - integrity sha512-Wlam8b5nhSeuNEj5Bb3ro1DKGX81mxxsjKMmxT4rbTqZrzuHSlTkxJ59IvUQqKuyp+cqfP6Rq/i4UXrhK0cg9Q== +"@budibase/pro@1.0.153": + version "1.0.153" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.0.153.tgz#a08e5b1111ad968baf6abb0be05433067c3fa845" + integrity sha512-ySEydGwLkw6PvJUMQaizytMKsP0N19e/HvTlWnr2lH1/hLep48V6k5s/3+iwQr+5GQV01hXkFEt/zK13IHSVVg== dependencies: - "@budibase/backend-core" "1.0.150" + "@budibase/backend-core" "1.0.153" node-fetch "^2.6.1" "@cspotcode/source-map-consumer@0.8.0": @@ -1290,13 +1290,6 @@ astral-regex@^1.0.0: resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-1.0.0.tgz#6c8c3fb827dd43ee3918f27b82782ab7658a6fd9" integrity sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg== -async-hook-jl@^1.7.6: - version "1.7.6" - resolved "https://registry.yarnpkg.com/async-hook-jl/-/async-hook-jl-1.7.6.tgz#4fd25c2f864dbaf279c610d73bf97b1b28595e68" - integrity sha512-gFaHkFfSxTjvoxDMYqDuGHlcRyUuamF8s+ZTtJdDzqjws4mCt7v0vuV79/E2Wr2/riMQgtG4/yUtXWs1gZ7JMg== - dependencies: - stack-chain "^1.3.7" - async@~2.1.4: version "2.1.5" resolved "https://registry.yarnpkg.com/async/-/async-2.1.5.tgz#e587c68580994ac67fc56ff86d3ac56bdbe810bc" @@ -1764,15 +1757,6 @@ clone-response@^1.0.2: dependencies: mimic-response "^1.0.0" -cls-hooked@^4.2.2: - version "4.2.2" - resolved "https://registry.yarnpkg.com/cls-hooked/-/cls-hooked-4.2.2.tgz#ad2e9a4092680cdaffeb2d3551da0e225eae1908" - integrity sha512-J4Xj5f5wq/4jAvcdgoGsL3G103BtWpZrMo8NEinRltN+xpTZdI+M38pyQqhuFU/P792xkMFvnKSf+Lm81U1bxw== - dependencies: - async-hook-jl "^1.7.6" - emitter-listener "^1.0.1" - semver "^5.4.1" - cluster-key-slot@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/cluster-key-slot/-/cluster-key-slot-1.1.0.tgz#30474b2a981fb12172695833052bc0d01336d10d" @@ -2258,7 +2242,7 @@ electron-to-chromium@^1.4.17: resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.58.tgz#cd980b08338210b591c25492857a518fe286b1d4" integrity sha512-7LXwnKyqcEaMFVXOer+2JPfFs1D+ej7yRRrfZoIH1YlLQZ81OvBNwSCBBLtExVkoMQQgOWwO0FbZVge6U/8rhQ== -emitter-listener@^1.0.1: +emitter-listener@^1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/emitter-listener/-/emitter-listener-1.1.2.tgz#56b140e8f6992375b3d7cb2cab1cc7432d9632e8" integrity sha512-Bt1sBAGFHY9DKY+4/2cV6izcKJUf5T7/gkdmkxzX/qv9CcGH8xSwVRW5mtX03SWJtRTWSOpzCuWN9rBFYZepZQ== @@ -5759,7 +5743,7 @@ semver@7.x, semver@^7.3.2, semver@^7.3.4, semver@^7.3.5: dependencies: lru-cache "^6.0.0" -semver@^5.4.1, semver@^5.5.0, semver@^5.6.0, semver@^5.7.1: +semver@^5.5.0, semver@^5.6.0, semver@^5.7.1: version "5.7.1" resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== @@ -5940,11 +5924,6 @@ sshpk@^1.7.0: safer-buffer "^2.0.2" tweetnacl "~0.14.0" -stack-chain@^1.3.7: - version "1.3.7" - resolved "https://registry.yarnpkg.com/stack-chain/-/stack-chain-1.3.7.tgz#d192c9ff4ea6a22c94c4dd459171e3f00cea1285" - integrity sha1-0ZLJ/06moiyUxN1FkXHj8AzqEoU= - stack-utils@^2.0.3: version "2.0.5" resolved "https://registry.yarnpkg.com/stack-utils/-/stack-utils-2.0.5.tgz#d25265fca995154659dbbfba3b49254778d2fdd5" From a5dd74842bd068a4deaa4892d02cb3d6c668138f Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Thu, 12 May 2022 10:44:36 +0100 Subject: [PATCH 02/16] Update print styles to work with dev tools update --- packages/client/src/components/ClientApp.svelte | 3 ++- packages/client/src/components/devtools/DevTools.svelte | 5 +++++ .../client/src/components/devtools/DevToolsHeader.svelte | 5 +++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/packages/client/src/components/ClientApp.svelte b/packages/client/src/components/ClientApp.svelte index 6bd0313c75..d4bbb10f6e 100644 --- a/packages/client/src/components/ClientApp.svelte +++ b/packages/client/src/components/ClientApp.svelte @@ -283,7 +283,8 @@ @media print { #spectrum-root, #clip-root, - #app-root { + #app-root, + #app-body { overflow: visible !important; } } diff --git a/packages/client/src/components/devtools/DevTools.svelte b/packages/client/src/components/devtools/DevTools.svelte index 4bb332da2f..bc7625bd57 100644 --- a/packages/client/src/components/devtools/DevTools.svelte +++ b/packages/client/src/components/devtools/DevTools.svelte @@ -66,4 +66,9 @@ .tab-content { padding: 0 var(--spacing-xl); } + @media print { + .devtools { + display: none; + } + } diff --git a/packages/client/src/components/devtools/DevToolsHeader.svelte b/packages/client/src/components/devtools/DevToolsHeader.svelte index 3ea528be5b..4dfaae610f 100644 --- a/packages/client/src/components/devtools/DevToolsHeader.svelte +++ b/packages/client/src/components/devtools/DevToolsHeader.svelte @@ -71,4 +71,9 @@ .dev-preview-header :global(.spectrum-Picker-label) { color: white !important; } + @media print { + .dev-preview-header { + display: none; + } + } From a3b9eca9a0bb9305523c1da0aa0066f38a83e717 Mon Sep 17 00:00:00 2001 From: Rory Powell Date: Thu, 12 May 2022 15:30:32 +0100 Subject: [PATCH 03/16] Revert "Adding to the REST query UI to make it more obvious when it needs saved, such as the user has changed a dynamic variable." This reverts commit 4982cad56d3d47521ac8289de766a5f0c993c4bb. --- .../rest/[query]/index.svelte | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/packages/builder/src/pages/builder/app/[application]/data/datasource/[selectedDatasource]/rest/[query]/index.svelte b/packages/builder/src/pages/builder/app/[application]/data/datasource/[selectedDatasource]/rest/[query]/index.svelte index d2914146ce..2baa6aab41 100644 --- a/packages/builder/src/pages/builder/app/[application]/data/datasource/[selectedDatasource]/rest/[query]/index.svelte +++ b/packages/builder/src/pages/builder/app/[application]/data/datasource/[selectedDatasource]/rest/[query]/index.svelte @@ -37,7 +37,7 @@ import AccessLevelSelect from "components/integration/AccessLevelSelect.svelte" import DynamicVariableModal from "../../_components/DynamicVariableModal.svelte" import Placeholder from "assets/bb-spaceship.svg" - import { cloneDeep, isEqual } from "lodash/fp" + import { cloneDeep } from "lodash/fp" import { RawRestBodyTypes } from "constants/backend" let query, datasource @@ -47,7 +47,6 @@ let response, schema, enabledHeaders let authConfigId let dynamicVariables, addVariableModal, varBinding - let baseQuery, baseDatasource, baseVariables $: datasourceType = datasource?.source $: integrationInfo = $integrations[datasourceType] @@ -63,15 +62,6 @@ $: hasSchema = Object.keys(schema || {}).length !== 0 || Object.keys(query?.schema || {}).length !== 0 - $: baseQuery = !baseQuery ? cloneDeep(query) : baseQuery - $: baseDatasource = !baseDatasource ? cloneDeep(datasource) : baseDatasource - $: baseVariables = !baseVariables - ? cloneDeep(dynamicVariables) - : baseVariables - $: hasChanged = - !isEqual(baseQuery, query) || - !isEqual(baseDatasource, datasource) || - !isEqual(baseVariables, dynamicVariables) function getSelectedQuery() { return cloneDeep( @@ -130,9 +120,6 @@ datasource.config.dynamicVariables = rebuildVariables(saveId) datasource = await datasources.save(datasource) } - baseQuery = query - baseDatasource = datasource - baseVariables = dynamicVariables } catch (err) { notifications.error(`Error saving query`) } @@ -346,7 +333,7 @@