Skip to content

Commit

Permalink
Ui/transform cleanup 2 (#9789)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
Monkeychip committed Aug 20, 2020
1 parent 9939a85 commit f4a93bb
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 12 deletions.
1 change: 1 addition & 0 deletions ui/app/models/transform.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.',
Expand Down
1 change: 0 additions & 1 deletion ui/app/templates/components/transform-create-form.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
data-test-field
@attr={{attr}}
@model={{model}}
@selectLimit={{selectLimit}}
/>
{{else}}
<FormField
Expand Down
1 change: 0 additions & 1 deletion ui/app/templates/components/transform-edit-form.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
@attr={{attr}}
@model={{model}}
@initialSelected={{model.templates}}
@selectLimit={{selectLimit}}
/>
{{else if (eq attr.name 'templates')}}
{{!-- TODO: for now don't show until backend makes api changes. --}}
Expand Down
8 changes: 4 additions & 4 deletions ui/app/templates/components/transform-show-transformation.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
</span>
</div>
<div class="copy-text level">
{{#let "vault write transform/encode/payments value=<enter your value here>" as |copyEncodeCommand|}}
<code>vault write transform/encode/payments value=&lt;enter your value here&gt;</code>
{{#let "vault write <backend>/encode/<your role name> value=<enter your value here> tweak=<base-64-string>" as |copyEncodeCommand|}}
<code>vault write &lt;backend&gt;/encode/&lt;your role name&gt; value=&lt;enter your value here&gt; tweak=&lt;base-64 string&gt;</code>
<CopyButton class="button is-transparent level-right" @clipboardText={{copyEncodeCommand}}
@buttonType="button" @success={{action (set-flash-message 'Command copied!')}}>
<Icon @size='l' @glyph="copy-action" aria-label="Copy" />
Expand All @@ -35,8 +35,8 @@
</span>
</div>
<div class="copy-text level">
{{#let "vault write transform/decode/payments value=<enter your value here>" as |copyDecodeCommand|}}
<code>vault write transform/decode/payments value=&lt;enter your value here&gt;</code>
{{#let "vault write <backend>/decode/<your role name> value=<enter your value here> tweak=<base-64-string>" as |copyDecodeCommand|}}
<code>vault write &lt;backend&gt;/decode/&lt;your role name&gt; value=&lt;enter your value here&gt; tweak=&lt;base-64 string&gt;</code>
<CopyButton class="button is-transparent level-right" @clipboardText={{copyDecodeCommand}}
@buttonType="button" @success={{action (set-flash-message 'Command copied!')}}>
<Icon @size='l' @glyph="copy-action" aria-label="Copy" />
Expand Down
5 changes: 0 additions & 5 deletions ui/lib/core/addon/components/search-select.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion ui/lib/core/addon/templates/components/form-field.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f4a93bb

Please sign in to comment.