Skip to content

Commit adc7a7a

Browse files
author
Oleg Zinoviev
committed
Merge branch 'UI' into MAGETWO-35172
2 parents 22aa7f6 + da69d75 commit adc7a7a

File tree

1,204 files changed

+15509
-18042
lines changed

Some content is hidden

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

1,204 files changed

+15509
-18042
lines changed

.php_cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ $finder = Symfony\CS\Finder\DefaultFinder::create()
1515
->exclude('dev/tests/functional/vendor')
1616
->exclude('dev/tests/integration/tmp')
1717
->exclude('dev/tests/integration/var')
18-
->exclude('lib/internal/Apache')
1918
->exclude('lib/internal/CardinalCommerce')
2019
->exclude('lib/internal/Cm')
2120
->exclude('lib/internal/Credis')

Gruntfile.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,14 @@ module.exports = function (grunt) {
6060
'less:luma',
6161
'less:backend'
6262
],
63-
63+
/**
64+
* Styles for backend theme
65+
*/
66+
backend: [
67+
'less:backend',
68+
'replace:example',
69+
'less:override'
70+
],
6471
/**
6572
* Documentation
6673
*/

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

Lines changed: 41 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,56 @@
88

99
class ListAction extends \Magento\Backend\App\AbstractAction
1010
{
11+
/**
12+
* @var \Magento\Framework\Json\Helper\Data
13+
*/
14+
protected $jsonHelper;
15+
16+
/**
17+
* @var \Magento\AdminNotification\Model\Resource\System\Message\Collection
18+
*/
19+
protected $messageCollection;
20+
21+
/**
22+
* Initialize ListAction
23+
*
24+
* @param \Magento\Backend\App\Action\Context $context
25+
* @param \Magento\Framework\Json\Helper\Data $jsonHelper
26+
* @param \Magento\AdminNotification\Model\Resource\System\Message\Collection $messageCollection
27+
*/
28+
public function __construct(
29+
\Magento\Backend\App\Action\Context $context,
30+
\Magento\Framework\Json\Helper\Data $jsonHelper,
31+
\Magento\AdminNotification\Model\Resource\System\Message\Collection $messageCollection
32+
) {
33+
$this->jsonHelper = $jsonHelper;
34+
$this->messageCollection = $messageCollection;
35+
parent::__construct($context);
36+
}
37+
1138
/**
1239
* @return void
1340
*/
1441
public function execute()
1542
{
1643
$severity = $this->getRequest()->getParam('severity');
17-
$messageCollection = $this->_objectManager->get(
18-
'Magento\AdminNotification\Model\Resource\System\Message\Collection'
19-
);
2044
if ($severity) {
21-
$messageCollection->setSeverity($severity);
45+
$this->messageCollection->setSeverity($severity);
2246
}
2347
$result = [];
24-
foreach ($messageCollection->getItems() as $item) {
25-
$result[] = ['severity' => $item->getSeverity(), 'text' => $item->getText()];
48+
foreach ($this->messageCollection->getItems() as $item) {
49+
$result[] = [
50+
'severity' => $item->getSeverity(),
51+
'text' => $item->getText(),
52+
];
53+
}
54+
if (empty($result)) {
55+
$result[] = [
56+
'severity' => (string)\Magento\Framework\Notification\MessageInterface::SEVERITY_NOTICE,
57+
'text' => 'You have viewed and resolved all recent system notices. '
58+
. 'Please refresh the web page to clear the notice alert.',
59+
];
2660
}
27-
$this->getResponse()->representJson(
28-
$this->_objectManager->get('Magento\Framework\Json\Helper\Data')->jsonEncode($result)
29-
);
61+
$this->getResponse()->representJson($this->jsonHelper->jsonEncode($result));
3062
}
3163
}

app/code/Magento/AdminNotification/etc/config.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* See COPYING.txt for license details.
66
*/
77
-->
8-
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Core/etc/config.xsd">
8+
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Store/etc/config.xsd">
99
<default>
1010
<system>
1111
<adminnotification>

app/code/Magento/AdminNotification/etc/module.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd">
99
<module name="Magento_AdminNotification" setup_version="2.0.0">
1010
<sequence>
11-
<module name="Magento_Core"/>
1211
<module name="Magento_Store"/>
1312
</sequence>
1413
</module>

app/code/Magento/Authorization/Model/Acl/AclRetriever.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,9 @@ public function getAllowedResourcesByUser($userType, $userId)
7575
try {
7676
$role = $this->_getUserRole($userType, $userId);
7777
if (!$role) {
78-
throw new AuthorizationException('The role associated with the specified user cannot be found.');
78+
throw new AuthorizationException(
79+
__('The role associated with the specified user cannot be found.')
80+
);
7981
}
8082
$allowedResources = $this->getAllowedResourcesByRole($role->getId());
8183
} catch (AuthorizationException $e) {

app/code/Magento/Authorization/Setup/InstallData.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,5 +85,17 @@ public function install(ModuleDataSetupInterface $setup, ModuleContextInterface
8585
$rule->setData('resource_id', 'Magento_Backend::all')->save();
8686
}
8787
}
88+
89+
/**
90+
* Delete rows by condition from authorization_rule
91+
*/
92+
$setup->startSetup();
93+
94+
$tableName = $setup->getTable('authorization_rule');
95+
if ($tableName) {
96+
$setup->getConnection()->delete($tableName, ['resource_id = ?' => 'admin/system/tools/compiler']);
97+
}
98+
99+
$setup->endSetup();
88100
}
89101
}

app/code/Magento/Backend/Controller/Adminhtml/Ajax/Translate.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,19 @@ class Translate extends \Magento\Backend\App\Action
1616
protected $inlineParser;
1717

1818
/**
19-
* @var \Magento\Framework\Controller\Result\JSONFactory
19+
* @var \Magento\Framework\Controller\Result\JsonFactory
2020
*/
2121
protected $resultJsonFactory;
2222

2323
/**
2424
* @param Action\Context $context
2525
* @param \Magento\Framework\Translate\Inline\ParserInterface $inlineParser
26-
* @param \Magento\Framework\Controller\Result\JSONFactory $resultJsonFactory
26+
* @param \Magento\Framework\Controller\Result\JsonFactory $resultJsonFactory
2727
*/
2828
public function __construct(
2929
Action\Context $context,
3030
\Magento\Framework\Translate\Inline\ParserInterface $inlineParser,
31-
\Magento\Framework\Controller\Result\JSONFactory $resultJsonFactory
31+
\Magento\Framework\Controller\Result\JsonFactory $resultJsonFactory
3232
) {
3333
parent::__construct($context);
3434
$this->resultJsonFactory = $resultJsonFactory;
@@ -38,13 +38,13 @@ public function __construct(
3838
/**
3939
* Ajax action for inline translation
4040
*
41-
* @return \Magento\Framework\Controller\Result\JSON
41+
* @return \Magento\Framework\Controller\Result\Json
4242
*/
4343
public function execute()
4444
{
4545
$translate = (array)$this->getRequest()->getPost('translate');
4646

47-
/** @var \Magento\Framework\Controller\Result\JSON $resultJson */
47+
/** @var \Magento\Framework\Controller\Result\Json $resultJson */
4848
$resultJson = $this->resultJsonFactory->create();
4949
try {
5050
$this->inlineParser->processAjaxPost($translate);

app/code/Magento/Backend/Controller/Adminhtml/Auth/DeniedJson.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,17 @@
99
class DeniedJson extends \Magento\Backend\Controller\Adminhtml\Auth
1010
{
1111
/**
12-
* @var \Magento\Framework\Controller\Result\JSONFactory
12+
* @var \Magento\Framework\Controller\Result\JsonFactory
1313
*/
1414
protected $resultJsonFactory;
1515

1616
/**
1717
* @param \Magento\Backend\App\Action\Context $context
18-
* @param \Magento\Framework\Controller\Result\JSONFactory $resultJsonFactory
18+
* @param \Magento\Framework\Controller\Result\JsonFactory $resultJsonFactory
1919
*/
2020
public function __construct(
2121
\Magento\Backend\App\Action\Context $context,
22-
\Magento\Framework\Controller\Result\JSONFactory $resultJsonFactory
22+
\Magento\Framework\Controller\Result\JsonFactory $resultJsonFactory
2323
) {
2424
parent::__construct($context);
2525
$this->resultJsonFactory = $resultJsonFactory;
@@ -41,11 +41,11 @@ protected function _getDeniedJson()
4141
/**
4242
* Denied JSON action
4343
*
44-
* @return \Magento\Framework\Controller\Result\JSON
44+
* @return \Magento\Framework\Controller\Result\Json
4545
*/
4646
public function execute()
4747
{
48-
/** @var \Magento\Framework\Controller\Result\JSON $resultJson */
48+
/** @var \Magento\Framework\Controller\Result\Json $resultJson */
4949
$resultJson = $this->resultJsonFactory->create();
5050
return $resultJson->setData($this->_getDeniedJson());
5151
}

app/code/Magento/Backend/Controller/Adminhtml/Cache.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ protected function _validateTypes(array $types)
7474
$allTypes = array_keys($this->_cacheTypeList->getTypes());
7575
$invalidTypes = array_diff($types, $allTypes);
7676
if (count($invalidTypes) > 0) {
77-
throw new LocalizedException(__("Specified cache type(s) don't exist: " . join(', ', $invalidTypes)));
77+
throw new LocalizedException(__('Specified cache type(s) don\'t exist: %1', join(', ', $invalidTypes)));
7878
}
7979
}
8080

0 commit comments

Comments
 (0)