Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UI/fix client count partial #13396

Merged
merged 4 commits into from
Dec 10, 2021
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions changelog/13396.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
ui: Fix client count current month data not showing unless monthly history data exists
```
6 changes: 3 additions & 3 deletions ui/app/components/clients/history.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ export default class HistoryComponent extends Component {

@tracked barChartSelection = false;

// Determine if we have client count data based on the current tab,
// since model is slightly different for current month vs history api
// Determine if we have client count data based on the current tab
get hasClientData() {
if (this.args.tab === 'current') {
return this.args.model.activity && this.args.model.activity.clients;
// Show the current numbers as long as config is on
return this.args.model.config?.enabled !== 'Off';
}
return this.args.model.activity && this.args.model.activity.total;
}
Expand Down
8 changes: 4 additions & 4 deletions ui/app/templates/components/clients/history.hbs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{#if (eq @model.config.queriesAvailable false)}}
{{#if (and (eq @tab 'history') (eq @model.config.queriesAvailable false))}}
{{#if (eq @model.config.enabled 'On')}}
<EmptyState
@title="No monthly history"
Expand Down Expand Up @@ -105,7 +105,7 @@
<div class="column" data-test-client-count-stats>
<StatText
@label="Total active clients"
@value={{or @model.activity.clients @model.activity.total.clients}}
@value={{or @model.activity.clients @model.activity.total.clients "0"}}
@size="l"
@subText="The sum of unique entities and non-entity tokens; Vault's primary billing metric."
/>
Expand All @@ -114,7 +114,7 @@
<StatText
class="column"
@label="Unique entities"
@value={{or @model.activity.distinct_entities @model.activity.total.distinct_entities}}
@value={{or @model.activity.distinct_entities @model.activity.total.distinct_entities "0"}}
@size="l"
@subText="Representation of a particular user, client or application that created a token via login."
/>
Expand All @@ -123,7 +123,7 @@
<StatText
class="column"
@label="Non-entity tokens"
@value={{or @model.activity.non_entity_tokens @model.activity.total.non_entity_tokens}}
@value={{or @model.activity.non_entity_tokens @model.activity.total.non_entity_tokens "0"}}
@size="l"
@subText="Tokens created via a method that is not associated with an entity."
/>
Expand Down