From b68940bca44818a0e20dd5ab2abb19b095e2eeed Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Thu, 30 May 2024 11:26:12 +0200 Subject: [PATCH] Map readonly --- .../src/components/grid/controls/ColumnsSettingButton.svelte | 4 ++++ packages/frontend-core/src/components/grid/stores/columns.js | 1 + 2 files changed, 5 insertions(+) diff --git a/packages/frontend-core/src/components/grid/controls/ColumnsSettingButton.svelte b/packages/frontend-core/src/components/grid/controls/ColumnsSettingButton.svelte index 8faf603b80..c07adf9fcb 100644 --- a/packages/frontend-core/src/components/grid/controls/ColumnsSettingButton.svelte +++ b/packages/frontend-core/src/components/grid/controls/ColumnsSettingButton.svelte @@ -69,6 +69,10 @@ return PERMISSION_OPTIONS.HIDDEN } + if (column.readonly) { + return PERMISSION_OPTIONS.READONLY + } + return PERMISSION_OPTIONS.WRITABLE } diff --git a/packages/frontend-core/src/components/grid/stores/columns.js b/packages/frontend-core/src/components/grid/stores/columns.js index a3281be936..b76dcbfe0e 100644 --- a/packages/frontend-core/src/components/grid/stores/columns.js +++ b/packages/frontend-core/src/components/grid/stores/columns.js @@ -146,6 +146,7 @@ export const initialise = context => { schema: fieldSchema, width: fieldSchema.width || oldColumn?.width || DefaultColumnWidth, visible: fieldSchema.visible ?? true, + readonly: fieldSchema.readonly, order: fieldSchema.order ?? oldColumn?.order, primaryDisplay: field === primaryDisplay, }