mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-09-05 16:03:47 +00:00
fix(datatables): say (EE) on the entries a license disables
A greyed-out 'Permissions' only tells the reader that they cannot click it. Suffix it the way the sidebar already marks its enterprise entries, so the reason is on the row itself rather than only in the tooltip.
This commit is contained in:
@@ -134,6 +134,8 @@
|
||||
|
||||
/** Shown on the entries the server refuses to plan without a license. */
|
||||
const EE_PERMISSIONS_TOOLTIP = 'Data table permissions require an Enterprise license'
|
||||
/** A disabled entry has to say why it is disabled, not just that it is. */
|
||||
const eeSuffixed = (name: string) => name + ($enterpriseLicense ? '' : ' (EE)')
|
||||
|
||||
const sameTable = (a: SelectedTable, b: SelectedTable) =>
|
||||
a.datatable === b.datatable && a.schema === b.schema && a.table === b.table
|
||||
@@ -694,7 +696,7 @@
|
||||
...(canManageDatatable
|
||||
? [
|
||||
{
|
||||
displayName: 'Roles',
|
||||
displayName: eeSuffixed('Roles'),
|
||||
icon: KeyRoundIcon,
|
||||
disabled: !$enterpriseLicense,
|
||||
tooltip: EE_PERMISSIONS_TOOLTIP,
|
||||
@@ -754,7 +756,7 @@
|
||||
...(canManage(root.datatable, sc.schemaKey)
|
||||
? [
|
||||
{
|
||||
displayName: 'Permissions',
|
||||
displayName: eeSuffixed('Permissions'),
|
||||
icon: KeyRoundIcon,
|
||||
disabled: !$enterpriseLicense,
|
||||
tooltip: EE_PERMISSIONS_TOOLTIP,
|
||||
@@ -842,7 +844,7 @@
|
||||
...(canManage(root.datatable, sc.schemaKey, tableKey)
|
||||
? [
|
||||
{
|
||||
displayName: 'Permissions',
|
||||
displayName: eeSuffixed('Permissions'),
|
||||
icon: KeyRoundIcon,
|
||||
disabled: !$enterpriseLicense,
|
||||
tooltip: EE_PERMISSIONS_TOOLTIP,
|
||||
|
||||
@@ -470,7 +470,7 @@
|
||||
action: () => migrationsButtons[dataTable.name]?.open()
|
||||
},
|
||||
{
|
||||
displayName: 'Permissions',
|
||||
displayName: 'Permissions' + ($enterpriseLicense ? '' : ' (EE)'),
|
||||
icon: KeyRound,
|
||||
// The server refuses to plan a permissions change without a
|
||||
// license, so the entry says so rather than failing later.
|
||||
|
||||
Reference in New Issue
Block a user