Repository navigation
Categories: don't store a stand-in colour - #298
Merged
Merged
Conversation
The category form filled a missing colour with the stand-in #4ea426 and
saved it, so every category that had no colour got one on the next save
and a dot appeared for it on the public hub.
Stored categories without a colour now show an empty colour field, the
field is optional ("Leave empty for no color"), and an empty field is
saved as null. New categories still start with the green default. Rows
and payload moved into category-rows.ts so the round trip is tested.
This file contains hidden or 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
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.
Problem
The category form showed a missing colour as
#4ea426and sent that value on save. Any category without a colour got one the next time the list was saved, for example after renaming another category, and from then on the public hub drew a dot for it. A colour could also never be removed again.Fix
optionalmode ofColorFieldwith the hint "Leave empty for no color".null.components/categories/category-rows.ts. Hint text in all seven languages.Existing data is unchanged: a category that already got
#4ea426this way can't be told apart from one that picked it on purpose. The guild can clear it now.Tests
category-rows.test.ts: a category without colour round-trips without colour, a cleared field becomesnull, names are trimmed and order follows position.pnpm --filter @msk-forms/webtypecheck, eslint and prettier on the changed files.