Skip to content

Commit 63fcd5f

Browse files
Merge pull request #212 from magento-cia/pre-release-develop-sync-03062023
Sync of pre-release with develop
2 parents 00fb0cd + 2484d99 commit 63fcd5f

File tree

42 files changed

+932
-44
lines changed

Some content is hidden

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

42 files changed

+932
-44
lines changed

.github/CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Contributions to the Magento 2 Page Builder codebase are done using the fork & pull model.
44
This contribution model has contributors maintaining their own fork of the Magento 2 Page Builder repository.
5-
The forked repository is then used to submit a request to the base repository to pull a set of changes.
5+
The forked repository is then used to submit a request to the base repository to "pull" a set of changes.
66
For more information on pull requests please refer to [GitHub Help](https://help.github.com/articles/about-pull-requests/).
77

88
Contributions can take the form of new components or features, changes to existing features, tests, documentation (such as developer guides, user guides, examples, or specifications), bug fixes or optimizations.
@@ -33,7 +33,7 @@ This will allow you to collaborate with the Magento 2 Page Builder development t
3333
1. Search current [listed issues](https://github.com/magento/magento2-page-builder/issues) (open or closed) for similar proposals of intended contribution before starting work on a new contribution.
3434
2. Review the [Contributor License Agreement](https://opensource.adobe.com/cla.html) if this is your first time contributing.
3535
3. Create and test your work.
36-
4. Fork the Magento 2 Page Builder repository according to the [Fork A Repository instructions](https://devdocs.magento.com/guides/v2.4/contributor-guide/contributing.html#fork) and when you are ready to send us a pull request – follow the [Create A Pull Request instructions](https://devdocs.magento.com/guides/v2.4/contributor-guide/contributing.html#pull_request).
36+
4. Fork the Magento 2 Page Builder repository according to the [Fork A Repository instructions](https://developer.adobe.com/commerce/contributor/guides/code-contributions/) and when you are ready to send us a pull request – follow the [Create A Pull Request instructions](https://developer.adobe.com/commerce/contributor/guides/code-contributions/).
3737
5. Once your contribution is received the Magento 2 Page Builder development team will review the contribution and collaborate with you as needed.
3838

3939
## Code of Conduct

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ The wiki provides more information on the Page Builder project, such as:
2121
- [MFTF best practices](https://github.com/magento/magento2-page-builder-docs/wiki/%5BRough-Draft%5D-MFTF-Best-Practices)
2222

2323
## Documentation
24-
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://github.com/magento/magento2-page-builder-docs/wiki/Installation-Guide).
24+
Complete documentation located on the [Magento DevDocs](https://developer.adobe.com/commerce/frontend-core/page-builder/), including what you need to know to start local development as described in the [installation guide](https://github.com/magento/magento2-page-builder-docs/wiki/Installation-Guide).
2525

2626
## Community Engineering Slack
2727

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# Magento_CatalogPageBuilderAnalytics module
22

3-
The Magento_CatalogPageBuilderAnalytics module configures data definitions for a data collection related to the PageBuilder module entities to be used in [Advanced Reporting](https://devdocs.magento.com/guides/v2.4/advanced-reporting/modules.html).
3+
The Magento_CatalogPageBuilderAnalytics module configures data definitions for a data collection related to the PageBuilder module entities to be used in [Advanced Reporting](https://developer.adobe.com/commerce/php/development/advanced-reporting/modules/).
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# Magento_CmsPageBuilderAnalytics module
22

3-
The Magento_CmsPageBuilderAnalytics module configures data definitions for a data collection related to the PageBuilder module entities to be used in [Advanced Reporting](https://devdocs.magento.com/guides/v2.4/advanced-reporting/modules.html).
3+
The Magento_CmsPageBuilderAnalytics module configures data definitions for a data collection related to the PageBuilder module entities to be used in [Advanced Reporting](https://developer.adobe.com/commerce/php/development/advanced-reporting/modules/).

app/code/Magento/PageBuilder/Model/Dom/Element.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ public function querySelectorAll(string $selector): HtmlCollectionInterface
145145
public function removeStyle(string $styleProperty): string
146146
{
147147
$style = $this->getAttribute('style');
148-
$this->setAttribute('style', preg_replace("/${styleProperty}:(.*?);/", '', $style ?? ''));
148+
$this->setAttribute('style', preg_replace("/{$styleProperty}:(.*?);/", '', $style ?? ''));
149149
return $this->getAttribute('style') ?? '';
150150
}
151151

@@ -155,7 +155,7 @@ public function removeStyle(string $styleProperty): string
155155
public function addStyle(string $styleProperty, string $value): string
156156
{
157157
$this->removeStyle($styleProperty);
158-
$this->setAttribute('style', "${styleProperty}: $value; " . $this->getAttribute('style') ?? '');
158+
$this->setAttribute('style', "{$styleProperty}: $value; " . $this->getAttribute('style') ?? '');
159159
return $this->getAttribute('style') ?? '';
160160
}
161161
}

app/code/Magento/PageBuilder/Model/Filter/Template.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,12 @@ function ($errorNumber, $errorString) {
170170
throw new DOMException($errorString, $errorNumber);
171171
}
172172
);
173-
$string = mb_convert_encoding($html, 'HTML-ENTITIES', 'UTF-8');
173+
$convmap = [0x80, 0x10FFFF, 0, 0x1FFFFF];
174+
$string = mb_encode_numericentity(
175+
$html,
176+
$convmap,
177+
'UTF-8'
178+
);
174179
try {
175180
libxml_use_internal_errors(true);
176181
// LIBXML_SCHEMA_CREATE option added according to this message

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,17 @@ public function __construct(
4141
public function filterHtml(string $content): string
4242
{
4343
$dom = new \DOMDocument('1.0', 'UTF-8');
44+
$previous = '';
4445
try {
4546
//this code is required because of https://bugs.php.net/bug.php?id=60021
4647
$previous = libxml_use_internal_errors(true);
4748
$content = '<div>' . $content . '</div>';
48-
$string = mb_convert_encoding($content, 'HTML-ENTITIES', 'UTF-8');
49+
$convmap = [0x80, 0x10FFFF, 0, 0x1FFFFF];
50+
$string = mb_encode_numericentity(
51+
$content,
52+
$convmap,
53+
'UTF-8'
54+
);
4955
$dom->loadHTML($string, LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD);
5056
} catch (\Exception $e) {
5157
$this->loggerInterface->critical($e->getMessage());
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="assertFieldSlideOutPropertyValueEquals">
11+
<arguments>
12+
<argument name="property"/>
13+
<argument name="value" defaultValue="" type="string"/>
14+
</arguments>
15+
<waitForElement time="2" selector="{{EditPanelForm.panelFieldControl(property.section, property.fieldName)}}" stepKey="waitForElementVisible"/>
16+
<see userInput="{{property.name}}" selector="{{EditPanelForm.panelFieldLabel(property.section, property.fieldName, property.section, property.name)}}" stepKey="seePropertyLabel"/>
17+
<grabValueFrom selector="{{EditPanelForm.panelFieldControl(property.section, property.fieldName)}}" stepKey="getFieldValue"/>
18+
<assertEquals stepKey="assertFieldValueEquals">
19+
<actualResult type="variable">getFieldValue</actualResult>
20+
<expectedResult type="string">{{value}}</expectedResult>
21+
</assertEquals>
22+
</actionGroup>
23+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
10+
<test name="AdminSimpleProductSetEditMetaDescriptionContentTest">
11+
<annotations>
12+
<features value="Catalog"/>
13+
<stories value="Create/edit simple product"/>
14+
<title value="Admin should be able to set/edit product Content when editing a simple product. Meta description should be autogenerated, based on updated mask with Page Builder installed."/>
15+
<description value="Admin should be able to set/edit product Content when editing a simple product"/>
16+
<severity value="MINOR"/>
17+
<testCaseId value="AC-6971"/>
18+
<group value="Catalog"/>
19+
<group value="WYSIWYGDisabled"/>
20+
</annotations>
21+
<actionGroup ref="AssertMetaDescriptionInProductEditFormActionGroup" stepKey="seeProductMetaDescription">
22+
<argument name="productMetaDescription" value="simple"/>
23+
</actionGroup>
24+
</test>
25+
</tests>

app/code/Magento/PageBuilder/Test/Mftf/Test/AdminPageBuilderBannerCommonTest/BannerTextContainingPageBuilderMarkupWontBreakStageTest.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,15 @@
3838
<dontSeeElement selector="{{HtmlOnStage.base('1')}}" stepKey="dontSeeHtmlCode"/>
3939
<waitForElementVisible selector="{{BannerOnBackend.base('1')}}" stepKey="waitForBannerVisible"/>
4040
<seeElement selector="{{BannerOnBackend.messageContent('1', PageBuilderBannerMessageProperty.value)}}" stepKey="seeTestStringInBanner"/>
41+
<actionGroup ref="exitPageBuilderFullScreen" stepKey="exitPageBuilderFullScreenDesktop"/>
42+
<actionGroup ref="AdminSaveAndContinueEditCmsPageActionGroup" stepKey="saveAndContinueEditCmsPageDesktop"/>
43+
<actionGroup ref="switchToPageBuilderStage" stepKey="switchToPageBuilderStage"/>
44+
<actionGroup ref="dragContentTypeToStage" stepKey="dragRowToRootContainer">
45+
<argument name="contentType" value="PageBuilderRowContentType"/>
46+
<argument name="containerTargetType" value="PageBuilderRootContainerContentType"/>
47+
</actionGroup>
48+
<dontSeeElement selector="{{HtmlOnStage.base('1')}}" stepKey="dontSeeHtmlCodeAfterSave"/>
49+
<waitForElementVisible selector="{{BannerOnBackend.base('1')}}" stepKey="waitForBannerVisibleAfterSave"/>
50+
<seeElement selector="{{BannerOnBackend.messageContent('1', PageBuilderBannerMessageProperty.value)}}" stepKey="seeTestStringInBannerAfterSave"/>
4151
</test>
4252
</tests>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
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+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
10+
<test name="AdminPageBuilderProductsCarouselSelectBySKUWithSpecialCharacterAndVerifyProductIsDisplayedTest" extends="AdminPageBuilderProductsSelectBySKUWithSpecialCharacterAndVerifyProductIsDisplayedTest">
11+
<annotations>
12+
<features value="PageBuilder"/>
13+
<stories value="Products"/>
14+
<title value="Carousel - Select Products By SKU with special characters, delete one product, verify product is displayed in the content preview and storefront"/>
15+
<description value="Verify that a product is shown in the content preview and storefront if the content type is filtered by 'Select By SKU' and the SKU contains special characters"/>
16+
<severity value="MINOR"/>
17+
<useCaseId value="ACP2E-1444"/>
18+
<testCaseId value="AC-7587"/>
19+
<group value="pagebuilder"/>
20+
<group value="pagebuilder-products"/>
21+
<group value="pagebuilder-productsCarousel"/>
22+
</annotations>
23+
<actionGroup ref="chooseVisualSelectOption" stepKey="selectAppearance">
24+
<argument name="property" value="PageBuilderProductsProductCarouselAppearance"/>
25+
</actionGroup>
26+
<actionGroup ref="fillSlideOutPanelFieldGeneral" stepKey="enterProductsCount">
27+
<argument name="property" value="PageBuilderProductsCarouselCountPropertyFour"/>
28+
</actionGroup>
29+
<actionGroup ref="validateProductCountInProducts" stepKey="validateProductsCountStage">
30+
<argument name="page" value="ProductsCarouselOnStage"/>
31+
<argument name="count" value="1"/>
32+
</actionGroup>
33+
<actionGroup ref="validateProductInProducts" stepKey="validateProduct1Stage">
34+
<argument name="page" value="ProductsCarouselOnStage"/>
35+
<argument name="product" value="ProductWithSpecialCharsInSKU"/>
36+
<argument name="productIndex" value="1"/>
37+
</actionGroup>
38+
<actionGroup ref="validateProductCountInProducts" stepKey="validateProductsCountStage2">
39+
<argument name="page" value="ProductsCarouselOnStage"/>
40+
<argument name="count" value="1"/>
41+
</actionGroup>
42+
<actionGroup ref="validateProductInProducts" stepKey="validateProduct2Stage2">
43+
<argument name="page" value="ProductsCarouselOnStage"/>
44+
<argument name="product" value="ProductWithSpecialCharsInSKU"/>
45+
<argument name="productIndex" value="1"/>
46+
</actionGroup>
47+
</test>
48+
</tests>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
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+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
10+
<test name="AdminPageBuilderProductsSelectBySKUWithSpecialCharacterAndVerifyProductIsDisplayedTest">
11+
<annotations>
12+
<features value="PageBuilder"/>
13+
<stories value="Products"/>
14+
<title value="Grid - Select Products By SKU with special characters, delete one product, verify product is displayed in the content preview and storefront"/>
15+
<description value="Verify that a product is shown in the content preview and storefront if the content type is filtered by 'Select By SKU' and the SKU contains special characters"/>
16+
<severity value="MINOR"/>
17+
<useCaseId value="ACP2E-1444"/>
18+
<testCaseId value="AC-7586"/>
19+
<group value="pagebuilder"/>
20+
<group value="pagebuilder-products"/>
21+
<group value="pagebuilder-productsGrid"/>
22+
</annotations>
23+
<before>
24+
<createData entity="ProductWithSpecialCharsInSKU" stepKey="createProduct1"/>
25+
<createData entity="SimpleProduct" stepKey="createProduct2"/>
26+
<createData entity="_emptyCmsPage" stepKey="createCMSPage"/>
27+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
28+
<actionGroup ref="navigateToCMSPage" stepKey="navigateToCMSPage">
29+
<argument name="CMSPage" value="$$createCMSPage$$"/>
30+
</actionGroup>
31+
<actionGroup ref="switchToPageBuilderStage" stepKey="switchToPageBuilderStage"/>
32+
<actionGroup ref="dragContentTypeToStage" stepKey="dragRowToRootContainer">
33+
<argument name="contentType" value="PageBuilderRowContentType"/>
34+
<argument name="containerTargetType" value="PageBuilderRootContainerContentType"/>
35+
</actionGroup>
36+
</before>
37+
<after>
38+
<deleteData createDataKey="createProduct1" stepKey="deleteProduct1"/>
39+
<deleteData createDataKey="createProduct2" stepKey="deleteProduct2"/>
40+
<deleteData createDataKey="createCMSPage" stepKey="deleteCMSPage"/>
41+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
42+
</after>
43+
<actionGroup ref="expandPageBuilderPanelMenuSection" stepKey="expandMenuSectionAddContent">
44+
<argument name="contentType" value="PageBuilderProductsContentType"/>
45+
</actionGroup>
46+
<actionGroup ref="dragContentTypeToStage" stepKey="dragProductsIntoStage">
47+
<argument name="contentType" value="PageBuilderProductsContentType"/>
48+
</actionGroup>
49+
<actionGroup ref="openPageBuilderEditPanel" stepKey="openEditAfterDrop">
50+
<argument name="contentType" value="PageBuilderProductsContentType"/>
51+
</actionGroup>
52+
<actionGroup ref="chooseVisualSelectOption" stepKey="selectAppearance">
53+
<argument name="property" value="PageBuilderProductsProductGridAppearance"/>
54+
</actionGroup>
55+
<actionGroup ref="chooseVisualSelectOption" stepKey="chooseSelectProductsBy">
56+
<argument name="property" value="PageBuilderProductsSelectProductsBySKU"/>
57+
</actionGroup>
58+
<actionGroup ref="addSKUsToSelectProductsBySKU" stepKey="addProductsSKUsToInputField">
59+
<argument name="SKUs" value="$$createProduct1.sku$$"/>
60+
</actionGroup>
61+
<actionGroup ref="fillSlideOutPanelFieldGeneral" stepKey="enterProductsCount">
62+
<argument name="property" value="PageBuilderProductsCountPropertyFour"/>
63+
</actionGroup>
64+
<actionGroup ref="saveEditPanelSettings" stepKey="saveEditPanelSettings"/>
65+
<actionGroup ref="validateProductCountInProducts" stepKey="validateProductsCountStage">
66+
<argument name="page" value="ProductsOnStage"/>
67+
<argument name="count" value="1"/>
68+
</actionGroup>
69+
<actionGroup ref="validateProductInProducts" stepKey="validateProduct1Stage">
70+
<argument name="page" value="ProductsOnStage"/>
71+
<argument name="product" value="ProductWithSpecialCharsInSKU"/>
72+
<argument name="productIndex" value="1"/>
73+
</actionGroup>
74+
<actionGroup ref="exitPageBuilderFullScreen" stepKey="exitPageBuilderFullScreen"/>
75+
<actionGroup ref="SaveAndContinueEditCmsPageActionGroup" stepKey="saveAndContinueEditCmsPage"/>
76+
<reloadPage stepKey="reloadPage"/>
77+
<waitForPageLoad stepKey="waitForReload"/>
78+
<actionGroup ref="switchToPageBuilderStage" stepKey="switchToPageBuilderStage1"/>
79+
<actionGroup ref="validateProductCountInProducts" stepKey="validateProductsCountStage2">
80+
<argument name="page" value="ProductsOnStage"/>
81+
<argument name="count" value="1"/>
82+
</actionGroup>
83+
<actionGroup ref="validateProductInProducts" stepKey="validateProduct2Stage2">
84+
<argument name="page" value="ProductsOnStage"/>
85+
<argument name="product" value="ProductWithSpecialCharsInSKU"/>
86+
<argument name="productIndex" value="1"/>
87+
</actionGroup>
88+
<actionGroup ref="openPageBuilderEditPanel" stepKey="openProductsContentType">
89+
<argument name="contentType" value="PageBuilderProductsContentType"/>
90+
</actionGroup>
91+
<actionGroup ref="assertFieldSlideOutPropertyValueEquals" stepKey="assertSKUFilterValueEqualsToProductSKU">
92+
<argument name="property" value="PageBuilderProductsEnterSKUsInput"/>
93+
<argument name="value" value="$$createProduct1.sku$$"/>
94+
</actionGroup>
95+
</test>
96+
</tests>

app/code/Magento/PageBuilder/Test/Mftf/Test/AdminPageBuilderSlideItemCommonTest/SlideItemTextContainingPageBuilderMarkupWontBreakStageTest.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,15 @@
4040
<dontSeeElement selector="{{HtmlOnStage.base('1')}}" stepKey="dontSeeHtmlCode"/>
4141
<waitForElementVisible selector="{{SlideOnBackend.base('1')}}" stepKey="waitForSlideItemVisible"/>
4242
<seeElement selector="{{SlideOnBackend.messageContent('1', PageBuilderSlideItemButtonText_Common.value)}}" stepKey="seeTestStringInSlideItem"/>
43+
<actionGroup ref="exitPageBuilderFullScreen" stepKey="exitPageBuilderFullScreenDesktop"/>
44+
<actionGroup ref="AdminSaveAndContinueEditCmsPageActionGroup" stepKey="saveAndContinueEditCmsPageDesktop"/>
45+
<actionGroup ref="switchToPageBuilderStage" stepKey="switchToPageBuilderStage"/>
46+
<actionGroup ref="dragContentTypeToStage" stepKey="dragRowToRootContainer">
47+
<argument name="contentType" value="PageBuilderRowContentType"/>
48+
<argument name="containerTargetType" value="PageBuilderRootContainerContentType"/>
49+
</actionGroup>
50+
<dontSeeElement selector="{{HtmlOnStage.base('1')}}" stepKey="dontSeeHtmlCodeAfterSave"/>
51+
<waitForElementVisible selector="{{SlideOnBackend.base('1')}}" stepKey="waitForSlideItemVisibleAfterSave"/>
52+
<seeElement selector="{{SlideOnBackend.messageContent('1', PageBuilderSlideItemButtonText_Common.value)}}" stepKey="seeTestStringInSlideItemAfterSave"/>
4353
</test>
4454
</tests>

0 commit comments

Comments
 (0)