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

Select all oois triggers toggle all #2536

Merged
merged 11 commits into from
Feb 26, 2024

Conversation

Rieven
Copy link
Contributor

@Rieven Rieven commented Feb 20, 2024

Changes

Select all oois button triggered toggle all, which is not necessary.

  • When pressing the button "Continue with all OOIs", it will not continue, saying that there are no oois selected from the list of oois.
  • This is because the button is in the same form as the oois selection (checkboxes)
  • I move the button outside the form to seperate 2 submits.
  • Test by clicking the button again and check whether it will continue to the next page (with no errors, see screenshot).

The problem

Pressing the button "Continue with all OOIs" cannot go to the next page, because it triggers the toggle all functionality in JS which requires at least 1 checkbox to be selected from the list of objects(OOIs). No selection is needed with "Continue with all OOIs".

"Continue with all OOIs" should go to the next page with query parameter : ooi="all" and should not be interrupted by the toggle all functionality.

Under what circumstances is this problem occurring?
screenshot:
image

Steps to reproduce

  1. Go to Reports in main menu
  2. Go to "Aggregate reports"
  3. Press "Continue with all OOIs" and see error at toggle all checkbox (see screenshot)

Possible solutions

  • Describe possible ways to solve the problem.
    Remove the button outside the ooi selection form and having its own form

What other options have you considered?
Put a href attribute, but then it also needs to continue with all the selection from query parameters, so need to refactor that as well.

Solution

Remove the button outside the ooi selection form and having its own form


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 February 20, 2024 11:21
underdarknl
underdarknl previously approved these changes Feb 20, 2024
@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.

What works:

The code and check seem to work as expected. Nice explanation of what you are trying to fix with your PR! Ready for merge.

What doesn't work:

n/a

Bug or feature?:

n/a

rocky/tests/conftest.py Outdated Show resolved Hide resolved
@underdarknl underdarknl merged commit b86a6ce into main Feb 26, 2024
10 checks passed
@underdarknl underdarknl deleted the fix-toggle-all-triggered-by-button branch February 26, 2024 08:40
zcrt pushed a commit to zcrt/nl-kat-coordination that referenced this pull request Feb 27, 2024
jpbruinsslot added a commit that referenced this pull request Mar 5, 2024
* main: (85 commits)
  Fix wrong solving of merge conflict (#2585)
  Add metrics collection for scheduler using prometheus (#2468)
  Hotfix for where_in queries for abstract types (#2577)
  Update django (#2587)
  Fix octopoes typing (#2555)
  Create findings report (#2393)
  Raise exception if boefje input OOI has been deleted (#2573)
  Set a timeout on hanging test ssl container (#2560)
  Feature/efficient reporting (#2516)
  Updated findings database. Removed old findings, added Impact, Source… (#2569)
  add unit test for web report (#2528)
  Add pool size config and logs (#2541)
  Quick fix for PDF table overflow (#2562)
  Fix/2527 octopoes unicode (#2558)
  Add return typing to report test fixtures (#2557)
  Sort vulnerabilities in vulnerability report (#2378)
  Disable ruff split-on-trailing-comma and update ruff (#2544)
  Select all oois triggers toggle all (#2536)
  Remove unnecessary toplevel dependencies (#2554)
  Make valid time required parameter in the octopoes API (#2543)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants