mirror of
https://github.com/ichsankurnia/hats-app.git
synced 2026-12-06 23:06:29 +00:00
Improve RBAC management and permissions UI
Unify interactive and read-only role permission rows, refine role and menu forms and labels, and correct the access-permissions sidebar route. Update role payloads and admin-menu handling.
This commit is contained in:
@@ -3,6 +3,21 @@
|
||||
import { usePathname } from 'next/navigation';
|
||||
import Link from 'next/link';
|
||||
|
||||
const SEGMENT_LABELS: Record<string, string> = {
|
||||
'rbac': 'RBAC',
|
||||
'action-pemission': 'Access Permissions',
|
||||
'action-permissions': 'Access Permissions',
|
||||
'menu': 'Menu Management',
|
||||
'user-role': 'Role Management',
|
||||
'create': 'Create',
|
||||
'edit': 'Edit',
|
||||
'administration': 'Administration',
|
||||
'company': 'Company',
|
||||
'user': 'User',
|
||||
'division': 'Division',
|
||||
'area': 'Area',
|
||||
};
|
||||
|
||||
export default function AdminBreadcrumb() {
|
||||
const pathname = usePathname();
|
||||
|
||||
@@ -12,6 +27,9 @@ export default function AdminBreadcrumb() {
|
||||
.slice(1); // skip 'admin'
|
||||
|
||||
const formatSegment = (seg: string) => {
|
||||
if (SEGMENT_LABELS[seg.toLowerCase()]) {
|
||||
return SEGMENT_LABELS[seg.toLowerCase()];
|
||||
}
|
||||
return seg
|
||||
.split('-')
|
||||
.map(word => word.charAt(0).toUpperCase() + word.slice(1))
|
||||
@@ -55,4 +73,3 @@ export default function AdminBreadcrumb() {
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user