Skip to content

Commit 0eabd02

Browse files
committed
Bug 1491495 - Allow decimals in some number inputs
Change compute resources and storage amount inputs to accept decimals.
1 parent b16134b commit 0eabd02

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

app/views/_compute-resource.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
ng-attr-id="{{id}}"
1010
ng-model="input.amount"
1111
min="0"
12-
pattern="\d*"
12+
pattern="\d+(\.\d+)?"
1313
ng-attr-placeholder="{{placeholder}}"
1414
select-on-focus
1515
class="form-control"

app/views/directives/osc-persistent-volume-claim.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@
146146
ng-model="claim.amount"
147147
required
148148
min="0"
149-
pattern="\d*"
149+
pattern="\d+(\.\d+)?"
150150
select-on-focus
151151
class="form-control"
152152
aria-describedby="claim-capacity-help">

dist/scripts/templates.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ angular.module('openshiftConsoleTemplates', []).run(['$templateCache', function(
7575
"<div class=\"resource-size\" ng-class=\"{ 'has-error': form.$invalid }\">\n" +
7676
"<div class=\"resource-amount\">\n" +
7777
"<label class=\"sr-only\" ng-attr-for=\"{{id}}\">Amount</label>\n" +
78-
"<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" +
78+
"<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" +
7979
"</div>\n" +
8080
"<div class=\"resource-unit\">\n" +
8181
"<label class=\"sr-only\" ng-attr-for=\"{{id}}-unit\">Unit</label>\n" +
@@ -7895,7 +7895,7 @@ angular.module('openshiftConsoleTemplates', []).run(['$templateCache', function(
78957895
"<div class=\"resource-size\" ng-class=\"{ 'has-error': persistentVolumeClaimForm.capacity.$invalid && persistentVolumeClaimForm.capacity.$touched && !claimDisabled }\">\n" +
78967896
"<div class=\"resource-amount\">\n" +
78977897
"<label for=\"claim-amount\" class=\"sr-only\">Amount</label>\n" +
7898-
"<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" +
7898+
"<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" +
78997899
"</div>\n" +
79007900
"<div class=\"resource-unit\">\n" +
79017901
"<label class=\"sr-only\">Unit</label>\n" +

0 commit comments

Comments
 (0)