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 2020/08/14 18:29:29 UTC

[GitHub] [trafficcontrol] ocket8888 commented on a change in pull request #4955: Allow '0' as a valid value for TTL field in DNS static entry

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



##########
File path: traffic_portal/app/src/common/modules/form/deliveryServiceStaticDnsEntry/form.deliveryServiceStaticDnsEntry.tpl.html
##########
@@ -50,9 +50,9 @@
             <div class="form-group" ng-class="{'has-error': hasError(dsStaticDnsEntryForm.ttl), 'has-feedback': hasError(dsStaticDnsEntryForm.ttl)}">
                 <label for="ttl" class="control-label col-md-2 col-sm-2 col-xs-12">TTL *</label>
                 <div class="col-md-10 col-sm-10 col-xs-12">
-                    <input id="ttl" name="ttl" type="number" class="form-control" ng-model="staticDnsEntry.ttl" min="0" step="1" required>
+                    <input id="ttl" name="ttl" type="number" class="form-control" ng-model="staticDnsEntry.ttl" ng-pattern="/^\d+$/" required>

Review comment:
       > _"min does not prevent the user from entering -1, for example._"
   
   What do you mean? Like the user can literally type in "-1"? Because you can still do that with `ng-pattern`. Also, without a min, I can use the browser's native controls to enter an invalid value. I can hit the down arrow and get -1. Using `min` and `step` if I put in "-1" I still see the field marked as invalid.
   
   ![image](https://user-images.githubusercontent.com/6013378/90281394-ba5e7780-de29-11ea-9201-0a59b164bf00.png)
   




----------------------------------------------------------------
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.

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