-
Notifications
You must be signed in to change notification settings - Fork 13.8k
feat: Global header #35807
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
Merged
Merged
feat: Global header #35807
Changes from 1 commit
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
a7a2f20
feat: NavBar pages, actions and preferences (#35707)
dougfabris 83107f5
Merge branch 'develop' into feat/global-navigation
dougfabris 5702b7e
feat: Introduce `NavBarNavigation` and `NavBarSearch` (#35798)
dougfabris 4b8fd9b
feat: NavBar Responsiveness (#35835)
dougfabris b901995
Merge branch 'develop' into feat/global-navigation
dougfabris 6e96f15
i18n: revert "Pages"
dougfabris aa9f4fa
test: remove code repetition
dougfabris 0c84c16
chore: changeset
dougfabris 0ac1997
test: add e2e tests for global header
dougfabris e8bc00c
chore: reduce `NavBarSearch` complexity
dougfabris 8de3921
fix: SidebarTogglerV2
dougfabris 25d6ee0
Merge branch 'develop' into feat/global-navigation
kodiakhq[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 0 additions & 29 deletions
29
apps/meteor/client/NavBarV2/NavBarPagesToolbar/NavBarItemAuditMenu.tsx
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
12 changes: 6 additions & 6 deletions
12
...ader/actions/hooks/useCreateRoomItems.tsx → ...rPagesToolbar/hooks/useCreateNewItems.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions
8
...eader/actions/hooks/useCreateRoomMenu.tsx → ...arPagesToolbar/hooks/useCreateNewMenu.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions
4
...actions/hooks/useMatrixFederationItems.ts → ...Toolbar/hooks/useMatrixFederationItems.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| export { default as NavBarItemAuditMenu } from './NavBarItemAuditMenu'; | ||
| export { default as NavBarItemHomePage } from './NavBarItemHomePage'; | ||
| export { default as NavBarItemMarketPlaceMenu } from './NavBarItemMarketPlaceMenu'; | ||
| export { default as NavBarItemDirectoryPage } from './NavBarItemDirectoryPage'; | ||
| export { default as NavBarItemCreateNew } from './NavBarItemCreateNew'; | ||
| export { default as NavBarItemSort } from './NavBarItemSort'; |
70 changes: 70 additions & 0 deletions
70
apps/meteor/client/NavBarV2/NavBarSettingsToolbar/NavBarItemAdministrationMenu.spec.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| import { mockAppRoot } from '@rocket.chat/mock-providers'; | ||
| import { render, screen, waitFor } from '@testing-library/react'; | ||
| import userEvent from '@testing-library/user-event'; | ||
|
|
||
| import NavBarItemAdministrationMenu from './NavBarItemAdministrationMenu'; | ||
|
|
||
| it('should not display the menu if no permission is set', async () => { | ||
| render(<NavBarItemAdministrationMenu />, { wrapper: mockAppRoot().build() }); | ||
|
|
||
| expect(screen.queryByRole('button', { name: 'Manage' })).not.toBeInTheDocument(); | ||
| }); | ||
|
|
||
| it('should display the workspace menu item if at least one admin permission is set', async () => { | ||
| render(<NavBarItemAdministrationMenu />, { wrapper: mockAppRoot().withPermission('access-permissions').build() }); | ||
|
|
||
| const menuButton = await screen.findByRole('button', { name: 'Manage' }); | ||
| await userEvent.click(menuButton); | ||
|
dougfabris marked this conversation as resolved.
Outdated
|
||
| expect(await screen.findByRole('menuitem', { name: 'Workspace' })).toBeInTheDocument(); | ||
| }); | ||
|
|
||
| it('should display the omnichannel menu item if view-livechat-manager permission is set', async () => { | ||
| render(<NavBarItemAdministrationMenu />, { | ||
| wrapper: mockAppRoot().withPermission('view-livechat-manager').withPermission('access-permissions').build(), | ||
| }); | ||
|
|
||
| const menuButton = await screen.findByRole('button', { name: 'Manage' }); | ||
| await userEvent.click(menuButton); | ||
| expect(await screen.findByRole('menuitem', { name: 'Omnichannel' })).toBeInTheDocument(); | ||
| }); | ||
|
|
||
| it('should not display any audit items if has at least one admin permission, some audit permission and the auditing module is not enabled', async () => { | ||
| render(<NavBarItemAdministrationMenu />, { | ||
| wrapper: mockAppRoot().withPermission('access-permissions').withPermission('can-audit').build(), | ||
| }); | ||
|
|
||
| const menuButton = await screen.findByRole('button', { name: 'Manage' }); | ||
| await userEvent.click(menuButton); | ||
|
|
||
| expect(screen.queryByRole('menuitem', { name: 'Messages' })).not.toBeInTheDocument(); | ||
| }); | ||
|
|
||
| it('should display audit items if has at least one admin permission, both audit permission and the auditing module is enabled', async () => { | ||
| render(<NavBarItemAdministrationMenu />, { | ||
| wrapper: mockAppRoot() | ||
| .withEndpoint('GET', '/v1/licenses.info', () => ({ | ||
| license: { | ||
| license: { | ||
| // @ts-expect-error: just for testing | ||
| grantedModules: [{ module: 'auditing' }], | ||
| }, | ||
| // @ts-expect-error: just for testing | ||
| activeModules: ['auditing'], | ||
| }, | ||
| })) | ||
| .withJohnDoe() | ||
| .withPermission('can-audit') | ||
| .withPermission('can-audit-log') | ||
| .build(), | ||
| }); | ||
|
|
||
| const menuButton = await screen.findByRole('button', { name: 'Manage' }); | ||
| await userEvent.click(menuButton); | ||
|
|
||
| await waitFor(() => { | ||
| expect(screen.getByText('Messages')).toBeInTheDocument(); | ||
| }); | ||
|
|
||
| expect(await screen.findByRole('menuitem', { name: 'Messages' })).toBeInTheDocument(); | ||
| expect(await screen.findByRole('menuitem', { name: 'Logs' })).toBeInTheDocument(); | ||
| }); | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.