Skip to content

Commit 7d50282

Browse files
committed
Fix envFrom validation regex
1 parent 724d76d commit 7d50282

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

app/views/directives/edit-environment-from.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
id="envfrom-prefix-{{$index}}"
8585
name="envfrom-prefix-{{$index}}"
8686
ng-model="entry.prefix"
87-
ng-pattern="/^[a-zA-Z0-9_]+$/">
87+
ng-pattern="/^[A-Za-z_][A-Za-z0-9_]*$/">
8888

8989
<span ng-show="$ctrl.editEnvironmentFromForm['envfrom-prefix-'+$index].$touched">
9090
<span class="help-block key-validation-error"

dist/scripts/templates.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -6744,7 +6744,7 @@ angular.module('openshiftConsoleTemplates', []).run(['$templateCache', function(
67446744
"</div>\n" +
67456745
"<div class=\"environment-from-input\" ng-if=\"!$ctrl.isEnvFromReadonly(entry) && $ctrl.hasOptions()\" ng-class=\"{ 'has-error': ($ctrl.editEnvironmentFromForm['envfrom-prefix-'+$index].$invalid && $ctrl.editEnvironmentFromForm['envfrom-prefix-'+$index].$touched) }\">\n" +
67466746
"<label for=\"envfrom-prefix-{{$index}}\" class=\"sr-only\">Prefix</label>\n" +
6747-
"<input type=\"text\" class=\"form-control\" placeholder=\"Add prefix\" id=\"envfrom-prefix-{{$index}}\" name=\"envfrom-prefix-{{$index}}\" ng-model=\"entry.prefix\" ng-pattern=\"/^[a-zA-Z0-9_]+$/\">\n" +
6747+
"<input type=\"text\" class=\"form-control\" placeholder=\"Add prefix\" id=\"envfrom-prefix-{{$index}}\" name=\"envfrom-prefix-{{$index}}\" ng-model=\"entry.prefix\" ng-pattern=\"/^[A-Za-z_][A-Za-z0-9_]*$/\">\n" +
67486748
"<span ng-show=\"$ctrl.editEnvironmentFromForm['envfrom-prefix-'+$index].$touched\">\n" +
67496749
"<span class=\"help-block key-validation-error\" ng-show=\"$ctrl.editEnvironmentFromForm['envfrom-prefix-'+$index].$error.pattern\">\n" +
67506750
"<span class=\"validation-text\">Please enter a valid prefix.</span>\n" +

0 commit comments

Comments
 (0)