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

ZGW UX improvements: select document type #4817

Merged
merged 18 commits into from
Nov 25, 2024

Conversation

sergei-maertens
Copy link
Member

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

Closes #4606 (partially

TODO

  • Implement API endpoint to return available document types
  • Implement registration plugin runtime behaviour changes
  • Automatically select best version of document type

Changes

  • Allow selecting the document type in a dropdown after the case type is selected
  • Registration prefers the new config option if set, otherwise fall back to legacy behaviour

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 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.61%. Comparing base (577b0df) to head (fe771da).
Report is 19 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4817   +/-   ##
=======================================
  Coverage   96.60%   96.61%           
=======================================
  Files         749      749           
  Lines       25563    25616   +53     
  Branches     3383     3394   +11     
=======================================
+ Hits        24696    24749   +53     
  Misses        604      604           
  Partials      263      263           

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


🚨 Try these New Features:

@sergei-maertens sergei-maertens force-pushed the feature/4606-zgw-ux-improvements branch 5 times, most recently from d340a4a to 46e83b5 Compare November 14, 2024 16:58
@sergei-maertens sergei-maertens marked this pull request as ready for review November 14, 2024 16:59
@sergei-maertens sergei-maertens force-pushed the feature/4606-zgw-ux-improvements branch from 46e83b5 to 0671396 Compare November 14, 2024 17:03
@sergei-maertens sergei-maertens force-pushed the feature/4606-zgw-ux-improvements branch 3 times, most recently from 2cd5e88 to b485b81 Compare November 20, 2024 21:21
@sergei-maertens sergei-maertens force-pushed the feature/4606-zgw-ux-improvements branch 2 times, most recently from 7ba5eca to ab76ea3 Compare November 22, 2024 14:33
@robinmolen
Copy link
Contributor

I was wondering, if you still wanted to change the catalogueUrl calculation/usage in the BasicOptionsFieldset.js (you said last week, in my PR of the ZGW products, that you wanted to try something different)

@sergei-maertens
Copy link
Member Author

I was wondering, if you still wanted to change the catalogueUrl calculation/usage in the BasicOptionsFieldset.js (you said last week, in my PR of the ZGW products, that you wanted to try something different)

Yes, but I'll do that when I get to the medewerker roltype field, since that probably also requires it! So out of scope for this PR, in scope for the next one.

Once a case type is selected, the available document type options are
fetched from the backend and we only store the 'description' field
value in the configuration options.
Added the serializer option to specify a document type via its
description, rather than having to provide a fully qualified URL.
The serializer that produces the available document types is now
properly in English, to be consistent with the rest of the serializers.

This requires an update to the formio-builder too.
Replaced endpoints with their English variant for consistency.
Tests broke due to changes in behaviour, but the assertions were not
updated accordingly yet.
The specified document type is now dynamically resolved within the
case type of the created case, using the submissions completion
time to determine the correct version to use.

The legacy configuration options now emit deprecation warnings, but will
still be supported for the foreseeable future.
* Added missing prop type for new form field
* Extended list of field names contained in optional settings
  fieldset
Consistenly use 'document types' rather than informatieobjecttypen,
as the URLs themselves have been updated and new code uses this
language.
@sergei-maertens sergei-maertens force-pushed the feature/4606-zgw-ux-improvements branch from ab76ea3 to fe771da Compare November 25, 2024 09:22
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.

Looks good to me 👍

@@ -370,8 +395,8 @@ def _validate_catalogue_case_and_doc_type(
)
err_invalid_document_type = ErrorDetail(
_(
"The provided informatieobjecttype does not exist in the specified "
"selected case type or Catalogi API."
"The provided informatieobjecttype does not exist in the selected case "
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
"The provided informatieobjecttype does not exist in the selected case "
"The provided document type does not exist in the selected case "

@sergei-maertens sergei-maertens merged commit 095da0f into master Nov 25, 2024
34 checks passed
@sergei-maertens sergei-maertens deleted the feature/4606-zgw-ux-improvements branch November 25, 2024 10:50
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.

Make ZGW registration options consistent with Objects API
2 participants