Skip to content

Commit d93d288

Browse files
🔃 [Magento Community Engineering] Community Contributions - 2.3-develop
Accepted Community Pull Requests: - #24359: Fixed the Spacing issue in grid (by @Nagamaiah333) - #24449: Resolve Scope icon and store view specific label text alignment issue (issue24440) (by @edenduong) - #24160: tear price change with tier price (by @sunilit42) - #24451: #24441 : Minicart height calculated incorrectly when child items contain margins (by @konarshankar07) - #24399: Remove "Add Review" if System has no Product issue24310 (by @edenduong) - #24308: Resolved edit configurable product from cart doesn't show selected swatch options #24306 (by @rani-webkul) - #24318: #23990: Reset not working properly in Add review from admin (by @konarshankar07) - #24489: magento/magento2#: Fix release notification README (by @atwixfirster) Fixed GitHub Issues: - #24152: Spacing Issue with the Admin grids pages (reported by @sudheer-gajjala) has been fixed in #24359 by @Nagamaiah333 in 2.3-develop branch Related commits: 1. 785cdcd - #24440: Scope icon and store view specific label text alignment issue (reported by @bhavik43) has been fixed in #24449 by @edenduong in 2.3-develop branch Related commits: 1. 4314d4b - #23567: Tear Price? Tier Price? (reported by @dyuk1987) has been fixed in #24160 by @sunilit42 in 2.3-develop branch Related commits: 1. 1666ce8 2. 5ac00d1 3. 4ad2885 4. 93265e6 5. 09b94a6 6. ca9de51 7. 8d90e19 8. 4ccf306 9. fb99abc 10. 8c1ddd1 11. db48e4c 12. aa1f52f - #24441: Minicart height calculated incorrectly when child items contain margins (reported by @gwharton) has been fixed in #24451 by @konarshankar07 in 2.3-develop branch Related commits: 1. 25a90fb - #24310: New Review form is redirected to review grid (reported by @konarshankar07) has been fixed in #24399 by @edenduong in 2.3-develop branch Related commits: 1. 38cf8d6 - #24306: Edit configurable product from cart doesn't show selected swatch options (reported by @rani-webkul) has been fixed in #24308 by @rani-webkul in 2.3-develop branch Related commits: 1. b6f2b5c - #23990: Reset not working properly in Add review from admin (reported by @sdzhepa) has been fixed in #24318 by @konarshankar07 in 2.3-develop branch Related commits: 1. 5f7029d 2. bd5a012 3. e115b06 4. 2f4f8e8 5. ea22c90 - #5246: Enable Merge CSS Files make adminl panel very slow (reported by @hungvt) has been fixed in #24489 by @atwixfirster in 2.3-develop branch Related commits: 1. e7fb5d7
2 parents b5a38dc + 8b38d52 commit d93d288

File tree

18 files changed

+133
-42
lines changed

18 files changed

+133
-42
lines changed

app/code/Magento/AdvancedPricingImportExport/Model/Import/AdvancedPricing.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,13 @@ class AdvancedPricing extends \Magento\ImportExport\Model\Import\Entity\Abstract
5050

5151
const VALIDATOR_WEBSITE = 'validator_website';
5252

53-
const VALIDATOR_TEAR_PRICE = 'validator_tear_price';
53+
/**
54+
* @deprecated
55+
* @see VALIDATOR_TIER_PRICE
56+
*/
57+
private const VALIDATOR_TEAR_PRICE = 'validator_tier_price';
58+
59+
private const VALIDATOR_TIER_PRICE = 'validator_tier_price';
5460

5561
/**
5662
* Validation failure message template definitions.
@@ -221,7 +227,7 @@ public function __construct(
221227
$this->_catalogProductEntity = $this->_resourceFactory->create()->getTable('catalog_product_entity');
222228
$this->_oldSkus = $this->retrieveOldSkus();
223229
$this->_validators[self::VALIDATOR_WEBSITE] = $websiteValidator;
224-
$this->_validators[self::VALIDATOR_TEAR_PRICE] = $tierPriceValidator;
230+
$this->_validators[self::VALIDATOR_TIER_PRICE] = $tierPriceValidator;
225231
$this->errorAggregator = $errorAggregator;
226232

227233
foreach (array_merge($this->errorMessageTemplates, $this->_messageTemplates) as $errorCode => $message) {
@@ -536,7 +542,7 @@ protected function getWebSiteId($websiteCode)
536542
*/
537543
protected function getCustomerGroupId($customerGroup)
538544
{
539-
$customerGroups = $this->_getValidator(self::VALIDATOR_TEAR_PRICE)->getCustomerGroups();
545+
$customerGroups = $this->_getValidator(self::VALIDATOR_TIER_PRICE)->getCustomerGroups();
540546
return $customerGroup == self::VALUE_ALL_GROUPS ? 0 : $customerGroups[$customerGroup];
541547
}
542548

app/code/Magento/AdvancedPricingImportExport/Test/Unit/Model/Import/AdvancedPricingTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
*/
1616
class AdvancedPricingTest extends \Magento\ImportExport\Test\Unit\Model\Import\AbstractImportTestCase
1717
{
18+
/**
19+
* DB Table data
20+
*/
1821
const TABLE_NAME = 'tableName';
1922
const LINK_FIELD = 'linkField';
2023

@@ -54,7 +57,7 @@ class AdvancedPricingTest extends \Magento\ImportExport\Test\Unit\Model\Import\A
5457
protected $websiteValidator;
5558

5659
/**
57-
* @var AdvancedPricing\Validator\TearPrice |\PHPUnit_Framework_MockObject_MockObject
60+
* @var AdvancedPricing\Validator\TierPrice |\PHPUnit_Framework_MockObject_MockObject
5861
*/
5962
protected $tierPriceValidator;
6063

app/code/Magento/Catalog/Model/Product/Type/Price.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ public function getChildFinalPrice($product, $productQty, $childProduct, $childP
204204
}
205205

206206
/**
207-
* Gets the 'tear_price' array from the product
207+
* Gets the 'tier_price' array from the product
208208
*
209209
* @param Product $product
210210
* @param string $key

app/code/Magento/Catalog/Test/Unit/Model/Product/Attribute/Backend/GroupPrice/AbstractTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,11 @@ public function testGetAffectedFields()
6565
$attribute->expects($this->any())->method('getAttributeId')->will($this->returnValue($attributeId));
6666
$attribute->expects($this->any())->method('isStatic')->will($this->returnValue(false));
6767
$attribute->expects($this->any())->method('getBackendTable')->will($this->returnValue('table'));
68-
$attribute->expects($this->any())->method('getName')->will($this->returnValue('tear_price'));
68+
$attribute->expects($this->any())->method('getName')->will($this->returnValue('tier_price'));
6969
$this->_model->setAttribute($attribute);
7070

7171
$object = new \Magento\Framework\DataObject();
72-
$object->setTearPrice([['price_id' => 10]]);
72+
$object->setTierPrice([['price_id' => 10]]);
7373
$object->setId(555);
7474

7575
$this->assertEquals(

app/code/Magento/Catalog/Test/Unit/Pricing/Price/BasePriceTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class BasePriceTest extends \PHPUnit\Framework\TestCase
3939
/**
4040
* @var \Magento\Catalog\Pricing\Price\TierPrice|\PHPUnit_Framework_MockObject_MockObject
4141
*/
42-
protected $tearPriceMock;
42+
protected $tierPriceMock;
4343

4444
/**
4545
* @var \Magento\Catalog\Pricing\Price\SpecialPrice|\PHPUnit_Framework_MockObject_MockObject
@@ -60,7 +60,7 @@ protected function setUp()
6060
$this->saleableItemMock = $this->createMock(\Magento\Catalog\Model\Product::class);
6161
$this->priceInfoMock = $this->createMock(\Magento\Framework\Pricing\PriceInfo\Base::class);
6262
$this->regularPriceMock = $this->createMock(\Magento\Catalog\Pricing\Price\RegularPrice::class);
63-
$this->tearPriceMock = $this->createMock(\Magento\Catalog\Pricing\Price\TierPrice::class);
63+
$this->tierPriceMock = $this->createMock(\Magento\Catalog\Pricing\Price\TierPrice::class);
6464
$this->specialPriceMock = $this->createMock(\Magento\Catalog\Pricing\Price\SpecialPrice::class);
6565
$this->calculatorMock = $this->createMock(\Magento\Framework\Pricing\Adjustment\Calculator::class);
6666

@@ -69,7 +69,7 @@ protected function setUp()
6969
->will($this->returnValue($this->priceInfoMock));
7070
$this->prices = [
7171
'regular_price' => $this->regularPriceMock,
72-
'tear_price' => $this->tearPriceMock,
72+
'tier_price' => $this->tierPriceMock,
7373
'special_price' => $this->specialPriceMock,
7474
];
7575

@@ -97,7 +97,7 @@ public function testGetValue($specialPriceValue, $expectedResult)
9797
$this->regularPriceMock->expects($this->exactly(3))
9898
->method('getValue')
9999
->will($this->returnValue(100));
100-
$this->tearPriceMock->expects($this->exactly(2))
100+
$this->tierPriceMock->expects($this->exactly(2))
101101
->method('getValue')
102102
->will($this->returnValue(99));
103103
$this->specialPriceMock->expects($this->any())

app/code/Magento/CatalogRule/Test/Unit/Model/Indexer/IndexBuilderTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ public function testUpdateCatalogRuleGroupWebsiteData()
252252
);
253253
$resourceMock->expects($this->any())
254254
->method('getMainTable')
255-
->will($this->returnValue('catalog_product_entity_tear_price'));
255+
->will($this->returnValue('catalog_product_entity_tier_price'));
256256
$backendModelMock->expects($this->any())
257257
->method('getResource')
258258
->will($this->returnValue($resourceMock));

app/code/Magento/Checkout/view/frontend/web/js/sidebar.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ define([
347347
if ($(this).find('.options').length > 0) {
348348
$(this).collapsible();
349349
}
350-
outerHeight = $(this).outerHeight();
350+
outerHeight = $(this).outerHeight(true);
351351

352352
if (counter-- > 0) {
353353
height += outerHeight;

app/code/Magento/ReleaseNotification/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Magento_ReleaseNotification Module
1+
# Magento_ReleaseNotification module
22

33
The **Release Notification Module** serves to provide a notification delivery platform for displaying new features of a Magento installation or upgrade as well as any other required release notifications.
44

app/code/Magento/Review/Block/Adminhtml/Add.php

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,33 +17,32 @@ class Add extends \Magento\Backend\Block\Widget\Form\Container
1717
* Initialize add review
1818
*
1919
* @return void
20+
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
2021
*/
2122
protected function _construct()
2223
{
2324
parent::_construct();
24-
2525
$this->_blockGroup = 'Magento_Review';
2626
$this->_controller = 'adminhtml';
2727
$this->_mode = 'add';
28-
2928
$this->buttonList->update('save', 'label', __('Save Review'));
3029
$this->buttonList->update('save', 'id', 'save_button');
31-
3230
$this->buttonList->update('reset', 'id', 'reset_button');
33-
31+
$this->buttonList->update('reset', 'onclick', 'window.review.formReset()');
3432
$this->_formScripts[] = '
3533
require(["prototype"], function(){
3634
toggleParentVis("add_review_form");
3735
toggleVis("save_button");
3836
toggleVis("reset_button");
3937
});
4038
';
41-
4239
// @codingStandardsIgnoreStart
4340
$this->_formInitScripts[] = '
44-
require(["jquery","prototype"], function(jQuery){
41+
require(["jquery","Magento_Review/js/rating","prototype"], function(jQuery, rating){
4542
window.review = function() {
4643
return {
44+
reviewFormEditSelector: "#edit_form",
45+
ratingSelector: "[data-widget=ratingControl]",
4746
productInfoUrl : null,
4847
formHidden : true,
4948
gridRowClick : function(data, click) {
@@ -72,6 +71,10 @@ protected function _construct()
7271
toggleVis("save_button");
7372
toggleVis("reset_button");
7473
},
74+
formReset: function() {
75+
jQuery(review.reviewFormEditSelector).trigger(\'reset\');
76+
jQuery(review.ratingSelector).ratingControl(\'removeRating\');
77+
},
7578
updateRating: function() {
7679
elements = [$("select_stores"), $("rating_detail").getElementsBySelector("input[type=\'radio\']")].flatten();
7780
$(\'save_button\').disabled = true;

app/code/Magento/Review/Block/Adminhtml/Main.php

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,19 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
declare(strict_types=1);
67

78
/**
89
* Adminhtml review main block
910
*/
1011
namespace Magento\Review\Block\Adminhtml;
1112

13+
use Magento\Framework\App\ObjectManager;
14+
use Magento\Catalog\Model\ResourceModel\Product\CollectionFactory as ProductCollectionFactory;
15+
16+
/**
17+
* Class \Magento\Review\Block\Adminhtml\Main
18+
*/
1219
class Main extends \Magento\Backend\Block\Widget\Grid\Container
1320
{
1421
/**
@@ -37,26 +44,37 @@ class Main extends \Magento\Backend\Block\Widget\Grid\Container
3744
*/
3845
protected $_customerViewHelper;
3946

47+
/**
48+
* Product Collection
49+
*
50+
* @var ProductCollectionFactory
51+
*/
52+
private $productCollectionFactory;
53+
4054
/**
4155
* @param \Magento\Backend\Block\Widget\Context $context
4256
* @param \Magento\Customer\Api\CustomerRepositoryInterface $customerRepository
4357
* @param \Magento\Catalog\Model\ProductFactory $productFactory
4458
* @param \Magento\Framework\Registry $registry
4559
* @param \Magento\Customer\Helper\View $customerViewHelper
4660
* @param array $data
61+
* @param ProductCollectionFactory $productCollectionFactory
4762
*/
4863
public function __construct(
4964
\Magento\Backend\Block\Widget\Context $context,
5065
\Magento\Customer\Api\CustomerRepositoryInterface $customerRepository,
5166
\Magento\Catalog\Model\ProductFactory $productFactory,
5267
\Magento\Framework\Registry $registry,
5368
\Magento\Customer\Helper\View $customerViewHelper,
54-
array $data = []
69+
array $data = [],
70+
ProductCollectionFactory $productCollectionFactory = null
5571
) {
5672
$this->_coreRegistry = $registry;
5773
$this->customerRepository = $customerRepository;
5874
$this->_productFactory = $productFactory;
5975
$this->_customerViewHelper = $customerViewHelper;
76+
$this->productCollectionFactory = $productCollectionFactory ?: ObjectManager::getInstance()
77+
->get(ProductCollectionFactory::class);
6078
parent::__construct($context, $data);
6179
}
6280

@@ -73,6 +91,10 @@ protected function _construct()
7391
$this->_blockGroup = 'Magento_Review';
7492
$this->_controller = 'adminhtml';
7593

94+
if (!$this->productCollectionFactory->create()->getSize()) {
95+
$this->removeButton('add');
96+
}
97+
7698
// lookup customer, if id is specified
7799
$customerId = $this->getRequest()->getParam('customerId', false);
78100
$customerName = '';

0 commit comments

Comments
 (0)