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

Reports: Fix select all OOIs #2909

Merged
merged 31 commits into from
May 28, 2024
Merged

Reports: Fix select all OOIs #2909

merged 31 commits into from
May 28, 2024

Conversation

Rieven
Copy link
Contributor

@Rieven Rieven commented May 6, 2024

Changes

  • Change select all objects from button to checkbox at the top of all checkboxes for objects.
  • After select all checkbox pressed a get request is performed to set ooi=all this will trigger all other checkboxes to be disabled and checked
  • Deselecting select all checkbox will do the opposite, it will again send a small get request to remove ooi=all resetting disabled and checked so user can do selections.
  • Form will remember pagination for all objects selection, if you want to select a ooi at page 2 for example, unchecking all checkbox will refresh page 2 with all unselected boxes
  • Select all will remember filters
  • This is done for aggregate and generate report flows

Issue link

Closes #2911

Demo

Screen.Recording.2024-05-21.at.15.33.12.mov

Code Checklist

  • All the commits in this PR are properly PGP-signed and verified.
  • This PR only contains functionality relevant to the issue; tickets have been created for newly discovered issues.
  • I have written unit tests for the changes or fixes I made.
  • For any non-trivial functionality, I have added integration and/or end-to-end tests.
  • I have performed a self-review of my code and refactored it to the best of my abilities.

Communication

  • I have informed others of any required .env changes files if required and changed the .env-dist accordingly.
  • I have made corresponding changes to the documentation, if necessary.
  • I have included comments in the code to elaborate on what is not self-evident from the code itself, including references to issues and discussions online, or implicit behavior of an interface.

Checklist for code reviewers:

Copy-paste the checklist from the docs/source/templates folder into your comment.


Checklist for QA:

Copy-paste the checklist from the docs/source/templates folder into your comment.

@Rieven Rieven requested a review from a team as a code owner May 6, 2024 12:59
rocky/rocky/locale/django.pot Outdated Show resolved Hide resolved
rocky/reports/views/base.py Outdated Show resolved Hide resolved
rocky/reports/views/base.py Outdated Show resolved Hide resolved
@stephanie0x00
Copy link
Contributor

Some QA notes:

  1. When using the top square to select all objects (which is what I'd intuitively do) the selected objects do not show up on the 'normal' reports page. This same behaviour occurs for the Aggregate report flow (and I'm expecting also for the Multi Report flow, but I haven't tested this).

  2. Using the 'Select all objects' text-button for the Normal report shows the same behaviour. When you continue to the next page no objects are selected. Maybe this behaviour occurs because I first used the checkbox option, but in that case this would still be a bug.

  3. A nice addition (though maybe for a new PR?) would be to use the 'Select all' text-button and/or the checkbox on top to select all objects and then being able to deselect some objects. I can see various occurrences where I might want to select almost all objects, apart from a few (for example those that are inherited such as DNS servers).

In the example below I clicked on the yellow checkbox to select all object, instead of the text saying 'Select all objects'.

This screenshot shows that all objects are selected:
image

This screenshot shows that the next page shows that no objects are selected:
image

@stephanie0x00
Copy link
Contributor

Checklist for QA:

  • I have checked out this branch, and successfully ran a fresh make reset.
  • I confirmed that there are no unintended functional regressions in this branch:
    • I have managed to pass the onboarding flow
    • Objects and Findings are created properly
    • Tasks are created and completed properly
  • I confirmed that the PR's advertised feature or hotfix works as intended.
  • I checked the logs for errors and/or warnings and made issues where necessary

What works:

Looks good, we ended up finding a bug where no reports were shown when multiple objects were selected. That has been resolved. During the selection of objects you now also get the feedback how many objects you selected if you used the select all function.

What doesn't work:

Nothing found.

Bug or feature?:

Nothing found.

Copy link
Contributor

@ammar92 ammar92 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very minimal suggestions, should be ready merge soon

rocky/reports/templates/partials/report_ooi_list.html Outdated Show resolved Hide resolved
rocky/tests/reports/test_base_report.py Outdated Show resolved Hide resolved
@underdarknl underdarknl merged commit e3f2fbe into main May 28, 2024
10 checks passed
@underdarknl underdarknl deleted the fix-select-all_oois branch May 28, 2024 14:33
jpbruinsslot added a commit that referenced this pull request Jun 11, 2024
* main: (78 commits)
  Translations update from Hosted Weblate (#3048)
  Translations update from Hosted Weblate (#3018)
  Fix empty consumes of boefjes will trigger tasks in scheduler (#3017)
  Fixes text in secondary menu on scan profile detail page (#3035)
  chore: Resolves css-issues found by sonarcloud (#3034)
  Add raw AuthToken SQL migration (#3009)
  Translations update from Hosted Weblate (#3012)
  Rewrite xtdb-cli.py with "click" (#2957)
  Phase out the Repository model from the KATalogus (#2984)
  Fix merge conflicts in weblate (#3007)
  Translations update from Hosted Weblate (#2996)
  Reports: Fix select all OOIs (#2909)
  Adding IPv6 support to documentation for Docker setups (#2813)
  Translations update from Hosted Weblate (#2930)
  User documentation for reports (#2898)
  Fix task api status code response for malformed id in the scheduler (#2953)
  Add drill trace option in dnssec boefje (#2979)
  Updated packages (#2972)
  Update granian and remove workaround for fixed bug (#2980)
  Fix typing in boefjes/normalizers (#2933)
  ...
jpbruinsslot added a commit that referenced this pull request Jun 17, 2024
* main: (40 commits)
  Translations update from Hosted Weblate (#3091)
  feat: 📝 add API titles (#3055)
  Fixed 2 small mistakes in documentation (#3089)
  Documentation - developer and helper functionality documentation for xtdb-cli tool (#3023)
  fix: 🔧 update db normalize setting (#2777)
  Translations update from Hosted Weblate (#3048)
  Translations update from Hosted Weblate (#3018)
  Fix empty consumes of boefjes will trigger tasks in scheduler (#3017)
  Fixes text in secondary menu on scan profile detail page (#3035)
  chore: Resolves css-issues found by sonarcloud (#3034)
  Add raw AuthToken SQL migration (#3009)
  Translations update from Hosted Weblate (#3012)
  Rewrite xtdb-cli.py with "click" (#2957)
  Phase out the Repository model from the KATalogus (#2984)
  Fix merge conflicts in weblate (#3007)
  Translations update from Hosted Weblate (#2996)
  Reports: Fix select all OOIs (#2909)
  Adding IPv6 support to documentation for Docker setups (#2813)
  Translations update from Hosted Weblate (#2930)
  User documentation for reports (#2898)
  ...
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.

Select All OOIs will not remember oois
5 participants