diff --git a/client/coral-admin/src/actions/install.js b/client/coral-admin/src/actions/install.js
index c7c673105..dbeb52c8e 100644
--- a/client/coral-admin/src/actions/install.js
+++ b/client/coral-admin/src/actions/install.js
@@ -27,7 +27,7 @@ const validation = (formData, dispatch, next) => {
if (cond) {
// Adding Error
- dispatch(addError(name, 'Please, fill this field '));
+ dispatch(addError(name, 'This field is required.'));
} else {
dispatch(addError(name, ''));
}
@@ -88,3 +88,22 @@ export const submitUser = () => (dispatch, getState) => {
export const updateSettingsFormData = (name, value) => ({type: actions.UPDATE_FORMDATA_SETTINGS, name, value});
export const updateUserFormData = (name, value) => ({type: actions.UPDATE_FORMDATA_USER, name, value});
+
+const checkInstallRequest = () => ({type: actions.CHECK_INSTALL_REQUEST});
+const checkInstallSuccess = installed => ({type: actions.CHECK_INSTALL_SUCCESS, installed});
+const checkInstallFailure = error => ({type: actions.CHECK_INSTALL_FAILURE, error});
+
+export const checkInstall = next => dispatch => {
+ dispatch(checkInstallRequest());
+ coralApi('/setup/available')
+ .then(({available}) => {
+ dispatch(checkInstallSuccess(available));
+ if (!available) {
+ next();
+ }
+ })
+ .catch(error => {
+ console.error(error);
+ dispatch(checkInstallFailure(`${error.message}`));
+ });
+};
diff --git a/client/coral-admin/src/constants/install.js b/client/coral-admin/src/constants/install.js
index 06d047adc..b3fd7e0d0 100644
--- a/client/coral-admin/src/constants/install.js
+++ b/client/coral-admin/src/constants/install.js
@@ -10,3 +10,7 @@ export const INSTALL_SUCCESS = 'INSTALL_SUCCESS';
export const INSTALL_FAILURE = 'INSTALL_FAILURE';
export const UPDATE_FORMDATA_USER = 'UPDATE_FORMDATA_USER';
export const UPDATE_FORMDATA_SETTINGS = 'UPDATE_FORMDATA_SETTINGS';
+
+export const CHECK_INSTALL_REQUEST = 'CHECK_INSTALL_REQUEST';
+export const CHECK_INSTALL_SUCCESS = 'CHECK_INSTALL_SUCCESS';
+export const CHECK_INSTALL_FAILURE = 'CHECK_INSTALL_FAILURE';
diff --git a/client/coral-admin/src/containers/Install/InstallContainer.js b/client/coral-admin/src/containers/Install/InstallContainer.js
index 869901e3e..7a8634180 100644
--- a/client/coral-admin/src/containers/Install/InstallContainer.js
+++ b/client/coral-admin/src/containers/Install/InstallContainer.js
@@ -1,32 +1,63 @@
-import React from 'react';
+import React, {Component} from 'react';
import {connect} from 'react-redux';
import styles from './style.css';
import {Wizard, WizardNav} from 'coral-ui';
import {Layout} from '../../components/ui/Layout';
-import {nextStep, previousStep, goToStep, updateUserFormData, updateSettingsFormData, submitSettings, submitUser} from '../../actions/install';
+
+import {
+ nextStep,
+ previousStep,
+ goToStep,
+ updateUserFormData,
+ updateSettingsFormData,
+ submitSettings,
+ submitUser,
+ checkInstall
+} from '../../actions/install';
import InitialStep from './components/Steps/InitialStep';
import AddOrganizationName from './components/Steps/AddOrganizationName';
import CreateYourAccount from './components/Steps/CreateYourAccount';
import FinalStep from './components/Steps/FinalStep';
-const InstallContainer = props => {
- const {install} = props;
+class InstallContainer extends Component {
+ componentDidMount() {
+ const {checkInstall} = this.props;
+ checkInstall(() => {
+ this.context.router.push('/admin');
+ });
+ }
- return (
- Welcome to the Coral Project
- { install.step !== 0 ? Welcome to the Coral Project
+ { install.step !== 0 ?
Thanks for installing Talk! We sent an email to verify your email address. While you finish setting the account, you can start engaging with your readers now.
- - + +The remainder of the Talk installation will take about ten minutes. + Once you complete the following two steps, you will have a free + installation and provision of Mongo and Redis.