From 5792c7cdb8058117a3b424c85ccc7de777c64b94 Mon Sep 17 00:00:00 2001 From: Mel O'Hagan Date: Thu, 27 Jun 2024 15:23:51 +0100 Subject: [PATCH 1/7] Script to verify ethereal --- scripts/verifyEtherealSmtp.js | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 scripts/verifyEtherealSmtp.js diff --git a/scripts/verifyEtherealSmtp.js b/scripts/verifyEtherealSmtp.js new file mode 100644 index 0000000000..aecf1d6593 --- /dev/null +++ b/scripts/verifyEtherealSmtp.js @@ -0,0 +1,31 @@ +const nodemailer = require("nodemailer") + +const options = { + port: 587, + host: "smtp.ethereal.email", + secure: false, + auth: { + user: "seamus99@ethereal.email", + pass: "5ghVteZAqj6jkKJF9R", + }, +} + +const transporter = nodemailer.createTransport(options) +transporter.verify(function (error) { + if (error) { + console.log(error) + } else { + console.log("Ethereal server is ready to take our messages") + } +}) + +const message = { + from: "from@example.com", + to: "to@example.com", + subject: "Did this email arrive?", + html: "Hello World!", +} + +transporter.sendMail(message).then(response => { + console.log("Test email URL: " + nodemailer.getTestMessageUrl(response)) +}) From 79c292538c70b7d2d2697eb78d2d3207955647cc Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Fri, 12 Jul 2024 13:51:06 +0100 Subject: [PATCH 2/7] There is a risk with default tables that the schema may exist in the DB as well as existing in memory - in this case we should merge the schemas to make sure that all possible attributes from the in memory representation, and the on disk version (which may have been updated by the user) have been captured in the SQLite schema. --- packages/server/src/sdk/app/tables/internal/sqs.ts | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/packages/server/src/sdk/app/tables/internal/sqs.ts b/packages/server/src/sdk/app/tables/internal/sqs.ts index fc0ee8fc0b..aeaa33ed2d 100644 --- a/packages/server/src/sdk/app/tables/internal/sqs.ts +++ b/packages/server/src/sdk/app/tables/internal/sqs.ts @@ -14,7 +14,7 @@ import { CONSTANT_INTERNAL_ROW_COLS, generateJunctionTableID, } from "../../../../db/utils" -import { isEqual } from "lodash" +import { isEqual, merge } from "lodash" import { DEFAULT_TABLES } from "../../../../db/defaultData/datasource_bb_default" const FieldTypeMap: Record = { @@ -130,9 +130,18 @@ async function buildBaseDefinition(): Promise { const defaultTables = DEFAULT_TABLES const definition = sql.designDoc.base("tableId") for (let table of tables.concat(defaultTables)) { + const tableId = table._id! + let existing = definition.sql.tables[tableId] + let mapped = mapTable(table) + // there are multiple definitions for this table (default table overlap) + // when there is overlap - we have to make sure we have columns from all definitions + // this problem really only applies to sample data tables where they've been expanded + if (existing) { + mapped[tableId] = merge(mapped[tableId], existing) + } definition.sql.tables = { ...definition.sql.tables, - ...mapTable(table), + ...mapped, } } return definition From 745a05fe8d34517715a968cd9d562cf77b2140f8 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Fri, 12 Jul 2024 13:54:55 +0100 Subject: [PATCH 3/7] Updating how the 'merging' is handled, don't include the in-memory representation if it exists on disk in Couch, prefer that. --- .../server/src/sdk/app/tables/internal/sqs.ts | 22 ++++++++----------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/packages/server/src/sdk/app/tables/internal/sqs.ts b/packages/server/src/sdk/app/tables/internal/sqs.ts index aeaa33ed2d..9db10f2b41 100644 --- a/packages/server/src/sdk/app/tables/internal/sqs.ts +++ b/packages/server/src/sdk/app/tables/internal/sqs.ts @@ -14,7 +14,7 @@ import { CONSTANT_INTERNAL_ROW_COLS, generateJunctionTableID, } from "../../../../db/utils" -import { isEqual, merge } from "lodash" +import { isEqual } from "lodash" import { DEFAULT_TABLES } from "../../../../db/defaultData/datasource_bb_default" const FieldTypeMap: Record = { @@ -127,21 +127,17 @@ function mapTable(table: Table): SQLiteTables { // nothing exists, need to iterate though existing tables async function buildBaseDefinition(): Promise { const tables = await tablesSdk.getAllInternalTables() - const defaultTables = DEFAULT_TABLES - const definition = sql.designDoc.base("tableId") - for (let table of tables.concat(defaultTables)) { - const tableId = table._id! - let existing = definition.sql.tables[tableId] - let mapped = mapTable(table) - // there are multiple definitions for this table (default table overlap) - // when there is overlap - we have to make sure we have columns from all definitions - // this problem really only applies to sample data tables where they've been expanded - if (existing) { - mapped[tableId] = merge(mapped[tableId], existing) + for (const defaultTable of DEFAULT_TABLES) { + // the default table doesn't exist in Couch, use the in-memory representation + if (!tables.find(table => table._id === defaultTable._id)) { + tables.push(defaultTable) } + } + const definition = sql.designDoc.base("tableId") + for (let table of tables) { definition.sql.tables = { ...definition.sql.tables, - ...mapped, + ...mapTable(table), } } return definition From ec8c6edf6800c4ad9a5e18c3baa6d896ab16860e Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Fri, 12 Jul 2024 14:11:15 +0000 Subject: [PATCH 4/7] Bump version to 2.29.20 --- lerna.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lerna.json b/lerna.json index bef5f0c268..efcbb7694c 100644 --- a/lerna.json +++ b/lerna.json @@ -1,6 +1,6 @@ { "$schema": "node_modules/lerna/schemas/lerna-schema.json", - "version": "2.29.19", + "version": "2.29.20", "npmClient": "yarn", "packages": [ "packages/*", From 19ff925dec5f11cbdfc616bf084aa4fd1de209d7 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Fri, 12 Jul 2024 18:09:29 +0100 Subject: [PATCH 5/7] Adding test cases for less than/greater than or equal to, there was no test cases confirming these definitely work. Also aligning the test cases with how the frontend performs these tests today. --- .../src/api/routes/tests/search.spec.ts | 87 ++++++++++++------- 1 file changed, 58 insertions(+), 29 deletions(-) diff --git a/packages/server/src/api/routes/tests/search.spec.ts b/packages/server/src/api/routes/tests/search.spec.ts index e2335cb71c..ae35c4c5eb 100644 --- a/packages/server/src/api/routes/tests/search.spec.ts +++ b/packages/server/src/api/routes/tests/search.spec.ts @@ -4,7 +4,12 @@ import { getDatasource, knexClient, } from "../../../integrations/tests/utils" -import { db as dbCore, utils } from "@budibase/backend-core" +import { + db as dbCore, + MAX_VALID_DATE, + MIN_VALID_DATE, + utils, +} from "@budibase/backend-core" import * as setup from "./utilities" import { @@ -1098,21 +1103,37 @@ describe.each([ }).toFindNothing() }) - // We never implemented half-open ranges in Lucene. - !isLucene && - it("can search using just a low value", async () => { - await expectQuery({ - range: { age: { low: 5 } }, - }).toContainExactly([{ age: 10 }]) - }) + it("greater than equal to", async () => { + await expectQuery({ + range: { + age: { low: 10, high: Number.MAX_SAFE_INTEGER }, + }, + }).toContainExactly([{ age: 10 }]) + }) - // We never implemented half-open ranges in Lucene. - !isLucene && - it("can search using just a high value", async () => { - await expectQuery({ - range: { age: { high: 5 } }, - }).toContainExactly([{ age: 1 }]) - }) + it("greater than", async () => { + await expectQuery({ + range: { + age: { low: 5, high: Number.MAX_SAFE_INTEGER }, + }, + }).toContainExactly([{ age: 10 }]) + }) + + it("less than equal to", async () => { + await expectQuery({ + range: { + age: { high: 1, low: Number.MIN_SAFE_INTEGER }, + }, + }).toContainExactly([{ age: 1 }]) + }) + + it("less than", async () => { + await expectQuery({ + range: { + age: { high: 5, low: Number.MIN_SAFE_INTEGER }, + }, + }).toContainExactly([{ age: 1 }]) + }) }) describe("sort", () => { @@ -1232,21 +1253,29 @@ describe.each([ }).toFindNothing() }) - // We never implemented half-open ranges in Lucene. - !isLucene && - it("can search using just a low value", async () => { - await expectQuery({ - range: { dob: { low: JAN_5TH } }, - }).toContainExactly([{ dob: JAN_10TH }]) - }) + it("greater than equal to", async () => { + await expectQuery({ + range: { dob: { low: JAN_10TH, high: MAX_VALID_DATE.toISOString() } }, + }).toContainExactly([{ dob: JAN_10TH }]) + }) - // We never implemented half-open ranges in Lucene. - !isLucene && - it("can search using just a high value", async () => { - await expectQuery({ - range: { dob: { high: JAN_5TH } }, - }).toContainExactly([{ dob: JAN_1ST }]) - }) + it("greater than", async () => { + await expectQuery({ + range: { dob: { low: JAN_5TH, high: MAX_VALID_DATE.toISOString() } }, + }).toContainExactly([{ dob: JAN_10TH }]) + }) + + it("less than equal to", async () => { + await expectQuery({ + range: { dob: { high: JAN_1ST, low: MIN_VALID_DATE.toISOString() } }, + }).toContainExactly([{ dob: JAN_1ST }]) + }) + + it("less than", async () => { + await expectQuery({ + range: { dob: { high: JAN_5TH, low: MIN_VALID_DATE.toISOString() } }, + }).toContainExactly([{ dob: JAN_1ST }]) + }) }) describe("sort", () => { From 0a50ab284f2c76d38ea05ded64a0efc81e19bf55 Mon Sep 17 00:00:00 2001 From: Dean Date: Mon, 15 Jul 2024 11:12:26 +0100 Subject: [PATCH 6/7] Title text alignment was not being saved to the app metadata. --- .../[componentId]/_components/Navigation/index.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/_components/Navigation/index.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/_components/Navigation/index.svelte index a0e0f1d93a..7c8b03caca 100644 --- a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/_components/Navigation/index.svelte +++ b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/_components/Navigation/index.svelte @@ -124,7 +124,7 @@ nav.syncAppNavigation({ textAlign: align })} + onChange={align => update("textAlign", align)} value={$nav.textAlign} props={{ options: alignmentOptions, From ab679ac85dcaf7164b1178ca986369bff4123a8d Mon Sep 17 00:00:00 2001 From: Conor Webb <126772285+ConorWebb96@users.noreply.github.com> Date: Mon, 15 Jul 2024 14:01:08 +0100 Subject: [PATCH 7/7] Add the option to use bindable inputs in your confirmations (#14138) Co-authored-by: deanhannigan --- .../actions/DeleteRow.svelte | 32 ++++++++--- .../actions/DuplicateRow.svelte | 34 +++++++---- .../actions/ExecuteQuery.svelte | 56 +++++++++++-------- .../ButtonActionEditor/actions/SaveRow.svelte | 33 ++++++++--- 4 files changed, 106 insertions(+), 49 deletions(-) diff --git a/packages/builder/src/components/design/settings/controls/ButtonActionEditor/actions/DeleteRow.svelte b/packages/builder/src/components/design/settings/controls/ButtonActionEditor/actions/DeleteRow.svelte index fd3521d597..410e4bb56e 100644 --- a/packages/builder/src/components/design/settings/controls/ButtonActionEditor/actions/DeleteRow.svelte +++ b/packages/builder/src/components/design/settings/controls/ButtonActionEditor/actions/DeleteRow.svelte @@ -1,5 +1,5 @@