Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

quick-add for mandatory fields #5858

Open
tsohst opened this issue Feb 24, 2021 · 16 comments
Open

quick-add for mandatory fields #5858

tsohst opened this issue Feb 24, 2021 · 16 comments
Assignees
Labels
complexity: medium Requires a substantial but not unusual amount of effort to implement netbox status: backlog Awaiting selection for work topic: UI/UX User interface or user experience related work type: feature Introduction of new functionality to the application
Milestone

Comments

@tsohst
Copy link

tsohst commented Feb 24, 2021

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

@jeremystretch
Copy link
Member

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.

@tsohst
Copy link
Author

tsohst commented 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.

@jeremystretch
Copy link
Member

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

@DanSheps
Copy link
Member

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

@jeremystretch
Copy link
Member

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.

@tsohst
Copy link
Author

tsohst commented Feb 25, 2021

Okay, sounds good 👍

@cpmills1975
Copy link
Contributor

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

@DanSheps
Copy link
Member

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

@jeremystretch jeremystretch added status: blocked Another issue or external requirement is preventing implementation type: feature Introduction of new functionality to the application labels Apr 13, 2021
@jeremystretch
Copy link
Member

Marking this as blocked by #5893

@jeremystretch jeremystretch added status: under review Further discussion is needed to determine this issue's scope and/or implementation and removed status: blocked Another issue or external requirement is preventing implementation labels Dec 9, 2021
@jeremystretch
Copy link
Member

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 jeremystretch added status: accepted This issue has been accepted for implementation and removed status: under review Further discussion is needed to determine this issue's scope and/or implementation labels Dec 28, 2021
@jeremystretch jeremystretch self-assigned this Dec 28, 2021
@jeremystretch
Copy link
Member

jeremystretch commented 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
Copy link
Member

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 jeremystretch added status: blocked Another issue or external requirement is preventing implementation and removed status: accepted This issue has been accepted for implementation labels Jan 13, 2022
@netbox-community netbox-community deleted a comment from tsohst Jan 2, 2023
@jeremystretch jeremystretch added status: accepted This issue has been accepted for implementation and removed status: blocked Another issue or external requirement is preventing implementation labels Jan 5, 2023
@jeremystretch jeremystretch self-assigned this Jan 5, 2023
@jeremystretch
Copy link
Member

Hoping to take a fresh look at this soon.

@jeremystretch jeremystretch removed their assignment Apr 10, 2023
@jeremystretch jeremystretch added this to the v3.6 milestone Apr 10, 2023
@jeremystretch jeremystretch modified the milestones: v3.6, v4.0 Jun 15, 2023
@jeremystretch
Copy link
Member

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

@jeremystretch jeremystretch added the topic: UI/UX User interface or user experience related work label Jan 5, 2024
@jeremystretch
Copy link
Member

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

@jeremystretch jeremystretch removed this from the v4.0 milestone Mar 7, 2024
@jeremystretch jeremystretch added needs milestone Awaiting prioritization for inclusion with a future NetBox release and removed status: accepted This issue has been accepted for implementation labels Mar 7, 2024
@jeffgdotorg
Copy link
Contributor

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.

@jeremystretch jeremystretch added the status: backlog Awaiting selection for work label May 21, 2024
@arthanson arthanson added the complexity: medium Requires a substantial but not unusual amount of effort to implement label May 22, 2024
@jeffgdotorg jeffgdotorg added this to the v4.1 milestone May 31, 2024
@jeremystretch jeremystretch removed this from the v4.1 milestone Jul 16, 2024
@jeremystretch jeremystretch added this to the v4.2 milestone Sep 26, 2024
@jeremystretch jeremystretch removed the needs milestone Awaiting prioritization for inclusion with a future NetBox release label Sep 26, 2024
@jeremystretch jeremystretch added v4.2 and removed v4.2 labels Oct 18, 2024
@jeremystretch jeremystretch added the netbox label Nov 1, 2024 — with Linear
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
complexity: medium Requires a substantial but not unusual amount of effort to implement netbox status: backlog Awaiting selection for work topic: UI/UX User interface or user experience related work type: feature Introduction of new functionality to the application
Projects
None yet
Development

No branches or pull requests

7 participants