Skip to content

Commit 3a36d4f

Browse files
authored
feature-8878: Can't read errors related to unfilled fields in the form (#9026)
1 parent f3b8e68 commit 3a36d4f

File tree

1 file changed

+5
-14
lines changed

1 file changed

+5
-14
lines changed

app/components/forms/orders/order-form.js

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ export default Component.extend(FormMixin, {
386386
const isConsentFormFieldValidation = {
387387
rules: [
388388
{
389-
type : 'checkbox',
389+
type : 'checked',
390390
prompt : this.l10n.t('Please enter Code of conduct consent.')
391391
}
392392
]
@@ -396,8 +396,7 @@ export default Component.extend(FormMixin, {
396396
optional : true,
397397
rules : [
398398
{
399-
type : 'regExp',
400-
value : compulsoryProtocolValidUrlPattern,
399+
type : 'checked',
401400
prompt : this.l10n.t('Please consent to the Refund Policy.')
402401
}
403402
]
@@ -531,24 +530,16 @@ export default Component.extend(FormMixin, {
531530
validationRules.fields[validationRuleKey] = validationMap[fieldIdentifier];
532531
} else {
533532
if (field.type === 'checkbox') {
534-
validationRules.fields[`${field.fieldIdentifier}_required_${index}`] = {
535-
rules: [
536-
{
537-
type : 'checkbox',
538-
prompt : this.l10n.t('Please select your {{field}}.', { field: field.name })
539-
}
540-
]
541-
};
542-
} else if (field.type === 'boolean') {
543533
validationRules.fields[`${field.fieldIdentifier}_required_${index}`] = {
544534
rules: [
545535
{
546536
type : 'checked',
547-
prompt : this.l10n.t('Please choosen your {{field}}.', { field: field.name })
537+
prompt : this.l10n.t('Please select your {{field}}.', { field: field.name })
548538
}
549539
]
550540
};
551-
} else {
541+
}
542+
else {
552543
validationRules.fields[`${field.fieldIdentifier}_required_${index}`] = {
553544
rules: [
554545
{

0 commit comments

Comments
 (0)