[PR #8143] [MERGED] Closes #7759: User preferences framework #13322

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

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/8143
Author: @jeremystretch
Created: 12/22/2021
Status: Merged
Merged: 12/22/2021
Merged by: @jeremystretch

Base: featureHead: 7759-user-preferences


📝 Commits (9)

  • 70f257b Introduce UserConfigForm for managing user preferences
  • 36d2422 Introduce UserPreference to define user preferences
  • 2c01e17 Update config context display to reference data_format preference
  • 1eeac7f Introduce DEFAULT_USER_PREFERENCES dynamic config setting
  • 1aafcf2 Enable plugins to define user preferences
  • 7926225 Improve preferences form rendering
  • 01997ef Add tests & cleanup
  • cb6342c Reference DEFAULT_USER_PREFERENCES for undefined preferences
  • 7343ae7 Fix invalid key retrieval

📊 Changes

22 files changed (+342 additions, -143 deletions)

View changed files

📝 docs/configuration/dynamic-settings.md (+16 -0)
📝 docs/development/user-preferences.md (+6 -5)
📝 docs/plugins/development.md (+17 -16)
📝 netbox/extras/admin.py (+3 -0)
📝 netbox/extras/plugins/__init__.py (+19 -0)
netbox/extras/tests/dummy_plugin/preferences.py (+20 -0)
📝 netbox/extras/tests/test_plugins.py (+9 -0)
📝 netbox/extras/views.py (+4 -4)
📝 netbox/netbox/config/parameters.py (+9 -0)
netbox/netbox/preferences.py (+49 -0)
📝 netbox/project-static/dist/netbox.js (+7 -7)
📝 netbox/project-static/dist/netbox.js.map (+2 -2)
📝 netbox/project-static/src/buttons/index.ts (+0 -2)
netbox/project-static/src/buttons/preferences.ts (+0 -30)
📝 netbox/templates/users/preferences.html (+28 -45)
📝 netbox/users/forms.py (+66 -2)
📝 netbox/users/models.py (+21 -7)
netbox/users/preferences.py (+10 -0)
📝 netbox/users/tests/test_models.py (+0 -2)
netbox/users/tests/test_preferences.py (+39 -0)

...and 2 more files

📄 Description

Closes: #7759

  • Introduces the UserPreference class for defining arbitrary user preferences
  • Implements a proper form for the user preferences view
  • Adds the DEFAULT_USER_PREFERENCES dynamic configuration parameter to enable defining default preferences for new users

🔄 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/8143 **Author:** [@jeremystretch](https://github.com/jeremystretch) **Created:** 12/22/2021 **Status:** ✅ Merged **Merged:** 12/22/2021 **Merged by:** [@jeremystretch](https://github.com/jeremystretch) **Base:** `feature` ← **Head:** `7759-user-preferences` --- ### 📝 Commits (9) - [`70f257b`](https://github.com/netbox-community/netbox/commit/70f257b1ea64aae4d6e5868d2eb3d2e7c3889420) Introduce UserConfigForm for managing user preferences - [`36d2422`](https://github.com/netbox-community/netbox/commit/36d2422eefa25d2414b2141dca518e8111a55736) Introduce UserPreference to define user preferences - [`2c01e17`](https://github.com/netbox-community/netbox/commit/2c01e178c7ea43fc04e0b811ffd540325670a681) Update config context display to reference data_format preference - [`1eeac7f`](https://github.com/netbox-community/netbox/commit/1eeac7f4f45f63bad3b371b8a72d8575aea2693d) Introduce DEFAULT_USER_PREFERENCES dynamic config setting - [`1aafcf2`](https://github.com/netbox-community/netbox/commit/1aafcf241fe537025f8a5860d468320c1d2202d5) Enable plugins to define user preferences - [`7926225`](https://github.com/netbox-community/netbox/commit/7926225e9be8bfc64fd168ac63e92df19371de17) Improve preferences form rendering - [`01997ef`](https://github.com/netbox-community/netbox/commit/01997efcbe4c03617a8b4e2803786c546c921c2b) Add tests & cleanup - [`cb6342c`](https://github.com/netbox-community/netbox/commit/cb6342c87404264a5d46dac54c6cf2736321561e) Reference DEFAULT_USER_PREFERENCES for undefined preferences - [`7343ae7`](https://github.com/netbox-community/netbox/commit/7343ae73397089c6e8d45ec91d8f5df5bd65c754) Fix invalid key retrieval ### 📊 Changes **22 files changed** (+342 additions, -143 deletions) <details> <summary>View changed files</summary> 📝 `docs/configuration/dynamic-settings.md` (+16 -0) 📝 `docs/development/user-preferences.md` (+6 -5) 📝 `docs/plugins/development.md` (+17 -16) 📝 `netbox/extras/admin.py` (+3 -0) 📝 `netbox/extras/plugins/__init__.py` (+19 -0) ➕ `netbox/extras/tests/dummy_plugin/preferences.py` (+20 -0) 📝 `netbox/extras/tests/test_plugins.py` (+9 -0) 📝 `netbox/extras/views.py` (+4 -4) 📝 `netbox/netbox/config/parameters.py` (+9 -0) ➕ `netbox/netbox/preferences.py` (+49 -0) 📝 `netbox/project-static/dist/netbox.js` (+7 -7) 📝 `netbox/project-static/dist/netbox.js.map` (+2 -2) 📝 `netbox/project-static/src/buttons/index.ts` (+0 -2) ➖ `netbox/project-static/src/buttons/preferences.ts` (+0 -30) 📝 `netbox/templates/users/preferences.html` (+28 -45) 📝 `netbox/users/forms.py` (+66 -2) 📝 `netbox/users/models.py` (+21 -7) ➕ `netbox/users/preferences.py` (+10 -0) 📝 `netbox/users/tests/test_models.py` (+0 -2) ➕ `netbox/users/tests/test_preferences.py` (+39 -0) _...and 2 more files_ </details> ### 📄 Description ### Closes: #7759 - Introduces the UserPreference class for defining arbitrary user preferences - Implements a proper form for the user preferences view - Adds the `DEFAULT_USER_PREFERENCES` dynamic configuration parameter to enable defining default preferences for new users --- <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:26:46 +01:00
adam closed this issue 2025-12-29 22:26:46 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#13322