Skip to content

Upgrade and migrate to HDS v4#917

Merged
nikomakela merged 11 commits into
mainfrom
HCRC-178-hds-v4
Nov 26, 2025
Merged

Upgrade and migrate to HDS v4#917
nikomakela merged 11 commits into
mainfrom
HCRC-178-hds-v4

Conversation

@nikomakela

@nikomakela nikomakela commented Nov 20, 2025

Copy link
Copy Markdown
Contributor

HCRC-178

NOTE: A real stable version of HCRC -lib needs to be used instead of canary. It should be installed when the related HCRC -lib changes are merged and published in a stable release. A related PR: City-of-Helsinki/react-helsinki-headless-cms#205.

This pull request encompasses a critical upgrade of the Helsinki Design System (HDS) and Helsinki Component Registry (HCRC) libraries, alongside the complete implementation of the cookie consent feature.


HDS/HCRC Migration Details

The upgrade involved migrating component usage and types across the application to conform with the latest library versions. Key changes include:

  • Type Migration: Critical migration to new types, particularly in event handling, components, sports, and hobbies modules, following the HDS v4 upgrade.
  • Style Consistency: Extensive style updates to align search form components (category, date, place, target age group) with HDS styles:
    • Set consistent gray placeholder text colors.
    • Ensured consistent padding, font size, and border styles for selectors.
    • Removed the isSelected indicator from the date selector for consistency.
    • Applied necessary theming to the category and event order selectors.
  • Dependency Management: Hard-set versions for hds-react and upgraded hds-core and hds-design-tokens.
  • Testing: Updated tests to reflect the new component structures and migrated test utilities (e.g., createLocaleDictBuilder, useAskemContext).

Cookie Consent Implementation

A new, comprehensive cookie consent system was implemented, consolidating all user tracking features.

  • Core Implementation: Added necessary cookie consent utilities, translations, and context providers.
  • User Tracking Refactor: Refactored user tracking features to be collected and handled by a dedicated UserTrackingFeatures component/wrapper, decoupling the tracking logic from the BaseApp.
  • Integration: Integrated the cookie consent modal and banner into the base application, ensuring proper client-side rendering and fixing related Content Security Policy (CSP) rules.
  • Context Management: Implemented the useConsentSiteSettings hook and refactored prop drilling and context usage (e.g., in the Askem hook) for cleaner data flow.

@terovirtanen

Copy link
Copy Markdown
Contributor

FEDERATION-ROUTER branch is deployed to platta: https://events-graphql-federation-hobbies-pr917.dev.hel.ninja 🚀🚀🚀

@terovirtanen

Copy link
Copy Markdown
Contributor

FEDERATION-ROUTER branch is deployed to platta: https://events-graphql-federation-events-pr917.dev.hel.ninja 🚀🚀🚀

@terovirtanen

Copy link
Copy Markdown
Contributor

FEDERATION-ROUTER branch is deployed to platta: https://events-graphql-federation-sports-pr917.dev.hel.ninja 🚀🚀🚀

@nikomakela

nikomakela commented Nov 20, 2025

Copy link
Copy Markdown
Contributor Author

A real stable version of HCRC -lib needs to be used instead of canary. It should be installed when the related HCRC -lib changes are merged and published in a stable release. A related PR: City-of-Helsinki/react-helsinki-headless-cms#205.

  • Use a stable release of HCRC -lib

@terovirtanen

Copy link
Copy Markdown
Contributor

FEDERATION-ROUTER branch is deployed to platta: https://events-graphql-federation-hobbies-pr917.dev.hel.ninja 🚀🚀🚀

@terovirtanen

Copy link
Copy Markdown
Contributor

FEDERATION-ROUTER branch is deployed to platta: https://events-graphql-federation-events-pr917.dev.hel.ninja 🚀🚀🚀

@terovirtanen

Copy link
Copy Markdown
Contributor

FEDERATION-ROUTER branch is deployed to platta: https://events-graphql-federation-sports-pr917.dev.hel.ninja 🚀🚀🚀

@terovirtanen

Copy link
Copy Markdown
Contributor

EVENTS-GRAPHQL-PROXY branch is deployed to platta: https://events-graphql-proxy-pr917.dev.hel.ninja 🚀🚀🚀

@terovirtanen

Copy link
Copy Markdown
Contributor

VENUE-GRAPHQL-PROXY branch is deployed to platta: https://venue-graphql-proxy-pr917.dev.hel.ninja 🚀🚀🚀

@terovirtanen

Copy link
Copy Markdown
Contributor

HARRASTUKSET-UI branch is deployed to platta: https://harrastukset-pr917.dev.hel.ninja 🚀🚀🚀

@terovirtanen

Copy link
Copy Markdown
Contributor

TAPAHTUMAT-UI branch is deployed to platta: https://tapahtumat-pr917.dev.hel.ninja 🚀🚀🚀

@terovirtanen

Copy link
Copy Markdown
Contributor

TestCafe result is failed for https://harrastukset-pr917.dev.hel.ninja 😿💢💥💥

@terovirtanen

Copy link
Copy Markdown
Contributor

TestCafe result is failed for https://tapahtumat-pr917.dev.hel.ninja 😿💢💥💥

@terovirtanen

Copy link
Copy Markdown
Contributor

LIIKUNTA-UI branch is deployed to platta: https://liikunta-pr917.dev.hel.ninja 🚀🚀🚀

@terovirtanen

Copy link
Copy Markdown
Contributor

TestCafe result is failed for https://liikunta-pr917.dev.hel.ninja 😿💢💥💥

@terovirtanen

Copy link
Copy Markdown
Contributor

FEDERATION-ROUTER branch is deployed to platta: https://events-graphql-federation-hobbies-pr917.dev.hel.ninja 🚀🚀🚀

@terovirtanen

Copy link
Copy Markdown
Contributor

FEDERATION-ROUTER branch is deployed to platta: https://events-graphql-federation-events-pr917.dev.hel.ninja 🚀🚀🚀

@terovirtanen

Copy link
Copy Markdown
Contributor

FEDERATION-ROUTER branch is deployed to platta: https://events-graphql-federation-sports-pr917.dev.hel.ninja 🚀🚀🚀

@terovirtanen

Copy link
Copy Markdown
Contributor

HARRASTUKSET-UI branch is deployed to platta: https://harrastukset-pr917.dev.hel.ninja 🚀🚀🚀

@terovirtanen

Copy link
Copy Markdown
Contributor

VENUE-GRAPHQL-PROXY branch is deployed to platta: https://venue-graphql-proxy-pr917.dev.hel.ninja 🚀🚀🚀

@terovirtanen

Copy link
Copy Markdown
Contributor

EVENTS-GRAPHQL-PROXY branch is deployed to platta: https://events-graphql-proxy-pr917.dev.hel.ninja 🚀🚀🚀

@terovirtanen

Copy link
Copy Markdown
Contributor

TAPAHTUMAT-UI branch is deployed to platta: https://tapahtumat-pr917.dev.hel.ninja 🚀🚀🚀

@nikomakela

nikomakela commented Nov 21, 2025

Copy link
Copy Markdown
Contributor Author

buttonStyles={{ fontSize: 'var(--fontsize-body-m)' }}
icon={<IconRead aria-hidden />}
noTags
visibleOptions={5.97} // use decimal to make scrollable content visible

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Would this magic number be good to give a meaningful name and move e.g. to AppConfig or to some constant somewhere else? Now even with the comment having a number like 5.97 is not very understandable. Would 5.98 do? Or 5.96, why is this exactly 5.97 and not e.g. 6? Well, anyway, this could use more clarity IMHO.

@nikomakela nikomakela Nov 21, 2025

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Well, it only was a number that made the UI look good. When there is no visible scroll bar in the menu, it tells to user that there are more options available. It should not be in AppConfig, because it's actually a selector specific value. It's not something I would like to configure app wide from apps configuration. I don't know what else add there, when it already says what it is for. It's a property of HDS Select component and description can be found here: https://hds.hel.fi/components/select/code/#component-properties. They give 5.5 as an example, but it didn't work well in our case, because it only showed white space. of the menu option -- Some text needs to be seen as well.

I find this a very trivial thing.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looking at https://hds.hel.fi/components/select/code/#component-properties helped clarify this a bit. Without the context it was weird. It's still a bit weird, but the default value being 5.5, it seems it is just some magic number that makes the UI look good. Maybe the link you gave could be added for better context, as given that context the "use decimal" is more understandable as they already talk using that:

Use decimals, so a part of the next option is shown.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'll think a bit to see if I can come up with a concise comment that explains the why here.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

How would you feel about something like this?
// Show next option partially to indicate more is available

@terovirtanen

Copy link
Copy Markdown
Contributor

TestCafe result is failed for https://harrastukset-pr917.dev.hel.ninja 😿💢💥💥

@terovirtanen

Copy link
Copy Markdown
Contributor

TestCafe result is failed for https://tapahtumat-pr917.dev.hel.ninja 😿💢💥💥

@terovirtanen

Copy link
Copy Markdown
Contributor

FEDERATION-ROUTER branch is deployed to platta: https://events-graphql-federation-hobbies-pr917.dev.hel.ninja 🚀🚀🚀

@terovirtanen

Copy link
Copy Markdown
Contributor

FEDERATION-ROUTER branch is deployed to platta: https://events-graphql-federation-events-pr917.dev.hel.ninja 🚀🚀🚀

@terovirtanen

Copy link
Copy Markdown
Contributor

HARRASTUKSET-UI branch is deployed to platta: https://harrastukset-pr917.dev.hel.ninja 🚀🚀🚀

@terovirtanen

Copy link
Copy Markdown
Contributor

TAPAHTUMAT-UI branch is deployed to platta: https://tapahtumat-pr917.dev.hel.ninja 🚀🚀🚀

@terovirtanen

Copy link
Copy Markdown
Contributor

EVENTS-GRAPHQL-PROXY branch is deployed to platta: https://events-graphql-proxy-pr917.dev.hel.ninja 🚀🚀🚀

@terovirtanen

Copy link
Copy Markdown
Contributor

FEDERATION-ROUTER branch is deployed to platta: https://events-graphql-federation-sports-pr917.dev.hel.ninja 🚀🚀🚀

@terovirtanen

Copy link
Copy Markdown
Contributor

VENUE-GRAPHQL-PROXY branch is deployed to platta: https://venue-graphql-proxy-pr917.dev.hel.ninja 🚀🚀🚀

@terovirtanen

Copy link
Copy Markdown
Contributor

LIIKUNTA-UI branch is deployed to platta: https://liikunta-pr917.dev.hel.ninja 🚀🚀🚀

@terovirtanen

Copy link
Copy Markdown
Contributor

TestCafe result is failed for https://harrastukset-pr917.dev.hel.ninja 😿💢💥💥

@terovirtanen

Copy link
Copy Markdown
Contributor

TestCafe result is failed for https://tapahtumat-pr917.dev.hel.ninja 😿💢💥💥

@terovirtanen

Copy link
Copy Markdown
Contributor

TestCafe result is failed for https://liikunta-pr917.dev.hel.ninja 😿💢💥💥

HCRC-178.

Update a failing mock that does not affect in test result.
@sonarqubecloud

Copy link
Copy Markdown

@sonarqubecloud

Copy link
Copy Markdown

@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
23.8% Coverage on New Code (required ≥ 65%)

See analysis details on SonarQube Cloud

@terovirtanen

Copy link
Copy Markdown
Contributor

FEDERATION-ROUTER branch is deployed to platta: https://events-graphql-federation-events-pr917.dev.hel.ninja 🚀🚀🚀

@terovirtanen

Copy link
Copy Markdown
Contributor

FEDERATION-ROUTER branch is deployed to platta: https://events-graphql-federation-sports-pr917.dev.hel.ninja 🚀🚀🚀

@terovirtanen

Copy link
Copy Markdown
Contributor

FEDERATION-ROUTER branch is deployed to platta: https://events-graphql-federation-hobbies-pr917.dev.hel.ninja 🚀🚀🚀

@terovirtanen

Copy link
Copy Markdown
Contributor

EVENTS-GRAPHQL-PROXY branch is deployed to platta: https://events-graphql-proxy-pr917.dev.hel.ninja 🚀🚀🚀

@terovirtanen

Copy link
Copy Markdown
Contributor

VENUE-GRAPHQL-PROXY branch is deployed to platta: https://venue-graphql-proxy-pr917.dev.hel.ninja 🚀🚀🚀

@terovirtanen

Copy link
Copy Markdown
Contributor

LIIKUNTA-UI branch is deployed to platta: https://liikunta-pr917.dev.hel.ninja 🚀🚀🚀

@sonarqubecloud

Copy link
Copy Markdown

@terovirtanen

Copy link
Copy Markdown
Contributor

TAPAHTUMAT-UI branch is deployed to platta: https://tapahtumat-pr917.dev.hel.ninja 🚀🚀🚀

@terovirtanen

Copy link
Copy Markdown
Contributor

HARRASTUKSET-UI branch is deployed to platta: https://harrastukset-pr917.dev.hel.ninja 🚀🚀🚀

@nikomakela nikomakela merged commit fdccd2d into main Nov 26, 2025
115 of 121 checks passed
@nikomakela nikomakela deleted the HCRC-178-hds-v4 branch November 26, 2025 12:45
@terovirtanen

Copy link
Copy Markdown
Contributor

TestCafe result is failed for https://liikunta-pr917.dev.hel.ninja 😿💢💥💥

@terovirtanen

Copy link
Copy Markdown
Contributor

TestCafe result is failed for https://tapahtumat-pr917.dev.hel.ninja 😿💢💥💥

@terovirtanen

Copy link
Copy Markdown
Contributor

TestCafe result is failed for https://harrastukset-pr917.dev.hel.ninja 😿💢💥💥

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