From 89eca2f452078b216569af684973a2b4257e1210 Mon Sep 17 00:00:00 2001 From: esikkala <esko.ikkala@aalto.fi> Date: Thu, 25 Nov 2021 14:37:46 +0200 Subject: [PATCH] Result table: add condition for expand buttons --- src/client/components/facet_results/ResultTable.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/client/components/facet_results/ResultTable.js b/src/client/components/facet_results/ResultTable.js index 71ff24ec..7e02fb1f 100644 --- a/src/client/components/facet_results/ResultTable.js +++ b/src/client/components/facet_results/ResultTable.js @@ -189,6 +189,7 @@ class ResultTable extends React.Component { ? true : this.state.expandedRows.has(row.id) let hasExpandableContent = false + let renderExpandButton = hasExpandableContent const dataCells = this.props.data.properties.map(column => { const { id, valueType, makeLink, externalLink, sortValues, sortBy, numberedList, minWidth, @@ -221,6 +222,9 @@ class ResultTable extends React.Component { shortenLabel = !expanded // shorten label only if the cell is not expanded } } + if (data.paginatedResultsAlwaysExpandRows) { + renderExpandButton = false + } return ( <ResultTableCell key={id} @@ -253,7 +257,7 @@ class ResultTable extends React.Component { return ( <TableRow key={row.id}> <TableCell className={classes.expandCell}> - {hasExpandableContent && + {renderExpandButton && <IconButton className={clsx(classes.expand, { [classes.expandOpen]: expanded -- GitLab