Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore: Bytt ut bruk av familie-form-elements med komponenter fra Aksel #1639

Merged
merged 32 commits into from
Feb 21, 2024

Conversation

idaame
Copy link
Contributor

@idaame idaame commented Feb 16, 2024

Favro: https://favro.com/organization/98c34fb974ce445eac854de0/1844bbac3b6605eacc8f5543?card=NAV-17446

Skriver oss bort fra familie-form-elements og bruker heller komponenter direkte fra Aksel.

Burde nok leses commit for commit. Tror alt i ett kan være lettere, har blitt litt mye frem og tilbake på slutten.
Har lagt ved en del skjermbilder, men ikke over alt fordi jeg mener det ikke er nødvendig.

Største forskjellen er nok at flere elementer nå bruker Aksel sin readonly-prop, som gjør at man rendrer komponenten nesten likt uansett om du kan redigere den eller ikke. Se eksempel for forskjell her.

Før
image

Etter
image

@idaame idaame requested a review from a team as a code owner February 16, 2024 11:33
Copy link
Contributor Author

Choose a reason for hiding this comment

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

image

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Lesevisning
image

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Før
image

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Eksempel:
image

Copy link
Contributor Author

Choose a reason for hiding this comment

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

image

Copy link
Contributor Author

Choose a reason for hiding this comment

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

image

Copy link
Contributor Author

@idaame idaame Feb 16, 2024

Choose a reason for hiding this comment

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

image

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Lesevisning
image

Ikke lesevisning
image
image
image

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Før:
image

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Lesevisning
image

@@ -30,7 +30,6 @@
"@navikt/ds-tokens": "^5.12.0",
"@navikt/familie-backend": "^10.0.7",
"@navikt/familie-datovelger": "0.2.0",
"@navikt/familie-form-elements": "^14.0.0",
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

🙌

? foreldelsevurderinger[periode.foreldelsesvurderingstype]
: ''
}
value={skjema.felter.foreldelsesvurderingstype.verdi}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Kan ikke mappe om til streng lenger når det er lesevisning, fordi ved lesevisning rendrer vi nå fortsatt selve radiogruppen og ikke en tekststreng. Dette feltet blir satt til periode.foreldelsesvurderingstype i en useEffect lenger opp her, så det burde fortsatt ha riktig verdi i lesevisning

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Se bilder i kommentar her #1639 (comment)

>
{behandlingsTyper.map(opt => (
{Object.values(Behandlingstype).map(opt => (
Copy link
Contributor Author

Choose a reason for hiding this comment

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

behandlingsTyper var en liste med de to verdiene som finnes for Behandlingstype så bruker heller enumen direkte

erLesevisning={erLesevisning}
tekstLesevisning={underavsnitt.fritekst || 'Fritekst ikke utfylt'}
className={
erLesevisning && !underavsnitt.fritekst ? 'lesevisning_ikke_utfylt' : ''
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fant ingen styling trigget av lesevisning_ikke_utfylt

onChange={event => onChangeVergeType(event)}
>
<option disabled={true} value={''}>
Velg vergetype
</option>
{vergeTyper
{Object.values(Vergetype)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

vergeTyper var en liste med alle verdiene i Vergetype-enum, med unntak av UDEFINERT, som uansett blir filtrert ut her

Copy link
Contributor

@halvorbmundal halvorbmundal left a comment

Choose a reason for hiding this comment

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

Copy link
Contributor

@charliemidtlyng charliemidtlyng left a comment

Choose a reason for hiding this comment

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

Ser veldig bra ut, dette!

@idaame idaame merged commit af70918 into main Feb 21, 2024
3 checks passed
@idaame idaame deleted the chore/aksel-oppgraderinger branch February 21, 2024 08:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants