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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user