mirror of
https://github.com/langgenius/dify.git
synced 2026-09-01 15:09:21 +08:00
fix(web): make legacy Home redirect permanent (#40492)
This commit is contained in:
@@ -971,22 +971,6 @@ describe('MainNav', () => {
|
||||
expect(homeLink).toHaveClass(activeStackingClassName)
|
||||
})
|
||||
|
||||
it('keeps Home active on the legacy explore apps route only', () => {
|
||||
mockPathname = '/explore/apps'
|
||||
|
||||
const { rerender } = renderMainNav()
|
||||
|
||||
const homeLink = screen.getByRole('link', { name: /common.mainNav.home/ })
|
||||
expect(homeLink).toHaveAttribute('aria-current', 'page')
|
||||
|
||||
mockPathname = '/installed/installed-1'
|
||||
rerender(<MainNav />)
|
||||
|
||||
expect(screen.getByRole('link', { name: /common.mainNav.home/ })).not.toHaveAttribute(
|
||||
'aria-current',
|
||||
)
|
||||
})
|
||||
|
||||
it('opens goto anything from the search button', async () => {
|
||||
renderMainNav(undefined, {
|
||||
extra: (
|
||||
|
||||
@@ -42,7 +42,7 @@ export const MAIN_NAV_ROUTES = [
|
||||
key: 'home',
|
||||
href: '/',
|
||||
labelKey: 'mainNav.home',
|
||||
active: (path: string) => path === '/' || path === '/explore/apps',
|
||||
active: (path: string) => path === '/',
|
||||
icon: 'i-custom-vender-main-nav-home',
|
||||
activeIcon: 'i-custom-vender-main-nav-home-active',
|
||||
visibility: VISIBLE_TO_ALL,
|
||||
|
||||
+1
-1
@@ -36,7 +36,7 @@ const nextConfig: NextConfig = {
|
||||
{
|
||||
source: '/explore/apps',
|
||||
destination: '/',
|
||||
permanent: false,
|
||||
permanent: true,
|
||||
},
|
||||
]
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user