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

Allow injection of form fields by plugins into standard models (and allow corresponding plugins to parse data on save) #14732

Open
DanSheps opened this issue Jan 8, 2024 · 4 comments
Labels
complexity: high Expected to require a large amont of time and effort to implement relative to other tasks netbox status: backlog Awaiting selection for work type: feature Introduction of new functionality to the application

Comments

@DanSheps
Copy link
Member

DanSheps commented Jan 8, 2024

NetBox version

v3.7.0

Feature type

New functionality

Proposed functionality

Add a method to:

  • Allow plugins to inject form fields into a "core model" form (example: Interface)
    • Perhaps allow this to be done in a dynamic manner, such as only showing fields when certain properties are already selected, however this is not "core" to the proposal
  • Process the form field data and save via a "sub-form" save method (or whatever method is appropriate)

Use case

This would allow for extending of "core" models by plugins while not actually modifying the core model

As an example, lets say you want to the Interface model to collect more data regarding the layer 2 information (example, port security, spanning tree, etc). You would define the form and model in your plugin and tell it which form (or model) to hook into, it would then display the extra field in the corresponding model create/edit form. When saved, the form would validate both the parent form and the "sub-form" before saving.

Database changes

None required

External dependencies

None

@DanSheps DanSheps added type: feature Introduction of new functionality to the application status: under review Further discussion is needed to determine this issue's scope and/or implementation labels Jan 8, 2024
@abhi1693
Copy link
Member

abhi1693 commented Jan 8, 2024

Seems duplicate of #11961

@DanSheps
Copy link
Member Author

DanSheps commented Jan 9, 2024

It does appear to be a duplicate. However that one was more or less also replalcing forms and manipulating data in the core model. This would be more akin to custom fields.

This however was brought up in a maintainers meeting a few months back by me which is why I am bringing it here (just a little lax on getting stuff from my brain into github)

@peteeckel
Copy link
Contributor

peteeckel commented Feb 6, 2024

It may be a duplicate (I'd say so, it's pretty much the core of what I wanted to suggest with #11961), but things have changed since then as NetBox 3.7.0 saw the introduction of plugin-injected fields in standard models, so adding plugin-injected form fields is the logical next step.

I highly appreciate this new approach, as the functionality could make my life much easier in some places and also greatly improve user experience - Custom Fields can be a bit clumsy at times.

Copy link
Contributor

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. Do not attempt to circumvent this process by "bumping" the issue; doing so will result in its immediate closure and you may be barred from participating in any future discussions. Please see our contributing guide.

@github-actions github-actions bot added the pending closure Requires immediate attention to avoid being closed for inactivity label May 15, 2024
@jeremystretch jeremystretch added complexity: high Expected to require a large amont of time and effort to implement relative to other tasks status: backlog Awaiting selection for work and removed status: under review Further discussion is needed to determine this issue's scope and/or implementation pending closure Requires immediate attention to avoid being closed for inactivity labels May 22, 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: high Expected to require a large amont of time and effort to implement relative to other tasks netbox status: backlog Awaiting selection for work type: feature Introduction of new functionality to the application
Projects
None yet
Development

No branches or pull requests

4 participants