You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by GitBox <gi...@apache.org> on 2017/11/01 13:08:58 UTC

[GitHub] garrensmith closed pull request #1011: Fix could not bulk delete from table view

garrensmith closed pull request #1011: Fix could not bulk delete from table view
URL: https://github.com/apache/couchdb-fauxton/pull/1011
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/app/addons/documents/__tests__/shared-helpers.test.js b/app/addons/documents/__tests__/shared-helpers.test.js
index 80308e590..9f2d5ff24 100644
--- a/app/addons/documents/__tests__/shared-helpers.test.js
+++ b/app/addons/documents/__tests__/shared-helpers.test.js
@@ -231,6 +231,16 @@ describe('Docs Shared Helpers', () => {
       expect(getDocRev(docView, docType)).toBe(docView.value.rev);
     });
 
+    it('returns document revision for docType "view" and only doc', () => {
+      const docView = {
+        id: "20c76d4ff9851694792654ab3e2ca303",
+        _rev: "1-c59f5770929653147ab939344b84e933"
+      };
+      const docType = Constants.INDEX_RESULTS_DOC_TYPE.VIEW;
+      expect(getDocRev(docView, docType)).toBe(docView._rev);
+    });
+
+
     it('returns document revision for docType "MangoQueryResult"', () => {
       const docMangoResult = {
         _id: "aardvark",
diff --git a/app/addons/documents/index-results/helpers/shared-helpers.js b/app/addons/documents/index-results/helpers/shared-helpers.js
index 175e04b78..86d139b37 100644
--- a/app/addons/documents/index-results/helpers/shared-helpers.js
+++ b/app/addons/documents/index-results/helpers/shared-helpers.js
@@ -96,7 +96,10 @@ const getDocId = (doc, docType = Constants.INDEX_RESULTS_DOC_TYPE.VIEW) => {
 
 const getDocRev = (doc, docType = Constants.INDEX_RESULTS_DOC_TYPE.VIEW) => {
   if (docType === Constants.INDEX_RESULTS_DOC_TYPE.VIEW) {
-    return doc.value && doc.value.rev;
+    if (doc.value) {
+      return doc.value.rev;
+    }
+    return doc._rev;
   } else if (docType === Constants.INDEX_RESULTS_DOC_TYPE.MANGO_INDEX) {
     return undefined;
   } else if (docType === Constants.INDEX_RESULTS_DOC_TYPE.MANGO_QUERY) {


 

----------------------------------------------------------------
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