Skip to content

Commit 10d4140

Browse files
committed
MC-3908: Dragging a text content block into the stage causes global styles to be changed and fonts to flash
- Fix build issues
1 parent b3e5964 commit 10d4140

File tree

7 files changed

+28
-20
lines changed

7 files changed

+28
-20
lines changed

app/code/Magento/PageBuilder/Test/Mftf/ActionGroup/WYSIWYGActionGroup.xml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
<argument name="variable" defaultValue=""/>
2828
</arguments>
2929
<comment userInput="Adding Variable To Tiny MCE" stepKey="commentAddVariableToTinyMCE"/>
30-
<waitForElementVisible selector="{{TinyMCESection.InsertVariableIcon}}" stepKey="waitForInsertVariable1"/>
31-
<click selector="{{TinyMCESection.InsertVariableIcon}}" stepKey="clickInsertVariable1"/>
30+
<waitForElementVisible selector="{{WYSIWYGInline.notCss}} {{TinyMCESection.InsertVariableIcon}}" stepKey="waitForInsertVariable1"/>
31+
<click selector="{{WYSIWYGInline.notCss}} {{TinyMCESection.InsertVariableIcon}}" stepKey="clickInsertVariable1"/>
3232
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappear"/>
3333
<waitForElementVisible selector="{{VariableSection.Radio(variable.variableName)}}" stepKey="waitForVariable1"/>
3434
<checkOption selector="{{VariableSection.Radio(variable.variableName)}}" stepKey="selectVariable"/>
@@ -67,8 +67,8 @@
6767
<argument name="page" defaultValue="" type="string"/>
6868
</arguments>
6969
<comment userInput="Adding Widget To Tiny MCE" stepKey="commentAddWidget"/>
70-
<waitForElementVisible selector="{{TinyMCESection.InsertWidgetIcon}}" stepKey="waitForInsertWidget1"/>
71-
<click selector="{{TinyMCESection.InsertWidgetIcon}}" stepKey="clickAddWidgetBtn"/>
70+
<waitForElementVisible selector="{{WYSIWYGInline.notCss}} {{TinyMCESection.InsertWidgetIcon}}" stepKey="waitForInsertWidget1"/>
71+
<click selector="{{WYSIWYGInline.notCss}} {{TinyMCESection.InsertWidgetIcon}}" stepKey="clickAddWidgetBtn"/>
7272
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappear"/>
7373
<waitForElementVisible selector="{{WidgetSection.WidgetType}}" stepKey="waitForWidgetType"/>
7474
<selectOption selector="{{WidgetSection.WidgetType}}" userInput="{{TinyMCEWidgetCMSPageLink.widgetType}}" stepKey="selectCMSPageLinkWidget"/>
@@ -131,8 +131,8 @@
131131
<argument name="title" type="string" defaultValue=""/>
132132
</arguments>
133133
<comment userInput="insertLinkInWYSIWYG" stepKey="comment"/>
134-
<waitForElementVisible selector="{{section.InsertLink}}" stepKey="waitForInsertLinkButton"/>
135-
<click selector="{{section.InsertLink}}" stepKey="clickInsertLinkButton"/>
134+
<waitForElementVisible selector="{{WYSIWYGInline.notCss}} {{section.InsertLink}}" stepKey="waitForInsertLinkButton"/>
135+
<click selector="{{WYSIWYGInline.notCss}} {{section.InsertLink}}" stepKey="clickInsertLinkButton"/>
136136
<waitForPageLoad stepKey="waitForPageLoad"/>
137137
<waitForElementVisible selector="{{WYSIWYGInsertLinkModal.modal}}" stepKey="waitForInsertLinkModal"/>
138138
<fillField selector="{{WYSIWYGInsertLinkModal.urlInput}}" userInput="{{url}}" stepKey="insertUrl"/>

app/code/Magento/PageBuilder/Test/Mftf/Section/PageBuilderTextSection.xml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,11 @@
109109
<element name="generalFilter" type="input" selector="input.admin__control-text[name='{{arg1}}']" parameterized="true"/>
110110
</section>
111111
<section name="WYSIWYGOnPageBuilder">
112-
<element name="undo" type="button" selector="div[aria-label='Undo']"/>
113-
<element name="redo" type="button" selector="div[aria-label='Redo']"/>
114-
<element name="fontSize" type="button" selector="div[aria-label='Font Sizes']"/>
115-
<element name="textColor" type="button" selector="div[aria-label='Text color']"/>
116-
<element name="backgroundColor" type="button" selector="div[aria-label='Background color']"/>
117-
<element name="formatSelector" type="button" selector="//span[text()='Formats']"/>
112+
<element name="undo" type="button" selector=".mce-tinymce:not(.mce-tinymce-inline) div[aria-label='Undo']"/>
113+
<element name="redo" type="button" selector=".mce-tinymce:not(.mce-tinymce-inline) div[aria-label='Redo']"/>
114+
<element name="fontSize" type="button" selector=".mce-tinymce:not(.mce-tinymce-inline) div[aria-label='Font Sizes']"/>
115+
<element name="textColor" type="button" selector=".mce-tinymce:not(.mce-tinymce-inline) div[aria-label='Text color']"/>
116+
<element name="backgroundColor" type="button" selector=".mce-tinymce:not(.mce-tinymce-inline) div[aria-label='Background color']"/>
117+
<element name="formatSelector" type="button" selector="//div[contains(@class, 'mce-tinymce') and not(contains(@class, 'mce-tinymce-inline'))]//span[text()='Formats']"/>
118118
</section>
119119
</sections>

app/code/Magento/PageBuilder/Test/Mftf/Section/PageBuilderWYSIWYGSection.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88

99
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
11+
<section name="WYSIWYGInline">
12+
<element name="notCss" type="button" selector=".mce-tinymce:not(.mce-tinymce-inline)"/>
13+
</section>
1114
<section name="WYSIWYGInsertLinkModal">
1215
<element name="modal" type="input" selector="[aria-label='Insert link']"/>
1316
<element name="title" type="input" selector="//div[@aria-label='Insert link']//div[contains(@id,'-title') and .='Insert link']"/>

app/code/Magento/PageBuilder/Test/Mftf/Test/AdminPageBuilderAdvancedConfigurationTest.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1866,6 +1866,7 @@
18661866
<argument name="containerTargetIndex" value="1"/>
18671867
<argument name="contentTypeIndex" value="1"/>
18681868
</actionGroup>
1869+
<actionGroup ref="clickOutsideTextInlineEditing" stepKey="closeLiveEdit"/>
18691870
<actionGroup ref="openPageBuilderEditPanelByIndex" stepKey="openEditMenuOnStage1">
18701871
<argument name="contentType" value="PageBuilderTextContentType"/>
18711872
<argument name="contentTypeIndex" value="1"/>
@@ -1886,6 +1887,7 @@
18861887
<argument name="containerTargetIndex" value="2"/>
18871888
<argument name="contentTypeIndex" value="2"/>
18881889
</actionGroup>
1890+
<actionGroup ref="clickOutsideTextInlineEditing" stepKey="closeLiveEdit1"/>
18891891
<actionGroup ref="openPageBuilderEditPanelByIndex" stepKey="openEditMenuOnStage2">
18901892
<argument name="contentType" value="PageBuilderTextContentType"/>
18911893
<argument name="contentTypeIndex" value="2"/>
@@ -1906,6 +1908,7 @@
19061908
<argument name="containerTargetIndex" value="3"/>
19071909
<argument name="contentTypeIndex" value="3"/>
19081910
</actionGroup>
1911+
<actionGroup ref="clickOutsideTextInlineEditing" stepKey="closeLiveEdit2"/>
19091912
<actionGroup ref="openPageBuilderEditPanelByIndex" stepKey="openEditMenuOnStage3">
19101913
<argument name="contentType" value="PageBuilderTextContentType"/>
19111914
<argument name="contentTypeIndex" value="3"/>
@@ -1926,6 +1929,7 @@
19261929
<argument name="containerTargetIndex" value="4"/>
19271930
<argument name="contentTypeIndex" value="4"/>
19281931
</actionGroup>
1932+
<actionGroup ref="clickOutsideTextInlineEditing" stepKey="closeLiveEdit4"/>
19291933
<actionGroup ref="openPageBuilderEditPanelByIndex" stepKey="openEditMenuOnStage4">
19301934
<argument name="contentType" value="PageBuilderTextContentType"/>
19311935
<argument name="contentTypeIndex" value="4"/>
@@ -1946,6 +1950,7 @@
19461950
<argument name="containerTargetIndex" value="5"/>
19471951
<argument name="contentTypeIndex" value="5"/>
19481952
</actionGroup>
1953+
<actionGroup ref="clickOutsideTextInlineEditing" stepKey="closeLiveEdit5"/>
19491954
<actionGroup ref="openPageBuilderEditPanelByIndex" stepKey="openEditMenuOnStage5">
19501955
<argument name="contentType" value="PageBuilderTextContentType"/>
19511956
<argument name="contentTypeIndex" value="5"/>
@@ -2191,6 +2196,7 @@
21912196
<argument name="containerTargetIndex" value="1"/>
21922197
<argument name="contentTypeIndex" value="1"/>
21932198
</actionGroup>
2199+
<actionGroup ref="clickOutsideTextInlineEditing" stepKey="closeLiveEdit"/>
21942200
<actionGroup ref="openPageBuilderEditPanelByIndex" stepKey="openEditMenuOnStage1">
21952201
<argument name="contentType" value="PageBuilderTextContentType"/>
21962202
<argument name="contentTypeIndex" value="1"/>
@@ -2211,6 +2217,7 @@
22112217
<argument name="containerTargetIndex" value="2"/>
22122218
<argument name="contentTypeIndex" value="2"/>
22132219
</actionGroup>
2220+
<actionGroup ref="clickOutsideTextInlineEditing" stepKey="closeLiveEdit1"/>
22142221
<actionGroup ref="openPageBuilderEditPanelByIndex" stepKey="openEditMenuOnStage2">
22152222
<argument name="contentType" value="PageBuilderTextContentType"/>
22162223
<argument name="contentTypeIndex" value="2"/>
@@ -2231,6 +2238,7 @@
22312238
<argument name="containerTargetIndex" value="3"/>
22322239
<argument name="contentTypeIndex" value="3"/>
22332240
</actionGroup>
2241+
<actionGroup ref="clickOutsideTextInlineEditing" stepKey="closeLiveEdit2"/>
22342242
<actionGroup ref="openPageBuilderEditPanelByIndex" stepKey="openEditMenuOnStage3">
22352243
<argument name="contentType" value="PageBuilderTextContentType"/>
22362244
<argument name="contentTypeIndex" value="3"/>
@@ -2251,6 +2259,7 @@
22512259
<argument name="containerTargetIndex" value="4"/>
22522260
<argument name="contentTypeIndex" value="4"/>
22532261
</actionGroup>
2262+
<actionGroup ref="clickOutsideTextInlineEditing" stepKey="closeLiveEdit3"/>
22542263
<actionGroup ref="openPageBuilderEditPanelByIndex" stepKey="openEditMenuOnStage4">
22552264
<argument name="contentType" value="PageBuilderTextContentType"/>
22562265
<argument name="contentTypeIndex" value="4"/>
@@ -2271,6 +2280,7 @@
22712280
<argument name="containerTargetIndex" value="5"/>
22722281
<argument name="contentTypeIndex" value="5"/>
22732282
</actionGroup>
2283+
<actionGroup ref="clickOutsideTextInlineEditing" stepKey="closeLiveEdit4"/>
22742284
<actionGroup ref="openPageBuilderEditPanelByIndex" stepKey="openEditMenuOnStage5">
22752285
<argument name="contentType" value="PageBuilderTextContentType"/>
22762286
<argument name="contentTypeIndex" value="5"/>

app/code/Magento/PageBuilder/Test/Mftf/Test/AdminPageBuilderTextTest.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2189,6 +2189,7 @@
21892189
<actionGroup ref="dragContentTypeToStage" stepKey="dragContentTypeToStage">
21902190
<argument name="contentType" value="PageBuilderTextContentType"/>
21912191
</actionGroup>
2192+
<actionGroup ref="clickOutsideTextInlineEditing" stepKey="closeLiveEdit"/>
21922193
<actionGroup ref="openPageBuilderEditPanel" stepKey="openEditMenuOnStage">
21932194
<argument name="contentType" value="PageBuilderTextContentType"/>
21942195
</actionGroup>

app/code/Magento/PageBuilder/view/adminhtml/web/js/content-type/text/preview.js

Lines changed: 1 addition & 5 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/content-type/text/preview.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,7 @@ export default class Preview extends BasePreview {
4848
element.id = this.parent.id + "-editor";
4949

5050
const wysiwygConfig = this.config.additional_data.wysiwygConfig.wysiwygConfigData;
51-
if (this.parent.dropped) {
52-
wysiwygConfig.adapter.settings.auto_focus = element.id;
53-
}
51+
wysiwygConfig.adapter.settings.auto_focus = this.parent.dropped ? element.id : null;
5452

5553
WysiwygFactory(
5654
this.parent.id,

0 commit comments

Comments
 (0)