diff --git a/src/views/control-implementations/IndexView.vue b/src/views/control-implementations/IndexView.vue index 1f28abd0..5cadde03 100644 --- a/src/views/control-implementations/IndexView.vue +++ b/src/views/control-implementations/IndexView.vue @@ -149,10 +149,27 @@ + + { + const map: Record = {}; + const walk = (node: TreeNode) => { + if (node.type === 'control') { + const control = node.data as Control; + map[normalizeId(control.id)] = control; + } + for (const child of node.children ?? []) { + walk(child); + } + }; + for (const node of nodes.value) { + walk(node); + } + return map; +}); + +const selectedControl = computed(() => { + const key = normalizeId(selectedDrawerControlId.value); + return key ? controlsById.value[key] : undefined; +}); + +const selectedControlDescription = computed(() => { + const statementPart = selectedControl.value?.parts?.find( + (part) => part.name === 'statement', + ); + return statementPart?.prose ?? ''; +}); + const selectedControlDashboardSuggestions = computed(() => { const key = normalizeId(selectedDrawerControlId.value); return key ? (pendingDashboardSuggestionsByControl.value[key] ?? []) : []; diff --git a/src/views/control-implementations/partials/ControlStatementByComponents.vue b/src/views/control-implementations/partials/ControlStatementByComponents.vue index aeaf5efb..131a55a1 100644 --- a/src/views/control-implementations/partials/ControlStatementByComponents.vue +++ b/src/views/control-implementations/partials/ControlStatementByComponents.vue @@ -56,11 +56,11 @@ const menuItems = computed(() => [ -
-
+
+
[ @save="emit('save', $event)" @delete="emit('delete', $event)" /> +
diff --git a/src/views/control-implementations/partials/ControlStatementImplementation.vue b/src/views/control-implementations/partials/ControlStatementImplementation.vue index ab206135..8a865a9a 100644 --- a/src/views/control-implementations/partials/ControlStatementImplementation.vue +++ b/src/views/control-implementations/partials/ControlStatementImplementation.vue @@ -1368,6 +1368,7 @@ async function submitEvidenceLinking() { > AI is not configured, so dashboard suggestions cannot be generated. +
+
diff --git a/src/views/control-implementations/partials/ControlStatementMetadata.vue b/src/views/control-implementations/partials/ControlStatementMetadata.vue index b1d289c5..24a5afd3 100644 --- a/src/views/control-implementations/partials/ControlStatementMetadata.vue +++ b/src/views/control-implementations/partials/ControlStatementMetadata.vue @@ -89,4 +89,5 @@ function formatLinks(links: Statement['links']): string { Edit
+
diff --git a/src/views/control-implementations/partials/ControlStatementSuggestions.vue b/src/views/control-implementations/partials/ControlStatementSuggestions.vue index fb3d26a1..6dd98fa3 100644 --- a/src/views/control-implementations/partials/ControlStatementSuggestions.vue +++ b/src/views/control-implementations/partials/ControlStatementSuggestions.vue @@ -107,5 +107,6 @@ function formatRelevanceScore(score: number | undefined): string { All suggestions applied. +
diff --git a/src/views/control-implementations/partials/CreateByComponentForm.vue b/src/views/control-implementations/partials/CreateByComponentForm.vue index 8c469705..7e95e547 100644 --- a/src/views/control-implementations/partials/CreateByComponentForm.vue +++ b/src/views/control-implementations/partials/CreateByComponentForm.vue @@ -152,4 +152,5 @@ function submit() { +
diff --git a/src/views/control-implementations/partials/IndexControlImplementation.vue b/src/views/control-implementations/partials/IndexControlImplementation.vue index c01fa0a6..8cbd856c 100644 --- a/src/views/control-implementations/partials/IndexControlImplementation.vue +++ b/src/views/control-implementations/partials/IndexControlImplementation.vue @@ -2,6 +2,7 @@ import { v4 as uuidv4 } from 'uuid'; import Drawer from '@/volt/Drawer.vue'; import Message from '@/volt/Message.vue'; +import Badge from '@/volt/Badge.vue'; import type { ImplementedRequirement, Statement } from '@/oscal'; import PartDisplay from '@/components/PartDisplay.vue'; import type { Part } from '@/oscal'; @@ -75,6 +76,13 @@ const selectedStatementStatusCue = computed(() => { const inheritedChipClass = 'rounded px-2 py-0.5 text-xs font-medium bg-purple-600 text-white dark:bg-purple-400 dark:text-purple-950'; +const controlDescription = computed(() => { + const statementPart = control.parts?.find( + (part) => part.name === 'statement', + ); + return statementPart?.prose ?? ''; +}); + const selectedStatementInherited = computed( () => !!selectedPart.value && @@ -314,22 +322,36 @@ async function onPartSelect(e: Event, part: Part) { class="w-full! md:w-1/2! lg:w-3/5!" > diff --git a/src/views/control-implementations/partials/__tests__/ControlStatementByComponents.spec.ts b/src/views/control-implementations/partials/__tests__/ControlStatementByComponents.spec.ts index 91c95832..53c627a7 100644 --- a/src/views/control-implementations/partials/__tests__/ControlStatementByComponents.spec.ts +++ b/src/views/control-implementations/partials/__tests__/ControlStatementByComponents.spec.ts @@ -74,7 +74,6 @@ describe('ControlStatementByComponents', () => { expect( wrapper.findAll('[data-test="statement-by-component"]'), ).toHaveLength(2); - expect(wrapper.findAll('.h-0\\.5')).toHaveLength(1); }); it('emits addComponent, createComponent and inheritFromSsp from burger menu commands', async () => {