-
Notifications
You must be signed in to change notification settings - Fork 27
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
🐛 [Frontend] Annotations fix: Convert named colors to HEX #6162
🐛 [Frontend] Annotations fix: Convert named colors to HEX #6162
Conversation
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.
Good catch! But pydantic seems to support hex colors. 🤔
Still some users might get annoyed to see gray annotations, maybe they chose a specific hex code and they try do to it again and then it'll end up gray again -> still a bug for them. Some scientists are very picky on their color choices. 😉
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.
fun
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.
@odeimaiz as discussed, I will check whether I could do the conversion from named-color to hex-color in the backend in a separate PR as well.
Quality Gate passedIssues Measures |
What do these changes do?
When listing projects, pydantic, I believe, is translating the colors used in the annotations from hex to named colors. The frontend wasn't able to understand some of those named colors (i.e. #0FF -> Cyan).
This PR workarounds that problem by checking the named colors in a longer list and converting it again to hex. If the named color doesn't exist in the list it will default it to light gray.
The annotations that were failing in the deserialization step:
Related issue/s
How to test
Dev-ops checklist