Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MS] Keep the top of the sidebar visible at all times #9354

Merged
merged 2 commits into from
Jan 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 26 additions & 23 deletions client/src/views/sidebar-menu/SidebarMenuPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,13 @@
class="sidebar"
>
<ion-header class="sidebar-header">
<div v-show="!isManagement()">
<div>
<!-- active organization -->
<ion-card class="organization-card">
<ion-card-header
class="organization-card-header organization-card-header-desktop"
@click="openOrganizationChoice($event)"
v-show="!isManagement()"
>
<ion-avatar class="organization-avatar body-lg">
<span v-if="!isTrialOrg">{{ userInfo ? userInfo.organizationId.substring(0, 2) : '' }}</span>
Expand All @@ -42,13 +43,29 @@
/>
</ion-card-header>

<div v-show="isManagement()">
<div
class="back-organization"
@click="navigateTo(Routes.Workspaces)"
>
<ion-button
fill="clear"
class="back-button"
>
<ion-icon :icon="chevronBack" />
{{ $msTranslate('SideMenu.back') }}
</ion-button>
</div>
</div>

<div
class="organization-card-buttons"
v-if="userInfo"
>
<ion-text
@click="navigateTo(Routes.Users)"
class="organization-card-buttons__item button-medium"
:class="currentRouteIsOrganizationManagementRoute() ? 'active' : ''"
id="manageOrganization"
v-show="userInfo.currentProfile != UserProfile.Outsider"
button
Expand Down Expand Up @@ -85,21 +102,6 @@
<!-- end of active organization -->
</div>

<div v-show="isManagement()">
<div
class="back-organization"
@click="navigateTo(Routes.Workspaces)"
>
<ion-button
fill="clear"
class="back-button"
>
<ion-icon :icon="chevronBack" />
{{ $msTranslate('SideMenu.back') }}
</ion-button>
</div>
</div>

<!-- frozen organization -->
<div
class="freeze-card"
Expand Down Expand Up @@ -702,6 +704,7 @@ async function onRecentFilesMenuVisibilityChanged(visible: boolean): Promise<voi
--background: transparent;
position: relative;
z-index: 12;
border-top: 1px solid var(--parsec-color-light-primary-30-opacity15);
}

.organization-workspaces,
Expand All @@ -723,21 +726,22 @@ async function onRecentFilesMenuVisibilityChanged(visible: boolean): Promise<voi
&-header {
display: flex;
flex-direction: row;
border-radius: var(--parsec-radius-8);
border-radius: var(--parsec-radius-12);
box-shadow: none;
align-items: center;
margin: 0 0.5rem;
padding: 0.5rem 1rem;
padding: 0.75rem 1rem;
gap: 0.5em;
position: relative;
z-index: 2;
border: 1px solid transparent;

&-desktop:hover {
cursor: pointer;
background: var(--parsec-color-light-primary-30-opacity15);
border-color: var(--parsec-color-light-primary-30-opacity15);
}

.organization-avatar {
&-desktop .organization-avatar {
background-color: var(--parsec-color-light-secondary-premiere);
color: var(--parsec-color-light-primary-600);
width: 2rem;
Expand Down Expand Up @@ -836,7 +840,8 @@ async function onRecentFilesMenuVisibilityChanged(visible: boolean): Promise<voi
align-items: center;
user-select: none;
align-self: stretch;
padding: 1rem;
padding: 0.625rem 1rem;
border: 1px solid transparent;
color: var(--parsec-color-light-secondary-inversed-contrast);
gap: 1rem;

Expand Down Expand Up @@ -877,7 +882,6 @@ ion-menu {
align-items: center;
justify-content: space-between;
transition: border 0.2s ease-in-out;
border-top: 1px solid var(--parsec-color-light-primary-30-opacity15);
padding: 1.5em 0 1em 0.5rem;

&__title {
Expand Down Expand Up @@ -1059,7 +1063,6 @@ ion-menu {

.title-h4 {
padding: 1.5em 0 1em;
border-top: 1px solid var(--parsec-color-light-primary-30-opacity15);
}
}
</style>
14 changes: 14 additions & 0 deletions client/tests/e2e/specs/sidebar.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ import { expect, msTest } from '@tests/e2e/helpers';
msTest('Sidebar in organization management', async ({ organizationPage }) => {
const sidebar = organizationPage.locator('.sidebar');

await expect(sidebar.locator('.back-button')).toBeVisible();

const mainButtons = sidebar.locator('.organization-card-buttons').locator('.organization-card-buttons__item');
await expect(mainButtons).toHaveText(['Manage my organization', 'My workspaces']);
await expect(mainButtons.nth(0)).toHaveTheClass('active');
await expect(mainButtons.nth(1)).not.toHaveTheClass('active');

await expect(sidebar.locator('.file-workspaces')).toBeHidden();
await expect(sidebar.locator('.favorites')).toBeHidden();
await expect(sidebar.locator('.workspaces')).toBeHidden();
Expand All @@ -18,6 +25,13 @@ msTest('Sidebar in organization management', async ({ organizationPage }) => {
msTest('Sidebar in workspaces page', async ({ connected }) => {
const sidebar = connected.locator('.sidebar');

await expect(sidebar.locator('.back-button')).toBeHidden();

const mainButtons = sidebar.locator('.organization-card-buttons').locator('.organization-card-buttons__item');
await expect(mainButtons).toHaveText(['Manage my organization', 'My workspaces']);
await expect(mainButtons.nth(0)).not.toHaveTheClass('active');
await expect(mainButtons.nth(1)).toHaveTheClass('active');

await expect(sidebar.locator('.file-workspaces')).toBeVisible();
await expect(sidebar.locator('.favorites')).toBeHidden();
await expect(sidebar.locator('.workspaces')).toBeVisible();
Expand Down
Loading