Commit 462318c3 authored by Petter Goksøyr Åsen's avatar Petter Goksøyr Åsen
Browse files

patron-client: support multiple publication places

parent 830d1e2a
......@@ -236,7 +236,8 @@
},
"hasPlaceOfPublication": {
"@id": "deichman:hasPlaceOfPublication",
"@type": "@id"
"@type": "@id",
"@container": "@set"
},
"publishedBy": {
"@id": "deichman:publishedBy",
......
......@@ -268,7 +268,7 @@ function transformPublications (publications) {
numberOfPages: publication.numberOfPages || [],
partNumber: publication.partNumber,
partTitle: publication.partTitle,
placeOfPublication: publication.hasPlaceOfPublication ? publication.hasPlaceOfPublication.prefLabel : undefined,
placeOfPublication: publication.hasPlaceOfPublication || [],
publicationParts: transformPublicationParts(publication.publicationParts),
publicationYear: publication.publicationYear,
publisher: publication.publishedBy ? publication.publishedBy.name : undefined,
......
......@@ -4,10 +4,10 @@ import { defineMessages } from 'react-intl'
import MetaItem from '../../../MetaItem'
const PlaceOfPublication = ({ placeOfPublication }) => {
if (placeOfPublication) {
if (placeOfPublication.length > 0) {
return (
<MetaItem label={messages.placeOfPublication} data-automation-id="publication_placeOfPublication">
{placeOfPublication}
{placeOfPublication.map(p => p.prefLabel).join(", ")}
</MetaItem>
)
} else {
......@@ -16,7 +16,7 @@ const PlaceOfPublication = ({ placeOfPublication }) => {
}
PlaceOfPublication.propTypes = {
placeOfPublication: PropTypes.string
placeOfPublication: PropTypes.array
}
export const messages = defineMessages({
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment