Skip to content

Commit

Permalink
Bestillingsvisning dokarkiv
Browse files Browse the repository at this point in the history
  • Loading branch information
betsytraran committed Dec 19, 2024
1 parent d1b2471 commit aafc168
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ import { Inst } from '@/components/fagsystem/inst/bestilling/Inst'
import { Krrstub } from '@/components/fagsystem/krrstub/bestilling/Krrstub'
import { Medl } from '@/components/fagsystem/medl/bestilling/Medl'
import { Udistub } from '@/components/fagsystem/udistub/bestilling/Udistub'
import { Dokarkiv } from '@/components/fagsystem/dokarkiv/bestilling/Dokarkiv'

export const BestillingTitle = styled.h4`
margin: 5px 0 15px 0;
Expand Down Expand Up @@ -150,6 +151,7 @@ export const Bestillingsdata = ({ bestilling }: any) => {
<Krrstub krrstub={bestilling.krrstub} />
<Medl medl={bestilling.medl} />
<Udistub udistub={bestilling.udistub} />
<Dokarkiv dokarkiv={bestilling.dokarkiv} />
</>
)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import React from 'react'
import { ErrorBoundary } from '@/components/ui/appError/ErrorBoundary'
import { BestillingData, BestillingTitle } from '@/components/bestilling/sammendrag/Bestillingsdata'
import { isEmpty } from '@/components/fagsystem/pdlf/form/partials/utils'
import { TitleValue } from '@/components/ui/titleValue/TitleValue'
import { oversettBoolean, showLabel } from '@/utils/DataFormatter'
import { Kodeverk } from '@/components/fagsystem/dokarkiv/form/DokarkivForm'
import { Journalpost } from '@/service/services/JoarkDokumentService'

type DokarkivProps = {
dokarkiv: Journalpost
}

export const Dokarkiv = ({ dokarkiv }: DokarkivProps) => {
if (!dokarkiv || isEmpty(dokarkiv)) {
return null
}

return (
<div className="person-visning">
<ErrorBoundary>
<BestillingTitle>Dokumenter (Joark)</BestillingTitle>
<BestillingData>
<TitleValue title="Brevkode" value={dokarkiv.dokumenter?.[0]?.brevkode} />
<TitleValue title="Tittel" value={dokarkiv.tittel} />
<TitleValue title="Tema" value={dokarkiv.tema} kodeverk={Kodeverk.TEMA} />
<TitleValue
title="Behandlingstema"
value={dokarkiv.behandlingstema}
kodeverk={Kodeverk.BEHANDLINGSTEMA}
/>
<TitleValue title="Journalførende enhet" value={dokarkiv.journalfoerendeEnhet} />
<TitleValue title="Sakstype" value={showLabel('sakstype', dokarkiv.sak?.sakstype)} />
<TitleValue
title="Fagsaksystem"
value={showLabel('fagsaksystem', dokarkiv.sak?.fagsaksystem)}
/>
<TitleValue title="Fagsak-ID" value={dokarkiv.sak?.fagsakId} />
<TitleValue
title="Ferdigstill journalpost"
value={oversettBoolean(dokarkiv.ferdigstill)}
/>
<TitleValue title="Avsender type" value={dokarkiv.avsenderMottaker?.idType} />
<TitleValue title="Avsender ID" value={dokarkiv.avsenderMottaker?.id} />
<TitleValue title="Avsender navn" value={dokarkiv.avsenderMottaker?.navn} />
<TitleValue title="Antall vedlegg" value={dokarkiv.vedlegg?.length || '0'} />
</BestillingData>
</ErrorBoundary>
</div>
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export type Vedlegg = {
}
}

enum Kodeverk {
export enum Kodeverk {
TEMA = 'Tema',
NAVSKJEMA = 'NAVSkjema',
BEHANDLINGSTEMA = 'Behandlingstema',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,19 @@ export type Journalpost = {
dokumenter: Dokument[]
miljoe: string
bestillingId?: number
ferdigstill?: boolean
vedlegg?: any[]
}

export type Dokument = {
dokumentInfoId: number
tittel?: string
brevkode?: string
}

type AvsenderMottaker = {
id: string
idType?: string
navn: string
type: string
}
Expand Down

0 comments on commit aafc168

Please sign in to comment.