-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Comments
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. |
No new Tab, open the editor in the same Tab, to create the new object. |
Yeah, as I mentioned that's not going to be feasible without a huge amount of UI work unfortunately. |
I have to concur with @jeremystretch, until we do a major UI rewrite, modals are just not feasible right now. |
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. |
Okay, sounds good 👍 |
Would it be possible to leverage the return_url somehow to bring the user back to the form they were editing after clicking save? |
We could perhaps see how it is opened (new tab) and maybe do a window(tab) close instead |
Marking this as blocked by #5893 |
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. |
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:
|
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. |
Hoping to take a fresh look at this soon. |
Bumped this to v4.0 as it probably makes more sense to implement as part of the UI refresh. |
Bumping this for now due to time constraints. Might pick it back up if we finish some other milestones earlier than planned. |
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. |
Environment
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.
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
The text was updated successfully, but these errors were encountered: