Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes bug where required field indicator was misaligned in deploy ima… #2188

Merged
merged 1 commit into from
Sep 29, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
140 changes: 69 additions & 71 deletions app/views/directives/deploy-image.html
Original file line number Diff line number Diff line change
Expand Up @@ -114,83 +114,81 @@ <h2>
</div>
</div>

<div class="row" ng-if-end>
<div class="col-sm-12">
<ng-form name="forms.deployImage" class="osc-form">
<div class="form-group">
<label for="name" class="required">Name</label>
<div ng-class="{'has-error': (forms.deployImage.name.$invalid && forms.deployImage.name.$touched) || nameTaken}">
<input type="text"
required
select-on-focus
minlength="2"
maxlength="24"
pattern="[a-z]([-a-z0-9]*[a-z0-9])?"
ng-model="app.name"
id="name"
name="name"
class="form-control"
autocorrect="off"
autocapitalize="none"
spellcheck="false">
<div ng-if-end>
<ng-form name="forms.deployImage" class="osc-form">
<div class="form-group">
<label for="name" class="required">Name</label>
<div ng-class="{'has-error': (forms.deployImage.name.$invalid && forms.deployImage.name.$touched) || nameTaken}">
<input type="text"
required
select-on-focus
minlength="2"
maxlength="24"
pattern="[a-z]([-a-z0-9]*[a-z0-9])?"
ng-model="app.name"
id="name"
name="name"
class="form-control"
autocorrect="off"
autocapitalize="none"
spellcheck="false">
</div>
<div class="help-block">Identifies the resources created for this image.</div>
<div class="has-error" ng-show="forms.deployImage.name.$invalid && forms.deployImage.name.$touched">
<div class="help-block" ng-show="forms.deployImage.name.$error.required">
A name is required.
</div>
<div class="help-block">Identifies the resources created for this image.</div>
<div class="has-error" ng-show="forms.deployImage.name.$invalid && forms.deployImage.name.$touched">
<div class="help-block" ng-show="forms.deployImage.name.$error.required">
A name is required.
</div>
<div class="help-block" ng-show="forms.deployImage.name.$error.pattern">
Name must be an alphanumeric (a-z, 0-9) string with a maximum length
of 24 characters where the first character is a letter (a-z). The '-'
character is allowed anywhere except the first or last character.
</div>
<div class="help-block" ng-show="forms.deployImage.name.$error.minlength">
Name must have at least 2 characters.
</div>
<div class="help-block" ng-show="forms.deployImage.name.$error.maxlength">
Name can't have more than 24 characters.
</div>
<div class="help-block" ng-show="forms.deployImage.name.$error.pattern">
Name must be an alphanumeric (a-z, 0-9) string with a maximum length
of 24 characters where the first character is a letter (a-z). The '-'
character is allowed anywhere except the first or last character.
</div>
<div class="has-error" ng-show="nameTaken">
<span class="help-block">This name is already in use within the project. Please choose a different name.</span>
<div class="help-block" ng-show="forms.deployImage.name.$error.minlength">
Name must have at least 2 characters.
</div>
<div class="help-block" ng-show="forms.deployImage.name.$error.maxlength">
Name can't have more than 24 characters.
</div>
</div>
<div class="has-error" ng-show="nameTaken">
<span class="help-block">This name is already in use within the project. Please choose a different name.</span>
</div>
<osc-form-section
header="Environment Variables"
about-title="Environment Variables"
about="Environment variables are used to configure and pass information to running containers."
expand="true"
can-toggle="false"
class="first-section">
<key-value-editor
entries="env"
key-placeholder="Name"
key-validator="[A-Za-z_][A-Za-z0-9_]*"
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."
value-placeholder="Value"
value-from-selector-options="input.selectedProject.metadata.uid && valueFromNamespace[input.selectedProject.metadata.name]"
add-row-link="Add Environment Variable"
add-row-with-selectors-link="Add Environment Variable Using a Config Map or Secret"></key-value-editor>
</osc-form-section>
</div>
<osc-form-section
header="Environment Variables"
about-title="Environment Variables"
about="Environment variables are used to configure and pass information to running containers."
expand="true"
can-toggle="false"
class="first-section">
<key-value-editor
entries="env"
key-placeholder="Name"
key-validator="[A-Za-z_][A-Za-z0-9_]*"
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."
value-placeholder="Value"
value-from-selector-options="input.selectedProject.metadata.uid && valueFromNamespace[input.selectedProject.metadata.name]"
add-row-link="Add Environment Variable"
add-row-with-selectors-link="Add Environment Variable Using a Config Map or Secret"></key-value-editor>
</osc-form-section>

<label-editor
labels="labels"
expand="true"
can-toggle="false"
help-text="Each label is applied to each created resource.">
</label-editor>
<label-editor
labels="labels"
expand="true"
can-toggle="false"
help-text="Each label is applied to each created resource.">
</label-editor>

<alerts alerts="alerts"></alerts>
<div ng-if="!isDialog" class="button-group gutter-bottom" ng-class="{'gutter-top': !alerts.length}">
<button type="submit"
class="btn btn-primary btn-lg"
ng-click="create()"
value=""
ng-disabled="forms.deployImage.$invalid || nameTaken || disableInputs">Create</button>
<a class="btn btn-default btn-lg" href="#" back>Cancel</a>
</div>
</ng-form>
</div>
<alerts alerts="alerts"></alerts>
<div ng-if="!isDialog" class="button-group gutter-bottom" ng-class="{'gutter-top': !alerts.length}">
<button type="submit"
class="btn btn-primary btn-lg"
ng-click="create()"
value=""
ng-disabled="forms.deployImage.$invalid || nameTaken || disableInputs">Create</button>
<a class="btn btn-default btn-lg" href="#" back>Cancel</a>
</div>
</ng-form>
</div>

<div ng-if="!loading && import.error" class="empty-state-message text-center">
Expand Down
4 changes: 1 addition & 3 deletions dist/scripts/templates.js
Original file line number Diff line number Diff line change
Expand Up @@ -6382,8 +6382,7 @@ angular.module('openshiftConsoleTemplates', []).run(['$templateCache', function(
"</div>\n" +
"</div>\n" +
"</div>\n" +
"<div class=\"row\" ng-if-end>\n" +
"<div class=\"col-sm-12\">\n" +
"<div ng-if-end>\n" +
"<ng-form name=\"forms.deployImage\" class=\"osc-form\">\n" +
"<div class=\"form-group\">\n" +
"<label for=\"name\" class=\"required\">Name</label>\n" +
Expand Down Expand Up @@ -6421,7 +6420,6 @@ angular.module('openshiftConsoleTemplates', []).run(['$templateCache', function(
"</div>\n" +
"</ng-form>\n" +
"</div>\n" +
"</div>\n" +
"<div ng-if=\"!loading && import.error\" class=\"empty-state-message text-center\">\n" +
"<h2>\n" +
"<i class=\"pficon pficon-error-circle-o\" aria-hidden=\"true\"></i>\n" +
Expand Down