Skip to content

Commit

Permalink
Lagt til forventet sluttdato for inst
Browse files Browse the repository at this point in the history
  • Loading branch information
betsytraran committed Dec 18, 2024
1 parent cb75684 commit 8ae0905
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1722,6 +1722,7 @@ const mapInst = (bestillingData, data) => {
institusjonstype: i.institusjonstype,
varighet: i.varighet,
startdato: i.startdato,
forventetSluttdato: i.forventetSluttdato,
sluttdato: i.sluttdato,
})
})
Expand All @@ -1739,6 +1740,7 @@ const mapInst = (bestillingData, data) => {
obj('Institusjonstype', showLabel('institusjonstype', inst.institusjonstype)),
obj('Varighet', inst.varighet && showLabel('varighet', inst.varighet)),
obj('Startdato', formatDate(inst.startdato)),
obj('Forventet sluttdato', formatDate(inst.forventetSluttdato)),
obj('Sluttdato', formatDate(inst.sluttdato)),
])
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ InstitusjonsoppholdPanel.initialValues = ({ set, del, has }) => ({
{
institusjonstype: runningE2ETest() ? 'AS' : '',
startdato: runningE2ETest() ? new Date() : '',
forventetSluttdato: '',
sluttdato: '',
},
])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { useFormContext } from 'react-hook-form'
export const initialValues = {
institusjonstype: '',
startdato: '',
forventetSluttdato: '',
sluttdato: '',
}
export const instAttributt = 'instdata'
Expand Down Expand Up @@ -56,6 +57,12 @@ export const InstForm = () => {
excludeDates={excludeDates}
maxDate={maxDate}
/>
<FormDatepicker
name={`${path}.forventetSluttdato`}
label="Forventet sluttdato"
excludeDates={excludeDates}
maxDate={maxDate}
/>
<FormDatepicker
name={`${path}.sluttdato`}
label="Sluttdato"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ export const validation = {
Yup.object({
institusjonstype: requiredString,
startdato: datoOverlapperIkkeAndreOppholdTest(requiredDate, true),
forventetSluttdato: Yup.string().nullable(),
sluttdato: datoOverlapperIkkeAndreOppholdTest(Yup.string().nullable(), false),
}),
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ export const InstVisning = ({ data, loading, bestillingIdListe, tilgjengeligMilj
value={showLabel('institusjonstype', opphold.institusjonstype)}
/>
<TitleValue title="Startdato" value={formatStringDates(opphold.startdato)} />
<TitleValue
title="Forventet sluttdato"
value={formatStringDates(opphold.forventetSluttdato)}
/>
<TitleValue title="Sluttdato" value={formatStringDates(opphold.sluttdato)} />
</div>
)}
Expand Down

0 comments on commit 8ae0905

Please sign in to comment.