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:
@@ -48,6 +48,9 @@ function adminLetzshop() {
|
||||
pendingOrders: 0
|
||||
},
|
||||
|
||||
// Confirm modals
|
||||
showDeleteStoreConfigModal: false,
|
||||
|
||||
// Configuration modal
|
||||
showConfigModal: false,
|
||||
selectedStore: null,
|
||||
@@ -191,10 +194,6 @@ function adminLetzshop() {
|
||||
* Delete store configuration
|
||||
*/
|
||||
async deleteStoreConfig() {
|
||||
if (!confirm(I18n.t('marketplace.confirmations.remove_letzshop_config_store'))) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
await apiClient.delete(`/admin/letzshop/stores/${this.selectedStore.store_id}/credentials`);
|
||||
this.showConfigModal = false;
|
||||
|
||||
@@ -124,6 +124,15 @@ function adminMarketplaceLetzshop() {
|
||||
productStats: { total: 0, active: 0, inactive: 0, last_sync: null },
|
||||
showImportModal: false,
|
||||
|
||||
// Confirm modals
|
||||
showDeclineOrderModal: false,
|
||||
orderToDecline: null,
|
||||
showConfirmAllItemsModal: false,
|
||||
showDeclineAllItemsModal: false,
|
||||
showDeleteCredentialsModal: false,
|
||||
showIgnoreExceptionModal: false,
|
||||
exceptionToIgnore: null,
|
||||
|
||||
// Modals
|
||||
showTrackingModal: false,
|
||||
showOrderModal: false,
|
||||
@@ -1010,8 +1019,6 @@ function adminMarketplaceLetzshop() {
|
||||
async declineOrder(order) {
|
||||
if (!this.selectedStore) return;
|
||||
|
||||
if (!confirm(I18n.t('marketplace.confirmations.decline_order'))) return;
|
||||
|
||||
try {
|
||||
await apiClient.post(`/admin/letzshop/stores/${this.selectedStore.id}/orders/${order.id}/reject`);
|
||||
this.successMessage = 'Order declined';
|
||||
@@ -1128,8 +1135,6 @@ function adminMarketplaceLetzshop() {
|
||||
async confirmAllItems(order) {
|
||||
if (!this.selectedStore) return;
|
||||
|
||||
if (!confirm(I18n.t('marketplace.confirmations.confirm_all_items'))) return;
|
||||
|
||||
try {
|
||||
await apiClient.post(
|
||||
`/admin/letzshop/stores/${this.selectedStore.id}/orders/${order.id}/confirm`
|
||||
@@ -1149,8 +1154,6 @@ function adminMarketplaceLetzshop() {
|
||||
async declineAllItems(order) {
|
||||
if (!this.selectedStore) return;
|
||||
|
||||
if (!confirm(I18n.t('marketplace.confirmations.decline_all_items'))) return;
|
||||
|
||||
try {
|
||||
await apiClient.post(
|
||||
`/admin/letzshop/stores/${this.selectedStore.id}/orders/${order.id}/reject`
|
||||
@@ -1241,10 +1244,6 @@ function adminMarketplaceLetzshop() {
|
||||
async deleteCredentials() {
|
||||
if (!this.selectedStore) return;
|
||||
|
||||
if (!confirm(I18n.t('marketplace.confirmations.remove_letzshop_config'))) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
await apiClient.delete(`/admin/letzshop/stores/${this.selectedStore.id}/credentials`);
|
||||
this.successMessage = 'Credentials removed';
|
||||
@@ -1459,10 +1458,6 @@ function adminMarketplaceLetzshop() {
|
||||
* Ignore an exception
|
||||
*/
|
||||
async ignoreException(exception) {
|
||||
if (!confirm(I18n.t('marketplace.confirmations.ignore_exception'))) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
await apiClient.post(`/admin/order-exceptions/${exception.id}/ignore`, {
|
||||
notes: 'Ignored via admin interface'
|
||||
|
||||
Reference in New Issue
Block a user