Display chevron

This commit is contained in:
Adria Navarro 2024-08-16 13:49:08 +02:00
parent 6b48bbf648
commit b92adecb53
2 changed files with 19 additions and 7 deletions

View File

@ -84,7 +84,7 @@
} }
let relationshipOpts1 = Object.values(PrettyRelationshipDefinitions) let relationshipOpts1 = Object.values(PrettyRelationshipDefinitions)
let relationshipOpts2 = Object.values(PrettyRelationshipDefinitions) let relationshipOpts2 = Object.values(PrettyRelationshipDefinitions)
let relationshipMap = { const relationshipMap = {
[RelationshipType.ONE_TO_MANY]: { [RelationshipType.ONE_TO_MANY]: {
part1: PrettyRelationshipDefinitions.MANY, part1: PrettyRelationshipDefinitions.MANY,
part2: PrettyRelationshipDefinitions.ONE, part2: PrettyRelationshipDefinitions.ONE,
@ -98,7 +98,7 @@
part2: PrettyRelationshipDefinitions.MANY, part2: PrettyRelationshipDefinitions.MANY,
}, },
} }
let autoColumnInfo = getAutoColumnInformation() const autoColumnInfo = getAutoColumnInformation()
let optionsValid = true let optionsValid = true
$: rowGoldenSample = RowUtils.generateGoldenSample($rows) $: rowGoldenSample = RowUtils.generateGoldenSample($rows)

View File

@ -4,11 +4,14 @@
import { getColumnIcon } from "../lib/utils" import { getColumnIcon } from "../lib/utils"
import ToggleActionButtonGroup from "./ToggleActionButtonGroup.svelte" import ToggleActionButtonGroup from "./ToggleActionButtonGroup.svelte"
import { helpers } from "@budibase/shared-core" import { helpers } from "@budibase/shared-core"
import { FieldType } from "@budibase/types"
export let allowViewReadonlyColumns = false export let allowViewReadonlyColumns = false
const { columns, datasource, dispatch } = getContext("grid") const { columns, datasource, dispatch } = getContext("grid")
$: allowRelationshipSchemas = true // TODO
const toggleColumn = async (column, permission) => { const toggleColumn = async (column, permission) => {
const visible = permission !== PERMISSION_OPTIONS.HIDDEN const visible = permission !== PERMISSION_OPTIONS.HIDDEN
const readonly = permission === PERMISSION_OPTIONS.READONLY const readonly = permission === PERMISSION_OPTIONS.READONLY
@ -94,11 +97,16 @@
{column.label} {column.label}
</div> </div>
</div> </div>
<ToggleActionButtonGroup <div class="column-options">
on:click={e => toggleColumn(column, e.detail)} <ToggleActionButtonGroup
value={columnToPermissionOptions(column)} on:click={e => toggleColumn(column, e.detail)}
options={column.options} value={columnToPermissionOptions(column)}
/> options={column.options}
/>
{#if allowRelationshipSchemas && column.schema.type === FieldType.LINK}
<Icon size="S" name="ChevronRight" />
{/if}
</div>
{/each} {/each}
</div> </div>
</div> </div>
@ -131,4 +139,8 @@
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
} }
.column-options {
display: flex;
gap: var(--spacing-s);
}
</style> </style>