diff --git a/apps/frontend/src/components/DpProcess/DpProcessTable.tsx b/apps/frontend/src/components/DpProcess/DpProcessTable.tsx index d981ba345..8d4516507 100644 --- a/apps/frontend/src/components/DpProcess/DpProcessTable.tsx +++ b/apps/frontend/src/components/DpProcess/DpProcessTable.tsx @@ -5,6 +5,7 @@ import RouteLink from '../common/RouteLink' import { useEffect, useState } from 'react' import { getResourceById } from '../../api' import { StyledLink } from 'baseui/link' +import { Tag } from '@navikt/ds-react' type DpProcessTableProps = { dpProcesses: DpProcess[] @@ -17,6 +18,8 @@ const DpProcessTable = (props: DpProcessTableProps) => { initialSortColumn: 'name', }) + const today = new Date().toISOString().split('T')[0] + useEffect(() => { ;(async () => { if (props.dpProcesses) { @@ -43,38 +46,40 @@ const DpProcessTable = (props: DpProcessTableProps) => { return ( <> - - - - + + + + } > - {table.data.map((process, index) => ( - - - - {process.name} - - - -
- D{process.dpProcessNumber} -
-
- - - {process.externalProcessResponsible?.shortName} - - - - {process.lastModifiedEmail} - -
- ))} + {table.data.map((process, index) => { + const isActive = today < process.end + + return ( + + + + {process.name} + + + + {isActive ? 'Aktiv' : 'Utgått'} + + + + {process.externalProcessResponsible?.shortName} + + + + {process.lastModifiedEmail} + + + ) + })}
) diff --git a/apps/frontend/src/constants.ts b/apps/frontend/src/constants.ts index af051d8b6..1d8b8bccb 100644 --- a/apps/frontend/src/constants.ts +++ b/apps/frontend/src/constants.ts @@ -309,7 +309,6 @@ export const processSort: ColumnCompares = { export const dpProcessSort: ColumnCompares = { name: (a, b) => a.name.localeCompare(b.name), - dpProcessNumber: (a, b) => a.dpProcessNumber - b.dpProcessNumber, externalProcessResponsible: (a, b) => (a.externalProcessResponsible?.shortName || '').localeCompare(b.externalProcessResponsible?.shortName || ''), affiliation: (a, b) => (a.affiliation.department?.shortName || '').localeCompare(a.affiliation.department?.shortName || ''), description: (a, b) => (a.description || '').localeCompare(b.description || ''), diff --git a/apps/frontend/src/pages/DpProcessPage.tsx b/apps/frontend/src/pages/DpProcessPage.tsx index 3117c4655..194169c7f 100644 --- a/apps/frontend/src/pages/DpProcessPage.tsx +++ b/apps/frontend/src/pages/DpProcessPage.tsx @@ -12,7 +12,7 @@ import { HeadingMedium } from 'baseui/typography' import { user } from '../service/User' import { useNavigate } from 'react-router-dom' import { Spinner } from 'baseui/spinner' -import {ampli} from "../service/Amplitude"; +import {ampli} from '../service/Amplitude' const DpProcessPage = () => { const [showModal, toggleModal] = useReducer((prevState) => !prevState, false) @@ -21,7 +21,7 @@ const DpProcessPage = () => { const [isLoading, setLoading] = useState(true) const navigate = useNavigate() - ampli.logEvent("besøk", {side: 'NAV som databehandler', url: '/dpprocess', app: 'Behandlingskatalogen'}) + ampli.logEvent('besøk', {side: 'NAV som databehandler', url: '/dpprocess', app: 'Behandlingskatalogen'}) useEffect(() => { ;(async () => { @@ -43,7 +43,7 @@ const DpProcessPage = () => { toggleModal() } catch (err: any) { if (err.response.data.message.includes('already exists')) { - setErrorDpProcessModal("Databehandlingen eksisterer allerede") + setErrorDpProcessModal('Databehandlingen eksisterer allerede') return } setErrorDpProcessModal(err.response.data.message)