From 9d40d6e451ea2bd364c848b8ec773a3d8aa50f1a Mon Sep 17 00:00:00 2001 From: Abderrahmane Smimite Date: Mon, 16 Dec 2024 12:38:37 +0100 Subject: [PATCH] Simply audit action plan for usability --- backend/core/views.py | 14 +- frontend/messages/en.json | 2 +- frontend/messages/fr.json | 3 +- .../[id=uuid]/action-plan/+page.svelte | 149 ++---------------- 4 files changed, 18 insertions(+), 150 deletions(-) diff --git a/backend/core/views.py b/backend/core/views.py index 562e5f3ba..5cbf27a36 100644 --- a/backend/core/views.py +++ b/backend/core/views.py @@ -2070,14 +2070,7 @@ def action_plan(self, request, pk): object_type=ComplianceAssessment, ) if UUID(pk) in viewable_objects: - response = { - "none": [], - "to_do": [], - "in_progress": [], - "on_hold": [], - "active": [], - "deprecated": [], - } + response = [] compliance_assessment_object: ComplianceAssessment = self.get_object() requirement_assessments_objects = ( compliance_assessment_object.get_requirement_assessments( @@ -2099,10 +2092,7 @@ def action_plan(self, request, pk): .filter(applied_controls=applied_control["id"]) .count() ) - if applied_control["status"] == "--": - response["none"].append(applied_control) - else: - response[applied_control["status"].lower()].append(applied_control) + response.append(applied_control) return Response(response) diff --git a/frontend/messages/en.json b/frontend/messages/en.json index f7d7c9fde..791af06cd 100644 --- a/frontend/messages/en.json +++ b/frontend/messages/en.json @@ -569,7 +569,7 @@ "noThreatsMapped": "No threats mapped. Consider attaching threats to your risk scenarios for a better overview.", "actionPlan": "Action plan", "noStatus": "No status", - "actionPlanHelpText": "Separated by status and sorted by eta", + "actionPlanHelpText": "The counter represents the number of associated requirements.", "matchingRequirements": "Matching requirements", "asZIP": "as ZIP", "incoming": "Incoming", diff --git a/frontend/messages/fr.json b/frontend/messages/fr.json index 8fea88c8e..6211b45f9 100644 --- a/frontend/messages/fr.json +++ b/frontend/messages/fr.json @@ -569,7 +569,7 @@ "noThreatsMapped": "Aucune menace n'a été attachée. Pensez à lier les menaces à vos scénarios de risque pour une meilleure visibilité.", "actionPlan": "Plan d'action", "noStatus": "Pas de statut", - "actionPlanHelpText": "Séparé par statut et trié par ETA", + "actionPlanHelpText": "Le compteur correspond aux nombres d'exigences liées", "matchingRequirements": "Exigences associées", "asZIP": "en ZIP", "incoming": "En approche", @@ -876,6 +876,7 @@ "ssoSettingsUpdated": "Paramètres SSO mis à jour", "scoreSemiColon": "Score:", "mappingInferenceHelpText": "Ces variables sont fixes et ne changeront pas en fonction de la source.", + "priority": "Priorité", "ebiosWs1": "Atelier 1 : Cadrage et Socle de sécurité", "ebiosWs2": "Atelier 2 : Sources de risque", "ebiosWs3": "Atelier 3 : Scénarios stratégiques", diff --git a/frontend/src/routes/(app)/(internal)/compliance-assessments/[id=uuid]/action-plan/+page.svelte b/frontend/src/routes/(app)/(internal)/compliance-assessments/[id=uuid]/action-plan/+page.svelte index cf1024da0..53d3197bf 100644 --- a/frontend/src/routes/(app)/(internal)/compliance-assessments/[id=uuid]/action-plan/+page.svelte +++ b/frontend/src/routes/(app)/(internal)/compliance-assessments/[id=uuid]/action-plan/+page.svelte @@ -13,6 +13,7 @@ const appliedControlsHead = { name: 'name', + status: 'status', priority: 'priority', category: 'category', csf_function: 'csfFunction', @@ -24,6 +25,7 @@ }; const appliedControlsColums = [ 'name', + 'status', 'priority', 'category', 'csf_function', @@ -34,35 +36,10 @@ 'requirements_count' ]; - const toDoAppliedControls: TableSource = { + const AppliedControls: TableSource = { head: appliedControlsHead, - body: tableSourceMapper(data.actionPlan.to_do, appliedControlsColums), - meta: data.actionPlan.to_do - }; - const inProgressAppliedControls: TableSource = { - head: appliedControlsHead, - body: tableSourceMapper(data.actionPlan.in_progress, appliedControlsColums), - meta: data.actionPlan.in_progress - }; - const onHoldAppliedControls: TableSource = { - head: appliedControlsHead, - body: tableSourceMapper(data.actionPlan.on_hold, appliedControlsColums), - meta: data.actionPlan.on_hold - }; - const activeAppliedControls: TableSource = { - head: appliedControlsHead, - body: tableSourceMapper(data.actionPlan.active, appliedControlsColums), - meta: data.actionPlan.active - }; - const deprecatedAppliedControls: TableSource = { - head: appliedControlsHead, - body: tableSourceMapper(data.actionPlan.deprecated, appliedControlsColums), - meta: data.actionPlan.deprecated - }; - const noneAppliedControls: TableSource = { - head: appliedControlsHead, - body: tableSourceMapper(data.actionPlan.none, appliedControlsColums), - meta: data.actionPlan.none + body: tableSourceMapper(data.actionPlan, appliedControlsColums), + meta: data.actionPlan }; @@ -102,113 +79,13 @@

- - {m.toDo()} - {m.inProgress()} - {m.onHold()} - {m.active()} - {m.deprecated()} - {m.noStatus()} - -
- {#if tabSet === 0} - - {/if} - {#if tabSet === 1} - - {/if} - {#if tabSet === 2} - - {/if} - {#if tabSet === 3} - - {/if} - {#if tabSet === 4} - - {/if} - {#if tabSet === 5} - - {/if} -
-
-
+