File tree Expand file tree Collapse file tree 3 files changed +37
-11
lines changed
app/code/Magento/Catalog/view/adminhtml/web/js/components
dev/tests/functional/tests/app/Magento/Catalog/Test Expand file tree Collapse file tree 3 files changed +37
-11
lines changed Original file line number Diff line number Diff line change 4
4
*/
5
5
6
6
define ( [
7
+ 'underscore' ,
7
8
'Magento_Ui/js/form/element/textarea'
8
- ] , function ( Textarea ) {
9
+ ] , function ( _ , Textarea ) {
9
10
'use strict' ;
10
11
11
12
return Textarea . extend ( {
@@ -123,24 +124,21 @@ define([
123
124
* Update field value, if it's allowed
124
125
*/
125
126
updateValue : function ( ) {
126
- var str = this . mask ,
127
+ var str = this . mask || '' ,
127
128
nonEmptyValueFlag = false ,
128
- placeholder ,
129
- property ,
130
129
tmpElement ;
131
130
132
131
if ( ! this . allowImport ) {
133
132
return ;
134
133
}
135
134
136
- for ( property in this . values ) {
137
- if ( this . values . hasOwnProperty ( property ) ) {
138
- placeholder = '' ;
139
- placeholder = placeholder . concat ( '{{' , property , '}}' ) ;
140
- str = str . replace ( placeholder , this . values [ property ] ) ;
141
- nonEmptyValueFlag = nonEmptyValueFlag || ! ! this . values [ property ] ;
142
- }
135
+ if ( str ) {
136
+ _ . each ( this . values , function ( propertyValue , propertyName ) {
137
+ str = str . replace ( '{{' + propertyName + '}}' , propertyValue ) ;
138
+ nonEmptyValueFlag = nonEmptyValueFlag || ! ! propertyValue ;
139
+ } ) ;
143
140
}
141
+
144
142
// strip tags
145
143
tmpElement = document . createElement ( 'div' ) ;
146
144
tmpElement . innerHTML = str ;
Original file line number Diff line number Diff line change 23
23
<item name =" value" xsi : type =" number" >0</item >
24
24
</field >
25
25
</dataset >
26
+ <dataset name =" empty_product_mask_sku" >
27
+ <field name =" catalog/fields_masks/sku" xsi : type =" array" >
28
+ <item name =" value" xsi : type =" string" />
29
+ </field >
30
+ </dataset >
31
+ <dataset name =" empty_product_mask_sku_rollback" >
32
+ <field name =" catalog/fields_masks/sku" xsi : type =" array" >
33
+ <item name =" value" xsi : type =" string" >{{name}}</item >
34
+ <item name =" inherit" xsi : type =" number" >1</item >
35
+ </field >
36
+ </dataset >
26
37
</repository >
27
38
</config >
Original file line number Diff line number Diff line change 449
449
<constraint name =" Magento\Catalog\Test\Constraint\AssertProductSaveMessage" />
450
450
<constraint name =" Magento\Catalog\Test\Constraint\AssertProductInCategory" />
451
451
</variation >
452
+ <variation name =" CreateSimpleProductEntityWithEmptySkuMaskTest1" summary =" Create Simple Product Entity With Empty Sku Mask" ticketId =" MAGETWO-63556" >
453
+ <data name =" configData" xsi : type =" string" >empty_product_mask_sku</data >
454
+ <data name =" description" xsi : type =" string" >Create product with custom options(fixed price)</data >
455
+ <data name =" product/data/url_key" xsi : type =" string" >simple-product-%isolation%</data >
456
+ <data name =" product/data/name" xsi : type =" string" >Simple Product %isolation%</data >
457
+ <data name =" product/data/sku" xsi : type =" string" >simple_sku_%isolation%</data >
458
+ <data name =" product/data/price/value" xsi : type =" string" >10000</data >
459
+ <data name =" product/data/weight" xsi : type =" string" >50</data >
460
+ <data name =" product/data/quantity_and_stock_status/qty" xsi : type =" string" >657</data >
461
+ <data name =" product/data/checkout_data/dataset" xsi : type =" string" >simple_drop_down_with_one_option_fixed_price</data >
462
+ <data name =" product/data/price/dataset" xsi : type =" string" >drop_down_with_one_option_fixed_price</data >
463
+ <constraint name =" Magento\Catalog\Test\Constraint\AssertProductSaveMessage" />
464
+ <constraint name =" Magento\Catalog\Test\Constraint\AssertProductInGrid" />
465
+ <constraint name =" Magento\Catalog\Test\Constraint\AssertProductInCategory" />
466
+ <constraint name =" Magento\Catalog\Test\Constraint\AssertProductPage" />
467
+ <constraint name =" Magento\Catalog\Test\Constraint\AssertProductInCart" />
468
+ </variation >
452
469
</testCase >
453
470
</config >
You can’t perform that action at this time.
0 commit comments