Skip to content

Commit aebe881

Browse files
committed
Merge branch '2.3-develop-main' into MAGETWO-71571-link-ui-component
2 parents cdd4c85 + d3971c9 commit aebe881

File tree

4 files changed

+56
-5
lines changed

4 files changed

+56
-5
lines changed

app/code/Magento/Cms/view/adminhtml/web/js/folder-tree.js

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,18 +77,28 @@ define([
7777
treeLoaded: function () {
7878
var path = this.options.currentPath,
7979
tree = this.element,
80+
lastExistentFolderEl,
8081

8182
/**
82-
* Recursive open.
83+
* Recursively open folders specified in path array.
8384
*/
8485
recursiveOpen = function () {
85-
var el = $('[data-id="' + path.pop() + '"]');
86+
var folderEl = $('[data-id="' + path.pop() + '"]');
87+
88+
// if folder doesn't exist, select the last opened folder
89+
if (!folderEl.length) {
90+
tree.jstree('select_node', lastExistentFolderEl);
91+
92+
return;
93+
}
94+
95+
lastExistentFolderEl = folderEl;
8696

8797
if (path.length > 1) {
88-
tree.jstree('open_node', el, recursiveOpen);
98+
tree.jstree('open_node', folderEl, recursiveOpen);
8999
} else {
90-
tree.jstree('open_node', el, function () {
91-
tree.jstree('select_node', el);
100+
tree.jstree('open_node', folderEl, function () {
101+
tree.jstree('select_node', folderEl);
92102
});
93103
}
94104
};
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="DeleteImageFromStorageActionGroup">
11+
<arguments>
12+
<argument name="Image" defaultValue="" />
13+
</arguments>
14+
<click selector="//small[contains(text(),'{{Image.value}}')]" stepKey="selectImage" />
15+
<see selector="{{MediaGallerySection.DeleteSelectedBtn}}" userInput="Delete Selected" stepKey="seeDeleteBtn"/>
16+
<click selector="{{MediaGallerySection.DeleteSelectedBtn}}" stepKey="clickDeleteSelected" />
17+
<waitForText userInput="OK" stepKey="waitForConfirm" />
18+
<click selector="{{MediaGallerySection.confirmDelete}}" stepKey="confirmDelete" />
19+
<waitForElementNotVisible selector="{{MediaGallerySection.image(ImageUpload.file)}}" stepKey="waitForImageDeleted" />
20+
<dontSeeElement selector="{{MediaGallerySection.image(ImageUpload.file)}}" stepKey="dontSeeImage" />
21+
</actionGroup>
22+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="NavigateToMediaFolderActionGroup">
11+
<arguments>
12+
<argument name="FolderName" type="string" defaultValue="" />
13+
</arguments>
14+
<conditionalClick selector="{{MediaGallerySection.StorageRootArrow}}" dependentSelector="{{MediaGallerySection.checkIfArrowExpand}}" stepKey="clickArrowIfClosed" visible="true"/>
15+
<waitForText userInput="{{FolderName}}" stepKey="waitForNewFolder" />
16+
<click userInput="{{FolderName}}" stepKey="clickOnCreatedFolder" />
17+
<waitForLoadingMaskToDisappear stepKey="waitForLoading5" />
18+
</actionGroup>
19+
</actionGroups>

0 commit comments

Comments
 (0)