Skip to content

Commit e18f09a

Browse files
author
mastuhin.olexnadr
committed
Merge branch 'ENGCOM-1103-magento-magento2-14381' of https://github.com/magento-engcom/magento2ce into ENGCOM-1103-magento-magento2-14381
2 parents 7884e63 + a2a65b8 commit e18f09a

File tree

570 files changed

+15321
-3044
lines changed

Some content is hidden

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

570 files changed

+15321
-3044
lines changed

.travis.yml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ services:
1616
- elasticsearch
1717
language: php
1818
php:
19-
- 7.0
2019
- 7.1
2120
env:
2221
global:
@@ -33,16 +32,6 @@ env:
3332
- TEST_SUITE=integration INTEGRATION_INDEX=2
3433
- TEST_SUITE=integration INTEGRATION_INDEX=3
3534
- TEST_SUITE=functional
36-
matrix:
37-
exclude:
38-
- php: 7.0
39-
env: TEST_SUITE=static
40-
- php: 7.0
41-
env: TEST_SUITE=js GRUNT_COMMAND=spec
42-
- php: 7.0
43-
env: TEST_SUITE=js GRUNT_COMMAND=static
44-
- php: 7.0
45-
env: TEST_SUITE=functional
4635
cache:
4736
apt: true
4837
directories:

app/code/Magento/AdminNotification/Block/System/Messages.php

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,24 +16,34 @@ class Messages extends \Magento\Backend\Block\Template
1616

1717
/**
1818
* @var \Magento\Framework\Json\Helper\Data
19+
* @deprecated
1920
*/
2021
protected $jsonHelper;
2122

23+
/**
24+
* @var \Magento\Framework\Serialize\Serializer\Json
25+
*/
26+
private $serializer;
27+
2228
/**
2329
* @param \Magento\Backend\Block\Template\Context $context
2430
* @param \Magento\AdminNotification\Model\ResourceModel\System\Message\Collection\Synchronized $messages
2531
* @param \Magento\Framework\Json\Helper\Data $jsonHelper
2632
* @param array $data
33+
* @param \Magento\Framework\Serialize\Serializer\Json|null $serializer
2734
*/
2835
public function __construct(
2936
\Magento\Backend\Block\Template\Context $context,
3037
\Magento\AdminNotification\Model\ResourceModel\System\Message\Collection\Synchronized $messages,
3138
\Magento\Framework\Json\Helper\Data $jsonHelper,
32-
array $data = []
39+
array $data = [],
40+
\Magento\Framework\Serialize\Serializer\Json $serializer = null
3341
) {
3442
$this->jsonHelper = $jsonHelper;
3543
parent::__construct($context, $data);
3644
$this->_messages = $messages;
45+
$this->serializer = $serializer ?: \Magento\Framework\App\ObjectManager::getInstance()
46+
->get(\Magento\Framework\Serialize\Serializer\Json::class);
3747
}
3848

3949
/**
@@ -117,7 +127,7 @@ protected function _getMessagesUrl()
117127
*/
118128
public function getSystemMessageDialogJson()
119129
{
120-
return $this->jsonHelper->jsonEncode(
130+
return $this->serializer->serialize(
121131
[
122132
'systemMessageDialog' => [
123133
'buttons' => [],

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ public function execute()
2828
)->markAsRead(
2929
$notificationId
3030
);
31-
$this->messageManager->addSuccess(__('The message has been marked as Read.'));
31+
$this->messageManager->addSuccessMessage(__('The message has been marked as Read.'));
3232
} catch (\Magento\Framework\Exception\LocalizedException $e) {
33-
$this->messageManager->addError($e->getMessage());
33+
$this->messageManager->addErrorMessage($e->getMessage());
3434
} catch (\Exception $e) {
35-
$this->messageManager->addException(
35+
$this->messageManager->addExceptionMessage(
3636
$e,
3737
__("We couldn't mark the notification as Read because of an error.")
3838
);

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public function execute()
2323
{
2424
$ids = $this->getRequest()->getParam('notification');
2525
if (!is_array($ids)) {
26-
$this->messageManager->addError(__('Please select messages.'));
26+
$this->messageManager->addErrorMessage(__('Please select messages.'));
2727
} else {
2828
try {
2929
foreach ($ids as $id) {
@@ -32,13 +32,13 @@ public function execute()
3232
$model->setIsRead(1)->save();
3333
}
3434
}
35-
$this->messageManager->addSuccess(
35+
$this->messageManager->addSuccessMessage(
3636
__('A total of %1 record(s) have been marked as Read.', count($ids))
3737
);
3838
} catch (\Magento\Framework\Exception\LocalizedException $e) {
39-
$this->messageManager->addError($e->getMessage());
39+
$this->messageManager->addErrorMessage($e->getMessage());
4040
} catch (\Exception $e) {
41-
$this->messageManager->addException(
41+
$this->messageManager->addExceptionMessage(
4242
$e,
4343
__("We couldn't mark the notification as Read because of an error.")
4444
);

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

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public function execute()
2323
{
2424
$ids = $this->getRequest()->getParam('notification');
2525
if (!is_array($ids)) {
26-
$this->messageManager->addError(__('Please select messages.'));
26+
$this->messageManager->addErrorMessage(__('Please select messages.'));
2727
} else {
2828
try {
2929
foreach ($ids as $id) {
@@ -32,11 +32,14 @@ public function execute()
3232
$model->setIsRemove(1)->save();
3333
}
3434
}
35-
$this->messageManager->addSuccess(__('Total of %1 record(s) have been removed.', count($ids)));
35+
$this->messageManager->addSuccessMessage(__('Total of %1 record(s) have been removed.', count($ids)));
3636
} catch (\Magento\Framework\Exception\LocalizedException $e) {
37-
$this->messageManager->addError($e->getMessage());
37+
$this->messageManager->addErrorMessage($e->getMessage());
3838
} catch (\Exception $e) {
39-
$this->messageManager->addException($e, __("We couldn't remove the messages because of an error."));
39+
$this->messageManager->addExceptionMessage(
40+
$e,
41+
__("We couldn't remove the messages because of an error.")
42+
);
4043
}
4144
}
4245
$this->_redirect('adminhtml/*/');

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,14 @@ public function execute()
3131

3232
try {
3333
$model->setIsRemove(1)->save();
34-
$this->messageManager->addSuccess(__('The message has been removed.'));
34+
$this->messageManager->addSuccessMessage(__('The message has been removed.'));
3535
} catch (\Magento\Framework\Exception\LocalizedException $e) {
36-
$this->messageManager->addError($e->getMessage());
36+
$this->messageManager->addErrorMessage($e->getMessage());
3737
} catch (\Exception $e) {
38-
$this->messageManager->addException($e, __("We couldn't remove the messages because of an error."));
38+
$this->messageManager->addExceptionMessage(
39+
$e,
40+
__("We couldn't remove the messages because of an error.")
41+
);
3942
}
4043

4144
$this->_redirect('adminhtml/*/');

app/code/Magento/AdminNotification/Controller/Adminhtml/System/Message/ListAction.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
*/
77
namespace Magento\AdminNotification\Controller\Adminhtml\System\Message;
88

9+
use Magento\Framework\Controller\ResultFactory;
10+
911
class ListAction extends \Magento\Backend\App\AbstractAction
1012
{
1113
/**
@@ -15,6 +17,7 @@ class ListAction extends \Magento\Backend\App\AbstractAction
1517

1618
/**
1719
* @var \Magento\Framework\Json\Helper\Data
20+
* @deprecated
1821
*/
1922
protected $jsonHelper;
2023

@@ -41,7 +44,7 @@ public function __construct(
4144
}
4245

4346
/**
44-
* @return void
47+
* @return \Magento\Framework\Controller\Result\Json
4548
*/
4649
public function execute()
4750
{
@@ -63,6 +66,9 @@ public function execute()
6366
. 'Please refresh the web page to clear the notice alert.',
6467
];
6568
}
66-
$this->getResponse()->representJson($this->jsonHelper->jsonEncode($result));
69+
/** @var \Magento\Framework\Controller\Result\Json $resultJson */
70+
$resultJson = $this->resultFactory->create(ResultFactory::TYPE_JSON);
71+
$resultJson->setData($result);
72+
return $resultJson;
6773
}
6874
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
declare(strict_types=1);
8+
9+
namespace Magento\AsynchronousOperations\Api;
10+
11+
/**
12+
* Interface BulkStatusInterface
13+
* Bulk summary data with list of operations items short data.
14+
*
15+
* @api
16+
*/
17+
interface BulkStatusInterface extends \Magento\Framework\Bulk\BulkStatusInterface
18+
{
19+
/**
20+
* Get Bulk summary data with list of operations items full data.
21+
*
22+
* @param string $bulkUuid
23+
* @return \Magento\AsynchronousOperations\Api\Data\DetailedBulkOperationsStatusInterface
24+
* @throws \Magento\Framework\Exception\NoSuchEntityException
25+
*/
26+
public function getBulkDetailedStatus($bulkUuid);
27+
28+
/**
29+
* Get Bulk summary data with list of operations items short data.
30+
*
31+
* @param string $bulkUuid
32+
* @return \Magento\AsynchronousOperations\Api\Data\BulkOperationsStatusInterface
33+
* @throws \Magento\Framework\Exception\NoSuchEntityException
34+
*/
35+
public function getBulkShortStatus($bulkUuid);
36+
}
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
declare(strict_types=1);
8+
9+
namespace Magento\AsynchronousOperations\Api\Data;
10+
11+
/**
12+
* Interface AsyncResponseInterface
13+
* Temporary data object to give response from webapi async router
14+
*
15+
* @api
16+
*/
17+
interface AsyncResponseInterface
18+
{
19+
const BULK_UUID = 'bulk_uuid';
20+
const REQUEST_ITEMS = 'request_items';
21+
const ERRORS = 'errors';
22+
23+
/**
24+
* Gets the bulk uuid.
25+
*
26+
* @return string Bulk Uuid.
27+
*/
28+
public function getBulkUuid();
29+
30+
/**
31+
* Sets the bulk uuid.
32+
*
33+
* @param string $bulkUuid
34+
* @return $this
35+
*/
36+
public function setBulkUuid($bulkUuid);
37+
38+
/**
39+
* Gets the list of request items with status data.
40+
*
41+
* @return \Magento\AsynchronousOperations\Api\Data\ItemStatusInterface[]
42+
*/
43+
public function getRequestItems();
44+
45+
/**
46+
* Sets the list of request items with status data.
47+
*
48+
* @param \Magento\AsynchronousOperations\Api\Data\ItemStatusInterface[] $requestItems
49+
* @return $this
50+
*/
51+
public function setRequestItems($requestItems);
52+
53+
/**
54+
* @param bool $isErrors
55+
* @return $this
56+
*/
57+
public function setErrors($isErrors = false);
58+
59+
/**
60+
* Is there errors during processing bulk
61+
*
62+
* @return boolean
63+
*/
64+
public function isErrors();
65+
66+
/**
67+
* Retrieve existing extension attributes object.
68+
*
69+
* @return \Magento\AsynchronousOperations\Api\Data\AsyncResponseExtensionInterface|null
70+
*/
71+
public function getExtensionAttributes();
72+
73+
/**
74+
* Set an extension attributes object.
75+
*
76+
* @param \Magento\AsynchronousOperations\Api\Data\AsyncResponseExtensionInterface $extensionAttributes
77+
* @return $this
78+
*/
79+
public function setExtensionAttributes(
80+
\Magento\AsynchronousOperations\Api\Data\AsyncResponseExtensionInterface $extensionAttributes
81+
);
82+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
declare(strict_types=1);
8+
9+
namespace Magento\AsynchronousOperations\Api\Data;
10+
11+
/**
12+
* Interface BulkStatusInterface
13+
*
14+
* Bulk summary data with list of operations items summary data.
15+
*
16+
* @api
17+
*/
18+
interface BulkOperationsStatusInterface extends BulkSummaryInterface
19+
{
20+
21+
const OPERATIONS_LIST = 'operations_list';
22+
23+
/**
24+
* Retrieve list of operation with statuses (short data).
25+
*
26+
* @return \Magento\AsynchronousOperations\Api\Data\SummaryOperationStatusInterface[]
27+
*/
28+
public function getOperationsList();
29+
30+
/**
31+
* Set operations list.
32+
*
33+
* @param \Magento\AsynchronousOperations\Api\Data\SummaryOperationStatusInterface[] $operationStatusList
34+
* @return $this
35+
*/
36+
public function setOperationsList($operationStatusList);
37+
}

0 commit comments

Comments
 (0)