Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 5F560200ACA for ; Wed, 18 May 2016 15:16:39 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 5DF1A1609B1; Wed, 18 May 2016 13:16:39 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id AE467160A00 for ; Wed, 18 May 2016 15:16:38 +0200 (CEST) Received: (qmail 6359 invoked by uid 500); 18 May 2016 13:16:37 -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 6343 invoked by uid 99); 18 May 2016 13:16:37 -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; Wed, 18 May 2016 13:16:37 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 770D5DFBED; Wed, 18 May 2016 13:16:37 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: garren@apache.org To: commits@couchdb.apache.org Date: Wed, 18 May 2016 13:16:37 -0000 Message-Id: <4bac963ea9f0434998cb4f2addb784bb@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [1/2] fauxton commit: updated refs/heads/jump-to-docs to 2d99c7f archived-at: Wed, 18 May 2016 13:16:39 -0000 Repository: couchdb-fauxton Updated Branches: refs/heads/jump-to-docs [created] 2d99c7fd8 integrate react-select Project: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/repo Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/commit/842baebc Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/tree/842baebc Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/diff/842baebc Branch: refs/heads/jump-to-docs Commit: 842baebc6884715b4f1935d6412843899b03aac4 Parents: 906f138 Author: Garren Smith Authored: Wed May 18 13:57:37 2016 +0200 Committer: Garren Smith Committed: Wed May 18 13:57:37 2016 +0200 ---------------------------------------------------------------------- app/addons/documents/assets/less/documents.less | 1 + app/addons/documents/assets/less/jumptodoc.less | 5 ++ app/addons/documents/jumptodoc.react.jsx | 48 ++++++++++++++++++++ app/addons/documents/views.js | 8 ++-- 4 files changed, 59 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/842baebc/app/addons/documents/assets/less/documents.less ---------------------------------------------------------------------- diff --git a/app/addons/documents/assets/less/documents.less b/app/addons/documents/assets/less/documents.less index 99d616c..8ce8aa6 100644 --- a/app/addons/documents/assets/less/documents.less +++ b/app/addons/documents/assets/less/documents.less @@ -21,6 +21,7 @@ @import "doc-editor.less"; @import "header.less"; @import "revision-browser"; +@import "jumptodoc"; .two-sides-toggle-button { font-size: 15px; http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/842baebc/app/addons/documents/assets/less/jumptodoc.less ---------------------------------------------------------------------- diff --git a/app/addons/documents/assets/less/jumptodoc.less b/app/addons/documents/assets/less/jumptodoc.less new file mode 100644 index 0000000..34d8691 --- /dev/null +++ b/app/addons/documents/assets/less/jumptodoc.less @@ -0,0 +1,5 @@ +#jump-to-doc-wrapper { +} + +.Select-menu-outer { +} http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/842baebc/app/addons/documents/jumptodoc.react.jsx ---------------------------------------------------------------------- diff --git a/app/addons/documents/jumptodoc.react.jsx b/app/addons/documents/jumptodoc.react.jsx new file mode 100644 index 0000000..2692bd7 --- /dev/null +++ b/app/addons/documents/jumptodoc.react.jsx @@ -0,0 +1,48 @@ +// Licensed under the Apache License, Version 2.0 (the "License"); you may not +// use this file except in compliance with the License. You may obtain a copy of +// the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +// 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([ + '../../app', + '../../core/api', + 'react', + 'react-dom', + 'react-select', +], (app, FauxtonAPI, React, ReactDOM, ReactSelect) => { + + const JumpToDoc = ({database, allDocs}) => { + const options = allDocs.map(doc => { + return { + value: doc.get('_id'), + label: doc.get('_id') + }; + }); + console.log('op', options); + return ( +
+ {console.log('bbb', val);}} /> +
+ ); + }; + + return { + JumpToDoc, + render: (el, database, allDocs) => { + ReactDOM.render(, $(el)[0]); + } + }; +}); http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/842baebc/app/addons/documents/views.js ---------------------------------------------------------------------- diff --git a/app/addons/documents/views.js b/app/addons/documents/views.js index b121bb1..633fbf3 100644 --- a/app/addons/documents/views.js +++ b/app/addons/documents/views.js @@ -20,12 +20,13 @@ define([ // Views "./queryoptions/queryoptions.react", "./queryoptions/actions", + './jumptodoc.react', //plugins "../../../assets/js/plugins/prettify" ], -function (app, FauxtonAPI, Components, Documents, Databases, QueryOptions, QueryActions) { +function (app, FauxtonAPI, Components, Documents, Databases, QueryOptions, QueryActions, JumpToDoc) { var Views = {}; @@ -53,14 +54,15 @@ function (app, FauxtonAPI, Components, Documents, Databases, QueryOptions, Query FauxtonAPI.Events.on('success:bulkDelete', this.selectAllMenu); // insert the Search Docs field - this.headerSearch = this.insertView("#header-search", new Views.JumpToDoc({ + /*this.headerSearch = this.insertView("#header-search", new Views.JumpToDoc({ database: this.database, collection: this.database.allDocs - })); + }));*/ }, afterRender: function () { QueryOptions.render('#query-options'); + JumpToDoc.render('#header-search', this.database, this.database.allDocs); this.toggleQueryOptionsHeader(this.isHidden); },