From d8ea292321acd341f217f3a2a4d9cfb97b63631c Mon Sep 17 00:00:00 2001 From: Dev Iyer Date: Thu, 20 Mar 2025 02:08:59 -0700 Subject: [PATCH] (#11036) task: remove redundant logout button from settings sidebar (#11050) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Removed logout item from settings navigation drawer - Removed logout locator and method from E2E tests - Removed logout item from NavigationDrawer story The logout functionality is now exclusively available through the menu switcher, making the UI more consistent and reducing duplication. Closes #11036 Screenshot 2025-03-19 at 9 46 33 PM --------- Co-authored-by: Félix Malfait --- packages/twenty-e2e-testing/lib/pom/settingsPage.ts | 6 ------ .../modules/settings/hooks/useSettingsNavigationItems.tsx | 8 -------- .../components/__stories__/NavigationDrawer.stories.tsx | 8 ++++++-- 3 files changed, 6 insertions(+), 16 deletions(-) diff --git a/packages/twenty-e2e-testing/lib/pom/settingsPage.ts b/packages/twenty-e2e-testing/lib/pom/settingsPage.ts index 7098e6a6e..e2dbd557f 100644 --- a/packages/twenty-e2e-testing/lib/pom/settingsPage.ts +++ b/packages/twenty-e2e-testing/lib/pom/settingsPage.ts @@ -18,7 +18,6 @@ export class SettingsPage { private readonly adminPanelLink: Locator; private readonly labLink: Locator; private readonly releasesLink: Locator; - private readonly logoutLink: Locator; private readonly advancedToggle: Locator; constructor(public readonly page: Page) { @@ -40,7 +39,6 @@ export class SettingsPage { this.adminPanelLink = page.getByRole('link', { name: 'Admin Panel' }); this.labLink = page.getByRole('link', { name: 'Lab' }); this.releasesLink = page.getByRole('link', { name: 'Releases' }); - this.logoutLink = page.getByText('Logout'); this.advancedToggle = page.locator('input[type="checkbox"]').first(); } @@ -112,10 +110,6 @@ export class SettingsPage { await this.releasesLink.click(); } - async logout() { - await this.logoutLink.click(); - } - async toggleAdvancedSettings() { await this.advancedToggle.click(); } diff --git a/packages/twenty-front/src/modules/settings/hooks/useSettingsNavigationItems.tsx b/packages/twenty-front/src/modules/settings/hooks/useSettingsNavigationItems.tsx index 342f8a482..c12ca77fc 100644 --- a/packages/twenty-front/src/modules/settings/hooks/useSettingsNavigationItems.tsx +++ b/packages/twenty-front/src/modules/settings/hooks/useSettingsNavigationItems.tsx @@ -6,7 +6,6 @@ import { IconColorSwatch, IconComponent, IconCurrencyDollar, - IconDoorEnter, IconFlask, IconFunction, IconHierarchy2, @@ -25,7 +24,6 @@ import { SettingsPath } from '@/types/SettingsPath'; import { FeatureFlagKey } from '~/generated-metadata/graphql'; import { SettingsPermissions } from '~/generated/graphql'; -import { useAuth } from '@/auth/hooks/useAuth'; import { currentUserState } from '@/auth/states/currentUserState'; import { billingState } from '@/client-config/states/billingState'; import { labPublicFeatureFlagsState } from '@/client-config/states/labPublicFeatureFlagsState'; @@ -67,7 +65,6 @@ const useSettingsNavigationItems = (): SettingsNavigationSection[] => { const featureFlags = useFeatureFlagsMap(); const permissionMap = useSettingsPermissionMap(); - const { signOut } = useAuth(); return [ { label: t`User`, @@ -204,11 +201,6 @@ const useSettingsNavigationItems = (): SettingsNavigationSection[] => { path: SettingsPath.Releases, Icon: IconRocket, }, - { - label: t`Logout`, - onClick: signOut, - Icon: IconDoorEnter, - }, ], }, ]; diff --git a/packages/twenty-front/src/modules/ui/navigation/navigation-drawer/components/__stories__/NavigationDrawer.stories.tsx b/packages/twenty-front/src/modules/ui/navigation/navigation-drawer/components/__stories__/NavigationDrawer.stories.tsx index abf14f0ce..5f6cb55cf 100644 --- a/packages/twenty-front/src/modules/ui/navigation/navigation-drawer/components/__stories__/NavigationDrawer.stories.tsx +++ b/packages/twenty-front/src/modules/ui/navigation/navigation-drawer/components/__stories__/NavigationDrawer.stories.tsx @@ -11,9 +11,9 @@ import { IconCalendarEvent, IconCheckbox, IconColorSwatch, - IconDoorEnter, IconMail, IconSearch, + IconServer, IconSettings, IconTargetArrow, IconUser, @@ -184,7 +184,11 @@ export const Settings: Story = { - + ),