Skip to content

Commit 4663042

Browse files
committed
Merge remote-tracking branch 'main/develop' into MAGETWO-44603
2 parents 86d92ab + b2f0ef0 commit 4663042

File tree

108 files changed

+1892
-1071
lines changed

Some content is hidden

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

108 files changed

+1892
-1071
lines changed

.htaccess

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,13 @@
129129

130130
</IfModule>
131131

132+
############################################
133+
## workaround for Apache 2.4.6 CentOS build when working via ProxyPassMatch with HHVM (or any other)
134+
## Please, set it on virtual host configuration level
135+
136+
## SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1
137+
############################################
138+
132139
<IfModule mod_rewrite.c>
133140

134141
############################################

app/code/Magento/Backend/view/adminhtml/layout/default.xml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,6 @@
6767
</container>
6868
</container>
6969
</referenceContainer>
70-
<referenceContainer name="backend.page">
71-
<block class="Magento\Framework\View\Element\Template" name="page.loader" template="Magento_Backend::admin/loader.phtml" after="-"/>
72-
</referenceContainer>
7370
<referenceContainer name="after.body.start">
7471
<block class="Magento\RequireJs\Block\Html\Head\Config" name="requirejs-config"/>
7572
<block class="Magento\Translation\Block\Html\Head\Config" name="translate-config"/>

app/code/Magento/Bundle/view/adminhtml/web/css/bundle-product.css

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,17 +49,13 @@
4949
.field-sku .control .sku {
5050
display: inline-block;
5151
width: 140px;
52-
margin-right: 15px;
52+
margin-right: 11px;
5353
}
5454

5555
.field-sku .control .sku > input[type='text'] {
5656
width: 100%;
5757
}
5858

59-
.field-sku .control .sku + .select {
60-
vertical-align: middle;
61-
}
62-
6359
.field-price .addon > .price {
6460
display: table;
6561
direction: rtl;
@@ -73,7 +69,6 @@
7369
}
7470

7571
.field-price .addon > .price + .select {
76-
width: 96px;
7772
float: left;
7873
}
7974

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/**
2+
* Copyright © 2015 Magento. All rights reserved.
3+
* See COPYING.txt for license details.
4+
*/
5+
/*jshint browser:true jquery:true expr:true*/
6+
define([
7+
'jquery',
8+
'Magento_Catalog/catalog/type-events',
9+
'Magento_Catalog/js/product/weight-handler'
10+
], function ($, productType, weight) {
11+
'use strict';
12+
13+
return {
14+
15+
/**
16+
* Constructor component
17+
*/
18+
'Magento_Bundle/js/bundle-type-handler': function () {
19+
this.bindAll();
20+
this._initType();
21+
},
22+
23+
/**
24+
* Bind all
25+
*/
26+
bindAll: function () {
27+
$(document).on('changeTypeProduct', this._initType.bind(this));
28+
},
29+
30+
/**
31+
* Init type
32+
* @private
33+
*/
34+
_initType: function () {
35+
if (
36+
productType.type.real === 'bundle' &&
37+
productType.type.current !== 'bundle' &&
38+
!weight.isLocked()
39+
) {
40+
weight.switchWeight();
41+
}
42+
}
43+
};
44+
});

app/code/Magento/Catalog/Block/Adminhtml/Product/Edit.php

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -301,25 +301,6 @@ public function getAttributesAllowedForAutogeneration()
301301
return $this->_productHelper->getAttributesAllowedForAutogeneration();
302302
}
303303

304-
/**
305-
* Get data for JS (product type transition)
306-
*
307-
* @return string
308-
*/
309-
public function getTypeSwitcherData()
310-
{
311-
return $this->jsonEncoder->encode(
312-
[
313-
'tab_id' => 'product_info_tabs_downloadable_items',
314-
'weight_switcher' => '[data-role=weight-switcher]',
315-
'product_has_weight_flag' => \Magento\Catalog\Model\Product\Edit\WeightResolver::HAS_WEIGHT,
316-
'weight_id' => 'weight',
317-
'current_type' => $this->getProduct()->getTypeId(),
318-
'attributes' => $this->_getAttributes(),
319-
]
320-
);
321-
}
322-
323304
/**
324305
* Get formed array with attribute codes and Apply To property
325306
*

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

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

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

app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/edit.phtml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,14 @@
6161
<script>
6262
require([
6363
"jquery",
64-
"Magento_Catalog/catalog/type-switcher",
64+
"Magento_Catalog/catalog/type-events",
6565
"underscore",
6666
"mage/mage",
6767
"mage/backend/tabs",
6868
"domReady!"
6969
], function($, TypeSwitcher){
7070
var $form = $('[data-form=edit-product]');
71-
$form.data('typeSwitcher', new TypeSwitcher(<?php /* @escapeNotVerified */ echo $block->getTypeSwitcherData();?>).bindAll());
71+
$form.data('typeSwitcher', TypeSwitcher.init());
7272

7373
var scriptTagManager = (function($) {
7474
var hiddenPrefix = 'hidden',
@@ -407,3 +407,11 @@ require([
407407
});
408408
});
409409
</script>
410+
<script type="text/x-magento-init">
411+
{
412+
"*": {
413+
"Magento_Catalog/js/product/weight-handler": {},
414+
"Magento_Catalog/catalog/apply-to-type-switcher": {}
415+
}
416+
}
417+
</script>
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
/**
2+
* Copyright © 2015 Magento. All rights reserved.
3+
* See COPYING.txt for license details.
4+
*/
5+
define([
6+
'jquery',
7+
'Magento_Catalog/js/product/weight-handler',
8+
'Magento_Catalog/catalog/type-events'
9+
], function ($, weight, productType) {
10+
'use strict';
11+
12+
return {
13+
14+
/**
15+
* Bind event
16+
*/
17+
bindAll: function () {
18+
$('[data-form=edit-product] [data-role=tabs]').on(
19+
'contentUpdated',
20+
this._switchToTypeByApplyAttr.bind(this)
21+
);
22+
23+
$('#product_info_tabs').on(
24+
'beforePanelsMove tabscreate tabsactivate',
25+
this._switchToTypeByApplyAttr.bind(this)
26+
);
27+
28+
$(document).on('changeTypeProduct', this._switchToTypeByApplyAttr.bind(this));
29+
},
30+
31+
/**
32+
* Constructor component
33+
*/
34+
'Magento_Catalog/catalog/apply-to-type-switcher': function () {
35+
this.bindAll();
36+
this._switchToTypeByApplyAttr();
37+
},
38+
39+
/**
40+
* Show/hide elements based on type
41+
*
42+
* @private
43+
*/
44+
_switchToTypeByApplyAttr: function () {
45+
$('[data-apply-to]:not(.removed)').each(function (index, element) {
46+
var attrContainer = $(element),
47+
applyTo = attrContainer.data('applyTo') || [],
48+
$inputs = attrContainer.find('select, input, textarea');
49+
50+
if (applyTo.length === 0 || $.inArray(productType.type.current, applyTo) !== -1) {
51+
attrContainer.removeClass('not-applicable-attribute');
52+
$inputs.removeClass('ignore-validate');
53+
} else {
54+
attrContainer.addClass('not-applicable-attribute');
55+
$inputs.addClass('ignore-validate');
56+
}
57+
});
58+
}
59+
};
60+
});
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
/**
2+
* Copyright © 2015 Magento. All rights reserved.
3+
* See COPYING.txt for license details.
4+
*/
5+
define([
6+
'jquery',
7+
'Magento_Catalog/js/product/weight-handler'
8+
], function ($, weight) {
9+
'use strict';
10+
11+
return {
12+
$type: $('#product_type_id'),
13+
14+
/**
15+
* Init
16+
*/
17+
init: function () {
18+
19+
if (weight.productHasWeight()) {
20+
this.type = {
21+
virtual: 'virtual',
22+
real: this.$type.val() //simple, configurable
23+
};
24+
} else {
25+
this.type = {
26+
virtual: this.$type.val(), //downloadable, virtual, grouped, bundle
27+
real: 'simple'
28+
};
29+
}
30+
this.type.current = this.$type.val();
31+
32+
this.bindAll();
33+
},
34+
35+
/**
36+
* Bind all
37+
*/
38+
bindAll: function () {
39+
$(document).on('setTypeProduct', function (event, type) {
40+
this.setType(type);
41+
}.bind(this));
42+
43+
//direct change type input
44+
this.$type.on('change', function () {
45+
this.type.current = this.$type.val();
46+
this._notifyType();
47+
}.bind(this));
48+
},
49+
50+
/**
51+
* Set type
52+
* @param {String} type - type product (downloadable, simple, virtual ...)
53+
* @returns {*}
54+
*/
55+
setType: function (type) {
56+
return this.$type.val(type || this.type.real).trigger('change');
57+
},
58+
59+
/**
60+
* Notify type
61+
* @private
62+
*/
63+
_notifyType: function () {
64+
$(document).trigger('changeTypeProduct', this.type);
65+
}
66+
};
67+
});

0 commit comments

Comments
 (0)