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>

0 commit comments

Comments
 (0)