[PR #4011] [MERGED] Fixes #3313: YAML-format the config context in the GUI #12729

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

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/4011
Author: @hSaria
Created: 1/25/2020
Status: Merged
Merged: 2/3/2020
Merged by: @jeremystretch

Base: developHead: 3313-config-context-gui


📝 Commits (5)

  • 724d3b8 Fixes #3313: YAML-format the config context in the GUI
  • 265d5c8 Format for local and source contexts
  • 7cfdc51 Corrected ConfigContext data
  • 0d18c29 Set default config context format to JSON to maintain existing behavior
  • ed99158 Merge branch 'develop' into 3313-config-context-gui

📊 Changes

6 files changed (+50 additions, -4 deletions)

View changed files

netbox/project-static/js/configcontext.js (+11 -0)
📝 netbox/templates/extras/configcontext.html (+7 -1)
netbox/templates/extras/inc/configcontext_data.html (+8 -0)
netbox/templates/extras/inc/configcontext_format.html (+6 -0)
📝 netbox/templates/extras/object_configcontext.html (+9 -3)
📝 netbox/utilities/templatetags/helpers.py (+9 -0)

📄 Description

Fixes: #3313

Change the rendered config context format to YAML. The JSON format can still be displayed via a toggle.

I've made this change for the final rendered context of an object as well as the context's data (i.e. extras/config-contexts/{id}/).

gif

Editing a config context is still JSON-based.

Edit: I've since changed the default format to JSON to maintain the existing behaviour. This PR now just adds a YAML toggle.

image

🔄 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/4011 **Author:** [@hSaria](https://github.com/hSaria) **Created:** 1/25/2020 **Status:** ✅ Merged **Merged:** 2/3/2020 **Merged by:** [@jeremystretch](https://github.com/jeremystretch) **Base:** `develop` ← **Head:** `3313-config-context-gui` --- ### 📝 Commits (5) - [`724d3b8`](https://github.com/netbox-community/netbox/commit/724d3b8894dde8e72402fb4e757899b5c05b90be) Fixes #3313: YAML-format the config context in the GUI - [`265d5c8`](https://github.com/netbox-community/netbox/commit/265d5c87e7f007f04fda6bf6c69bf52c0d2def12) Format for local and source contexts - [`7cfdc51`](https://github.com/netbox-community/netbox/commit/7cfdc5188c13e361ffa20ccdcdde6158ad6d4f07) Corrected ConfigContext data - [`0d18c29`](https://github.com/netbox-community/netbox/commit/0d18c296a9864b16b01acd63702e22d1b6c24388) Set default config context format to JSON to maintain existing behavior - [`ed99158`](https://github.com/netbox-community/netbox/commit/ed991583917ae07d4f4d7accd01968c26dfedbea) Merge branch 'develop' into 3313-config-context-gui ### 📊 Changes **6 files changed** (+50 additions, -4 deletions) <details> <summary>View changed files</summary> ➕ `netbox/project-static/js/configcontext.js` (+11 -0) 📝 `netbox/templates/extras/configcontext.html` (+7 -1) ➕ `netbox/templates/extras/inc/configcontext_data.html` (+8 -0) ➕ `netbox/templates/extras/inc/configcontext_format.html` (+6 -0) 📝 `netbox/templates/extras/object_configcontext.html` (+9 -3) 📝 `netbox/utilities/templatetags/helpers.py` (+9 -0) </details> ### 📄 Description ### Fixes: #3313 Change the rendered config context format to YAML. The JSON format can still be displayed via a toggle. I've made this change for the final rendered context of an object as well as the context's data (i.e. `extras/config-contexts/{id}/`). ![gif](https://user-images.githubusercontent.com/34197532/73123915-08df1e00-3f8d-11ea-94a6-4d16a87d7db8.gif) > Editing a config context is still JSON-based. Edit: I've since changed the default format to JSON to maintain the existing behaviour. This PR now just adds a YAML toggle. <img width="638" alt="image" src="https://user-images.githubusercontent.com/34197532/73535264-0fe9ae80-441b-11ea-9c1b-c29e5415a599.png"> --- <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:23:18 +01:00
adam closed this issue 2025-12-29 22:23:18 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#12729