Skip to content

Commit ec1be8d

Browse files
author
Hwashiang Yu
committed
MC-4063: Flaky MFTF Test: AdminRemoveDefaultImageDownloadableProductTest
- Updated required entry validation rule to be specific to margins and paddings
1 parent 9a9a039 commit ec1be8d

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

app/code/Magento/PageBuilder/view/adminhtml/web/js/form/element/validator-rules-mixin.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -127,23 +127,23 @@ define([
127127
validator.addRule(
128128
'required-entry',
129129
function (value) {
130-
var allFilled = true;
130+
// Validation only for margins and paddings
131+
if (typeof value === 'object' && !!(value.padding || value.margin)) {
132+
var allFilled = true;
131133

132-
if (typeof value !== 'object') {
133-
return requiredInputRule.handler(value);
134-
}
134+
_.flatten(_.map(value, _.values)).forEach(function(val) {
135+
if (utils.isEmpty(val)) {
136+
return allFilled = false;
137+
}
138+
});
135139

136-
_.flatten(_.map(value, _.values)).forEach(function(val) {
137-
if (utils.isEmpty(val)) {
138-
return allFilled = false;
139-
}
140-
});
140+
return allFilled;
141+
}
141142

142-
return allFilled;
143+
return requiredInputRule.handler(value);
143144
},
144145
$.mage.__(requiredInputRule.message)
145146
);
146-
147147
validateObjectField(validator, 'validate-number');
148148
validateObjectField(validator, 'less-than-equals-to');
149149
validateObjectField(validator, 'greater-than-equals-to');

0 commit comments

Comments
 (0)