couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gar...@apache.org
Subject [25/27] fauxton commit: updated refs/heads/master to 0ca35da
Date Tue, 31 May 2016 07:58:53 GMT
http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/0ca35da7/app/addons/auth/test/auth.storesSpec.js
----------------------------------------------------------------------
diff --git a/app/addons/auth/test/auth.storesSpec.js b/app/addons/auth/test/auth.storesSpec.js
index d2744c0..1c8818f 100644
--- a/app/addons/auth/test/auth.storesSpec.js
+++ b/app/addons/auth/test/auth.storesSpec.js
@@ -10,139 +10,135 @@
 // License for the specific language governing permissions and limitations under
 // the License.
 
-define([
-  '../../../core/api',
-  'react',
-  '../../../../test/mocha/testUtils',
-  '../actiontypes',
-  '../stores'
-], function (FauxtonAPI, React, testUtils, ActionTypes, Stores) {
-  var assert = testUtils.assert;
-
-  var changePasswordStore = Stores.changePasswordStore;
-  var createAdminStore = Stores.createAdminStore;
-  var createAdminSidebarStore = Stores.createAdminSidebarStore;
-
-  describe('Auth Stores', function () {
-
-    describe('ChangePasswordStore', function () {
-
-      it('get / set change password updates store', function () {
-        // check empty by default
-        assert.equal(changePasswordStore.getChangePassword(), '');
-
-        var newPassword = 'lets-rick-roll-mocha';
-        FauxtonAPI.dispatch({
-          type: ActionTypes.AUTH_UPDATE_CHANGE_PWD_FIELD,
-          value: newPassword
-        });
-        assert.equal(changePasswordStore.getChangePassword(), newPassword);
-      });
+import FauxtonAPI from "../../../core/api";
+import React from "react";
+import testUtils from "../../../../test/mocha/testUtils";
+import ActionTypes from "../actiontypes";
+import Stores from "../stores";
+var assert = testUtils.assert;
+
+var changePasswordStore = Stores.changePasswordStore;
+var createAdminStore = Stores.createAdminStore;
+var createAdminSidebarStore = Stores.createAdminSidebarStore;
+
+describe('Auth Stores', function () {
 
-      it('clearing change password clears in store', function () {
-        var newPassword = 'never-gonna-give-you-up';
-        FauxtonAPI.dispatch({
-          type: ActionTypes.AUTH_UPDATE_CHANGE_PWD_FIELD,
-          value: newPassword
-        });
-        assert.equal(changePasswordStore.getChangePassword(), newPassword);
+  describe('ChangePasswordStore', function () {
 
-        FauxtonAPI.dispatch({ type: ActionTypes.AUTH_CLEAR_CHANGE_PWD_FIELDS });
-        assert.equal(changePasswordStore.getChangePassword(), '');
+    it('get / set change password updates store', function () {
+      // check empty by default
+      assert.equal(changePasswordStore.getChangePassword(), '');
+
+      var newPassword = 'lets-rick-roll-mocha';
+      FauxtonAPI.dispatch({
+        type: ActionTypes.AUTH_UPDATE_CHANGE_PWD_FIELD,
+        value: newPassword
       });
+      assert.equal(changePasswordStore.getChangePassword(), newPassword);
+    });
 
-      it('get / set change confirm password updates store', function () {
-        // check empty by default
-        assert.equal(changePasswordStore.getChangePasswordConfirm(), '');
-
-        // check getPassword works
-        var newPassword = 'never-gonna-let-you-down';
-        FauxtonAPI.dispatch({
-          type: ActionTypes.AUTH_UPDATE_CHANGE_PWD_CONFIRM_FIELD,
-          value: newPassword
-        });
-        assert.equal(changePasswordStore.getChangePasswordConfirm(), newPassword);
+    it('clearing change password clears in store', function () {
+      var newPassword = 'never-gonna-give-you-up';
+      FauxtonAPI.dispatch({
+        type: ActionTypes.AUTH_UPDATE_CHANGE_PWD_FIELD,
+        value: newPassword
       });
+      assert.equal(changePasswordStore.getChangePassword(), newPassword);
 
-      it('clearing change confirm password clears in store', function () {
-        var newPassword = 'never-gonna-run-around-and-desert-you';
-        FauxtonAPI.dispatch({
-          type: ActionTypes.AUTH_UPDATE_CHANGE_PWD_CONFIRM_FIELD,
-          value: newPassword
-        });
-        assert.equal(changePasswordStore.getChangePasswordConfirm(), newPassword);
+      FauxtonAPI.dispatch({ type: ActionTypes.AUTH_CLEAR_CHANGE_PWD_FIELDS });
+      assert.equal(changePasswordStore.getChangePassword(), '');
+    });
 
-        FauxtonAPI.dispatch({ type: ActionTypes.AUTH_CLEAR_CHANGE_PWD_FIELDS });
-        assert.equal(changePasswordStore.getChangePasswordConfirm(), '');
+    it('get / set change confirm password updates store', function () {
+      // check empty by default
+      assert.equal(changePasswordStore.getChangePasswordConfirm(), '');
+
+      // check getPassword works
+      var newPassword = 'never-gonna-let-you-down';
+      FauxtonAPI.dispatch({
+        type: ActionTypes.AUTH_UPDATE_CHANGE_PWD_CONFIRM_FIELD,
+        value: newPassword
       });
+      assert.equal(changePasswordStore.getChangePasswordConfirm(), newPassword);
     });
 
+    it('clearing change confirm password clears in store', function () {
+      var newPassword = 'never-gonna-run-around-and-desert-you';
+      FauxtonAPI.dispatch({
+        type: ActionTypes.AUTH_UPDATE_CHANGE_PWD_CONFIRM_FIELD,
+        value: newPassword
+      });
+      assert.equal(changePasswordStore.getChangePasswordConfirm(), newPassword);
 
-    describe('CreateAdminStore', function () {
+      FauxtonAPI.dispatch({ type: ActionTypes.AUTH_CLEAR_CHANGE_PWD_FIELDS });
+      assert.equal(changePasswordStore.getChangePasswordConfirm(), '');
+    });
+  });
 
-      it('get / set username updates store', function () {
-        assert.equal(createAdminStore.getUsername(), '');
 
-        var newUsername = 'never-gonna-make-you-cry';
-        FauxtonAPI.dispatch({
-          type: ActionTypes.AUTH_UPDATE_CREATE_ADMIN_USERNAME_FIELD,
-          value: newUsername
-        });
-        assert.equal(createAdminStore.getUsername(), newUsername);
-      });
+  describe('CreateAdminStore', function () {
 
-      it('clearing username clears in store', function () {
-        var newUsername = 'never-gonna-say-goodbye';
-        FauxtonAPI.dispatch({
-          type: ActionTypes.AUTH_UPDATE_CREATE_ADMIN_USERNAME_FIELD,
-          value: newUsername
-        });
-        assert.equal(createAdminStore.getUsername(), newUsername);
+    it('get / set username updates store', function () {
+      assert.equal(createAdminStore.getUsername(), '');
 
-        FauxtonAPI.dispatch({ type: ActionTypes.AUTH_CLEAR_CREATE_ADMIN_FIELDS });
-        assert.equal(createAdminStore.getUsername(), '');
+      var newUsername = 'never-gonna-make-you-cry';
+      FauxtonAPI.dispatch({
+        type: ActionTypes.AUTH_UPDATE_CREATE_ADMIN_USERNAME_FIELD,
+        value: newUsername
       });
+      assert.equal(createAdminStore.getUsername(), newUsername);
+    });
 
-      it('get / set password updates store', function () {
-        // check empty by default
-        assert.equal(createAdminStore.getPassword(), '');
-
-        // check getPassword works
-        var newPassword = 'never-gonna-tell-a-lie-and-hurt-you';
-        FauxtonAPI.dispatch({
-          type: ActionTypes.AUTH_UPDATE_CREATE_ADMIN_PWD_FIELD,
-          value: newPassword
-        });
-        assert.equal(createAdminStore.getPassword(), newPassword);
+    it('clearing username clears in store', function () {
+      var newUsername = 'never-gonna-say-goodbye';
+      FauxtonAPI.dispatch({
+        type: ActionTypes.AUTH_UPDATE_CREATE_ADMIN_USERNAME_FIELD,
+        value: newUsername
       });
+      assert.equal(createAdminStore.getUsername(), newUsername);
 
-      it('clearing change confirm password clears in store', function () {
-        var newPassword = 'mocha-please-consider-yourself-rickrolled';
-        FauxtonAPI.dispatch({
-          type: ActionTypes.AUTH_UPDATE_CREATE_ADMIN_PWD_FIELD,
-          value: newPassword
-        });
-        assert.equal(createAdminStore.getPassword(), newPassword);
-
-        FauxtonAPI.dispatch({ type: ActionTypes.AUTH_CLEAR_CREATE_ADMIN_FIELDS });
-        assert.equal(createAdminStore.getPassword(), '');
-      });
+      FauxtonAPI.dispatch({ type: ActionTypes.AUTH_CLEAR_CREATE_ADMIN_FIELDS });
+      assert.equal(createAdminStore.getUsername(), '');
     });
 
+    it('get / set password updates store', function () {
+      // check empty by default
+      assert.equal(createAdminStore.getPassword(), '');
 
-    describe('CreateAdminSidebarStore', function () {
-      var defaultPage = 'changePassword';
-      it('has correct default selected page', function () {
-        assert.equal(createAdminSidebarStore.getSelectedPage(), defaultPage);
+      // check getPassword works
+      var newPassword = 'never-gonna-tell-a-lie-and-hurt-you';
+      FauxtonAPI.dispatch({
+        type: ActionTypes.AUTH_UPDATE_CREATE_ADMIN_PWD_FIELD,
+        value: newPassword
       });
+      assert.equal(createAdminStore.getPassword(), newPassword);
+    });
 
-      it('selecting a page updates the selected page in store', function () {
-        var newPage = 'addAdmin';
-        FauxtonAPI.dispatch({ type: ActionTypes.AUTH_SELECT_PAGE, page: newPage });
-        assert.equal(createAdminSidebarStore.getSelectedPage(), newPage);
+    it('clearing change confirm password clears in store', function () {
+      var newPassword = 'mocha-please-consider-yourself-rickrolled';
+      FauxtonAPI.dispatch({
+        type: ActionTypes.AUTH_UPDATE_CREATE_ADMIN_PWD_FIELD,
+        value: newPassword
       });
+      assert.equal(createAdminStore.getPassword(), newPassword);
+
+      FauxtonAPI.dispatch({ type: ActionTypes.AUTH_CLEAR_CREATE_ADMIN_FIELDS });
+      assert.equal(createAdminStore.getPassword(), '');
     });
+  });
+
 
+  describe('CreateAdminSidebarStore', function () {
+    var defaultPage = 'changePassword';
+    it('has correct default selected page', function () {
+      assert.equal(createAdminSidebarStore.getSelectedPage(), defaultPage);
+    });
+
+    it('selecting a page updates the selected page in store', function () {
+      var newPage = 'addAdmin';
+      FauxtonAPI.dispatch({ type: ActionTypes.AUTH_SELECT_PAGE, page: newPage });
+      assert.equal(createAdminSidebarStore.getSelectedPage(), newPage);
+    });
   });
 
 });

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/0ca35da7/app/addons/auth/test/baseSpec.js
----------------------------------------------------------------------
diff --git a/app/addons/auth/test/baseSpec.js b/app/addons/auth/test/baseSpec.js
index 81fa366..c566287 100644
--- a/app/addons/auth/test/baseSpec.js
+++ b/app/addons/auth/test/baseSpec.js
@@ -9,95 +9,92 @@
 // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 // License for the specific language governing permissions and limitations under
 // the License.
-define([
-      '../../../core/api',
-      '../base',
-      '../../../core/auth',
-      '../../../../test/mocha/testUtils',
-      'sinon'
-], function (FauxtonAPI, Base, Auth, testUtils, sinon) {
-  var assert = testUtils.assert;
-
-  describe("Auth: Login", function () {
-
-    describe("failed login", function () {
-
-      it("redirects with replace: true set", function () {
-        var navigateSpy = sinon.spy(FauxtonAPI, 'navigate');
-        FauxtonAPI.auth = new Auth();
-        FauxtonAPI.session.isLoggedIn = function () { return false; };
-        Base.initialize();
-        FauxtonAPI.auth.authDeniedCb();
-        assert.ok(navigateSpy.withArgs('/login?urlback=', {replace: true}).calledOnce);
-      });
+import FauxtonAPI from "../../../core/api";
+import Base from "../base";
+import Auth from "../../../core/auth";
+import testUtils from "../../../../test/mocha/testUtils";
+import sinon from "sinon";
+var assert = testUtils.assert;
+
+describe("Auth: Login", function () {
+
+  describe("failed login", function () {
+
+    it("redirects with replace: true set", function () {
+      var navigateSpy = sinon.spy(FauxtonAPI, 'navigate');
+      FauxtonAPI.auth = new Auth();
+      FauxtonAPI.session.isLoggedIn = function () { return false; };
+      Base.initialize();
+      FauxtonAPI.auth.authDeniedCb();
+      assert.ok(navigateSpy.withArgs('/login?urlback=', {replace: true}).calledOnce);
     });
   });
+});
 
-  describe('auth session change', function () {
+describe('auth session change', function () {
 
-    afterEach(function () {
-      FauxtonAPI.updateHeaderLink.restore && FauxtonAPI.updateHeaderLink.restore();
-      FauxtonAPI.session.isAdminParty.restore && FauxtonAPI.session.isAdminParty.restore();
-    });
+  afterEach(function () {
+    FauxtonAPI.updateHeaderLink.restore && FauxtonAPI.updateHeaderLink.restore();
+    FauxtonAPI.session.isAdminParty.restore && FauxtonAPI.session.isAdminParty.restore();
+  });
 
-    it('for admin party changes title to admin party', function () {
-      var spy = sinon.spy(FauxtonAPI, 'updateHeaderLink');
-      var stub = sinon.stub(FauxtonAPI.session, 'isAdminParty').returns(true);
-      FauxtonAPI.session.trigger('change');
+  it('for admin party changes title to admin party', function () {
+    var spy = sinon.spy(FauxtonAPI, 'updateHeaderLink');
+    var stub = sinon.stub(FauxtonAPI.session, 'isAdminParty').returns(true);
+    FauxtonAPI.session.trigger('change');
 
-      assert.ok(spy.calledOnce);
-      var args = spy.getCall(0).args[0];
+    assert.ok(spy.calledOnce);
+    var args = spy.getCall(0).args[0];
 
-      assert.ok(args.title.match(/Admin Party/));
-      FauxtonAPI.session.isAdminParty.restore();
-    });
+    assert.ok(args.title.match(/Admin Party/));
+    FauxtonAPI.session.isAdminParty.restore();
+  });
 
-    it('for login changes title to login', function () {
-      var spy = sinon.spy(FauxtonAPI, 'updateHeaderLink');
-      var stub = sinon.stub(FauxtonAPI.session, 'isAdminParty').returns(false);
-      sinon.stub(FauxtonAPI.session, 'user').returns({name: 'test-user'});
-      sinon.stub(FauxtonAPI.session, 'isLoggedIn').returns(true);
-      FauxtonAPI.session.trigger('change');
+  it('for login changes title to login', function () {
+    var spy = sinon.spy(FauxtonAPI, 'updateHeaderLink');
+    var stub = sinon.stub(FauxtonAPI.session, 'isAdminParty').returns(false);
+    sinon.stub(FauxtonAPI.session, 'user').returns({name: 'test-user'});
+    sinon.stub(FauxtonAPI.session, 'isLoggedIn').returns(true);
+    FauxtonAPI.session.trigger('change');
 
-      assert.ok(spy.calledOnce);
-      var args = spy.getCall(0).args[0];
+    assert.ok(spy.calledOnce);
+    var args = spy.getCall(0).args[0];
 
-      assert.equal(args.title, 'test-user');
-      FauxtonAPI.session.isLoggedIn.restore();
-      FauxtonAPI.session.user.restore();
-      FauxtonAPI.session.isAdminParty.restore();
-    });
+    assert.equal(args.title, 'test-user');
+    FauxtonAPI.session.isLoggedIn.restore();
+    FauxtonAPI.session.user.restore();
+    FauxtonAPI.session.isAdminParty.restore();
+  });
 
-    it('for login adds logout link', function () {
-      var spy = sinon.spy(FauxtonAPI, 'addHeaderLink');
-      var stub = sinon.stub(FauxtonAPI.session, 'isAdminParty').returns(false);
-      sinon.stub(FauxtonAPI.session, 'user').returns({name: 'test-user'});
-      sinon.stub(FauxtonAPI.session, 'isLoggedIn').returns(true);
-      FauxtonAPI.session.trigger('change');
+  it('for login adds logout link', function () {
+    var spy = sinon.spy(FauxtonAPI, 'addHeaderLink');
+    var stub = sinon.stub(FauxtonAPI.session, 'isAdminParty').returns(false);
+    sinon.stub(FauxtonAPI.session, 'user').returns({name: 'test-user'});
+    sinon.stub(FauxtonAPI.session, 'isLoggedIn').returns(true);
+    FauxtonAPI.session.trigger('change');
 
-      assert.ok(spy.calledOnce);
-      var args = spy.getCall(0).args[0];
+    assert.ok(spy.calledOnce);
+    var args = spy.getCall(0).args[0];
 
-      assert.equal(args.title, 'Logout');
-      FauxtonAPI.session.isLoggedIn.restore();
-      FauxtonAPI.session.user.restore();
-      FauxtonAPI.session.isAdminParty.restore();
-    });
+    assert.equal(args.title, 'Logout');
+    FauxtonAPI.session.isLoggedIn.restore();
+    FauxtonAPI.session.user.restore();
+    FauxtonAPI.session.isAdminParty.restore();
+  });
 
-    it('for logout, removes logout link', function () {
-      var spy = sinon.spy(FauxtonAPI, 'removeHeaderLink');
-      var stub = sinon.stub(FauxtonAPI.session, 'isAdminParty').returns(false);
-      sinon.stub(FauxtonAPI.session, 'isLoggedIn').returns(false);
-      FauxtonAPI.session.trigger('change');
+  it('for logout, removes logout link', function () {
+    var spy = sinon.spy(FauxtonAPI, 'removeHeaderLink');
+    var stub = sinon.stub(FauxtonAPI.session, 'isAdminParty').returns(false);
+    sinon.stub(FauxtonAPI.session, 'isLoggedIn').returns(false);
+    FauxtonAPI.session.trigger('change');
 
-      assert.ok(spy.calledOnce);
-      var args = spy.getCall(0).args[0];
+    assert.ok(spy.calledOnce);
+    var args = spy.getCall(0).args[0];
 
-      assert.equal(args.id, 'logout');
-      FauxtonAPI.session.isLoggedIn.restore();
-      FauxtonAPI.session.isAdminParty.restore();
-    });
+    assert.equal(args.id, 'logout');
+    FauxtonAPI.session.isLoggedIn.restore();
+    FauxtonAPI.session.isAdminParty.restore();
+  });
 
 
-  });
 });

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/0ca35da7/app/addons/cluster/base.js
----------------------------------------------------------------------
diff --git a/app/addons/cluster/base.js b/app/addons/cluster/base.js
index 43f3a21..ec264ab 100644
--- a/app/addons/cluster/base.js
+++ b/app/addons/cluster/base.js
@@ -10,15 +10,10 @@
 // License for the specific language governing permissions and limitations under
 // the License.
 
-define([
-  '../../app',
-  '../../core/api',
-  './routes'
-],
+import app from "../../app";
+import FauxtonAPI from "../../core/api";
+import Cluster from "./routes";
 
-function (app, FauxtonAPI, Cluster) {
+Cluster.initialize = function () {};
 
-  Cluster.initialize = function () {};
-
-  return Cluster;
-});
+export default Cluster;

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/0ca35da7/app/addons/cluster/cluster.actions.js
----------------------------------------------------------------------
diff --git a/app/addons/cluster/cluster.actions.js b/app/addons/cluster/cluster.actions.js
index a21bd3e..f515548 100644
--- a/app/addons/cluster/cluster.actions.js
+++ b/app/addons/cluster/cluster.actions.js
@@ -10,42 +10,39 @@
 // License for the specific language governing permissions and limitations under
 // the License.
 
-define([
-  '../../core/api',
-  './resources',
-  './cluster.actiontypes'
-],
-function (FauxtonAPI, ClusterResources, ActionTypes) {
-  return {
-    fetchNodes: function () {
-      var memberships = new ClusterResources.ClusterNodes();
-
-      memberships.fetch().then(function () {
-        this.updateNodes({
-          nodes: memberships.get('nodes_mapped')
-        });
-      }.bind(this));
-    },
-
-    updateNodes: function (options) {
-      FauxtonAPI.dispatch({
-        type: ActionTypes.CLUSTER_FETCH_NODES,
-        options: options
+import FauxtonAPI from "../../core/api";
+import ClusterResources from "./resources";
+import ActionTypes from "./cluster.actiontypes";
+
+export default {
+  fetchNodes: function () {
+    var memberships = new ClusterResources.ClusterNodes();
+
+    memberships.fetch().then(function () {
+      this.updateNodes({
+        nodes: memberships.get('nodes_mapped')
       });
-    },
+    }.bind(this));
+  },
 
-    navigateToNodeBasedOnNodeCount: function (successtarget) {
-      var memberships = new ClusterResources.ClusterNodes();
+  updateNodes: function (options) {
+    FauxtonAPI.dispatch({
+      type: ActionTypes.CLUSTER_FETCH_NODES,
+      options: options
+    });
+  },
 
-      memberships.fetch().then(function () {
-        var nodes = memberships.get('all_nodes');
+  navigateToNodeBasedOnNodeCount: function (successtarget) {
+    var memberships = new ClusterResources.ClusterNodes();
 
-        if (nodes.length === 1) {
-          return FauxtonAPI.navigate(successtarget + nodes[0]);
-        }
-        return FauxtonAPI.navigate('/cluster/disabled', {trigger: true});
-      });
-    }
+    memberships.fetch().then(function () {
+      var nodes = memberships.get('all_nodes');
+
+      if (nodes.length === 1) {
+        return FauxtonAPI.navigate(successtarget + nodes[0]);
+      }
+      return FauxtonAPI.navigate('/cluster/disabled', {trigger: true});
+    });
+  }
 
-  };
-});
+};

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/0ca35da7/app/addons/cluster/cluster.actiontypes.js
----------------------------------------------------------------------
diff --git a/app/addons/cluster/cluster.actiontypes.js b/app/addons/cluster/cluster.actiontypes.js
index 8fd521e..525e7f6 100644
--- a/app/addons/cluster/cluster.actiontypes.js
+++ b/app/addons/cluster/cluster.actiontypes.js
@@ -10,8 +10,6 @@
 // License for the specific language governing permissions and limitations under
 // the License.
 
-define([], function () {
-  return {
-    CLUSTER_FETCH_NODES: 'CLUSTER_FETCH_NODES'
-  };
-});
+export default {
+  CLUSTER_FETCH_NODES: 'CLUSTER_FETCH_NODES'
+};

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/0ca35da7/app/addons/cluster/cluster.react.jsx
----------------------------------------------------------------------
diff --git a/app/addons/cluster/cluster.react.jsx b/app/addons/cluster/cluster.react.jsx
index 954f32c..97f6ea1 100644
--- a/app/addons/cluster/cluster.react.jsx
+++ b/app/addons/cluster/cluster.react.jsx
@@ -10,70 +10,64 @@
 // License for the specific language governing permissions and limitations under
 // the License.
 
-define([
-  '../../app',
-  '../../core/api',
-  'react',
-  './cluster.stores'
-],
+import app from "../../app";
+import FauxtonAPI from "../../core/api";
+import React from "react";
+import ClusterStore from "./cluster.stores";
 
-function (app, FauxtonAPI, React, ClusterStore) {
+var nodesStore = ClusterStore.nodesStore;
 
-  var nodesStore = ClusterStore.nodesStore;
 
+var DisabledConfigController = React.createClass({
 
-  var DisabledConfigController = React.createClass({
+  getStoreState: function () {
+    return {
+      nodes: nodesStore.getNodes()
+    };
+  },
 
-    getStoreState: function () {
-      return {
-        nodes: nodesStore.getNodes()
-      };
-    },
+  getInitialState: function () {
+    return this.getStoreState();
+  },
 
-    getInitialState: function () {
-      return this.getStoreState();
-    },
+  componentDidMount: function () {
+    nodesStore.on('change', this.onChange, this);
+  },
 
-    componentDidMount: function () {
-      nodesStore.on('change', this.onChange, this);
-    },
+  componentWillUnmount: function () {
+    nodesStore.off('change', this.onChange);
+  },
 
-    componentWillUnmount: function () {
-      nodesStore.off('change', this.onChange);
-    },
+  onChange: function () {
+    this.setState(this.getStoreState());
+  },
 
-    onChange: function () {
-      this.setState(this.getStoreState());
-    },
-
-    render: function () {
-      return (
-        <div className="config-warning-cluster-wrapper">
-          <div className="config-warning-cluster-container">
-            <div>
-              <div className="config-warning-icon-container pull-left">
-                <i className="fonticon-attention-circled"></i>
-              </div>
-              It seems that you are running a cluster with {this.state.nodes.length} nodes.
For CouchDB 2.0
-              we recommend using a configuration management tools like Chef, Ansible,
-              Puppet or Salt (in no particular order) to configure your nodes in a cluster.
-              <br/>
-              <br/>
-              <div className="config-warning-other-text">
-                We highly recommend against configuring nodes in your cluster using the HTTP
API and
-                suggest using a configuration management tool for all configurations.
-              </div>
+  render: function () {
+    return (
+      <div className="config-warning-cluster-wrapper">
+        <div className="config-warning-cluster-container">
+          <div>
+            <div className="config-warning-icon-container pull-left">
+              <i className="fonticon-attention-circled"></i>
+            </div>
+            It seems that you are running a cluster with {this.state.nodes.length} nodes.
For CouchDB 2.0
+            we recommend using a configuration management tools like Chef, Ansible,
+            Puppet or Salt (in no particular order) to configure your nodes in a cluster.
+            <br/>
+            <br/>
+            <div className="config-warning-other-text">
+              We highly recommend against configuring nodes in your cluster using the HTTP
API and
+              suggest using a configuration management tool for all configurations.
             </div>
           </div>
         </div>
-      );
-    }
-  });
-
-  var Views = {
-    DisabledConfigController: DisabledConfigController
-  };
+      </div>
+    );
+  }
+});
 
-  return Views;
+var Views = {
+  DisabledConfigController: DisabledConfigController
+};
 
-});
+export default Views;

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/0ca35da7/app/addons/cluster/cluster.stores.js
----------------------------------------------------------------------
diff --git a/app/addons/cluster/cluster.stores.js b/app/addons/cluster/cluster.stores.js
index 5d91ea3..8463304 100644
--- a/app/addons/cluster/cluster.stores.js
+++ b/app/addons/cluster/cluster.stores.js
@@ -10,51 +10,48 @@
 // License for the specific language governing permissions and limitations under
 // the License.
 
-define([
-  '../../core/api',
-  './cluster.actiontypes'
-], function (FauxtonAPI, ActionTypes) {
+import FauxtonAPI from "../../core/api";
+import ActionTypes from "./cluster.actiontypes";
 
-  var NodesStore = FauxtonAPI.Store.extend({
+var NodesStore = FauxtonAPI.Store.extend({
 
-    initialize: function () {
-      this.reset();
-    },
+  initialize: function () {
+    this.reset();
+  },
 
-    reset: function () {
-      this._nodes = [];
-    },
+  reset: function () {
+    this._nodes = [];
+  },
 
-    setNodes: function (options) {
-      this._nodes = options.nodes;
-    },
+  setNodes: function (options) {
+    this._nodes = options.nodes;
+  },
 
-    getNodes: function () {
-      return this._nodes;
-    },
+  getNodes: function () {
+    return this._nodes;
+  },
 
-    dispatch: function (action) {
+  dispatch: function (action) {
 
-      switch (action.type) {
-        case ActionTypes.CLUSTER_FETCH_NODES:
-          this.setNodes(action.options);
-        break;
+    switch (action.type) {
+      case ActionTypes.CLUSTER_FETCH_NODES:
+        this.setNodes(action.options);
+      break;
 
-        default:
-        return;
-      }
-
-      this.triggerChange();
+      default:
+      return;
     }
 
-  });
+    this.triggerChange();
+  }
+
+});
 
 
-  var nodesStore = new NodesStore();
+var nodesStore = new NodesStore();
 
-  nodesStore.dispatchToken = FauxtonAPI.dispatcher.register(nodesStore.dispatch.bind(nodesStore));
+nodesStore.dispatchToken = FauxtonAPI.dispatcher.register(nodesStore.dispatch.bind(nodesStore));
 
-  return {
-    nodesStore: nodesStore
-  };
-});
+export default {
+  nodesStore: nodesStore
+};

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/0ca35da7/app/addons/cluster/resources.js
----------------------------------------------------------------------
diff --git a/app/addons/cluster/resources.js b/app/addons/cluster/resources.js
index ed17d3a..cb74aeb 100644
--- a/app/addons/cluster/resources.js
+++ b/app/addons/cluster/resources.js
@@ -10,37 +10,33 @@
 // License for the specific language governing permissions and limitations under
 // the License.
 
-define([
-  '../../app',
-  '../../core/api'
-],
-function (app, FauxtonAPI) {
-
-  var Cluster = FauxtonAPI.addon();
-
-  Cluster.ClusterNodes = Backbone.Model.extend({
-    url: function (context) {
-      if (context === 'apiurl') {
-        return window.location.origin + '/_membership';
-      } else {
-        return app.host + '/_membership';
-      }
-    },
-
-    parse: function (res) {
-      var list;
-
-      list = res.all_nodes.reduce(function (acc, node) {
-        var isInCluster = res.cluster_nodes.indexOf(node) !== -1;
-
-        acc.push({node: node, isInCluster: isInCluster});
-        return acc;
-      }, []);
-
-      res.nodes_mapped = list;
-      return res;
+import app from "../../app";
+import FauxtonAPI from "../../core/api";
+
+var Cluster = FauxtonAPI.addon();
+
+Cluster.ClusterNodes = Backbone.Model.extend({
+  url: function (context) {
+    if (context === 'apiurl') {
+      return window.location.origin + '/_membership';
+    } else {
+      return app.host + '/_membership';
     }
-  });
+  },
+
+  parse: function (res) {
+    var list;
 
-  return Cluster;
+    list = res.all_nodes.reduce(function (acc, node) {
+      var isInCluster = res.cluster_nodes.indexOf(node) !== -1;
+
+      acc.push({node: node, isInCluster: isInCluster});
+      return acc;
+    }, []);
+
+    res.nodes_mapped = list;
+    return res;
+  }
 });
+
+export default Cluster;

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/0ca35da7/app/addons/cluster/routes.js
----------------------------------------------------------------------
diff --git a/app/addons/cluster/routes.js b/app/addons/cluster/routes.js
index 69d632a..7287c5a 100644
--- a/app/addons/cluster/routes.js
+++ b/app/addons/cluster/routes.js
@@ -10,43 +10,38 @@
 // License for the specific language governing permissions and limitations under
 // the License.
 
-define([
-  '../../app',
-  '../../core/api',
-  './resources',
-  './cluster.react',
-  './cluster.actions'
-],
+import app from "../../app";
+import FauxtonAPI from "../../core/api";
+import Cluster from "./resources";
+import ClusterComponents from "./cluster.react";
+import ClusterActions from "./cluster.actions";
 
-function (app, FauxtonAPI, Cluster, ClusterComponents, ClusterActions) {
 
+var ConfigDisabledRouteObject = FauxtonAPI.RouteObject.extend({
+  layout: 'one_pane',
 
-  var ConfigDisabledRouteObject = FauxtonAPI.RouteObject.extend({
-    layout: 'one_pane',
+  routes: {
+    'cluster/disabled': 'showDisabledFeatureScreen'
+  },
 
-    routes: {
-      'cluster/disabled': 'showDisabledFeatureScreen'
-    },
+  crumbs: [
+    { name: 'Config disabled', link: '_config' }
+  ],
 
-    crumbs: [
-      { name: 'Config disabled', link: '_config' }
-    ],
+  apiUrl: function () {
+    return [this.memberships.url('apiurl'), this.memberships.documentation];
+  },
 
-    apiUrl: function () {
-      return [this.memberships.url('apiurl'), this.memberships.documentation];
-    },
+  initialize: function () {
+    this.memberships = new Cluster.ClusterNodes();
+  },
 
-    initialize: function () {
-      this.memberships = new Cluster.ClusterNodes();
-    },
-
-    showDisabledFeatureScreen: function () {
-      ClusterActions.fetchNodes();
-      this.warning = this.setComponent('#dashboard-content', ClusterComponents.DisabledConfigController);
-    }
-  });
+  showDisabledFeatureScreen: function () {
+    ClusterActions.fetchNodes();
+    this.warning = this.setComponent('#dashboard-content', ClusterComponents.DisabledConfigController);
+  }
+});
 
-  Cluster.RouteObjects = [ConfigDisabledRouteObject];
+Cluster.RouteObjects = [ConfigDisabledRouteObject];
 
-  return Cluster;
-});
+export default Cluster;

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/0ca35da7/app/addons/cluster/tests/clusterSpec.react.jsx
----------------------------------------------------------------------
diff --git a/app/addons/cluster/tests/clusterSpec.react.jsx b/app/addons/cluster/tests/clusterSpec.react.jsx
index 85687b3..fae04be 100644
--- a/app/addons/cluster/tests/clusterSpec.react.jsx
+++ b/app/addons/cluster/tests/clusterSpec.react.jsx
@@ -9,49 +9,46 @@
 // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 // License for the specific language governing permissions and limitations under
 // the License.
-define([
-  '../../../core/api',
-  '../cluster.react',
-  '../cluster.actions',
-  '../cluster.stores',
-  '../../../../test/mocha/testUtils',
-  'react',
-  'react-dom',
-  'react-addons-test-utils',
-], function (FauxtonAPI, ClusterComponent, ClusterActions, ClusterStores, utils, React, ReactDOM,
TestUtils) {
-
-  var assert = utils.assert;
-
-  describe('Cluster Controller', function () {
-    var container, controller;
-
-    beforeEach(function () {
-
-      var nodeList = [
-        {'node': 'node1@127.0.0.1', 'isInCluster': true},
-        {'node': 'node2@127.0.0.1', 'isInCluster': true},
-        {'node': 'node3@127.0.0.1', 'isInCluster': false},
-        {'node': 'node3@127.0.0.1', 'isInCluster': false},
-        {'node': 'node3@127.0.0.1', 'isInCluster': false},
-        {'node': 'node3@127.0.0.1', 'isInCluster': false}
-      ];
-
-      ClusterActions.updateNodes({nodes: nodeList});
-
-      container = document.createElement('div');
-      controller = TestUtils.renderIntoDocument(
-        <ClusterComponent.DisabledConfigController />,
-        container
-      );
-    });
-
-    afterEach(function () {
-      ClusterStores.nodesStore.reset();
-      ReactDOM.unmountComponentAtNode(container);
-    });
-
-    it('renders the amount of nodes', function () {
-      assert.ok(/6 nodes/.test($(ReactDOM.findDOMNode(controller)).text()), 'finds 6 nodes');
-    });
+import FauxtonAPI from "../../../core/api";
+import ClusterComponent from "../cluster.react";
+import ClusterActions from "../cluster.actions";
+import ClusterStores from "../cluster.stores";
+import utils from "../../../../test/mocha/testUtils";
+import React from "react";
+import ReactDOM from "react-dom";
+import TestUtils from "react-addons-test-utils";
+
+var assert = utils.assert;
+
+describe('Cluster Controller', function () {
+  var container, controller;
+
+  beforeEach(function () {
+
+    var nodeList = [
+      {'node': 'node1@127.0.0.1', 'isInCluster': true},
+      {'node': 'node2@127.0.0.1', 'isInCluster': true},
+      {'node': 'node3@127.0.0.1', 'isInCluster': false},
+      {'node': 'node3@127.0.0.1', 'isInCluster': false},
+      {'node': 'node3@127.0.0.1', 'isInCluster': false},
+      {'node': 'node3@127.0.0.1', 'isInCluster': false}
+    ];
+
+    ClusterActions.updateNodes({nodes: nodeList});
+
+    container = document.createElement('div');
+    controller = TestUtils.renderIntoDocument(
+      <ClusterComponent.DisabledConfigController />,
+      container
+    );
+  });
+
+  afterEach(function () {
+    ClusterStores.nodesStore.reset();
+    ReactDOM.unmountComponentAtNode(container);
+  });
+
+  it('renders the amount of nodes', function () {
+    assert.ok(/6 nodes/.test($(ReactDOM.findDOMNode(controller)).text()), 'finds 6 nodes');
   });
 });

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/0ca35da7/app/addons/cluster/tests/resourcesSpec.js
----------------------------------------------------------------------
diff --git a/app/addons/cluster/tests/resourcesSpec.js b/app/addons/cluster/tests/resourcesSpec.js
index ad365f8..7443d6d 100644
--- a/app/addons/cluster/tests/resourcesSpec.js
+++ b/app/addons/cluster/tests/resourcesSpec.js
@@ -10,51 +10,48 @@
 // License for the specific language governing permissions and limitations under
 // the License.
 
-define([
-  '../../../../test/mocha/testUtils',
-  '../../../core/api',
-  '../resources',
-], function (testUtils, FauxtonAPI, Resources) {
-  var assert = testUtils.assert;
-
-
-  describe('Membership Model', function () {
-    var data = {
-      'all_nodes': ['node1@127.0.0.1', 'node2@127.0.0.1', 'node3@127.0.0.1', 'notpartofclusternode'],
-      'cluster_nodes': ['node1@127.0.0.1', 'node2@127.0.0.1', 'node3@127.0.0.1']
-    };
-
-    it('reorders the data', function () {
-      var memberships = new Resources.ClusterNodes();
-      var res = memberships.parse(data);
-
-      assert.deepEqual([
-        {node: 'node1@127.0.0.1', isInCluster: true},
-        {node: 'node2@127.0.0.1', isInCluster: true},
-        {node: 'node3@127.0.0.1', isInCluster: true},
-        {node: 'notpartofclusternode', isInCluster: false}
-      ],
-      res.nodes_mapped);
-    });
-
-    it('keeps the exiting data', function () {
-      var memberships = new Resources.ClusterNodes();
-      var res = memberships.parse(data);
-
-      assert.deepEqual([
-        'node1@127.0.0.1',
-        'node2@127.0.0.1',
-        'node3@127.0.0.1',
-        'notpartofclusternode'
-      ],
-      res.all_nodes);
-
-      assert.deepEqual([
-        'node1@127.0.0.1',
-        'node2@127.0.0.1',
-        'node3@127.0.0.1'
-      ],
-      res.cluster_nodes);
-    });
+import testUtils from "../../../../test/mocha/testUtils";
+import FauxtonAPI from "../../../core/api";
+import Resources from "../resources";
+var assert = testUtils.assert;
+
+
+describe('Membership Model', function () {
+  var data = {
+    'all_nodes': ['node1@127.0.0.1', 'node2@127.0.0.1', 'node3@127.0.0.1', 'notpartofclusternode'],
+    'cluster_nodes': ['node1@127.0.0.1', 'node2@127.0.0.1', 'node3@127.0.0.1']
+  };
+
+  it('reorders the data', function () {
+    var memberships = new Resources.ClusterNodes();
+    var res = memberships.parse(data);
+
+    assert.deepEqual([
+      {node: 'node1@127.0.0.1', isInCluster: true},
+      {node: 'node2@127.0.0.1', isInCluster: true},
+      {node: 'node3@127.0.0.1', isInCluster: true},
+      {node: 'notpartofclusternode', isInCluster: false}
+    ],
+    res.nodes_mapped);
+  });
+
+  it('keeps the exiting data', function () {
+    var memberships = new Resources.ClusterNodes();
+    var res = memberships.parse(data);
+
+    assert.deepEqual([
+      'node1@127.0.0.1',
+      'node2@127.0.0.1',
+      'node3@127.0.0.1',
+      'notpartofclusternode'
+    ],
+    res.all_nodes);
+
+    assert.deepEqual([
+      'node1@127.0.0.1',
+      'node2@127.0.0.1',
+      'node3@127.0.0.1'
+    ],
+    res.cluster_nodes);
   });
 });

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/0ca35da7/app/addons/components/actions.js
----------------------------------------------------------------------
diff --git a/app/addons/components/actions.js b/app/addons/components/actions.js
index 74bc733..a2b5855 100644
--- a/app/addons/components/actions.js
+++ b/app/addons/components/actions.js
@@ -10,75 +10,70 @@
 // License for the specific language governing permissions and limitations under
 // the License.
 
-define([
-  '../../core/api',
-  './actiontypes'
-],
-function (FauxtonAPI, ActionTypes) {
+import FauxtonAPI from "../../core/api";
+import ActionTypes from "./actiontypes";
 
-  function showAPIBarButton () {
-    FauxtonAPI.dispatch({ type: ActionTypes.CMPNTS_SHOW_API_BAR_BUTTON });
-  }
+function showAPIBarButton () {
+  FauxtonAPI.dispatch({ type: ActionTypes.CMPNTS_SHOW_API_BAR_BUTTON });
+}
 
-  function hideAPIBarButton () {
-    FauxtonAPI.dispatch({ type: ActionTypes.CMPNTS_HIDE_API_BAR_BUTTON });
-  }
+function hideAPIBarButton () {
+  FauxtonAPI.dispatch({ type: ActionTypes.CMPNTS_HIDE_API_BAR_BUTTON });
+}
 
-  function toggleApiBarVisibility (visible) {
-    FauxtonAPI.dispatch({
-      type: ActionTypes.CMPNTS_SET_API_BAR_CONTENT_VISIBLE_STATE,
-      options: visible
-    });
-  }
+function toggleApiBarVisibility (visible) {
+  FauxtonAPI.dispatch({
+    type: ActionTypes.CMPNTS_SET_API_BAR_CONTENT_VISIBLE_STATE,
+    options: visible
+  });
+}
 
-  function updateAPIBar (params) {
-    FauxtonAPI.dispatch({
-      type: ActionTypes.CMPNTS_UPDATE_API_BAR,
-      options: params
-    });
-  }
+function updateAPIBar (params) {
+  FauxtonAPI.dispatch({
+    type: ActionTypes.CMPNTS_UPDATE_API_BAR,
+    options: params
+  });
+}
 
-  function showDeleteDatabaseModal (options) {
-    FauxtonAPI.dispatch({
-      type: ActionTypes.CMPNTS_DATABASES_SHOWDELETE_MODAL,
-      options: options
-    });
-  }
+function showDeleteDatabaseModal (options) {
+  FauxtonAPI.dispatch({
+    type: ActionTypes.CMPNTS_DATABASES_SHOWDELETE_MODAL,
+    options: options
+  });
+}
 
-  function deleteDatabase (dbId) {
-    var url = FauxtonAPI.urls('databaseBaseURL', 'server', dbId, '');
+function deleteDatabase (dbId) {
+  var url = FauxtonAPI.urls('databaseBaseURL', 'server', dbId, '');
 
-    $.ajax({
-      url: url,
-      dataType: 'json',
-      type: 'DELETE'
-    }).then(function () {
-      this.showDeleteDatabaseModal({ showModal: true });
+  $.ajax({
+    url: url,
+    dataType: 'json',
+    type: 'DELETE'
+  }).then(function () {
+    this.showDeleteDatabaseModal({ showModal: true });
 
-      FauxtonAPI.addNotification({
-        msg: 'The database <code>' + _.escape(dbId) + '</code> has been deleted.',
-        clear: true,
-        escape: false // beware of possible XSS when the message changes
-      });
+    FauxtonAPI.addNotification({
+      msg: 'The database <code>' + _.escape(dbId) + '</code> has been deleted.',
+      clear: true,
+      escape: false // beware of possible XSS when the message changes
+    });
 
-      Backbone.history.loadUrl(FauxtonAPI.urls('allDBs', 'app'));
+    Backbone.history.loadUrl(FauxtonAPI.urls('allDBs', 'app'));
 
-    }.bind(this)).fail(function (rsp, error, msg) {
-      FauxtonAPI.addNotification({
-        msg: 'Could not delete the database, reason ' + msg + '.',
-        type: 'error',
-        clear: true
-      });
+  }.bind(this)).fail(function (rsp, error, msg) {
+    FauxtonAPI.addNotification({
+      msg: 'Could not delete the database, reason ' + msg + '.',
+      type: 'error',
+      clear: true
     });
-  }
-
-  return {
-    deleteDatabase: deleteDatabase,
-    showDeleteDatabaseModal: showDeleteDatabaseModal,
-    showAPIBarButton: showAPIBarButton,
-    hideAPIBarButton: hideAPIBarButton,
-    toggleApiBarVisibility: toggleApiBarVisibility,
-    updateAPIBar: updateAPIBar,
-  };
+  });
+}
 
-});
+export default {
+  deleteDatabase: deleteDatabase,
+  showDeleteDatabaseModal: showDeleteDatabaseModal,
+  showAPIBarButton: showAPIBarButton,
+  hideAPIBarButton: hideAPIBarButton,
+  toggleApiBarVisibility: toggleApiBarVisibility,
+  updateAPIBar: updateAPIBar,
+};

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/0ca35da7/app/addons/components/actiontypes.js
----------------------------------------------------------------------
diff --git a/app/addons/components/actiontypes.js b/app/addons/components/actiontypes.js
index 454fe28..e1ce518 100644
--- a/app/addons/components/actiontypes.js
+++ b/app/addons/components/actiontypes.js
@@ -10,14 +10,10 @@
 // License for the specific language governing permissions and limitations under
 // the License.
 
-define([],  function () {
-
-  return {
-    CMPNTS_SHOW_API_BAR_BUTTON: 'CMPNTS_SHOW_API_BAR_BUTTON',
-    CMPNTS_HIDE_API_BAR_BUTTON: 'CMPNTS_HIDE_API_BAR_BUTTON',
-    CMPNTS_UPDATE_API_BAR: 'CMPNTS_UPDATE_API_BAR',
-    CMPNTS_SET_API_BAR_CONTENT_VISIBLE_STATE: 'CMPNTS_SET_API_BAR_CONTENT_VISIBLE_STATE',
-    CMPNTS_DATABASES_SHOWDELETE_MODAL: 'CMPNTS_DATABASES_SHOWDELETE_MODAL'
-  };
-
-});
+export default {
+  CMPNTS_SHOW_API_BAR_BUTTON: 'CMPNTS_SHOW_API_BAR_BUTTON',
+  CMPNTS_HIDE_API_BAR_BUTTON: 'CMPNTS_HIDE_API_BAR_BUTTON',
+  CMPNTS_UPDATE_API_BAR: 'CMPNTS_UPDATE_API_BAR',
+  CMPNTS_SET_API_BAR_CONTENT_VISIBLE_STATE: 'CMPNTS_SET_API_BAR_CONTENT_VISIBLE_STATE',
+  CMPNTS_DATABASES_SHOWDELETE_MODAL: 'CMPNTS_DATABASES_SHOWDELETE_MODAL'
+};

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/0ca35da7/app/addons/components/base.js
----------------------------------------------------------------------
diff --git a/app/addons/components/base.js b/app/addons/components/base.js
index 5c9197a..7fa290e 100644
--- a/app/addons/components/base.js
+++ b/app/addons/components/base.js
@@ -10,13 +10,8 @@
 // License for the specific language governing permissions and limitations under
 // the License.
 
-define([
-  './assets/less/components.less'
-],
+import "./assets/less/components.less";
+var Components = {};
+Components.initialize = function () {};
 
-function () {
-  var Components = {};
-  Components.initialize = function () {};
-
-  return Components;
-});
+export default Components;


Mime
View raw message