garrensmith commented on a change in pull request #950: Simplify Mango/Query 
panel layout
URL: https://github.com/apache/couchdb-fauxton/pull/950#discussion_r132897937
 
 

 ##########
 File path: app/addons/documents/mango/mango.components.js
 ##########
 @@ -268,16 +250,39 @@ var MangoIndexEditorController = React.createClass({
       return;
     }
 
-    Actions.saveQuery({
+    Actions.saveIndex({
       database: this.state.database,
       queryCode: this.getMangoEditor().getEditorValue()
     });
   }
 });
 
+class ExplainPage extends Component {
+  componentDidMount () {
+    prettyPrint();
+  };
+
+  componentDidUpdate () {
+    prettyPrint();
+  };
+
+  render () {
+    return (
+      <div>
+        <pre className="prettyprint">{JSON.stringify(this.props.explainPlan, 
null, ' ')}</pre>
+      </div>
+    );
+  };
+}
+
+ExplainPage.propTypes = {
+  explainPlan: React.PropTypes.object.isRequired
+};
+
 var Views = {
   MangoIndexEditorController: MangoIndexEditorController,
-  MangoQueryEditorController: MangoQueryEditorController
+  MangoQueryEditorController: MangoQueryEditorController,
 
 Review comment:
   You can just do 
   
   ```
   export default {
       MangoIndexEditorController,
       MangoQueryEditorController,
       ExplainPage
   }
   ```
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to