Skip to content

Commit fb4b5f6

Browse files
Merge branch 'develop' into 525_mobile_column_width_slider_child_fix
2 parents 7f3c5c2 + b0a25e7 commit fb4b5f6

File tree

11 files changed

+86
-22
lines changed

11 files changed

+86
-22
lines changed

app/code/Magento/PageBuilder/Model/Dom/NodeList.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public function __construct(
4444
/**
4545
* @inheritDoc
4646
*/
47-
public function item($index): ?ElementInterface
47+
public function item(int $index): ?ElementInterface
4848
{
4949
return $this->objectManager->create(ElementInterface::class, [ 'element' => $this->nodeList->item($index) ]);
5050
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="AddPageLinkWidgetToTinyMCEWithAnchorAndTitleActionGroup" extends="addPageLinkWidgetToTinyMCE">
11+
<arguments>
12+
<argument name="anchor" defaultValue="" type="string"/>
13+
<argument name="title" defaultValue="" type="string"/>
14+
</arguments>
15+
<comment userInput="Insert anchor and title text" stepKey="commentAddAnchorAndTitleText" after="waitForLoadingMaskToDisappear2"/>
16+
<waitForElementVisible selector="{{WidgetSection.InputAnchorCustomText}}" stepKey="waitForInputAnchorCustomText" after="commentAddAnchorAndTitleText"/>
17+
<fillField selector="{{WidgetSection.InputAnchorCustomText}}" userInput="{{anchor}}" stepKey="insertTextToDisplay" after="waitForInputAnchorCustomText" />
18+
<waitForElementVisible selector="{{WidgetSection.InputAnchorCustomTitle}}" stepKey="waitForInputAnchorCustomTitle" after="insertTextToDisplay"/>
19+
<fillField selector="{{WidgetSection.InputAnchorCustomTitle}}" userInput="{{title}}" stepKey="insertTitle" after="waitForInputAnchorCustomTitle"/>
20+
<waitForElementVisible selector="{{TinyMCESection.InsertWidgetIcon}}" stepKey="waitForInsertWidget1" after="waitForInsertWidgetModalToClose"/>
21+
<click selector="{{TinyMCESection.InsertWidgetIcon}}" stepKey="clickAddWidgetBtn"/>
22+
</actionGroup>
23+
</actionGroups>

app/code/Magento/PageBuilder/Test/Mftf/Data/TinyMCEData.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@
3939
<data key="stageValue">{{widget type=&quot;Magento\Cms\Block\Widget\Page\Link&quot; template=&quot;widget/link/link_block.phtml&quot; page_id=</data>
4040
<data key="stageValueEncoded">e3t3aWRnZXQgdHlwZT0iTWFnZW50b1xDbXNcQmxvY2tcV2lkZ2V0XFBhZ2VcTGluayIgdGVtcGxhdGU9IndpZGdldC9saW5rL2xpbmtfYmxvY2sucGh0bWwiIHBhZ2VfaWQ9</data>
4141
</entity>
42+
<entity name="TinyMCEWidgetCMSPageLinkWithAnchorAndTitle" extends="TinyMCEWidgetCMSPageLink" type="pagebuilder_text_widget_property">
43+
<data key="anchorText">Piiramatult kõnesid ja SMSe Eestis ja ELi rändluses</data>
44+
<data key="title">Piiramatult kõnesid ja SMSe Eestis ja ELi rändluses</data>
45+
</entity>
4246
<entity name="PageBuilderTextArea_WidgetCMSPageLink" type="pagebuilder_text_widget_property">
4347
<data key="widgetType">Magento\Cms\Block\Widget\Page\Link</data>
4448
<data key="editPanelValue">{{widget type=&quot;Magento\\Cms\\Block\\Widget\\Page\\Link&quot; template=&quot;widget/link/link_block.phtml&quot; page_id=</data>

app/code/Magento/PageBuilder/Test/Mftf/Test/AdminPageBuilderSlideItemCommonTest/SlideItemMoveSlideItemsToRearrangeTest.xml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,13 +101,9 @@
101101
<seeElement selector="{{SlideOnBackend.messageContent('2', PageBuilderSlideItemContent_Slide2.value)}}" stepKey="seeSlide2ContentAfterSave"/>
102102
<!-- Change Slide Order -->
103103
<comment userInput="Change Slide Order" stepKey="commentSortingSlides"/>
104-
<executeJS function="return document.querySelectorAll('{{SliderOnStage.slideNavigationDragHandle}}')[0].clientWidth / 4" stepKey="xCoordinateToMoveTo"/>
105-
<comment userInput="xCoordinateToMoveTo: $xCoordinateToMoveTo" stepKey="commentXCoordinate"/>
106-
<executeJS function="return document.querySelectorAll('{{SliderOnStage.slideNavigationDragHandle}}')[0].clientHeight / 2" stepKey="yCoordinateToMoveTo"/>
107-
<comment userInput="yCoordinateToMoveTo: $yCoordinateToMoveTo" stepKey="commentYCoordinate"/>
108104
<click selector="{{SliderOnStage.slideNavigationDot('1', '3')}}" stepKey="clickSlideDot"/>
109105
<waitForPageLoad stepKey="waitForPageLoad2"/>
110-
<dragAndDrop selector1="{{SliderOnStage.slideNavigationDragHandleByIndex('1', '3')}}" selector2="{{SliderOnStage.slideNavigationDot('1', '1')}}" x="$xCoordinateToMoveTo" y="$yCoordinateToMoveTo" stepKey="dragAndDropSlide"/>
106+
<dragAndDrop selector1="{{SliderOnStage.slideNavigationDragHandleByIndex('1', '3')}}" selector2="{{SliderOnStage.slideNavigationDot('1', '1')}}" x="-1" stepKey="dragAndDropSlide"/>
111107
<waitForPageLoad stepKey="waitForDragAndDrop"/>
112108
<!-- Validate Stage After Sorting -->
113109
<comment userInput="Validate Stage After Sorting" stepKey="commentValidateStage2"/>

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

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,10 @@
4040
<argument name="contentType" value="PageBuilderTextContentType"/>
4141
</actionGroup>
4242
<clickWithLeftButton x="10" y="10" selector="{{TextOnStage.tinymce('1')}}" stepKey="focusOnTextEditorArea"/>
43-
<actionGroup ref="addPageLinkWidgetToTinyMCEInline" stepKey="addPageLinkWidgetToTinyMCE">
44-
<argument name="widget" value="TinyMCEWidgetCMSPageLink"/>
43+
<actionGroup ref="AddPageLinkWidgetToTinyMCEWithAnchorAndTitleActionGroup" stepKey="addPageLinkWidgetToTinyMCE">
4544
<argument name="page" value="$$createCMSPageB.identifier$$"/>
45+
<argument name="anchor" value="{{TinyMCEWidgetCMSPageLinkWithAnchorAndTitle.anchorText}}"/>
46+
<argument name="title" value="{{TinyMCEWidgetCMSPageLinkWithAnchorAndTitle.title}}"/>
4647
</actionGroup>
4748
<waitForElementVisible selector="{{TextOnStage.text('1', TinyMCEWidgetCMSPageLink.editPanelValue)}}" stepKey="waitForWidgetStage1"/>
4849
<!--Verify widget edit page-->
@@ -73,6 +74,19 @@
7374
<actionGroup ref="doubleClickWidgetTinyMCE" stepKey="doubleClickWidget">
7475
<argument name="widget" value="TinyMCEWidgetCMSPageLink.editPanelValue"/>
7576
</actionGroup>
77+
<!-- Grab a value from the link-->
78+
<waitForElementVisible selector="{{WidgetSection.InputAnchorCustomText}}" stepKey="waitForInputAnchorCustomText"/>
79+
<grabValueFrom selector="{{WidgetSection.InputAnchorCustomText}}" stepKey="grabAnchorText"/>
80+
<waitForElementVisible selector="{{WidgetSection.InputAnchorCustomTitle}}" stepKey="waitForInputAnchorCustomTitle"/>
81+
<grabValueFrom selector="{{WidgetSection.InputAnchorCustomTitle}}" stepKey="grabTitleText"/>
82+
<assertEquals stepKey="assertAnchorTextCMSWidgetLink" message="pass">
83+
<expectedResult type="string">{{TinyMCEWidgetCMSPageLinkWithAnchorAndTitle.anchorText}}</expectedResult>
84+
<actualResult type="string">{$grabAnchorText}</actualResult>
85+
</assertEquals>
86+
<assertEquals stepKey="assertTitleCMSWidgetLink" message="pass">
87+
<expectedResult type="string">{{TinyMCEWidgetCMSPageLinkWithAnchorAndTitle.title}}</expectedResult>
88+
<actualResult type="string">{$grabTitleText}</actualResult>
89+
</assertEquals>
7690
<actionGroup ref="closeWidgetPanelTinyMCE" stepKey="closeWidgetPanelTinyMCE"/>
7791
<!-- Validate Storefront -->
7892
<comment userInput="Verify Widget Content Type on storefront" stepKey="commentVerifyWidgetOnStorefront"/>

app/code/Magento/PageBuilder/view/adminhtml/web/js/utils/editor.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/**
2+
* Copyright © Magento, Inc. All rights reserved.
3+
* See COPYING.txt for license details.
4+
*/
5+
6+
interface Base64 {
7+
_keyStr: string;
8+
encode: (input: string) => string;
9+
decode: (input: string) => string;
10+
mageEncode: (input: string) => string;
11+
mageDecode: (output: string) => string;
12+
idEncode: (input: string) => string;
13+
idDecode: (output: string) => string;
14+
_utf8_encode: (input: string) => string;
15+
_utf8_decode: (utftext: string) => string;
16+
}
17+
18+
interface Window {
19+
Base64: Base64;
20+
}

app/code/Magento/PageBuilder/view/adminhtml/web/ts/js/utils/editor.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
*/
55

66
import $ from "jquery";
7+
import "mage/adminhtml/tools";
78
import $t from "mage/translate";
89
import mageUtils from "mageUtils";
910
import {Editor} from "tinymce";
@@ -125,7 +126,7 @@ function convertWidgetsToHtmlPreview(content: string) {
125126
}
126127

127128
const image = $("<img />")
128-
.prop("id", btoa(match).replace(/\+/g, ":").replace(/\//g, "_").replace(/=/g, "-"))
129+
.prop("id", window.Base64.idEncode(match))
129130
.prop("src", imageSrc);
130131

131132
placeholder.append(image);
Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
# Workflow tips
22

3-
When you are working on a page and changing the master.html template, you need to Save the page in the Admin UI and make some kind of change to the preview template on the Admin UI. Otherwise, you will not see your changes in the browser. This is due to how Page Builder updates changes: it will not update the master template until changes have been made to the page.
3+
## Save page
4+
5+
When you are working on a page and changing the master.html template, you need to Save the page in the Admin UI and make some kind of change to the preview template on the Admin UI. Otherwise, you will not see your changes in the browser. This is due to how Page Builder updates changes: it will not update the master template until changes have been made to the page.
6+
7+
## Setup and cache
8+
9+
If you change something in the configuration of your extension and the change is not visible, run `bin/magento cache:flush` to ensure that the configuration is updated.
410

docs/extend-existing-content-type/step-3-extend-forms.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Your file structure for the Banner extension form and corresponding layout shoul
1212

1313
### Extension form
1414

15-
When customizing an existing form, make sure you name your form with the same name as the existing content type's form. In our case, we are customizing the Banner's form, which means we must name our form: `pagebuilder-banner-form.xml`. Here's the basic XML configuration for the Banner form extension:
15+
When customizing an existing form, make sure you name your form with the same name as the existing content type's form. In our case, we are customizing the Banner's form, which means we must name our form: `pagebuilder_banner_form.xml`. Here's the basic XML configuration for the Banner form extension:
1616

1717
```xml
1818
<?xml version="1.0" encoding="UTF-8"?>
@@ -46,7 +46,7 @@ When customizing an existing form, make sure you name your form with the same na
4646
</dataProvider>
4747
</dataSource>
4848

49-
<!--Add Fieldsets and fields-->
49+
<!--Add Fieldsets and fields-->
5050

5151
</form>
5252
```
@@ -93,7 +93,7 @@ The following table describes some key elements:
9393
| `settings` | Provides the markup that gives your field a label, CSS styling, validation, and other properties as needed. |
9494
{:style="table-layout:auto"}
9595

96-
After adding the `max_height` field, flush your cache, drag a banner to the Admin stage, open the editor, and see your new style property field being rendered in the Banner's form, as shown here:
96+
After adding the `max_height` field`, run `bin/magento cache:clean`, drag a banner to the Admin stage, open the editor, and see your new style property field being rendered in the Banner's form, as shown here:
9797

9898
![Appearance fieldset](../images/appearance-fieldset.png){:width="934px" height="auto"}
9999

0 commit comments

Comments
 (0)