-
Notifications
You must be signed in to change notification settings - Fork 75
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 for test coverage #1549
base: master
Are you sure you want to change the base?
filter for test coverage #1549
Conversation
Signed-off-by: Prahitha Movva <prahitha.movva03@gmail.com>
Signed-off-by: Prahitha Movva <prahitha.movva03@gmail.com>
Note: Still a WIP (the select dropdown was not recorded in the screen recording) |
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.
LGTM in general, nice work!
I am still not sure about putting this in the cell it is now, it seems to limit the visibility of the total number of tests passed?
also: what happens if you select something for multiple cells? is this a logical and? or a logical or? it is not immediately clear I think
conf/report/report-template.html
Outdated
] | ||
], | ||
initComplete: function() { | ||
this.api().columns([2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]).every(function() { |
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 exactly does this do? do we have to have that list literal here?
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.
so I listed them out to not have the dropdown for the tags (first 2 columns) but I'll see if this can be done in some other way
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.
So this will have to be changed whenever we add a new tool ? This sounds brittle. Can this be formulated as 'everything but the first two columns' instead ?
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 believe this is resolved in the latest commit. I'll also look into adding a separate JS file for the script. Thanks for the suggestions!
CC @hzeller |
thanks! so the position of the drop-downs definitely has to change and I planned on working on it once the functionality seemed okay. and, I believe it's a logical and because it filters out from the previous result only. i'll look into other ways if it's not as intuitive, please let me know |
conf/report/report-template.html
Outdated
] | ||
], | ||
initComplete: function() { | ||
this.api().columns([2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]).every(function() { |
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.
So this will have to be changed whenever we add a new tool ? This sounds brittle. Can this be formulated as 'everything but the first two columns' instead ?
conf/report/report-template.html
Outdated
initComplete: function() { | ||
this.api().columns([2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]).every(function() { | ||
var column = this; | ||
var select = $('<select><option value="Select"></option></select>') |
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.
General question to consider: instead of having in-line implementation of functions, putting them in a separate JS file might be easier to maintain in the long term.
It is easy to accumulate important code that is hard to understand if buried in a large HTML template (not sure what are good practices are to break this up, as it seems that the closure takes a few values from the context (such as $(this).val()
) - so possibly the function to be implemented externally needs explicit parameters; but that is good for documentation).
So while this looks not a large problem here at this point (and maybe the conclusion might be that this particular use might be benign), it might become some problem in the future. So worthwhile considering a general plan for code structuring.
Signed-off-by: Prahitha Movva <prahitha.movva03@gmail.com>
below is a demo of how the toggle looks and works. also, just to clarify, the filtering is currently logical and but can support logical or too. any suggestions on how to implement it differently are welcome. thanks! toggleFilter.mp4 |
Compared test results
|
Signed-off-by: Prahitha Movva <prahitha.movva03@gmail.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.
Adding it this way will not allow us to easily mix the filter options with other filter types (once we add them).
"filter type" should be a separate field, so once we click "show filter options" we should get a combo box with "filter type" (for now we should be able to only select "coverage" but other filter types should be possible to select in the future.
Then once you do select "coverage" another two inputs should appear - one for the tool selection and another one for coverage selection.
below all of that we should have two buttons - "apply" and "add"
"apply" is self-explanatory (and can be optional - it is okay to automatically apply everything once the row i actually correct - I think this is done like this at the moment)
"add" should generate another row of fields which we can use to combine the current filter (the first row) with another filter (test coverage for another tool for now, other filter types in the future).
Is that explanation clear? Or do you need more details?
Another option - a possibly more modern approach - would be to make the search bar recognize some keywords and make it apply the filters based on what is typed into the search bar - something similar to what github and gitlab do: https://docs.gitlab.com/ee/user/search/ (for a start we could use the google-like filter_type:filter_input
notation) - but I think this may be harder to implement
@hzeller what do you think?
note: the filters will temporarily be at the end of the table ->
$(column.footer()).empty()
it is not fully implemented yet. the column.draw() inside the conditional statements doesn't work and needs some work.