Search Ext: Add api params to debug section
authorColeman Watts <coleman@civicrm.org>
Sat, 18 Jul 2020 03:27:46 +0000 (23:27 -0400)
committerColeman Watts <coleman@civicrm.org>
Sat, 18 Jul 2020 13:07:43 +0000 (09:07 -0400)
ext/search/ang/search/crmSearch.component.js
ext/search/ang/search/crmSearch/debug.html

index 3ec65608b00025ea4568822c2d5480097281542c..1695f95701d8bfa6bcbc1388eec143864f25d3a8 100644 (file)
           ctrl.stale = true;
           ctrl.debug = error.debug;
           $scope.error = errorMsg(error);
-        });
+        })
+          .finally(function() {
+            if (ctrl.debug) {
+              ctrl.debug.params = JSON.stringify(ctrl.params, null, 2);
+            }
+          });
       }
 
       var _loadResults = _.debounce(_loadResultsCallback, 250);
index e7e4bd255e6cebf2ff3713fb6032bb46023633e9..4bb483d1af9e43adbed8b77fde498a0dc777547a 100644 (file)
@@ -2,6 +2,9 @@
   <legend class="collapsible-title">{{:: ts('Query Info') }}</legend>
   <div>
     <pre ng-if="$ctrl.debug.timeIndex">{{ ts('Request took %1 seconds.', {1: $ctrl.debug.timeIndex}) }}</pre>
+    <div><strong>API:</strong></div>
+    <pre>{{ $ctrl.debug.params }}</pre>
+    <div><strong>SQL:</strong></div>
     <pre ng-repeat="query in $ctrl.debug.sql">{{ query }}</pre>
   </div>
 </fieldset>