Skip to content

controlled vocabulary option for target audience#1258

Merged
fbacall merged 2 commits intoElixirTeSS:masterfrom
DaanVanVugt:feature/controlled_vocabulary_option_target_audience
Apr 9, 2026
Merged

controlled vocabulary option for target audience#1258
fbacall merged 2 commits intoElixirTeSS:masterfrom
DaanVanVugt:feature/controlled_vocabulary_option_target_audience

Conversation

@mikesndrs
Copy link
Copy Markdown
Contributor

@mikesndrs mikesndrs commented Mar 13, 2026

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

  • I have read and followed the CONTRIBUTING guide.
  • I confirm that I have the authority necessary to make this contribution on behalf of its copyright owner and agree to license it to the TeSS codebase under the BSD license.

Copy link
Copy Markdown
Member

@fbacall fbacall left a comment

Choose a reason for hiding this comment

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

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?

@mikesndrs
Copy link
Copy Markdown
Contributor Author

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

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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_vars config list in tess.example.yml.
  • Updates the Events form to conditionally use a dropdown for target_audience when the feature is enabled.
  • Updates the Materials form to conditionally use a dropdown for target_audience when 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.

@fbacall fbacall merged commit 670ee72 into ElixirTeSS:master Apr 9, 2026
7 checks passed
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.

3 participants