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'
|
||||
|
||||
@@ -66,6 +66,13 @@ function storeLetzshop() {
|
||||
shipped: 0
|
||||
},
|
||||
|
||||
// Confirm modals
|
||||
showDeleteCredentialsModal: false,
|
||||
showConfirmOrderModal: false,
|
||||
orderToConfirm: null,
|
||||
showRejectOrderModal: false,
|
||||
orderToReject: null,
|
||||
|
||||
// Modals
|
||||
showTrackingModal: false,
|
||||
showOrderModal: false,
|
||||
@@ -291,10 +298,6 @@ function storeLetzshop() {
|
||||
* Delete credentials
|
||||
*/
|
||||
async deleteCredentials() {
|
||||
if (!confirm(I18n.t('marketplace.confirmations.remove_letzshop_credentials'))) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
await apiClient.delete('/store/letzshop/credentials');
|
||||
this.credentials = null;
|
||||
@@ -316,10 +319,6 @@ function storeLetzshop() {
|
||||
* Confirm order
|
||||
*/
|
||||
async confirmOrder(order) {
|
||||
if (!confirm(I18n.t('marketplace.confirmations.confirm_order'))) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
const response = await apiClient.post(`/store/letzshop/orders/${order.id}/confirm`);
|
||||
|
||||
@@ -340,10 +339,6 @@ function storeLetzshop() {
|
||||
* Reject order
|
||||
*/
|
||||
async rejectOrder(order) {
|
||||
if (!confirm(I18n.t('marketplace.confirmations.reject_order'))) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
const response = await apiClient.post(`/store/letzshop/orders/${order.id}/reject`);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user