This repository was archived by the owner on Apr 29, 2019. It is now read-only.
File tree 2 files changed +15
-3
lines changed
app/code/Magento/Rule/view/adminhtml/web
dev/tests/js/jasmine/tests/app/code/Magento/Rule/view/adminhtml/web
2 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -14,11 +14,11 @@ define([
14
14
*/
15
15
var ConditionsDataNormalizer = function ( ) {
16
16
this . patterns = {
17
- validate : / ^ [ a - z 0 - 9 _ - ] [ a - z 0 - 9 _ - ] * (?: \[ (?: \d * | [ a - z 0 - 9 _ - ] + ) \] ) * $ / i,
18
- key : / [ a - z 0 - 9 _ - ] + | (? = \[ \] ) / gi,
17
+ validate : / ^ [ a - z 0 - 9 _ . - ] [ a - z 0 - 9 _ . - ] * (?: \[ (?: \d * | [ a - z 0 - 9 _ . - ] + ) \] ) * $ / i,
18
+ key : / [ a - z 0 - 9 _ . - ] + | (? = \[ \] ) / gi,
19
19
push : / ^ $ / ,
20
20
fixed : / ^ \d + $ / ,
21
- named : / ^ [ a - z 0 - 9 _ - ] + $ / i
21
+ named : / ^ [ a - z 0 - 9 _ . - ] + $ / i
22
22
} ;
23
23
} ;
24
24
Original file line number Diff line number Diff line change @@ -65,5 +65,17 @@ define([
65
65
expect ( normal . foo [ '1' ] . value ) . toEqual ( 123 ) ;
66
66
expect ( normal . foo [ '1--1' ] ) . toEqual ( 321 ) ;
67
67
} ) ;
68
+
69
+ it ( 'Check keys containing a dot are normalized' , function ( ) {
70
+ var normal = normalizer . normalize ( {
71
+ 'foo[1][name.foo]' : 'bar' ,
72
+ 'foo[1][value.foo]' : 123 ,
73
+ 'foo[1--1]' : 321
74
+ } ) ;
75
+
76
+ expect ( normal . foo [ '1' ] [ 'name.foo' ] ) . toEqual ( 'bar' ) ;
77
+ expect ( normal . foo [ '1' ] [ 'value.foo' ] ) . toEqual ( 123 ) ;
78
+ expect ( normal . foo [ '1--1' ] ) . toEqual ( 321 ) ;
79
+ } ) ;
68
80
} ) ;
69
81
} ) ;
You can’t perform that action at this time.
0 commit comments