couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gar...@apache.org
Subject fauxton commit: updated refs/heads/master to 5bd2991
Date Tue, 17 Feb 2015 10:03:35 GMT
Repository: couchdb-fauxton
Updated Branches:
  refs/heads/master ff1922a02 -> 5bd29916a


Highlight User managment section

Highlights user managment section when it is active
Fixes COUCHDB-2584


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

Branch: refs/heads/master
Commit: 5bd29916a57c8ebe071c694f631f4f1189dd50fe
Parents: ff1922a
Author: Garren Smith <garren.smith@gmail.com>
Authored: Mon Feb 16 14:39:30 2015 +0200
Committer: Garren Smith <garren.smith@gmail.com>
Committed: Tue Feb 17 12:03:12 2015 +0200

----------------------------------------------------------------------
 app/addons/auth/routes.js                       |  6 +++--
 app/addons/fauxton/base.js                      |  4 +--
 app/addons/fauxton/components.react.jsx         |  6 ++---
 .../tests/nightwatch/highlightsidebar.js        | 28 ++++++++++++++++++++
 4 files changed, 37 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/5bd29916/app/addons/auth/routes.js
----------------------------------------------------------------------
diff --git a/app/addons/auth/routes.js b/app/addons/auth/routes.js
index 6512869..785a492 100644
--- a/app/addons/auth/routes.js
+++ b/app/addons/auth/routes.js
@@ -67,7 +67,9 @@ function(app, FauxtonAPI, Auth) {
         route: 'addAdmin'
       }
     },
-    selectedHeader: "", // TODO prevents "Databases" being selected at least
+    selectedHeader: function () {
+      return FauxtonAPI.session.user().name;
+    },
 
     initialize: function () {
       this.navDrop = this.setView('#sidebar-content', new Auth.NavDropDown({model: FauxtonAPI.session}));
@@ -87,6 +89,6 @@ function(app, FauxtonAPI, Auth) {
   });
 
   Auth.RouteObjects = [authRouteObject, userRouteObject];
-  
+
   return Auth;
 });

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/5bd29916/app/addons/fauxton/base.js
----------------------------------------------------------------------
diff --git a/app/addons/fauxton/base.js b/app/addons/fauxton/base.js
index f575ed2..781aea7 100644
--- a/app/addons/fauxton/base.js
+++ b/app/addons/fauxton/base.js
@@ -57,7 +57,7 @@ function(app, FauxtonAPI, Components, ReactComponents, Actions, ZeroClipboard)
{
     FauxtonAPI.masterLayout.apiBar = app.apiBar;
 
     FauxtonAPI.RouteObject.on('beforeFullRender', function (routeObject) {
-      Actions.setNavbarActiveLink(routeObject.selectedHeader);
+      Actions.setNavbarActiveLink(_.result(routeObject, 'selectedHeader'));
     });
 
     FauxtonAPI.RouteObject.on('beforeEstablish', function (routeObject) {
@@ -95,7 +95,7 @@ function(app, FauxtonAPI, Components, ReactComponents, Actions, ZeroClipboard)
{
       Actions.setNavbarVersionInfo(versionInfo.get("version"));
     });
   };
-  
+
   Fauxton.VersionInfo = Backbone.Model.extend({
     url: function () {
       return app.host;

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/5bd29916/app/addons/fauxton/components.react.jsx
----------------------------------------------------------------------
diff --git a/app/addons/fauxton/components.react.jsx b/app/addons/fauxton/components.react.jsx
index c420a8a..f6a84c7 100644
--- a/app/addons/fauxton/components.react.jsx
+++ b/app/addons/fauxton/components.react.jsx
@@ -27,9 +27,9 @@ function(FauxtonAPI, React, Stores, Actions) {
       if (!version) { return null; }
       return (
         <div className="version-footer">
-          Fauxton on 
+          Fauxton on
           <a href="http://couchdb.apache.org/"> Apache CouchDB</a>
-          <br/> 
+          <br/>
           v. {version}
         </div>
       );
@@ -57,7 +57,7 @@ function(FauxtonAPI, React, Stores, Actions) {
         <li data-nav-name={link.title} className={liClassName} >
           <a href={link.href} target={link.target ? '_blank' : ''} data-bypass={link.target
? 'true' : 'false'}>
             <i className={link.icon + " fonticon "}></i>
-            <span dangerouslySetInnerHTML={{__html: link.title }} /> 
+            <span dangerouslySetInnerHTML={{__html: link.title }} />
           </a>
         </li>
       );

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/5bd29916/app/addons/fauxton/tests/nightwatch/highlightsidebar.js
----------------------------------------------------------------------
diff --git a/app/addons/fauxton/tests/nightwatch/highlightsidebar.js b/app/addons/fauxton/tests/nightwatch/highlightsidebar.js
new file mode 100644
index 0000000..5bb0b63
--- /dev/null
+++ b/app/addons/fauxton/tests/nightwatch/highlightsidebar.js
@@ -0,0 +1,28 @@
+// 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.
+
+module.exports = {
+  'Highlight Sidebar' : function (client) {
+    var waitTime = 10000,
+        baseUrl = client.globals.test_settings.launch_url;
+
+    client
+      .loginToGUI()
+      .url(baseUrl)
+      .waitForElementPresent('#add-new-database', waitTime, false)
+      .click('a[href="#changePassword"]')
+      .pause(1000)
+      .waitForElementVisible('.auth-page', waitTime, false)
+      .assert.cssClassPresent('li[data-nav-name="' + client.globals.test_settings.fauxton_username
+ '"]', "active")
+    .end();
+  }
+};


Mime
View raw message