Skip to content
Snippets Groups Projects
Commit 36cd224f authored by mattwire's avatar mattwire
Browse files

Add SearchKit-based webhooks list

parent c627a1fe
No related branches found
No related tags found
1 merge request!48Add SearchKit-based webhooks list
<div af-fieldset="">
<crm-search-display-list search-name="Paymentprocessor_Webhook_Detail" display-name="Paymentprocessor_Webhook_Detail" filters="{id: routeParams.id}"></crm-search-display-list>
</div>
<?php
use CRM_Mjwshared_ExtensionUtil as E;
return [
'type' => 'search',
'title' => E::ts('Payment Processor Webhook Detail'),
'icon' => 'fa-list-alt',
'server_route' => 'civicrm/paymentprocessorwebhooks/detail',
'permission' => [
'edit contributions',
],
];
<div af-fieldset="">
<div class="af-container af-layout-inline">
<af-field name="status" />
<af-field name="payment_processor_id" defn="{input_attrs: {multiple: true}}" />
<af-field name="event_id" />
<af-field name="identifier" />
<af-field name="message" />
<af-field name="data" />
<af-field name="created_date" defn="{input_type: 'Select', search_range: true, input_attrs: {}}" />
<af-field name="processed_date" defn="{input_type: 'Select', search_range: true, input_attrs: {}}" />
</div>
<crm-search-display-table search-name="Paymentprocessor_Webhook_Search" display-name="Paymentprocessor_Webhook_Search"></crm-search-display-table>
</div>
<?php
use CRM_Mjwshared_ExtensionUtil as E;
return [
'type' => 'search',
'title' => E::ts('Payment Processor Webhooks'),
'icon' => 'fa-list-alt',
'server_route' => 'civicrm/paymentprocessorwebhooks',
'permission' => [
'edit contributions',
],
];
<?php
use CRM_Mjwshared_ExtensionUtil as E;
return [
[
'name' => 'Navigation_afsearchPaymentProcessorWebhooks',
'entity' => 'Navigation',
'cleanup' => 'unused',
'update' => 'unmodified',
'params' => [
'version' => 4,
'values' => [
'label' => E::ts('Payment Processor Webhooks'),
'name' => 'afsearchPaymentProcessorWebhooks',
'url' => 'civicrm/paymentprocessorwebhooks',
'icon' => 'crm-i fa-list-alt',
'permission' => [
'edit contributions',
],
'permission_operator' => 'AND',
'parent_id.name' => 'CiviContribute',
'weight' => 19,
],
'match' => ['name', 'domain_id'],
],
],
];
<?php
use CRM_Mjwshared_ExtensionUtil as E;
return [
[
'name' => 'SavedSearch_Paymentprocessor_Webhook_Detail',
'entity' => 'SavedSearch',
'cleanup' => 'unused',
'update' => 'unmodified',
'params' => [
'version' => 4,
'values' => [
'name' => 'Paymentprocessor_Webhook_Detail',
'label' => E::ts('Paymentprocessor Webhook Detail'),
'api_entity' => 'PaymentprocessorWebhook',
'api_params' => [
'version' => 4,
'select' => [
'id',
'data',
'identifier',
'message',
'trigger',
'status',
],
'orderBy' => [],
'where' => [],
'groupBy' => [],
'join' => [],
'having' => [],
],
],
'match' => ['name'],
],
],
[
'name' => 'SavedSearch_Paymentprocessor_Webhook_Detail_SearchDisplay_Paymentprocessor_Webhook_Detail',
'entity' => 'SearchDisplay',
'cleanup' => 'unused',
'update' => 'unmodified',
'params' => [
'version' => 4,
'values' => [
'name' => 'Paymentprocessor_Webhook_Detail',
'label' => E::ts('Paymentprocessor Webhook Detail'),
'saved_search_id.name' => 'Paymentprocessor_Webhook_Detail',
'type' => 'list',
'settings' => [
'style' => 'ul',
'limit' => 1,
'sort' => [],
'pager' => FALSE,
'columns' => [
[
'type' => 'field',
'key' => 'id',
'dataType' => 'Integer',
'label' => E::ts('ID'),
],
[
'type' => 'field',
'key' => 'identifier',
'dataType' => 'String',
'label' => E::ts('Identifier'),
],
[
'type' => 'field',
'key' => 'message',
'dataType' => 'String',
'break' => FALSE,
'label' => E::ts('Message'),
],
[
'type' => 'field',
'key' => 'trigger',
'dataType' => 'String',
'label' => E::ts('Trigger'),
],
[
'type' => 'field',
'key' => 'status',
'dataType' => 'String',
'label' => E::ts('Status'),
],
[
'type' => 'html',
'key' => 'data',
'dataType' => 'Text',
'label' => E::ts('Data'),
],
],
'placeholder' => 0,
],
],
'match' => [
'saved_search_id',
'name',
],
],
],
];
<?php
use CRM_Mjwshared_ExtensionUtil as E;
return [
[
'name' => 'SavedSearch_Paymentprocessor_Webhook_Search',
'entity' => 'SavedSearch',
'cleanup' => 'unused',
'update' => 'unmodified',
'params' => [
'version' => 4,
'values' => [
'name' => 'Paymentprocessor_Webhook_Search',
'label' => E::ts('Paymentprocessor Webhook Search'),
'api_entity' => 'PaymentprocessorWebhook',
'api_params' => [
'version' => 4,
'select' => [
'id',
'status',
'created_date',
'processed_date',
'payment_processor_id:label',
'event_id',
'message',
],
'orderBy' => [],
'where' => [],
'groupBy' => [],
'join' => [],
'having' => [],
],
],
'match' => ['name'],
],
],
[
'name' => 'SavedSearch_Paymentprocessor_Webhook_Search_SearchDisplay_Paymentprocessor_Webhook_Search',
'entity' => 'SearchDisplay',
'cleanup' => 'unused',
'update' => 'unmodified',
'params' => [
'version' => 4,
'values' => [
'name' => 'Paymentprocessor_Webhook_Search',
'label' => E::ts('Paymentprocessor Webhook Search'),
'saved_search_id.name' => 'Paymentprocessor_Webhook_Search',
'type' => 'table',
'settings' => [
'description' => E::ts(NULL),
'sort' => [
['created_date', 'DESC'],
],
'limit' => 50,
'pager' => [],
'placeholder' => 5,
'columns' => [
[
'type' => 'field',
'key' => 'id',
'dataType' => 'Integer',
'label' => E::ts('ID'),
'sortable' => TRUE,
],
[
'type' => 'field',
'key' => 'status',
'dataType' => 'String',
'label' => E::ts('Status'),
'sortable' => TRUE,
],
[
'type' => 'field',
'key' => 'created_date',
'dataType' => 'Timestamp',
'label' => E::ts('Created Date'),
'sortable' => TRUE,
],
[
'type' => 'field',
'key' => 'processed_date',
'dataType' => 'Timestamp',
'label' => E::ts('Processed Date'),
'sortable' => TRUE,
],
[
'type' => 'field',
'key' => 'payment_processor_id:label',
'dataType' => 'Integer',
'label' => E::ts('Payment Processor'),
'sortable' => TRUE,
'rewrite' => '[payment_processor_id:label] ([payment_processor_id])',
],
[
'type' => 'field',
'key' => 'event_id',
'dataType' => 'String',
'label' => E::ts('Event ID'),
'sortable' => TRUE,
],
[
'type' => 'field',
'key' => 'message',
'dataType' => 'String',
'label' => E::ts('Message'),
'sortable' => TRUE,
],
[
'size' => 'btn-xs',
'links' => [
[
'path' => 'civicrm/paymentprocessorwebhooks/detail#?id=[id]',
'icon' => 'fa-clipboard-list',
'text' => E::ts('Detail'),
'style' => 'default',
'condition' => [],
'task' => '',
'entity' => '',
'action' => '',
'join' => '',
'target' => 'crm-popup',
],
[
'task' => 'retry',
'entity' => 'PaymentprocessorWebhook',
'join' => '',
'target' => 'crm-popup',
'icon' => 'fa-rectangle-refresh',
'text' => E::ts('Retry'),
'style' => 'default',
'path' => '',
'action' => '',
'condition' => [],
],
[
'task' => 'delete',
'entity' => 'PaymentprocessorWebhook',
'join' => '',
'target' => 'crm-popup',
'icon' => 'fa-trash',
'text' => E::ts('Delete'),
'style' => 'danger',
'path' => '',
'action' => '',
'condition' => [],
],
],
'type' => 'buttons',
'alignment' => 'text-right',
],
],
'actions' => TRUE,
'classes' => ['table', 'table-striped'],
'actions_display_mode' => 'menu',
'cssRules' => [
['bg-success', 'status', '=', 'success'],
['bg-danger', 'status', '=', 'error'],
['bg-info', 'status', '=', 'new'],
],
'headerCount' => TRUE,
],
],
'match' => [
'saved_search_id',
'name',
],
],
],
];
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment