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 2014/10/29 12:11:45 UTC

fauxton commit: updated refs/heads/master to 30fadf1

Repository: couchdb-fauxton
Updated Branches:
  refs/heads/master 059264511 -> 30fadf1ac


Remove `rightHeader` from changes view for now

We have a separate filter function in this view. It probably
makes sense to integrate this filter into the right header
function later, but currently the rightHeader with the search for
documents and the query-options-tray does not work with changes and
duplicates the functionality of the filter in this context.

Closes COUCHDB-2397


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

Branch: refs/heads/master
Commit: 30fadf1acb18bfc6c4c65ea71b30b153d811e694
Parents: 0592645
Author: Robert Kowalski <ro...@apache.org>
Authored: Tue Oct 21 13:42:29 2014 +0200
Committer: Robert Kowalski <ro...@apache.org>
Committed: Wed Oct 29 12:11:30 2014 +0100

----------------------------------------------------------------------
 app/addons/documents/routes-documents.js | 22 +++++++++++++---------
 app/addons/documents/tests/routeSpec.js  | 16 +++++++++++++---
 2 files changed, 26 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/30fadf1a/app/addons/documents/routes-documents.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/routes-documents.js b/app/addons/documents/routes-documents.js
index 8ab96d9..49e9c22 100644
--- a/app/addons/documents/routes-documents.js
+++ b/app/addons/documents/routes-documents.js
@@ -107,10 +107,6 @@ function(app, FauxtonAPI, Documents, Changes, Index, DocEditor, Databases, Resou
         }
       });
 
-      this.rightHeader = this.setView("#right-header", new Documents.Views.RightAllDocsHeader({
-         database: this.database
-      }));
-
       this.leftheader = this.setView("#breadcrumbs", new Components.LeftHeader({
         crumbs: crumbs.allDocs(this.database),
         dropdownMenu: this.setUpDropdown()
@@ -181,8 +177,7 @@ function(app, FauxtonAPI, Documents, Changes, Index, DocEditor, Databases, Resou
       this.leftheader.updateCrumbs(crumbs.allDocs(this.database));
       this.rightHeader.hideQueryOptions();
 
-      // problem line again
-      this.apiUrl = [designDocInfo.url('apiurl'), designDocInfo.documentation() ];
+      this.apiUrl = [designDocInfo.url('apiurl'), designDocInfo.documentation()];
     },
 
     tempFn:  function(databaseName, ddoc, fn){
@@ -223,7 +218,11 @@ function(app, FauxtonAPI, Documents, Changes, Index, DocEditor, Databases, Resou
         return;
       }
 
-      this.leftheader.updateCrumbs(crumbs.allDocs(this.database)); 
+      this.rightHeader = this.setView("#right-header", new Documents.Views.RightAllDocsHeader({
+        database: this.database
+      }));
+
+      this.leftheader.updateCrumbs(crumbs.allDocs(this.database));
       this.database.buildAllDocs(docParams);
 
       if (docParams.startkey && docParams.startkey.indexOf("_design") > -1) {
@@ -242,7 +241,7 @@ function(app, FauxtonAPI, Documents, Changes, Index, DocEditor, Databases, Resou
         params: urlParams,
         bulkDeleteDocsCollection: new Documents.BulkDeleteDocCollection([], {databaseId: this.database.get('id')})
       }));
-      
+
       this.apiUrl = function() {
        return [this.database.allDocs.urlRef("apiurl", urlParams), this.database.allDocs.documentation()];
       };
@@ -298,6 +297,9 @@ function(app, FauxtonAPI, Documents, Changes, Index, DocEditor, Databases, Resou
        return [this.indexedDocs.urlRef("apiurl", urlParams), "docs"];
       };
 
+      this.rightHeader = this.setView("#right-header", new Documents.Views.RightAllDocsHeader({
+        database: this.database
+      }));
       this.rightHeader.showQueryOptions();
       this.rightHeader.resetQueryOptions({
         queryParams: urlParams,
@@ -454,6 +456,9 @@ function(app, FauxtonAPI, Documents, Changes, Index, DocEditor, Databases, Resou
 
     changes: function () {
       var docParams = app.getParams();
+
+      this.rightHeader && this.rightHeader.remove();
+
       this.database.buildChanges(docParams);
 
       this.changesView = this.setView("#dashboard-lower-content", new Changes.Changes({
@@ -473,7 +478,6 @@ function(app, FauxtonAPI, Documents, Changes, Index, DocEditor, Databases, Resou
 
       this.sidebar.setSelectedTab('changes');
       this.leftheader.updateCrumbs(crumbs.changes(this.database));
-      this.rightHeader.showQueryOptions();
 
       this.apiUrl = function () {
         return [this.database.url("changes-apiurl"), this.database.documentation()];

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/30fadf1a/app/addons/documents/tests/routeSpec.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/tests/routeSpec.js b/app/addons/documents/tests/routeSpec.js
index 2927845..9b6458f 100644
--- a/app/addons/documents/tests/routeSpec.js
+++ b/app/addons/documents/tests/routeSpec.js
@@ -9,6 +9,7 @@
 // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 // License for the specific language governing permissions and limitations under
 // the License.
+
 define([
         'addons/documents/routes',
         'testUtils'
@@ -18,9 +19,18 @@ define([
 
   describe('Documents Route', function () {
 
-    describe('changes route', function () {
+    it('the all-documents-list has a right header', function () {
+      var routeObj = new DocumentRoute(null, null, ['test']);
+
+      routeObj.allDocs('newdatabase', null);
+      assert.equal(typeof routeObj.rightHeader, 'object');
     });
-  });
 
-});
+    it('the view that shows a view has a right header', function () {
+      var routeObj = new DocumentRoute(null, null, ['test']);
 
+      routeObj.viewFn('newdatabase', 'ads', 'newView');
+      assert.equal(typeof routeObj.rightHeader, 'object');
+    });
+  });
+});