Fix empty Actions dropdown on Domains page#3975
Open
themuddfamily wants to merge 2 commits into
Open
Conversation
The Actions dropdown in the Domains list toolbar was always visible but contained no menu items. This matches the pattern used in IdentityList: - Only show the Actions dropdown when multiple rows are selected - Populate it with a bulk Delete action using MenuItems component Fixes modoboa#3974
Member
|
@themuddfamily Thanks for this. Actually, I'm not sure that allowing domain multi-deletion is a good idea but if we do it, I'd prefer to implement a single endpoint in the API (bulk mode). |
As requested in review, adds a single bulk_delete endpoint to
DomainViewSet that accepts a list of domain IDs, rather than
calling the individual delete endpoint in a loop.
- POST /api/v2/domains/bulk_delete/ accepts {ids: [...], keep_folder: bool}
- Frontend calls the new endpoint from the bulk Actions dropdown
- Validates permissions for each domain before deletion
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
<v-list>with no menu itemsbulk_deleteAPI endpoint (POST /api/v2/domains/bulk_delete/) that accepts{ids: [...], keep_folder: bool}for deleting multiple domains in a single requestIdentityList.vue), and calls the new bulk endpointChanges
Backend:
modoboa/admin/api/v2/viewsets.pybulk_deleteaction toDomainViewSet{ids: [1, 2, 3], keep_folder: false}Frontend:
frontend/src/api/domains.jsbulkDeleteDomains(ids, keepFolder)methodFrontend:
frontend/src/components/admin/domains/DomainList.vuev-if="selected.length > 1"to Actions menu (same pattern as IdentityList)getActionMenuItems()anddeleteSelectedDomains()using the bulk endpointFixes #3974