Merge pull request #12003 from Budibase/fix/use-user-table-as-display-column
Ban user column to be used as display column
This commit is contained in:
commit
f8a4968513
|
@ -1,5 +1,6 @@
|
||||||
<script>
|
<script>
|
||||||
import { getContext, onMount, tick } from "svelte"
|
import { getContext, onMount, tick } from "svelte"
|
||||||
|
import { FieldType } from "@budibase/types"
|
||||||
import GridCell from "./GridCell.svelte"
|
import GridCell from "./GridCell.svelte"
|
||||||
import { Icon, Popover, Menu, MenuItem, clickOutside } from "@budibase/bbui"
|
import { Icon, Popover, Menu, MenuItem, clickOutside } from "@budibase/bbui"
|
||||||
import { getColumnIcon } from "../lib/utils"
|
import { getColumnIcon } from "../lib/utils"
|
||||||
|
@ -25,11 +26,12 @@
|
||||||
} = getContext("grid")
|
} = getContext("grid")
|
||||||
|
|
||||||
const bannedDisplayColumnTypes = [
|
const bannedDisplayColumnTypes = [
|
||||||
"link",
|
FieldType.LINK,
|
||||||
"array",
|
FieldType.ARRAY,
|
||||||
"attachment",
|
FieldType.ATTACHMENT,
|
||||||
"boolean",
|
FieldType.BOOLEAN,
|
||||||
"json",
|
FieldType.JSON,
|
||||||
|
FieldType.BB_REFERENCE,
|
||||||
]
|
]
|
||||||
|
|
||||||
let anchor
|
let anchor
|
||||||
|
|
|
@ -219,10 +219,7 @@ export async function outputProcessing<T extends Row[] | Row>(
|
||||||
? await linkRows.attachFullLinkedDocs(table, safeRows)
|
? await linkRows.attachFullLinkedDocs(table, safeRows)
|
||||||
: safeRows
|
: safeRows
|
||||||
|
|
||||||
// process formulas
|
// process complex types: attachements, bb references...
|
||||||
enriched = processFormulas(table, enriched, { dynamic: true }) as Row[]
|
|
||||||
|
|
||||||
// set the attachments URLs
|
|
||||||
for (let [property, column] of Object.entries(table.schema)) {
|
for (let [property, column] of Object.entries(table.schema)) {
|
||||||
if (column.type === FieldTypes.ATTACHMENT) {
|
if (column.type === FieldTypes.ATTACHMENT) {
|
||||||
for (let row of enriched) {
|
for (let row of enriched) {
|
||||||
|
@ -242,6 +239,10 @@ export async function outputProcessing<T extends Row[] | Row>(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// process formulas after the complex types had been processed
|
||||||
|
enriched = processFormulas(table, enriched, { dynamic: true }) as Row[]
|
||||||
|
|
||||||
if (opts.squash) {
|
if (opts.squash) {
|
||||||
enriched = (await linkRows.squashLinksToPrimaryDisplay(
|
enriched = (await linkRows.squashLinksToPrimaryDisplay(
|
||||||
table,
|
table,
|
||||||
|
|
Loading…
Reference in New Issue