You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
pfModalOverlay: no way to close modal for custom validations #755
If modal has a form and form validation depends on API response, the modal closes itself without waiting for API response and show error. There seems to be no way to stop closing of modal.
Also I am not able to access form controls in order to validate and provide error messages accordingly. For eg. I am using ng-maxlength which sets the flag {formname}{fieldname}.$error.maxlength to false but I don't see a way to access it inside the pfModalOverlay component.
*Note: added $scope.formScope.maxLength = 6; $scope.formScope is used for $ctrl.modalBodyScope when passed into the pfModalOverlay component. I also added a name attribute to the input field.
Here is the error validation message:
<div ng-if="demoForm.fieldTwo.$dirty && demoForm.fieldTwo.$touched">
<div class="has-error" ng-if="demoForm.fieldTwo.$error.maxlength">
<span class="help-block">
Field Two exceeds max length of {{$ctrl.modalBodyScope.maxLength}}!
</span>
</div>
</div>
Where demoForm is already defined as <form name='demoForm'...
Activity
gnehapk commentedon Aug 9, 2018
Also I am not able to access form controls in order to validate and provide error messages accordingly. For eg. I am using ng-maxlength which sets the flag
{formname}{fieldname}.$error.maxlengthto false but I don't see a way to access it inside the pfModalOverlay component.dtaylor113 commentedon Aug 9, 2018
Hi @gnehapk, I updated the ngDoc example pfModalOveral to show

maxLengtherrors:Here is the relevant HTML in `demo-form.html':
*Note: added
$scope.formScope.maxLength = 6;$scope.formScopeis used for$ctrl.modalBodyScopewhen passed into the pfModalOverlay component. I also added anameattribute to theinputfield.Here is the error validation message:
Where
demoFormis already defined as<form name='demoForm'...dtaylor113 commentedon Aug 10, 2018
For Tendrl (Gluster Management UI) and Ceph-dashboard
dtaylor113 commentedon Aug 14, 2018
The fix/enhancement for this Issue is available in angular-patternfly v4.18.5