Skip to content

Commit

Permalink
Julesøknad og flexjar (#2935)
Browse files Browse the repository at this point in the history
  • Loading branch information
heyvard authored Nov 11, 2024
1 parent ae109e8 commit f7d2eb3
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 8 deletions.
10 changes: 7 additions & 3 deletions src/components/flexjar/flexjar-kvittering.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ export const FlexjarKvittering = () => {
const { valgtSoknad } = useSoknadMedDetaljer()

const feedbackId = 'sykepengesoknad-kvittering'
const feedbackProps: Record<string, string | undefined | boolean> = {
soknadstype: valgtSoknad?.soknadstype.toString(),
}
if (valgtSoknad?.julesoknad) {
feedbackProps['julesøknad'] = true
}
return (
<EmojiFlexjar
feedbackId={feedbackId}
Expand All @@ -20,9 +26,7 @@ export const FlexjarKvittering = () => {
getPlaceholder={() => 'Fortell oss om din opplevelse (valgfritt)'}
flexjarsporsmal="Hvordan opplevde du denne søknaden?"
flexjartittel="Hjelp oss med å gjøre søknaden bedre"
feedbackProps={{
soknadstype: valgtSoknad?.soknadstype.toString(),
}}
feedbackProps={feedbackProps}
/>
)
}
12 changes: 8 additions & 4 deletions src/components/flexjar/flexjar-sporsmal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@ export const FlexjarSporsmal = ({ soknad, sporsmal, steg }: FlexjarSporsmalProps
}

const feedbackId = 'sykepengesoknad-sporsmal'
const feedbackProps: Record<string, string | undefined | boolean> = {
soknadstype: soknad?.soknadstype.toString(),
sporsmal: sporsmal?.tag.toString(),
}
if (soknad?.julesoknad) {
feedbackProps['julesøknad'] = true
}
return (
<FlexjarFelles
feedbackId={feedbackId}
Expand All @@ -55,10 +62,7 @@ export const FlexjarSporsmal = ({ soknad, sporsmal, steg }: FlexjarSporsmalProps
thanksFeedback={thanksFeedback}
setThanksFeedback={setThanksFeedback}
getPlaceholder={getPlaceholder}
feedbackProps={{
soknadstype: soknad?.soknadstype.toString(),
sporsmal: sporsmal?.tag.toString(),
}}
feedbackProps={feedbackProps}
textRequired={activeState === 'FORBEDRING' || activeState === 'NEI'}
flexjartittel="Hjelp oss med å gjøre søknaden bedre"
flexjarsporsmal="Opplever du at du har nok informasjon til å svare på dette spørsmålet?"
Expand Down
2 changes: 1 addition & 1 deletion src/components/kvittering/kvittering-side.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ const KvitteringSide = () => {
const skalViseFlexjar =
!skalViseSelvstendigNaeringsdrivendeUxSignals &&
!skalViseUxSignals &&
(flexjarToggle.enabled || valgtSoknad.soknadstype === RSSoknadstype.OPPHOLD_UTLAND)
(flexjarToggle.enabled || valgtSoknad.julesoknad)

return (
<>
Expand Down
1 change: 1 addition & 0 deletions src/components/soknad/soknaden.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ export const Soknaden = () => {
</Button>
)}
{(flexjarToggle.enabled ||
valgtSoknad?.julesoknad ||
sporsmal?.tag == 'INNTEKTSOPPLYSNINGER_DRIFT_VIRKSOMHETEN' ||
sporsmal?.tag == 'INNTEKTSOPPLYSNINGER_VIRKSOMHETEN_AVVIKLET' ||
sporsmal?.tag == 'MEDLEMSKAP_OPPHOLDSTILLATELSE_V2' ||
Expand Down
1 change: 1 addition & 0 deletions src/types/mapping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,5 +128,6 @@ export function rsToSoknad(soknad: RSSoknad): Soknad {
soknad.inntektsopplysningerInnsendingId,
soknad.inntektsopplysningerInnsendingDokumenter,
kjentOppholdstillatelse,
soknad.julesoknad,
)
}
1 change: 1 addition & 0 deletions src/types/rs-types/rs-soknad.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,5 @@ export interface RSSoknad {
inntektsopplysningerInnsendingId?: string
inntektsopplysningerInnsendingDokumenter?: string[]
kjentOppholdstillatelse?: RSKjentOppholdstillatelse
julesoknad?: boolean
}
1 change: 1 addition & 0 deletions src/types/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export class Soknad extends ObjectCopier {
readonly inntektsopplysningerInnsendingId?: string,
readonly inntektsopplysningerInnsendingDokumenter?: string[],
readonly kjentOppholdstillatelse?: KjentOppholdstillatelse,
readonly julesoknad?: boolean,
) {
super()
}
Expand Down

0 comments on commit f7d2eb3

Please sign in to comment.