Skip to content

Commit b8964bb

Browse files
author
Oleg Zinoviev
committed
MAGETWO-34520: [UI] Updates messaging styles.
- Merge branch 'UI' into admin-styles-migration Conflicts: setup/pub/styles/setup.css
2 parents 34a5e47 + 670849f commit b8964bb

File tree

96 files changed

+2528
-1527
lines changed

Some content is hidden

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

96 files changed

+2528
-1527
lines changed

app/code/Magento/Backup/Controller/Adminhtml/Index/Grid.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class Grid extends \Magento\Backup\Controller\Adminhtml\Index
1515
*/
1616
public function execute()
1717
{
18-
$this->renderLayot(false);
18+
$this->_view->loadLayout();
1919
$this->_view->renderLayout();
2020
}
2121
}

app/code/Magento/Catalog/Model/Layer/Filter/Price/Range.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ class Range
2525
private $scopeConfig;
2626

2727
/**
28-
* @var \Magento\Catalog\Model\Layer
28+
* @var Resolver
2929
*/
30-
private $layer;
30+
private $layerResolver;
3131

3232
/**
3333
* @param Registry $registry
@@ -39,15 +39,16 @@ public function __construct(Registry $registry, ScopeConfigInterface $scopeConfi
3939
{
4040
$this->registry = $registry;
4141
$this->scopeConfig = $scopeConfig;
42-
$this->layer = $layerResolver->get();
42+
$this->layerResolver = $layerResolver;
4343
}
4444

4545
/**
4646
* @return array
4747
*/
4848
public function getPriceRange()
4949
{
50-
$currentCategory = $this->registry->registry('current_category_filter') ?: $this->layer->getCurrentCategory();
50+
$currentCategory = $this->registry->registry('current_category_filter')
51+
?: $this->layerResolver->get()->getCurrentCategory();
5152

5253
return $currentCategory->getFilterPriceRange();
5354
}

app/code/Magento/Catalog/Model/Layout/DepersonalizePlugin.php

Lines changed: 9 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,17 @@
77
*/
88
namespace Magento\Catalog\Model\Layout;
99

10+
use Magento\PageCache\Model\DepersonalizeChecker;
11+
1012
/**
1113
* Class DepersonalizePlugin
1214
*/
1315
class DepersonalizePlugin
1416
{
1517
/**
16-
* @var \Magento\Framework\App\RequestInterface
17-
*/
18-
protected $request;
19-
20-
/**
21-
* @var \Magento\Framework\Module\Manager
22-
*/
23-
protected $moduleManager;
24-
25-
/**
26-
* @var \Magento\PageCache\Model\Config
18+
* @var DepersonalizeChecker
2719
*/
28-
protected $cacheConfig;
20+
protected $depersonalizeChecker;
2921

3022
/**
3123
* Catalog session
@@ -35,21 +27,15 @@ class DepersonalizePlugin
3527
protected $catalogSession;
3628

3729
/**
30+
* @param DepersonalizeChecker $depersonalizeChecker
3831
* @param \Magento\Catalog\Model\Session $catalogSession
39-
* @param \Magento\Framework\App\RequestInterface $request
40-
* @param \Magento\Framework\Module\Manager $moduleManager
41-
* @param \Magento\PageCache\Model\Config $cacheConfig
4232
*/
4333
public function __construct(
44-
\Magento\Catalog\Model\Session $catalogSession,
45-
\Magento\Framework\Module\Manager $moduleManager,
46-
\Magento\Framework\App\RequestInterface $request,
47-
\Magento\PageCache\Model\Config $cacheConfig
34+
DepersonalizeChecker $depersonalizeChecker,
35+
\Magento\Catalog\Model\Session $catalogSession
4836
) {
4937
$this->catalogSession = $catalogSession;
50-
$this->request = $request;
51-
$this->moduleManager = $moduleManager;
52-
$this->cacheConfig = $cacheConfig;
38+
$this->depersonalizeChecker = $depersonalizeChecker;
5339
}
5440

5541
/**
@@ -61,11 +47,7 @@ public function __construct(
6147
*/
6248
public function afterGenerateXml(\Magento\Framework\View\LayoutInterface $subject, $result)
6349
{
64-
if ($this->moduleManager->isEnabled('Magento_PageCache')
65-
&& $this->cacheConfig->isEnabled()
66-
&& !$this->request->isAjax()
67-
&& $subject->isCacheable()
68-
) {
50+
if ($this->depersonalizeChecker->checkIfDepersonalize($subject)) {
6951
$this->catalogSession->clearStorage();
7052
}
7153
return $result;

app/code/Magento/CatalogSearch/Model/Adapter/Mysql/Dynamic/DataProvider.php

Lines changed: 2 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,19 @@
77

88
use Magento\Catalog\Model\Layer\Filter\Price\Range;
99
use Magento\Customer\Model\Session;
10-
use Magento\Framework\App\Config\ScopeConfigInterface;
1110
use Magento\Framework\App\Resource;
1211
use Magento\Framework\DB\Adapter\AdapterInterface;
1312
use Magento\Framework\DB\Select;
1413
use Magento\Framework\Search\Adapter\Mysql\Aggregation\DataProviderInterface as MysqlDataProviderInterface;
1514
use Magento\Framework\Search\Dynamic\DataProviderInterface;
1615
use Magento\Framework\Search\Dynamic\IntervalFactory;
1716
use Magento\Framework\Search\Request\BucketInterface;
18-
use Magento\Store\Model\ScopeInterface;
1917

2018
/**
2119
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
2220
*/
2321
class DataProvider implements DataProviderInterface
2422
{
25-
const XML_PATH_INTERVAL_DIVISION_LIMIT = 'catalog/layered_navigation/interval_division_limit';
26-
const XML_PATH_RANGE_STEP = 'catalog/layered_navigation/price_range_step';
27-
const XML_PATH_RANGE_MAX_INTERVALS = 'catalog/layered_navigation/price_range_max_intervals';
28-
2923
/**
3024
* @var Resource
3125
*/
@@ -36,11 +30,6 @@ class DataProvider implements DataProviderInterface
3630
*/
3731
private $range;
3832

39-
/**
40-
* @var ScopeConfigInterface
41-
*/
42-
private $scopeConfig;
43-
4433
/**
4534
* @var Session
4635
*/
@@ -58,23 +47,20 @@ class DataProvider implements DataProviderInterface
5847

5948
/**
6049
* @param Resource $resource
61-
* @param ScopeConfigInterface $scopeConfig
6250
* @param Range $range
6351
* @param Session $customerSession
6452
* @param MysqlDataProviderInterface $dataProvider
6553
* @param IntervalFactory $intervalFactory
6654
*/
6755
public function __construct(
6856
Resource $resource,
69-
ScopeConfigInterface $scopeConfig,
7057
Range $range,
7158
Session $customerSession,
7259
MysqlDataProviderInterface $dataProvider,
7360
IntervalFactory $intervalFactory
7461
) {
7562
$this->resource = $resource;
7663
$this->range = $range;
77-
$this->scopeConfig = $scopeConfig;
7864
$this->customerSession = $customerSession;
7965
$this->dataProvider = $dataProvider;
8066
$this->intervalFactory = $intervalFactory;
@@ -97,7 +83,7 @@ public function getAggregations(array $entityIds)
9783
'count' => 'count(DISTINCT entity_id)',
9884
'max' => 'MAX(min_price)',
9985
'min' => 'MIN(min_price)',
100-
'std' => 'STDDEV_SAMP(min_price)',
86+
'std' => 'STDDEV_SAMP(min_price)'
10187
];
10288

10389
$select = $this->getSelect();
@@ -115,28 +101,6 @@ public function getAggregations(array $entityIds)
115101
return $result;
116102
}
117103

118-
/**
119-
* {@inheritdoc}
120-
*/
121-
public function getOptions()
122-
{
123-
return [
124-
'interval_division_limit' => (int)$this->scopeConfig->getValue(
125-
self::XML_PATH_INTERVAL_DIVISION_LIMIT,
126-
ScopeInterface::SCOPE_STORE
127-
),
128-
'range_step' => (double)$this->scopeConfig->getValue(
129-
self::XML_PATH_RANGE_STEP,
130-
ScopeInterface::SCOPE_STORE
131-
),
132-
'min_range_power' => 10,
133-
'max_intervals_number' => (int)$this->scopeConfig->getValue(
134-
self::XML_PATH_RANGE_MAX_INTERVALS,
135-
ScopeInterface::SCOPE_STORE
136-
)
137-
];
138-
}
139-
140104
/**
141105
* {@inheritdoc}
142106
*/
@@ -190,7 +154,7 @@ public function prepareData($range, array $dbRanges)
190154
$data[] = [
191155
'from' => $fromPrice,
192156
'to' => $toPrice,
193-
'count' => $count,
157+
'count' => $count
194158
];
195159
}
196160
}
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<?php
2+
/**
3+
* Copyright © 2015 Magento. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
namespace Magento\CatalogSearch\Model\Adapter;
7+
8+
use Magento\Framework\App\Config\ScopeConfigInterface;
9+
use Magento\Framework\Search\Adapter\OptionsInterface;
10+
use Magento\Store\Model\ScopeInterface;
11+
12+
class Options implements OptionsInterface
13+
{
14+
const XML_PATH_INTERVAL_DIVISION_LIMIT = 'catalog/layered_navigation/interval_division_limit';
15+
const XML_PATH_RANGE_STEP = 'catalog/layered_navigation/price_range_step';
16+
const XML_PATH_RANGE_MAX_INTERVALS = 'catalog/layered_navigation/price_range_max_intervals';
17+
18+
/**
19+
* @var ScopeConfigInterface
20+
*/
21+
private $scopeConfig;
22+
23+
/**
24+
* @param ScopeConfigInterface $scopeConfig
25+
*/
26+
public function __construct(ScopeConfigInterface $scopeConfig)
27+
{
28+
$this->scopeConfig = $scopeConfig;
29+
}
30+
31+
/**
32+
* {@inheritdoc}
33+
*/
34+
public function get()
35+
{
36+
return [
37+
'interval_division_limit' => (int)$this->scopeConfig->getValue(
38+
self::XML_PATH_INTERVAL_DIVISION_LIMIT,
39+
ScopeInterface::SCOPE_STORE
40+
),
41+
'range_step' => (double)$this->scopeConfig->getValue(
42+
self::XML_PATH_RANGE_STEP,
43+
ScopeInterface::SCOPE_STORE
44+
),
45+
'min_range_power' => 10,
46+
'max_intervals_number' => (int)$this->scopeConfig->getValue(
47+
self::XML_PATH_RANGE_MAX_INTERVALS,
48+
ScopeInterface::SCOPE_STORE
49+
)
50+
];
51+
}
52+
}
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
<?php
2+
/**
3+
* Copyright © 2015 Magento. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
namespace Magento\CatalogSearch\Model\Adminhtml\System\Config\Backend;
7+
8+
/**
9+
* @author Magento Core Team <core@magentocommerce.com>
10+
*/
11+
class Engine extends \Magento\Framework\App\Config\Value
12+
{
13+
/** @var \Magento\Indexer\Model\IndexerRegistry */
14+
protected $indexerRegistry;
15+
16+
/**
17+
* @param \Magento\Framework\Model\Context $context
18+
* @param \Magento\Framework\Registry $registry
19+
* @param \Magento\Framework\App\Config\ScopeConfigInterface $config
20+
* @param \Magento\Indexer\Model\IndexerRegistry $indexerRegistry
21+
* @param \Magento\Framework\Model\Resource\AbstractResource $resource
22+
* @param \Magento\Framework\Data\Collection\Db $resourceCollection
23+
* @param array $data
24+
*/
25+
public function __construct(
26+
\Magento\Framework\Model\Context $context,
27+
\Magento\Framework\Registry $registry,
28+
\Magento\Framework\App\Config\ScopeConfigInterface $config,
29+
\Magento\Indexer\Model\IndexerRegistry $indexerRegistry,
30+
\Magento\Framework\Model\Resource\AbstractResource $resource = null,
31+
\Magento\Framework\Data\Collection\Db $resourceCollection = null,
32+
array $data = []
33+
) {
34+
$this->indexerRegistry = $indexerRegistry;
35+
parent::__construct($context, $registry, $config, $resource, $resourceCollection, $data);
36+
}
37+
38+
/**
39+
* After save call
40+
* Invalidate catalog search index if engine was changed
41+
*
42+
* @return $this
43+
*/
44+
public function afterSave()
45+
{
46+
parent::afterSave();
47+
48+
if ($this->isValueChanged()) {
49+
$this->indexerRegistry->get(\Magento\CatalogSearch\Model\Indexer\Fulltext::INDEXER_ID)->invalidate();
50+
}
51+
return $this;
52+
}
53+
}

0 commit comments

Comments
 (0)