-
Notifications
You must be signed in to change notification settings - Fork 12
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
editor: add custom validators support #354
Conversation
e6e1fc6
to
cc3fb6a
Compare
for (const customValidator of this._customValidators) { | ||
if (formOptions.validation && formOptions.validation.validators) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The if
should be placed before the for
isn't it ?
* @returns number - the index position in the parent array, null if the parent | ||
* is not an array. | ||
*/ | ||
getIndex() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If think this method is useless and you can do directly Number(this.field.key)
instead of using it, because the check if field is array is already done
@@ -48,7 +51,7 @@ export class NgCoreFormlyExtension { | |||
* Constructor | |||
* @param _editorService - editor service | |||
*/ | |||
constructor(private _editorService: EditorService) { } | |||
constructor(private _editorService: EditorService, private _recordService: RecordService) { } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update doc block
* Adds custom validators support for repeatable fields. * Fixes missing duplicate and trash support for form field in non long mode. Co-Authored-by: Johnny Mariéthoz <Johnny.Mariethoz@rero.ch>
cc3fb6a
to
4f8e870
Compare
@@ -47,8 +50,11 @@ export class NgCoreFormlyExtension { | |||
/** | |||
* Constructor | |||
* @param _editorService - editor service | |||
* @params _recordService - ng core record service |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo : @params
or @param
const remoteRecordType = | ||
customValidators.valueAlreadyExists.remoteRecordType; | ||
const limitToValues = | ||
customValidators.valueAlreadyExists.limitToValues; | ||
const filter = | ||
customValidators.valueAlreadyExists.filter; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cosmetic : spit the lines here seems confused (for me and myself)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commit message approved.
long mode.
Co-Authored-by: Johnny Mariéthoz Johnny.Mariethoz@rero.ch
Why are you opening this PR?
How to test?
Code review check list