From e6455d005b870fb2a690694aebd1ca73a87c22dc Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Tue, 13 Jun 2023 10:00:01 +0100 Subject: [PATCH 01/16] Add encrypt option --- .../components/start/ExportAppModal.svelte | 33 ++++++++++++------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/packages/builder/src/components/start/ExportAppModal.svelte b/packages/builder/src/components/start/ExportAppModal.svelte index 948416b192..3326f8c42c 100644 --- a/packages/builder/src/components/start/ExportAppModal.svelte +++ b/packages/builder/src/components/start/ExportAppModal.svelte @@ -1,9 +1,16 @@ - - Apps can be exported with or without data that is within internal tables - - select this below. - + + + + + {#if !encypt} + + {/if} From 1baaab287512fbecba61f963fd0fcda6d33e01d0 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Tue, 13 Jun 2023 11:15:32 +0100 Subject: [PATCH 02/16] Add steps --- .../components/start/ExportAppModal.svelte | 41 ++++++++++++++----- 1 file changed, 31 insertions(+), 10 deletions(-) diff --git a/packages/builder/src/components/start/ExportAppModal.svelte b/packages/builder/src/components/start/ExportAppModal.svelte index 3326f8c42c..be20d48b15 100644 --- a/packages/builder/src/components/start/ExportAppModal.svelte +++ b/packages/builder/src/components/start/ExportAppModal.svelte @@ -1,19 +1,36 @@ - + Date: Tue, 13 Jun 2023 11:21:54 +0100 Subject: [PATCH 03/16] Add password field --- .../components/start/ExportAppModal.svelte | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/packages/builder/src/components/start/ExportAppModal.svelte b/packages/builder/src/components/start/ExportAppModal.svelte index be20d48b15..6a761f9043 100644 --- a/packages/builder/src/components/start/ExportAppModal.svelte +++ b/packages/builder/src/components/start/ExportAppModal.svelte @@ -1,10 +1,18 @@ From d041ad621ff56fd6d6494788d007a9588c902cf3 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Tue, 13 Jun 2023 12:51:42 +0100 Subject: [PATCH 08/16] Add email validation --- packages/builder/src/helpers/validation/yup/index.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/builder/src/helpers/validation/yup/index.js b/packages/builder/src/helpers/validation/yup/index.js index f0fd1ca7c5..ef359b7df6 100644 --- a/packages/builder/src/helpers/validation/yup/index.js +++ b/packages/builder/src/helpers/validation/yup/index.js @@ -34,6 +34,9 @@ export const createValidationStore = () => { case "email": propertyValidator = string().email().nullable() break + case "password": + propertyValidator = string().min(8) + break default: propertyValidator = string().nullable() } From 5f3335c566c1606205222c24001513b6c53a8fdf Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Tue, 13 Jun 2023 13:07:41 +0100 Subject: [PATCH 09/16] Fix validation order --- packages/builder/src/helpers/validation/yup/index.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/builder/src/helpers/validation/yup/index.js b/packages/builder/src/helpers/validation/yup/index.js index ef359b7df6..b5bdf030a5 100644 --- a/packages/builder/src/helpers/validation/yup/index.js +++ b/packages/builder/src/helpers/validation/yup/index.js @@ -35,7 +35,7 @@ export const createValidationStore = () => { propertyValidator = string().email().nullable() break case "password": - propertyValidator = string().min(8) + propertyValidator = string().nullable() break default: propertyValidator = string().nullable() @@ -45,6 +45,13 @@ export const createValidationStore = () => { propertyValidator = propertyValidator.required() } + // We want to do this after the possible required validation, to prioritise the required error + switch (type) { + case "password": + propertyValidator = propertyValidator.min(8) + break + } + validator[propertyName] = propertyValidator } From 38cce94f2c497dd201d0c3f02a00f2c87d8a7907 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Tue, 13 Jun 2023 14:28:31 +0100 Subject: [PATCH 10/16] Fix type --- packages/builder/src/components/start/ExportAppModal.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/builder/src/components/start/ExportAppModal.svelte b/packages/builder/src/components/start/ExportAppModal.svelte index 5afa133218..952cf8a499 100644 --- a/packages/builder/src/components/start/ExportAppModal.svelte +++ b/packages/builder/src/components/start/ExportAppModal.svelte @@ -15,7 +15,7 @@ let password = null const validation = createValidationStore() - validation.addValidatorType("password", "password", "true") + validation.addValidatorType("password", "password", true) $: validation.observe("password", password) const Step = { CONFIG: "config", SET_PASSWORD: "set_password" } From 2fe83a96f18d96fbd31db55dad23ada7a2caf4dd Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Wed, 14 Jun 2023 11:30:05 +0100 Subject: [PATCH 11/16] Fix frontend --- packages/builder/src/components/start/ExportAppModal.svelte | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/builder/src/components/start/ExportAppModal.svelte b/packages/builder/src/components/start/ExportAppModal.svelte index 3418206611..d488b30d83 100644 --- a/packages/builder/src/components/start/ExportAppModal.svelte +++ b/packages/builder/src/components/start/ExportAppModal.svelte @@ -54,7 +54,10 @@ const exportApp = async () => { const id = published ? app.prodId : app.devId const url = `/api/backups/export?appId=${id}` - await downloadFile(url, { excludeRows, encryptPassword: password }) + await downloadFile(url, { + excludeRows: !includeInternalTablesRows, + encryptPassword: password, + }) } export async function downloadFile(url, body) { From fa835e65ef7a161bfeac78d890a58a766ea66e84 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Wed, 14 Jun 2023 16:57:36 +0100 Subject: [PATCH 12/16] Add loading when saving datasource --- .../data/datasource/[datasourceId]/index.svelte | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/builder/src/pages/builder/app/[application]/data/datasource/[datasourceId]/index.svelte b/packages/builder/src/pages/builder/app/[application]/data/datasource/[datasourceId]/index.svelte index a853fcea0c..166b4363df 100644 --- a/packages/builder/src/pages/builder/app/[application]/data/datasource/[datasourceId]/index.svelte +++ b/packages/builder/src/pages/builder/app/[application]/data/datasource/[datasourceId]/index.svelte @@ -33,6 +33,7 @@ let isValid = true let integration, baseDatasource, datasource let queryList + let loading = false $: baseDatasource = $datasources.selected $: queryList = $queries.list.filter( @@ -65,9 +66,11 @@ } const saveDatasource = async () => { + loading = true if (integration.features[DatasourceFeature.CONNECTION_CHECKING]) { const valid = await validateConfig() if (!valid) { + loading = false return false } } @@ -82,6 +85,8 @@ baseDatasource = cloneDeep(datasource) } catch (err) { notifications.error(`Error saving datasource: ${err}`) + } finally { + loading = false } } @@ -119,7 +124,11 @@
Configuration -
From bfc6bb6a6e0069504e0f3064990bc7045f246755 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Wed, 14 Jun 2023 17:07:47 +0100 Subject: [PATCH 13/16] Add spinner while saving datasources --- .../data/datasource/[datasourceId]/index.svelte | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/packages/builder/src/pages/builder/app/[application]/data/datasource/[datasourceId]/index.svelte b/packages/builder/src/pages/builder/app/[application]/data/datasource/[datasourceId]/index.svelte index 166b4363df..949fff4edc 100644 --- a/packages/builder/src/pages/builder/app/[application]/data/datasource/[datasourceId]/index.svelte +++ b/packages/builder/src/pages/builder/app/[application]/data/datasource/[datasourceId]/index.svelte @@ -22,6 +22,7 @@ import ImportRestQueriesModal from "components/backend/DatasourceNavigator/modals/ImportRestQueriesModal.svelte" import { API } from "api" import { DatasourceFeature } from "@budibase/types" + import Spinner from "components/common/Spinner.svelte" const querySchema = { name: {}, @@ -129,7 +130,12 @@ cta on:click={saveDatasource} > - Save +
+ {#if loading} + Save + {/if} + Save +
From e6ad3a4719aeb92668ed8e55864d16f63fa330ac Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Wed, 14 Jun 2023 17:17:29 +0100 Subject: [PATCH 14/16] Type pg --- packages/server/src/integrations/postgres.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/server/src/integrations/postgres.ts b/packages/server/src/integrations/postgres.ts index 33ecf45982..9b2f94db8f 100644 --- a/packages/server/src/integrations/postgres.ts +++ b/packages/server/src/integrations/postgres.ts @@ -20,7 +20,7 @@ import Sql from "./base/sql" import { PostgresColumn } from "./base/types" import { escapeDangerousCharacters } from "../utilities" -import { Client, types } from "pg" +import { Client, ClientConfig, types } from "pg" // Return "date" and "timestamp" types as plain strings. // This lets us reference the original stored timezone. @@ -144,7 +144,7 @@ class PostgresIntegration extends Sql implements DatasourcePlus { super(SqlClient.POSTGRES) this.config = config - let newConfig = { + let newConfig: ClientConfig = { ...this.config, ssl: this.config.ssl ? { From 4d3ab040bfe8d1146f5ef159d2f5826fec385e97 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Thu, 15 Jun 2023 11:06:01 +0100 Subject: [PATCH 15/16] Support postgres client certificates --- packages/server/src/integrations/postgres.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/packages/server/src/integrations/postgres.ts b/packages/server/src/integrations/postgres.ts index 9b2f94db8f..b1f20f97ec 100644 --- a/packages/server/src/integrations/postgres.ts +++ b/packages/server/src/integrations/postgres.ts @@ -42,6 +42,8 @@ interface PostgresConfig { schema: string ssl?: boolean ca?: string + clientKey?: string + clientCert?: string rejectUnauthorized?: boolean } @@ -98,6 +100,19 @@ const SCHEMA: Integration = { required: false, }, ca: { + display: "Server CA", + type: DatasourceFieldType.LONGFORM, + default: false, + required: false, + }, + clientKey: { + display: "Client key", + type: DatasourceFieldType.LONGFORM, + default: false, + required: false, + }, + clientCert: { + display: "Client cert", type: DatasourceFieldType.LONGFORM, default: false, required: false, @@ -150,6 +165,8 @@ class PostgresIntegration extends Sql implements DatasourcePlus { ? { rejectUnauthorized: this.config.rejectUnauthorized, ca: this.config.ca, + key: this.config.clientKey, + cert: this.config.clientCert, } : undefined, } From 3be274c756a4fedb50f31b6288a80baf1b753c3a Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Thu, 15 Jun 2023 11:47:45 +0000 Subject: [PATCH 16/16] Bump version to 2.7.20-alpha.1 --- lerna.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lerna.json b/lerna.json index 94f9d9120b..e763ce2252 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.7.20-alpha.0", + "version": "2.7.20-alpha.1", "npmClient": "yarn", "packages": [ "packages/backend-core",