Skip to content
Snippets Groups Projects
Commit ca6b414e authored by esikkala's avatar esikkala
Browse files

Result table: fix shorten label prop

parent 0353f50d
No related branches found
No related tags found
No related merge requests found
......@@ -73,6 +73,7 @@ const ObjectListCollapsible = props => {
<>
<ObjectListItem
data={itemData}
shortenLabel={shortenLabel}
makeLink={makeLink}
externalLink={externalLink}
linkAsButton={linkAsButton}
......@@ -84,6 +85,7 @@ const ObjectListCollapsible = props => {
{showSource && itemData.source &&
<ObjectListItemSources
data={itemData.source}
shortenLabel={shortenLabel}
externalLink={sourceExternalLink}
/>}
</>
......
......@@ -3,9 +3,9 @@ import PropTypes from 'prop-types'
import ObjectListItemLink from './ObjectListItemLink'
const ObjectListItem = props => {
const { data, makeLink, externalLink, linkAsButton, isFirstValue, collapsedMaxWords } = props
const { data, makeLink, externalLink, linkAsButton, isFirstValue, collapsedMaxWords, shortenLabel } = props
let label = Array.isArray(data.prefLabel) ? data.prefLabel[0] : data.prefLabel
if ((isFirstValue || data.shortenLabel) && collapsedMaxWords) {
if ((isFirstValue || shortenLabel) && collapsedMaxWords) {
const wordCount = label.split(' ').length
if (wordCount > collapsedMaxWords) {
label = label.trim().split(' ').splice(0, props.collapsedMaxWords).join(' ')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment