Skip to content

Commit

Permalink
Feature/frontend dokument behandlingstema (#3518)
Browse files Browse the repository at this point in the history
* Lagt på felter for behandlingstema i joark-dokument-service JournalpostDTO
* Lagt til behandlingstema select i dolly-frontend og henter denne igjen fra graphql oppslag mot dokarkiv
  • Loading branch information
stigus authored Jun 17, 2024
1 parent ebf89ae commit 2bf526f
Show file tree
Hide file tree
Showing 8 changed files with 470 additions and 443 deletions.
878 changes: 438 additions & 440 deletions apps/dolly-frontend/src/main/js/package-lock.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -2073,6 +2073,7 @@ const mapDokarkiv = (bestillingData, data) => {
obj('Avsender ID', dokarkivKriterier.avsenderMottaker?.id),
obj('Avsender navn', dokarkivKriterier.avsenderMottaker?.navn),
obj('Tema', dokarkivKriterier.tema),
obj('Behandlingstema', dokarkivKriterier.behandlingstema),
obj('Journalførende enhet', dokarkivKriterier.journalfoerendeEnhet),
obj('Ferdigstill journalpost', oversettBoolean(dokarkivKriterier.ferdigstill)),
obj('Sakstype', showLabel('sakstype', dokarkivKriterier.sak?.sakstype)),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import { FormCheckbox } from '@/components/ui/form/inputs/checbox/Checkbox'
import { SelectOptionsManager as Options } from '@/service/SelectOptions'
import { UseFormReturn } from 'react-hook-form/dist/types'
import { useFormContext } from 'react-hook-form'
import { Option } from '@/service/SelectOptionsOppslag'
import { useKodeverk } from '@/utils/hooks/useKodeverk'

const Digitalinnsending = React.lazy(
() => import('@/components/fagsystem/dokarkiv/form/partials/Digitalinnsending'),
Expand Down Expand Up @@ -48,6 +50,7 @@ export type Vedlegg = {
enum Kodeverk {
TEMA = 'Tema',
NAVSKJEMA = 'NAVSkjema',
BEHANDLINGSTEMA = 'Behandlingstema',
}

export const dokarkivAttributt = 'dokarkiv'
Expand All @@ -58,6 +61,7 @@ export const DokarkivForm = () => {
const digitalInnsending = formMethods.watch('dokarkiv.avsenderMottaker')
const [files, setFiles] = useState(sessionDokumenter || [])
const [skjemaValues, setSkjemaValues] = useState(formMethods.watch('dokarkiv.skjema'))
const { kodeverk: behandlingstemaKodeverk, loading } = useKodeverk('Behandlingstema')

if (!_.has(formMethods.getValues(), dokarkivAttributt)) {
return null
Expand Down Expand Up @@ -101,7 +105,7 @@ export const DokarkivForm = () => {
formMethods.trigger('dokarkiv.vedlegg')
}

const handleSakstypeChange = (target) => {
const handleSakstypeChange = (target: Option) => {
formMethods.setValue('dokarkiv.sak.sakstype', target.value)
if (target.value !== 'FAGSAK') {
formMethods.setValue('dokarkiv.sak.fagsaksystem', '')
Expand Down Expand Up @@ -145,6 +149,13 @@ export const DokarkivForm = () => {
size="xlarge"
isClearable={false}
/>
<FormSelect
name="dokarkiv.behandlingstema"
label="Behandlingstema"
size={'xxlarge'}
options={!loading && behandlingstemaKodeverk}
isClearable={true}
/>
<DollyTextInput
onChange={(event: BaseSyntheticEvent) => {
formMethods.setValue(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,16 @@ export default ({ journalpost, miljoe }: Props) => (
<TitleValue title="Tittel" value={journalpost.tittel} />
<TitleValue title="Kanal" value={journalpost.kanal} />
<TitleValue title="Tema" value={journalpost.tema} />
<TitleValue title="Journalførende enhet" value={journalpost.journalfoerendeEnhet} />
<TitleValue title="Sakstype" value={showLabel('sakstype', journalpost.sak?.sakstype)} />
<TitleValue
title="Behandlingstema"
value={`${journalpost.behandlingstemanavn || ''} (${journalpost.behandlingstema})`}
/>
<TitleValue
title="Fagsaksystem"
value={showLabel('fagsaksystem', journalpost.sak?.fagsaksystem)}
/>
<TitleValue title="Journalførende enhet" value={journalpost.journalfoerendeEnhet} />
<TitleValue title="Sakstype" value={showLabel('sakstype', journalpost.sak?.sakstype)} />
<TitleValue title="Fagsak-ID" value={journalpost.sak?.fagsakId} />
<TitleValue title="Journalpost-ID" value={journalpost.journalpostId} />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ export type Journalpost = {
tittel: string
avsenderMottaker: AvsenderMottaker
tema: string
behandlingstema: string
behandlingstemanavn: string
kanal: string
journalfoerendeEnhet: string
sak: Sak
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,5 +143,12 @@ export const SortKodeverkArray = (data) => {
return kodeverk.filter((kode) => kode.value !== 'permittering')
}

if (data.name === 'Behandlingstema') {
return kodeverk.map((kode) => ({
label: `${kode.label} (${kode.value})`,
value: kode.value,
}))
}

return kodeverk
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ public class JournalpostDTO {
Integer journalpostId;
String tittel;
String temanavn;
String behandlingstema;
String behandlingstemanavn;
AvsenderMottakerDTO avsenderMottaker;
List<DokumentDTO> dokumenter;
SakDTO sak;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ query journalpost($journalpostId: String!) {
journalpost(journalpostId: $journalpostId) {
journalpostId
temanavn
behandlingstema
behandlingstemanavn
avsenderMottaker {
type
id
Expand Down

0 comments on commit 2bf526f

Please sign in to comment.