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

View File

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