Skip to content

Commit 0dc9854

Browse files
author
Yu Tang
committed
Merge remote-tracking branch 'mainline/develop' into develop
2 parents d35efeb + 0c03986 commit 0dc9854

File tree

1,419 files changed

+22928
-15430
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,419 files changed

+22928
-15430
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')

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/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/Block/Widget/Grid/Extended.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,11 @@ protected function _prepareLayout()
203203
$this->setChild(
204204
'reset_filter_button',
205205
$this->getLayout()->createBlock('Magento\Backend\Block\Widget\Button')->setData(
206-
['label' => __('Reset Filter'), 'onclick' => $this->getJsObjectName() . '.resetFilter()']
206+
[
207+
'label' => __('Reset Filter'),
208+
'onclick' => $this->getJsObjectName() . '.resetFilter()',
209+
'class' => 'action-reset'
210+
]
207211
)
208212
);
209213
$this->setChild(

app/code/Magento/Backend/Test/Unit/Model/Menu/Filter/IteratorTest.php

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,6 @@ class IteratorTest extends \PHPUnit_Framework_TestCase
1212
*/
1313
protected $_menuModel;
1414

15-
/**
16-
* @var \Magento\Backend\Model\Menu\Filter\Iterator
17-
*/
18-
protected $_filterIteratorModel;
19-
2015
/**
2116
* @var \Magento\Backend\Model\Menu\Item[]
2217
*/
@@ -42,9 +37,6 @@ protected function setUp()
4237
$loggerMock = $this->getMock('Psr\Log\LoggerInterface');
4338

4439
$this->_menuModel = new \Magento\Backend\Model\Menu($loggerMock);
45-
$this->_filterIteratorModel = new \Magento\Backend\Model\Menu\Filter\Iterator(
46-
$this->_menuModel->getIterator()
47-
);
4840
}
4941

5042
public function testLoopWithAllItemsDisabledDoesntIterate()
@@ -54,8 +46,12 @@ public function testLoopWithAllItemsDisabledDoesntIterate()
5446
$this->_menuModel->add($this->getMock('Magento\Backend\Model\Menu\Item', [], [], '', false));
5547
$this->_menuModel->add($this->getMock('Magento\Backend\Model\Menu\Item', [], [], '', false));
5648
$this->_menuModel->add($this->getMock('Magento\Backend\Model\Menu\Item', [], [], '', false));
49+
$filterIteratorModel = new \Magento\Backend\Model\Menu\Filter\Iterator(
50+
$this->_menuModel->getIterator()
51+
);
52+
5753
$items = [];
58-
foreach ($this->_filterIteratorModel as $item) {
54+
foreach ($filterIteratorModel as $item) {
5955
$items[] = $item;
6056
}
6157
$this->assertCount(0, $items);
@@ -70,9 +66,12 @@ public function testLoopIteratesOnlyValidItems()
7066

7167
$this->_menuModel->add($this->getMock('Magento\Backend\Model\Menu\Item', [], [], '', false));
7268
$this->_menuModel->add($this->getMock('Magento\Backend\Model\Menu\Item', [], [], '', false));
69+
$filterIteratorModel = new \Magento\Backend\Model\Menu\Filter\Iterator(
70+
$this->_menuModel->getIterator()
71+
);
7372

7473
$items = [];
75-
foreach ($this->_filterIteratorModel as $item) {
74+
foreach ($filterIteratorModel as $item) {
7675
$items[] = $item;
7776
}
7877
$this->assertCount(1, $items);
@@ -88,9 +87,12 @@ public function testLoopIteratesDosntIterateDisabledItems()
8887

8988
$this->_menuModel->add($this->getMock('Magento\Backend\Model\Menu\Item', [], [], '', false));
9089
$this->_menuModel->add($this->getMock('Magento\Backend\Model\Menu\Item', [], [], '', false));
90+
$filterIteratorModel = new \Magento\Backend\Model\Menu\Filter\Iterator(
91+
$this->_menuModel->getIterator()
92+
);
9193

9294
$items = [];
93-
foreach ($this->_filterIteratorModel as $item) {
95+
foreach ($filterIteratorModel as $item) {
9496
$items[] = $item;
9597
}
9698
$this->assertCount(1, $items);
@@ -106,9 +108,12 @@ public function testLoopIteratesDosntIterateNotAllowedItems()
106108

107109
$this->_menuModel->add($this->getMock('Magento\Backend\Model\Menu\Item', [], [], '', false));
108110
$this->_menuModel->add($this->getMock('Magento\Backend\Model\Menu\Item', [], [], '', false));
111+
$filterIteratorModel = new \Magento\Backend\Model\Menu\Filter\Iterator(
112+
$this->_menuModel->getIterator()
113+
);
109114

110115
$items = [];
111-
foreach ($this->_filterIteratorModel as $item) {
116+
foreach ($filterIteratorModel as $item) {
112117
$items[] = $item;
113118
}
114119
$this->assertCount(1, $items);
@@ -125,9 +130,12 @@ public function testLoopIteratesMixedItems()
125130

126131
$this->_menuModel->add($this->getMock('Magento\Backend\Model\Menu\Item', [], [], '', false));
127132
$this->_menuModel->add($this->getMock('Magento\Backend\Model\Menu\Item', [], [], '', false));
133+
$filterIteratorModel = new \Magento\Backend\Model\Menu\Filter\Iterator(
134+
$this->_menuModel->getIterator()
135+
);
128136

129137
$items = [];
130-
foreach ($this->_filterIteratorModel as $item) {
138+
foreach ($filterIteratorModel as $item) {
131139
$items[] = $item;
132140
}
133141
$this->assertCount(1, $items);

app/code/Magento/Backend/etc/adminhtml/menu.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<menu>
1010
<add id="Magento_Backend::system_design_schedule" title="Schedule" module="Magento_Backend" sortOrder="30" parent="Magento_Backend::system_design" action="adminhtml/system_design" resource="Magento_Backend::schedule"/>
1111
<add id="Magento_Backend::system_currency" title="Currency" module="Magento_Backend" sortOrder="30" parent="Magento_Backend::stores" action="adminhtml/system_currency" resource="Magento_CurrencySymbol::system_currency"/>
12-
<add id="Magento_Backend::system_store" title="All Stores" module="Magento_Core" sortOrder="10" parent="Magento_Backend::stores_settings" action="adminhtml/system_store/" resource="Magento_Backend::store"/>
12+
<add id="Magento_Backend::system_store" title="All Stores" module="Magento_Backend" sortOrder="10" parent="Magento_Backend::stores_settings" action="adminhtml/system_store/" resource="Magento_Backend::store"/>
1313
<add id="Magento_Backend::dashboard" title="Dashboard" module="Magento_Backend" sortOrder="10" action="adminhtml/dashboard" resource="Magento_Backend::dashboard"/>
1414
<add id="Magento_Backend::system" title="System" module="Magento_Backend" sortOrder="80" resource="Magento_Backend::system"/>
1515
<add id="Magento_Backend::system_tools" title="Tools" module="Magento_Backend" sortOrder="50" parent="Magento_Backend::system" resource="Magento_Backend::tools"/>

app/code/Magento/Backend/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
<media_storage_configuration>

app/code/Magento/Backend/view/adminhtml/templates/media/uploader.phtml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
</div>
1616
<div class="clear"></div>
1717
<script id="<?php echo $block->getHtmlId() ?>-template" type="text/x-magento-template">
18-
<div id="<%= data.id %>" class="file-row">
19-
<span class="file-info"><%= data.name %> (<%= data.size %>)</span>
18+
<div id="<%- data.id %>" class="file-row">
19+
<span class="file-info"><%- data.name %> (<%- data.size %>)</span>
2020
<div class="progressbar-container">
2121
<div class="progressbar upload-progress" style="width: 0%;"></div>
2222
</div>

0 commit comments

Comments
 (0)