- 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 <img width="851" alt="Screenshot 2025-03-19 at 9 46 33 PM" src="https://github.com/user-attachments/assets/3d73ec84-a2b7-4c4d-9605-dc83a9a760c1" /> --------- Co-authored-by: Félix Malfait <felix@twenty.com>
This commit is contained in:
@ -18,7 +18,6 @@ export class SettingsPage {
|
|||||||
private readonly adminPanelLink: Locator;
|
private readonly adminPanelLink: Locator;
|
||||||
private readonly labLink: Locator;
|
private readonly labLink: Locator;
|
||||||
private readonly releasesLink: Locator;
|
private readonly releasesLink: Locator;
|
||||||
private readonly logoutLink: Locator;
|
|
||||||
private readonly advancedToggle: Locator;
|
private readonly advancedToggle: Locator;
|
||||||
|
|
||||||
constructor(public readonly page: Page) {
|
constructor(public readonly page: Page) {
|
||||||
@ -40,7 +39,6 @@ export class SettingsPage {
|
|||||||
this.adminPanelLink = page.getByRole('link', { name: 'Admin Panel' });
|
this.adminPanelLink = page.getByRole('link', { name: 'Admin Panel' });
|
||||||
this.labLink = page.getByRole('link', { name: 'Lab' });
|
this.labLink = page.getByRole('link', { name: 'Lab' });
|
||||||
this.releasesLink = page.getByRole('link', { name: 'Releases' });
|
this.releasesLink = page.getByRole('link', { name: 'Releases' });
|
||||||
this.logoutLink = page.getByText('Logout');
|
|
||||||
this.advancedToggle = page.locator('input[type="checkbox"]').first();
|
this.advancedToggle = page.locator('input[type="checkbox"]').first();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -112,10 +110,6 @@ export class SettingsPage {
|
|||||||
await this.releasesLink.click();
|
await this.releasesLink.click();
|
||||||
}
|
}
|
||||||
|
|
||||||
async logout() {
|
|
||||||
await this.logoutLink.click();
|
|
||||||
}
|
|
||||||
|
|
||||||
async toggleAdvancedSettings() {
|
async toggleAdvancedSettings() {
|
||||||
await this.advancedToggle.click();
|
await this.advancedToggle.click();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,7 +6,6 @@ import {
|
|||||||
IconColorSwatch,
|
IconColorSwatch,
|
||||||
IconComponent,
|
IconComponent,
|
||||||
IconCurrencyDollar,
|
IconCurrencyDollar,
|
||||||
IconDoorEnter,
|
|
||||||
IconFlask,
|
IconFlask,
|
||||||
IconFunction,
|
IconFunction,
|
||||||
IconHierarchy2,
|
IconHierarchy2,
|
||||||
@ -25,7 +24,6 @@ import { SettingsPath } from '@/types/SettingsPath';
|
|||||||
import { FeatureFlagKey } from '~/generated-metadata/graphql';
|
import { FeatureFlagKey } from '~/generated-metadata/graphql';
|
||||||
import { SettingsPermissions } from '~/generated/graphql';
|
import { SettingsPermissions } from '~/generated/graphql';
|
||||||
|
|
||||||
import { useAuth } from '@/auth/hooks/useAuth';
|
|
||||||
import { currentUserState } from '@/auth/states/currentUserState';
|
import { currentUserState } from '@/auth/states/currentUserState';
|
||||||
import { billingState } from '@/client-config/states/billingState';
|
import { billingState } from '@/client-config/states/billingState';
|
||||||
import { labPublicFeatureFlagsState } from '@/client-config/states/labPublicFeatureFlagsState';
|
import { labPublicFeatureFlagsState } from '@/client-config/states/labPublicFeatureFlagsState';
|
||||||
@ -67,7 +65,6 @@ const useSettingsNavigationItems = (): SettingsNavigationSection[] => {
|
|||||||
|
|
||||||
const featureFlags = useFeatureFlagsMap();
|
const featureFlags = useFeatureFlagsMap();
|
||||||
const permissionMap = useSettingsPermissionMap();
|
const permissionMap = useSettingsPermissionMap();
|
||||||
const { signOut } = useAuth();
|
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
label: t`User`,
|
label: t`User`,
|
||||||
@ -204,11 +201,6 @@ const useSettingsNavigationItems = (): SettingsNavigationSection[] => {
|
|||||||
path: SettingsPath.Releases,
|
path: SettingsPath.Releases,
|
||||||
Icon: IconRocket,
|
Icon: IconRocket,
|
||||||
},
|
},
|
||||||
{
|
|
||||||
label: t`Logout`,
|
|
||||||
onClick: signOut,
|
|
||||||
Icon: IconDoorEnter,
|
|
||||||
},
|
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|||||||
@ -11,9 +11,9 @@ import {
|
|||||||
IconCalendarEvent,
|
IconCalendarEvent,
|
||||||
IconCheckbox,
|
IconCheckbox,
|
||||||
IconColorSwatch,
|
IconColorSwatch,
|
||||||
IconDoorEnter,
|
|
||||||
IconMail,
|
IconMail,
|
||||||
IconSearch,
|
IconSearch,
|
||||||
|
IconServer,
|
||||||
IconSettings,
|
IconSettings,
|
||||||
IconTargetArrow,
|
IconTargetArrow,
|
||||||
IconUser,
|
IconUser,
|
||||||
@ -184,7 +184,11 @@ export const Settings: Story = {
|
|||||||
|
|
||||||
<NavigationDrawerSection>
|
<NavigationDrawerSection>
|
||||||
<NavigationDrawerSectionTitle label="Other" />
|
<NavigationDrawerSectionTitle label="Other" />
|
||||||
<NavigationDrawerItem label="Logout" Icon={IconDoorEnter} />
|
<NavigationDrawerItem
|
||||||
|
label="Admin Panel"
|
||||||
|
to={getSettingsPath(SettingsPath.AdminPanel)}
|
||||||
|
Icon={IconServer}
|
||||||
|
/>
|
||||||
</NavigationDrawerSection>
|
</NavigationDrawerSection>
|
||||||
</>
|
</>
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user