From 53102d95767caf8b6f40afc3adbe278150d5dd6b Mon Sep 17 00:00:00 2001 From: Damilare Adedoyin Date: Tue, 28 Nov 2023 16:26:48 +0000 Subject: [PATCH] Coworker create Searchkit over view of queue status --- Civi/Api4/Queue.php | 2 +- .../ang/afsearchCiviCRMQueues.aff.html | 5 + .../ang/afsearchCiviCRMQueues.aff.php | 12 +++ .../managed/SavedSearch_Queues.mgd.php | 100 ++++++++++++++++++ 4 files changed, 118 insertions(+), 1 deletion(-) create mode 100644 ext/civicrm_admin_ui/ang/afsearchCiviCRMQueues.aff.html create mode 100644 ext/civicrm_admin_ui/ang/afsearchCiviCRMQueues.aff.php create mode 100644 ext/civicrm_admin_ui/managed/SavedSearch_Queues.mgd.php diff --git a/Civi/Api4/Queue.php b/Civi/Api4/Queue.php index 3339d06629..bdfd2d0a3b 100644 --- a/Civi/Api4/Queue.php +++ b/Civi/Api4/Queue.php @@ -20,7 +20,7 @@ use Civi\Api4\Action\Queue\Run; * Registering a queue in this table (and setting `is_auto=1`) can * allow it to execute tasks automatically in the background. * - * @searchable none + * @searchable secondary * @since 5.47 * @package Civi\Api4 */ diff --git a/ext/civicrm_admin_ui/ang/afsearchCiviCRMQueues.aff.html b/ext/civicrm_admin_ui/ang/afsearchCiviCRMQueues.aff.html new file mode 100644 index 0000000000..2043d35357 --- /dev/null +++ b/ext/civicrm_admin_ui/ang/afsearchCiviCRMQueues.aff.html @@ -0,0 +1,5 @@ +
+ + + +
diff --git a/ext/civicrm_admin_ui/ang/afsearchCiviCRMQueues.aff.php b/ext/civicrm_admin_ui/ang/afsearchCiviCRMQueues.aff.php new file mode 100644 index 0000000000..3bfcd9ea26 --- /dev/null +++ b/ext/civicrm_admin_ui/ang/afsearchCiviCRMQueues.aff.php @@ -0,0 +1,12 @@ + 'search', + 'title' => E::ts('CiviCRM Queues'), + 'icon' => 'fa-list-alt', + 'server_route' => 'civicrm/queues', + 'permission' => ['administer queues'], + 'placement' => [], + 'permission_operator' => "AND", +]; diff --git a/ext/civicrm_admin_ui/managed/SavedSearch_Queues.mgd.php b/ext/civicrm_admin_ui/managed/SavedSearch_Queues.mgd.php new file mode 100644 index 0000000000..f0b1cc7589 --- /dev/null +++ b/ext/civicrm_admin_ui/managed/SavedSearch_Queues.mgd.php @@ -0,0 +1,100 @@ + 'SavedSearch_Queues', + 'entity' => 'SavedSearch', + 'cleanup' => 'always', + 'update' => 'unmodified', + 'params' => [ + 'version' => 4, + 'values' => [ + 'name' => 'Queues', + 'label' => E::ts('Queues'), + 'api_entity' => 'Queue', + 'api_params' => [ + 'version' => 4, + 'select' => [ + 'id', + 'name', + 'type:label', + 'status:label', + ], + 'orderBy' => [], + 'where' => [], + 'groupBy' => [], + 'join' => [], + 'having' => [], + ], + ], + 'match' => [ + 'name', + ], + ], + ], + [ + 'name' => 'SavedSearch_Queues_SearchDisplay_Queues_Table_1', + 'entity' => 'SearchDisplay', + 'cleanup' => 'always', + 'update' => 'unmodified', + 'params' => [ + 'version' => 4, + 'values' => [ + 'name' => 'Queues_Table_1', + 'label' => E::ts('Queues'), + 'saved_search_id.name' => 'Queues', + 'type' => 'table', + 'settings' => [ + 'description' => NULL, + 'sort' => [], + 'limit' => 50, + 'pager' => [], + 'placeholder' => 5, + 'columns' => [ + [ + 'type' => 'field', + 'key' => 'id', + 'dataType' => 'Integer', + 'label' => E::ts('System Queue ID'), + 'sortable' => TRUE, + ], + [ + 'type' => 'field', + 'key' => 'name', + 'dataType' => 'String', + 'label' => E::ts('Name'), + 'sortable' => TRUE, + ], + [ + 'type' => 'field', + 'key' => 'type:label', + 'dataType' => 'String', + 'label' => E::ts('Type'), + 'sortable' => TRUE, + ], + [ + 'type' => 'field', + 'key' => 'status:label', + 'dataType' => 'String', + 'label' => E::ts('Status'), + 'sortable' => TRUE, + 'rewrite' => '', + 'editable' => TRUE, + ], + ], + 'actions' => FALSE, + 'classes' => [ + 'table', + 'table-striped', + ], + ], + ], + 'match' => [ + 'saved_search_id', + 'name', + ], + ], + ], +]; -- 2.25.1