diff --git a/packages/bbui/src/Table/CellRenderer.svelte b/packages/bbui/src/Table/CellRenderer.svelte index d6a2f3196d..95aee839e8 100644 --- a/packages/bbui/src/Table/CellRenderer.svelte +++ b/packages/bbui/src/Table/CellRenderer.svelte @@ -5,11 +5,13 @@ import RelationshipRenderer from "./RelationshipRenderer.svelte" import AttachmentRenderer from "./AttachmentRenderer.svelte" import ArrayRenderer from "./ArrayRenderer.svelte" + import InternalRenderer from "./InternalRenderer.svelte" export let row export let schema export let value export let customRenderers = [] + let renderer const typeMap = { boolean: BooleanRenderer, datetime: DateTimeRenderer, @@ -20,10 +22,20 @@ number: StringRenderer, longform: StringRenderer, array: ArrayRenderer, + internal: InternalRenderer, } $: type = schema?.type ?? "string" $: customRenderer = customRenderers?.find(x => x.column === schema?.name) - $: renderer = customRenderer?.component ?? typeMap[type] ?? StringRenderer + $: { + // this has to be done purely in the front-end due to migration issues + // the schema gets overriden on every tables fetch so we can't just set + // these to be a new type unfortunately + if (schema.name === "_id" || schema.name === "_rev") { + renderer = customRenderer?.component ?? typeMap.internal ?? StringRenderer + } else { + renderer = customRenderer?.component ?? typeMap[type] ?? StringRenderer + } + } {#if renderer && (customRenderer || (value != null && value !== ""))} diff --git a/packages/bbui/src/Table/InternalRenderer.svelte b/packages/bbui/src/Table/InternalRenderer.svelte new file mode 100644 index 0000000000..0f894ac853 --- /dev/null +++ b/packages/bbui/src/Table/InternalRenderer.svelte @@ -0,0 +1,28 @@ + + +
+ +
+ + diff --git a/packages/builder/src/components/automation/SetupPanel/RowSelector.svelte b/packages/builder/src/components/automation/SetupPanel/RowSelector.svelte index 3821157e51..d1ab19761b 100644 --- a/packages/builder/src/components/automation/SetupPanel/RowSelector.svelte +++ b/packages/builder/src/components/automation/SetupPanel/RowSelector.svelte @@ -43,8 +43,6 @@ function schemaHasOptions(schema) { return !!schema.constraints?.inclusion?.length } - - $: console.log($tables.list)