Repository navigation
Replace CategoryOptions expanded mode VAutocomplete with KMultiSelect #6355
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
Closed
sarwar-jahin-port
wants to merge
6
commits into
learningequality:unstable
from
sarwar-jahin-port:refactor/kmultiselect-category-options-6346
Closed
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
eac372f
Migrate CategoryOptions expanded mode to KMultiSelect
sarwar-jahin-port b40bd7b
Fix clear-all and parent removal dropping partial categories
sarwar-jahin-port c3fe15b
Kept cleared pure and moved the clear-all handling into onKMultiSelec…
sarwar-jahin-port f343577
Restore cleared-based reset for Clear-all
sarwar-jahin-port 214d6b7
Simplify CategoryOptions back to the plain rebuild
sarwar-jahin-port c3e7bbc
Remove tests redundant with the simplified contract
sarwar-jahin-port File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
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.
question: Clicking a parent category with a selected child now produces a different result in expanded mode. For example, with
value: { [DANCE]: [n1] }, clicking School behaves differently:{}(baseisCheckboxSelectedByChildrenandonChange).{ [DANCE], [SCHOOL] }.Issue #6346 states that "Selecting a parent category gives the same result as it does now." It also requires both modes to share the same component. These two criteria conflict in this case.
@LianaHarris360, which behaviour should we preserve? If the result should match dropdown mode, the acceptance criterion needs to be updated to reflect that. If the existing behaviour must be preserved, KMultiSelect cannot currently support it, so KDS will need a change first.
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.
agreed this is a real conflict between the two acceptance criteria, not something I should resolve unilaterally. Leaving that for @LianaHarris360's call happy to implement either direction once it's settled.
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.
The preference would be to keep the current behavior, but I remember discussing this during the design of
KMultiSelectand we ultimately decided that a parent value should only be shown as checked when all of its children are selected.However when
KMultiSelectis in Automatic parent selection mode, the parent value is automatically included in the selected list if any child is selected, and when clicked, it and all of its children are removed from the list.Uh oh!
There was an error while loading. Please reload this page.
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.
Thanks @LianaHarris360. I checked
autoSelectParentin KDS 5.10.0, and I think it does not give the current behavior here, for two reasons. I ran both cases locally with the prop turned on.useMultiSelectCascade.js#L176-L187). A resource that already has Dance still shows School as indeterminate, and a click on School adds it.handleSavesaves all three on the resource. Currently, only Dance is saved, in both modes.So I suggest that we keep the
KMultiSelectbehavior, which is the same as dropdown mode, and change the criterion to "Selecting a parent category gives the same result in both modes." Is that OK with you? If we need parents saved, I think that needs its own issue, because it changes the data for both modes.Uh oh!
There was an error while loading. Please reload this page.
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.
Yep, that's fine with me. Thanks for looking into it!