Skip to content

Commit e89e715

Browse files
committed
MC-3902: Add line height option to TinyMCE
- add Line Height option to TinyMCE toolbar
1 parent 9d40f18 commit e89e715

File tree

4 files changed

+29
-2
lines changed

4 files changed

+29
-2
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public function getConfig(\Magento\Framework\DataObject $config): \Magento\Frame
3838
{
3939
$config->addData([
4040
'tinymce4' => [
41-
'toolbar' => 'undo redo | styleselect | fontsizeselect | forecolor backcolor | bold italic underline' .
41+
'toolbar' => 'undo redo | styleselect | fontsizeselect | lineheightselect | forecolor backcolor | bold italic underline' .
4242
' | alignleft aligncenter alignright | numlist bullist | link image table charmap',
4343

4444
'plugins' => implode(
@@ -59,7 +59,8 @@ public function getConfig(\Magento\Framework\DataObject $config): \Magento\Frame
5959
'table',
6060
'textcolor',
6161
'image',
62-
'colorpicker'
62+
'colorpicker',
63+
'lineheight'
6364
]
6465
),
6566
'content_css' => [

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@
112112
<element name="undo" type="button" selector="div[aria-label='Undo']"/>
113113
<element name="redo" type="button" selector="div[aria-label='Redo']"/>
114114
<element name="fontSize" type="button" selector="div[aria-label='Font Sizes']"/>
115+
<element name="lineHeight" type="button" selector="div[aria-label='Line Height']"/>
115116
<element name="textColor" type="button" selector="div[aria-label='Text color']"/>
116117
<element name="backgroundColor" type="button" selector="div[aria-label='Background color']"/>
117118
<element name="formatSelector" type="button" selector="//span[text()='Formats']"/>

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

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -810,6 +810,7 @@
810810
<seeElement selector="{{WYSIWYGOnPageBuilder.undo}}" stepKey="seeUndo"/>
811811
<seeElement selector="{{WYSIWYGOnPageBuilder.redo}}" stepKey="seeRedo"/>
812812
<seeElement selector="{{WYSIWYGOnPageBuilder.fontSize}}" stepKey="seeFontsize"/>
813+
<seeElement selector="{{WYSIWYGOnPageBuilder.lineHeight}}" stepKey="seeLineHeight"/>
813814
<seeElement selector="{{WYSIWYGOnPageBuilder.textColor}}" stepKey="seeTextColor"/>
814815
<seeElement selector="{{WYSIWYGOnPageBuilder.backgroundColor}}" stepKey="seeBackgroundColor"/>
815816
<!--Verify FontSize-->
@@ -835,6 +836,29 @@
835836
<see userInput="56px" stepKey="see56px" />
836837
<see userInput="64px" stepKey="see64px" />
837838
<see userInput="72px" stepKey="see72px" />
839+
<!--Verify LineHeight-->
840+
<comment userInput="Verify LineHeight" stepKey="commentVerifyLineHeight"/>
841+
<click selector="{{WYSIWYGOnPageBuilder.lineHeight}}" stepKey="clickOnLineHeight"/>
842+
<see userInput="10px" stepKey="seeLineHeight10px" />
843+
<see userInput="12px" stepKey="seeLineHeight12px" />
844+
<see userInput="14px" stepKey="seeLineHeight14px" />
845+
<see userInput="16px" stepKey="seeLineHeight16px" />
846+
<see userInput="18px" stepKey="seeLineHeight18px" />
847+
<see userInput="20px" stepKey="seeLineHeight20px" />
848+
<see userInput="24px" stepKey="seeLineHeight24px" />
849+
<see userInput="26px" stepKey="seeLineHeight26px" />
850+
<see userInput="28px" stepKey="seeLineHeight28px" />
851+
<see userInput="32px" stepKey="seeLineHeight32px" />
852+
<see userInput="34px" stepKey="seeLineHeight34px" />
853+
<see userInput="36px" stepKey="seeLineHeight36px" />
854+
<see userInput="38px" stepKey="seeLineHeight38px" />
855+
<see userInput="40px" stepKey="seeLineHeight40px" />
856+
<see userInput="42px" stepKey="seeLineHeight42px" />
857+
<see userInput="48px" stepKey="seeLineHeight48px" />
858+
<see userInput="52px" stepKey="seeLineHeight52px" />
859+
<see userInput="56px" stepKey="seeLineHeight56px" />
860+
<see userInput="64px" stepKey="seeLineHeight64px" />
861+
<see userInput="72px" stepKey="seeLineHeight72px" />
838862
<!--Verify FontStyle on preview-->
839863
<comment userInput="Verify FontStyle on preview" stepKey="commentVerifyFontsizeOnPreview"/>
840864
<click selector="{{TextOnStage.tinymce('1')}}" stepKey="focusOnEditorArea"/>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
<argument name="additionalSettings" xsi:type="array">
5555
<item name="fixed_toolbar_container" xsi:type="string">.pagebuilder-content-type</item>
5656
<item name="fontsize_formats" xsi:type="string">10px 12px 14px 16px 18px 20px 24px 26px 28px 32px 34px 36px 38px 40px 42px 48px 52px 56px 64px 72px</item>
57+
<item name="lineheight_formats" xsi:type="string">10px 12px 14px 16px 18px 20px 24px 26px 28px 32px 34px 36px 38px 40px 42px 48px 52px 56px 64px 72px</item>
5758
<item name="style_formats" xsi:type="array">
5859
<item name="paragraph" xsi:type="array">
5960
<item name="title" xsi:type="string">Paragraph</item>

0 commit comments

Comments
 (0)