fix: order bulk-delete had zero confirmation
Bulk-delete button called facade.applyBulkDelete() with no gate. Added app-confirm-dialog, same pattern as products/categories. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -45,9 +45,16 @@
|
||||
<app-button variant="secondary" size="sm" (click)="facade.applyBulkArchive(true)">{{ 'adminOrders.archiveSelected' | translate }}</app-button>
|
||||
<app-button variant="secondary" size="sm" (click)="facade.exportSelectedAsCsv()">{{ 'adminProducts.bulkExportAction' | translate }}</app-button>
|
||||
<app-button variant="secondary" size="sm" (click)="printSelection()">{{ 'adminOrders.printSelected' | translate }}</app-button>
|
||||
<app-button variant="danger" size="sm" (click)="facade.applyBulkDelete()">{{ 'adminProducts.bulkDelete' | translate }}</app-button>
|
||||
<app-button variant="danger" size="sm" (click)="bulkDelete()">{{ 'adminProducts.bulkDelete' | translate }}</app-button>
|
||||
</div>
|
||||
}
|
||||
<app-confirm-dialog
|
||||
[open]="bulkDeleteConfirmOpen()"
|
||||
[titleText]="'adminOrders.bulkDeleteTitle' | translate"
|
||||
[message]="'adminOrders.confirmBulkDelete' | translate"
|
||||
[destructive]="true"
|
||||
(confirmed)="confirmBulkDelete()"
|
||||
(cancelled)="bulkDeleteConfirmOpen.set(false)" />
|
||||
|
||||
@if (facade.loading()) {
|
||||
<div class="skeleton-rows" role="status" aria-live="polite" aria-busy="true">
|
||||
|
||||
@@ -15,11 +15,12 @@ import { EmptyStateComponent } from '../../../../shared/ui/empty-state/empty-sta
|
||||
import { SkeletonComponent } from '../../../../shared/ui/skeleton/skeleton.component';
|
||||
import { CardComponent } from '../../../../shared/ui/card/card.component';
|
||||
import { OrdersDashboardComponent } from '../components/orders-dashboard/orders-dashboard.component';
|
||||
import { ConfirmDialogComponent } from '../../../../shared/ui/confirm-dialog/confirm-dialog.component';
|
||||
|
||||
@Component({
|
||||
selector: 'app-admin-orders-list-page',
|
||||
standalone: true,
|
||||
imports: [CommonModule, FormsModule, TranslatePipe, ButtonComponent, InputComponent, BadgeComponent, TableComponent, PaginationComponent, EmptyStateComponent, SkeletonComponent, CardComponent, OrdersDashboardComponent],
|
||||
imports: [CommonModule, FormsModule, TranslatePipe, ButtonComponent, InputComponent, BadgeComponent, TableComponent, PaginationComponent, EmptyStateComponent, SkeletonComponent, CardComponent, OrdersDashboardComponent, ConfirmDialogComponent],
|
||||
templateUrl: './admin-orders-list-page.component.html',
|
||||
styleUrls: ['./admin-orders-list-page.component.scss'],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush
|
||||
@@ -35,6 +36,7 @@ export class AdminOrdersListPageComponent {
|
||||
readonly allColumns = ALL_ORDER_COLUMNS;
|
||||
protected readonly columnsPanelOpen = signal(false);
|
||||
protected readonly bulkStatusValue = signal<AdminOrderStatus>('pending');
|
||||
protected readonly bulkDeleteConfirmOpen = signal(false);
|
||||
|
||||
constructor() {
|
||||
this.facade.loadList();
|
||||
@@ -61,6 +63,15 @@ export class AdminOrdersListPageComponent {
|
||||
this.facade.applyBulkStatus(this.bulkStatusValue());
|
||||
}
|
||||
|
||||
bulkDelete(): void {
|
||||
this.bulkDeleteConfirmOpen.set(true);
|
||||
}
|
||||
|
||||
confirmBulkDelete(): void {
|
||||
this.facade.applyBulkDelete();
|
||||
this.bulkDeleteConfirmOpen.set(false);
|
||||
}
|
||||
|
||||
printSelection(): void {
|
||||
window.print();
|
||||
}
|
||||
|
||||
@@ -1360,6 +1360,8 @@ export const en: Translations = {
|
||||
},
|
||||
},
|
||||
adminOrders: {
|
||||
bulkDeleteTitle: 'Delete orders',
|
||||
confirmBulkDelete: 'Delete the selected orders? This cannot be undone.',
|
||||
back: 'Back to orders',
|
||||
search: 'Search by order number, name, email, or phone…',
|
||||
export: 'Export',
|
||||
|
||||
@@ -1355,6 +1355,8 @@ export const hy: Translations = {
|
||||
},
|
||||
},
|
||||
adminOrders: {
|
||||
bulkDeleteTitle: 'Ջնջել պատվերները',
|
||||
confirmBulkDelete: 'Ջնջե՞լ ընտրված պատվերները։ Հնարավոր չէ հետարկել։',
|
||||
back: 'Վերադառնալ պատվերներին',
|
||||
search: 'Փնտրել ըստ պատվերի համարի, անվան, էլ. փոստի կամ հեռախոսի…',
|
||||
export: 'Արտահանել',
|
||||
|
||||
@@ -1355,6 +1355,8 @@ export const ru: Translations = {
|
||||
},
|
||||
},
|
||||
adminOrders: {
|
||||
bulkDeleteTitle: 'Удалить заказы',
|
||||
confirmBulkDelete: 'Удалить выбранные заказы? Это действие нельзя отменить.',
|
||||
back: 'Назад к заказам',
|
||||
search: 'Поиск по номеру заказа, имени, email или телефону…',
|
||||
export: 'Экспорт',
|
||||
|
||||
@@ -1359,6 +1359,8 @@ export interface Translations {
|
||||
};
|
||||
};
|
||||
adminOrders: {
|
||||
bulkDeleteTitle: string;
|
||||
confirmBulkDelete: string;
|
||||
back: string;
|
||||
search: string;
|
||||
export: string;
|
||||
|
||||
Reference in New Issue
Block a user