store secret key and value as an object to fix copy/show secret bug (#7926)

This commit is contained in:
Noelle Daley 2019-11-22 11:12:33 -08:00 committed by GitHub
parent e363c3809d
commit 3bd7e184a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 4 deletions

View File

@ -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);

View File

@ -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}}