Reference cell
This commit is contained in:
parent
43bbf8d093
commit
ae237d3714
|
@ -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} />
|
|
@ -9,6 +9,7 @@ import BooleanCell from "../cells/BooleanCell.svelte"
|
||||||
import FormulaCell from "../cells/FormulaCell.svelte"
|
import FormulaCell from "../cells/FormulaCell.svelte"
|
||||||
import JSONCell from "../cells/JSONCell.svelte"
|
import JSONCell from "../cells/JSONCell.svelte"
|
||||||
import AttachmentCell from "../cells/AttachmentCell.svelte"
|
import AttachmentCell from "../cells/AttachmentCell.svelte"
|
||||||
|
import BBReferenceCell from "../cells/BBReferenceCell.svelte"
|
||||||
|
|
||||||
const TypeComponentMap = {
|
const TypeComponentMap = {
|
||||||
text: TextCell,
|
text: TextCell,
|
||||||
|
@ -23,6 +24,7 @@ const TypeComponentMap = {
|
||||||
link: RelationshipCell,
|
link: RelationshipCell,
|
||||||
formula: FormulaCell,
|
formula: FormulaCell,
|
||||||
json: JSONCell,
|
json: JSONCell,
|
||||||
|
bb_reference: BBReferenceCell,
|
||||||
}
|
}
|
||||||
export const getCellRenderer = column => {
|
export const getCellRenderer = column => {
|
||||||
return TypeComponentMap[column?.schema?.type] || TextCell
|
return TypeComponentMap[column?.schema?.type] || TextCell
|
||||||
|
|
Loading…
Reference in New Issue