Skip to content

Commit e44b19c

Browse files
[EngCom] Public Pull Requests - 2.3-develop
- merged latest code from mainline branch
2 parents b65e67c + 97fd70f commit e44b19c

File tree

24 files changed

+324
-135
lines changed

24 files changed

+324
-135
lines changed

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

+12-5
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

+6-14
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

+43-45
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

+1-1
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

+1-1
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

+2-2
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

+1-1
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

+3-1
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
*/
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?xml version="1.0"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
9+
<type name="Magento\StoreGraphQl\Model\Resolver\Store\StoreConfigDataProvider">
10+
<arguments>
11+
<argument name="extendedConfigData" xsi:type="array">
12+
<item name="head_shortcut_icon" xsi:type="string">design/head/shortcut_icon</item>
13+
<item name="default_title" xsi:type="string">design/head/default_title</item>
14+
<item name="title_prefix" xsi:type="string">design/head/title_prefix</item>
15+
<item name="title_suffix" xsi:type="string">design/head/title_suffix</item>
16+
<item name="default_description" xsi:type="string">design/head/default_description</item>
17+
<item name="default_keywords" xsi:type="string">design/head/default_keywords</item>
18+
<item name="head_includes" xsi:type="string">design/head/includes</item>
19+
<item name="demonotice" xsi:type="string">design/head/demonotice</item>
20+
<item name="header_logo_src" xsi:type="string">design/header/logo_src</item>
21+
<item name="logo_width" xsi:type="string">design/header/logo_width</item>
22+
<item name="logo_height" xsi:type="string">design/header/logo_height</item>
23+
<item name="logo_alt" xsi:type="string">design/header/logo_alt</item>
24+
<item name="welcome" xsi:type="string">design/header/welcome</item>
25+
<item name="absolute_footer" xsi:type="string">design/footer/absolute_footer</item>
26+
<item name="copyright" xsi:type="string">design/footer/copyright</item>
27+
</argument>
28+
</arguments>
29+
</type>
30+
</config>

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

+2-1
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
}

0 commit comments

Comments
 (0)