Vault Automation a92bffe5ce
UI: Hide Client Count Dashboard for PKI Only Clusters (#10513) (#10831)
* hide client counting dashboard for PKI only clusters

* add test and hide client count card

* convert to ts,
add pki only license banner, add comments, and support for multiple dismissed types

* add banner description

* add changelog entry

* update tests + add test coverage for multiple banners + info banner

* update tests

* add doc link

* Apply suggestions from code review



* naming updates

* update feature key format

* update casing

* add enum, revert naming, move helper to util

* test hidden nav link and dashboard card

---------

Co-authored-by: lane-wetmore <lane.wetmore@hashicorp.com>
Co-authored-by: claire bontempo <68122737+hellobontempo@users.noreply.github.com>
2025-11-17 09:11:14 -06:00

48 lines
1.4 KiB
TypeScript

/**
* Copyright IBM Corp. 2016, 2025
* SPDX-License-Identifier: BUSL-1.1
*/
import Component from '@glimmer/component';
import { service } from '@ember/service';
import NamespaceService from 'vault/services/namespace';
export type Args = {
isRootNamespace: boolean;
replication: unknown;
secretsEngines: unknown;
vaultConfiguration: unknown;
version: { isEnterprise: boolean; hasPKIOnly: boolean };
};
export default class OverviewComponent extends Component<Args> {
@service declare readonly namespace: NamespaceService;
/**
* the client count card should show in the following conditions
* Self Managed clusters that are running enterprise and showing the `root` namespace
* Managed clusters that are running enterprise and show the `admin` namespace
*/
// for self managed clusters, this is the `root` namespace
// for HVD clusters, this is the `admin` namespace
get shouldShowClientCount() {
const { version, isRootNamespace } = this.args;
const { namespace } = this;
// don't show client count if this isn't an enterprise cluster
if (!version.isEnterprise) return false;
// don't show client count if this is a PKI-only Secrets cluster
if (version.hasPKIOnly) return false;
// HVD clusters
if (namespace.inHvdAdminNamespace) return true;
// SM clusters
if (isRootNamespace) return true;
return false;
}
}