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

Edit report recipe #3690

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

Edit report recipe #3690

wants to merge 20 commits into from

Conversation

madelondohmen
Copy link
Contributor

@madelondohmen madelondohmen commented Oct 16, 2024

NOTE: This PR uses the PR #3695


Changes

This PR makes it possible for a user to edit the ReportRecipe.

  • We've added a button to the Scheduled Reports page for each scheduled report in the table.
  • This button redirects the user to the OOI edit page, where the ReportRecipe can be edited.
  • After editing, the scheduler will be updated as well (to update the "deadline_at" and the "schedule" (schedule == cron-expression)

Issue link

Closes #3687

Demo

Opname.2024-10-16.092638.mp4

QA notes

  • Create a report and choose to schedule it
  • Go to the "Scheduled" tab on the Reports page
  • Open the row in the table
  • Click on the edit button
  • Try to edit all fields
  • Save
  • Check if the fields have been changed on the detail page
  • Also check if the fields have been changed on the Scheduled Reports page

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.

@madelondohmen madelondohmen self-assigned this Oct 16, 2024
@madelondohmen madelondohmen requested a review from a team as a code owner October 16, 2024 07:28
rocky/rocky/scheduler.py Show resolved Hide resolved
@madelondohmen madelondohmen marked this pull request as draft October 16, 2024 07:42
@madelondohmen madelondohmen marked this pull request as ready for review October 17, 2024 16:05
Copy link

sonarcloud bot commented Oct 17, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
21.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarCloud

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.

Looks good to me, tiny remarks

rocky/reports/views/report_overview.py Outdated Show resolved Hide resolved
@@ -75,6 +75,7 @@ def generate_form_fields(self, hidden_ooi_fields: dict[str, str] | None = None)
or annotation == dict[str, str]
or annotation == list[str]
or annotation == dict[str, JsonValue]
or annotation == dict[str, Any]
Copy link
Contributor

Choose a reason for hiding this comment

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

Adding this line makes the conditional checks for dict[str, str] and dict[str, JsonValue] redundant. I suggest removing these checks

@noamblitz
Copy link
Contributor

Tried to change the cron expression for a Report Recipe, got
image

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.

Edit report recipe
7 participants