Skip to content

Commit 9174fbf

Browse files
author
Alexander Akimov
authored
Merge pull request #3424 from magento-tsg/2.2.7-develop-pr57
[TSG] Backporting for 2.2 (pr57) (2.2.7)
2 parents 67c3162 + 339f74b commit 9174fbf

File tree

5 files changed

+23
-20
lines changed

5 files changed

+23
-20
lines changed

app/code/Magento/Catalog/Test/Mftf/Section/AdminProductCustomizableOptionsSection.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,17 @@
1010
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd">
1111
<section name="AdminProductCustomizableOptionsSection">
1212
<element name="checkIfCustomizableOptionsTabOpen" type="text" selector="//span[text()='Customizable Options']/parent::strong/parent::*[@data-state-collapsible='closed']"/>
13-
<element name="customizableOptions" type="text" selector="//strong[contains(@class, 'admin__collapsible-title')]/span[text()='Customizable Options']"/>
13+
<element name="customizableOptions" type="text" selector="//strong[contains(@class, 'admin__collapsible-title')]/span[text()='Customizable Options']" timeout="30"/>
1414
<element name="useDefaultOptionTitle" type="text" selector="[data-index='options'] tr.data-row [data-index='title'] [name^='options_use_default']"/>
1515
<element name="useDefaultOptionValueTitleByIndex" type="text" selector="[data-index='options'] [data-index='values'] tr[data-repeat-index='{{var1}}'] [name^='options_use_default']" parameterized="true"/>
1616
<element name="addOptionBtn" type="button" selector="button[data-index='button_add']"/>
17-
<element name="fillOptionTitle" type="input" selector="//span[text()='{{var1}}']/parent::div/parent::div/parent::div//label[text()='Option Title']/parent::span/parent::div//input[@class='admin__control-text']" parameterized="true"/>
18-
<element name="checkSelect" type="select" selector="//span[text()='{{var1}}']/parent::div/parent::div/parent::div//label[text()='Option Type']/parent::span/parent::div//div[@data-role='selected-option']" parameterized="true"/>
17+
<element name="fillOptionTitle" type="input" selector="//span[text()='{{var1}}']/parent::div/parent::div/parent::div//span[text()='Option Title']/parent::label/parent::div//input[@class='admin__control-text']" parameterized="true"/>
18+
<element name="checkSelect" type="select" selector="//span[text()='{{var1}}']/parent::div/parent::div/parent::div//span[text()='Option Type']/parent::label/parent::div//div[@data-role='selected-option']" parameterized="true"/>
1919
<element name="checkDropDown" type="select" selector="//span[text()='{{var1}}']/ancestor::div[@class='fieldset-wrapper-title']/following-sibling::div[@data-role='collapsible-content']//div[@data-index='type']//div[contains(@class, 'action-menu')]//li[@class='admin__action-multiselect-menu-inner-item']//label[text()='Drop-down']" parameterized="true"/>
2020
<element name="clickAddValue" type="button" selector="//span[text()='{{var1}}']/parent::div/parent::div/parent::div//tfoot//button" parameterized="true"/>
21-
<element name="fillOptionValueTitle" type="input" selector="//span[text()='{{var1}}']/parent::div/parent::div/parent::div//tbody/tr[@data-repeat-index='{{var2}}']//label[text()='Title']/parent::span/parent::div//div[@class='admin__field-control']/input" parameterized="true"/>
21+
<element name="fillOptionValueTitle" type="input" selector="//span[text()='{{var1}}']/parent::div/parent::div/parent::div//tbody/tr[@data-repeat-index='{{var2}}']//span[text()='Title']/parent::label/parent::div//div[@class='admin__field-control']/input" parameterized="true"/>
2222
<element name="fillOptionValuePrice" type="input" selector="//span[text()='{{var1}}']/parent::div/parent::div/parent::div//tbody/tr[@data-repeat-index='{{var2}}']//span[text()='Price']/parent::label/parent::div//div[@class='admin__control-addon']/input" parameterized="true"/>
23-
<element name="clickSelectPriceType" type="select" selector="//span[text()='{{var1}}']/parent::div/parent::div/parent::div//tbody//tr[@data-repeat-index='{{var2}}']//label[text()='Price Type']/parent::span/parent::div//select" parameterized="true"/>
23+
<element name="clickSelectPriceType" type="select" selector="//span[text()='{{var1}}']/parent::div/parent::div/parent::div//tbody//tr[@data-repeat-index='{{var2}}']//span[text()='Price Type']/parent::label/parent::div//select" parameterized="true"/>
2424
<!-- Elements that make it easier to select the most recently added element -->
2525
<element name="lastOptionTitle" type="input" selector="//*[@data-index='custom_options']//*[@data-index='options']/tbody/tr[last()]//*[contains(@class, '_required')]//input" />
2626
<element name="lastOptionTypeParent" type="block" selector="//*[@data-index='custom_options']//*[@data-index='options']/tbody/tr[last()]//*[contains(@class, 'admin__action-multiselect-text')]" />

app/code/Magento/Catalog/Test/Mftf/Section/AdminProductFormSection.xml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
<element name="productName" type="input" selector=".admin__field[data-index=name] input"/>
1616
<element name="productNameUseDefault" type="checkbox" selector="input[name='use_default[name]']"/>
1717
<element name="productSku" type="input" selector=".admin__field[data-index=sku] input"/>
18-
<element name="enableProductAttributeLabel" type="text" selector="[data-index='status'] .admin__field-label label"/>
19-
<element name="enableProductAttributeLabelWrapper" type="text" selector="[data-index='status'] .admin__field-label"/>
2018
<element name="productStatus" type="checkbox" selector="input[name='product[status]']"/>
2119
<element name="productStatusUseDefault" type="checkbox" selector="input[name='use_default[status]']"/>
2220
<element name="productPrice" type="input" selector=".admin__field[data-index=price] input"/>
@@ -33,7 +31,7 @@
3331
<element name="visibilityUseDefault" type="checkbox" selector="//input[@name='use_default[visibility]']"/>
3432
<element name="divByDataIndex" type="input" selector="div[data-index='{{var}}']" parameterized="true"/>
3533
<element name="attributeSetSearchCount" type="text" selector="div[data-index='attribute_set_id'] .admin__action-multiselect-search-count"/>
36-
<element name="attributeLabelByText" type="text" selector="//*[@class='admin__field']//label[text()='{{attributeLabel}}']" parameterized="true"/>
34+
<element name="attributeLabelByText" type="text" selector="//*[@class='admin__field']//span[text()='{{attributeLabel}}']" parameterized="true"/>
3735
<element name="addAttributeBtn" type="button" selector="#addAttribute"/>
3836
</section>
3937
<section name="ProductInWebsitesSection">

app/code/Magento/Ui/view/base/web/templates/form/field.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
visible="visible"
99
css="$data.additionalClasses"
1010
attr="'data-index': index">
11-
<span class="admin__field-label" if="$data.label" visible="$data.labelVisible">
12-
<label translate="label" attr="'data-config-scope': $data.scopeLabel, for: uid"/>
13-
</span>
11+
<label class="admin__field-label" if="$data.label" visible="$data.labelVisible" attr="for: uid">
12+
<span translate="label" attr="'data-config-scope': $data.scopeLabel"/>
13+
</label>
1414
<div class="admin__field-control"
1515
css="'_with-tooltip': $data.tooltip, '_with-reset': $data.showFallbackReset && $data.isDifferedFromDefault">
1616
<render args="elementTmpl" ifnot="hasAddons()"/>

app/design/adminhtml/Magento/backend/web/css/source/forms/_fields.less

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,11 @@
5959
}
6060

6161
.abs-field-no-label {
62+
/**
63+
*@codingStandardsIgnoreStart
64+
*/
6265
#mix-grid .return_length(@field-label-grid__column, @field-grid__columns, '+');
66+
//@codingStandardsIgnoreEnd
6367
margin-left: @_length;
6468
}
6569

@@ -183,13 +187,10 @@
183187

184188
.admin__field-label {
185189
color: @field-label__color;
190+
cursor: pointer;
186191
margin: 0;
187192
text-align: right;
188193

189-
label {
190-
cursor: pointer;
191-
}
192-
193194
+ br {
194195
display: none;
195196
}
@@ -210,7 +211,7 @@
210211
overflow: hidden;
211212
}
212213

213-
label {
214+
span {
214215
display: inline-block;
215216
line-height: @field-label__line-height;
216217
vertical-align: middle;
@@ -228,7 +229,7 @@
228229

229230
.required > &, // ToDo UI: change classes 'required' to '_required'.
230231
._required > & {
231-
> label {
232+
> span {
232233
&:after {
233234
color: @validation__color;
234235
content: '*';
@@ -291,7 +292,11 @@
291292
// Till that time they'll be disabled by commenting pseudo-element content property.
292293
&[data-config-scope] {
293294
&:before {
295+
/**
296+
*@codingStandardsIgnoreStart
297+
*/
294298
#mix-grid .return_length(@field-label-grid__column + @field-control-grid__column, @field-grid__columns);
299+
//@codingStandardsIgnoreEnd
295300
color: @field-scope__color;
296301
content: attr(data-config-scope);
297302
display: inline-block;
@@ -515,7 +520,7 @@
515520
position: absolute;
516521
top: 0;
517522

518-
label {
523+
span {
519524
&:before {
520525
display: block;
521526
}
@@ -530,7 +535,7 @@
530535
}
531536

532537
& > .admin__field-label {
533-
label {
538+
span {
534539
&:before {
535540
display: none;
536541
}

dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/ProductForm.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class ProductForm extends FormSections
2828
*
2929
* @var string
3030
*/
31-
protected $attribute = './/*[contains(@class,"label")]/label[text()="%s"]';
31+
protected $attribute = './/*[contains(@class,"label")]/span[text()="%s"]';
3232

3333
/**
3434
* Product new from date field on the product form

0 commit comments

Comments
 (0)