Imvedansh opened a new pull request, #12380:
URL: https://github.com/apache/cloudstack/pull/12380
Implements a confirmation modal for domain deletion that shows detailed
impact before proceeding, making it consistent with account deletion
## **Description**
This PR implements a comprehensive domain deletion confirmation dialog,
making the domain deletion process consistent with account deletion and
providing better warnings to users about the impact of their actions.
Fixes #11497
### New Component: DomainDeleteConfirm
- Created a modal component that shows detailed impact before domain deletion
- Displays a table with account-wise VM statistics:
- Account name
- Total VMs
- Running VMs
- Stopped VMs
- Shows prominent warning about permanent deletion of accounts and VMs
- Requires user to type the exact domain name to enable deletion
- Fetches live data using `listAccounts` and `listVirtualMachines` APIs
### Types of changes
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)
- [X] New feature (non-breaking change which adds functionality)
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] Enhancement (improves an existing feature and functionality)
- [ ] Cleanup (Code refactoring and cleanup, that may add test cases)
- [ ] Build/CI
- [ ] Test (unit or integration test code)
### Feature/Enhancement Scale or Bug Severity
#### Feature/Enhancement Scale
- [ ] Major
- [ ] Minor
#### Bug Severity
- [ ] BLOCKER
- [ ] Critical
- [ ] Major
- [ ] Minor
- [ ] Trivial
### Screenshots (if appropriate):
<img width="1823" height="966" alt="Screenshot from 2026-01-05 22-34-21"
src="https://github.com/user-attachments/assets/3d072882-2f17-4f51-bb24-46eb22434f16"
/>
<img width="1823" height="966" alt="Screenshot from 2026-01-05 22-34-31"
src="https://github.com/user-attachments/assets/2927d43d-8565-47f4-aec0-00b15be4e8c0"
/>
### How Has This Been Tested?
1. Navigate to Domains section
2. Select a domain with multiple accounts and VMs
3. Click "Delete Domain" action
4. Verify modal shows:
- Warning message about permanent deletion
- Table with accurate account and VM counts
- Confirmation input field
5. Try clicking "Delete Domain" without typing name → button should be
disabled
6. Type incorrect domain name → button should remain disabled
7. Type correct domain name → button should enable
8. Click "Delete Domain" → domain should be deleted and UI should update
#### How did you try to break this feature and the system with this change?
- Domain with no accounts
- Domain with accounts but no VMs
- Domain with mix of running and stopped VMs
- Deleting domain while viewing it (should navigate away)
- Whitespace handling in domain name input
<!-- see how your change affects other areas of the code, etc. -->
<!-- Please read the
[CONTRIBUTING](https://github.com/apache/cloudstack/blob/main/CONTRIBUTING.md)
document -->
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]