-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
support latest version of ember-changeset / ember-changeset-validations #27
support latest version of ember-changeset / ember-changeset-validations #27
Conversation
@simonihmig The current API for validation plugins does not seem to be flexible enough for common use cases. Or did I missed an obvious alternative to overriding |
8cc94f7
to
21636fd
Compare
Rebased after #25 has been merged. |
Hi, could it be that this change affects the displaying of nested properties element groups? After upgrading I seem to have forms not displaying errors for nested properties, while |
Yes. That could be caused by this change. Before it was using Refactored away from that one: https://github.com/kaliber5/ember-bootstrap-changeset-validations/blob/9034f0296e03d95fb61c99733d29b515178985c3/addon/components/bs-form/element.js#L10 Haven't considered that + import { get } from '@ember/object';
- let error = this.model?.error?.[this.property]?.validation;
+ let error = get(this, `model.error.${this.property}.validation`); Do you have time for a bug fix? |
this seems a legit fix, as that does return the correct validation message. The field is not rendered accordingly though... |
This fixes two issues:
dependentKeyCompat
for computed properties. This can be removed as soon asFormElement
class of Ember Bootstrap is refactored to use tracked properties and/or to provide a different API for validation plugins. This was reported as Broken with latest version of ember-changeset / ember-changeset-validations #26.validate()
method is called for it (or for all properties). This conflicts with Ember Bootstrap's assumption that validation is always up to date. A form element may be shown as valid just cause no validation was run ever. This was reported as Focus out is causing incorrect display of success on form element #22.Fixes #26 and #22.