Skip to content

Commit

Permalink
Merge branch 'master' into historikk-i-tidligere-vedtaksperioder
Browse files Browse the repository at this point in the history
  • Loading branch information
gunnsteingarmo committed Sep 25, 2023
2 parents 28f652f + c79c981 commit 374267a
Show file tree
Hide file tree
Showing 83 changed files with 2,000 additions and 1,230 deletions.
100 changes: 42 additions & 58 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,40 +26,37 @@
},
"dependencyComments": {
"color-string": "Overrider versjon som brukes av winston, som kommer fra familie-frontend-backend",
"request-promise": "Overrider versjon som kommer fra familie-frontend-backend",
"body-parser": "Overrider versjon som kommer fra familie-frontend backend",
"react-collapse": "Trengs for datovelgeren, overrider versjonen som ligger der"
},
"dependencies": {
"@navikt/aksel-icons": "^2.9.x",
"@navikt/ds-css": "2.9.x",
"@navikt/ds-icons": "2.9.x",
"@navikt/ds-react": "2.9.x",
"@navikt/ds-react-internal": "2.9.x",
"@navikt/ds-tokens": "2.9.x",
"@navikt/aksel-icons": "^5.5.0",
"@navikt/ds-css": "5.5.0",
"@navikt/ds-react": "5.5.0",
"@navikt/ds-tokens": "5.5.0",
"@navikt/familie-backend": "10.0.7",
"@navikt/familie-dokumentliste": "^8.1.1",
"@navikt/familie-endringslogg": "^8.1.1",
"@navikt/familie-form-elements": "^10.1.2",
"@navikt/familie-header": "^9.0.1",
"@navikt/familie-ikoner": "^7.0.0",
"@navikt/familie-dokumentliste": "^9.0.1",
"@navikt/familie-endringslogg": "^9.0.3",
"@navikt/familie-form-elements": "^12.0.0",
"@navikt/familie-header": "^11.0.1",
"@navikt/familie-ikoner": "^7.0.1",
"@navikt/familie-logging": "^6.0.0",
"@navikt/familie-typer": "^8.0.0",
"@navikt/familie-visittkort": "^9.0.0",
"@navikt/familie-typer": "^8.0.1",
"@navikt/familie-visittkort": "^11.0.2",
"@navikt/fnrvalidator": "^1.3.3",
"@sentry/browser": "^7.60.1",
"@sentry/core": "^7.60.1",
"@sentry/browser": "^7.69.0",
"@sentry/core": "^7.69.0",
"@types/amplitude-js": "^8.16.2",
"@types/classnames": "^2.3.1",
"@types/express": "^4.17.17",
"@types/file-saver": "^2.0.5",
"@types/react": "^18.2.17",
"@types/react": "^18.2.21",
"@types/react-dom": "^18.2.7",
"@types/styled-components": "^5.1.26",
"@types/uuid": "^9.0.2",
"@types/styled-components": "^5.1.27",
"@types/uuid": "^9.0.4",
"amplitude-js": "^8.21.9",
"autoprefixer": "^10.4.14",
"axios": "^1.4.0",
"autoprefixer": "^10.4.15",
"axios": "^1.5.0",
"babel-loader": "^9.1.3",
"body-parser": "^1.20.2",
"classnames": "^2.3.2",
Expand All @@ -72,88 +69,75 @@
"file-loader": "^6.2.0",
"file-saver": "^2.0.5",
"http-proxy-middleware": "^2.0.6",
"https-proxy-agent": "^7.0.1",
"https-proxy-agent": "^7.0.2",
"lodash.throttle": "^4.1.1",
"loglevel": "^1.8.1",
"namecase": "^1.1.2",
"nav-datovelger": "^12.6.0",
"nav-frontend-core": "^6.0.1",
"nav-frontend-js-utils": "^1.0.20",
"nav-frontend-lenker": "^2.0.2",
"nav-frontend-lenker-style": "^2.0.2",
"nav-frontend-paneler-style": "^2.0.2",
"nav-frontend-popover": "^2.0.4",
"nav-frontend-popover-style": "^2.0.2",
"nav-frontend-skjema": "^4.0.6",
"nav-frontend-skjema-style": "^3.0.3",
"nav-frontend-tabell-style": "^2.1.2",
"nav-frontend-typografi": "^4.0.2",
"nav-frontend-typografi-style": "^2.0.2",
"passport": "^0.6.0",
"passport-azure-ad": "^4.3.5",
"prom-client": "^14.2.0",
"prop-types": "^15.8.1",
"react": "^18.2.0",
"react-collapse": "^5.1.1",
"react-day-picker": "^7.4.10",
"react-day-picker": "^8.8.2",
"react-dom": "^18.2.0",
"react-is": "^18.2.0",
"react-pdf": "7.3.0",
"react-router-dom": "^6.14.2",
"react-pdf": "7.3.3",
"react-router-dom": "^6.16.0",
"react-router-prompt": "^0.5.4",
"react-select": "^5.7.4",
"snyk": "^1.1198.0",
"styled-components": "^5.3.5",
"snyk": "^1.1221.0",
"styled-components": "^6.0.8",
"svg-inline-loader": "^0.8.2",
"use-debounce": "^9.0.4",
"uuid": "^9.0.0"
"uuid": "^9.0.1"
},
"devDependencies": {
"@axe-core/react": "4.7.3",
"@babel/core": "^7.22.9",
"@babel/core": "^7.22.20",
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
"@babel/preset-env": "^7.22.9",
"@babel/preset-react": "^7.22.5",
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.10",
"@babel/preset-env": "^7.22.20",
"@babel/preset-react": "^7.22.15",
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.11",
"@types/axe-core": "^2.0.7",
"@types/webpack": "^5.28.1",
"@types/webpack": "^5.28.2",
"@types/webpack-dev-middleware": "^5.3.0",
"@types/webpack-env": "^1.18.1",
"@types/webpack-hot-middleware": "^2.25.6",
"@typescript-eslint/eslint-plugin": "^6.2.0",
"@typescript-eslint/parser": "^6.2.0",
"@typescript-eslint/typescript-estree": "^6.2.0",
"@typescript-eslint/eslint-plugin": "^6.7.0",
"@typescript-eslint/parser": "^6.7.0",
"@typescript-eslint/typescript-estree": "^6.7.0",
"babel-polyfill": "^6.26.0",
"babel-preset-react-app": "^10.0.1",
"compression-webpack-plugin": "^10.0.0",
"copy-webpack-plugin": "^11.0.0",
"css-loader": "^6.8.1",
"eslint": "^8.46.0",
"eslint": "^8.49.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-prettier": "^8.9.0",
"eslint-plugin-import": "^2.28.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-import": "^2.28.1",
"eslint-plugin-jsx-a11y": "^6.7.1",
"eslint-plugin-prettier": "^5.0.0",
"eslint-plugin-react": "^7.33.1",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-webpack-plugin": "^4.0.1",
"express-static-gzip": "^2.1.7",
"fork-ts-checker-webpack-plugin": "^8.0.0",
"html-webpack-plugin": "^5.5.3",
"husky": "^8.0.3",
"less": "^4.1.3",
"less": "^4.2.0",
"less-loader": "^11.1.3",
"lint-staged": "^13.2.3",
"lint-staged": "^14.0.1",
"mini-css-extract-plugin": "^2.7.6",
"postcss": "^8.4.27",
"postcss": "^8.4.29",
"postcss-loader": "^7.3.3",
"prettier": "^3.0.0",
"prettier": "^3.0.3",
"react-hot-loader": "^4.13.1",
"react-refresh": "^0.14.0",
"style-loader": "^3.3.3",
"ts-loader": "^9.4.4",
"tsconfig-paths-webpack-plugin": "^4.1.0",
"typescript": "^5.1.6",
"typescript": "^5.2.2",
"webpack": "^5.88.2",
"webpack-cli": "^5.1.4",
"webpack-dev-middleware": "^6.1.1",
Expand Down
5 changes: 1 addition & 4 deletions src/frontend/App.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { BodyLong, Modal } from '@navikt/ds-react';
import { BodyLong } from '@navikt/ds-react';
import * as React from 'react';
import { useState } from 'react';
import { AppProvider, useApp } from './App/context/AppContext';
Expand Down Expand Up @@ -37,9 +37,6 @@ import { loggBesøkEvent } from './App/utils/amplitude/amplitudeLoggEvents';
import { BesøkEvent } from './App/utils/amplitude/typer';
import Innloggingsfeilmelding from './Felles/Varsel/Innloggingsfeilmelding';

// @ts-ignore
Modal.setAppElement(document.getElementById('modal-a11y-wrapper'));

const Innhold = styled(BodyLong)`
margin-top: 2rem;
margin-bottom: 2rem;
Expand Down
5 changes: 4 additions & 1 deletion src/frontend/App/typer/vedtak.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export type IInnvilgeVedtakForOvergangsstønad = {
};

export type IInnvilgeVedtakForBarnetilsyn = {
resultatType: EBehandlingResultat.INNVILGE;
resultatType: EBehandlingResultat.INNVILGE | EBehandlingResultat.INNVILGE_UTEN_UTBETALING;
begrunnelse?: string;
perioder: IUtgiftsperiode[];
perioderKontantstøtte: IPeriodeMedBeløp[];
Expand Down Expand Up @@ -302,13 +302,15 @@ export enum EAvslagÅrsak {
STØNADSTID_OPPBRUKT = 'STØNADSTID_OPPBRUKT',
MANGLENDE_OPPLYSNINGER = 'MANGLENDE_OPPLYSNINGER',
MINDRE_INNTEKTSENDRINGER = 'MINDRE_INNTEKTSENDRINGER',
KORTVARIG_AVBRUDD_JOBB = 'KORTVARIG_AVBRUDD_JOBB',
}

export const årsakerTilAvslag: EAvslagÅrsak[] = [
EAvslagÅrsak.BARN_OVER_ÅTTE_ÅR,
EAvslagÅrsak.MANGLENDE_OPPLYSNINGER,
EAvslagÅrsak.STØNADSTID_OPPBRUKT,
EAvslagÅrsak.MINDRE_INNTEKTSENDRINGER,
EAvslagÅrsak.KORTVARIG_AVBRUDD_JOBB,
];

export enum ESkolepengerStudietype {
Expand Down Expand Up @@ -438,6 +440,7 @@ export const avslagÅrsakTilTekst: Record<EAvslagÅrsak, string> = {
STØNADSTID_OPPBRUKT: 'Stønadstiden er brukt opp',
MANGLENDE_OPPLYSNINGER: 'Manglende opplysninger',
MINDRE_INNTEKTSENDRINGER: 'Ikke 10 % endring inntekt',
KORTVARIG_AVBRUDD_JOBB: 'Kortvarig avbrudd jobb',
};

export const samordningsfradragstypeTilTekst: Record<ESamordningsfradragtype, string> = {
Expand Down
9 changes: 7 additions & 2 deletions src/frontend/App/utils/dato.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,13 @@ export const tilDato = (dato: string | Date): Date =>

export const tilLocaleDateString = (dato: Date) => formatISO(dato, { representation: 'date' });

export const nullableTilDato = (dato: string | Date | undefined): Date | undefined =>
typeof dato === 'string' ? parseISO(dato) : dato;
export const nullableTilDato = (dato: string | Date | undefined): Date | undefined => {
if (typeof dato === 'string') {
return dato !== '' ? parseISO(dato) : undefined;
} else {
return dato;
}
};

export const nullableDatoTilAlder = (dato?: string | Date | null): number | undefined => {
return dato ? datoTilAlder(dato) : undefined;
Expand Down
39 changes: 39 additions & 0 deletions src/frontend/Felles/Datovelger/Datovelger.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import React, { FC } from 'react';
import { useDatepicker, DatePicker } from '@navikt/ds-react';
import { FamilieLesefelt } from '@navikt/familie-form-elements';
import { nullableTilDato, tilLocaleDateString } from '../../App/utils/dato';
import { formaterNullableIsoDato } from '../../App/utils/formatter';

export const Datovelger: FC<{
verdi: string | undefined;
settVerdi: (verdi: string | undefined) => void;
erLesevisning?: boolean;
label: string;
id: string;
feil?: string;
maksDato?: Date;
minDato?: Date;
}> = ({ settVerdi, erLesevisning, verdi, label, id, feil, minDato, maksDato }) => {
const { datepickerProps, inputProps } = useDatepicker({
defaultSelected: nullableTilDato(verdi),
onDateChange: (dato) => settVerdi(dato && tilLocaleDateString(dato)),
toDate: maksDato,
fromDate: minDato,
});

return (
<div>
{erLesevisning ? (
<FamilieLesefelt
size={'small'}
label={label}
verdi={formaterNullableIsoDato(verdi)}
/>
) : (
<DatePicker id={id} {...datepickerProps}>
<DatePicker.Input label={label} {...inputProps} error={feil} size={'medium'} />
</DatePicker>
)}
</div>
);
};
Original file line number Diff line number Diff line change
@@ -1,21 +1,27 @@
import React from 'react';
import { formaterFødselsnummer } from '../../App/utils/formatter';
import Clipboard from '@navikt/familie-clipboard';
import { CopyButton } from '@navikt/ds-react';
import styled from 'styled-components';

const NoWrapSpan = styled.span`
white-space: nowrap;
font-size: 16px;
display: flex;
align-items: center;
`;

export const KopierbartNullableFødselsnummer: React.FC<{ fødselsnummer: string }> = ({
fødselsnummer,
}) => {
return (
<NoWrapSpan>
<Clipboard>
<span>{formaterFødselsnummer(fødselsnummer)}</span>
</Clipboard>
<span>{formaterFødselsnummer(fødselsnummer)}</span>
<CopyButton
size={'xsmall'}
copyText={formaterFødselsnummer(fødselsnummer)}
variant={'action'}
activeText={'kopiert'}
/>
</NoWrapSpan>
);
};
10 changes: 5 additions & 5 deletions src/frontend/Felles/Hamburgermeny/Hamburgermeny.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
import React, { FC, useEffect, useRef, useState } from 'react';
import { Hamburger, EllipsisV } from '@navikt/ds-icons';
import { MenuHamburgerIcon, MenuElipsisVerticalIcon } from '@navikt/aksel-icons';
import styled from 'styled-components';

interface HamburgerMenyInnholdProps {
åpen: boolean;
}

const HamburgerMenyIkon = styled(Hamburger)`
const HamburgerMenyIkon = styled(MenuHamburgerIcon)`
margin: 1rem 1rem 0 1rem;
&:hover {
cursor: pointer;
}
`;

const HamburgerMenyEllipsisVIkon = styled(EllipsisV)`
const HamburgerMenyEllipsisVIkon = styled(MenuElipsisVerticalIcon)`
margin: 0.5rem 0.5rem 0 0.5rem;
&:hover {
Expand All @@ -26,8 +26,8 @@ const HamburgerWrapper = styled.div`
position: relative;
`;

const HamburgerMenyInnhold = styled.div`
display: ${(props: HamburgerMenyInnholdProps) => (props.åpen ? 'block' : 'none')};
const HamburgerMenyInnhold = styled.div<HamburgerMenyInnholdProps>`
display: ${(props) => (props.åpen ? 'block' : 'none')};
position: absolute;
Expand Down
1 change: 0 additions & 1 deletion src/frontend/Felles/HeaderMedSøk/headermedsøk.less
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
@import (reference) '~nav-frontend-core/less/_variabler';

.header {
position: sticky;
Expand Down
4 changes: 2 additions & 2 deletions src/frontend/Felles/Ikoner/BeslutterIkon.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import * as React from 'react';

import { DecisionFilled } from '@navikt/ds-icons';
import { PersonGavelFillIcon } from '@navikt/aksel-icons';

import { TidslinjeIkonbakgrunn } from './ikonelementer';

const BeslutterIkon: React.FC = () => {
return (
<TidslinjeIkonbakgrunn>
<DecisionFilled fr="mask" fontSize="15" aria-label="Beslutter" />
<PersonGavelFillIcon fr="mask" fontSize="15" aria-label="Beslutter" />
</TidslinjeIkonbakgrunn>
);
};
Expand Down
4 changes: 2 additions & 2 deletions src/frontend/Felles/Ikoner/SaksbehandlerIkon.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import * as React from 'react';

import { CaseworkerFilled } from '@navikt/ds-icons';
import { PersonPencilFillIcon } from '@navikt/aksel-icons';

import { TidslinjeIkonbakgrunn } from './ikonelementer';

const SaksbehandlerIkon: React.FC = () => {
return (
<TidslinjeIkonbakgrunn>
<CaseworkerFilled fr="mask" fontSize="15" aria-label="Saksbehandler" />
<PersonPencilFillIcon fr="mask" fontSize="15" aria-label="Saksbehandler" />
</TidslinjeIkonbakgrunn>
);
};
Expand Down
4 changes: 2 additions & 2 deletions src/frontend/Felles/Ikoner/SystemIkon.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import * as React from 'react';

import { AutomaticSystem } from '@navikt/ds-icons';
import { CogRotationIcon } from '@navikt/aksel-icons';

import { TidslinjeIkonbakgrunn } from './ikonelementer';

const SystemIkon: React.FC = () => {
return (
<TidslinjeIkonbakgrunn>
<AutomaticSystem fr="mask" fontSize="15" aria-label="System" />
<CogRotationIcon fr="mask" fontSize="15" aria-label="System" />
</TidslinjeIkonbakgrunn>
);
};
Expand Down
Loading

0 comments on commit 374267a

Please sign in to comment.