added translations to OrdersInfo
This commit is contained in:
@@ -123,5 +123,10 @@
|
|||||||
"delete": "Löschen",
|
"delete": "Löschen",
|
||||||
"pleaseEnterPassword": "Bitte Passwort eingeben",
|
"pleaseEnterPassword": "Bitte Passwort eingeben",
|
||||||
"mainAdminMenu": "Admin-Hauptmenü",
|
"mainAdminMenu": "Admin-Hauptmenü",
|
||||||
"uuid": "UUID"
|
"uuid": "UUID",
|
||||||
|
"Orders Management": "Bestellverwaltung",
|
||||||
|
"orderDetails": "Bestelldetails",
|
||||||
|
"orderId": "Bestellnummer",
|
||||||
|
"date": "Datum",
|
||||||
|
"moveToNextStatus": "Zum nächsten Status"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -123,5 +123,10 @@
|
|||||||
"delete": "Delete",
|
"delete": "Delete",
|
||||||
"pleaseEnterPassword": "Please enter password",
|
"pleaseEnterPassword": "Please enter password",
|
||||||
"mainAdminMenu": "Main Administration Menu",
|
"mainAdminMenu": "Main Administration Menu",
|
||||||
"uuid": "UUID"
|
"uuid": "UUID",
|
||||||
|
"Orders Management": "Orders Management",
|
||||||
|
"orderDetails": "Order Details",
|
||||||
|
"orderId": "Order Number",
|
||||||
|
"date": "Date",
|
||||||
|
"moveToNextStatus": "Move to Next Status"
|
||||||
}
|
}
|
||||||
@@ -61,14 +61,16 @@ const mockOrders: OrderType[] = [
|
|||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
|
// The order in which the statuses are displayed
|
||||||
const statusOrder: OrderStatusEnum[] = [
|
const statusOrder: OrderStatusEnum[] = [
|
||||||
OrderStatusEnum.CANCELLED,
|
OrderStatusEnum.CANCELLED,
|
||||||
OrderStatusEnum.ISSUES,
|
OrderStatusEnum.ISSUES,
|
||||||
OrderStatusEnum.ORDERED,
|
OrderStatusEnum.ORDERED,
|
||||||
OrderStatusEnum.IN_PROGRESS,
|
OrderStatusEnum.IN_PROGRESS,
|
||||||
OrderStatusEnum.DELIVERED
|
OrderStatusEnum.DELIVERED
|
||||||
];
|
];
|
||||||
|
|
||||||
|
// Main component for managing orders
|
||||||
export default function OrdersInfo() {
|
export default function OrdersInfo() {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
@@ -112,14 +114,12 @@ export default function OrdersInfo() {
|
|||||||
bgcolor: theme.palette.background.paper,
|
bgcolor: theme.palette.background.paper,
|
||||||
border: `1px solid ${theme.palette.divider}`,
|
border: `1px solid ${theme.palette.divider}`,
|
||||||
borderRadius: 2
|
borderRadius: 2
|
||||||
}}
|
}}>
|
||||||
>
|
|
||||||
<Typography
|
<Typography
|
||||||
variant="h6"
|
variant="h6"
|
||||||
align="center"
|
align="center"
|
||||||
gutterBottom
|
gutterBottom
|
||||||
sx={{ color: theme.palette.text.primary }}
|
sx={{ color: theme.palette.text.primary }}>
|
||||||
>
|
|
||||||
{t(status.toString())}
|
{t(status.toString())}
|
||||||
</Typography>
|
</Typography>
|
||||||
{filtered.map((order) => (
|
{filtered.map((order) => (
|
||||||
@@ -137,7 +137,7 @@ export default function OrdersInfo() {
|
|||||||
return (
|
return (
|
||||||
<Box>
|
<Box>
|
||||||
<Typography variant="h4" align="center" gutterBottom>
|
<Typography variant="h4" align="center" gutterBottom>
|
||||||
{t("Orders Management")}
|
{t("Orders Management")} {/* Bestellverwaltung */}
|
||||||
</Typography>
|
</Typography>
|
||||||
|
|
||||||
<DndContext
|
<DndContext
|
||||||
@@ -155,21 +155,21 @@ export default function OrdersInfo() {
|
|||||||
</DndContext>
|
</DndContext>
|
||||||
|
|
||||||
<Dialog open={!!selectedOrder} onClose={() => setSelectedOrder(null)}>
|
<Dialog open={!!selectedOrder} onClose={() => setSelectedOrder(null)}>
|
||||||
<DialogTitle>Order Details</DialogTitle>
|
<DialogTitle>{t("orderDetails")}</DialogTitle> {/* Bestelldetails */}
|
||||||
<DialogContent sx={{ bgcolor: theme.palette.background.paper }}>
|
<DialogContent sx={{ bgcolor: theme.palette.background.paper }}>
|
||||||
{selectedOrder && (
|
{selectedOrder && (
|
||||||
<Box sx={{ color: theme.palette.text.primary }}>
|
<Box sx={{ color: theme.palette.text.primary }}>
|
||||||
<Typography variant="body1">
|
<Typography variant="body1">
|
||||||
<strong>Order ID:</strong> {selectedOrder.id}
|
<strong>{t("orderId")}:</strong> {selectedOrder.id}
|
||||||
</Typography>
|
</Typography>
|
||||||
<Typography variant="body1">
|
<Typography variant="body1">
|
||||||
<strong>Date:</strong> {selectedOrder.date}
|
<strong>{t("date")}:</strong> {selectedOrder.date}
|
||||||
</Typography>
|
</Typography>
|
||||||
<Typography variant="body1">
|
<Typography variant="body1">
|
||||||
<strong>Address:</strong> {selectedOrder.address}
|
<strong>{t("address")}:</strong> {selectedOrder.address}
|
||||||
</Typography>
|
</Typography>
|
||||||
<Typography variant="body1" sx={{ mt: 2 }}>
|
<Typography variant="body1" sx={{ mt: 2 }}>
|
||||||
<strong>Items:</strong>
|
<strong>{t("items")}:</strong>
|
||||||
</Typography>
|
</Typography>
|
||||||
{selectedOrder.items.map((item, idx) => (
|
{selectedOrder.items.map((item, idx) => (
|
||||||
<Typography key={idx} variant="body2">
|
<Typography key={idx} variant="body2">
|
||||||
@@ -177,7 +177,7 @@ export default function OrdersInfo() {
|
|||||||
</Typography>
|
</Typography>
|
||||||
))}
|
))}
|
||||||
<Typography variant="body1" sx={{ mt: 2 }}>
|
<Typography variant="body1" sx={{ mt: 2 }}>
|
||||||
<strong>Total:</strong> {selectedOrder.total.toFixed(2)} €
|
<strong>{t("total")}:</strong> {selectedOrder.total.toFixed(2)} €
|
||||||
</Typography>
|
</Typography>
|
||||||
<Button
|
<Button
|
||||||
variant="contained"
|
variant="contained"
|
||||||
@@ -186,12 +186,12 @@ export default function OrdersInfo() {
|
|||||||
onClick={() => {
|
onClick={() => {
|
||||||
handleNextStatus(selectedOrder);
|
handleNextStatus(selectedOrder);
|
||||||
setSelectedOrder(null);
|
setSelectedOrder(null);
|
||||||
}}
|
}}>
|
||||||
>
|
{t("moveToNextStatus")} {/* Zum nächsten Status bewegen */}
|
||||||
Move to Next Status
|
|
||||||
</Button>
|
</Button>
|
||||||
</Box>
|
</Box>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
</DialogContent>
|
</DialogContent>
|
||||||
</Dialog>
|
</Dialog>
|
||||||
</Box>
|
</Box>
|
||||||
|
|||||||
Reference in New Issue
Block a user