Skip to content
This repository was archived by the owner on Dec 19, 2019. It is now read-only.

Commit d93d288

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

app/code/Magento/Review/Test/Unit/Block/Adminhtml/MainTest.php

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

78
namespace Magento\Review\Test\Unit\Block\Adminhtml;
89

910
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper;
11+
use Magento\Customer\Api\CustomerRepositoryInterface;
12+
use Magento\Customer\Helper\View as ViewHelper;
13+
use Magento\Customer\Api\Data\CustomerInterface;
14+
use Magento\Framework\App\RequestInterface;
15+
use Magento\Review\Block\Adminhtml\Main as MainBlock;
16+
use Magento\Framework\DataObject;
17+
use Magento\Catalog\Model\ResourceModel\Product\Collection;
18+
use Magento\Catalog\Model\ResourceModel\Product\CollectionFactory;
1019

20+
/**
21+
* Unit Test For Main Block
22+
*
23+
* Class \Magento\Review\Test\Unit\Block\Adminhtml\MainTest
24+
*/
1125
class MainTest extends \PHPUnit\Framework\TestCase
1226
{
1327
/**
14-
* @var \Magento\Review\Block\Adminhtml\Main
28+
* @var MainBlock
1529
*/
1630
protected $model;
1731

1832
/**
19-
* @var \Magento\Framework\App\RequestInterface|\PHPUnit_Framework_MockObject_MockObject
33+
* @var RequestInterface|\PHPUnit_Framework_MockObject_MockObject
2034
*/
2135
protected $request;
2236

2337
/**
24-
* @var \Magento\Customer\Api\CustomerRepositoryInterface|\PHPUnit_Framework_MockObject_MockObject
38+
* @var CustomerRepositoryInterface|\PHPUnit_Framework_MockObject_MockObject
2539
*/
2640
protected $customerRepository;
2741

2842
/**
29-
* @var \Magento\Customer\Helper\View|\PHPUnit_Framework_MockObject_MockObject
43+
* @var ViewHelper|\PHPUnit_Framework_MockObject_MockObject
3044
*/
3145
protected $customerViewHelper;
3246

47+
/**
48+
* @var CollectionFactory|\PHPUnit_Framework_MockObject_MockObject
49+
*/
50+
protected $collectionFactory;
51+
3352
public function testConstruct()
3453
{
3554
$this->customerRepository = $this
36-
->getMockForAbstractClass(\Magento\Customer\Api\CustomerRepositoryInterface::class);
37-
$this->customerViewHelper = $this->createMock(\Magento\Customer\Helper\View::class);
38-
$dummyCustomer = $this->getMockForAbstractClass(\Magento\Customer\Api\Data\CustomerInterface::class);
55+
->getMockForAbstractClass(CustomerRepositoryInterface::class);
56+
$this->customerViewHelper = $this->createMock(ViewHelper::class);
57+
$this->collectionFactory = $this->createMock(CollectionFactory::class);
58+
$dummyCustomer = $this->getMockForAbstractClass(CustomerInterface::class);
3959

4060
$this->customerRepository->expects($this->once())
4161
->method('getById')
@@ -44,8 +64,8 @@ public function testConstruct()
4464
$this->customerViewHelper->expects($this->once())
4565
->method('getCustomerName')
4666
->with($dummyCustomer)
47-
->will($this->returnValue(new \Magento\Framework\DataObject()));
48-
$this->request = $this->getMockForAbstractClass(\Magento\Framework\App\RequestInterface::class);
67+
->will($this->returnValue(new DataObject()));
68+
$this->request = $this->getMockForAbstractClass(RequestInterface::class);
4969
$this->request->expects($this->at(0))
5070
->method('getParam')
5171
->with('customerId', false)
@@ -54,14 +74,21 @@ public function testConstruct()
5474
->method('getParam')
5575
->with('productId', false)
5676
->will($this->returnValue(false));
77+
$productCollection = $this->getMockBuilder(Collection::class)
78+
->disableOriginalConstructor()
79+
->getMock();
80+
$this->collectionFactory->expects($this->once())
81+
->method('create')
82+
->will($this->returnValue($productCollection));
5783

5884
$objectManagerHelper = new ObjectManagerHelper($this);
5985
$this->model = $objectManagerHelper->getObject(
60-
\Magento\Review\Block\Adminhtml\Main::class,
86+
MainBlock::class,
6187
[
6288
'request' => $this->request,
6389
'customerRepository' => $this->customerRepository,
64-
'customerViewHelper' => $this->customerViewHelper
90+
'customerViewHelper' => $this->customerViewHelper,
91+
'productCollectionFactory' => $this->collectionFactory
6592
]
6693
);
6794
}

app/code/Magento/Review/view/adminhtml/web/js/rating.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,15 @@ define([
6262

6363
checkedInputs.nextAll('label').addBack().css('color', this.options.colorFilled).data('checked', true);
6464
checkedInputs.prevAll('label').css('color', this.options.colorUnfilled).data('checked', false);
65+
},
66+
67+
/**
68+
* Remove rating when form reset
69+
*/
70+
removeRating: function () {
71+
var checkedInputs = this.element.find('input[type="radio"]');
72+
73+
checkedInputs.nextAll('label').css('color', this.options.colorUnfilled).data('checked', false);
6574
}
6675
});
6776

app/code/Magento/Sales/Block/Adminhtml/Order/Status/NewStatus/Form.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ protected function _addStoresFieldset($model, $form)
8181
if (!$this->_storeManager->isSingleStoreMode()) {
8282
$fieldset = $form->addFieldset(
8383
'store_labels_fieldset',
84-
['legend' => __('Store View Specific Labels'), 'class' => 'store-scope']
84+
['legend' => __('Store View Specific Labels'), 'class' => 'store-scope no-margin-top-tooltip']
8585
);
8686
} else {
8787
$fieldset = $form->addFieldset(

app/code/Magento/Swatches/view/frontend/web/js/swatch-renderer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -750,7 +750,7 @@ define([
750750

751751
$(document).trigger('updateMsrpPriceBlock',
752752
[
753-
parseInt($this.attr('index'), 10) + 1,
753+
_.findKey($widget.options.jsonConfig.index, $widget.options.jsonConfig.defaultValues),
754754
$widget.options.jsonConfig.optionPrices
755755
]);
756756

0 commit comments

Comments
 (0)