Inconsistent UX in VLAN groups create and edit forms when changing scope type #6129

Closed
opened 2025-12-29 19:37:06 +01:00 by adam · 4 comments
Owner

Originally created by @stephanblanke on GitHub (Feb 21, 2022).

Originally assigned to: @stephanblanke on GitHub.

NetBox version

v3.1.8

Python version

3.8

Steps to Reproduce

  1. Open /ipam/vlan-groups/add/
  2. Enter a name
  3. Change Scope type to "DCIM > site"
  4. Select a site
  5. Click "Create"
  6. Click "Edit" to edit the newly created VLAN group
  7. Change scope type to "Virtualization > cluster"

Expected Behavior

Changing the scope type should dynamically show/hide the fields (region, site group, site, location, rack, cluster group and cluster) in the create form.

Observed Behavior

Changing the scope type does not hide any fields in the create form. The expected behavior can be seen in the edit form.

Originally created by @stephanblanke on GitHub (Feb 21, 2022). Originally assigned to: @stephanblanke on GitHub. ### NetBox version v3.1.8 ### Python version 3.8 ### Steps to Reproduce 1. Open /ipam/vlan-groups/add/ 2. Enter a name 3. Change Scope type to "DCIM > site" 4. Select a site 5. Click "Create" 6. Click "Edit" to edit the newly created VLAN group 7. Change scope type to "Virtualization > cluster" ### Expected Behavior Changing the scope type should dynamically show/hide the fields (region, site group, site, location, rack, cluster group and cluster) in the create form. ### Observed Behavior Changing the scope type does not hide any fields in the create form. The expected behavior can be seen in the edit form.
adam added the type: bugstatus: accepted labels 2025-12-29 19:37:06 +01:00
adam closed this issue 2025-12-29 19:37:06 +01:00
Author
Owner

@stephanblanke commented on GitHub (Feb 22, 2022):

I can try to implement this. PR is on its way.

@stephanblanke commented on GitHub (Feb 22, 2022): I can try to implement this. PR is on its way.
Author
Owner

@jeremystretch commented on GitHub (Feb 22, 2022):

I was just looking into this, and it seems to be tied to differing values for data-netbox-url-name. I'm not entirely sure how this is intended to work; maybe @thatmattlove can shed some light?

@jeremystretch commented on GitHub (Feb 22, 2022): I was just looking into this, and it seems to be tied to differing values for `data-netbox-url-name`. I'm not entirely sure how this is intended to work; maybe @thatmattlove can shed some light?
Author
Owner

@stephanblanke commented on GitHub (Feb 22, 2022):

From my point of view we just have to duplicate the following lines and name the dict vlangroup_add: ddff193786/netbox/project-static/src/forms/scopeSelector.ts (L30-L71).

I did a quick test locally and the results look promising. As soon as I can get the pre-commit hooks running, I can commit the change to my fork and create a PR.

@stephanblanke commented on GitHub (Feb 22, 2022): From my point of view we just have to duplicate the following lines and name the dict vlangroup_add: https://github.com/netbox-community/netbox/blob/ddff1937861ac47ba59efa4256e5301a7ce23902/netbox/project-static/src/forms/scopeSelector.ts#L30-L71. I did a quick test locally and the results look promising. As soon as I can get the pre-commit hooks running, I can commit the change to my fork and create a PR.
Author
Owner

@jeremystretch commented on GitHub (Feb 22, 2022):

From my point of view we just have to duplicate the following lines

I'm afraid that simply duplicating the code isn't a tenable solution. We need to ensure that the existing code is used for both views.

@jeremystretch commented on GitHub (Feb 22, 2022): > From my point of view we just have to duplicate the following lines I'm afraid that simply duplicating the code isn't a tenable solution. We need to ensure that the existing code is used for both views.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#6129