Ivan - Add redirection to completed if install is already done [skip ci]

This commit is contained in:
ivan 2017-03-11 03:52:43 -03:00
parent 01192aaeb7
commit a183d1ed79
1 changed files with 14 additions and 1 deletions

View File

@ -1,8 +1,10 @@
import React from 'react'; import React from 'react';
import classNames from 'classnames'; import classNames from 'classnames';
import _ from 'lodash'; import _ from 'lodash';
import {browserHistory} from 'react-router';
import i18n from 'lib-app/i18n'; import i18n from 'lib-app/i18n';
import API from 'lib-app/api-call';
import Widget from 'core-components/widget'; import Widget from 'core-components/widget';
import Icon from 'core-components/icon'; import Icon from 'core-components/icon';
@ -18,6 +20,17 @@ const steps = [
class InstallLayout extends React.Component { class InstallLayout extends React.Component {
componentDidMount() {
API.call({
path: '/system/installation-step',
data: {}
}).then((result) => {
if(result.data != this.getCurrentStep()) {
browserHistory.push('/install/step-' + (result.data + 1));
}
});
}
render() { render() {
return ( return (
<Widget className="install-layout"> <Widget className="install-layout">
@ -64,7 +77,7 @@ class InstallLayout extends React.Component {
} }
return ( return (
<li className={classNames(classes)}> <li className={classNames(classes)} key={index}>
<Icon name={icon} size="sm" className="install-layout__step-icon"/> <Icon name={icon} size="sm" className="install-layout__step-icon"/>
<span className="install-layout__step-text"> <span className="install-layout__step-text">
{index+1}. {i18n(key)} {index+1}. {i18n(key)}