mirror of
https://github.com/hashicorp/vault.git
synced 2025-08-21 14:41:09 +02:00
* rename * move activation-flags state to the flags service * clean up descriptions of services * fix naming that I missed * Update secrets.ts * add test coverage * services/flags: rearrage getters --------- Co-authored-by: Noelle Daley <noelledaley@users.noreply.github.com>
36 lines
864 B
JavaScript
36 lines
864 B
JavaScript
/**
|
|
* Copyright (c) HashiCorp, Inc.
|
|
* SPDX-License-Identifier: BUSL-1.1
|
|
*/
|
|
|
|
import Component from '@glimmer/component';
|
|
import { service } from '@ember/service';
|
|
|
|
export default class SidebarNavClusterComponent extends Component {
|
|
@service currentCluster;
|
|
@service flags;
|
|
@service version;
|
|
@service auth;
|
|
@service namespace;
|
|
|
|
get cluster() {
|
|
return this.currentCluster.cluster;
|
|
}
|
|
|
|
get isRootNamespace() {
|
|
// should only return true if we're in the true root namespace
|
|
return this.namespace.inRootNamespace && !this.cluster?.hasChrootNamespace;
|
|
}
|
|
|
|
get showSync() {
|
|
// Only show sync if cluster is not managed
|
|
return this.flags.managedNamespaceRoot === null;
|
|
}
|
|
|
|
get syncBadge() {
|
|
if (this.version.isCommunity) return 'Enterprise';
|
|
if (!this.version.hasSecretsSync) return 'Premium';
|
|
return undefined;
|
|
}
|
|
}
|