garrensmith commented on a change in pull request #933: Update for changes to 
_cluster_setup endpoint
URL: https://github.com/apache/couchdb-fauxton/pull/933#discussion_r128968579
 
 

 ##########
 File path: app/addons/setup/setup.js
 ##########
 @@ -66,6 +99,32 @@ var SetupCurrentAdminPassword = React.createClass({
 
 });
 
+var SetupNodeCountSetting = React.createClass({
+  getInitialState: function () {
+    return {
+      nodeCountValue: this.props.nodeCountValue
+    };
+  },
+
+  handleNodeCountChange: function (event) {
+    this.props.onAlterNodeCount(event);
+    this.setState({nodeCountValue: event.target.value});
+  },
+
+  render: function () {
+    return (
+      <div className="setup-node-count">
+        <p>Number of nodes to be added to the cluster (including this one)</p>
+        <input
+          className="setup-input-nodecount"
+          value={this.state.nodeCountValue}
+          onChange={this.handleNodeCountChange}
+          placeholder="Value of cluster n"
+          type="text" />
+      </div>
+    );
+  }
+});
 
 var SetupOptionalSettings = React.createClass({
   getInitialState: function () {
 
 Review comment:
   I'm getting this warning in the devtools console when I try and configure a 
single node:
   
   ```
   SetupOptionalSettings is changing an uncontrolled input of type text to be 
controlled. Input elements should not switch from uncontrolled to controlled 
(or vice versa). Decide between using a controlled or uncontrolled input 
element for the lifetime of the component. More info: 
https://fb.me/react-controlled-components
   ```
   
   Its because the ipInitialValue is undefined. Settings it to `''` should fix 
it
 
----------------------------------------------------------------
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