feat(k8s/application): Update form validation for environment variables when deploying an application (#4177)

pull/4192/head
Maxime Bajeux 2020-08-11 00:56:54 +02:00 committed by GitHub
parent 56524ca7d5
commit baaa96f34f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -147,6 +147,7 @@
class="form-control"
ng-model="envVar.Name"
ng-change="ctrl.onChangeEnvironmentName($index)"
ng-pattern="/^[a-zA-Z]([-_a-zA-Z0-9]*[a-zA-Z0-9])?$/"
placeholder="foo"
required
/>
@ -158,6 +159,10 @@
>
<ng-messages for="kubernetesApplicationCreationForm['environment_variable_name_' + $index].$error">
<p ng-message="required"><i class="fa fa-exclamation-triangle" aria-hidden="true"></i> Environment variable name is required.</p>
<p ng-message="pattern"
><i class="fa fa-exclamation-triangle" aria-hidden="true"></i> This field must consist alphanumeric characters, '-' or '_', start with an alphabetic
character, and end with an alphanumeric character (e.g. 'my-var', or 'MY_VAR123').</p
>
</ng-messages>
<p ng-if="ctrl.state.duplicateEnvironmentVariables[$index] !== undefined"
><i class="fa fa-exclamation-triangle" aria-hidden="true"></i> This environment variable is already defined.</p