VAULT-42410 - Refactored empty state component for kmip directory (#12806) (#13020)

* VAULT-42410 - refactored empty state component for kmip directory

* added data-test attributes

* fixed failing tests

Co-authored-by: mohit-hashicorp <mohit.ojha@hashicorp.com>
This commit is contained in:
Vault Automation 2026-03-13 23:14:55 -04:00 committed by GitHub
parent 94c5e6b68e
commit b5c6e83db1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 57 additions and 26 deletions

View file

@ -50,8 +50,8 @@
<MaskedInput @value={{@config.ca_pem}} @displayOnly={{true}} @allowCopy={{true}} />
</InfoTableRow>
{{else}}
<EmptyState
@title="No configuration for this secrets engine"
@message="We'll need to configure a few things before getting started."
/>
<Hds::ApplicationState class="top-padding-32 is-marginless" as |A|>
<A.Header @title="No configuration for this secrets engine" @titleTag="h2" data-test-empty-state-title />
<A.Body @text="We'll need to configure a few things before getting started." data-test-empty-state-message />
</Hds::ApplicationState>
{{/if}}

View file

@ -95,13 +95,23 @@
</div>
{{else}}
{{#if @filterValue}}
<EmptyState @title="There are no credentials matching &quot;{{@filterValue}}&quot;" />
<Hds::ApplicationState class="top-padding-32 is-marginless" as |A|>
<A.Header
@title="There are no credentials matching &quot;{{@filterValue}}&quot;"
@titleTag="h2"
data-test-empty-state-title
/>
</Hds::ApplicationState>
{{else}}
<EmptyState
@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."
>
<Hds::Link::Standalone @icon="plus" @text="Generate credentials" @route="credentials.generate" />
</EmptyState>
<Hds::ApplicationState class="top-padding-32 is-marginless" as |A|>
<A.Header @title="No credentials yet for this role" @titleTag="h2" data-test-empty-state-title />
<A.Body
@text="You can generate new credentials that will be limited to this role's allowed operations, then you can distribute them to your KMIP clients."
data-test-empty-state-message
/>
<A.Footer data-test-empty-state-actions as |F|>
<F.LinkStandalone @icon="plus" @text="Generate credentials" @route="credentials.generate" />
</A.Footer>
</Hds::ApplicationState>
{{/if}}
{{/if}}

View file

@ -106,13 +106,23 @@
</div>
{{else}}
{{#if @filterValue}}
<EmptyState @title="There are no roles matching &quot;{{@filterValue}}&quot;" />
<Hds::ApplicationState class="top-padding-32 is-marginless" as |A|>
<A.Header
@title="There are no roles matching &quot;{{@filterValue}}&quot;"
@titleTag="h2"
data-test-empty-state-title
/>
</Hds::ApplicationState>
{{else}}
<EmptyState
@title="No roles in this scope yet"
@message="Roles let you generate credentials with a specified set of KMIP operations permissions that clients are allowed to perform."
>
<Hds::Link::Standalone @icon="plus" @text="Create a role" @route="scope.roles.create" />
</EmptyState>
<Hds::ApplicationState class="top-padding-32 is-marginless" as |A|>
<A.Header @title="No roles in this scope yet" @titleTag="h2" data-test-empty-state-title />
<A.Body
@text="Roles let you generate credentials with a specified set of KMIP operations permissions that clients are allowed to perform."
data-test-empty-state-message
/>
<A.Footer data-test-empty-state-actions as |F|>
<F.LinkStandalone @icon="plus" @text="Create a role" @route="scope.roles.create" />
</A.Footer>
</Hds::ApplicationState>
{{/if}}
{{/if}}

View file

@ -94,13 +94,23 @@
</div>
{{else}}
{{#if @filterValue}}
<EmptyState @title="There are no scopes matching &quot;{{@filterValue}}&quot;" />
<Hds::ApplicationState class="top-padding-32 is-marginless" as |A|>
<A.Header
@title="There are no scopes matching &quot;{{@filterValue}}&quot;"
@titleTag="h2"
data-test-empty-state-title
/>
</Hds::ApplicationState>
{{else}}
<EmptyState
@title="KMIP Secrets Engine"
@message="First, let's create a scope that our roles and credentials will belong to. A client can only access objects within their role's scope."
>
<Hds::Link::Standalone @icon="plus" @text="Create a scope" @route="scopes.create" />
</EmptyState>
<Hds::ApplicationState class="top-padding-32 is-marginless" as |A|>
<A.Header @title="KMIP Secrets Engine" @titleTag="h2" data-test-empty-state-title />
<A.Body
@text="First, let's create a scope that our roles and credentials will belong to. A client can only access objects within their role's scope."
data-test-empty-state-message
/>
<A.Footer data-test-empty-state-actions as |F|>
<F.LinkStandalone @icon="plus" @text="Create a scope" @route="scopes.create" />
</A.Footer>
</Hds::ApplicationState>
{{/if}}
{{/if}}

View file

@ -4,9 +4,10 @@
*/
import { text, isPresent, collection, clickable } from 'ember-cli-page-object';
import { GENERAL } from 'vault/tests/helpers/general-selectors';
export default {
isEmpty: isPresent('[data-test-component="empty-state"]'),
isEmpty: isPresent(GENERAL.emptyStateTitle),
listItemLinks: collection('[data-test-list-item-link]', {
text: text(),
click: clickable(),