couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From robertkowal...@apache.org
Subject fauxton commit: updated refs/heads/master to 7308368
Date Thu, 28 Jul 2016 13:59:48 GMT
Repository: couchdb-fauxton
Updated Branches:
  refs/heads/master 6a618ebda -> 7308368d0


remove polling feature

there is no real world use case for watching the changes feed in
production. as the feature has a bug, we decided removing it would
make more sense.

PR: #755
PR-URL: https://github.com/apache/couchdb-fauxton/pull/755
Reviewed-By: garren smith <garren.smith@gmail.com>


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

Branch: refs/heads/master
Commit: 7308368d0896c259601bbc328649d8bea194ca9d
Parents: 6a618eb
Author: Robert Kowalski <robertkowalski@apache.org>
Authored: Thu Jul 28 14:31:37 2016 +0200
Committer: Robert Kowalski <robertkowalski@apache.org>
Committed: Thu Jul 28 15:59:40 2016 +0200

----------------------------------------------------------------------
 app/addons/documents/assets/less/changes.less   | 11 ------
 app/addons/documents/changes/actions.js         | 15 -------
 app/addons/documents/changes/actiontypes.js     |  3 +-
 .../documents/changes/components.react.jsx      | 41 --------------------
 app/addons/documents/changes/stores.js          | 16 --------
 app/addons/documents/routes-documents.js        |  2 +-
 .../documents/tests/nightwatch/changes.js       | 28 -------------
 7 files changed, 2 insertions(+), 114 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/7308368d/app/addons/documents/assets/less/changes.less
----------------------------------------------------------------------
diff --git a/app/addons/documents/assets/less/changes.less b/app/addons/documents/assets/less/changes.less
index c86e016..ffafd7d 100644
--- a/app/addons/documents/assets/less/changes.less
+++ b/app/addons/documents/assets/less/changes.less
@@ -137,17 +137,6 @@
   margin-left: 20px;
 }
 
-.changes-polling {
-  padding: 20px 0;
-  float: right;
-  input {
-    margin: 0 8px 1px;
-  }
-  label {
-    display: inline-block;
-  }
-}
-
 .new-change-row {
   -webkit-animation: slideDown 1.5s both, highlight-element 2.0s 1;
 }

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/7308368d/app/addons/documents/changes/actions.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/changes/actions.js b/app/addons/documents/changes/actions.js
index 1ec5c37..4d2635f 100644
--- a/app/addons/documents/changes/actions.js
+++ b/app/addons/documents/changes/actions.js
@@ -75,20 +75,5 @@ export default {
         seqNum: latestSeqNum
       });
     }
-
-    if (changesStore.pollingEnabled()) {
-      this.getLatestChanges();
-    }
-  },
-
-  togglePolling: function () {
-    FauxtonAPI.dispatch({ type: ActionTypes.TOGGLE_CHANGES_POLLING });
-
-    // the user just enabled polling. Start 'er up
-    if (changesStore.pollingEnabled()) {
-      this.getLatestChanges();
-    } else {
-      currentRequest.abort();
-    }
   }
 };

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/7308368d/app/addons/documents/changes/actiontypes.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/changes/actiontypes.js b/app/addons/documents/changes/actiontypes.js
index 34e42f7..bd2e412 100644
--- a/app/addons/documents/changes/actiontypes.js
+++ b/app/addons/documents/changes/actiontypes.js
@@ -16,6 +16,5 @@ export default {
   ADD_CHANGES_FILTER_ITEM: 'ADD_CHANGES_FILTER_ITEM',
   REMOVE_CHANGES_FILTER_ITEM: 'REMOVE_CHANGES_FILTER_ITEM',
   UPDATE_CHANGES_FILTER: 'UPDATE_CHANGES_FILTER',
-  TOGGLE_CHANGES_CODE_VISIBILITY: 'TOGGLE_CHANGES_CODE_VISIBILITY',
-  TOGGLE_CHANGES_POLLING: 'TOGGLE_CHANGES_POLLING'
+  TOGGLE_CHANGES_CODE_VISIBILITY: 'TOGGLE_CHANGES_CODE_VISIBILITY'
 };

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/7308368d/app/addons/documents/changes/components.react.jsx
----------------------------------------------------------------------
diff --git a/app/addons/documents/changes/components.react.jsx b/app/addons/documents/changes/components.react.jsx
index d015181..fb01a36 100644
--- a/app/addons/documents/changes/components.react.jsx
+++ b/app/addons/documents/changes/components.react.jsx
@@ -137,46 +137,6 @@ class ChangesTabContent extends React.Component {
 }
 
 
-class PollingOption extends React.Component {
-  constructor (props) {
-    super(props);
-    this.state = this.getStoreState();
-  }
-
-  getStoreState () {
-    return {
-      pollingEnabled: store.pollingEnabled()
-    };
-  }
-
-  onChange () {
-    this.setState(this.getStoreState());
-  }
-
-  componentDidMount () {
-    store.on('change', this.onChange, this);
-  }
-
-  componentWillUnmount () {
-    store.off('change', this.onChange);
-  }
-
-  render () {
-    return (
-      <div className="changes-polling">
-        <input
-          type="checkbox"
-          id="changes-toggle-polling"
-          checked={this.state.pollingEnabled}
-          onChange={() => Actions.togglePolling()}
-        />
-        <label htmlFor="changes-toggle-polling">Auto-update changes list</label>
-      </div>
-    );
-  }
-}
-
-
 class AddFilterForm extends React.Component {
   constructor (props) {
     super(props);
@@ -380,7 +340,6 @@ class ChangeID extends React.Component {
 
 
 export default {
-  PollingOption,
   ChangesController,
   ChangesTabContent,
   ChangeRow,

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/7308368d/app/addons/documents/changes/stores.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/changes/stores.js b/app/addons/documents/changes/stores.js
index 98c0a3d..05a6a3b 100644
--- a/app/addons/documents/changes/stores.js
+++ b/app/addons/documents/changes/stores.js
@@ -28,7 +28,6 @@ var ChangesStore = FauxtonAPI.Store.extend({
     this._databaseName = '';
     this._maxChangesListed = 100;
     this._showingSubset = false;
-    this._pollingEnabled = false;
     this._lastSequenceNum = null;
   },
 
@@ -120,17 +119,6 @@ var ChangesStore = FauxtonAPI.Store.extend({
     this._maxChangesListed = num;
   },
 
-  togglePolling: function () {
-    this._pollingEnabled = !this._pollingEnabled;
-
-    // if polling was just enabled, reset the last sequence num to 'now' so only future changes
will appear
-    this._lastSequenceNum = 'now';
-  },
-
-  pollingEnabled: function () {
-    return this._pollingEnabled;
-  },
-
   getLastSeqNum: function () {
     return this._lastSequenceNum;
   },
@@ -153,10 +141,6 @@ var ChangesStore = FauxtonAPI.Store.extend({
         this.removeFilter(action.filter);
         break;
 
-      case ActionTypes.TOGGLE_CHANGES_POLLING:
-        this.togglePolling();
-        break;
-
       default:
         return;
     }

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/7308368d/app/addons/documents/routes-documents.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/routes-documents.js b/app/addons/documents/routes-documents.js
index 3ada09e..7858177 100644
--- a/app/addons/documents/routes-documents.js
+++ b/app/addons/documents/routes-documents.js
@@ -180,7 +180,7 @@ var DocumentsRouteObject = BaseRoute.extend({
     this.setComponent("#dashboard-lower-content", Changes.ChangesController);
 
     this.removeComponent('#footer');
-    this.setComponent('#react-headerbar', Changes.PollingOption);
+    this.removeComponent('#react-headerbar');
 
     this.viewEditor && this.viewEditor.remove();
 

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/7308368d/app/addons/documents/tests/nightwatch/changes.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/tests/nightwatch/changes.js b/app/addons/documents/tests/nightwatch/changes.js
index 7fee938..b2cbabb 100644
--- a/app/addons/documents/tests/nightwatch/changes.js
+++ b/app/addons/documents/tests/nightwatch/changes.js
@@ -44,34 +44,6 @@ module.exports = {
       .clickWhenVisible('.js-doc-link')
       .waitForElementPresent('#doc-editor-actions-panel', waitTime, false)
       .end();
-  },
-
-  'Check auto-update feature': function (client) {
-    var waitTime = client.globals.maxWaitTime,
-        newDatabaseName = client.globals.testDatabaseName,
-        newDocName = 'totally-new-doc',
-        baseUrl = client.globals.test_settings.launch_url;
-
-    client
-      .loginToGUI()
-
-      // create a single document
-      .createDocument('doc_1', newDatabaseName)
-
-      // go to the changes page and enable the auto-update feature
-      .url(baseUrl + '/#/database/' + newDatabaseName + '/_changes')
-
-      .waitForElementPresent('#changes-toggle-polling', waitTime, false)
-      .clickWhenVisible('#changes-toggle-polling', waitTime, false)
-
-      // now add a new item behind the scenes with nano. Before it's added, confirm it's
not already in the page
-      .waitForElementNotPresent('.change-box[data-id="' + newDocName + '"]', waitTime, false)
-      .createDocument(newDocName, newDatabaseName)
-
-      .waitForElementPresent('.change-box[data-id="' + newDocName + '"]', waitTime, false)
-
-      // we win!
-      .end();
   }
 
 };


Mime
View raw message