[PR #19774] [MERGED] Closes #19735: Implement reusable bulk operations classes #15716

Closed
opened 2025-12-30 00:23:37 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/19774
Author: @jeremystretch
Created: 6/26/2025
Status: Merged
Merged: 6/30/2025
Merged by: @jeremystretch

Base: featureHead: 19735-bulk-actions


📝 Commits (10+)

📊 Changes

56 files changed (+567 additions, -973 deletions)

View changed files

netbox/core/object_actions.py (+18 -0)
📝 netbox/core/views.py (+7 -10)
netbox/dcim/object_actions.py (+38 -0)
📝 netbox/dcim/views.py (+29 -94)
📝 netbox/extras/views.py (+8 -30)
📝 netbox/netbox/constants.py (+2 -1)
netbox/netbox/object_actions.py (+176 -0)
📝 netbox/netbox/views/generic/bulk_views.py (+6 -4)
📝 netbox/netbox/views/generic/mixins.py (+36 -3)
📝 netbox/netbox/views/generic/object_views.py (+10 -3)
netbox/templates/core/buttons/bulk_sync.html (+3 -0)
📝 netbox/templates/core/datafile.html (+0 -6)
📝 netbox/templates/core/job.html (+0 -6)
netbox/templates/dcim/buttons/bulk_add_components.html (+71 -0)
netbox/templates/dcim/buttons/bulk_disconnect.html (+3 -0)
netbox/templates/dcim/component_list.html (+0 -22)
netbox/templates/dcim/device/components_base.html (+0 -23)
netbox/templates/dcim/device/consoleports.html (+0 -28)
netbox/templates/dcim/device/consoleserverports.html (+0 -28)
netbox/templates/dcim/device/devicebays.html (+0 -14)

...and 36 more files

📄 Description

Closes: #19735

  • Introduce the ObjectAction base class & subclasses to represent single- and multi-object operations
  • Replace legacy actions dictionaries defined on views with tuples of ObjectAction subclasses
  • Change clone_button tag to be silent if URL resolution fails
  • Remove the following blocks from the template generic/object_children.html:
    • bulk_edit_controls
    • bulk_delete_controls
  • Remove ClusterRemoveDevicesView (identified as an anti-pattern)
  • Delete obsolete HTML templates
  • Flag LEGACY_ACTIONS and DEFAULT_ACTION_PERMISSIONS for removal in future release

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netbox-community/netbox/pull/19774 **Author:** [@jeremystretch](https://github.com/jeremystretch) **Created:** 6/26/2025 **Status:** ✅ Merged **Merged:** 6/30/2025 **Merged by:** [@jeremystretch](https://github.com/jeremystretch) **Base:** `feature` ← **Head:** `19735-bulk-actions` --- ### 📝 Commits (10+) - [`c438c13`](https://github.com/netbox-community/netbox/commit/c438c130458347773e547438f4e6964d7ad15349) Initial work on #19735 - [`3e26ce9`](https://github.com/netbox-community/netbox/commit/3e26ce950cef2faf714e616955d9363626a3b071) Work in progress - [`56eb5d2`](https://github.com/netbox-community/netbox/commit/56eb5d28d1f1bc56c7061440dd04bc2349ee2140) Remove ClusterRemoveDevicesView (anti-pattern) - [`7c0fbd1`](https://github.com/netbox-community/netbox/commit/7c0fbd170373358c554d5bfddc8f1e8e13048746) Misc cleanup - [`1c55880`](https://github.com/netbox-community/netbox/commit/1c558805a544781b1290e82a7e6b77644e8d4986) Fix has_bulk_actions - [`faa0d85`](https://github.com/netbox-community/netbox/commit/faa0d859bba7e4fb49f8662b48770bd0ca59e9a3) Fix has_bulk_actions for ObjectChildrenView - [`ce8c149`](https://github.com/netbox-community/netbox/commit/ce8c1490c841ab1979b6b32f1747953f6250421a) Restore clone button - [`2be2cdb`](https://github.com/netbox-community/netbox/commit/2be2cdb215cd630593f5bf2ae76a2280f5276dbd) Misc cleanup - [`60d8062`](https://github.com/netbox-community/netbox/commit/60d80621edea5bcd0ff1a645433035e651e9ea03) Clean up custom bulk actions - [`57e041f`](https://github.com/netbox-community/netbox/commit/57e041fd1ad14c27b50930fa61e7a246566fdd89) Rename individual object actions ### 📊 Changes **56 files changed** (+567 additions, -973 deletions) <details> <summary>View changed files</summary> ➕ `netbox/core/object_actions.py` (+18 -0) 📝 `netbox/core/views.py` (+7 -10) ➕ `netbox/dcim/object_actions.py` (+38 -0) 📝 `netbox/dcim/views.py` (+29 -94) 📝 `netbox/extras/views.py` (+8 -30) 📝 `netbox/netbox/constants.py` (+2 -1) ➕ `netbox/netbox/object_actions.py` (+176 -0) 📝 `netbox/netbox/views/generic/bulk_views.py` (+6 -4) 📝 `netbox/netbox/views/generic/mixins.py` (+36 -3) 📝 `netbox/netbox/views/generic/object_views.py` (+10 -3) ➕ `netbox/templates/core/buttons/bulk_sync.html` (+3 -0) 📝 `netbox/templates/core/datafile.html` (+0 -6) 📝 `netbox/templates/core/job.html` (+0 -6) ➕ `netbox/templates/dcim/buttons/bulk_add_components.html` (+71 -0) ➕ `netbox/templates/dcim/buttons/bulk_disconnect.html` (+3 -0) ➖ `netbox/templates/dcim/component_list.html` (+0 -22) ➖ `netbox/templates/dcim/device/components_base.html` (+0 -23) ➖ `netbox/templates/dcim/device/consoleports.html` (+0 -28) ➖ `netbox/templates/dcim/device/consoleserverports.html` (+0 -28) ➖ `netbox/templates/dcim/device/devicebays.html` (+0 -14) _...and 36 more files_ </details> ### 📄 Description ### Closes: #19735 - Introduce the ObjectAction base class & subclasses to represent single- and multi-object operations - Replace legacy `actions` dictionaries defined on views with tuples of ObjectAction subclasses - Change `clone_button` tag to be silent if URL resolution fails - Remove the following blocks from the template `generic/object_children.html`: - `bulk_edit_controls` - `bulk_delete_controls` - Remove ClusterRemoveDevicesView (identified as an anti-pattern) - Delete obsolete HTML templates - Flag `LEGACY_ACTIONS` and `DEFAULT_ACTION_PERMISSIONS` for removal in future release --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-30 00:23:37 +01:00
adam closed this issue 2025-12-30 00:23:37 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#15716