diff --git a/frontend/src/lib/utils/table.ts b/frontend/src/lib/utils/table.ts index 439412bff..0428be0b4 100644 --- a/frontend/src/lib/utils/table.ts +++ b/frontend/src/lib/utils/table.ts @@ -93,11 +93,11 @@ export const listViewFields = { body: ['ref_id', 'name', 'description', 'framework'], meta: ['id', 'urn'] }, - "stored-libraries": { + 'stored-libraries': { head: ['ref', 'name', 'description', 'language', 'overview'], body: ['ref_id', 'name', 'description', 'locale', 'overview'] }, - "loaded-libraries": { + 'loaded-libraries': { head: ['ref', 'name', 'description', 'language', 'overview'], body: ['ref_id', 'name', 'description', 'locale', 'overview'] } diff --git a/frontend/src/routes/(app)/libraries/[id=urn]/+server.ts b/frontend/src/routes/(app)/libraries/[id=urn]/+server.ts index e77b95394..d07c79e6f 100644 --- a/frontend/src/routes/(app)/libraries/[id=urn]/+server.ts +++ b/frontend/src/routes/(app)/libraries/[id=urn]/+server.ts @@ -4,8 +4,8 @@ import { error, type NumericRange } from '@sveltejs/kit'; import type { RequestHandler } from './$types'; export const GET: RequestHandler = async ({ fetch, url, params }) => { - const isLoaded = url.searchParams.has("loaded"); - const URLModel = isLoaded ? "loaded-libraries" : "stored-libraries"; + const isLoaded = url.searchParams.has('loaded'); + const URLModel = isLoaded ? 'loaded-libraries' : 'stored-libraries'; const endpoint = `${BASE_API_URL}/${URLModel}/${params.id}/`; const res = await fetch(endpoint); diff --git a/frontend/src/routes/(app)/libraries/[id=urn]/tree/+server.ts b/frontend/src/routes/(app)/libraries/[id=urn]/tree/+server.ts index e63dc91b4..3ccf59a81 100644 --- a/frontend/src/routes/(app)/libraries/[id=urn]/tree/+server.ts +++ b/frontend/src/routes/(app)/libraries/[id=urn]/tree/+server.ts @@ -4,7 +4,7 @@ import { error, type NumericRange } from '@sveltejs/kit'; import type { RequestHandler } from './$types'; export const GET: RequestHandler = async ({ fetch, params, url }) => { - const URLModel = url.searchParams.has("loaded") ? "loaded-libraries" : "stored-libraries"; + const URLModel = url.searchParams.has('loaded') ? 'loaded-libraries' : 'stored-libraries'; const endpoint = `${BASE_API_URL}/${URLModel}/${params.id}/tree`; const res = await fetch(endpoint); diff --git a/frontend/tests/utils/test-data.ts b/frontend/tests/utils/test-data.ts index 123944438..9890b9262 100644 --- a/frontend/tests/utils/test-data.ts +++ b/frontend/tests/utils/test-data.ts @@ -24,165 +24,165 @@ export default { analyst: { name: 'Analyst', perms: [ - "add_project", - "view_project", - "change_project", - "delete_project", - "add_riskassessment", - "view_riskassessment", - "change_riskassessment", - "delete_riskassessment", - "add_appliedcontrol", - "view_appliedcontrol", - "change_appliedcontrol", - "delete_appliedcontrol", - "add_policy", - "view_policy", - "change_policy", - "delete_policy", - "add_riskscenario", - "view_riskscenario", - "change_riskscenario", - "delete_riskscenario", - "add_riskacceptance", - "view_riskacceptance", - "change_riskacceptance", - "delete_riskacceptance", - "add_complianceassessment", - "view_complianceassessment", - "change_complianceassessment", - "delete_complianceassessment", - "view_requirementassessment", - "change_requirementassessment", - "add_evidence", - "view_evidence", - "change_evidence", - "delete_evidence", - "add_asset", - "view_asset", - "change_asset", - "delete_asset", - "add_threat", - "view_threat", - "change_threat", - "delete_threat", - "view_referencecontrol", - "view_folder", - "view_usergroup", - "view_riskmatrix", - "view_requirementnode", - "view_framework", - "view_loadedlibrary", - "view_user", + 'add_project', + 'view_project', + 'change_project', + 'delete_project', + 'add_riskassessment', + 'view_riskassessment', + 'change_riskassessment', + 'delete_riskassessment', + 'add_appliedcontrol', + 'view_appliedcontrol', + 'change_appliedcontrol', + 'delete_appliedcontrol', + 'add_policy', + 'view_policy', + 'change_policy', + 'delete_policy', + 'add_riskscenario', + 'view_riskscenario', + 'change_riskscenario', + 'delete_riskscenario', + 'add_riskacceptance', + 'view_riskacceptance', + 'change_riskacceptance', + 'delete_riskacceptance', + 'add_complianceassessment', + 'view_complianceassessment', + 'change_complianceassessment', + 'delete_complianceassessment', + 'view_requirementassessment', + 'change_requirementassessment', + 'add_evidence', + 'view_evidence', + 'change_evidence', + 'delete_evidence', + 'add_asset', + 'view_asset', + 'change_asset', + 'delete_asset', + 'add_threat', + 'view_threat', + 'change_threat', + 'delete_threat', + 'view_referencecontrol', + 'view_folder', + 'view_usergroup', + 'view_riskmatrix', + 'view_requirementnode', + 'view_framework', + 'view_loadedlibrary', + 'view_user' ] }, reader: { name: 'Reader', perms: [ - "view_project", - "view_riskassessment", - "view_appliedcontrol", - "view_policy", - "view_riskscenario", - "view_riskacceptance", - "view_asset", - "view_threat", - "view_referencecontrol", - "view_folder", - "view_usergroup", - "view_riskmatrix", - "view_complianceassessment", - "view_requirementassessment", - "view_requirementnode", - "view_evidence", - "view_framework", - "view_loadedlibrary", - "view_user", + 'view_project', + 'view_riskassessment', + 'view_appliedcontrol', + 'view_policy', + 'view_riskscenario', + 'view_riskacceptance', + 'view_asset', + 'view_threat', + 'view_referencecontrol', + 'view_folder', + 'view_usergroup', + 'view_riskmatrix', + 'view_complianceassessment', + 'view_requirementassessment', + 'view_requirementnode', + 'view_evidence', + 'view_framework', + 'view_loadedlibrary', + 'view_user' ] }, domainManager: { name: 'Domain manager', perms: [ - "change_usergroup", - "view_usergroup", - "add_project", - "change_project", - "delete_project", - "view_project", - "add_riskassessment", - "view_riskassessment", - "change_riskassessment", - "delete_riskassessment", - "add_appliedcontrol", - "view_appliedcontrol", - "change_appliedcontrol", - "delete_appliedcontrol", - "add_policy", - "view_policy", - "change_policy", - "delete_policy", - "add_riskscenario", - "view_riskscenario", - "change_riskscenario", - "delete_riskscenario", - "add_riskacceptance", - "view_riskacceptance", - "change_riskacceptance", - "delete_riskacceptance", - "add_asset", - "view_asset", - "change_asset", - "delete_asset", - "add_threat", - "view_threat", - "change_threat", - "delete_threat", - "view_referencecontrol", - "view_folder", - "change_folder", - "add_riskmatrix", - "view_riskmatrix", - "change_riskmatrix", - "delete_riskmatrix", - "add_complianceassessment", - "view_complianceassessment", - "change_complianceassessment", - "delete_complianceassessment", - "view_requirementassessment", - "change_requirementassessment", - "add_evidence", - "view_evidence", - "change_evidence", - "delete_evidence", - "view_requirementnode", - "view_framework", - "view_loadedlibrary", - "view_user", + 'change_usergroup', + 'view_usergroup', + 'add_project', + 'change_project', + 'delete_project', + 'view_project', + 'add_riskassessment', + 'view_riskassessment', + 'change_riskassessment', + 'delete_riskassessment', + 'add_appliedcontrol', + 'view_appliedcontrol', + 'change_appliedcontrol', + 'delete_appliedcontrol', + 'add_policy', + 'view_policy', + 'change_policy', + 'delete_policy', + 'add_riskscenario', + 'view_riskscenario', + 'change_riskscenario', + 'delete_riskscenario', + 'add_riskacceptance', + 'view_riskacceptance', + 'change_riskacceptance', + 'delete_riskacceptance', + 'add_asset', + 'view_asset', + 'change_asset', + 'delete_asset', + 'add_threat', + 'view_threat', + 'change_threat', + 'delete_threat', + 'view_referencecontrol', + 'view_folder', + 'change_folder', + 'add_riskmatrix', + 'view_riskmatrix', + 'change_riskmatrix', + 'delete_riskmatrix', + 'add_complianceassessment', + 'view_complianceassessment', + 'change_complianceassessment', + 'delete_complianceassessment', + 'view_requirementassessment', + 'change_requirementassessment', + 'add_evidence', + 'view_evidence', + 'change_evidence', + 'delete_evidence', + 'view_requirementnode', + 'view_framework', + 'view_loadedlibrary', + 'view_user' ] }, approver: { name: 'Approver', perms: [ - "view_project", - "view_riskassessment", - "view_appliedcontrol", - "view_policy", - "view_riskscenario", - "view_riskacceptance", - "approve_riskacceptance", - "view_asset", - "view_threat", - "view_referencecontrol", - "view_folder", - "view_usergroup", - "view_riskmatrix", - "view_complianceassessment", - "view_requirementassessment", - "view_requirementnode", - "view_evidence", - "view_framework", - "view_loadedlibrary", - "view_user", + 'view_project', + 'view_riskassessment', + 'view_appliedcontrol', + 'view_policy', + 'view_riskscenario', + 'view_riskacceptance', + 'approve_riskacceptance', + 'view_asset', + 'view_threat', + 'view_referencecontrol', + 'view_folder', + 'view_usergroup', + 'view_riskmatrix', + 'view_complianceassessment', + 'view_requirementassessment', + 'view_requirementnode', + 'view_evidence', + 'view_framework', + 'view_loadedlibrary', + 'view_user' ] } },