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/06/19 15:03:18 UTC

[GitHub] millayr commented on a change in pull request #906: Toolbar redesign for all docs

millayr commented on a change in pull request #906: Toolbar redesign for all docs
URL: https://github.com/apache/couchdb-fauxton/pull/906#discussion_r122733116
 
 

 ##########
 File path: app/addons/documents/index-results/apis/base-api.js
 ##########
 @@ -0,0 +1,95 @@
+// 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 ActionTypes from '../actiontypes';
+
+export const nowLoading = () => {
+  return {
+    type: ActionTypes.INDEX_RESULTS_REDUX_IS_LOADING
+  };
+};
+
+export const resetState = () => {
+  return {
+    type: ActionTypes.INDEX_RESULTS_REDUX_RESET_STATE
+  };
+};
+
+export const newResultsAvailable = (docs, params, canShowNext) => {
+  return {
+    type: ActionTypes.INDEX_RESULTS_REDUX_NEW_RESULTS,
+    docs: docs,
+    params: params,
+    canShowNext: canShowNext
+  };
+};
+
+export const newSelectedDocs = (selectedDocs = []) => {
+  return {
+    type: ActionTypes.INDEX_RESULTS_REDUX_NEW_SELECTED_DOCS,
+    selectedDocs: selectedDocs
+  };
+};
+
+export const selectDoc = (doc, selectedDocs) => {
+  const indexInSelectedDocs = selectedDocs.findIndex((selectedDoc) => {
 
 Review comment:
   We need to remove docs from the array when a user has deselected it from their list of results.  I've added some comments better describe what the function is trying to achieve.
 
----------------------------------------------------------------
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