Skip to content

Commit

Permalink
Merge pull request #1711 from magento-gl/2.4-develop
Browse files Browse the repository at this point in the history
Merge 2.4-develop into AC-12085
  • Loading branch information
djadobe16 authored Sep 2, 2024
2 parents 7728309 + edcd0dc commit b4d9987
Show file tree
Hide file tree
Showing 161 changed files with 7,602 additions and 434 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function getConfig(\Magento\Framework\DataObject $config) : \Magento\Fram
{
$config->addData([
'tinymce' => [
'toolbar' => 'formatselect | bold italic underline | alignleft aligncenter alignright | '
'toolbar' => ' blocks | formatselect | bold italic underline | alignleft aligncenter alignright | '
. 'bullist numlist | link table charmap',
'plugins' => implode(
' ',
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Cms/Test/Mftf/Data/WysiwygConfigData.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@
<data key="path">cms/wysiwyg/editor</data>
<data key="scope_id">0</data>
<data key="label">Yes</data>
<data key="value">mage/adminhtml/wysiwyg/tiny_mce/tinymce5Adapter</data>
<data key="value">mage/adminhtml/wysiwyg/tiny_mce/tinymceAdapter</data>
</entity>
</entities>
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<element name="UploadImageNew" type="file" selector="#upload_image"/>
<element name="UploadImageSelector" type="file" selector="#fileUploader"/>
<element name="UploadImageWithUploaderId" type="file" selector="#fileUploader + .uppy-Root .uppy-Dashboard-input"/>
<element name="OkBtn" type="button" selector=".tox-dialog__footer button[title='Save']"/>
<element name="OkBtn" type="button" selector=".tox-dialog__footer button[aria-label='Save']"/>
<element name="insertBtn" type="button" selector="#insert"/>
<element name="InsertFile" type="text" selector="#insert_files" timeout="30"/>
<element name="CreateFolder" type="button" selector="#new_folder" timeout="30"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,19 @@
<element name="InsertVariableBtn" type="button" selector=".scalable.add-variable.plugin"/>
<element name="InsertVariableIcon" type="button" selector="button[aria-label='Insert Variable']"/>
<element name="InsertImageBtn" type="button" selector=".scalable.action-add-image.plugin"/>
<element name="InsertImageIcon" type="button" selector="button[title='Insert/edit image']" timeout="30"/>
<element name="Style" type="button" selector="button[title='Blocks']"/>
<element name="Bold" type="button" selector="button[title='Bold']"/>
<element name="Italic" type="button" selector="button[title='Italic']"/>
<element name="Underline" type="button" selector="button[title='Underline']"/>
<element name="AlignLeft" type="button" selector="button[title='Align left']"/>
<element name="AlignCenter" type="button" selector="button[title='Align center']"/>
<element name="AlignRight" type="button" selector="button[title='Align right']"/>
<element name="Bullet" type="button" selector="div[title='Bullet list']"/>
<element name="Numlist" type="button" selector="div[title='Numbered list']"/>
<element name="InsertLink" type="button" selector="button[title='Insert/edit link']"/>
<element name="InsertTable" type="button" selector="button[title='Table']"/>
<element name="SpecialCharacter" type="button" selector="button[title='Special character']"/>
<element name="InsertImageIcon" type="button" selector="button[aria-label='Insert/edit image']" timeout="30"/>
<element name="Style" type="button" selector="button[aria-label='Block Paragraph']"/>
<element name="Bold" type="button" selector="button[aria-label='Bold']"/>
<element name="Italic" type="button" selector="button[aria-label='Italic']"/>
<element name="Underline" type="button" selector="button[aria-label='Underline']"/>
<element name="AlignLeft" type="button" selector="button[aria-label='Align left']"/>
<element name="AlignCenter" type="button" selector="button[aria-label='Align center']"/>
<element name="AlignRight" type="button" selector="button[aria-label='Align right']"/>
<element name="Bullet" type="button" selector="div[aria-label='Bullet list']"/>
<element name="Numlist" type="button" selector="div[aria-label='Numbered list']"/>
<element name="InsertLink" type="button" selector="button[aria-label='Insert/edit link']"/>
<element name="InsertTable" type="button" selector="button[aria-label='Table']"/>
<element name="SpecialCharacter" type="button" selector="button[aria-label='Special character']"/>
<element name="WidgetButton" type="button" selector="span[class*='magento-widget mceNonEditable']"/>
<element name="EditorContent" type="input" selector="#tinymce"/>
<element name="Content" type="textarea" selector="textarea"/>
Expand Down
4 changes: 2 additions & 2 deletions app/code/Magento/Cms/etc/adminhtml/di.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
<arguments>
<argument name="adapterOptions" xsi:type="array">
<item name="tinymce" xsi:type="array">
<item name="value" xsi:type="string">mage/adminhtml/wysiwyg/tiny_mce/tinymce5Adapter</item>
<item name="label" xsi:type="string" translatable="true">TinyMCE 5</item>
<item name="value" xsi:type="string">mage/adminhtml/wysiwyg/tiny_mce/tinymceAdapter</item>
<item name="label" xsi:type="string" translatable="true">TinyMCE 7</item>
</item>
</argument>
</arguments>
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Cms/etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<cms>
<wysiwyg>
<enabled>enabled</enabled>
<editor>mage/adminhtml/wysiwyg/tiny_mce/tinymce5Adapter</editor>
<editor>mage/adminhtml/wysiwyg/tiny_mce/tinymceAdapter</editor>
<force_valid>0</force_valid>
</wysiwyg>
</cms>
Expand Down
3 changes: 2 additions & 1 deletion app/code/Magento/Developer/Model/Logger/Handler/Debug.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
use Magento\Framework\Exception\RuntimeException;
use Magento\Framework\Filesystem\DriverInterface;
use Magento\Framework\Logger\Handler\Debug as DebugHandler;
use Monolog\LogRecord;

/**
* Enable/disable debug logging based on the store config setting
Expand Down Expand Up @@ -53,7 +54,7 @@ public function __construct(
/**
* @inheritdoc
*/
public function isHandling(array $record): bool
public function isHandling(LogRecord $record): bool
{
if ($this->deploymentConfig->isAvailable()) {
return parent::isHandling($record) && $this->isLoggingEnabled();
Expand Down
5 changes: 2 additions & 3 deletions app/code/Magento/Developer/Model/Logger/Handler/Syslog.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use Magento\Config\Setup\ConfigOptionsList;
use Magento\Framework\App\Config\ScopeConfigInterface;
use Magento\Framework\App\DeploymentConfig;
use Monolog\LogRecord;

/**
* Enable/disable syslog logging based on the deployment config setting.
Expand All @@ -22,8 +23,6 @@ class Syslog extends \Magento\Framework\Logger\Handler\Syslog
public const CONFIG_PATH = 'dev/syslog/syslog_logging';

/**
* Deployment config.
*
* @var DeploymentConfig
*/
private $deploymentConfig;
Expand All @@ -43,7 +42,7 @@ public function __construct(
/**
* @inheritdoc
*/
public function isHandling(array $record): bool
public function isHandling(LogRecord $record): bool
{
return parent::isHandling($record)
&& $this->deploymentConfig->isDbAvailable()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,17 @@
*/
namespace Magento\Developer\Test\Unit\Model\Logger\Handler;

use Magento\Config\Setup\ConfigOptionsList;
use Magento\Developer\Model\Logger\Handler\Debug;
use Magento\Framework\App\Config\ScopeConfigInterface;
use Magento\Framework\App\DeploymentConfig;
use Magento\Framework\App\State;
use Magento\Framework\Filesystem\DriverInterface;
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager;
use Monolog\Formatter\FormatterInterface;
use Monolog\Level;
use Monolog\Logger;
use Monolog\LogRecord;
use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase;

Expand Down Expand Up @@ -51,6 +54,11 @@ class DebugTest extends TestCase
*/
private $deploymentConfigMock;

/**
* @var LogRecord
*/
private $logRecord;

/**
* @inheritdoc
*/
Expand Down Expand Up @@ -81,6 +89,13 @@ protected function setUp(): void
'deploymentConfig' => $this->deploymentConfigMock
]);
$this->model->setFormatter($this->formatterMock);

$this->logRecord = new LogRecord(
new \DateTimeImmutable(),
'testChannel',
Level::Debug,
'testMessage'
);
}

/**
Expand All @@ -99,7 +114,7 @@ public function testHandleEnabledInDeveloperMode()
->expects($this->never())
->method('getValue');

$this->assertTrue($this->model->isHandling(['formatted' => false, 'level' => Logger::DEBUG]));
$this->assertTrue($this->model->isHandling($this->logRecord));
}

/**
Expand All @@ -118,7 +133,7 @@ public function testHandleEnabledInDefaultMode()
->expects($this->never())
->method('getValue');

$this->assertTrue($this->model->isHandling(['formatted' => false, 'level' => Logger::DEBUG]));
$this->assertTrue($this->model->isHandling($this->logRecord));
}

/**
Expand All @@ -137,7 +152,7 @@ public function testHandleDisabledByProduction()
->expects($this->never())
->method('getValue');

$this->assertFalse($this->model->isHandling(['formatted' => false, 'level' => Logger::DEBUG]));
$this->assertFalse($this->model->isHandling($this->logRecord));
}

/**
Expand All @@ -148,15 +163,19 @@ public function testHandleDisabledByLevel()
$this->deploymentConfigMock->expects($this->once())
->method('isAvailable')
->willReturn(true);
$this->stateMock
->expects($this->never())
->method('getMode')
->willReturn(State::MODE_DEVELOPER);
$this->scopeConfigMock
->expects($this->never())
->method('getValue');
$this->deploymentConfigMock->expects($this->once())
->method('get')
->with(ConfigOptionsList::CONFIG_PATH_DEBUG_LOGGING)
->willReturn(false);

$this->assertFalse($this->model->isHandling(['formatted' => false, 'level' => Logger::API]));
$this->assertFalse($this->model->isHandling(
new LogRecord(
new \DateTimeImmutable(),
'testChannel',
Level::Error,
'testMessage'
)
));
}

/**
Expand All @@ -174,6 +193,6 @@ public function testDeploymentConfigIsNotAvailable()
->expects($this->never())
->method('getValue');

$this->assertTrue($this->model->isHandling(['formatted' => false, 'level' => Logger::DEBUG]));
$this->assertTrue($this->model->isHandling($this->logRecord));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
use Magento\Framework\App\Config\ScopeConfigInterface;
use Magento\Framework\App\DeploymentConfig;
use Magento\Framework\Logger\Monolog;
use Monolog\Handler\AbstractHandler;
use Monolog\Level;
use Monolog\LogRecord;
use PHPUnit\Framework\MockObject\MockObject as Mock;
use PHPUnit\Framework\TestCase;

Expand All @@ -35,13 +38,24 @@ class SyslogTest extends TestCase
*/
private $deploymentConfigMock;

/**
* @var LogRecord
*/
private $logRecord;

/**
* @inheritdoc
*/
protected function setUp(): void
{
$this->scopeConfigMock = $this->getMockForAbstractClass(ScopeConfigInterface::class);
$this->deploymentConfigMock = $this->createMock(DeploymentConfig::class);
$this->logRecord = new LogRecord(
new \DateTimeImmutable(),
'testChannel',
Level::Debug,
'testMessage'
);

$this->model = new Syslog(
$this->deploymentConfigMock,
Expand All @@ -54,10 +68,6 @@ protected function setUp(): void
*/
public function testIsHandling(): void
{
$record = [
'level' => Monolog::DEBUG,
];

$this->scopeConfigMock
->expects($this->never())
->method('getValue');
Expand All @@ -72,7 +82,7 @@ public function testIsHandling(): void
->willReturn(1);

$this->assertTrue(
$this->model->isHandling($record)
$this->model->isHandling($this->logRecord)
);
}

Expand All @@ -81,10 +91,6 @@ public function testIsHandling(): void
*/
public function testIsHandlingNotInstalled(): void
{
$record = [
'level' => Monolog::DEBUG,
];

$this->scopeConfigMock
->expects($this->never())
->method('getValue');
Expand All @@ -94,7 +100,7 @@ public function testIsHandlingNotInstalled(): void
->willReturn(false);

$this->assertFalse(
$this->model->isHandling($record)
$this->model->isHandling($this->logRecord)
);
}

Expand All @@ -103,10 +109,6 @@ public function testIsHandlingNotInstalled(): void
*/
public function testIsHandlingDisabled(): void
{
$record = [
'level' => Monolog::DEBUG,
];

$this->scopeConfigMock
->expects($this->never())
->method('getValue');
Expand All @@ -121,7 +123,7 @@ public function testIsHandlingDisabled(): void
->willReturn(0);

$this->assertFalse(
$this->model->isHandling($record)
$this->model->isHandling($this->logRecord)
);
}
}
2 changes: 1 addition & 1 deletion app/code/Magento/Ui/Block/Wysiwyg/ActiveEditor.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*/
class ActiveEditor extends \Magento\Framework\View\Element\Template
{
const DEFAULT_EDITOR_PATH = 'mage/adminhtml/wysiwyg/tiny_mce/tinymce5Adapter';
public const DEFAULT_EDITOR_PATH = 'mage/adminhtml/wysiwyg/tiny_mce/tinymceAdapter';

/**
* @var ScopeConfigInterface
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Ui/etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
</dev>
<cms>
<wysiwyg>
<editor_version>mage/adminhtml/wysiwyg/tiny_mce/tinymce5Adapter</editor_version>
<editor_version>mage/adminhtml/wysiwyg/tiny_mce/tinymceAdapter</editor_version>
</wysiwyg>
</cms>
</default>
Expand Down
6 changes: 3 additions & 3 deletions app/code/Magento/Ui/view/base/requirejs-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ var config = {
shim: {
'chartjs/chartjs-adapter-moment': ['moment'],
'chartjs/es6-shim.min': {},
'tiny_mce_5/tinymce.min': {
'tiny_mce_7/tinymce.min': {
exports: 'tinyMCE'
}
},
Expand All @@ -28,8 +28,8 @@ var config = {
buttonAdapter: 'Magento_Ui/js/form/button-adapter',
chartJs: 'chartjs/Chart.min',
'chart.js': 'chartjs/Chart.min',
tinymce: 'tiny_mce_5/tinymce.min',
wysiwygAdapter: 'mage/adminhtml/wysiwyg/tiny_mce/tinymce5Adapter'
tinymce: 'tiny_mce_7/tinymce.min',
wysiwygAdapter: 'mage/adminhtml/wysiwyg/tiny_mce/tinymceAdapter'
}
}
};
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
"magento/zend-cache": "^1.16",
"magento/zend-db": "^1.16",
"magento/zend-pdf": "^1.16",
"monolog/monolog": "^2.7",
"monolog/monolog": "^3.6",
"opensearch-project/opensearch-php": "^1.0 || ^2.0",
"pelago/emogrifier": "^7.0",
"php-amqplib/php-amqplib": "^3.2",
Expand All @@ -90,7 +90,7 @@
"tubalmartin/cssmin": "^4.1",
"web-token/jwt-framework": "^3.1",
"webonyx/graphql-php": "^15.0",
"wikimedia/less.php": "^3.2"
"wikimedia/less.php": "^4.4"
},
"require-dev": {
"allure-framework/allure-phpunit": "^3",
Expand Down
Loading

0 comments on commit b4d9987

Please sign in to comment.