Skip to content

Commit

Permalink
Merge pull request #212 from ottemo/awk_password-field-bug
Browse files Browse the repository at this point in the history
[#109488236 deliver] password field rendering bug
  • Loading branch information
Ian Wendt committed Dec 17, 2015
2 parents 4311f77 + 63e92c4 commit c220484
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 31 deletions.
1 change: 1 addition & 0 deletions app/scripts/design/directives/editor/guiPassword.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ angular.module("designModule")
return {
restrict: "EA",
scope: {
"attribute": "=editorScope",
"item": "=item"
},
templateUrl: $designService.getTemplate("design/gui/editor/password.html")
Expand Down
36 changes: 6 additions & 30 deletions app/themes/views/design/gui/editor/password.html
Original file line number Diff line number Diff line change
@@ -1,47 +1,23 @@
<ng-form name="passwordForm" novalidate>
<div class="form-group"
ng-class="{ 'has-error' : passwordForm.password.$invalid && passwordForm.password.$dirty}">
<label class="control-label">
Password*
<label class="control-label" for="inp_{{attribute.Attribute}}">
{{attribute.Label}}
<span ng-show="attribute.IsRequired">*</span>
</label>

<input type="password"
id="inp_{{attribute.Attribute}}"
class="form-control"
name="password"
ng-model="item.password"
ot-password
required
ng-model="item[attribute.Attribute]"
ng-required="attribute.IsRequired"
autocomplete="off">

<div class="help-block"
ng-show="passwordForm.password.$dirty">
<span ng-show="passwordForm.password.$error.required">This field is required.</span>
<span ng-show="passwordForm.password.$error['ot-password']">{{passwordForm.password.message}}</span>
</div>
</div>

<div class="form-group"
ng-class="{ 'has-error' : passwordForm.confirm_password.$invalid && passwordForm.confirm_password.$dirty}">
<label class="control-label">
Confirm*
</label>

<!-- NOTE: intentionally not bound to the model, because we send the whole model to the server
and the server will error out if there are any extra fields present -->
<input type="password"
class="form-control"
name="confirm_password"
ng-model="confirm_password"
ot-match="item.password"
required
autocomplete="off">

<div class="help-block"
ng-show="passwordForm.$submitted || passwordForm.confirm_password.$dirty">
<span ng-show="passwordForm.confirm_password.$error.required">This field is required.</span>
<span ng-show="passwordForm.confirm_password.$error.match">The two passwords don't match</span>
</div>
</div>

</ng-form>

2 changes: 1 addition & 1 deletion app/themes/views/design/gui/formBuilder.html
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@

<div ng-switch-when="password"
class="form-group col-xs-12 col-sm-6">
<gui-password item="item"></gui-password>
<gui-password item="item" editor-scope="attribute"></gui-password>
</div>

<div class="form-group col-xs-12 col-sm-6" ng-switch-when="boolean"
Expand Down

0 comments on commit c220484

Please sign in to comment.