add tips for secret controls

This commit is contained in:
Jake McDermott 2019-03-13 19:08:12 -04:00
parent 43456d13c4
commit 1eda939ce2
No known key found for this signature in database
GPG Key ID: 9A6F084352C3A0B7
4 changed files with 20 additions and 7 deletions

View File

@ -4,12 +4,12 @@ function ComponentsStrings (BaseString) {
const { t } = this;
const ns = this.components;
ns.REPLACE = t.s('REPLACE');
ns.REVERT = t.s('REVERT');
ns.REPLACE = t.s('Replace');
ns.REVERT = t.s('Revert');
ns.ENCRYPTED = t.s('ENCRYPTED');
ns.OPTIONS = t.s('OPTIONS');
ns.SHOW = t.s('SHOW');
ns.HIDE = t.s('HIDE');
ns.SHOW = t.s('Show');
ns.HIDE = t.s('Hide');
ns.message = {
REQUIRED_INPUT_MISSING: t.s('Please enter a value.'),

View File

@ -22,12 +22,14 @@ function AtInputSecretController (baseInputController) {
scope = _scope_;
scope.type = 'password';
scope.state._show = false;
scope.state._showHideText = vm.strings.get('SHOW');
if (!scope.state._value || scope.state._promptOnLaunch) {
scope.mode = 'input';
} else {
scope.mode = 'encrypted';
scope.state._placeholder = vm.strings.get('ENCRYPTED');
scope.state._buttonText = vm.strings.get('REPLACE');
}
vm.check();
@ -49,9 +51,11 @@ function AtInputSecretController (baseInputController) {
if (scope.type === 'password') {
scope.type = 'text';
scope.state._show = true;
scope.state._showHideText = vm.strings.get('HIDE');
} else {
scope.type = 'password';
scope.state._show = false;
scope.state._showHideText = vm.strings.get('SHOW');
}
};

View File

@ -35,7 +35,10 @@
<button
class="btn at-ButtonHollow--default at-Input-button"
ng-disabled="state.asTag || (!state._enableToggle && (state._disabled || form.disabled))"
ng-click="vm.toggleRevertReplace()">
ng-click="vm.toggleRevertReplace()"
aw-tool-tip="{{ state._buttonText }}"
data-tip-watch="state._buttonText"
data-placement="top">
<i ng-show="!state._isBeingReplaced" class="fa fa-undo"></i>
<i ng-show="state._isBeingReplaced" class="fa fa-undo fa-flip-horizontal"></i>
</button>
@ -44,7 +47,10 @@
<button
class="btn at-ButtonHollow--default at-Input-button"
ng-disabled="state.asTag || state._disabled || form.disabled"
ng-click="vm.toggleShowHide()">
ng-click="vm.toggleShowHide()"
aw-tool-tip="{{ state._showHideText }}"
data-tip-watch="state._showHideText"
data-placement="top">
<i ng-show="!state._show" class="fa fa-eye"></i>
<i ng-show="state._show" class="fa fa-eye-slash"></i>
</button>

View File

@ -23,7 +23,7 @@
ng-show="state.asTag"
class="form-control at-Input at-InputTaggedTextarea"
ng-class="{
'at-Input--rejected': state._rejected,
'at-Input--rejected': state._rejected,
}"
>
<div class="at-InputTagContainer">
@ -50,6 +50,9 @@
class="btn at-ButtonHollow--white at-Input-button--long-sm"
ng-disabled="state.asTag || (!state._enableToggle && (state._disabled || form.disabled))"
ng-click="state._isBeingReplaced = !state._isBeingReplaced"
aw-tool-tip="{{ state._buttonText }}"
data-tip-watch="state._buttonText"
data-placement="top"
>
<i ng-show="!state._isBeingReplaced" class="fa fa-undo"></i>
<i ng-show="state._isBeingReplaced" class="fa fa-undo fa-flip-horizontal"></i>