Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pkp/pkp-lib#10329 Include metadataLocales in /submissions/{submission… #10330

Merged
merged 1 commit into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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