From bcad9b8aef73a22f77479cb903f99648a8abae8c Mon Sep 17 00:00:00 2001 From: Tushar Ranjan Date: Sun, 13 Oct 2024 09:10:48 +0530 Subject: [PATCH 1/4] Fixed Nav Item Api & Webhook and Functions stay selected like when navigating the data model settings --- .../settings/components/SettingsNavigationDrawerItems.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/twenty-front/src/modules/settings/components/SettingsNavigationDrawerItems.tsx b/packages/twenty-front/src/modules/settings/components/SettingsNavigationDrawerItems.tsx index e84a7d2734e2..cf5ad38297b9 100644 --- a/packages/twenty-front/src/modules/settings/components/SettingsNavigationDrawerItems.tsx +++ b/packages/twenty-front/src/modules/settings/components/SettingsNavigationDrawerItems.tsx @@ -208,12 +208,14 @@ export const SettingsNavigationDrawerItems = () => { label="API & Webhooks" path={SettingsPath.Developers} Icon={IconCode} + matchSubPages /> {isFunctionSettingsEnabled && ( )} From 32d1a85db8e0faf01e6c81a3689dfd4a7c233b75 Mon Sep 17 00:00:00 2001 From: ehconitin Date: Sun, 13 Oct 2024 12:44:19 +0530 Subject: [PATCH 2/4] similiar fix for integrations --- .../settings/components/SettingsNavigationDrawerItems.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/twenty-front/src/modules/settings/components/SettingsNavigationDrawerItems.tsx b/packages/twenty-front/src/modules/settings/components/SettingsNavigationDrawerItems.tsx index cf5ad38297b9..ed9b74b07abe 100644 --- a/packages/twenty-front/src/modules/settings/components/SettingsNavigationDrawerItems.tsx +++ b/packages/twenty-front/src/modules/settings/components/SettingsNavigationDrawerItems.tsx @@ -180,6 +180,7 @@ export const SettingsNavigationDrawerItems = () => { label="Integrations" path={SettingsPath.Integrations} Icon={IconApps} + matchSubPages /> {isCRMMigrationEnabled && ( Date: Sun, 13 Oct 2024 15:21:09 +0530 Subject: [PATCH 3/4] reverse --- .../components/SettingsNavigationDrawerItem.tsx | 2 +- .../components/SettingsNavigationDrawerItems.tsx | 10 ++-------- 2 files changed, 3 insertions(+), 9 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 ed9b74b07abe..a7fbaa985d65 100644 --- a/packages/twenty-front/src/modules/settings/components/SettingsNavigationDrawerItems.tsx +++ b/packages/twenty-front/src/modules/settings/components/SettingsNavigationDrawerItems.tsx @@ -43,7 +43,6 @@ type SettingsNavigationItem = { label: string; path: SettingsPath; Icon: IconComponent; - matchSubPages?: boolean; indentationLevel?: NavigationDrawerItemIndentationLevel; }; @@ -90,14 +89,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 +106,7 @@ export const SettingsNavigationDrawerItems = () => { return matchPath( { path: pathName, - end: !accountSubSetting.matchSubPages, + end: true, }, currentPathName, ); @@ -134,6 +131,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 /> {isCRMMigrationEnabled && ( { label="API & Webhooks" path={SettingsPath.Developers} Icon={IconCode} - matchSubPages /> {isFunctionSettingsEnabled && ( )} From b32d37296b105cf4054a72ee1395ddea89f43fcc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Malfait?= Date: Sun, 13 Oct 2024 13:14:27 +0200 Subject: [PATCH 4/4] Address comment --- .../settings/components/SettingsNavigationDrawerItems.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/twenty-front/src/modules/settings/components/SettingsNavigationDrawerItems.tsx b/packages/twenty-front/src/modules/settings/components/SettingsNavigationDrawerItems.tsx index a7fbaa985d65..8ca0f3ea214e 100644 --- a/packages/twenty-front/src/modules/settings/components/SettingsNavigationDrawerItems.tsx +++ b/packages/twenty-front/src/modules/settings/components/SettingsNavigationDrawerItems.tsx @@ -44,6 +44,7 @@ type SettingsNavigationItem = { path: SettingsPath; Icon: IconComponent; indentationLevel?: NavigationDrawerItemIndentationLevel; + matchSubPages?: boolean; }; const StyledIconContainer = styled.div` @@ -106,7 +107,7 @@ export const SettingsNavigationDrawerItems = () => { return matchPath( { path: pathName, - end: true, + end: !accountSubSetting.matchSubPages ?? true, }, currentPathName, );