feat(ENG-9817): collection-specific metadata with cedar#963
Open
Vlad0n20 wants to merge 2 commits intoCenterForOpenScience:feature/es2-consolidationfrom
Open
feat(ENG-9817): collection-specific metadata with cedar#963Vlad0n20 wants to merge 2 commits intoCenterForOpenScience:feature/es2-consolidationfrom
Vlad0n20 wants to merge 2 commits intoCenterForOpenScience:feature/es2-consolidationfrom
Conversation
nsemets
requested changes
Apr 22, 2026
nsemets
requested changes
Apr 23, 2026
Comment on lines
+19
to
+83
| const mockCedarTemplate: CedarMetadataDataTemplateJsonApi = { | ||
| id: mockTemplateId, | ||
| type: 'cedar-metadata-templates', | ||
| attributes: { | ||
| schema_name: 'Test', | ||
| cedar_id: 'cedar-1', | ||
| template: { | ||
| '@id': '', | ||
| '@type': '', | ||
| type: 'object', | ||
| title: 'Test', | ||
| description: '', | ||
| $schema: '', | ||
| '@context': { | ||
| pav: '', | ||
| xsd: '', | ||
| bibo: '', | ||
| oslc: '', | ||
| schema: '', | ||
| 'schema:name': { '@type': 'xsd:string' }, | ||
| 'pav:createdBy': { '@type': '@id' }, | ||
| 'pav:createdOn': { '@type': 'xsd:dateTime' }, | ||
| 'oslc:modifiedBy': { '@type': '@id' }, | ||
| 'pav:lastUpdatedOn': { '@type': 'xsd:dateTime' }, | ||
| 'schema:description': { '@type': 'xsd:string' }, | ||
| }, | ||
| required: [], | ||
| properties: {}, | ||
| _ui: { order: [], propertyLabels: {}, propertyDescriptions: {} }, | ||
| }, | ||
| }, | ||
| }; | ||
|
|
||
| const mockCedarRecord: CedarMetadataRecordData = { | ||
| id: 'record-1', | ||
| attributes: { | ||
| metadata: {} as CedarMetadataRecordData['attributes']['metadata'], | ||
| is_published: false, | ||
| }, | ||
| relationships: { | ||
| template: { data: { type: 'cedar-metadata-templates', id: mockTemplateId } }, | ||
| target: { data: { type: 'nodes', id: 'node-1' } }, | ||
| }, | ||
| }; | ||
|
|
||
| const mockSubmissionsWithTemplate: CollectionSubmission[] = [ | ||
| { | ||
| id: '1', | ||
| type: 'collection-submissions', | ||
| collectionTitle: 'Collection A', | ||
| collectionId: 'col1', | ||
| reviewsState: CollectionSubmissionReviewState.Accepted, | ||
| collectedType: '', | ||
| status: 'accepted', | ||
| volume: '', | ||
| issue: '', | ||
| programArea: '', | ||
| schoolType: '', | ||
| studyDesign: '', | ||
| dataType: '', | ||
| disease: '', | ||
| gradeLevels: '', | ||
| requiredMetadataTemplateId: mockTemplateId, | ||
| }, | ||
| ]; |
Collaborator
There was a problem hiding this comment.
Use mocks from testing/data/collections
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.
Purpose
Add support for collection-specific metadata using CEDAR (Center for
Expanded Data Annotation and Retrieval) templates when submitting or
editing a project in a collection. Collections that require structured
metadata can now enforce a CEDAR template form instead of the
standard filter-based metadata fields.
Summary of Changes
feature flag
requiredMetadataTemplateId field
field (full CEDAR template object)
requiredMetadataTemplateId from API responses into
CollectionSubmission and expose requiredMetadataTemplate on the
provider
required metadata template via the collections store
CEDAR form instead of the standard filter fields; saves/updates a
CEDAR record on submission via CreateCedarMetadataRecord /
UpdateCedarMetadataRecord actions
web component, tracks form data via
onCedarChange, and emits cedarDataSaved instead of metadataSaved
and isCedarMode inputs; builds lookup maps (cedarRecordByTemplateId,
cedarTemplateById) and passes matched data to each item
when in CEDAR mode and hides standard filter
attributes
Screenshot(s)
Side Effects
QA Notes