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
Code view: support glob filters #532
Code view: support glob filters #532
Conversation
4f780f7
to
99ee679
Compare
With the addition of reposense#170, users can filter the code view by filetype by selecting tick boxes. Let's support a more powerful search box where users can filter files by glob e.g. **/test/*.java.
99ee679
to
07ea762
Compare
Since I could not find any frontend Javascript library for glob pattern matching, i have used a node-module called Since the build javascript file produced is automated, it does not conform to |
@reposense/devs ready for review |
@ongspxm kindly review |
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 feature doesn't work together with the current file type filter checkboxes:
Uncheck all file types
Set glob filter to any of the filetypes (e.g. **.java
)
All .java
files will appear, when the checkbox for .java
is still unchecked.
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.
@apoorva17 I intend to have the file types selection to tap on the search bar functionality when its complete.
E.g. clicking on the file formats check box will update the search bar, letting the search bar to perform the filtration, so that we can remove the redundant code that does the same thing. Can you look into it?
@yamidark this is fixed now |
This can be looked at in a separate PR. @damithc your opinion? |
I'm OK to do it as a separate PR. @eugenepeh Actually, I'm not entirely sure about that feature. Auto-updating the search bar as the user ticks checkboxes is nice, but complications will arise when the user types in the search bar and tick checkboxes in tandem. If we go in that direction, we may have to disable checkboxes the moment the user starts typing in the search bar. |
The reason I propose this is because it is not going to be easy to get the checkbox and search bar work well with each other. The complication you mentioned, still exist in current implementation. E.g. toggling the checkbox ignores the search bar values and shows results corresponding only to the checkboxes. I propose that we replace all the checkboxes with buttons that append or replace the search bar value so that both work in coherent. E.g.
The advantage of my proposition over this alternative is that:
@damithc , what do you think? |
Good points. |
I see. Though, another advantage of auto-generated text is that it helps user understand how the glob works .
It does helps to reduce the complexity, though not any helpful to the bookmarking because it is still 2 separate field. However, if users are more comfortable with the ui in #547 (comment), I am all in for it as my main concerns are mainly the complexity and potential bugs getting the 2 working together. |
We can show the auto-generated glob under the tick boxes as a read-only label so that the user can copy it over to the filter box, if he wants.
That's true. In this case, we'll have to encode filter text or tickbox configuration, whichever the chosen option. On a general note, it maybe good to define a data structure that can represent all report parameters, and functions to encode it into a URL (and decode it from the URL). perhaps something based on JSON?
Yes, getting the two to work together will be hard. Let's keep them separate. |
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.
minor nit
2943096
to
ddb3c51
Compare
@damithc i've updated the implementation as per #547 (comment) |
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.
Do update the report image in the UserGuide as well, only DeveloperGuide updated
Ok, I've updated 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.
minor nit, the rest looks ready to go
}, | ||
|
||
getFilteredFiles() { | ||
}, |
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 here because?
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 tried to do v-on:submit.prevent
for glob filter to prevent the page from refreshing without specifying any method but it wasn't working so i had to add this method in.
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.
sflr; pls add a comment here if needed. but try this first, it should work, using vanilla form functions:
form(onsubmit="return false")
On a separate note, is there a glob syntax to specify multiple conditions? e.g., having |
Not currently, I'm using minimatch library which does not seem to support such a glob syntax. |
Can try multimatch. It extends minimatch library to support multiple conditions. |
Sure, I can look into this in a follow-up PR. |
@ongspxm just a reminder, you have an unresolved conversation #532 (review) |
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.
minor nits
}, | ||
|
||
getFilteredFiles() { | ||
}, |
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.
sflr; pls add a comment here if needed. but try this first, it should work, using vanilla form functions:
form(onsubmit="return false")
@apoorva17 sry, i pressed wrong, dun know how to unapprove, but just that change will do |
@ongspxm I've made the requested change. |
@apoorva17 Restarted it a few times and it passes now, seems like cypress will fail the tests once in awhile (happens to be locally as well). Will raise an issue for this. |
Nits to proposed message:
|
After #532 , the name of the checkbox is changed from `mui-checkbox` to `mui-checkbox--filetype`, causing an alignment problem with the checkboxes. Since this rename is meaningful, let's add another css part to ensure that the checkboxes align. Meanwhile, some of the indentation in #532 does not follow our standard, let's update them as well.
Fixes #504