Skip to content

Commit bb5bf78

Browse files
#692: Fix skipped MFTF tests after Chrome update
- fix sortable when dropping to hidden content type
1 parent 089513f commit bb5bf78

File tree

4 files changed

+6
-10
lines changed

4 files changed

+6
-10
lines changed

app/code/Magento/PageBuilder/Test/Mftf/Test/AdminPageBuilderRowTest/ValidateCannotMoveContentTypeIntoHiddenRowTest.xml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@
2020
<group value="pagebuilder-row"/>
2121
<group value="pagebuilder-heading"/>
2222
<group value="pagebuilder-hideShow"/>
23-
<skip>
24-
<issueId value="PB-701" />
25-
</skip>
2623
</annotations>
2724
<before>
2825
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>

app/code/Magento/PageBuilder/Test/Mftf/Test/AdminPageBuilderTabGroupTest/ValidateCannotMoveContentTypeIntoHiddenTabTest.xml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,6 @@
2121
<group value="pagebuilder-tab"/>
2222
<group value="pagebuilder-tabGroup"/>
2323
<group value="pagebuilder-hideShow"/>
24-
<skip>
25-
<issueId value="PB-701" />
26-
</skip>
2724
</annotations>
2825
<before>
2926
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>

app/code/Magento/PageBuilder/view/adminhtml/web/js/drag-drop/sortable.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/code/Magento/PageBuilder/view/adminhtml/web/ts/js/drag-drop/sortable.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,13 +243,15 @@ function onSortReceive(preview: Preview, event: Event, ui: JQueryUI.SortableUIPa
243243
*/
244244
function onSortUpdate(preview: Preview, event: Event, ui: JQueryUI.SortableUIParams) {
245245
// If the sortable instance is disabled don't complete this operation
246-
if ($(this).sortable("option", "disabled") || ui.item.parents(hiddenClass).length > 0) {
246+
if (($(this).hasClass("ui-sortable") && $(this).sortable("option", "disabled"))
247+
|| ui.item.parents(hiddenClass).length > 0
248+
) {
247249
ui.item.remove();
248250
$(this).sortable("cancel");
249251

250252
// jQuery tries to reset the state but kills KO's bindings, so we'll force a re-render on the content type
251253
if (ui.item.length > 0 && typeof ko.dataFor(ui.item[0]) !== "undefined") {
252-
const contentType = ko.dataFor(ui.item[0]).contentType as ContentTypeCollectionInterface;
254+
const contentType = ko.dataFor(ui.item[0]).parentContentType as ContentTypeCollectionInterface;
253255
const children = contentType.getChildren()().splice(0);
254256
contentType.getChildren()([]);
255257
contentType.getChildren()(children);

0 commit comments

Comments
 (0)