From b3308aef3e070ddd3ba52981b78f512a0a2ddd6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20M=C3=BCller?= Date: Thu, 20 Apr 2023 17:26:40 +0200 Subject: [PATCH] MA2-272 - Fixed sorting of API and TransactionStatus logs --- view/adminhtml/requirejs-config.js | 10 +- .../ui_component/payone_orders_grid.xml | 1 - .../ui_component/payone_protocol_api_grid.xml | 231 +++++---------- ...payone_protocol_transactionstatus_grid.xml | 275 ++++++------------ .../web/js/grid/data-storage-mixin.js | 46 +++ 5 files changed, 224 insertions(+), 339 deletions(-) create mode 100644 view/adminhtml/web/js/grid/data-storage-mixin.js diff --git a/view/adminhtml/requirejs-config.js b/view/adminhtml/requirejs-config.js index 5f11f2de..1e215584 100644 --- a/view/adminhtml/requirejs-config.js +++ b/view/adminhtml/requirejs-config.js @@ -24,12 +24,12 @@ /*jshint browser:true jquery:true*/ /*global alert*/ -/* deactivated for now since no mixins are needed at the moment, file stays for potential future use - var config = { config: { - mixins: {} + mixins: { + 'Magento_Ui/js/grid/data-storage': { + 'Payone_Core/js/grid/data-storage-mixin': true + } + } } }; - -*/ diff --git a/view/adminhtml/ui_component/payone_orders_grid.xml b/view/adminhtml/ui_component/payone_orders_grid.xml index 5c9bc5a1..18fe655d 100644 --- a/view/adminhtml/ui_component/payone_orders_grid.xml +++ b/view/adminhtml/ui_component/payone_orders_grid.xml @@ -63,7 +63,6 @@ - diff --git a/view/adminhtml/ui_component/payone_protocol_api_grid.xml b/view/adminhtml/ui_component/payone_protocol_api_grid.xml index 55c72880..5411fe78 100644 --- a/view/adminhtml/ui_component/payone_protocol_api_grid.xml +++ b/view/adminhtml/ui_component/payone_protocol_api_grid.xml @@ -28,180 +28,103 @@ payone_protocol_api_grid.payone_protocol_api_grid_data_source - payone_protocol_api_grid.payone_protocol_api_grid_data_source - payone_protocol_api_columns - - - Magento\Framework\View\Element\UiComponent\DataProvider\DataProvider - payone_protocol_api_grid_data_source - id - id - - - - - - - - - Magento_Ui/js/grid/provider - - + + payone_protocol_api_columns + + payone_protocol_api_grid.payone_protocol_api_grid_data_source + + + + + + + Payone_Core::payone_protocol_api + + + id + main_table.id + + - - - - ui/grid/toolbar - - - - - - - payone_protocol_api_grid - - - - - - - - - payone_protocol_api_grid.payone_protocol_api_grid.payone_protocol_api_columns - - Magento_Ui/js/grid/controls/columns - dataGridActions - - - + + + true + + + - - - payone_protocol_api_grid.payone_protocol_api_grid.payone_protocol_api_columns - - payone_protocol_api_grid.payone_protocol_api_grid.listing_top.bookmarks - current.filters - - - payone_protocol_api_grid.payone_protocol_api_grid.listing_top.listing_filters - - payone_protocol_api_grid.payone_protocol_api_grid.payone_protocol_api_columns.${ $.index }:visible - - - - - - - Magento\Store\Ui\Component\Listing\Column\Store\Options - - - - All Store Views - store_id - Store-ID - - + + + + All Store Views + + store_id + + ns = ${ $.ns }, index = ${ $.index }:visible + + - - - - - payone_protocol_api_grid.payone_protocol_api_grid.listing_top.bookmarks - current.paging - - payone_protocol_api_grid.payone_protocol_api_grid.payone_protocol_api_columns.ids - - - - + + - - - - payone_protocol_api_grid.payone_protocol_api_grid.listing_top.bookmarks - current - - - - payone_protocol_api_grid.payone_protocol_api_grid.payone_protocol_api_columns.actions - applyAction - - view - ${ $.$data.rowIndex } - - - - payone_protocol_api_grid.payone_protocol_api_grid.listing_top.bookmarks - columns.${ $.index } - current.${ $.storageConfig.root} + + + + payone_protocol_api_grid.payone_protocol_api_grid.payone_protocol_api_columns.actions + applyAction + + view + ${ $.$data.rowIndex } - - - + + + - - - id - desc - ID - - + + id + desc + + - - - text - asc - OrderId - - + + text + + - - - text - Txid - - + + text + + - - - text - RefNr - - + + text + + - - - text - asc - Request - - + + text + + - - - text - asc - Response - - + + text + + - - - - dateRange - Magento_Ui/js/grid/columns/date - date - Create Date - - + + + dateRange + date + + diff --git a/view/adminhtml/ui_component/payone_protocol_transactionstatus_grid.xml b/view/adminhtml/ui_component/payone_protocol_transactionstatus_grid.xml index 511a8db5..57032b88 100644 --- a/view/adminhtml/ui_component/payone_protocol_transactionstatus_grid.xml +++ b/view/adminhtml/ui_component/payone_protocol_transactionstatus_grid.xml @@ -28,211 +28,128 @@ payone_protocol_transactionstatus_grid.payone_protocol_transactionstatus_grid_data_source - payone_protocol_transactionstatus_grid.payone_protocol_transactionstatus_grid_data_source - payone_protocol_api_columns - - - Magento\Framework\View\Element\UiComponent\DataProvider\DataProvider - payone_protocol_transactionstatus_grid_data_source - id - id - - - - - - - - - Magento_Ui/js/grid/provider - - + + payone_protocol_transactionstatus_columns + + payone_protocol_transactionstatus_grid.payone_protocol_transactionstatus_grid_data_source + + + + + + + Payone_Core::payone_protocol_transactionstatus + + + id + main_table.id + + - - - - ui/grid/toolbar - - - - - - - payone_protocol_transactionstatus_grid - - - - - - - - - payone_protocol_transactionstatus_grid.payone_protocol_transactionstatus_grid.payone_protocol_api_columns - - Magento_Ui/js/grid/controls/columns - dataGridActions - - - + + + true + + + - - - payone_protocol_transactionstatus_grid.payone_protocol_transactionstatus_grid.payone_protocol_api_columns - - payone_protocol_transactionstatus_grid.payone_protocol_transactionstatus_grid.listing_top.bookmarks - current.filters - - - payone_protocol_transactionstatus_grid.payone_protocol_transactionstatus_grid.listing_top.listing_filters - - payone_protocol_transactionstatus_grid.payone_protocol_transactionstatus_grid.payone_protocol_api_columns.${ $.index }:visible - - - - - - - Magento\Store\Ui\Component\Listing\Column\Store\Options - - - - All Store Views - store_id - Store-ID - - + + + + All Store Views + + store_id + + ns = ${ $.ns }, index = ${ $.index }:visible + + - - - - - payone_protocol_transactionstatus_grid.payone_protocol_transactionstatus_grid.listing_top.bookmarks - current.paging - - payone_protocol_transactionstatus_grid.payone_protocol_transactionstatus_grid.payone_protocol_api_columns.ids - - - - - - - - - payone_protocol_transactionstatus_grid.payone_protocol_transactionstatus_grid.listing_top.bookmarks - current - - - - payone_protocol_transactionstatus_grid.payone_protocol_transactionstatus_grid.payone_protocol_api_columns.actions - applyAction - - view - ${ $.$data.rowIndex } - - - - payone_protocol_transactionstatus_grid.payone_protocol_transactionstatus_grid.listing_top.bookmarks - columns.${ $.index } - current.${ $.storageConfig.root} + + + + + + + payone_protocol_transactionstatus_grid.payone_protocol_transactionstatus_grid.payone_protocol_transactionstatus_columns.actions + applyAction + + view + ${ $.$data.rowIndex } - - - + + + - - - id - desc - ID - - + + id + desc + + - - - text - Txid - - + + text + + - - - text - Reference - - + + text + + - - - text - Last Txaction - - + + text + + - - - - dateRange - Magento_Ui/js/grid/columns/date - date - TxTime - - + + + dateRange + date + + - - - text - Sequencenumber - - + + text + + - - - text - Clearingtype - - + + text + + - - - textRange - Receivable - - + + textRange + + - - - textRange - Balance - - + + textRange + + - - - textRange - Price - - + + textRange + + - - - - dateRange - Magento_Ui/js/grid/columns/date - date - Created At - - + + + dateRange + date + + diff --git a/view/adminhtml/web/js/grid/data-storage-mixin.js b/view/adminhtml/web/js/grid/data-storage-mixin.js new file mode 100644 index 00000000..318d2caf --- /dev/null +++ b/view/adminhtml/web/js/grid/data-storage-mixin.js @@ -0,0 +1,46 @@ +/** + * PAYONE Magento 2 Connector is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * PAYONE Magento 2 Connector is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with PAYONE Magento 2 Connector. If not, see . + * + * PHP version 5 + * + * @category Payone + * @package Payone_Magento2_Plugin + * @author FATCHIP GmbH + * @copyright 2003 - 2019 Payone GmbH + * @license GNU Lesser General Public License + * @link http://www.payone.de + */ +/*jshint browser:true jquery:true*/ +/*global alert*/ +define([ + 'jquery' +], function ($) { + 'use strict'; + + var mixin = { + initConfig: function () { + this._super(); + + if (this.name.indexOf("payone_protocol") !== -1) { + this.indexField = "id"; + } + + return this; + } + }; + + return function (dataStorage) { + return dataStorage.extend(mixin); + }; +});