Render license labels under flexible metadata - #7575
Conversation
Under flexible metadata, attributes render per the m3 profile's view options, and the shipped profiles mark license as render_as: external_link - so licenses render as bare auto-linked URIs instead of their authority labels, and every app seeded from those profiles carries the setting in its stored flexible schema. conform_options now applies the semantic renderer for the authority-backed fields (license, rights_statement), overriding a profile-supplied render_as: the label still links to the URI, so an external_link rendering is strictly worse, and forcing it here heals existing stored schemas without a migration. The shipped m3 profiles (engine, koppie, dassie) are updated to render_as: license so new schemas agree. related_url keeps its external_link. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Test Results 17 files ± 0 17 suites ±0 3h 31m 58s ⏱️ + 10m 27s Results for commit 7abe834. ± Comparison against base commit c57d5bb. This pull request removes 443 and adds 449 tests. Note that renamed tests count towards both.♻️ This comment has been updated with latest results. |
There was a problem hiding this comment.
Pull request overview
Adjusts flexible-metadata attribute rendering so authority-backed URI fields (license and rights_statement) render via their semantic renderers (showing human-readable labels) instead of falling back to a bare auto-linked URI when profiles/schemas specify render_as: external_link.
Changes:
- Force
AttributesHelper#conform_optionsto overriderender_asforlicenseandrights_statementto their semantic renderers. - Update shipped m3 metadata profiles (engine + koppie + dassie) so
licenseusesrender_as: licensefor newly seeded schemas. - Add specs covering semantic renderer application, override behavior (for license), and passthrough for non-semantic fields.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| app/helpers/hyrax/attributes_helper.rb | Forces semantic renderers for authority-backed fields regardless of stored/profile render_as. |
| spec/helpers/hyrax/attributes_helper_spec.rb | Adds coverage for conform_options semantic renderer behavior and passthrough behavior. |
| config/metadata_profiles/m3_profile.yaml | Updates default m3 profile to render license using the license renderer. |
| .koppie/config/metadata_profiles/m3_profile.yaml | Aligns koppie’s m3 profile license rendering with semantic license renderer. |
| .dassie/config/metadata_profiles/m3_profile.yaml | Aligns dassie’s m3 profile license rendering with semantic license renderer. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Copilot review: the stored-external_link override was only specced for license; rights_statement takes the same path and deserves the same pin. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
What
On flexible-metadata apps, a work's license renders as a bare auto-linked URI ("https://creativecommons.org/licenses/by/4.0/") instead of its authority label ("Creative Commons BY Attribution 4.0 International").
Why
Attribute rendering under flexible metadata follows the m3 profile's view options, and the profiles Hyrax ships (engine default, koppie, dassie) mark license as
render_as: external_link. Every app seeded from those profiles also carries the setting in its stored flexible schema, so fixing the profiles alone would not heal existing apps.Fix
AttributesHelper#conform_optionsapplies the semantic renderer for the two authority-backed fields (license->:license,rights_statement->:rights_statement), overriding a profile-suppliedrender_as. The semantic renderer's label still links out to the URI, so anexternal_linkrendering is strictly worse than the label - which is why overriding the stored value is safe, and why this heals existing stored schemas without a migration.render_as: licenseso newly seeded schemas agree with the code.related_urlkeeps itsexternal_link, and the helper leaves fields without a semantic mapping untouched (covered by spec).Testing
Spec additions in the existing
#conform_optionsblock cover both semantic fields, the override of a storedexternal_link, and non-semantic fields passing through unchanged. Written and verified downstream first: this fix originated as a Hyku decorator (samvera/hyku#3212), verified live against seeded flexible-metadata tenants where the license row now shows the authority label; upstreaming it here per review feedback since the helper and the profiles are Hyrax's. I could not run the full engine suite locally, so leaning on CI for the suite run.Downstream note: once this lands, the Hyku decorator in samvera/hyku#3212 becomes redundant and that PR slims to nothing (its profile fix is Hyku's own copy, also being handled).
🤖 Generated with Claude Code