Refactor: Improve Startup Script, i18n-EN and ItemCard

This commit is contained in:
imagede
2026-03-09 18:40:16 +01:00
parent 5c10e012cd
commit f049f51de2
5 changed files with 11 additions and 24 deletions

View File

@@ -1,17 +0,0 @@
package de.htwsaar.webshop.util;
public class DanielDimensionException extends RuntimeException {
public DanielDimensionException(String message) {
super(message);
}
public DanielDimensionException(String message, Throwable cause) {
super(message, cause);
}
public DanielDimensionException(Throwable cause) {
super(cause);
}
}

View File

@@ -102,7 +102,7 @@
"surname": "Surname",
"language": "Language",
"password": "Password",
"actualPrice": "Price in €",
"actualPrice": "Price after Discount",
"stock": "Stock",
"price100": "Price in ct",
"price100€": "Price in €",
@@ -154,4 +154,4 @@
"createNewItem": "Create New Item",
"stockExpected": "Expected Stock",
"addProduct": "Add Product"
}
}

View File

@@ -54,6 +54,11 @@ export default function ItemCard({item}: { item: ItemWithImage }) {
<Typography variant="body2" sx={{color: 'text.secondary'}} className="item-description">
{(item.price100 / 100 * (1 - item.discount100 / 100)).toFixed(2)}
</Typography>
{item.discount100 == 0 ? <></> :
<Typography variant="body2" sx={{color: 'red'}} className="item-description">
{(- item.discount100)}%
</Typography>
}
<IconButton
aria-label={t('addToCart')}
onClick={(event) => {
@@ -83,4 +88,4 @@ export default function ItemCard({item}: { item: ItemWithImage }) {
</Card>
</Paper>
)
}
}

View File

@@ -1,7 +1,6 @@
#!/bin/sh
# Function to clean up background processes on script exit
cleanup() {
echo "[DPS] Cleaning up..."
pkill $backend_pid # pkill because subshells
@@ -10,8 +9,8 @@ cleanup() {
exit
}
# Trap SIGINT (Ctrl+C)
trap cleanup SIGINT
# Trap INT (Ctrl+C)
trap cleanup INT
echo "[DPS] trapped"
cd ./00-backend
@@ -25,5 +24,5 @@ frontend_pid=$!
echo "[DPS] Frontend started with PID $frontend_pid"
echo "[DPS] Ctrl+C to stop"
# Wait indefinitely; cleanup will handle interruption
# Wait for cleanup
wait