vault/ui/app/components/totp/key-qr-code.hbs
lane-wetmore 9998650de4
UI: Update TOTP QR default size and hide when 0 (#30636)
* update default qr size, hide when 0 and add test

* update test
2025-05-15 12:30:24 -05:00

42 lines
1.3 KiB
Handlebars

{{!
Copyright (c) HashiCorp, Inc.
SPDX-License-Identifier: BUSL-1.1
}}
<div class="box is-fullwidth is-sideless is-paddingless is-marginless">
<MessageError @model={{@model}} />
{{#unless @model.isError}}
<Hds::Alert @type="inline" @color="warning" class="has-top-bottom-margin" data-test-warning as |A|>
<A.Title>Warning</A.Title>
<A.Description>
You will not be able to access this information later, so please copy the information below.
</A.Description>
</Hds::Alert>
{{/unless}}
{{#each @model.generatedAttrs as |attr|}}
<InfoTableRow
@label={{capitalize (or attr.options.label (humanize (dasherize attr.name)))}}
@value={{get @model attr.name}}
/>
{{/each}}
{{#if (gt @model.qrSize 0)}}
<div class="list-item-row">
<div class="center-display column">
<QrCode
@text={{@model.url}}
@colorLight="#F7F7F7"
@width={{@model.qrSize}}
@height={{@model.qrSize}}
@correctLevel="L"
data-test-qrcode
/>
</div>
</div>
{{/if}}
</div>
<div class="field is-grouped box is-fullwidth is-bottomless">
<div class="control">
<Hds::Button @text="Continue" @color="secondary" {{on "click" @onReset}} data-test-back-button />
</div>
</div>