diff --git a/ui/app/components/secure-variable-form.hbs b/ui/app/components/secure-variable-form.hbs index bf78bbd15..6d2868b4b 100644 --- a/ui/app/components/secure-variable-form.hbs +++ b/ui/app/components/secure-variable-form.hbs @@ -1,12 +1,10 @@ -
+ \ No newline at end of file diff --git a/ui/app/components/secure-variable-form.js b/ui/app/components/secure-variable-form.js index 1b119d855..4cb052b10 100644 --- a/ui/app/components/secure-variable-form.js +++ b/ui/app/components/secure-variable-form.js @@ -12,9 +12,6 @@ export default class SecureVariableFormComponent extends Component { @service router; @service flashMessages; - @tracked - shouldHideValues = true; - /** * @typedef {Object} DuplicatePathWarning * @property {string} path @@ -25,10 +22,6 @@ export default class SecureVariableFormComponent extends Component { */ @tracked duplicatePathWarning = null; - get valueFieldType() { - return this.shouldHideValues ? 'password' : 'text'; - } - get shouldDisableSave() { return !this.args.model?.path; } @@ -68,11 +61,6 @@ export default class SecureVariableFormComponent extends Component { } } - @action - toggleShowHide() { - this.shouldHideValues = !this.shouldHideValues; - } - @action appendRow() { this.keyValues.pushObject({ key: '', diff --git a/ui/app/components/secure-variable-form/input-group.hbs b/ui/app/components/secure-variable-form/input-group.hbs new file mode 100644 index 000000000..a2569369c --- /dev/null +++ b/ui/app/components/secure-variable-form/input-group.hbs @@ -0,0 +1,23 @@ + \ No newline at end of file diff --git a/ui/app/components/secure-variable-form/input-group.js b/ui/app/components/secure-variable-form/input-group.js new file mode 100644 index 000000000..36eac0a4a --- /dev/null +++ b/ui/app/components/secure-variable-form/input-group.js @@ -0,0 +1,18 @@ +// @ts-check + +import { action } from '@ember/object'; +import Component from '@glimmer/component'; +import { tracked } from '@glimmer/tracking'; + +export default class InputGroup extends Component { + @tracked isObscured = true; + + get inputType() { + return this.isObscured ? 'password' : 'text'; + } + + @action + toggleInputType() { + this.isObscured = !this.isObscured; + } +} diff --git a/ui/tests/integration/components/secure-variable-form-test.js b/ui/tests/integration/components/secure-variable-form-test.js index d779cfb64..fe2caf46b 100644 --- a/ui/tests/integration/components/secure-variable-form-test.js +++ b/ui/tests/integration/components/secure-variable-form-test.js @@ -81,42 +81,52 @@ module('Integration | Component | secure-variable-form', function (hooks) { ); }); - test('Values can be toggled to show/hide', async function (assert) { - this.set( - 'mockedModel', - server.create('variable', { - keyValues: [{ key: 'foo', value: 'bar' }], - }) - ); - - assert.expect(6); - - await render(hbs`