Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unified admin grid columns and added XML configuration #4225

Merged
merged 37 commits into from
Oct 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
d1c3310
Fixes price filter
sreichel Sep 24, 2024
a32bd09
Fixes price filter (test)
sreichel Sep 24, 2024
a34da5e
copyright
sreichel Sep 24, 2024
581112e
Merge branch 'main' into fix-3158
sreichel Sep 24, 2024
aec4625
Unified grid columns
sreichel Sep 29, 2024
7af7c75
Increased width
sreichel Sep 29, 2024
7192dff
Merge branch 'main' into fix-3158
sreichel Oct 2, 2024
344739d
Unified "edit" column
sreichel Oct 2, 2024
b8de9ca
Unified "action" column
sreichel Oct 5, 2024
e66eb89
Unified "store" column
sreichel Oct 5, 2024
eaf2813
Use config from XML
sreichel Oct 5, 2024
5d8ae13
Added test
sreichel Oct 5, 2024
266b056
phpcs
sreichel Oct 5, 2024
6558b76
Update tests/unit/Mage/Adminhtml/Block/Widget/GridTest.php
sreichel Oct 5, 2024
7bf93be
typo
sreichel Oct 5, 2024
236d0b0
Merge remote-tracking branch 'origin/fix-3158' into fix-3158
sreichel Oct 5, 2024
db77a96
Unified "currency" column
sreichel Oct 5, 2024
a39da55
Unified "price" column
sreichel Oct 5, 2024
6a75fcc
Unified "currency" column
sreichel Oct 6, 2024
e48869f
Unified "currency" column
sreichel Oct 6, 2024
4583401
Unified "number" column
sreichel Oct 6, 2024
702c0f6
updated copyright dates
sreichel Oct 6, 2024
575543f
cleanup
sreichel Oct 6, 2024
eed5634
Removed "from" "to" label to safe space
sreichel Oct 6, 2024
3bab8f9
Typo [skip ci]
sreichel Oct 6, 2024
53789e3
Re-added "from" "to" label to legacy theme
sreichel Oct 6, 2024
1207046
Flush cache once if an old config is cached
sreichel Oct 6, 2024
c86e9a4
Merge branch 'main' into fix-3158
sreichel Oct 8, 2024
b264207
Hide placeholder in legacy theme
sreichel Oct 9, 2024
fb054da
Merge remote-tracking branch 'origin/fix-3158' into fix-3158
sreichel Oct 9, 2024
2400657
Update app/code/core/Mage/Oauth/Block/Adminhtml/Oauth/Consumer/Grid.php
sreichel Oct 9, 2024
883a702
Merge branch 'main' into fix-3158
sreichel Oct 14, 2024
60e5e4c
Merge branch 'main' into fix-3158
sreichel Oct 14, 2024
c9e9bc2
Merge branch 'main' into fix-3158
sreichel Oct 15, 2024
ba3349f
Merge branch 'main' into fix-3158
sreichel Oct 15, 2024
ff3f17f
Update app/code/core/Mage/Adminhtml/Block/Widget/Grid.php
sreichel Oct 16, 2024
7ba4a3a
Merge branch 'main' into fix-3158
sreichel Oct 18, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions .phpstan.dist.baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -570,11 +570,6 @@ parameters:
count: 1
path: app/code/core/Mage/Adminhtml/Block/Widget/Form.php

-
message: "#^Property Mage_Adminhtml_Block_Widget_Grid\\:\\:\\$defaultColumnSettings \\(array\\<array\\<array\\>\\>\\) does not accept default value of type array\\<string, array\\<string, int\\>\\>\\.$#"
count: 1
path: app/code/core/Mage/Adminhtml/Block/Widget/Grid.php

-
message: "#^Parameter \\#1 \\$emptyLabel of method Mage_Directory_Model_Resource_Country_Collection\\:\\:toOptionArray\\(\\) expects string, false given\\.$#"
count: 1
Expand Down Expand Up @@ -3435,11 +3430,6 @@ parameters:
count: 1
path: app/code/core/Mage/Core/Model/Cache.php

-
message: "#^Method Mage_Core_Model_Config\\:\\:getNode\\(\\) should return Mage_Core_Model_Config_Element but returns Varien_Simplexml_Element\\|false\\.$#"
count: 1
path: app/code/core/Mage/Core/Model/Config.php

-
message: "#^Parameter \\#1 \\$options of method Mage_Core_Model_Config\\:\\:reinit\\(\\) expects array, Mage_Core_Model_Config_Options given\\.$#"
count: 1
Expand Down
1 change: 0 additions & 1 deletion app/code/core/Mage/Adminhtml/Block/Api/Role/Grid/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ protected function _prepareColumns()
'header' => Mage::helper('adminhtml')->__('User ID'),
'width' => 5,
'align' => 'left',
'sortable' => true,
'index' => 'user_id'
]);

Expand Down
3 changes: 1 addition & 2 deletions app/code/core/Mage/Adminhtml/Block/Api/User/Grid.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* @category Mage
* @package Mage_Adminhtml
* @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com)
* @copyright Copyright (c) 2022-2023 The OpenMage Contributors (https://www.openmage.org)
* @copyright Copyright (c) 2022-2024 The OpenMage Contributors (https://www.openmage.org)
* @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/

Expand Down Expand Up @@ -43,7 +43,6 @@ protected function _prepareColumns()
'header' => Mage::helper('adminhtml')->__('ID'),
'width' => 5,
'align' => 'right',
'sortable' => true,
'index' => 'user_id'
]);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,6 @@ protected function _prepareColumns()

$this->addColumn('entity_id', [
'header' => Mage::helper('catalog')->__('ID'),
'sortable' => true,
'width' => '60',
'index' => 'entity_id'
]);

Expand Down Expand Up @@ -171,10 +169,8 @@ protected function _prepareColumns()
]);

$this->addColumn('price', [
'header' => Mage::helper('catalog')->__('Price'),
'type' => 'currency',
'currency_code' => (string) Mage::getStoreConfig(Mage_Directory_Model_Currency::XML_PATH_CURRENCY_BASE),
'index' => 'price'
'type' => 'currency',
'currency_code' => Mage_Directory_Helper_Data::getConfigCurrencyBase(),
]);

$this->addColumn('position', [
Expand All @@ -186,8 +182,6 @@ protected function _prepareColumns()
]);

$this->addColumn('action', [
'header' => Mage::helper('catalog')->__('Action'),
'width' => '50px',
'type' => 'action',
'getter' => 'getId',
'actions' => [
Expand All @@ -205,8 +199,6 @@ protected function _prepareColumns()
],
],
],
'filter' => false,
'sortable' => false,
'index' => 'stores',
]);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* @category Mage
* @package Mage_Adminhtml
* @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com)
* @copyright Copyright (c) 2019-2023 The OpenMage Contributors (https://www.openmage.org)
* @copyright Copyright (c) 2019-2024 The OpenMage Contributors (https://www.openmage.org)
* @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/

Expand Down Expand Up @@ -46,7 +46,6 @@ protected function _prepareColumns()

$this->addColumnAfter('is_visible', [
'header' => Mage::helper('catalog')->__('Visible'),
'sortable' => true,
'index' => 'is_visible_on_front',
'type' => 'options',
'options' => [
Expand All @@ -58,7 +57,6 @@ protected function _prepareColumns()

$this->addColumnAfter('is_global', [
'header' => Mage::helper('catalog')->__('Scope'),
'sortable' => true,
'index' => 'is_global',
'type' => 'options',
'options' => [
Expand All @@ -71,7 +69,6 @@ protected function _prepareColumns()

$this->addColumnAfter('is_searchable', [
'header' => Mage::helper('catalog')->__('Searchable'),
'sortable' => true,
'index' => 'is_searchable',
'type' => 'options',
'options' => [
Expand All @@ -83,7 +80,6 @@ protected function _prepareColumns()

$this->addColumnAfter('is_filterable', [
'header' => Mage::helper('catalog')->__('Use in Layered Navigation'),
'sortable' => true,
'index' => 'is_filterable',
'type' => 'options',
'options' => [
Expand All @@ -96,7 +92,6 @@ protected function _prepareColumns()

$this->addColumnAfter('is_comparable', [
'header' => Mage::helper('catalog')->__('Comparable'),
'sortable' => true,
'index' => 'is_comparable',
'type' => 'options',
'options' => [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* @category Mage
* @package Mage_Adminhtml
* @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com)
* @copyright Copyright (c) 2022-2023 The OpenMage Contributors (https://www.openmage.org)
* @copyright Copyright (c) 2022-2024 The OpenMage Contributors (https://www.openmage.org)
* @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/

Expand Down Expand Up @@ -49,7 +49,6 @@ protected function _prepareColumns()
$this->addColumn('set_name', [
'header' => Mage::helper('catalog')->__('Set Name'),
'align' => 'left',
'sortable' => true,
'index' => 'attribute_set_name',
]);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* @category Mage
* @package Mage_Adminhtml
* @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com)
* @copyright Copyright (c) 2022-2023 The OpenMage Contributors (https://www.openmage.org)
* @copyright Copyright (c) 2022-2024 The OpenMage Contributors (https://www.openmage.org)
* @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/

Expand Down Expand Up @@ -72,11 +72,9 @@ protected function _prepareColumns()
]);

$this->addColumn('price', [
'header' => Mage::helper('catalog')->__('Price'),
'index' => 'price',
'type' => 'currency',
'currency_code'
=> Mage::getStoreConfig(Mage_Directory_Model_Currency::XML_PATH_CURRENCY_BASE)
=> Mage_Directory_Helper_Data::getConfigCurrencyBase(),
]);

$this->addColumn('add_date', [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* @category Mage
* @package Mage_Adminhtml
* @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com)
* @copyright Copyright (c) 2019-2023 The OpenMage Contributors (https://www.openmage.org)
* @copyright Copyright (c) 2019-2024 The OpenMage Contributors (https://www.openmage.org)
* @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/

Expand Down Expand Up @@ -128,8 +128,6 @@ protected function _prepareColumns()

$this->addColumn('entity_id', [
'header' => Mage::helper('catalog')->__('ID'),
'sortable' => true,
'width' => 60,
'index' => 'entity_id'
]);

Expand Down Expand Up @@ -182,10 +180,8 @@ protected function _prepareColumns()
]);

$this->addColumn('price', [
'header' => Mage::helper('catalog')->__('Price'),
'type' => 'currency',
'currency_code' => (string) Mage::getStoreConfig(Mage_Directory_Model_Currency::XML_PATH_CURRENCY_BASE),
'index' => 'price'
'currency_code' => Mage_Directory_Helper_Data::getConfigCurrencyBase(),
]);

$this->addColumn('position', [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* @category Mage
* @package Mage_Adminhtml
* @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com)
* @copyright Copyright (c) 2019-2023 The OpenMage Contributors (https://www.openmage.org)
* @copyright Copyright (c) 2019-2024 The OpenMage Contributors (https://www.openmage.org)
* @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/

Expand Down Expand Up @@ -130,8 +130,6 @@ protected function _prepareColumns()

$this->addColumn('entity_id', [
'header' => Mage::helper('catalog')->__('ID'),
'sortable' => true,
'width' => 60,
'index' => 'entity_id'
]);

Expand Down Expand Up @@ -184,10 +182,8 @@ protected function _prepareColumns()
]);

$this->addColumn('price', [
'header' => Mage::helper('catalog')->__('Price'),
'type' => 'currency',
'currency_code' => (string) Mage::getStoreConfig(Mage_Directory_Model_Currency::XML_PATH_CURRENCY_BASE),
'index' => 'price'
'currency_code' => Mage_Directory_Helper_Data::getConfigCurrencyBase(),
]);

$this->addColumn('position', [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,6 @@ protected function _prepareColumns()

$this->addColumn('entity_id', [
'header' => Mage::helper('catalog')->__('ID'),
'sortable' => true,
'width' => '60px',
'index' => 'entity_id'
]);
$this->addColumn('name', [
Expand Down Expand Up @@ -230,10 +228,8 @@ protected function _prepareColumns()
]);

$this->addColumn('price', [
'header' => Mage::helper('catalog')->__('Price'),
'type' => 'currency',
'currency_code' => (string) Mage::getStoreConfig(Mage_Directory_Model_Currency::XML_PATH_CURRENCY_BASE),
'index' => 'price'
'currency_code' => Mage_Directory_Helper_Data::getConfigCurrencyBase(),
]);

$this->addColumn('is_saleable', [
Expand All @@ -257,7 +253,6 @@ protected function _prepareColumns()
$this->addColumn(
'action',
[
'header' => Mage::helper('catalog')->__('Action'),
'type' => 'action',
'getter' => 'getId',
'actions' => [
Expand All @@ -268,8 +263,6 @@ protected function _prepareColumns()
'onclick' => 'superProduct.createPopup(this.href);return false;'
]
],
'filter' => false,
'sortable' => false
]
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,6 @@ protected function _prepareColumns()

$this->addColumn('entity_id', [
'header' => Mage::helper('catalog')->__('ID'),
'sortable' => true,
'width' => '60px',
'index' => 'entity_id'
]);
$this->addColumn('name', [
Expand All @@ -145,10 +143,8 @@ protected function _prepareColumns()
'index' => 'sku'
]);
$this->addColumn('price', [
'header' => Mage::helper('catalog')->__('Price'),
'type' => 'currency',
'currency_code' => (string) Mage::getStoreConfig(Mage_Directory_Model_Currency::XML_PATH_CURRENCY_BASE),
'index' => 'price'
'currency_code' => Mage_Directory_Helper_Data::getConfigCurrencyBase(),
]);

$this->addColumn('qty', [
Expand All @@ -157,7 +153,6 @@ protected function _prepareColumns()
'type' => 'number',
'validate_class' => 'validate-number',
'index' => 'qty',
'width' => '1',
'editable' => true,
'filter_condition_callback' => [$this, '_addLinkModelFilterCallback']
]);
Expand All @@ -175,8 +170,6 @@ protected function _prepareColumns()
]);

$this->addColumn('action', [
'header' => Mage::helper('catalog')->__('Action'),
'width' => '50px',
'type' => 'action',
'getter' => 'getId',
'actions' => [
Expand All @@ -194,8 +187,6 @@ protected function _prepareColumns()
],
],
],
'filter' => false,
'sortable' => false,
'index' => 'stores',
]);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* @category Mage
* @package Mage_Adminhtml
* @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com)
* @copyright Copyright (c) 2022-2023 The OpenMage Contributors (https://www.openmage.org)
* @copyright Copyright (c) 2022-2024 The OpenMage Contributors (https://www.openmage.org)
* @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/

Expand Down Expand Up @@ -56,7 +56,6 @@ protected function _prepareColumns()
$this->addColumn('popularity', [
'header' => Mage::helper('catalog')->__('# of Use'),
'width' => '50px',
'align' => 'right',
'index' => 'popularity',
'type' => 'number',
]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* @category Mage
* @package Mage_Adminhtml
* @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com)
* @copyright Copyright (c) 2019-2023 The OpenMage Contributors (https://www.openmage.org)
* @copyright Copyright (c) 2019-2024 The OpenMage Contributors (https://www.openmage.org)
* @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/

Expand Down Expand Up @@ -130,8 +130,6 @@ protected function _prepareColumns()

$this->addColumn('entity_id', [
'header' => Mage::helper('catalog')->__('ID'),
'sortable' => true,
'width' => 60,
'index' => 'entity_id'
]);
$this->addColumn('name', [
Expand Down Expand Up @@ -183,10 +181,8 @@ protected function _prepareColumns()
]);

$this->addColumn('price', [
'header' => Mage::helper('catalog')->__('Price'),
'type' => 'currency',
'currency_code' => (string) Mage::getStoreConfig(Mage_Directory_Model_Currency::XML_PATH_CURRENCY_BASE),
'index' => 'price'
'currency_code' => Mage_Directory_Helper_Data::getConfigCurrencyBase(),
]);

$this->addColumn('position', [
Expand Down
Loading
Loading