Skip to content

Commit fd3a773

Browse files
Merge remote-tracking branch 'remotes/github/2.3-develop' into EPAM-PR-25
2 parents 25bc41f + 4f23251 commit fd3a773

File tree

20 files changed

+237
-125
lines changed

20 files changed

+237
-125
lines changed

app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tabs.php

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
use Magento\Backend\Block\Template\Context;
1010
use Magento\Backend\Block\Widget\Accordion;
11-
use Magento\Backend\Block\Widget\Tabs as WigetTabs;
11+
use Magento\Backend\Block\Widget\Tabs as WidgetTabs;
1212
use Magento\Backend\Model\Auth\Session;
1313
use Magento\Catalog\Helper\Catalog;
1414
use Magento\Catalog\Helper\Data;
@@ -22,7 +22,7 @@
2222
* Admin product edit tabs
2323
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
2424
*/
25-
class Tabs extends WigetTabs
25+
class Tabs extends WidgetTabs
2626
{
2727
const BASIC_TAB_GROUP_CODE = 'basic';
2828

@@ -109,7 +109,7 @@ public function __construct(
109109
}
110110

111111
/**
112-
* @return void
112+
* @inheritdoc
113113
*/
114114
protected function _construct()
115115
{
@@ -119,6 +119,8 @@ protected function _construct()
119119
}
120120

121121
/**
122+
* Get group collection.
123+
*
122124
* @param int $attributeSetId
123125
* @return \Magento\Eav\Model\ResourceModel\Entity\Attribute\Group\Collection
124126
*/
@@ -131,10 +133,11 @@ public function getGroupCollection($attributeSetId)
131133
}
132134

133135
/**
134-
* @return $this
136+
* @inheritdoc
135137
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
136-
* @SuppressWarnings(PHPMD.NPathComplexity)
137138
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
139+
* @SuppressWarnings(PHPMD.NPathComplexity)
140+
* @SuppressWarnings(PHPMD.RequestAwareBlockMethod)
138141
*/
139142
protected function _prepareLayout()
140143
{
@@ -315,6 +318,8 @@ public function getAttributeTabBlock()
315318
}
316319

317320
/**
321+
* Set attribute tab block.
322+
*
318323
* @param string $attributeTabBlock
319324
* @return $this
320325
*/
@@ -337,6 +342,8 @@ protected function _translateHtml($html)
337342
}
338343

339344
/**
345+
* Get accordion.
346+
*
340347
* @param string $parentTab
341348
* @return string
342349
*/

app/code/Magento/Catalog/Test/Unit/Model/ProductTest.php

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88

99
use Magento\Catalog\Api\Data\ProductExtensionInterface;
1010
use Magento\Catalog\Model\Product;
11+
use Magento\Catalog\Model\Product\Attribute\Source\Status;
1112
use Magento\Framework\Api\Data\ImageContentInterface;
1213
use Magento\Framework\Api\ExtensibleDataInterface;
1314
use Magento\Framework\Api\ExtensionAttributesFactory;
1415
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper;
15-
use Magento\Catalog\Model\Product\Attribute\Source\Status;
1616

1717
/**
1818
* Product Test
@@ -180,7 +180,7 @@ class ProductTest extends \PHPUnit\Framework\TestCase
180180
/**
181181
* @var \PHPUnit_Framework_MockObject_MockObject
182182
*/
183-
private $extensionAttrbutes;
183+
private $extensionAttributes;
184184

185185
/**
186186
* @var \PHPUnit_Framework_MockObject_MockObject
@@ -200,7 +200,7 @@ class ProductTest extends \PHPUnit\Framework\TestCase
200200
/**
201201
* @var ProductExtensionInterface|\PHPUnit_Framework_MockObject_MockObject
202202
*/
203-
private $extensionAttributes;
203+
private $productExtAttributes;
204204

205205
/**
206206
* @var \Magento\Eav\Model\Config|\PHPUnit_Framework_MockObject_MockObject
@@ -218,7 +218,7 @@ protected function setUp()
218218
\Magento\Framework\Module\Manager::class,
219219
['isEnabled']
220220
);
221-
$this->extensionAttrbutes = $this->getMockBuilder(\Magento\Framework\Api\ExtensionAttributesInterface::class)
221+
$this->extensionAttributes = $this->getMockBuilder(\Magento\Framework\Api\ExtensionAttributesInterface::class)
222222
->setMethods(['getWebsiteIds', 'setWebsiteIds'])
223223
->disableOriginalConstructor()
224224
->getMock();
@@ -372,13 +372,13 @@ protected function setUp()
372372
$this->mediaConfig = $this->createMock(\Magento\Catalog\Model\Product\Media\Config::class);
373373
$this->eavConfig = $this->createMock(\Magento\Eav\Model\Config::class);
374374

375-
$this->extensionAttributes = $this->getMockBuilder(ProductExtensionInterface::class)
375+
$this->productExtAttributes = $this->getMockBuilder(ProductExtensionInterface::class)
376376
->setMethods(['getStockItem'])
377377
->getMockForAbstractClass();
378378
$this->extensionAttributesFactory
379379
->expects($this->any())
380380
->method('create')
381-
->willReturn($this->extensionAttributes);
381+
->willReturn($this->productExtAttributes);
382382

383383
$this->filterCustomAttribute = $this->createTestProxy(
384384
\Magento\Catalog\Model\FilterProductCustomAttribute::class
@@ -567,14 +567,6 @@ public function testGetCategoryId()
567567
$this->assertEquals(10, $this->model->getCategoryId());
568568
}
569569

570-
public function testGetCategoryIdWhenProductNotInCurrentCategory()
571-
{
572-
$this->model->setData('category_ids', [12]);
573-
$this->category->expects($this->once())->method('getId')->will($this->returnValue(10));
574-
$this->registry->expects($this->any())->method('registry')->will($this->returnValue($this->category));
575-
$this->assertFalse($this->model->getCategoryId());
576-
}
577-
578570
public function testGetIdBySku()
579571
{
580572
$this->resource->expects($this->once())->method('getIdBySku')->will($this->returnValue(5));

app/code/Magento/CatalogWidget/view/frontend/templates/product/widget/content/grid.phtml

Lines changed: 43 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
$showWishlist = true;
2121
$showCompare = true;
2222
$showCart = true;
23-
$templateType = \Magento\Catalog\Block\Product\ReviewRendererInterface::DEFAULT_VIEW;
23+
$templateType = \Magento\Catalog\Block\Product\ReviewRendererInterface::SHORT_VIEW;
2424
$description = false;
2525
?>
2626
<div class="block widget block-products-list <?= /* @noEscape */ $mode ?>">
@@ -48,57 +48,55 @@
4848
<?= $block->escapeHtml($_item->getName()) ?>
4949
</a>
5050
</strong>
51-
<?php
52-
echo $block->getProductPriceHtml($_item, $type);
53-
?>
54-
5551
<?php if ($templateType): ?>
5652
<?= $block->getReviewsSummaryHtml($_item, $templateType) ?>
5753
<?php endif; ?>
58-
54+
<?php echo $block->getProductPriceHtml($_item, $type); ?>
5955
<?php if ($showWishlist || $showCompare || $showCart): ?>
60-
<div class="product-item-actions">
61-
<?php if ($showCart): ?>
62-
<div class="actions-primary">
63-
<?php if ($_item->isSaleable()): ?>
64-
<?php if (!$_item->getTypeInstance()->isPossibleBuyFromList($_item)): ?>
65-
<button class="action tocart primary" data-mage-init='{"redirectUrl":{"url":"<?= $block->escapeUrl($block->getAddToCartUrl($_item)) ?>"}}' type="button" title="<?= $block->escapeHtmlAttr(__('Add to Cart')) ?>">
66-
<span><?= $block->escapeHtml(__('Add to Cart')) ?></span>
67-
</button>
56+
<div class="product-item-inner">
57+
<div class="product-item-actions">
58+
<?php if ($showCart): ?>
59+
<div class="actions-primary">
60+
<?php if ($_item->isSaleable()): ?>
61+
<?php if (!$_item->getTypeInstance()->isPossibleBuyFromList($_item)): ?>
62+
<button class="action tocart primary" data-mage-init='{"redirectUrl":{"url":"<?= $block->escapeUrl($block->getAddToCartUrl($_item)) ?>"}}' type="button" title="<?= $block->escapeHtmlAttr(__('Add to Cart')) ?>">
63+
<span><?= $block->escapeHtml(__('Add to Cart')) ?></span>
64+
</button>
65+
<?php else: ?>
66+
<?php
67+
$postDataHelper = $this->helper('Magento\Framework\Data\Helper\PostHelper');
68+
$postData = $postDataHelper->getPostData($block->getAddToCartUrl($_item), ['product' => $_item->getEntityId()])
69+
?>
70+
<button class="action tocart primary" data-post='<?= /* @noEscape */ $postData ?>' type="button" title="<?= $block->escapeHtmlAttr(__('Add to Cart')) ?>">
71+
<span><?= $block->escapeHtml(__('Add to Cart')) ?></span>
72+
</button>
73+
<?php endif; ?>
6874
<?php else: ?>
69-
<?php
70-
$postDataHelper = $this->helper('Magento\Framework\Data\Helper\PostHelper');
71-
$postData = $postDataHelper->getPostData($block->getAddToCartUrl($_item), ['product' => $_item->getEntityId()])
72-
?>
73-
<button class="action tocart primary" data-post='<?= /* @noEscape */ $postData ?>' type="button" title="<?= $block->escapeHtmlAttr(__('Add to Cart')) ?>">
74-
<span><?= $block->escapeHtml(__('Add to Cart')) ?></span>
75-
</button>
75+
<?php if ($_item->getIsSalable()): ?>
76+
<div class="stock available"><span><?= $block->escapeHtml(__('In stock')) ?></span></div>
77+
<?php else: ?>
78+
<div class="stock unavailable"><span><?= $block->escapeHtml(__('Out of stock')) ?></span></div>
79+
<?php endif; ?>
7680
<?php endif; ?>
77-
<?php else: ?>
78-
<?php if ($_item->getIsSalable()): ?>
79-
<div class="stock available"><span><?= $block->escapeHtml(__('In stock')) ?></span></div>
80-
<?php else: ?>
81-
<div class="stock unavailable"><span><?= $block->escapeHtml(__('Out of stock')) ?></span></div>
81+
</div>
82+
<?php endif; ?>
83+
<?php if ($showWishlist || $showCompare): ?>
84+
<div class="actions-secondary" data-role="add-to-links">
85+
<?php if ($this->helper('Magento\Wishlist\Helper\Data')->isAllow() && $showWishlist): ?>
86+
<a href="#"
87+
data-post='<?= /* @noEscape */ $block->getAddToWishlistParams($_item) ?>' class="action towishlist" data-action="add-to-wishlist" title="<?= $block->escapeHtmlAttr(__('Add to Wish List')) ?>">
88+
<span><?= $block->escapeHtml(__('Add to Wish List')) ?></span>
89+
</a>
90+
<?php endif; ?>
91+
<?php if ($block->getAddToCompareUrl() && $showCompare): ?>
92+
<?php $compareHelper = $this->helper('Magento\Catalog\Helper\Product\Compare');?>
93+
<a href="#" class="action tocompare" data-post='<?= /* @noEscape */ $compareHelper->getPostDataParams($_item) ?>' title="<?= $block->escapeHtmlAttr(__('Add to Compare')) ?>">
94+
<span><?= $block->escapeHtml(__('Add to Compare')) ?></span>
95+
</a>
8296
<?php endif; ?>
83-
<?php endif; ?>
84-
</div>
85-
<?php endif; ?>
86-
<?php if ($showWishlist || $showCompare): ?>
87-
<div class="actions-secondary" data-role="add-to-links">
88-
<?php if ($this->helper('Magento\Wishlist\Helper\Data')->isAllow() && $showWishlist): ?>
89-
<a href="#"
90-
data-post='<?= /* @noEscape */ $block->getAddToWishlistParams($_item) ?>' class="action towishlist" data-action="add-to-wishlist" title="<?= $block->escapeHtmlAttr(__('Add to Wish List')) ?>">
91-
<span><?= $block->escapeHtml(__('Add to Wish List')) ?></span>
92-
</a>
93-
<?php endif; ?>
94-
<?php if ($block->getAddToCompareUrl() && $showCompare): ?>
95-
<?php $compareHelper = $this->helper('Magento\Catalog\Helper\Product\Compare');?>
96-
<a href="#" class="action tocompare" data-post='<?= /* @noEscape */ $compareHelper->getPostDataParams($_item) ?>' title="<?= $block->escapeHtmlAttr(__('Add to Compare')) ?>">
97-
<span><?= $block->escapeHtml(__('Add to Compare')) ?></span>
98-
</a>
99-
<?php endif; ?>
100-
</div>
101-
<?php endif; ?>
97+
</div>
98+
<?php endif; ?>
99+
</div>
102100
</div>
103101
<?php endif; ?>
104102
</div>

app/code/Magento/Customer/Model/Address/AbstractAddress.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ public function getStreet()
222222
}
223223

224224
/**
225-
* Get steet line by number
225+
* Get street line by number
226226
*
227227
* @param int $number
228228
* @return string

app/code/Magento/Customer/Model/Address/AddressModelInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
interface AddressModelInterface
1616
{
1717
/**
18-
* Get steet line by number
18+
* Get street line by number
1919
*
2020
* @param int $number
2121
* @return string

app/code/Magento/ImportExport/Block/Adminhtml/Export/Filter.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,8 +237,8 @@ protected function _getSelectHtmlWithValue(Attribute $attribute, $value)
237237
if ($attribute->getFilterOptions()) {
238238
$options = [];
239239

240-
foreach ($attribute->getFilterOptions() as $value => $label) {
241-
$options[] = ['value' => $value, 'label' => $label];
240+
foreach ($attribute->getFilterOptions() as $optionValue => $label) {
241+
$options[] = ['value' => $optionValue, 'label' => $label];
242242
}
243243
} else {
244244
$options = $attribute->getSource()->getAllOptions(false);

app/code/Magento/Paypal/Model/Billing/AbstractAgreement.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
namespace Magento\Paypal\Model\Billing;
77

88
/**
9-
* Billing Agreement abstaract class
9+
* Billing Agreement abstract class
1010
*/
1111
abstract class AbstractAgreement extends \Magento\Framework\Model\AbstractModel
1212
{

app/code/Magento/Sales/Block/Adminhtml/Order/Creditmemo/Create/Adjustments.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
use Magento\Framework\Pricing\PriceCurrencyInterface;
99

1010
/**
11+
* Credit memo adjustmets block
12+
*
1113
* @api
1214
* @since 100.0.2
1315
*/
@@ -50,7 +52,7 @@ public function __construct(
5052
}
5153

5254
/**
53-
* Initialize creditmemo agjustment totals
55+
* Initialize creditmemo adjustment totals
5456
*
5557
* @return $this
5658
*/

app/design/adminhtml/Magento/backend/web/css/source/components/_messages.less

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@
7676
position: absolute;
7777
speak: none;
7878
text-shadow: none;
79-
top: 1.5rem;
79+
top: 50%;
80+
margin-top: -1.25rem;
8081
width: auto;
8182
}
8283
}

app/design/frontend/Magento/blank/Magento_Catalog/web/css/source/_widgets.less

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,15 @@
2323
}
2424

2525
.block.widget {
26+
.products-grid .product-item {
27+
margin-left: 2%;
28+
width: calc(~'(100% - 2%)/2');
29+
30+
&:nth-child(2n + 1) {
31+
margin-left: 0;
32+
}
33+
}
34+
2635
.product-item-info {
2736
width: auto;
2837
}
@@ -60,6 +69,15 @@
6069
.page-layout-3columns .block.widget .products-grid .product-item {
6170
width: 100%/3;
6271
}
72+
73+
.page-layout-1column .block.widget .products-grid .product-item {
74+
margin-left: 2%;
75+
width: calc(~'(100% - 4%)/3');
76+
77+
&:nth-child(3n + 1) {
78+
margin-left: 0;
79+
}
80+
}
6381
}
6482

6583
//
@@ -82,7 +100,16 @@
82100
}
83101

84102
.page-layout-1column .block.widget .products-grid .product-item {
85-
width: 100%/4;
103+
margin-left: 2%;
104+
width: calc(~'(100% - 6%)/4');
105+
106+
&:nth-child(3n + 1) {
107+
margin-left: 2%;
108+
}
109+
110+
&:nth-child(4n + 1) {
111+
margin-left: 0;
112+
}
86113
}
87114

88115
.page-layout-3columns .block.widget .products-grid .product-item {
@@ -96,11 +123,11 @@
96123
}
97124

98125
.page-layout-1column .block.widget .products-grid .product-item {
99-
margin-left: calc(~'(100% - 5 * (100%/6)) / 4');
100-
width: 100%/6;
126+
margin-left: 2%;
127+
width: calc(~'(100% - 8%)/5');
101128

102129
&:nth-child(4n + 1) {
103-
margin-left: calc(~'(100% - 5 * (100%/6)) / 4');
130+
margin-left: 2%;
104131
}
105132

106133
&:nth-child(5n + 1) {

0 commit comments

Comments
 (0)