Remove admin FS panel, merge with item panel
This commit is contained in:
@@ -97,7 +97,7 @@ public class FarmImageController {
|
|||||||
return ResponseEntity.ok().build();
|
return ResponseEntity.ok().build();
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(path = FARM_IMAGE_ARTICLES, method = RequestMethod.GET, produces = "application/json")
|
@RequestMapping(path = FARM_IMAGE_ARTICLES, method = RequestMethod.GET, produces = "application/json")
|
||||||
public ResponseEntity<List<ArticleWithFarmImageModel>> getFSArticles(HttpServletRequest request) {
|
public ResponseEntity<List<ArticleWithFarmImageModel>> getFSArticles(HttpServletRequest request) {
|
||||||
logRequest(request);
|
logRequest(request);
|
||||||
return ResponseEntity.ok(farmImageService.getArticles());
|
return ResponseEntity.ok(farmImageService.getArticles());
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ public class StatisticsServiceImpl implements StatisticsService {
|
|||||||
int percent = (int) Math.floor(((1.0d * article.getStock() / article.getStockExpected()) * 100) / 10) * 10;
|
int percent = (int) Math.floor(((1.0d * article.getStock() / article.getStockExpected()) * 100) / 10) * 10;
|
||||||
log.info("Stock percent: {} {}", article.getUuid(), percent);
|
log.info("Stock percent: {} {}", article.getUuid(), percent);
|
||||||
for (ArticleCategory value : ArticleCategory.values()) {
|
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);
|
log.info("Fixing Article Category {} to {}", article.getCategory(), value.loc);
|
||||||
article.setCategory(value.loc);
|
article.setCategory(value.loc);
|
||||||
articleService.update(article);
|
articleService.update(article);
|
||||||
|
|||||||
@@ -140,5 +140,6 @@
|
|||||||
"IN_PROGRESS": "In Versand",
|
"IN_PROGRESS": "In Versand",
|
||||||
"ISSUES": "Probleme",
|
"ISSUES": "Probleme",
|
||||||
"DELIVERED": "Zugesendet",
|
"DELIVERED": "Zugesendet",
|
||||||
"CANCELLED": "Storniert"
|
"CANCELLED": "Storniert",
|
||||||
|
"fsImage": "FS-Bild"
|
||||||
}
|
}
|
||||||
@@ -140,5 +140,6 @@
|
|||||||
"IN_PROGRESS": "In Progress",
|
"IN_PROGRESS": "In Progress",
|
||||||
"ISSUES": "Issues",
|
"ISSUES": "Issues",
|
||||||
"DELIVERED": "Delivered",
|
"DELIVERED": "Delivered",
|
||||||
"CANCELLED": "Cancelled"
|
"CANCELLED": "Cancelled",
|
||||||
|
"fsImage": "FS-Image"
|
||||||
}
|
}
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
import { Typography } from "@mui/material";
|
|
||||||
|
|
||||||
export default function FSModelInfo() {
|
|
||||||
return (
|
|
||||||
<Typography>Under Construction</Typography>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -19,6 +19,11 @@ export default function ItemsInfo() {
|
|||||||
//TODO: implement
|
//TODO: implement
|
||||||
console.log("IconEdit", item);
|
console.log("IconEdit", item);
|
||||||
}
|
}
|
||||||
|
function handleFarmStationEdit(item: Item) {
|
||||||
|
//TODO: implement
|
||||||
|
console.log("FsEdit", item);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
const [rows, setRows] = useState<Item[]>([]);
|
const [rows, setRows] = useState<Item[]>([]);
|
||||||
const [selectedRows, setSelectedRows] = useState<Set<GridRowId>>(new Set());
|
const [selectedRows, setSelectedRows] = useState<Set<GridRowId>>(new Set());
|
||||||
@@ -131,6 +136,13 @@ export default function ItemsInfo() {
|
|||||||
width: 90,
|
width: 90,
|
||||||
editable: false,
|
editable: false,
|
||||||
renderCell: params => <IconButton onClick={() => handleIconEdit(params.row)}> <EditIcon/> </IconButton>,
|
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')}
|
{t('deleteProduct')}
|
||||||
</Button>
|
</Button>
|
||||||
|
<Button
|
||||||
|
variant="contained"
|
||||||
|
color="primary"
|
||||||
|
startIcon={<DeleteIcon/>}
|
||||||
|
onClick={handleDeleteSelected}
|
||||||
|
disabled={selectedRows.size === 0}
|
||||||
|
sx={{
|
||||||
|
marginRight: 1
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{t('addProduct')}
|
||||||
|
</Button>
|
||||||
</Toolbar>
|
</Toolbar>
|
||||||
)}}
|
)}}
|
||||||
showToolbar
|
showToolbar
|
||||||
|
|||||||
@@ -16,7 +16,6 @@ import {
|
|||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import AccountsInfo from "../helper/adminpanel/AccountsInfo";
|
import AccountsInfo from "../helper/adminpanel/AccountsInfo";
|
||||||
import FSModelInfo from "../helper/adminpanel/FSModelInfo";
|
|
||||||
import ItemInfo from "../helper/adminpanel/ItemsInfo";
|
import ItemInfo from "../helper/adminpanel/ItemsInfo";
|
||||||
import OrdersInfo from "../helper/adminpanel/OrdersInfo";
|
import OrdersInfo from "../helper/adminpanel/OrdersInfo";
|
||||||
import StatisticsInfo from "../helper/adminpanel/StatisticsInfo";
|
import StatisticsInfo from "../helper/adminpanel/StatisticsInfo";
|
||||||
@@ -40,8 +39,6 @@ export default function AdminPanel() {
|
|||||||
return <AccountsInfo />;
|
return <AccountsInfo />;
|
||||||
case "items":
|
case "items":
|
||||||
return <ItemInfo />;
|
return <ItemInfo />;
|
||||||
case "fsmodel":
|
|
||||||
return <FSModelInfo />;
|
|
||||||
default:
|
default:
|
||||||
return <StatisticsInfo />;
|
return <StatisticsInfo />;
|
||||||
}
|
}
|
||||||
@@ -52,7 +49,6 @@ export default function AdminPanel() {
|
|||||||
{ key: "orders", icon: <ReceiptLong />, label: t("orders") },
|
{ key: "orders", icon: <ReceiptLong />, label: t("orders") },
|
||||||
{ key: "accounts", icon: <AccountCircle />, label: t("accounts") },
|
{ key: "accounts", icon: <AccountCircle />, label: t("accounts") },
|
||||||
{ key: "items", icon: <Category />, label: t("items") },
|
{ key: "items", icon: <Category />, label: t("items") },
|
||||||
{ key: "fsmodel", icon: <Category />, label: t("fsmodel") },
|
|
||||||
];
|
];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
Reference in New Issue
Block a user