Skip to content

Commit 3591899

Browse files
Merge branch '510_content-snapshot-cms-admin-page' of github.com:magento/magento2-page-builder into 512_content-snapshot-block-admin-page
2 parents 3958e7b + 519131c commit 3591899

File tree

50 files changed

+1335
-109
lines changed

Some content is hidden

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

50 files changed

+1335
-109
lines changed

app/code/Magento/PageBuilder/Component/Form/Element/Wysiwyg.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public function __construct(
6666
$data['config']['component'] = 'Magento_PageBuilder/js/form/element/wysiwyg';
6767

6868
// Override the templates to include our KnockoutJS code
69-
$data['config']['template'] = 'Magento_PageBuilder/form/element/wysiwyg';
69+
$data['config']['template'] = 'ui/form/field';
7070
$data['config']['elementTmpl'] = 'Magento_PageBuilder/form/element/wysiwyg';
7171
$wysiwygConfigData = $stageConfig->getConfig();
7272
$data['config']['wysiwygConfigData'] = isset($config['wysiwygConfigData']) ?
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
declare(strict_types = 1);
8+
9+
namespace Magento\PageBuilder\Plugin\Catalog\Ui\DataProvider\Product\Form\Modifier;
10+
11+
use Magento\Catalog\Api\Data\ProductAttributeInterface;
12+
use Magento\Catalog\Ui\DataProvider\Product\Form\Modifier\Eav as EavModifier;
13+
use Magento\Framework\Stdlib\ArrayManager;
14+
15+
/**
16+
* Data Provider for EAV Attributes on Product Page
17+
*/
18+
class EavPlugin
19+
{
20+
public const META_ATTRIBUTE_CONFIG_PATH = 'arguments/data/config';
21+
22+
/**
23+
* @var ArrayManager
24+
*/
25+
private $arrayManager;
26+
27+
/**
28+
* @param ArrayManager $arrayManager
29+
*/
30+
public function __construct(ArrayManager $arrayManager)
31+
{
32+
$this->arrayManager = $arrayManager;
33+
}
34+
35+
/**
36+
* Setup Attribute Meta
37+
*
38+
* @param EavModifier $subject
39+
* @param array $result
40+
* @param ProductAttributeInterface $attribute
41+
* @param string $groupCode
42+
* @param int $sortOrder
43+
* @return array
44+
*
45+
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
46+
*/
47+
public function afterSetupAttributeMeta(
48+
EavModifier $subject,
49+
$result,
50+
ProductAttributeInterface $attribute,
51+
$groupCode,
52+
$sortOrder
53+
) {
54+
$meta = $result;
55+
56+
if ($attribute->getData('is_pagebuilder_enabled')) {
57+
$meta = $this->arrayManager->merge(
58+
static::META_ATTRIBUTE_CONFIG_PATH,
59+
$result,
60+
[
61+
'additionalClasses' => 'admin__field-wide admin__field-page-builder'
62+
]
63+
);
64+
}
65+
66+
return $meta;
67+
}
68+
69+
/**
70+
* Setup Attribute Container Meta
71+
*
72+
* @param EavModifier $subject
73+
* @param array $result
74+
* @param ProductAttributeInterface $attribute
75+
* @return array
76+
*
77+
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
78+
*/
79+
public function afterSetupAttributeContainerMeta(
80+
EavModifier $subject,
81+
$result,
82+
ProductAttributeInterface $attribute
83+
) {
84+
$containerMeta = $result;
85+
86+
if ($attribute->getData('is_pagebuilder_enabled')) {
87+
$containerMeta = $this->arrayManager->merge(
88+
static::META_ATTRIBUTE_CONFIG_PATH,
89+
$result,
90+
[
91+
'additionalFieldsetClasses' => [
92+
'admin__field-wide' => true,
93+
'admin__fieldset-page-builder' => true
94+
],
95+
'template' => 'Magento_PageBuilder/form/components/group/group'
96+
]
97+
);
98+
}
99+
100+
return $containerMeta;
101+
}
102+
}

app/code/Magento/PageBuilder/Test/Mftf/ActionGroup/AdminActionGroup/SwitchToPageBuilderStageActionGroup.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,16 @@
1111
<arguments>
1212
<argument name="sectionSelector" defaultValue="{{CmsNewPagePageContentSection.header}}" type="string"/>
1313
<argument name="sectionDependentSelector" defaultValue="{{CmsNewPagePageContentSection.header}}._show" type="string"/>
14+
<argument name="snapshotSelector" defaultValue="{{PageBuilderStage.snapshot}}" type="string"/>
15+
<argument name="editButtonSelector" defaultValue="{{PageBuilderStage.editButtonSelector}}" type="string"/>
1416
<argument name="rowIndex" defaultValue="1" type="string"/>
1517
</arguments>
1618
<waitForElementVisible time="30" selector="{{sectionSelector}}" stepKey="waitForSection"/>
1719
<conditionalClick selector="{{sectionSelector}}" dependentSelector="{{sectionDependentSelector}}" visible="false" stepKey="expandSection"/>
1820
<waitForPageLoad time="30" stepKey="waitForStageToLoad"/>
21+
<waitForElementVisible time="30" selector="{{snapshotSelector}}" stepKey="waitForSnapshot"/>
22+
<waitForElementVisible time="30" selector="{{editButtonSelector}}" stepKey="waitForEditButton"/>
23+
<click selector="{{editButtonSelector}}" stepKey="clickEditButton"/>
1924
<!-- Wait for the first row to be added into the stage for it to be "ready" -->
2025
<waitForElementNotVisible selector="{{PageBuilderStage.stageLoading}}" stepKey="waitForStageLoadingGraphicNotVisible"/>
2126
<waitForElementVisible time="30" selector="{{RowOnStage.base(rowIndex)}}" stepKey="waitForPageBuilderRow"/>
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="switchToPageBuilderStage">
11+
<arguments>
12+
<argument name="sectionSelector" defaultValue="{{CmsNewPagePageContentSection.header}}" type="string"/>
13+
<argument name="sectionDependentSelector" defaultValue="{{CmsNewPagePageContentSection.header}}._show" type="string"/>
14+
<argument name="rowIndex" defaultValue="1" type="string"/>
15+
</arguments>
16+
<waitForElementVisible time="30" selector="{{sectionSelector}}" stepKey="waitForSection"/>
17+
<conditionalClick selector="{{sectionSelector}}" dependentSelector="{{sectionDependentSelector}}" visible="false" stepKey="expandSection"/>
18+
<waitForPageLoad time="30" stepKey="waitForStageToLoad"/>
19+
<!-- Wait for the first row to be added into the stage for it to be "ready" -->
20+
<waitForElementNotVisible selector="{{PageBuilderStage.stageLoading}}" stepKey="waitForStageLoadingGraphicNotVisible"/>
21+
<waitForElementVisible time="30" selector="{{RowOnStage.base(rowIndex)}}" stepKey="waitForPageBuilderRow"/>
22+
</actionGroup>
23+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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="AdminOpenPageBuilderFromContentPreviewOverlayActionGroup">
11+
<annotations>
12+
<description>Click Page Builder preview overlay to open Page Builder stage.</description>
13+
</annotations>
14+
<waitForElementVisible selector="{{PageBuilderStage.stageOverlay}}" stepKey="waitForStageOverlay"/>
15+
<click selector="{{PageBuilderStage.stageOverlay}}" stepKey="clickOnStageOverlayOnStage"/>
16+
<waitForPageLoad stepKey="waitForPageLoadPageBuilder"/>
17+
<waitForElementVisible selector="{{PageBuilderPanel.layoutMenuSection}}" stepKey="waitForPageBuilderLayoutMenu"/>
18+
<waitForElementVisible selector="{{PageBuilderStage.stageWrapperFullScreen}}" stepKey="waitForPageBuilderFullScreen"/>
19+
</actionGroup>
20+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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="ValidatePageBuilderPreviewActionGroup">
11+
<annotations>
12+
<description>Verifies Page Builder preview has the 'Edit with Page Builder' button, has an overlay, does not have the Page Builder left panel, does not have the Page Builder template buttons, and does not open content type option menus.</description>
13+
</annotations>
14+
<arguments>
15+
<argument name="pageBuilderArea" defaultValue="" type="string"/>
16+
</arguments>
17+
<waitForElementVisible selector="{{pageBuilderArea}}{{PageBuilderStage.editWithPageBuilderButton}}" stepKey="waitForEditWithPageBuilderButton"/>
18+
<see userInput="Edit with Page Builder" selector="{{pageBuilderArea}}{{PageBuilderStage.editWithPageBuilderButton}}" stepKey="seeEditWithPageBuilderButton"/>
19+
<dontSeeElementInDOM selector="{{PageBuilderPanel.leftPanel}}" stepKey="dontSeePageBuilderContentTypePanel"/>
20+
<dontSeeElementInDOM selector="{{pageBuilderArea}}{{PageBuilderStage.applyTemplateButton}}" stepKey="dontSeePageBuilderApplyTemplateButton"/>
21+
<dontSeeElementInDOM selector="{{pageBuilderArea}}{{PageBuilderStage.saveAsTemplateButton}}" stepKey="dontSeePageBuilderSaveAsTemplateButton"/>
22+
<waitForElementVisible selector="{{PageBuilderStage.stageOverlay}}" stepKey="waitForStageOverlay"/>
23+
<moveMouseOver selector="{{PageBuilderStage.stageOverlay}}" stepKey="mouseOverStageOverlay"/>
24+
<waitForElementVisible selector="{{PageBuilderStage.stageOverlayOnHover}}" stepKey="waitForStageOverlayOnHover"/>
25+
<dontSeeElement selector="{{PageBuilderContentTypeOptionsMenu.contentTypeOptionsMenu(PageBuilderRowContentType.role)}}" stepKey="dontSeeRowOptionMenu"/>
26+
</actionGroup>
27+
</actionGroups>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
<waitForPageLoad stepKey="waitForStageLoad"/>
1919
<waitForElementVisible selector="{{RowOnStage.empty(rowIndex)}}" stepKey="waitForEmptyRow"/>
2020
<seeElement selector="{{RowOnStage.empty(rowIndex)}}" stepKey="seeEmptyRow"/>
21+
<see userInput="Drag content types or columns here" selector="{{RowOnStage.emptyPlaceholder(rowIndex)}}" stepKey="seeEmptyRowPlaceholderMessage"/>
2122
<seeNumberOfElements userInput="1" selector="{{pageBuilderArea}}{{RowOnStage.allRows}}" stepKey="seeOnlyOneRow"/>
2223
</actionGroup>
2324
</actionGroups>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<waitForLoadingMaskToDisappear stepKey="waitForSelectPageModal"/>
2424
<waitForElementVisible selector="{{WidgetSection.SelectPageFilterInput('chooser_title')}}" stepKey="waitForGrid"/>
2525
<fillField selector="{{WidgetSection.SelectPageFilterInput('chooser_identifier')}}" userInput="{{page}}" stepKey="enterPageName"/>
26-
<click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickSearch"/>
26+
<click selector=".modal-slide._show {{AdminProductGridFilterSection.applyFilters}}" stepKey="clickSearch"/>
2727
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappear3"/>
2828
<waitForElementVisible selector="//td[contains(@class,'col-url')][contains(text(),'{{page}}')]" stepKey="waitForSearchResult"/>
2929
<click selector="//td[contains(@class,'col-url')][contains(text(),'{{page}}')]" stepKey="clickCmsPageLinkRow"/>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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="ClickTinyMCEInsertImageButtonActionGroup">
11+
<annotations>
12+
<description>Clicks the Insert Link button from the TinyMCE.</description>
13+
</annotations>
14+
<arguments>
15+
<argument name="section" defaultValue="TinyMCESection"/>
16+
<argument name="wysiwygArea" defaultValue="{{WYSIWYGOnPageBuilderInline.notCss}}" type="string"/>
17+
</arguments>
18+
<waitForElementVisible selector="{{wysiwygArea}} {{section.InsertLink}}" stepKey="waitForTinyMCEInsertLinkButton"/>
19+
<click selector="{{wysiwygArea}} {{section.InsertLink}}" stepKey="clickTinyMCEInsertLinkButton"/>
20+
<waitForElementVisible selector="{{WYSIWYGInsertLinkModal.modal}}" stepKey="waitForWYSIWYGInsertLinkModal"/>
21+
</actionGroup>
22+
</actionGroups>
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="FillTinyMCEInsertImageModalAndSaveActionGroup">
11+
<annotations>
12+
<description>Adds text to Text To Display field from the TinyMCE Insert Link Modal window.</description>
13+
</annotations>
14+
<arguments>
15+
<argument name="textToDisplay" defaultValue="" type="string"/>
16+
</arguments>
17+
<waitForElementVisible selector="{{WYSIWYGInsertLinkModal.textToDisplayInput}}" stepKey="waitForTinyMCELinkModalTextToDisplayInput"/>
18+
<fillField selector="{{WYSIWYGInsertLinkModal.textToDisplayInput}}" userInput="{{textToDisplay}}" stepKey="insertTinyMCELinkModalTextToDisplayInput"/>
19+
<waitForElementVisible selector="{{WYSIWYGInsertLinkModal.okButton}}" stepKey="waitForTinyMCEInsertLinkModalOkButton"/>
20+
<click selector="{{WYSIWYGInsertLinkModal.okButton}}" stepKey="clickTinyMCEInsertLinkModalOkButton"/>
21+
<waitForElementNotVisible selector="{{WYSIWYGInsertLinkModal.modal}}" stepKey="waitForTinyMCEInsertLinkModalNotVisible"/>
22+
</actionGroup>
23+
</actionGroups>

0 commit comments

Comments
 (0)