Skip to content

Commit

Permalink
Remove inngang. The only entry-point for this app is via the external…
Browse files Browse the repository at this point in the history
… page nav.no/klage.

Co-authored-by: Christian Skrøvseth <[email protected]>
  • Loading branch information
eriksson-daniel and cskrov committed Dec 20, 2023
1 parent a591df2 commit eac416a
Show file tree
Hide file tree
Showing 79 changed files with 312 additions and 2,475 deletions.
2 changes: 1 addition & 1 deletion frontend/.vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"editor.linkedEditing": true,
"editor.defaultFormatter": "dbaeumer.vscode-eslint",
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
"source.fixAll.eslint": "explicit"
},
"typescript.validate.enable": true,
"typescript.tsdk": "node_modules/typescript/lib",
Expand Down
502 changes: 120 additions & 382 deletions frontend/package-lock.json

Large diffs are not rendered by default.

20 changes: 7 additions & 13 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,12 @@
"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.14.0",
"@typescript-eslint/parser": "^6.14.0",
"@typescript-eslint/eslint-plugin": "^6.15.0",
"@typescript-eslint/parser": "^6.15.0",
"copyfiles": "^2.4.1",
"css-loader": "^6.8.1",
"eslint": "^8.56.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-icons": "^3.4.3",
"@navikt/ds-react": "^5.12.0",
"@navikt/aksel-icons": "^5.12.1",
"@navikt/ds-css": "^5.12.1",
"@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": "^2.30.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"
}
}
47 changes: 0 additions & 47 deletions frontend/src/breadcrumbs/use-breadcrumbs.ts

This file was deleted.

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
8 changes: 4 additions & 4 deletions frontend/src/components/attachments/attachments.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Close, Delete } from '@navikt/ds-icons';
import { TrashIcon, XMarkIcon } from '@navikt/aksel-icons';
import { Alert, BodyLong, Button, ErrorSummary, Label, Loader } from '@navikt/ds-react';
import { FetchBaseQueryError } from '@reduxjs/toolkit/query';
import React, { useState } from 'react';
Expand Down Expand Up @@ -68,10 +68,10 @@ export const AttachmentsSection = ({
</ExternalLink>
<Button
variant="danger"
size="small"
size="xsmall"
title={`${common.delete} ${tittel}`}
onClick={() => deleteAttachment(id)}
icon={<Delete />}
icon={<TrashIcon aria-hidden />}
/>
</StyledListItem>
))}
Expand Down Expand Up @@ -132,7 +132,7 @@ const ShowErrors = ({ errors, clear, translations }: ShowErrorsProps) => {
return (
<div>
<StyledClearButton variant="secondary" onClick={clearErrors}>
<Close /> {translations.begrunnelse.attachments.clear_errors}
<XMarkIcon aria-hidden /> {translations.begrunnelse.attachments.clear_errors}
</StyledClearButton>
<ErrorSummary>
{errorMessages.map((error, i) => (
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/components/attachments/file-icon.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { FileContent, Picture } from '@navikt/ds-icons';
import { FileTextIcon, ImageIcon } from '@navikt/aksel-icons';
import React from 'react';

interface FileIconProps {
Expand All @@ -7,8 +7,8 @@ interface FileIconProps {

export const FileIcon = ({ contentType }: FileIconProps) => {
if (contentType.includes('image')) {
return <Picture aria-hidden />;
return <ImageIcon aria-hidden />;
}

return <FileContent aria-hidden />;
return <FileTextIcon aria-hidden />;
};
7 changes: 3 additions & 4 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 { UploadIcon } from '@navikt/aksel-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 All @@ -77,8 +75,9 @@ export const UploadButton = ({
onClick={handleAttachmentClick}
loading={isLoading}
id="upload-attachment"
icon={<UploadIcon aria-hidden />}
>
<Upload /> {upload_button_text}
{upload_button_text}
</StyledUploadButton>
<StyledUploadInput
id={inputId}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ErrorColored, SuccessColored } from '@navikt/ds-icons';
import { CheckmarkIcon, XMarkOctagonIcon } from '@navikt/aksel-icons';
import { Popover } from '@navikt/ds-react';
import React, { useRef, useState } from 'react';
import { styled } from 'styled-components';
Expand Down Expand Up @@ -58,7 +58,7 @@ const getContent = (status: StatusProps, saving: string, saved: string, failed:
if (status.isSuccess) {
return (
<>
<SuccessColored />
<CheckmarkIcon aria-hidden />
<>{saved}</>
</>
);
Expand All @@ -67,7 +67,7 @@ const getContent = (status: StatusProps, saving: string, saved: string, failed:
if (status.isError) {
return (
<>
<ErrorColored />
<XMarkOctagonIcon aria-hidden />
{failed}
</>
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React from 'react';
import { useBreadcrumbs } from '@app/breadcrumbs/use-breadcrumbs';
import { useInnsendingsytelseName } from '@app/hooks/use-innsendingsytelser';
import { usePageInit } from '@app/hooks/use-page-init';
import { useIsAuthenticated } from '@app/hooks/use-user';
Expand Down Expand Up @@ -37,7 +36,6 @@ export const DigitalFormContainer = ({
const { data: isAuthenticated } = useIsAuthenticated();

usePageInit(`${steps[activeStep - 1] ?? ''} \u2013 ${title_fragment}`);
useBreadcrumbs(null, null);

const [label1, label2, label3] = steps;

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
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { skipToken } from '@reduxjs/toolkit/query';
import React from 'react';
import { useBreadcrumbs } from '@app/breadcrumbs/use-breadcrumbs';
import { useInnsendingsytelseName } from '@app/hooks/use-innsendingsytelser';
import { usePageInit } from '@app/hooks/use-page-init';
import { useIsAuthenticated } from '@app/hooks/use-user';
Expand Down Expand Up @@ -35,7 +34,6 @@ export const PostFormContainer = ({
const { data: isAuthenticated } = useIsAuthenticated(loginRequired ? undefined : skipToken);

usePageInit(`${steps[activeStep - 1] ?? ''} \u2013 ${title_fragment}`);
useBreadcrumbs(null, null);

const [label1, label2, label3] = steps;

Expand Down
Loading

0 comments on commit eac416a

Please sign in to comment.