Remove double checks
This commit is contained in:
parent
5444655237
commit
9ac462c390
|
@ -28,8 +28,7 @@
|
|||
showAvatars={false}
|
||||
on:updatedatasource={handleGridViewUpdate}
|
||||
isCloud={$admin.cloud}
|
||||
showReadonlyColumnsOptions
|
||||
canSetReadonlyColumns={$licensing.isViewReadonlyColumnsEnabled}
|
||||
allowViewReadonlyColumns={$licensing.isViewReadonlyColumnsEnabled}
|
||||
>
|
||||
<svelte:fragment slot="filter">
|
||||
<GridFilterButton />
|
||||
|
|
|
@ -4,8 +4,7 @@
|
|||
import { getColumnIcon } from "../lib/utils"
|
||||
import ToggleActionButtonGroup from "./ToggleActionButtonGroup.svelte"
|
||||
|
||||
export let showReadonlyColumnsOptions = false
|
||||
export let canSetReadonlyColumns = false
|
||||
export let allowViewReadonlyColumns = false
|
||||
|
||||
const { columns, datasource, stickyColumn, dispatch } = getContext("grid")
|
||||
|
||||
|
@ -43,10 +42,10 @@
|
|||
$: READONLY_OPTION = {
|
||||
icon: "Visibility",
|
||||
value: PERMISSION_OPTIONS.READONLY,
|
||||
tooltip: canSetReadonlyColumns
|
||||
tooltip: allowViewReadonlyColumns
|
||||
? "Read only"
|
||||
: "Read only (premium feature)",
|
||||
disabled: !canSetReadonlyColumns,
|
||||
disabled: !allowViewReadonlyColumns,
|
||||
}
|
||||
const HIDDEN_OPTION = {
|
||||
icon: "VisibilityOff",
|
||||
|
@ -54,9 +53,10 @@
|
|||
tooltip: "Hidden",
|
||||
}
|
||||
|
||||
$: options = showReadonlyColumnsOptions
|
||||
? [EDIT_OPTION, READONLY_OPTION, HIDDEN_OPTION]
|
||||
: [EDIT_OPTION, HIDDEN_OPTION]
|
||||
$: options =
|
||||
$datasource.type === "viewV2"
|
||||
? [EDIT_OPTION, READONLY_OPTION, HIDDEN_OPTION]
|
||||
: [EDIT_OPTION, HIDDEN_OPTION]
|
||||
|
||||
function columnToPermissionOptions(column) {
|
||||
if (!column.visible) {
|
||||
|
|
|
@ -57,8 +57,7 @@
|
|||
export let buttons = null
|
||||
export let darkMode
|
||||
export let isCloud = null
|
||||
export let showReadonlyColumnsOptions = false
|
||||
export let canSetReadonlyColumns = false
|
||||
export let allowViewReadonlyColumns = false
|
||||
|
||||
// Unique identifier for DOM nodes inside this instance
|
||||
const gridID = `grid-${Math.random().toString().slice(2)}`
|
||||
|
@ -155,10 +154,7 @@
|
|||
<div class="controls-left">
|
||||
<slot name="filter" />
|
||||
<SortButton />
|
||||
<ColumnsSettingButton
|
||||
{showReadonlyColumnsOptions}
|
||||
{canSetReadonlyColumns}
|
||||
/>
|
||||
<ColumnsSettingButton {allowViewReadonlyColumns} />
|
||||
<SizeButton />
|
||||
<slot name="controls" />
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue