Skip to content

Commit 03da376

Browse files
authored
Merge branch '2.4-develop' into PWA-1326
2 parents 98db093 + 7a72b6b commit 03da376

File tree

48 files changed

+805
-166
lines changed

Some content is hidden

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

48 files changed

+805
-166
lines changed

app/code/Magento/Catalog/Block/Ui/ProductViewCounter.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ public function getCurrentProductData()
153153
$this->productRenderCollectorComposite
154154
->collect($product, $productRender);
155155
$data = $this->hydrator->extract($productRender);
156+
$data['is_available'] = $product->isAvailable();
156157

157158
$currentProductData = [
158159
'items' => [

app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminClickOnAdvancedInventoryLinkActionGroup.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,7 @@
1717

1818
<click selector="{{AdminProductFormSection.advancedInventoryLink}}" stepKey="clickOnAdvancedInventoryLink"/>
1919
<waitForPageLoad stepKey="waitForAdvancedInventoryPageToLoad"/>
20+
<!-- Wait for close button appeared. That means animation finished and modal window is fully visible -->
21+
<waitForElementVisible selector="{{AdminProductFormAdvancedInventorySection.advancedInventoryCloseButton}}" stepKey="waitForCloseButtonAppeared"/>
2022
</actionGroup>
2123
</actionGroups>

app/code/Magento/Catalog/Test/Mftf/Data/ProductData.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@
3939
<data key="name">TestFooBar</data>
4040
<data key="sku" unique="suffix">foobar</data>
4141
</entity>
42+
<entity name="ApiSimpleProductWithDoubleSpaces" type="product" extends="ApiSimpleProduct">
43+
<data key="name">Simple Product Double Space</data>
44+
<data key="sku" unique="suffix">simple-product double-space</data>
45+
</entity>
4246
<entity name="ApiSimpleProductWithSpecCharInName" type="product" extends="ApiSimpleProduct">
4347
<data key="name">Pursuit Lumaflex&#38;trade; Tone Band</data>
4448
<data key="sku" unique="suffix">x&#38;trade;</data>
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
10+
<test name="AdminShowDoubleSpacesInProductGrid">
11+
<annotations>
12+
<features value="Catalog"/>
13+
<stories value="Edit products"/>
14+
<title value="Show double spaces in the product grid"/>
15+
<description value="Admin should be able to see double spaces in the Name and Sku fields in the product grid"/>
16+
<testCaseId value="MC-40725"/>
17+
<useCaseId value="MC-40122"/>
18+
<severity value="AVERAGE"/>
19+
<group value="Catalog"/>
20+
</annotations>
21+
22+
<before>
23+
<createData entity="ApiCategory" stepKey="createCategory"/>
24+
<createData entity="ApiSimpleProductWithDoubleSpaces" stepKey="createProduct">
25+
<requiredEntity createDataKey="createCategory"/>
26+
</createData>
27+
<magentoCLI command="cron:run --group=index" stepKey="cronRun"/>
28+
<magentoCLI command="cron:run --group=index" stepKey="cronRunSecondTime"/>
29+
</before>
30+
31+
<after>
32+
<actionGroup ref="AdminDeleteAllProductsFromGridActionGroup" stepKey="deleteProduct"/>
33+
<actionGroup ref="ClearFiltersAdminProductGridActionGroup" stepKey="clearGridFilters"/>
34+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
35+
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
36+
</after>
37+
38+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
39+
<actionGroup ref="AdminOpenCatalogProductPageActionGroup" stepKey="goToProductCatalogPage"/>
40+
<actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="searchForProduct">
41+
<argument name="product" value="$createProduct$"/>
42+
</actionGroup>
43+
<actionGroup ref="AssertAdminProductGridCellActionGroup" stepKey="assertProductName">
44+
<argument name="column" value="Name"/>
45+
<argument name="value" value="$createProduct.name$"/>
46+
</actionGroup>
47+
<actionGroup ref="AssertAdminProductGridCellActionGroup" stepKey="assertProductSku">
48+
<argument name="column" value="SKU"/>
49+
<argument name="value" value="$createProduct.sku$"/>
50+
</actionGroup>
51+
</test>
52+
</tests>

app/code/Magento/Catalog/Test/Unit/Block/Ui/ProductViewCounterTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,14 +166,14 @@ public function testGetCurrentProductDataWithNonEmptyProduct()
166166
{
167167
$productMock = $this->getMockBuilder(ProductInterface::class)
168168
->disableOriginalConstructor()
169+
->addMethods(['isAvailable'])
169170
->getMockForAbstractClass();
170171
$productRendererMock = $this->getMockBuilder(ProductRenderInterface::class)
171172
->disableOriginalConstructor()
172173
->getMockForAbstractClass();
173174
$storeMock = $this->getMockBuilder(Store::class)
174175
->disableOriginalConstructor()
175176
->getMock();
176-
177177
$this->registryMock->expects($this->once())
178178
->method('registry')
179179
->with('product')

app/code/Magento/Catalog/view/adminhtml/ui_component/product_listing.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@
132132
<settings>
133133
<addField>true</addField>
134134
<filter>text</filter>
135-
<bodyTmpl>ui/grid/cells/html</bodyTmpl>
135+
<bodyTmpl>Magento_Catalog/grid/cells/preserved</bodyTmpl>
136136
<label translate="true">Name</label>
137137
</settings>
138138
</column>
@@ -155,7 +155,7 @@
155155
<column name="sku" sortOrder="60">
156156
<settings>
157157
<filter>text</filter>
158-
<bodyTmpl>ui/grid/cells/html</bodyTmpl>
158+
<bodyTmpl>Magento_Catalog/grid/cells/preserved</bodyTmpl>
159159
<label translate="true">SKU</label>
160160
</settings>
161161
</column>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<!--
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
-->
7+
<div class="data-grid-cell-content white-space-preserved" html="$col.getLabel($row())"/>

app/code/Magento/Catalog/view/base/web/js/product/addtocart-button.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,16 @@ define([
5555
return row['is_salable'];
5656
},
5757

58+
/**
59+
* Depends on this option, stock status text can be "In stock" or "Out Of Stock"
60+
*
61+
* @param {Object} row
62+
* @returns {Boolean}
63+
*/
64+
isAvailable: function (row) {
65+
return row['is_available'];
66+
},
67+
5868
/**
5969
* Depends on this option, "Add to cart" button can be shown or hide. Depends on backend configuration
6070
*

app/code/Magento/Catalog/view/frontend/templates/product/compare/list.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
</button>
7979
</form>
8080
<?php else :?>
81-
<?php if ($item->getIsSalable()) :?>
81+
<?php if ($item->isAvailable()) :?>
8282
<div class="stock available"><span><?= $block->escapeHtml(__('In stock')) ?></span></div>
8383
<?php else :?>
8484
<div class="stock unavailable"><span><?= $block->escapeHtml(__('Out of stock')) ?></span></div>

app/code/Magento/Catalog/view/frontend/templates/product/list.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ $_helper = $block->getData('outputHelper');
153153
<?php endforeach; ?>
154154
</ol>
155155
</div>
156-
<?= $block->getToolbarHtml() ?>
156+
<?= $block->getChildBlock('toolbar')->setIsBottom(true)->toHtml() ?>
157157
<script type="text/x-magento-init">
158158
{
159159
"[data-role=tocart-form], .form.map.checkout": {

0 commit comments

Comments
 (0)