couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gar...@apache.org
Subject [1/3] fauxton commit: updated refs/heads/master to 369c326
Date Mon, 07 Nov 2016 08:33:44 GMT
Repository: couchdb-fauxton
Updated Branches:
  refs/heads/master 6cb7eaa22 -> 369c32654


databases: show data_size instead of disk_size

return to old default


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

Branch: refs/heads/master
Commit: 0290732965e873600f944fbc829147248482c7f3
Parents: 6cb7eaa
Author: Robert Kowalski <robertkowalski@apache.org>
Authored: Fri Nov 4 16:03:48 2016 +0100
Committer: Robert Kowalski <robertkowalski@apache.org>
Committed: Fri Nov 4 16:14:37 2016 +0100

----------------------------------------------------------------------
 app/addons/databases/components.react.jsx |  4 ++--
 app/addons/databases/stores.js            |  2 +-
 app/addons/databases/tests/storesSpec.js  | 18 ++++++++++++++++++
 3 files changed, 21 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/02907329/app/addons/databases/components.react.jsx
----------------------------------------------------------------------
diff --git a/app/addons/databases/components.react.jsx b/app/addons/databases/components.react.jsx
index 2e4ad36..5e58681 100644
--- a/app/addons/databases/components.react.jsx
+++ b/app/addons/databases/components.react.jsx
@@ -158,7 +158,7 @@ var DatabaseRow = React.createClass({
       item
     } = this.props;
 
-    const {encodedId, id, url, diskSize, docCount, docDelCount, showTombstoneWarning, failed
} = item;
+    const {encodedId, id, url, dataSize, docCount, docDelCount, showTombstoneWarning, failed
} = item;
     const tombStoneWarning = showTombstoneWarning ?
       (<GraveyardInfo docCount={docCount} docDelCount={docDelCount} />) : null;
 
@@ -177,7 +177,7 @@ var DatabaseRow = React.createClass({
         <td>
           <a href={url}>{id}</a>
         </td>
-        <td>{diskSize}</td>
+        <td>{dataSize}</td>
         <td>{docCount} {tombStoneWarning}</td>
         {this.getExtensionColumns(item)}
 

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/02907329/app/addons/databases/stores.js
----------------------------------------------------------------------
diff --git a/app/addons/databases/stores.js b/app/addons/databases/stores.js
index b4dd647..93ae88a 100644
--- a/app/addons/databases/stores.js
+++ b/app/addons/databases/stores.js
@@ -92,7 +92,7 @@ var DatabasesStore = FauxtonAPI.Store.extend({
     }
 
     return {
-      diskSize: Helpers.formatSize(details.disk_size || 0),
+      dataSize: Helpers.formatSize(details.data_size || 0),
       docCount: details.doc_count,
       docDelCount: details.doc_del_count,
       showTombstoneWarning: details.doc_del_count > details.doc_count

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/02907329/app/addons/databases/tests/storesSpec.js
----------------------------------------------------------------------
diff --git a/app/addons/databases/tests/storesSpec.js b/app/addons/databases/tests/storesSpec.js
index d6d8d61..2adbd62 100644
--- a/app/addons/databases/tests/storesSpec.js
+++ b/app/addons/databases/tests/storesSpec.js
@@ -64,6 +64,24 @@ describe('Databases Store', function () {
       assert(!store.doesDatabaseExist('db3'));
     });
 
+    it('uses the data_size prop', () => {
+      DatabaseActions.updateDatabases({
+        dbList: ['db1'],
+        databaseDetails: [{
+          db_name: 'db1',
+          doc_count: 5,
+          doc_del_count: 3,
+          data_size: 1337,
+          disk_size: 0
+        }],
+        failedDbs: []
+      });
+
+      const dbList = store.getDbList();
+
+      assert.equal(dbList[0].dataSize, '1.3 KB');
+    });
+
   });
 
 });


Mime
View raw message