couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gar...@apache.org
Subject [2/2] fauxton commit: updated refs/heads/master to d94f3f2
Date Tue, 09 Aug 2016 12:09:53 GMT
react: use react-select for database page

refactor CSS and BEMify jump-to-doc with it


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

Branch: refs/heads/master
Commit: d94f3f202477d71053b77f8a4be22740e65d8318
Parents: e185633
Author: Robert Kowalski <robertkowalski@apache.org>
Authored: Tue Jul 26 18:24:01 2016 +0200
Committer: Garren Smith <garren.smith@gmail.com>
Committed: Tue Aug 9 14:09:30 2016 +0200

----------------------------------------------------------------------
 app/addons/databases/actions.js                 |  17 +--
 app/addons/databases/components.react.jsx       | 107 +++++++++----------
 app/addons/databases/stores.js                  |  16 ++-
 .../databases/tests/componentsSpec.react.jsx    |  76 -------------
 .../tests/nightwatch/switchDatabase.js          |  15 +--
 app/addons/databases/tests/storesSpec.js        |  20 ++--
 app/addons/documents/assets/less/documents.less |   1 -
 app/addons/documents/assets/less/jumptodoc.less |  38 -------
 .../documents/components/jumptodoc.react.jsx    |   7 +-
 .../components/rightalldocsheader.react.jsx     |  10 +-
 .../tests/nightwatch/deletesDocuments.js        |   2 +-
 .../tests/nightwatch/selectDocViaTypeahead.js   |   4 +-
 assets/less/fauxton.less                        |  70 ++++++------
 assets/less/templates.less                      |   2 +-
 .../custom-commands/auth/loginToGUI.js          |   2 +-
 15 files changed, 134 insertions(+), 253 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/d94f3f20/app/addons/databases/actions.js
----------------------------------------------------------------------
diff --git a/app/addons/databases/actions.js b/app/addons/databases/actions.js
index 06af7d4..431bee4 100644
--- a/app/addons/databases/actions.js
+++ b/app/addons/databases/actions.js
@@ -122,15 +122,18 @@ export default {
     if (_.isNull(databaseName) || databaseName.trim().length === 0) {
       return;
     }
+
     databaseName = databaseName.trim();
+
     if (Stores.databasesStore.doesDatabaseExist(databaseName)) {
-      var url = FauxtonAPI.urls('allDocs', 'app', app.utils.safeURLName(databaseName), "");
-      FauxtonAPI.navigate(url);
-    } else {
-      FauxtonAPI.addNotification({
-        msg: 'Database does not exist.',
-        type: 'error'
-      });
+      var url = FauxtonAPI.urls('allDocs', 'app', app.utils.safeURLName(databaseName), '');
+      // use the next cpu tick to allow react-select to unmount prorperly
+      return setTimeout(() => { FauxtonAPI.navigate(url); });
     }
+
+    FauxtonAPI.addNotification({
+      msg: 'Database does not exist.',
+      type: 'error'
+    });
   }
 };

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/d94f3f20/app/addons/databases/components.react.jsx
----------------------------------------------------------------------
diff --git a/app/addons/databases/components.react.jsx b/app/addons/databases/components.react.jsx
index 62eb09e..e2c1ea4 100644
--- a/app/addons/databases/components.react.jsx
+++ b/app/addons/databases/components.react.jsx
@@ -23,6 +23,8 @@ import Resources from "./resources";
 import Actions from "./actions";
 import Helpers from "../../helpers";
 
+import ReactSelect from "react-select";
+
 var ToggleHeaderButton = Components.ToggleHeaderButton;
 var databasesStore = Stores.databasesStore;
 var deleteDbModalStore = ComponentsStore.deleteDbModalStore;
@@ -219,17 +221,44 @@ var GraveyardInfo = React.createClass({
   }
 });
 
-var RightDatabasesHeader = React.createClass({
+class RightDatabasesHeader extends React.Component {
+
+  constructor (props) {
+    super(props);
+
+    this.state = this.getStoreState();
+  }
+
+  getStoreState () {
+
+    return {
+      databaseList: databasesStore.getDatabaseNamesForDropDown()
+    };
+  }
+
+  componentDidMount () {
+    databasesStore.on('change', this.onChange, this);
+  }
+
+  componentWillUnmount () {
+    databasesStore.off('change', this.onChange);
+  }
+
+  onChange () {
+    this.setState(this.getStoreState());
+  }
+
+  render () {
+    const {databaseList} = this.state;
 
-  render: function () {
     return (
       <div className="header-right right-db-header flex-layout flex-row">
-        <JumpToDatabaseWidget />
+        <JumpToDatabaseWidget databaseList={databaseList} />
         <AddDatabaseWidget />
       </div>
     );
   }
-});
+};
 
 var AddDatabaseWidget = React.createClass({
 
@@ -284,64 +313,28 @@ var AddDatabaseWidget = React.createClass({
   }
 });
 
-var JumpToDatabaseWidget = React.createClass({
 
-  getStoreState: function () {
-    return {
-      databaseNames: databasesStore.getDatabaseNames()
-    };
-  },
+const JumpToDatabaseWidget = ({databaseList}) => {
 
-  getInitialState: function () {
-    return this.getStoreState();
-  },
+  return (
+    <div data-name="jump-to-db" className="faux-header__searchboxwrapper">
+      <div className="faux-header__searchboxcontainer">
 
-  componentDidMount: function () {
-    databasesStore.on('change', this.onChange, this);
-  },
-
-  componentDidUpdate: function () {
-    $(ReactDOM.findDOMNode(this.refs.searchDbName)).typeahead({
-      source: this.state.databaseNames,
-      updater: function (item) {
-        this.jumpToDb(item);
-      }.bind(this)
-    });
-  },
-
-  componentWillUnmount: function () {
-    databasesStore.off('change', this.onChange, this);
-  },
-
-  onChange: function () {
-    this.setState(this.getStoreState());
-  },
+        <ReactSelect
+          placeholder="Database name"
+          options={databaseList}
+          clearable={false}
+          onChange={({value: databaseName}) => {
+            Actions.jumpToDatabase(databaseName);
+          }} />
 
-  jumpToDb: function (databaseName) {
-    databaseName = databaseName || ReactDOM.findDOMNode(this.refs.searchDbName).value;
-    Actions.jumpToDatabase(databaseName);
-  },
-
-  jumpToDbHandler: function (e) {
-    e.preventDefault();
-    this.jumpToDb();
-  },
-
-  render: function () {
-    return (
-      <div className="searchbox-wrapper">
-        <div id="header-search" className="js-search searchbox-container">
-          <form onSubmit={this.jumpToDbHandler} id="jump-to-db" className="navbar-form
pull-right database-search">
-            <div className="input-append">
-              <input type="text" className="search-autocomplete" ref="searchDbName" name="search-query"
placeholder="Database name" autoComplete="off" />
-              <span><button className="btn btn-primary" type="submit"><i className="icon
icon-search"></i></button></span>
-            </div>
-          </form>
-        </div>
       </div>
-    );
-  }
-});
+    </div>
+  );
+};
+JumpToDatabaseWidget.propTypes = {
+  databaseList: React.PropTypes.array.isRequired
+};
 
 var DatabasePagination = React.createClass({
 

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/d94f3f20/app/addons/databases/stores.js
----------------------------------------------------------------------
diff --git a/app/addons/databases/stores.js b/app/addons/databases/stores.js
index 9f5540b..f20fe2e 100644
--- a/app/addons/databases/stores.js
+++ b/app/addons/databases/stores.js
@@ -72,13 +72,19 @@ var DatabasesStore = FauxtonAPI.Store.extend({
   },
 
   getDatabaseNames: function () {
-    if (this._backboneCollection) {
-      return _.map(this._backboneCollection.toJSON(), function (item, key) {
-        return item.name;
-      });
-    } else {
+    if (!this._backboneCollection || !this._backboneCollection.length) {
       return [];
     }
+
+    return this._backboneCollection.toJSON().map((item, key) => {
+      return item.name;
+    });
+  },
+
+  getDatabaseNamesForDropDown: function () {
+    return this.getDatabaseNames().map((db) => {
+      return { value: db, label: db};
+    });
   },
 
   doesDatabaseExist: function (databaseName) {

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/d94f3f20/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 f9a4eb0..a20f62e 100644
--- a/app/addons/databases/tests/componentsSpec.react.jsx
+++ b/app/addons/databases/tests/componentsSpec.react.jsx
@@ -141,82 +141,6 @@ describe('AddDatabaseWidget', function () {
 
 });
 
-describe('JumpToDatabaseWidget', function () {
-
-  var container, jumpEl, oldJumpToDatabase, oldGetDatabaseNames, old$;
-  var jumpCalled, passedDbName;
-
-  beforeEach(function () {
-    old$ = $;
-    // simulate typeahead
-    $ = function (selector) {
-      var res = old$(selector);
-      res.typeahead = function () {};
-      return res;
-    };
-    oldJumpToDatabase = Actions.jumpToDatabase;
-    Actions.jumpToDatabase = function (dbName) {
-      jumpCalled = true;
-      passedDbName = dbName;
-    };
-    oldGetDatabaseNames = Stores.databasesStore.getDatabaseNames;
-    Stores.databasesStore.getDatabaseNames = function () {
-      return ["db1", "db2"];
-    };
-    container = document.createElement('div');
-    jumpEl = ReactDOM.render(React.createElement(Views.JumpToDatabaseWidget, {}), container);
-  });
-
-  afterEach(function () {
-    $ = old$;
-    Actions.jumpToDatabase = oldJumpToDatabase;
-    Stores.databasesStore.getDatabaseNames = oldGetDatabaseNames;
-    ReactDOM.unmountComponentAtNode(container);
-    // reset the store for future use
-    Stores.databasesStore.reset();
-  });
-
-  it("Jumps to a database with given name", function () {
-    jumpCalled = false;
-    passedDbName = null;
-    jumpEl.jumpToDb("db1");
-    assert.equal(true, jumpCalled);
-    assert.equal("db1", passedDbName);
-  });
-
-  it("jumps to an existing DB from input", function () {
-    jumpCalled = false;
-    passedDbName = null;
-    const input = TestUtils.findRenderedDOMComponentWithTag(jumpEl, 'input');
-    input.value = "db2";
-    jumpEl.jumpToDb();
-    assert.equal(true, jumpCalled);
-    assert.equal("db2", passedDbName);
-  });
-
-  it('updates DB list if data is sent after initially mounted', function () {
-    var newCollection = new Backbone.Collection();
-    newCollection.add(new Backbone.Model({ name: 'new-db1' }));
-    newCollection.add(new Backbone.Model({ name: 'new-db2' }));
-
-    var spy = sinon.spy(jumpEl, 'componentDidUpdate');
-
-    FauxtonAPI.dispatch({
-      type: ActionTypes.DATABASES_INIT,
-      options: {
-        collection: newCollection.toJSON(),
-        backboneCollection: newCollection,
-        page: 1
-      }
-    });
-
-    // because of the need to override typeahead, this just does a spy on the componentDidUpdate
method to ensure
-    // it gets called
-    assert.ok(spy.calledOnce);
-
-  });
-});
-
 
 describe('DatabasePagination', function () {
   it('uses custom URL prefix on the navigation if passed through props', function () {

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/d94f3f20/app/addons/databases/tests/nightwatch/switchDatabase.js
----------------------------------------------------------------------
diff --git a/app/addons/databases/tests/nightwatch/switchDatabase.js b/app/addons/databases/tests/nightwatch/switchDatabase.js
index 76aaa8b..9c73c30 100644
--- a/app/addons/databases/tests/nightwatch/switchDatabase.js
+++ b/app/addons/databases/tests/nightwatch/switchDatabase.js
@@ -14,8 +14,8 @@
 
 module.exports = {
   'Confirm selecting database via typeahead redirects properly': function (client) {
-    var waitTime = client.globals.maxWaitTime,
-        newDatabaseName = client.globals.testDatabaseName;
+    const waitTime = client.globals.maxWaitTime;
+    const newDatabaseName = client.globals.testDatabaseName;
 
     client
       .createDatabase(newDatabaseName)
@@ -28,14 +28,15 @@ module.exports = {
       })
 
       // wait for the DB name typeahead field to appear in the header
-      .waitForElementPresent('#jump-to-db .search-autocomplete', waitTime, false)
+      .waitForElementPresent('[data-name="jump-to-db"]', waitTime, false)
       .waitForElementPresent('#dashboard-content table.databases', waitTime, false)
-      .setValue('#jump-to-db .search-autocomplete', [newDatabaseName, client.Keys.ENTER])
+      .clickWhenVisible('[data-name="jump-to-db"] .Select-placeholder')
+      .setValue('[data-name="jump-to-db"] input', [newDatabaseName, client.Keys.ENTER])
       .waitForElementPresent('.index-pagination', waitTime, false)
       // now check we've redirected and the URL ends with /_all_docs
-      .url(function (result) {
-        var endsWithAllDocs = /all_docs$/.test(result.value);
-        this.assert.ok(endsWithAllDocs, 'Redirected properly');
+      .url((result) => {
+        const urlEndsWithAllDocs = /all_docs$/.test(result.value);
+        client.assert.ok(urlEndsWithAllDocs, 'Redirected properly');
       })
       .end();
   }

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/d94f3f20/app/addons/databases/tests/storesSpec.js
----------------------------------------------------------------------
diff --git a/app/addons/databases/tests/storesSpec.js b/app/addons/databases/tests/storesSpec.js
index 02ddbcf..c8d8446 100644
--- a/app/addons/databases/tests/storesSpec.js
+++ b/app/addons/databases/tests/storesSpec.js
@@ -43,21 +43,17 @@ describe('Databases Store', function () {
 
   describe("database collection info", function () {
 
-    beforeEach(function () {
-      Stores.databasesStore._backboneCollection.toJSON = function () {
-        return {
-          "db1": {
-            "name": "db1"
-          },
-          "db2": {
-            "name": "db2"
-          }
-        };
-      };
+    beforeEach(() => {
+      const data = [{"name": "db1"}, {"name": "db2"}];
+
+      const collection = new Backbone.Collection();
+      collection.add(data);
+
+      Stores.databasesStore._backboneCollection = collection;
     });
 
     it("determines database names", function () {
-      assert.ok(JSON.stringify(["db1", "db2"]) == JSON.stringify(Stores.databasesStore.getDatabaseNames().sort()));
+      assert.ok(JSON.stringify(["db1", "db2"]) === JSON.stringify(Stores.databasesStore.getDatabaseNames().sort()));
     });
 
     it("determines database availability", function () {

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/d94f3f20/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 175e879..6938d74 100644
--- a/app/addons/documents/assets/less/documents.less
+++ b/app/addons/documents/assets/less/documents.less
@@ -21,7 +21,6 @@
 @import "doc-editor.less";
 @import "header.less";
 @import "revision-browser";
-@import "jumptodoc";
 
 
 button.beautify {

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/d94f3f20/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
deleted file mode 100644
index 947f22c..0000000
--- a/app/addons/documents/assets/less/jumptodoc.less
+++ /dev/null
@@ -1,38 +0,0 @@
-// 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.
-
-.searchbox-wrapper {
-  overflow: visible;
-  height: 64px;
-  width: 235px;
-}
-
-#header-search {
-  overflow: visible;
-  position: absolute;
-}
-
-#jump-to-doc {
-  .Select-control, .Select-menu-outer {
-    width: 210px;
-  }
-}
-
-/* this allows the jump-to-doc results expand as much as need be when the component is used
in the header */
-#right-header #jump-to-doc .Select-menu-outer {
-  &>div>div {
-    padding-right: 25px; /* prevents overlapping of auto-generated scrollbar */
-  }
-  min-width: 210px;
-  max-width: 450px;
-  width: auto;
-}

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/d94f3f20/app/addons/documents/components/jumptodoc.react.jsx
----------------------------------------------------------------------
diff --git a/app/addons/documents/components/jumptodoc.react.jsx b/app/addons/documents/components/jumptodoc.react.jsx
index c8398ea..c06f0c2 100644
--- a/app/addons/documents/components/jumptodoc.react.jsx
+++ b/app/addons/documents/components/jumptodoc.react.jsx
@@ -18,11 +18,11 @@ import ReactSelect from "react-select";
 
 const JumpToDoc = ({database, loadOptions}) => {
   return (
-    <div id="jump-to-doc" class="input-append">
+    <div>
       <ReactSelect.Async
+        className="jump-to-doc"
         name="jump-to-doc"
         placeholder="Document ID"
-        className="jump-to-doc"
         loadOptions={loadOptions}
         clearable={false}
         onChange={({value: docId}) => {
@@ -30,8 +30,7 @@ const JumpToDoc = ({database, loadOptions}) => {
           // We navigating away from the page. So we need to take that navigation out of
the loop otherwise
           // it causes an issue where the react-select state is changed after its unmounted
           setTimeout(() => FauxtonAPI.navigate(url, {trigger: true}));
-        }}
-      />
+        }} />
     </div>
   );
 };

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/d94f3f20/app/addons/documents/components/rightalldocsheader.react.jsx
----------------------------------------------------------------------
diff --git a/app/addons/documents/components/rightalldocsheader.react.jsx b/app/addons/documents/components/rightalldocsheader.react.jsx
index f0377fd..7ca1900 100644
--- a/app/addons/documents/components/rightalldocsheader.react.jsx
+++ b/app/addons/documents/components/rightalldocsheader.react.jsx
@@ -28,11 +28,13 @@ const { QueryOptionsController } = QueryOptions;
 
 const RightAllDocsHeader = ({database}) =>
   <div className="header-right right-db-header flex-layout flex-row">
-    <div className="searchbox-wrapper">
-        <div id="header-search" className="searchbox-container">
-          <JumpToDoc loadOptions={Actions.fetchAllDocsWithKey(database)} database={database}
/>
-        </div>
+
+    <div className="faux-header__searchboxwrapper">
+      <div className="faux-header__searchboxcontainer">
+        <JumpToDoc loadOptions={Actions.fetchAllDocsWithKey(database)} database={database}
/>
+      </div>
     </div>
+
     <QueryOptionsController />
   </div>;
 

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/d94f3f20/app/addons/documents/tests/nightwatch/deletesDocuments.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/tests/nightwatch/deletesDocuments.js b/app/addons/documents/tests/nightwatch/deletesDocuments.js
index fc81257..d867705 100644
--- a/app/addons/documents/tests/nightwatch/deletesDocuments.js
+++ b/app/addons/documents/tests/nightwatch/deletesDocuments.js
@@ -108,7 +108,7 @@ module.exports = {
       .waitForElementPresent('#editor-container', waitTime, false)
       .clickWhenVisible('#doc-editor-actions-panel button[title="Delete"]')
       .clickWhenVisible('.confirmation-modal button.btn.btn-success')
-      .waitForElementPresent('#jump-to-doc', waitTime, false)
+      .waitForElementPresent('.jump-to-doc', waitTime, false)
 
       //check raw JSON
       .url(baseUrl + '/' + newDatabaseName + '/_all_docs')

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/d94f3f20/app/addons/documents/tests/nightwatch/selectDocViaTypeahead.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/tests/nightwatch/selectDocViaTypeahead.js b/app/addons/documents/tests/nightwatch/selectDocViaTypeahead.js
index 032eb94..f765acc 100644
--- a/app/addons/documents/tests/nightwatch/selectDocViaTypeahead.js
+++ b/app/addons/documents/tests/nightwatch/selectDocViaTypeahead.js
@@ -23,7 +23,7 @@ module.exports = {
       .populateDatabase(newDatabaseName, 3)
       .loginToGUI()
       .url(baseUrl + '/#/database/' + newDatabaseName + '/_all_docs')
-      .waitForElementPresent('#jump-to-doc', waitTime, false)
+      .waitForElementPresent('.jump-to-doc', waitTime, false)
       .keys(['\uE00C'])
       .waitForElementPresent('.prettyprint', waitTime, false)
       .waitForElementPresent('.documents-pagination', waitTime, false)
@@ -31,7 +31,7 @@ module.exports = {
 
       // we need to explicitly show the doc field because it's hidden on Travis due to screen
width
       .execute("$('.searchbox-wrapper').show();")
-      .setValue('#jump-to-doc .Select-input input', ['_des'])
+      .setValue('.jump-to-doc .Select-input input', ['_des'])
       .keys(['\uE015', '\uE015', '\uE006'])
       .waitForElementPresent('.panel-button.upload', waitTime, false)
     .end();

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/d94f3f20/assets/less/fauxton.less
----------------------------------------------------------------------
diff --git a/assets/less/fauxton.less b/assets/less/fauxton.less
index d832dfb..8391f5f 100644
--- a/assets/less/fauxton.less
+++ b/assets/less/fauxton.less
@@ -334,14 +334,6 @@ div.spinner {
   }
 }
 
-#header-search {
-  height: @collapsedNavWidth;
-  span {
-    position: relative;
-  }
-}
-
-
 
 .js-filter-form {
   .help-block {
@@ -470,32 +462,36 @@ body #dashboard .flex-body#breadcrumbs {
     padding: 0;
     margin: 0;
   }
-  .searchbox-container {
-    padding: 12px;
-    input[type="text"] {
-      .border-radius(5px);
-      font-size: 13px;
-      padding: 8px 35px 8px 10px;
-      width: 150px;
-    }
-    .btn-primary {
-      background: none repeat scroll 0% 0% transparent;
-      border: none;
-      position: absolute;
-      right: 12px;
-      top: 0;
-      height: 50px;
-      z-index: 2;
-      color: #999;
-      .icon-search {
-        position: absolute;
-        top: 11px;
-      }
-    }
-    form {
-      margin: 0;
-    }
+}
+
+
+.faux-header__searchboxwrapper {
+  overflow: visible;
+  height: 64px;
+  width: 235px;
+}
+
+.faux-header__searchboxcontainer {
+  height: @collapsedNavWidth;
+  overflow: visible;
+  position: absolute;
+  padding: 12px;
+}
+
+.faux-header__searchboxcontainer {
+  .Select-control, .Select-menu-outer {
+    width: 210px;
+  }
+}
+
+/* this allows the jump-to-doc results expand as much as need be when the component is used
in the header */
+#right-header .faux-header__searchboxcontainer .Select-menu-outer {
+  &>div>div {
+    padding-right: 25px; /* prevents overlapping of auto-generated scrollbar */
   }
+  min-width: 210px;
+  max-width: 450px;
+  width: auto;
 }
 
 // react-select color design
@@ -630,7 +626,7 @@ footer.pagination-footer {
 @media (max-width: 730px) {
   .closeMenu {
     .one-pane {
-      .searchbox-wrapper {
+      .faux-header__searchboxwrapper {
         display: none;
       }
     }
@@ -640,7 +636,7 @@ footer.pagination-footer {
 @media (max-width: 1000px) {
   .closeMenu {
     .with-sidebar {
-      .searchbox-wrapper {
+      .faux-header__searchboxwrapper {
         display: none;
       }
     }
@@ -651,7 +647,7 @@ footer.pagination-footer {
 @media (max-width: 875px) {
   body:not(.closeMenu) {
     .one-pane {
-      .searchbox-wrapper {
+      .faux-header__searchboxwrapper {
         display: none;
       }
     }
@@ -661,7 +657,7 @@ footer.pagination-footer {
 @media (max-width: 1285px) {
   body:not(.closeMenu) {
     .with-sidebar {
-      .searchbox-wrapper {
+      .faux-header__searchboxwrapper {
         display: none;
       }
     }

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/d94f3f20/assets/less/templates.less
----------------------------------------------------------------------
diff --git a/assets/less/templates.less b/assets/less/templates.less
index 615cbb6..d4e71af 100644
--- a/assets/less/templates.less
+++ b/assets/less/templates.less
@@ -517,7 +517,7 @@ with_tabs_sidebar.html
   .right-header-wrapper {
     border-left: 1px solid #999;
     .box-shadow(-6px 0 rgba(0, 0, 0, 0.1));
-    .searchbox-wrapper {
+    .faux-header__searchboxwrapper {
       display: none;
     }
   }

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/d94f3f20/test/nightwatch_tests/custom-commands/auth/loginToGUI.js
----------------------------------------------------------------------
diff --git a/test/nightwatch_tests/custom-commands/auth/loginToGUI.js b/test/nightwatch_tests/custom-commands/auth/loginToGUI.js
index ef67837..ee7d1f8 100644
--- a/test/nightwatch_tests/custom-commands/auth/loginToGUI.js
+++ b/test/nightwatch_tests/custom-commands/auth/loginToGUI.js
@@ -32,7 +32,7 @@ exports.command = function () {
     .clickWhenVisible('#submit')
 
     .closeNotification()
-    .waitForElementPresent('#jump-to-db', waitTime, false)
+    .waitForElementPresent('[data-name="jump-to-db"]', waitTime, false)
 
     // important! wait for the db page to fully load. This was the cause of many bugs
     .waitForElementVisible('#dashboard-content table.databases', waitTime, false);


Mime
View raw message