Skip to content

Commit e85c5a2

Browse files
authored
Merge branch 'develop' into PB-364-sync-release-to-develop
2 parents 710be5b + cc2d342 commit e85c5a2

File tree

298 files changed

+6870
-3736
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

298 files changed

+6870
-3736
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
## Scope
2+
### Story
3+
<!---
4+
* [<issue_number>](https://jira.corp.magento.com/browse/<issue_number>) <issue_title>
5+
-->
6+
7+
### Bug
8+
<!---
9+
* [<issue_number>](https://jira.corp.magento.com/browse/<issue_number>) <issue_title>
10+
-->
11+
12+
### Task
13+
<!---
14+
* [<issue_number>](https://jira.corp.magento.com/browse/<issue_number>) <issue_title>
15+
-->
16+
17+
### Builds
18+
<!---
19+
[All-User-Requested-Tests](https://m2build-ur.devops.magento.com/job/All-User-Requested-Tests/<build_number>)
20+
-->
21+
22+
### Related Pull Requests
23+
<!---
24+
https://github.com/magento/magento2ce/pull/<related_pr>
25+
-->
26+
<!-- related pull request placeholder -->
27+
28+
### Checklist
29+
- [ ] PR is green on M2 Quality Portal
30+
- [ ] Jira issues have accurate summary, meaningful description and have links to relevant documentation at the story/task level
31+
- [ ] Semantic Version build failure is approved by architect (if build is red) <Architect Name>
32+
- [ ] Pull Request approved by architect <Architect Name>
33+
- [ ] Pull Request quality review performed by <name>
34+
- [ ] All unstable functional acceptance tests are isolated (if any)
35+
- [ ] All linked Zephyr tests are approved by PO and have Ready to Use status
36+
- [ ] Travis CI build is green (for mainline CE only)
37+
- [ ] Jenkins Extended FAT build is green

.stylelintrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
"selector-combinator-space-before": "always",
2121
"selector-list-comma-newline-after": "always",
2222
"shorthand-property-no-redundant-values": true,
23-
"string-quotes": "single"
23+
"string-quotes": "single",
24+
"function-calc-no-invalid": null
2425
}
2526
}

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

Lines changed: 54 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
use Magento\Framework\UrlInterface;
1212

1313
/**
14-
* Class Config
14+
* Provide configuration to the admin JavaScript app
15+
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
1516
*
1617
* @api
1718
*/
@@ -80,9 +81,18 @@ class Config
8081
*/
8182
private $rootContainerConfig;
8283

84+
/**
85+
* @var \Magento\Widget\Model\Widget\Config
86+
*/
87+
private $widgetConfig;
88+
89+
/**
90+
* @var \Magento\Variable\Model\Variable\Config
91+
*/
92+
private $variableConfig;
93+
8394
/**
8495
* Config constructor.
85-
*
8696
* @param \Magento\PageBuilder\Model\ConfigInterface $config
8797
* @param Config\UiComponentConfig $uiComponentConfig
8898
* @param UrlInterface $urlBuilder
@@ -94,6 +104,8 @@ class Config
94104
* @param \Magento\PageBuilder\Model\WidgetInitializerConfig $widgetInitializerConfig
95105
* @param array $rootContainerConfig
96106
* @param array $data
107+
* @param \Magento\Widget\Model\Widget\Config|null $widgetConfig
108+
* @param \Magento\Variable\Model\Variable\Config|null $variableConfig
97109
*
98110
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
99111
*/
@@ -108,7 +120,9 @@ public function __construct(
108120
\Magento\PageBuilder\Model\Wysiwyg\InlineEditingSupportedAdapterList $inlineEditingChecker,
109121
\Magento\PageBuilder\Model\WidgetInitializerConfig $widgetInitializerConfig,
110122
array $rootContainerConfig = [],
111-
array $data = []
123+
array $data = [],
124+
\Magento\Widget\Model\Widget\Config $widgetConfig = null,
125+
\Magento\Variable\Model\Variable\Config $variableConfig = null
112126
) {
113127
$this->config = $config;
114128
$this->uiComponentConfig = $uiComponentConfig;
@@ -121,6 +135,10 @@ public function __construct(
121135
$this->widgetInitializerConfig = $widgetInitializerConfig;
122136
$this->rootContainerConfig = $rootContainerConfig;
123137
$this->data = $data;
138+
$this->widgetConfig = $widgetConfig ?? \Magento\Framework\App\ObjectManager::getInstance()
139+
->get(\Magento\Widget\Model\Widget\Config::class);
140+
$this->variableConfig = $variableConfig ?? \Magento\Framework\App\ObjectManager::getInstance()
141+
->get(\Magento\Variable\Model\Variable\Config::class);
124142
}
125143

126144
/**
@@ -134,15 +152,46 @@ public function getConfig()
134152
'menu_sections' => $this->getMenuSections(),
135153
'content_types' => $this->getContentTypes(),
136154
'stage_config' => $this->data,
137-
'media_url' => $this->urlBuilder->getBaseUrl(['_type' => UrlInterface::URL_TYPE_MEDIA]),
155+
'media_url' => $this->frontendUrlBuilder->getBaseUrl(['_type' => UrlInterface::URL_TYPE_MEDIA]),
138156
'preview_url' => $this->urlBuilder->getUrl('pagebuilder/stage/preview'),
139157
'render_url' => $this->urlBuilder->getUrl('pagebuilder/stage/render'),
140158
'column_grid_default' => $this->scopeConfig->getValue(self::XML_PATH_COLUMN_GRID_DEFAULT),
141159
'column_grid_max' => $this->scopeConfig->getValue(self::XML_PATH_COLUMN_GRID_MAX),
142160
'can_use_inline_editing_on_stage' => $this->isWysiwygProvisionedForEditingOnStage(),
143161
'widgets' => $this->widgetInitializerConfig->getConfig(),
144-
'breakpoints' => $this->widgetInitializerConfig->getBreakpoints()
162+
'breakpoints' => $this->widgetInitializerConfig->getBreakpoints(),
163+
'tinymce' => $this->getTinyMceConfig(),
164+
];
165+
}
166+
167+
/**
168+
* Retrieve the TinyMCE required configuration
169+
*
170+
* @return array
171+
*/
172+
private function getTinyMceConfig()
173+
{
174+
$config = [
175+
'widgets' => [],
176+
'variables' => []
145177
];
178+
179+
// Retrieve widget configuration
180+
$widgetConfig = $this->widgetConfig->getConfig(new \Magento\Framework\DataObject());
181+
$options = $widgetConfig->getData('plugins');
182+
if (isset($options[0]) && $options[0]['name'] === 'magentowidget') {
183+
$config['widgets'] = $options[0]['options'];
184+
}
185+
186+
// Retrieve variable configuration
187+
$variableConfig = $this->variableConfig->getWysiwygPluginSettings(new \Magento\Framework\DataObject());
188+
if (isset($variableConfig['plugins']) && isset($variableConfig['plugins'][0])
189+
&& $variableConfig['plugins'][0]['name'] === 'magentovariable'
190+
) {
191+
$config['variables'] = $variableConfig['plugins'][0]['options'];
192+
}
193+
194+
return $config;
146195
}
147196

148197
/**

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,11 @@ class Preview
4242
*/
4343
private $scopeConfig;
4444

45+
/**
46+
* @var bool
47+
*/
48+
private $isPreview = false;
49+
4550
/**
4651
* Preview constructor.
4752
* @param \Magento\Store\Model\App\Emulation $emulation
@@ -67,11 +72,6 @@ public function __construct(
6772
$this->scopeConfig = $scopeConfig;
6873
}
6974

70-
/**
71-
* @var bool
72-
*/
73-
private $isPreview;
74-
7575
/**
7676
* Retrieve the area in which the preview needs to be ran in
7777
*

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
<conditionalClick selector="{{sectionSelector}}" dependentSelector="{{sectionDependentSelector}}" visible="false" stepKey="expandSection"/>
3232
<waitForPageLoad time="30" stepKey="waitForSectionToExpand"/>
3333
</actionGroup>
34-
<actionGroup name="saveCatalogCategory" extends="saveCategoryForm">
34+
<actionGroup name="saveCatalogCategory" extends="SaveCategoryFormActionGroup">
3535
<!-- Move to CE: Fix CE action group -->
3636
<waitForElementVisible selector="{{AdminCategoryMainActionsSection.SaveButton}}" stepKey="waitForSaveCategoryButton" before="saveCategory"/>
3737
<waitForPageLoad stepKey="waitForPageLoad" after="saveCategory"/>

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,8 @@
161161
</arguments>
162162
<!-- Validate bottom edge of overlay -->
163163
<comment userInput="Validate bottom edge of overlay" stepKey="commentValidateBottomEdgeOfOverlay"/>
164-
<executeJS function="return {{page.wrapperJS(index)}}.getBoundingClientRect().top+{{padding.paddingTop}}+120" stepKey="wrapperTopPaddingContent"/>
164+
<!-- 30px padding top, 50px min height, 30px padding bottom -->
165+
<executeJS function="return {{page.wrapperJS(index)}}.getBoundingClientRect().top+{{padding.paddingTop}}+30+50+30" stepKey="wrapperTopPaddingContent"/>
165166
<executeJS function="return {{page.overlayJS(index)}}.getBoundingClientRect().bottom" stepKey="overlayBottomPosition"/>
166167
<executeJS function="return Math.round(({$wrapperTopPaddingContent}/{$overlayBottomPosition})*100)/100" stepKey="overlayBottomRatio"/>
167168
<assertEquals stepKey="assertOverlayBottomRatio">

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

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,15 @@
6565
<waitForElementVisible selector="{{TinyMCESection.InsertVariableIcon}}" stepKey="waitForInsertVariable1"/>
6666
<click selector="{{TinyMCESection.InsertVariableIcon}}" stepKey="clickInsertVariable1"/>
6767
</actionGroup>
68+
<actionGroup name="seeVariableTinyMCE">
69+
<arguments>
70+
<argument name="section" defaultValue="TextOnStage"/>
71+
<argument name="index" defaultValue="1" type="string"/>
72+
<argument name="labelValue" defaultValue=""/>
73+
</arguments>
74+
<waitForElementVisible selector="{{section.text(index, labelValue)}}" stepKey="waitForVariable"/>
75+
<seeElement selector="{{section.text(index, labelValue)}}" stepKey="seeVariable"/>
76+
</actionGroup>
6877
<actionGroup name="addVariableToTinyMCE3" extends="addVariableToTinyMCE">
6978
<arguments>
7079
<argument name="variable" defaultValue=""/>
@@ -243,4 +252,104 @@
243252
<waitForPageLoad stepKey="waitForPageLoad1"/>
244253
<click selector="{{PageBuilderPanel.searchPanel}}" stepKey="loseFocusFromEditor"/>
245254
</actionGroup>
255+
<actionGroup name="formatTextTinyMCE">
256+
<arguments>
257+
<argument name="section" defaultValue="WYSIWYGOnPageBuilderInline"/>
258+
<!-- Receives pagebuilder_tinymce_format -->
259+
<argument name="format" defaultValue="TinyMCEFormatHeading1"/>
260+
</arguments>
261+
<waitForElementVisible selector="{{section.formatSelector}}" stepKey="waitForFormatList"/>
262+
<click selector="{{section.formatSelector}}" stepKey="expandFormatList"/>
263+
<waitForElementVisible selector="{{section.formatOption(format.label)}}" stepKey="waitForFormatOptionVisible"/>
264+
<click selector="{{section.formatOption(format.label)}}" stepKey="clickFormatOption"/>
265+
<waitForElementNotVisible selector="{{section.formatOption(format.label)}}" stepKey="waitForFormatInvisible"/>
266+
</actionGroup>
267+
<actionGroup name="waitForTinyMCEInFocus">
268+
<arguments>
269+
<argument name="section" defaultValue="TextOnStage"/>
270+
<argument name="index" defaultValue="1" type="string"/>
271+
</arguments>
272+
<waitForElementVisible selector="{{section.tinymceInFocus(index)}}" stepKey="waitForTinyMCEInFocus"/>
273+
</actionGroup>
274+
<actionGroup name="clickDirectiveTinyMCE">
275+
<arguments>
276+
<argument name="section" defaultValue="TextOnStage"/>
277+
<argument name="index" defaultValue="1" type="string"/>
278+
<argument name="labelValue" defaultValue=""/>
279+
</arguments>
280+
<waitForElementVisible selector="{{section.directive(index, labelValue)}}" stepKey="waitForDirective"/>
281+
<click selector="{{section.directive(index, labelValue)}}" stepKey="clickDirective"/>
282+
</actionGroup>
283+
<actionGroup name="seeDirectiveFocusedTinyMCE">
284+
<arguments>
285+
<argument name="section" defaultValue="TextOnStage"/>
286+
<argument name="index" defaultValue="1" type="string"/>
287+
<argument name="labelValue" defaultValue=""/>
288+
</arguments>
289+
<waitForElementVisible selector="{{section.directiveFocused(index, labelValue)}}" stepKey="waitForDirectiveFocused"/>
290+
<seeElement selector="{{section.directiveFocused(index, labelValue)}}" stepKey="verifyDirectiveIsFocused"/>
291+
</actionGroup>
292+
<actionGroup name="scrollToTinyMCE">
293+
<arguments>
294+
<argument name="section" defaultValue="TextOnStage"/>
295+
<argument name="index" defaultValue="1" type="string"/>
296+
</arguments>
297+
<scrollTo selector="{{section.tinymce(index)}}" stepKey="scrollToTinyMCE"/>
298+
<waitForElementVisible selector="{{section.tinymce(index)}}" stepKey="waitForTinyMCEVisible"/>
299+
</actionGroup>
300+
<actionGroup name="assertSelectedText">
301+
<arguments>
302+
<argument name="expectedSelectedText"/>
303+
</arguments>
304+
<executeJS function="return window.getSelection().toString()" stepKey="selectionString"/>
305+
<assertEquals stepKey="assertSelectionText">
306+
<expectedResult type="string">{{expectedSelectedText.selection}}</expectedResult>
307+
<actualResult type="variable">selectionString</actualResult>
308+
</assertEquals>
309+
</actionGroup>
310+
<actionGroup name="doubleClickVariableTinyMCE">
311+
<arguments>
312+
<argument name="section" defaultValue="TextOnStage"/>
313+
<argument name="index" defaultValue="1" type="string"/>
314+
<argument name="variable"/>
315+
</arguments>
316+
<waitForElementVisible selector="{{section.directive(index, variable.editPanelValue)}}" stepKey="waitForVariableVisible"/>
317+
<doubleClick selector="{{section.directive(index, variable.editPanelValue)}}" stepKey="doubleClickOnVariablePlaceholder"/>
318+
<waitForPageLoad stepKey="waitForPageLoad"/>
319+
<waitForElementVisible selector="{{VariableSection.CancelBtnEnabled}}" stepKey="waitForCancelButton"/>
320+
<waitForElementVisible selector="{{VariableSection.Radio(variable.variableName)}}" stepKey="waitForVariableAfterDoubleClick"/>
321+
</actionGroup>
322+
<actionGroup name="closeVariablePanelTinyMCE">
323+
<waitForElementVisible selector="{{VariableSection.CancelBtnEnabled}}" stepKey="waitForCancelButton"/>
324+
<click selector="{{VariableSection.CancelBtnEnabled}}" stepKey="clickCancelButton"/>
325+
<waitForPageLoad stepKey="waitForPageLoad"/>
326+
<waitForElementNotVisible selector="{{VariableSection.CancelBtnEnabled}}" stepKey="waitForVariableCancelNotVisible"/>
327+
</actionGroup>
328+
<actionGroup name="doubleClickWidgetTinyMCE">
329+
<arguments>
330+
<argument name="section" defaultValue="TextOnStage"/>
331+
<argument name="index" defaultValue="1" type="string"/>
332+
<argument name="widget"/>
333+
</arguments>
334+
<waitForElementVisible selector="{{section.directive('1', TinyMCEWidgetCMSPageLink.editPanelValue)}}" stepKey="waitForWidgetVisible"/>
335+
<doubleClick selector="{{section.directive('1', TinyMCEWidgetCMSPageLink.editPanelValue)}}" stepKey="doubleClickOnWidgetPlaceholder"/>
336+
<waitForPageLoad stepKey="waitForPageLoad"/>
337+
<waitForElementVisible selector="{{WidgetSection.CancelBtnEnabled}}" stepKey="waitForCancelButtonVisible"/>
338+
</actionGroup>
339+
<actionGroup name="closeWidgetPanelTinyMCE">
340+
<waitForElementVisible selector="{{WidgetSection.CancelBtnEnabled}}" stepKey="waitForCancelButton"/>
341+
<click selector="{{WidgetSection.CancelBtnEnabled}}" stepKey="clickCancelButton"/>
342+
<waitForPageLoad stepKey="waitForPageLoad"/>
343+
<waitForElementNotVisible selector="{{WidgetSection.CancelBtnEnabled}}" stepKey="waitForCancelButtonNotVisible"/>
344+
</actionGroup>
345+
<actionGroup name="focusTinyMCE">
346+
<arguments>
347+
<argument name="section" defaultValue="TextOnStage"/>
348+
<argument name="index" defaultValue="1" type="string"/>
349+
</arguments>
350+
<waitForElementVisible selector="{{section.tinymce(index)}}" stepKey="waitForTinyMCE"/>
351+
<click selector="{{section.tinymce(index)}}" stepKey="focusOnTextEditorArea"/>
352+
<waitForPageLoad stepKey="waitForPageLoad"/>
353+
<waitForElementVisible selector="{{section.tinymceInFocus(index)}}" stepKey="waitForTinyMCEInFocus"/>
354+
</actionGroup>
246355
</actionGroups>

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

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,13 @@
1616
<data key="cmsPageLinkName" unique="suffix">cms-page-link-</data>
1717
<data key="value">test string</data>
1818
</entity>
19+
<entity name="PageBuilderTextHeadingProperty" type="pagebuilder_text_property">
20+
<data key="name">Text</data>
21+
<data key="section">General</data>
22+
<data key="fieldName">text</data>
23+
<data key="cmsPageLinkName" unique="suffix">cms-page-link-</data>
24+
<data key="value">This is a heading</data>
25+
</entity>
1926
<entity name="PageBuilderTextContentTypeDefault" type="pagebuilder_text_property">
2027
<data key="name">Text</data>
2128
<data key="section">General</data>
@@ -72,4 +79,62 @@
7279
<data key="expectedString1">test str</data>
7380
<data key="expectedString2">ing</data>
7481
</entity>
82+
<!-- TinyMCE Formats -->
83+
<entity name="TinyMCEFormatParagraph" type="pagebuilder_tinymce_format">
84+
<data key="label">Paragraph</data>
85+
<data key="tagName">p</data>
86+
</entity>
87+
<entity name="TinyMCEFormatHeading1" type="pagebuilder_tinymce_format">
88+
<data key="label">Heading 1</data>
89+
<data key="tagName">h1</data>
90+
</entity>
91+
<entity name="TinyMCEFormatHeading2" type="pagebuilder_tinymce_format">
92+
<data key="label">Heading 2</data>
93+
<data key="tagName">h2</data>
94+
</entity>
95+
<entity name="TinyMCEFormatHeading3" type="pagebuilder_tinymce_format">
96+
<data key="label">Heading 3</data>
97+
<data key="tagName">h3</data>
98+
</entity>
99+
<entity name="TinyMCEFormatHeading4" type="pagebuilder_tinymce_format">
100+
<data key="label">Heading 4</data>
101+
<data key="tagName">h4</data>
102+
</entity>
103+
<entity name="TinyMCEFormatHeading5" type="pagebuilder_tinymce_format">
104+
<data key="label">Heading 5</data>
105+
<data key="tagName">h5</data>
106+
</entity>
107+
<entity name="TinyMCEFormatHeading6" type="pagebuilder_tinymce_format">
108+
<data key="label">Heading 6</data>
109+
<data key="tagName">h6</data>
110+
</entity>
111+
<entity name="TinyMCEFormatImportant" type="pagebuilder_tinymce_format">
112+
<data key="label">Important</data>
113+
<data key="tagName">div</data>
114+
</entity>
115+
<entity name="TinyMCEFormatPreformatted" type="pagebuilder_tinymce_format">
116+
<data key="label">Preformatted</data>
117+
<data key="tagName">div</data>
118+
</entity>
119+
<!-- TinyMCE Selections -->
120+
<entity name="TinyMCEPartialHeadingSelection" type="pagebuilder_text_selection">
121+
<data key="startX">15</data>
122+
<data key="endX">115</data>
123+
<data key="startY">15</data>
124+
<data key="endY">15</data>
125+
<data key="selection">his is a h</data>
126+
</entity>
127+
<entity name="TinyMCEPartialTextSelection" type="pagebuilder_text_selection">
128+
<data key="startX">18</data>
129+
<data key="endX">55</data>
130+
<data key="startY">15</data>
131+
<data key="endY">15</data>
132+
<data key="selection">t strin</data>
133+
</entity>
134+
<entity name="TinyMCEHeadingVariableTextSelection" type="pagebuilder_multiple_text_selection">
135+
<data key="selection">his is a heading
136+
Base URL
137+
138+
test strin</data>
139+
</entity>
75140
</entities>

0 commit comments

Comments
 (0)