Skip to content

Commit

Permalink
store secret key and value as an object to fix copy/show secret bug (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
Noelle Daley authored Nov 22, 2019
1 parent 80fcc79 commit 05ca95e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
6 changes: 6 additions & 0 deletions ui/app/models/secret.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ export default DS.Model.extend(KeyMixin, {
renewable: attr('boolean'),

secretData: attr('object'),
secretKeyAndValue: computed('secretData', function() {
const data = this.get('secretData');
return Object.keys(data).map(key => {
return { key, value: data[key] };
});
}),

dataAsJSONString: computed('secretData', function() {
return JSON.stringify(this.get('secretData'), null, 2);
Expand Down
8 changes: 4 additions & 4 deletions ui/app/templates/partials/secret-form-show.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@
</div>
</div>
</div>
{{#each-in modelForData.secretData as |key value|}}
{{#info-table-row label=key value=value alwaysRender=true}}
{{masked-input value=value displayOnly=true allowCopy=true}}
{{#each modelForData.secretKeyAndValue as |secret|}}
{{#info-table-row label=secret.key value=secret.value alwaysRender=true}}
{{masked-input value=secret.value displayOnly=true allowCopy=true}}
{{/info-table-row}}
{{/each-in}}
{{/each}}
{{/if}}
{{/if}}

0 comments on commit 05ca95e

Please sign in to comment.