couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From robertkowal...@apache.org
Subject [1/3] fauxton commit: updated refs/heads/master to 8b7e186
Date Mon, 31 Oct 2016 14:04:36 GMT
Repository: couchdb-fauxton
Updated Branches:
  refs/heads/master 7166e4cd1 -> 8b7e186bf


remove leagcy data-size property handling

CouchDB 2 data size is always available in CouchDB 2

PR: #782
PR-URL: https://github.com/apache/couchdb-fauxton/pull/782
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/c1bb043a
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/tree/c1bb043a
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/diff/c1bb043a

Branch: refs/heads/master
Commit: c1bb043a7945aa036cb082e0b9ac08c0a7d3077a
Parents: a12add3
Author: Robert Kowalski <robertkowalski@apache.org>
Authored: Mon Sep 26 16:50:54 2016 +0200
Committer: Robert Kowalski <robertkowalski@apache.org>
Committed: Mon Oct 31 15:04:34 2016 +0100

----------------------------------------------------------------------
 app/addons/databases/resources.js           | 16 +---------------
 app/addons/databases/tests/resourcesSpec.js | 12 ------------
 2 files changed, 1 insertion(+), 27 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/c1bb043a/app/addons/databases/resources.js
----------------------------------------------------------------------
diff --git a/app/addons/databases/resources.js b/app/addons/databases/resources.js
index 7b8876b..4ee31cf 100644
--- a/app/addons/databases/resources.js
+++ b/app/addons/databases/resources.js
@@ -132,26 +132,12 @@ Databases.Status = FauxtonAPI.Model.extend({
   },
 
   dataSize: function () {
-    if (this.get("other")) {
-      return this.get("other").data_size;
-    } else if (this.get('data_size')) {
-      return this.get('data_size');
-    } else if (this.get('disk_size')) {
-      return this.get('disk_size');
-    } else {
-      return 0;
-    }
+    return this.get('other').data_size;
   },
 
   parse: function (resp) {
     this.loadSuccess = true;
     return resp;
-  },
-
-  // a sure-fire way to know when the DB size info is actually available; dataSize() may
return 0 before or after
-  // the data has been loaded
-  hasDataSize: function () {
-    return this.get('other') || this.get('data_size') || this.get('disk_size');
   }
 });
 

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/c1bb043a/app/addons/databases/tests/resourcesSpec.js
----------------------------------------------------------------------
diff --git a/app/addons/databases/tests/resourcesSpec.js b/app/addons/databases/tests/resourcesSpec.js
index 0005fbc..a199f05 100644
--- a/app/addons/databases/tests/resourcesSpec.js
+++ b/app/addons/databases/tests/resourcesSpec.js
@@ -31,18 +31,6 @@ describe("Databases: List", function () {
       assert.ok(!modelWithoutGraveYard.isGraveYard());
     });
 
-    it("can tell whether the data size showing is accurate or not", function () {
-      var modelWithDataSize = new Resources.Status({
-        other: 6,
-        data_size: 5,
-        disk_size: 2
-      });
-      assert.ok(modelWithDataSize.hasDataSize());
-
-      var empty_probably_fetching_model = new Resources.Status({});
-      assert.notOk(empty_probably_fetching_model.hasDataSize());
-    });
-
   });
 
   describe('List of Databases', function () {


Mime
View raw message