Skip to content

Commit 2a42afa

Browse files
Merge branch 'develop' into MC-34385
2 parents de4c011 + e56edfd commit 2a42afa

File tree

44 files changed

+325
-75
lines changed

Some content is hidden

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

44 files changed

+325
-75
lines changed

README.md

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,25 @@ Welcome to the Magento 2 Page Builder project!
66

77
Page Builder introduces an intuitive, drag-and-drop interface for creating digital content, powered by content types like images, videos, banners, etc. with instant preview capabilities that enable non-technical users to take control of their content. It allows to create new pages, enrich products and categories, and launch content updates quickly and easily without the help of a front-end web developer.
88

9+
## Wiki
10+
11+
Public access to the Page Builder wiki is found here:
12+
13+
https://github.com/magento/magento2-page-builder-docs/wiki.
14+
15+
The wiki provides more information on the Page Builder project, such as:
16+
17+
- [Links to User Guide tutorials](https://github.com/magento/magento2-page-builder-docs/wiki#page-builder-tutorials)
18+
- [Page Builder roadmaps](https://github.com/magento/magento2-page-builder-docs/wiki#roadmap)
19+
- [MFTF best practices](https://github.com/magento/magento2-page-builder-docs/wiki/%5BRough-Draft%5D-MFTF-Best-Practices)
20+
- [Partners Acceleration Program](https://github.com/magento/magento2-page-builder-docs/wiki/Partners-Acceleration-Program-Team)
21+
922
## Documentation
10-
Complete documentation located on the [Magento DevDocs](https://devdocs.magento.com/page-builder/docs/):
11-
- Project [roadmap](https://github.com/magento/magento2-page-builder/wiki#roadmap) contains information about project phases
12-
- How to start local development described in the [installation guide](https://devdocs.magento.com/page-builder/docs/getting-started/install-pagebuilder.html)
23+
Complete documentation located on the [Magento DevDocs](https://devdocs.magento.com/page-builder/docs/), including what you need to know to start local development as described in the [installation guide](https://devdocs.magento.com/page-builder/docs/getting-started/install-pagebuilder.html).
1324

1425
## Community Engineering Slack
1526

16-
To connect with Magento team and the Community, join us on the [Magento Community Engineering Slack](https://magentocommeng.slack.com).
27+
To connect with Magento team and the Community, join us on the [Magento Community Engineering Slack](https://magentocommeng.slack.com).
1728
If you are interested in joining Slack, or a specific channel, use our [self signup](https://opensource.magento.com/slack) link.
1829

1930
Magento 2 Page Builder project slack channel: [#pagebuilder](https://magentocommeng.slack.com/archives/CHB455HPF)

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

Lines changed: 52 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -7,38 +7,47 @@
77

88
namespace Magento\PageBuilder\Model\Stage;
99

10+
use Magento\Framework\App\Area;
11+
use Magento\Framework\App\Config\ScopeConfigInterface;
12+
use Magento\Framework\App\State;
13+
use Magento\Framework\View\Design\Theme\ThemeProviderInterface;
14+
use Magento\Framework\View\DesignInterface;
15+
use Magento\Store\Model\App\Emulation;
16+
use Magento\Store\Model\ScopeInterface;
17+
use Magento\Store\Model\StoreManagerInterface;
18+
1019
/**
1120
* Handle placing Magento into Page Builder Preview mode and emulating the store front
1221
*/
1322
class Preview
1423
{
1524
/**
16-
* @var \Magento\Store\Model\App\Emulation
25+
* @var Emulation
1726
*/
1827
private $emulation;
1928

2029
/**
21-
* @var \Magento\Framework\App\State
30+
* @var State
2231
*/
2332
private $appState;
2433

2534
/**
26-
* @var \Magento\Framework\View\DesignInterface
35+
* @var DesignInterface
2736
*/
2837
private $design;
2938

3039
/**
31-
* @var \Magento\Framework\View\Design\Theme\ThemeProviderInterface
40+
* @var ThemeProviderInterface
3241
*/
3342
private $themeProvider;
3443

3544
/**
36-
* @var \Magento\Store\Model\StoreManagerInterface
45+
* @var StoreManagerInterface
3746
*/
3847
private $storeManager;
3948

4049
/**
41-
* @var \Magento\Framework\App\Config\ScopeConfigInterface
50+
* @var ScopeConfigInterface
4251
*/
4352
private $scopeConfig;
4453

@@ -49,20 +58,20 @@ class Preview
4958

5059
/**
5160
* Preview constructor.
52-
* @param \Magento\Store\Model\App\Emulation $emulation
53-
* @param \Magento\Framework\App\State $appState
54-
* @param \Magento\Framework\View\DesignInterface $design
55-
* @param \Magento\Framework\View\Design\Theme\ThemeProviderInterface $themeProvider
56-
* @param \Magento\Store\Model\StoreManagerInterface $storeManager
57-
* @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig
61+
* @param Emulation $emulation
62+
* @param State $appState
63+
* @param DesignInterface $design
64+
* @param ThemeProviderInterface $themeProvider
65+
* @param StoreManagerInterface $storeManager
66+
* @param ScopeConfigInterface $scopeConfig
5867
*/
5968
public function __construct(
60-
\Magento\Store\Model\App\Emulation $emulation,
61-
\Magento\Framework\App\State $appState,
62-
\Magento\Framework\View\DesignInterface $design,
63-
\Magento\Framework\View\Design\Theme\ThemeProviderInterface $themeProvider,
64-
\Magento\Store\Model\StoreManagerInterface $storeManager,
65-
\Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig
69+
Emulation $emulation,
70+
State $appState,
71+
DesignInterface $design,
72+
ThemeProviderInterface $themeProvider,
73+
StoreManagerInterface $storeManager,
74+
ScopeConfigInterface $scopeConfig
6675
) {
6776
$this->emulation = $emulation;
6877
$this->appState = $appState;
@@ -79,7 +88,7 @@ public function __construct(
7988
*/
8089
public function getPreviewArea() : string
8190
{
82-
return \Magento\Framework\App\Area::AREA_FRONTEND;
91+
return Area::AREA_FRONTEND;
8392
}
8493

8594
/**
@@ -95,7 +104,7 @@ public function startPreviewMode($callback, $storeId = null)
95104
$this->isPreview = true;
96105

97106
if (!$storeId) {
98-
$storeId = $this->storeManager->getDefaultStoreView()->getId();
107+
$storeId = $this->getStoreId();
99108
}
100109
$this->emulation->startEnvironmentEmulation($storeId);
101110

@@ -104,7 +113,7 @@ public function startPreviewMode($callback, $storeId = null)
104113
function () use ($callback) {
105114
$themeId = $this->scopeConfig->getValue(
106115
'design/theme/theme_id',
107-
\Magento\Store\Model\ScopeInterface::SCOPE_STORE
116+
ScopeInterface::SCOPE_STORE
108117
);
109118
$theme = $this->themeProvider->getThemeById($themeId);
110119
$this->design->setDesignTheme($theme, $this->getPreviewArea());
@@ -131,4 +140,26 @@ public function isPreviewMode() : bool
131140
{
132141
return $this->isPreview;
133142
}
143+
144+
/**
145+
* Returns store id by default store view or store id from the available store if default store view is null
146+
*
147+
* @return int|null
148+
*/
149+
private function getStoreId(): ?int
150+
{
151+
$storeId = null;
152+
$store = $this->storeManager->getDefaultStoreView();
153+
if ($store) {
154+
$storeId = (int) $store->getId();
155+
} else {
156+
$stores = $this->storeManager->getStores();
157+
if (count($stores)) {
158+
$store = array_shift($stores);
159+
$storeId = (int) $store->getId();
160+
}
161+
}
162+
163+
return $storeId;
164+
}
134165
}

app/code/Magento/PageBuilder/Test/Mftf/ActionGroup/OptionsMenuActionGroup/DuplicateContentTypeActionGroup.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,12 @@
1414
<argument name="contentTypeXCoordinate" defaultValue="null" type="string"/>
1515
<argument name="contentTypeYCoordinate" defaultValue="null" type="string"/>
1616
</arguments>
17+
<moveMouseOver selector="{{PageBuilderPanel.searchPanel}}" stepKey="moveMouseToSearchPanel"/>
1718
<waitForElement selector="{{PageBuilderStage.contentTypeTotalInStage(contentType.role)}}" stepKey="waitForAllContentTypes"/>
1819
<executeJS function="return document.querySelectorAll('{{PageBuilderStage.contentTypeTotalInStage(contentType.role)}}').length+1" stepKey="expectedContentTypeCount"/>
1920
<waitForElementVisible selector="{{PageBuilderStage.contentTypeInStageByIndex(contentType.role, targetIndex)}}" stepKey="waitForContentTypeInStageVisible"/>
20-
<moveMouseOver selector="{{PageBuilderStage.contentTypeInStageByIndex(contentType.role, targetIndex)}}" x="{{contentTypeXCoordinate}}" y="{{contentTypeYCoordinate}}" stepKey="onMouseOverContentTypeStage"/>
21+
<executeJS function="return ['row', 'column'].include('{{contentType.role}}') ? '//div[contains(@class, &quot;pagebuilder-display-label&quot;) and contains(.,&quot;'+'{{contentType.role}}'.toUpperCase()+'&quot;)]' : ['tabs'].include('{{contentType.role}}') ? '//ul[@data-element=&quot;navigation&quot;]' : '';" stepKey="contentTypeLabelSelector" />
22+
<moveMouseOver selector="{{PageBuilderStage.contentTypeInStageByIndex(contentType.role, targetIndex)}}{$contentTypeLabelSelector}" x="{{contentTypeXCoordinate}}" y="{{contentTypeYCoordinate}}" stepKey="onMouseOverContentTypeStage"/>
2123
<waitForElementVisible selector="{{PageBuilderContentTypeOptionsMenu.contentTypeOptionsMenuByIndex(contentType.role, targetIndex)}}" stepKey="waitForOptionsMenu"/>
2224
<waitForElementVisible selector="{{PageBuilderContentTypeOptionsMenu.contentTypeDuplicate(contentType.role, targetIndex)}}" stepKey="waitForDuplicate"/>
2325
<click selector="{{PageBuilderContentTypeOptionsMenu.contentTypeDuplicate(contentType.role, targetIndex)}}" stepKey="clickDuplicateContentType"/>

app/code/Magento/PageBuilder/Test/Mftf/ActionGroup/OptionsMenuActionGroup/HideContentTypeActionGroup.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
<!-- Hiding content type -->
1919
<comment userInput="Hiding content type" stepKey="commentHideContentType"/>
2020
<waitForElementVisible selector="{{section.base(targetIndex)}}" stepKey="waitForContentType"/>
21-
<moveMouseOver selector="{{section.base(targetIndex)}}" x="{{x}}" y="{{y}}" stepKey="moveMouseOverContentType"/>
21+
<executeJS function="return ['row', 'column'].include('{{contentType.role}}') ? '//div[contains(@class, &quot;pagebuilder-display-label&quot;) and contains(.,&quot;'+'{{contentType.role}}'.toUpperCase()+'&quot;)]' : '';" stepKey="contentTypeLabelSelector" />
22+
<moveMouseOver selector="{{section.base(targetIndex)}}{$contentTypeLabelSelector}" x="{{x}}" y="{{y}}" stepKey="moveMouseOverContentType"/>
2223
<waitForPageLoad stepKey="waitForMouseOver"/>
2324
<waitForElementVisible selector="{{PageBuilderContentTypeOptionsMenu.contentTypeHide(contentType.role, targetIndex)}}" stepKey="waitForHideOptionVisible"/>
2425
<click selector="{{PageBuilderContentTypeOptionsMenu.contentTypeHide(contentType.role, targetIndex)}}" stepKey="hideContentType"/>

app/code/Magento/PageBuilder/Test/Mftf/ActionGroup/OptionsMenuActionGroup/OpenPageBuilderEditPanelActionGroup.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@
1313
<argument name="offsetXCoordinate" defaultValue="10" type="string"/>
1414
<argument name="offsetYCoordinate" defaultValue="0" type="string"/>
1515
</arguments>
16+
<moveMouseOver selector="{{PageBuilderPanel.searchPanel}}" stepKey="moveMouseToSearchPanel"/>
1617
<waitForElementVisible time="10" selector="{{PageBuilderStage.contentTypeInStage(contentType.role)}}" stepKey="waitForContentTypeInStageVisible"/>
17-
<moveMouseOver selector="{{PageBuilderStage.contentTypeInStage(contentType.role)}}" x="{{offsetXCoordinate}}" y="{{offsetYCoordinate}}" stepKey="onMouseOverContentTypeStage"/>
18+
<executeJS function="return ['row', 'column'].include('{{contentType.role}}') ? '//div[contains(@class, &quot;pagebuilder-display-label&quot;) and contains(.,&quot;'+'{{contentType.role}}'.toUpperCase()+'&quot;)]' : ['tabs'].include('{{contentType.role}}') ? '//ul[@data-element=&quot;navigation&quot;]' : '';" stepKey="contentTypeLabelSelector" />
19+
<moveMouseOver selector="{{PageBuilderStage.contentTypeInStage(contentType.role)}}{$contentTypeLabelSelector}" x="{{offsetXCoordinate}}" y="{{offsetYCoordinate}}" stepKey="onMouseOverContentTypeStage"/>
1820
<waitForPageLoad stepKey="waitForPageLoad"/>
1921
<waitForElementVisible time="10" selector="{{PageBuilderContentTypeOptionsMenu.contentTypeOptionsMenu(contentType.role)}}" stepKey="waitForOptions"/>
2022
<click selector="{{PageBuilderContentTypeOptionsMenu.contentTypeEdit(contentType.role)}}" stepKey="clickEditContentType"/>

app/code/Magento/PageBuilder/Test/Mftf/ActionGroup/OptionsMenuActionGroup/OpenPageBuilderEditPanelByIndexActionGroup.xml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@
1414
<argument name="contentTypeXCoordinate" defaultValue="null" type="string"/>
1515
<argument name="contentTypeYCoordinate" defaultValue="null" type="string"/>
1616
</arguments>
17-
<waitForElementVisible time="20" selector="{{PageBuilderStage.contentTypeInStageByIndex(contentType.role, contentTypeIndex)}}" stepKey="waitForContentTypeInStageVisible"/>
18-
<moveMouseOver selector="{{PageBuilderStage.contentTypeInStageByIndex(contentType.role, contentTypeIndex)}}" x="{{contentTypeXCoordinate}}" y="{{contentTypeYCoordinate}}" stepKey="onMouseOverContentTypeStage"/>
17+
<executeJS function="return ['row', 'column'].include('{{contentType.role}}') ? '//div[contains(@class, &quot;pagebuilder-display-label&quot;) and contains(.,&quot;'+'{{contentType.role}}'.toUpperCase()+'&quot;)]' : ['tabs'].include('{{contentType.role}}') ? '//ul[@data-element=&quot;navigation&quot;]' : '';" stepKey="contentTypeLabelSelector" />
18+
<waitForElementVisible time="20" selector="{{PageBuilderStage.contentTypeInStageByIndex(contentType.role, contentTypeIndex)}}{$contentTypeLabelSelector}" stepKey="waitForContentTypeInStageVisible"/>
19+
<moveMouseOver stepKey="moveMouseOverSearch" selector="{{PageBuilderPanel.searchPanel}}" />
20+
<moveMouseOver selector="{{PageBuilderStage.contentTypeInStageByIndex(contentType.role, contentTypeIndex)}}{$contentTypeLabelSelector}" x="{{contentTypeXCoordinate}}" y="{{contentTypeYCoordinate}}" stepKey="onMouseOverContentTypeStage"/>
1921
<waitForPageLoad stepKey="waitForPageLoad"/>
2022
<waitForElementVisible time="10" selector="{{PageBuilderContentTypeOptionsMenu.contentTypeOptionsMenuByIndex(contentType.role, contentTypeIndex)}}" stepKey="waitForOptions"/>
2123
<waitForElementVisible selector="{{PageBuilderContentTypeOptionsMenu.contentTypeEditByIndex(contentType.role, contentTypeIndex)}}" stepKey="waitForEditButton"/>

app/code/Magento/PageBuilder/Test/Mftf/ActionGroup/OptionsMenuActionGroup/RemoveContentTypeFromStageByIndexActionGroup.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@
1616
</arguments>
1717
<seeElement selector="{{PageBuilderStage.contentTypeInStageByIndex(contentType.role, contentTypeNumber)}}" stepKey="seeContentTypeInStage"/>
1818
<waitForElementVisible time="20" selector="{{PageBuilderStage.contentTypeInStageByIndex(contentType.role, contentTypeNumber)}}" stepKey="waitForContentTypeInStageVisible"/>
19-
<moveMouseOver selector="{{PageBuilderStage.contentTypeInStageByIndex(contentType.role, contentTypeNumber)}}" x="{{x}}" y="{{y}}" stepKey="onMouseOverContentTypeStage"/>
19+
<moveMouseOver stepKey="moveMouseOverSearch" selector="{{PageBuilderPanel.searchPanel}}" />
20+
<executeJS function="return ['row', 'column'].include('{{contentType.role}}') ? '//div[contains(@class, &quot;pagebuilder-display-label&quot;) and contains(.,&quot;'+'{{contentType.role}}'.toUpperCase()+'&quot;)]' : ['tabs'].include('{{contentType.role}}') ? '//ul[@data-element=&quot;navigation&quot;]' : '';" stepKey="contentTypeLabelSelector" />
21+
<moveMouseOver selector="{{PageBuilderStage.contentTypeInStageByIndex(contentType.role, contentTypeNumber)}}{$contentTypeLabelSelector}" x="{{x}}" y="{{y}}" stepKey="onMouseOverContentTypeStage"/>
2022
<waitForPageLoad stepKey="waitForOptionsAnimation"/>
2123
<waitForElementVisible time="10" selector="{{PageBuilderContentTypeOptionsMenu.contentTypeOptionsMenuByIndex(contentType.role, contentTypeNumber)}}" stepKey="waitForOptions"/>
2224
<click selector="{{PageBuilderContentTypeOptionsMenu.contentTypeRemoveByIndex(contentType.role, contentTypeNumber)}}" stepKey="clickRemoveContentType"/>

app/code/Magento/PageBuilder/Test/Mftf/ActionGroup/StageActionGroup/FocusOnInlineTinyMCEEditorActionGroup.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<argument name="section" defaultValue="TextOnStage"/>
1313
<argument name="index" defaultValue="1" type="string"/>
1414
<argument name="contentTypeXCoordinate" defaultValue="0" type="string"/>
15-
<argument name="contentTypeYCoordinate" defaultValue="0" type="string"/>
15+
<argument name="contentTypeYCoordinate" defaultValue="10" type="string"/>
1616
</arguments>
1717
<comment userInput="focusOnInlineTinyMCEEditor" stepKey="comment"/>
1818
<waitForElementVisible selector="{{section.tinymce(index)}}" stepKey="waitForEditor"/>

app/code/Magento/PageBuilder/Test/Mftf/ActionGroup/StageActionGroup/GoToMediaStorageFromStageActionGroup.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
<argument name="y" defaultValue="null" type="string"/>
1616
</arguments>
1717
<comment userInput="Hover over content type in stage and click Select From Gallery button" stepKey="commentHover"/>
18+
<moveMouseOver selector="{{PageBuilderPanel.searchPanel}}" stepKey="moveMouseOutsideLiveEdit"/>
1819
<moveMouseOver selector="{{PageBuilderStage.contentTypeInStageByIndex(contentType.role, index)}}" x="{{x}}" y="{{y}}" stepKey="onMouseOverImageContentTypeStage"/>
1920
<waitForElementVisible selector="{{PageBuilderStage.onHoverSelectFromGalleryButton(contentType.role, index)}}" stepKey="seeSelectFromGalleryBtn2"/>
2021
<click selector="{{PageBuilderStage.onHoverSelectFromGalleryButton(contentType.role, index)}}" stepKey="clickSelectFromGalleryBtn1"/>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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="StorefrontValidateCategoryDescriptionAppearanceActionGroup">
11+
<annotations>
12+
<description>Validates the data-appearance attribute value for the category-description first direct child row.</description>
13+
</annotations>
14+
<arguments>
15+
<argument name="dataAppearance" defaultValue="contained" type="string"/>
16+
</arguments>
17+
<waitForElementVisible time="30" selector="{{StorefrontCategoryMainSection.DataAppearanceRow(dataAppearance)}}" stepKey="waitForDataAppearanceRow"/>
18+
</actionGroup>
19+
</actionGroups>

0 commit comments

Comments
 (0)