quick-add for mandatory fields #4587

Closed
opened 2025-12-29 18:37:57 +01:00 by adam · 16 comments
Owner

Originally created by @tsohst on GitHub (Feb 24, 2021).

Originally assigned to: @jeremystretch on GitHub.

Environment

  • Python version: 2.7.16
  • NetBox version: v2.10.3

Proposed Functionality

When adding a new device for example, you always have the finish creating anything related (mandatory fields).
A "+" button would be useful, which would direct you the the specific editor (device-role in this case), you can then create the device-role - save and netbox redirects you to the original (device) editor and auto-fill the field.

image

Use Case

Faster creating of anything that has relations (mandatory field) (e.g. devices -> device-roles)

Database Changes

Don't know

External Dependencies

Don't know

Originally created by @tsohst on GitHub (Feb 24, 2021). Originally assigned to: @jeremystretch on GitHub. <!-- NOTE: IF YOUR ISSUE DOES NOT FOLLOW THIS TEMPLATE, IT WILL BE CLOSED. This form is only for proposing specific new features or enhancements. If you have a general idea or question, please start a discussion instead: https://github.com/netbox-community/netbox/discussions NOTE: Due to an excessive backlog of feature requests, we are not currently accepting any proposals which significantly extend NetBox's feature scope. Please describe the environment in which you are running NetBox. Be sure that you are running an unmodified instance of the latest stable release before submitting a bug report. --> ### Environment * Python version: 2.7.16 * NetBox version: v2.10.3 <!-- Describe in detail the new functionality you are proposing. Include any specific changes to work flows, data models, or the user interface. --> ### Proposed Functionality When adding a new device for example, you always have the finish creating anything related (mandatory fields). A "+" button would be useful, which would direct you the the specific editor (device-role in this case), you can then create the device-role - save and netbox redirects you to the original (device) editor and auto-fill the field. ![image](https://user-images.githubusercontent.com/32710648/109009111-6e30a180-76ae-11eb-82b7-02b97622a5f7.png) <!-- Convey an example use case for your proposed feature. Write from the perspective of a NetBox user who would benefit from the proposed functionality and describe how. ---> ### Use Case Faster creating of anything that has relations (mandatory field) (e.g. devices -> device-roles) <!-- Note any changes to the database schema necessary to support the new feature. For example, does the proposal require adding a new model or field? (Not all new features require database changes.) ---> ### Database Changes Don't know <!-- List any new dependencies on external libraries or services that this new feature would introduce. For example, does the proposal require the installation of a new Python package? (Not all new features introduce new dependencies.) --> ### External Dependencies Don't know
adam added the status: acceptedtype: featurecomplexity: mediumnetboxtopic: UI/UX labels 2025-12-29 18:37:57 +01:00
adam closed this issue 2025-12-29 18:37:58 +01:00
Author
Owner

@jeremystretch commented on GitHub (Feb 24, 2021):

which would direct you the the specific editor

We could add an "add" button to the dropdown easily, but are you saying have it open a separate tab, or something more advanced? Ideally it would open a modal within the current tab to add the new object, but that would take a lot more work under the hood to implement.

@jeremystretch commented on GitHub (Feb 24, 2021): > which would direct you the the specific editor We could add an "add" button to the dropdown easily, but are you saying have it open a separate tab, or something more advanced? Ideally it would open a modal within the current tab to add the new object, but that would take a lot more work under the hood to implement.
Author
Owner

@tsohst commented on GitHub (Feb 24, 2021):

No new Tab, open the editor in the same Tab, to create the new object.
Save that new object and after save, your back in the editor you we're before.

@tsohst commented on GitHub (Feb 24, 2021): No new Tab, open the editor in the same Tab, to create the new object. Save that new object and after save, your back in the editor you we're before.
Author
Owner

@jeremystretch commented on GitHub (Feb 24, 2021):

Yeah, as I mentioned that's not going to be feasible without a huge amount of UI work unfortunately.

@jeremystretch commented on GitHub (Feb 24, 2021): Yeah, as I mentioned that's not going to be feasible without a huge amount of UI work unfortunately.
Author
Owner

@DanSheps commented on GitHub (Feb 25, 2021):

I have to concur with @jeremystretch, until we do a major UI rewrite, modals are just not feasible right now.

@DanSheps commented on GitHub (Feb 25, 2021): I have to concur with @jeremystretch, until we do a major UI rewrite, modals are just not feasible right now.
Author
Owner

@jeremystretch commented on GitHub (Feb 25, 2021):

I think it's worthwhile to add a button though. Even if you need to open a new tab to add something, the selection widget within the form will automatically repopulate to include it.

@jeremystretch commented on GitHub (Feb 25, 2021): I think it's worthwhile to add a button though. Even if you need to open a new tab to add something, the selection widget within the form will automatically repopulate to include it.
Author
Owner

@tsohst commented on GitHub (Feb 25, 2021):

Okay, sounds good 👍

@tsohst commented on GitHub (Feb 25, 2021): Okay, sounds good 👍
Author
Owner

@cpmills1975 commented on GitHub (Feb 27, 2021):

Would it be possible to leverage the return_url somehow to bring the user back to the form they were editing after clicking save?

@cpmills1975 commented on GitHub (Feb 27, 2021): Would it be possible to leverage the return_url somehow to bring the user back to the form they were editing after clicking save?
Author
Owner

@DanSheps commented on GitHub (Feb 27, 2021):

We could perhaps see how it is opened (new tab) and maybe do a window(tab) close instead

@DanSheps commented on GitHub (Feb 27, 2021): We could perhaps see how it is opened (new tab) and maybe do a window(tab) close instead
Author
Owner

@jeremystretch commented on GitHub (Apr 13, 2021):

Marking this as blocked by #5893

@jeremystretch commented on GitHub (Apr 13, 2021): Marking this as blocked by #5893
Author
Owner

@jeremystretch commented on GitHub (Dec 13, 2021):

Lately I've been looking into HTMX and this seems like a prime use case for it. It should be pretty simple to embed an "add" button next to the field which, when clicked, displays an object creation form directly below the form field. Once the form is submitted, it will disappear, and the newly created object will appear as an available option in the field's dropdown widget.

@jeremystretch commented on GitHub (Dec 13, 2021): Lately I've been looking into [HTMX](https://htmx.org/) and this seems like a prime use case for it. It should be pretty simple to embed an "add" button next to the field which, when clicked, displays an object creation form directly below the form field. Once the form is submitted, it will disappear, and the newly created object will appear as an available option in the field's dropdown widget.
Author
Owner

@jeremystretch commented on GitHub (Dec 28, 2021):

I've started working on a POC for this. The bare functionality is there, but we need to fix up some of the frontend stuff. Specifically:

  • Applying APISelect to the modal fields in the "add new" form
  • Fixing auto-slugification
  • Rendering the success/error messages returned when submitting the form
  • Automatically refreshing the list of available objects & selecting the newest one (if feasible)
@jeremystretch commented on GitHub (Dec 28, 2021): I've started working on a POC for this. The bare functionality is there, but we need to fix up some of the frontend stuff. Specifically: - ~Applying APISelect to the modal fields in the "add new" form~ - ~Fixing auto-slugification~ - Rendering the success/error messages returned when submitting the form - Automatically refreshing the list of available objects & selecting the newest one (if feasible)
Author
Owner

@jeremystretch commented on GitHub (Jan 13, 2022):

I've got a rough POC for this working in the 5858-inline-add-objects. However, we need to change how form errors are handled, to ensure the dynamically-loaded forms function as expected. This is largely related to #8058, so I'm going to mark this as blocked for now.

@jeremystretch commented on GitHub (Jan 13, 2022): I've got a rough POC for this working in the [5858-inline-add-objects](https://github.com/netbox-community/netbox/tree/5858-inline-add-objects). However, we need to change how form errors are handled, to ensure the dynamically-loaded forms function as expected. This is largely related to #8058, so I'm going to mark this as blocked for now.
Author
Owner

@jeremystretch commented on GitHub (Jan 5, 2023):

Hoping to take a fresh look at this soon.

@jeremystretch commented on GitHub (Jan 5, 2023): Hoping to take a fresh look at this soon.
Author
Owner

@jeremystretch commented on GitHub (Jun 15, 2023):

Bumped this to v4.0 as it probably makes more sense to implement as part of the UI refresh.

@jeremystretch commented on GitHub (Jun 15, 2023): Bumped this to v4.0 as it probably makes more sense to implement as part of the UI refresh.
Author
Owner

@jeremystretch commented on GitHub (Mar 7, 2024):

Bumping this for now due to time constraints. Might pick it back up if we finish some other milestones earlier than planned.

@jeremystretch commented on GitHub (Mar 7, 2024): Bumping this for now due to time constraints. Might pick it back up if we finish some other milestones earlier than planned.
Author
Owner

@jeffgdotorg commented on GitHub (Mar 26, 2024):

Let's give this FR some weight in v4.1 planning. It addresses a family of paper-cut issues that we've been hearing a lot about lately.

@jeffgdotorg commented on GitHub (Mar 26, 2024): Let's give this FR some weight in v4.1 planning. It addresses a family of paper-cut issues that we've been hearing a lot about lately.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#4587