-
Notifications
You must be signed in to change notification settings - Fork 486
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
Fixes #1381 - Improvements clay multi select #1382
Merged
jbalsas
merged 10 commits into
liferay:develop
from
matuzalemsteles:improvements-clay-multi-select
Dec 18, 2018
Merged
Changes from 4 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
c847008
Fixes #1381 - Adds the eventFromInput to emit with inputOnKeydown
matuzalemsteles 60ff96c
Fixes #1381 - Add items and remove items by default and the new API f…
matuzalemsteles 0149edb
Fixes #1381 - Update ClayAutocomplete tests
matuzalemsteles 9915d67
Fixes #1381 - Update ClayMultiSelect tests
matuzalemsteles 32eea13
Fixes #1381 - SF
matuzalemsteles 0c21207
Fixes #1381 - Adds the new labelLocator and valueLocator APIs
matuzalemsteles f2d7334
Fixes #1381 - Replace the default value of filterField in favor of th…
matuzalemsteles 6aca854
Fixes #1381 - Adds the data from the element filtered
matuzalemsteles 2d56632
Fixes #1381 - Deprecates extractData and filterField and adds the lab…
matuzalemsteles 1a60380
Fixes #1381 - Update tests
matuzalemsteles 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 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 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 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 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 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
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.
hey @jbalsas, I do not know if I understood your intention of the
filterField
, but I'm using it for the context of setting the field when the items are filtered.https://github.com/liferay/clay/pull/1382/files#diff-21f70f10741963ea56df2ba593022af3R64
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.
Hey @matuzalemsteles, yeah, I think this does what's expected, but the initial value is odd. It should likely be
value
. I'd expect theitemSelected
event fromAutoComplete
to emit the full item that was selected. This should be more than just a string, it should be the whole object. For example:You'd then set
filterField = 'foo'
, and the value to add should then be1
or3
depending on which item got selected.Additionally, we should have a counterpart for the
label
. We can't simply derive it from thevalue
, as these things might not always have a clear mapping. Imagine the following:In this case, you'd likely want to set the field value to map to the
categoryId
field, and the label one to map thename
field.With this in mind, I'd propose something like:
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 @jbalsas for the clarifications, I'll make the modifications.
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.
hey @jbalsas just clarifying something related to the
filterField
API, we are only using to get the field of the filtered item (See https://github.com/liferay/clay/blob/master/packages/clay-data-provider/src/ClayDataProvider.js#L152). I'm assuming a dev can make its own filter system and disable the default.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.
On the use of
labelLocator
andvalueLocator
of accepting functions is a bad thing because we need to pass to Soy and it does not deal well with this. I like the idea of accepting onlystring
, what do you think?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.
Got it, let's stick with strings for now, then 👌
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.
hey @jbalsas, yesterday I was looking at this and I did the following to be able to accept the
string
andfunction
, I kept your idea and I'm just not taking into consideration to modify theselectedItems
API schema, that way I just do the mapping oflabelLocator
andvalueLocator
... What do you think?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.
What did you do? 😂
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.
haha 😅, I'm going to send what I had done, it would have been clearer.
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.
😂 👍