mirror of
https://github.com/hashicorp/vault.git
synced 2025-11-15 15:51:13 +01:00
* rename query params to match keys from api response * move type guard check to util * update color scheme * remove passing selected namespace to export activity data request * remove namespace and mount filter toolbar * update response, sort by client count number * remove default page size for testing * implement table and filters in overview tab * remove old query params * cleanup unused args * revert page header changes * update mirage, remove month from utils * update client count utils * one more color! * reset table to page 1; * workaround to force Hds::Pagination::Numbered to update when currentPage changes * add empty state test for no attribution * delete unused methods * add test for new utils * add changelog * rename changelog --------- Co-authored-by: claire bontempo <cbontempo@hashicorp.com>
48 lines
1.5 KiB
TypeScript
48 lines
1.5 KiB
TypeScript
/**
|
|
* Copyright (c) HashiCorp, Inc.
|
|
* SPDX-License-Identifier: BUSL-1.1
|
|
*/
|
|
|
|
import Component from '@glimmer/component';
|
|
import { tracked } from '@glimmer/tracking';
|
|
|
|
import type { ByMonthNewClients, TotalClients } from 'core/utils/client-count-utils';
|
|
|
|
interface Args {
|
|
isSecretsSyncActivated: boolean;
|
|
byMonthNewClients: ByMonthNewClients[];
|
|
isHistoricalMonth: boolean;
|
|
isCurrentMonth: boolean;
|
|
runningTotals: TotalClients;
|
|
}
|
|
|
|
export default class RunningTotal extends Component<Args> {
|
|
@tracked showStacked = false;
|
|
|
|
get chartContainerText() {
|
|
const { isSecretsSyncActivated } = this.args;
|
|
return `The total clients in the specified date range, displayed per month. This includes entity, non-entity${
|
|
isSecretsSyncActivated ? ', ACME and secrets sync clients' : ' and ACME clients'
|
|
}. The total client count number is an important consideration for Vault billing.`;
|
|
}
|
|
|
|
get runningTotalData() {
|
|
return this.args.byMonthNewClients.map((monthly) => ({
|
|
...monthly,
|
|
new_clients: monthly.clients,
|
|
}));
|
|
}
|
|
|
|
get chartLegend() {
|
|
if (this.showStacked) {
|
|
return [
|
|
{ key: 'entity_clients', label: 'entity clients' },
|
|
{ key: 'non_entity_clients', label: 'non-entity clients' },
|
|
...(this.args.isSecretsSyncActivated ? [{ key: 'secret_syncs', label: 'secret sync clients' }] : []),
|
|
{ key: 'acme_clients', label: 'acme clients' },
|
|
];
|
|
}
|
|
return [{ key: 'new_clients', label: 'new clients' }];
|
|
}
|
|
}
|