From 36870735a38f5cec486dda32249a2801dfd8570a Mon Sep 17 00:00:00 2001 From: Nizamudeen A Date: Thu, 18 May 2023 11:54:53 +0530 Subject: [PATCH] mgr/dashboard: remove Selected Object Gateway dropdown Only from Daemons and Multisite page because its not needed there. Fixes: https://tracker.ceph.com/issues/61230 Signed-off-by: Nizamudeen A (cherry picked from commit 075fce3cf8f8bc5150abd4684bc87e56e993da5e) --- .../src/app/core/context/context.component.ts | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/pybind/mgr/dashboard/frontend/src/app/core/context/context.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/core/context/context.component.ts index 8de611307a71f..e036b754438b4 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/core/context/context.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/core/context/context.component.ts @@ -23,9 +23,13 @@ export class ContextComponent implements OnInit, OnDestroy { readonly REFRESH_INTERVAL = 5000; private subs = new Subscription(); private rgwUrlPrefix = '/rgw'; + private rgwUserUrlPrefix = '/rgw/user'; + private rgwBuckerUrlPrefix = '/rgw/bucket'; permissions: Permissions; featureToggleMap$: FeatureTogglesMap$; - isRgwRoute = document.location.href.includes(this.rgwUrlPrefix); + isRgwRoute = + document.location.href.includes(this.rgwUserUrlPrefix) || + document.location.href.includes(this.rgwBuckerUrlPrefix); constructor( private authStorageService: AuthStorageService, @@ -42,7 +46,12 @@ export class ContextComponent implements OnInit, OnDestroy { this.subs.add( this.router.events .pipe(filter((event: Event) => event instanceof NavigationEnd)) - .subscribe(() => (this.isRgwRoute = this.router.url.startsWith(this.rgwUrlPrefix))) + .subscribe( + () => + (this.isRgwRoute = [this.rgwBuckerUrlPrefix, this.rgwUserUrlPrefix].some((urlPrefix) => + this.router.url.startsWith(urlPrefix) + )) + ) ); // Set daemon list polling only when in RGW route: this.subs.add( -- 2.39.5