Skip to content
Snippets Groups Projects
Commit cc2edc71 authored by Reinoud Bokhorst's avatar Reinoud Bokhorst
Browse files

OSB-31: fixed some inefficiencies

parent 761f4faf
No related branches found
No related tags found
2 merge requests!89Monitoring maintenance Epic branch merge,!1Resolve OSB-13 "Monitoringmaintenance "
...@@ -49,7 +49,7 @@ class STSRow extends Component { ...@@ -49,7 +49,7 @@ class STSRow extends Component {
class ToolBar extends Component { class ToolBar extends Component {
onErrorsOnlyClick(selected) { onErrorsOnlyClick = () => {
this.props.onChange('allErrorTypes', !this.props.allErrorTypes ); this.props.onChange('allErrorTypes', !this.props.allErrorTypes );
} }
...@@ -57,8 +57,8 @@ class ToolBar extends Component { ...@@ -57,8 +57,8 @@ class ToolBar extends Component {
return ( return (
<div className="sts-toolbar"> <div className="sts-toolbar">
{ this.props.allErrorTypes { this.props.allErrorTypes
? <Button color="info" size="xs" onClick={() => this.onErrorsOnlyClick()} active>All types</Button> ? <Button color="info" size="xs" onClick={this.onErrorsOnlyClick} active>All types</Button>
: <Button color="info" size="xs" onClick={() => this.onErrorsOnlyClick()}>All types</Button> : <Button color="info" size="xs" onClick={this.onErrorsOnlyClick}>All types</Button>
} }
</div> </div>
); );
...@@ -78,7 +78,7 @@ class StationTestSummaryC extends Component { ...@@ -78,7 +78,7 @@ class StationTestSummaryC extends Component {
}; };
/* Handle changes of selected filters in the ToolBar */ /* Handle changes of selected filters in the ToolBar */
onToolbarChange(key, value) { onToolbarChange = (key, value) => {
let obj = {}; let obj = {};
obj[key] = value; obj[key] = value;
this.setState(obj); this.setState(obj);
...@@ -160,7 +160,7 @@ class StationTestSummaryC extends Component { ...@@ -160,7 +160,7 @@ class StationTestSummaryC extends Component {
<React.Fragment> <React.Fragment>
<h5 className="react-grid-item-header"> <h5 className="react-grid-item-header">
Station test summary Station test summary
<ToolBar onChange={(key,value) => this.onToolbarChange(key,value) } allErrorTypes={this.state.allErrorTypes} /> <ToolBar onChange={this.onToolbarChange} allErrorTypes={this.state.allErrorTypes} />
</h5> </h5>
<div className="react-grid-item-body"> <div className="react-grid-item-body">
<Table bordered hover size="sm" className="sts-table"> <Table bordered hover size="sm" className="sts-table">
......
...@@ -160,7 +160,7 @@ class LandingPageC extends Component { ...@@ -160,7 +160,7 @@ class LandingPageC extends Component {
<ToolBar/> <ToolBar/>
<ResponsiveGridLayout className="layout" layouts={this.props.layout.panels} measureBeforeMount={true} <ResponsiveGridLayout className="layout" layouts={this.props.layout.panels} measureBeforeMount={true}
breakpoints={this.props.layout.breakpoints} cols={this.props.layout.cols} breakpoints={this.props.layout.breakpoints} cols={this.props.layout.cols}
onResizeStop={e => this.props.setNewLayout(e)}> onResizeStop={this.props.setNewLayout}>
{createGridPanel({key: "ul", renderHeader: true, title: "Station overview", body: <StationOverview url={this.getStationOverviewURL()}/>})} {createGridPanel({key: "ul", renderHeader: true, title: "Station overview", body: <StationOverview url={this.getStationOverviewURL()}/>})}
{createGridPanel({key: "ur", renderHeader: true, title: "Latest observations", body: <LatestObservations url={this.getLatestObservationURL()}/>})} {createGridPanel({key: "ur", renderHeader: true, title: "Latest observations", body: <LatestObservations url={this.getLatestObservationURL()}/>})}
{createGridPanel({key: "bl", renderHeader: false, body: <StationTestSummary url={this.getStationTestSummaryURL()}/>})} {createGridPanel({key: "bl", renderHeader: false, body: <StationTestSummary url={this.getStationTestSummaryURL()}/>})}
......
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