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

Support Custom Field Name Changes #137

Closed
itdependsnetworks opened this issue Mar 12, 2021 · 7 comments · Fixed by #208
Closed

Support Custom Field Name Changes #137

itdependsnetworks opened this issue Mar 12, 2021 · 7 comments · Fixed by #208
Assignees
Labels
type: bug Something isn't working as expected
Milestone

Comments

@itdependsnetworks
Copy link
Contributor

Environment

  • Python version: 3.7
  • Nautobot version: v1.0.0b2

Steps to Reproduce

  1. Create a custom field in nautobot, e.g. color on the dcim.device model
  2. Update data for a device, e.g. set to red
  3. Updated name of custom field to colour
  4. View the data in in the UI (notice it is missing)
  5. Return custom field to color
  6. See data return

Expected Behavior

Either custom fields should not be editable or when edited, the data should migrate as well.

Observed Behavior

The data seems to "disappear" on the UI. When the custom field name is returned, the data "reappears".

Screenshots

image

image

image

image

@jathanism
Copy link
Contributor

Yeah I would definitely lean towards a custom field not being able to be renamed once it is created. That would go a long way to avoiding an issue like this entirely that results in apparent data loss. Other concrete model fields cannot be renamed, so I think this asserts that consistency and prevents us from having to come up with an over-engineered solution.

@smk4664
Copy link
Contributor

smk4664 commented Mar 12, 2021

What about adding label. This way the name(label) presented to the End Users could change, but not change the internal field. Though, this could change its usability in scripts and jobs.

@glennmatthews
Copy link
Contributor

What about adding label. This way the name(label) presented to the End Users could change, but not change the internal field. Though, this could change its usability in scripts and jobs.

Custom fields actually do already have a label field, which can be freely changed. :-)

@jedelman8
Copy link
Contributor

@itdependsnetworks can you test again using labels? Does that help? If so, this could be added to the docs in the short term.

@itdependsnetworks
Copy link
Contributor Author

It does not, label changes what is in green, and I am referring to what is in orange.

image

@itdependsnetworks
Copy link
Contributor Author

actually, I am incorrect, I was referring to #135 yes, I think documentation for now is the course of action, with a longer term solution.

@lampwins lampwins self-assigned this Mar 29, 2021
@lampwins lampwins added status: current type: bug Something isn't working as expected and removed status: under review labels Mar 29, 2021
@lampwins
Copy link
Member

For now, we will not allow the name or type to be changed once created.

@lampwins lampwins linked a pull request Mar 29, 2021 that will close this issue
@lampwins lampwins added this to the v1.0.0 milestone Apr 1, 2021
@glennmatthews glennmatthews added this to To do in Release v1.0.0 via automation Apr 2, 2021
@glennmatthews glennmatthews moved this from To do to In progress in Release v1.0.0 Apr 2, 2021
Release v1.0.0 automation moved this from In progress to Done Apr 5, 2021
glennmatthews added a commit that referenced this issue Apr 5, 2021
* fixes #135, #136, and #201 - custom fields choices refactor

* pr feedback

* pr feedback

* refactor migrations (again) and rename custom_field_data to _custom_field_data to make it private

* pr feedback and added webhooks queue

* updated docs

* Update nautobot/docs/additional-features/custom-fields.md

Co-authored-by: Glenn Matthews <glenn.matthews@networktocode.com>

Co-authored-by: Glenn Matthews <glenn.matthews@networktocode.com>
jathanism added a commit to jathanism/nautobot that referenced this issue Apr 5, 2021
jathanism added a commit to jathanism/nautobot that referenced this issue Apr 5, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 5, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: bug Something isn't working as expected
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

6 participants