controlled vocabulary option for target audience#1258
Conversation
fbacall
left a comment
There was a problem hiding this comment.
Should this have a validation to check the target audience is part of the dictionary?
What gets selected in the dropdown menu if you have a target audience value that is not in the dictionary?
|
the dropdown is only for adding new values. pre existing values will continue to exist but new ones will only have the dictionary values as options. I don't think a validation is necessary |
There was a problem hiding this comment.
Pull request overview
Adds a feature-flagged option to render the target_audience field for Events and Materials using a controlled-vocabulary dropdown (backed by TargetAudienceDictionary) instead of a free-text multi-input, to improve consistency for filtering/search.
Changes:
- Introduces a new
feature.controlled_vocabulary_varsconfig list intess.example.yml. - Updates the Events form to conditionally use a dropdown for
target_audiencewhen the feature is enabled. - Updates the Materials form to conditionally use a dropdown for
target_audiencewhen the feature is enabled.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| config/tess.example.yml | Documents the new controlled_vocabulary_vars feature flag. |
| app/views/materials/_form.html.erb | Switches target_audience input to a dictionary-backed dropdown when enabled. |
| app/views/events/_form.html.erb | Switches target_audience input to a dictionary-backed dropdown when enabled. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary of changes
Config option to have target_audience field in events and materials use the available dictionary as options with a dropdown instead of the free string input field
Motivation and context
Easier for searching and filtering
Checklist