Tidy
This commit is contained in:
parent
a63d193a3c
commit
6301b9de4c
|
@ -115,13 +115,14 @@
|
||||||
})
|
})
|
||||||
|
|
||||||
let relationshipPanelColumns = []
|
let relationshipPanelColumns = []
|
||||||
$: {
|
async function fetchRelationshipPanelColumns(relationshipField) {
|
||||||
relationshipPanelColumns = []
|
relationshipPanelColumns = []
|
||||||
if (relationshipField) {
|
if (!relationshipField) {
|
||||||
cache.actions.getTable(relationshipField.tableId).then(table => {
|
return
|
||||||
relationshipPanelColumns = Object.entries(
|
}
|
||||||
relationshipField?.schema || {}
|
|
||||||
)
|
const table = await cache.actions.getTable(relationshipField.tableId)
|
||||||
|
relationshipPanelColumns = Object.entries(relationshipField?.schema || {})
|
||||||
.map(([name, column]) => {
|
.map(([name, column]) => {
|
||||||
return {
|
return {
|
||||||
name: name,
|
name: name,
|
||||||
|
@ -135,15 +136,10 @@
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.sort((a, b) =>
|
.sort((a, b) =>
|
||||||
a.primaryDisplay === b.primaryDisplay
|
a.primaryDisplay === b.primaryDisplay ? 0 : a.primaryDisplay ? -1 : 1
|
||||||
? 0
|
|
||||||
: a.primaryDisplay
|
|
||||||
? -1
|
|
||||||
: 1
|
|
||||||
)
|
)
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
$: fetchRelationshipPanelColumns(relationshipField)
|
||||||
|
|
||||||
async function toggleColumn(column, permission) {
|
async function toggleColumn(column, permission) {
|
||||||
const visible = permission !== FieldPermissions.HIDDEN
|
const visible = permission !== FieldPermissions.HIDDEN
|
||||||
|
@ -217,7 +213,7 @@
|
||||||
{#if allowRelationshipSchemas}
|
{#if allowRelationshipSchemas}
|
||||||
<Popover
|
<Popover
|
||||||
on:close={() => (relationshipFieldName = null)}
|
on:close={() => (relationshipFieldName = null)}
|
||||||
open={!!relationshipPanelColumns}
|
open={!!relationshipField}
|
||||||
anchor={relationshipPanelAnchor}
|
anchor={relationshipPanelAnchor}
|
||||||
align="right-outside"
|
align="right-outside"
|
||||||
>
|
>
|
||||||
|
|
Loading…
Reference in New Issue