Skip to content
This repository was archived by the owner on Apr 29, 2019. It is now read-only.

Commit 714d31c

Browse files
🔃 [EngCom] Public Pull Requests - 2.2-develop
Accepted Public Pull Requests: - magento/magento2#15262: Fix \Magento\Customer\Model\Customer\NotificationStorage class (by @adrian-martinez-interactiv4) - magento/magento2#15249: Removed non-existing argument (by @yogeshks) - magento/magento2#15194: Move buttons definition to separate file (by @jissereitsma) - magento/magento2#14994: Prevent not category links in breadcrumbs at product page (by @vovayatsyuk)
2 parents 48d9e3f + d41ce33 commit 714d31c

File tree

9 files changed

+46
-34
lines changed

9 files changed

+46
-34
lines changed

app/code/Magento/Catalog/Plugin/Block/Topmenu.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ private function getCategoryAsArray($category, $currentCategory, $isParentActive
162162
'url' => $this->catalogCategory->getCategoryUrl($category),
163163
'has_active' => in_array((string)$category->getId(), explode('/', $currentCategory->getPath()), true),
164164
'is_active' => $category->getId() == $currentCategory->getId(),
165+
'is_category' => true,
165166
'is_parent_active' => $isParentActive
166167
];
167168
}

app/code/Magento/Catalog/view/frontend/web/js/product/breadcrumbs.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ define([
1616
categoryUrlSuffix: '',
1717
useCategoryPathInUrl: false,
1818
product: '',
19+
categoryItemSelector: '.category-item',
1920
menuContainer: '[data-action="navigation"] > ul'
2021
},
2122

@@ -142,7 +143,10 @@ define([
142143
categoryMenuItem = null;
143144

144145
if (categoryUrl && menu.length) {
145-
categoryMenuItem = menu.find('a[href="' + categoryUrl + '"]');
146+
categoryMenuItem = menu.find(
147+
this.options.categoryItemSelector +
148+
' > a[href="' + categoryUrl + '"]'
149+
);
146150
}
147151

148152
return categoryMenuItem;

app/code/Magento/Customer/Model/Customer/NotificationStorage.php

Lines changed: 9 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
*/
66
namespace Magento\Customer\Model\Customer;
77

8+
use Magento\Framework\App\ObjectManager;
89
use Magento\Framework\Cache\FrontendInterface;
910
use Magento\Framework\Serialize\SerializerInterface;
1011

@@ -18,21 +19,21 @@ class NotificationStorage
1819
private $cache;
1920

2021
/**
21-
* @param FrontendInterface $cache
22-
*/
23-
24-
/**
25-
* @param FrontendInterface $cache
22+
* @var SerializerInterface
2623
*/
2724
private $serializer;
2825

2926
/**
3027
* NotificationStorage constructor.
3128
* @param FrontendInterface $cache
29+
* @param SerializerInterface $serializer
3230
*/
33-
public function __construct(FrontendInterface $cache)
34-
{
31+
public function __construct(
32+
FrontendInterface $cache,
33+
SerializerInterface $serializer = null
34+
) {
3535
$this->cache = $cache;
36+
$this->serializer = $serializer ?: ObjectManager::getInstance()->get(SerializerInterface::class);
3637
}
3738

3839
/**
@@ -45,7 +46,7 @@ public function __construct(FrontendInterface $cache)
4546
public function add($notificationType, $customerId)
4647
{
4748
$this->cache->save(
48-
$this->getSerializer()->serialize([
49+
$this->serializer->serialize([
4950
'customer_id' => $customerId,
5051
'notification_type' => $notificationType
5152
]),
@@ -88,19 +89,4 @@ private function getCacheKey($notificationType, $customerId)
8889
{
8990
return 'notification_' . $notificationType . '_' . $customerId;
9091
}
91-
92-
/**
93-
* Get serializer
94-
*
95-
* @return SerializerInterface
96-
* @deprecated 100.2.0
97-
*/
98-
private function getSerializer()
99-
{
100-
if ($this->serializer === null) {
101-
$this->serializer = \Magento\Framework\App\ObjectManager::getInstance()
102-
->get(SerializerInterface::class);
103-
}
104-
return $this->serializer;
105-
}
10692
}

app/code/Magento/Theme/Block/Html/Topmenu.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,10 @@ protected function _getMenuItemClasses(\Magento\Framework\Data\Tree\Node $item)
309309
$classes[] = 'level' . $item->getLevel();
310310
$classes[] = $item->getPositionClass();
311311

312+
if ($item->getIsCategory()) {
313+
$classes[] = 'category-item';
314+
}
315+
312316
if ($item->getIsFirst()) {
313317
$classes[] = 'first';
314318
}

app/code/Magento/Translation/Block/Html/Head/Config.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ class Config extends \Magento\Framework\View\Element\AbstractBlock
3434

3535
/**
3636
* @param \Magento\Framework\View\Element\Context $context
37-
* @param RequireJsConfig $config
3837
* @param \Magento\Framework\View\Page\Config $pageConfig
3938
* @param \Magento\Translation\Model\FileManager $fileManager
4039
* @param Inline $inline

app/code/Magento/Translation/Model/Json/PreProcessor.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ class PreProcessor implements PreProcessorInterface
4444
* @var TranslateInterface
4545
*/
4646
protected $translate;
47+
4748
/**
4849
* @var DesignInterface
4950
*/

app/code/Magento/Ui/view/base/web/js/form/adapter.js

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,12 @@
88
*/
99
define([
1010
'jquery',
11-
'underscore'
12-
], function ($, _) {
11+
'underscore',
12+
'Magento_Ui/js/form/adapter/buttons'
13+
], function ($, _, buttons) {
1314
'use strict';
1415

15-
var buttons = {
16-
'reset': '#reset',
17-
'save': '#save',
18-
'saveAndContinue': '#save_and_continue'
19-
},
20-
selectorPrefix = '',
16+
var selectorPrefix = '',
2117
eventPrefix;
2218

2319
/**
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/**
2+
* Copyright © Magento, Inc. All rights reserved.
3+
* See COPYING.txt for license details.
4+
*/
5+
6+
/**
7+
* @api
8+
*/
9+
define(function () {
10+
'use strict';
11+
12+
return {
13+
'reset': '#reset',
14+
'save': '#save',
15+
'saveAndContinue': '#save_and_continue'
16+
};
17+
});

dev/tests/js/jasmine/tests/app/code/Magento/Catalog/frontend/js/product/breadcrumbs.test.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,11 @@ define([
1919
},
2020
defaultContext = require.s.contexts._,
2121
menuSelector = '[data-action="navigation"] > ul',
22-
menuItem = $('<li class="level0"><a href="http://localhost.com/cat1.html">Cat1</a></li>')[0],
22+
menuItem = $(
23+
'<li class="level0 category-item">' +
24+
'<a href="http://localhost.com/cat1.html" id="ui-id-3">Cat1</a>' +
25+
'</li>'
26+
)[0],
2327

2428
/**
2529
* Create context object.

0 commit comments

Comments
 (0)