-
Notifications
You must be signed in to change notification settings - Fork 59
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
Findings dashboard for all organizations #4007
base: main
Are you sure you want to change the base?
Conversation
…minvws/nl-kat-coordination into feature/findings-dashboard-for-all-orgs
…ture/findings-dashboard-for-all-orgs
…hub.com/minvws/nl-kat-coordination into feature/findings-dashboard-for-all-orgs
…minvws/nl-kat-coordination into feature/findings-dashboard-for-all-orgs
…minvws/nl-kat-coordination into feature/findings-dashboard-for-all-orgs
…minvws/nl-kat-coordination into feature/findings-dashboard-for-all-orgs
Running |
|
…feature/findings-dashboard-for-all-orgs01~
|
( | ||
"dashboard", | ||
models.ForeignKey( | ||
null=True, on_delete=django.db.models.deletion.SET_NULL, to="crisis_room.dashboard" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can probably be a cascade, where the dashboarddata gets deleted when the dashboard gets deleted. Not just set to null. Null values are not needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought that the data can still exist after deleting the dashboard. So they can delete the dashboard and asign the data to another dashboard? i don't know if this was the intention. I see a possibility to re-asign data to another dashboard.
|
||
|
||
class DashboardData(models.Model): | ||
dashboard = models.ForeignKey(Dashboard, on_delete=models.SET_NULL, null=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
null is not allowed. On_delete from a dashboard, the dashboardData should also be deleted. so cascade.
{% block content %} | ||
{% include "header.html" %} | ||
|
||
<main id="main-content" tabindex="-1" class="crisisroom"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is there a tabindex on these?
@@ -9,6 +9,7 @@ | |||
<main id="main-content"> | |||
<section> | |||
<div> | |||
{{ member }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
debugging? I dont see it defined anywhere in the contexts?
@@ -25,6 +26,7 @@ <h1>{% translate "Crisis room" %} {{ organization.name }} @ {{ observed_at|date: | |||
<p> | |||
{% translate "An overview of the top 10 most severe findings OpenKAT found. Check the detail section for additional severity information." %} | |||
</p> | |||
{{ recipe_form_fields }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here?
|
||
@register.filter | ||
def get_first_seen(occurrences: dict) -> datetime: | ||
first_seen_list = [datetime.fromisoformat(occurrence["first_seen"]) for occurrence in occurrences] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets do a min on the occurences first, and Then transform to a date. thats cheaper. Also, we we have the occurrences sorted by the database, we can just take the first or last, and use that instead of looping.
<td> | ||
<a href="{% ooi_url 'ooi_detail' occurrence.finding.ooi organization.code %}">{{ occurrence.finding.ooi|human_readable }}</a> | ||
</td> | ||
<td>{{ occurrence.first_seen|get_datetime }}</td> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's also a template function to print '2 days ago', which we can use in conjunction with a title tag to add the 'raw utc' date for power users.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oeeh we can use that indeed, let me check
Co-authored-by: Jan Klopper <[email protected]>
Changes
This PR adds dashboards to OpenKAT.
In the frontend we've only added the Findings Dashboard to the Crisis Room of all organizations, but the backend is already ready to add all kinds of dashboards to both Crisis Rooms.
This PR adds:
Issue link
Closes #3881
Demo
Opname.2025-01-07.102915.mp4
Aggregate Report:

QA notes
New organization
Create a new organization. Creating a new organization would automatically add this organization to the Findings Dashboard (which is shown in the Crisis Room for all organizations). Besides this, on the Scheduled Reports page there should be a ReportRecipe called "Crisis Room Aggregate Report". This should also create a report, which can be seen on the Report History page (this may take a minute). After the report has been created, the results of the report should be visible on the Crisis Room for all organizations. Please make sure that these two matches.
Existing organizations
Existing organizations also need their own dashboard. This can be done by using the command "make dashboard" in rocky. Please check if this adds the existing organizations to the Findings Dashboard (which is shown in the Crisis Room for all organizations).
Findings Report
The Findings Report should work as expected. Also, it should be possible to create a Aggregate and Multi Findings Report. Please check if this work as expected.
Code Checklist
.env
changes files if required and changed the.env-dist
accordingly.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.