diff --git a/00-backend/src/main/java/de/htwsaar/webshop/controller/FarmImageController.java b/00-backend/src/main/java/de/htwsaar/webshop/controller/FarmImageController.java index 05bfbdd..eeedc90 100644 --- a/00-backend/src/main/java/de/htwsaar/webshop/controller/FarmImageController.java +++ b/00-backend/src/main/java/de/htwsaar/webshop/controller/FarmImageController.java @@ -97,7 +97,7 @@ public class FarmImageController { 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> getFSArticles(HttpServletRequest request) { logRequest(request); return ResponseEntity.ok(farmImageService.getArticles()); diff --git a/00-backend/src/main/java/de/htwsaar/webshop/service/impl/StatisticsServiceImpl.java b/00-backend/src/main/java/de/htwsaar/webshop/service/impl/StatisticsServiceImpl.java index 391eddb..02e352d 100644 --- a/00-backend/src/main/java/de/htwsaar/webshop/service/impl/StatisticsServiceImpl.java +++ b/00-backend/src/main/java/de/htwsaar/webshop/service/impl/StatisticsServiceImpl.java @@ -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); diff --git a/01-frontend/public/locales/de/translation.json b/01-frontend/public/locales/de/translation.json index 1a1b564..ac36804 100644 --- a/01-frontend/public/locales/de/translation.json +++ b/01-frontend/public/locales/de/translation.json @@ -140,5 +140,6 @@ "IN_PROGRESS": "In Versand", "ISSUES": "Probleme", "DELIVERED": "Zugesendet", - "CANCELLED": "Storniert" + "CANCELLED": "Storniert", + "fsImage": "FS-Bild" } \ No newline at end of file diff --git a/01-frontend/public/locales/en/translation.json b/01-frontend/public/locales/en/translation.json index 65a0cbd..239e140 100644 --- a/01-frontend/public/locales/en/translation.json +++ b/01-frontend/public/locales/en/translation.json @@ -140,5 +140,6 @@ "IN_PROGRESS": "In Progress", "ISSUES": "Issues", "DELIVERED": "Delivered", - "CANCELLED": "Cancelled" + "CANCELLED": "Cancelled", + "fsImage": "FS-Image" } \ No newline at end of file diff --git a/01-frontend/src/helper/adminpanel/FSModelInfo.tsx b/01-frontend/src/helper/adminpanel/FSModelInfo.tsx deleted file mode 100644 index b5ecf31..0000000 --- a/01-frontend/src/helper/adminpanel/FSModelInfo.tsx +++ /dev/null @@ -1,7 +0,0 @@ -import { Typography } from "@mui/material"; - -export default function FSModelInfo() { - return ( - Under Construction - ); -} \ No newline at end of file diff --git a/01-frontend/src/helper/adminpanel/ItemsInfo.tsx b/01-frontend/src/helper/adminpanel/ItemsInfo.tsx index 385c03a..878a4b2 100644 --- a/01-frontend/src/helper/adminpanel/ItemsInfo.tsx +++ b/01-frontend/src/helper/adminpanel/ItemsInfo.tsx @@ -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([]); const [selectedRows, setSelectedRows] = useState>(new Set()); @@ -131,6 +136,13 @@ export default function ItemsInfo() { width: 90, editable: false, renderCell: params => handleIconEdit(params.row)}> , + }, + { + field: 'farmImage', + headerName: t('fsImage'), + width: 90, + editable: false, + renderCell: params => handleFarmStationEdit(params.row)}> , } ]; @@ -163,6 +175,18 @@ export default function ItemsInfo() { > {t('deleteProduct')} + )}} showToolbar diff --git a/01-frontend/src/pages/AdminPanel.tsx b/01-frontend/src/pages/AdminPanel.tsx index c4afea2..8c9483f 100644 --- a/01-frontend/src/pages/AdminPanel.tsx +++ b/01-frontend/src/pages/AdminPanel.tsx @@ -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 ; case "items": return ; - case "fsmodel": - return ; default: return ; } @@ -52,7 +49,6 @@ export default function AdminPanel() { { key: "orders", icon: , label: t("orders") }, { key: "accounts", icon: , label: t("accounts") }, { key: "items", icon: , label: t("items") }, - { key: "fsmodel", icon: , label: t("fsmodel") }, ]; return (