From e2bf3b32e127f019dfe1295babb4c778dc1993b0 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Tue, 16 May 2023 14:52:45 +0100 Subject: [PATCH 1/4] Revert flatpickr version to fix bug in 3.3.2, improve display of time-only dates --- packages/bbui/package.json | 2 +- .../src/components/grid/cells/DateCell.svelte | 21 +++++++++++++++---- yarn.lock | 9 +++++++- 3 files changed, 26 insertions(+), 6 deletions(-) diff --git a/packages/bbui/package.json b/packages/bbui/package.json index f313dd04c0..de1fc0db5e 100644 --- a/packages/bbui/package.json +++ b/packages/bbui/package.json @@ -84,7 +84,7 @@ "@spectrum-css/vars": "3.0.1", "dayjs": "^1.10.4", "easymde": "^2.16.1", - "svelte-flatpickr": "^3.3.2", + "svelte-flatpickr": "3.2.3", "svelte-portal": "^1.0.0" }, "resolutions": { diff --git a/packages/frontend-core/src/components/grid/cells/DateCell.svelte b/packages/frontend-core/src/components/grid/cells/DateCell.svelte index f5b1acb1c8..53b159ee30 100644 --- a/packages/frontend-core/src/components/grid/cells/DateCell.svelte +++ b/packages/frontend-core/src/components/grid/cells/DateCell.svelte @@ -13,10 +13,10 @@ let flatpickr let isOpen - // adding the 0- will turn a string like 00:00:00 into a valid ISO + // Adding the 0- will turn a string like 00:00:00 into a valid ISO // date, but will make actual ISO dates invalid - $: time = new Date(`0-${value}`) - $: timeOnly = !isNaN(time) || schema?.timeOnly + $: isTimeValue = !isNaN(new Date(`0-${value}`)) + $: timeOnly = isTimeValue || schema?.timeOnly $: dateOnly = schema?.dateOnly $: format = timeOnly ? "HH:mm:ss" @@ -24,6 +24,19 @@ ? "MMM D YYYY" : "MMM D YYYY, HH:mm" $: editable = focused && !readonly + $: displayValue = getDisplayValue(value, format, timeOnly, isTimeValue) + + const getDisplayValue = (value, format, timeOnly, isTimeValue) => { + if (!value) { + return "" + } + // Parse full date strings + if (!timeOnly || !isTimeValue) { + return dayjs(value).format(format) + } + // Otherwise must be a time string + return dayjs(`0-${value}`).format(format) + } // Ensure we close flatpickr when unselected $: { @@ -49,7 +62,7 @@
{#if value} - {dayjs(timeOnly ? time : value).format(format)} + {displayValue} {/if}
{#if editable} diff --git a/yarn.lock b/yarn.lock index 04d9a7d140..1e59d0a579 100644 --- a/yarn.lock +++ b/yarn.lock @@ -22951,7 +22951,14 @@ svelte-dnd-action@^0.9.8: resolved "https://registry.yarnpkg.com/svelte-dnd-action/-/svelte-dnd-action-0.9.22.tgz#003eee9dddb31d8c782f6832aec8b1507fff194d" integrity sha512-lOQJsNLM1QWv5mdxIkCVtk6k4lHCtLgfE59y8rs7iOM6erchbLC9hMEFYSveZz7biJV0mpg7yDSs4bj/RT/YkA== -svelte-flatpickr@^3.1.0, svelte-flatpickr@^3.2.3, svelte-flatpickr@^3.3.2: +svelte-flatpickr@3.2.3: + version "3.2.3" + resolved "https://registry.yarnpkg.com/svelte-flatpickr/-/svelte-flatpickr-3.2.3.tgz#db5dd7ad832ef83262b45e09737955ad3d591fc8" + integrity sha512-PNkqK4Napx8nTvCwkaUXdnKo8dISThaxEOK+szTUXcY6H0dQM0TSyuoMaVWY2yX7pM+PN5cpCQCcVe8YvTRFSw== + dependencies: + flatpickr "^4.5.2" + +svelte-flatpickr@^3.1.0, svelte-flatpickr@^3.2.3: version "3.3.2" resolved "https://registry.yarnpkg.com/svelte-flatpickr/-/svelte-flatpickr-3.3.2.tgz#f08bcde83d439cb30df6fd07b974d87371f130c1" integrity sha512-VNJLYyLRDplI63oWX5hJylzAJc2VhTh3z9SNecfjtuPZmP6FZPpg9Fw7rXpkEV2DPovIWj2PtaVxB6Kp9r423w== From 00cbe5a2d574a1cdc52b7f72f2af9531430bf59a Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Wed, 17 May 2023 10:00:25 +0000 Subject: [PATCH 2/4] Bump version to 2.6.16-alpha.3 --- lerna.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lerna.json b/lerna.json index e56d307592..5253871cbc 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.6.16-alpha.2", + "version": "2.6.16-alpha.3", "npmClient": "yarn", "packages": [ "packages/backend-core", From b2109e6160f1422bc81a3ce246fa8fef1d80cce9 Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Wed, 17 May 2023 10:20:20 +0000 Subject: [PATCH 3/4] Bump version to 2.6.16-alpha.4 --- lerna.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lerna.json b/lerna.json index 5253871cbc..45abc9671f 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.6.16-alpha.3", + "version": "2.6.16-alpha.4", "npmClient": "yarn", "packages": [ "packages/backend-core", From 02fc795d982b3b57129b811f65d8f1ac4332311f Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Wed, 17 May 2023 13:00:08 +0200 Subject: [PATCH 4/4] Rename nightly.spec to integration.spec --- qa-core/package.json | 2 +- .../{mariaDB.nightly.spec.ts => mariaDB.integration.spec.ts} | 0 .../{mongoDB.nightly.spec.ts => mongoDB.integration.spec.ts} | 0 ...tgresSQL.nightly.spec.ts => postgresSQL.integration.spec.ts} | 0 .../{restAPI.nightly.spec.ts => restAPI.integration.spec.ts} | 0 5 files changed, 1 insertion(+), 1 deletion(-) rename qa-core/src/internal-api/tests/dataSources/{mariaDB.nightly.spec.ts => mariaDB.integration.spec.ts} (100%) rename qa-core/src/internal-api/tests/dataSources/{mongoDB.nightly.spec.ts => mongoDB.integration.spec.ts} (100%) rename qa-core/src/internal-api/tests/dataSources/{postgresSQL.nightly.spec.ts => postgresSQL.integration.spec.ts} (100%) rename qa-core/src/internal-api/tests/dataSources/{restAPI.nightly.spec.ts => restAPI.integration.spec.ts} (100%) diff --git a/qa-core/package.json b/qa-core/package.json index a6f9537d0f..2cfc8e2865 100644 --- a/qa-core/package.json +++ b/qa-core/package.json @@ -14,7 +14,7 @@ "test:watch": "yarn run test --watch", "test:debug": "DEBUG=1 yarn run test", "test:notify": "node scripts/testResultsWebhook", - "test:smoke": "yarn run test --testPathIgnorePatterns=/.+\\.nightly\\.spec\\.ts", + "test:smoke": "yarn run test --testPathIgnorePatterns=/.+\\.integration\\.spec\\.ts", "test:ci": "start-server-and-test dev:built http://localhost:4001/health test:smoke", "dev:built": "cd ../ && yarn dev:built" }, diff --git a/qa-core/src/internal-api/tests/dataSources/mariaDB.nightly.spec.ts b/qa-core/src/internal-api/tests/dataSources/mariaDB.integration.spec.ts similarity index 100% rename from qa-core/src/internal-api/tests/dataSources/mariaDB.nightly.spec.ts rename to qa-core/src/internal-api/tests/dataSources/mariaDB.integration.spec.ts diff --git a/qa-core/src/internal-api/tests/dataSources/mongoDB.nightly.spec.ts b/qa-core/src/internal-api/tests/dataSources/mongoDB.integration.spec.ts similarity index 100% rename from qa-core/src/internal-api/tests/dataSources/mongoDB.nightly.spec.ts rename to qa-core/src/internal-api/tests/dataSources/mongoDB.integration.spec.ts diff --git a/qa-core/src/internal-api/tests/dataSources/postgresSQL.nightly.spec.ts b/qa-core/src/internal-api/tests/dataSources/postgresSQL.integration.spec.ts similarity index 100% rename from qa-core/src/internal-api/tests/dataSources/postgresSQL.nightly.spec.ts rename to qa-core/src/internal-api/tests/dataSources/postgresSQL.integration.spec.ts diff --git a/qa-core/src/internal-api/tests/dataSources/restAPI.nightly.spec.ts b/qa-core/src/internal-api/tests/dataSources/restAPI.integration.spec.ts similarity index 100% rename from qa-core/src/internal-api/tests/dataSources/restAPI.nightly.spec.ts rename to qa-core/src/internal-api/tests/dataSources/restAPI.integration.spec.ts