You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ro...@apache.org on 2016/11/15 14:00:20 UTC

fauxton commit: updated refs/heads/master to b245c6d

Repository: couchdb-fauxton
Updated Branches:
  refs/heads/master 89f57a453 -> b245c6d20


db-list: expose elements to make them reusable

PR: #806
PR-URL: https://github.com/apache/couchdb-fauxton/pull/806
Reviewed-By: Ryan Millay


Project: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/commit/b245c6d2
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/tree/b245c6d2
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/diff/b245c6d2

Branch: refs/heads/master
Commit: b245c6d20376fd29159004b792dcea42639bcf00
Parents: 89f57a4
Author: Robert Kowalski <ro...@apache.org>
Authored: Fri Nov 11 16:57:42 2016 +0100
Committer: Robert Kowalski <ro...@apache.org>
Committed: Tue Nov 15 15:00:19 2016 +0100

----------------------------------------------------------------------
 app/addons/databases/components.react.jsx | 16 +++++++++++-----
 app/addons/databases/stores.js            |  7 ++++---
 2 files changed, 15 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/b245c6d2/app/addons/databases/components.react.jsx
----------------------------------------------------------------------
diff --git a/app/addons/databases/components.react.jsx b/app/addons/databases/components.react.jsx
index 5e58681..849f284 100644
--- a/app/addons/databases/components.react.jsx
+++ b/app/addons/databases/components.react.jsx
@@ -296,14 +296,17 @@ var DatabasePagination = React.createClass({
 
   getDefaultProps: function () {
     return {
-      linkPath: '_all_dbs'
+      linkPath: '_all_dbs',
+      store: databasesStore
     };
   },
 
   getStoreState: function () {
+    const {store} = this.props;
+
     return {
-      totalAmountOfDatabases: databasesStore.getTotalAmountOfDatabases(),
-      page: databasesStore.getPage()
+      totalAmountOfDatabases: store.getTotalAmountOfDatabases(),
+      page: store.getPage()
     };
   },
 
@@ -312,11 +315,14 @@ var DatabasePagination = React.createClass({
   },
 
   componentDidMount: function () {
-    databasesStore.on('change', this.onChange, this);
+    const {store} = this.props;
+
+    store.on('change', this.onChange, this);
   },
 
   componentWillUnmount: function () {
-    databasesStore.off('change', this.onChange, this);
+    const {store} = this.props;
+    store.off('change', this.onChange, this);
   },
 
   onChange: function () {

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/b245c6d2/app/addons/databases/stores.js
----------------------------------------------------------------------
diff --git a/app/addons/databases/stores.js b/app/addons/databases/stores.js
index e0145a2..ff75d01 100644
--- a/app/addons/databases/stores.js
+++ b/app/addons/databases/stores.js
@@ -18,7 +18,7 @@ import Helpers from "../../helpers";
 
 const Database = Resources.Model;
 
-var DatabasesStore = FauxtonAPI.Store.extend({
+const DatabasesStoreConstructor = FauxtonAPI.Store.extend({
 
   initialize: function () {
     this.reset();
@@ -134,9 +134,10 @@ var DatabasesStore = FauxtonAPI.Store.extend({
   }
 });
 
-const databasesStore = new DatabasesStore();
+const databasesStore = new DatabasesStoreConstructor();
 databasesStore.dispatchToken = FauxtonAPI.dispatcher.register(databasesStore.dispatch.bind(databasesStore));
 
 export default {
-  databasesStore: databasesStore
+  databasesStore: databasesStore,
+  DatabasesStoreConstructor: DatabasesStoreConstructor
 };