Skip to content

Commit

Permalink
AdminUi - add Settings Inspector listing
Browse files Browse the repository at this point in the history
  • Loading branch information
ufundo committed Dec 11, 2024
1 parent 4844f11 commit 5d4432f
Show file tree
Hide file tree
Showing 3 changed files with 153 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ext/civicrm_admin_ui/ang/afsearchSettingsInspector.aff.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<div af-fieldset="">
<af-field name="title" />
<af-field name="group_name" />
<af-field name="is_env_loadable" />
<af-field name="current_layer" defn="{input_attrs: {multiple: true}}" />
<crm-search-display-table search-name="Settings_Inspector" display-name="Settings_Inspector"></crm-search-display-table>
</div>
16 changes: 16 additions & 0 deletions ext/civicrm_admin_ui/ang/afsearchSettingsInspector.aff.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php
use CRM_CivicrmAdminUi_ExtensionUtil as E;

return [
'type' => 'search',
'title' => E::ts('Settings Inspector'),
'description' => E::ts('Allows inspecting settings on the CiviCRM site'),
'icon' => 'fa-list-alt',
'server_route' => 'civicrm/admin/settings-inspector',
'permission' => [
'administer CiviCRM system',
],
'search_displays' => [
'Settings_Inspector.Settings_Inspector',
],
];
130 changes: 130 additions & 0 deletions ext/civicrm_admin_ui/managed/SavedSearch_Settings_Inspector.mgd.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
<?php
use CRM_CivicrmAdminUi_ExtensionUtil as E;

return [
[
'name' => 'SavedSearch_Settings_Inspector',
'entity' => 'SavedSearch',
'cleanup' => 'unused',
'update' => 'unmodified',
'params' => [
'version' => 4,
'values' => [
'name' => 'Settings_Inspector',
'label' => E::ts('Settings Inspector'),
'api_entity' => 'SettingsMeta',
'api_params' => [
'version' => 4,
'select' => [
'title',
'name',
'description',
'group_name',
'is_constant',
'is_env_loadable',
'global_name',
'current_value',
'current_layer:label',
],
'orderBy' => [],
'where' => [],
],
],
'match' => ['name'],
],
],
[
'name' => 'SavedSearch_Settings_Inspector_SearchDisplay_Settings_Inspector',
'entity' => 'SearchDisplay',
'cleanup' => 'unused',
'update' => 'unmodified',
'params' => [
'version' => 4,
'values' => [
'name' => 'Settings_Inspector',
'label' => E::ts('Settings Inspector'),
'saved_search_id.name' => 'Settings_Inspector',
'type' => 'table',
'settings' => [
'description' => E::ts(NULL),
'sort' => [],
'limit' => 50,
'pager' => [],
'placeholder' => 5,
'columns' => [
[
'type' => 'field',
'key' => 'group_name',
'dataType' => 'String',
'label' => E::ts('Group'),
'sortable' => TRUE,
],
[
'type' => 'field',
'key' => 'title',
'dataType' => 'String',
'label' => E::ts('Setting'),
'sortable' => TRUE,
],
[
'type' => 'field',
'key' => 'name',
'dataType' => 'String',
'label' => E::ts('Machine-name'),
'sortable' => TRUE,
],
[
'type' => 'field',
'key' => 'description',
'dataType' => 'String',
'label' => E::ts('Description'),
'sortable' => TRUE,
],
[
'type' => 'field',
'key' => 'is_constant',
'dataType' => 'Boolean',
'label' => E::ts('PHP Constant?'),
'sortable' => TRUE,
],
[
'type' => 'field',
'key' => 'is_env_loadable',
'dataType' => 'Boolean',
'label' => E::ts('Environment Variable?'),
'sortable' => TRUE,
],
[
'type' => 'field',
'key' => 'global_name',
'dataType' => 'String',
'label' => E::ts('Global Name'),
'sortable' => TRUE,
],
[
'type' => 'field',
'key' => 'current_layer:label',
'dataType' => 'String',
'label' => E::ts('Current layer'),
'sortable' => TRUE,
],
[
'type' => 'field',
'key' => 'current_value',
'dataType' => 'String',
'label' => E::ts('Current value'),
'sortable' => TRUE,
],
],
'actions' => TRUE,
'classes' => ['table', 'table-striped'],
'actions_display_mode' => 'menu',
],
],
'match' => [
'saved_search_id',
'name',
],
],
],
];

0 comments on commit 5d4432f

Please sign in to comment.