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 2015/11/20 14:56:04 UTC

[2/3] fauxton commit: updated refs/heads/master to f4ff1c5

cors: remove dead code

PR: #578
PR-URL: https://github.com/apache/couchdb-fauxton/pull/578
Reviewed-By: Michelle Phung <mi...@apache.org>


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

Branch: refs/heads/master
Commit: 0500da8ab2c0cd96d830d1419fc5d309d3e68d22
Parents: 270183b
Author: Robert Kowalski <ro...@apache.org>
Authored: Wed Nov 18 12:53:48 2015 +0100
Committer: Robert Kowalski <ro...@apache.org>
Committed: Fri Nov 20 14:55:46 2015 +0100

----------------------------------------------------------------------
 app/addons/cors/actiontypes.js        |  4 +---
 app/addons/cors/stores.js             | 19 ++-----------------
 app/addons/cors/tests/actionsSpecs.js | 24 ------------------------
 3 files changed, 3 insertions(+), 44 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/0500da8a/app/addons/cors/actiontypes.js
----------------------------------------------------------------------
diff --git a/app/addons/cors/actiontypes.js b/app/addons/cors/actiontypes.js
index 7e4916b..7182624 100644
--- a/app/addons/cors/actiontypes.js
+++ b/app/addons/cors/actiontypes.js
@@ -17,8 +17,6 @@ define([], function () {
     CORS_IS_ALL_ORIGINS: 'CORS_IS_ALL_ORIGINS',
     CORS_DELETE_ORIGIN: 'CORS_DELETE_ORIGIN',
     CORS_UPDATE_ORIGIN: 'CORS_UPDATE_ORIGIN',
-    CORS_METHOD_CHANGE: 'CORS_METHOD_CHANGE',
-    CORS_SAVING: 'CORS_SAVING',
-    CORS_SAVED: 'CORS_SAVED'
+    CORS_METHOD_CHANGE: 'CORS_METHOD_CHANGE'
   };
 });

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/0500da8a/app/addons/cors/stores.js
----------------------------------------------------------------------
diff --git a/app/addons/cors/stores.js b/app/addons/cors/stores.js
index bd36093..bd33447 100644
--- a/app/addons/cors/stores.js
+++ b/app/addons/cors/stores.js
@@ -100,53 +100,38 @@ define([
       switch (action.type) {
         case ActionTypes.EDIT_CORS:
           this.editCors(action.options);
-          this.triggerChange();
         break;
 
         case ActionTypes.TOGGLE_ENABLE_CORS:
           this.toggleEnableCors();
           this.setConfigChanged();
-          this.triggerChange();
         break;
 
         case ActionTypes.CORS_ADD_ORIGIN:
           this.addOrigin(action.origin);
           this.setConfigChanged();
-          this.triggerChange();
         break;
 
         case ActionTypes.CORS_IS_ALL_ORIGINS:
           this.originChange(action.isAllOrigins);
           this.setConfigChanged();
-          this.triggerChange();
         break;
 
         case ActionTypes.CORS_DELETE_ORIGIN:
           this.deleteOrigin(action.origin);
           this.setConfigChanged();
-          this.triggerChange();
         break;
 
         case ActionTypes.CORS_UPDATE_ORIGIN:
           this.updateOrigin(action.updatedOrigin, action.originalOrigin);
           this.setConfigChanged();
-          this.triggerChange();
-        break;
-
-        case ActionTypes.CORS_SAVING:
-          this.saving();
-          this.triggerChange();
-        break;
-
-        case ActionTypes.CORS_SAVED:
-          this.setConfigSaved();
-          this.savingDone();
-          this.triggerChange();
         break;
 
         default:
         return;
       }
+
+      this.triggerChange();
     }
 
   });

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/0500da8a/app/addons/cors/tests/actionsSpecs.js
----------------------------------------------------------------------
diff --git a/app/addons/cors/tests/actionsSpecs.js b/app/addons/cors/tests/actionsSpecs.js
index 9b74634..43d4ba1 100644
--- a/app/addons/cors/tests/actionsSpecs.js
+++ b/app/addons/cors/tests/actionsSpecs.js
@@ -108,30 +108,6 @@ define([
         FauxtonAPI.addNotification.restore();
       });
 
-      it('dispatches CORS_SAVED', function () {
-        var stub = sinon.stub(FauxtonAPI, 'when');
-        var called = false;
-        var promise = FauxtonAPI.Deferred();
-        promise.resolve();
-        stub.returns(promise);
-
-        FauxtonAPI.dispatcher.register(function (actions) {
-
-          if (actions.type === 'CORS_SAVED') {
-            called = true;
-          }
-
-        });
-
-        Actions.saveCors({
-          enableCors: true,
-          origins: ['https://testdomain.com']
-        });
-
-        assert.ok(called);
-        FauxtonAPI.when.restore();
-      });
-
     });
 
     describe('Sanitize origins', function () {