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

CSV Import of Custom Links fails when button_class is "default" #15596

Closed
maddin8 opened this issue Apr 1, 2024 · 1 comment
Closed

CSV Import of Custom Links fails when button_class is "default" #15596

maddin8 opened this issue Apr 1, 2024 · 1 comment

Comments

@maddin8
Copy link

maddin8 commented Apr 1, 2024

Deployment Type

Self-hosted

NetBox Version

v3.7.4

Python Version

3.11

Steps to Reproduce

  1. Go to Custom links
  2. Prepare some CSV file with dummy values for a Custom Link to import, see below for example.
  3. Attempt the Import of the CSV file or use Direct import via Comma-separated data.

Sample data used to reproduce the observed behavior:

name,content_types,enabled,group_name,button_class,new_window,link_text,link_url,weight
Test,"dcim.device,virtualization.virtualmachine",TRUE,Testgroup,default,TRUE,Open Link in new Window,https://{{ object.name }}:443/,100

Also tried with:

name,content_types,enabled,group_name,button_class,new_window,link_text,link_url,weight
Test,"dcim.device,virtualization.virtualmachine",TRUE,Testgroup,Default,TRUE,Open Link in new Window,https://{{ object.name }}:443/,100

Expected Behavior

The new Custom Link should be created with a "Button Class" value of "Default", just as it works when creating a new Custom Field manually via the GUI and leaving "Default" as the "Button Class" as displayed.

Observed Behavior

Error "Record 1 button_class: Select a valid choice. Default is not one of the available choices." is displayed in the GUI and the Custom Link is not created.

@maddin8 maddin8 added status: needs triage This issue is awaiting triage by a maintainer type: bug A confirmed report of unexpected behavior in the application labels Apr 1, 2024
@maddin8
Copy link
Author

maddin8 commented Apr 1, 2024

I just found out that the "Default" value is called "outline-dark" by looking into the "button_class" column of the "extras_customlink" table of another Netbox instance (I also found the evidence in the Code after searching for the value "outline-dark" in Github).

I'm not sure anymore if this is a bug or just needs improvement in documentation as I didn't find this being mentioned in the Netbox UI or the Documentation (Something like "Default is "outline-dark"" in either of these places would be helpful.

New to "contributing" to Github, so I think I'll close this and instead suggest an addition to documentation.

@maddin8 maddin8 closed this as completed Apr 1, 2024
@jeremystretch jeremystretch removed type: bug A confirmed report of unexpected behavior in the application status: needs triage This issue is awaiting triage by a maintainer labels Apr 2, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants