Skip to content

Commit

Permalink
Bug 1491495 - Allow decimals in some number inputs
Browse files Browse the repository at this point in the history
Change compute resources and storage amount inputs to accept decimals.
  • Loading branch information
spadgett committed Sep 14, 2017
1 parent b16134b commit 0eabd02
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/views/_compute-resource.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
ng-attr-id="{{id}}"
ng-model="input.amount"
min="0"
pattern="\d*"
pattern="\d+(\.\d+)?"
ng-attr-placeholder="{{placeholder}}"
select-on-focus
class="form-control"
Expand Down
2 changes: 1 addition & 1 deletion app/views/directives/osc-persistent-volume-claim.html
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@
ng-model="claim.amount"
required
min="0"
pattern="\d*"
pattern="\d+(\.\d+)?"
select-on-focus
class="form-control"
aria-describedby="claim-capacity-help">
Expand Down
4 changes: 2 additions & 2 deletions dist/scripts/templates.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ angular.module('openshiftConsoleTemplates', []).run(['$templateCache', function(
"<div class=\"resource-size\" ng-class=\"{ 'has-error': form.$invalid }\">\n" +
"<div class=\"resource-amount\">\n" +
"<label class=\"sr-only\" ng-attr-for=\"{{id}}\">Amount</label>\n" +
"<input type=\"number\" name=\"amount\" ng-attr-id=\"{{id}}\" ng-model=\"input.amount\" min=\"0\" pattern=\"\\d*\" ng-attr-placeholder=\"{{placeholder}}\" select-on-focus class=\"form-control\" ng-attr-aria-describedby=\"{{description ? id + '-help' : undefined}}\">\n" +
"<input type=\"number\" name=\"amount\" ng-attr-id=\"{{id}}\" ng-model=\"input.amount\" min=\"0\" pattern=\"\\d+(\\.\\d+)?\" ng-attr-placeholder=\"{{placeholder}}\" select-on-focus class=\"form-control\" ng-attr-aria-describedby=\"{{description ? id + '-help' : undefined}}\">\n" +
"</div>\n" +
"<div class=\"resource-unit\">\n" +
"<label class=\"sr-only\" ng-attr-for=\"{{id}}-unit\">Unit</label>\n" +
Expand Down Expand Up @@ -7895,7 +7895,7 @@ angular.module('openshiftConsoleTemplates', []).run(['$templateCache', function(
"<div class=\"resource-size\" ng-class=\"{ 'has-error': persistentVolumeClaimForm.capacity.$invalid && persistentVolumeClaimForm.capacity.$touched && !claimDisabled }\">\n" +
"<div class=\"resource-amount\">\n" +
"<label for=\"claim-amount\" class=\"sr-only\">Amount</label>\n" +
"<input type=\"number\" name=\"capacity\" id=\"claim-amount\" ng-model=\"claim.amount\" required min=\"0\" pattern=\"\\d*\" select-on-focus class=\"form-control\" aria-describedby=\"claim-capacity-help\">\n" +
"<input type=\"number\" name=\"capacity\" id=\"claim-amount\" ng-model=\"claim.amount\" required min=\"0\" pattern=\"\\d+(\\.\\d+)?\" select-on-focus class=\"form-control\" aria-describedby=\"claim-capacity-help\">\n" +
"</div>\n" +
"<div class=\"resource-unit\">\n" +
"<label class=\"sr-only\">Unit</label>\n" +
Expand Down

0 comments on commit 0eabd02

Please sign in to comment.