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

Refactor ZGW options components structure #4869

Merged
merged 1 commit into from
Nov 29, 2024

Conversation

sergei-maertens
Copy link
Member

@sergei-maertens sergei-maertens commented Nov 28, 2024

Required for #4606

Refactored the components and hooks so we can lift up the retrieval of available catalogues in a ZGW API group.

The parent component is now responsible for fetching the available catalogues and relays the loading/error state from useAsync. It also encapsulated the derived catalogueUrl when a valid value is available and selected, which other components need to look up related objects (like case types, document types, products and the future role types).

I've opted to pass down the error into a component that just throws for the existing error boundary behaviour and location, as it's important that you can still change the API group to trigger a new attempt and we want to keep the code nicely organised.

Finally, some more fieldsets were abstracted into their own components for readability reasons.

Checklist

Check off the items that are completed or not relevant.

  • Impact on features

    • Checked copying a form
    • Checked import/export of a form
    • Config checks in the configuration overview admin page
    • Problem detection in the admin email digest is handled
  • Release management

    • I have labelled the PR as "needs-backport" accordingly
  • I have updated the translations assets (you do NOT need to provide translations)

    • Ran ./bin/makemessages_js.sh
    • Ran ./bin/compilemessages_js.sh
  • Commit hygiene

    • Commit messages refer to the relevant Github issue
    • Commit messages explain the "why" of change, not the how

Copy link

codecov bot commented Nov 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.60%. Comparing base (65133e1) to head (dfb2ca9).
Report is 2 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4869   +/-   ##
=======================================
  Coverage   96.60%   96.60%           
=======================================
  Files         751      751           
  Lines       25692    25692           
  Branches     3399     3399           
=======================================
  Hits        24821    24821           
  Misses        609      609           
  Partials      262      262           

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

Refactored the components and hooks so we can lift up the retrieval of
available catalogues in a ZGW API group.

The parent component is now responsible for fetching the available
catalogues and relays the loading/error state from useAsync. It also
encapsulated the derived catalogueUrl when a valid value is available
and selected, which other components need to look up related objects
(like case types, document types, products and the future role types).

I've opted to pass down the error into a component that just throws
for the existing error boundary behaviour and location, as it's
important that you can still change the API group to trigger a new
attempt and we want to keep the code nicely organised.

Finally, some more fieldsets were abstracted into their own components
for readability reasons.
@sergei-maertens sergei-maertens force-pushed the feature/4606-zgw-ux-medewerker-roltype branch from 1540ab4 to dfb2ca9 Compare November 28, 2024 17:00
@sergei-maertens
Copy link
Member Author

This was briefly discussed on Slack with @robinmolen and I think the conclusion was that this PR can be merged. If there's still feedback after all, I'll handle it separately in another PR so that I can wrap this up in our off-week.

@sergei-maertens sergei-maertens merged commit d69aca5 into master Nov 29, 2024
34 checks passed
@sergei-maertens sergei-maertens deleted the feature/4606-zgw-ux-medewerker-roltype branch November 29, 2024 13:32
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.

1 participant