Skip to content

Commit ae6cac2

Browse files
author
Oleksii Korshenko
authored
Merge pull request #1384 from magento-engcom/develop-prs
Public Pull Requests #10433 #10430 #10435
2 parents c98f85d + d766ca3 commit ae6cac2

File tree

3 files changed

+34
-10
lines changed

3 files changed

+34
-10
lines changed

app/code/Magento/AdminNotification/Controller/Adminhtml/Notification/AjaxMarkAsRead.php

Lines changed: 30 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,35 @@
66
*/
77
namespace Magento\AdminNotification\Controller\Adminhtml\Notification;
88

9+
use Magento\Backend\App\Action;
10+
use Magento\Framework\Controller\ResultFactory;
11+
912
class AjaxMarkAsRead extends \Magento\AdminNotification\Controller\Adminhtml\Notification
1013
{
14+
/**
15+
* @var \Magento\AdminNotification\Model\NotificationService
16+
*/
17+
private $notificationService;
18+
19+
/**
20+
* @param Action\Context $context
21+
* @param \Magento\AdminNotification\Model\NotificationService|null $notificationService
22+
* @throws \RuntimeException
23+
*/
24+
public function __construct(
25+
Action\Context $context,
26+
\Magento\AdminNotification\Model\NotificationService $notificationService = null
27+
) {
28+
parent::__construct($context);
29+
$this->notificationService = $notificationService?: \Magento\Framework\App\ObjectManager::getInstance()
30+
->get(\Magento\AdminNotification\Model\NotificationService::class);
31+
}
32+
1133
/**
1234
* Mark notification as read (AJAX action)
1335
*
14-
* @return void
36+
* @return \Magento\Framework\Controller\Result\Json|void
37+
* @throws \InvalidArgumentException
1538
*/
1639
public function execute()
1740
{
@@ -21,17 +44,15 @@ public function execute()
2144
$notificationId = (int)$this->getRequest()->getPost('id');
2245
$responseData = [];
2346
try {
24-
$this->_objectManager->create(
25-
\Magento\AdminNotification\Model\NotificationService::class
26-
)->markAsRead(
27-
$notificationId
28-
);
47+
$this->notificationService->markAsRead($notificationId);
2948
$responseData['success'] = true;
3049
} catch (\Exception $e) {
3150
$responseData['success'] = false;
3251
}
33-
$this->getResponse()->representJson(
34-
$this->_objectManager->create(\Magento\Framework\Json\Helper\Data::class)->jsonEncode($responseData)
35-
);
52+
53+
/** @var \Magento\Framework\Controller\Result\Json $resultJson */
54+
$resultJson = $this->resultFactory->create(ResultFactory::TYPE_JSON);
55+
$resultJson->setData($responseData);
56+
return $resultJson;
3657
}
3758
}

app/code/Magento/Sales/etc/fieldset.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@
279279
<aspect name="to_order" />
280280
</field>
281281
<field name="base_shipping_discount_tax_compensation_amount">
282-
<aspect name="to_order" />
282+
<aspect name="to_order" targetField="base_shipping_discount_tax_compensation_amnt" />
283283
</field>
284284
<field name="prefix">
285285
<aspect name="to_order_address" />

lib/web/mage/menu.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,7 @@ define([
323323

324324
$(this.element).off('mouseenter mouseleave');
325325
this._on({
326+
326327
/**
327328
* @param {jQuery.Event} event
328329
*/
@@ -372,7 +373,9 @@ define([
372373
_toggleDesktopMode: function () {
373374
var categoryParent, html;
374375

376+
$(this.element).off('click mousedown mouseenter mouseleave');
375377
this._on({
378+
376379
/**
377380
* Prevent focus from sticking to links inside menu after clicking
378381
* them (focus should always stay on UL during navigation).

0 commit comments

Comments
 (0)