Freigaberollen in Verwaltung verschieben
All checks were successful
CI / Build and Deploy (push) Successful in 3m8s
All checks were successful
CI / Build and Deploy (push) Successful in 3m8s
This commit is contained in:
@@ -18,14 +18,12 @@ import {
|
|||||||
Button,
|
Button,
|
||||||
Card,
|
Card,
|
||||||
CardContent,
|
CardContent,
|
||||||
Checkbox,
|
|
||||||
Chip,
|
Chip,
|
||||||
Container,
|
Container,
|
||||||
Dialog,
|
Dialog,
|
||||||
DialogActions,
|
DialogActions,
|
||||||
DialogContent,
|
DialogContent,
|
||||||
DialogTitle,
|
DialogTitle,
|
||||||
FormControlLabel,
|
|
||||||
IconButton,
|
IconButton,
|
||||||
MenuItem,
|
MenuItem,
|
||||||
Stack,
|
Stack,
|
||||||
@@ -1260,6 +1258,11 @@ export function DashboardShell({
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (orgaSettingsDraft.requiredApprovalTypes.length === 0) {
|
||||||
|
setMessage({ type: "error", text: "Bitte mindestens eine Freigaberolle auswählen." });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
await runAction(async () => {
|
await runAction(async () => {
|
||||||
await parseResponse(
|
await parseResponse(
|
||||||
await fetch("/api/settings", {
|
await fetch("/api/settings", {
|
||||||
@@ -1268,7 +1271,8 @@ export function DashboardShell({
|
|||||||
"Content-Type": "application/json"
|
"Content-Type": "application/json"
|
||||||
},
|
},
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
approvalThreshold: nextThreshold
|
approvalThreshold: nextThreshold,
|
||||||
|
requiredApprovalTypes: orgaSettingsDraft.requiredApprovalTypes
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
@@ -1482,7 +1486,7 @@ export function DashboardShell({
|
|||||||
value: ApprovalPermissionValue[],
|
value: ApprovalPermissionValue[],
|
||||||
onToggle: (approvalType: ApprovalPermissionValue) => void,
|
onToggle: (approvalType: ApprovalPermissionValue) => void,
|
||||||
helperText: string,
|
helperText: string,
|
||||||
availableApprovalTypes: ApprovalPermissionValue[]
|
availableApprovalTypes: readonly ApprovalPermissionValue[]
|
||||||
) {
|
) {
|
||||||
return (
|
return (
|
||||||
<Stack spacing={1}>
|
<Stack spacing={1}>
|
||||||
@@ -2297,8 +2301,18 @@ export function DashboardShell({
|
|||||||
helperText={`Aktuell: ${approvalThreshold.toFixed(2)} EUR`}
|
helperText={`Aktuell: ${approvalThreshold.toFixed(2)} EUR`}
|
||||||
fullWidth
|
fullWidth
|
||||||
/>
|
/>
|
||||||
|
{renderApprovalPermissionSelector(
|
||||||
|
orgaSettingsDraft.requiredApprovalTypes,
|
||||||
|
(approvalType) =>
|
||||||
|
setOrgaSettingsDraft((current) => ({
|
||||||
|
...current,
|
||||||
|
requiredApprovalTypes: toggleApprovalPermission(current.requiredApprovalTypes, approvalType)
|
||||||
|
})),
|
||||||
|
"Diese Rollen müssen schwellenpflichtige Ausgaben bestätigen. AG-Mitglieder können nicht freigeben.",
|
||||||
|
APPROVAL_FLOW
|
||||||
|
)}
|
||||||
<Button type="button" variant="outlined" disabled={busy} onClick={handleSaveApprovalThreshold}>
|
<Button type="button" variant="outlined" disabled={busy} onClick={handleSaveApprovalThreshold}>
|
||||||
Schwelle speichern
|
Schwelle und Freigaberollen speichern
|
||||||
</Button>
|
</Button>
|
||||||
</Stack>
|
</Stack>
|
||||||
</CardContent>
|
</CardContent>
|
||||||
@@ -2911,37 +2925,10 @@ export function DashboardShell({
|
|||||||
</Container>
|
</Container>
|
||||||
</Box>
|
</Box>
|
||||||
|
|
||||||
<Dialog open={isOrgaSettingsOpen} onClose={() => setIsOrgaSettingsOpen(false)} fullWidth maxWidth="sm">
|
<Dialog open={isOrgaSettingsOpen} onClose={() => setIsOrgaSettingsOpen(false)} fullWidth maxWidth="sm">
|
||||||
<DialogTitle>Zuständigkeiten & Benachrichtigungen</DialogTitle>
|
<DialogTitle>Zuständigkeiten & Benachrichtigungen</DialogTitle>
|
||||||
<DialogContent>
|
<DialogContent>
|
||||||
<Stack spacing={2.5} sx={{ pt: 1 }}>
|
<Stack spacing={2.5} sx={{ pt: 1 }}>
|
||||||
<Box>
|
|
||||||
<Typography variant="subtitle1" sx={{ fontWeight: 700 }}>
|
|
||||||
Freigaberollen
|
|
||||||
</Typography>
|
|
||||||
<Typography variant="body2" color="text.secondary">
|
|
||||||
Diese Rollen müssen neue schwellenpflichtige Ausgaben bestätigen.
|
|
||||||
</Typography>
|
|
||||||
<Stack spacing={0.5} sx={{ mt: 1 }}>
|
|
||||||
{APPROVAL_FLOW.map((approvalType) => (
|
|
||||||
<FormControlLabel
|
|
||||||
key={approvalType}
|
|
||||||
control={
|
|
||||||
<Checkbox
|
|
||||||
checked={orgaSettingsDraft.requiredApprovalTypes.includes(approvalType)}
|
|
||||||
onChange={() =>
|
|
||||||
setOrgaSettingsDraft((current) => ({
|
|
||||||
...current,
|
|
||||||
requiredApprovalTypes: toggleApprovalPermission(current.requiredApprovalTypes, approvalType)
|
|
||||||
}))
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
}
|
|
||||||
label={approvalLabel(approvalType)}
|
|
||||||
/>
|
|
||||||
))}
|
|
||||||
</Stack>
|
|
||||||
</Box>
|
|
||||||
<TextField
|
<TextField
|
||||||
select
|
select
|
||||||
label="Budgetfreigabe-Push"
|
label="Budgetfreigabe-Push"
|
||||||
|
|||||||
Reference in New Issue
Block a user