Skip to content

Commit

Permalink
Merge pull request #2096 from navikt/feature/prompt-meldingcontainer
Browse files Browse the repository at this point in the history
[KAIZEN-0] Vis prompt om man prøver å navigere bort fra meldingscontainer om melding blir sendt
  • Loading branch information
Jesperpaulsen authored Jan 11, 2024
2 parents 9203876 + d4d48ae commit d4193d4
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ import journalsakResource from '../../../../rest/resources/journalsakResource';
import SendNyMelding, { OppgavelisteValg, SendNyMeldingState } from './SendNyMelding';
import useFeatureToggle from '../../../../components/featureToggle/useFeatureToggle';
import { FeatureToggles } from '../../../../components/featureToggle/toggleIDs';
import { Prompt } from 'react-router';
import IfFeatureToggleOn from '../../../../components/featureToggle/IfFeatureToggleOn';

interface Props {
defaultOppgaveDestinasjon: OppgavelisteValg;
Expand Down Expand Up @@ -204,14 +206,24 @@ function SendNyMeldingContainer(props: Props) {
};

return (
<SendNyMelding
updateState={updateState}
state={state}
handleSubmit={handleSubmit}
handleAvbryt={handleAvbryt}
formErEndret={state !== initialState}
sendNyMeldingPanelState={sendNyMeldingStatus}
/>
<>
<IfFeatureToggleOn toggleID={FeatureToggles.VisPromptMeldingSending}>
<Prompt
when={sendNyMeldingStatus.type === SendNyMeldingStatus.POSTING}
message={
'Meldingen sendes. Hvis du navigerer bort er det ikke sikkert den blir sendt. Er du sikker på at du vil fortsette?'
}
/>
</IfFeatureToggleOn>
<SendNyMelding
updateState={updateState}
state={state}
handleSubmit={handleSubmit}
handleAvbryt={handleAvbryt}
formErEndret={state !== initialState}
sendNyMeldingPanelState={sendNyMeldingStatus}
/>
</>
);
}

Expand Down
4 changes: 2 additions & 2 deletions src/components/featureToggle/toggleIDs.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export enum FeatureToggles {
BrukSoknadsstatus = 'modiapersonoversikt.soknadsstatus-api',
BrukWebworkerPaaInnLogging = 'modiapersonoversikt.web-worker-paa-innlogging',
DebugMeldingsFunksjonalitet = 'modiapersonoversikt.ny-send-melding-container',
IkkeFnrIPath = 'modiapersonoversikt.ikke-fnr-i-path'
IkkeFnrIPath = 'modiapersonoversikt.ikke-fnr-i-path',
VisPromptMeldingSending = 'modiapersonoversikt.vis-promt-naar-melding-sendes'
}

0 comments on commit d4193d4

Please sign in to comment.