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 2019/03/01 19:31:37 UTC
[GitHub] ocket8888 commented on a change in pull request #3361: Added
pattern validation for truly valid xmlids
ocket8888 commented on a change in pull request #3361: Added pattern validation for truly valid xmlids
URL: https://github.com/apache/trafficcontrol/pull/3361#discussion_r261730496
##########
File path: traffic_portal/app/src/common/modules/form/deliveryService/form.deliveryService.Steering.tpl.html
##########
@@ -296,47 +308,46 @@
<div class="form-group" ng-class="{'has-error': hasError(deliveryServiceForm.trResponseHeaders), 'has-feedback': hasError(deliveryServiceForm.trResponseHeaders)}"
ng-if="isClientSteering(deliveryService)">
- <label class="control-label col-md-2 col-sm-2 col-xs-12">
+ <label class="control-label col-md-2 col-sm-2 col-xs-12" for="trResponseHeaders">
<span uib-popover-html="label('trResponseHeaders', 'desc')" popover-trigger="click" popover-placement="top" popover-append-to-body="true" popover-class="popover-class">{{label('trResponseHeaders', 'title')}}</span>
</label>
<div class="col-md-10 col-sm-10 col-xs-12">
- <input name="trResponseHeaders" type="text" class="form-control" ng-model="deliveryService.trResponseHeaders" ng-maxlength="1024" autofocus>
+ <input id="trResponseHeaders" name="trResponseHeaders" type="text" class="form-control" ng-model="deliveryService.trResponseHeaders" maxlength="1024">
<small class="input-error" ng-show="hasPropertyError(deliveryServiceForm.trResponseHeaders, 'maxlength')">Too Long</small>
<small class="input-diff" ng-show="settings.isRequest && open() && deliveryService.trResponseHeaders != dsCurrent.trResponseHeaders">Current Value: [ {{dsCurrent.trResponseHeaders}} ]</small>
<span ng-show="hasError(deliveryServiceForm.trResponseHeaders)" class="form-control-feedback"><i class="fa fa-times"></i></span>
</div>
</div>
<div class="form-group" ng-class="{'has-error': hasError(deliveryServiceForm.ccrDnsTtl), 'has-feedback': hasError(deliveryServiceForm.ccrDnsTtl)}">
- <label class="control-label col-md-2 col-sm-2 col-xs-12">
+ <label class="control-label col-md-2 col-sm-2 col-xs-12" for="ccrDnsTtl">
<span uib-popover-html="label('ccrDnsTtl', 'desc')" popover-trigger="click" popover-placement="top" popover-append-to-body="true" popover-class="popover-class">{{label('ccrDnsTtl', 'title')}}</span>
</label>
<div class="col-md-10 col-sm-10 col-xs-12">
- <input name="ccrDnsTtl" type="number" class="form-control" ng-model="deliveryService.ccrDnsTtl" ng-pattern="/^\d+$/" autofocus>
- <small class="input-error" ng-show="hasPropertyError(deliveryServiceForm.ccrDnsTtl, 'pattern')">Whole Number</small>
+ <input id="ccrDnsTtl" name="ccrDnsTtl" type="number" class="form-control" ng-model="deliveryService.ccrDnsTtl" min="0" step="1">
<small class="input-diff" ng-show="settings.isRequest && open() && deliveryService.ccrDnsTtl != dsCurrent.ccrDnsTtl">Current Value: [ {{dsCurrent.ccrDnsTtl}} ]</small>
<span ng-show="hasError(deliveryServiceForm.ccrDnsTtl)" class="form-control-feedback"><i class="fa fa-times"></i></span>
</div>
</div>
<div class="form-group" ng-class="{'has-error': hasError(deliveryServiceForm.infoUrl), 'has-feedback': hasError(deliveryServiceForm.infoUrl)}">
- <label class="control-label col-md-2 col-sm-2 col-xs-12">
+ <label class="control-label col-md-2 col-sm-2 col-xs-12" for="infoUrl">
<span uib-popover-html="label('infoUrl', 'desc')" popover-trigger="click" popover-placement="top" popover-append-to-body="true" popover-class="popover-class">{{label('infoUrl', 'title')}}</span>
</label>
<div class="col-md-10 col-sm-10 col-xs-12">
- <input name="infoUrl" type="text" class="form-control" ng-model="deliveryService.infoUrl" ng-maxlength="255" autofocus>
+ <input id="infoUrl" name="infoUrl" type="url" title="Must be a valid URL" class="form-control" ng-model="deliveryService.infoUrl" maxlength="255">
Review comment:
The message in the `title` is meant to be sufficient. I could add a red text error underneath, though. Probably should, actually, for consistency's sake.
Are there really people who use the "Info URL" field for things that aren't URLs? With _three unlimited length description fields on the object_? That sounds like a horribly unintuitive misuse of the field.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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
With regards,
Apache Git Services