SearchKit - Add created & modified info to SavedSearch listing
authorColeman Watts <coleman@civicrm.org>
Wed, 24 Mar 2021 22:15:08 +0000 (18:15 -0400)
committerColeman Watts <coleman@civicrm.org>
Wed, 24 Mar 2021 22:15:08 +0000 (18:15 -0400)
ext/search/ang/crmSearchAdmin.module.js
ext/search/ang/crmSearchAdmin/searchList.controller.js
ext/search/ang/crmSearchAdmin/searchList.html

index 7aa5b7eb60e1b2b95e3a83f8e03f331a9de08d31..88cdddbe699452fa7805b34b417f96f09ed387c2 100644 (file)
                 'label',
                 'api_entity',
                 'api_params',
+                'created.display_name',
+                'modified.display_name',
+                'created_date',
+                'modified_date',
                 'GROUP_CONCAT(display.name ORDER BY display.id) AS display_name',
                 'GROUP_CONCAT(display.label ORDER BY display.id) AS display_label',
                 'GROUP_CONCAT(display.type:icon ORDER BY display.id) AS display_icon',
index e554164c3f1d91ab5bdbc0481972e045cd17d277..42a36d904eac74e2e3d9cda3d3f6f5413932018d 100644 (file)
@@ -4,6 +4,7 @@
   angular.module('crmSearchAdmin').controller('searchList', function($scope, savedSearches, crmApi4) {
     var ts = $scope.ts = CRM.ts('org.civicrm.search'),
       ctrl = $scope.$ctrl = this;
+    $scope.formatDate = CRM.utils.formatDate;
     this.savedSearches = savedSearches;
     this.afformEnabled = CRM.crmSearchAdmin.afformEnabled;
     this.afformAdminEnabled = CRM.crmSearchAdmin.afformAdminEnabled;
index 427ae1718b075ca1f80d10e345258a1f2025436c..856f4e89a8f2b9922f3eec599394b3f9a7e435e3 100644 (file)
         <th>{{:: ts('Displays') }}</th>
         <th>{{:: ts('Smart Group') }}</th>
         <th ng-if="$ctrl.afformEnabled">{{:: ts('Forms') }}</th>
+        <th>{{:: ts('Created') }}</th>
+        <th>{{:: ts('Last Modified') }}</th>
         <th></th>
       </tr>
     </thead>
     <tbody>
       <tr ng-repeat="search in $ctrl.savedSearches | filter:$ctrl.searchFilter">
-        <td>{{ search.id }}</td>
-        <td>{{ search.label }}</td>
-        <td>{{ $ctrl.entityTitles[search.api_entity] }}</td>
+        <td>{{:: search.id }}</td>
+        <td>{{:: search.label }}</td>
+        <td>{{:: $ctrl.entityTitles[search.api_entity] }}</td>
         <td>
           <div class="btn-group">
             <button type="button" disabled ng-if="!search.display_name" class="btn btn-xs dropdown-toggle btn-primary-outline">
@@ -43,7 +45,7 @@
             </ul>
           </div>
         </td>
-        <td>{{ search.groups.join(', ') }}</td>
+        <td>{{:: search.groups.join(', ') }}</td>
         <td ng-if="::$ctrl.afformEnabled">
           <div class="btn-group">
             <button type="button" ng-click="$ctrl.loadAfforms()" ng-if="search.display_name" class="btn btn-xs dropdown-toggle btn-primary-outline" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
@@ -72,6 +74,8 @@
             </ul>
           </div>
         </td>
+        <td>{{:: ts('%1 by %2', {1: formatDate(search.created_date), 2: search['created.display_name']}) }}</td>
+        <td>{{:: ts('%1 by %2', {1: formatDate(search.created_date), 2: search['modified.display_name']}) }}</td>
         <td class="text-right">
           <a class="btn btn-xs btn-default" href="#/edit/{{:: search.id }}">{{:: ts('Edit') }}</a>
           <a class="btn btn-xs btn-default" href="#/create/{{:: search.api_entity + '?params=' + $ctrl.encode(search.api_params) }}">{{:: ts('Clone') }}</a>