Skip to content

Commit 162319b

Browse files
committed
#544: Configurable Page Builder Full Screen Mode
- Adding Configurable Option - Setting Default Value - Adding Translation String(s) - Extending Existing Tests
1 parent 410bbbd commit 162319b

File tree

5 files changed

+24
-4
lines changed

5 files changed

+24
-4
lines changed

app/code/Magento/PageBuilder/Test/Mftf/Section/PageBuilderStoreConfigurationSection.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
*/
77
-->
88

9-
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10-
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
9+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
1110
<section name="ContentManagementSection">
1211
<element name="PageBuilderOptions" type="button" selector="#cms_pagebuilder-head"/>
1312
<element name="CheckIfPageBuilderTabExpanded" type="button" selector="#cms_pagebuilder-head:not(.open)"/>
1413
<element name="EnablePageBuilderSystemValue" type="button" selector="#cms_pagebuilder_enabled_inherit"/>
1514
<element name="EnablePageBuilder" type="button" selector="#cms_pagebuilder_enabled"/>
15+
<element name="EnablePageBuilderContentPreview" type="button" selector="#cms_pagebuilder_enable_content_preview"/>
1616
<element name="DisclaimerMessage" type="text" selector="//aside[@data-type='popup']//div[@class='modal-inner-wrap']"/>
1717
<element name="CancelBtn" type="button" selector=".action-pagebuilder-cancel"/>
1818
<element name="TurnOffBtn" type="button" selector=".action-accept"/>

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66
*/
77
-->
88

9-
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10-
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
9+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
1110
<test name="VerifyPageBuilderSwitcherAndDisclaimerMessageTest">
1211
<annotations>
1312
<features value="PageBuilder"/>
@@ -40,6 +39,12 @@
4039
<actualResult type="variable">grabTextFromDisclaimerMsg</actualResult>
4140
<expectedResult type="string">Includes advanced tools to design page layouts, add Magento content (Product and Category data, CMS content and Blocks), and format text.\n\nFor Product Attributes — Page Builder can be selected as the “input type” to design layouts and create content.</expectedResult>
4241
</assertEquals>
42+
<seeOptionIsSelected selector="{{ContentManagementSection.EnablePageBuilderContentPreview}}" userInput="Yes" stepKey="seeEnablePageBuilderContentPreview"/>
43+
<grabTextFrom selector="//tr[@id='row_cms_pagebuilder_enable_content_preview']/td[@class='value']//span" stepKey="grabTextFromEnablePageBuilderContentPreviewComment"/>
44+
<assertEquals message="pass" stepKey="assertEquals3">
45+
<actualResult type="variable">grabTextFromEnablePageBuilderContentPreviewComment</actualResult>
46+
<expectedResult type="string">Preview Page Builder content on product and category editing pages. Setting to "No" can improve performance in case several attributes are editable by Page Builder.</expectedResult>
47+
</assertEquals>
4348
<!--Disable PageBuilder-->
4449
<comment userInput="Disable PageBuilder" stepKey="commentDisablePageBuilder"/>
4550
<selectOption selector="{{ContentManagementSection.EnablePageBuilder}}" userInput="No" stepKey="selectNO1"/>
@@ -52,6 +57,7 @@
5257
<waitForElementVisible selector="{{ContentManagementSection.DisclaimerMessage}}" stepKey="waitForPopUpMsg2"/>
5358
<click selector="{{ContentManagementSection.TurnOffBtn}}" stepKey="selectTurnOff" />
5459
<dontSee selector="{{ContentManagementSection.DisclaimerMessage}}" stepKey="popupClose2"/>
60+
<dontSee selector="{{ContentManagementSection.EnablePageBuilderContentPreview}}" stepKey="dontSeeEnablePageBuilderContentPreview"/>
5561
<seeOptionIsSelected selector="{{ContentManagementSection.EnablePageBuilder}}" userInput="No" stepKey="seeNoIsSelected" />
5662
<click selector="{{ContentManagementSection.Save}}" stepKey="saveConfig" />
5763
<!-- I switch between NO -> YES - > NO without saving the Config, Then: Warning message will not appear on page-->

app/code/Magento/PageBuilder/etc/adminhtml/system.xml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,17 @@
1818
<![CDATA[Includes advanced tools to design page layouts, add Magento content (Product and Category data, CMS content and Blocks), and format text.<br /><br />For Product Attributes — Page Builder can be selected as the “input type” to design layouts and create content.]]>
1919
</comment>
2020
</field>
21+
<field id="enable_content_preview" translate="label comment" type="select" sortOrder="10" showInDefault="1" showInWebsite="0" showInStore="0">
22+
<depends>
23+
<field id="enabled">1</field>
24+
</depends>
25+
<label>Enable Page Builder Content Preview</label>
26+
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
27+
<frontend_model>Magento\PageBuilder\Block\Adminhtml\System\Config\EnableField</frontend_model>
28+
<comment>
29+
<![CDATA[Preview Page Builder content on product and category editing pages. Setting to "No" can improve performance in case several attributes are editable by Page Builder.]]>
30+
</comment>
31+
</field>
2132
<field id="google_maps_api_key" translate="label comment" type="text" sortOrder="2010" showInDefault="1" showInWebsite="0" showInStore="0">
2233
<label>Google Maps API Key</label>
2334
<comment>

app/code/Magento/PageBuilder/etc/config.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
<cms>
2020
<pagebuilder>
2121
<enabled>1</enabled>
22+
<enable_content_preview>1</enable_content_preview>
2223
<column_grid_default>12</column_grid_default>
2324
<column_grid_max>16</column_grid_max>
2425
</pagebuilder>

app/code/Magento/PageBuilder/i18n/en_US.csv

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ Grid,Grid
7070
"Advanced Content Tools","Advanced Content Tools"
7171
"Enable Page Builder","Enable Page Builder"
7272
"Includes advanced tools to design page layouts, add Magento content (Product and Category data, CMS content and Blocks), and format text.<br /><br />For Product Attributes — Page Builder can be selected as the “input type” to design layouts and create content.","Includes advanced tools to design page layouts, add Magento content (Product and Category data, CMS content and Blocks), and format text.<br /><br />For Product Attributes — Page Builder can be selected as the “input type” to design layouts and create content."
73+
"Enable Page Builder Content Preview","Enable Page Builder Content Preview"
74+
"Preview Page Builder content on product and category editing pages. Setting to ""No"" can improve performance in case several attributes are editable by Page Builder.","Preview Page Builder content on product and category editing pages. Setting to ""No"" can improve performance in case several attributes are editable by Page Builder."
7375
Appearance,Appearance
7476
Title,Title
7577
Content,Content

0 commit comments

Comments
 (0)