From a520a4fea8793cba23d4a9a97908844e9a12efe4 Mon Sep 17 00:00:00 2001 From: stigus Date: Wed, 2 Oct 2024 10:11:32 +0200 Subject: [PATCH] * Dolly frontend mer oppsett for Fullmakt --- .../fagsystem/fullmakt/form/FullmaktForm.tsx | 10 +++++++++- .../src/main/js/src/components/ui/panel/Panel.tsx | 2 +- .../src/main/js/src/service/SelectOptions.tsx | 1 + 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/apps/dolly-frontend/src/main/js/src/components/fagsystem/fullmakt/form/FullmaktForm.tsx b/apps/dolly-frontend/src/main/js/src/components/fagsystem/fullmakt/form/FullmaktForm.tsx index 857ac6342b0..5ae7e677971 100644 --- a/apps/dolly-frontend/src/main/js/src/components/fagsystem/fullmakt/form/FullmaktForm.tsx +++ b/apps/dolly-frontend/src/main/js/src/components/fagsystem/fullmakt/form/FullmaktForm.tsx @@ -144,6 +144,14 @@ export const Fullmakt = ({ label="Handling" options={Options('fullmaktHandling')} size="grow" + onChange={(val: Option[]) => { + formMethods.setValue( + `${path}.handling`, + val?.some((opt) => opt.value?.includes('*')) + ? alleHandlinger + : val.map((opt) => opt.value), + ) + }} isClearable={true} isMulti={true} /> @@ -158,7 +166,7 @@ export const Fullmakt = ({ eksisterendePersonPath={`${path}.motpartsPersonident`} label={'FULLMEKTIG'} formMethods={formMethods} - isExpanded={isTestnorgeIdent || formMethods.watch(`${path}.motpartsPersonident`) !== null} + isExpanded={isTestnorgeIdent || !!formMethods.watch(`${path}.motpartsPersonident`)} toggleExpansion={!isTestnorgeIdent} eksisterendeNyPerson={eksisterendeNyPerson} /> diff --git a/apps/dolly-frontend/src/main/js/src/components/ui/panel/Panel.tsx b/apps/dolly-frontend/src/main/js/src/components/ui/panel/Panel.tsx index 129f2b79137..23a7b095163 100644 --- a/apps/dolly-frontend/src/main/js/src/components/ui/panel/Panel.tsx +++ b/apps/dolly-frontend/src/main/js/src/components/ui/panel/Panel.tsx @@ -21,7 +21,7 @@ export default function Panel({ checkAttributeArray = null, uncheckAttributeArray = null, informasjonstekst = null, - iconType = null, + iconType = null as unknown as string, forceOpen = false, setPanelOpen = null, }) { diff --git a/apps/dolly-frontend/src/main/js/src/service/SelectOptions.tsx b/apps/dolly-frontend/src/main/js/src/service/SelectOptions.tsx index 462e88073a7..ec58dce3c3d 100644 --- a/apps/dolly-frontend/src/main/js/src/service/SelectOptions.tsx +++ b/apps/dolly-frontend/src/main/js/src/service/SelectOptions.tsx @@ -604,6 +604,7 @@ const selectOptions = { ], fullmaktHandling: [ + { value: '*', label: 'Alle' }, { value: 'LES', label: 'Les' }, { value: 'KOMMUNISER', label: 'Kommuniser' }, { value: 'SKRIV', label: 'Skriv' },