diff --git a/apps/backend/src/main/java/no/nav/data/etterlevelse/arkivering/domain/EtterlevelseArkiv.java b/apps/backend/src/main/java/no/nav/data/etterlevelse/arkivering/domain/EtterlevelseArkiv.java
index 3b3037a40..5e6102044 100644
--- a/apps/backend/src/main/java/no/nav/data/etterlevelse/arkivering/domain/EtterlevelseArkiv.java
+++ b/apps/backend/src/main/java/no/nav/data/etterlevelse/arkivering/domain/EtterlevelseArkiv.java
@@ -61,6 +61,6 @@ public EtterlevelseArkivResponse toResponse() {
}
public InstanceId convertToInstanceId() {
- return new InstanceId(id.toString(), behandlingId + "-" + webSakNummer);
+ return new InstanceId(id.toString(), behandlingId + "-" + webSakNummer, "");
}
}
diff --git a/apps/backend/src/main/java/no/nav/data/etterlevelse/codelist/codeusage/dto/InstanceId.java b/apps/backend/src/main/java/no/nav/data/etterlevelse/codelist/codeusage/dto/InstanceId.java
index 32763b26f..72dcb9867 100644
--- a/apps/backend/src/main/java/no/nav/data/etterlevelse/codelist/codeusage/dto/InstanceId.java
+++ b/apps/backend/src/main/java/no/nav/data/etterlevelse/codelist/codeusage/dto/InstanceId.java
@@ -18,6 +18,7 @@ public class InstanceId {
private String id;
private String name;
+ private String number;
@JsonIgnore
public UUID getIdAsUUID() {
diff --git a/apps/backend/src/main/java/no/nav/data/etterlevelse/etterlevelse/domain/Etterlevelse.java b/apps/backend/src/main/java/no/nav/data/etterlevelse/etterlevelse/domain/Etterlevelse.java
index 53f4a0e3b..baefbd579 100644
--- a/apps/backend/src/main/java/no/nav/data/etterlevelse/etterlevelse/domain/Etterlevelse.java
+++ b/apps/backend/src/main/java/no/nav/data/etterlevelse/etterlevelse/domain/Etterlevelse.java
@@ -78,6 +78,6 @@ public EtterlevelseResponse toResponse() {
}
public InstanceId convertToInstanceId() {
- return new InstanceId(id.toString(), behandlingId + "-" + kravId());
+ return new InstanceId(id.toString(), behandlingId + "-" + kravId(), "");
}
}
diff --git a/apps/backend/src/main/java/no/nav/data/etterlevelse/etterlevelseDokumentasjon/domain/EtterlevelseDokumentasjon.java b/apps/backend/src/main/java/no/nav/data/etterlevelse/etterlevelseDokumentasjon/domain/EtterlevelseDokumentasjon.java
index e7d285529..f9a757e6f 100644
--- a/apps/backend/src/main/java/no/nav/data/etterlevelse/etterlevelseDokumentasjon/domain/EtterlevelseDokumentasjon.java
+++ b/apps/backend/src/main/java/no/nav/data/etterlevelse/etterlevelseDokumentasjon/domain/EtterlevelseDokumentasjon.java
@@ -78,6 +78,6 @@ public EtterlevelseDokumentasjonResponse toResponse() {
}
public InstanceId convertToInstanceId() {
- return new InstanceId(id.toString(), title);
+ return new InstanceId(id.toString(), title, "E" + etterlevelseNummer);
}
}
diff --git a/apps/backend/src/main/java/no/nav/data/etterlevelse/krav/domain/Krav.java b/apps/backend/src/main/java/no/nav/data/etterlevelse/krav/domain/Krav.java
index e38f3298a..4708c112c 100644
--- a/apps/backend/src/main/java/no/nav/data/etterlevelse/krav/domain/Krav.java
+++ b/apps/backend/src/main/java/no/nav/data/etterlevelse/krav/domain/Krav.java
@@ -137,6 +137,6 @@ public KravResponse toResponse() {
}
public InstanceId convertToInstanceId() {
- return new InstanceId(id.toString(), navn);
+ return new InstanceId(id.toString(), navn, "K" + kravNummer + "." + kravVersjon);
}
}
diff --git a/apps/backend/src/main/java/no/nav/data/etterlevelse/kravprioritering/domain/KravPrioritering.java b/apps/backend/src/main/java/no/nav/data/etterlevelse/kravprioritering/domain/KravPrioritering.java
index 7c96804ea..e5e91ff25 100644
--- a/apps/backend/src/main/java/no/nav/data/etterlevelse/kravprioritering/domain/KravPrioritering.java
+++ b/apps/backend/src/main/java/no/nav/data/etterlevelse/kravprioritering/domain/KravPrioritering.java
@@ -46,6 +46,6 @@ public KravPrioriteringResponse toResponse() {
}
public InstanceId convertToInstanceId() {
- return new InstanceId(id.toString(), kravId());
+ return new InstanceId(id.toString(), kravId(), "");
}
}
diff --git a/apps/backend/src/main/java/no/nav/data/etterlevelse/virkemiddel/domain/Virkemiddel.java b/apps/backend/src/main/java/no/nav/data/etterlevelse/virkemiddel/domain/Virkemiddel.java
index cefb1db88..0e2285a84 100644
--- a/apps/backend/src/main/java/no/nav/data/etterlevelse/virkemiddel/domain/Virkemiddel.java
+++ b/apps/backend/src/main/java/no/nav/data/etterlevelse/virkemiddel/domain/Virkemiddel.java
@@ -57,7 +57,7 @@ public VirkemiddelResponse toResponse() {
}
public InstanceId convertToInstanceId() {
- return new InstanceId(id.toString(), navn);
+ return new InstanceId(id.toString(), navn, "");
}
}
diff --git a/apps/frontend/src/components/Header.tsx b/apps/frontend/src/components/Header.tsx
index 46c2d3fa8..92d3cf597 100644
--- a/apps/frontend/src/components/Header.tsx
+++ b/apps/frontend/src/components/Header.tsx
@@ -26,11 +26,9 @@ export const LoginButton = () => {
// updates window.location on navigation
const location = useLocation()
return (
-
-
- Logg inn
-
-
+
+ Logg inn
+
)
}
@@ -54,7 +52,7 @@ const LoggedInHeader = () => {
const kravPages = user.isKraveier()
? [{ label: 'Forvalte og opprette krav', href: '/kravliste' },
- //{ label: 'Forvalte og opprette virkemiddel', href: '/virkemiddelliste' }
+ //{ label: 'Forvalte og opprette virkemiddel', href: '/virkemiddelliste' }
]
: []
const adminPages = user.isAdmin()
@@ -186,14 +184,14 @@ const Header = (props: { noSearchBar?: boolean; noLoginButton?: boolean }) => {
-
-
+
+
Etterlevelse
{!props.noSearchBar && (
-
+
)}
@@ -204,8 +202,8 @@ const Header = (props: { noSearchBar?: boolean; noLoginButton?: boolean }) => {
{user.isLoggedIn() &&
}
)}
-
-
+
+
{systemVarsel && systemVarsel.meldingStatus === MeldingStatus.ACTIVE && (
{
const [errorOnResponse, setErrorOnResponse] = React.useState(null)
const [usage, setUsage] = useState
()
+ const [sort, setSort] = useState()
+
useEffect(() => {
if (showUsage && selectedCode) {
- ;(async () => {
+ ; (async () => {
setUsage(undefined)
const usage = await getCodelistUsage(selectedCode.list, selectedCode.code)
setUsage(usage)
@@ -60,81 +58,93 @@ const CodeListTable = ({ tableData, refresh }: TableCodelistProps) => {
}
}
+ let sortedData = tableData
+
+ const comparator = (a: Code, b: Code, orderBy: string) => {
+ switch (orderBy) {
+ case 'code':
+ return a.code.localeCompare(b.code)
+ case 'navn':
+ return (a.shortName || '').localeCompare(b.shortName || '')
+ default:
+ return 0
+ }
+ }
+
+ sortedData = sortedData.sort((a, b) => {
+ if (sort) {
+ return sort.direction === 'ascending'
+ ? comparator(b, a, sort.orderBy)
+ : comparator(a, b, sort.orderBy)
+ }
+ return 1
+ })
+
return (
<>
-
- table.data.map((row, index) => (
-
-
- {row.code}
- |
- {row.shortName} |
-
-
- {row.description}
-
- {row.data && JSON.stringify(row.data, null, 1)}
-
-
- |
-
-
-
-
-
-
-
- |
-
- ))
- }
- />
+ handleSort(sort, setSort, sortKey)}>
+
+
+ Code
+ Navn
+ Beskrivelse
+
+
+
+
+ {sortedData.map((code: Code, i) => {
+ return (
+
+ {code.code}
+ {code.shortName}
+
+
+
{code.description}
+
+ {code.data && JSON.stringify(code.data, null, 1)}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ )
+ })}
+
+
{showEditModal && selectedCode && (
{
code: selectedCode.code ?? '',
shortName: selectedCode.shortName ?? '',
description: selectedCode.description ?? '',
- data: selectedCode.data || {},
+ data: selectedCode.data ? selectedCode.data.relevantFor ? selectedCode.data : { ...selectedCode.data, relevantFor: LovCodeRelevans.KRAV_OG_VIRKEMIDDEL } : { relevantFor: LovCodeRelevans.KRAV_OG_VIRKEMIDDEL },
}}
isOpen={showEditModal}
onClose={() => {
diff --git a/apps/frontend/src/components/admin/CodeList/CodeListUsage.tsx b/apps/frontend/src/components/admin/CodeList/CodeListUsage.tsx
index d9cf7d2b4..2d65f8055 100644
--- a/apps/frontend/src/components/admin/CodeList/CodeListUsage.tsx
+++ b/apps/frontend/src/components/admin/CodeList/CodeListUsage.tsx
@@ -1,20 +1,10 @@
import * as React from 'react'
import { useEffect, useState } from 'react'
-import { Block } from 'baseui/block'
-import { LabelMedium } from 'baseui/typography'
-import { Value } from 'baseui/select'
-import { Button } from 'baseui/button'
-
-import { Spinner } from 'baseui/spinner'
-import { Cell, Row, Table } from '../../common/Table'
-import { theme } from '../../../util'
import { codelist, CodeUsage } from '../../../services/Codelist'
import { ObjectLink } from '../../common/RouteLink'
import { ObjectType } from '../audit/AuditTypes'
import { replaceCodelistUsage } from '../../../api/CodelistApi'
-import CustomizedSelect from '../../common/CustomizedSelect'
-import { ettlevColors } from '../../../util/theme'
-import { buttonContentStyle } from '../../common/Button'
+import { Button, Label, Loader, Select, Table } from '@navikt/ds-react'
const UsageTable = (props: { usage: CodeUsage }) => {
const { usage } = props
@@ -25,60 +15,56 @@ const UsageTable = (props: { usage: CodeUsage }) => {
const rows = usage ? Math.max(usage.krav.length, usage.etterlevelseDokumentasjoner.length, usage.codelist.length) : -1
return (
- !!v)}
- render={(table) =>
- Array.from(Array(rows).keys()).map((index) => {
+
+
+
+ {krav && Krav}
+ {etterlevelseDokumentasjoner && Etterlevelse Dokumentasjoner}
+ {codelist && Codelist}
+
+
+
+ {Array.from(Array(rows).keys()).map((index) => {
const kr = usage.krav[index]
const ed = usage.etterlevelseDokumentasjoner[index]
const cl = usage.codelist[index]
return (
-
- {krav && (
-
+
+ {krav &&
+
{kr && (
- {kr.name}
+ {kr.number} {kr.name}
)}
- |
- )}
- {etterlevelseDokumentasjoner && (
-
+ }
+ {etterlevelseDokumentasjoner &&
+
{ed && (
- {ed.name}
+ {ed.number} {ed.name}
)}
- |
- )}
- {codelist && (
-
+ }
+ {codelist &&
+
{cl && (
{cl.list} - {cl.code}
)}
- |
- )}
-
+ }
+
)
- })
- }
- />
+ })}
+
+
)
}
export const Usage = (props: { usage?: CodeUsage; refresh: () => void }) => {
const [showReplace, setShowReplace] = useState(false)
- const [newValue, setNewValue] = useState([])
+ const [newValue, setNewValue] = useState()
const ref = React.createRef()
const { usage, refresh } = props
@@ -89,64 +75,52 @@ export const Usage = (props: { usage?: CodeUsage; refresh: () => void }) => {
}, [usage])
const replace = async () => {
- await replaceCodelistUsage(usage!.listName, usage!.code, newValue[0].id as string)
- refresh()
+ if (newValue) {
+ await replaceCodelistUsage(usage!.listName, usage!.code, newValue).then(() => refresh())
+ }
}
return (
-
-
- Bruk
+
+
+
{!!usage?.inUse && (
)}
-
+
{showReplace && usage && usage.listName && (
-
-
+
-
+
)}
{usage && }
- {!usage && }
-
+ {!usage && }
+
)
}
diff --git a/apps/frontend/src/components/admin/CodeList/CodelistPage.tsx b/apps/frontend/src/components/admin/CodeList/CodelistPage.tsx
index adf06aba0..0ec669b4e 100644
--- a/apps/frontend/src/components/admin/CodeList/CodelistPage.tsx
+++ b/apps/frontend/src/components/admin/CodeList/CodelistPage.tsx
@@ -1,23 +1,16 @@
import * as React from 'react'
import { useEffect } from 'react'
-import { StatefulSelect } from 'baseui/select'
-import { Block } from 'baseui/block'
-import { KIND, SIZE as ButtonSize } from 'baseui/button'
import { useNavigate, useParams } from 'react-router-dom'
-import { HeadingXXLarge } from 'baseui/typography'
-import { Spinner } from 'baseui/spinner'
-import Button from '../../common/Button'
-import { faPlus } from '@fortawesome/free-solid-svg-icons'
import { useAwait, useForceUpdate } from '../../../util/hooks'
import { Code, codelist, CodeListFormValues } from '../../../services/Codelist'
import { createCodelist } from '../../../api/CodelistApi'
-import { theme } from '../../../util'
import { user } from '../../../services/User'
import CreateCodeListModal from './ModalCreateCodeList'
import CodeListTable from './CodeListStyledTable'
-import { ettlevColors, responsivePaddingSmall, responsiveWidthSmall } from '../../../util/theme'
import { Helmet } from 'react-helmet'
+import { Button, Heading, Loader, Select } from '@navikt/ds-react'
+import { PlusIcon } from '@navikt/aksel-icons'
const CodeListPage = () => {
const params = useParams<{ listname?: string }>()
@@ -58,47 +51,46 @@ const CodeListPage = () => {
if (!user.isAdmin() || !lists) {
return (
-
-
-
+
+
+
)
}
return (
-
+
{listname ? listname : 'Velg kodeverk'}
-
Administrering av kodeverk
+
Administrering av kodeverk
{loading ? (
-
+
) : (
-
-
- setListname(value[0].id as string)}
- clearable={false}
- placeholder="Velg kodeverk"
- initialState={{ value: listname ? [{ id: listname, label: listname }] : [] }}
- />
-
+
+
{listname && (
-
-
-
+ } variant="tertiary" onClick={() => setCreateCodeListModal(!createCodeListModal)}>
+ Opprett ny kode
+
)}
-
+
)}
{!loading && currentCodelist && (
-
+
-
+
)}
{
isOpen={createCodeListModal}
errorOnCreate={errorOnResponse}
onClose={() => {
- setCreateCodeListModal(!createCodeListModal)
+ setCreateCodeListModal(false)
setErrorOnResponse(null)
}}
submit={handleCreateCodelist}
/>
-
+
)
}
diff --git a/apps/frontend/src/components/admin/CodeList/LovCode.tsx b/apps/frontend/src/components/admin/CodeList/LovCode.tsx
index e6c107dc0..a1e6e8079 100644
--- a/apps/frontend/src/components/admin/CodeList/LovCode.tsx
+++ b/apps/frontend/src/components/admin/CodeList/LovCode.tsx
@@ -1,35 +1,21 @@
-import { Block, BlockProps } from 'baseui/block'
-import { LabelMedium } from 'baseui/typography'
+import { Block } from 'baseui/block'
import { Field, FieldProps } from 'formik'
-import { Code, codelist, CodeListFormValues, ListName, LovCodeData, LovCodeRelevans, lovCodeRelevansToOptions, TemaCodeData } from '../../../services/Codelist'
-import { SIZE as InputSIZE } from 'baseui/input'
+import { codelist, CodeListFormValues, ListName, LovCodeData, LovCodeRelevans, lovCodeRelevansToOptions, TemaCodeData } from '../../../services/Codelist'
import { OptionList } from '../../common/Inputs'
import { temaBilder } from '../../Images'
-import { StatefulTooltip } from 'baseui/tooltip'
-import { faQuestionCircle } from '@fortawesome/free-solid-svg-icons'
-import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
import { theme } from '../../../util'
import Button from '../../common/Button'
-import CustomizedInput from '../../common/CustomizedInput'
-import CustomizedSelect from '../../common/CustomizedSelect'
-import CustomizedTextarea from '../../common/CustomizedTextarea'
import { Error } from '../../common/ModalSchema'
-
-const rowBlockProps: BlockProps = {
- display: 'flex',
- width: '100%',
- marginTop: '1rem',
- alignItems: 'center',
-}
+import { Label, Select, TextField, Textarea } from '@navikt/ds-react'
export const LovCodeDataForm = () => {
return (
-
-
-
+
+
+
+
{({ field, form }: FieldProps) => {
const data = field.value
@@ -42,61 +28,56 @@ export const LovCodeDataForm = () => {
if (!data.lovId && form.values.description) {
set({ lovId: form.values.description })
}
- // Migrate old
- if (!data.relevantFor) {
- set({ relevantFor: LovCodeRelevans.KRAV_OG_VIRKEMIDDEL })
- }
return (
<>
-
-
+
+
+ set({ lovId: e.target.value })} className="w-full" label="Lov ID" hideLabel />
+
-
-
- {' '}
- Underavdeling:{' '}
-
+
+
set({ underavdeling: val.code })}
- label={'Underavdeling'}
+ label={'underavdeling'}
/>
-
+
-
-
- Tema:{' '}
-
+
+
set({ tema: val.code })}
- label={'Tema'}
+ label={'tema'}
/>
-
+
-
-
- Relevant for:{' '}
-
+
+
set({ relevantFor: val })}
- label={'Relevant for'}
+ label={'relevant for'}
/>
-
+
>
)
}}
-
+
)
}
@@ -108,12 +89,12 @@ export const TemaCodeDataForm = () => {
}))
return (
-
-
-
+
+
+
+
{({ field, form }: FieldProps) => {
const data = field.value
@@ -123,42 +104,40 @@ export const TemaCodeDataForm = () => {
}
return (
<>
-
-
+
+
+
+
+
+
>
)
}}
-
+
)
}
diff --git a/apps/frontend/src/components/admin/CodeList/ModalCreateCodeList.tsx b/apps/frontend/src/components/admin/CodeList/ModalCreateCodeList.tsx
index 43b3808b8..03d4bbc4f 100644
--- a/apps/frontend/src/components/admin/CodeList/ModalCreateCodeList.tsx
+++ b/apps/frontend/src/components/admin/CodeList/ModalCreateCodeList.tsx
@@ -1,30 +1,10 @@
-import * as React from 'react'
-import { Modal, ModalBody, ModalButton, ModalFooter, ModalHeader, ROLE, SIZE } from 'baseui/modal'
-import { Block, BlockProps } from 'baseui/block'
-import { LabelMedium } from 'baseui/typography'
import { Field, FieldProps, Form, Formik } from 'formik'
-import { SIZE as InputSIZE } from 'baseui/input'
-import { Button, KIND } from 'baseui/button'
-import { CodeListFormValues, codeListSchema, ListName } from '../../../services/Codelist'
+import { CodeListFormValues, codeListSchema, ListName, LovCodeRelevans } from '../../../services/Codelist'
import { Error } from '../../common/ModalSchema'
import { LovCodeDataForm, TemaCodeDataForm } from './LovCode'
import { MarkdownInfo } from '../../common/Markdown'
-import CustomizedInput from '../../common/CustomizedInput'
-import CustomizedTextarea from '../../common/CustomizedTextarea'
-import { buttonContentStyle } from '../../common/Button'
-const modalBlockProps: BlockProps = {
- width: '700px',
- paddingRight: '2rem',
- paddingLeft: '2rem',
-}
-
-const rowBlockProps: BlockProps = {
- display: 'flex',
- width: '100%',
- marginTop: '1rem',
- alignItems: 'center',
-}
+import { BodyShort, Button, Label, Modal, TextField, Textarea } from '@navikt/ds-react'
type ModalCreateProps = {
title: string
@@ -37,8 +17,8 @@ type ModalCreateProps = {
const CreateCodeListModal = ({ isOpen, title, list, errorOnCreate, onClose, submit }: ModalCreateProps) => {
return (
- onClose()}>
-
+ onClose()} header={{ heading: title }}>
+
{
submit(values)
@@ -50,79 +30,67 @@ const CreateCodeListModal = ({ isOpen, title, list, errorOnCreate, onClose, subm
code: '',
shortName: '',
description: '',
- data: {},
+ data: {
+ relevantFor: LovCodeRelevans.KRAV_OG_VIRKEMIDDEL
+ },
} as CodeListFormValues
}
validationSchema={codeListSchema}
>
{({ submitForm }) => (
)}
-
+
)
}
diff --git a/apps/frontend/src/components/admin/CodeList/ModalDeleteCodeList.tsx b/apps/frontend/src/components/admin/CodeList/ModalDeleteCodeList.tsx
index 3dc2acc93..78b813630 100644
--- a/apps/frontend/src/components/admin/CodeList/ModalDeleteCodeList.tsx
+++ b/apps/frontend/src/components/admin/CodeList/ModalDeleteCodeList.tsx
@@ -1,10 +1,5 @@
-import * as React from 'react'
-import { Modal, ModalBody, ModalFooter, ModalHeader } from 'baseui/modal'
-import { ParagraphMedium } from 'baseui/typography'
-import { Button } from 'baseui/button'
-import { Block } from 'baseui/block'
import { CodeListFormValues } from '../../../services/Codelist'
-import { buttonContentStyle } from '../../common/Button'
+import { BodyShort, Button, Modal } from '@navikt/ds-react'
type ModalDeleteProps = {
title: string
@@ -17,46 +12,30 @@ type ModalDeleteProps = {
const DeleteCodeListModal = ({ title, initialValues, isOpen, errorOnDelete, submit, onClose }: ModalDeleteProps) => {
return (
-
- {title}
-
-
- {' '}
+
+
+
Bekreft sletting av kode "{initialValues.code}" fra "{initialValues.list}".
-
-
+
+
-
-
- {errorOnDelete && {errorOnDelete}
}
+
+
+
{errorOnDelete && {errorOnDelete}}
-
-
+
+
)
}
diff --git a/apps/frontend/src/components/admin/CodeList/ModalUpdateCodeList.tsx b/apps/frontend/src/components/admin/CodeList/ModalUpdateCodeList.tsx
index bdf02ce94..b53bad2f7 100644
--- a/apps/frontend/src/components/admin/CodeList/ModalUpdateCodeList.tsx
+++ b/apps/frontend/src/components/admin/CodeList/ModalUpdateCodeList.tsx
@@ -1,32 +1,10 @@
-import * as React from 'react'
-import { Modal, ModalBody, ModalButton, ModalFooter, ModalHeader, ROLE, SIZE } from 'baseui/modal'
-
import { Field, FieldProps, Form, Formik, FormikProps } from 'formik'
-import { Button, KIND } from 'baseui/button'
-import { Block, BlockProps } from 'baseui/block'
-import { LabelMedium } from 'baseui/typography'
-import { SIZE as InputSIZE } from 'baseui/input'
import { CodeListFormValues, codeListSchema, ListName } from '../../../services/Codelist'
import { Error } from '../../common/ModalSchema'
import { LovCodeDataForm, TemaCodeDataForm } from './LovCode'
import { MarkdownInfo } from '../../common/Markdown'
-import CustomizedInput from '../../common/CustomizedInput'
-import CustomizedTextarea from '../../common/CustomizedTextarea'
-import { buttonContentStyle } from '../../common/Button'
-
-const modalBlockProps: BlockProps = {
- width: '700px',
- paddingRight: '2rem',
- paddingLeft: '2rem',
-}
-
-const rowBlockProps: BlockProps = {
- display: 'flex',
- width: '100%',
- marginTop: '1rem',
- alignItems: 'center',
-}
+import { BodyShort, Button, Label, Modal, TextField, Textarea } from '@navikt/ds-react'
type ModalUpdateProps = {
title: string
@@ -39,8 +17,8 @@ type ModalUpdateProps = {
const UpdateCodeListModal = ({ title, initialValues, errorOnUpdate, isOpen, onClose, submit }: ModalUpdateProps) => {
return (
-
-
+
+
{
submit(values)
@@ -51,72 +29,58 @@ const UpdateCodeListModal = ({ title, initialValues, errorOnUpdate, isOpen, onCl
>
{(formik: FormikProps) => (
)}
-
+
)
}
diff --git a/apps/frontend/src/components/admin/audit/AuditButton.tsx b/apps/frontend/src/components/admin/audit/AuditButton.tsx
index 9a2453d9d..c4554eb77 100644
--- a/apps/frontend/src/components/admin/audit/AuditButton.tsx
+++ b/apps/frontend/src/components/admin/audit/AuditButton.tsx
@@ -1,40 +1,38 @@
-import { KIND, SIZE as ButtonSize } from 'baseui/button'
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
import { faHistory } from '@fortawesome/free-solid-svg-icons'
-import React from 'react'
import { user } from '../../../services/User'
import RouteLink from '../../common/RouteLink'
-import Button from '../../common/Button'
import { intl } from '../../../util/intl/intl'
+import { Button, ButtonProps, Link, Tooltip } from '@navikt/ds-react'
+import { ClockDashedIcon } from '@navikt/aksel-icons'
-export const AuditButton = (props: {
+interface AuditButtonProps extends ButtonProps {
id: string
fontColor?: string
auditId?: string
- kind?: (typeof KIND)[keyof typeof KIND]
marginLeft?: boolean
marginRight?: boolean
- children?: any
- ariaLabel?: string
-}) => {
+}
+
+
+export const AuditButton = (props: AuditButtonProps) => {
+ const { id, auditId, marginLeft, marginRight, ...restProps } = props
return user.isAdmin() ? (
-
+
{props.children ? (
props.children
) : (
<>
-
+
+ }
+ />
+
>
)}
-
+
) : null
}
diff --git a/apps/frontend/src/components/admin/audit/AuditRecentTable.tsx b/apps/frontend/src/components/admin/audit/AuditRecentTable.tsx
index 4d16f894b..21f3caf2d 100644
--- a/apps/frontend/src/components/admin/audit/AuditRecentTable.tsx
+++ b/apps/frontend/src/components/admin/audit/AuditRecentTable.tsx
@@ -99,7 +99,7 @@ export const AuditRecentTable = (props: { show: boolean; tableType?: ObjectType
{rowNum}
-
+
{moment(audit.time).fromNow()}
diff --git a/apps/frontend/src/components/common/Inputs.tsx b/apps/frontend/src/components/common/Inputs.tsx
index 7b0a71efc..418f18509 100644
--- a/apps/frontend/src/components/common/Inputs.tsx
+++ b/apps/frontend/src/components/common/Inputs.tsx
@@ -20,6 +20,7 @@ import TextEditor from './TextEditor/TextEditor'
import { Error } from './ModalSchema'
import { ettlevColors } from '../../util/theme'
import { borderColor, borderStyle, borderWidth } from './Style'
+import { Select } from '@navikt/ds-react'
export const FieldWrapper = ({ children, marginBottom }: { children: React.ReactNode; marginBottom?: string }) => {
return {children}
@@ -364,7 +365,7 @@ export const OptionField = (
return (
- {(p: FieldProps) => (
+ {(p: FieldProps) => (
} error={p.meta.touched && p.meta.error} caption={props.caption}>
p.form.setFieldValue(props.name, val)} value={p.field.value} />
@@ -375,29 +376,26 @@ export const OptionField = (
}
export const OptionList = (
- props: { label: string; clearable?: boolean; value?: Code | string; onChange: (val?: any) => void } & Or<{ options: Value }, { listName: ListName }>,
+ props: { label: string; value?: string; onChange: (val?: any) => void } & Or<{ options: Value }, { listName: ListName }>,
) => {
const options: Value = props.options || codelist.getParsedOptions(props.listName)
return (
- o.id === (props.listName ? (props.value as Code | undefined)?.code : props.value))}
- onChange={(s) => {
- const val = s.option?.id
- const toSet = props.listName && val ? codelist.getCode(props.listName, val as string) : val
+
)
}
diff --git a/apps/frontend/src/components/common/ModalSchema.tsx b/apps/frontend/src/components/common/ModalSchema.tsx
index d04e709fc..4364e3f20 100644
--- a/apps/frontend/src/components/common/ModalSchema.tsx
+++ b/apps/frontend/src/components/common/ModalSchema.tsx
@@ -1,51 +1,42 @@
import { ErrorMessage } from 'formik'
-import { Block } from 'baseui/block'
-import { KIND as NKIND, Notification } from 'baseui/notification'
-import { LabelMedium } from 'baseui/typography'
-import * as React from 'react'
-import { theme } from '../../util'
-import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
-import { faExclamationCircle } from '@fortawesome/free-solid-svg-icons'
-import { paddingZero } from './Style'
-import CustomizedStatefulTooltip from './CustomizedStatefulTooltip'
-import { ettlevColors } from '../../util/theme'
+import { Alert, Label, Tooltip } from '@navikt/ds-react'
+import { ExclamationmarkIcon } from '@navikt/aksel-icons'
export const Error = (props: { fieldName: string; fullWidth?: boolean }) => (
{(msg) => (
-
+
{!props.fullWidth && }
-
-
+
{msg}
-
-
-
+
+
+
)}
)
-export const ModalLabel = (props: { label?: any; tooltip?: string | React.ReactElement; fullwidth?: boolean }) => {
- const width = props.fullwidth ? { witdh: '100%' } : { minWidth: '25%', maxWidth: '25%' }
+export const ModalLabel = (props: { label?: any; tooltip?: string; fullwidth?: boolean }) => {
return (
-
+
{props.tooltip ? (
-
-
-
- {props.label}
-
-
-
-
-
-
+
+
+
) : (
- {props.label}
+
)}
-
+
)
}
diff --git a/apps/frontend/src/components/common/RouteLink.tsx b/apps/frontend/src/components/common/RouteLink.tsx
index 46a60b41a..07d54b24f 100644
--- a/apps/frontend/src/components/common/RouteLink.tsx
+++ b/apps/frontend/src/components/common/RouteLink.tsx
@@ -112,10 +112,10 @@ export const ObjectLink = (props: ObjectLinkProps) => {
} else link = {props.children}
return props.withHistory ? (
-
+
) : (
link
)
diff --git a/apps/frontend/src/components/kravList/AllKrav.tsx b/apps/frontend/src/components/kravList/AllKrav.tsx
index 8f2007fe1..1b054f4ea 100644
--- a/apps/frontend/src/components/kravList/AllKrav.tsx
+++ b/apps/frontend/src/components/kravList/AllKrav.tsx
@@ -127,11 +127,11 @@ export const AllKrav = () => {
diff --git a/apps/frontend/src/pages/KravListPage.tsx b/apps/frontend/src/pages/KravListPage.tsx
index 4a8882837..acea34d19 100644
--- a/apps/frontend/src/pages/KravListPage.tsx
+++ b/apps/frontend/src/pages/KravListPage.tsx
@@ -1,6 +1,5 @@
import {useEffect, useState} from 'react'
import CustomizedBreadcrumbs from '../components/common/CustomizedBreadcrumbs'
-import RouteLink from '../components/common/RouteLink'
import {user} from '../services/User'
import moment from 'moment'
import {Krav, KravQL} from '../constants'
@@ -48,11 +47,9 @@ export const KravListPage = () => {
{user.isKraveier() && (
-
-
)}
diff --git a/apps/frontend/src/services/Codelist.ts b/apps/frontend/src/services/Codelist.ts
index 8b2b481c2..6ac261c22 100644
--- a/apps/frontend/src/services/Codelist.ts
+++ b/apps/frontend/src/services/Codelist.ts
@@ -196,6 +196,7 @@ export interface CodeUsage {
export interface Use {
id: string
name: string
+ number: string
}
export interface CategoryUsage {
|