mirror of
https://github.com/hashicorp/vault.git
synced 2026-05-06 04:46:25 +02:00
VAULT-17006 - Replaced EmptyState component with HDS ApplicationState for "clients" directory (#11648) (#11709)
* VAULT-17006 - Replaced EmptyState component with HDS ApplicationState for "clients" directory * added missing data-test values to HDS:ApplicationState header and body * reverted top margin spacing to use top padding instead * updated class for consistent spacing and added icon & errorCode args * fixed failing test * fixed vertical alignment for Hds Application State error * VAULT-17006 - Replaced EmptyState component with HDS ApplicationState for "clients" directory * added missing data-test values to HDS:ApplicationState header and body * reverted top margin spacing to use top padding instead * updated class for consistent spacing and added icon & errorCode args * fixed failing test * fixed vertical alignment for Hds Application State error * fixed failing test case Co-authored-by: mohit-hashicorp <mohit.ojha@hashicorp.com>
This commit is contained in:
parent
a78fd4e78c
commit
1484f71665
@ -3,8 +3,10 @@
|
||||
SPDX-License-Identifier: BUSL-1.1
|
||||
}}
|
||||
|
||||
<Hds::ApplicationState class="has-top-margin-xxl" ...attributes as |A|>
|
||||
<Hds::ApplicationState class="top-padding-32" ...attributes as |A|>
|
||||
<A.Header
|
||||
@icon="skip"
|
||||
@errorCode={{@error.httpStatus}}
|
||||
@title={{or @title (if (eq @error.httpStatus 403) "You are not authorized" "Error")}}
|
||||
data-test-empty-state-title
|
||||
/>
|
||||
|
||||
@ -4,30 +4,37 @@
|
||||
}}
|
||||
|
||||
{{#if (or @config.reportingEnabled (eq @config.enabled "On"))}}
|
||||
<EmptyState
|
||||
@title="No data received"
|
||||
@message="Tracking is turned on and Vault is gathering data. It should appear here within 30 minutes."
|
||||
class="is-shadowless"
|
||||
/>
|
||||
<Hds::ApplicationState class="top-padding-32" as |A|>
|
||||
<A.Header data-test-empty-state-title @title="No data received" />
|
||||
<A.Body
|
||||
data-test-empty-state-message
|
||||
@text="Tracking is turned on and Vault is gathering data. It should appear here within 30 minutes."
|
||||
/>
|
||||
</Hds::ApplicationState>
|
||||
{{else if @config}}
|
||||
<EmptyState
|
||||
@title="Data tracking is disabled"
|
||||
@message="Tracking is disabled, and no data is being collected. To turn it on, edit the configuration."
|
||||
class="is-shadowless"
|
||||
>
|
||||
<Hds::ApplicationState class="top-padding-32" as |A|>
|
||||
<A.Header data-test-empty-state-title @title="Data tracking is disabled" />
|
||||
<A.Body
|
||||
data-test-empty-state-message
|
||||
@text="Tracking is disabled, and no data is being collected. To turn it on, edit the configuration."
|
||||
/>
|
||||
{{#if @config.canEdit}}
|
||||
<Hds::Link::Standalone
|
||||
@icon="chevron-right"
|
||||
@iconPosition="trailing"
|
||||
@text="Go to configuration"
|
||||
@route="vault.cluster.clients.config"
|
||||
/>
|
||||
<A.Footer as |F|>
|
||||
<F.LinkStandalone
|
||||
@icon="chevron-right"
|
||||
@iconPosition="trailing"
|
||||
@text="Go to configuration"
|
||||
@route="vault.cluster.clients.config"
|
||||
/>
|
||||
</A.Footer>
|
||||
{{/if}}
|
||||
</EmptyState>
|
||||
</Hds::ApplicationState>
|
||||
{{else}}
|
||||
<EmptyState
|
||||
@title="Activity configuration data is unavailable"
|
||||
@message="Reporting status is unknown and could be enabled or disabled. Check the Vault logs for more information."
|
||||
class="is-shadowless"
|
||||
/>
|
||||
<Hds::ApplicationState class="top-padding-32" as |A|>
|
||||
<A.Header data-test-empty-state-title @title="Activity configuration data is unavailable" />
|
||||
<A.Body
|
||||
data-test-empty-state-message
|
||||
@text="Reporting status is unknown and could be enabled or disabled. Check the Vault logs for more information."
|
||||
/>
|
||||
</Hds::ApplicationState>
|
||||
{{/if}}
|
||||
@ -82,19 +82,25 @@
|
||||
{{yield}}
|
||||
{{else if (and this.version.isCommunity (or (not @startTimestamp) (not @endTimestamp)))}}
|
||||
{{! Empty state for community without start or end query param }}
|
||||
<EmptyState
|
||||
@title="Input the start and end dates to view client attribution by path."
|
||||
@message="Only historical data may be queried. No data is available for the current month."
|
||||
/>
|
||||
<Hds::ApplicationState class="top-padding-32" as |A|>
|
||||
<A.Header data-test-empty-state-title @title="Input the start and end dates to view client attribution by path." />
|
||||
<A.Body
|
||||
data-test-empty-state-message
|
||||
@text="Only historical data may be queried. No data is available for the current month."
|
||||
/>
|
||||
</Hds::ApplicationState>
|
||||
{{else}}
|
||||
<EmptyState
|
||||
@title="No data received"
|
||||
@message={{if
|
||||
this.version.isCommunity
|
||||
"Select a start and end date above to query client count data."
|
||||
"Select a different date range to view client count data."
|
||||
}}
|
||||
/>
|
||||
<Hds::ApplicationState class="top-padding-32" as |A|>
|
||||
<A.Header data-test-empty-state-title @title="No data received" />
|
||||
<A.Body
|
||||
data-test-empty-state-message
|
||||
@text={{if
|
||||
this.version.isCommunity
|
||||
"Select a start and end date above to query client count data."
|
||||
"Select a different date range to view client count data."
|
||||
}}
|
||||
/>
|
||||
</Hds::ApplicationState>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
</div>
|
||||
@ -6,29 +6,36 @@
|
||||
{{#if (eq @model.httpStatus 404)}}
|
||||
<NotFound @model={{this.model}} />
|
||||
{{else}}
|
||||
<EmptyState
|
||||
@title={{if (eq @model.httpStatus 403) "You are not authorized" "Error"}}
|
||||
@subTitle="Error {{@model.httpStatus}}"
|
||||
@icon="skip"
|
||||
>
|
||||
{{#if (eq @model.httpStatus 403)}}
|
||||
<p>
|
||||
You must be granted permissions to view this page. Ask your administrator if you think you should have access to the
|
||||
<code>{{@model.path}}</code>
|
||||
endpoint.
|
||||
</p>
|
||||
{{else}}
|
||||
<ul>
|
||||
{{#if @model.message}}
|
||||
<li>{{@model.message}}</li>
|
||||
<hr />
|
||||
<div class="is-flex is-flex-grow-1">
|
||||
<Hds::ApplicationState class="align-self-center" as |A|>
|
||||
<A.Header
|
||||
data-test-empty-state-title
|
||||
@title={{if (eq @model.httpStatus 403) "You are not authorized" "Error"}}
|
||||
@icon="skip"
|
||||
@errorCode={{@model.httpStatus}}
|
||||
/>
|
||||
<A.Body data-test-empty-state-message>
|
||||
{{#if (eq @model.httpStatus 403)}}
|
||||
<p>
|
||||
You must be granted permissions to view this page. Ask your administrator if you think you should have access to
|
||||
the
|
||||
<code>{{@model.path}}</code>
|
||||
endpoint.
|
||||
</p>
|
||||
{{else}}
|
||||
<ul>
|
||||
{{#if @model.message}}
|
||||
<li>{{@model.message}}</li>
|
||||
<hr />
|
||||
{{/if}}
|
||||
{{#each @model.errors as |error|}}
|
||||
<li>
|
||||
{{error}}
|
||||
</li>
|
||||
{{/each}}
|
||||
</ul>
|
||||
{{/if}}
|
||||
{{#each @model.errors as |error|}}
|
||||
<li>
|
||||
{{error}}
|
||||
</li>
|
||||
{{/each}}
|
||||
</ul>
|
||||
{{/if}}
|
||||
</EmptyState>
|
||||
</A.Body>
|
||||
</Hds::ApplicationState>
|
||||
</div>
|
||||
{{/if}}
|
||||
@ -62,7 +62,7 @@ module('Acceptance | clients | counts', function (hooks) {
|
||||
return overrideResponse(403);
|
||||
});
|
||||
await visit('/vault/clients/counts/overview');
|
||||
assert.dom(GENERAL.emptyStateTitle).hasText('You are not authorized');
|
||||
assert.dom(GENERAL.emptyStateTitle).hasText('ERROR 403 You are not authorized');
|
||||
assert
|
||||
.dom(GENERAL.emptyStateMessage)
|
||||
.hasText(
|
||||
|
||||
@ -81,7 +81,7 @@ module('Integration | Component | clients | Page::Counts', function (hooks) {
|
||||
|
||||
assert
|
||||
.dom(GENERAL.emptyStateTitle)
|
||||
.hasText('You are not authorized', 'Activity error empty state renders');
|
||||
.hasText('ERROR 403 You are not authorized', 'Activity error empty state renders');
|
||||
});
|
||||
|
||||
test('it should render config disabled alert', async function (assert) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user