fix(giving): render Finance nav section in UserPortal sidebar
Task 11 added the finance nav to user-navbar.component, but the active sidebar is rendered inline by UserPortalComponent (app-user-navbar is not mounted). Added the role-gated Finance section (Offering Entry / Givings / Giving Types) to UserPortalComponent, matching its Administration pattern. Verified at runtime: section renders for super_admin and links load the giving pages. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -70,8 +70,15 @@ export class UserPortalComponent implements OnInit, OnDestroy {
|
||||
{ text: 'User Management', icon: userIcon, path: '/user-portal/admin/users' },
|
||||
];
|
||||
|
||||
public financeNavItems: NavItem[] = [
|
||||
{ text: 'Offering Entry', icon: this.creditCardIcon, path: '/user-portal/finance/offering-session' },
|
||||
{ text: 'Givings', icon: this.creditCardIcon, path: '/user-portal/finance/givings' },
|
||||
{ text: 'Giving Types', icon: this.creditCardIcon, path: '/user-portal/finance/giving-categories' },
|
||||
];
|
||||
|
||||
public showMemberAdminSection = false;
|
||||
public showUserAdminSection = false;
|
||||
public showFinanceSection = false;
|
||||
|
||||
private destroy$ = new Subject<void>();
|
||||
|
||||
@@ -114,6 +121,7 @@ export class UserPortalComponent implements OnInit, OnDestroy {
|
||||
const roles = user?.roles ?? [];
|
||||
this.showMemberAdminSection = roles.some(r => r === 'super_admin' || r === 'secretary');
|
||||
this.showUserAdminSection = roles.includes('super_admin');
|
||||
this.showFinanceSection = roles.some(r => r === 'finance' || r === 'super_admin');
|
||||
});
|
||||
}
|
||||
|
||||
@@ -144,6 +152,7 @@ export class UserPortalComponent implements OnInit, OnDestroy {
|
||||
...this.supportNavItems,
|
||||
...this.memberAdminNavItems,
|
||||
...this.userAdminNavItems,
|
||||
...this.financeNavItems,
|
||||
];
|
||||
allItems.forEach(item => (item.active = false));
|
||||
|
||||
@@ -182,6 +191,9 @@ export class UserPortalComponent implements OnInit, OnDestroy {
|
||||
'settings': 'Settings',
|
||||
'admin/members': 'Member Management',
|
||||
'admin/users': 'User Management',
|
||||
'finance/offering-session': 'Sunday Offering Entry',
|
||||
'finance/givings': 'Givings',
|
||||
'finance/giving-categories': 'Giving Types',
|
||||
};
|
||||
return titles[page] ?? 'Dashboard';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user