Return-Path: X-Original-To: apmail-couchdb-commits-archive@www.apache.org Delivered-To: apmail-couchdb-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0355817442 for ; Mon, 11 May 2015 18:58:39 +0000 (UTC) Received: (qmail 53338 invoked by uid 500); 11 May 2015 18:58:38 -0000 Delivered-To: apmail-couchdb-commits-archive@couchdb.apache.org Received: (qmail 53288 invoked by uid 500); 11 May 2015 18:58:38 -0000 Mailing-List: contact commits-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list commits@couchdb.apache.org Received: (qmail 53278 invoked by uid 99); 11 May 2015 18:58:38 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 11 May 2015 18:58:38 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 9E763E0850; Mon, 11 May 2015 18:58:38 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: benkeen@apache.org To: commits@couchdb.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: fauxton commit: updated refs/heads/master to 860a808 Date: Mon, 11 May 2015 18:58:38 +0000 (UTC) Repository: couchdb-fauxton Updated Branches: refs/heads/master 54b118562 -> 860a808b4 DatabasePagination now supports passing custom URL prefix Project: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/repo Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/commit/860a808b Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/tree/860a808b Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/diff/860a808b Branch: refs/heads/master Commit: 860a808b49a1c536ee265a09ec573ace666630a6 Parents: 54b1185 Author: Ben Keen Authored: Mon May 11 10:36:11 2015 -0700 Committer: Ben Keen Committed: Mon May 11 11:58:22 2015 -0700 ---------------------------------------------------------------------- app/addons/databases/components.react.jsx | 9 ++++++++- app/addons/databases/tests/componentsSpec.react.jsx | 15 +++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/860a808b/app/addons/databases/components.react.jsx ---------------------------------------------------------------------- diff --git a/app/addons/databases/components.react.jsx b/app/addons/databases/components.react.jsx index 0bf290c..a40c74b 100644 --- a/app/addons/databases/components.react.jsx +++ b/app/addons/databases/components.react.jsx @@ -269,6 +269,11 @@ define([ }); var DatabasePagination = React.createClass({ + getDefaultProps: function () { + return { + linkPath: '_all_dbs' + }; + }, getStoreState: function () { return { @@ -296,10 +301,12 @@ define([ render: function () { var page = this.state.page; var total = this.props.total || this.state.databaseNames.length; + var urlPrefix = '#/' + this.props.linkPath + '?page='; + return (
- +
); http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/860a808b/app/addons/databases/tests/componentsSpec.react.jsx ---------------------------------------------------------------------- diff --git a/app/addons/databases/tests/componentsSpec.react.jsx b/app/addons/databases/tests/componentsSpec.react.jsx index 5a790a4..cebb194 100644 --- a/app/addons/databases/tests/componentsSpec.react.jsx +++ b/app/addons/databases/tests/componentsSpec.react.jsx @@ -186,5 +186,20 @@ define([ }); + describe('DatabasePagination', function () { + it ('uses custom URL prefix on the navigation if passed through props', function () { + var container = document.createElement('div'); + var pagination = TestUtils.renderIntoDocument(, container); + + var links = $(pagination.getDOMNode()).find("a"); + assert.equal(links.length, 3, "pagination contains links"); + + links.each(function () { + assert.include(this.href, '_custom_path', 'link contains custom path'); + }); + }); + + }); + });