File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
app/code/Magento/Ui/view/base/web/js/grid/columns Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -33,13 +33,35 @@ define([
33
33
return value + '' ;
34
34
} ) ;
35
35
36
+ options = this . flatOptions ( options ) ;
37
+
36
38
options . forEach ( function ( item ) {
37
39
if ( _ . contains ( values , item . value + '' ) ) {
38
40
label . push ( item . label ) ;
39
41
}
40
42
} ) ;
41
43
42
44
return label . join ( ', ' ) ;
45
+ } ,
46
+
47
+ /**
48
+ * Transformation tree options structure to liner array.
49
+ *
50
+ * @param {Array } options
51
+ * @returns {Array }
52
+ */
53
+ flatOptions : function ( options ) {
54
+ var self = this ;
55
+
56
+ return options . reduce ( function ( options , option ) {
57
+ if ( _ . isArray ( option . value ) ) {
58
+ options = options . concat ( self . flatOptions ( option . value ) ) ;
59
+ } else {
60
+ options . push ( option ) ;
61
+ }
62
+
63
+ return options ;
64
+ } , [ ] ) ;
43
65
}
44
66
45
67
/*eslint-enable eqeqeq*/
You can’t perform that action at this time.
0 commit comments