fix(next): active nav item not clickable in edit view (#11457)

This fixes an issue where the active collection nav item was
non-clickable inside documents. Now, it remains clickable when viewing a
document, allowing users to return to the list view from the nav items
in the sidebar.

The active state indicator still appears in both cases.
This commit is contained in:
Patrik
2025-02-28 15:14:21 -05:00
committed by GitHub
parent 81e8a9d50d
commit 83b4548fc1
4 changed files with 23 additions and 8 deletions

View File

@@ -409,12 +409,21 @@ describe('General', () => {
test('should disable active nav item', async () => {
await page.goto(postsUrl.list)
await openNav(page)
const activeItem = page.locator('.nav .nav__link.active')
const activeItem = page.locator('.nav .nav__link:has(.nav__link-indicator)')
await expect(activeItem).toBeVisible()
const tagName = await activeItem.evaluate((el) => el.tagName.toLowerCase())
expect(tagName).toBe('div')
})
test('should keep active nav item enabled in the edit view', async () => {
await page.goto(postsUrl.create)
await openNav(page)
const activeItem = page.locator('.nav .nav__link:has(.nav__link-indicator)')
await expect(activeItem).toBeVisible()
const tagName = await activeItem.evaluate((el) => el.tagName.toLowerCase())
expect(tagName).toBe('a')
})
test('breadcrumbs — should navigate from list to dashboard', async () => {
await page.goto(postsUrl.list)
await page.locator(`.step-nav a[href="${adminRoutes.routes.admin}"]`).click()

View File

@@ -64,7 +64,6 @@ export interface Config {
auth: {
users: UserAuthOperations;
};
blocks: {};
collections: {
uploads: Upload;
posts: Post;