From 543603339b645c1f750fd06d3e096c5026d79c7a Mon Sep 17 00:00:00 2001 From: mokaddem Date: Sat, 12 Jun 2021 12:04:11 +0200 Subject: [PATCH] new: [inbox] Added list request processors --- src/Controller/Component/ACLComponent.php | 5 +++ src/Controller/InboxController.php | 22 ++------- templates/Inbox/list_processors.php | 54 +++++++++++++++++++++++ 3 files changed, 63 insertions(+), 18 deletions(-) create mode 100644 templates/Inbox/list_processors.php diff --git a/src/Controller/Component/ACLComponent.php b/src/Controller/Component/ACLComponent.php index eec94ce..55c2161 100644 --- a/src/Controller/Component/ACLComponent.php +++ b/src/Controller/Component/ACLComponent.php @@ -662,6 +662,11 @@ class ACLComponent extends Component 'actions' => ['delete', 'edit', 'view'], 'skipTopMenu' => 1, 'popup' => 1 + ], + 'listProcessors' => [ + 'url' => '/inbox/listProcessors', + 'label' => __('List Request Processors'), + 'skipTopMenu' => 1 ] ] ], diff --git a/src/Controller/InboxController.php b/src/Controller/InboxController.php index 6c0f978..8997529 100644 --- a/src/Controller/InboxController.php +++ b/src/Controller/InboxController.php @@ -105,27 +105,13 @@ class InboxController extends AppController $data[] = [ 'enabled' => $processor->enabled, 'scope' => $scope, - 'action' => $processor->action + 'action' => $processor->action, + 'description' => isset($processor->getDescription) ? $processor->getDescription() : null, + 'notice' => $processor->notice ?? null, + 'error' => $processor->error ?? null, ]; } } - $this->set('title', 'Available request processors'); - $this->set('fields', [ - [ - 'name' => 'Enabled', - 'data_path' => 'enabled', - 'element' => 'boolean' - ], - [ - 'name' => 'Processor scope', - 'data_path' => 'scope', - ], - [ - 'name' => 'Processor action', - 'data_path' => 'action', - ] - ]); $this->set('data', $data); - $this->render('/genericTemplates/index_simple'); } } diff --git a/templates/Inbox/list_processors.php b/templates/Inbox/list_processors.php new file mode 100644 index 0000000..fd93199 --- /dev/null +++ b/templates/Inbox/list_processors.php @@ -0,0 +1,54 @@ +element('genericElements/IndexTable/index_table', [ + 'data' => [ + 'skip_pagination' => true, + 'data' => $data, + 'top_bar' => [ + 'children' => [ + [ + 'type' => 'context_filters', + 'context_filters' => !empty($filteringContexts) ? $filteringContexts : [] + ], + [ + 'type' => 'search', + 'button' => __('Filter'), + 'placeholder' => __('Enter value to search'), + 'data' => '', + 'searchKey' => 'value', + 'allowFilering' => true + ] + ] + ], + 'fields' => [ + [ + 'name' => __('Enabled'), + 'data_path' => 'enabled', + 'element' => 'boolean' + ], + [ + 'name' => __('Processor scope'), + 'data_path' => 'scope', + ], + [ + 'name' => __('Processor action'), + 'data_path' => 'action', + ], + [ + 'name' => __('Description'), + 'data_path' => 'description', + ], + [ + 'name' => __('Notice'), + 'data_path' => 'notice', + ], + [ + 'name' => __('Error'), + 'data_path' => 'error', + ], + ], + 'title' => __('Available Inbox Request Processors'), + 'description' => __('The list of Inbox Request Processors available on this server.'), + 'actions' => [ + ] + ] +]); \ No newline at end of file