mirror of
https://github.com/hashicorp/vault.git
synced 2025-11-15 07:41:34 +01:00
* UI: Reorganize client components (#8742) * remove complex logic from running totals component * move byMonthNewClients getter to overview * organization: remove unused @versionHistory, update tests * rename namespaceLabels getter * refactor filter-toolbar to manage drodown Sets * add search bar to filter toolbar * make export request * finish adding search logic to dropdown * rename route method * move typescript declarations because all of the client ones are in client-count-utils * add error template for failed export request * update tests * stub activity export adapter method instead of trying to mock readable stream * lint --------- Co-authored-by: claire bontempo <68122737+hellobontempo@users.noreply.github.com> 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 { service } from '@ember/service';
|
|
|
|
import type { ByMonthNewClients, TotalClients } from 'core/utils/client-count-utils';
|
|
import type FlagsService from 'vault/services/flags';
|
|
|
|
interface Args {
|
|
byMonthNewClients: ByMonthNewClients[];
|
|
runningTotals: TotalClients;
|
|
}
|
|
|
|
export default class RunningTotal extends Component<Args> {
|
|
@service declare readonly flags: FlagsService;
|
|
|
|
@tracked showStacked = false;
|
|
|
|
get chartContainerText() {
|
|
return `The total clients in the specified date range, displayed per month. This includes entity, non-entity${
|
|
this.flags.secretsSyncIsActivated ? ', 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.flags.secretsSyncIsActivated ? [{ key: 'secret_syncs', label: 'secret sync clients' }] : []),
|
|
{ key: 'acme_clients', label: 'acme clients' },
|
|
];
|
|
}
|
|
return [{ key: 'new_clients', label: 'new clients' }];
|
|
}
|
|
}
|