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/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)} /> - - - - - + + +
+ +

{ 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); }); @@ -791,6 +791,7 @@ class Scenario extends React.Component { title='Files/Data' dataKey='resultFileIDs' linkKey='filebuttons' + data={this.state.files} width='300' onDownload={(index) => this.downloadResultData(index)} /> @@ -905,18 +906,18 @@ class Scenario extends React.Component { /> - { this.state.ExternalICInUse ? ( + {this.state.ExternalICInUse ? (
this.runAction(action, when)} actions={[ - {id: '-1', title: 'Action', data: {action: 'none'}}, - {id: '0', title: 'Start', data: {action: 'start'}}, - {id: '1', title: 'Stop', data: {action: 'stop'}}, - {id: '2', title: 'Pause', data: {action: 'pause'}}, - {id: '3', title: 'Resume', data: {action: 'resume'}} - ]}/> + { id: '-1', title: 'Action', data: { action: 'none' } }, + { id: '0', title: 'Start', data: { action: 'start' } }, + { id: '1', title: 'Stop', data: { action: 'stop' } }, + { id: '2', title: 'Pause', data: { action: 'pause' } }, + { id: '3', title: 'Resume', data: { action: 'resume' } } + ]} />
) : (
) } 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)} }> -