From ccdef0e97b2f2a9d950620ff757a82d194de05d0 Mon Sep 17 00:00:00 2001 From: Tushar Ranjan <107484915+tushar110302@users.noreply.github.com> Date: Sun, 13 Oct 2024 16:48:33 +0530 Subject: [PATCH] Fix: Nav Item Api & Webhook and Functions stay selected (#7628) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixed Nav Item Api & Webhook and Functions stay selected like data model settings. Now when clicked stays selected and deos not loose its selection Fixes #7573 https://github.com/user-attachments/assets/4cb78158-8411-4ee1-9bcc-2870344c0c62 --------- Co-authored-by: ehconitin Co-authored-by: Félix Malfait --- .../settings/components/SettingsNavigationDrawerItem.tsx | 2 +- .../settings/components/SettingsNavigationDrawerItems.tsx | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/packages/twenty-front/src/modules/settings/components/SettingsNavigationDrawerItem.tsx b/packages/twenty-front/src/modules/settings/components/SettingsNavigationDrawerItem.tsx index 050ca38f9e9b..16835921f6da 100644 --- a/packages/twenty-front/src/modules/settings/components/SettingsNavigationDrawerItem.tsx +++ b/packages/twenty-front/src/modules/settings/components/SettingsNavigationDrawerItem.tsx @@ -21,7 +21,7 @@ export const SettingsNavigationDrawerItem = ({ Icon, label, indentationLevel, - matchSubPages = false, + matchSubPages = true, path, soon, subItemState, diff --git a/packages/twenty-front/src/modules/settings/components/SettingsNavigationDrawerItems.tsx b/packages/twenty-front/src/modules/settings/components/SettingsNavigationDrawerItems.tsx index e84a7d2734e2..8ca0f3ea214e 100644 --- a/packages/twenty-front/src/modules/settings/components/SettingsNavigationDrawerItems.tsx +++ b/packages/twenty-front/src/modules/settings/components/SettingsNavigationDrawerItems.tsx @@ -43,8 +43,8 @@ type SettingsNavigationItem = { label: string; path: SettingsPath; Icon: IconComponent; - matchSubPages?: boolean; indentationLevel?: NavigationDrawerItemIndentationLevel; + matchSubPages?: boolean; }; const StyledIconContainer = styled.div` @@ -90,14 +90,12 @@ export const SettingsNavigationDrawerItems = () => { label: 'Emails', path: SettingsPath.AccountsEmails, Icon: IconMail, - matchSubPages: true, indentationLevel: 2, }, { label: 'Calendars', path: SettingsPath.AccountsCalendars, Icon: IconCalendarEvent, - matchSubPages: true, indentationLevel: 2, }, ]; @@ -109,7 +107,7 @@ export const SettingsNavigationDrawerItems = () => { return matchPath( { path: pathName, - end: !accountSubSetting.matchSubPages, + end: !accountSubSetting.matchSubPages ?? true, }, currentPathName, ); @@ -134,6 +132,7 @@ export const SettingsNavigationDrawerItems = () => { label="Accounts" path={SettingsPath.Accounts} Icon={IconAt} + matchSubPages={false} /> {accountSubSettings.map((navigationItem, index) => ( { label="Data model" path={SettingsPath.Objects} Icon={IconHierarchy2} - matchSubPages />