Reference cell

This commit is contained in:
Adria Navarro 2023-09-15 17:05:38 +02:00
parent 43bbf8d093
commit ae237d3714
2 changed files with 18 additions and 0 deletions

View File

@ -0,0 +1,16 @@
<script>
import RelationshipCell from "./RelationshipCell.svelte"
import { TableNames } from "constants"
// import { FieldSubtype } from "@budibase/types"
const subtypeToTable = {
["user"]: TableNames.USERS,
}
const schema = {
...$$props.schema,
tableId: subtypeToTable[$$props.schema.subtype],
}
</script>
<RelationshipCell {...$$props} {schema} />

View File

@ -9,6 +9,7 @@ import BooleanCell from "../cells/BooleanCell.svelte"
import FormulaCell from "../cells/FormulaCell.svelte"
import JSONCell from "../cells/JSONCell.svelte"
import AttachmentCell from "../cells/AttachmentCell.svelte"
import BBReferenceCell from "../cells/BBReferenceCell.svelte"
const TypeComponentMap = {
text: TextCell,
@ -23,6 +24,7 @@ const TypeComponentMap = {
link: RelationshipCell,
formula: FormulaCell,
json: JSONCell,
bb_reference: BBReferenceCell,
}
export const getCellRenderer = column => {
return TypeComponentMap[column?.schema?.type] || TextCell