Skip to content

Commit a374e81

Browse files
committed
Remove incorrect minlength="2" restrictions on some resource names
Removed the minlength from the following create forms: * Config maps * HPAs * PVCs * Routes Improved the minlength error message for project names, where it is required. Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1396906
1 parent 6b5b66a commit a374e81

File tree

6 files changed

+24
-13
lines changed

6 files changed

+24
-13
lines changed

app/views/create-project.html

+10-3
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,21 @@ <h1>New Project</h1>
3838
<div>
3939
<span class="help-block">A unique name for the project.</span>
4040
</div>
41+
<div class="has-error">
42+
<span id="nameHelp" class="help-block" ng-if="createProjectForm.name.$error.minlength && createProjectForm.name.$touched">
43+
Name must have at least two characters.
44+
</span>
45+
</div>
4146
<div class="has-error">
4247
<span id="nameHelp" class="help-block" ng-if="createProjectForm.name.$error.pattern && createProjectForm.name.$touched">
4348
Project names may only contain lower-case letters, numbers, and dashes.
44-
They may not start or end with a dash.</span>
49+
They may not start or end with a dash.
50+
</span>
4551
</div>
4652
<div class="has-error">
47-
<span class="help-block" ng-if="nameTaken">This name is already
48-
in use. Please choose a different name.</span>
53+
<span class="help-block" ng-if="nameTaken">
54+
This name is already in use. Please choose a different name.
55+
</span>
4956
</div>
5057
</div>
5158

app/views/directives/edit-config-map.html

-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
ng-required="showNameInput"
1515
ng-pattern="/^[a-z0-9]([-a-z0-9]*[a-z0-9])?$/"
1616
ng-maxlength="63"
17-
ng-minlength="2"
1817
placeholder="my-config-map"
1918
select-on-focus
2019
autocorrect="off"

app/views/directives/osc-autoscaling.html

-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
ng-readonly="nameReadOnly"
1414
ng-pattern="/^[a-z0-9]([-a-z0-9]*[a-z0-9])?$/"
1515
ng-maxlength="63"
16-
ng-minlength="2"
1716
placeholder="my-hpa"
1817
select-on-focus
1918
autocorrect="off"

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

-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@
4747
ng-required="true"
4848
ng-pattern="/^[a-z0-9]([-a-z0-9]*[a-z0-9])?$/"
4949
ng-maxlength="253"
50-
ng-minlength="2"
5150
placeholder="my-storage-claim"
5251
select-on-focus
5352
autocorrect="off"

app/views/directives/osc-routing.html

-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
ng-required="showNameInput"
1515
ng-pattern="/^[a-z0-9]([-a-z0-9]*[a-z0-9])?$/"
1616
ng-maxlength="63"
17-
ng-minlength="2"
1817
placeholder="my-route"
1918
select-on-focus
2019
autocorrect="off"

dist/scripts/templates.js

+14-6
Original file line numberDiff line numberDiff line change
@@ -4169,11 +4169,19 @@ angular.module('openshiftConsoleTemplates', []).run(['$templateCache', function(
41694169
"<span class=\"help-block\">A unique name for the project.</span>\n" +
41704170
"</div>\n" +
41714171
"<div class=\"has-error\">\n" +
4172+
"<span id=\"nameHelp\" class=\"help-block\" ng-if=\"createProjectForm.name.$error.minlength && createProjectForm.name.$touched\">\n" +
4173+
"Name must have at least two characters.\n" +
4174+
"</span>\n" +
4175+
"</div>\n" +
4176+
"<div class=\"has-error\">\n" +
41724177
"<span id=\"nameHelp\" class=\"help-block\" ng-if=\"createProjectForm.name.$error.pattern && createProjectForm.name.$touched\">\n" +
4173-
"Project names may only contain lower-case letters, numbers, and dashes. They may not start or end with a dash.</span>\n" +
4178+
"Project names may only contain lower-case letters, numbers, and dashes. They may not start or end with a dash.\n" +
4179+
"</span>\n" +
41744180
"</div>\n" +
41754181
"<div class=\"has-error\">\n" +
4176-
"<span class=\"help-block\" ng-if=\"nameTaken\">This name is already in use. Please choose a different name.</span>\n" +
4182+
"<span class=\"help-block\" ng-if=\"nameTaken\">\n" +
4183+
"This name is already in use. Please choose a different name.\n" +
4184+
"</span>\n" +
41774185
"</div>\n" +
41784186
"</div>\n" +
41794187
"<div class=\"form-group\">\n" +
@@ -5865,7 +5873,7 @@ angular.module('openshiftConsoleTemplates', []).run(['$templateCache', function(
58655873
"<label for=\"config-map-name\" class=\"required\">Name</label>\n" +
58665874
"\n" +
58675875
"<div ng-class=\"{ 'has-error': configMapForm.name.$invalid && configMapForm.name.$touched }\">\n" +
5868-
"<input id=\"config-map-name\" class=\"form-control\" type=\"text\" name=\"name\" ng-model=\"configMap.metadata.name\" ng-required=\"showNameInput\" ng-pattern=\"/^[a-z0-9]([-a-z0-9]*[a-z0-9])?$/\" ng-maxlength=\"63\" ng-minlength=\"2\" placeholder=\"my-config-map\" select-on-focus autocorrect=\"off\" autocapitalize=\"off\" spellcheck=\"false\" aria-describedby=\"config-map-name-help\">\n" +
5876+
"<input id=\"config-map-name\" class=\"form-control\" type=\"text\" name=\"name\" ng-model=\"configMap.metadata.name\" ng-required=\"showNameInput\" ng-pattern=\"/^[a-z0-9]([-a-z0-9]*[a-z0-9])?$/\" ng-maxlength=\"63\" placeholder=\"my-config-map\" select-on-focus autocorrect=\"off\" autocapitalize=\"off\" spellcheck=\"false\" aria-describedby=\"config-map-name-help\">\n" +
58695877
"</div>\n" +
58705878
"<div>\n" +
58715879
"<span id=\"config-map-name-help\" class=\"help-block\">A unique name for the config map within the project.</span>\n" +
@@ -6653,7 +6661,7 @@ angular.module('openshiftConsoleTemplates', []).run(['$templateCache', function(
66536661
"<div ng-show=\"showNameInput\" class=\"form-group\">\n" +
66546662
"<label for=\"hpa-name\" class=\"required\">Autoscaler Name</label>\n" +
66556663
"<span ng-class=\"{ 'has-error': form.name.$touched && form.name.$invalid }\">\n" +
6656-
"<input id=\"hpa-name\" class=\"form-control\" type=\"text\" name=\"name\" ng-model=\"autoscaling.name\" ng-required=\"showNameInput\" ng-readonly=\"nameReadOnly\" ng-pattern=\"/^[a-z0-9]([-a-z0-9]*[a-z0-9])?$/\" ng-maxlength=\"63\" ng-minlength=\"2\" placeholder=\"my-hpa\" select-on-focus autocorrect=\"off\" autocapitalize=\"off\" spellcheck=\"false\" aria-describedby=\"hpa-name-help\">\n" +
6664+
"<input id=\"hpa-name\" class=\"form-control\" type=\"text\" name=\"name\" ng-model=\"autoscaling.name\" ng-required=\"showNameInput\" ng-readonly=\"nameReadOnly\" ng-pattern=\"/^[a-z0-9]([-a-z0-9]*[a-z0-9])?$/\" ng-maxlength=\"63\" placeholder=\"my-hpa\" select-on-focus autocorrect=\"off\" autocapitalize=\"off\" spellcheck=\"false\" aria-describedby=\"hpa-name-help\">\n" +
66576665
"</span>\n" +
66586666
"<div>\n" +
66596667
"<span id=\"hpa-name-help\" class=\"help-block\">\n" +
@@ -6971,7 +6979,7 @@ angular.module('openshiftConsoleTemplates', []).run(['$templateCache', function(
69716979
"\n" +
69726980
"<div class=\"form-group\">\n" +
69736981
"<label for=\"claim-name\" class=\"required\">Name</label>\n" +
6974-
"<input id=\"claim-name\" class=\"form-control\" type=\"text\" name=\"name\" ng-model=\"claim.name\" ng-required=\"true\" ng-pattern=\"/^[a-z0-9]([-a-z0-9]*[a-z0-9])?$/\" ng-maxlength=\"253\" ng-minlength=\"2\" placeholder=\"my-storage-claim\" select-on-focus autocorrect=\"off\" autocapitalize=\"off\" spellcheck=\"false\" aria-describedby=\"claim-name-help\">\n" +
6982+
"<input id=\"claim-name\" class=\"form-control\" type=\"text\" name=\"name\" ng-model=\"claim.name\" ng-required=\"true\" ng-pattern=\"/^[a-z0-9]([-a-z0-9]*[a-z0-9])?$/\" ng-maxlength=\"253\" placeholder=\"my-storage-claim\" select-on-focus autocorrect=\"off\" autocapitalize=\"off\" spellcheck=\"false\" aria-describedby=\"claim-name-help\">\n" +
69756983
"<div>\n" +
69766984
"<span id=\"claim-name-help\" class=\"help-block\">A unique name for the storage claim within the project.</span>\n" +
69776985
"</div>\n" +
@@ -7099,7 +7107,7 @@ angular.module('openshiftConsoleTemplates', []).run(['$templateCache', function(
70997107
"<div ng-show=\"showNameInput\" class=\"form-group\">\n" +
71007108
"<label for=\"route-name\" class=\"required\">Name</label>\n" +
71017109
"\n" +
7102-
"<input id=\"route-name\" class=\"form-control\" type=\"text\" name=\"name\" ng-model=\"route.name\" ng-required=\"showNameInput\" ng-pattern=\"/^[a-z0-9]([-a-z0-9]*[a-z0-9])?$/\" ng-maxlength=\"63\" ng-minlength=\"2\" placeholder=\"my-route\" select-on-focus autocorrect=\"off\" autocapitalize=\"off\" spellcheck=\"false\" aria-describedby=\"route-name-help\">\n" +
7110+
"<input id=\"route-name\" class=\"form-control\" type=\"text\" name=\"name\" ng-model=\"route.name\" ng-required=\"showNameInput\" ng-pattern=\"/^[a-z0-9]([-a-z0-9]*[a-z0-9])?$/\" ng-maxlength=\"63\" placeholder=\"my-route\" select-on-focus autocorrect=\"off\" autocapitalize=\"off\" spellcheck=\"false\" aria-describedby=\"route-name-help\">\n" +
71037111
"<div>\n" +
71047112
"<span id=\"route-name-help\" class=\"help-block\">A unique name for the route within the project.</span>\n" +
71057113
"</div>\n" +

0 commit comments

Comments
 (0)