You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficcontrol.apache.org by GitBox <gi...@apache.org> on 2021/11/03 22:32:14 UTC

[GitHub] [trafficcontrol] ocket8888 commented on a change in pull request #6325: Feature/tp refetch

ocket8888 commented on a change in pull request #6325:
URL: https://github.com/apache/trafficcontrol/pull/6325#discussion_r742391632



##########
File path: traffic_portal/app/src/common/modules/form/job/form.job.tpl.html
##########
@@ -47,14 +47,22 @@
                     <span ng-show="hasError(jobForm.regex)" class="form-control-feedback"><i class="fa fa-times"></i></span>
                 </div>
             </div>
-            <div class="form-group" ng-class="{'has-error': hasError(jobForm.ttl), 'has-feedback': hasError(jobForm.ttl)}">
+            <div class="form-group" ng-class="{'has-error': hasError(jobForm.ttlhours), 'has-feedback': hasError(jobForm.ttlhours)}">
                 <label class="control-label col-md-2 col-sm-2 col-xs-12">TTL (hours) *</label>
                 <div class="col-md-10 col-sm-10 col-xs-12">
-                    <input name="ttl" type="number" class="form-control" placeholder="Number of hours until the invalidation request expires" ng-model="job.ttl" ng-maxlength="3" ng-pattern="/^\d+$/" required autofocus>
-                    <small class="input-error" ng-show="hasPropertyError(jobForm.ttl, 'required')">Required Whole Number</small>
-                    <small class="input-error" ng-show="hasPropertyError(jobForm.ttl, 'maxlength')">Too Long</small>
-                    <small class="input-error" ng-show="hasPropertyError(jobForm.ttl, 'pattern')">Whole Number</small>
-                    <span ng-show="hasError(jobForm.ttl)" class="form-control-feedback"><i class="fa fa-times"></i></span>
+                    <input name="ttlhours" type="number" class="form-control" placeholder="Number of hours until the invalidation request expires" ng-model="job.ttlhours" ng-maxlength="3" ng-pattern="/^\d+$/" required autofocus>

Review comment:
       I'm just looking through this for docs reasons, but I can't stop myself from pointing out: this is an `input[type="number"]:required` so setting a pattern of `/^\d+$/` has no effect, since only things that would match that pattern (which can be just `pattern` too, since it's static - just like how `ng-maxlength=3` is no different from `maxlength=3` since `3` is a constant value but **also** also on a numeric input the controls will behave more nicely if you just set `max="999"` instead of `maxlength="3"`) are valid inputs anyway. And also, since this is a number, you don't need to be `parseInt`-ing down below.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org