Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update plate #782

Draft
wants to merge 27 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
ce4c486
Collaboration
eriksson-daniel Sep 10, 2024
7578416
Revert "Collaboration"
eriksson-daniel Sep 11, 2024
3e06d28
Keep Redis
eriksson-daniel Sep 11, 2024
f4d8498
Required update
eriksson-daniel Sep 11, 2024
5a2815c
Handle/ignore time in date only formatting
cskrov Sep 16, 2024
79ee66c
Support new oppgave type: Ny behandling etter TR har opphevet
eriksson-daniel Sep 9, 2024
126d331
Collaboration
eriksson-daniel Sep 10, 2024
f82e342
Prevent editing behandling when sent to MU
cskrov Sep 23, 2024
17e0759
Reset ekstra utfall when main utfall unset
cskrov Sep 19, 2024
185a7c1
Fix Smart Document language change event
cskrov Sep 23, 2024
4b4346f
Add proxy API server timing
cskrov Sep 26, 2024
f9a20ce
Add console.error of unhandled rejection
cskrov Sep 23, 2024
ff312e3
Upgrade to Fastify v5 and update dependencies
cskrov Sep 23, 2024
baa6928
Use correct BETO part name
cskrov Sep 25, 2024
2a87dff
Behandling etter Trygderetten opphevet: Remove unnecessary fields, re…
eriksson-daniel Sep 26, 2024
f4e7749
Add saksnr search, remove name search
eriksson-daniel Sep 19, 2024
9497a85
Remove text about unassigned new oppgave for henvist from TR
cskrov Sep 26, 2024
9e7eedf
Fix bug where new redaktør text was not auto-navigated to
eriksson-daniel Sep 26, 2024
6c3755a
Include styringsenheten in list of klageenheter when setting header/f…
eriksson-daniel Sep 26, 2024
77bddc2
Oppgavebehandling: Warn user if they set a date way back in time
eriksson-daniel Sep 26, 2024
c1ada46
Reword 'Klager' to 'Den ankende part' in anke and anke i TR
eriksson-daniel Sep 26, 2024
635924b
BETONG finish: Remind user to send oppgave in Gosys if fagsystem is n…
eriksson-daniel Sep 26, 2024
2753f4b
Fix bug where creation of new regelverk would not redirect correctly …
eriksson-daniel Sep 26, 2024
4710685
Fix and improve Dockerfile lines
cskrov Sep 26, 2024
5461721
Update dependencies
cskrov Sep 30, 2024
69cf3ed
Improve comment position logic
cskrov Sep 30, 2024
d923bad
WIP: Update Plate
cskrov Sep 30, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1 +1 @@
bun 1.1.19
bun 1.1.27
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM node:22-alpine

ENV NODE_ENV production
ENV NODE_ENV=production
ENV NPM_CONFIG_CACHE=/tmp

WORKDIR /usr/src/app
Expand All @@ -10,7 +10,7 @@ COPY frontend frontend
WORKDIR /usr/src/app/server

ARG VERSION
ENV VERSION $VERSION
ENV VERSION=$VERSION

CMD node dist/server.js
CMD ["node", "dist/server.js"]
EXPOSE 8080
Binary file modified frontend/bun.lockb
Binary file not shown.
92 changes: 49 additions & 43 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,66 +11,72 @@
},
"license": "MIT",
"devDependencies": {
"@happy-dom/global-registrator": "^14.12.3",
"@types/bun": "^1.1.6",
"@types/react": "18.3.3",
"@happy-dom/global-registrator": "14.12.3",
"@types/bun": "1.1.10",
"@types/react": "18.3.10",
"@types/react-dom": "18.3.0",
"@types/react-redux": "7.1.33",
"@typescript-eslint/eslint-plugin": "8.0.1",
"@typescript-eslint/parser": "8.0.1",
"@vitejs/plugin-react": "^4.3.1",
"@types/react-redux": "7.1.34",
"@typescript-eslint/eslint-plugin": "8.7.0",
"@typescript-eslint/parser": "8.7.0",
"@vitejs/plugin-react": "4.3.2",
"css-loader": "7.1.2",
"eslint": "8.57.0",
"eslint-config-prettier": "9.1.0",
"eslint-import-resolver-typescript-bun": "^0.0.101",
"eslint-plugin-import": "2.29.1",
"eslint-plugin-jsx-a11y": "6.9.0",
"eslint-import-resolver-typescript-bun": "0.0.104",
"eslint-plugin-import": "2.30.0",
"eslint-plugin-jsx-a11y": "6.10.0",
"eslint-plugin-prefer-arrow": "1.2.3",
"eslint-plugin-prettier": "5.2.1",
"eslint-plugin-react": "7.35.0",
"eslint-plugin-react": "7.37.0",
"eslint-plugin-react-hooks": "4.6.2",
"eslint-plugin-vitest": "^0.5.4",
"jsdom": "^24.1.1",
"eslint-plugin-vitest": "0.5.4",
"jsdom": "24.1.1",
"prettier": "3.3.3",
"style-loader": "4.0.0",
"ts-loader": "9.5.1",
"typescript": "5.5.4",
"vite": "^5.4.0",
"vite-tsconfig-paths": "^5.0.0"
"typescript": "5.6.2",
"vite": "5.4.8",
"vite-tsconfig-paths": "5.0.1"
},
"dependencies": {
"@grafana/faro-react": "^1.9.0",
"@grafana/faro-web-sdk": "^1.9.0",
"@grafana/faro-web-tracing": "^1.9.0",
"@navikt/aksel-icons": "6.14.0",
"@navikt/ds-css": "6.14.0",
"@navikt/ds-react": "6.14.0",
"@grafana/faro-react": "1.10.1",
"@grafana/faro-web-sdk": "1.10.1",
"@grafana/faro-web-tracing": "1.10.1",
"@hocuspocus/provider": "2.13.6",
"@navikt/aksel-icons": "7.1.0",
"@navikt/ds-css": "7.1.0",
"@navikt/ds-react": "7.1.0",
"@navikt/fnrvalidator": "1.3.0",
"@reduxjs/toolkit": "2.2.7",
"@styled-icons/fluentui-system-regular": "10.47.0",
"@types/qs": "^6.9.15",
"@udecode/plate-alignment": "36.0.11",
"@udecode/plate-autoformat": "36.0.0",
"@udecode/plate-basic-marks": "36.0.0",
"@udecode/plate-break": "36.0.0",
"@udecode/plate-common": "36.3.4",
"@udecode/plate-font": "36.0.0",
"@udecode/plate-heading": "36.0.12",
"@udecode/plate-indent": "36.0.0",
"@udecode/plate-list": "36.0.0",
"@udecode/plate-paragraph": "36.0.0",
"@udecode/plate-resizable": "36.0.0",
"@udecode/plate-serializer-docx": "36.3.5",
"@udecode/plate-table": "34.0.0",
"qs": "^6.13.0",
"@slate-yjs/core": "1.0.2",
"@slate-yjs/react": "1.1.0",
"@styled-icons/fluentui-system-regular": "10.47.0",
"@types/qs": "6.9.16",
"@udecode/plate-alignment": "38.0.1",
"@udecode/plate-autoformat": "38.0.1",
"@udecode/plate-basic-marks": "38.0.1",
"@udecode/plate-break": "38.0.1",
"@udecode/plate-common": "38.0.6",
"@udecode/plate-cursor": "38.0.0",
"@udecode/plate-font": "38.0.1",
"@udecode/plate-heading": "38.0.12",
"@udecode/plate-indent": "38.0.1",
"@udecode/plate-layout": "^38.0.1",
"@udecode/plate-list": "38.0.1",
"@udecode/plate-resizable": "38.0.0",
"@udecode/plate-serializer-docx": "36.5.8",
"@udecode/plate-table": "38.0.8",
"@udecode/plate-yjs": "38.0.1",
"qs": "6.13.0",
"react": "18.3.1",
"react-dom": "18.3.1",
"react-redux": "9.1.2",
"react-router": "6.26.0",
"react-router-dom": "6.26.0",
"react-router": "6.26.2",
"react-router-dom": "6.26.2",
"slate": "0.103.0",
"slate-history": "0.100.0",
"slate-react": "0.107.1",
"styled-components": "6.1.12"
"slate-history": "0.109.0",
"slate-react": "0.110.1",
"styled-components": "6.1.13",
"yjs": "13.6.19"
}
}
1 change: 1 addition & 0 deletions frontend/src/bun-test-setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,5 @@ mock.module('@app/static-data/static-data', () => ({

mock.module('@app/observability', () => ({
pushError: jest.fn(),
pushLog: jest.fn(),
}));
2 changes: 2 additions & 0 deletions frontend/src/components/app/router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { ModalEnum } from '@app/components/svarbrev/row/row';
import { AccessRightsPage } from '@app/pages/access-rights/access-rights';
import { AdminPage } from '@app/pages/admin/admin';
import { AnkebehandlingPage } from '@app/pages/ankebehandling/ankebehandling';
import { BehandlingEtterTrOpphevetPage } from '@app/pages/behandling-etter-tr-opphevet/behandling-etter-tr-opphevet';
import { BunnteksterPage } from '@app/pages/bunntekster/bunntekster';
import { GodeFormuleringerPage } from '@app/pages/gode-formuleringer/gode-formuleringer';
import { KlagebehandlingPage } from '@app/pages/klagebehandling/klagebehandling';
Expand Down Expand Up @@ -33,6 +34,7 @@ export const Router = () => (
<Route path="klagebehandling/:id" element={<KlagebehandlingPage />} />
<Route path="ankebehandling/:id" element={<AnkebehandlingPage />} />
<Route path="trygderettsankebehandling/:id" element={<TrygderettsankebehandlingPage />} />
<Route path="behandling-etter-tr-opphevet/:id" element={<BehandlingEtterTrOpphevetPage />} />
</Route>

<Route element={<ProtectedRoute roles={[Role.KABAL_INNSYN_EGEN_ENHET, Role.KABAL_KROL]} />}>
Expand Down
18 changes: 10 additions & 8 deletions frontend/src/components/behandling/behandling.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Heading, Skeleton } from '@navikt/ds-react';
import { BehandlingEtterTrOpphevetDetaljer } from '@app/components/behandling/behandlingsdetaljer/behandling-etter-tr-opphevet-detaljer';
import { BehandlingSection } from '@app/components/behandling/behandlingsdetaljer/behandling-section';
import { useOppgave } from '@app/hooks/oppgavebehandling/use-oppgave';
import { useBehandlingEnabled } from '@app/hooks/settings/use-setting';
Expand Down Expand Up @@ -67,13 +68,14 @@ const Behandlingsdetaljer = () => {
);
}

if (oppgave.typeId === SaksTypeEnum.KLAGE) {
return <Klagebehandlingsdetaljer oppgavebehandling={oppgave} />;
switch (oppgave.typeId) {
case SaksTypeEnum.KLAGE:
return <Klagebehandlingsdetaljer oppgavebehandling={oppgave} />;
case SaksTypeEnum.ANKE:
return <Ankebehandlingsdetaljer oppgavebehandling={oppgave} />;
case SaksTypeEnum.ANKE_I_TRYGDERETTEN:
return <Trygderettsankebehandlingsdetaljer oppgavebehandling={oppgave} />;
case SaksTypeEnum.BEHANDLING_ETTER_TR_OPPHEVET:
return <BehandlingEtterTrOpphevetDetaljer oppgavebehandling={oppgave} />;
}

if (oppgave.typeId === SaksTypeEnum.ANKE) {
return <Ankebehandlingsdetaljer oppgavebehandling={oppgave} />;
}

return <Trygderettsankebehandlingsdetaljer oppgavebehandling={oppgave} />;
};
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { subDays } from 'date-fns';
import { ReadOnlyDate } from '@app/components/behandling/behandlingsdetaljer/read-only-date';
import { DateContainer } from '@app/components/behandling/styled-components';
import { CURRENT_YEAR_IN_CENTURY } from '@app/components/date-picker/constants';
import { DatePicker } from '@app/components/date-picker/date-picker';
import { useOppgave } from '@app/hooks/oppgavebehandling/use-oppgave';
import { useCanEdit } from '@app/hooks/use-can-edit';
import { useCanEditBehandling } from '@app/hooks/use-can-edit';
import { useFieldName } from '@app/hooks/use-field-name';
import { useValidationError } from '@app/hooks/use-validation-error';
import { useSetMottattKlageinstansMutation } from '@app/redux-api/oppgaver/mutations/behandling-dates';
Expand All @@ -12,7 +13,7 @@ import { SaksTypeEnum } from '@app/types/kodeverk';
const ID = 'anke-mottatt-dato';

export const AnkeMottattDato = () => {
const canEdit = useCanEdit();
const canEdit = useCanEditBehandling();
const { data } = useOppgave();
const error = useValidationError('mottattKlageinstans');
const label = useFieldName('mottattKlageinstans');
Expand Down Expand Up @@ -43,6 +44,7 @@ export const AnkeMottattDato = () => {
id={ID}
size="small"
centuryThreshold={CURRENT_YEAR_IN_CENTURY}
warningThreshhold={subDays(new Date(), 360)}
/>
</DateContainer>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export const Ankebehandlingsdetaljer = ({ oppgavebehandling }: Props) => {

<Part
isDeletable={false}
label="Klager"
label="Den ankende part"
part={oppgavebehandling.klager}
onChange={(klager) => updateKlager({ klager, oppgaveId: oppgavebehandling.id })}
isLoading={klagerIsLoading}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
import { Heading } from '@navikt/ds-react';
import { ExtraUtfall } from '@app/components/behandling/behandlingsdetaljer/extra-utfall';
import { GosysBeskrivelse } from '@app/components/behandling/behandlingsdetaljer/gosys/beskrivelse';
import { ReadOnlyDate } from '@app/components/behandling/behandlingsdetaljer/read-only-date';
import { Saksnummer } from '@app/components/behandling/behandlingsdetaljer/saksnummer';
import { Type } from '@app/components/type/type';
import { isoDateToPretty } from '@app/domain/date';
import { useUpdateFullmektigMutation, useUpdateKlagerMutation } from '@app/redux-api/oppgaver/mutations/behandling';
import { IBehandlingEtterTryderettenOpphevet as IBehandlingEtterTrOpphevet } from '@app/types/oppgavebehandling/oppgavebehandling';
import { Part } from '../../part/part';
import { StyledBehandlingSection } from '../styled-components';
import { BehandlingSection } from './behandling-section';
import { Lovhjemmel } from './lovhjemmel/lovhjemmel';
import { MeldingFraVedtaksinstans } from './melding-fra-vedtaksinstans';
import { UtfallResultat } from './utfall-resultat';
import { Ytelse } from './ytelse';

interface Props {
oppgavebehandling: IBehandlingEtterTrOpphevet;
}

export const BehandlingEtterTrOpphevetDetaljer = ({ oppgavebehandling }: Props) => {
const [updateFullmektig, { isLoading: fullmektigIsLoading }] = useUpdateFullmektigMutation();
const [updateKlager, { isLoading: klagerIsLoading }] = useUpdateKlagerMutation();

const {
typeId,
fraNAVEnhetNavn,
fraNAVEnhet,
kommentarFraVedtaksinstans,
oppgavebeskrivelse,
resultat,
ytelseId,
prosessfullmektig,
saksnummer,
varsletFrist,
kjennelseMottatt,
} = oppgavebehandling;

return (
<StyledBehandlingSection>
<Heading level="1" size="medium" spacing>
Behandling
</Heading>

<Part
isDeletable={false}
label="Opprinnelig klager / ankende part"
part={oppgavebehandling.klager}
onChange={(klager) => updateKlager({ klager, oppgaveId: oppgavebehandling.id })}
isLoading={klagerIsLoading}
/>

<Part
isDeletable
label="Fullmektig"
part={prosessfullmektig}
onChange={(fullmektig) => updateFullmektig({ fullmektig, oppgaveId: oppgavebehandling.id })}
isLoading={fullmektigIsLoading}
/>

<BehandlingSection label="Type">
<Type type={typeId} />
</BehandlingSection>

<BehandlingSection label="Ytelse">
<Ytelse ytelseId={ytelseId} />
</BehandlingSection>

<Saksnummer saksnummer={saksnummer} />

<ReadOnlyDate
date={kjennelseMottatt}
id="dato-for-kjennelse-mottatt-fra-trygderetten-med-utfall-opphevet"
label="Dato for kjennelse mottatt fra Trygderetten med utfall opphevet"
/>

<BehandlingSection label="Varslet frist">
{varsletFrist === null ? 'Ikke satt' : isoDateToPretty(varsletFrist)}
</BehandlingSection>

<BehandlingSection label="Anke behandlet av">
{fraNAVEnhetNavn} - {fraNAVEnhet}
</BehandlingSection>

<MeldingFraVedtaksinstans kommentarFraVedtaksinstans={kommentarFraVedtaksinstans} />

<GosysBeskrivelse oppgavebeskrivelse={oppgavebeskrivelse} />

<UtfallResultat utfall={resultat.utfallId} oppgaveId={oppgavebehandling.id} />

<ExtraUtfall
utfallIdSet={resultat.extraUtfallIdSet}
mainUtfall={resultat.utfallId}
oppgaveId={oppgavebehandling.id}
/>

<Lovhjemmel />
</StyledBehandlingSection>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { styled } from 'styled-components';
import { Dropdown } from '@app/components/filter-dropdown/dropdown';
import { isUtfall } from '@app/functions/is-utfall';
import { useOppgave } from '@app/hooks/oppgavebehandling/use-oppgave';
import { useCanEdit } from '@app/hooks/use-can-edit';
import { useCanEditBehandling } from '@app/hooks/use-can-edit';
import { useOnClickOutside } from '@app/hooks/use-on-click-outside';
import { useUtfall } from '@app/hooks/use-utfall';
import { useUpdateExtraUtfallMutation } from '@app/redux-api/oppgaver/mutations/set-utfall';
Expand All @@ -20,7 +20,7 @@ interface Props extends TagsProps {
}

export const ExtraUtfall = (props: Props) => {
const canEdit = useCanEdit();
const canEdit = useCanEditBehandling();

return (
<Container>
Expand Down Expand Up @@ -85,7 +85,7 @@ const ExtraUtfallButton = ({ utfallIdSet, mainUtfall, oppgaveId }: Props) => {
};

const ReadOnlyLabel = () => {
const canEdit = useCanEdit();
const canEdit = useCanEditBehandling();

if (canEdit) {
return null;
Expand All @@ -108,7 +108,7 @@ const TAGSCONTAINER_ID = 'tags-container';
const Tags = ({ utfallIdSet, mainUtfall }: TagsProps) => {
const { data: oppgave } = useOppgave();
const [utfallKodeverk] = useUtfall(oppgave?.typeId);
const canEdit = useCanEdit();
const canEdit = useCanEditBehandling();

return (
<>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { subDays } from 'date-fns';
import { ReadOnlyDate } from '@app/components/behandling/behandlingsdetaljer/read-only-date';
import { DateContainer } from '@app/components/behandling/styled-components';
import { CURRENT_YEAR_IN_CENTURY } from '@app/components/date-picker/constants';
import { DatePicker } from '@app/components/date-picker/date-picker';
import { useOppgave } from '@app/hooks/oppgavebehandling/use-oppgave';
import { useCanEdit } from '@app/hooks/use-can-edit';
import { useCanEditBehandling } from '@app/hooks/use-can-edit';
import { useFieldName } from '@app/hooks/use-field-name';
import { useValidationError } from '@app/hooks/use-validation-error';
import { useSetKjennelseMottattMutation } from '@app/redux-api/oppgaver/mutations/behandling-dates';
Expand All @@ -12,7 +13,7 @@ import { SaksTypeEnum } from '@app/types/kodeverk';
const ID = 'kjennelse-mottatt';

export const KjennelseMottatt = () => {
const canEdit = useCanEdit();
const canEdit = useCanEditBehandling();
const { data } = useOppgave();
const error = useValidationError('kjennelseMottatt');
const label = useFieldName('kjennelseMottatt');
Expand Down Expand Up @@ -45,6 +46,7 @@ export const KjennelseMottatt = () => {
id={ID}
size="small"
centuryThreshold={CURRENT_YEAR_IN_CENTURY}
warningThreshhold={subDays(new Date(), 360)}
/>
</DateContainer>
);
Expand Down
Loading
Loading