From 3f519842ba37a88c931b53ce270192c3ebc7747a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20M=C3=BCller?= Date: Thu, 19 Jan 2023 11:24:56 +0100 Subject: [PATCH 1/3] MAG2-272 - Changed default sorting to created_at --- view/adminhtml/ui_component/payone_orders_grid.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/view/adminhtml/ui_component/payone_orders_grid.xml b/view/adminhtml/ui_component/payone_orders_grid.xml index f026ce26..898520b5 100644 --- a/view/adminhtml/ui_component/payone_orders_grid.xml +++ b/view/adminhtml/ui_component/payone_orders_grid.xml @@ -259,7 +259,6 @@ text - desc ID @@ -334,6 +333,7 @@ + desc dateRange Magento_Ui/js/grid/columns/date date From 9bfa748dde05376c259310b0ee587100584e3fe2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20M=C3=BCller?= Date: Wed, 19 Apr 2023 18:32:50 +0200 Subject: [PATCH 2/3] MAG2-272 - Fixed list sort bug --- view/adminhtml/requirejs-config.js | 10 +- .../ui_component/payone_orders_grid.xml | 569 +++++++----------- .../web/js/grid/data-storage-mixin.js | 46 -- 3 files changed, 213 insertions(+), 412 deletions(-) delete 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 1e215584..5f11f2de 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: { - 'Magento_Ui/js/grid/data-storage': { - 'Payone_Core/js/grid/data-storage-mixin': true - } - } + mixins: {} } }; + +*/ diff --git a/view/adminhtml/ui_component/payone_orders_grid.xml b/view/adminhtml/ui_component/payone_orders_grid.xml index 898520b5..5c9bc5a1 100644 --- a/view/adminhtml/ui_component/payone_orders_grid.xml +++ b/view/adminhtml/ui_component/payone_orders_grid.xml @@ -28,436 +28,283 @@ payone_orders_grid.sales_order_grid_data_source - payone_orders_grid.sales_order_grid_data_source - - sales_order_columns - - - add - Create New Order - primary - sales/order_create/start - - - - Magento\Framework\View\Element\UiComponent\DataProvider\DataProvider - sales_order_grid_data_source - entity_id - id - - - - - - - - - Magento_Ui/js/grid/provider - - + + + + + sales_order_columns + + payone_orders_grid.sales_order_grid_data_source + + + + + + + Magento_Sales::sales_order + + + id + main_table.entity_id + + - - - - ui/grid/toolbar - - - - - - - payone_orders_grid - - - - - - - - - payone_orders_grid.sales_order_grid.sales_order_columns - - Magento_Ui/js/grid/controls/columns - dataGridActions - - - - - - - payone_orders_grid.sales_order_grid.sales_order_columns.ids - - - - - - - payone_orders_grid.sales_order_grid_data_source - payone_orders_grid.sales_order_grid.listing_top.listing_filters_chips - - payone_orders_grid.sales_order_grid.listing_top.bookmarks - current.search - - - - + + + true + + + + + - - - payone_orders_grid.sales_order_grid.sales_order_columns - - payone_orders_grid.sales_order_grid.listing_top.bookmarks - current.filters - - - payone_orders_grid.sales_order_grid.listing_top.listing_filters - - payone_orders_grid.sales_order_grid.sales_order_columns.${ $.index }:visible - - - - - - - Magento\Store\Ui\Component\Listing\Column\Store\Options - - - - All Store Views - store_id - Purchase Point - - + + + + All Store Views + + store_id + + ns = ${ $.ns }, index = ${ $.index }:visible + + - - - - payone_orders_grid.sales_order_grid.sales_order_columns.ids - entity_id - - + - - - cancel - Cancel - - - + + + cancel + + - - - hold_order - Hold - - - + + + hold_order + + - - - unhold_order - Unhold - - - + + + unhold_order + + - - - pdfinvoices_order - Print Invoices - - - + + + pdfinvoices_order + + - - - pdfshipments_order - Print Packing Slips - - - + + + pdfshipments_order + + - - - pdfcreditmemos_order - Print Credit Memos - - - + + + pdfcreditmemos_order + + - - - pdfdocs_order - Print All - - - + + + pdfdocs_order + + - - - print_shipping_label - Print Shipping Labels - - - + + + print_shipping_label + + - - - - - payone_orders_grid.sales_order_grid.listing_top.bookmarks - current.paging - - payone_orders_grid.sales_order_grid.sales_order_columns.ids - - - - + + - - - - payone_orders_grid.sales_order_grid.listing_top.bookmarks - current - - - - payone_orders_grid.sales_order_grid.sales_order_columns.actions - applyAction - - view - ${ $.$data.rowIndex } - + + + + payone_orders_grid.sales_order_grid.sales_order_columns.actions + applyAction + + view + ${ $.$data.rowIndex } - - payone_orders_grid.sales_order_grid.listing_top.bookmarks - columns.${ $.index } - current.${ $.storageConfig.root} - - - - + + + - - - entity_id - - + + entity_id + - - - text - ID - - + + text + + - - - text - Txid - - + + text + + - - - text - Refnr - - + + text + + - - - text - Auth-mode - - + + text + + - - - text - PAYONE Status - - + + text + + - - - Magento\Sales\Ui\Component\Listing\Column\Status\Options - - select - Magento_Ui/js/grid/columns/select - select - Status - - + + + select + + select + + - - - text - Bill-to Name - - + + text + + - - - text - Ship-to Name - - + + text + + - - - textRange - Grand Total (Purchased) - - + + textRange + + - - - - desc - dateRange - Magento_Ui/js/grid/columns/date - date - Purchase Date - - - - - - Magento\Sales\Ui\Component\Listing\Column\Status\Options - - select - Magento_Ui/js/grid/columns/select - select - Status - - + + + dateRange + date + + desc + - - - text - ui/grid/cells/html - false - Billing Address - - + + text + + ui/grid/cells/html + false + - - - text - ui/grid/cells/html - false - Shipping Address - - + + text + + ui/grid/cells/html + false + - - - text - false - Shipping Information - - + + text + + false + - - - text - false - Customer Email - - + + text + + false + - - - Magento\Customer\Ui\Component\Listing\Column\Group\Options - - select - Magento_Ui/js/grid/columns/select - false - select - Customer Group - - + + + select + + select + + false + - - - textRange - false - Subtotal - - + + textRange + + false + - - - textRange - false - Shipping and Handling - - + + textRange + + false + - - - text - false - Customer Name - - + + text + + false + - - - Magento\Payment\Ui\Component\Listing\Column\Method\Options - - select - Magento_Ui/js/grid/columns/select - false - select - Payment Method - - + + + select + + select + + false + - - - - textRange - false - Total Refunded - - + + + textRange + + false + - entity_id sales/order/view order_id + + entity_id + diff --git a/view/adminhtml/web/js/grid/data-storage-mixin.js b/view/adminhtml/web/js/grid/data-storage-mixin.js deleted file mode 100644 index fdc92366..00000000 --- a/view/adminhtml/web/js/grid/data-storage-mixin.js +++ /dev/null @@ -1,46 +0,0 @@ -/** - * 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") !== -1) { - this.indexField = "id"; - } - - return this; - } - }; - - return function (dataStorage) { - return dataStorage.extend(mixin); - }; -}); 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 3/3] 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); + }; +});