Skip to content

Commit c891137

Browse files
author
Serhii Balko
committed
Merge remote-tracking branch 'origin/MC-40122' into 2.4-develop-pr54
2 parents 6a63aac + f370a8e commit c891137

File tree

5 files changed

+69
-2
lines changed

5 files changed

+69
-2
lines changed

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/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/design/adminhtml/Magento/backend/Magento_Ui/web/css/source/module/_data-grid.less

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@
6666
display: inline-block;
6767
overflow: hidden;
6868
width: 100%;
69+
70+
&.white-space-preserved {
71+
white-space: pre;
72+
}
6973
}
7074

7175
body._in-resize {

0 commit comments

Comments
 (0)