Skip to content

Commit 3cf122c

Browse files
MAGETWO-96416: Clicking on a Root Category causes all other Root Categories to be expanded to the top-level categories
1 parent d583606 commit 3cf122c

File tree

4 files changed

+33
-2
lines changed

4 files changed

+33
-2
lines changed

app/code/Magento/Catalog/Block/Adminhtml/Category/Tree.php

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public function __construct(
7171
}
7272

7373
/**
74-
* @return void
74+
* @inheritdoc
7575
*/
7676
protected function _construct()
7777
{
@@ -80,7 +80,7 @@ protected function _construct()
8080
}
8181

8282
/**
83-
* @return $this
83+
* @inheritdoc
8484
*/
8585
protected function _prepareLayout()
8686
{
@@ -182,6 +182,8 @@ public function getSuggestedCategoriesJson($namePart)
182182
}
183183

184184
/**
185+
* Get add root button html
186+
*
185187
* @return string
186188
*/
187189
public function getAddRootButtonHtml()
@@ -190,6 +192,8 @@ public function getAddRootButtonHtml()
190192
}
191193

192194
/**
195+
* Get add sub button html
196+
*
193197
* @return string
194198
*/
195199
public function getAddSubButtonHtml()
@@ -198,6 +202,8 @@ public function getAddSubButtonHtml()
198202
}
199203

200204
/**
205+
* Get expand button html
206+
*
201207
* @return string
202208
*/
203209
public function getExpandButtonHtml()
@@ -206,6 +212,8 @@ public function getExpandButtonHtml()
206212
}
207213

208214
/**
215+
* Get collapse button html
216+
*
209217
* @return string
210218
*/
211219
public function getCollapseButtonHtml()
@@ -214,6 +222,8 @@ public function getCollapseButtonHtml()
214222
}
215223

216224
/**
225+
* Get store switcher
226+
*
217227
* @return string
218228
*/
219229
public function getStoreSwitcherHtml()
@@ -222,6 +232,8 @@ public function getStoreSwitcherHtml()
222232
}
223233

224234
/**
235+
* Get loader tree url
236+
*
225237
* @param bool|null $expanded
226238
* @return string
227239
*/
@@ -235,6 +247,8 @@ public function getLoadTreeUrl($expanded = null)
235247
}
236248

237249
/**
250+
* Get nodes url
251+
*
238252
* @return string
239253
*/
240254
public function getNodesUrl()
@@ -243,6 +257,8 @@ public function getNodesUrl()
243257
}
244258

245259
/**
260+
* Get switcher tree url
261+
*
246262
* @return string
247263
*/
248264
public function getSwitchTreeUrl()
@@ -254,6 +270,8 @@ public function getSwitchTreeUrl()
254270
}
255271

256272
/**
273+
* Get is was expanded
274+
*
257275
* @return bool
258276
* @SuppressWarnings(PHPMD.BooleanGetMethodName)
259277
*/
@@ -263,6 +281,8 @@ public function getIsWasExpanded()
263281
}
264282

265283
/**
284+
* Get move url
285+
*
266286
* @return string
267287
*/
268288
public function getMoveUrl()
@@ -271,6 +291,8 @@ public function getMoveUrl()
271291
}
272292

273293
/**
294+
* Get tree
295+
*
274296
* @param mixed|null $parenNodeCategory
275297
* @return array
276298
*/
@@ -282,6 +304,8 @@ public function getTree($parenNodeCategory = null)
282304
}
283305

284306
/**
307+
* Get tree json
308+
*
285309
* @param mixed|null $parenNodeCategory
286310
* @return string
287311
*/
@@ -390,6 +414,8 @@ public function buildNodeName($node)
390414
}
391415

392416
/**
417+
* Is category movable
418+
*
393419
* @param Node|array $node
394420
* @return bool
395421
*/
@@ -403,6 +429,8 @@ protected function _isCategoryMoveable($node)
403429
}
404430

405431
/**
432+
* Is parent selected category
433+
*
406434
* @param Node|array $node
407435
* @return bool
408436
*/

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@
109109
<element name="PageSize" type="input" selector="input[name='parameters[page_size]']"/>
110110
<element name="ProductAttribute" type="multiselect" selector="select[name='parameters[show_attributes][]']" />
111111
<element name="ButtonToShow" type="multiselect" selector="select[name='parameters[show_buttons][]']"/>
112+
<element name="ExpandRootCategory" type="text" selector="img.x-tree-elbow-end-plus"/>
112113
<!--Compare on Storefront-->
113114
<element name="ProductName" type="text" selector=".product.name.product-item-name" />
114115
<element name="CompareBtn" type="button" selector=".action.tocompare"/>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
<selectOption selector="{{WidgetSection.WidgetTemplate}}" userInput="Category Link Block Template" stepKey="selectTemplate" />
4747
<click selector="{{WidgetSection.BtnChooser}}" stepKey="clickSelectCategoryBtn" />
4848
<waitForLoadingMaskToDisappear stepKey="wait3"/>
49+
<click selector="{{WidgetSection.ExpandRootCategory}}" stepKey="expandRootCategory" />
4950
<click userInput="$$createPreReqCategory.name$$" stepKey="selectPreCreateCategory" />
5051
<waitForElementNotVisible selector="{{WidgetSection.SelectCategoryTitle}}" stepKey="waitForSlideoutCloses1" />
5152
<click selector="{{WidgetSection.InsertWidget}}" stepKey="clickInsertWidget" />

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
<selectOption selector="{{WidgetSection.WidgetTemplate}}" userInput="Product Link Block Template" stepKey="selectTemplate" />
5151
<click selector="{{WidgetSection.BtnChooser}}" stepKey="clickSelectPageBtn" />
5252
<waitForLoadingMaskToDisappear stepKey="wait4"/>
53+
<click selector="{{WidgetSection.ExpandRootCategory}}" stepKey="expandRootCategory" />
5354
<click selector="{{WidgetSection.PreCreateCategory('$$createPreReqCategory.name$$')}}" stepKey="selectPreCategory" />
5455
<waitForLoadingMaskToDisappear stepKey="waitLoadingMask" />
5556
<click selector="{{WidgetSection.PreCreateProduct('$$createPreReqProduct.name$$')}}" stepKey="selectPreProduct" />

0 commit comments

Comments
 (0)