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

AddressNL - Using autofill / prefill / manual mode #4998

Open
12 tasks
robinmolen opened this issue Jan 8, 2025 · 0 comments
Open
12 tasks

AddressNL - Using autofill / prefill / manual mode #4998

robinmolen opened this issue Jan 8, 2025 · 0 comments

Comments

@robinmolen
Copy link
Contributor

robinmolen commented Jan 8, 2025

Thema / Theme

Frontend

Omschrijving / Description

This ticket will be picked-up as part of #4431, and describes the "mode behavior" part of the latest summarizing comment on the AddressNL Epic ticket

The addressNL component will receive a new configuration field: "mode". This is a dropdown with three (3) values:

  • regular (or maybe 'Manual' is more fitting?)
  • prefill
  • autofill
    Based on the chosen mode, the addressNL component will work differently for the people filling in the form. This field will replace the 'Derive address' checkbox

Mode-behaviour

The behavior is described in this comment. For simplicity's sake, i've copied the requirement:

The AddressNL-component features these fields:

A. postalcode, housenumber
B. houseletter, housenumber-addition
C. city, streetname

The letters are referenced in the text below

In regular mode:

  • Show A, B and C-fields as editable (C-fields only if enabled to show)
  • If BRK-validation is enabled: Trigger after A and B-fields are filled in.

In Autofill mode:

  • Show A and B-fields as editable fields
  • Show C-fields as read-only fields
  • When A-fields filled in, derive C-fields
  • If the C-fields cannot be derived (service offline, invalid address) make the C-fields editable
  • If the C-fields can be derived, make the C-fields read-only
  • If BRK-validation is enabled: Trigger after A and B-fields are filled in.

In Prefill mode:

  • Show A, B and C-fields as read-only
  • Prefill allows you to select a plugin and an attribute-set:
  • If prefill fails, make A, B and C-fields editable (C-fields only if enabled to show)
  • If BRK-validation is enabled: Trigger upon submit/next step

Added value / Toegevoegde waarde

No response

Aanvullende opmerkingen / Additional context

Actions:

  • Add mode selectbox with 3 values: 'Regular', 'Prefill' and 'Autofill'
  • 'Autofill' option can ONLY be selected if the BAG API is configured. Give an error if its not or hide option completely
  • Remove the Derive address field
  • Migrate Derive address cofing to the new mode config
    (If Derive address was set to True use the Autofill option. If it was set to False use the Regular option)
  • In the import logic, map Derive address config to the new mode config
    (If Derive address was set to True use the Autofill option. If it was set to False use the Regular option)
  • If BRK-validation is enabled: validation on submit/next step
    (I think this is also best for the 'regular' and 'autofill' modes, seeing as the B-fields are optional and might not be used)

Regular mode:

  • A,B,C-fields are all editable

Autofill mode:

  • Enable "derive address" logic
  • Start with C-fields as read-only
  • If no address can be derived, make C-fields editable
    (If the user changes the postcode, and a new address can be derived, turn the C-fields back into read-only)

Prefill mode:

  • Start with A,B,C fields as read-only
  • If prefill fails, mark A,B,C fields as editable
@robinmolen robinmolen added this to the Release 3.1.0 milestone Jan 8, 2025
@robinmolen robinmolen changed the title AddressNL - mode behavior AddressNL - component usage modes Jan 8, 2025
@robinmolen robinmolen changed the title AddressNL - component usage modes AddressNL - Using autofill / prefill / manual mode Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Todo
Development

No branches or pull requests

1 participant