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

Primary nav fails to render with trailing space in cluster badge color #12272

Closed
rak-phillip opened this issue Oct 15, 2024 · 5 comments · Fixed by #12379
Closed

Primary nav fails to render with trailing space in cluster badge color #12272

rak-phillip opened this issue Oct 15, 2024 · 5 comments · Fixed by #12379
Assignees
Labels
Milestone

Comments

@rak-phillip
Copy link
Member

The primary navigation bar in Rancher Dashboard fails to render if a space is entered for a custom badge color for a cluster.

Steps to reproduce

  1. Navigate to Cluster Management
  2. Click on Create and select an RKE2 cluster
  3. Fill out the required fields for creating an RKE2 cluster
  4. Click on Cluster Appearance => Customize
  5. Enable Badge background color and select a background color for the cluster
  6. Create the cluster
  7. Click on "Edit YAML" for the newly created cluster
  8. Modify ui.rancher/badge-color so that it contains trailing whitespace (e.g ui.rancher/badge-color: '#1a5fb4 '
  9. Save the changes

Expected behavior

No errors in the console and primary navigation renders

Actual behavior

Error is printed to the console

Error: Unable to parse color from string: #1a5fb4 
    Color index.js:49
    Color index.js:24
    parseColor color.js:85
    get badge management.cattle.io.cluster.js:315
    get reactivity.esm-bundler.js:492
    clusters TopLevelMenu.vue:107
    clusters TopLevelMenu.vue:98

Primary navigation fails to render

Screenshots

primary-nav

@rak-phillip rak-phillip added this to the v2.10.0 milestone Oct 15, 2024
@github-actions github-actions bot added the QA/dev-automation Issues that engineers have written automation around so QA doesn't have look at this label Oct 15, 2024
@gaktive gaktive added the JIRA label Oct 16, 2024
@gaktive
Copy link
Member

gaktive commented Oct 16, 2024

Internal reference: SURE-9153

@codyrancher codyrancher self-assigned this Oct 17, 2024
@gaktive gaktive assigned nwmac and unassigned codyrancher Oct 28, 2024
@gaktive
Copy link
Member

gaktive commented Oct 28, 2024

@nwmac working on something similar with the form validation in the colour picker.

@nwmac nwmac added QA/manual-test Indicates issue requires manually testing and removed QA/dev-automation Issues that engineers have written automation around so QA doesn't have look at this labels Oct 28, 2024
@nwmac
Copy link
Member

nwmac commented Oct 28, 2024

/backport v2.9.4

@nwmac
Copy link
Member

nwmac commented Oct 29, 2024

/backport v2.8.10

@rancher-max
Copy link
Member

Validated using rancher head build

Version Information:

image

Validation Information:

  • Performed the steps mentioned and noticed no error in the console and primary navigation renders properly
  • Edited as Form and then went to Edit as YAML from that page and saw the same good results
  • Used different forms of whitespace (tab, single space, multiple spaces, new lines) and saw the same good results

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants