vault/ui/lib/kmip/addon/templates/credentials/index.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

94 lines
3.2 KiB
Handlebars

<HeaderCredentials @role={{this.role}} @scope={{this.scope}} />
<Toolbar>
{{#if model.meta.total}}
<ToolbarFilters>
<NavigateInput
@filterFocusDidChange={{action "setFilterFocus" }}
@filterDidChange={{action "setFilter"}}
@filter={{this.filter}}
@filterMatchesKey={{filterMatchesKey}}
@firstPartialMatch={{firstPartialMatch}}
@placeholder="Filter credentials by serial number"
@urls={{hash
create="vault.cluster.secrets.backend.kmip.credentials.generate"
list="vault.cluster.secrets.backend.kmip.scope.roles"
show="vault.cluster.secrets.backend.kmip.credentials"
}}
/>
{{#if filterFocused}}
{{#if filterMatchesKey}}
<p class="input-hint">
<kbd>ENTER</kbd> to go to <code>{{this.filter}}</code> roles
</p>
{{/if}}
{{#if firstPartialMatch}}
<p class="input-hint">
<kbd>TAB</kbd> to complete <code>{{firstPartialMatch.id}}</code>
</p>
{{/if}}
{{/if}}
</ToolbarFilters>
{{/if}}
<ToolbarActions>
<ToolbarLink
@type="add"
@params={{array "credentials.generate"}}
data-test-kmip-link-generate-credentials
>
Generate credentials
</ToolbarLink>
</ToolbarActions>
</Toolbar>
<ListView @items={{model}} @itemNoun="credentials" @paginationRouteName="credentials.index" as |list|>
{{#if list.empty}}
<list.empty
@title="No credentials yet for this role"
@message="You can generate new credentials that will be limited to this role's allowed operations, then you can distribute them to your KMIP clients."
>
{{#link-to "credentials.generate"}}
Generate credentials
{{/link-to}}
</list.empty>
{{else if list.item}}
<ListItem @linkPrefix={{this.mountPoint}} @linkParams={{array "credentials.show" this.scope this.role list.item.id}} as |Item|>
<Item.content>
<Icon @name="file-text" class="has-text-grey-light" />{{list.item.id}}
</Item.content>
<Item.menu as |m|>
<li class="action">
{{#link-to "credentials.show" this.scope this.role list.item.id class="is-block"}}
View credentials
{{/link-to}}
</li>
{{#if list.item.deletePath.canDelete}}
<MenuLoader @loadingParam={{list.item.deletePath.isPending}}>
<m.Message
@id={{list.item.id}}
@triggerText="Revoke credentials"
@title="Revoke this?"
@message="Any client using these credentials will no longer be able to."
@confirmButtonText="Revoke"
@onConfirm={{action
(perform
Item.callMethod
"destroyRecord"
list.item
"Successfully revoked credentials"
"There was an error revoking the credentials"
(action "refresh")
)
}}
/>
</MenuLoader>
{{/if}}
</Item.menu>
</ListItem>
{{else}}
<ListItem as |Item|>
<Item.content>
There are no credentials that match {{this.filter}}, press <kbd>ENTER</kbd> to add one.
</Item.content>
</ListItem>
{{/if}}
</ListView>