Disable permission tab when empty (#19630)
as title fixes https://discord.com/channels/1130383047699738754/1488475331072491590
This commit is contained in:
+13
-2
@@ -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)
|
||||
|
||||
+1
-4
@@ -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';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user