Skip to content

Introducing profile component parameter updatePreferencesModalEnabled#260

Merged
robinmolen merged 4 commits intomainfrom
feature/5824-profile-non-authenticated-usage
Dec 18, 2025
Merged

Introducing profile component parameter updatePreferencesModalEnabled#260
robinmolen merged 4 commits intomainfrom
feature/5824-profile-non-authenticated-usage

Conversation

@robinmolen
Copy link
Contributor

Closes open-formulieren/open-forms#5824

Using the updatePreferencesModalEnabled we can control whether the "update preferences" button and modal will be shown along the profile component textfield subfield.

In addition, the logic behind when the "update preferences" button appears is also updated. The touched state caused issues in OF when moving between form-steps, where the "update preferences" button would not be shown because the field wasn't touched. To make the "update preferences" button appear, updatePreferencesModalEnabled needs to be set to true, and the textfield needs an valid digital address.

@codecov
Copy link

codecov bot commented Dec 18, 2025

Codecov Report

❌ Patch coverage is 60.00000% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 69.40%. Comparing base (4616c49) to head (e564448).
⚠️ Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
src/registry/customerProfile/subFields.tsx 57.14% 3 Missing ⚠️
src/registry/customerProfile/hooks.ts 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #260      +/-   ##
==========================================
- Coverage   69.43%   69.40%   -0.04%     
==========================================
  Files         290      290              
  Lines       10791    10796       +5     
  Branches     1744     1790      +46     
==========================================
  Hits         7493     7493              
- Misses       3294     3299       +5     
  Partials        4        4              
Flag Coverage Δ
storybook 89.36% <100.00%> (ø)
vitest 54.33% <0.00%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Instead of calculating the validity of the parent component, we can simply pass it along from the parent to the child.

The touched state in the `showPreferencesButton` logic doesn't serve any purpose. It was intended as "only show the button after human input", but this will (at this time) always be the case with the textfield subfield.

The touched state could even cause issues/confusion with moving between form-steps. Where the user goes to a previously filled-in step to adjust their profile preferences, but the "update preferences" is for some reason hidden. Only after focus/blur will the button be shown.

The logic should be: "does the field have a valid value for the intended digital address type?"
…onent parameters

Using the `updatePreferencesModalEnabled` component parameter we can control if the "update digital address preferences" modal should be shown. The normal logic, of requiring a valid value, is still being used.
@robinmolen robinmolen force-pushed the feature/5824-profile-non-authenticated-usage branch 2 times, most recently from 06f73a2 to 8f3f153 Compare December 18, 2025 13:32
@robinmolen robinmolen force-pushed the feature/5824-profile-non-authenticated-usage branch from 8f3f153 to e564448 Compare December 18, 2025 13:35
@robinmolen robinmolen merged commit f3cc120 into main Dec 18, 2025
@robinmolen robinmolen deleted the feature/5824-profile-non-authenticated-usage branch December 18, 2025 13:40
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.

Profile component renderer - non-authenticated flow

2 participants