Skip to content

Commit a1537b0

Browse files
Merge pull request #394 from magento-cia/cia-2.4.8-develop-2.4-develop-sync-02212025
Cia 2.4.8 develop 2.4 develop sync 02212025
2 parents b7cdedc + adfb174 commit a1537b0

File tree

11 files changed

+322
-176
lines changed

11 files changed

+322
-176
lines changed

app/code/Magento/PageBuilder/Model/Wysiwyg/DefaultConfigProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function getConfig(DataObject $config): DataObject
4545
$config->addData(
4646
[
4747
'tinymce' => [
48-
'toolbar' => 'undo redo | styles | fontfamily fontsize | lineheight | forecolor backcolor ' .
48+
'toolbar' => 'undo redo | styles | fontfamily fontsizeinput | lineheight | forecolor backcolor ' .
4949
'| bold italic underline | alignleft aligncenter alignright | numlist bullist ' .
5050
'| link image table charmap',
5151

app/code/Magento/PageBuilder/Test/Mftf/Section/PageBuilderWYSIWYGSection/WYSIWYGOnPageBuilderInlineSection.xml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!--
33
/**
4-
* Copyright 2024 Adobe
5-
* All rights reserved.
6-
* See COPYING.txt for license details.
4+
* Copyright 2025 Adobe
5+
* All Rights Reserved.
76
*/
87
-->
98
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
@@ -14,11 +13,13 @@
1413
<element name="notCss" type="button" selector=".tox-tinymce:not(.tox-tinymce-inline)"/>
1514
<element name="undo" type="button" selector=".tox-tinymce-inline button[aria-label='Undo']"/>
1615
<element name="redo" type="button" selector=".tox-tinymce-inline button[aria-label='Redo']"/>
17-
<element name="formatSelector" type="button" selector=".tox-tinymce-inline button[aria-label='Formats']"/>
18-
<element name="fontSize" type="button" selector=".tox-tinymce-inline button[aria-label='Font sizes']"/>
16+
<element name="formatSelector" type="button" selector=".tox-tinymce-inline button[aria-label='Format Paragraph']"/>
17+
<element name="fontSize" type="button" selector=".tox-tinymce-inline button[aria-label*='font size']:nth-of-type(1)"/>
18+
<element name="fontSizeMinus" type="button" selector=".tox-tinymce-inline button[aria-label*='font size']:nth-of-type(1)"/>
19+
<element name="fontSizePlus" type="button" selector=".tox-tinymce-inline button[aria-label*='font size']:nth-of-type(2)"/>
1920
<element name="lineHeight" type="button" selector=".tox-tinymce-inline button[aria-label='Line height']"/>
20-
<element name="textColor" type="button" selector=".tox-tinymce-inline div[aria-label='Text color']"/>
21-
<element name="backgroundColor" type="button" selector=".tox-tinymce-inline div[aria-label='Background color']"/>
21+
<element name="textColor" type="button" selector=".tox-tinymce-inline div[aria-label='Text color Black']"/>
22+
<element name="backgroundColor" type="button" selector=".tox-tinymce-inline div[aria-label='Background color Black']"/>
2223
<element name="bold" type="button" selector=".tox-tinymce-inline button[aria-label='Bold']"/>
2324
<element name="italic" type="button" selector=".tox-tinymce-inline button[aria-label='Italic']"/>
2425
<element name="underline" type="button" selector=".tox-tinymce-inline button[aria-label='Underline']"/>
@@ -32,6 +33,7 @@
3233
<element name="table" type="button" selector=".tox-tinymce-inline button[aria-label='Table']"/>
3334
<element name="tableMenuFirstItem" type="text" selector="div[title='Table']"/>
3435
<element name="tableGrid" type="text" parameterized="true" selector="//div[@class='tox-insert-table-picker']//div[{{size}}]"/>
36+
<element name="fontSizeValue" type="text" parameterized="true" selector="//*[@data-mce-style and contains(@style, '{{size}}')]"/>
3537
<element name="tableToolbar" type="text" selector=".tox-pop .tox-pop__dialog .tox-toolbar"/>
3638
<element name="tableProperties" type="button" selector="button[aria-label='Table properties']"/>
3739
<element name="deleteTable" type="button" selector="button[aria-label='Delete table']"/>
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!--
33
/**
4-
* Copyright © Magento, Inc. All rights reserved.
5-
* See COPYING.txt for license details.
4+
* Copyright 2025 Adobe
5+
* All Rights Reserved.
66
*/
77
-->
8+
89
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
910
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
1011
<section name="WYSIWYGOnPageBuilder">
1112
<element name="undo" type="button" selector=".tox-tinymce:not(.tox-tinymce-inline) button[aria-label='Undo']"/>
1213
<element name="redo" type="button" selector=".tox-tinymce:not(.tox-tinymce-inline) button[aria-label='Redo']"/>
13-
<element name="fontSize" type="button" selector=".tox-tinymce:not(.tox-tinymce-inline) button[aria-label='Font sizes']"/>
14+
<element name="fontSize" type="button" selector=".tox-tinymce:not(.tox-tinymce-inline) button[aria-label*='font size']:nth-of-type(1)"/>
1415
<element name="lineHeight" type="button" selector=".mce-tinymce:not(.mce-tinymce-inline) div[aria-label='Line Height']"/>
15-
<element name="textColor" type="button" selector=".tox-tinymce:not(.tox-tinymce-inline) div[aria-label='Text color']"/>
16-
<element name="backgroundColor" type="button" selector=".tox-tinymce:not(.tox-tinymce-inline) div[aria-label='Background color']"/>
16+
<element name="textColor" type="button" selector=".tox-tinymce:not(.tox-tinymce-inline) div[aria-label='Text color Black']"/>
17+
<element name="backgroundColor" type="button" selector=".tox-tinymce:not(.tox-tinymce-inline) div[aria-label='Background color Black']"/>
1718
<element name="formatSelector" type="button" selector="//div[contains(@class, 'tox-tinymce') and not(contains(@class, 'tox-tinymce-inline'))]//span[text()='Paragraph']"/>
1819
</section>
1920
</sections>

app/code/Magento/PageBuilder/Test/Mftf/Test/AdminPageBuilderTextTest/TextAddTextWithCustomTinyMCETest.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!--
33
/**
4-
* Copyright © Magento, Inc. All rights reserved.
5-
* See COPYING.txt for license details.
4+
* Copyright 2025 Adobe
5+
* All Rights Reserved.
66
*/
77
-->
8+
89
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
910
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
1011
<test name="TextAddTextWithCustomTinyMCETest">
@@ -18,7 +19,6 @@
1819
<testCaseId value="MC-1333"/>
1920
<group value="pagebuilder"/>
2021
<group value="pagebuilder-text"/>
21-
<group value="pr_exclude"/>
2222
</annotations>
2323
<before>
2424
<createData entity="_defaultCmsPage" stepKey="createCMSPage"/>

app/code/Magento/PageBuilder/Test/Mftf/Test/AdminPageBuilderTextTest/TextVerifySelectionInlineWYSIWYG.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!--
33
/**
4-
* Copyright © Magento, Inc. All rights reserved.
5-
* See COPYING.txt for license details.
4+
* Copyright 2025 Adobe
5+
* All Rights Reserved.
66
*/
77
-->
8+
89
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
910
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
1011
<test name="TextVerifySelectionInlineWYSIWYG">
@@ -18,7 +19,6 @@
1819
<testCaseId value="MC-29450"/>
1920
<group value="pagebuilder"/>
2021
<group value="pagebuilder-text"/>
21-
<group value="pr_exclude"/>
2222
</annotations>
2323
<before>
2424
<createData entity="_emptyCmsPage" stepKey="createCMSPage"/>

app/code/Magento/PageBuilder/Test/Mftf/Test/AdminPageBuilderTextTest/TextVerifyTinyMCEToolbarOnPageBuilderStageTest.xml

Lines changed: 26 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!--
3-
/**
4-
* Copyright © Magento, Inc. All rights reserved.
5-
* See COPYING.txt for license details.
6-
*/
3+
/**
4+
* Copyright 2025 Adobe
5+
* All Rights Reserved.
6+
*/
77
-->
88
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
99
<test name="TextVerifyTinyMCEToolbarOnPageBuilderStageTest">
@@ -17,7 +17,6 @@
1717
<testCaseId value="MC-3463"/>
1818
<group value="pagebuilder"/>
1919
<group value="pagebuilder-text"/>
20-
<group value="pr_exclude"/>
2120
</annotations>
2221
<before>
2322
<createData entity="_defaultCmsPage" stepKey="createCMSPage"/>
@@ -52,51 +51,31 @@
5251
<seeElement selector="{{WYSIWYGOnPageBuilderInline.textColor}}" stepKey="seeTextColor"/>
5352
<seeElement selector="{{WYSIWYGOnPageBuilderInline.backgroundColor}}" stepKey="seeBackgroundColor"/>
5453
<!--Verify FontSize-->
55-
<comment userInput="Verify FontSize" stepKey="commentVerifyFontSize"/>
56-
<click selector="{{WYSIWYGOnPageBuilderInline.fontSize}}" stepKey="clickOnFontSize"/>
57-
<see userInput="10px" stepKey="see10px"/>
58-
<see userInput="12px" stepKey="see12px"/>
59-
<see userInput="14px" stepKey="see14px"/>
60-
<see userInput="16px" stepKey="see16px"/>
61-
<see userInput="18px" stepKey="see18px"/>
62-
<see userInput="20px" stepKey="see20px"/>
63-
<see userInput="24px" stepKey="see24px"/>
64-
<see userInput="26px" stepKey="see26px"/>
65-
<see userInput="28px" stepKey="see28px"/>
66-
<see userInput="32px" stepKey="see32px"/>
67-
<see userInput="34px" stepKey="see34px"/>
68-
<see userInput="36px" stepKey="see36px"/>
69-
<see userInput="38px" stepKey="see38px"/>
70-
<see userInput="40px" stepKey="see40px"/>
71-
<see userInput="42px" stepKey="see42px"/>
72-
<see userInput="48px" stepKey="see48px"/>
73-
<see userInput="52px" stepKey="see52px"/>
74-
<see userInput="56px" stepKey="see56px"/>
75-
<see userInput="64px" stepKey="see64px"/>
76-
<see userInput="72px" stepKey="see72px"/>
54+
<click selector="{{WYSIWYGOnPageBuilderInline.fontSizeMinus}}" stepKey="clickOnFontSizeMinus"/>
55+
<waitForElementVisible stepKey="see13px" selector="{{WYSIWYGOnPageBuilderInline.fontSizeValue('font-size: 13px')}}"/>
56+
<click selector="{{WYSIWYGOnPageBuilderInline.fontSizeMinus}}" stepKey="clickOnFontSizeMinusAgain"/>
57+
<waitForElementVisible stepKey="see12px" selector="//*[@data-mce-style and contains(@style, 'font-size: 12px')]" />
58+
<click selector="{{WYSIWYGOnPageBuilderInline.fontSizePlus}}" stepKey="clickOnFontSizePlus"/>
59+
<waitForElementVisible stepKey="see13pxAfterPlus" selector="//*[@data-mce-style and contains(@style, 'font-size: 13px')]" />
60+
<click selector="{{WYSIWYGOnPageBuilderInline.fontSizePlus}}" stepKey="clickOnFontSizePlusOne"/>
61+
<waitForElementVisible stepKey="see14pxAfterPlus" selector="//*[@data-mce-style and contains(@style, 'font-size: 14px')]" />
62+
<click selector="{{WYSIWYGOnPageBuilderInline.fontSizePlus}}" stepKey="clickOnFontSizePlusTwo"/>
63+
<waitForElementVisible stepKey="see15pxAfterPlus" selector="//*[@data-mce-style and contains(@style, 'font-size: 15px')]" />
64+
<click selector="{{WYSIWYGOnPageBuilderInline.fontSizePlus}}" stepKey="clickOnFontSizePlusThree"/>
65+
<waitForElementVisible stepKey="see16pxAfterPlus" selector="//*[@data-mce-style and contains(@style, 'font-size: 16px')]" />
66+
<click selector="{{WYSIWYGOnPageBuilderInline.fontSizePlus}}" stepKey="clickOnFontSizePlusFour"/>
67+
<waitForElementVisible stepKey="see17pxAfterPlus" selector="//*[@data-mce-style and contains(@style, 'font-size: 17px')]" />
68+
<click selector="{{WYSIWYGOnPageBuilderInline.fontSizePlus}}" stepKey="clickOnFontSizePlusFive"/>
69+
<waitForElementVisible stepKey="see18pxAfterPlus" selector="//*[@data-mce-style and contains(@style, 'font-size: 18px')]" />
7770
<!--Verify LineHeight-->
7871
<comment userInput="Verify LineHeight" stepKey="commentVerifyLineHeight"/>
7972
<click selector="{{WYSIWYGOnPageBuilderInline.lineHeight}}" stepKey="clickOnLineHeight"/>
80-
<see userInput="10px" stepKey="seeLineHeight10px"/>
81-
<see userInput="12px" stepKey="seeLineHeight12px"/>
82-
<see userInput="14px" stepKey="seeLineHeight14px"/>
83-
<see userInput="16px" stepKey="seeLineHeight16px"/>
84-
<see userInput="18px" stepKey="seeLineHeight18px"/>
85-
<see userInput="20px" stepKey="seeLineHeight20px"/>
86-
<see userInput="24px" stepKey="seeLineHeight24px"/>
87-
<see userInput="26px" stepKey="seeLineHeight26px"/>
88-
<see userInput="28px" stepKey="seeLineHeight28px"/>
89-
<see userInput="32px" stepKey="seeLineHeight32px"/>
90-
<see userInput="34px" stepKey="seeLineHeight34px"/>
91-
<see userInput="36px" stepKey="seeLineHeight36px"/>
92-
<see userInput="38px" stepKey="seeLineHeight38px"/>
93-
<see userInput="40px" stepKey="seeLineHeight40px"/>
94-
<see userInput="42px" stepKey="seeLineHeight42px"/>
95-
<see userInput="48px" stepKey="seeLineHeight48px"/>
96-
<see userInput="52px" stepKey="seeLineHeight52px"/>
97-
<see userInput="56px" stepKey="seeLineHeight56px"/>
98-
<see userInput="64px" stepKey="seeLineHeight64px"/>
99-
<see userInput="72px" stepKey="seeLineHeight72px"/>
73+
<waitForText userInput="1.1" stepKey="seeValue1"/>
74+
<waitForText userInput="1.2" stepKey="seeValue2"/>
75+
<waitForText userInput="1.3" stepKey="seeValue3"/>
76+
<waitForText userInput="1.4" stepKey="seeValue4"/>
77+
<waitForText userInput="1.5" stepKey="seeValue5"/>
78+
<waitForText userInput="2" stepKey="seeValue6"/>
10079
<!--Verify FontStyle on preview-->
10180
<comment userInput="Verify FontStyle on preview" stepKey="commentVerifyFontsizeOnPreview"/>
10281
<clickWithLeftButton x="10" y="10" selector="{{TextOnStage.tinymce('1')}}" stepKey="focusOnEditorArea"/>

app/code/Magento/PageBuilder/Test/Unit/Model/Wysiwyg/DefaultConfigProviderTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,6 @@ public function testGetConfig(): void
3737
$config = new DataObject();
3838
$configProvider = new DefaultConfigProvider($this->assetRepo, []);
3939
$result = $configProvider->getConfig($config);
40-
$this->assertStringContainsString('fontfamily fontsize', $result->getTinymce()['toolbar']);
40+
$this->assertStringContainsString('fontfamily fontsizeinput', $result->getTinymce()['toolbar']);
4141
}
4242
}

app/code/Magento/PageBuilder/view/adminhtml/web/js/template-manager.js

Lines changed: 18 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/code/Magento/PageBuilder/view/adminhtml/web/ts/js/template-manager.ts

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
2-
* Copyright © Magento, Inc. All rights reserved.
3-
* See COPYING.txt for license details.
2+
* Copyright 2019 Adobe
3+
* All Rights Reserved.
44
*/
55

66
import html2canvas from "html2canvas";
@@ -138,6 +138,7 @@ function createCapture(stage: Stage) {
138138
renderingLock.then(() => {
139139
// Resolve issues with Parallax
140140
const parallaxRestore = disableParallax(stageElement);
141+
const canvasElement = document.querySelector("#" + stage.id + " .pagebuilder-canvas") as HTMLElement;
141142

142143
stageElement.style.height = $(stageElement).outerHeight(false) + "px";
143144
stageElement.classList.add("capture");
@@ -151,11 +152,12 @@ function createCapture(stage: Stage) {
151152

152153
_.defer(() => {
153154
html2canvas(
154-
document.querySelector("#" + stage.id + " .pagebuilder-canvas"),
155+
canvasElement,
155156
{
156157
scale: 1,
157158
useCORS: true,
158159
scrollY: (window.pageYOffset * -1),
160+
height: correctCanvasHeight(canvasElement),
159161
},
160162
).then((canvas: HTMLCanvasElement) => {
161163
const imageSrc = canvas.toDataURL("image/jpeg", 0.85);
@@ -216,6 +218,16 @@ function restoreParallax(rows: ResetRowInterface[]) {
216218
});
217219
}
218220

221+
/**
222+
* Adjust canvas element size to prevent area overflow.
223+
*
224+
* @param canvasElement
225+
*/
226+
function correctCanvasHeight(canvasElement: HTMLElement) {
227+
// @ts-ignore
228+
return canvasElement.getHeight() < 4096 ? canvasElement.getHeight() : 4096;
229+
}
230+
219231
interface ResetRowInterface {
220232
element: HTMLElement;
221233
styles: string;

dev/tests/integration/testsuite/Magento/PageBuilder/CatalogWidget/Block/Product/ProductListTest.php

Lines changed: 38 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
<?php
22
/**
3-
* Copyright 2024 Adobe
4-
* All rights reserved.
5-
* See COPYING.txt for license details.
3+
* Copyright 2021 Adobe
4+
* All Rights Reserved.
65
*/
76
declare(strict_types=1);
87

@@ -11,7 +10,10 @@
1110
use Magento\Catalog\Api\Data\CategoryInterface;
1211
use Magento\CatalogWidget\Block\Product\ProductsList;
1312
use Magento\Store\Model\Store;
13+
use Magento\TestFramework\Fixture\AppArea;
14+
use Magento\TestFramework\Fixture\Config;
1415
use Magento\TestFramework\Helper\Bootstrap;
16+
use Magento\Widget\Model\Template\Filter;
1517
use PHPUnit\Framework\TestCase;
1618

1719
/**
@@ -292,4 +294,37 @@ public static function categoryFilterAndSortDataProvider(): array
292294
]
293295
];
294296
}
297+
298+
#[
299+
AppArea('frontend'),
300+
Config('dev/template/minify_html', 1, 'store', 'default')
301+
]
302+
public function testWidgetWithMinification()
303+
{
304+
/** @var Filter $filter */
305+
$filter = Bootstrap::getObjectManager()->create(
306+
Filter::class
307+
);
308+
$notExistedSku = uniqid();
309+
$construction = [
310+
0 => '{{widget type="Magento\CatalogWidget\Block\Product\ProductsList" ' .
311+
'template="Magento_PageBuilder::catalog/product/widget/content/carousel.phtml" anchor_text="" ' .
312+
'id_path="" show_pager="0" products_count="20" condition_option="sku" condition_option_value="' .
313+
$notExistedSku . '" ' .
314+
'type_name="Catalog Products Carousel" conditions_encoded="^[`1`:^[`aggregator`:`all`,`new_child`:``,' .
315+
'`type`:`Magento||CatalogWidget||Model||Rule||Condition||Combine`,`value`:`1`^],`1--1`:' .
316+
'^[`operator`:`()`,`type`:`Magento||CatalogWidget||Model||Rule||Condition||Product`,`attribute`:`sku`' .
317+
',`value`:`' . $notExistedSku . '`^]^]" sort_order="position_by_sku" store_id="0"}}',
318+
1 => 'widget',
319+
2 => 'type="Magento\CatalogWidget\Block\Product\ProductsList" ' .
320+
'template="Magento_PageBuilder::catalog/product/widget/content/carousel.phtml" anchor_text="" ' .
321+
'id_path="" show_pager="0" products_count="20" condition_option="sku" condition_option_value="' .
322+
$notExistedSku . '" ' .
323+
'type_name="Catalog Products Carousel" conditions_encoded="^[`1`:^[`aggregator`:`all`,`new_child`:``,' .
324+
'`type`:`Magento||CatalogWidget||Model||Rule||Condition||Combine`,`value`:`1`^],`1--1`:' .
325+
'^[`operator`:`()`,`type`:`Magento||CatalogWidget||Model||Rule||Condition||Product`,`attribute`:' .
326+
'`sku`,`value`:`' . $notExistedSku . '`^]^]" sort_order="position_by_sku" store_id="0"'
327+
];
328+
$this->assertEquals('', $filter->generateWidget($construction));
329+
}
295330
}

0 commit comments

Comments
 (0)