Skip to content

Commit 0bd006f

Browse files
authored
IS-2867: Move dialogmelding to tredeling (#1653)
1 parent dc6b7a6 commit 0bd006f

File tree

12 files changed

+34
-90
lines changed

12 files changed

+34
-90
lines changed

src/components/behandler/VelgBehandler.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ export const VelgBehandler = ({
5151
legend={legend}
5252
name="behandlerRef"
5353
error={fieldState.error?.message}
54+
size="small"
5455
>
5556
{behandlere.map((behandler, index) => (
5657
<Radio

src/mocks/isbehandlerdialog/mockIsbehandlerdialog.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const replaceNumberInString = (originalString: string, searchValue: string) => {
1818

1919
export const mockIsbehandlerdialog = [
2020
http.get(`${ISBEHANDLERDIALOG_ROOT}/melding`, () => {
21-
return HttpResponse.json(behandlerdialogMock);
21+
return HttpResponse.json(behandlerdialogMockData);
2222
}),
2323
http.get(`${ISBEHANDLERDIALOG_ROOT}/melding/:uuid/:vedleggNumber/pdf`, () => {
2424
return HttpResponse.text("PDF");

src/sider/TredeltSide.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export function SecondColumn({ children, className }: Props) {
4343
return (
4444
<div
4545
className={
46-
"xl:flex-grow-[2] xl:flex-shrink-1 xl:basis-0 xl:h-screen xl:sticky xl:top-2 xl:overflow-y-scroll " +
46+
"xl:flex-grow-[2] xl:flex-shrink-1 xl:basis-0 xl:h-screen xl:sticky xl:top-2 xl:overflow-y-scroll -xl:mt-2 " +
4747
className
4848
}
4949
>

src/sider/behandlerdialog/BehandlerdialogContainer.tsx

+14-7
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,30 @@
11
import React, { ReactElement } from "react";
22
import Side from "@/sider/Side";
3-
import Sidetopp from "@/components/Sidetopp";
43
import SideLaster from "@/components/SideLaster";
5-
import { BehandlerdialogSide } from "@/sider/behandlerdialog/BehandlerdialogSide";
64
import { Menypunkter } from "@/components/globalnavigasjon/GlobalNavigasjon";
5+
import * as Tredelt from "@/sider/TredeltSide";
6+
import { MeldingTilBehandler } from "@/sider/behandlerdialog/meldingtilbehandler/MeldingTilBehandler";
7+
import { Meldinger } from "@/sider/behandlerdialog/meldinger/Meldinger";
8+
import { useBehandlerdialogQuery } from "@/data/behandlerdialog/behandlerdialogQueryHooks";
79

810
const texts = {
911
title: "Dialog med behandler",
1012
};
1113

1214
export const BehandlerdialogContainer = (): ReactElement => {
13-
const henter = false;
14-
const hentingFeilet = false;
15+
const { isLoading, isError } = useBehandlerdialogQuery();
1516

1617
return (
1718
<Side tittel={texts.title} aktivtMenypunkt={Menypunkter.BEHANDLERDIALOG}>
18-
<SideLaster henter={henter} hentingFeilet={hentingFeilet}>
19-
<Sidetopp tittel={texts.title} />
20-
<BehandlerdialogSide />
19+
<SideLaster henter={isLoading} hentingFeilet={isError}>
20+
<Tredelt.Container>
21+
<Tredelt.FirstColumn>
22+
<Meldinger />
23+
</Tredelt.FirstColumn>
24+
<Tredelt.SecondColumn>
25+
<MeldingTilBehandler />
26+
</Tredelt.SecondColumn>
27+
</Tredelt.Container>
2128
</SideLaster>
2229
</Side>
2330
);

src/sider/behandlerdialog/BehandlerdialogSide.tsx

-25
This file was deleted.

src/sider/behandlerdialog/legeerklaring/ReturLegeerklaring.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ export const ReturLegeerklaring = ({ melding }: ReturLegeerklaringProps) => {
6969
setVisReturModal(true);
7070
returLegeerklaring.reset();
7171
}}
72+
size="small"
7273
>
7374
{texts.button}
7475
</Button>
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from "react";
2-
import { Heading } from "@navikt/ds-react";
2+
import { Box, Heading } from "@navikt/ds-react";
33
import { Samtaler } from "@/sider/behandlerdialog/meldinger/Samtaler";
44
import BehandleBehandlerdialogSvarOppgaveKnapp from "@/sider/behandlerdialog/meldinger/BehandleBehandlerdialogSvarOppgaveKnapp";
55

@@ -9,12 +9,12 @@ export const texts = {
99

1010
export const Meldinger = () => {
1111
return (
12-
<>
12+
<Box background="surface-default" className="p-4">
1313
<Heading level="2" size="medium" spacing>
1414
{texts.header}
1515
</Heading>
1616
<BehandleBehandlerdialogSvarOppgaveKnapp />
1717
<Samtaler />
18-
</>
18+
</Box>
1919
);
2020
};
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,23 @@
11
import React from "react";
22
import { MeldingTilBehandlerSkjema } from "@/sider/behandlerdialog/meldingtilbehandler/MeldingTilBehandlerSkjema";
3-
import { Alert, Heading } from "@navikt/ds-react";
4-
import styled from "styled-components";
3+
import { Alert, Box, Heading } from "@navikt/ds-react";
54

65
const texts = {
76
header: "Skriv til behandler",
87
alertInfo:
9-
"Dialogmeldingen skal bare benyttes i sykefraværsoppfølgingen. Meldingen vises til innbyggeren på Min side.",
8+
"Dialogmeldingen skal kun benyttes i sykefraværsoppfølgingen. Meldingen vises til innbyggeren på Min side.",
109
};
1110

12-
const MeldingTilBehandlerAlert = styled(Alert)`
13-
max-width: fit-content;
14-
margin-bottom: 1.5em;
15-
16-
.navds-alert__wrapper {
17-
max-width: fit-content;
18-
}
19-
`;
20-
2111
export const MeldingTilBehandler = () => {
2212
return (
23-
<>
24-
<Heading level="2" size="medium" spacing>
13+
<Box background="surface-default" className="p-4 flex flex-col gap-4">
14+
<Heading level="2" size="medium">
2515
{texts.header}
2616
</Heading>
27-
<MeldingTilBehandlerAlert variant="warning" size="small">
17+
<Alert variant="warning" size="small" inline>
2818
{texts.alertInfo}
29-
</MeldingTilBehandlerAlert>
19+
</Alert>
3020
<MeldingTilBehandlerSkjema />
31-
</>
21+
</Box>
3222
);
3323
};

src/sider/behandlerdialog/meldingtilbehandler/MeldingTilBehandlerSkjema.tsx

+3
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ export const MeldingTilBehandlerSkjema = () => {
9191
<Select
9292
id="type"
9393
className="mb-4"
94+
size="small"
9495
label={texts.meldingsType.label}
9596
{...register("meldingsType", { required: true })}
9697
value={watch("meldingsType")}
@@ -121,6 +122,8 @@ export const MeldingTilBehandlerSkjema = () => {
121122
})}
122123
maxLength={MAX_LENGTH_BEHANDLER_MELDING}
123124
error={meldingTekstErrorMessage}
125+
size="small"
126+
minRows={4}
124127
/>
125128
<ForhandsvisningModal
126129
contentLabel={texts.previewContentLabel}

src/sider/behandlerdialog/paminnelse/PaminnelseMelding.tsx

+2
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ export const PaminnelseMelding = ({
6262
<div className="flex gap-4">
6363
<Button
6464
icon={<BellIcon aria-hidden />}
65+
size="small"
6566
onClick={() => {
6667
setVisPaminnelseModal(true);
6768
paminnelseTilBehandler.reset();
@@ -72,6 +73,7 @@ export const PaminnelseMelding = ({
7273
</Button>
7374
<Button
7475
variant="secondary"
76+
size="small"
7577
loading={behandleOppgave.isPending}
7678
onClick={handleFjernOppgaveClick}
7779
>

test/behandlerdialog/BehandlerdialogSideTest.tsx

-35
This file was deleted.

test/behandlerdialog/MeldingTilBehandlerTest.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ describe("MeldingTilBehandler", () => {
5050
renderMeldingTilBehandler();
5151

5252
const alertText =
53-
"Dialogmeldingen skal bare benyttes i sykefraværsoppfølgingen. Meldingen vises til innbyggeren på Min side.";
53+
"Dialogmeldingen skal kun benyttes i sykefraværsoppfølgingen. Meldingen vises til innbyggeren på Min side.";
5454

5555
expect(screen.getByRole("heading", { name: "Skriv til behandler" })).to
5656
.exist;

0 commit comments

Comments
 (0)