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 240E4200BC5 for ; Tue, 22 Nov 2016 15:49:08 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 22B03160B1C; Tue, 22 Nov 2016 14:49:08 +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 6CCC1160B0C for ; Tue, 22 Nov 2016 15:49:07 +0100 (CET) Received: (qmail 66727 invoked by uid 500); 22 Nov 2016 14:49:06 -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 66702 invoked by uid 99); 22 Nov 2016 14:49:06 -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; Tue, 22 Nov 2016 14:49:06 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 57559E0158; Tue, 22 Nov 2016 14:49:06 +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: Tue, 22 Nov 2016 14:49:07 -0000 Message-Id: In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [2/2] fauxton commit: updated refs/heads/master to 4665e30 archived-at: Tue, 22 Nov 2016 14:49:08 -0000 switch auth to react onepane Project: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/repo Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/commit/84b5318f Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/tree/84b5318f Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/diff/84b5318f Branch: refs/heads/master Commit: 84b5318f88a54b3794d4ee32951da5a6ab4ac7da Parents: 4924a1e Author: Garren Smith Authored: Tue Nov 15 10:20:32 2016 +0200 Committer: Garren Smith Committed: Tue Nov 22 16:48:49 2016 +0200 ---------------------------------------------------------------------- app/addons/auth/layout.js | 31 +++++++++++++++++++++++++++++++ app/addons/auth/routes.js | 21 ++++++++++++++++----- app/addons/components/layouts.js | 1 + 3 files changed, 48 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/84b5318f/app/addons/auth/layout.js ---------------------------------------------------------------------- diff --git a/app/addons/auth/layout.js b/app/addons/auth/layout.js new file mode 100644 index 0000000..24bd9df --- /dev/null +++ b/app/addons/auth/layout.js @@ -0,0 +1,31 @@ +// 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. + +import React from 'react'; +import FauxtonAPI from "../../core/api"; +import {OnePane, OnePaneHeader, OnePaneContent} from '../components/layouts'; + +export const AuthLayout = ({crumbs, component}) => { + return ( + + + + + {component} + + + ); +}; + +export default AuthLayout; http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/84b5318f/app/addons/auth/routes.js ---------------------------------------------------------------------- diff --git a/app/addons/auth/routes.js b/app/addons/auth/routes.js index b0e41d5..be30171 100644 --- a/app/addons/auth/routes.js +++ b/app/addons/auth/routes.js @@ -10,15 +10,19 @@ // License for the specific language governing permissions and limitations under // the License. +import React from 'react'; import app from "../../app"; import FauxtonAPI from "../../core/api"; import Auth from "./resources"; import AuthActions from "./actions"; import Components from "./components.react"; import ClusterActions from "../cluster/cluster.actions"; +import Layout from './layout'; + +const {LoginForm, CreateAdminForm} = Components; var AuthRouteObject = FauxtonAPI.RouteObject.extend({ - layout: 'one_pane', + layout: 'empty', routes: { 'login?*extra': 'login', @@ -28,14 +32,18 @@ var AuthRouteObject = FauxtonAPI.RouteObject.extend({ 'createAdmin/:node': 'createAdminForNode' }, hideNotificationCenter: true, + hideApiBar: true, checkNodes: function () { ClusterActions.navigateToNodeBasedOnNodeCount('/createAdmin/'); }, login: function () { - this.crumbs = [{ name: 'Log In to CouchDB' }]; - this.setComponent('#dashboard-content', Components.LoginForm, { urlBack: app.getParams().urlback }); + const crumbs = [{ name: 'Log In to CouchDB' }]; + this.setComponent(".template", Layout, { + crumbs: crumbs, + component: + }); }, logout: function () { @@ -47,8 +55,11 @@ var AuthRouteObject = FauxtonAPI.RouteObject.extend({ createAdminForNode: function () { ClusterActions.fetchNodes(); - this.crumbs = [{ name: 'Create Admin' }]; - this.setComponent('#dashboard-content', Components.CreateAdminForm, { loginAfter: true }); + const crumbs = [{ name: 'Create Admin' }]; + this.setComponent(".template", Layout, { + crumbs: crumbs, + component: + }); } }); http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/84b5318f/app/addons/components/layouts.js ---------------------------------------------------------------------- diff --git a/app/addons/components/layouts.js b/app/addons/components/layouts.js index 736f60b..ae014bd 100644 --- a/app/addons/components/layouts.js +++ b/app/addons/components/layouts.js @@ -74,6 +74,7 @@ OnePaneHeader.defaultProps = { OnePaneHeader.propTypes = { docURL: React.PropTypes.string, endpoint: React.PropTypes.string, + crumbs: React.PropTypes.array }; export const OnePaneContent = ({children}) => {