vault/ui/app/templates/components/tool-unwrap.hbs
Jordan Reimer d8112714cf
Incorporate Ember Flight Icons (#12976)
* adds ember-flight-icons dependecy

* adds inline-json-import babel plugin

* adds flight icon styling

* updates Icon component to support flight icons

* updates Icon component usages to new api and updates name values to flight icon set when available

* fixes tests

* updates icon story with flight mappings and fixes issue with flight icons not rendering in storybook

* adds changelog

* fixes typo in sign action glyph name in transit-key model

* adds comments to icon-map

* updates Icon component to use only supported flight icon sizes

* adds icon transform codemod

* updates icon transform formatting to handle edge case

* runs icon transform on templates

* updates Icon usage in toolbar-filter md and story

* updates tests
2021-12-07 10:05:14 -07:00

78 lines
2.9 KiB
Handlebars

<PageHeader as |p|>
<p.levelLeft>
<h1 class="title is-3">
Unwrap data
</h1>
</p.levelLeft>
</PageHeader>
{{#if @unwrap_data}}
<div class="box is-sideless is-fullwidth is-marginless">
<nav class="tabs">
<ul>
<li role="tab" aria-selected={{if (eq @unwrapActiveTab "data") "true" "false"}} class="{{if (eq @unwrapActiveTab "data") "is-active"}}">
<button type="button" class="link link-plain tab has-text-weight-semibold" {{action (mut @unwrapActiveTab) "data"}} data-test-button-data>Data</button>
</li>
<li role="tab" aria-selected={{if (eq @unwrapActiveTab "data") "true" "false"}} class="{{if (eq @unwrapActiveTab "details") "is-active"}}">
<button type="button" class="link link-plain tab has-text-weight-semibold" {{action (mut @unwrapActiveTab) "details"}} data-test-button-details>Wrap Details</button>
</li>
</ul>
</nav>
{{#if (eq @unwrapActiveTab "data")}}
<div class="field">
<div class="control">
<JsonEditor @title="Unwrapped Data" @value={{stringify @unwrap_data}} @options={{hash
readOnly=true
}} />
</div>
</div>
{{else}}
<div class="field box is-fullwidth is-shadowless is-paddingless is-marginless">
{{#each-in @details as |key detail|}}
<InfoTableRow @label={{key}} @value={{key}}>
{{#if (or (eq detail "No") (eq detail "None"))}}
<Icon @name="x-circle" class="has-text-grey" />
{{detail}}
{{else}}
{{#if (eq detail "Yes") }}
<Icon @name="check-circle" class="has-text-success" />
{{/if}}
{{detail}}
{{/if}}
</InfoTableRow>
{{/each-in}}
</div>
{{/if}}
</div>
<div class="field is-grouped box is-fullwidth is-bottomless">
<div class="control">
<CopyButton @clipboardText={{stringify @unwrap_data}} @class="button is-primary" @buttonType="button" @success={{action (set-flash-message "Data copied!")}}>
Copy
</CopyButton>
</div>
<div class="control">
<button {{on "click" this.onClear}} type="button" class="button">
Back
</button>
</div>
</div>
{{else}}
<div class="box is-sideless is-fullwidth is-marginless">
<NamespaceReminder @mode="perform" @noun={{@selectedAction}} />
<MessageError @errors={{@errors}} />
<div class="field">
<label for="token" class="is-label">Wrapping token</label>
<div class="control">
<Input @value={{@token}} class="input" @id="token" @name="token" @autocomplete="off" @spellcheck="false" data-test-tools-input="wrapping-token" />
</div>
</div>
</div>
<div class="field is-grouped box is-fullwidth is-bottomless">
<div class="control">
<button type="submit" data-test-tools-submit="true" class="button is-primary">
Unwrap data
</button>
</div>
</div>
{{/if}}