-
-
Notifications
You must be signed in to change notification settings - Fork 100
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Embroider compat * import directly
- Loading branch information
Showing
12 changed files
with
1,836 additions
and
2,734 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,15 @@ | ||
import buildMessage from 'ember-changeset-validations/utils/validation-errors'; | ||
import { validate } from 'ember-validators'; | ||
import evValidateConfirmation from 'ember-validators/confirmation'; | ||
import { assign } from '@ember/polyfills'; | ||
|
||
|
||
export default function validateConfirmation(options = {}) { | ||
return (key, newValue, _oldValue, changes , content = {}) => { | ||
// Combine the changes on top of the content so that we evaluate against both default values | ||
// and valid changes. `changes` only has valid changes that have been made and won't include | ||
// default values | ||
let model = assign({}, content, changes); | ||
|
||
let result = validate('confirmation', newValue, options, model, key); | ||
let result = evValidateConfirmation(newValue, options, model, key); | ||
return (result === true) ? true : buildMessage(key, result); | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
import buildMessage from 'ember-changeset-validations/utils/validation-errors'; | ||
import { validate } from 'ember-validators'; | ||
import evValidateExclusion from 'ember-validators/exclusion'; | ||
|
||
export default function validateExclusion(options = {}) { | ||
if (options.list) { | ||
options.in = options.list; | ||
} | ||
|
||
return (key, value) => { | ||
let result = validate('exclusion', value, options, null, key); | ||
let result = evValidateExclusion(value, options, null, key); | ||
return (result === true) ? true : buildMessage(key, result); | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
import buildMessage from 'ember-changeset-validations/utils/validation-errors'; | ||
import { validate } from 'ember-validators'; | ||
import evValidateInclusion from 'ember-validators/inclusion'; | ||
|
||
export default function validateInclusion(options = {}) { | ||
if (options.list) { | ||
options.in = options.list; | ||
} | ||
|
||
return (key, value) => { | ||
let result = validate('inclusion', value, options, null, key); | ||
let result = evValidateInclusion(value, options, null, key); | ||
return (result === true) ? true : buildMessage(key, result); | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
import buildMessage from 'ember-changeset-validations/utils/validation-errors'; | ||
import withDefaults from 'ember-changeset-validations/utils/with-defaults'; | ||
import { validate } from 'ember-validators'; | ||
import evValidateLength from 'ember-validators/length'; | ||
|
||
export default function validateLength(options = {}) { | ||
options = withDefaults(options, { useBetweenMessage: true }); | ||
|
||
return (key, value) => { | ||
let result = validate('length', value, options, null, key); | ||
let result = evValidateLength(value, options, null, key); | ||
return (result === true) ? true : buildMessage(key, result); | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.