Disable permission tab when empty (#19630)

as title

fixes
https://discord.com/channels/1130383047699738754/1488475331072491590
This commit is contained in:
martmull
2026-04-13 15:18:49 +02:00
committed by GitHub
parent bf5cc68f25
commit cd10f3cbd9
2 changed files with 14 additions and 6 deletions
@@ -53,12 +53,23 @@ export const SettingsApplicationDetails = () => {
const tabs: SingleTabProps[] = [
{ id: 'about', title: t`About`, Icon: IconInfoCircle },
{ id: 'content', title: t`Content`, Icon: IconBox },
{ id: 'permissions', title: t`Permissions`, Icon: IconLock },
{
id: 'permissions',
title: t`Permissions`,
Icon: IconLock,
tooltipContent: !isDefined(application?.defaultRoleId)
? t`No permission defined for this application`
: undefined,
disabled: !isDefined(application?.defaultRoleId),
},
{
id: 'settings',
title: t`Settings`,
Icon: IconSettings,
tooltipContent: t`No variables to set for this application`,
tooltipContent:
(application?.applicationVariables ?? []).length === 0
? t`No variables to set for this application`
: undefined,
disabled: (application?.applicationVariables ?? []).length === 0,
},
...(isDefined(settingsCustomTabFrontComponentId)
@@ -18,10 +18,7 @@ import {
import { STANDARD_OBJECTS } from 'twenty-shared/metadata';
import { isDefined } from 'twenty-shared/utils';
import { v4 as uuidv4 } from 'uuid';
import {
FieldMetadataType,
type PermissionFlagType,
} from '~/generated-metadata/graphql';
import { FieldMetadataType } from '~/generated-metadata/graphql';
import { findObjectNameByUniversalIdentifier } from '~/pages/settings/applications/utils/findObjectNameByUniversalIdentifier';