From 4707c6c69db573a7b73496ee03a0ddaafe82f020 Mon Sep 17 00:00:00 2001 From: Mohamed-Hacene Date: Mon, 12 Feb 2024 15:28:30 +0100 Subject: [PATCH 1/5] feat: add security measures and requirement assessments nested tables in evidence view --- backend/core/serializers.py | 2 + backend/core/views.py | 3 +- .../src/lib/components/Forms/ModelForm.svelte | 14 ------- frontend/src/lib/utils/crud.ts | 3 +- frontend/src/lib/utils/table.ts | 4 ++ .../(app)/evidences/[id=uuid]/+page.server.ts | 25 ++++++++++- .../(app)/evidences/[id=uuid]/+page.svelte | 41 +++++++++++++++++-- 7 files changed, 72 insertions(+), 20 deletions(-) diff --git a/backend/core/serializers.py b/backend/core/serializers.py index 6a283edd4..1ef5af2d7 100644 --- a/backend/core/serializers.py +++ b/backend/core/serializers.py @@ -395,6 +395,8 @@ class Meta: class RequirementAssessmentReadSerializer(BaseModelSerializer): name = serializers.CharField(source="__str__") + compliance_assessment = FieldsRelatedField() + class Meta: model = RequirementAssessment diff --git a/backend/core/views.py b/backend/core/views.py index 2706cd9c4..cf1128710 100644 --- a/backend/core/views.py +++ b/backend/core/views.py @@ -502,6 +502,7 @@ class SecurityMeasureViewSet(BaseModelViewSet): "effort", "risk_scenarios", "requirement_assessments", + "evidences" ] search_fields = ["name", "description", "risk_scenarios", "requirement_assessments"] @@ -1161,7 +1162,7 @@ class RequirementAssessmentViewSet(BaseModelViewSet): """ model = RequirementAssessment - filterset_fields = ["folder"] + filterset_fields = ["folder", "evidences"] search_fields = ["name", "description"] @action(detail=False, name="Get updatable measures") diff --git a/frontend/src/lib/components/Forms/ModelForm.svelte b/frontend/src/lib/components/Forms/ModelForm.svelte index ac2d13af6..d28a68a18 100644 --- a/frontend/src/lib/components/Forms/ModelForm.svelte +++ b/frontend/src/lib/components/Forms/ModelForm.svelte @@ -248,20 +248,6 @@ label="Domain" hide={initialData.security_measures || initialData.requirement_assessments} /> - - { const URLModel = 'evidences'; @@ -14,7 +17,27 @@ export const load: PageServerLoad = (async ({ fetch, params }) => { const object = await fetch(`${endpoint}object/`).then((res) => res.json()); - return { URLModel, evidence, object }; + const tables: Record = {}; + + for (const key of ['security-measures', 'requirement-assessments'] as urlModel[]) { + const keyEndpoint = `${BASE_API_URL}/${key}/?evidences=${params.id}`; + const response = await fetch(keyEndpoint); + if (response.ok) { + const data = await response.json().then((data) => data.results); + const bodyData = tableSourceMapper(data, listViewFields[key].body); + + const table: TableSource = { + head: listViewFields[key].head, + body: bodyData, + meta: data + }; + tables[key] = table; + } else { + console.error(`Failed to fetch data for ${key}: ${response.statusText}`); + } + } + + return { URLModel, evidence, object, tables }; }) export const actions: Actions = { diff --git a/frontend/src/routes/(app)/evidences/[id=uuid]/+page.svelte b/frontend/src/routes/(app)/evidences/[id=uuid]/+page.svelte index 4396d4c3d..fa13cc424 100644 --- a/frontend/src/routes/(app)/evidences/[id=uuid]/+page.svelte +++ b/frontend/src/routes/(app)/evidences/[id=uuid]/+page.svelte @@ -5,10 +5,11 @@ import { breadcrumbObject } from '$lib/utils/stores'; import { URL_MODEL_MAP } from '$lib/utils/crud'; import ConfirmModal from '$lib/components/Modals/ConfirmModal.svelte'; - import type { ModalSettings, ModalComponent, ModalStore } from '@skeletonlabs/skeleton'; - import { getModalStore } from '@skeletonlabs/skeleton'; + import type { ModalSettings, ModalComponent, ModalStore, ToastStore } from '@skeletonlabs/skeleton'; + import { getModalStore, TabGroup, Tab, getToastStore } from '@skeletonlabs/skeleton'; import { isURL } from '$lib/utils/helpers'; import { getModelInfo } from '$lib/utils/crud.js'; + import ModelTable from '$lib/components/ModelTable/ModelTable.svelte'; export let data: PageData; breadcrumbObject.set(data.evidence); @@ -21,6 +22,7 @@ let attachment: Attachment | undefined = undefined; const modalStore: ModalStore = getModalStore(); + const toastStore: ToastStore = getToastStore(); function modalConfirm(id: string, name: string, action: string): void { const modalComponent: ModalComponent = { @@ -55,12 +57,14 @@ const user = $page.data.user; const model = URL_MODEL_MAP['evidences']; const canEditObject: boolean = Object.hasOwn(user.permissions, `change_${model.name}`); + + let tabSet = 0;
- {#each Object.entries(data.evidence).filter( ([key, _]) => ['name', 'description', 'folder', 'security_measures', 'requirement_assessments', 'attachment', 'link', 'comment'].includes(key) ) as [key, value]} + {#each Object.entries(data.evidence).filter( ([key, _]) => ['name', 'description', 'folder', 'attachment', 'link', 'comment'].includes(key) ) as [key, value]}
{#if key === 'urn'} @@ -123,6 +127,37 @@ {/if}
+
+ + + Security measures + + + Requirement assessments + + + {#if tabSet === 0} +
+ +
+ {/if} + {#if tabSet === 1} +
+ +
+ {/if} +
+
+
{#if data.evidence.attachment}
From 45a16503a06fef4f259e91b095a755f438e998b9 Mon Sep 17 00:00:00 2001 From: Mohamed-Hacene Date: Mon, 12 Feb 2024 15:29:37 +0100 Subject: [PATCH 2/5] style: run format --- .../src/lib/components/SideBar/navData.ts | 17 +++--- frontend/src/lib/utils/crud.ts | 2 +- frontend/src/lib/utils/table.ts | 2 +- .../[id=uuid]/TreeViewItemContent.svelte | 26 ++++----- .../(app)/evidences/[id=uuid]/+page.server.ts | 13 ++--- .../(app)/evidences/[id=uuid]/+page.svelte | 33 +++++------ .../src/routes/(app)/libraries/+page.svelte | 58 +++++++++---------- .../(app)/libraries/[id=urn]/+page.svelte | 11 ++-- .../first-connexion/+page.server.ts | 8 ++- frontend/tests/functional/nav.test.ts | 8 ++- 10 files changed, 94 insertions(+), 84 deletions(-) diff --git a/frontend/src/lib/components/SideBar/navData.ts b/frontend/src/lib/components/SideBar/navData.ts index 76c1bef70..3148d6c31 100644 --- a/frontend/src/lib/components/SideBar/navData.ts +++ b/frontend/src/lib/components/SideBar/navData.ts @@ -56,13 +56,12 @@ export const navData = { name: 'Assets', fa_icon: 'fa-solid fa-gem', href: '/assets' - }, + } ] }, { name: 'Governance', items: [ - { name: 'Policies', fa_icon: 'fa-solid fa-user', @@ -72,7 +71,7 @@ export const navData = { name: 'Risk matrices', fa_icon: 'fa-solid fa-table-cells-large', href: '/risk-matrices' - }, + } ] }, { @@ -116,10 +115,9 @@ export const navData = { } ] }, - { - name: 'Organisation', - items : [ - + { + name: 'Organisation', + items: [ { name: 'Domains', fa_icon: 'fa-solid fa-diagram-project', @@ -145,9 +143,8 @@ export const navData = { fa_icon: 'fa-solid fa-user-tag', href: '/role-assignments' } - ] - - }, + ] + }, { name: 'Extra', diff --git a/frontend/src/lib/utils/crud.ts b/frontend/src/lib/utils/crud.ts index 3adb44d5f..eef2cf201 100644 --- a/frontend/src/lib/utils/crud.ts +++ b/frontend/src/lib/utils/crud.ts @@ -271,7 +271,7 @@ export const URL_MODEL_MAP: ModelMap = { foreignKeyFields: [ { field: 'security_measures', urlModel: 'security-measures' }, { field: 'evidences', urlModel: 'evidences' }, - { field: 'compliance_assessment', urlModel: 'compliance-assessments'} + { field: 'compliance_assessment', urlModel: 'compliance-assessments' } ] }, libraries: { diff --git a/frontend/src/lib/utils/table.ts b/frontend/src/lib/utils/table.ts index bf2b4077e..f1ccf135d 100644 --- a/frontend/src/lib/utils/table.ts +++ b/frontend/src/lib/utils/table.ts @@ -86,7 +86,7 @@ export const listViewFields = { }, 'requirement-assessments': { head: ['Name', 'Description', 'Compliance Assessment'], - body: ['name', 'description', 'compliance_assessment'], + body: ['name', 'description', 'compliance_assessment'] }, evidences: { head: ['Name', 'File', 'Description'], 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 54ef38132..e1ed2a83c 100644 --- a/frontend/src/routes/(app)/compliance-assessments/[id=uuid]/TreeViewItemContent.svelte +++ b/frontend/src/routes/(app)/compliance-assessments/[id=uuid]/TreeViewItemContent.svelte @@ -155,20 +155,20 @@
{#each orderedStatusPercentages as sp} {#if complianceColorMap[sp.status] === '#000000'} -
- {sp.percentage.display}% -
+
+ {sp.percentage.display}% +
{:else} -
- {sp.percentage.display}% - -
+
+ {sp.percentage.display}% + +
{/if} {/each}
diff --git a/frontend/src/routes/(app)/evidences/[id=uuid]/+page.server.ts b/frontend/src/routes/(app)/evidences/[id=uuid]/+page.server.ts index 1e886c9db..8e86083c5 100644 --- a/frontend/src/routes/(app)/evidences/[id=uuid]/+page.server.ts +++ b/frontend/src/routes/(app)/evidences/[id=uuid]/+page.server.ts @@ -8,7 +8,7 @@ import type { urlModel } from '$lib/utils/types'; import { listViewFields } from '$lib/utils/table'; import { tableSourceMapper, type TableSource } from '@skeletonlabs/skeleton'; -export const load: PageServerLoad = (async ({ fetch, params }) => { +export const load: PageServerLoad = async ({ fetch, params }) => { const URLModel = 'evidences'; const endpoint = `${BASE_API_URL}/${URLModel}/${params.id}/`; @@ -38,7 +38,7 @@ export const load: PageServerLoad = (async ({ fetch, params }) => { } return { URLModel, evidence, object, tables }; -}) +}; export const actions: Actions = { deleteAttachment: async (event) => { @@ -63,11 +63,10 @@ export const actions: Actions = { if (response.non_field_errors) { setError(deleteAttachmentForm, 'non_field_errors', response.non_field_errors); } - setFlash({ type: "error", message: "An error has occured" }, event); + setFlash({ type: 'error', message: 'An error has occured' }, event); return fail(400, { form: deleteAttachmentForm }); } - setFlash({ type: "success", message: "Attachment successfully deleted" }, event); - throw redirect(302, `/${urlmodel}/${id}`) + setFlash({ type: 'success', message: 'Attachment successfully deleted' }, event); + throw redirect(302, `/${urlmodel}/${id}`); } - -} \ No newline at end of file +}; diff --git a/frontend/src/routes/(app)/evidences/[id=uuid]/+page.svelte b/frontend/src/routes/(app)/evidences/[id=uuid]/+page.svelte index fa13cc424..96259f968 100644 --- a/frontend/src/routes/(app)/evidences/[id=uuid]/+page.svelte +++ b/frontend/src/routes/(app)/evidences/[id=uuid]/+page.svelte @@ -5,7 +5,12 @@ import { breadcrumbObject } from '$lib/utils/stores'; import { URL_MODEL_MAP } from '$lib/utils/crud'; import ConfirmModal from '$lib/components/Modals/ConfirmModal.svelte'; - import type { ModalSettings, ModalComponent, ModalStore, ToastStore } from '@skeletonlabs/skeleton'; + import type { + ModalSettings, + ModalComponent, + ModalStore, + ToastStore + } from '@skeletonlabs/skeleton'; import { getModalStore, TabGroup, Tab, getToastStore } from '@skeletonlabs/skeleton'; import { isURL } from '$lib/utils/helpers'; import { getModelInfo } from '$lib/utils/crud.js'; @@ -34,7 +39,7 @@ URLModel: getModelInfo('evidences').urlModel, formAction: action } - }; + }; const modal: ModalSettings = { type: 'component', component: modalComponent, @@ -129,29 +134,23 @@
- - Security measures - - - Requirement assessments - + Security measures + Requirement assessments {#if tabSet === 0}
- +
{/if} {#if tabSet === 1}
-
{/if} @@ -170,9 +169,9 @@ on:click={(_) => { modalConfirm(data.evidence.id, data.evidence.attachment, '?/deleteAttachment'); }} - on:keydown={(_) => modalConfirm(data.evidence.id, data.evidence.attachment, '?/deleteAttachment')} - class="btn variant-filled-tertiary h-full" - > + modalConfirm(data.evidence.id, data.evidence.attachment, '?/deleteAttachment')} + class="btn variant-filled-tertiary h-full">
diff --git a/frontend/src/routes/(app)/libraries/+page.svelte b/frontend/src/routes/(app)/libraries/+page.svelte index a28641ad0..edd4146f7 100644 --- a/frontend/src/routes/(app)/libraries/+page.svelte +++ b/frontend/src/routes/(app)/libraries/+page.svelte @@ -47,35 +47,35 @@
{#if tabSet === 1}
- {#await superValidate(LibraryUploadSchema)} -

Loading the library upload button...

- {:then form} - - - - Loading the library upload button... + {:then form} + - - {:catch err} -

The following error occured while loading the library form : {err}

- {/await} + + + +
+ {:catch err} +

The following error occured while loading the library form : {err}

+ {/await}
{/if} diff --git a/frontend/src/routes/(app)/libraries/[id=urn]/+page.svelte b/frontend/src/routes/(app)/libraries/[id=urn]/+page.svelte index 0dfe99f49..e3e779472 100644 --- a/frontend/src/routes/(app)/libraries/[id=urn]/+page.svelte +++ b/frontend/src/routes/(app)/libraries/[id=urn]/+page.svelte @@ -75,10 +75,13 @@

Provider: {library.provider}

Packager: {library.packager}

{#if library.dependencies} -

Dependendies: - {#each library.dependencies as dependency} -

  • {dependency}
  • - {/each} +

    + Dependendies: + {#each library.dependencies as dependency} +

  • + {dependency} +
  • + {/each}

    {/if} {#if library.copyright} diff --git a/frontend/src/routes/(authentication)/first-connexion/+page.server.ts b/frontend/src/routes/(authentication)/first-connexion/+page.server.ts index a606917b0..981eca749 100644 --- a/frontend/src/routes/(authentication)/first-connexion/+page.server.ts +++ b/frontend/src/routes/(authentication)/first-connexion/+page.server.ts @@ -45,7 +45,13 @@ export const actions: Actions = { return fail(400, { form }); } - setFlash({ type: 'success', message: `Your password was successfully set. Welcome to CISO Assistant.` }, event); + setFlash( + { + type: 'success', + message: `Your password was successfully set. Welcome to CISO Assistant.` + }, + event + ); redirect(302, '/login'); } }; diff --git a/frontend/tests/functional/nav.test.ts b/frontend/tests/functional/nav.test.ts index eb1c396b2..c5d3c5d7f 100644 --- a/frontend/tests/functional/nav.test.ts +++ b/frontend/tests/functional/nav.test.ts @@ -4,7 +4,13 @@ type StringMap = { [key: string]: string; }; -test('sidebar navigation tests', async ({ logedPage, analyticsPage: analyticsPage, layout, sideBar, page }) => { +test('sidebar navigation tests', async ({ + logedPage, + analyticsPage: analyticsPage, + layout, + sideBar, + page +}) => { await test.step('proper redirection to the analytics page after login', async () => { await analyticsPage.hasUrl(); await analyticsPage.hasTitle(); From 017e6fa9ffda05d2c5e118c7508a2bfd424d2ded Mon Sep 17 00:00:00 2001 From: Mohamed-Hacene Date: Mon, 12 Feb 2024 15:44:14 +0100 Subject: [PATCH 3/5] fix: requirement assessments api tests after updating read serializer --- backend/app_tests/api/test_api_requirement_assessments.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/app_tests/api/test_api_requirement_assessments.py b/backend/app_tests/api/test_api_requirement_assessments.py index 2f6d59e11..9aace25a6 100644 --- a/backend/app_tests/api/test_api_requirement_assessments.py +++ b/backend/app_tests/api/test_api_requirement_assessments.py @@ -113,7 +113,7 @@ def test_get_requirement_assessments(self, authenticated_client): }, { "folder": str(folder.id), - "compliance_assessment": str(compliance_assessment.id), + "compliance_assessment": {"id": str(compliance_assessment.id), "str": compliance_assessment.name}, "requirement": str(RequirementNode.objects.all()[0].id), }, -1, From e1b3376849a06f7a7b158e06efd5cb1efdb06626 Mon Sep 17 00:00:00 2001 From: Mohamed-Hacene Date: Mon, 12 Feb 2024 16:01:44 +0100 Subject: [PATCH 4/5] fix: requirement assessments api test during auth creation --- backend/app_tests/api/test_api_requirement_assessments.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/backend/app_tests/api/test_api_requirement_assessments.py b/backend/app_tests/api/test_api_requirement_assessments.py index 9aace25a6..646b0ed6d 100644 --- a/backend/app_tests/api/test_api_requirement_assessments.py +++ b/backend/app_tests/api/test_api_requirement_assessments.py @@ -143,6 +143,9 @@ def test_create_requirement_assessments(self, authenticated_client): "requirement": str(RequirementNode.objects.all()[0].id), "security_measures": [str(security_measure.id)], }, + { + "compliance_assessment": {"id": str(compliance_assessment.id), "str": compliance_assessment.name} + }, base_count=-1, ) @@ -186,7 +189,7 @@ def test_update_requirement_assessments(self, authenticated_client): }, { "folder": str(Folder.get_root_folder().id), - "compliance_assessment": str(compliance_assessment.id), + "compliance_assessment": {"id": str(compliance_assessment.id), "str": compliance_assessment.name}, "requirement": str(RequirementNode.objects.all()[0].id), }, ) From 1a67954569c65594000d42d8adbfbbab3fe7629d Mon Sep 17 00:00:00 2001 From: Mohamed-Hacene Date: Mon, 12 Feb 2024 16:41:19 +0100 Subject: [PATCH 5/5] fix: resolve frontend linter errors --- frontend/.eslintignore | 2 ++ frontend/.prettierignore | 2 ++ .../src/lib/components/Modals/CreateModal.svelte | 2 ++ .../components/ModelTable/LanguageDisplay.svelte | 2 +- .../lib/components/ModelTable/ModelTable.svelte | 2 +- .../TableRowActions/TableRowActions.svelte | 2 +- .../TreeView/RecursiveTreeViewItem.svelte | 4 ++-- .../fragments/WatchlistExceptions.svelte | 16 ++++++++-------- frontend/src/lib/utils/csrf.ts | 4 +++- .../[id=uuid]/+page.svelte | 2 +- .../[id=uuid]/TreeViewItemContent.svelte | 4 ++-- .../[id=uuid]/TreeViewItemLead.svelte | 2 +- .../[id=uuid]/TreeViewItemContent.svelte | 3 +++ .../src/routes/(app)/libraries/+page.server.ts | 2 +- 14 files changed, 30 insertions(+), 19 deletions(-) diff --git a/frontend/.eslintignore b/frontend/.eslintignore index 38972655f..1a5c5a0c1 100644 --- a/frontend/.eslintignore +++ b/frontend/.eslintignore @@ -6,6 +6,8 @@ node_modules .env .env.* !.env.example +/tests/reports/* +/tests/results/* # Ignore files for PNPM, NPM and YARN pnpm-lock.yaml diff --git a/frontend/.prettierignore b/frontend/.prettierignore index 38972655f..1a5c5a0c1 100644 --- a/frontend/.prettierignore +++ b/frontend/.prettierignore @@ -6,6 +6,8 @@ node_modules .env .env.* !.env.example +/tests/reports/* +/tests/results/* # Ignore files for PNPM, NPM and YARN pnpm-lock.yaml diff --git a/frontend/src/lib/components/Modals/CreateModal.svelte b/frontend/src/lib/components/Modals/CreateModal.svelte index 340065181..8d7fe949a 100644 --- a/frontend/src/lib/components/Modals/CreateModal.svelte +++ b/frontend/src/lib/components/Modals/CreateModal.svelte @@ -33,6 +33,8 @@ {$modalStore[0].title ?? '(title missing)'}
    -{@html display} +{display} diff --git a/frontend/src/lib/components/ModelTable/ModelTable.svelte b/frontend/src/lib/components/ModelTable/ModelTable.svelte index 208dc108a..d72f98e61 100644 --- a/frontend/src/lib/components/ModelTable/ModelTable.svelte +++ b/frontend/src/lib/components/ModelTable/ModelTable.svelte @@ -77,7 +77,7 @@ if (['Enter', 'Space'].includes(event.code)) onRowClick(event, rowIndex); } - export let identifierField: string = 'id'; + export let identifierField = 'id'; export let deleteForm: SuperValidated | undefined = undefined; diff --git a/frontend/src/lib/components/TableRowActions/TableRowActions.svelte b/frontend/src/lib/components/TableRowActions/TableRowActions.svelte index bbd2a0c72..cfcc90891 100644 --- a/frontend/src/lib/components/TableRowActions/TableRowActions.svelte +++ b/frontend/src/lib/components/TableRowActions/TableRowActions.svelte @@ -17,7 +17,7 @@ export let editURL: string | undefined; export let deleteForm: SuperValidated | undefined; export let URLModel: urlModel | string | undefined; - export let identifierField: string = 'id'; + export let identifierField = 'id'; export let hasBody = false; diff --git a/frontend/src/lib/components/TreeView/RecursiveTreeViewItem.svelte b/frontend/src/lib/components/TreeView/RecursiveTreeViewItem.svelte index 97a69d79b..38a1f6d33 100644 --- a/frontend/src/lib/components/TreeView/RecursiveTreeViewItem.svelte +++ b/frontend/src/lib/components/TreeView/RecursiveTreeViewItem.svelte @@ -151,13 +151,13 @@ }} > {#if typeof node.content === 'string'} - {@html node.content} + {node.content} {:else} {/if} {#if typeof node.lead === 'string'} - {@html node.lead} + {node.lead} {:else} {/if} diff --git a/frontend/src/lib/components/fragments/WatchlistExceptions.svelte b/frontend/src/lib/components/fragments/WatchlistExceptions.svelte index 3df630c49..98e3538f9 100644 --- a/frontend/src/lib/components/fragments/WatchlistExceptions.svelte +++ b/frontend/src/lib/components/fragments/WatchlistExceptions.svelte @@ -43,21 +43,21 @@ request_path )}'" > - + {#if acceptance.approver == user.id && acceptance.state == 'submitted'} action requested {/if} {acceptance.name} - - + + {acceptance.folder.str} - - + + {acceptance.approver.str} - - + + {#if acceptanceState(acceptance.expiry_date) === 'expired'} expired {:else if acceptanceState(acceptance.expiry_date) === 'upcoming'} @@ -66,7 +66,7 @@ today {/if} {formatStringToDate(acceptance.expiry_date)} - + {/each} {:else} diff --git a/frontend/src/lib/utils/csrf.ts b/frontend/src/lib/utils/csrf.ts index ea42c2573..b817397a7 100644 --- a/frontend/src/lib/utils/csrf.ts +++ b/frontend/src/lib/utils/csrf.ts @@ -6,7 +6,9 @@ async function getCsrfToken() { credentials: 'include' }).then((res) => res.json()); return response.csrfToken; - } catch (error) {} + } catch (error) { + console.error(error); + } } export const csrfToken = await getCsrfToken(); 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 9503b8f77..5a4be3880 100644 --- a/frontend/src/routes/(app)/compliance-assessments/[id=uuid]/+page.svelte +++ b/frontend/src/routes/(app)/compliance-assessments/[id=uuid]/+page.svelte @@ -49,7 +49,7 @@ if (node.children && Object.keys(node.children).length > 0) { for (const childId in node.children) { - if (node.children.hasOwnProperty(childId)) { + if (Object.prototype.hasOwnProperty.call(node.children, childId)) { const childNode = node.children[childId]; countStatus(childNode, statusCounts); } 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 e1ed2a83c..24bda2ce2 100644 --- a/frontend/src/routes/(app)/compliance-assessments/[id=uuid]/TreeViewItemContent.svelte +++ b/frontend/src/routes/(app)/compliance-assessments/[id=uuid]/TreeViewItemContent.svelte @@ -10,7 +10,7 @@ export let security_functions: Record[] | undefined = undefined; export let children: Record> | undefined = undefined; export let canEditRequirementAssessment: boolean; - export let status: string | undefined = undefined; + // export let status: string | undefined = undefined; export let statusCounts: Record | undefined; $: hasChildren = children && Object.keys(children).length > 0; @@ -87,7 +87,7 @@ {#if threats || security_functions}
    (showInfo = !showInfo)} on:keydown={(_) => (showInfo = !showInfo)} 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 d6f5857a3..4106c9430 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,5 @@