diff --git a/.eslintrc.js b/.eslintrc.js
index e29c1a8a6221f03d61414a04824b100e0e46a6b7..c20a185d2d289f0a3c16702e83b7c484aca02e49 100755
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -19,6 +19,7 @@ module.exports = {
'react/jsx-no-bind': [0],
'react/prop-types': [0],
'react/prefer-stateless-function': [0],
+ 'react/jsx-one-expression-per-line': [0],
'react/jsx-wrap-multilines': [
'error',
{
diff --git a/src/components/Authorized/PromiseRender.js b/src/components/Authorized/PromiseRender.js
index 02518ad5d0f03b00fdb4cef68ff69e2296130df3..b18bcbece1db86bf6bf1198dad5eb859f1b6408d 100644
--- a/src/components/Authorized/PromiseRender.js
+++ b/src/components/Authorized/PromiseRender.js
@@ -5,13 +5,16 @@ export default class PromiseRender extends React.PureComponent {
state = {
component: null,
};
+
componentDidMount() {
this.setRenderComponent(this.props);
}
+
componentWillReceiveProps(nextProps) {
// new Props enter
this.setRenderComponent(nextProps);
}
+
// set render Component : ok or error
setRenderComponent(props) {
const ok = this.checkIsInstantiation(props.ok);
@@ -28,6 +31,7 @@ export default class PromiseRender extends React.PureComponent {
});
});
}
+
// Determine whether the incoming component has been instantiated
// AuthorizedRoute is already instantiated
// Authorized render is already instantiated, children is no instantiated
@@ -38,6 +42,7 @@ export default class PromiseRender extends React.PureComponent {
}
return () => target;
};
+
render() {
const Component = this.state.component;
return Component ? (
diff --git a/src/components/Charts/TimelineChart/index.js b/src/components/Charts/TimelineChart/index.js
index e7ab6b11dea63b237f423855757371bc5fcb3516..018464da5ea3c9f2dbe1d548bf9ec8038c753550 100644
--- a/src/components/Charts/TimelineChart/index.js
+++ b/src/components/Charts/TimelineChart/index.js
@@ -44,8 +44,7 @@ export default class TimelineChart extends React.Component {
});
const dv = ds.createView();
- dv
- .source(data)
+ dv.source(data)
.transform({
type: 'filter',
callback: obj => {
diff --git a/src/components/Charts/WaterWave/index.js b/src/components/Charts/WaterWave/index.js
index 709384274cdfcb76dc7cb47cb8f5b94530f02476..5ea6dcc36f01b65f15703556ad6d9d17f6a4e9fe 100644
--- a/src/components/Charts/WaterWave/index.js
+++ b/src/components/Charts/WaterWave/index.js
@@ -189,7 +189,10 @@ export default class WaterWave extends PureComponent {
{title && {title}}
-
{percent}%
+
+ {percent}
+ %
+
);
diff --git a/src/components/CountDown/index.js b/src/components/CountDown/index.js
index 875fb1e2c588fb58ea0860a828fb5bc863ef143c..b67fab2f9d4a21cce05be763a1f5b445188b31e4 100644
--- a/src/components/CountDown/index.js
+++ b/src/components/CountDown/index.js
@@ -39,7 +39,9 @@ class CountDown extends Component {
}
timer = 0;
+
interval = 1000;
+
initTime = props => {
let lastTime = 0;
let targetTime = 0;
@@ -58,6 +60,7 @@ class CountDown extends Component {
lastTime: lastTime < 0 ? 0 : lastTime,
};
};
+
// defaultFormat = time => (
// {moment(time).format('hh:mm:ss')}
// );
@@ -70,10 +73,15 @@ class CountDown extends Component {
const s = Math.floor((time - h * hours - m * minutes) / 1000);
return (
- {fixedZero(h)}:{fixedZero(m)}:{fixedZero(s)}
+ {fixedZero(h)}
+ :
+ {fixedZero(m)}
+ :
+ {fixedZero(s)}
);
};
+
tick = () => {
const { onEnd } = this.props;
let { lastTime } = this.state;
diff --git a/src/components/DescriptionList/Description.js b/src/components/DescriptionList/Description.js
index 3e41c07173f868852899bccb5db79e8d58911520..002ad2849e50b0d5372e6e7f469fce3f709840d5 100644
--- a/src/components/DescriptionList/Description.js
+++ b/src/components/DescriptionList/Description.js
@@ -10,8 +10,8 @@ const Description = ({ term, column, className, children, ...restProps }) => {
return (
{term && {term}
}
- {children !== null && children !== undefined &&
- {children}
}
+ {children !== null &&
+ children !== undefined && {children}
}
);
};
diff --git a/src/components/DescriptionList/DescriptionList.js b/src/components/DescriptionList/DescriptionList.js
index 382d7e85f0cbf04507d76cf40e40a586911e075b..73bb5f5f92262c1e1f550d0e6e2a28811717b5da 100644
--- a/src/components/DescriptionList/DescriptionList.js
+++ b/src/components/DescriptionList/DescriptionList.js
@@ -22,7 +22,10 @@ const DescriptionList = ({
{title ?
{title}
: null}
- {React.Children.map(children, child => child ? React.cloneElement(child, { column }) : child)}
+ {React.Children.map(
+ children,
+ child => (child ? React.cloneElement(child, { column }) : child)
+ )}
);
diff --git a/src/components/EditableItem/index.js b/src/components/EditableItem/index.js
index fcda844e3f5af30970b2b8b58b4e4d6a9dcfe8c7..5b22631c0e10c93f8a7f76aab29c32bc0d2a7550 100644
--- a/src/components/EditableItem/index.js
+++ b/src/components/EditableItem/index.js
@@ -7,19 +7,23 @@ export default class EditableItem extends PureComponent {
value: this.props.value,
editable: false,
};
+
handleChange = e => {
const { value } = e.target;
this.setState({ value });
};
+
check = () => {
this.setState({ editable: false });
if (this.props.onChange) {
this.props.onChange(this.state.value);
}
};
+
edit = () => {
this.setState({ editable: true });
};
+
render() {
const { value, editable } = this.state;
return (
diff --git a/src/components/EditableLinkGroup/index.js b/src/components/EditableLinkGroup/index.js
index 2d0b4aa83a34921f6936c24b104d4933475c969d..ae3d93c712b8b019078fe37bd07286716349ef3f 100644
--- a/src/components/EditableLinkGroup/index.js
+++ b/src/components/EditableLinkGroup/index.js
@@ -17,6 +17,7 @@ class EditableLinkGroup extends PureComponent {
onAdd: () => {},
linkElement: 'a',
};
+
render() {
const { links, linkElement, onAdd } = this.props;
return (
diff --git a/src/components/GlobalHeader/index.js b/src/components/GlobalHeader/index.js
index 0f405f7bda25f77991dcce06f7aa24cefefbd9a0..f84d2d2eb2fffc1382925087655fb8aa3e96a94b 100644
--- a/src/components/GlobalHeader/index.js
+++ b/src/components/GlobalHeader/index.js
@@ -12,8 +12,9 @@ export default class GlobalHeader extends PureComponent {
componentWillUnmount() {
this.triggerResizeEvent.cancel();
}
+
getNoticeData() {
- const { notices} = this.props;
+ const { notices } = this.props;
if (notices == null || notices.length === 0) {
return {};
}
@@ -43,6 +44,7 @@ export default class GlobalHeader extends PureComponent {
});
return groupBy(newNotices, 'type');
}
+
toggle = () => {
const { collapsed, onCollapse } = this.props;
onCollapse(!collapsed);
@@ -67,7 +69,7 @@ export default class GlobalHeader extends PureComponent {
onNoticeClear,
} = this.props;
if (currentUser == null) {
- currentUser = {}
+ currentUser = {};
}
const menu = (