From 7cbfd7be84da8657b64c2df30c631b0e77f2bba7 Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Fri, 30 Aug 2024 15:58:11 +0100 Subject: [PATCH 1/6] Disable creation of createdAt and createdBy auto columns when default values is enabled. --- packages/backend-core/src/features/index.ts | 2 +- packages/builder/src/helpers/utils.js | 14 +++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/packages/backend-core/src/features/index.ts b/packages/backend-core/src/features/index.ts index a8d6f0d0ef..61ba3a0292 100644 --- a/packages/backend-core/src/features/index.ts +++ b/packages/backend-core/src/features/index.ts @@ -266,6 +266,6 @@ export class FlagSet, T extends { [key: string]: V }> { // All of the machinery in this file is to make sure that flags have their // default values set correctly and their types flow through the system. export const flags = new FlagSet({ - DEFAULT_VALUES: Flag.boolean(false), + DEFAULT_VALUES: Flag.boolean(env.isDev()), SQS: Flag.boolean(false), }) diff --git a/packages/builder/src/helpers/utils.js b/packages/builder/src/helpers/utils.js index a1f9b34e3d..f3d48331e7 100644 --- a/packages/builder/src/helpers/utils.js +++ b/packages/builder/src/helpers/utils.js @@ -7,10 +7,22 @@ import { FIELDS, isAutoColumnUserRelationship, } from "constants/backend" +import { isEnabled } from "helpers/featureFlags" export function getAutoColumnInformation(enabled = true) { let info = {} - for (let [key, subtype] of Object.entries(AUTO_COLUMN_SUB_TYPES)) { + for (const [key, subtype] of Object.entries(AUTO_COLUMN_SUB_TYPES)) { + // Because it's possible to replicate the functionality of CREATED_AT and + // CREATED_BY columns, we disable their creation when the DEFAULT_VALUES + // feature flag is enabled. + if (isEnabled("DEFAULT_VALUES")) { + if ( + subtype === AUTO_COLUMN_SUB_TYPES.CREATED_AT || + subtype === AUTO_COLUMN_SUB_TYPES.CREATED_BY + ) { + continue + } + } info[subtype] = { enabled, name: AUTO_COLUMN_DISPLAY_NAMES[key] } } return info From d5a79cb015846a0e9f39e61d6f8be53fa3e4d3b6 Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Mon, 2 Sep 2024 09:36:14 +0000 Subject: [PATCH 2/6] Bump version to 2.31.4 --- lerna.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lerna.json b/lerna.json index 754041d6ef..3396c082bf 100644 --- a/lerna.json +++ b/lerna.json @@ -1,6 +1,6 @@ { "$schema": "node_modules/lerna/schemas/lerna-schema.json", - "version": "2.31.3", + "version": "2.31.4", "npmClient": "yarn", "packages": [ "packages/*", From 5702611bd156bc07abfdcb6f09683ea381a7cd16 Mon Sep 17 00:00:00 2001 From: Christos Alexiou Date: Mon, 2 Sep 2024 14:03:15 +0300 Subject: [PATCH 3/6] Add LICENSE_TYPE --- .github/workflows/deploy-featurebranch.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/deploy-featurebranch.yml b/.github/workflows/deploy-featurebranch.yml index eccc783dfb..d86d301507 100644 --- a/.github/workflows/deploy-featurebranch.yml +++ b/.github/workflows/deploy-featurebranch.yml @@ -22,6 +22,7 @@ jobs: env: PAYLOAD_BRANCH: ${{ github.head_ref }} PAYLOAD_PR_NUMBER: ${{ github.event.pull_request.number }} + PAYLOAD_LICENSE_TYPE: "free" with: repository: budibase/budibase-deploys event: featurebranch-qa-deploy From ee50012775b79ba87a1d23d1a368ab2852df2e0b Mon Sep 17 00:00:00 2001 From: mikesealey Date: Mon, 2 Sep 2024 13:37:36 +0100 Subject: [PATCH 4/6] tweaks z-index to show preview above bindings drawer --- hosting/.env | 1 + .../builder/app/[application]/_components/PreviewOverlay.svelte | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/hosting/.env b/hosting/.env index 173d409d04..58736980bc 100644 --- a/hosting/.env +++ b/hosting/.env @@ -22,6 +22,7 @@ REDIS_PORT=6379 WATCHTOWER_PORT=6161 BUDIBASE_ENVIRONMENT=PRODUCTION SQL_MAX_ROWS= +SQL_LOGGING_ENABLE=1 # An admin user can be automatically created initially if these are set BB_ADMIN_USER_EMAIL= diff --git a/packages/builder/src/pages/builder/app/[application]/_components/PreviewOverlay.svelte b/packages/builder/src/pages/builder/app/[application]/_components/PreviewOverlay.svelte index 6d3441400f..d77744a809 100644 --- a/packages/builder/src/pages/builder/app/[application]/_components/PreviewOverlay.svelte +++ b/packages/builder/src/pages/builder/app/[application]/_components/PreviewOverlay.svelte @@ -49,7 +49,7 @@ right: 0; left: 0; bottom: 0; - z-index: 999; + z-index: 9000; position: absolute; background: rgba(255, 255, 255, 0.1); display: flex; From 3aad185f5fbb8ffe407cd1f3d07eb7295542edc1 Mon Sep 17 00:00:00 2001 From: mikesealey Date: Mon, 2 Sep 2024 13:42:26 +0100 Subject: [PATCH 5/6] reverts unintended hosting change --- hosting/.env | 1 - 1 file changed, 1 deletion(-) diff --git a/hosting/.env b/hosting/.env index 58736980bc..173d409d04 100644 --- a/hosting/.env +++ b/hosting/.env @@ -22,7 +22,6 @@ REDIS_PORT=6379 WATCHTOWER_PORT=6161 BUDIBASE_ENVIRONMENT=PRODUCTION SQL_MAX_ROWS= -SQL_LOGGING_ENABLE=1 # An admin user can be automatically created initially if these are set BB_ADMIN_USER_EMAIL= From bb8ba16b3041e89216563c20b528d67147808532 Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Mon, 2 Sep 2024 15:28:20 +0100 Subject: [PATCH 6/6] Types for new view calculation feature. --- packages/types/src/documents/app/view.ts | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/packages/types/src/documents/app/view.ts b/packages/types/src/documents/app/view.ts index 2572ddba5d..24dad0bcca 100644 --- a/packages/types/src/documents/app/view.ts +++ b/packages/types/src/documents/app/view.ts @@ -37,6 +37,19 @@ export type ViewUIFieldMetadata = UIFieldMetadata & { readonly?: boolean } +export enum CalculationType { + SUM = "sum", + AVG = "avg", + COUNT = "count", + MIN = "min", + MAX = "max", +} + +export type ViewCalculationFieldMetadata = ViewUIFieldMetadata & { + calculationType: CalculationType + field: string +} + export interface ViewV2 { version: 2 id: string @@ -49,7 +62,7 @@ export interface ViewV2 { order?: SortOrder type?: SortType } - schema?: Record + schema?: Record } export type ViewSchema = ViewCountOrSumSchema | ViewStatisticsSchema