-
Notifications
You must be signed in to change notification settings - Fork 42
[Aksel.nav.no] Migrated more components over to new PortableText component #3689
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
Conversation
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR migrates several components over to use the new PortableText component and cleans up unused Sanity types. Key changes include updating UI components (such as RelatertInnhold, Bilde, PropsSeksjon, Tips, etc.) to work with the new structure, removing obsolete Sanity type definitions and properties, and adjusting utility functions (e.g. getStatusTag) to support the migration.
Reviewed Changes
Copilot reviewed 42 out of 48 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
RelatertInnhold.tsx | Introduces a new component for rendering related content links. |
Bilde.tsx | Updates the image component to work with the new Sanity image utilities. |
PropsSeksjon.tsx | Refactors the prop table component including injection of an overridable prop. |
Tips.tsx | Adds a component for rendering tip blocks. |
types.ts | Removes unused types and adds new properties to Ds_props for better type‐checking. |
query-types.ts | Cleans up deprecated type definitions and properties in the Sanity schema. |
theme-config.ts | Updates getStatusTag to accept an additional parameter for excluding stable tags. |
Sidebar.item.tsx | Adjusts sidebar item rendering to use the updated status tag logic. |
CustomPortableText.components.tsx | Integrates new portable text component mappings for a variety of content types. |
TableV2.tsx, DoDont.tsx, etc. | Additional UI components updated as part of the migration. |
Files not reviewed (6)
- aksel.nav.no/website/app/_ui/bilde/Bilde.module.css: Language not supported
- aksel.nav.no/website/app/_ui/do-dont/DoDont.module.css: Language not supported
- aksel.nav.no/website/app/_ui/props-seksjon/PropsSeksjon.module.css: Language not supported
- aksel.nav.no/website/app/_ui/relatert-innhold/RelatertInnhold.module.css: Language not supported
- aksel.nav.no/website/app/_ui/tips/Tips.module.css: Language not supported
- aksel.nav.no/website/app/_ui/typography/Typography.module.css: Language not supported
Comments suppressed due to low confidence (2)
aksel.nav.no/website/app/_ui/theme-config.ts:35
- The new optional parameter 'ignoreStable' should be documented clearly to ensure that its behavior is well understood by future maintainers and that its usage at call sites (such as in Sidebar.item.tsx) remains intentional.
function getStatusTag(statusTag: StatusTagT, ignoreStable = false) {
aksel.nav.no/website/app/_ui/props-seksjon/PropsSeksjon.tsx:33
- [nitpick] Since 'propList' is obtained from a filter (thus creating a new array), using push here is acceptable, but consider using a non-mutating approach (like concatenation) if immutability is a concern for future refactors.
if (overridable) { propList.push({ description: "OverridableComponent-api", required: false, name: "as", type: "React.ElementType", _type: "prop", _key: "overridable", }); }
Description
Flyttet/Skrevet om "moduler" til å fungere med App-router og ny PortableText struktur. Bruker nå typene hentet direkte fra sanity for bedre typesjekking.
Endringer i Sanity
Fjernet ubrukte/unike typer som ikke var nødvendige:
Type removals:
Innholdskort
type definition.Tastatur_modul
type definition.Herobilde
type definition.Property removals:
hero_bilde
property from theAksel_prinsipp
type.Tastatur_modul
from theRiktekst_komponent
type.Property additions:
return
,params
, andexample
properties to theDs_props
type.Component Checklist 📝
@navikt/core/css/config/_mappings.js
)@navikt/core/css/tokens.json
)@navikt/aksel-stylelint/src/deprecations.ts
)@navikt/core/react/src/index.ts
and@navikt/core/react/package.json
)@navikt/core/css/index.css
)<Component>: <gitmoji?> <Text>.
E.g. "Button: ✨ Add feature xyz.")