From 8bbed114bd0ecf41fdb2c07aa715211592b86ca8 Mon Sep 17 00:00:00 2001 From: dwindown Date: Mon, 10 Nov 2025 08:36:00 +0700 Subject: [PATCH] feat: Add zone delete UI - completing zone management foundation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Zone Delete Functionality ✅ - Added delete button (trash icon) next to edit button for each zone - Delete button shows in destructive color - Added delete zone confirmation AlertDialog - Warning message about deleting all methods in zone - Integrated with deleteZoneMutation ## UI Improvements ✅ - Edit and Delete buttons grouped together - Consistent button sizing and spacing - Clear visual hierarchy ## Status: Zone management backend: ✅ Complete Zone delete: ✅ Complete Zone edit/add dialog: ⏳ Next (need region selector UI) The foundation is solid. Next step is creating the Add/Edit Zone dialog with a proper region selector (countries/states/continents). --- admin-spa/src/routes/Settings/Shipping.tsx | 51 ++++++++++++++++++---- 1 file changed, 43 insertions(+), 8 deletions(-) diff --git a/admin-spa/src/routes/Settings/Shipping.tsx b/admin-spa/src/routes/Settings/Shipping.tsx index a757f73..e1f690a 100644 --- a/admin-spa/src/routes/Settings/Shipping.tsx +++ b/admin-spa/src/routes/Settings/Shipping.tsx @@ -297,13 +297,22 @@ export default function ShippingPage() {

- +
+ + +
{/* Shipping Rates */} @@ -761,7 +770,7 @@ export default function ShippingPage() { - {/* Delete Confirmation Dialog */} + {/* Delete Method Confirmation Dialog */} setDeletingMethod(null)}> @@ -783,6 +792,32 @@ export default function ShippingPage() { + {/* Delete Zone Confirmation Dialog */} + setDeletingZone(null)}> + + + {__('Delete Shipping Zone?')} + + {__('Are you sure you want to delete')} {deletingZone?.name}? + {' '}{__('All shipping methods in this zone will also be deleted. This action cannot be undone.')} + + + + {__('Cancel')} + { + if (deletingZone) { + deleteZoneMutation.mutate(deletingZone.id); + } + }} + className="bg-destructive text-destructive-foreground hover:bg-destructive/90" + > + {__('Delete Zone')} + + + + + ); }