SearchKit - Add descriptions to search display types
authorColeman Watts <coleman@civicrm.org>
Sat, 5 Nov 2022 20:37:54 +0000 (16:37 -0400)
committerColeman Watts <coleman@civicrm.org>
Thu, 10 Nov 2022 17:34:45 +0000 (12:34 -0500)
ext/search_kit/ang/crmSearchAdmin/crmSearchAdminDisplay.component.js
ext/search_kit/ang/crmSearchAdmin/tabs.html
ext/search_kit/managed/SearchDisplayType.mgd.php

index 44192f1cd5bfe35c8510f1e0c0f9b056f9a7ce70..c951df207975e47128e8e7a75d7fd7a3776e37ac 100644 (file)
@@ -16,6 +16,7 @@
       _.each(CRM.crmSearchAdmin.displayTypes, function(type) {
         html +=
           '<div ng-switch-when="' + type.id + '">\n' +
+          '  <div class="help-block"><i class="crm-i ' + type.icon + '"></i> ' + _.escape(type.description) + '</div>' +
           '  <search-admin-display-' + type.id + ' api-entity="$ctrl.savedSearch.api_entity" api-params="$ctrl.savedSearch.api_params" display="$ctrl.display"></search-admin-display-' + type.id + '>\n' +
           '  <hr>\n' +
           '  <button type="button" class="btn btn-{{ !$ctrl.stale ? \'success\' : $ctrl.preview ? \'warning\' : \'primary\' }}" ng-click="$ctrl.previewDisplay()" ng-disabled="!$ctrl.stale">\n' +
index b738e7d99db772ea3abf06290e12d8e625a6c3d1..cb8827c6a4fc754998e03476f30773651a85d379 100644 (file)
@@ -33,7 +33,7 @@
     <i class="crm-i fa-plus"></i> {{:: ts('Add...') }} <span class="caret"></span>
   </button>
   <ul class="dropdown-menu">
-    <li ng-if="!$ctrl.savedSearch.groups.length">
+    <li ng-if="!$ctrl.savedSearch.groups.length" title="{{:: ts('Smart group of contacts based on search results') }}">
       <a href ng-click="$ctrl.addGroup()">
         <i class="crm-i fa-users"></i>
         {{:: ts('Smart Group') }}
@@ -41,7 +41,7 @@
     </li>
     <li class="dropdown-header">{{:: ts('Display') }}</li>
     <li ng-repeat="type in ::$ctrl.displayTypes">
-      <a href ng-click="$ctrl.addDisplay(type.id)">
+      <a href ng-click="$ctrl.addDisplay(type.id)" title="{{:: type.description }}">
         <i class="crm-i {{:: type.icon }}"></i>
         {{:: type.label }}
       </a>
index 87bf76e64be92dce3faa065a881b4ec7e9d2f9ea..55e4e32504a777b45179c1c6806b11818d9cad12 100644 (file)
@@ -12,7 +12,7 @@ return [
       'version' => 4,
       'values' => [
         'name' => 'search_display_type',
-        'title' => 'Search Display Type',
+        'title' => E::ts('Search Display Type'),
         'is_reserved' => TRUE,
         'is_active' => TRUE,
         'option_value_fields' => [
@@ -37,6 +37,7 @@ return [
         'value' => 'table',
         'name' => 'crm-search-display-table',
         'label' => E::ts('Table'),
+        'description' => E::ts('A table displays results in rows and columns, with an optional pager and selectable actions. The styling of rows and columns is highly configurable.'),
         'icon' => 'fa-table',
         'is_reserved' => TRUE,
         'is_active' => TRUE,
@@ -57,6 +58,7 @@ return [
         'value' => 'list',
         'name' => 'crm-search-display-list',
         'label' => E::ts('List'),
+        'description' => E::ts('Lists are highly flexible and display results on one or more lines. Each field can be styled differently or given a custom css class.'),
         'icon' => 'fa-list',
         'is_reserved' => TRUE,
         'is_active' => TRUE,
@@ -77,6 +79,7 @@ return [
         'value' => 'grid',
         'name' => 'crm-search-display-grid',
         'label' => E::ts('Grid'),
+        'description' => E::ts('Grid displays are useful for image gallery thumbnails and other content to show side-by side.'),
         'icon' => 'fa-th',
         'is_reserved' => TRUE,
         'is_active' => TRUE,
@@ -97,6 +100,7 @@ return [
         'value' => 'autocomplete',
         'name' => 'crm-search-display-autocomplete',
         'label' => E::ts('Autocomplete'),
+        'description' => E::ts('Autocompletes are form fields that give results from this search as the user types. Creating a display is optional and allows customization of how each result appears in the dropdown.'),
         'icon' => 'fa-keyboard-o',
         'is_reserved' => TRUE,
         'is_active' => TRUE,