From 309492e3c57c2d1bef6c5967ee8bc00497026c7e Mon Sep 17 00:00:00 2001 From: Laura Fuentes Grau Date: Tue, 16 Feb 2021 14:36:13 +0100 Subject: [PATCH 1/4] TimeOffset Widget: adjust default size --- src/widget/widget-factory.js | 8 ++++---- src/widget/widgets/time-offset.js | 3 +-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/widget/widget-factory.js b/src/widget/widget-factory.js index ed04630..e3f4c2c 100644 --- a/src/widget/widget-factory.js +++ b/src/widget/widget-factory.js @@ -200,10 +200,10 @@ class WidgetFactory { break; case 'TimeOffset': - widget.minWidth = 20; - widget.minHeight = 20; - widget.width = 100; - widget.height = 40; + widget.minWidth = 200; + widget.minHeight = 80; + widget.width = 200; + widget.height = 80; widget.customProperties.threshold_yellow = 1; widget.customProperties.threshold_red = 2; widget.customProperties.icID = -1; diff --git a/src/widget/widgets/time-offset.js b/src/widget/widgets/time-offset.js index 3682da8..ee429e8 100644 --- a/src/widget/widgets/time-offset.js +++ b/src/widget/widgets/time-offset.js @@ -66,7 +66,6 @@ class WidgetTimeOffset extends Component { } else if (this.props.widget.customProperties.showOffset){ icSelected = this.state.timeOffset + 's'; } - return (
{this.props.widget.customProperties.icID !== -1 ? @@ -81,7 +80,7 @@ class WidgetTimeOffset extends Component { : (Please select Infrastructure Component)} }> - Date: Tue, 16 Feb 2021 18:39:19 +0100 Subject: [PATCH 2/4] 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)} /> From 48ee4825d5bf7ceb34a483ceaef06200bc823a05 Mon Sep 17 00:00:00 2001 From: irismarie Date: Tue, 16 Feb 2021 18:42:53 +0100 Subject: [PATCH 3/4] make result edit dialog a bit prettier (#271) --- src/result/edit-result.js | 43 ++++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/src/result/edit-result.js b/src/result/edit-result.js index e1992c1..024a410 100644 --- a/src/result/edit-result.js +++ b/src/result/edit-result.js @@ -53,7 +53,7 @@ class EditResultDialog extends React.Component { isEmpty(val) { return (val === undefined || val == null || val.length <= 0); - }; + }; componentDidUpdate(prevProps, prevState) { if (this.props.resultId != prevProps.resultId || this.props.results != prevProps.results) { @@ -75,7 +75,7 @@ class EditResultDialog extends React.Component { }) } } - } + } }; selectUploadFile(event) { @@ -118,7 +118,7 @@ class EditResultDialog extends React.Component { } - submitDescription() { + submitDescription() { let result = this.props.results[this.props.resultId]; if (!this.isEmpty(result)) { result.description = this.state.description; @@ -143,16 +143,15 @@ class EditResultDialog extends React.Component {
- - + Description - + - + - - @@ -176,19 +173,23 @@ class EditResultDialog extends React.Component { />
- - - Add Result File - this.selectUploadFile(event)} /> - - - - - + + +
+ +

Date: Tue, 16 Feb 2021 18:58:59 +0100 Subject: [PATCH 4/4] nicer timestamp for result zipfile --- src/scenario/scenario.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scenario/scenario.js b/src/scenario/scenario.js index f33875c..698f1d6 100644 --- a/src/scenario/scenario.js +++ b/src/scenario/scenario.js @@ -177,7 +177,7 @@ class Scenario extends React.Component { filesToDownload.forEach(file => { zip.file(file.name, file.data); }); - let zipname = "result_" + this.state.resultNodl + "_" + Date.now(); + let zipname = "result_" + this.state.resultNodl + "_" + (new Date()).toISOString(); zip.generateAsync({type: "blob"}).then(function(content) { saveAs(content, zipname); });