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

Add config for extra collapse button

parent 13380256
No related branches found
No related tags found
No related merge requests found
......@@ -190,7 +190,7 @@ class ResultTable extends React.Component {
const dataCells = this.props.data.properties.map(column => {
const {
id, valueType, makeLink, externalLink, sortValues, sortBy, numberedList, minWidth,
height, linkAsButton, collapsedMaxWords, sourceExternalLink, renderAsHTML, HTMLParserTask
height, linkAsButton, collapsedMaxWords, showExtraCollapseButton, sourceExternalLink, renderAsHTML, HTMLParserTask
} = column
let { previewImageHeight } = column
if (screenSize === 'xs' || screenSize === 'sm') {
......@@ -243,6 +243,7 @@ class ResultTable extends React.Component {
onExpandClick={this.handleExpandRowFromChildComponent}
linkAsButton={linkAsButton}
collapsedMaxWords={collapsedMaxWords}
showExtraCollapseButton={showExtraCollapseButton}
shortenLabel={shortenLabel}
showSource={false}
sourceExternalLink={sourceExternalLink}
......
......@@ -11,7 +11,7 @@ const ResultTableCell = props => {
data, tableData, valueType, makeLink, externalLink, sortValues, sortBy, numberedList, minWidth,
height, container, columnId, expanded, linkAsButton, collapsedMaxWords, showSource,
sourceExternalLink, renderAsHTML, HTMLParserTask, referencedTerm, previewImageHeight,
onExpandClick, rowId, shortenLabel = false
onExpandClick, showExtraCollapseButton, rowId, shortenLabel = false
} = props
let cellContent = null
const cellStyle = {
......@@ -52,6 +52,7 @@ const ResultTableCell = props => {
onExpandClick={onExpandClick}
rowId={rowId}
collapsedMaxWords={collapsedMaxWords}
showExtraCollapseButton={showExtraCollapseButton}
shortenLabel={shortenLabel}
renderAsHTML={renderAsHTML}
HTMLParserTask={HTMLParserTask}
......
......@@ -84,7 +84,7 @@ const StringList = props => {
}
}
const { renderAsHTML, classes, expanded, rowId, onExpandClick } = props
const { renderAsHTML, classes, expanded, rowId, onExpandClick, showExtraCollapseButton = false } = props
let { data } = props
if (data == null || data === '-') {
return '-'
......@@ -101,7 +101,7 @@ const StringList = props => {
{isArray && createBasicList(data)}
{!isArray && <div>{data}</div>}
</Collapse>
{expanded &&
{expanded && showExtraCollapseButton &&
<IconButton
className={clsx(classes.expand, {
[classes.expandOpen]: expanded
......
......@@ -472,6 +472,7 @@
"numberedList": false,
"minWidth": 220,
"collapsedMaxWords": 5,
"showExtraCollapseButton": true,
"expandedOnInstancePage": true
},
{
......
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