fix: Dashboard path and guest wishlist access

Issue 1 - Dashboard Always Active:
Problem: Dashboard menu showed active on all routes
Root Cause: Navigation tree used path='/' which matched all routes
Solution: Changed dashboard path from '/' to '/dashboard' in NavigationRegistry
- Main menu path: '/' → '/dashboard'
- Overview submenu: '/' → '/dashboard'
- SPA already had redirect from '/' to '/dashboard'
Result: Dashboard only active on dashboard routes 

Issue 2 - Guest Wishlist Blocked:
Problem: Heart icon required login despite enable_guest_wishlist setting
Root Cause: Wishlist icon had user?.isLoggedIn check in frontend
Solution: Removed isLoggedIn check from wishlist icon visibility
- Backend already checks enable_guest_wishlist setting in check_permission()
- Frontend now shows icon when module enabled + show_in_header setting
- Guests can click and access wishlist (backend enforces permission)
Result: Guest wishlist fully functional 

Files Modified (2):
- includes/Compat/NavigationRegistry.php (dashboard path)
- customer-spa/src/layouts/BaseLayout.tsx (removed login check)
- admin-spa/dist/app.js + customer-spa/dist/app.js (rebuilt)

Both issues resolved!
This commit is contained in:
Dwindi Ramadhana
2025-12-26 22:32:15 +07:00
parent 863610043d
commit 3aaee45981
2 changed files with 3 additions and 3 deletions

View File

@@ -135,7 +135,7 @@ function ClassicLayout({ children }: BaseLayoutProps) {
))}
{/* Wishlist */}
{headerSettings.elements.wishlist && isEnabled('wishlist') && (wishlistSettings.show_in_header ?? true) && user?.isLoggedIn && (
{headerSettings.elements.wishlist && isEnabled('wishlist') && (wishlistSettings.show_in_header ?? true) && (
<Link to="/my-account/wishlist" className="flex items-center gap-2 text-sm font-medium text-gray-700 hover:text-gray-900 transition-colors no-underline">
<Heart className="h-5 w-5" />
<span className="hidden lg:block">Wishlist</span>