diff --git a/src/components/dashboard/dashboard-shell.tsx b/src/components/dashboard/dashboard-shell.tsx index cde3b25..aa02651 100644 --- a/src/components/dashboard/dashboard-shell.tsx +++ b/src/components/dashboard/dashboard-shell.tsx @@ -45,6 +45,7 @@ import { approvalLabel, canManageBudgets, canManageUsers, + getAvailableApprovalRoles, roleLabel } from "@/lib/domain"; @@ -1091,7 +1092,8 @@ export function DashboardShell({ function renderApprovalPermissionSelector( value: ApprovalPermissionValue[], onToggle: (approvalType: ApprovalPermissionValue) => void, - helperText: string + helperText: string, + availableApprovalTypes: ApprovalPermissionValue[] ) { return ( @@ -1099,21 +1101,27 @@ export function DashboardShell({ Freigaberollen - {APPROVAL_FLOW.map((approvalType) => { - const selected = value.includes(approvalType); + {availableApprovalTypes.length > 0 ? ( + availableApprovalTypes.map((approvalType) => { + const selected = value.includes(approvalType); - return ( - - ); - })} + return ( + + ); + }) + ) : ( + + Keine Freigaberollen verfuegbar + + )} {helperText} @@ -1778,7 +1786,8 @@ export function DashboardShell({ ...current, approvalPermissions: toggleApprovalPermission(current.approvalPermissions, approvalType) })), - "Lege fest, für welche Freigabeschritte dieses Konto zeichnen darf." + "Lege fest, für welche Freigabeschritte dieses Konto zeichnen darf.", + getAvailableApprovalRoles(userForm.role) )}