fix: replace all native confirm() dialogs with styled modal macros
Some checks failed
Some checks failed
Migrated ~68 native browser confirm() calls across 74 files to use the project's confirm_modal/confirm_modal_dynamic Jinja2 macros, providing consistent styled confirmation dialogs instead of plain browser popups. Modules updated: core, tenancy, cms, marketplace, messaging, billing, customers, orders, cart. Uses danger/warning/info variants and double-confirm pattern for destructive delete operations. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -17,6 +17,8 @@ function adminStoreDetail() {
|
||||
loading: false,
|
||||
error: null,
|
||||
storeCode: null,
|
||||
showDeleteStoreModal: false,
|
||||
showDeleteStoreFinalModal: false,
|
||||
|
||||
// Initialize
|
||||
async init() {
|
||||
@@ -143,21 +145,20 @@ function adminStoreDetail() {
|
||||
return 'bg-green-500';
|
||||
},
|
||||
|
||||
// Prompt delete store (first step of double confirm)
|
||||
promptDeleteStore() {
|
||||
detailLog.info('Delete store requested:', this.storeCode);
|
||||
this.showDeleteStoreModal = true;
|
||||
},
|
||||
|
||||
// Confirm first step, show final confirmation
|
||||
confirmDeleteStoreStep() {
|
||||
detailLog.info('First delete confirmation accepted, showing final confirmation');
|
||||
this.showDeleteStoreFinalModal = true;
|
||||
},
|
||||
|
||||
// Delete store
|
||||
async deleteStore() {
|
||||
detailLog.info('Delete store requested:', this.storeCode);
|
||||
|
||||
if (!confirm(`Are you sure you want to delete store "${this.store.name}"?\n\nThis action cannot be undone and will delete:\n- All products\n- All orders\n- All customers\n- All team members`)) {
|
||||
detailLog.info('Delete cancelled by user');
|
||||
return;
|
||||
}
|
||||
|
||||
// Second confirmation for safety
|
||||
if (!confirm(`FINAL CONFIRMATION\n\nType the store code to confirm: ${this.store.store_code}\n\nAre you absolutely sure?`)) {
|
||||
detailLog.info('Delete cancelled by user (second confirmation)');
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
const url = `/admin/stores/${this.storeCode}?confirm=true`;
|
||||
window.LogConfig.logApiCall('DELETE', url, null, 'request');
|
||||
@@ -189,4 +190,4 @@ function adminStoreDetail() {
|
||||
};
|
||||
}
|
||||
|
||||
detailLog.info('Store detail module loaded');
|
||||
detailLog.info('Store detail module loaded');
|
||||
|
||||
Reference in New Issue
Block a user