= {
+ high: 'catalog.stockHigh',
+ medium: 'catalog.stockMedium',
+ low: 'catalog.stockLow',
+ out: 'catalog.stockOut'
+};
+
@Component({
selector: 'app-compare-table',
standalone: true,
@@ -34,7 +41,7 @@ export class CompareTableComponent {
const baseRows: CompareRow[] = [
this.toRow('price', this.i18n.t('ux.comparePrice'), products.map(product => `${product.price.toFixed(2)} ${product.currency}`)),
this.toRow('rating', this.i18n.t('ux.compareRating'), products.map(product => `${(product.rating ?? 0).toFixed(1)}`)),
- this.toRow('stock', this.i18n.t('ux.compareStock'), products.map(product => product.remainings ?? this.i18n.t('ux.compareUnknown'))),
+ this.toRow('stock', this.i18n.t('ux.compareStock'), products.map(product => this.stockLabel(product.remainings))),
this.toRow('discount', this.i18n.t('ux.compareDiscount'), products.map(product => `${product.discount ?? 0}%`)),
this.toRow('color', this.i18n.t('ux.compareColor'), products.map(product => product.colour ?? '—')),
this.toRow('size', this.i18n.t('ux.compareSize'), products.map(product => product.size ?? '—'))
@@ -58,6 +65,14 @@ export class CompareTableComponent {
return this.highlightDifferences && !row.identical;
}
+ private stockLabel(remainings: string | undefined): string {
+ if (!remainings) {
+ return this.i18n.t('ux.compareUnknown');
+ }
+ const key = STOCK_LABEL_KEYS[remainings.toLowerCase()];
+ return key ? this.i18n.t(key) : remainings;
+ }
+
private toRow(key: string, label: string, values: string[]): CompareRow {
const normalized = values.map(value => value.trim().toLowerCase());
const identical = normalized.every(value => value === normalized[0]);
diff --git a/src/app/pages/cart/cart.component.html b/src/app/pages/cart/cart.component.html
index 44e1c43..9061471 100644
--- a/src/app/pages/cart/cart.component.html
+++ b/src/app/pages/cart/cart.component.html
@@ -40,7 +40,9 @@
- {{ itemDesc(item) || '' }}...
+ @if (itemDesc(item)) {
+ {{ itemDesc(item) }}...
+ }
@if (item.colour || (item.size && item.size.toLowerCase() !== 'default')) {
diff --git a/src/assets/mock/bootstrap/bootstrap.json b/src/assets/mock/bootstrap/bootstrap.json
index 1d3a493..31e9ef3 100644
--- a/src/assets/mock/bootstrap/bootstrap.json
+++ b/src/assets/mock/bootstrap/bootstrap.json
@@ -201,7 +201,7 @@
{
"id": "footer-about",
"labelKey": "nav.about",
- "route": "/about",
+ "route": "/about-us",
"order": 1
},
{