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 5a4be3880..a481c98ad 100644 --- a/frontend/src/routes/(app)/compliance-assessments/[id=uuid]/+page.svelte +++ b/frontend/src/routes/(app)/compliance-assessments/[id=uuid]/+page.svelte @@ -11,6 +11,7 @@ import DonutChart from '$lib/components/Chart/DonutChart.svelte'; import { URL_MODEL_MAP } from '$lib/utils/crud'; + import type { Node } from './types'; export let data: PageData; breadcrumbObject.set(data.compliance_assessment); @@ -27,18 +28,6 @@ `change_${requirementAssessmentModel.name}` ); - interface Node { - urn: string; - parent_urn: string | null; - name: string; - node_content: string; - assessable: boolean; - style: string; - description: string | null; - children?: Record; - status?: string; // Assuming that the status field exists in nodes similar to leaves - } - const countStatus = ( node: Node, statusCounts: Record = {} diff --git a/frontend/src/routes/(app)/compliance-assessments/[id=uuid]/TreeViewItemContent.svelte b/frontend/src/routes/(app)/compliance-assessments/[id=uuid]/TreeViewItemContent.svelte index 24bda2ce2..66f1a34ad 100644 --- a/frontend/src/routes/(app)/compliance-assessments/[id=uuid]/TreeViewItemContent.svelte +++ b/frontend/src/routes/(app)/compliance-assessments/[id=uuid]/TreeViewItemContent.svelte @@ -1,17 +1,36 @@ -
-
+
+
- {#if !hasChildren && canEditRequirementAssessment} - + {#if assessable && canEditRequirementAssessment} + {content} @@ -84,13 +105,21 @@ {content} {/if} - {#if threats || security_functions} + {#if (threats && threats.length > 0) || (security_functions && security_functions.length > 0)}
(showInfo = !showInfo)} - on:keydown={(_) => (showInfo = !showInfo)} + class="select-none text-sm hover:text-primary-400 {classesShowInfoText(showInfo)}" + on:click={(e) => { + e.preventDefault(); + showInfo = !showInfo; + }} + on:keydown={(e) => { + if (e.key === 'Enter') { + e.preventDefault(); + showInfo = !showInfo; + } + }} > Learn more
@@ -152,24 +181,16 @@ {/if}
{#if hasChildren} -
+
{#each orderedStatusPercentages as sp} - {#if complianceColorMap[sp.status] === '#000000'} -
- {sp.percentage.display}% -
- {:else} -
- {sp.percentage.display}% - -
- {/if} +
+ {sp.percentage.display}% +
{/each}
{/if} diff --git a/frontend/src/routes/(app)/compliance-assessments/[id=uuid]/TreeViewItemLead.svelte b/frontend/src/routes/(app)/compliance-assessments/[id=uuid]/TreeViewItemLead.svelte index 4106c9430..f0326df86 100644 --- a/frontend/src/routes/(app)/compliance-assessments/[id=uuid]/TreeViewItemLead.svelte +++ b/frontend/src/routes/(app)/compliance-assessments/[id=uuid]/TreeViewItemLead.svelte @@ -1,5 +1,4 @@