Skip to content

Commit 4bfcc46

Browse files
committed
AC-8260: Migration from extjs library to jstree in file js/category-checkbox-tree.js
1 parent 13e54e1 commit 4bfcc46

File tree

9 files changed

+221
-245
lines changed

9 files changed

+221
-245
lines changed

app/code/Magento/Catalog/view/adminhtml/web/js/category-checkbox-tree.js

Lines changed: 178 additions & 231 deletions
Large diffs are not rendered by default.

app/code/Magento/CatalogWidget/Test/Mftf/ActionGroup/AdminFillCatalogProductsListWidgetCategoryActionGroup.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
<click selector="{{WidgetSection.RuleParam}}" stepKey="clickToAddRuleParam"/>
2626
<click selector="{{WidgetSection.Chooser}}" stepKey="clickToSelectFromList"/>
2727
<waitForPageLoad stepKey="waitForPageLoadAfterSelectingRuleParam"/>
28-
<waitForElementVisible selector="{{WidgetSection.PreCreateCategory(categoryName)}}" stepKey="waitForCategoryElementVisible"/>
29-
<click selector="{{WidgetSection.PreCreateCategory(categoryName)}}" stepKey="selectCategoryFromArguments"/>
28+
<waitForElementVisible selector="{{WidgetSection.CreateCategory(categoryName)}}" stepKey="waitForCategoryElementVisible"/>
29+
<click selector="{{WidgetSection.CreateCategory(categoryName)}}" stepKey="selectCategoryFromArguments"/>
3030
<click selector="{{AdminNewWidgetSection.applyParameter}}" stepKey="clickApplyButton"/>
3131
<waitForElementNotVisible selector="{{InsertWidgetSection.categoryTreeWrapper}}" stepKey="waitForCategoryTreeIsNotVisible"/>
3232
</actionGroup>

app/code/Magento/CatalogWidget/Test/Mftf/Test/CatalogProductListCheckWidgetOrderTest.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@
6868
<click selector="{{WidgetSection.RuleParam}}" stepKey="clickRuleParam" />
6969
<waitForElementVisible selector="{{WidgetSection.Chooser}}" stepKey="waitForElement" />
7070
<click selector="{{WidgetSection.Chooser}}" stepKey="clickChooser" />
71-
<waitForElementVisible selector="{{WidgetSection.PreCreateCategory('$simplecategory.name$')}}" stepKey="waitForCategoryVisible" />
72-
<click selector="{{WidgetSection.PreCreateCategory('$simplecategory.name$')}}" stepKey="selectCategory" />
71+
<waitForElementVisible selector="{{WidgetSection.CreateCategory('$simplecategory.name$')}}" stepKey="waitForCategoryVisible" />
72+
<click selector="{{WidgetSection.CreateCategory('$simplecategory.name$')}}" stepKey="selectCategory" />
7373
<actionGroup ref="AdminClickInsertWidgetActionGroup" stepKey="clickInsertWidget"/>
7474
<!--Save cms page and go to Storefront-->
7575
<actionGroup ref="SaveCmsPageActionGroup" stepKey="saveCmsPage"/>

app/code/Magento/Cms/Test/Mftf/Section/TinyMCESection/WidgetSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
<element name="CMSPage" type="text" selector="//td[contains(text(),'Home page')]"/>
2626
<element name="BlockPage" type="text" selector="//td[contains(text(),'{{var1}}')]" parameterized="true"/>
2727
<element name="PreCreateCategory" type="text" selector=" //span[contains(text(),'{{var1}}')]" parameterized="true"/>
28+
<element name="CreateCategory" type="text" selector=" //a[contains(text(),'{{var1}}')]" parameterized="true"/>
2829
<element name="PreCreateProduct" type="text" selector="//td[contains(text(),'{{var1}}')]" parameterized="true"/>
2930
<element name="NoOfProductToDisplay" type="input" selector="input[data-ui-id='wysiwyg-widget-options-fieldset-element-text-parameters-products-count']"/>
3031
<element name="AddParam" type="button" selector=".rule-param-add"/>

app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogProductListTypeTest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
<waitForElementVisible selector="{{WidgetSection.Chooser}}" stepKey="waitForElement" />
5858
<click selector="{{WidgetSection.Chooser}}" stepKey="clickChooser" />
5959
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskDisappear4" />
60-
<click selector="{{WidgetSection.PreCreateCategory('$$createPreReqCategory.name$$')}}" stepKey="selectPreCategory" />
60+
<click selector="{{WidgetSection.CreateCategory('$$createPreReqCategory.name$$')}}" stepKey="selectPreCategory" />
6161

6262
<!-- Test that the "<" operand functions correctly -->
6363
<click selector="{{WidgetSection.AddParam}}" stepKey="clickAddParamBtn2" />

app/code/Magento/SalesRule/Test/Mftf/Section/AdminCartPriceRulesFormSection.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
<element name="ruleParameterSelect" type="select" selector="rule[conditions][{{arg}}][operator]" parameterized="true"/>
5050
<element name="ruleParameterInput" type="input" selector="rule[conditions][{{arg}}][value]" parameterized="true"/>
5151
<element name="openChooser" type="button" selector="//label[@for='conditions__{{arg}}__value']" parameterized="true"/>
52-
<element name="categoryCheckbox" type="checkbox" selector="//span[contains(text(), '{{arg}}')]/parent::a/preceding-sibling::input[@type='checkbox']" parameterized="true"/>
52+
<element name="categoryCheckbox" type="checkbox" selector="//a[contains(text(), '{{arg}}')]" parameterized="true"/>
5353
<element name="newCondition" type="button" selector=".rule-param.rule-param-new-child" timeout="30"/>
5454
<element name="conditionSelect" type="select" selector="select[name='rule[conditions][1][new_child]']"/>
5555
<element name="targetEllipsis" type="input" selector="//ul[contains(@id, 'conditions')]//a[.='...']"/>

app/code/Magento/SalesRule/Test/Mftf/Section/PriceRuleConditionsSection.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
<element name="firstProductAttributeSelected" type="select" selector="#conditions__1__children .rule-param:nth-of-type(2) a:nth-child(1)"/>
1515
<element name="changeCategoriesButton" type="text" selector="#conditions__1--1__children>li>span.rule-param:nth-of-type(2)>a"/>
1616
<element name="categoriesChooser" type="text" selector="#conditions__1--1__children>li>span.rule-param:nth-of-type(2)>span>label>a"/>
17-
<element name="treeRoot" type="text" selector=".x-tree-root-ct.x-tree-lines"/>
18-
<element name="lastTreeNode" type="text" selector=".x-tree-root-ct.x-tree-lines > div > li > ul > li:last-child div img.x-tree-elbow-end-plus"/>
19-
<element name="subcategory4level" type="text" selector=".x-tree-root-ct.x-tree-lines > div > li > ul > li > ul > li > ul > li > ul > li > div img.x-tree-elbow-end-plus"/>
17+
<element name="treeRoot" type="text" selector=".jstree-container-ul.jstree-children"/>
18+
<element name="lastTreeNode" type="text" selector="//li[contains(@class,'jstree-node') and contains(@class,'jstree-closed')]//i[contains(@class,'jstree-ocl')]"/>
19+
<element name="subcategory4level" type="text" selector=".jstree-container-ul .jstree-children li > ul > li > ul > li > ul > li i.jstree-ocl"/>
2020

2121
<element name="ruleParamLink" type="button" selector="//*[@id='conditions__{{var1}}__children']/li[{{var2}}]/span[{{var3}}]/a" parameterized="true"/>
2222
<element name="operatorByIndex" type="input" selector="#conditions__{{var1}}--{{var2}}__operator" parameterized="true"/>

app/code/Magento/SalesRule/Test/Mftf/Test/PriceRuleCategoryNestingTest.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,9 @@
5959
<waitForElement selector="{{PriceRuleConditionsSection.treeRoot}}" stepKey="wait3"/>
6060
<click selector="{{PriceRuleConditionsSection.lastTreeNode}}" stepKey="openLatestTreeNode1"/>
6161
<click selector="{{PriceRuleConditionsSection.lastTreeNode}}" stepKey="openLatestTreeNode2"/>
62-
<click selector="{{PriceRuleConditionsSection.lastTreeNode}}" stepKey="openLatestTreeNode3"/>
6362
<waitForAjaxLoad stepKey="ajaxLoad4"/>
63+
<click selector="{{PriceRuleConditionsSection.lastTreeNode}}" stepKey="openLatestTreeNode3"/>
64+
<waitForAjaxLoad stepKey="ajaxLoad5"/>
6465
<waitForElement selector="{{PriceRuleConditionsSection.subcategory4level}}" stepKey="wait4"/>
6566
<click selector="{{PriceRuleConditionsSection.subcategory4level}}" stepKey="openLatestTreeNode4"/>
6667
<scrollToTopOfPage stepKey="scrollToTop"/>

app/design/adminhtml/Magento/backend/web/css/source/components/_rules-temp.less

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,21 @@
1-
// /**
2-
// * Copyright © Magento, Inc. All rights reserved.
3-
// * See COPYING.txt for license details.
4-
// */
1+
/************************************************************************
2+
*
3+
* ADOBE CONFIDENTIAL
4+
* ___________________
5+
*
6+
* Copyright 2015 Adobe
7+
* All Rights Reserved.
8+
*
9+
* NOTICE: All information contained herein is, and remains
10+
* the property of Adobe and its suppliers, if any. The intellectual
11+
* and technical concepts contained herein are proprietary to Adobe
12+
* and its suppliers and are protected by all applicable intellectual
13+
* property laws, including trade secret and copyright laws.
14+
* Dissemination of this information or reproduction of this material
15+
* is strictly forbidden unless prior written permission is obtained
16+
* from Adobe.
17+
*************************************************************************
18+
*/
519

620
//
721
// Rule tree component
@@ -12,9 +26,13 @@
1226
}
1327

1428
.rule-tree {
29+
/**
30+
* @codingStandardsIgnoreStart
31+
*/
1532
.admin__field-control & {
1633
padding-top: .3rem;
1734
}
35+
//@codingStandardsIgnoreEnd
1836

1937
ul {
2038
border-left: 1px dotted @color-gray52;
@@ -36,6 +54,15 @@
3654
line-height: normal !important;
3755
}
3856

57+
.jstree ul {
58+
border-left: none !important;
59+
padding-left: 0 !important;
60+
}
61+
62+
.jstree li {
63+
margin: 0 0 0 2.4rem;
64+
}
65+
3966
.legend {
4067
font-weight: @font-weight__semibold;
4168
}

0 commit comments

Comments
 (0)