You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by gi...@git.apache.org on 2017/10/02 07:14:08 UTC

[GitHub] garrensmith commented on a change in pull request #986: Refactor map/reduce views to use Redux

garrensmith commented on a change in pull request #986: Refactor map/reduce views to use Redux
URL: https://github.com/apache/couchdb-fauxton/pull/986#discussion_r142064928
 
 

 ##########
 File path: app/addons/documents/index-editor/components/DesignDocSelector.js
 ##########
 @@ -0,0 +1,116 @@
+// 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.
+
+import React, { Component } from "react";
+import ReactDOM from "react-dom";
+import FauxtonAPI from "../../../../core/api";
+import ReactComponents from "../../../components/react-components";
+
+const StyledSelect = ReactComponents.StyledSelect;
+
+export default class DesignDocSelector extends Component {
+
+  constructor(props) {
+    super(props);
+  }
+
+  validate() {
+    if (this.props.selectedDesignDocName === 'new-doc' && this.props.newDesignDocName === '') {
+      FauxtonAPI.addNotification({
+        msg: 'Please name your design doc.',
+        type: 'error'
+      });
+      ReactDOM.findDOMNode(this.refs.newDesignDoc).focus();
+      return false;
+    }
+    return true;
+  }
+
+  getDocList() {
+    return _.map(this.props.designDocList, function (designDoc) {
 
 Review comment:
   Can you change to `this.props.designDocList.map` with fat arrow
 
----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services