Repository navigation
fix(setting): persist inline edits of enum values - #11071
Open
MichaelUray wants to merge 1 commit into
Open
MichaelUray wants to merge 1 commit into
MichaelUray wants to merge 1 commit into
Conversation
Editing an existing value in Settings > Enums was only kept locally: EnumValuesList dispatches 'update' on blur/Enter, but EnumValues did not listen to it, so the change was only saved by a later drag and drop. EnumValues now handles 'update' and stores the edited values. Edited values are trimmed and, like adding a value, empty or duplicate values are rejected and the list is reverted to the stored values. The list works on a local copy so the stored document is no longer mutated in place. Fixes hcengineering#9063 Signed-off-by: Michael Uray <michaeluray@users.noreply.github.com>
This branch has not been deployed
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.
Fixes #9063
Problem
Editing the text of an existing value in Settings → Enums was lost.
EnumValuesListdispatchesupdateon blur/Enter, butEnumValuesonly listened toremoveanddrop, so an edit was only persisted by a later drag and drop.Changes
EnumValueshandlesupdateand stores the edited list.Tests
enumValuesUtils.test.tsfor the validation helper.