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

feat: Configurable question tags #4694

Open
wants to merge 19 commits into
base: main
Choose a base branch
from
Open

Conversation

dsamojlenko
Copy link
Member

@dsamojlenko dsamojlenko commented Nov 21, 2024

Summary | Résumé

Some preparatory work for #4378 "Machine readable tags or IDs":

  • Adds a tag property to the form schema (under properties)
  • Defaults this tag to a UUID when adding a new form element in the form-builder
  • Adds a configuration component in MoreDialog (commented out for now) to configure the tag name

Next steps

This work will be on hold temporarily, so leaving some notes for future me.

Attach the tag to Responses (in buildFormDataObject)

The structure of individual answers within a response will be:
{
"tag": "...",
"answer": [string]
}

The answer string can sometimes be a serialized object - in the cases of FormattedDate and AddressComplete, they will be serialized JSON. Checkboxes also render as a serialized object/array of values. There may be other instances.

Once the answer has a tag attached, everywhere we render an answer will need to be updated to:

  • Check if the answer is of this new TaggedAnswer type
  • If it is, render/return the answer portion only
  • If not, return the answer as string

This will need to be reflected in all DownloadableFormats transformers.

Copy link
Contributor

@dsamojlenko dsamojlenko marked this pull request as ready for review November 25, 2024 17:12
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