Remove admin FS panel, merge with item panel

This commit is contained in:
Tim
2025-06-18 15:16:33 +02:00
parent 64bdd73d23
commit 9204c0a490
7 changed files with 30 additions and 15 deletions

View File

@@ -83,7 +83,7 @@ public class StatisticsServiceImpl implements StatisticsService {
int percent = (int) Math.floor(((1.0d * article.getStock() / article.getStockExpected()) * 100) / 10) * 10;
log.info("Stock percent: {} {}", article.getUuid(), percent);
for (ArticleCategory value : ArticleCategory.values()) {
if (article.getCategory().equalsIgnoreCase(value.loc)) {
if (!article.getCategory().equals(value.loc) && article.getCategory().equalsIgnoreCase(value.loc)) {
log.info("Fixing Article Category {} to {}", article.getCategory(), value.loc);
article.setCategory(value.loc);
articleService.update(article);

View File

@@ -140,5 +140,6 @@
"IN_PROGRESS": "In Versand",
"ISSUES": "Probleme",
"DELIVERED": "Zugesendet",
"CANCELLED": "Storniert"
"CANCELLED": "Storniert",
"fsImage": "FS-Bild"
}

View File

@@ -140,5 +140,6 @@
"IN_PROGRESS": "In Progress",
"ISSUES": "Issues",
"DELIVERED": "Delivered",
"CANCELLED": "Cancelled"
"CANCELLED": "Cancelled",
"fsImage": "FS-Image"
}

View File

@@ -1,7 +0,0 @@
import { Typography } from "@mui/material";
export default function FSModelInfo() {
return (
<Typography>Under Construction</Typography>
);
}

View File

@@ -19,6 +19,11 @@ export default function ItemsInfo() {
//TODO: implement
console.log("IconEdit", item);
}
function handleFarmStationEdit(item: Item) {
//TODO: implement
console.log("FsEdit", item);
}
const [rows, setRows] = useState<Item[]>([]);
const [selectedRows, setSelectedRows] = useState<Set<GridRowId>>(new Set());
@@ -131,6 +136,13 @@ export default function ItemsInfo() {
width: 90,
editable: false,
renderCell: params => <IconButton onClick={() => handleIconEdit(params.row)}> <EditIcon/> </IconButton>,
},
{
field: 'farmImage',
headerName: t('fsImage'),
width: 90,
editable: false,
renderCell: params => <IconButton onClick={() => handleFarmStationEdit(params.row)}> <EditIcon/> </IconButton>,
}
];
@@ -163,6 +175,18 @@ export default function ItemsInfo() {
>
{t('deleteProduct')}
</Button>
<Button
variant="contained"
color="primary"
startIcon={<DeleteIcon/>}
onClick={handleDeleteSelected}
disabled={selectedRows.size === 0}
sx={{
marginRight: 1
}}
>
{t('addProduct')}
</Button>
</Toolbar>
)}}
showToolbar

View File

@@ -16,7 +16,6 @@ import {
import { useState } from "react";
import { useTranslation } from "react-i18next";
import AccountsInfo from "../helper/adminpanel/AccountsInfo";
import FSModelInfo from "../helper/adminpanel/FSModelInfo";
import ItemInfo from "../helper/adminpanel/ItemsInfo";
import OrdersInfo from "../helper/adminpanel/OrdersInfo";
import StatisticsInfo from "../helper/adminpanel/StatisticsInfo";
@@ -40,8 +39,6 @@ export default function AdminPanel() {
return <AccountsInfo />;
case "items":
return <ItemInfo />;
case "fsmodel":
return <FSModelInfo />;
default:
return <StatisticsInfo />;
}
@@ -52,7 +49,6 @@ export default function AdminPanel() {
{ key: "orders", icon: <ReceiptLong />, label: t("orders") },
{ key: "accounts", icon: <AccountCircle />, label: t("accounts") },
{ key: "items", icon: <Category />, label: t("items") },
{ key: "fsmodel", icon: <Category />, label: t("fsmodel") },
];
return (