From 2cec247d48ee676155fd6ed0ee2f002d11a5512d Mon Sep 17 00:00:00 2001 From: Nassim Tabchiche Date: Mon, 26 Feb 2024 18:13:02 +0100 Subject: [PATCH 1/4] Fix policies crud metadata --- frontend/src/lib/utils/crud.ts | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/frontend/src/lib/utils/crud.ts b/frontend/src/lib/utils/crud.ts index 7fa0fdddb..29a2b7206 100644 --- a/frontend/src/lib/utils/crud.ts +++ b/frontend/src/lib/utils/crud.ts @@ -190,6 +190,26 @@ export const URL_MODEL_MAP: ModelMap = { { field: 'folder' } ] }, + policies: { + name: 'securitymeasure', + localName: 'policy', + localNamePlural: 'policies', + localFrGender: 'f', + verboseName: 'Policy', + verboseNamePlural: 'Policies', + foreignKeyFields: [ + { field: 'security_function', urlModel: 'security-functions' }, + { field: 'folder', urlModel: 'folders' }, + { field: 'evidences', urlModel: 'evidences' } + ], + selectFields: [{ field: 'status' }, { field: 'effort' }], + filters: [ + { field: 'security_function' }, + { field: 'status' }, + { field: 'effort' }, + { field: 'folder' } + ] + }, 'risk-acceptances': { name: 'riskacceptance', localName: 'riskAcceptance', From ae8026b866df697c0b68f9b05b59fc199e7906c0 Mon Sep 17 00:00:00 2001 From: Nassim Tabchiche Date: Mon, 26 Feb 2024 18:13:12 +0100 Subject: [PATCH 2/4] Fix select component --- frontend/src/lib/components/Forms/Select.svelte | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/lib/components/Forms/Select.svelte b/frontend/src/lib/components/Forms/Select.svelte index 3c0b13da0..ed218b494 100644 --- a/frontend/src/lib/components/Forms/Select.svelte +++ b/frontend/src/lib/components/Forms/Select.svelte @@ -55,8 +55,8 @@ {...$constraints} {...$$restProps} > - {#if !$constraints?.required} - + {#if !$constraints?.required && !options.find((o) => o.label === '--')} + {/if} {#each options as option}