fix(admin): polish products
Add accessible names to the table-view select-all and per-row checkboxes — they had none, while the grid-view equivalent already did (product name via aria-label). New adminProducts.selectAllRows/ selectRow keys added across en/ru/hy. Reviewed toolbar, filters, bulk actions, empty/loading states, and grid view: all buttons already route through app-button (own :focus-visible), empty state already uses shared EmptyStateComponent. No orphaned bindings or corrupted glyphs found. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -88,7 +88,7 @@
|
|||||||
<app-table [class.density-compact]="density === 'compact'">
|
<app-table [class.density-compact]="density === 'compact'">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th><input type="checkbox" (change)="selectAll.emit($any($event.target).checked)" /></th>
|
<th><input type="checkbox" [attr.aria-label]="'adminProducts.selectAllRows' | translate" (change)="selectAll.emit($any($event.target).checked)" /></th>
|
||||||
<th>{{ 'adminProducts.name' | translate }}</th>
|
<th>{{ 'adminProducts.name' | translate }}</th>
|
||||||
@if (isColumnVisible('sku')) { <th>{{ 'backoffice.sku' | translate }}</th> }
|
@if (isColumnVisible('sku')) { <th>{{ 'backoffice.sku' | translate }}</th> }
|
||||||
@if (isColumnVisible('brand')) { <th>{{ 'adminProducts.brand' | translate }}</th> }
|
@if (isColumnVisible('brand')) { <th>{{ 'adminProducts.brand' | translate }}</th> }
|
||||||
@@ -102,7 +102,7 @@
|
|||||||
<tbody>
|
<tbody>
|
||||||
@for (product of products; track product.id) {
|
@for (product of products; track product.id) {
|
||||||
<tr>
|
<tr>
|
||||||
<td><input type="checkbox" [checked]="isSelected(product.id)" (change)="selectionChange.emit({ id: product.id, checked: $any($event.target).checked })" /></td>
|
<td><input type="checkbox" [checked]="isSelected(product.id)" [attr.aria-label]="('adminProducts.selectRow' | translate) + ': ' + product.name" (change)="selectionChange.emit({ id: product.id, checked: $any($event.target).checked })" /></td>
|
||||||
<td>{{ product.name }}</td>
|
<td>{{ product.name }}</td>
|
||||||
@if (isColumnVisible('sku')) { <td>{{ product.sku }}</td> }
|
@if (isColumnVisible('sku')) { <td>{{ product.sku }}</td> }
|
||||||
@if (isColumnVisible('brand')) { <td>{{ product.brand }}</td> }
|
@if (isColumnVisible('brand')) { <td>{{ product.brand }}</td> }
|
||||||
|
|||||||
@@ -1531,6 +1531,8 @@ export const en: Translations = {
|
|||||||
emptyTitle: 'No products found',
|
emptyTitle: 'No products found',
|
||||||
emptyDescription: 'Try adjusting your filters, or create a new product.',
|
emptyDescription: 'Try adjusting your filters, or create a new product.',
|
||||||
emptyGuide: 'Good products have a clear title, at least one photo, a price, and a short description — that\'s enough to publish. You can always add more detail later.',
|
emptyGuide: 'Good products have a clear title, at least one photo, a price, and a short description — that\'s enough to publish. You can always add more detail later.',
|
||||||
|
selectAllRows: 'Select all products',
|
||||||
|
selectRow: 'Select product',
|
||||||
search: 'Search products…',
|
search: 'Search products…',
|
||||||
category: 'Category',
|
category: 'Category',
|
||||||
allCategories: 'All categories',
|
allCategories: 'All categories',
|
||||||
|
|||||||
@@ -1526,6 +1526,8 @@ export const hy: Translations = {
|
|||||||
emptyTitle: 'Ապրանքներ չեն գտնվել',
|
emptyTitle: 'Ապրանքներ չեն գտնվել',
|
||||||
emptyDescription: 'Փոխեք ֆիլտրերը կամ ստեղծեք նոր ապրանք։',
|
emptyDescription: 'Փոխեք ֆիլտրերը կամ ստեղծեք նոր ապրանք։',
|
||||||
emptyGuide: 'Լավ ապրանքին բավական է հստակ վերնագիր, առնվազն մեկ լուսանկար, գին և կարճ նկարագրություն՝ հրապարակելու համար։ Մնացածը կարող եք ավելացնել հետո։',
|
emptyGuide: 'Լավ ապրանքին բավական է հստակ վերնագիր, առնվազն մեկ լուսանկար, գին և կարճ նկարագրություն՝ հրապարակելու համար։ Մնացածը կարող եք ավելացնել հետո։',
|
||||||
|
selectAllRows: 'Ընտրել բոլոր ապրանքները',
|
||||||
|
selectRow: 'Ընտրել ապրանքը',
|
||||||
search: 'Փնտրել ապրանքներ…',
|
search: 'Փնտրել ապրանքներ…',
|
||||||
category: 'Կատեգորիա',
|
category: 'Կատեգորիա',
|
||||||
allCategories: 'Բոլոր կատեգորիաները',
|
allCategories: 'Բոլոր կատեգորիաները',
|
||||||
|
|||||||
@@ -1526,6 +1526,8 @@ export const ru: Translations = {
|
|||||||
emptyTitle: 'Товары не найдены',
|
emptyTitle: 'Товары не найдены',
|
||||||
emptyDescription: 'Измените фильтры или создайте новый товар.',
|
emptyDescription: 'Измените фильтры или создайте новый товар.',
|
||||||
emptyGuide: 'Хорошему товару нужны понятное название, минимум одно фото, цена и короткое описание — этого достаточно для публикации. Остальное можно добавить позже.',
|
emptyGuide: 'Хорошему товару нужны понятное название, минимум одно фото, цена и короткое описание — этого достаточно для публикации. Остальное можно добавить позже.',
|
||||||
|
selectAllRows: 'Выбрать все товары',
|
||||||
|
selectRow: 'Выбрать товар',
|
||||||
search: 'Поиск товаров…',
|
search: 'Поиск товаров…',
|
||||||
category: 'Категория',
|
category: 'Категория',
|
||||||
allCategories: 'Все категории',
|
allCategories: 'Все категории',
|
||||||
|
|||||||
@@ -1539,6 +1539,8 @@ export interface Translations {
|
|||||||
emptyTitle: string;
|
emptyTitle: string;
|
||||||
emptyDescription: string;
|
emptyDescription: string;
|
||||||
emptyGuide: string;
|
emptyGuide: string;
|
||||||
|
selectAllRows: string;
|
||||||
|
selectRow: string;
|
||||||
search: string;
|
search: string;
|
||||||
category: string;
|
category: string;
|
||||||
allCategories: string;
|
allCategories: string;
|
||||||
|
|||||||
Reference in New Issue
Block a user