✨ Multi-select + typeahead roles; typeahead for large controlled vocabs (#92, #93)#119
Merged
Merged
Conversation
Points hyrax-webapp at samvera/hyku d431073 (merge of #3148, 'multi-select-typeahead-fields'), which pulls in the Hyrax compound controlled-field work from samvera/hyrax#7540. This is the prerequisite for the m3-profile `form: { multiple: true, autocomplete: true }` opt-ins in the following commit to render. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Adds `form:` opt-ins to compound controlled sub-properties in the m3 profile, now honored by Hyrax's compound_controlled_select (via #7540): - contributor_role: multiple + autocomplete — a contributor holds several typed roles in ONE compound row, searchable via select2 typeahead over the ~390-term contributor_roles authority (#92). - license (~1450 SPDX terms), rights_statement, relationship_type: autocomplete — select2 typeahead for large controlled vocabularies (#93). - date_type (11 inline values) intentionally left a plain dropdown. Because role is now multi-value, it reads back as an array per compound row (superseding the old one-compound-row-per-role storage). Enact:: WorkContributors and Enact::ContributorGraph now Array()-flatten each entry's roles, backward-compatible with legacy single-string entries; Enact::PeopleGraph already wrapped with Array(). Specs cover the new array shape in both services. Refs #92, #93. Requires the Hyrax bump in the previous commit. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
ShanaLMoore
force-pushed
the
i92-role-multiselect-typeahead
branch
from
July 20, 2026 15:07
aff1597 to
8644292
Compare
There was a problem hiding this comment.
Pull request overview
This pull request updates the deposit/edit metadata profile and contributor-related services to support (1) multi-select + typeahead contributor roles and (2) typeahead for controlled fields with larger vocabularies, while keeping service-layer readers backward-compatible with legacy single-role storage.
Changes:
- Enable multi-select + autocomplete for
contributor_roleand autocomplete for large controlled vocabularies (license,rights_statement,relationship_type) inm3_profile.yaml. - Update
Enact::WorkContributorsandEnact::ContributorGraphto flatten roles when stored as either a legacy string or a new multi-select array. - Add specs to cover multi-role arrays in both services.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| config/metadata_profiles/m3_profile.yaml | Opts controlled fields into autocomplete and enables multi-select for contributor roles. |
| app/services/enact/work_contributors.rb | Flattens per-entry roles (string or array) when grouping credits per contributor. |
| app/services/enact/contributor_graph.rb | Flattens per-entry roles (string or array) when building credited-work entries. |
| spec/services/enact/work_contributors_spec.rb | Adds coverage for role arrays stored on a single compound entry. |
| spec/services/enact/contributor_graph_spec.rb | Adds coverage for role arrays stored on a single compound entry. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
laritakr
approved these changes
Jul 20, 2026
laritakr
left a comment
Collaborator
There was a problem hiding this comment.
Great work... this looks awesome
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Enables multi-select + typeahead on contributor roles, and typeahead on large controlled vocabularies (SPDX licenses, rights statements, relationship types) in the deposit/edit forms.
Closes #92 (contributors can hold multiple roles per work)
Closes #93 (typeahead for metadata fields with large value lists)
Builds on samvera/hyrax#7540 (compound controlled-field multi-select/typeahead), pulled in via the Hyku submodule bump in this branch.
Changes
config/metadata_profiles/m3_profile.yaml—form:opt-ins on compoundcontrolledsub-properties:contributor_rolemultiple: true+autocomplete: truelicenseautocomplete: truerights_statementautocomplete: truerelationship_typeautocomplete: truedate_typeapp/services/enact/work_contributors.rb,contributor_graph.rb—roleis now multi-value (array per compound row, superseding the old one-row-per-role storage), so both readersArray()-flatten each entry's roles. Backward-compatible with legacy single-string entries (PeopleGraphalready wrapped withArray()). Multi-role coverage added to both specs.Verification
Rubocop clean; the two service specs pass in-container. Verified end-to-end in the browser (dev tenant, Hyrax
d431073): role field renders as a select2 multi-select typeahead, license filters the full SPDX list, and a saved multi-role contributor renders once on the show page with both roles joined.Screenshots
Create form
Edit form
Show page
🤖 Generated with Claude Code