store secret key and value as an object to fix copy/show secret bug (#7926)
This commit is contained in:
parent
e363c3809d
commit
3bd7e184a0
|
@ -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);
|
||||
|
|
|
@ -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}}
|
||||
|
|
Loading…
Reference in New Issue