-
Notifications
You must be signed in to change notification settings - Fork 90
pfModalOverlay: allow async validations while keeping modal open, demo maxlength validation #756
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
pfModalOverlay: allow async validations while keeping modal open, demo maxlength validation #756
Conversation
d06e923
to
27cf462
Compare
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.
@dtaylor113 This is working great! Wondering if we can adjust the visuals to match the PF "Errors and Validation" pattern.
Following the Errors and Validation pattern would include an inline notification at the top with the specific field-level errors listed out by each field. Below is an example of what I mean: |
Hi @beanh66, ok, sounds good. The example here actually can have several error messages, how would that be displayed in the modal? |
@beanh66, ok, thanks, that makes sense. I'll work on it some more. I may create another Issue/PR for this additional work because it's not what this PR was directly addressing. -thanks |
...for the inline notification at the top that is, the field level help shouldn't be an issue for this PR. I need to figure out if the inline notification at the top should be baked into the component, or done via the app dev's supplied form. |
27cf462
to
8a26ac1
Compare
Hi @beanh66, updated the screenshot/video in this PR's description. PTAL -thanks! |
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.
Thanks @dtaylor113 LGTM!
3dde992
to
1ddd033
Compare
@jeff-phillips-18, hoping you could take a look -thanks |
@@ -103,9 +109,12 @@ angular.module('patternfly.modals').component('pfModalOverlayContent', { | |||
|
|||
ctrl.ok = function (label, actionFn) { | |||
if (typeof actionFn === "function") { | |||
actionFn(); | |||
if (actionFn() !== 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.
Only concern would be an existing application returning false but not expecting the modal to remain open. Unlikely unless it is just happenstance. I think it's OK to assume that unlikelyhood is great enough to proceed.
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.
Yeah, I tend to agree that scenario is unlikely. If an app was returning false
, I'm not sure why or what controller would be processing a true or false? The component executes the button actionFns and it wasn't expecting any return values.
1ddd033
to
0bfb005
Compare
5cf8851
to
4cf62e6
Compare
4cf62e6
to
80c72b9
Compare
Description
Fixes #755
Added the ability to return

false
for actionBtn function(s) to keep modal open. Allows app dev to click 'Save', show spinner & perform async validation, and if invalid display error msg, or if valid, programmatically close the modal:Also demonstrated how to perform
ng-maxlength
validations.Also fixes #757 (Broken Semantic Release)
PR Checklist