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

[OF#5006] Update addressNL component to manually fill in city and streetname #775

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

vaszig
Copy link
Contributor

@vaszig vaszig commented Jan 16, 2025

Closes open-formulieren/open-forms#5006 partly

Until now the addressNL component would retrieve the city and street name based on the postcode and housenumber. These fields were always read-only but now we want to be able to fill in city and street name manually if something goes wrong with the API call.

@vaszig vaszig marked this pull request as draft January 16, 2025 15:38
Copy link

codecov bot commented Jan 16, 2025

Bundle Report

Changes will increase total bundle size by 2.15kB (0.02%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
@open-formulieren/sdk-OpenForms-umd 4.77MB 1.08kB (0.02%) ⬆️
@open-formulieren/sdk-esm 4.75MB 1.07kB (0.02%) ⬆️

Affected Assets, Files, and Routes:

view changes for bundle: @open-formulieren/sdk-OpenForms-umd

Assets Changed:

Asset Name Size Change Total Size Change (%)
open-*.js 1.08kB 3.49MB 0.03%

Files in open-*.js:

  • ./src/i18n/compiled/nl.json → Total Size: 25.37kB

  • ./src/i18n/compiled/en.json → Total Size: 26.48kB

  • ./src/formio/components/AddressNL.jsx → Total Size: 15.03kB

view changes for bundle: @open-formulieren/sdk-esm

Assets Changed:

Asset Name Size Change Total Size Change (%)
assets/formio-*.js 739 bytes 2.03MB 0.04%
assets/nl-*.js 167 bytes 23.01kB 0.73%
assets/en-*.js 165 bytes 22.15kB 0.75%

Files in assets/formio-*.js:

  • ./src/formio/components/AddressNL.jsx → Total Size: 15.01kB

Files in assets/nl-*.js:

  • ./src/i18n/compiled/nl.json → Total Size: 25.37kB

Files in assets/en-*.js:

  • ./src/i18n/compiled/en.json → Total Size: 24.51kB

Copy link

codecov bot commented Jan 16, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.73%. Comparing base (263df05) to head (93b9e8b).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #775      +/-   ##
==========================================
+ Coverage   83.65%   83.73%   +0.08%     
==========================================
  Files         244      244              
  Lines        4777     4796      +19     
  Branches     1268     1273       +5     
==========================================
+ Hits         3996     4016      +20     
+ Misses        748      747       -1     
  Partials       33       33              
Flag Coverage Δ
storybook 76.34% <100.00%> (+0.09%) ⬆️
vitest 64.76% <45.45%> (+1.80%) ⬆️

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.

@vaszig vaszig force-pushed the of-5006/addressnl-ability-to-manually-edit-streetname-and-city branch 2 times, most recently from 706b6c6 to cbcde0f Compare January 17, 2025 08:32
@vaszig vaszig marked this pull request as ready for review January 17, 2025 08:32
@vaszig vaszig force-pushed the of-5006/addressnl-ability-to-manually-edit-streetname-and-city branch from cbcde0f to e6d7ded Compare January 17, 2025 08:35
@vaszig vaszig requested a review from robinmolen January 17, 2025 10:27
@vaszig vaszig force-pushed the of-5006/addressnl-ability-to-manually-edit-streetname-and-city branch from e6d7ded to e9f4b55 Compare January 21, 2025 06:56
@vaszig vaszig force-pushed the of-5006/addressnl-ability-to-manually-edit-streetname-and-city branch 2 times, most recently from 8cdb120 to f5599a0 Compare January 21, 2025 10:08
@vaszig vaszig marked this pull request as draft January 21, 2025 12:23
@vaszig vaszig force-pushed the of-5006/addressnl-ability-to-manually-edit-streetname-and-city branch 2 times, most recently from 1d1a28a to a9f8193 Compare January 23, 2025 13:25
@vaszig vaszig marked this pull request as ready for review January 23, 2025 13:26
Copy link
Contributor

@robinmolen robinmolen left a comment

Choose a reason for hiding this comment

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

Some things can/should be simplified/cleaned-up.

I'm wondering if the extra logic in checkComponentValidity should be there. Maybe you can discuss this tomorrow with Sergei, or we can take a look next week

src/formio/components/AddressNL.jsx Outdated Show resolved Hide resolved
src/formio/components/AddressNL.jsx Outdated Show resolved Hide resolved
src/formio/components/AddressNL.jsx Outdated Show resolved Hide resolved
src/formio/components/AddressNL.stories.js Outdated Show resolved Hide resolved
@vaszig
Copy link
Contributor Author

vaszig commented Jan 24, 2025

Some things can/should be simplified/cleaned-up.

I'm wondering if the extra logic in checkComponentValidity should be there. Maybe you can discuss this tomorrow with Sergei, or we can take a look next week

Yes, I am not exactly sure about this either, but I chose to do it like this after some investigation in the code.
We already do it in several places like in the FileField component:

https://github.com/open-formulieren/open-forms-sdk/blob/main/src/formio/components/FileField.js#L305.

@vaszig vaszig force-pushed the of-5006/addressnl-ability-to-manually-edit-streetname-and-city branch from a9f8193 to 40eba22 Compare January 29, 2025 11:53
@vaszig vaszig marked this pull request as draft January 29, 2025 13:47
@vaszig vaszig force-pushed the of-5006/addressnl-ability-to-manually-edit-streetname-and-city branch from 40eba22 to 7369d3d Compare January 29, 2025 15:04
await userEvent.type(postcodeInput, '1017 CJ');

// wait for the check logic api call
await sleep(1800);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

If I understood it correctly, the button is disabled for all this time, so I have to wait for it and then click on it.

@vaszig vaszig force-pushed the of-5006/addressnl-ability-to-manually-edit-streetname-and-city branch from 7369d3d to eb69adc Compare January 29, 2025 15:09
@vaszig vaszig marked this pull request as ready for review January 29, 2025 15:13
@vaszig vaszig requested a review from robinmolen January 29, 2025 15:14
…ually fill in city and streetname

Until now the addressNL component would retrieve the city and street
name based on the postcode and housenumber. These fields were always
read-only but now we want to be able to fill in city and street name if
something goes wrong with the API call.
@vaszig vaszig force-pushed the of-5006/addressnl-ability-to-manually-edit-streetname-and-city branch from eb69adc to 93b9e8b Compare January 29, 2025 15:23
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.

AddressNL - autofill unhappy flow
3 participants