From fd30e24b7f9ee3aaf2afe636562f6377b5281e0c Mon Sep 17 00:00:00 2001 From: Pradeep Nayak Date: Tue, 5 Dec 2023 14:32:46 +0000 Subject: [PATCH] Added Export Mapping search kit UI --- .../ang/afsearchImportExportMappings.aff.html | 7 + .../ang/afsearchImportExportMappings.aff.php | 13 ++ ...SavedSearch_Import_Export_Mappings.mgd.php | 149 ++++++++++++++++++ 3 files changed, 169 insertions(+) create mode 100644 ext/civicrm_admin_ui/ang/afsearchImportExportMappings.aff.html create mode 100644 ext/civicrm_admin_ui/ang/afsearchImportExportMappings.aff.php create mode 100644 ext/civicrm_admin_ui/managed/SavedSearch_Import_Export_Mappings.mgd.php diff --git a/ext/civicrm_admin_ui/ang/afsearchImportExportMappings.aff.html b/ext/civicrm_admin_ui/ang/afsearchImportExportMappings.aff.html new file mode 100644 index 0000000000..49829fcb11 --- /dev/null +++ b/ext/civicrm_admin_ui/ang/afsearchImportExportMappings.aff.html @@ -0,0 +1,7 @@ +
+
{{:: ts('Saved mappings allow you to easily run the same import or export job multiple times. Mappings are created and updated as part of an Import or Export task. This screen allows you to rename or delete existing mappings.') }}
+ +
+
+ +
diff --git a/ext/civicrm_admin_ui/ang/afsearchImportExportMappings.aff.php b/ext/civicrm_admin_ui/ang/afsearchImportExportMappings.aff.php new file mode 100644 index 0000000000..602fb02314 --- /dev/null +++ b/ext/civicrm_admin_ui/ang/afsearchImportExportMappings.aff.php @@ -0,0 +1,13 @@ + E::ts('Import/Export Mappings'), + 'permission' => [ + 'administer CiviCRM', + ], + 'type' => 'search', + 'icon' => 'fa-list-alt', + 'server_route' => 'civicrm/admin/mapping', + 'permission_operator' => 'AND', +]; diff --git a/ext/civicrm_admin_ui/managed/SavedSearch_Import_Export_Mappings.mgd.php b/ext/civicrm_admin_ui/managed/SavedSearch_Import_Export_Mappings.mgd.php new file mode 100644 index 0000000000..df915b5b7f --- /dev/null +++ b/ext/civicrm_admin_ui/managed/SavedSearch_Import_Export_Mappings.mgd.php @@ -0,0 +1,149 @@ + 'SavedSearch_Import_Export_Mappings', + 'entity' => 'SavedSearch', + 'cleanup' => 'unused', + 'update' => 'unmodified', + 'params' => [ + 'version' => 4, + 'values' => [ + 'name' => 'Import_Export_Mappings', + 'label' => E::ts('Import/Export Mappings'), + 'api_entity' => 'Mapping', + 'api_params' => [ + 'version' => 4, + 'select' => [ + 'name', + 'description', + 'mapping_type_id:label', + 'id', + ], + 'orderBy' => [], + 'where' => [ + [ + 'mapping_type_id:name', + '!=', + 'Search Builder', + ], + ], + 'groupBy' => [], + 'join' => [], + 'having' => [], + ], + ], + 'match' => [ + 'name', + ], + ], + ], + [ + 'name' => 'SavedSearch_Import_Export_Mappings_SearchDisplay_Import_Export_Mappings', + 'entity' => 'SearchDisplay', + 'cleanup' => 'unused', + 'update' => 'unmodified', + 'params' => [ + 'version' => 4, + 'values' => [ + 'name' => 'Import_Export_Mappings', + 'label' => E::ts('Import/Export Mappings'), + 'saved_search_id.name' => 'Import_Export_Mappings', + 'type' => 'table', + 'settings' => [ + 'description' => NULL, + 'sort' => [ + [ + 'mapping_type_id:label', + 'ASC', + ], + [ + 'name', + 'ASC', + ], + ], + 'limit' => 50, + 'pager' => [], + 'placeholder' => 5, + 'columns' => [ + [ + 'type' => 'field', + 'key' => 'id', + 'dataType' => 'Integer', + 'label' => E::ts('ID'), + 'sortable' => TRUE, + ], + [ + 'type' => 'field', + 'key' => 'name', + 'dataType' => 'String', + 'label' => E::ts('Name'), + 'sortable' => TRUE, + ], + [ + 'type' => 'field', + 'key' => 'mapping_type_id:label', + 'dataType' => 'Integer', + 'label' => E::ts('Mapping Type'), + 'sortable' => TRUE, + ], + [ + 'type' => 'field', + 'key' => 'description', + 'dataType' => 'String', + 'label' => E::ts('Description'), + 'sortable' => TRUE, + ], + [ + 'text' => '', + 'style' => 'default', + 'size' => 'btn-xs', + 'icon' => 'fa-bars', + 'links' => [ + [ + 'path' => 'civicrm/admin/mapping?action=update&reset=1&id=[id]', + 'icon' => 'fa-external-link', + 'text' => E::ts('Edit'), + 'style' => 'default', + 'condition' => [], + 'task' => '', + 'entity' => '', + 'action' => '', + 'join' => '', + 'target' => 'crm-popup', + ], + [ + 'task' => 'delete', + 'entity' => 'Mapping', + 'join' => '', + 'target' => 'crm-popup', + 'icon' => 'fa-trash', + 'text' => E::ts('Delete'), + 'style' => 'danger', + 'path' => '', + 'action' => '', + 'condition' => [], + ], + ], + 'type' => 'menu', + 'alignment' => 'text-right', + ], + ], + 'actions' => [ + 'delete', + 'update', + ], + 'classes' => [ + 'table', + 'table-striped', + ], + ], + ], + 'match' => [ + 'name', + 'saved_search_id', + ], + ], + ], +]; -- 2.25.1