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

Result table: add condition for expand buttons

parent 0e1f3012
No related branches found
No related tags found
No related merge requests found
...@@ -189,6 +189,7 @@ class ResultTable extends React.Component { ...@@ -189,6 +189,7 @@ class ResultTable extends React.Component {
? true ? true
: this.state.expandedRows.has(row.id) : this.state.expandedRows.has(row.id)
let hasExpandableContent = false let hasExpandableContent = false
let renderExpandButton = hasExpandableContent
const dataCells = this.props.data.properties.map(column => { const dataCells = this.props.data.properties.map(column => {
const { const {
id, valueType, makeLink, externalLink, sortValues, sortBy, numberedList, minWidth, id, valueType, makeLink, externalLink, sortValues, sortBy, numberedList, minWidth,
...@@ -221,6 +222,9 @@ class ResultTable extends React.Component { ...@@ -221,6 +222,9 @@ class ResultTable extends React.Component {
shortenLabel = !expanded // shorten label only if the cell is not expanded shortenLabel = !expanded // shorten label only if the cell is not expanded
} }
} }
if (data.paginatedResultsAlwaysExpandRows) {
renderExpandButton = false
}
return ( return (
<ResultTableCell <ResultTableCell
key={id} key={id}
...@@ -253,7 +257,7 @@ class ResultTable extends React.Component { ...@@ -253,7 +257,7 @@ class ResultTable extends React.Component {
return ( return (
<TableRow key={row.id}> <TableRow key={row.id}>
<TableCell className={classes.expandCell}> <TableCell className={classes.expandCell}>
{hasExpandableContent && {renderExpandButton &&
<IconButton <IconButton
className={clsx(classes.expand, { className={clsx(classes.expand, {
[classes.expandOpen]: expanded [classes.expandOpen]: expanded
......
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