Skip to content

Commit 015b8dd

Browse files
Merge pull request #8691 from magento-gl/comm_prs_247beta3_dec
[Bluetooth] Community Pull Requests delivery
2 parents a2519ca + aa21f38 commit 015b8dd

File tree

18 files changed

+140
-49
lines changed

18 files changed

+140
-49
lines changed

app/code/Magento/Backend/Block/Menu.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
*/
1919
class Menu extends \Magento\Backend\Block\Template
2020
{
21-
const CACHE_TAGS = 'BACKEND_MAINMENU';
21+
public const CACHE_TAGS = 'BACKEND_MAINMENU';
2222

2323
/**
2424
* @var string
@@ -347,6 +347,11 @@ protected function _columnBrake($items, $limit)
347347
}
348348
$result[] = ['place' => $place, 'colbrake' => $colbrake];
349349
}
350+
351+
if (isset($result[1]) && $result[1]['colbrake'] === true && isset($result[2])) {
352+
$result[2]['colbrake'] = true;
353+
}
354+
350355
return $result;
351356
}
352357

app/code/Magento/Backend/Console/Command/CacheCleanCommand.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
class CacheCleanCommand extends AbstractCacheTypeManageCommand
1616
{
1717
/**
18-
* {@inheritdoc}
18+
* @inheritdoc
1919
*/
2020
protected function configure()
2121
{
@@ -32,12 +32,15 @@ protected function configure()
3232
*/
3333
protected function performAction(array $cacheTypes)
3434
{
35-
$this->eventManager->dispatch('adminhtml_cache_flush_system');
35+
if ($cacheTypes === [] || in_array('full_page', $cacheTypes)) {
36+
$this->eventManager->dispatch('adminhtml_cache_flush_system');
37+
}
38+
3639
$this->cacheManager->clean($cacheTypes);
3740
}
3841

3942
/**
40-
* {@inheritdoc}
43+
* @inheritdoc
4144
*/
4245
protected function getDisplayMessage()
4346
{

app/code/Magento/Backend/Console/Command/CacheFlushCommand.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
class CacheFlushCommand extends AbstractCacheTypeManageCommand
1616
{
1717
/**
18-
* {@inheritdoc}
18+
* @inheritdoc
1919
*/
2020
protected function configure()
2121
{
@@ -32,12 +32,15 @@ protected function configure()
3232
*/
3333
protected function performAction(array $cacheTypes)
3434
{
35-
$this->eventManager->dispatch('adminhtml_cache_flush_all');
35+
if ($cacheTypes === [] || in_array('full_page', $cacheTypes)) {
36+
$this->eventManager->dispatch('adminhtml_cache_flush_all');
37+
}
38+
3639
$this->cacheManager->flush($cacheTypes);
3740
}
3841

3942
/**
40-
* {@inheritdoc}
43+
* @inheritdoc
4144
*/
4245
protected function getDisplayMessage()
4346
{

app/code/Magento/Backend/Test/Unit/Console/Command/AbstractCacheManageCommandTest.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,22 @@ public function executeDataProvider()
3535
return [
3636
'implicit all' => [
3737
[],
38-
['A', 'B', 'C'],
39-
$this->getExpectedExecutionOutput(['A', 'B', 'C']),
38+
['A', 'B', 'C', 'full_page'],
39+
true,
40+
$this->getExpectedExecutionOutput(['A', 'B', 'C', 'full_page']),
4041
],
4142
'specified types' => [
4243
['types' => ['A', 'B']],
4344
['A', 'B'],
45+
false,
4446
$this->getExpectedExecutionOutput(['A', 'B']),
4547
],
48+
'fpc_only' => [
49+
['types' => ['full_page']],
50+
['full_page'],
51+
true,
52+
$this->getExpectedExecutionOutput(['full_page']),
53+
],
4654
];
4755
}
4856

app/code/Magento/Backend/Test/Unit/Console/Command/CacheCleanCommandTest.php

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,22 @@ protected function setUp(): void
2222
/**
2323
* @param array $param
2424
* @param array $types
25+
* @param bool $shouldDispatch
2526
* @param string $output
2627
* @dataProvider executeDataProvider
2728
*/
28-
public function testExecute($param, $types, $output)
29+
public function testExecute($param, $types, $shouldDispatch, $output)
2930
{
30-
$this->cacheManagerMock->expects($this->once())->method('getAvailableTypes')->willReturn(['A', 'B', 'C']);
31+
$this->cacheManagerMock->expects($this->once())->method('getAvailableTypes')->willReturn([
32+
'A', 'B', 'C', 'full_page'
33+
]);
3134
$this->cacheManagerMock->expects($this->once())->method('clean')->with($types);
32-
$this->eventManagerMock->expects($this->once())->method('dispatch')->with($this->cacheEventName);
35+
36+
if ($shouldDispatch) {
37+
$this->eventManagerMock->expects($this->once())->method('dispatch')->with($this->cacheEventName);
38+
} else {
39+
$this->eventManagerMock->expects($this->never())->method('dispatch');
40+
}
3341

3442
$commandTester = new CommandTester($this->command);
3543
$commandTester->execute($param);

app/code/Magento/Backend/Test/Unit/Console/Command/CacheFlushCommandTest.php

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,22 @@ protected function setUp(): void
2222
/**
2323
* @param array $param
2424
* @param array $types
25+
* @param bool $shouldDispatch
2526
* @param string $output
2627
* @dataProvider executeDataProvider
2728
*/
28-
public function testExecute($param, $types, $output)
29+
public function testExecute($param, $types, $shouldDispatch, $output)
2930
{
30-
$this->cacheManagerMock->expects($this->once())->method('getAvailableTypes')->willReturn(['A', 'B', 'C']);
31+
$this->cacheManagerMock->expects($this->once())->method('getAvailableTypes')->willReturn([
32+
'A', 'B', 'C', 'full_page'
33+
]);
3134
$this->cacheManagerMock->expects($this->once())->method('flush')->with($types);
32-
$this->eventManagerMock->expects($this->once())->method('dispatch')->with($this->cacheEventName);
35+
36+
if ($shouldDispatch) {
37+
$this->eventManagerMock->expects($this->once())->method('dispatch')->with($this->cacheEventName);
38+
} else {
39+
$this->eventManagerMock->expects($this->never())->method('dispatch');
40+
}
3341

3442
$commandTester = new CommandTester($this->command);
3543
$commandTester->execute($param);

app/code/Magento/Bundle/Test/Mftf/Test/AdminBundleDynamicAttributesAfterMassUpdateTest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
<argument name="consumerName" value="{{AdminProductAttributeUpdateConsumerData.consumerName}}"/>
4848
<argument name="maxMessages" value="{{AdminProductAttributeUpdateConsumerData.messageLimit}}"/>
4949
</actionGroup>
50-
<magentoCron stepKey="runCron"/>
50+
<magentoCron groups="default" stepKey="runCron"/>
5151

5252
<actionGroup ref="OpenProductForEditByClickingRowXColumnYInProductGridActionGroup" stepKey="openProductForEdit"/>
5353

app/code/Magento/Catalog/Test/Mftf/Test/StorefrontVerifyProductAfterPartialReindexOnSeveralWebsitesTest.xml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,11 @@
8787
<argument name="productName" value="{{_defaultProduct.name}}"/>
8888
</actionGroup>
8989

90-
<!-- Run cron -->
91-
<magentoCron stepKey="runCron" />
92-
<magentoCron stepKey="runCronTwice" />
90+
<!-- We need the 'indexer_update_all_views' job to run. This is the best
91+
way we can make that happen, but there is no guarantee that there is
92+
such a job already scheduled in the queue. -->
93+
<magentoCron groups="index" stepKey="runCron" />
94+
<comment userInput="We need the indexer_update_all_views job to run" stepKey="runCronTwice"/>
9395

9496
<!-- Check product is present in category after cron run -->
9597
<actionGroup ref="AssertProductInStorefrontCategoryPage" stepKey="assertProductInStorefront1">

app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontReuseCouponCodeAfterOrderCanceledTest.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@
9494
<argument name="orderNumberMessage" value="CONST.successCheckoutOrderNumberMessage"/>
9595
<argument name="emailYouMessage" value="CONST.successCheckoutEmailYouMessage"/>
9696
</actionGroup>
97-
<magentoCron stepKey="runCronAfterPlacingOrder"/>
97+
<magentoCron groups="default" stepKey="runCronAfterPlacingOrder"/>
9898

9999
<!-- Get Order id -->
100100
<grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="grabOrderNumber"/>
@@ -114,7 +114,7 @@
114114
<!-- Cancel order -->
115115
<actionGroup ref="CancelPendingOrderActionGroup" stepKey="cancelOrder"/>
116116
<waitForPageLoad stepKey="waitForOrderDetailsToLoad"/>
117-
<magentoCron stepKey="runCronAfterCancelingOrder"/>
117+
<magentoCron groups="default" stepKey="runCronAfterCancelingOrder"/>
118118

119119
<!-- Open My Account Page from Customer dropdown -->
120120
<actionGroup ref="StorefrontOpenMyAccountPageActionGroup" stepKey="goToMyAccountPage"/>

app/code/Magento/Ui/view/base/web/js/grid/massactions.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,15 @@ define([
6060
return this;
6161
}
6262

63-
action = this.getAction(actionIndex);
63+
action = this.getAction(actionIndex);
6464
callback = this._getCallback(action, data);
6565

6666
action.confirm ?
6767
this._confirm(action, callback) :
6868
callback();
6969

70+
this.close();
71+
7072
return this;
7173
},
7274

@@ -127,7 +129,7 @@ define([
127129
*/
128130
_getCallback: function (action, selections) {
129131
var callback = action.callback,
130-
args = [action, selections];
132+
args = [action, selections];
131133

132134
if (utils.isObject(callback)) {
133135
args.unshift(callback.target);

app/code/Magento/Ui/view/base/web/js/lib/view/utils/dom-observer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ define([
149149
_.each(watchers.selectors, function (listeners, selector) {
150150
for (let data of listeners) {
151151
if (!data.ctx.contains(node) || !$(node, data.ctx).is(selector)) {
152-
return;
152+
break;
153153
}
154154

155155
if (data.type === 'add') {

app/design/frontend/Magento/blank/web/css/styles-l.less

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,6 @@
2222
//@magento_import 'source/_module.less'; // Theme modules
2323
//@magento_import 'source/_widgets.less'; // Theme widgets
2424

25-
//
26-
// Media queries collector
27-
// ---------------------------------------------
28-
29-
@import 'source/lib/_responsive.less';
30-
31-
@media-target: 'desktop'; // Sets target device for this file
32-
@media-common: false; // Sets not to output common styles
33-
3425
//
3526
// Global variables override
3627
// ---------------------------------------------
@@ -42,3 +33,12 @@
4233
// ---------------------------------------------
4334

4435
//@magento_import 'source/_extend.less';
36+
37+
//
38+
// Media queries collector
39+
// ---------------------------------------------
40+
41+
@import 'source/lib/_responsive.less';
42+
43+
@media-target: 'desktop'; // Sets target device for this file
44+
@media-common: false; // Sets not to output common styles

app/design/frontend/Magento/blank/web/css/styles-m.less

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,6 @@
2323
//@magento_import 'source/_module.less'; // Theme modules
2424
//@magento_import 'source/_widgets.less'; // Theme widgets
2525

26-
//
27-
// Media queries collector
28-
// ---------------------------------------------
29-
30-
@import 'source/lib/_responsive.less';
31-
32-
@media-target: 'mobile'; // Sets target device for this file
33-
3426
//
3527
// Global variables override
3628
// ---------------------------------------------
@@ -42,3 +34,11 @@
4234
// ---------------------------------------------
4335

4436
//@magento_import 'source/_extend.less';
37+
38+
//
39+
// Media queries collector
40+
// ---------------------------------------------
41+
42+
@import 'source/lib/_responsive.less';
43+
44+
@media-target: 'mobile'; // Sets target device for this file

dev/tests/integration/testsuite/Magento/Backend/Block/MenuTest.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ protected function setUp(): void
5959
*/
6060
public function testRenderNavigation()
6161
{
62-
$menuHtml = $this->blockMenu->renderNavigation($this->menuConfig->getMenu());
62+
$menuHtml = $this->blockMenu->renderNavigation($this->menuConfig->getMenu(), 0, 12);
6363
$menu = new \SimpleXMLElement($menuHtml);
6464

6565
$item = $menu->xpath('/ul/li/a/span')[0];
@@ -74,12 +74,17 @@ public function testRenderNavigation()
7474
'Invited Customers',
7575
];
7676
foreach ($menu->xpath('/ul//ul//ul/li/a/span') as $sortOrder => $item) {
77+
if ($sortOrder>2) {
78+
break;
79+
}
7780
$this->assertEquals(
7881
$liTitles[$sortOrder],
7982
(string)$item,
8083
'"' . $liTitles[$sortOrder] . '" item is absent or located on wrong menu level.'
8184
);
8285
}
86+
// test column break if submenu contain more than 12 node
87+
$this->assertStringContainsString('<li class="column">', $menuHtml);
8388
}
8489

8590
/**

dev/tests/integration/testsuite/Magento/Backend/Block/_files/menu/Magento/Backend/etc/adminhtml/menu.xml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,41 @@
1313
<add id="Magento_Backend::system_report_magento_invite_general" title="Invite" module="Magento_Backend" sortOrder="20" parent="Magento_Backend::system_report" resource="Magento_Backend::report_magento_invite_general"/>
1414
<add id="Magento_Backend::system_report_private_sales" title="Private Sales" module="Magento_Backend" sortOrder="10" parent="Magento_Backend::system_report" resource="Magento_Backend::report_private_sales" />
1515
<add id="Magento_Backend::system_report_magento_invite_customer" title="Invited Customers" module="Magento_Backend" sortOrder="30" parent="Magento_Backend::system_report" resource="Magento_Backend::report_magento_invite_customer"/>
16+
<add id="Magento_Cms::test1" title="Test 1"
17+
translate="title" module="Magento_Cms" sortOrder="100"
18+
action="test/test/test"
19+
parent="Magento_Backend::system" resource="Magento_Cms::page"/>
20+
<add id="Magento_Cms::test2" title="Test 2"
21+
translate="title" module="Magento_Cms" sortOrder="100"
22+
action="test/test/test"
23+
parent="Magento_Backend::system" resource="Magento_Cms::page"/>
24+
<add id="Magento_Cms::test3" title="Test 3"
25+
translate="title" module="Magento_Cms" sortOrder="100"
26+
action="test/test/test"
27+
parent="Magento_Backend::system" resource="Magento_Cms::page"/>
28+
<add id="Magento_Cms::test4" title="Test 4"
29+
translate="title" module="Magento_Cms" sortOrder="100"
30+
action="test/test/test"
31+
parent="Magento_Backend::system" resource="Magento_Cms::page"/>
32+
<add id="Magento_Cms::test5" title="Test 5"
33+
translate="title" module="Magento_Cms" sortOrder="100"
34+
action="test/test/test"
35+
parent="Magento_Backend::system" resource="Magento_Cms::page"/>
36+
<add id="Magento_Cms::test6" title="Test 6"
37+
translate="title" module="Magento_Cms" sortOrder="100"
38+
action="test/test/test"
39+
parent="Magento_Backend::system" resource="Magento_Cms::page"/>
40+
<add id="Magento_Cms::test7" title="Test 7"
41+
translate="title" module="Magento_Cms" sortOrder="100"
42+
action="test/test/test"
43+
parent="Magento_Backend::system" resource="Magento_Cms::page"/>
44+
<add id="Magento_Cms::test8" title="Test 8"
45+
translate="title" module="Magento_Cms" sortOrder="100"
46+
action="test/test/test"
47+
parent="Magento_Backend::system" resource="Magento_Cms::page"/>
48+
<add id="Magento_Cms::test9" title="Test 9"
49+
translate="title" module="Magento_Cms" sortOrder="100"
50+
action="test/test/test"
51+
parent="Magento_Backend::system" resource="Magento_Cms::page"/>
1652
</menu>
1753
</config>

0 commit comments

Comments
 (0)