From 1ed62b0534be8f8419947bc5689caad4d7be1f2d Mon Sep 17 00:00:00 2001 From: irismarie Date: Tue, 16 Feb 2021 18:39:19 +0100 Subject: [PATCH] show filesnames in tooltip, resulttable (#271) --- src/common/table.js | 15 ++++++++++----- src/scenario/scenario.js | 1 + 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/common/table.js b/src/common/table.js index 1a1dd90..400bffe 100644 --- a/src/common/table.js +++ b/src/common/table.js @@ -52,6 +52,13 @@ class CustomTable extends Component { break; } } + } else if ('data' in child.props && 'dataKey' in child.props) { + content = new Map(); + let keys = _.get(data, child.props.dataKey); + let filteredData = child.props.data.filter(data => keys.includes(data.id)) + filteredData.forEach(file => { + content.set(_.get(file, 'id'), _.get(file, 'name')); + }) } else if ('dataKey' in child.props) { content = _.get(data, child.props.dataKey); } @@ -63,8 +70,6 @@ class CustomTable extends Component { let cell = []; if (content != null) { - //content = content.toString(); - // check if cell should be a link const linkKey = child.props.linkKey; if (linkKey && data[linkKey] != null) { @@ -72,9 +77,9 @@ class CustomTable extends Component { } else if (child.props.clickable) { cell.push(); } else if (linkKey === 'filebuttons') { - content.forEach(element => { - cell.push(Download {element}} > - ); }); } else { diff --git a/src/scenario/scenario.js b/src/scenario/scenario.js index 7bf2de9..f33875c 100644 --- a/src/scenario/scenario.js +++ b/src/scenario/scenario.js @@ -749,6 +749,7 @@ class Scenario extends React.Component { title='Files/Data' dataKey='resultFileIDs' linkKey='filebuttons' + data={this.state.files} width='300' onDownload={(index) => this.downloadResultData(index)} />