Skip to content

Commit

Permalink
#10329 Include metadataLocales in /submissions/{submissionId} API
Browse files Browse the repository at this point in the history
  • Loading branch information
bozana committed Sep 9, 2024
1 parent eb38e39 commit 734537f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions classes/submission/maps/Schema.php
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,11 @@ protected function mapByProperties(array $props, Submission $submission, bool|Co
case 'editorAssigned':
$output[$prop] = $this->getPropertyStageAssignments($this->stageAssignments);
break;
case 'metadataLocales':
$output[$prop] = collect($this->context->getSupportedSubmissionMetadataLocaleNames() + $submission->getPublicationLanguageNames())
->sortKeys()
->toArray();
break;
case 'publications':
$output[$prop] = Repo::publication()->getSchemaMap($submission, $this->userGroups, $this->genres)
->summarizeMany($submission->getData('publications'), $anonymize)->values();
Expand Down
8 changes: 8 additions & 0 deletions schemas/submission.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,14 @@
"regex:/^([A-Za-z]{2,4})(?<sc>[_-]([A-Za-z]{4,5}|[0-9]{4}))?([_-]([A-Za-z]{2}|[0-9]{3}))?(@[a-z]{2,30}(?&sc)?)?$/"
]
},
"metadataLocales": {
"type": "array",
"description": "The list of metadata locales in the form [locale code => locale name translated in UI locale].",
"readOnly": true,
"items": {
"type": "string"
}
},
"publications": {
"type": "array",
"description": "A list of publications that have been created for this submission.",
Expand Down

0 comments on commit 734537f

Please sign in to comment.