fix(storefront): release-candidate walkthrough fixes
- Cart item description showed a stray literal "..." when the item had no
description text (cart.component.html) — now only renders the trailing
ellipsis when a description is present.
- Compare table showed raw internal stock enum values ("high"/"low"/etc.)
instead of localized labels (compare-table.component.ts) — now reuses the
same stock-label mapping used by product cards.
- Search with zero results incorrectly showed the empty-category messaging
("browse categories" / "go to parent category") stacked on top of the
search's own "nothing found" message (catalog-container.component.ts) —
isEmptyCategoryState now excludes active search queries so only the
search-appropriate empty state renders.
- Footer "About" link pointed to /about, which 404s; the actual CMS page
route is /about-us (bootstrap.json mock nav data) — corrected the route.
- Added missing public/assets/images/placeholder.svg, the fallback image
referenced by getMainImage() for items without photos (previously 404s
if that fallback path is ever hit).
Investigated and left as-is (not code bugs): /images/*.webp 404s on
product cards are references to a real backend/CDN not present in local
dev (confirmed via mock-data.interceptor.ts and api.service.ts image-URL
resolution) — expected dev-only gap. Footer "Contacts" link (/contacts)
has no corresponding static page content at all in mock data; flagging
for a content decision rather than fabricating copy.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -10,6 +10,13 @@ interface CompareRow {
|
||||
identical: boolean;
|
||||
}
|
||||
|
||||
const STOCK_LABEL_KEYS: Record<string, string> = {
|
||||
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]);
|
||||
|
||||
Reference in New Issue
Block a user