You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by be...@apache.org on 2016/04/15 21:13:19 UTC

fauxton commit: updated refs/heads/master to bd7205f

Repository: couchdb-fauxton
Updated Branches:
  refs/heads/master d5d4acb28 -> bd7205f45


Minor text/btn changes

This makes a few further additions to buttons / text / styles,
as per Justin's recommendations.


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

Branch: refs/heads/master
Commit: bd7205f45c2c2448da7e8e06f743f2d0444177f9
Parents: d5d4acb
Author: Ben Keen <be...@gmail.com>
Authored: Tue Mar 8 10:50:02 2016 -0800
Committer: Ben Keen <be...@gmail.com>
Committed: Fri Apr 15 12:13:03 2016 -0700

----------------------------------------------------------------------
 .../components/react-components.react.jsx       | 26 +++++++++-----------
 app/addons/cors/components.react.jsx            |  2 +-
 .../documents/doc-editor/components.react.jsx   |  4 ++-
 .../documents/mango/mango.components.react.jsx  |  2 +-
 .../queryoptions/queryoptions.react.jsx         |  2 +-
 .../tests/nightwatch/deletesDocuments.js        |  3 ++-
 .../documents/tests/nightwatch/viewDelete.js    |  5 ++--
 app/addons/fauxton/components.react.jsx         |  7 ++++--
 8 files changed, 27 insertions(+), 24 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/bd7205f4/app/addons/components/react-components.react.jsx
----------------------------------------------------------------------
diff --git a/app/addons/components/react-components.react.jsx b/app/addons/components/react-components.react.jsx
index 8baffe1..dcf9a75 100644
--- a/app/addons/components/react-components.react.jsx
+++ b/app/addons/components/react-components.react.jsx
@@ -1449,7 +1449,11 @@ define([
       modalProps: React.PropTypes.object
     },
 
-    close: function () {
+    close: function (e) {
+      if (e) {
+        e.preventDefault();
+      }
+
       this.setState({
         inputValue: '',
         disableSubmit: true
@@ -1494,7 +1498,6 @@ define([
       var isSystemDatabase = this.props.modalProps.isSystemDatabase;
       var showDeleteModal = this.props.modalProps.showDeleteModal;
       var dbId = this.props.modalProps.dbId;
-      var errorMessage = this.state.errorMessage;
 
       var warning = isSystemDatabase ? (
         <p style={{color: '#d14'}} className="warning">
@@ -1510,9 +1513,9 @@ define([
           <Modal.Body>
             {warning}
             <p>
-            Warning: This action will permanently delete <code>{dbId}</code>.
-            To confirm the deletion of the database and all of the
-            database's documents, you must enter the database's name.
+              Warning: This action will permanently delete <code>{dbId}</code>.
+              To confirm the deletion of the database and all of the
+              database's documents, you must enter the database's name.
             </p>
             <input
               type="text"
@@ -1522,20 +1525,13 @@ define([
               autoFocus={true} />
           </Modal.Body>
           <Modal.Footer>
-            <a
-              style={{marginRight: '10px', cursor: 'pointer'}}
-              onClick={this.close}
-              data-bypass="true"
-            >
-              Cancel
-            </a>
             <button
               disabled={this.state.disableSubmit}
               onClick={this.onDeleteClick}
-              className="btn btn-danger delete"
-            >
-              <i className="icon fonticon-cancel-circled"></i> Delete
+              className="btn btn-danger delete">
+              <i className="icon fonticon-cancel-circled" /> Delete
             </button>
+            <a href="#" onClick={this.close} data-bypass="true" className="cancel-link">Cancel</a>
           </Modal.Footer>
         </Modal>
       );

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/bd7205f4/app/addons/cors/components.react.jsx
----------------------------------------------------------------------
diff --git a/app/addons/cors/components.react.jsx b/app/addons/cors/components.react.jsx
index 620e2b6..8411b49 100644
--- a/app/addons/cors/components.react.jsx
+++ b/app/addons/cors/components.react.jsx
@@ -340,7 +340,7 @@ define([
               <br />
               <button
                 type="button"
-                className="enable-disable btn btn-small btn-success"
+                className="enable-disable btn btn-success"
                 onClick={this.enableCorsChange}
                 disabled={this.state.isLoading ? 'disabled' : null}
               >

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/bd7205f4/app/addons/documents/doc-editor/components.react.jsx
----------------------------------------------------------------------
diff --git a/app/addons/documents/doc-editor/components.react.jsx b/app/addons/documents/doc-editor/components.react.jsx
index af211b9..116a7b7 100644
--- a/app/addons/documents/doc-editor/components.react.jsx
+++ b/app/addons/documents/doc-editor/components.react.jsx
@@ -143,12 +143,14 @@ define([
     },
 
     render: function () {
+      var saveButtonLabel = (this.props.isNewDoc) ? 'Create Document' : 'Save Changes';
+
       return (
         <div>
           <div id="doc-editor-actions-panel">
             <div className="doc-actions-left">
               <button className="save-doc btn btn-success save" type="button" onClick={this.saveDoc}>
-                <i className="icon fonticon-ok-circled"></i> Save Changes
+                <i className="icon fonticon-ok-circled"></i> {saveButtonLabel}
               </button>
               <div>
                 <a href={this.props.previousPage} className="js-back cancel-button">Cancel</a>

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/bd7205f4/app/addons/documents/mango/mango.components.react.jsx
----------------------------------------------------------------------
diff --git a/app/addons/documents/mango/mango.components.react.jsx b/app/addons/documents/mango/mango.components.react.jsx
index 5bffecc..e88a05b 100644
--- a/app/addons/documents/mango/mango.components.react.jsx
+++ b/app/addons/documents/mango/mango.components.react.jsx
@@ -156,7 +156,7 @@ function (app, FauxtonAPI, React, Stores, Actions,
             {this.getIndexBox()}
             <div className="padded-box">
               <div className="control-group">
-                <ConfirmButton text={this.props.confirmbuttonText} id="create-index-btn" />
+                <ConfirmButton text={this.props.confirmbuttonText} id="create-index-btn" showIcon={false} />
               </div>
             </div>
           </form>

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/bd7205f4/app/addons/documents/queryoptions/queryoptions.react.jsx
----------------------------------------------------------------------
diff --git a/app/addons/documents/queryoptions/queryoptions.react.jsx b/app/addons/documents/queryoptions/queryoptions.react.jsx
index 085ab5e..97876bd 100644
--- a/app/addons/documents/queryoptions/queryoptions.react.jsx
+++ b/app/addons/documents/queryoptions/queryoptions.react.jsx
@@ -288,7 +288,7 @@ A key value is the first parameter emitted in a map function. For example emit("
           <div id="button-options" className="controls controls-row">
             <button type="submit" className="btn btn-success">
               <i className="fonticon-play icon" />
-              Query
+              Run Query
             </button>
             <a onClick={this.hideTray} className="btn btn-cancel">Cancel</a>
           </div>

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/bd7205f4/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 1799fed..339e6b8 100644
--- a/app/addons/documents/tests/nightwatch/deletesDocuments.js
+++ b/app/addons/documents/tests/nightwatch/deletesDocuments.js
@@ -114,8 +114,9 @@ module.exports = {
       .url(baseUrl + '#/database/' + newDatabaseName + '/' + newDocumentName)
       .waitForElementPresent('#editor-container', waitTime, false)
       .clickWhenVisible('#doc-editor-actions-panel button[title="Delete"]')
-      .clickWhenVisible('button.btn.btn-success.js-btn-success')
+      .clickWhenVisible('.confirmation-modal button.btn.btn-success')
       .waitForElementPresent('#jump-to-doc-id', waitTime, false)
+
       //check raw JSON
       .url(baseUrl + '/' + newDatabaseName + '/_all_docs')
       .waitForElementPresent('pre', waitTime, false)

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/bd7205f4/app/addons/documents/tests/nightwatch/viewDelete.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/tests/nightwatch/viewDelete.js b/app/addons/documents/tests/nightwatch/viewDelete.js
index 0911066..0e5dee1 100644
--- a/app/addons/documents/tests/nightwatch/viewDelete.js
+++ b/app/addons/documents/tests/nightwatch/viewDelete.js
@@ -30,8 +30,9 @@ module.exports = {
 
       .clickWhenVisible('.index-list .active span', waitTime, true)
       .clickWhenVisible('.popover-content .fonticon-trash', waitTime, true)
-      .waitForElementVisible('.confirmation-modal .js-btn-success', waitTime, true)
-      .clickWhenVisible('.confirmation-modal .js-btn-success', waitTime, true)
+      .waitForElementVisible('.confirmation-modal button.btn-success', waitTime, true)
+      .clickWhenVisible('.confirmation-modal button.btn-success', waitTime, true)
+
 
       // now wait for the sidebar to have removed the design doc
       .waitForElementNotPresent('#testdesigndoc', waitTime, true)

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/bd7205f4/app/addons/fauxton/components.react.jsx
----------------------------------------------------------------------
diff --git a/app/addons/fauxton/components.react.jsx b/app/addons/fauxton/components.react.jsx
index e799ac0..af5d50f 100644
--- a/app/addons/fauxton/components.react.jsx
+++ b/app/addons/fauxton/components.react.jsx
@@ -360,7 +360,7 @@ function (app, FauxtonAPI, React, ReactDOM, ZeroClipboard, ReactBootstrap) {
   });
 
 
-  // A super-simple replacement for window.confirm()
+  // a super-simple replacement for window.confirm()
   var ConfirmationModal = React.createClass({
     propTypes: {
       visible: React.PropTypes.bool.isRequired,
@@ -378,6 +378,7 @@ function (app, FauxtonAPI, React, ReactDOM, ZeroClipboard, ReactBootstrap) {
         title: 'Please confirm',
         text: '',
         successButtonLabel: 'Okay',
+        buttonClass: 'btn-success',
         onClose: function () { },
         onSubmit: function () { }
       };
@@ -395,6 +396,8 @@ function (app, FauxtonAPI, React, ReactDOM, ZeroClipboard, ReactBootstrap) {
       if (!_.isString(this.props.text)) {
         content = this.props.text;
       }
+      var btnClasses = 'btn ' + this.props.buttonClass;
+
       return (
         <Modal dialogClassName="confirmation-modal" show={this.props.visible} onHide={this.close}>
           <Modal.Header closeButton={true}>
@@ -404,7 +407,7 @@ function (app, FauxtonAPI, React, ReactDOM, ZeroClipboard, ReactBootstrap) {
             {content}
           </Modal.Body>
           <Modal.Footer>
-            <button className="btn btn-success js-btn-success" onClick={this.props.onSubmit}>
+            <button className={btnClasses} onClick={this.props.onSubmit}>
               <i className="fonticon-ok-circled"></i> {this.props.successButtonLabel}
             </button>
             <a href="#" data-bypass="true" className="cancel-link" onClick={this.close}>Cancel</a>