-
Notifications
You must be signed in to change notification settings - Fork 3
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
Make element-search-dialog easier to customize #430
Conversation
Signed-off-by: LE SAULNIER Kevin <kevin.lesaulnier@rte-france.com>
Signed-off-by: LE SAULNIER Kevin <kevin.lesaulnier@rte-france.com>
Signed-off-by: LE SAULNIER Kevin <kevin.lesaulnier@rte-france.com>
Signed-off-by: LE SAULNIER Kevin <kevin.lesaulnier@rte-france.com>
Signed-off-by: LE SAULNIER Kevin <kevin.lesaulnier@rte-france.com>
renderElement, | ||
searchTermDisabled, | ||
searchTermDisableReason, | ||
isLoading, |
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.
Why do we need to expose this prop to the owner of ElementSearchDialog
?
Maybe we could set a local state to true when onSearchTermChange
is called then set it to false when elementsFound changes ?
I think It's complex if we let the component owner manage this state no ?
At least name is loading
as the Autocomplete prop ?
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.
I think it's way better to handle "isLoading" when we make the fetch, otherwise we will have some troubles handling errors or edge cases
for "isLoading" naming, I see your point, but I think it's more clear to call it "isLoading"
Can we ask a 3rd person to decide with us ?
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 which case we can have troubles or errors when using state instead of props
When testing I saw that we show the "loading..." text when input field is empty (enter a character, then remove it), that doesn't happen at the moment in gridstudy |
Before, emptying the field would make the suggestions empty, now we are displaying the history |
return searchTermDisabled || searchTermDisableReason | ||
? searchTermDisableReason | ||
: searchTerm; |
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.
return searchTermDisabled || searchTermDisableReason | |
? searchTermDisableReason | |
: searchTerm; | |
return searchTermDisabled | |
? searchTermDisableReason | |
: searchTerm; |
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.
and add a default value for searchTermDisableReason
maybe ?
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.
Hmm I'm not sure here, he we could have a behaviour where searchTermDisabled is "true" and searchTermDisableReason is empty
It means we would disable the component, but still display "searchTerm" in the textInput
This was the previous behaviour if I'm not wrong
Signed-off-by: LE SAULNIER Kevin <kevin.lesaulnier@rte-france.com>
Signed-off-by: LE SAULNIER Kevin <kevin.lesaulnier@rte-france.com>
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.
Code Review OK
Test OK
Console warning check OK
Signed-off-by: LE SAULNIER Kevin <kevin.lesaulnier@rte-france.com>
…idsuite/commons-ui into refacto-element-search-dialog
No description provided.