Skip to content

Fix empty Actions dropdown on Domains page#3975

Open
themuddfamily wants to merge 2 commits into
modoboa:masterfrom
themuddfamily:fix/domains-empty-actions-dropdown
Open

Fix empty Actions dropdown on Domains page#3975
themuddfamily wants to merge 2 commits into
modoboa:masterfrom
themuddfamily:fix/domains-empty-actions-dropdown

Conversation

@themuddfamily
Copy link
Copy Markdown

@themuddfamily themuddfamily commented Mar 15, 2026

Summary

  • The Actions dropdown in the Domains list toolbar was always visible but contained an empty <v-list> with no menu items
  • Added a bulk_delete API endpoint (POST /api/v2/domains/bulk_delete/) that accepts {ids: [...], keep_folder: bool} for deleting multiple domains in a single request
  • Frontend now only shows the Actions dropdown when multiple rows are selected (matching the pattern in IdentityList.vue), and calls the new bulk endpoint

Changes

Backend: modoboa/admin/api/v2/viewsets.py

  • Added bulk_delete action to DomainViewSet
  • Accepts {ids: [1, 2, 3], keep_folder: false}
  • Validates permissions for each domain before deletion

Frontend: frontend/src/api/domains.js

  • Added bulkDeleteDomains(ids, keepFolder) method

Frontend: frontend/src/components/admin/domains/DomainList.vue

  • Added v-if="selected.length > 1" to Actions menu (same pattern as IdentityList)
  • Added getActionMenuItems() and deleteSelectedDomains() using the bulk endpoint

Fixes #3974

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
@kryskool kryskool requested a review from tonioo March 16, 2026 08:15
@kryskool kryskool added this to the 2.8.0 milestone Mar 16, 2026
@tonioo
Copy link
Copy Markdown
Member

tonioo commented Mar 20, 2026

@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).
Do you think you could do that instead?

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
@tonioo tonioo modified the milestones: 2.8.0, 2.8.1 Mar 23, 2026
@kryskool kryskool modified the milestones: 2.8.1, 2.8.2 Mar 31, 2026
@kryskool kryskool modified the milestones: 2.8.2, 2.8.3 Apr 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Domains page: Actions dropdown in toolbar is empty

4 participants