From c1ce6be9b9817d1e0081a635972311f033730f81 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Fri, 17 May 2024 17:17:57 +0100 Subject: [PATCH 1/2] Disallowing arrays for single types (attachment and user). --- packages/server/src/sdk/app/rows/utils.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/server/src/sdk/app/rows/utils.ts b/packages/server/src/sdk/app/rows/utils.ts index a9df4f89cd..777ebff655 100644 --- a/packages/server/src/sdk/app/rows/utils.ts +++ b/packages/server/src/sdk/app/rows/utils.ts @@ -14,7 +14,7 @@ import { makeExternalQuery } from "../../../integrations/base/query" import { Format } from "../../../api/controllers/view/exporters" import sdk from "../.." import { isRelationshipColumn } from "../../../db/utils" -import { SqlClient, isSQL } from "../../../integrations/utils" +import { isSQL, SqlClient } from "../../../integrations/utils" const SQL_CLIENT_SOURCE_MAP: Record = { [SourceName.POSTGRES]: SqlClient.POSTGRES, @@ -144,6 +144,10 @@ export async function validate({ throw new Error("Unable to fetch table for validation") } const errors: Record = {} + const disallowArrayTypes = [ + FieldType.ATTACHMENT_SINGLE, + FieldType.BB_REFERENCE_SINGLE, + ] for (let fieldName of Object.keys(fetchedTable.schema)) { const column = fetchedTable.schema[fieldName] const constraints = cloneDeep(column.constraints) @@ -160,6 +164,10 @@ export async function validate({ if (type === FieldType.OPTIONS && constraints?.inclusion) { constraints.inclusion.push(null as any, "") } + + if (disallowArrayTypes.includes(type) && Array.isArray(row[fieldName])) { + errors[fieldName] = `Cannot accept arrays` + } let res // Validate.js doesn't seem to handle array From b902e765fd43d0be72b3eb851356320aac7a9ecf Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Mon, 20 May 2024 09:37:48 +0100 Subject: [PATCH 2/2] Observe size changes in tabs as a catch-all solution for incorrect underline sizing --- packages/bbui/src/Tabs/Tab.svelte | 69 ++++++++++--------- .../builder/app/[application]/_layout.svelte | 28 +++----- .../builder/src/stores/builder/builder.js | 11 --- 3 files changed, 48 insertions(+), 60 deletions(-) diff --git a/packages/bbui/src/Tabs/Tab.svelte b/packages/bbui/src/Tabs/Tab.svelte index f51ad96e05..627d7e525a 100644 --- a/packages/bbui/src/Tabs/Tab.svelte +++ b/packages/bbui/src/Tabs/Tab.svelte @@ -1,40 +1,28 @@ @@ -53,11 +56,12 @@
{#if icon} @@ -72,7 +76,8 @@ {/if} {title}
-{#if $selected.title === title} + +{#if isSelected} diff --git a/packages/builder/src/pages/builder/app/[application]/_layout.svelte b/packages/builder/src/pages/builder/app/[application]/_layout.svelte index 7d4958db04..6094c93a26 100644 --- a/packages/builder/src/pages/builder/app/[application]/_layout.svelte +++ b/packages/builder/src/pages/builder/app/[application]/_layout.svelte @@ -105,10 +105,6 @@ } onMount(async () => { - document.fonts.onloadingdone = e => { - builderStore.loadFonts(e.fontfaces) - } - if (!hasSynced && application) { try { await API.syncApp(application) @@ -149,19 +145,17 @@ /> - {#key $builderStore?.fonts} - {#each $layout.children as { path, title }} - - - - {/each} - {/key} + {#each $layout.children as { path, title }} + + + + {/each}
diff --git a/packages/builder/src/stores/builder/builder.js b/packages/builder/src/stores/builder/builder.js index 055498bc91..d002062da9 100644 --- a/packages/builder/src/stores/builder/builder.js +++ b/packages/builder/src/stores/builder/builder.js @@ -14,7 +14,6 @@ export const INITIAL_BUILDER_STATE = { tourKey: null, tourStepKey: null, hoveredComponentId: null, - fonts: null, } export class BuilderStore extends BudiStore { @@ -37,16 +36,6 @@ export class BuilderStore extends BudiStore { this.websocket } - loadFonts(fontFaces) { - const ff = fontFaces.map( - fontFace => `${fontFace.family}-${fontFace.weight}` - ) - this.update(state => ({ - ...state, - fonts: [...(state.fonts || []), ...ff], - })) - } - init(app) { if (!app?.appId) { console.error("BuilderStore: No appId supplied for websocket")