Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
d967ea4
Enable `babel-plugin-react-compiler` and update dependencies
stigus Apr 25, 2025
16bca42
Merge branch 'master' into feature/react-compiler-migration
stigus Apr 29, 2025
b73b723
- Fikser lås funksjonalitet som ikke oppdaterte gruppe etter sending,…
stigus Apr 29, 2025
692790f
Merge branch 'master' into feature/react-compiler-migration
stigus Apr 29, 2025
ebda102
- Testing for the Laas functionality in GruppeHeader, some refactorings
stigus Apr 30, 2025
244c681
- Refactored enkelInntektsmeldingVisning to fix a bug with virksomhet…
stigus May 6, 2025
10b1e81
Merge branch 'master' into feature/react-compiler-migration
stigus May 6, 2025
4e41acd
deploy
stigus May 6, 2025
c49b2a1
Mindre endringer og fix for test
stigus May 6, 2025
f70281e
Merge branch 'master' into feature/react-compiler-migration
stigus Aug 14, 2025
eea64c2
- Remove deprecated `FormFieldInput` component and replace with `Doll…
stigus Aug 14, 2025
d972364
- Refactor `stateModifier.tsx` to improve readability and performance…
stigus Aug 15, 2025
8410d22
- Refactor `Attributt` and `AttributtKategori` components to improve …
stigus Aug 15, 2025
af9f586
Fjernet en haug av AI generert tull (prøvde GPT-5 for å refaktorere m…
stigus Aug 15, 2025
4009bd9
- Refactor `Attributt` and `AttributtKategori` components with improv…
stigus Aug 18, 2025
023768e
Merge branch 'master' into feature/react-compiler-migration
stigus Aug 18, 2025
c9801c5
- Replace imports from `SoekForm` to `SoekFormWrapper` across compone…
stigus Aug 20, 2025
44cfcdf
Merge branch 'master' into feature/react-compiler-migration
stigus Sep 9, 2025
ebf93d7
Merge branch 'master' into feature/react-compiler-migration
stigus Sep 9, 2025
0e6dea6
Merge branch 'master' into feature/react-compiler-migration
stigus Sep 9, 2025
4b789d3
- Bump project version to `3.2.0` in `package.json` and `package-lock…
stigus Sep 9, 2025
ba35cb6
- Update `mockServiceWorker.js` for latest `msw` version `2.11.2` cha…
stigus Sep 11, 2025
6828473
Merge branch 'master' into feature/react-compiler-migration
stigus Oct 3, 2025
e619788
- Merge master, update, fix conflicts
stigus Oct 3, 2025
7d07ab8
Merge branch 'master' into feature/react-compiler-migration
stigus Oct 3, 2025
ffa8a88
- Add `useControlled` prop to multiple `DollyTextInput` components fo…
stigus Oct 3, 2025
5accb88
- Refactor `CreateInfostripeForm` to use a function for default value…
stigus Oct 3, 2025
e59a5f6
- Update `hentAlle` method in `InfostripeController` to include an op…
stigus Oct 3, 2025
5949732
- Update `useDollyInfostriper` to accept an optional parameter for in…
stigus Oct 3, 2025
44688dc
- Add `useControlled` prop to `FormTextInput` for consistent controll…
stigus Oct 3, 2025
2effaf9
Merge branch 'master' into feature/react-compiler-migration
stigus Oct 6, 2025
c85fb48
- Update `@asamuzakjp/dom-selector` to version 6.6.1
stigus Oct 6, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,14 @@
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;

import static org.apache.commons.lang3.BooleanUtils.isTrue;

@Slf4j
@RestController
@RequiredArgsConstructor
Expand All @@ -34,11 +37,14 @@ public class InfostripeController {
private final MapperFacade mapperFacade;

@GetMapping
@Operation(description = "Hent alle gyldige informasjonsmeldinger")
public Flux<InfostripeMelding> hentAlle() {
@Operation(description = "Hent alle gjeldende informasjonsmeldinger")
public Flux<InfostripeMelding> hentAlle(@RequestParam(required = false, defaultValue = "false", name = "inkluderFremtidige") boolean inkluderFremtidige) {

return informasjonsmeldingRepository.findGyldigMeldinger()
.map(melding -> mapperFacade.map(melding, InfostripeMelding.class));
return isTrue(inkluderFremtidige) ?
informasjonsmeldingRepository.findGjeldendeOgFremtidigeMeldinger()
.map(melding -> mapperFacade.map(melding, InfostripeMelding.class)) :
informasjonsmeldingRepository.findGjeldendeMeldinger()
.map(melding -> mapperFacade.map(melding, InfostripeMelding.class));
}

@PostMapping
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,12 @@ public interface InformasjonsmeldingRepository extends ReactiveCrudRepository<In
(i.expires is null or i.expires >= current_timestamp)
order by i.id desc
""")
Flux<InfoStripe> findGyldigMeldinger();
Flux<InfoStripe> findGjeldendeMeldinger();

@Query("""
select * from info_stripe i where
(i.expires is null or i.expires >= current_timestamp)
order by i.id desc
""")
Flux<InfoStripe> findGjeldendeOgFremtidigeMeldinger();
}
494 changes: 254 additions & 240 deletions apps/dolly-frontend/src/main/js/package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion apps/dolly-frontend/src/main/js/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dolly",
"version": "3.1.13",
"version": "3.2.0",
"type": "module",
"description": "",
"main": "index.js",
Expand Down
5 changes: 0 additions & 5 deletions apps/dolly-frontend/src/main/js/playwright.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,11 @@ export default defineConfig({
},
},

/* Configure projects for major browsers */
projects: [
{
name: 'Google Chrome',
use: { ...devices['Desktop Chrome'], channel: 'chrome' },
},
{
name: 'Microsoft Edge',
use: { ...devices['Desktop Edge'], channel: 'msedge' },
},
],

/* Run the local dev server before starting the tests */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@ test('Åpne bestilt ident med knytning mot alle fagsystem', async ({ page }) =>
})
await page.getByTestId(TestComponentSelectors.TOGGLE_VISNING_PERSONER).click()
await page.getByTestId(TestComponentSelectors.TOGGLE_PERSON_IBRUK).click()
await expect(page.getByTestId(TestComponentSelectors.TOGGLE_PERSON_IBRUK)).toBeEnabled()
await expect(page.getByTestId(TestComponentSelectors.TOGGLE_PERSON_IBRUK)).toBeChecked()
await page.getByTestId(TestComponentSelectors.TOGGLE_PERSON_IBRUK).click()
await expect(page.getByTestId(TestComponentSelectors.TOGGLE_PERSON_IBRUK)).not.toBeChecked()

await page.getByTestId(TestComponentSelectors.BUTTON_OPEN_IDENT).click()
await page.getByTestId(TestComponentSelectors.BUTTON_OPEN_BESTILLINGSDETALJER).click()
await page.waitForTimeout(300)
Expand All @@ -40,6 +42,7 @@ test('Åpne bestilt ident med knytning mot alle fagsystem', async ({ page }) =>

for (const hover_miljoe of await page.getByTestId(TestComponentSelectors.HOVER_MILJOE).all()) {
await hover_miljoe.click()
await page.waitForTimeout(200)
await page.getByTestId(TestComponentSelectors.BUTTON_OPEN_KONTAKTINFO).hover()
// Hover over kontaktinfo for å lukke gjeldende åpne miljø hover
await page.waitForTimeout(200)
Expand Down
2 changes: 0 additions & 2 deletions apps/dolly-frontend/src/main/js/src/allRoutes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ const NyansettelserPage = lazyWithPreload(() => import('@/pages/nyansettelser/Ny
const GruppeOversikt = lazyWithPreload(() => import('@/pages/gruppeOversikt/GruppeOversikt'))
const Organisasjon = lazyWithPreload(() => import('@/pages/organisasjoner/Organisasjoner'))
const MinSide = lazyWithPreload(() => import('@/pages/minSide/MinSide'))
const UI = lazyWithPreload(() => import('@/pages/ui/index'))
const Endringsmelding = lazyWithPreload(() => import('@/pages/endringsmelding/Endringsmelding'))
const DollySoekPage = lazyWithPreload(() => import('@/pages/dollySoek/DollySoekPage'))
const TenorSoekPage = lazyWithPreload(() => import('@/pages/tenorSoek/TenorSoekPage'))
Expand Down Expand Up @@ -85,7 +84,6 @@ const allRoutes = [
element: Bestillingsveileder,
},
{ path: '/minside', handle: { crumb: () => 'Min side' }, element: MinSide },
{ path: '/ui', handle: { crumb: () => 'UI demo' }, element: UI },
{
path: '/dollysoek',
handle: { crumb: () => 'Søk i Dolly' },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { FormTextInput } from '@/components/ui/form/inputs/textInput/TextInput'
import { Option } from '@/service/SelectOptionsOppslag'
import {
BestillingsveilederContext,
BestillingsveilederContextType,
BestillingsveilederContextType
} from '@/components/bestillingsveileder/BestillingsveilederContext'
import { useDollyEnvironments } from '@/utils/hooks/useEnvironments'
import { BVOptions } from '@/components/bestillingsveileder/options/options'
Expand Down Expand Up @@ -40,6 +40,7 @@ export function NyIdent({ gruppeId }: any) {
isClearable={false}
/>
<FormTextInput
useControlled
name="antall"
label="Antall"
type="number"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import { useContext } from 'react'
import { UseFormReturn } from 'react-hook-form'
import { BestillingsveilederContext } from './BestillingsveilederContext'
import { BestillingsveilederContext, BestillingsveilederContextType } from './BestillingsveilederContext'
import * as _ from 'lodash-es'

export const useStateModifierFns = (formMethods: UseFormReturn, setFormMutate: any) => {
Copy link
Preview

Copilot AI Sep 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The 'use no memo' directive and its purpose should be documented more clearly. Consider adding a comment explaining why React Compiler optimization is being skipped for this specific component.

Suggested change
export const useStateModifierFns = (formMethods: UseFormReturn, setFormMutate: any) => {
export const useStateModifierFns = (formMethods: UseFormReturn, setFormMutate: any) => {
// React Compiler optimization is skipped for this hook because it relies on dynamic form state,
// mutable context, and side effects that are not compatible with automatic memoization.
// Ensuring up-to-date values and correct behavior requires disabling memoization here.

Copilot uses AI. Check for mistakes.

const { setValue, watch, resetField, getValues, reset, formState } = formMethods
'use no memo' // Skip compilation for this component

const { setValue, watch, resetField, getValues, reset } = formMethods
const opts = useContext(BestillingsveilederContext) as BestillingsveilederContextType

const set = (path: string, value: any) => setValue(path, value)
Expand All @@ -13,16 +15,15 @@ export const useStateModifierFns = (formMethods: UseFormReturn, setFormMutate: a
const delMutate = () => setFormMutate?.(() => undefined)

const del = (path: string | string[]) => {
if (Array.isArray(path)) {
path.forEach((p) => resetField(p))
} else {
resetField(path)
}
let newObj = _.omit(getValues(), path)
if (Array.isArray(path)) path.forEach((p) => resetField(p))
else resetField(path)

// Ingen tomme objekter guard
let newObj = _.omit(getValues(), path)
let rootPath = Array.isArray(path) ? path[0].split('.')[0] : path.split('.')[0]
if (path.includes('pdldata.person') || path[0].includes('pdldata.person'))
if (
(Array.isArray(path) && path[0].includes('pdldata.person')) ||
(!Array.isArray(path) && path.includes('pdldata.person'))
)
rootPath = 'pdldata.person'
if (_.isEmpty(_.get(newObj, rootPath))) newObj = _.omit(newObj, rootPath)
reset(newObj)
Expand All @@ -34,8 +35,8 @@ export const useStateModifierFns = (formMethods: UseFormReturn, setFormMutate: a

const allCheckedLabels = (attrs: Record<string, any>) =>
Object.values(attrs)
.filter((a) => a.checked)
.map((b) => b.label)
.filter((a: any) => a.checked) // getter recomputed each render
.map((b: any) => b.label)

const batchUpdate = (
attrs: Record<string, any>,
Expand All @@ -60,8 +61,19 @@ export const useStateModifierFns = (formMethods: UseFormReturn, setFormMutate: a
methods: UseFormReturn
}) => Record<string, any>,
) => {
// Build attrs with checked as a getter tied to form values
const attrs =
fn({ set, setMulti, opts, del, delMutate, has, values, methods: formMethods }) || {}
fn({
set,
setMulti,
opts,
del,
delMutate,
has,
values,
methods: formMethods,
}) || {}

const checked = allCheckedLabels(attrs)
return {
attrs,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,29 +1,43 @@
import { DollyCheckbox } from '@/components/ui/form/inputs/checbox/Checkbox'
import { CheckboxGroup } from '@navikt/ds-react'
import { DollyCheckbox } from '@/components/ui/form/inputs/checbox/Checkbox'
import { Hjelpetekst } from '@/components/hjelpetekst/Hjelpetekst'
import React from 'react'

export const Attributt = ({
interface AttrItem {
label: string
readonly checked: boolean
add: () => void
remove: () => void
}
interface AttributtProps {
attr: AttrItem
vis?: boolean
disabled?: boolean
title?: string
id?: string
infoTekst?: string
[key: string]: any
}
export const Attributt: React.FC<AttributtProps> = ({
attr,
vis = true,
disabled = false,
title = null,
id = null,
title,
id,
infoTekst = '',
...props
}) => {
if (!vis) {
return null
}
if (!vis) return null
return (
<div title={title} style={{ display: 'flex' }}>
<DollyCheckbox
wrapperSize={null}
label={attr?.label}
attributtCheckbox={true}
size={'small'}
onChange={attr?.checked ? attr?.remove : attr?.add}
value={attr?.label}
isDisabled={disabled}
wrapperSize="grow"
label={attr.label}
attributtCheckbox
size="small"
onChange={(e) => (e.target.checked ? attr.add() : attr.remove())}
value={attr.label}
disabled={disabled}
id={id}
{...props}
/>
Expand All @@ -34,21 +48,24 @@ export const Attributt = ({
)
}

export const AttributtKategori = ({ title, children, attr }) => {
interface AttributtKategoriProps {
title: string
children: React.ReactNode
attr: Record<string, AttrItem>
}
export const AttributtKategori: React.FC<AttributtKategoriProps> = ({ title, children, attr }) => {
'use no memo' // Skip compilation for this component
const values = attr && Object.values(attr)
const checked = values
?.filter((attribute) => attribute.checked)
?.map((attribute) => attribute.label)
const checkedValues = values?.filter((a) => a.checked)?.map((a) => a.label) || []

const attributter = Array.isArray(children) ? children : [children]
const attributterSomSkalVises = attributter.some(
(attr) => attr.props.vis || !attr.props.hasOwnProperty('vis'),
const showAny = attributter.some(
(child: any) => child?.props?.vis || !child?.props?.hasOwnProperty('vis'),
)
if (!attributterSomSkalVises) {
return null
}
if (!showAny) return null

return (
<CheckboxGroup name={title} legend={title} value={checked}>
<CheckboxGroup name={title} legend={title} value={checkedValues}>
<div className="attributt-velger_panelsubcontent">{children}</div>
</CheckboxGroup>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ export const MalOppsummering = ({
/>
) : (
<FormTextInput
useControlled
data-testid={TestComponentSelectors.INPUT_BESTILLING_MALNAVN}
name="malBestillingNavn"
size={'xlarge'}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { useNavigate } from 'react-router'
import { useGruppeById } from '@/utils/hooks/useGruppe'
import { REGEX_BACKEND_GRUPPER, useMatchMutate } from '@/utils/hooks/useMutate'
import { Form, FormProvider, useForm } from 'react-hook-form'
import { FormProvider, useForm } from 'react-hook-form'
import { yupResolver } from '@hookform/resolvers/yup'
import * as Yup from 'yup'
import { DollyApi } from '@/service/Api'
import React, { useState } from 'react'
import Loading from '@/components/ui/loading/Loading'
import NavButton from '@/components/ui/button/NavButton/NavButton'
import { TestComponentSelectors } from '#/mocks/Selectors'
import { FormTextInput } from '@/components/ui/form/inputs/textInput/TextInput'
import { DollyTextInput } from '@/components/ui/form/inputs/textInput/TextInput'
import './RedigerGruppe.less'
import { Alert } from '@navikt/ds-react'

Expand Down Expand Up @@ -98,17 +98,6 @@ export const RedigerGruppe = ({ gruppeId, onCancel }: Props) => {
data-testid={TestComponentSelectors.BUTTON_OPPRETT}
variant={'primary'}
type={'submit'}
onClick={() => {
formMethods.trigger(['navn', 'hensikt'])
formMethods.setValue('navn', formMethods.getValues('navn'), {
shouldValidate: true,
shouldTouch: true,
})
formMethods.setValue('hensikt', formMethods.getValues('hensikt'), {
shouldValidate: true,
shouldTouch: true,
})
}}
>
{erRedigering ? 'Lagre' : 'Opprett og gå til gruppe'}
</NavButton>
Expand All @@ -120,27 +109,26 @@ export const RedigerGruppe = ({ gruppeId, onCancel }: Props) => {

return (
<FormProvider {...formMethods}>
<Form
control={formMethods.control}
<form
className={'opprett-tabellrad'}
autoComplete={'off'}
onSubmit={formMethods.handleSubmit(erRedigering ? handleUpdateGruppe : handleCreateGruppe)}
>
<div className="fields">
<FormTextInput
<DollyTextInput
useControlled
data-testid={TestComponentSelectors.INPUT_NAVN}
name="navn"
label="NAVN"
size="grow"
useOnChange={true}
autoFocus
/>
<FormTextInput
<DollyTextInput
useControlled
data-testid={TestComponentSelectors.INPUT_HENSIKT}
name="hensikt"
label="HENSIKT"
size="grow"
useOnChange={true}
/>
{buttons}
</div>
Expand All @@ -149,7 +137,7 @@ export const RedigerGruppe = ({ gruppeId, onCancel }: Props) => {
{feilmelding}
</Alert>
)}
</Form>
</form>
</FormProvider>
)
}
Loading