Skip to content

Commit c0dce8d

Browse files
merge magento/2.3-develop into magento-epam/EPAM-PR-30
2 parents 6812727 + 9c36f6f commit c0dce8d

File tree

57 files changed

+1928
-195
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+1928
-195
lines changed

app/code/Magento/Braintree/view/adminhtml/templates/form/cc.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ $ccType = $block->getInfoData('cc_type');
8383
id="<?= /* @noEscape */ $code ?>_vault"
8484
name="payment[is_active_payment_token_enabler]"
8585
class="admin__control-checkbox"/>
86-
<label class="label" for="<?= /* @noEscape */ $code ?>_vault">
86+
<label class="label admin__field-label" for="<?= /* @noEscape */ $code ?>_vault">
8787
<span><?= $block->escapeHtml(__('Save for later use.')) ?></span>
8888
</label>
8989
</div>
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
declare(strict_types=1);
7+
8+
namespace Magento\Bundle\Model\Plugin\Frontend;
9+
10+
use Magento\Bundle\Model\Product\Type;
11+
use Magento\Catalog\Model\Product as CatalogProduct;
12+
13+
/**
14+
* Add child identities to product identities on storefront.
15+
*/
16+
class Product
17+
{
18+
/**
19+
* @var Type
20+
*/
21+
private $type;
22+
23+
/**
24+
* @param Type $type
25+
*/
26+
public function __construct(Type $type)
27+
{
28+
$this->type = $type;
29+
}
30+
31+
/**
32+
* Add child identities to product identities
33+
*
34+
* @param CatalogProduct $product
35+
* @param array $identities
36+
* @return array
37+
*/
38+
public function afterGetIdentities(CatalogProduct $product, array $identities): array
39+
{
40+
foreach ($this->type->getChildrenIds($product->getEntityId()) as $childIds) {
41+
foreach ($childIds as $childId) {
42+
$identities[] = CatalogProduct::CACHE_TAG . '_' . $childId;
43+
}
44+
}
45+
46+
return array_unique($identities);
47+
}
48+
}
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
namespace Magento\Bundle\Test\Unit\Model\Plugin\Frontend;
8+
9+
use Magento\Bundle\Model\Plugin\Frontend\Product as ProductPlugin;
10+
use Magento\Bundle\Model\Product\Type;
11+
use Magento\Catalog\Model\Product;
12+
use PHPUnit_Framework_MockObject_MockObject as MockObject;
13+
14+
class ProductTest extends \PHPUnit\Framework\TestCase
15+
{
16+
/** @var \Magento\Bundle\Model\Plugin\Product */
17+
private $plugin;
18+
19+
/** @var MockObject|Type */
20+
private $type;
21+
22+
/** @var MockObject|\Magento\Catalog\Model\Product */
23+
private $product;
24+
25+
protected function setUp()
26+
{
27+
$this->product = $this->getMockBuilder(Product::class)
28+
->disableOriginalConstructor()
29+
->setMethods(['getEntityId'])
30+
->getMock();
31+
32+
$this->type = $this->getMockBuilder(Type::class)
33+
->disableOriginalConstructor()
34+
->setMethods(['getChildrenIds'])
35+
->getMock();
36+
37+
$this->plugin = new ProductPlugin($this->type);
38+
}
39+
40+
public function testAfterGetIdentities()
41+
{
42+
$baseIdentities = [
43+
'SomeCacheId',
44+
'AnotherCacheId',
45+
];
46+
$id = 12345;
47+
$childIds = [
48+
1 => [1, 2, 5, 100500],
49+
12 => [7, 22, 45, 24612]
50+
];
51+
$expectedIdentities = [
52+
'SomeCacheId',
53+
'AnotherCacheId',
54+
Product::CACHE_TAG . '_' . 1,
55+
Product::CACHE_TAG . '_' . 2,
56+
Product::CACHE_TAG . '_' . 5,
57+
Product::CACHE_TAG . '_' . 100500,
58+
Product::CACHE_TAG . '_' . 7,
59+
Product::CACHE_TAG . '_' . 22,
60+
Product::CACHE_TAG . '_' . 45,
61+
Product::CACHE_TAG . '_' . 24612,
62+
];
63+
$this->product->expects($this->once())
64+
->method('getEntityId')
65+
->will($this->returnValue($id));
66+
$this->type->expects($this->once())
67+
->method('getChildrenIds')
68+
->with($id)
69+
->will($this->returnValue($childIds));
70+
$identities = $this->plugin->afterGetIdentities($this->product, $baseIdentities);
71+
$this->assertEquals($expectedIdentities, $identities);
72+
}
73+
}

app/code/Magento/Bundle/etc/frontend/di.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,7 @@
1313
</argument>
1414
</arguments>
1515
</type>
16+
<type name="Magento\Catalog\Model\Product">
17+
<plugin name="bundle" type="Magento\Bundle\Model\Plugin\Frontend\Product" sortOrder="100" />
18+
</type>
1619
</config>

app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Related.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ protected function _prepareColumns()
322322
}
323323

324324
/**
325-
* Rerieve grid URL
325+
* Retrieve grid URL
326326
*
327327
* @return string
328328
*/

app/code/Magento/Catalog/Model/Layer/Filter/Item/DataBuilder.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
* See COPYING.txt for license details.
55
*/
66

7+
namespace Magento\Catalog\Model\Layer\Filter\Item;
8+
79
/**
810
* Item Data Builder
911
*/
10-
namespace Magento\Catalog\Model\Layer\Filter\Item;
11-
1212
class DataBuilder
1313
{
1414
/**
@@ -29,7 +29,7 @@ class DataBuilder
2929
* Add Item Data
3030
*
3131
* @param string $label
32-
* @param string $label
32+
* @param string $value
3333
* @param int $count
3434
* @return void
3535
*/

app/code/Magento/Catalog/view/adminhtml/web/catalog/product/composite/configure.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ define([
9191

9292
/**
9393
* Add product list types as scope and their urls
94-
* expamle: addListType('product_to_add', {urlFetch: 'http://magento...'})
95-
* expamle: addListType('wishlist', {urlSubmit: 'http://magento...'})
94+
* example: addListType('product_to_add', {urlFetch: 'http://magento...'})
95+
* example: addListType('wishlist', {urlSubmit: 'http://magento...'})
9696
*
9797
* @param type types as scope
9898
* @param urls obj can be
@@ -112,7 +112,7 @@ define([
112112
/**
113113
* Adds complex list type - that is used to submit several list types at once
114114
* Only urlSubmit is possible for this list type
115-
* expamle: addComplexListType(['wishlist', 'product_list'], 'http://magento...')
115+
* example: addComplexListType(['wishlist', 'product_list'], 'http://magento...')
116116
*
117117
* @param type types as scope
118118
* @param urls obj can be

app/code/Magento/Catalog/view/adminhtml/web/js/form/element/action-delete.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
define([
66
'underscore',
77
'Magento_Ui/js/form/element/abstract'
8-
], function (_, Acstract) {
8+
], function (_, Abstract) {
99
'use strict';
1010

11-
return Acstract.extend({
11+
return Abstract.extend({
1212
defaults: {
1313
prefixName: '',
1414
prefixElementName: '',

app/code/Magento/Catalog/view/adminhtml/web/js/form/element/input.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
define([
66
'underscore',
77
'Magento_Ui/js/form/element/abstract'
8-
], function (_, Acstract) {
8+
], function (_, Abstract) {
99
'use strict';
1010

11-
return Acstract.extend({
11+
return Abstract.extend({
1212
defaults: {
1313
prefixName: '',
1414
prefixElementName: '',

app/code/Magento/Catalog/view/base/web/js/price-utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ define([
6060
pattern = pattern.indexOf('{sign}') < 0 ? s + pattern : pattern.replace('{sign}', s);
6161

6262
// we're avoiding the usage of to fixed, and using round instead with the e representation to address
63-
// numbers like 1.005 = 1.01. Using ToFixed to only provide trailig zeroes in case we have a whole number
63+
// numbers like 1.005 = 1.01. Using ToFixed to only provide trailing zeroes in case we have a whole number
6464
i = parseInt(
6565
amount = Number(Math.round(Math.abs(+amount || 0) + 'e+' + precision) + ('e-' + precision)),
6666
10

0 commit comments

Comments
 (0)