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:
@@ -18,6 +18,12 @@ function adminMerchantEdit() {
|
||||
saving: false,
|
||||
merchantId: null,
|
||||
|
||||
// Modal state
|
||||
showToggleVerificationModal: false,
|
||||
showToggleActiveModal: false,
|
||||
showDeleteMerchantModal: false,
|
||||
showDeleteMerchantFinalModal: false,
|
||||
|
||||
// Transfer ownership state
|
||||
showTransferOwnershipModal: false,
|
||||
transferring: false,
|
||||
@@ -166,11 +172,6 @@ function adminMerchantEdit() {
|
||||
const action = this.merchant.is_verified ? 'unverify' : 'verify';
|
||||
merchantEditLog.info(`Toggle verification: ${action}`);
|
||||
|
||||
if (!confirm(`Are you sure you want to ${action} this merchant?`)) {
|
||||
merchantEditLog.info('Verification toggle cancelled by user');
|
||||
return;
|
||||
}
|
||||
|
||||
this.saving = true;
|
||||
try {
|
||||
const url = `/admin/merchants/${this.merchantId}/verification`;
|
||||
@@ -199,11 +200,6 @@ function adminMerchantEdit() {
|
||||
const action = this.merchant.is_active ? 'deactivate' : 'activate';
|
||||
merchantEditLog.info(`Toggle active status: ${action}`);
|
||||
|
||||
if (!confirm(`Are you sure you want to ${action} this merchant?\n\nThis will affect all stores under this merchant.`)) {
|
||||
merchantEditLog.info('Active status toggle cancelled by user');
|
||||
return;
|
||||
}
|
||||
|
||||
this.saving = true;
|
||||
try {
|
||||
const url = `/admin/merchants/${this.merchantId}/status`;
|
||||
@@ -343,8 +339,8 @@ function adminMerchantEdit() {
|
||||
this.userSearchResults = [];
|
||||
},
|
||||
|
||||
// Delete merchant
|
||||
async deleteMerchant() {
|
||||
// Prompt delete merchant (first step of double confirm)
|
||||
promptDeleteMerchant() {
|
||||
merchantEditLog.info('=== DELETING MERCHANT ===');
|
||||
|
||||
if (this.merchant.store_count > 0) {
|
||||
@@ -352,16 +348,17 @@ function adminMerchantEdit() {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!confirm(`Are you sure you want to delete merchant "${this.merchant.name}"?\n\nThis action cannot be undone.`)) {
|
||||
merchantEditLog.info('Merchant deletion cancelled by user');
|
||||
return;
|
||||
}
|
||||
this.showDeleteMerchantModal = true;
|
||||
},
|
||||
|
||||
// Double confirmation for critical action
|
||||
if (!confirm(`FINAL CONFIRMATION: Delete "${this.merchant.name}"?\n\nThis will permanently delete the merchant and all its data.`)) {
|
||||
merchantEditLog.info('Merchant deletion cancelled at final confirmation');
|
||||
return;
|
||||
}
|
||||
// Confirm first step, show final confirmation
|
||||
confirmDeleteMerchantStep() {
|
||||
this.showDeleteMerchantFinalModal = true;
|
||||
},
|
||||
|
||||
// Delete merchant
|
||||
async deleteMerchant() {
|
||||
merchantEditLog.info('=== DELETING MERCHANT (confirmed) ===');
|
||||
|
||||
this.saving = true;
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user