Skip to content

Commit

Permalink
Merge branch '2.4-develop' of https://github.com/magento/magento2 int…
Browse files Browse the repository at this point in the history
…o 2.3-develop
  • Loading branch information
Nazar65 committed Jan 6, 2020
2 parents 2860283 + 3e23510 commit 94e8685
Show file tree
Hide file tree
Showing 3,735 changed files with 103,238 additions and 28,990 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
[![Open Source Helpers](https://www.codetriage.com/magento/magento2/badges/users.svg)](https://www.codetriage.com/magento/magento2)
[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/magento/magento2?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
[![Crowdin](https://d322cqt584bo4o.cloudfront.net/magento-2/localized.svg)](https://crowdin.com/project/magento-2)
<h2>Welcome</h2>

## Welcome
Welcome to Magento 2 installation! We're glad you chose to install Magento 2, a cutting-edge, feature-rich eCommerce solution that gets results.

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

<h3>Community Maintainers</h3>
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.
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.

<a href="https://magento.com/magento-contributors#maintainers">
<img src="https://raw.githubusercontent.com/wiki/magento/magento2/images/maintainers.png"/>
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/AdminAnalytics/registration.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
* See COPYING.txt for license details.
*/

use \Magento\Framework\Component\ComponentRegistrar;
use Magento\Framework\Component\ComponentRegistrar;

ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_AdminAnalytics', __DIR__);
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
<item name="text" xsi:type="string" translate="true"><![CDATA[
<p>Help us improve Magento Admin by allowing us to collect usage data.</p>
<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>
<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>
<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>
]]></item>
</item>
</argument>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,7 @@ define([
enableLogAction: '${ $.provider }:data.enableLogAction',
disableLogAction: '${ $.provider }:data.disableLogAction'
},
options: {
keyEventHandlers: {
/**
* Prevents escape key from exiting out of modal
*/
escapeKey: function () {
return;
}
}
},
options: {},
notificationWindow: null
},

Expand All @@ -41,11 +32,32 @@ define([
this._super();
},

/**
* Configure ESC and TAB so user can't leave modal
* without selecting an option
*
* @returns {Object} Chainable.
*/
initModalEvents: function () {
this._super();
//Don't allow ESC key to close modal
this.options.keyEventHandlers.escapeKey = this.handleEscKey.bind(this);
//Restrict tab action to the modal
this.options.keyEventHandlers.tabKey = this.handleTabKey.bind(this);

return this;
},

/**
* Once the modal is opened it hides the X
*/
onOpened: function () {
$('.modal-header button.action-close').hide();
$('.modal-header button.action-close').attr('disabled', true).hide();

this.focusableElements = $(this.rootSelector).find('a[href], button:enabled');
this.firstFocusableElement = this.focusableElements[0];
this.lastFocusableElement = this.focusableElements[this.focusableElements.length - 1];
this.firstFocusableElement.focus();
},

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

if (analyticsPopupConfig.releaseVisible) {
notifiModal.initializeContentAfterAnalytics();
registry.get(notificationModalSelector).initializeContentAfterAnalytics();
}
},

/**
* Handle Tab and Shift+Tab key event
*
* Keep the tab actions restricted to the popup modal
* so the user must select an option to dismiss the modal
*/
handleTabKey: function (event) {
var modal = this,
KEY_TAB = 9;

/**
* Handle Shift+Tab to tab backwards
*/
function handleBackwardTab() {
if (document.activeElement === modal.firstFocusableElement ||
document.activeElement === $(modal.rootSelector)[0]
) {
event.preventDefault();
modal.lastFocusableElement.focus();
}
}

/**
* Handle Tab forward
*/
function handleForwardTab() {
if (document.activeElement === modal.lastFocusableElement) {
event.preventDefault();
modal.firstFocusableElement.focus();
}
}

switch (event.keyCode) {
case KEY_TAB:
if (modal.focusableElements.length === 1) {
event.preventDefault();
break;
}

if (event.shiftKey) {
handleBackwardTab();
break;
}
handleForwardTab();
break;
default:
break;
}
},

/**
* Handle Esc key
*
* Esc key should not close modal
*/
handleEscKey: function (event) {
event.preventDefault();
}
}
);
Expand Down
27 changes: 15 additions & 12 deletions app/code/Magento/AdminNotification/Block/Grid/Renderer/Actions.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php
declare(strict_types=1);

/**
* Adminhtml AdminNotification Severity Renderer
*
Expand All @@ -8,12 +10,16 @@

namespace Magento\AdminNotification\Block\Grid\Renderer;

use Magento\Backend\Block\Context;
use Magento\Backend\Block\Widget\Grid\Column\Renderer\AbstractRenderer;
use Magento\Framework\App\ActionInterface;
use Magento\Framework\DataObject;
use Magento\Framework\Url\Helper\Data;

/**
* Renderer class for action in the admin notifications grid
*
* @package Magento\AdminNotification\Block\Grid\Renderer
*/
class Actions extends \Magento\Backend\Block\Widget\Grid\Column\Renderer\AbstractRenderer
class Actions extends AbstractRenderer
{
/**
* @var \Magento\Framework\Url\Helper\Data
Expand All @@ -25,11 +31,8 @@ class Actions extends \Magento\Backend\Block\Widget\Grid\Column\Renderer\Abstrac
* @param \Magento\Framework\Url\Helper\Data $urlHelper
* @param array $data
*/
public function __construct(
\Magento\Backend\Block\Context $context,
\Magento\Framework\Url\Helper\Data $urlHelper,
array $data = []
) {
public function __construct(Context $context, Data $urlHelper, array $data = [])
{
$this->_urlHelper = $urlHelper;
parent::__construct($context, $data);
}
Expand All @@ -40,7 +43,7 @@ public function __construct(
* @param \Magento\Framework\DataObject $row
* @return string
*/
public function render(\Magento\Framework\DataObject $row)
public function render(DataObject $row)
{
$readDetailsHtml = $row->getUrl() ? '<a class="action-details" target="_blank" href="' .
$this->escapeUrl($row->getUrl())
Expand All @@ -49,7 +52,7 @@ public function render(\Magento\Framework\DataObject $row)

$markAsReadHtml = !$row->getIsRead() ? '<a class="action-mark" href="' . $this->getUrl(
'*/*/markAsRead/',
['_current' => true, 'id' => $row->getId()]
['_current' => true, 'id' => $row->getNotificationId()]
) . '">' . __(
'Mark as Read'
) . '</a>' : '';
Expand All @@ -63,8 +66,8 @@ public function render(\Magento\Framework\DataObject $row)
'*/*/remove/',
[
'_current' => true,
'id' => $row->getId(),
\Magento\Framework\App\ActionInterface::PARAM_NAME_URL_ENCODED => $encodedUrl
'id' => $row->getNotificationId(),
ActionInterface::PARAM_NAME_URL_ENCODED => $encodedUrl
]
),
__('Are you sure?'),
Expand Down
12 changes: 10 additions & 2 deletions app/code/Magento/AdminNotification/Block/Grid/Renderer/Notice.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php
declare(strict_types=1);

/**
* Adminhtml AdminNotification Severity Renderer
*
Expand All @@ -7,15 +9,21 @@
*/
namespace Magento\AdminNotification\Block\Grid\Renderer;

class Notice extends \Magento\Backend\Block\Widget\Grid\Column\Renderer\AbstractRenderer
use Magento\Backend\Block\Widget\Grid\Column\Renderer\AbstractRenderer;
use Magento\Framework\DataObject;

/**
* Renderer class for notice in the admin notifications grid
*/
class Notice extends AbstractRenderer
{
/**
* Renders grid column
*
* @param \Magento\Framework\DataObject $row
* @return string
*/
public function render(\Magento\Framework\DataObject $row)
public function render(DataObject $row)
{
return '<span class="grid-row-title">' .
$this->escapeHtml($row->getTitle()) .
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php
declare(strict_types=1);

/**
* Adminhtml AdminNotification Severity Renderer
*
Expand All @@ -7,9 +9,16 @@
*/
namespace Magento\AdminNotification\Block\Grid\Renderer;

use Magento\AdminNotification\Model\Inbox;
use Magento\Backend\Block\Context;
use Magento\Backend\Block\Widget\Grid\Column\Renderer\AbstractRenderer;
use Magento\Framework\DataObject;
use Magento\Framework\Notification\MessageInterface;

class Severity extends \Magento\Backend\Block\Widget\Grid\Column\Renderer\AbstractRenderer
/**
* Renderer class for severity in the admin notifications grid
*/
class Severity extends AbstractRenderer
{
/**
* @var \Magento\AdminNotification\Model\Inbox
Expand All @@ -21,11 +30,8 @@ class Severity extends \Magento\Backend\Block\Widget\Grid\Column\Renderer\Abstra
* @param \Magento\AdminNotification\Model\Inbox $notice
* @param array $data
*/
public function __construct(
\Magento\Backend\Block\Context $context,
\Magento\AdminNotification\Model\Inbox $notice,
array $data = []
) {
public function __construct(Context $context, Inbox $notice, array $data = [])
{
parent::__construct($context, $data);
$this->_notice = $notice;
}
Expand All @@ -36,12 +42,14 @@ public function __construct(
* @param \Magento\Framework\DataObject $row
* @return string
*/
public function render(\Magento\Framework\DataObject $row)
public function render(DataObject $row)
{
$class = '';
$value = '';

switch ($row->getData($this->getColumn()->getIndex())) {
$column = $this->getColumn();
$index = $column->getIndex();
switch ($row->getData($index)) {
case MessageInterface::SEVERITY_CRITICAL:
$class = 'critical';
$value = $this->_notice->getSeverities(MessageInterface::SEVERITY_CRITICAL);
Expand All @@ -59,6 +67,7 @@ public function render(\Magento\Framework\DataObject $row)
$value = $this->_notice->getSeverities(MessageInterface::SEVERITY_NOTICE);
break;
}

return '<span class="grid-severity-' . $class . '"><span>' . $value . '</span></span>';
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AdminSystemMessagesWarningActionGroup">
<annotations>
<description>Check warning system message exists.</description>
</annotations>
<arguments>
<argument name="message" type="string"/>
</arguments>

<waitForElementVisible selector="{{AdminSystemMessagesSection.systemMessagesDropdown}}" stepKey="waitMessagesDropdownAppears"/>
<conditionalClick selector="{{AdminSystemMessagesSection.systemMessagesDropdown}}" dependentSelector="{{AdminSystemMessagesSection.messagesBlock}}" visible="false" stepKey="openMessagesBlockIfCollapsed"/>
<see userInput="{{message}}" selector="{{AdminSystemMessagesSection.warning}}" stepKey="seeWarningMessage"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,9 @@
<section name="AdminSystemMessagesSection">
<element name="systemMessagesDropdown" type="button" selector="#system_messages .message-system-action-dropdown"/>
<element name="actionMessageLog" type="button" selector="//*[contains(@class, 'message-system-summary')]/a[contains(text(), '{{textMessage}}')]" parameterized="true"/>
<element name="messagesBlock" type="block" selector="#system_messages div.message-system-collapsible"/>
<element name="success" type="text" selector="#system_messages div.message-success"/>
<element name="warning" type="text" selector="#system_messages div.message-warning"/>
<element name="notice" type="text" selector="#system_messages div.message-notice"/>
</section>
</sections>
Loading

0 comments on commit 94e8685

Please sign in to comment.