Refactor: Improve Startup Script, i18n-EN and ItemCard
This commit is contained in:
Binary file not shown.
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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 €",
|
||||
|
||||
@@ -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) => {
|
||||
|
||||
7
start.sh
7
start.sh
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user