Skip to content

Commit 33a87c8

Browse files
author
OpenShift Bot
authored
Merge pull request #2188 from rhamilto/image-required-indicator-fix
Merged by openshift-bot
2 parents 0c5ffd4 + 0f246bb commit 33a87c8

File tree

2 files changed

+70
-74
lines changed

2 files changed

+70
-74
lines changed

app/views/directives/deploy-image.html

+69-71
Original file line numberDiff line numberDiff line change
@@ -114,83 +114,81 @@ <h2>
114114
</div>
115115
</div>
116116

117-
<div class="row" ng-if-end>
118-
<div class="col-sm-12">
119-
<ng-form name="forms.deployImage" class="osc-form">
120-
<div class="form-group">
121-
<label for="name" class="required">Name</label>
122-
<div ng-class="{'has-error': (forms.deployImage.name.$invalid && forms.deployImage.name.$touched) || nameTaken}">
123-
<input type="text"
124-
required
125-
select-on-focus
126-
minlength="2"
127-
maxlength="24"
128-
pattern="[a-z]([-a-z0-9]*[a-z0-9])?"
129-
ng-model="app.name"
130-
id="name"
131-
name="name"
132-
class="form-control"
133-
autocorrect="off"
134-
autocapitalize="none"
135-
spellcheck="false">
117+
<div ng-if-end>
118+
<ng-form name="forms.deployImage" class="osc-form">
119+
<div class="form-group">
120+
<label for="name" class="required">Name</label>
121+
<div ng-class="{'has-error': (forms.deployImage.name.$invalid && forms.deployImage.name.$touched) || nameTaken}">
122+
<input type="text"
123+
required
124+
select-on-focus
125+
minlength="2"
126+
maxlength="24"
127+
pattern="[a-z]([-a-z0-9]*[a-z0-9])?"
128+
ng-model="app.name"
129+
id="name"
130+
name="name"
131+
class="form-control"
132+
autocorrect="off"
133+
autocapitalize="none"
134+
spellcheck="false">
135+
</div>
136+
<div class="help-block">Identifies the resources created for this image.</div>
137+
<div class="has-error" ng-show="forms.deployImage.name.$invalid && forms.deployImage.name.$touched">
138+
<div class="help-block" ng-show="forms.deployImage.name.$error.required">
139+
A name is required.
136140
</div>
137-
<div class="help-block">Identifies the resources created for this image.</div>
138-
<div class="has-error" ng-show="forms.deployImage.name.$invalid && forms.deployImage.name.$touched">
139-
<div class="help-block" ng-show="forms.deployImage.name.$error.required">
140-
A name is required.
141-
</div>
142-
<div class="help-block" ng-show="forms.deployImage.name.$error.pattern">
143-
Name must be an alphanumeric (a-z, 0-9) string with a maximum length
144-
of 24 characters where the first character is a letter (a-z). The '-'
145-
character is allowed anywhere except the first or last character.
146-
</div>
147-
<div class="help-block" ng-show="forms.deployImage.name.$error.minlength">
148-
Name must have at least 2 characters.
149-
</div>
150-
<div class="help-block" ng-show="forms.deployImage.name.$error.maxlength">
151-
Name can't have more than 24 characters.
152-
</div>
141+
<div class="help-block" ng-show="forms.deployImage.name.$error.pattern">
142+
Name must be an alphanumeric (a-z, 0-9) string with a maximum length
143+
of 24 characters where the first character is a letter (a-z). The '-'
144+
character is allowed anywhere except the first or last character.
153145
</div>
154-
<div class="has-error" ng-show="nameTaken">
155-
<span class="help-block">This name is already in use within the project. Please choose a different name.</span>
146+
<div class="help-block" ng-show="forms.deployImage.name.$error.minlength">
147+
Name must have at least 2 characters.
156148
</div>
149+
<div class="help-block" ng-show="forms.deployImage.name.$error.maxlength">
150+
Name can't have more than 24 characters.
151+
</div>
152+
</div>
153+
<div class="has-error" ng-show="nameTaken">
154+
<span class="help-block">This name is already in use within the project. Please choose a different name.</span>
157155
</div>
158-
<osc-form-section
159-
header="Environment Variables"
160-
about-title="Environment Variables"
161-
about="Environment variables are used to configure and pass information to running containers."
162-
expand="true"
163-
can-toggle="false"
164-
class="first-section">
165-
<key-value-editor
166-
entries="env"
167-
key-placeholder="Name"
168-
key-validator="[A-Za-z_][A-Za-z0-9_]*"
169-
key-validator-error="A valid environment variable name is an alphanumeric (a-z and 0-9) string beginning with a letter that may contain underscores."
170-
value-placeholder="Value"
171-
value-from-selector-options="input.selectedProject.metadata.uid && valueFromNamespace[input.selectedProject.metadata.name]"
172-
add-row-link="Add Environment Variable"
173-
add-row-with-selectors-link="Add Environment Variable Using a Config Map or Secret"></key-value-editor>
174-
</osc-form-section>
156+
</div>
157+
<osc-form-section
158+
header="Environment Variables"
159+
about-title="Environment Variables"
160+
about="Environment variables are used to configure and pass information to running containers."
161+
expand="true"
162+
can-toggle="false"
163+
class="first-section">
164+
<key-value-editor
165+
entries="env"
166+
key-placeholder="Name"
167+
key-validator="[A-Za-z_][A-Za-z0-9_]*"
168+
key-validator-error="A valid environment variable name is an alphanumeric (a-z and 0-9) string beginning with a letter that may contain underscores."
169+
value-placeholder="Value"
170+
value-from-selector-options="input.selectedProject.metadata.uid && valueFromNamespace[input.selectedProject.metadata.name]"
171+
add-row-link="Add Environment Variable"
172+
add-row-with-selectors-link="Add Environment Variable Using a Config Map or Secret"></key-value-editor>
173+
</osc-form-section>
175174

176-
<label-editor
177-
labels="labels"
178-
expand="true"
179-
can-toggle="false"
180-
help-text="Each label is applied to each created resource.">
181-
</label-editor>
175+
<label-editor
176+
labels="labels"
177+
expand="true"
178+
can-toggle="false"
179+
help-text="Each label is applied to each created resource.">
180+
</label-editor>
182181

183-
<alerts alerts="alerts"></alerts>
184-
<div ng-if="!isDialog" class="button-group gutter-bottom" ng-class="{'gutter-top': !alerts.length}">
185-
<button type="submit"
186-
class="btn btn-primary btn-lg"
187-
ng-click="create()"
188-
value=""
189-
ng-disabled="forms.deployImage.$invalid || nameTaken || disableInputs">Create</button>
190-
<a class="btn btn-default btn-lg" href="#" back>Cancel</a>
191-
</div>
192-
</ng-form>
193-
</div>
182+
<alerts alerts="alerts"></alerts>
183+
<div ng-if="!isDialog" class="button-group gutter-bottom" ng-class="{'gutter-top': !alerts.length}">
184+
<button type="submit"
185+
class="btn btn-primary btn-lg"
186+
ng-click="create()"
187+
value=""
188+
ng-disabled="forms.deployImage.$invalid || nameTaken || disableInputs">Create</button>
189+
<a class="btn btn-default btn-lg" href="#" back>Cancel</a>
190+
</div>
191+
</ng-form>
194192
</div>
195193

196194
<div ng-if="!loading && import.error" class="empty-state-message text-center">

dist/scripts/templates.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -6382,8 +6382,7 @@ angular.module('openshiftConsoleTemplates', []).run(['$templateCache', function(
63826382
"</div>\n" +
63836383
"</div>\n" +
63846384
"</div>\n" +
6385-
"<div class=\"row\" ng-if-end>\n" +
6386-
"<div class=\"col-sm-12\">\n" +
6385+
"<div ng-if-end>\n" +
63876386
"<ng-form name=\"forms.deployImage\" class=\"osc-form\">\n" +
63886387
"<div class=\"form-group\">\n" +
63896388
"<label for=\"name\" class=\"required\">Name</label>\n" +
@@ -6421,7 +6420,6 @@ angular.module('openshiftConsoleTemplates', []).run(['$templateCache', function(
64216420
"</div>\n" +
64226421
"</ng-form>\n" +
64236422
"</div>\n" +
6424-
"</div>\n" +
64256423
"<div ng-if=\"!loading && import.error\" class=\"empty-state-message text-center\">\n" +
64266424
"<h2>\n" +
64276425
"<i class=\"pficon pficon-error-circle-o\" aria-hidden=\"true\"></i>\n" +

0 commit comments

Comments
 (0)