-
Notifications
You must be signed in to change notification settings - Fork 13
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
patrons: add a role async validator #567
Conversation
* | ||
* @param field - formly field config. | ||
*/ | ||
_getRoleValidator(field: FormlyFieldConfig) { |
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.
add term private
_getRoleValidator(field: FormlyFieldConfig) { | ||
return { | ||
expression: (control: FormControl) => { | ||
console.log('validate'); |
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.
remove this
fc3dc2e
to
74454d8
Compare
* | ||
* @param field - formly field config. | ||
*/ | ||
private _getRoleValidator(field: FormlyFieldConfig) { |
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.
output typing: Observable<Boolean>
?
if (ptrn.organisation.pid !== currentOrgPid) { | ||
if (ptrn.roles.some(role => ['librarian', 'system_librarian'].some(r => r === role))) { | ||
return true; | ||
} | ||
} | ||
return false; |
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.
merged ?
return (ptrn.organisation.pid !== currentOrgPid) && (ptrn.roles.some(role => ['librarian', 'system_librarian'].some(r => r === role)));
74454d8
to
85de364
Compare
a4c1d56
to
0c226e6
Compare
* Removes useless console log messages. * Adds a role patron editor validator to avoid multiple professional accounts. * Fixes spelling: constributionSources -> contributionSources. Co-Authored-by: Johnny Mariéthoz <johnny.mariethoz@rero.ch>
0c226e6
to
34ca3ff
Compare
accounts
For reviewer
Only the last commit.
Why are you opening this PR?
Dependencies
How to test?
Code review check list