[PR #5288] [MERGED] Closes #5252: Introduce an API endpoint for writing user preferences #12997

Closed
opened 2025-12-29 22:24:48 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/5288
Author: @jeremystretch
Created: 10/29/2020
Status: Merged
Merged: 10/29/2020
Merged by: @jeremystretch

Base: develop-2.10Head: 5252-table-config


📝 Commits (10+)

  • 2845dd4 Add a REST API endpoint for updating user preferences
  • 4de7fcd Convert table config updates to use REST API
  • ff3d0b7 Tweak the table config form for generic use
  • ce2210b Introduce table_config_form template tag to simplify form generation
  • cf328ca Fix interfaces table header
  • ffdb727 Update BaseTable to accept user instance directly
  • acd4054 Customize device component tables for user
  • a433611 Fix overwriting of existing preferences
  • 00e102f Fix resetting column preferences
  • aad32c4 Add tests for UserConfig API endpoint

📊 Changes

14 files changed (+301 additions, -73 deletions)

View changed files

📝 netbox/dcim/views.py (+45 -9)
📝 netbox/project-static/css/base.css (+0 -4)
netbox/project-static/js/tableconfig.js (+47 -0)
📝 netbox/templates/base.html (+1 -0)
📝 netbox/templates/dcim/device.html (+56 -1)
📝 netbox/templates/utilities/obj_list.html (+7 -4)
📝 netbox/templates/utilities/templatetags/table_config_form.html (+4 -5)
📝 netbox/users/api/urls.py (+3 -0)
📝 netbox/users/api/views.py (+38 -1)
📝 netbox/users/tests/test_api.py (+55 -3)
📝 netbox/utilities/forms/forms.py (+7 -0)
📝 netbox/utilities/tables.py (+27 -23)
📝 netbox/utilities/templatetags/helpers.py (+9 -0)
📝 netbox/utilities/views.py (+2 -23)

📄 Description

Fixes: #5252

  • Introduce UserConfigViewSet
  • Update BaseTable to take a User instance for configuration
  • Remove table configuration logic from ObjectListView
  • Add table configuration Javascript

🔄 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/5288 **Author:** [@jeremystretch](https://github.com/jeremystretch) **Created:** 10/29/2020 **Status:** ✅ Merged **Merged:** 10/29/2020 **Merged by:** [@jeremystretch](https://github.com/jeremystretch) **Base:** `develop-2.10` ← **Head:** `5252-table-config` --- ### 📝 Commits (10+) - [`2845dd4`](https://github.com/netbox-community/netbox/commit/2845dd488e3790789bf1db02c1f68b9858a882dd) Add a REST API endpoint for updating user preferences - [`4de7fcd`](https://github.com/netbox-community/netbox/commit/4de7fcd758cb6133073096401757b24dbc21afc4) Convert table config updates to use REST API - [`ff3d0b7`](https://github.com/netbox-community/netbox/commit/ff3d0b72b9fb9ed3d0050ddb7da2367e69208679) Tweak the table config form for generic use - [`ce2210b`](https://github.com/netbox-community/netbox/commit/ce2210b7bcf7a7ab5d6a759e210a86e2f1b78770) Introduce table_config_form template tag to simplify form generation - [`cf328ca`](https://github.com/netbox-community/netbox/commit/cf328ca51ed9ea6af37d25e2de6877664802f4ee) Fix interfaces table header - [`ffdb727`](https://github.com/netbox-community/netbox/commit/ffdb727e1c4e2424abede8591c4d74516300b19d) Update BaseTable to accept user instance directly - [`acd4054`](https://github.com/netbox-community/netbox/commit/acd4054e79cd250cdec1042b5f29a3a93f9fc0b1) Customize device component tables for user - [`a433611`](https://github.com/netbox-community/netbox/commit/a43361170cb1a7818a5748351f8017095a9b3cfa) Fix overwriting of existing preferences - [`00e102f`](https://github.com/netbox-community/netbox/commit/00e102fb0c2d919213bac24426322aaa34724ff9) Fix resetting column preferences - [`aad32c4`](https://github.com/netbox-community/netbox/commit/aad32c48662738f4365c3a75688ca085590b5a75) Add tests for UserConfig API endpoint ### 📊 Changes **14 files changed** (+301 additions, -73 deletions) <details> <summary>View changed files</summary> 📝 `netbox/dcim/views.py` (+45 -9) 📝 `netbox/project-static/css/base.css` (+0 -4) ➕ `netbox/project-static/js/tableconfig.js` (+47 -0) 📝 `netbox/templates/base.html` (+1 -0) 📝 `netbox/templates/dcim/device.html` (+56 -1) 📝 `netbox/templates/utilities/obj_list.html` (+7 -4) 📝 `netbox/templates/utilities/templatetags/table_config_form.html` (+4 -5) 📝 `netbox/users/api/urls.py` (+3 -0) 📝 `netbox/users/api/views.py` (+38 -1) 📝 `netbox/users/tests/test_api.py` (+55 -3) 📝 `netbox/utilities/forms/forms.py` (+7 -0) 📝 `netbox/utilities/tables.py` (+27 -23) 📝 `netbox/utilities/templatetags/helpers.py` (+9 -0) 📝 `netbox/utilities/views.py` (+2 -23) </details> ### 📄 Description ### Fixes: #5252 - Introduce UserConfigViewSet - Update BaseTable to take a User instance for configuration - Remove table configuration logic from ObjectListView - Add table configuration Javascript --- <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-29 22:24:48 +01:00
adam closed this issue 2025-12-29 22:24:48 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#12997