SearchKit - POC help text
authorColeman Watts <coleman@civicrm.org>
Tue, 25 Oct 2022 22:49:39 +0000 (18:49 -0400)
committerColeman Watts <coleman@civicrm.org>
Mon, 13 Mar 2023 15:08:17 +0000 (11:08 -0400)
ext/search_kit/ang/crmSearchAdmin/compose.html
ext/search_kit/ang/crmSearchAdmin/crmSearchAdmin.component.js
ext/search_kit/ang/crmSearchAdmin/crmSearchClause.component.js
ext/search_kit/ang/crmSearchAdmin/crmSearchClause.html
ext/search_kit/ang/crmSearchAdmin/displays/colType/field.html
ext/search_kit/ang/crmSearchAdmin/displays/colType/html.html
ext/search_kit/ang/crmSearchAdmin/displays/searchAdminDisplayGrid.component.js
ext/search_kit/ang/crmSearchAdmin/displays/searchAdminDisplayList.component.js
ext/search_kit/ang/crmSearchAdmin/displays/searchAdminDisplayTable.component.js
ext/search_kit/templates/CRM/Search/Help/Compose.hlp [new file with mode: 0644]
ext/search_kit/templates/CRM/Search/Help/Display.hlp [new file with mode: 0644]

index 3d773cfcd25caa3e0aa325124d72f814d3efdcc8..6a52133a588390e5cb0a054c5231eebf6eb1d8ae 100644 (file)
@@ -45,7 +45,7 @@
       <crm-search-clause clauses="$ctrl.savedSearch.api_params.where" format="string" op="AND" label="{{:: ts('Where') }}" fields="fieldsForWhere" allow-functions="true" ></crm-search-clause>
     </fieldset>
     <fieldset ng-if="$ctrl.paramExists('having') && $ctrl.savedSearch.api_params.groupBy.length" class="api4-clause-fieldset">
-      <crm-search-clause clauses="$ctrl.savedSearch.api_params.having" format="string" op="AND" label="{{:: ts('Having') }}" fields="fieldsForHaving" ></crm-search-clause>
+      <crm-search-clause clauses="$ctrl.savedSearch.api_params.having" format="string" op="AND" label="{{:: ts('Having') }}" help="having" fields="fieldsForHaving" ></crm-search-clause>
     </fieldset>
   </div>
 </div>
index 750f597eab53acc4bb3d058493e47d1a7b904449..4d1d8e9f1bc4b90ccf3effecb437566ccdfca0a8 100644 (file)
@@ -6,11 +6,12 @@
       savedSearch: '<'
     },
     templateUrl: '~/crmSearchAdmin/crmSearchAdmin.html',
-    controller: function($scope, $element, $location, $timeout, crmApi4, dialogService, searchMeta) {
+    controller: function($scope, $element, $location, $timeout, crmApi4, dialogService, searchMeta, crmUiHelp) {
       var ts = $scope.ts = CRM.ts('org.civicrm.search_kit'),
         ctrl = this,
         afformLoad,
         fieldsForJoinGetters = {};
+      $scope.hs = crmUiHelp({file: 'CRM/Search/Help/Compose'});
 
       this.afformEnabled = 'org.civicrm.afform' in CRM.crmSearchAdmin.modules;
       this.afformAdminEnabled = (CRM.checkPerm('administer CiviCRM') || CRM.checkPerm('administer afform')) &&
index 9bd637ab3c392b54ee9b76e0492dd1376a5c4c3e..bde690cda5dad0a2c6938d7853fe5fa608c0149d 100644 (file)
       allowFunctions: '<',
       skip: '<',
       label: '@',
+      help: '@',
       hideLabel: '@',
       placeholder: '<',
       deleteGroup: '&'
     },
     templateUrl: '~/crmSearchAdmin/crmSearchClause.html',
-    controller: function ($scope, $element, searchMeta) {
+    controller: function ($scope, $element, searchMeta, crmUiHelp) {
       var ts = $scope.ts = CRM.ts('org.civicrm.search_kit'),
         ctrl = this,
         meta = {};
@@ -31,6 +32,7 @@
 
       this.$onInit = function() {
         ctrl.hasParent = !!$element.attr('delete-group');
+        $scope.hs = crmUiHelp({file: 'CRM/Search/Help/Compose'});
       };
 
       // Gets the first arg of type "field"
index 5baaaa7bd1ca0ab0c7cbc4227390556e704d428f..5f4902f998e02f4a6e33bbc887c849289f073863 100644 (file)
@@ -1,4 +1,7 @@
-<legend ng-if="!$ctrl.hideLabel">{{ $ctrl.label || ts('%1 group', {1: $ctrl.conjunctions[$ctrl.op]}) }}</legend>
+<legend ng-if="!$ctrl.hideLabel">
+  {{ $ctrl.label || ts('%1 group', {1: $ctrl.conjunctions[$ctrl.op]}) }}
+  <a ng-if="$ctrl.help" crm-ui-help="hs({id: $ctrl.help, title: $ctrl.label})"></a>
+</legend>
 <div class="btn-group btn-group-xs" ng-if=":: $ctrl.hasParent">
   <button type="button" class="btn btn-danger-outline" ng-click="$ctrl.deleteGroup()" title="{{:: ts('Remove group') }}">
     <i class="crm-i fa-trash" aria-hidden="true"></i>
index ed44ebbf0c15d4a043cafc71b45644b800469c0d..16ea194e8c1053bf65ad66749896fd048d379545 100644 (file)
@@ -44,6 +44,7 @@
     <input type="checkbox" ng-checked="col.rewrite" ng-click="$ctrl.parent.toggleRewrite(col)" >
     {{:: ts('Rewrite Text') }}
   </label>
+  <a crm-ui-help="hs({id: 'rewrite', title: ts('Rewrite Text')})"></a>
   <textarea rows="2" class="form-control crm-flex-1" ng-if="col.rewrite" ng-model="col.rewrite" ng-model-options="{updateOn: 'blur'}"></textarea>
   <crm-search-admin-token-select ng-if="col.rewrite" model="col" field="rewrite" suffix=":label"></crm-search-admin-token-select>
 </div>
index 14f359f28ef9d3ce2d8ba88d2380ef3563ef7510..609f296b923e52d7e9fcaf567e561d4e803628a3 100644 (file)
@@ -25,6 +25,7 @@
     <input type="checkbox" ng-checked="col.rewrite" ng-click="$ctrl.parent.toggleRewrite(col)" >
     {{:: ts('Rewrite HTML') }}
   </label>
+  <a crm-ui-help="hs({id: 'rewrite', title: ts('Rewrite HTML')})"></a>
   <textarea rows="2" class="form-control crm-flex-1" ng-if="col.rewrite" ng-model="col.rewrite" ng-model-options="{updateOn: 'blur'}"></textarea>
   <crm-search-admin-token-select ng-if="col.rewrite" model="col" field="rewrite" suffix=":label"></crm-search-admin-token-select>
 </div>
index e5295b3ccecaee46a66d9bfeb68a5ea72a52df29..e1c5707e4073941d61639312076bc1b3bb47c70d 100644 (file)
       parent: '^crmSearchAdminDisplay'
     },
     templateUrl: '~/crmSearchAdmin/displays/searchAdminDisplayGrid.html',
-    controller: function($scope, searchMeta) {
+    controller: function($scope, searchMeta, crmUiHelp) {
       var ts = $scope.ts = CRM.ts('org.civicrm.search_kit'),
         ctrl = this;
+      $scope.hs = crmUiHelp({file: 'CRM/Search/Help/Display'});
 
       this.getColTypes = function() {
         return ctrl.parent.colTypes;
index 6705513402dd1eb0c18a27d184321e348c4f2b9d..66d390b5f0fc12839e8bf80095e4081f637f9907 100644 (file)
       parent: '^crmSearchAdminDisplay'
     },
     templateUrl: '~/crmSearchAdmin/displays/searchAdminDisplayList.html',
-    controller: function($scope, searchMeta) {
+    controller: function($scope, searchMeta, crmUiHelp) {
       var ts = $scope.ts = CRM.ts('org.civicrm.search_kit'),
         ctrl = this;
+      $scope.hs = crmUiHelp({file: 'CRM/Search/Help/Display'});
 
       this.getColTypes = function() {
         return ctrl.parent.colTypes;
index e151bf5758b1b454c1ac2eb055ea51345ad443d4..b31260e9f8abc6f568b87be7f711cc744e8c6c24 100644 (file)
       parent: '^crmSearchAdminDisplay'
     },
     templateUrl: '~/crmSearchAdmin/displays/searchAdminDisplayTable.html',
-    controller: function($scope, searchMeta, formatForSelect2) {
+    controller: function($scope, searchMeta, formatForSelect2, crmUiHelp) {
       var ts = $scope.ts = CRM.ts('org.civicrm.search_kit'),
         ctrl = this;
+      $scope.hs = crmUiHelp({file: 'CRM/Search/Help/Display'});
 
       this.tableClasses = [
         {name: 'table', label: ts('Row Borders')},
diff --git a/ext/search_kit/templates/CRM/Search/Help/Compose.hlp b/ext/search_kit/templates/CRM/Search/Help/Compose.hlp
new file mode 100644 (file)
index 0000000..7fde36f
--- /dev/null
@@ -0,0 +1,4 @@
+{htxt id="having"}
+  <p>{ts}Unlike the WHERE clause which filters data in the database, HAVING filters the results shown in the table. This allows filtering of aggregate data or field transformations.{/ts}</p>
+  <p>{ts}Note: Rewrite occurs after HAVING has been applied, so does not affect the HAVING filter.{/ts}</p>
+{/htxt}
diff --git a/ext/search_kit/templates/CRM/Search/Help/Display.hlp b/ext/search_kit/templates/CRM/Search/Help/Display.hlp
new file mode 100644 (file)
index 0000000..71ca83e
--- /dev/null
@@ -0,0 +1,3 @@
+{htxt id="rewrite"}
+  <p>{ts}Both search tokens and smarty tags are supported when rewriting fields.{/ts}</p>
+{/htxt}