garrensmith closed pull request #1129: VerifyInstall Redux refactoring 
URL: https://github.com/apache/couchdb-fauxton/pull/1129
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/app/addons/verifyinstall/__tests__/components.test.js 
b/app/addons/verifyinstall/__tests__/components.test.js
index a7c911e04..1d4a37888 100644
--- a/app/addons/verifyinstall/__tests__/components.test.js
+++ b/app/addons/verifyinstall/__tests__/components.test.js
@@ -10,14 +10,15 @@
 // License for the specific language governing permissions and limitations 
under
 // the License.
 
-import FauxtonAPI from "../../../core/api";
-import React from "react";
-import ReactDOM from "react-dom";
-import testUtils from "../../../../test/mocha/testUtils";
-import Constants from "../constants";
-import Components from "../components";
+import FauxtonAPI from '../../../core/api';
+import React from 'react';
+import ReactDOM from 'react-dom';
+import testUtils from '../../../../test/mocha/testUtils';
+import Constants from '../constants';
+import VerifyInstallButton from '../components/VerifyInstallButton';
+import VerifyInstallResults from '../components/VerifyInstallResults';
 import {mount} from 'enzyme';
-import sinon from "sinon";
+import sinon from 'sinon';
 FauxtonAPI.router = new FauxtonAPI.Router([]);
 
 var assert = testUtils.assert;
@@ -41,7 +42,7 @@ describe('VerifyInstallResults', function () {
 
   it('confirm all result fields blank before tests ran', function () {
 
-    el = mount(<Components.VerifyInstallResults testResults={testResults} />);
+    el = mount(<VerifyInstallResults testResults={testResults} />);
 
     tests.forEach((test) => {
       assert.equal(el.find('#' + test.id).text(), '');
@@ -58,7 +59,7 @@ describe('VerifyInstallResults', function () {
         success: true
       };
 
-      el = mount(<Components.VerifyInstallResults testResults={copy} />);
+      el = mount(<VerifyInstallResults testResults={copy} />);
 
       // now look at the DOM for that element. It should contain a tick char
       assert.equal(el.find('#' + test.id + ' span').text(), '✓');
@@ -75,7 +76,7 @@ describe('VerifyInstallResults', function () {
         success: false
       };
 
-      el = mount(<Components.VerifyInstallResults testResults={copy} />);
+      el = mount(<VerifyInstallResults testResults={copy} />);
 
       // now look at the DOM for that element. It should contain an error char
       assert.equal(el.find('#' + test.id + ' span').text(), '✗');
@@ -90,20 +91,20 @@ describe('VerifyInstallButton', function () {
   it('calls verify function on click', function () {
     const stub = { func: () => { } };
     const spy = sinon.spy(stub, 'func');
-    el = mount(<Components.VerifyInstallButton verify={stub.func} 
isVerifying={false} />);
+    el = mount(<VerifyInstallButton verify={stub.func} isVerifying={false} />);
     el.simulate('click');
     assert.ok(spy.calledOnce);
   });
 
   it('shows appropriate default label', function () {
     const stub = { func: () => { } };
-    el = mount(<Components.VerifyInstallButton verify={stub.func} 
isVerifying={false} />);
+    el = mount(<VerifyInstallButton verify={stub.func} isVerifying={false} />);
     assert.equal(el.text(), 'Verify Installation');
   });
 
   it('shows appropriate label during verification', function () {
     const stub = { func: () => { } };
-    el = mount(<Components.VerifyInstallButton verify={stub.func} 
isVerifying={true} />);
+    el = mount(<VerifyInstallButton verify={stub.func} isVerifying={true} />);
     assert.equal(el.text(), 'Verifying');
   });
 
diff --git a/app/addons/verifyinstall/__tests__/reducers.test.js 
b/app/addons/verifyinstall/__tests__/reducers.test.js
new file mode 100644
index 000000000..c789a1d04
--- /dev/null
+++ b/app/addons/verifyinstall/__tests__/reducers.test.js
@@ -0,0 +1,64 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy 
of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations 
under
+// the License.
+
+import testUtils from "../../../../test/mocha/testUtils";
+import reducer from "../reducers";
+import ActionTypes from "../actiontypes";
+
+var assert = testUtils.assert;
+
+describe('VerifyInstall Reducer', () => {
+
+  it('initial state has all tests status set to false', () => {
+    const newState = reducer(undefined, {type: 'something_else'});
+
+    assert.ok(newState.isVerifying === false);
+
+    // confirm all the tests are initially marked as incomplete
+    Object.keys(newState.tests).forEach((test) => {
+      assert.ok(newState.tests[test].complete === false);
+    });
+  });
+
+  it('verification status changes to in progress', () => {
+    const newState = reducer(undefined, {
+      type: ActionTypes.VERIFY_INSTALL_START
+    });
+
+    assert.ok(newState.isVerifying === true);
+  });
+
+  it('verification status changes to completed', () => {
+    const newState = reducer(undefined, {
+      type: ActionTypes.VERIFY_INSTALL_ALL_TESTS_COMPLETE
+    });
+    assert.ok(newState.isVerifying === false);
+  });
+
+  it('resets status of all tests', () => {
+    const state = {
+      tests: {
+        TEST1: { complete: true, success: true },
+        TEST2: { complete: true, success: false  },
+        TEST3: { complete: false, success: false  }
+      }
+    };
+    const newState = reducer(state, {
+      type: ActionTypes.VERIFY_INSTALL_RESET
+    });
+    Object.keys(newState.tests).forEach((test) => {
+      assert.ok(newState.tests[test].complete === false);
+      assert.isUndefined(newState.tests[test].success);
+    });
+  });
+
+});
diff --git a/app/addons/verifyinstall/__tests__/stores.test.js 
b/app/addons/verifyinstall/__tests__/stores.test.js
deleted file mode 100644
index 65789005c..000000000
--- a/app/addons/verifyinstall/__tests__/stores.test.js
+++ /dev/null
@@ -1,46 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy 
of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations 
under
-// the License.
-
-import FauxtonAPI from "../../../core/api";
-import testUtils from "../../../../test/mocha/testUtils";
-import Stores from "../stores";
-import ActionTypes from "../actiontypes";
-
-var assert = testUtils.assert;
-
-describe('VerifyInstallStore', () => {
-
-  afterEach(() => {
-    Stores.verifyInstallStore.reset();
-  });
-
-  it('check store defaults', () => {
-    assert.ok(Stores.verifyInstallStore.checkIsVerifying() === false);
-
-    // confirm all the tests are initially marked as incomplete
-    const tests = Stores.verifyInstallStore.getTestResults();
-    _.each(tests, (test) => {
-      assert.ok(test.complete === false);
-    });
-  });
-
-  it('publishing start event changes state in store', () => {
-    FauxtonAPI.dispatch({ type: ActionTypes.VERIFY_INSTALL_START });
-    assert.ok(Stores.verifyInstallStore.checkIsVerifying() === true);
-  });
-
-  it('publishing completion event changes state in store', () => {
-    FauxtonAPI.dispatch({ type: ActionTypes.VERIFY_INSTALL_ALL_TESTS_COMPLETE 
});
-    assert.ok(Stores.verifyInstallStore.checkIsVerifying() === false);
-  });
-
-});
diff --git a/app/addons/verifyinstall/actions.js 
b/app/addons/verifyinstall/actions.js
index 80f6e6a95..e8a5967b1 100644
--- a/app/addons/verifyinstall/actions.js
+++ b/app/addons/verifyinstall/actions.js
@@ -17,9 +17,9 @@ import ActionTypes from "./actiontypes";
 
 
 // helper function to publish success/fail result of a single test having been 
ran
-const testPassed = function (test) {
+const testPassed = function (test, dispatch) {
   return function () {
-    FauxtonAPI.dispatch({
+    dispatch({
       type: ActionTypes.VERIFY_INSTALL_SINGLE_TEST_COMPLETE,
       test: test,
       success: true
@@ -28,12 +28,12 @@ const testPassed = function (test) {
 };
 
 let allTestsPassed = true;
-const testFailed = function (test) {
+const testFailed = function (test, dispatch) {
   return function (xhr) {
     allTestsPassed = false;
     if (!xhr) { return; }
 
-    FauxtonAPI.dispatch({
+    dispatch({
       type: ActionTypes.VERIFY_INSTALL_SINGLE_TEST_COMPLETE,
       test: test,
       success: false
@@ -52,54 +52,50 @@ const testFailed = function (test) {
 };
 
 
-export default {
-  resetStore: function () {
-    FauxtonAPI.dispatch({ type: ActionTypes.VERIFY_INSTALL_RESET });
-  },
-
-  startVerification: function () {
+export const resetTests = () => (dispatch) => {
+  dispatch({ type: ActionTypes.VERIFY_INSTALL_RESET });
+};
 
-    // announce that we're starting the verification tests
-    FauxtonAPI.dispatch({ type: ActionTypes.VERIFY_INSTALL_START });
+export const startVerification = () => (dispatch) => {
+  // announce that we're starting the verification tests
+  dispatch({ type: ActionTypes.VERIFY_INSTALL_START });
 
-    var testProcess = VerifyInstall.testProcess;
+  const testProcess = VerifyInstall.testProcess;
+  testProcess.setup()
+    .then(() => {
+      return 
testProcess.saveDB().then(testPassed(Constants.TESTS.CREATE_DATABASE, 
dispatch));
+    }, testFailed(Constants.TESTS.CREATE_DATABASE, dispatch))
+    .then(() => {
+      return 
testProcess.saveDoc().then(testPassed(Constants.TESTS.CREATE_DOCUMENT, 
dispatch));
+    }, testFailed(Constants.TESTS.CREATE_DATABASE, dispatch))
+    .then(() => {
+      return 
testProcess.updateDoc().then(testPassed(Constants.TESTS.UPDATE_DOCUMENT, 
dispatch));
+    }, testFailed(Constants.TESTS.CREATE_DOCUMENT, dispatch))
+    .then(() => {
+      return 
testProcess.destroyDoc().then(testPassed(Constants.TESTS.DELETE_DOCUMENT, 
dispatch));
+    }, testFailed(Constants.TESTS.UPDATE_DOCUMENT, dispatch))
+    .then(() => {
+      return testProcess.setupView().then(() => {
+        return 
testProcess.testView().then(testPassed(Constants.TESTS.CREATE_VIEW, dispatch));
+      });
+    }, testFailed(Constants.TESTS.DELETE_DOCUMENT, dispatch))
+    .then(() => {
+      return testProcess.setupReplicate().then(() => {
+        return 
testProcess.testReplicate().then(testPassed(Constants.TESTS.REPLICATION, 
dispatch));
+      });
+    }, testFailed(Constants.TESTS.CREATE_VIEW, dispatch))
+    .then(() => {}, testFailed(Constants.TESTS.REPLICATION, dispatch))
+    .then(() => {
+      // now announce the tests have been ran
+      dispatch({ type: ActionTypes.VERIFY_INSTALL_ALL_TESTS_COMPLETE });
 
-    testProcess.setup()
-      .then(() => {
-        return 
testProcess.saveDB().then(testPassed(Constants.TESTS.CREATE_DATABASE));
-      }, testFailed(Constants.TESTS.CREATE_DATABASE))
-      .then(() => {
-        return 
testProcess.saveDoc().then(testPassed(Constants.TESTS.CREATE_DOCUMENT));
-      }, testFailed(Constants.TESTS.CREATE_DATABASE))
-      .then(() => {
-        return 
testProcess.updateDoc().then(testPassed(Constants.TESTS.UPDATE_DOCUMENT));
-      }, testFailed(Constants.TESTS.CREATE_DOCUMENT))
-      .then(() => {
-        return 
testProcess.destroyDoc().then(testPassed(Constants.TESTS.DELETE_DOCUMENT));
-      }, testFailed(Constants.TESTS.UPDATE_DOCUMENT))
-      .then(() => {
-        return testProcess.setupView().then(() => {
-          return 
testProcess.testView().then(testPassed(Constants.TESTS.CREATE_VIEW));
+      if (allTestsPassed) {
+        FauxtonAPI.addNotification({
+          msg: 'Success! Your CouchDB installation is working. Time to Relax.',
+          type: 'success'
         });
-      }, testFailed(Constants.TESTS.DELETE_DOCUMENT))
-      .then(() => {
-        return testProcess.setupReplicate().then(() => {
-          return 
testProcess.testReplicate().then(testPassed(Constants.TESTS.REPLICATION));
-        });
-      }, testFailed(Constants.TESTS.CREATE_VIEW))
-      .then(() => {}, testFailed(Constants.TESTS.REPLICATION))
-      .then(() => {
-        // now announce the tests have been ran
-        FauxtonAPI.dispatch({ type: 
ActionTypes.VERIFY_INSTALL_ALL_TESTS_COMPLETE });
-
-        if (allTestsPassed) {
-          FauxtonAPI.addNotification({
-            msg: 'Success! Your CouchDB installation is working. Time to 
Relax.',
-            type: 'success'
-          });
-        }
+      }
 
-        testProcess.removeDBs();
-      });
-  }
+      testProcess.removeDBs();
+    });
 };
diff --git a/app/addons/verifyinstall/base.js b/app/addons/verifyinstall/base.js
index 194957597..4f3eaa955 100644
--- a/app/addons/verifyinstall/base.js
+++ b/app/addons/verifyinstall/base.js
@@ -12,6 +12,7 @@
 
 import FauxtonAPI from "../../core/api";
 import VerifyInstall from "./routes";
+import reducers from './reducers';
 import "./assets/less/verifyinstall.less";
 
 VerifyInstall.initialize = function () {
@@ -23,4 +24,8 @@ VerifyInstall.initialize = function () {
   });
 };
 
+FauxtonAPI.addReducers({
+  verifyinstall: reducers
+});
+
 export default VerifyInstall;
diff --git a/app/addons/verifyinstall/__tests__/actions.test.js 
b/app/addons/verifyinstall/components/VerifyInstallButton.js
similarity index 52%
rename from app/addons/verifyinstall/__tests__/actions.test.js
rename to app/addons/verifyinstall/components/VerifyInstallButton.js
index a32c28e3a..4e7df0892 100644
--- a/app/addons/verifyinstall/__tests__/actions.test.js
+++ b/app/addons/verifyinstall/components/VerifyInstallButton.js
@@ -10,20 +10,20 @@
 // License for the specific language governing permissions and limitations 
under
 // the License.
 
-import FauxtonAPI from "../../../core/api";
-import testUtils from "../../../../test/mocha/testUtils";
-import Stores from "../stores";
-import ActionTypes from "../actiontypes";
-import sinon from "sinon";
+import PropTypes from 'prop-types';
+import React from 'react';
 
-var assert = testUtils.assert;
+export default class VerifyInstallButton extends React.Component {
+  static propTypes = {
+    verify: PropTypes.func.isRequired,
+    isVerifying: PropTypes.bool.isRequired
+  };
 
-describe('Verify Install Actions', () => {
-
-  it('resets the store when action called', () => {
-    var spy = sinon.spy(Stores.verifyInstallStore, 'reset');
-    FauxtonAPI.dispatch({ type: ActionTypes.VERIFY_INSTALL_RESET });
-    assert.ok(spy.calledOnce);
-  });
-
-});
+  render() {
+    return (
+      <button id="start" className="btn btn-primary" 
onClick={this.props.verify} disabled={this.props.isVerifying}>
+        {this.props.isVerifying ? 'Verifying' : 'Verify Installation'}
+      </button>
+    );
+  }
+}
diff --git a/app/addons/verifyinstall/components/VerifyInstallContainer.js 
b/app/addons/verifyinstall/components/VerifyInstallContainer.js
new file mode 100644
index 000000000..efc4fbb83
--- /dev/null
+++ b/app/addons/verifyinstall/components/VerifyInstallContainer.js
@@ -0,0 +1,30 @@
+import { connect } from 'react-redux';
+import VerifyInstallScreen from './VerifyInstallScreen';
+import { resetTests, startVerification } from '../actions';
+
+const mapStateToProps = ({ verifyinstall }) => {
+  return {
+    isVerifying: verifyinstall.isVerifying,
+    testResults: verifyinstall.tests
+  };
+};
+
+const mapDispatchToProps = (dispatch) => {
+  return {
+    resetTests: () => {
+      dispatch(resetTests());
+    },
+
+    startVerification: () => {
+      dispatch(resetTests());
+      dispatch(startVerification());
+    }
+  };
+};
+
+const VerifyInstallContainer = connect(
+  mapStateToProps,
+  mapDispatchToProps
+)(VerifyInstallScreen);
+
+export default VerifyInstallContainer;
diff --git a/app/addons/verifyinstall/components.js 
b/app/addons/verifyinstall/components/VerifyInstallResults.js
similarity index 58%
rename from app/addons/verifyinstall/components.js
rename to app/addons/verifyinstall/components/VerifyInstallResults.js
index 16f74ed27..08ced5fcd 100644
--- a/app/addons/verifyinstall/components.js
+++ b/app/addons/verifyinstall/components/VerifyInstallResults.js
@@ -11,66 +11,10 @@
 // the License.
 
 import PropTypes from 'prop-types';
+import React from 'react';
+import Constants from '../constants';
 
-import React from "react";
-import Constants from "./constants";
-import Actions from "./actions";
-import Stores from "./stores";
-
-const store = Stores.verifyInstallStore;
-
-class VerifyInstallController extends React.Component {
-  getStoreState = () => {
-    return {
-      isVerifying: store.checkIsVerifying(),
-      testResults: store.getTestResults()
-    };
-  };
-
-  startVerification = () => {
-    Actions.startVerification();
-  };
-
-  onChange = () => {
-    this.setState(this.getStoreState());
-  };
-
-  state = this.getStoreState();
-
-  componentDidMount() {
-    store.on('change', this.onChange, this);
-  }
-
-  componentWillUnmount() {
-    store.off('change', this.onChange);
-  }
-
-  render() {
-    return (
-      <div>
-        <VerifyInstallButton verify={this.startVerification} 
isVerifying={this.state.isVerifying} />
-        <VerifyInstallResults testResults={this.state.testResults} />
-      </div>
-    );
-  }
-}
-
-class VerifyInstallButton extends React.Component {
-  static propTypes = {
-    verify: PropTypes.func.isRequired,
-    isVerifying: PropTypes.bool.isRequired
-  };
-
-  render() {
-    return (
-      <button id="start" className="btn btn-primary" 
onClick={this.props.verify} disabled={this.props.isVerifying}>
-        {this.props.isVerifying ? 'Verifying' : 'Verify Installation'}
-      </button>
-    );
-  }
-}
-
-class VerifyInstallResults extends React.Component {
+export default class VerifyInstallResults extends React.Component {
   static propTypes = {
     testResults: PropTypes.object.isRequired
   };
@@ -124,9 +68,3 @@ class VerifyInstallResults extends React.Component {
     );
   }
 }
-
-export default {
-  VerifyInstallController: VerifyInstallController,
-  VerifyInstallButton: VerifyInstallButton,
-  VerifyInstallResults: VerifyInstallResults
-};
diff --git a/app/addons/verifyinstall/components/VerifyInstallScreen.js 
b/app/addons/verifyinstall/components/VerifyInstallScreen.js
new file mode 100644
index 000000000..a5c637b0b
--- /dev/null
+++ b/app/addons/verifyinstall/components/VerifyInstallScreen.js
@@ -0,0 +1,32 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy 
of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations 
under
+// the License.
+
+import React from 'react';
+import VerifyInstallButton from './VerifyInstallButton';
+import VerifyInstallResults from './VerifyInstallResults';
+
+export default class VerifyInstallScreen extends React.Component {
+
+  constructor(props) {
+    super(props);
+    this.props.resetTests();
+  }
+
+  render() {
+    return (
+      <div>
+        <VerifyInstallButton verify={this.props.startVerification} 
isVerifying={this.props.isVerifying} />
+        <VerifyInstallResults testResults={this.props.testResults} />
+      </div>
+    );
+  }
+}
diff --git a/app/addons/verifyinstall/reducers.js 
b/app/addons/verifyinstall/reducers.js
new file mode 100644
index 000000000..6067f1d9e
--- /dev/null
+++ b/app/addons/verifyinstall/reducers.js
@@ -0,0 +1,75 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy 
of
+// the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations 
under
+// the License.
+
+import ActionTypes from './actiontypes';
+import Constants from './constants';
+
+const initialState = {
+  isVerifying: false,
+  tests: {}
+};
+Object.keys(Constants.TESTS).forEach((key) => {
+  initialState.tests[Constants.TESTS[key]] = { complete: false };
+});
+
+function resetTests(tests) {
+  const testsCopy = {...tests};
+  Object.keys(testsCopy).forEach((key) => {
+    testsCopy[key] = { complete: false };
+  });
+  return testsCopy;
+}
+
+function updateTestStatus(tests, test, success) {
+  const testsCopy = {...tests};
+
+  // shouldn't ever occur since we're using constants for the test names
+  if (!_.has(testsCopy, test)) {
+    throw new Error('Invalid test name passed to updateTestStatus()');
+  }
+
+  // mark this test as complete, and track whether it was a success or failure
+  testsCopy[test] = { complete: true, success: success };
+  return testsCopy;
+}
+
+export default function verifyinstall (state = initialState, action) {
+  switch (action.type) {
+
+    case ActionTypes.VERIFY_INSTALL_START:
+      return {
+        ...state,
+        isVerifying: true
+      };
+
+    case ActionTypes.VERIFY_INSTALL_RESET:
+      return {
+        ...state,
+        tests: resetTests(state.tests)
+      };
+
+    case ActionTypes.VERIFY_INSTALL_SINGLE_TEST_COMPLETE:
+      return {
+        ...state,
+        tests: updateTestStatus(state.tests, action.test, action.success)
+      };
+
+    case ActionTypes.VERIFY_INSTALL_ALL_TESTS_COMPLETE:
+      return {
+        ...state,
+        isVerifying: false
+      };
+
+    default:
+      return state;
+  }
+}
diff --git a/app/addons/verifyinstall/routes.js 
b/app/addons/verifyinstall/routes.js
index 12c675fed..cae198325 100644
--- a/app/addons/verifyinstall/routes.js
+++ b/app/addons/verifyinstall/routes.js
@@ -13,8 +13,7 @@
 import React from 'react';
 import FauxtonAPI from "../../core/api";
 import VerifyInstall from "./resources";
-import Actions from "./actions";
-import Components from "./components";
+import VerifyInstallContainer from "./components/VerifyInstallContainer";
 import {OnePaneSimpleLayout} from '../components/layouts';
 
 const VerifyRouteObject = FauxtonAPI.RouteObject.extend({
@@ -24,9 +23,8 @@ const VerifyRouteObject = FauxtonAPI.RouteObject.extend({
   selectedHeader: 'Verify',
 
   verifyInstall: function () {
-    Actions.resetStore();
     return <OnePaneSimpleLayout
-      component={<Components.VerifyInstallController/>}
+      component={<VerifyInstallContainer/>}
       crumbs={[
         {name: 'Verify CouchDB Installation'}
       ]}
diff --git a/app/addons/verifyinstall/stores.js 
b/app/addons/verifyinstall/stores.js
deleted file mode 100644
index 25074cb21..000000000
--- a/app/addons/verifyinstall/stores.js
+++ /dev/null
@@ -1,93 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy 
of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations 
under
-// the License.
-
-import FauxtonAPI from "../../core/api";
-import Constants from "./constants";
-import ActionTypes from "./actiontypes";
-
-var VerifyInstallStore = FauxtonAPI.Store.extend({
-  initialize: function () {
-    this.reset();
-  },
-
-  reset: function () {
-    this._isVerifying = false;
-
-    // reset all the tests
-    this._tests = {};
-    _.each(Object.keys(Constants.TESTS), (key) => {
-      this._tests[Constants.TESTS[key]] = { complete: false };
-    });
-  },
-
-  startVerification: function () {
-    this._isVerifying = true;
-  },
-
-  stopVerification: function () {
-    this._isVerifying = false;
-  },
-
-  checkIsVerifying: function () {
-    return this._isVerifying;
-  },
-
-  updateTestStatus: function (test, success) {
-
-    // shouldn't ever occur since we're using constants for the test names
-    if (!_.has(this._tests, test)) {
-      throw new Error('Invalid test name passed to updateTestStatus()');
-    }
-
-    // mark this test as complete, and track whether it was a success or 
failure
-    this._tests[test] = { complete: true, success: success };
-  },
-
-  getTestResults: function () {
-    return this._tests;
-  },
-
-  dispatch: function (action) {
-    switch (action.type) {
-      case ActionTypes.VERIFY_INSTALL_START:
-        this.startVerification();
-        this.triggerChange();
-        break;
-
-      case ActionTypes.VERIFY_INSTALL_RESET:
-        this.reset();
-        this.triggerChange();
-        break;
-
-      case ActionTypes.VERIFY_INSTALL_SINGLE_TEST_COMPLETE:
-        this.updateTestStatus(action.test, action.success);
-        this.triggerChange();
-        break;
-
-      case ActionTypes.VERIFY_INSTALL_ALL_TESTS_COMPLETE:
-        this.stopVerification();
-        this.triggerChange();
-        break;
-
-      default:
-        return;
-    }
-  }
-});
-
-
-var Stores = {};
-Stores.verifyInstallStore = new VerifyInstallStore();
-Stores.verifyInstallStore.dispatchToken = 
FauxtonAPI.dispatcher.register(Stores.verifyInstallStore.dispatch.bind(Stores.verifyInstallStore));
-
-
-export default Stores;


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to