fix(bestellungen): use status label as button text, all progress buttons blue, keep red for reject only
This commit is contained in:
@@ -825,20 +825,15 @@ export default function BestellungDetail() {
|
|||||||
return canCreate || canManageOrders;
|
return canCreate || canManageOrders;
|
||||||
})
|
})
|
||||||
.map((s) => {
|
.map((s) => {
|
||||||
const isApprove = bestellung.status === 'wartet_auf_genehmigung' && s === 'bereit_zur_bestellung';
|
|
||||||
const isReject = bestellung.status === 'wartet_auf_genehmigung' && s === 'entwurf';
|
const isReject = bestellung.status === 'wartet_auf_genehmigung' && s === 'entwurf';
|
||||||
const label = isApprove
|
const label = isReject ? 'Ablehnen' : BESTELLUNG_STATUS_LABELS[s];
|
||||||
? 'Genehmigen'
|
const color = isReject ? 'error' : 'primary';
|
||||||
: isReject
|
|
||||||
? 'Ablehnen'
|
|
||||||
: `Status: ${BESTELLUNG_STATUS_LABELS[s]}`;
|
|
||||||
const color = isApprove ? 'success' : isReject ? 'error' : 'primary';
|
|
||||||
const isAbgeschlossen = s === 'abgeschlossen';
|
const isAbgeschlossen = s === 'abgeschlossen';
|
||||||
return (
|
return (
|
||||||
<Button
|
<Button
|
||||||
key={s}
|
key={s}
|
||||||
variant="contained"
|
variant="contained"
|
||||||
color={color as 'success' | 'error' | 'primary'}
|
color={color as 'error' | 'primary'}
|
||||||
disabled={isAbgeschlossen && (!allCostsEntered || !allItemsReceived)}
|
disabled={isAbgeschlossen && (!allCostsEntered || !allItemsReceived)}
|
||||||
onClick={() => { setStatusForce(false); setStatusConfirmTarget(s); }}
|
onClick={() => { setStatusForce(false); setStatusConfirmTarget(s); }}
|
||||||
>
|
>
|
||||||
|
|||||||
Reference in New Issue
Block a user