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/02/02 14:09:31 UTC

fauxton commit: updated refs/heads/master to 1aaf6f2

Repository: couchdb-fauxton
Updated Branches:
  refs/heads/master 14d3cddff -> 1aaf6f240


make links for modifying a db reusable

simple refactor which moves code into another location.
is already coverd by integration test

PR: #637
PR-URL: https://github.com/apache/couchdb-fauxton/pull/637
Reviewed-By: garren smith <ga...@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/1aaf6f24
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/tree/1aaf6f24
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/diff/1aaf6f24

Branch: refs/heads/master
Commit: 1aaf6f24069dcfca7834eb324d68314fdb836081
Parents: 14d3cdd
Author: Robert Kowalski <ro...@apache.org>
Authored: Tue Feb 2 12:07:04 2016 +0000
Committer: Robert Kowalski <ro...@apache.org>
Committed: Tue Feb 2 13:09:16 2016 +0000

----------------------------------------------------------------------
 app/addons/documents/helpers.js  | 13 +++++++++++++
 app/addons/fauxton/components.js | 10 +---------
 2 files changed, 14 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/1aaf6f24/app/addons/documents/helpers.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/helpers.js b/app/addons/documents/helpers.js
index 81be185..32fe4f2 100644
--- a/app/addons/documents/helpers.js
+++ b/app/addons/documents/helpers.js
@@ -84,11 +84,24 @@ define([
     return JSON.parse('"' + str + '"');   // this ensures newlines are converted
   }
 
+  function getModifyDatabaseLinks (databaseName) {
+    return [{
+      title: 'Replicate Database',
+      icon: 'fonticon-replicate',
+      url: FauxtonAPI.urls('replication', 'app', databaseName)
+    }, {
+      title: 'Delete',
+      icon: 'fonticon-trash',
+      trigger: 'database:delete'
+    }];
+  }
+
   return {
     getPreviousPageForDoc: getPreviousPageForDoc,
     getPreviousPage: getPreviousPage,
     getSeqNum: getSeqNum,
     getNewButtonLinks: getNewButtonLinks,
+    getModifyDatabaseLinks: getModifyDatabaseLinks,
     parseJSON: parseJSON
   };
 });

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/1aaf6f24/app/addons/fauxton/components.js
----------------------------------------------------------------------
diff --git a/app/addons/fauxton/components.js b/app/addons/fauxton/components.js
index 7d646c7..b2f03fb 100644
--- a/app/addons/fauxton/components.js
+++ b/app/addons/fauxton/components.js
@@ -89,15 +89,7 @@ function (app, FauxtonAPI, ace, spin, ReactComponents, Helpers) {
     },
 
     getModififyDbLinks: function () {
-      return [{
-        title: 'Replicate Database',
-        icon: 'fonticon-replicate',
-        url: FauxtonAPI.urls('replication', 'app', this.dbName)
-      }, {
-        title: 'Delete',
-        icon: 'fonticon-trash',
-        trigger: 'database:delete'
-      }];
+      return Helpers.getModifyDatabaseLinks(this.dbName);
     },
 
     setUpDropDownMenu: function () {