Skip to content
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 fixes #1288

Merged
merged 10 commits into from
Apr 17, 2019
Merged

Filter fixes #1288

merged 10 commits into from
Apr 17, 2019

Conversation

bjoernricks
Copy link
Contributor

@bjoernricks bjoernricks commented Apr 16, 2019

Fix several issues with filter handling

  • Delta report selection must set first=1
  • Fix pagination with default filter (reset filter.id if filter is changed)
  • Improve the powerfilter by not syncing the filter state
  • Fix setting filters at report details page with quotes in the value

Checklist:

@codecov
Copy link

codecov bot commented Apr 16, 2019

Codecov Report

Merging #1288 into gsa-8.0 will increase coverage by 0.02%.
The diff coverage is 22.97%.

Impacted file tree graph

@@             Coverage Diff             @@
##           gsa-8.0    #1288      +/-   ##
===========================================
+ Coverage    18.05%   18.08%   +0.02%     
===========================================
  Files          953      953              
  Lines        27689    27723      +34     
  Branches      5994     6006      +12     
===========================================
+ Hits          4999     5013      +14     
- Misses       21285    21303      +18     
- Partials      1405     1407       +2
Impacted Files Coverage Δ
gsa/src/web/entities/container.js 0% <0%> (ø) ⬆️
gsa/src/web/components/powerfilter/powerfilter.js 0% <0%> (ø) ⬆️
gsa/src/web/entities/table.js 0% <0%> (ø) ⬆️
gsa/src/web/pages/reports/listpage.js 0% <0%> (ø) ⬆️
gsa/src/gmp/models/filter.js 100% <100%> (ø) ⬆️
gsa/src/gmp/models/filter/convert.js 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update edf70b7...b442953. Read the comment docs.

When paging through the list of reports and selecting a report for delta
comparision always reset the pagination to the first page. If not reset
the list for selecting the report for diff comparision could be empty.
Most methods of Filter model are mutable. If a filter has an id and a
filter is changed the id doesn't reflect the original fiter anymore.
Therefore it must be reset.

This fixes the pagination at the list tables if a default filter is
applied.
The method isn't used outside of Filter model. Therefore it should be
kept private.
Remove the current applied filter from the state of the Powerfilter.
Only store the previously applied filter to allow updating the filter
input field. With this change the filter in the Powerfilter component is
controlled from the outside completely.
If reset or remove icons are clicked reset the displayed user filter
string at the input field in the powerfilter.
Using filter keyword with quotes like foo="bar" creates xml escaped
values when using the fastxml parser. Therefore the values need to be
unescaped before being evaluated and converted.

This is e.g. an issue at the report details page when adding result
filters.
First improve the style by adding some margins and second always display
the current applied filter. This allows to take a look at the applied
filter when the filtering doesn't return any entities.
Avoid displaying an empty list page when the first filter value exceeds
the number of available entities. In that case reset the first filter
value to 1 and do a reload of the page.
Decode xml encoded filter relations too. Releations can be > and < which
are encoded as &gt; and &lt; by fast-xml-parser.
@bjoernricks bjoernricks marked this pull request as ready for review April 17, 2019 07:52
@bjoernricks bjoernricks requested a review from swaterkamp as a code owner April 17, 2019 07:52
@bjoernricks bjoernricks requested a review from a team April 17, 2019 07:52
@swaterkamp swaterkamp merged commit 8ac1e5b into greenbone:gsa-8.0 Apr 17, 2019
@bjoernricks bjoernricks deleted the filter-fixes branch April 24, 2019 10:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants