-
Notifications
You must be signed in to change notification settings - Fork 397
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
fix: Handle invalid colour codes on tags, allow default colours #4822
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rolodato
requested review from
kyle-ssg and
matthewelwell
and removed request for
a team
November 8, 2024 18:09
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
github-actions
bot
added
front-end
Issue related to the React Front End Dashboard
api
Issue related to the REST API
labels
Nov 8, 2024
Docker builds report
|
rolodato
changed the title
fix: Handle invalid color codes on tags
fix: Handle invalid colour codes on tags, allow default colours
Nov 8, 2024
Uffizzi Preview |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #4822 +/- ##
==========================================
+ Coverage 97.33% 97.35% +0.02%
==========================================
Files 1180 1183 +3
Lines 41223 41276 +53
==========================================
+ Hits 40123 40183 +60
+ Misses 1100 1093 -7 ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
kyle-ssg
reviewed
Nov 12, 2024
kyle-ssg
approved these changes
Nov 19, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Thanks for submitting a PR! Please check the boxes below:
docs/
if required so people know about the feature!Changes
Fixes the frontend breaking when rendering tags that have an invalid colour.
To reproduce, create a tag with a colour code that is not accepted by
color
. Example (missing#
):curl 'http://localhost:8000/api/v1/projects/34/tags/' -X POST -H 'authorization: Token ...' -H 'content-type: application/json' --data-raw '{"color":"ff0000","label":"my-tag"}'
Trying to render a tag with this colour crashes the frontend:
The reporter of this bug found it when creating a tag using our Terraform provider: https://registry.terraform.io/providers/Flagsmith/flagsmith/latest/docs/resources/tag#tag_colour-1.
The API currently requires forces tags to be created with a colour. Tag colours are entirely visual so there is no reason to force users to provide a value. This change also allows creating tags in the API without specifying a colour.
Flagsmith/terraform-provider-flagsmith#166 makes tag colours optional in the Terraform provider.
How did you test this code?
Manually by looking at tags rendered in different parts of the app.