Skip to content

Commit

Permalink
Fix custom components + error message default
Browse files Browse the repository at this point in the history
  • Loading branch information
joegaudet committed Jul 22, 2020
1 parent 209a59a commit 4c2fc05
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 25 deletions.
2 changes: 1 addition & 1 deletion addon/components/errors-for.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{{component @customErrorComponent error=error}}
{{else}}
<label class="error" data-test-form-error>
{{error}}
{{error.message}}
</label>
{{/if}}
{{/each}}
Expand Down
8 changes: 4 additions & 4 deletions addon/components/field-for.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,13 @@
@visible={{this._showConfirm}}
@buttonClass={{this.buttonClasses}}
@isActing={{this.form.isSubmitting}}
@customCommitCancelComponent={{this.customCommitCancelComponent}}
@customCommitCancelComponent={{this.formFor.customCommitCancelComponent}}
@commit={{this.commit}}
@cancel={{this.cancel}}
/>
</div>

<ErrorsFor @errors={{this.errors}} @customErrorComponent={{this.customErrorComponent}} />
<ErrorsFor @errors={{this.errors}} @customErrorComponent={{this.formFor.customErrorComponent}} />
</div>
</AttachPopover>
{{else}}
Expand Down Expand Up @@ -154,13 +154,13 @@
@visible={{this._showConfirm}}
@buttonClass={{this.buttonClasses}}
@isActing={{this.form.isSubmitting}}
@customCommitCancelComponent={{this.customCommitCancelComponent}}
@customCommitCancelComponent={{this.formFor.customCommitCancelComponent}}
@commit={{this.commit}}
@cancel={{this.cancel}}
/>
</div>

<ErrorsFor @errors={{this.errors}} @customErrorComponent={{this.customErrorComponent}} />
<ErrorsFor @errors={{this.errors}} @customErrorComponent={{this.formFor.customErrorComponent}} />
</div>
{{/if}}
{{/if}}
Expand Down
2 changes: 1 addition & 1 deletion addon/components/form-for.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
onClick=(fn this.confirmDestroy this.model)
)
errors=(component
"errors-for" errors=this.errors customErrorComponent=this.customErrorComponent
"errors-for" errors=this.errors customErrorComponent=this.formFor.customErrorComponent
)
self=this
)
Expand Down
38 changes: 19 additions & 19 deletions tests/dummy/app/controllers/docs/usage.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,25 +38,25 @@ export default class UsageController extends Controller {
toggleErrors() {
if (this.errors) {
this.anObject.errors = {
string: ['String Error'],
password: ['Password Error'],
text: ['Text Error'],
email: ['Email Error'],
url: ['URL Error'],
tel: ['TEL Error'],
search: ['Search Error'],
number: ['Number Error'],
currency: ['Currency Error'],
numberRange: ['Number Range Error'],
color: ['Color Error'],
date: ['Date Error'],
time: ['Time Error'],
datetime: ['Datetime Error'],
boolean: ['Boolean Error'],
select: ['Select Error'],
radio: ['Select Error'],
start: ['Start Error'],
end: ['End Error'],
string: [{message:'String Error'}],
password: [{message:'Password Error'}],
text: [{message:'Text Error'}],
email: [{message:'Email Error'}],
url: [{message:'URL Error'}],
tel: [{message:'TEL Error'}],
search: [{message:'Search Error'}],
number: [{message:'Number Error'}],
currency: [{message:'Currency Error'}],
numberRange: [{message:'Number Range Error'}],
color: [{message:'Color Error'}],
date: [{message:'Date Error'}],
time: [{message:'Time Error'}],
datetime: [{message:'Datetime Error'}],
boolean: [{message:'Boolean Error'}],
select: [{message:'Select Error'}],
radio: [{message:'Select Error'}],
start: [{message:'Start Error'}],
end: [{message:'End Error'}],
};
} else {
this.anObject.errors = {
Expand Down

0 comments on commit 4c2fc05

Please sign in to comment.