+
+
+
+
{
dot={false}/>
-
+
-
-
-
- hmax
- =
- {hMax.toFixed(2)}
- m
-
+
+
+ hmax={hMax.toFixed(2)}m
-
{xLabel}
+
{xLabel}
-
-
+
+
);
};
diff --git a/src/t02/components/settings.jsx b/src/t02/components/settings.jsx
index eb974d3a..05c05442 100644
--- a/src/t02/components/settings.jsx
+++ b/src/t02/components/settings.jsx
@@ -2,37 +2,38 @@ import React from 'react';
import {pure} from 'recompose';
import PropTypes from 'prop-types';
import {mounding} from 'gwflowjs';
+import {Form, Grid, Header, Radio} from "semantic-ui-react";
const Settings = ({settings, handleChange, w, L, W, hi, Sy, K, t}) => {
const hhi = mounding.calculateHi(0, 0, w, L, W, hi, Sy, K, t);
const hMax = (hhi + hi);
return (
-
-
Settings
-
-
Please select the axis for the calculation of groundwater mounding:
-
-
-
-
- The resulting groundwater mound is {hhi.toFixed(2)}m
- and the groundwater level will rise up to {hMax.toFixed(2)}m.
-
-
+
+
+
+
+ The resulting groundwater mound is {hhi.toFixed(2)}m
+ and the groundwater level will rise up to {hMax.toFixed(2)}m.
+
+
);
};
diff --git a/src/t02/containers/main.js b/src/t02/containers/main.js
index 44b86abc..bdb22732 100644
--- a/src/t02/containers/main.js
+++ b/src/t02/containers/main.js
@@ -4,34 +4,31 @@ import {connect} from 'react-redux';
import {withRouter} from 'react-router';
import uuid from 'uuid';
-import '../../less/4TileTool.less';
-import styleGlobals from 'styleGlobals';
import image from '../images/T02.png';
import {Background, Chart, Parameters, Settings} from '../components';
-import {WebData, LayoutComponents} from '../../core';
+import {WebData} from '../../core';
-import Icon from '../../components/primitive/Icon';
import Navbar from '../../containers/Navbar';
-import Accordion from '../../components/primitive/Accordion';
-import AccordionItem from '../../components/primitive/AccordionItem';
-import Input from '../../components/primitive/Input';
-import Select from '../../components/primitive/Select';
-import Button from '../../components/primitive/Button';
import {Modifier as Dashboard} from '../../dashboard';
import {each} from 'lodash';
import {getInitialState} from '../reducers/main';
import applyParameterUpdate from '../../core/simpleTools/parameterUpdate';
import {isReadOnly} from '../../core/helpers';
+import {Accordion, Icon, Container, Divider, Grid, Header, Input, Form} from "semantic-ui-react";
+import SliderParameter from "../../core/parameterSlider/SliderParameter";
const styles = {
- heading: {
- borderBottom: '1px solid ' + styleGlobals.colors.graySemilight,
- fontWeight: 300,
- fontSize: 16,
- textAlign: 'left',
- paddingBottom: 10
+ container: {
+ padding: '0 40px 0 40px',
+ width: '1280px'
+ },
+ columnContainer: {
+ background: '#fff',
+ boxShadow: '0 0 2px 0 rgba(76, 76, 76, 0.3)',
+ height: '100%',
+ padding: '12px'
}
};
@@ -39,12 +36,12 @@ const buildPayload = (data) => {
return {
settings: data.settings,
parameters: data.parameters.map(v => {
- return {
+ SliderParameter.fromObject({
id: v.id,
max: v.max,
min: v.min,
value: v.value,
- };
+ }).toObject;
})
};
};
@@ -57,13 +54,15 @@ const navigation = [{
class T02 extends React.Component {
+ // TODO: get data from saved instance
constructor() {
super();
this.state = getInitialState();
+ this.state.activeIndex = 0;
}
componentWillReceiveProps(newProps) {
- this.setState(function(prevState) {
+ this.setState(function (prevState) {
return {
...prevState,
...newProps.toolInstance,
@@ -113,47 +112,32 @@ class T02 extends React.Component {
});
}
- handleInputChange = name => {
- return value => {
- this.setState(prevState => {
- return {
- ...prevState,
- [ name ]: value
- };
- });
+ handleInputChange = (e, {name, value}) => this.setState(prevState => {
+ return {
+ ...prevState,
+ [name]: value
};
- };
+ });
- handleSelectChange = name => {
- return data => {
- this.handleInputChange(name)(data ? data.value : undefined);
- };
- };
-
- handleChange = (e) => {
- if (e.target.name === 'variable') {
- this.updateSettings(e.target.value);
- }
-
- if (e.target.name.startsWith('parameter')) {
- const param = e.target.name.split('_');
-
- const parameter = {};
- parameter.id = param[1];
- parameter[param[2]] = e.target.value;
-
- this.updateParameter(parameter);
- }
+ handleChange = parameter => {
+ this.updateParameter(parameter.toObject);
};
handleReset = () => {
this.setState(getInitialState());
};
+ handleClickAccordion = (e, titleProps) => {
+ const {index} = titleProps;
+ const {activeIndex} = this.state;
+ const newIndex = activeIndex === index ? -1 : index;
+
+ this.setState({activeIndex: newIndex})
+ };
+
render() {
- const {settings, parameters, name, description} = this.state;
- const {getToolInstanceStatus, updateToolInstanceStatus, createToolInstanceStatus, toolInstance} = this.props;
- const {id} = this.props.params;
+ const {activeIndex, settings, parameters} = this.state;
+ const {getToolInstanceStatus, toolInstance} = this.props;
const readOnly = isReadOnly(toolInstance.permissions);
const chartParams = {settings};
@@ -161,92 +145,99 @@ class T02 extends React.Component {
chartParams[v.id] = v.value;
});
- const heading = (
-
-
-
-
-
-
-
-
-
-
- );
-
return (
-
+
);
}
}
@@ -268,7 +259,7 @@ const mapDispatchToProps = (dispatch, props) => {
for (const key in actions) {
if (actions.hasOwnProperty(key)) {
// eslint-disable-next-line no-loop-func
- wrappedActions[key] = function() {
+ wrappedActions[key] = function () {
const args = Array.prototype.slice.call(arguments);
dispatch(actions[key](tool, ...args));
};
diff --git a/src/t02/reducers/main.js b/src/t02/reducers/main.js
index 198129a8..3f2e5f93 100644
--- a/src/t02/reducers/main.js
+++ b/src/t02/reducers/main.js
@@ -18,6 +18,7 @@ export const getInitialState = () => {
max: 10,
value: 0.045,
stepSize: 0.001,
+ type: 'float',
decimals: 3
}, {
order: 1,
@@ -28,6 +29,7 @@ export const getInitialState = () => {
max: 1000,
value: 40,
stepSize: 1,
+ type: 'float',
decimals: 0
}, {
order: 2,
@@ -38,6 +40,7 @@ export const getInitialState = () => {
max: 100,
value: 20,
stepSize: 1,
+ type: 'float',
decimals: 0
}, {
order: 3,
@@ -48,6 +51,7 @@ export const getInitialState = () => {
max: 100,
value: 35,
stepSize: 1,
+ type: 'float',
decimals: 0
}, {
order: 4,
@@ -59,6 +63,7 @@ export const getInitialState = () => {
validMax: (x) => x <= 0.5,
value: 0.085,
stepSize: 0.001,
+ type: 'float',
decimals: 3
}, {
order: 5,
@@ -70,6 +75,7 @@ export const getInitialState = () => {
validMax: x => x <= 100000,
value: 1.83,
stepSize: 0.01,
+ type: 'float',
decimals: 2
}, {
order: 6,
@@ -80,6 +86,7 @@ export const getInitialState = () => {
max: 100,
value: 1.5,
stepSize: 0.1,
+ type: 'float',
decimals: 1
}]
};
diff --git a/src/t03/components/optimization/OptimizationObjectives.jsx b/src/t03/components/optimization/OptimizationObjectives.jsx
index b74ee8fb..dfbf13a6 100644
--- a/src/t03/components/optimization/OptimizationObjectives.jsx
+++ b/src/t03/components/optimization/OptimizationObjectives.jsx
@@ -155,225 +155,223 @@ class OptimizationObjectivesComponent extends React.Component {
];
return (
-
-
-
-
- {this.state.selectedObjective &&
-
-
+
+ }
+
+
+
);
}
}