File tree Expand file tree Collapse file tree 2 files changed +24
-17
lines changed
Ui/DataProvider/Product/Form/Modifier
view/adminhtml/web/js/components Expand file tree Collapse file tree 2 files changed +24
-17
lines changed Original file line number Diff line number Diff line change @@ -458,7 +458,8 @@ protected function getOptionInfo()
458
458
'component ' => 'Magento_Bundle/js/components/bundle-input-type ' ,
459
459
'parentContainer ' => 'product_bundle_container ' ,
460
460
'selections ' => 'bundle_selections ' ,
461
- 'targetIndex ' => 'is_default ' ,
461
+ 'isDefaultIndex ' => 'is_default ' ,
462
+ 'userDefinedIndex ' => 'selection_can_change_qty ' ,
462
463
'dataScope ' => 'type ' ,
463
464
'label ' => __ ('Input Type ' ),
464
465
'sortOrder ' => 20 ,
Original file line number Diff line number Diff line change @@ -26,36 +26,42 @@ define([
26
26
27
27
if ( type !== this . previousType ) {
28
28
this . previousType = type ;
29
-
30
- if ( type === 'radio' ) {
31
- this . clearValues ( ) ;
32
- }
29
+ this . processSelections ( type === 'radio' ) ;
33
30
}
34
31
35
32
this . _super ( ) ;
36
33
} ,
37
34
38
35
/**
39
- * Clears values in components like this.
36
+ * Toggle 'User Defined' column and clears values
37
+ * @param {Boolean } isRadio
40
38
*/
41
- clearValues : function ( ) {
39
+ processSelections : function ( isRadio ) {
42
40
var records = registry . get ( this . retrieveParentName ( this . parentContainer ) + '.' + this . selections ) ,
43
41
checkedFound = false ;
44
42
45
43
records . elems . each ( function ( record ) {
46
44
record . elems . filter ( function ( comp ) {
47
- return comp . index === this . targetIndex ;
45
+ return comp . index === this . userDefinedIndex ;
48
46
} , 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 ) ;
58
48
} ) ;
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
+ }
59
65
} , this ) ;
60
66
} ,
61
67
You can’t perform that action at this time.
0 commit comments