From 00a5ed132f8d2c6c29c634c628a9bbc1abdcd520 Mon Sep 17 00:00:00 2001 From: Vault Automation Date: Tue, 5 May 2026 12:29:58 -0600 Subject: [PATCH] [UI] Update sidebar to also hide/show billing metrics dashboard based on permissions (#14490) (#14517) * Update sidebar to also hide/show based on permissions * Add tests Co-authored-by: Kianna <30884335+kiannaquach@users.noreply.github.com> --- ui/app/services/permissions.js | 3 +++ .../addon/components/sidebar/nav/cluster.hbs | 2 +- .../addon/components/sidebar/nav/cluster.js | 1 + ui/lib/core/addon/helpers/display-nav-item.ts | 17 ++++++++++++++++- .../components/sidebar/nav/cluster-test.js | 11 ++++++++++- 5 files changed, 31 insertions(+), 3 deletions(-) diff --git a/ui/app/services/permissions.js b/ui/app/services/permissions.js index 07874b685b..40933c0080 100644 --- a/ui/app/services/permissions.js +++ b/ui/app/services/permissions.js @@ -115,6 +115,9 @@ const API_PATHS = { monitoring: { 'utilization-report': 'sys/utilization-report', }, + billing: { + overview: 'sys/billing/overview', + }, }; // API_PATHS_TO_ROUTE_PARAMS is used to resolve route params for that path when checking permissions for the nav item. diff --git a/ui/lib/core/addon/components/sidebar/nav/cluster.hbs b/ui/lib/core/addon/components/sidebar/nav/cluster.hbs index 58459deea1..810cfdf8ac 100644 --- a/ui/lib/core/addon/components/sidebar/nav/cluster.hbs +++ b/ui/lib/core/addon/components/sidebar/nav/cluster.hbs @@ -59,7 +59,7 @@ data-test-sidebar-nav-link="Client count" /> {{/if}} - {{#if (and this.version.hasConsumptionBilling (or this.isRootNamespace this.namespace.inHvdAdminNamespace))}} + {{#if (display-nav-item this.routeName.billingDashboard)}}