claire bontempo 05f32b69ee
UI: upgrade HDS to 4.12.0 (#28525)
* update hds to latest version

* yield dropdown Interactive text instead of use @text arg, results after running codemod

* remaining dropdown changes

* address sidebar nav IconButton deprecation, fix secret tests

* revert

* explicitly select popupmenu

* more test changes

* fix pki toggle button

* remove tracked prop in oidc client controller

* aaand more test updates

* change to tilde

* tilde yarn lock changes

* small cleanup items
2024-10-04 20:07:48 +00:00

78 lines
2.6 KiB
Handlebars
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{{!
Copyright (c) HashiCorp, Inc.
SPDX-License-Identifier: BUSL-1.1
~}}
<TabPageHeader
@model={{@backend}}
@filterRoles={{not @promptConfig}}
@query={{this.query}}
@breadcrumbs={{@breadcrumbs}}
@handleSearch={{this.handleSearch}}
@handleInput={{this.handleInput}}
@handleKeyDown={{this.handleKeyDown}}
>
{{#unless @promptConfig}}
<ToolbarLink @route="roles.create" @type="add" data-test-toolbar-roles-action>
Create role
</ToolbarLink>
{{/unless}}
</TabPageHeader>
{{#if @promptConfig}}
<ConfigCta />
{{else if (not @roles)}}
{{#if @filterValue}}
<EmptyState @title="There are no roles matching &quot;{{@filterValue}}&quot;" />
{{else}}
<EmptyState
data-test-config-cta
@title="No roles yet"
@message="When created, roles will be listed here. Create a role to start generating service account tokens."
/>
{{/if}}
{{else}}
<div class="has-bottom-margin-s">
{{#each @roles as |role|}}
<ListItem @linkPrefix={{this.mountPoint}} @linkParams={{array "roles.role.details" role.name}} as |Item|>
<Item.content>
<Icon @name="user" />
<span data-test-role={{role.name}}>{{role.name}}</span>
</Item.content>
<Item.menu>
{{#if (or role.canRead role.canEdit role.canDelete)}}
<Hds::Dropdown @isInline={{true}} @listPosition="bottom-right" as |dd|>
<dd.ToggleIcon
@icon="more-horizontal"
@text="More options"
@hasChevron={{false}}
data-test-popup-menu-trigger
/>
{{#if role.canRead}}
<dd.Interactive @route="roles.role.details" @model={{role}} data-test-details>Details</dd.Interactive>
{{/if}}
{{#if role.canEdit}}
<dd.Interactive data-test-edit @route="roles.role.edit" @model={{role}}>Edit</dd.Interactive>
{{/if}}
{{#if role.canDelete}}
<dd.Interactive
data-test-delete
@color="critical"
{{on "click" (fn (mut this.roleToDelete) role)}}
>Delete</dd.Interactive>
{{/if}}
</Hds::Dropdown>
{{/if}}
</Item.menu>
</ListItem>
{{/each}}
{{#if this.roleToDelete}}
<ConfirmModal
@color="critical"
@confirmMessage="Deleting this role means that youll need to recreate it in order to generate credentials again."
@onConfirm={{fn this.onDelete this.roleToDelete}}
@onClose={{fn (mut this.roleToDelete) null}}
/>
{{/if}}
</div>
{{/if}}