From f4a93bb840710912a1d169bd9be4f4081a023447 Mon Sep 17 00:00:00 2001 From: Angel Garbarino Date: Thu, 20 Aug 2020 11:16:30 -0600 Subject: [PATCH] Ui/transform cleanup 2 (#9789) * amend encode/decode commands for now until design gets back with more details * restrict character count on masking input field * clean up selectLimit * show backend instead of transform in cli copy command --- ui/app/models/transform.js | 1 + ui/app/templates/components/transform-create-form.hbs | 1 - ui/app/templates/components/transform-edit-form.hbs | 1 - .../components/transform-show-transformation.hbs | 8 ++++---- ui/lib/core/addon/components/search-select.js | 5 ----- ui/lib/core/addon/templates/components/form-field.hbs | 2 +- 6 files changed, 6 insertions(+), 12 deletions(-) diff --git a/ui/app/models/transform.js b/ui/app/models/transform.js index a7e013a8442f..106bf0f310fa 100644 --- a/ui/app/models/transform.js +++ b/ui/app/models/transform.js @@ -58,6 +58,7 @@ const Model = DS.Model.extend({ subText: `A tweak value is used when performing FPE transformations. This can be supplied, generated, or internal.`, // TODO: I do not include the link here. Need to figure out the best way to approach this. }), masking_character: attr('string', { + characterLimit: 1, defaultValue: '*', label: 'Masking character', subText: 'Specify which character you’d like to mask your data.', diff --git a/ui/app/templates/components/transform-create-form.hbs b/ui/app/templates/components/transform-create-form.hbs index d5d3f8f1de1f..fced8c8e94c2 100644 --- a/ui/app/templates/components/transform-create-form.hbs +++ b/ui/app/templates/components/transform-create-form.hbs @@ -11,7 +11,6 @@ data-test-field @attr={{attr}} @model={{model}} - @selectLimit={{selectLimit}} /> {{else}} {{else if (eq attr.name 'templates')}} {{!-- TODO: for now don't show until backend makes api changes. --}} diff --git a/ui/app/templates/components/transform-show-transformation.hbs b/ui/app/templates/components/transform-show-transformation.hbs index 35e80a46350d..22a4ec8e4f4f 100644 --- a/ui/app/templates/components/transform-show-transformation.hbs +++ b/ui/app/templates/components/transform-show-transformation.hbs @@ -18,8 +18,8 @@
- {{#let "vault write transform/encode/payments value=" as |copyEncodeCommand|}} - vault write transform/encode/payments value=<enter your value here> + {{#let "vault write /encode/ value= tweak=" as |copyEncodeCommand|}} + vault write <backend>/encode/<your role name> value=<enter your value here> tweak=<base-64 string> @@ -35,8 +35,8 @@
- {{#let "vault write transform/decode/payments value=" as |copyDecodeCommand|}} - vault write transform/decode/payments value=<enter your value here> + {{#let "vault write /decode/ value= tweak=" as |copyDecodeCommand|}} + vault write <backend>/decode/<your role name> value=<enter your value here> tweak=<base-64 string> diff --git a/ui/lib/core/addon/components/search-select.js b/ui/lib/core/addon/components/search-select.js index 0228c81a880e..5fb3452ed641 100644 --- a/ui/lib/core/addon/components/search-select.js +++ b/ui/lib/core/addon/components/search-select.js @@ -136,11 +136,6 @@ export default Component.extend({ this.handleChange(); }, selectOption(option) { - if (this.selectLimit) { - if (this.selectLimit <= this.selectedOptions.length) { - return; - } - } this.selectedOptions.pushObject(option); this.options.removeObject(option); this.handleChange(); diff --git a/ui/lib/core/addon/templates/components/form-field.hbs b/ui/lib/core/addon/templates/components/form-field.hbs index aa7892fda6af..f6090607c6d6 100644 --- a/ui/lib/core/addon/templates/components/form-field.hbs +++ b/ui/lib/core/addon/templates/components/form-field.hbs @@ -155,7 +155,7 @@ value={{or (get model valuePath) attr.options.defaultValue}} oninput={{action (action "setAndBroadcast" valuePath) value="target.value" - }} class="input" /> + }} class="input" maxLength={{attr.options.characterLimit}} /> {{#if attr.options.validationAttr}} {{#if