Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
eriksson-daniel committed Dec 20, 2023
1 parent 2aa1085 commit d199c7d
Show file tree
Hide file tree
Showing 40 changed files with 55 additions and 1,152 deletions.
351 changes: 45 additions & 306 deletions frontend/package-lock.json

Large diffs are not rendered by default.

14 changes: 4 additions & 10 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,9 @@
"lint-fix": "eslint src --color --fix"
},
"devDependencies": {
"@types/amplitude-js": "^8.16.5",
"@types/jest": "^29.5.11",
"@types/react": "^18.2.45",
"@types/react-dom": "^18.2.18",
"@types/styled-components": "^5.1.34",
"@types/webpack-env": "^1.18.4",
"@typescript-eslint/eslint-plugin": "^6.15.0",
"@typescript-eslint/parser": "^6.15.0",
Expand All @@ -31,7 +29,7 @@
"eslint-plugin-jest": "^27.6.0",
"eslint-plugin-jsx-a11y": "^6.8.0",
"eslint-plugin-prefer-arrow": "^1.2.3",
"eslint-plugin-prettier": "^5.0.1",
"eslint-plugin-prettier": "^5.1.0",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^4.6.0",
"fork-ts-checker-webpack-plugin": "^9.0.2",
Expand All @@ -46,25 +44,21 @@
"webpack-dev-server": "^4.15.1"
},
"dependencies": {
"@navikt/ds-css": "^5.12.0",
"@navikt/ds-css": "^5.12.1",
"@navikt/ds-icons": "^3.4.3",
"@navikt/ds-react": "^5.12.0",
"@navikt/ds-react": "^5.12.1",
"@navikt/fnrvalidator": "^1.3.3",
"@navikt/nav-dekoratoren-moduler": "^2.1.5",
"@reduxjs/toolkit": "^2.0.1",
"@sentry/react": "^7.88.0",
"@sentry/tracing": "^7.88.0",
"@styled-icons/material": "^10.47.0",
"amplitude-js": "^8.21.9",
"classnames": "^2.3.2",
"date-fns": "^3.0.0",
"date-fns": "^3.0.1",
"dayjs": "^1.11.10",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-redux": "^9.0.4",
"react-router": "^6.21.0",
"react-router-dom": "^6.21.0",
"redux": "^5.0.0",
"styled-components": "^6.1.1"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@ import { useAnkeErrors } from '@app/hooks/use-errors';
import { useUser } from '@app/hooks/use-user';
import { useLanguage } from '@app/language/use-language';
import { useTranslation } from '@app/language/use-translation';
import { PageIdentifier } from '@app/logging/amplitude';
import { AppEventEnum } from '@app/logging/error-report/action';
import { addAppEvent } from '@app/logging/error-report/error-report';
import { useLogPageView } from '@app/logging/use-log-page-view';
import {
useDeleteAnkeMutation,
useDeleteAttachmentMutation,
Expand Down Expand Up @@ -41,9 +39,6 @@ const RenderAnkebegrunnelsePage = ({ anke }: Props) => {
const navigate = useNavigate();
const language = useLanguage();
const { data: user } = useUser();

useLogPageView(PageIdentifier.ANKESKJEMA_BEGRUNNElSE);

const { ankeskjema } = useTranslation();

const [deleteAttachment] = useDeleteAttachmentMutation();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React from 'react';
import { useAnkeErrors, useGoToBegrunnelseOnError } from '@app/hooks/use-errors';
import { useTranslation } from '@app/language/use-translation';
import { PageIdentifier } from '@app/logging/amplitude';
import { Anke } from '@app/redux-api/case/anke/types';
import { RenderCaseinnsendingPage } from '../../../case/common/post/innsending-page';
import { AnkeLoader } from '../anke-loader';
Expand All @@ -21,7 +20,6 @@ const AnkeinnsendingPageWrapper = ({ anke }: Props) => {
<RenderCaseinnsendingPage
innsendingsytelse={anke.innsendingsytelse}
hasVedlegg={anke.hasVedlegg}
pageIdentifier={PageIdentifier.ANKESKJEMA_INNSENDING}
skjema_post={ankeskjema_post}
/>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ import React from 'react';
import { Navigate } from 'react-router-dom';
import { useLanguage } from '@app/language/use-language';
import { useTranslation } from '@app/language/use-translation';
import { PageIdentifier } from '@app/logging/amplitude';
import { useLogPageView } from '@app/logging/use-log-page-view';
import { useGetAnkeQuery } from '@app/redux-api/case/anke/api';
import { Anke } from '@app/redux-api/case/anke/types';
import { CaseStatus } from '@app/redux-api/case/types';
Expand All @@ -23,8 +21,6 @@ const RenderAnkekvitteringPage = ({ anke }: Props) => {
const language = useLanguage();
const { ankeskjema } = useTranslation();

useLogPageView(PageIdentifier.ANKESKJEMA_KVITTERING);

if (anke.status !== CaseStatus.DONE) {
return <Navigate to={`/${language}/anke/${anke.id}/oppsummering`} replace />;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ import { useAnkeErrors } from '@app/hooks/use-errors';
import { useIsAuthenticated, useUser } from '@app/hooks/use-user';
import { Clipboard } from '@app/icons/clipboard';
import { useTranslation } from '@app/language/use-translation';
import { PageIdentifier } from '@app/logging/amplitude';
import { useLogPageView } from '@app/logging/use-log-page-view';
import { Anke } from '@app/redux-api/case/anke/types';
import { CaseStatus } from '@app/redux-api/case/types';
import { API_PATH } from '@app/redux-api/common';
Expand Down Expand Up @@ -38,8 +36,6 @@ const DigitalAnkeoppsummeringPage = ({ anke }: Props) => {

const { data: user, isLoading: userIsLoading } = useUser();

useLogPageView(PageIdentifier.ANKESKJEMA_OPPSUMMERING);

const { isValid } = useAnkeErrors(anke);

if (userIsLoading || typeof user === 'undefined') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@ import { useSessionAnkeUpdate } from '@app/hooks/use-session-anke-update';
import { Innsendingsytelse } from '@app/innsendingsytelser/innsendingsytelser';
import { useLanguage } from '@app/language/use-language';
import { useTranslation } from '@app/language/use-translation';
import { PageIdentifier } from '@app/logging/amplitude';
import { AppEventEnum } from '@app/logging/error-report/action';
import { addAppEvent } from '@app/logging/error-report/error-report';
import { useLogPageView } from '@app/logging/use-log-page-view';
import { useAppDispatch } from '@app/redux/configure-store';
import { deleteSessionAnke } from '@app/redux/session/session';
import { CenteredContainer } from '@app/styled-components/common';
Expand Down Expand Up @@ -44,8 +42,6 @@ const RenderAnkebegrunnelsePage = ({ anke }: Props) => {
const dispatch = useAppDispatch();
const language = useLanguage();

useLogPageView(PageIdentifier.ANKESKJEMA_BEGRUNNElSE);

const { ankeskjema, ankeskjema_post } = useTranslation();

const { errors, isValid, isEverythingValid, setError } = useSessionAnkeErrors(anke);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import React from 'react';
import { useGoToBegrunnelseOnError, useSessionAnkeErrors } from '@app/hooks/use-errors';
import { Innsendingsytelse } from '@app/innsendingsytelser/innsendingsytelser';
import { useTranslation } from '@app/language/use-translation';
import { PageIdentifier } from '@app/logging/amplitude';
import { RenderCaseinnsendingPage } from '../../../case/common/post/innsending-page';
import { AnkeSessionLoader } from '../anke-session-loader';
import { ISessionAnke } from '../types';
Expand All @@ -24,7 +23,6 @@ const SessionAnkeWrapper = ({ anke }: { anke: ISessionAnke }) => {
<RenderCaseinnsendingPage
innsendingsytelse={anke.innsendingsytelse}
hasVedlegg={anke.hasVedlegg}
pageIdentifier={PageIdentifier.ANKESKJEMA_INNSENDING}
skjema_post={ankeskjema_post}
/>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ import { useSessionAnkeErrors } from '@app/hooks/use-errors';
import { Clipboard } from '@app/icons/clipboard';
import { Innsendingsytelse } from '@app/innsendingsytelser/innsendingsytelser';
import { useTranslation } from '@app/language/use-translation';
import { PageIdentifier } from '@app/logging/amplitude';
import { useLogPageView } from '@app/logging/use-log-page-view';
import { CenteredContainer } from '@app/styled-components/common';
import { CenteredHeading } from '@app/styled-components/page-title';
import { PostFormContainer } from '../../../case/common/post/post-form-container';
Expand All @@ -33,8 +31,6 @@ interface IProps {
const PostAnkeoppsummeringPage = ({ anke }: IProps) => {
const { common, ankeskjema } = useTranslation();

useLogPageView(PageIdentifier.ANKESKJEMA_OPPSUMMERING);

const { isValid } = useSessionAnkeErrors(anke);

const { steps, title_fragment, page_title } = ankeskjema.common;
Expand Down
2 changes: 0 additions & 2 deletions frontend/src/components/attachments/upload-button.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Upload } from '@navikt/ds-icons';
import { Button } from '@navikt/ds-react';
import { FetchBaseQueryError } from '@reduxjs/toolkit/query';
import { captureException } from '@sentry/react';
import React, { useRef } from 'react';
import { styled } from 'styled-components';
import { isError } from '@app/functions/is-api-error';
Expand Down Expand Up @@ -58,7 +57,6 @@ export const UploadButton = ({
await uploadAttachment({ caseId, file }).unwrap();
} catch (err) {
if (isError(err)) {
captureException(err);
setError(err);
}

Expand Down
7 changes: 1 addition & 6 deletions frontend/src/components/case/common/post/innsending-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,17 @@ import { useAddress } from '@app/hooks/use-address';
import { Innsendingsytelse } from '@app/innsendingsytelser/innsendingsytelser';
import { Language } from '@app/language/language';
import { useTranslation } from '@app/language/use-translation';
import { PageIdentifier } from '@app/logging/amplitude';
import { useLogPageView } from '@app/logging/use-log-page-view';
import { CenteredContainer } from '@app/styled-components/common';
import { Optional } from '../../../optional/optional';
import { PostFormContainer } from './post-form-container';

interface Props {
pageIdentifier: PageIdentifier;
skjema_post: Language['ankeskjema_post'] | Language['klageskjema_post'];
innsendingsytelse: Innsendingsytelse;
hasVedlegg: boolean;
}

export const RenderCaseinnsendingPage = ({ pageIdentifier, skjema_post, innsendingsytelse, hasVedlegg }: Props) => {
useLogPageView(pageIdentifier);

export const RenderCaseinnsendingPage = ({ skjema_post, innsendingsytelse, hasVedlegg }: Props) => {
const { page_title, title_fragment, steps, title, stepTexts, address, common } = useTexts({
skjema_post,
innsendingsytelse,
Expand Down
46 changes: 0 additions & 46 deletions frontend/src/components/icon-link-panel/icon-link-panel.tsx

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@ import { useKlageErrors } from '@app/hooks/use-errors';
import { useUser } from '@app/hooks/use-user';
import { useLanguage } from '@app/language/use-language';
import { useTranslation } from '@app/language/use-translation';
import { PageIdentifier } from '@app/logging/amplitude';
import { AppEventEnum } from '@app/logging/error-report/action';
import { addAppEvent } from '@app/logging/error-report/error-report';
import { useLogPageView } from '@app/logging/use-log-page-view';
import {
useDeleteAttachmentMutation,
useDeleteKlageMutation,
Expand Down Expand Up @@ -42,8 +40,6 @@ const RenderKlagebegrunnelsePage = ({ klage }: Props) => {
const language = useLanguage();
const { data: user } = useUser();

useLogPageView(PageIdentifier.KLAGESKJEMA_BEGRUNNElSE);

const { klageskjema } = useTranslation();

const [deleteAttachment] = useDeleteAttachmentMutation();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React from 'react';
import { useGoToBegrunnelseOnError, useKlageErrors } from '@app/hooks/use-errors';
import { useTranslation } from '@app/language/use-translation';
import { PageIdentifier } from '@app/logging/amplitude';
import { Klage } from '@app/redux-api/case/klage/types';
import { RenderCaseinnsendingPage } from '../../../case/common/post/innsending-page';
import { KlageLoader } from '../klage-loader';
Expand All @@ -17,7 +16,6 @@ const KlageWrapper = ({ klage }: { klage: Klage }) => {
<RenderCaseinnsendingPage
innsendingsytelse={klage.innsendingsytelse}
hasVedlegg={klage.hasVedlegg}
pageIdentifier={PageIdentifier.KLAGESKJEMA_INNSENDING}
skjema_post={klageskjema_post}
/>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ import React from 'react';
import { Navigate } from 'react-router-dom';
import { useLanguage } from '@app/language/use-language';
import { useTranslation } from '@app/language/use-translation';
import { PageIdentifier } from '@app/logging/amplitude';
import { useLogPageView } from '@app/logging/use-log-page-view';
import { useGetKlageQuery } from '@app/redux-api/case/klage/api';
import { Klage } from '@app/redux-api/case/klage/types';
import { CaseStatus } from '@app/redux-api/case/types';
Expand All @@ -23,8 +21,6 @@ const RenderKlagekvitteringPage = ({ klage }: Props) => {
const language = useLanguage();
const { klageskjema } = useTranslation();

useLogPageView(PageIdentifier.KLAGESKJEMA_KVITTERING);

if (klage.status !== CaseStatus.DONE) {
return <Navigate to={`/${language}/klage/${klage.id}/oppsummering`} replace />;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ import { styled } from 'styled-components';
import { useIsAuthenticated, useUser } from '@app/hooks/use-user';
import { Clipboard } from '@app/icons/clipboard';
import { useTranslation } from '@app/language/use-translation';
import { PageIdentifier } from '@app/logging/amplitude';
import { useLogPageView } from '@app/logging/use-log-page-view';
import { Klage } from '@app/redux-api/case/klage/types';
import { CaseStatus } from '@app/redux-api/case/types';
import { API_PATH } from '@app/redux-api/common';
Expand Down Expand Up @@ -38,8 +36,6 @@ const DigitalKlageoppsummeringPage = ({ klage }: Props) => {

const { data: user, isLoading: userIsLoading } = useUser();

useLogPageView(PageIdentifier.KLAGESKJEMA_OPPSUMMERING);

if (userIsLoading || typeof user === 'undefined') {
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@ import { useSessionKlageUpdate } from '@app/hooks/use-session-klage-update';
import { Innsendingsytelse } from '@app/innsendingsytelser/innsendingsytelser';
import { useLanguage } from '@app/language/use-language';
import { useTranslation } from '@app/language/use-translation';
import { PageIdentifier } from '@app/logging/amplitude';
import { AppEventEnum } from '@app/logging/error-report/action';
import { addAppEvent } from '@app/logging/error-report/error-report';
import { useLogPageView } from '@app/logging/use-log-page-view';
import { useAppDispatch } from '@app/redux/configure-store';
import { deleteSessionKlage } from '@app/redux/session/session';
import { CenteredContainer } from '@app/styled-components/common';
Expand Down Expand Up @@ -44,8 +42,6 @@ const RenderKlagebegrunnelsePage = ({ klage }: Props) => {
const dispatch = useAppDispatch();
const language = useLanguage();

useLogPageView(PageIdentifier.KLAGESKJEMA_BEGRUNNElSE);

const { klageskjema, klageskjema_post } = useTranslation();

const { errors, isValid, isEverythingValid, setError } = useSessionKlageErrors(klage);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import React from 'react';
import { useGoToBegrunnelseOnError, useSessionKlageErrors } from '@app/hooks/use-errors';
import { Innsendingsytelse } from '@app/innsendingsytelser/innsendingsytelser';
import { useTranslation } from '@app/language/use-translation';
import { PageIdentifier } from '@app/logging/amplitude';
import { RenderCaseinnsendingPage } from '../../../case/common/post/innsending-page';
import { KlageSessionLoader } from '../klage-session-loader';
import { ISessionKlage } from '../types';
Expand All @@ -24,7 +23,6 @@ const SessionKlageWrapper = ({ klage }: { klage: ISessionKlage }) => {
<RenderCaseinnsendingPage
innsendingsytelse={klage.innsendingsytelse}
hasVedlegg={klage.hasVedlegg}
pageIdentifier={PageIdentifier.KLAGESKJEMA_INNSENDING}
skjema_post={klageskjema_post}
/>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ import { useSessionKlageErrors } from '@app/hooks/use-errors';
import { Clipboard } from '@app/icons/clipboard';
import { Innsendingsytelse } from '@app/innsendingsytelser/innsendingsytelser';
import { useTranslation } from '@app/language/use-translation';
import { PageIdentifier } from '@app/logging/amplitude';
import { useLogPageView } from '@app/logging/use-log-page-view';
import { CenteredContainer } from '@app/styled-components/common';
import { CenteredHeading } from '@app/styled-components/page-title';
import { PostFormContainer } from '../../../case/common/post/post-form-container';
Expand Down Expand Up @@ -35,8 +33,6 @@ const PostKlageoppsummeringPage = ({ klage }: Props) => {
const { common, klageskjema } = useTranslation();
const { isValid } = useSessionKlageErrors(klage);

useLogPageView(PageIdentifier.KLAGESKJEMA_OPPSUMMERING);

const { steps, title_fragment, page_title } = klageskjema.common;

return (
Expand Down
Loading

0 comments on commit d199c7d

Please sign in to comment.