vault/ui/lib/ldap/addon/components/page/libraries.hbs
claire bontempo 4ac07e1d97
UI: HDS adoption replace <ConfirmAction> component (#21520)
* replace confirm-action dropdown with button+modal

* add modal frame to sidebar

* fix weird paragraph indent

* pass button text as arg

* add warning color to rotate modals

* update seal action and config ssh

* cleanup confirm action

* edit form

* add dropdown arg

* put back seal text

* put back confirm button text

* fix toolbar stylinggp

* popup member group

* move up title

* finish popup- components

* keymgmt

* fix modal button logic

* remaining app template components

* add period for angel

* vault cluster items

* add button text assertion

* remaining instances

* remove arg for passing confirm text

* contextual confirm action components

* delete old components

* update docs

* ammend dropdown loading states, add getter for confirm button color

* address feedback

* remove @disabled arg and add @disabledMessage

* add changelog;

* mfa tests

* update test selectors

* lol cleanup selectors

* start confirm action tests WIP

* move dropdown class directly to component

* add default color of isInDropdown

* final cleanup

* add tests

* remove @buttonColor as arg for dropdown

* update confirm action tests

* updae modals with disabled message

* refactor provider edit test
2023-11-17 23:44:21 +00:00

92 lines
3.1 KiB
Handlebars

{{!
Copyright (c) HashiCorp, Inc.
SPDX-License-Identifier: BUSL-1.1
~}}
<TabPageHeader @model={{@backendModel}} @breadcrumbs={{@breadcrumbs}}>
<:toolbarFilters>
{{#if (and (not @promptConfig) @libraries)}}
<FilterInput @placeholder="Filter libraries" @onInput={{fn (mut this.filterValue)}} />
{{/if}}
</:toolbarFilters>
<:toolbarActions>
{{#if @promptConfig}}
<ToolbarLink @route="configure" data-test-toolbar-action="config">
Configure LDAP
</ToolbarLink>
{{else}}
<ToolbarLink @route="libraries.create" @type="add" data-test-toolbar-action="library">
Create library
</ToolbarLink>
{{/if}}
</:toolbarActions>
</TabPageHeader>
{{#if @promptConfig}}
<ConfigCta />
{{else if (not this.filteredLibraries)}}
{{#if this.filterValue}}
<EmptyState @title="There are no libraries matching &quot;{{this.filterValue}}&quot;" />
{{else}}
<EmptyState
data-test-config-cta
@title="No libraries created yet"
@message="Use libraries to manage a set of highly privileged accounts that can be shared among a team."
>
<LinkTo class="has-top-margin-xs" @route="libraries.create">
Create library
</LinkTo>
</EmptyState>
{{/if}}
{{else}}
<div class="has-bottom-margin-s">
{{#each this.filteredLibraries as |library|}}
<ListItem @linkPrefix={{this.mountPoint}} @linkParams={{array "libraries.library.details" library.name}} as |Item|>
<Item.content>
<Icon @name="folder" />
<span data-test-library={{library.name}}>{{library.name}}</span>
</Item.content>
<Item.menu>
{{#if library.libraryPath.isLoading}}
<li class="action">
<Hds::Button disabled @color="tertiary" @icon="loading" @text="loading" @isIconOnly={{true}} />
</li>
{{else}}
<li class="action">
<LinkTo
class="has-text-black has-text-weight-semibold"
data-test-edit
@route="libraries.library.edit"
@model={{library}}
@disabled={{not library.canEdit}}
>
Edit
</LinkTo>
</li>
<li class="action">
<LinkTo
class="has-text-black has-text-weight-semibold"
data-test-details
@route="libraries.library.details"
@model={{library}}
@disabled={{not library.canRead}}
>
Details
</LinkTo>
</li>
{{#if library.canDelete}}
<ConfirmAction
data-test-delete
@id={{library.id}}
@isInDropdown={{true}}
@buttonText="Delete"
@confirmMessage="This library and associated accounts will be permanently deleted. You will not be able to recover it."
@onConfirmAction={{fn this.onDelete library}}
/>
{{/if}}
{{/if}}
</Item.menu>
</ListItem>
{{/each}}
</div>
{{/if}}