Skip to content

Releases: adopted-ember-addons/ember-cp-validations

v6.0.1-ember-cp-validations: Merge pull request #753 from adopted-ember-addons/release-preview

26 Feb 15:25
92523c2
Compare
Choose a tag to compare

Release (2024-02-26)

ember-cp-validations 6.0.1 (patch)

🐛 Bug Fix

  • ember-cp-validations

🏠 Internal

Committers: 2

Release 6.0.0

09 Nov 16:08
Compare
Choose a tag to compare

💥 Breaking Change

  • #731 Update ember-cli to v4.4 and drop support for node v12 (@fsmanuel)

🚀 Enhancement

  • #741 Replace require with @embroider/macros fixing embroider support (@achambers)

📝 Documentation

🏠 Internal

Committers: 3

Release 5.0.0

27 Oct 15:01
Compare
Choose a tag to compare

💥 Breaking Change

  • #717 Ember 4.0 compatibility - drops support for Ember < 3.28 (@fsmanuel)

Committers: 1

Release 4.0.0

21 Sep 14:14
Compare
Choose a tag to compare

🏠 Internal

Committers: 1

v4.0.0-beta.1

24 May 16:21
Compare
Choose a tag to compare
v4.0.0-beta.1 Pre-release
Pre-release
  • #579 Update validator test blueprints to latest APIs
  • #580 Remove isDirty
  • #583 export hasValidations decorator for es6 style models @danielspaniel
  • #586 update to 3.1 and fix ObjectProxy extends validations bug @danielspaniel
  • #590 Update ember-require-module to v0.3.0
  • #593 Upgrade ember-validators to 1.2.0

v4.0.0-beta.0

02 Apr 05:08
Compare
Choose a tag to compare
v4.0.0-beta.0 Pre-release
Pre-release

Breaking Changes

Support Latest 2 LTS Releases

As Ember is evolving, we have to be able to keep up. v3.x supported Ember versions as old
as 1.11 which not only made this addon difficult to maintain, but also added a
lot of bloat. Going forward, this addon will target and test against only the 2
latest LTS releases.

Inline Validator

This library has always supported the ability to pass in a custom validate function
to the validator but it didn't feel consistent with the rest of the API. To normalize
this, we created a new inline validator that you can pass a function to via
the validate option.

Before (3.x)

validator(function(value, options, model, attribute) {
  return value === options.username ?
         true :
         `Username must be ${options.username}`;
}, {
  username: 'offirgolan'
});

After (4.x)

validator('inline', {
  username: 'offirgolan',
  validate(value, options, model, attribute) {
    return value === options.username ?
           true :
           `Username must be ${options.username}`;
  }
});

New Features

Validator Composability

Easily compose complicated validations by using this this.test to validate
against pre-existing validators.

validate(value, options, ...args) {
  let result = this.test('presence', value, { presence: true }, ...args);

  if (!result.isValid) {
    return result.message;
  }

  result = this.test('number', value, { integer: true }, ...args);

  // You can easily override the error message by returning your own.
  if (!result.isValid) {
      return 'This value must be an integer!';
    }

  // Add custom logic...

  return true;
}

Pull Requests

  • #564 Update all the things
  • #566 Validator Composability
  • #568 Partial memory leak fixes
  • #569 Inline Validator
  • #576 Ember 3.0 + Updated Tests

v3.5.1

21 Nov 18:10
Compare
Choose a tag to compare

v3.5.0

18 Sep 21:45
Compare
Choose a tag to compare
  • #538 [BUGFIX] Rework Warning Logic

Upgrade Notes

The isWarning flag on the validations object as well as the individual attribute validations object has been removed since it didn't really make any sense and replace with a hasWarnings flag.

v3.4.0

31 Jul 23:15
Compare
Choose a tag to compare
  • #523 Upgrade All the Dependencies!

v3.3.2

12 May 01:04
Compare
Choose a tag to compare
  • #505 [BUGFIX] Ember Data 2.13 Nested Key Destroy