-
Notifications
You must be signed in to change notification settings - Fork 80
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
Filter by whole file path instead of file name #176
base: master
Are you sure you want to change the base?
Conversation
|
||
if (!show) { | ||
return null | ||
} | ||
|
||
const filtered = createFileTree(filter).tree |
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.
Originally I didn't have this here, but when the tree was reloaded for a reason other than the filter changing (e.g. sync button pressed, or "viewed" checkbox clicked) it would add back folders that should not be visible.
Not sure if this is the best way to address that, but it seems to work fine.
@@ -7,12 +7,28 @@ class Folder extends React.Component { | |||
this.state = {} | |||
} | |||
|
|||
getHighlight ({ nodeLabel, filter, index }) { |
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 did try and move this to the shared lib.js
but it didn't work because of the React stuff, so settled for just having a copy in Folder
let location = tree | ||
if (filterItem(parts[parts.length - 1], filter)) { | ||
if (filterItem(title, filter)) { |
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 is the main change, I haven't made it optional but I'm happy to if you'd like
Thanks I will review soon |
Hi @berzniz, any chance to have this merged any soon (along with other PR's)? This looks really useful. |
Hi @kopach - I won't be able to merge this to the upcoming 1.0.36 version. There are two main things:
|
Updates the filter logic to filter by the whole file path instead of just the file name.
Example:
Closes #175