Skip to content

Commit 44deef8

Browse files
author
Yaroslav Onischenko
committed
Merge remote-tracking branch 'mainline/develop' into develop
2 parents 6e12c33 + 108f621 commit 44deef8

File tree

34 files changed

+361
-110
lines changed

34 files changed

+361
-110
lines changed
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<?php
2+
/**
3+
* Copyright © 2015 Magento. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
namespace Magento\Bundle\Block\Adminhtml\Order\Create;
7+
8+
class Sidebar
9+
{
10+
/**
11+
* Get item qty
12+
*
13+
* @param \Magento\Sales\Block\Adminhtml\Order\Create\Sidebar\AbstractSidebar $subject
14+
* @param callable $proceed
15+
* @param \Magento\Framework\DataObject $item
16+
*
17+
* @return string
18+
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
19+
*/
20+
public function aroundGetItemQty(
21+
\Magento\Sales\Block\Adminhtml\Order\Create\Sidebar\AbstractSidebar $subject,
22+
\Closure $proceed,
23+
\Magento\Framework\DataObject $item
24+
) {
25+
if ($item->getProduct()->getTypeId() == \Magento\Bundle\Model\Product\Type::TYPE_CODE) {
26+
return '';
27+
}
28+
return $proceed($item);
29+
}
30+
31+
/**
32+
* Check whether product configuration is required before adding to order
33+
*
34+
* @param \Magento\Sales\Block\Adminhtml\Order\Create\Sidebar\AbstractSidebar $subject
35+
* @param callable $proceed
36+
* @param string $productType
37+
*
38+
* @return bool
39+
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
40+
*/
41+
public function aroundIsConfigurationRequired(
42+
\Magento\Sales\Block\Adminhtml\Order\Create\Sidebar\AbstractSidebar $subject,
43+
\Closure $proceed,
44+
$productType
45+
) {
46+
if ($productType == \Magento\Bundle\Model\Product\Type::TYPE_CODE) {
47+
return true;
48+
}
49+
return $proceed($productType);
50+
}
51+
}

app/code/Magento/Bundle/Model/Product/Type.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@
1919
*/
2020
class Type extends \Magento\Catalog\Model\Product\Type\AbstractType
2121
{
22+
/**
23+
* Product type
24+
*/
25+
const TYPE_CODE = 'bundle';
26+
2227
/**
2328
* Product is composite
2429
*

app/code/Magento/Bundle/etc/adminhtml/di.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
<type name="Magento\Catalog\Controller\Adminhtml\Product\Initialization\Helper">
1010
<plugin name="Bundle" type="Magento\Bundle\Controller\Adminhtml\Product\Initialization\Helper\Plugin\Bundle" sortOrder="60" />
1111
</type>
12+
<type name="Magento\Sales\Block\Adminhtml\Order\Create\Sidebar\AbstractSidebar">
13+
<plugin name="Bundle" type="Magento\Bundle\Block\Adminhtml\Order\Create\Sidebar" sortOrder="200"/>
14+
</type>
1215
<type name="Magento\Catalog\Model\Product\CopyConstructor\Composite">
1316
<arguments>
1417
<argument name="constructors" xsi:type="array">

app/code/Magento/Catalog/Ui/Component/ColumnFactory.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ public function create($attribute, $context, array $config = [])
5555
'dataType' => $this->getDataType($attribute),
5656
'add_field' => true,
5757
'visible' => $attribute->getIsVisibleInGrid(),
58+
'filter' => ($attribute->getIsFilterableInGrid())
59+
? $this->getFilterType($attribute->getFrontendInput())
60+
: null,
5861
], $config);
5962

6063
if ($attribute->usesSource()) {
@@ -92,4 +95,17 @@ protected function getDataType($attribute)
9295
? $this->dataTypeMap[$attribute->getFrontendInput()]
9396
: $this->dataTypeMap['default'];
9497
}
98+
99+
/**
100+
* Retrieve filter type by $frontendInput
101+
*
102+
* @param string $frontendInput
103+
* @return string
104+
*/
105+
protected function getFilterType($frontendInput)
106+
{
107+
$filtersMap = ['date' => 'dateRange'];
108+
$result = array_replace_recursive($this->dataTypeMap, $filtersMap);
109+
return isset($result[$frontendInput]) ? $result[$frontendInput] : $result['default'];
110+
}
95111
}

app/code/Magento/Catalog/view/adminhtml/templates/catalog/category/checkboxes/tree.phtml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@
1010

1111
<?php $_divId = 'tree-div_' . time() ?>
1212
<div id="<?php /* @escapeNotVerified */ echo $_divId ?>" class="tree"></div>
13-
<!--[if IE]>
1413
<script id="ie-deferred-loader" defer="defer" src=""></script>
15-
<![endif]-->
1614
<script>
1715
require([
1816
'jquery',

app/code/Magento/Catalog/view/adminhtml/templates/catalog/category/tree.phtml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,7 @@
3535
<div><?php /* @escapeNotVerified */ echo __('This operation can take a long time'); ?></div>
3636
</div>
3737
</div>
38-
<!--[if IE]>
3938
<script id="ie-deferred-loader" defer="defer" src=""></script>
40-
<![endif]-->
4139
<script>
4240
var tree;
4341
require([

app/code/Magento/Catalog/view/adminhtml/templates/catalog/category/widget/tree.phtml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,8 @@
1010

1111
<?php $_divId = 'tree' . $block->getId() ?>
1212
<div id="<?php /* @escapeNotVerified */ echo $_divId ?>" class="tree"></div>
13-
<!--[if IE]>
1413
<script id="ie-deferred-loader" defer="defer" src=""></script>
15-
<![endif]-->
14+
<![]-->
1615
<script>
1716
require(['jquery', "prototype", "extjs/ext-tree-checkbox"], function(jQuery){
1817

app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/attribute/set/main.phtml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,7 @@
3838
<span class="title"><?php /* @escapeNotVerified */ echo __('Unassigned Attributes') ?></span>
3939
</div>
4040
<div id="tree-div2" class="attribute-set-tree"></div>
41-
<!--[if IE]>
4241
<script id="ie-deferred-loader" defer="defer" src=""></script>
43-
<![endif]-->
4442
<script>
4543
define("tree-panel",
4644
[

app/code/Magento/Checkout/view/frontend/web/js/sidebar.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ define([
5353
actions: {
5454
confirm: function () {
5555
self._removeItem($(event.currentTarget));
56+
},
57+
always: function (event) {
58+
event.stopImmediatePropagation();
5659
}
5760
}
5861
});

app/code/Magento/Cms/view/adminhtml/ui_component/cms_block_listing.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,14 @@
8585
<item name="provider" xsi:type="string">cms_block_listing.cms_block_listing.listing_top.bookmarks</item>
8686
<item name="namespace" xsi:type="string">current.filters</item>
8787
</item>
88+
<item name="templates" xsi:type="array">
89+
<item name="filters" xsi:type="array">
90+
<item name="select" xsi:type="array">
91+
<item name="component" xsi:type="string">Magento_Ui/js/form/element/ui-select</item>
92+
<item name="template" xsi:type="string">ui/grid/filters/elements/ui-select</item>
93+
</item>
94+
</item>
95+
</item>
8896
<item name="childDefaults" xsi:type="array">
8997
<item name="provider" xsi:type="string">cms_block_listing.cms_block_listing.listing_top.listing_filters</item>
9098
<item name="imports" xsi:type="array">

0 commit comments

Comments
 (0)