diff --git a/backend/core/helpers.py b/backend/core/helpers.py index 46d1aa852..2a12568c2 100644 --- a/backend/core/helpers.py +++ b/backend/core/helpers.py @@ -230,11 +230,16 @@ def get_sorted_requirement_nodes_rec( for requirement_node in requirement_nodes if requirement_node.parent_urn == node.urn ] + req_as = requirement_assessment_from_requirement_id[str(node.id)] if requirements_assessed else None result[str(node.id)] = { "urn": node.urn, "parent_urn": node.parent_urn, "ref_id": node.ref_id, "name": node.name, + "ra_id": str(req_as.id) if requirements_assessed else None, + "status": req_as.status if requirements_assessed else None, + "status_display": req_as.get_status_display() if requirements_assessed else None, + "status_i18n": camel_case(req_as.status) if requirements_assessed else None, "node_content": node.display_long, "style": "node", "assessable": node.assessable, diff --git a/frontend/src/lib/utils/helpers.ts b/frontend/src/lib/utils/helpers.ts index 579b66381..50f259b3e 100644 --- a/frontend/src/lib/utils/helpers.ts +++ b/frontend/src/lib/utils/helpers.ts @@ -15,3 +15,12 @@ export const isURL = (url: string) => { return false; } }; + +export function getRequirementTitle(ref_id: string, name: string) { + const pattern = (ref_id ? 2 : 0) + (name ? 1 : 0) + const title: string = + pattern == 3 ? `${ref_id} - ${name}` : + pattern == 2 ? ref_id : + pattern == 1 ? name : ''; + return title; +} \ No newline at end of file diff --git a/frontend/src/routes/(app)/frameworks/[id=uuid]/TreeViewItemContent.svelte b/frontend/src/routes/(app)/frameworks/[id=uuid]/TreeViewItemContent.svelte index 32542caaf..918370936 100644 --- a/frontend/src/routes/(app)/frameworks/[id=uuid]/TreeViewItemContent.svelte +++ b/frontend/src/routes/(app)/frameworks/[id=uuid]/TreeViewItemContent.svelte @@ -1,4 +1,5 @@
-

- {title} -

{data.requirement.urn} {#if data.requirement.description}

{data.requirement.description}