Skip to content

Commit cb0a0c4

Browse files
Merge branch 'MAGETWO-50460' of https://github.corp.magento.com/magento-tango/magento2ce into MAGETWO-51470
2 parents 1252ea3 + b1cf094 commit cb0a0c4

File tree

2 files changed

+24
-17
lines changed

2 files changed

+24
-17
lines changed

app/code/Magento/Bundle/Ui/DataProvider/Product/Form/Modifier/BundlePanel.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,8 @@ protected function getOptionInfo()
458458
'component' => 'Magento_Bundle/js/components/bundle-input-type',
459459
'parentContainer' => 'product_bundle_container',
460460
'selections' => 'bundle_selections',
461-
'targetIndex' => 'is_default',
461+
'isDefaultIndex' => 'is_default',
462+
'userDefinedIndex' => 'selection_can_change_qty',
462463
'dataScope' => 'type',
463464
'label' => __('Input Type'),
464465
'sortOrder' => 20,

app/code/Magento/Bundle/view/adminhtml/web/js/components/bundle-input-type.js

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -26,36 +26,42 @@ define([
2626

2727
if (type !== this.previousType) {
2828
this.previousType = type;
29-
30-
if (type === 'radio') {
31-
this.clearValues();
32-
}
29+
this.processSelections(type === 'radio');
3330
}
3431

3532
this._super();
3633
},
3734

3835
/**
39-
* Clears values in components like this.
36+
* Toggle 'User Defined' column and clears values
37+
* @param {Boolean} isRadio
4038
*/
41-
clearValues: function () {
39+
processSelections: function (isRadio) {
4240
var records = registry.get(this.retrieveParentName(this.parentContainer) + '.' + this.selections),
4341
checkedFound = false;
4442

4543
records.elems.each(function (record) {
4644
record.elems.filter(function (comp) {
47-
return comp.index === this.targetIndex;
45+
return comp.index === this.userDefinedIndex;
4846
}, this).each(function (comp) {
49-
if (comp.checked()) {
50-
if (checkedFound) {
51-
comp.clearing = true;
52-
comp.clear();
53-
comp.clearing = false;
54-
}
55-
56-
checkedFound = true;
57-
}
47+
comp.visible(isRadio);
5848
});
49+
50+
if (isRadio) {
51+
record.elems.filter(function (comp) {
52+
return comp.index === this.isDefaultIndex;
53+
}, this).each(function (comp) {
54+
if (comp.checked()) {
55+
if (checkedFound) {
56+
comp.clearing = true;
57+
comp.clear();
58+
comp.clearing = false;
59+
}
60+
61+
checkedFound = true;
62+
}
63+
});
64+
}
5965
}, this);
6066
},
6167

0 commit comments

Comments
 (0)