Skip to content

Commit 0df60db

Browse files
committed
Merge branch 'MC-1416' of github.com:magento-trigger/magento2-page-builder into MC-1416
2 parents c316286 + 7ca7b87 commit 0df60db

File tree

13 files changed

+73
-43
lines changed

13 files changed

+73
-43
lines changed

app/code/Magento/PageBuilder/Model/Config/ContentType/AdditionalData/Provider/Wysiwyg/Config.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public function getData(string $itemName) : array
6161
{
6262
$config = [];
6363
$activeEditorPath = $this->activeEditor->getWysiwygAdapterPath();
64-
if ($this->inlineEditingChecker->isAvailable($activeEditorPath)) {
64+
if ($this->inlineEditingChecker->isSupported($activeEditorPath)) {
6565
$config['adapter'] = $this->wysiwygConfig->getConfig()->getData();
6666
if (isset($this->additionalConfig[$activeEditorPath])) {
6767
$config['additional'] = $this->additionalConfig[$activeEditorPath];

app/code/Magento/PageBuilder/Model/Stage/Config.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,6 @@ private function isWysiwygProvisionedForEditingOnStage()
203203
{
204204
$activeEditorPath = $this->activeEditor->getWysiwygAdapterPath();
205205

206-
return $this->inlineEditingChecker->isAvailable($activeEditorPath);
206+
return $this->inlineEditingChecker->isSupported($activeEditorPath);
207207
}
208208
}

app/code/Magento/PageBuilder/Model/Wysiwyg/InlineEditingSupportedAdapterList.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public function __construct(
4141
* @param string $editorPath
4242
* @return bool
4343
*/
44-
public function isAvailable(string $editorPath) : bool
44+
public function isSupported(string $editorPath) : bool
4545
{
4646

4747
return $this->wysiwygAdaptersSupportingInlineEditing[$editorPath] && $this->wysiwygConfig->isEnabled() ?? false;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@
121121
<see userInput="{{PageBuilderTextContentTypeDefault.value}}" stepKey="seeTextContentType"/>
122122
<seeElement selector="{{StorefrontCMSPageSection.imageSource(ImageUpload3.fileName)}}" stepKey="assertMediaSource"/>
123123
<seeElement selector="{{TextOnStorefront.text('1', _ENV.MAGENTO_BASE_URL)}}" stepKey="waitForVariableStorefront"/>
124-
<seeElement selector="{{TextOnStorefront.textAreaWidget('1', 'text', $$createCMSPageB.identifier$$)}}" stepKey="waitForWidgetStorefront"/>
124+
<seeElement selector="{{TextOnStorefront.textAreaWidget('1', '{{_ENV.MAGENTO_BASE_URL}}', $$createCMSPageB.identifier$$)}}" stepKey="waitForWidgetStorefront"/>
125125
</test>
126126
<test name="ColumnAddToRowAndHeightAdjusts">
127127
<annotations>

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

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,11 @@
2525
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
2626
<actionGroup ref="SwitchToVersion4ActionGroup" stepKey="switchToTinyMCE4" />
2727
<createData entity="_defaultCmsPage" stepKey="createCMSPage" />
28+
<createData entity="_defaultCmsPage" stepKey="createCMSPageB" />
2829
</before>
2930
<after>
3031
<deleteData createDataKey="createCMSPage" stepKey="deletePreReqCMSPage" />
32+
<deleteData createDataKey="createCMSPageB" stepKey="deletePreReqCMSPageB" />
3133
<actionGroup ref="logout" stepKey="logout"/>
3234
</after>
3335
<actionGroup ref="navigateToCreatedCMSPage" stepKey="navigateToCreatedCMSPage1">
@@ -47,6 +49,9 @@
4749
<waitForElementVisible selector="{{TabOnStage.tabContent('1')}}" stepKey="waitForFirstTabContent"/>
4850
<waitForElementVisible selector="{{TabOnStage.tabHeader('1')}}" stepKey="waitForFirstTabHeader"/>
4951
<!-- Add Text to Tab -->
52+
<actionGroup ref="expandPageBuilderPanelGroup" stepKey="expandPageBuilderPanelGroupText">
53+
<argument name="group" value="PageBuilderTextContentType"/>
54+
</actionGroup>
5055
<actionGroup ref="dragContentTypeToContainer" stepKey="dragTextOntoTab">
5156
<argument name="contentType" value="PageBuilderTextContentType"/>
5257
<argument name="containerTargetType" value="PageBuilderTabContentType"/>
@@ -121,8 +126,8 @@
121126
<amOnPage url="$$createCMSPage.identifier$$" stepKey="amOnPageTestPage"/>
122127
<see userInput="{{PageBuilderTextContentTypeDefault.value}}" stepKey="seeTextContentType"/>
123128
<seeElement selector="{{StorefrontCMSPageSection.imageSource(ImageUpload3.fileName)}}" stepKey="assertMediaSource"/>
124-
<seeElement selector="{{TextOnStorefront.text('1', _ENV.MAGENTO_BASE_URL)}}" stepKey="waitForVariableStorefront"/>
125-
<seeElement selector="{{TextOnStorefront.textAreaWidget('1', 'text', $$createCMSPageB.identifier$$)}}" stepKey="waitForWidgetStorefront"/>
129+
<seeElement selector="{{TextOnStorefront.text('1', '{{_ENV.MAGENTO_BASE_URL}}')}}" stepKey="waitForVariableStorefront"/>
130+
<seeElement selector="{{TextOnStorefront.textAreaWidget('1', '{{_ENV.MAGENTO_BASE_URL}}', $$createCMSPageB.identifier$$)}}" stepKey="waitForWidgetStorefront"/>
126131
</test>
127132
<test name="CanAddTextToTab">
128133
<annotations>
@@ -149,7 +154,7 @@
149154
</actionGroup>
150155
<!-- Add Tabs to Stage -->
151156
<comment userInput="Add Tabs to Stage" stepKey="addTabsToStage"/>
152-
<actionGroup ref="expandPageBuilderPanelGroup" stepKey="expandPageBuilderPanelGroup">
157+
<actionGroup ref="expandPageBuilderPanelGroup" stepKey="expandPageBuilderPanelGroup1">
153158
<argument name="group" value="PageBuilderTabsContentType"/>
154159
</actionGroup>
155160
<actionGroup ref="dragContentTypeToStage" stepKey="dragTabsIntoStage">

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -860,6 +860,9 @@
860860
<actionGroup ref="expandPageBuilderPanelGroup" stepKey="expandPageBuilderPanelGroup">
861861
<argument name="group" value="PageBuilderTextContentType"/>
862862
</actionGroup>
863+
<actionGroup ref="expandPageBuilderPanelGroup" stepKey="expandPageBuilderPanelGroupText">
864+
<argument name="group" value="PageBuilderTextContentType"/>
865+
</actionGroup>
863866
<actionGroup ref="dragContentTypeToStage" stepKey="dragIntoStage">
864867
<argument name="contentType" value="PageBuilderTextContentType"/>
865868
</actionGroup>
@@ -1258,7 +1261,7 @@
12581261
</actionGroup>
12591262
<!-- Validate Storefront -->
12601263
<comment userInput="Validate Storefront" stepKey="commentValidateStorefront"/>
1261-
<waitForElementVisible selector="{{TextOnStorefront.textAreaWidget('1', 'text', PageBuilderPageTitle.pageName)}}" stepKey="waitForTextStorefront"/>
1264+
<waitForElementVisible selector="{{TextOnStorefront.textAreaWidget('1', '{{_ENV.MAGENTO_BASE_URL}}', PageBuilderPageTitle.pageName)}}" stepKey="waitForTextStorefront"/>
12621265
</test>
12631266
<test name="TextDisabledWYSIWYGAddVariable">
12641267
<annotations>

app/code/Magento/PageBuilder/view/adminhtml/web/js/content-type/wysiwyg-factory.js

Lines changed: 1 addition & 1 deletion
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/js/content-type/wysiwyg.js

Lines changed: 8 additions & 8 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/wysiwyg-factory.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,22 @@
33
* See COPYING.txt for license details.
44
*/
55

6-
import WysiwygSetup from "mage/adminhtml/wysiwyg/tiny_mce/setup";
7-
import WysiwygInstance from "wysiwygAdapter";
6+
import WysiwygSetupInterface from "mage/adminhtml/wysiwyg/tiny_mce/setup";
7+
import WysiwygInstanceInterface from "wysiwygAdapter";
88
import {AdditionalDataConfigInterface} from "../content-type-config";
99

1010
/**
1111
* Create new wysiwyg adapter instance
1212
* @param {string} elementId
1313
* @param {AdditionalDataConfigInterface} config
14-
* @returns {WysiwygInstance}
14+
* @returns {WysiwygInstanceInterface}
1515
* @api
1616
*/
1717
export default function create(
1818
elementId: string,
1919
config: AdditionalDataConfigInterface,
20-
): WysiwygInstance {
21-
const wysiwygSetup = new WysiwygSetup(elementId, config.adapter);
20+
): WysiwygInstanceInterface {
21+
const wysiwygSetup = new WysiwygSetupInterface(elementId, config.adapter);
2222

2323
if (config.additional.mode) {
2424
wysiwygSetup.setup(config.additional.mode);

app/code/Magento/PageBuilder/view/adminhtml/web/ts/js/content-type/wysiwyg.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
*/
55

66
import $ from "jquery";
7-
import WysiwygSetup from "mage/adminhtml/wysiwyg/tiny_mce/setup";
7+
import wysiwygEvents from "mage/adminhtml/wysiwyg/events";
88
import events from "Magento_PageBuilder/js/events";
99
import _ from "underscore";
10-
import WysiwygInstance from "wysiwygAdapter";
10+
import WysiwygInstanceInterface from "wysiwygAdapter";
1111
import {AdditionalDataConfigInterface} from "../content-type-config";
1212
import DataStore from "../data-store";
1313
import WysiwygFactory from "./wysiwyg-factory";
@@ -26,7 +26,7 @@ export default class Wysiwyg {
2626
/**
2727
* Wysiwyg adapter instance
2828
*/
29-
private wysiwygAdapter: WysiwygInstance;
29+
private wysiwygAdapter: WysiwygInstanceInterface;
3030

3131
/**
3232
* Content type's data store
@@ -100,7 +100,7 @@ export default class Wysiwyg {
100100
}
101101

102102
/**
103-
* @returns {WysiwygSetup}
103+
* @returns {WysiwygInstanceInterface}
104104
*/
105105
public getAdapter() {
106106
return this.wysiwygAdapter;
@@ -111,7 +111,7 @@ export default class Wysiwyg {
111111
*/
112112
public onEdit(callback: () => void) {
113113
this.wysiwygAdapter.eventBus.attachEventHandler(
114-
this.wysiwygAdapter.EVENT.AFTER_CONTENT_CHANGE,
114+
wysiwygEvents.afterChangeContent,
115115
_.debounce(callback, 100),
116116
);
117117
}
@@ -121,7 +121,7 @@ export default class Wysiwyg {
121121
*/
122122
public onFocus(callback: () => void) {
123123
this.wysiwygAdapter.eventBus.attachEventHandler(
124-
this.wysiwygAdapter.EVENT.AFTER_FOCUS,
124+
wysiwygEvents.afterFocus,
125125
callback,
126126
);
127127
}
@@ -131,7 +131,7 @@ export default class Wysiwyg {
131131
*/
132132
public onBlur(callback: () => void) {
133133
this.wysiwygAdapter.eventBus.attachEventHandler(
134-
this.wysiwygAdapter.EVENT.AFTER_BLUR,
134+
wysiwygEvents.afterBlur,
135135
callback,
136136
);
137137
}

0 commit comments

Comments
 (0)