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

Add bulk actions on report overview #3777

Open
wants to merge 20 commits into
base: main
Choose a base branch
from

Conversation

TwistMeister
Copy link
Contributor

Changes

This adds a drop down button with several actions on the report history page. The user needs to make a selection from the list of reports first, using the checkboxes.

Issue link

Closes #3379 and #3388

QA notes

Select one or more reports from the list using the checkboxes in front. In addition, also use the "select all" for testing purposes. And then select either delete or rename from the "actions" drop down and preform the action in the modal and submit the modal.


Code Checklist

  • All the commits in this PR are properly PGP-signed and verified.
  • This PR only contains functionality relevant to the issue.
  • I have written unit tests for the changes or fixes I made.
  • I have checked the documentation and made changes where necessary.
  • I have performed a self-review of my code and refactored it to the best of my abilities.
  • Tickets have been created for newly discovered issues.
  • For any non-trivial functionality, I have added integration and/or end-to-end tests.
  • I have informed others of any required .env changes files if required and changed the .env-dist accordingly.
  • 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.

@TwistMeister TwistMeister requested a review from a team as a code owner October 31, 2024 11:58
for subreport in subreports:
self.recreate_report(subreport, parent_ooi)

def rename_reports(self, report_references: list[str]) -> None:
Copy link
Contributor

Choose a reason for hiding this comment

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

A few things:

  • The messages here are a bit misleading, because there's no way to find out what message belongs to what report reference?
  • On success you would spam a few "Report names changed successfully." messages on the view, you probably want to do that only once when it actually succeeds?

Also, the message "Report names changed successfully." is misleading


observed_at = datetime.now(timezone.utc)

bytes_data = self.get_report_data_from_bytes(report_ooi)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
bytes_data = self.get_report_data_from_bytes(report_ooi)
report_data = self.get_report_data_from_bytes(report_ooi)


bytes_data = self.get_report_data_from_bytes(report_ooi)

new_bytes_id = self.bytes_client.upload_raw(
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
new_bytes_id = self.bytes_client.upload_raw(
raw_id = self.bytes_client.upload_raw(

def delete_reports(self, report_references: list[str]) -> None:
reports_selected = self.request.GET.get("report", "")
if reports_selected == "all":
all_reports = self.get_queryset()[:] # must be sliced
Copy link
Contributor

Choose a reason for hiding this comment

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

Why does it need to be sliced?

Suggested change
all_reports = self.get_queryset()[:] # must be sliced
all_reports = list(self.get_queryset())

Copy link

sonarcloud bot commented Oct 31, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
7.1% Coverage on New Code (required ≥ 80%)
16.9% Duplication on New Code (required ≤ 3%)

See analysis details on SonarCloud

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.

Implementation: Bulk action - Rename report(s)
3 participants