diff --git a/packages/builder/src/components/backend/DataTable/ViewV2DataTable.svelte b/packages/builder/src/components/backend/DataTable/ViewV2DataTable.svelte
index 3b628c7b53..646b764a2c 100644
--- a/packages/builder/src/components/backend/DataTable/ViewV2DataTable.svelte
+++ b/packages/builder/src/components/backend/DataTable/ViewV2DataTable.svelte
@@ -1,6 +1,6 @@
@@ -54,7 +77,7 @@
quiet
size="M"
on:click={() => (open = !open)}
- selected={open || anyHidden}
+ selected={open || anyRestricted}
disabled={!$columns.length}
>
{text}
@@ -73,7 +96,7 @@
({ ...o, disabled: true }))}
/>
{/if}
{#each $columns as column}
diff --git a/packages/frontend-core/src/components/grid/controls/ToggleActionButtonGroup.svelte b/packages/frontend-core/src/components/grid/controls/ToggleActionButtonGroup.svelte
index e705b5016d..2e62c593d1 100644
--- a/packages/frontend-core/src/components/grid/controls/ToggleActionButtonGroup.svelte
+++ b/packages/frontend-core/src/components/grid/controls/ToggleActionButtonGroup.svelte
@@ -7,7 +7,6 @@
export let value
export let options
- export let disabled
@@ -15,7 +14,7 @@
dispatch("click", option.value)}
- {disabled}
+ disabled={option.disabled}
size="S"
icon={option.icon}
quiet
diff --git a/packages/frontend-core/src/components/grid/layout/Grid.svelte b/packages/frontend-core/src/components/grid/layout/Grid.svelte
index 0a3075a61f..8a82209162 100644
--- a/packages/frontend-core/src/components/grid/layout/Grid.svelte
+++ b/packages/frontend-core/src/components/grid/layout/Grid.svelte
@@ -57,6 +57,7 @@
export let buttons = null
export let darkMode
export let isCloud = null
+ export let allowViewReadonlyColumns = false
// Unique identifier for DOM nodes inside this instance
const gridID = `grid-${Math.random().toString().slice(2)}`
@@ -153,7 +154,7 @@
-
+
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,
}
diff --git a/packages/server/src/api/routes/tests/viewV2.spec.ts b/packages/server/src/api/routes/tests/viewV2.spec.ts
index 8069fadf10..962d6e82a3 100644
--- a/packages/server/src/api/routes/tests/viewV2.spec.ts
+++ b/packages/server/src/api/routes/tests/viewV2.spec.ts
@@ -424,7 +424,7 @@ describe.each([
await config.api.viewV2.create(newView, {
status: 400,
body: {
- message: "Readonly fields are not enabled for your tenant",
+ message: "Readonly fields are not enabled",
status: 400,
},
})
@@ -690,7 +690,7 @@ describe.each([
await config.api.viewV2.update(view, {
status: 400,
body: {
- message: "Readonly fields are not enabled for your tenant",
+ message: "Readonly fields are not enabled",
},
})
})
diff --git a/packages/server/src/sdk/app/views/index.ts b/packages/server/src/sdk/app/views/index.ts
index ea05ecf512..18ab94be21 100644
--- a/packages/server/src/sdk/app/views/index.ts
+++ b/packages/server/src/sdk/app/views/index.ts
@@ -55,10 +55,7 @@ async function guardViewSchema(
if (viewSchema[field].readonly) {
if (!(await features.isViewReadonlyColumnsEnabled())) {
- throw new HTTPError(
- `Readonly fields are not enabled for your tenant`,
- 400
- )
+ throw new HTTPError(`Readonly fields are not enabled`, 400)
}
if (isRequired(tableSchemaField.constraints)) {