diff --git a/backend/core/helpers.py b/backend/core/helpers.py index fe2b09699..1d74ac39e 100644 --- a/backend/core/helpers.py +++ b/backend/core/helpers.py @@ -516,16 +516,16 @@ def aggregate_risks_per_field( count = ( RiskScenario.objects.filter(id__in=object_ids_view) .filter(residual_level=i) - .filter(risk_assessment__risk_matrix__name=["name"]) + # .filter(risk_assessment__risk_matrix__name=["name"]) .count() - ) + ) # What the second filter does ? Is this usefull ? else: count = ( RiskScenario.objects.filter(id__in=object_ids_view) .filter(current_level=i) - .filter(risk_assessment__risk_matrix__name=["name"]) + # .filter(risk_assessment__risk_matrix__name=["name"]) .count() - ) + ) # What the second filter does ? Is this usefull ? if "count" not in values[m["risk"][i][field]]: values[m["risk"][i][field]]["count"] = count @@ -551,7 +551,6 @@ def risks_count_per_level(user: User, risk_assessments: list | None = None): residual_level.append( {"name": r[0], "value": r[1]["count"], "color": r[1]["color"], "localName": camel_case(r[0])} ) - return {"current": current_level, "residual": residual_level} @@ -709,7 +708,6 @@ def risk_status(user: User, risk_assessment_list): names.append(str(risk_assessment.project) + " " + str(risk_assessment.version)) y_max_rsk = max(max_tmp, default=0) + 1 - print("y_max_rsk: ", y_max_rsk) return { "names": names, diff --git a/backend/core/views.py b/backend/core/views.py index fcff38bfd..8d7ee541b 100644 --- a/backend/core/views.py +++ b/backend/core/views.py @@ -682,7 +682,7 @@ def impact(self, request, pk): return Response(choices) @action(detail=False, name="Get risk count per level") - def count_per_level(self, request): # _per_level + def count_per_level(self, request): return Response({"results": risks_count_per_level(request.user)}) diff --git a/frontend/src/lib/components/Chart/DonutChart.svelte b/frontend/src/lib/components/Chart/DonutChart.svelte index 38f56f66e..13c203b1f 100644 --- a/frontend/src/lib/components/Chart/DonutChart.svelte +++ b/frontend/src/lib/components/Chart/DonutChart.svelte @@ -3,6 +3,7 @@ import { localItems } from '$lib/utils/locales'; import { languageTag } from '$paraglide/runtime'; + export let name: string; export let s_label: string; export let values: any[]; // Set the types for these variables later on @@ -75,4 +76,4 @@ }); -
+
\ No newline at end of file diff --git a/frontend/src/routes/(app)/analytics/+page.svelte b/frontend/src/routes/(app)/analytics/+page.svelte index cbdcb9cf9..c7b8ccd67 100644 --- a/frontend/src/routes/(app)/analytics/+page.svelte +++ b/frontend/src/routes/(app)/analytics/+page.svelte @@ -306,18 +306,20 @@ {m.currentRiskLevelPerScenario()} object.color)} />
{m.residualRiskLevelPerScenario()} object.color)} />
@@ -620,6 +622,7 @@ c0.27-0.268,0.707-0.268,0.979,0l7.908,7.83c0.27,0.268,0.27,0.701,0,0.969c-0.271, name="compliance_assessments" s_label={m.complianceAssessments()} values={compliance_assessment.donut.values} + colors={compliance_assessment.donut.values.map(object => object.itemStyle.color)} />
diff --git a/frontend/src/routes/(app)/analytics/composer/+page.svelte b/frontend/src/routes/(app)/analytics/composer/+page.svelte index 50faffd70..cb3c19395 100644 --- a/frontend/src/routes/(app)/analytics/composer/+page.svelte +++ b/frontend/src/routes/(app)/analytics/composer/+page.svelte @@ -29,9 +29,10 @@
object.color)} />
@@ -52,9 +53,10 @@
Residual risk level per risk scenario
object.color)} />
diff --git a/frontend/src/routes/(app)/compliance-assessments/[id=uuid]/+page.svelte b/frontend/src/routes/(app)/compliance-assessments/[id=uuid]/+page.svelte index 8c4183d50..be8dcb9c8 100644 --- a/frontend/src/routes/(app)/compliance-assessments/[id=uuid]/+page.svelte +++ b/frontend/src/routes/(app)/compliance-assessments/[id=uuid]/+page.svelte @@ -138,8 +138,10 @@
object.itemStyle.color)} />