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
Fix for sidebar search result based on Pretty name flag #1485
Conversation
e2bf8d7
to
8c5bd12
Compare
Signed-off-by: Jitendra Gundaniya <jitendra_gundaniya@mckinsey.com>
Signed-off-by: Jitendra Gundaniya <jitendra_gundaniya@mckinsey.com>
cc68568
to
5e17f6f
Compare
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 have added few comments. Please have a look. Thank you
src/selectors/modular-pipelines.js
Outdated
searchValue | ||
); | ||
|
||
if (found || foundOpposite) { |
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.
This works in searching for both pretty and non-pretty names but the node list displayed is changed.
Have a look at the gif - The display names in the list gets changed based on search value i.e., I disabled pretty name flag and searched for a pretty name "Feat" and the node list shows Feature Engineering instead of feature_engineering. Though the search results return a value, we should push names based on the pretty flag I guess
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 checked current version on https://demo.kedro.org and this is happening before my changes. We can create a separate ticket for this if this behaviour is not as expected.
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.
@tynandebold is this the expected behavior ?
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.
No, that isn't expected. @jitu5 is right though, this isn't due to his change.
In the screen capture, what's returned when you search for feat
when prettyName
is off should be feature_engineering
and not Feature Engineering
.
Jitendra, can you please create a separate ticket to fix that?
@@ -44,7 +44,12 @@ export const searchTree = ( | |||
// if the child node is a leaf, simply search the leaf's name | |||
// and add to the search result if there is a match. | |||
const found = searchString(childNode.data.name, searchValue); | |||
if (found) { | |||
const foundOpposite = searchString( |
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.
[Nit] I feel opposite terminology not fitting but at the same time, I cannot come up with a suitable name here. @tynandebold any suggestions ?
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'm fine with it.
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 have left few comments and none of them is a blocking change, so approving it now
# Conflicts: # RELEASE.md
…/kedro-viz into fix/pretty_name_search
@tynandebold Now searched/matched text is being highlighted in both the cases. please let me know if anythings is missing or broken. |
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 for making that style change. It looks good to me now, and I'll approve.
I do think there's a little bit of odd UX wherein there can be a mismatch between what's returned in the sidebar and what's show in the flowchart. E.g. if prettyName
is off and you search for Create mat
you'll get back Create Matplot Chart
, but in the flowchart the text of that node is create_matplotlib_chart
.
I think this is ok for now. Let's see if anyone complains. The benefit is now you can search for both pretty and normal names. Nicely done!
@tynandebold For this E.g. if prettyName is off and you search for Before the changes I did just now, it was returning correct text same as flowchart but it want highlighting because the enter text is pretty name ( |
Co-authored-by: Tynan DeBold <thdebold@gmail.com>
Description
This resolves case below for the Pretty name feature 1252
When the feature is turned on, the sidebar search will only allow the user to search for pretty-named things. For example, if one searches for data_processing.preprocessed_shuttles nothing will be returned, even though preprocessed shuttles exists and is the same thing. The same is true in the opposite direction.
Development notes
Now it works for both the type of search terms Pretty name and non Pretty name if it exist.
Checklist
RELEASE.md
file