1
0
Fork 0
mirror of synced 2024-09-13 07:53:31 +12:00

Lock readonly

This commit is contained in:
Adria Navarro 2024-05-30 11:07:30 +02:00
parent 1dd5c67392
commit 8e72f1f0fa
2 changed files with 14 additions and 2 deletions

View file

@ -138,6 +138,11 @@ export const createLicensingStore = () => {
const isViewPermissionsEnabled = license.features.includes(
Constants.Features.VIEW_PERMISSIONS
)
const isViewReadonlyColumnsEnabled = license.features.includes(
Constants.Features.VIEW_READONLY_COLUMNS
)
store.update(state => {
return {
...state,
@ -157,6 +162,7 @@ export const createLicensingStore = () => {
triggerAutomationRunEnabled,
isViewPermissionsEnabled,
perAppBuildersEnabled,
isViewReadonlyColumnsEnabled,
}
})
},

View file

@ -1,6 +1,7 @@
<script>
import { getContext } from "svelte"
import { ActionButton, Popover, Icon, notifications } from "@budibase/bbui"
import { licensing } from "stores/portal"
import { getColumnIcon } from "../lib/utils"
import ToggleActionButtonGroup from "./ToggleActionButtonGroup.svelte"
@ -32,6 +33,8 @@
return hidden ? `Columns (${hidden} restricted)` : "Columns"
}
$: isViewReadonlyColumnsEnabled = $licensing.isViewReadonlyColumnsEnabled
const PERMISSION_OPTIONS = {
WRITABLE: "writable",
READONLY: "readonly",
@ -43,10 +46,13 @@
value: PERMISSION_OPTIONS.WRITABLE,
tooltip: "Writable",
}
const READONLY_OPTION = {
$: READONLY_OPTION = {
icon: "Visibility",
value: PERMISSION_OPTIONS.READONLY,
tooltip: "Read only",
tooltip: isViewReadonlyColumnsEnabled
? "Read only"
: "Read only (premium feature)",
disabled: !isViewReadonlyColumnsEnabled,
}
const HIDDEN_OPTION = {
icon: "VisibilityOff",