-
Notifications
You must be signed in to change notification settings - Fork 216
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
Support CustomField UI visibility in 3.8 #1136
base: devel
Are you sure you want to change the base?
Conversation
Add ui_editable and ui_visible parameters.
Tests are missing at this point. I see that they will need to be changed also. |
Not sure what to do with the CI sanity test failure. I get that Ansible "helpfully" treats yes/true & no/false as the same. |
YAML converts |
It would be very disappointing to not have full feature parity especially since I would definitely want to use the
I have opened a probably futile discussion item in netbox-community/netbox, let's see if there is any feedback before going down the route of 2 boolean parameters. Added: quoting the values seem to work. Not sure how good of a practice that is, any comments? |
Use docs semantic markup to refer to other options and fix a typo in markup.
Quote truthy looking values to treat them as strings.
required: false | ||
choices: | ||
- "yes" | ||
- "no" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These values are going to cause a lot of confusion, people are going to just use yes
and no
without strings and YAML will convert them to booleans, and then the module will throw an error and they'll come here asking why it doesn't work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exactly and that is what my comments above are about.
I 100% agree.
I need feedback on what is the preferred solution to work around this. I do not think forcing users to quote values to just one module parameter is reasonable, at all.
Two other possible options:
- Present 2 different boolean parameters instead of presenting
ui_editable
as a string value:ui_editable
andui_editable_hidden
. Based on the combined value of these 2 parameters decide if giveyes
no
orhidden
to NetBox API. - Use some other values than
yes
andno
as valuesui_editable
: module parameters takes other values for exampleread-write
and calls NetBox API withyes
; valueread-only
meansno
andhidden
stays the same.
Open to other suggestions or feedback on these 2. I had an open discussion item at the netbox project and suggestions to not use yes
and no
in the NetBox API were ignored.
Both will make the module API diverge from NetBox API which will be sad.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think Option 1 of the other options is the best one. If we're diverging from the NetBox API we may as well do it the best way we can. Thanks for your work on this @bluikko
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also think option 1 is the best solution. I'm not crazy about this trilean that the netbox API is exposing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will rework this to 2x boolean then.
Related Issue
#1135
New Behavior
Add to CustomField the 2 new UI visibility parameters.
Contrast to Current Behavior
Add ui_editable and ui_visible parameters that are new in NetBox 3.8.
Discussion: Benefits and Drawbacks
Just add the new parameters and keep the old
ui_visibility
for backwardscompatibility with pre-3.7.
Changes to the Documentation
Added the 2 new parameters to module documentation.
Proposed Release Note Entry
Support CustomField UI visibility in NetBox 3.8.
Double Check
devel
branch.