Skip to content

Commit d79bf5e

Browse files
authored
Merge branch '2.4-develop' into korostii-patch-25243
2 parents 71ca4bb + 5ad40fa commit d79bf5e

File tree

3,907 files changed

+111905
-30286
lines changed

Some content is hidden

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

3,907 files changed

+111905
-30286
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
[![Open Source Helpers](https://www.codetriage.com/magento/magento2/badges/users.svg)](https://www.codetriage.com/magento/magento2)
22
[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/magento/magento2?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
33
[![Crowdin](https://d322cqt584bo4o.cloudfront.net/magento-2/localized.svg)](https://crowdin.com/project/magento-2)
4-
<h2>Welcome</h2>
4+
5+
## Welcome
56
Welcome to Magento 2 installation! We're glad you chose to install Magento 2, a cutting-edge, feature-rich eCommerce solution that gets results.
67

78
## Magento System Requirements
@@ -30,7 +31,7 @@ To suggest documentation improvements, click [here][4].
3031
[4]: https://devdocs.magento.com
3132

3233
<h3>Community Maintainers</h3>
33-
The members of this team have been recognized for their outstanding commitment to maintaining and improving Magento. Magento has granted them permission to accept, merge, and reject pull requests, as well as review issues, and thanks these Community Maintainers for their valuable contributions.
34+
The members of this team have been recognized for their outstanding commitment to maintaining and improving Magento. Magento has granted them permission to accept, merge, and reject pull requests, as well as review issues, and thanks to these Community Maintainers for their valuable contributions.
3435

3536
<a href="https://magento.com/magento-contributors#maintainers">
3637
<img src="https://raw.githubusercontent.com/wiki/magento/magento2/images/maintainers.png"/>

app/code/Magento/AdminAnalytics/registration.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
* See COPYING.txt for license details.
55
*/
66

7-
use \Magento\Framework\Component\ComponentRegistrar;
7+
use Magento\Framework\Component\ComponentRegistrar;
88

99
ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_AdminAnalytics', __DIR__);

app/code/Magento/AdminAnalytics/view/adminhtml/ui_component/admin_usage_notification.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
<item name="text" xsi:type="string" translate="true"><![CDATA[
8686
<p>Help us improve Magento Admin by allowing us to collect usage data.</p>
8787
<p>All usage data that we collect for this purpose cannot be used to individually identify you and is used only to improve the Magento Admin and related products and services.</p>
88-
<p>You can learn more and opt out at any time by following the instructions in <a href="https://docs.magento.com/m2/ce/user_guide/stores/admin.html" target="_blank">merchant documentation</a>.</p>
88+
<p>You can learn more and opt out at any time by following the instructions in <a href="https://docs.magento.com/m2/ce/user_guide/stores/admin.html" target="_blank" tabindex="0">merchant documentation</a>.</p>
8989
]]></item>
9090
</item>
9191
</argument>

app/code/Magento/AdminAnalytics/view/adminhtml/web/js/modal/component.js

Lines changed: 84 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,7 @@ define([
2020
enableLogAction: '${ $.provider }:data.enableLogAction',
2121
disableLogAction: '${ $.provider }:data.disableLogAction'
2222
},
23-
options: {
24-
keyEventHandlers: {
25-
/**
26-
* Prevents escape key from exiting out of modal
27-
*/
28-
escapeKey: function () {
29-
return;
30-
}
31-
}
32-
},
23+
options: {},
3324
notificationWindow: null
3425
},
3526

@@ -41,11 +32,32 @@ define([
4132
this._super();
4233
},
4334

35+
/**
36+
* Configure ESC and TAB so user can't leave modal
37+
* without selecting an option
38+
*
39+
* @returns {Object} Chainable.
40+
*/
41+
initModalEvents: function () {
42+
this._super();
43+
//Don't allow ESC key to close modal
44+
this.options.keyEventHandlers.escapeKey = this.handleEscKey.bind(this);
45+
//Restrict tab action to the modal
46+
this.options.keyEventHandlers.tabKey = this.handleTabKey.bind(this);
47+
48+
return this;
49+
},
50+
4451
/**
4552
* Once the modal is opened it hides the X
4653
*/
4754
onOpened: function () {
48-
$('.modal-header button.action-close').hide();
55+
$('.modal-header button.action-close').attr('disabled', true).hide();
56+
57+
this.focusableElements = $(this.rootSelector).find('a[href], button:enabled');
58+
this.firstFocusableElement = this.focusableElements[0];
59+
this.lastFocusableElement = this.focusableElements[this.focusableElements.length - 1];
60+
this.firstFocusableElement.focus();
4961
},
5062

5163
/**
@@ -104,11 +116,70 @@ define([
104116
* Allows admin usage popup to be shown first and then new release notification
105117
*/
106118
openReleasePopup: function () {
107-
var notifiModal = registry.get('release_notification.release_notification.notification_modal_1');
119+
var notificationModalSelector = 'release_notification.release_notification.notification_modal_1';
108120

109121
if (analyticsPopupConfig.releaseVisible) {
110-
notifiModal.initializeContentAfterAnalytics();
122+
registry.get(notificationModalSelector).initializeContentAfterAnalytics();
111123
}
124+
},
125+
126+
/**
127+
* Handle Tab and Shift+Tab key event
128+
*
129+
* Keep the tab actions restricted to the popup modal
130+
* so the user must select an option to dismiss the modal
131+
*/
132+
handleTabKey: function (event) {
133+
var modal = this,
134+
KEY_TAB = 9;
135+
136+
/**
137+
* Handle Shift+Tab to tab backwards
138+
*/
139+
function handleBackwardTab() {
140+
if (document.activeElement === modal.firstFocusableElement ||
141+
document.activeElement === $(modal.rootSelector)[0]
142+
) {
143+
event.preventDefault();
144+
modal.lastFocusableElement.focus();
145+
}
146+
}
147+
148+
/**
149+
* Handle Tab forward
150+
*/
151+
function handleForwardTab() {
152+
if (document.activeElement === modal.lastFocusableElement) {
153+
event.preventDefault();
154+
modal.firstFocusableElement.focus();
155+
}
156+
}
157+
158+
switch (event.keyCode) {
159+
case KEY_TAB:
160+
if (modal.focusableElements.length === 1) {
161+
event.preventDefault();
162+
break;
163+
}
164+
165+
if (event.shiftKey) {
166+
handleBackwardTab();
167+
break;
168+
}
169+
handleForwardTab();
170+
break;
171+
default:
172+
break;
173+
}
174+
},
175+
176+
/**
177+
* Handle Esc key
178+
*
179+
* Esc key should not close modal
180+
*/
181+
handleEscKey: function (event) {
182+
event.preventDefault();
112183
}
113184
}
114185
);

app/code/Magento/AdminNotification/Block/Grid/Renderer/Actions.php

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
<?php
2+
declare(strict_types=1);
3+
24
/**
35
* Adminhtml AdminNotification Severity Renderer
46
*
@@ -8,12 +10,16 @@
810

911
namespace Magento\AdminNotification\Block\Grid\Renderer;
1012

13+
use Magento\Backend\Block\Context;
14+
use Magento\Backend\Block\Widget\Grid\Column\Renderer\AbstractRenderer;
15+
use Magento\Framework\App\ActionInterface;
16+
use Magento\Framework\DataObject;
17+
use Magento\Framework\Url\Helper\Data;
18+
1119
/**
1220
* Renderer class for action in the admin notifications grid
13-
*
14-
* @package Magento\AdminNotification\Block\Grid\Renderer
1521
*/
16-
class Actions extends \Magento\Backend\Block\Widget\Grid\Column\Renderer\AbstractRenderer
22+
class Actions extends AbstractRenderer
1723
{
1824
/**
1925
* @var \Magento\Framework\Url\Helper\Data
@@ -25,11 +31,8 @@ class Actions extends \Magento\Backend\Block\Widget\Grid\Column\Renderer\Abstrac
2531
* @param \Magento\Framework\Url\Helper\Data $urlHelper
2632
* @param array $data
2733
*/
28-
public function __construct(
29-
\Magento\Backend\Block\Context $context,
30-
\Magento\Framework\Url\Helper\Data $urlHelper,
31-
array $data = []
32-
) {
34+
public function __construct(Context $context, Data $urlHelper, array $data = [])
35+
{
3336
$this->_urlHelper = $urlHelper;
3437
parent::__construct($context, $data);
3538
}
@@ -40,7 +43,7 @@ public function __construct(
4043
* @param \Magento\Framework\DataObject $row
4144
* @return string
4245
*/
43-
public function render(\Magento\Framework\DataObject $row)
46+
public function render(DataObject $row)
4447
{
4548
$readDetailsHtml = $row->getUrl() ? '<a class="action-details" target="_blank" href="' .
4649
$this->escapeUrl($row->getUrl())
@@ -49,7 +52,7 @@ public function render(\Magento\Framework\DataObject $row)
4952

5053
$markAsReadHtml = !$row->getIsRead() ? '<a class="action-mark" href="' . $this->getUrl(
5154
'*/*/markAsRead/',
52-
['_current' => true, 'id' => $row->getId()]
55+
['_current' => true, 'id' => $row->getNotificationId()]
5356
) . '">' . __(
5457
'Mark as Read'
5558
) . '</a>' : '';
@@ -63,8 +66,8 @@ public function render(\Magento\Framework\DataObject $row)
6366
'*/*/remove/',
6467
[
6568
'_current' => true,
66-
'id' => $row->getId(),
67-
\Magento\Framework\App\ActionInterface::PARAM_NAME_URL_ENCODED => $encodedUrl
69+
'id' => $row->getNotificationId(),
70+
ActionInterface::PARAM_NAME_URL_ENCODED => $encodedUrl
6871
]
6972
),
7073
__('Are you sure?'),

app/code/Magento/AdminNotification/Block/Grid/Renderer/Notice.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
<?php
2+
declare(strict_types=1);
3+
24
/**
35
* Adminhtml AdminNotification Severity Renderer
46
*
@@ -7,15 +9,21 @@
79
*/
810
namespace Magento\AdminNotification\Block\Grid\Renderer;
911

10-
class Notice extends \Magento\Backend\Block\Widget\Grid\Column\Renderer\AbstractRenderer
12+
use Magento\Backend\Block\Widget\Grid\Column\Renderer\AbstractRenderer;
13+
use Magento\Framework\DataObject;
14+
15+
/**
16+
* Renderer class for notice in the admin notifications grid
17+
*/
18+
class Notice extends AbstractRenderer
1119
{
1220
/**
1321
* Renders grid column
1422
*
1523
* @param \Magento\Framework\DataObject $row
1624
* @return string
1725
*/
18-
public function render(\Magento\Framework\DataObject $row)
26+
public function render(DataObject $row)
1927
{
2028
return '<span class="grid-row-title">' .
2129
$this->escapeHtml($row->getTitle()) .

app/code/Magento/AdminNotification/Block/Grid/Renderer/Severity.php

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
<?php
2+
declare(strict_types=1);
3+
24
/**
35
* Adminhtml AdminNotification Severity Renderer
46
*
@@ -7,9 +9,16 @@
79
*/
810
namespace Magento\AdminNotification\Block\Grid\Renderer;
911

12+
use Magento\AdminNotification\Model\Inbox;
13+
use Magento\Backend\Block\Context;
14+
use Magento\Backend\Block\Widget\Grid\Column\Renderer\AbstractRenderer;
15+
use Magento\Framework\DataObject;
1016
use Magento\Framework\Notification\MessageInterface;
1117

12-
class Severity extends \Magento\Backend\Block\Widget\Grid\Column\Renderer\AbstractRenderer
18+
/**
19+
* Renderer class for severity in the admin notifications grid
20+
*/
21+
class Severity extends AbstractRenderer
1322
{
1423
/**
1524
* @var \Magento\AdminNotification\Model\Inbox
@@ -21,11 +30,8 @@ class Severity extends \Magento\Backend\Block\Widget\Grid\Column\Renderer\Abstra
2130
* @param \Magento\AdminNotification\Model\Inbox $notice
2231
* @param array $data
2332
*/
24-
public function __construct(
25-
\Magento\Backend\Block\Context $context,
26-
\Magento\AdminNotification\Model\Inbox $notice,
27-
array $data = []
28-
) {
33+
public function __construct(Context $context, Inbox $notice, array $data = [])
34+
{
2935
parent::__construct($context, $data);
3036
$this->_notice = $notice;
3137
}
@@ -36,12 +42,14 @@ public function __construct(
3642
* @param \Magento\Framework\DataObject $row
3743
* @return string
3844
*/
39-
public function render(\Magento\Framework\DataObject $row)
45+
public function render(DataObject $row)
4046
{
4147
$class = '';
4248
$value = '';
4349

44-
switch ($row->getData($this->getColumn()->getIndex())) {
50+
$column = $this->getColumn();
51+
$index = $column->getIndex();
52+
switch ($row->getData($index)) {
4553
case MessageInterface::SEVERITY_CRITICAL:
4654
$class = 'critical';
4755
$value = $this->_notice->getSeverities(MessageInterface::SEVERITY_CRITICAL);
@@ -59,6 +67,7 @@ public function render(\Magento\Framework\DataObject $row)
5967
$value = $this->_notice->getSeverities(MessageInterface::SEVERITY_NOTICE);
6068
break;
6169
}
70+
6271
return '<span class="grid-severity-' . $class . '"><span>' . $value . '</span></span>';
6372
}
6473
}
Lines changed: 23 additions & 0 deletions
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+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminSystemMessagesWarningActionGroup">
12+
<annotations>
13+
<description>Check warning system message exists.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="message" type="string"/>
17+
</arguments>
18+
19+
<waitForElementVisible selector="{{AdminSystemMessagesSection.systemMessagesDropdown}}" stepKey="waitMessagesDropdownAppears"/>
20+
<conditionalClick selector="{{AdminSystemMessagesSection.systemMessagesDropdown}}" dependentSelector="{{AdminSystemMessagesSection.messagesBlock}}" visible="false" stepKey="openMessagesBlockIfCollapsed"/>
21+
<see userInput="{{message}}" selector="{{AdminSystemMessagesSection.warning}}" stepKey="seeWarningMessage"/>
22+
</actionGroup>
23+
</actionGroups>

app/code/Magento/AdminNotification/Test/Mftf/Section/AdminSystemMessagesSection.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,9 @@
1111
<section name="AdminSystemMessagesSection">
1212
<element name="systemMessagesDropdown" type="button" selector="#system_messages .message-system-action-dropdown"/>
1313
<element name="actionMessageLog" type="button" selector="//*[contains(@class, 'message-system-summary')]/a[contains(text(), '{{textMessage}}')]" parameterized="true"/>
14+
<element name="messagesBlock" type="block" selector="#system_messages div.message-system-collapsible"/>
15+
<element name="success" type="text" selector="#system_messages div.message-success"/>
16+
<element name="warning" type="text" selector="#system_messages div.message-warning"/>
17+
<element name="notice" type="text" selector="#system_messages div.message-notice"/>
1418
</section>
1519
</sections>

0 commit comments

Comments
 (0)