From 036e355c9bd37eedd1c83547baae671473bd9ba2 Mon Sep 17 00:00:00 2001 From: gitstart Date: Thu, 18 May 2023 14:05:05 +0000 Subject: [PATCH 001/587] disable duplicate for webhook triggers automation Co-authored-by: Moshood Abidemi --- .../AutomationPanel/EditAutomationPopover.svelte | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/builder/src/components/automation/AutomationPanel/EditAutomationPopover.svelte b/packages/builder/src/components/automation/AutomationPanel/EditAutomationPopover.svelte index 0ce9c781ac..09b9cf07db 100644 --- a/packages/builder/src/components/automation/AutomationPanel/EditAutomationPopover.svelte +++ b/packages/builder/src/components/automation/AutomationPanel/EditAutomationPopover.svelte @@ -32,7 +32,12 @@
- Duplicate + Duplicate Edit Delete From bb4209cd670b142ab042168f43d8f287eaff7762 Mon Sep 17 00:00:00 2001 From: Michael Drury Date: Fri, 26 May 2023 09:21:34 +0100 Subject: [PATCH 002/587] Basic modal put together. --- .../modals/DatasourceConfigModal.svelte | 22 ++- .../modals/FetchTablesModal.svelte | 21 +++ packages/server/package.json | 2 +- packages/worker/package.json | 2 +- yarn.lock | 127 ++++++------------ 5 files changed, 79 insertions(+), 95 deletions(-) create mode 100644 packages/builder/src/components/backend/DatasourceNavigator/modals/FetchTablesModal.svelte diff --git a/packages/builder/src/components/backend/DatasourceNavigator/modals/DatasourceConfigModal.svelte b/packages/builder/src/components/backend/DatasourceNavigator/modals/DatasourceConfigModal.svelte index e75109b1be..4c47720692 100644 --- a/packages/builder/src/components/backend/DatasourceNavigator/modals/DatasourceConfigModal.svelte +++ b/packages/builder/src/components/backend/DatasourceNavigator/modals/DatasourceConfigModal.svelte @@ -1,7 +1,14 @@ + + + + saveDatasource()} + onConfirm={() => + datasourcePlus ? saveDatasource() : fetchTablesModal.show()} onCancel={() => modal.show()} - confirmText={datasource.plus ? "Connect" : "Save and continue to query"} + confirmText={datasourcePlus ? "Connect" : "Save and continue to query"} cancelText="Back" - showSecondaryButton={datasource.plus} + showSecondaryButton={datasourcePlus} size="L" disabled={!isValid} > diff --git a/packages/builder/src/components/backend/DatasourceNavigator/modals/FetchTablesModal.svelte b/packages/builder/src/components/backend/DatasourceNavigator/modals/FetchTablesModal.svelte new file mode 100644 index 0000000000..41a1f2d2d0 --- /dev/null +++ b/packages/builder/src/components/backend/DatasourceNavigator/modals/FetchTablesModal.svelte @@ -0,0 +1,21 @@ + + + prevModal.show()} + confirmText="Continue" + cancelText="Back" + size="L" + disabled={selected.length === 0} +> + SOME TABLES HERE + diff --git a/packages/server/package.json b/packages/server/package.json index 136eeb609b..2ec1395b71 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -47,7 +47,7 @@ "@apidevtools/swagger-parser": "10.0.3", "@budibase/backend-core": "0.0.1", "@budibase/client": "0.0.1", - "@budibase/pro": "develop", + "@budibase/pro": "0.0.1", "@budibase/shared-core": "0.0.1", "@budibase/string-templates": "0.0.1", "@budibase/types": "0.0.1", diff --git a/packages/worker/package.json b/packages/worker/package.json index dded20cf30..684bd8755b 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -38,7 +38,7 @@ "license": "GPL-3.0", "dependencies": { "@budibase/backend-core": "0.0.1", - "@budibase/pro": "develop", + "@budibase/pro": "0.0.1", "@budibase/string-templates": "0.0.1", "@budibase/types": "0.0.1", "@koa/router": "8.0.8", diff --git a/yarn.lock b/yarn.lock index 33225932ea..0d9d795b8a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1728,47 +1728,6 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@2.6.19-alpha.4": - version "2.6.19-alpha.4" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.6.19-alpha.4.tgz#525dd7ba6c5db4404cf00d1165f79d34a1093826" - integrity sha512-1pfOr+J9xYawedVmvqpQ4b/8C2SQP4cKhFmSz5uErM2SCgbRj+JuzOUTPNX0vzAXPvat/kEegt79xThummDvhA== - dependencies: - "@budibase/nano" "10.1.2" - "@budibase/pouchdb-replication-stream" "1.2.10" - "@budibase/types" "2.6.19-alpha.4" - "@shopify/jest-koa-mocks" "5.0.1" - "@techpass/passport-openidconnect" "0.3.2" - aws-cloudfront-sign "2.2.0" - aws-sdk "2.1030.0" - bcrypt "5.0.1" - bcryptjs "2.4.3" - bull "4.10.1" - correlation-id "4.0.0" - dotenv "16.0.1" - emitter-listener "1.1.2" - ioredis "4.28.0" - joi "17.6.0" - jsonwebtoken "9.0.0" - koa-passport "4.1.4" - koa-pino-logger "4.0.0" - lodash "4.17.21" - lodash.isarguments "3.1.0" - node-fetch "2.6.7" - passport-google-oauth "2.0.0" - passport-jwt "4.0.0" - passport-local "1.0.0" - passport-oauth2-refresh "^2.1.0" - pino "8.11.0" - pino-http "8.3.3" - posthog-node "1.3.0" - pouchdb "7.3.0" - pouchdb-find "7.2.2" - redlock "4.2.0" - sanitize-s3-objectkey "0.0.1" - semver "7.3.7" - tar-fs "2.1.1" - uuid "8.3.2" - "@budibase/bbui@^0.9.139": version "0.9.190" resolved "https://registry.yarnpkg.com/@budibase/bbui/-/bbui-0.9.190.tgz#e1ec400ac90f556bfbc80fc23a04506f1585ea81" @@ -1869,32 +1828,6 @@ pouchdb-promise "^6.0.4" through2 "^2.0.0" -"@budibase/pro@develop": - version "2.6.19-alpha.4" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.6.19-alpha.4.tgz#5d4c885ac9ac4ccfb2f8896961aca903c1178750" - integrity sha512-iu2QzV8Z77c00muBSK+NVsZdug3lLD0lR+vcKancGEz1PPE4yNIH7g8jB6i8h9agArbx9S2ICeHQqGb6nQaGHQ== - dependencies: - "@budibase/backend-core" "2.6.19-alpha.4" - "@budibase/shared-core" "2.6.19-alpha.4" - "@budibase/string-templates" "2.6.19-alpha.4" - "@budibase/types" "2.6.19-alpha.4" - "@koa/router" "8.0.8" - bull "4.10.1" - joi "17.6.0" - jsonwebtoken "8.5.1" - lru-cache "^7.14.1" - memorystream "^0.3.1" - node-fetch "^2.6.1" - scim-patch "^0.7.0" - scim2-parse-filter "^0.2.8" - -"@budibase/shared-core@2.6.19-alpha.4": - version "2.6.19-alpha.4" - resolved "https://registry.yarnpkg.com/@budibase/shared-core/-/shared-core-2.6.19-alpha.4.tgz#dd22dd0a18ee4d6739b629f461e5caec90706282" - integrity sha512-ac6iWSsgz70OYbdA+QHPLpTnRbIZ4OecVc6Y7gnEZ78hZ4S5da8a+73jswuy0/t4YsiT/gjukjzjoihg3NemVg== - dependencies: - "@budibase/types" "2.6.19-alpha.4" - "@budibase/standard-components@^0.9.139": version "0.9.139" resolved "https://registry.yarnpkg.com/@budibase/standard-components/-/standard-components-0.9.139.tgz#cf8e2b759ae863e469e50272b3ca87f2827e66e3" @@ -1913,25 +1846,6 @@ svelte-apexcharts "^1.0.2" svelte-flatpickr "^3.1.0" -"@budibase/string-templates@2.6.19-alpha.4": - version "2.6.19-alpha.4" - resolved "https://registry.yarnpkg.com/@budibase/string-templates/-/string-templates-2.6.19-alpha.4.tgz#92ebd69a6841174b8af91f338c4754ca7c402707" - integrity sha512-KsH3NlQcJibRj98Q8zQ3KQHhfSIWPQfvR80MmBTIe05llEZGox4re4pQQUnlMafaUEyNNtIqVnbTJ1XP0LmFng== - dependencies: - "@budibase/handlebars-helpers" "^0.11.8" - dayjs "^1.10.4" - handlebars "^4.7.6" - handlebars-utils "^1.0.6" - lodash "^4.17.20" - vm2 "^3.9.15" - -"@budibase/types@2.6.19-alpha.4": - version "2.6.19-alpha.4" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.6.19-alpha.4.tgz#bcf81699329d3f8509e4b0a489211f35b6cfa7ce" - integrity sha512-qFsXHZTSigcfCv02aTZGsf17vBT/MC+zK9ky7WZVX4h0sJiE0li4A66/tMaSDz3/vQ7ToPRhJK/p+LOWA/oceg== - dependencies: - scim-patch "^0.7.0" - "@bull-board/api@3.7.0": version "3.7.0" resolved "https://registry.yarnpkg.com/@bull-board/api/-/api-3.7.0.tgz#231f687187c0cb34e0b97f463917b6aaeb4ef6af" @@ -3543,6 +3457,11 @@ resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz#add4c98d341472a289190b424efbdb096991bb24" integrity sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw== +"@jridgewell/sourcemap-codec@^1.4.13": + version "1.4.15" + resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz#d7c6e6755c78567a951e04ab52ef0fd26de59f32" + integrity sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg== + "@jridgewell/trace-mapping@0.3.9": version "0.3.9" resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz#6534fd5933a53ba7cbf3a17615e273a0d1273ff9" @@ -4323,7 +4242,7 @@ dependencies: slash "^3.0.0" -"@rollup/plugin-commonjs@^16.0.0": +"@rollup/plugin-commonjs@16.0.0", "@rollup/plugin-commonjs@^16.0.0": version "16.0.0" resolved "https://registry.yarnpkg.com/@rollup/plugin-commonjs/-/plugin-commonjs-16.0.0.tgz#169004d56cd0f0a1d0f35915d31a036b0efe281f" integrity sha512-LuNyypCP3msCGVQJ7ki8PqYdpjfEkE/xtFa5DqlF+7IBD0JsfMZ87C58heSwIMint58sAUZbt3ITqOmdQv/dXw== @@ -4406,6 +4325,22 @@ "@rollup/pluginutils" "^3.1.0" magic-string "^0.25.7" +"@rollup/plugin-replace@^5.0.2": + version "5.0.2" + resolved "https://registry.yarnpkg.com/@rollup/plugin-replace/-/plugin-replace-5.0.2.tgz#45f53501b16311feded2485e98419acb8448c61d" + integrity sha512-M9YXNekv/C/iHHK+cvORzfRYfPbq0RDD8r0G+bMiTXjNGKulPnCT9O3Ss46WfhI6ZOCgApOP7xAdmCQJ+U2LAA== + dependencies: + "@rollup/pluginutils" "^5.0.1" + magic-string "^0.27.0" + +"@rollup/plugin-typescript@8.3.0": + version "8.3.0" + resolved "https://registry.yarnpkg.com/@rollup/plugin-typescript/-/plugin-typescript-8.3.0.tgz#bc1077fa5897b980fc27e376c4e377882c63e68b" + integrity sha512-I5FpSvLbtAdwJ+naznv+B4sjXZUcIvLLceYpITAn7wAP8W0wqc5noLdGIp9HGVntNhRWXctwPYrSSFQxtl0FPA== + dependencies: + "@rollup/pluginutils" "^3.1.0" + resolve "^1.17.0" + "@rollup/pluginutils@^3.0.8", "@rollup/pluginutils@^3.1.0": version "3.1.0" resolved "https://registry.yarnpkg.com/@rollup/pluginutils/-/pluginutils-3.1.0.tgz#706b4524ee6dc8b103b3c995533e5ad680c02b9b" @@ -12433,7 +12368,7 @@ fs.realpath@^1.0.0: resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw== -fsevents@^2.1.2, fsevents@^2.3.2, fsevents@~2.3.2: +fsevents@^2.1.2, fsevents@^2.3.2, fsevents@~2.3.1, fsevents@~2.3.2: version "2.3.2" resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a" integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA== @@ -17481,6 +17416,13 @@ magic-string@^0.26.2: dependencies: sourcemap-codec "^1.4.8" +magic-string@^0.27.0: + version "0.27.0" + resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.27.0.tgz#e4a3413b4bab6d98d2becffd48b4a257effdbbf3" + integrity sha512-8UnnX2PeRAPZuN12svgR9j7M1uWMovg/CEnIwIG0LFkXSJJe4PdfUGiTGl8V9bsBHFUtfVINcSyYxd7q+kx9fA== + dependencies: + "@jridgewell/sourcemap-codec" "^1.4.13" + make-dir@3.1.0, make-dir@^3.0.0, make-dir@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-3.1.0.tgz#415e967046b3a7f1d185277d84aa58203726a13f" @@ -22307,6 +22249,13 @@ rollup-pluginutils@^2.3.1, rollup-pluginutils@^2.5.0, rollup-pluginutils@^2.6.0, dependencies: estree-walker "^0.6.1" +rollup@2.45.2: + version "2.45.2" + resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.45.2.tgz#8fb85917c9f35605720e92328f3ccbfba6f78b48" + integrity sha512-kRRU7wXzFHUzBIv0GfoFFIN3m9oteY4uAsKllIpQDId5cfnkWF2J130l+27dzDju0E6MScKiV0ZM5Bw8m4blYQ== + optionalDependencies: + fsevents "~2.3.1" + rollup@^2.36.2, rollup@^2.44.0, rollup@^2.45.2, rollup@^2.79.1: version "2.79.1" resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.79.1.tgz#bedee8faef7c9f93a2647ac0108748f497f081c7" @@ -24312,7 +24261,7 @@ timed-out@^4.0.1: resolved "https://registry.yarnpkg.com/timed-out/-/timed-out-4.0.1.tgz#f32eacac5a175bea25d7fab565ab3ed8741ef56f" integrity sha512-G7r3AhovYtr5YKOWQkta8RKAPb+J9IsO4uVmzjl8AZwfhs8UcUwTiD6gcJYSgOtzyjvQKrKYn41syHbUWMkafA== -timekeeper@2.2.0: +timekeeper@2.2.0, timekeeper@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/timekeeper/-/timekeeper-2.2.0.tgz#9645731fce9e3280a18614a57a9d1b72af3ca368" integrity sha512-W3AmPTJWZkRwu+iSNxPIsLZ2ByADsOLbbLxe46UJyWj3mlYLlwucKiq+/dPm0l9wTzqoF3/2PH0AGFCebjq23A== From a330e606bf1a8c655d2c0abbc1528d99b295f438 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Mon, 5 Jun 2023 15:17:06 +0100 Subject: [PATCH 003/587] Removing merge artifact. --- .../DatasourceNavigator/modals/DatasourceConfigModal.svelte | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/builder/src/components/backend/DatasourceNavigator/modals/DatasourceConfigModal.svelte b/packages/builder/src/components/backend/DatasourceNavigator/modals/DatasourceConfigModal.svelte index 1696a1870b..52051fe134 100644 --- a/packages/builder/src/components/backend/DatasourceNavigator/modals/DatasourceConfigModal.svelte +++ b/packages/builder/src/components/backend/DatasourceNavigator/modals/DatasourceConfigModal.svelte @@ -75,7 +75,6 @@ title={`Connect to ${name}`} onConfirm={() => datasourcePlus ? saveDatasource() : fetchTablesModal.show()} - onCancel={() => modal.show()} confirmText={datasourcePlus ? "Connect" : "Save and continue to query"} cancelText="Back" showSecondaryButton={datasourcePlus} From 96f44c0a863569fbf8050f0bd460a38a1ff98488 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Mon, 5 Jun 2023 17:40:12 +0100 Subject: [PATCH 004/587] Reworking implementation to a single modal, that changes content rather than progressing to a new modal. --- .../modals/DatasourceConfigModal.svelte | 87 +++++++++++-------- .../modals/FetchTablesModal.svelte | 21 ----- packages/frontend-core/src/api/datasources.js | 11 +++ 3 files changed, 61 insertions(+), 58 deletions(-) delete mode 100644 packages/builder/src/components/backend/DatasourceNavigator/modals/FetchTablesModal.svelte diff --git a/packages/builder/src/components/backend/DatasourceNavigator/modals/DatasourceConfigModal.svelte b/packages/builder/src/components/backend/DatasourceNavigator/modals/DatasourceConfigModal.svelte index 52051fe134..e9d23ff0c7 100644 --- a/packages/builder/src/components/backend/DatasourceNavigator/modals/DatasourceConfigModal.svelte +++ b/packages/builder/src/components/backend/DatasourceNavigator/modals/DatasourceConfigModal.svelte @@ -1,14 +1,7 @@ - - - - - datasourcePlus ? saveDatasource() : fetchTablesModal.show()} - confirmText={datasourcePlus ? "Connect" : "Save and continue to query"} - cancelText="Back" + {title} + onConfirm={() => nextStep()} + {confirmText} + cancelText={fetchTableStep ? "Cancel" : "Back"} showSecondaryButton={datasourcePlus} size="L" disabled={!isValid} > - - Connect your database to Budibase using the config below. - - - (isValid = e.detail)} - /> + {#if !fetchTableStep} + + Connect your database to Budibase using the config below. + + + (isValid = e.detail)} + /> + {:else} + Some stuff here + {/if} diff --git a/packages/builder/src/components/backend/DatasourceNavigator/modals/FetchTablesModal.svelte b/packages/builder/src/components/backend/DatasourceNavigator/modals/FetchTablesModal.svelte deleted file mode 100644 index 41a1f2d2d0..0000000000 --- a/packages/builder/src/components/backend/DatasourceNavigator/modals/FetchTablesModal.svelte +++ /dev/null @@ -1,21 +0,0 @@ - - - prevModal.show()} - confirmText="Continue" - cancelText="Back" - size="L" - disabled={selected.length === 0} -> - SOME TABLES HERE - diff --git a/packages/frontend-core/src/api/datasources.js b/packages/frontend-core/src/api/datasources.js index 16d19c512f..f7554f64b0 100644 --- a/packages/frontend-core/src/api/datasources.js +++ b/packages/frontend-core/src/api/datasources.js @@ -69,4 +69,15 @@ export const buildDatasourceEndpoints = API => ({ body: { datasource }, }) }, + + /** + * Fetch table names available within the datasource, for filtering out undesired tables + * @param datasource the datasource configuration to use for fetching tables + */ + fetchTablesForDatasource: async datasource => { + return await API.post({ + url: `/api/datasources/tables`, + body: { datasource }, + }) + }, }) From b57557760dd060db96091fa4cc2970e1bfb44525 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Mon, 5 Jun 2023 18:36:50 +0100 Subject: [PATCH 005/587] Updating fancy forms to be usable for data table fetching designs. --- .../bbui/src/FancyForm/FancyCheckbox.svelte | 14 +++++++++-- packages/bbui/src/FancyForm/FancyField.svelte | 4 +-- packages/bbui/src/FancyForm/FancyForm.svelte | 12 ++++++++- .../DatasourceNavigator/icons/index.js | 3 +++ .../modals/DatasourceConfigModal.svelte | 25 +++++++++++++++++-- 5 files changed, 51 insertions(+), 7 deletions(-) diff --git a/packages/bbui/src/FancyForm/FancyCheckbox.svelte b/packages/bbui/src/FancyForm/FancyCheckbox.svelte index 191cc79485..21fdb9d7a9 100644 --- a/packages/bbui/src/FancyForm/FancyCheckbox.svelte +++ b/packages/bbui/src/FancyForm/FancyCheckbox.svelte @@ -8,6 +8,8 @@ export let disabled = false export let error = null export let validate = null + export let compact = false + export let noMaxWidth const dispatch = createEventDispatcher() @@ -21,7 +23,16 @@ } - + @@ -39,7 +50,6 @@ } .text { font-size: 15px; - line-height: 17px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; diff --git a/packages/bbui/src/FancyForm/FancyField.svelte b/packages/bbui/src/FancyForm/FancyField.svelte index 0c99394599..10d847248d 100644 --- a/packages/bbui/src/FancyForm/FancyField.svelte +++ b/packages/bbui/src/FancyForm/FancyField.svelte @@ -61,7 +61,7 @@ From 410d8700e4555c414b50f19b0d626758e030ce2b Mon Sep 17 00:00:00 2001 From: Pedro Silva Date: Mon, 5 Jun 2023 18:42:44 +0100 Subject: [PATCH 006/587] Add more tests for user settings --- qa-core/src/internal-api/api/apis/SelfAPI.ts | 18 +++++++++++++++--- .../tests/users/userManagement.spec.ts | 16 ++++++++++++++++ 2 files changed, 31 insertions(+), 3 deletions(-) diff --git a/qa-core/src/internal-api/api/apis/SelfAPI.ts b/qa-core/src/internal-api/api/apis/SelfAPI.ts index cd162053a1..022a438249 100644 --- a/qa-core/src/internal-api/api/apis/SelfAPI.ts +++ b/qa-core/src/internal-api/api/apis/SelfAPI.ts @@ -14,10 +14,11 @@ export default class SelfAPI extends BaseAPI { return [response, json] } - async changeSelfPassword(body: Partial): Promise<[Response, User]> { + async changeSelfPassword(): Promise<[Response, User]> { + const body = { + password: "newPassword", + } const [response, json] = await this.post(`/global/self`, body) - expect(json._id).toEqual(body._id) - expect(json._rev).not.toEqual(body._rev) return [response, json] } @@ -26,4 +27,15 @@ export default class SelfAPI extends BaseAPI { expect(json).toHaveProperty("apiKey") return json } + + async changeUserInfo(body: Partial): Promise<[Response, User]> { + const [response, json] = await this.post(`/global/self`, body) + return [response, json] + } + + async generateApiKey(): Promise<[Response, ApiKeyResponse]> { + const [response, json] = await this.post(`/global/self/api_key`) + expect(json).toHaveProperty("apiKey") + return [response, json] + } } diff --git a/qa-core/src/internal-api/tests/users/userManagement.spec.ts b/qa-core/src/internal-api/tests/users/userManagement.spec.ts index 28096c08c9..d1bada05c0 100644 --- a/qa-core/src/internal-api/tests/users/userManagement.spec.ts +++ b/qa-core/src/internal-api/tests/users/userManagement.spec.ts @@ -87,4 +87,20 @@ describe("Internal API - User Management & Permissions", () => { expect(changedUserInfoJson.builder?.global).toBeDefined() expect(changedUserInfoJson.builder?.global).toEqual(true) }) + + it("Set First and Last Name", async () => { + const body: Partial = { + firstName: "newFirstName", + lastName: "newLastName", + } + await config.api.self.changeUserInfo(body) + }) + + it("Generate API key", async () => { + await config.api.self.generateApiKey() + }) + + it("Change Password", async () => { + await config.api.self.changeSelfPassword() + }) }) From 7afbce696baf48b7ba89038ba150a5ea947544b9 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Mon, 5 Jun 2023 18:18:08 +0100 Subject: [PATCH 007/587] Create listbox component --- packages/bbui/src/ListBox/Checkbox.svelte | 62 ++++++++++++++ packages/bbui/src/ListBox/ListBox.svelte | 99 +++++++++++++++++++++++ packages/bbui/src/index.js | 1 + 3 files changed, 162 insertions(+) create mode 100644 packages/bbui/src/ListBox/Checkbox.svelte create mode 100644 packages/bbui/src/ListBox/ListBox.svelte diff --git a/packages/bbui/src/ListBox/Checkbox.svelte b/packages/bbui/src/ListBox/Checkbox.svelte new file mode 100644 index 0000000000..3548e4868e --- /dev/null +++ b/packages/bbui/src/ListBox/Checkbox.svelte @@ -0,0 +1,62 @@ + + + + + diff --git a/packages/bbui/src/ListBox/ListBox.svelte b/packages/bbui/src/ListBox/ListBox.svelte new file mode 100644 index 0000000000..04b563160e --- /dev/null +++ b/packages/bbui/src/ListBox/ListBox.svelte @@ -0,0 +1,99 @@ + + +
+ {#if options && Array.isArray(options)} + {#if showSelectAll} +
+ +
+ {/if} + {#each options as option} +
+ +
+ {/each} + {/if} +
+ + diff --git a/packages/bbui/src/index.js b/packages/bbui/src/index.js index d26b938dd5..f1b2e58870 100644 --- a/packages/bbui/src/index.js +++ b/packages/bbui/src/index.js @@ -78,6 +78,7 @@ export { default as IconSideNavItem } from "./IconSideNav/IconSideNavItem.svelte export { default as Slider } from "./Form/Slider.svelte" export { default as Accordion } from "./Accordion/Accordion.svelte" export { default as File } from "./Form/File.svelte" +export { default as ListBox } from "./ListBox/ListBox.svelte" // Renderers export { default as BoldRenderer } from "./Table/BoldRenderer.svelte" From b7fd069d00962233fe10f6fb89164e7c2e77aa59 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Tue, 6 Jun 2023 13:49:11 +0100 Subject: [PATCH 008/587] Fixing endpoint to info from tables for datasource fetching. --- packages/frontend-core/src/api/datasources.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/frontend-core/src/api/datasources.js b/packages/frontend-core/src/api/datasources.js index f7554f64b0..fec897555c 100644 --- a/packages/frontend-core/src/api/datasources.js +++ b/packages/frontend-core/src/api/datasources.js @@ -74,9 +74,9 @@ export const buildDatasourceEndpoints = API => ({ * Fetch table names available within the datasource, for filtering out undesired tables * @param datasource the datasource configuration to use for fetching tables */ - fetchTablesForDatasource: async datasource => { + fetchInfoForDatasource: async datasource => { return await API.post({ - url: `/api/datasources/tables`, + url: `/api/datasources/info`, body: { datasource }, }) }, From f37c49e8afdbbd3c7df05626d22168d7837560e3 Mon Sep 17 00:00:00 2001 From: Dean Date: Tue, 6 Jun 2023 16:16:09 +0100 Subject: [PATCH 009/587] Initial commit --- .../src/components/start/AppRow.svelte | 2 +- .../builder/app/[application]/_layout.svelte | 78 ++++------- .../automate/[automationId]/_layout.svelte | 15 -- .../automate/[automationId]/index.svelte | 5 - .../app/[application]/automate/_layout.svelte | 131 ------------------ .../app/[application]/automate/index.svelte | 10 -- .../pages/builder/portal/apps/index.svelte | 5 +- 7 files changed, 31 insertions(+), 215 deletions(-) delete mode 100644 packages/builder/src/pages/builder/app/[application]/automate/[automationId]/_layout.svelte delete mode 100644 packages/builder/src/pages/builder/app/[application]/automate/[automationId]/index.svelte delete mode 100644 packages/builder/src/pages/builder/app/[application]/automate/_layout.svelte delete mode 100644 packages/builder/src/pages/builder/app/[application]/automate/index.svelte diff --git a/packages/builder/src/components/start/AppRow.svelte b/packages/builder/src/components/start/AppRow.svelte index 142c5c6e31..50e6b8466a 100644 --- a/packages/builder/src/components/start/AppRow.svelte +++ b/packages/builder/src/components/start/AppRow.svelte @@ -22,7 +22,7 @@ } const goToOverview = () => { - $goto(`../overview/${app.devId}`) + $goto(`../../app/${app.devId}/settings`) } diff --git a/packages/builder/src/pages/builder/app/[application]/_layout.svelte b/packages/builder/src/pages/builder/app/[application]/_layout.svelte index f13aa3dab6..d10657bdbe 100644 --- a/packages/builder/src/pages/builder/app/[application]/_layout.svelte +++ b/packages/builder/src/pages/builder/app/[application]/_layout.svelte @@ -12,6 +12,7 @@ Heading, Modal, notifications, + Button, } from "@budibase/bbui" import AppActions from "components/deploy/AppActions.svelte" import { API } from "api" @@ -144,53 +145,14 @@
{#if $store.initialised}
- -
- -
- $goto("../../portal/apps")}> - Exit to portal - - $goto(`../../portal/overview/${application}`)} - > - Overview - - - $goto(`../../portal/overview/${application}/access`)} - > - Access - - - $goto(`../../portal/overview/${application}/automation-history`)} - > - Automation history - - - $goto(`../../portal/overview/${application}/backups`)} - > - Backups - - - - $goto(`../../portal/overview/${application}/name-and-url`)} - > - Name and URL - - - $goto(`../../portal/overview/${application}/version`)} - > - Version - -
- {$store.name} -
-
+ + $goto("../../portal/apps")} + /> + {#if $store.hasLock} {#each $layout.children as { path, title }} @@ -212,6 +174,9 @@
{/if}
+
+ {$store.name} +
@@ -236,6 +201,13 @@ diff --git a/packages/builder/src/pages/builder/app/[application]/automate/index.svelte b/packages/builder/src/pages/builder/app/[application]/automate/index.svelte deleted file mode 100644 index ea2c853139..0000000000 --- a/packages/builder/src/pages/builder/app/[application]/automate/index.svelte +++ /dev/null @@ -1,10 +0,0 @@ - diff --git a/packages/builder/src/pages/builder/portal/apps/index.svelte b/packages/builder/src/pages/builder/portal/apps/index.svelte index 8b8451f036..f2ea7b3896 100644 --- a/packages/builder/src/pages/builder/portal/apps/index.svelte +++ b/packages/builder/src/pages/builder/portal/apps/index.svelte @@ -100,7 +100,10 @@ const params = new URLSearchParams({ open: "error", }) - $goto(`../overview/${appId}/automation-history?${params.toString()}`) + $goto( + `/builder/app/${appId}/settings/automation-history?${params.toString()}` + ) + // $goto(`../overview/${appId}/automation-history?${params.toString()}`) } const errorCount = errors => { From 05851f6b19ad819a9c88b6a43ae8884ba0d18b61 Mon Sep 17 00:00:00 2001 From: gitstart Date: Tue, 6 Jun 2023 15:18:15 +0000 Subject: [PATCH 010/587] Fix CSV encoding issue Co-authored-by: Benjamin Mayanja --- .../components/backend/DataTable/modals/ExportModal.svelte | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/builder/src/components/backend/DataTable/modals/ExportModal.svelte b/packages/builder/src/components/backend/DataTable/modals/ExportModal.svelte index 6cefe244bf..95586a384b 100644 --- a/packages/builder/src/components/backend/DataTable/modals/ExportModal.svelte +++ b/packages/builder/src/components/backend/DataTable/modals/ExportModal.svelte @@ -130,7 +130,10 @@ notifications.error("Export Failed") } if (response) { - download(response, `export.${exportFormat}`) + download( + new Blob([response], { type: "text/plain" }), + `export.${exportFormat}` + ) notifications.success("Export Successful") } } else { From e1b63842e5e50be106371fd165b704d2a177f9e0 Mon Sep 17 00:00:00 2001 From: Dean Date: Tue, 6 Jun 2023 16:24:30 +0100 Subject: [PATCH 011/587] Adding in relocated screen components --- .../automation/[automationId]/_layout.svelte | 15 + .../automation/[automationId]/index.svelte | 5 + .../[application]/automation/_layout.svelte | 131 +++++++ .../app/[application]/automation/index.svelte | 10 + .../app/[application]/settings/_layout.svelte | 74 ++++ .../_components/HistoryDetailsPanel.svelte | 82 +++++ .../_components/StatusRenderer.svelte | 27 ++ .../settings/automation-history/index.svelte | 262 ++++++++++++++ .../_components/ActionsRenderer.svelte | 87 +++++ .../_components/AppSizeRenderer.svelte | 41 +++ .../_components/CreateRestoreModal.svelte | 27 ++ .../_components/DatasourceRenderer.svelte | 21 ++ .../backups/_components/StatusRenderer.svelte | 15 + .../_components/TimeAgoRenderer.svelte | 10 + .../backups/_components/TypeRenderer.svelte | 36 ++ .../backups/_components/UserRenderer.svelte | 18 + .../settings/backups/index.svelte | 340 ++++++++++++++++++ .../app/[application]/settings/embed.svelte | 23 ++ .../app/[application]/settings/index.svelte | 4 + .../settings/name-and-url.svelte | 79 ++++ .../app/[application]/settings/version.svelte | 39 ++ 21 files changed, 1346 insertions(+) create mode 100644 packages/builder/src/pages/builder/app/[application]/automation/[automationId]/_layout.svelte create mode 100644 packages/builder/src/pages/builder/app/[application]/automation/[automationId]/index.svelte create mode 100644 packages/builder/src/pages/builder/app/[application]/automation/_layout.svelte create mode 100644 packages/builder/src/pages/builder/app/[application]/automation/index.svelte create mode 100644 packages/builder/src/pages/builder/app/[application]/settings/_layout.svelte create mode 100644 packages/builder/src/pages/builder/app/[application]/settings/automation-history/_components/HistoryDetailsPanel.svelte create mode 100644 packages/builder/src/pages/builder/app/[application]/settings/automation-history/_components/StatusRenderer.svelte create mode 100644 packages/builder/src/pages/builder/app/[application]/settings/automation-history/index.svelte create mode 100644 packages/builder/src/pages/builder/app/[application]/settings/backups/_components/ActionsRenderer.svelte create mode 100644 packages/builder/src/pages/builder/app/[application]/settings/backups/_components/AppSizeRenderer.svelte create mode 100644 packages/builder/src/pages/builder/app/[application]/settings/backups/_components/CreateRestoreModal.svelte create mode 100644 packages/builder/src/pages/builder/app/[application]/settings/backups/_components/DatasourceRenderer.svelte create mode 100644 packages/builder/src/pages/builder/app/[application]/settings/backups/_components/StatusRenderer.svelte create mode 100644 packages/builder/src/pages/builder/app/[application]/settings/backups/_components/TimeAgoRenderer.svelte create mode 100644 packages/builder/src/pages/builder/app/[application]/settings/backups/_components/TypeRenderer.svelte create mode 100644 packages/builder/src/pages/builder/app/[application]/settings/backups/_components/UserRenderer.svelte create mode 100644 packages/builder/src/pages/builder/app/[application]/settings/backups/index.svelte create mode 100644 packages/builder/src/pages/builder/app/[application]/settings/embed.svelte create mode 100644 packages/builder/src/pages/builder/app/[application]/settings/index.svelte create mode 100644 packages/builder/src/pages/builder/app/[application]/settings/name-and-url.svelte create mode 100644 packages/builder/src/pages/builder/app/[application]/settings/version.svelte diff --git a/packages/builder/src/pages/builder/app/[application]/automation/[automationId]/_layout.svelte b/packages/builder/src/pages/builder/app/[application]/automation/[automationId]/_layout.svelte new file mode 100644 index 0000000000..3be71a1bbe --- /dev/null +++ b/packages/builder/src/pages/builder/app/[application]/automation/[automationId]/_layout.svelte @@ -0,0 +1,15 @@ + + + diff --git a/packages/builder/src/pages/builder/app/[application]/automation/[automationId]/index.svelte b/packages/builder/src/pages/builder/app/[application]/automation/[automationId]/index.svelte new file mode 100644 index 0000000000..1a15ed48c6 --- /dev/null +++ b/packages/builder/src/pages/builder/app/[application]/automation/[automationId]/index.svelte @@ -0,0 +1,5 @@ + + + diff --git a/packages/builder/src/pages/builder/app/[application]/automation/_layout.svelte b/packages/builder/src/pages/builder/app/[application]/automation/_layout.svelte new file mode 100644 index 0000000000..79ca5df168 --- /dev/null +++ b/packages/builder/src/pages/builder/app/[application]/automation/_layout.svelte @@ -0,0 +1,131 @@ + + + +
+ +
+ {#if $automationStore.automations?.length} + + {:else} +
+
+ + + + + You have no automations + Let's fix that. Call the bots! + + +
+
+ {/if} +
+ + {#if $automationStore.showTestPanel} +
+ +
+ {/if} + + + + + + +
+ + diff --git a/packages/builder/src/pages/builder/app/[application]/automation/index.svelte b/packages/builder/src/pages/builder/app/[application]/automation/index.svelte new file mode 100644 index 0000000000..ea2c853139 --- /dev/null +++ b/packages/builder/src/pages/builder/app/[application]/automation/index.svelte @@ -0,0 +1,10 @@ + diff --git a/packages/builder/src/pages/builder/app/[application]/settings/_layout.svelte b/packages/builder/src/pages/builder/app/[application]/settings/_layout.svelte new file mode 100644 index 0000000000..3c0299d50a --- /dev/null +++ b/packages/builder/src/pages/builder/app/[application]/settings/_layout.svelte @@ -0,0 +1,74 @@ + + + +
+ + + + + + + + + + + + + + +
+ + diff --git a/packages/builder/src/pages/builder/app/[application]/settings/automation-history/_components/HistoryDetailsPanel.svelte b/packages/builder/src/pages/builder/app/[application]/settings/automation-history/_components/HistoryDetailsPanel.svelte new file mode 100644 index 0000000000..5b9c925130 --- /dev/null +++ b/packages/builder/src/pages/builder/app/[application]/settings/automation-history/_components/HistoryDetailsPanel.svelte @@ -0,0 +1,82 @@ + + +{#if history} + +
+ + +
+ + {history.automationName} + + + {#if history.status === STOPPED_ERROR} +
+ +
+ {/if} + {#if exists} +
+ +
+ {/if} + {#key history} +
+ +
+ {/key} +
+{:else} + No details found +{/if} + + diff --git a/packages/builder/src/pages/builder/app/[application]/settings/automation-history/_components/StatusRenderer.svelte b/packages/builder/src/pages/builder/app/[application]/settings/automation-history/_components/StatusRenderer.svelte new file mode 100644 index 0000000000..f041faa349 --- /dev/null +++ b/packages/builder/src/pages/builder/app/[application]/settings/automation-history/_components/StatusRenderer.svelte @@ -0,0 +1,27 @@ + + + + {info.message} + diff --git a/packages/builder/src/pages/builder/app/[application]/settings/automation-history/index.svelte b/packages/builder/src/pages/builder/app/[application]/settings/automation-history/index.svelte new file mode 100644 index 0000000000..c1c6be997b --- /dev/null +++ b/packages/builder/src/pages/builder/app/[application]/settings/automation-history/index.svelte @@ -0,0 +1,262 @@ + + + + + Automation History + View the automations your app has executed + + + +
+