From b0d999cf3cffbf3db09f7add83bd7acba8b1b470 Mon Sep 17 00:00:00 2001 From: Carlos Alcaide Date: Wed, 7 Jul 2021 12:39:44 -0700 Subject: [PATCH] =?UTF-8?q?feat:=20=F0=9F=8E=B8=20Add=20toggle=20secret=20?= =?UTF-8?q?feature?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add toggle secret feature to the hidde secret component --- ui/desktop/app/components/hidden-secret/index.hbs | 13 ++++++++++++- ui/desktop/app/components/hidden-secret/index.js | 9 +++++++++ ui/desktop/app/styles/app.scss | 4 ++++ .../app/templates/scopes/scope/projects/targets.hbs | 4 ++-- 4 files changed, 27 insertions(+), 3 deletions(-) diff --git a/ui/desktop/app/components/hidden-secret/index.hbs b/ui/desktop/app/components/hidden-secret/index.hbs index a28042fd6..aacb6d165 100644 --- a/ui/desktop/app/components/hidden-secret/index.hbs +++ b/ui/desktop/app/components/hidden-secret/index.hbs @@ -1,9 +1,20 @@
+ - {{this.textMask}} + + {{#if this.secretVisible}} + {{@secret}} + {{else}} + {{this.textMask}} + {{/if}} +
\ No newline at end of file diff --git a/ui/desktop/app/components/hidden-secret/index.js b/ui/desktop/app/components/hidden-secret/index.js index f5b443ff2..6894d79d1 100644 --- a/ui/desktop/app/components/hidden-secret/index.js +++ b/ui/desktop/app/components/hidden-secret/index.js @@ -1,5 +1,14 @@ import Component from '@glimmer/component'; +import { action } from '@ember/object'; +import { tracked } from '@glimmer/tracking'; export default class HiddenSecretComponent extends Component { textMask = '■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■'; + + @tracked secretVisible = false; + + @action + toggleSecretVisibility() { + this.secretVisible = !this.secretVisible; + } } diff --git a/ui/desktop/app/styles/app.scss b/ui/desktop/app/styles/app.scss index 6bf7c387e..ad090994c 100644 --- a/ui/desktop/app/styles/app.scss +++ b/ui/desktop/app/styles/app.scss @@ -480,6 +480,10 @@ $chevron-down: url("data:image/svg+xml;utf-8, - {{t + {{t 'form.key.label' }} {{t @@ -102,7 +102,7 @@ {{#each credential.secrets as |secret|}} - {{secret.key}} + {{secret.key}}