Fix multi-combo field remove and undo buttons not working#12406
Open
RudyTheDev wants to merge 2 commits into
Open
Fix multi-combo field remove and undo buttons not working#12406RudyTheDev wants to merge 2 commits into
RudyTheDev wants to merge 2 commits into
Conversation
Contributor
maybe close/reopen of PR to try retriggering CI build? |
Contributor
Author
Ah, I didn't know I could do that, thanks for the tip. I assumed I had to push another commit or have a repo member rerun the workflow. |
Contributor
actually they also would need to close/reopen or push commit (maybe push trash commit and force push previous state) |
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.
This PR fixes a bug with
multiCombopreset fields for sub-keyed values, such as "Fuel Types" (e.g.fuel:diesel), where the "remove" and "undo" buttons would not work/show. This currently affects 19 fields likefuel_multi,payment_multi,diet_multietc.Currently:
Pressing the trash can does nothing:
Making any changes does not show an undo arrow:
Fix:
Pressing trash can deletes all the sub-tags and shows undo arrow:
Modifying key value shows undo arrow:
Undo arrow is shown when making individual additions (i.e. new key not in original):
Undo arrow is shown when making individual deletions (i.e. key exists only in original):
For all the above, undo now properly restores not just current keys, but also the original keys.
Seems to work for multi-selection fine as well including mixing new/existing elements.
In technical details: this fixes a primary bug in
uiFieldwhereallKeys()wrapper was not passingtagstopresetField.allKeys, thus not accounting for "dynamic" preset keys. Specifically, inuiFieldComboin.tagswhere it did tag collection infield.keys = ...formultiCombovariant, this value was never used. The consequence is that tags likefuel:dieselwould not be considered byuiFieldfunctions, namelyremove,revert,isModifiedandtagsContainFieldKey. Furthermore, this fixes a secondary bug thatisModifiedandrevertdid not consider that the original entity may have had keys matching the field that no longer exist. In other words,allKeys(_tags)(even with tags given) would not consider theallKeys(original.tags). Since any selected entity triggers either modified flag or adds the keys to revert list, then multi-select also works.No LLM code, only some auto-complete.