From 079271a98d8e7039a307aa986a227c0f1bee6fa8 Mon Sep 17 00:00:00 2001 From: Artem Babak Date: Fri, 27 Nov 2026 17:14:25 +0200 Subject: [PATCH] fix: hide dashboards marked hidden for mobile in dashboard select inside the mobile app (#16797) The dashboard selection dropdown requested /api/user/dashboards without the mobile flag, so dashboards with "Hide dashboard in mobile application" were listed and could be opened from the mobile app. Pass mobile=true when the UI runs inside the mobile app; browser behaviour is unchanged. --- ui-ngx/src/app/core/http/dashboard.service.ts | 5 ++++- .../src/app/shared/components/dashboard-select.component.ts | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ui-ngx/src/app/core/http/dashboard.service.ts b/ui-ngx/src/app/core/http/dashboard.service.ts index 15c2501a76..30608a5b75 100644 --- a/ui-ngx/src/app/core/http/dashboard.service.ts +++ b/ui-ngx/src/app/core/http/dashboard.service.ts @@ -60,7 +60,7 @@ export class DashboardService { } public getUserDashboards(userId: string, operation: Operation, - pageLink: PageLink, config?: RequestConfig): Observable> { + pageLink: PageLink, config?: RequestConfig, mobile = false): Observable> { let url = `/api/user/dashboards${pageLink.toQuery()}`; if (userId) { url += `&userId=${userId}`; @@ -68,6 +68,9 @@ export class DashboardService { if (operation) { url += `&operation=${operation}`; } + if (mobile) { + url += `&mobile=true`; + } return this.http.get>(url, defaultHttpOptionsFromConfig(config)); } diff --git a/ui-ngx/src/app/shared/components/dashboard-select.component.ts b/ui-ngx/src/app/shared/components/dashboard-select.component.ts index ea13a3fa4c..1cf971914e 100644 --- a/ui-ngx/src/app/shared/components/dashboard-select.component.ts +++ b/ui-ngx/src/app/shared/components/dashboard-select.component.ts @@ -37,6 +37,7 @@ import { } from './dashboard-select-panel.component'; import { Operation } from '@shared/models/security.models'; import { UtilsService } from '@core/services/utils.service'; +import { MobileService } from '@core/services/mobile.service'; // @dynamic @Component({ @@ -87,6 +88,7 @@ export class DashboardSelectComponent implements ControlValueAccessor, OnInit { constructor(private store: Store, private dashboardService: DashboardService, private utils: UtilsService, + private mobileService: MobileService, private overlay: Overlay, private breakpointObserver: BreakpointObserver, private viewContainerRef: ViewContainerRef, @@ -185,7 +187,8 @@ export class DashboardSelectComponent implements ControlValueAccessor, OnInit { if (this.customerId) { dashboardsObservable = this.dashboardService.getCustomerDashboards(true, this.customerId, pageLink, {ignoreLoading: true}); } else { - dashboardsObservable = this.dashboardService.getUserDashboards(null, this.operation, pageLink, {ignoreLoading: true}); + dashboardsObservable = this.dashboardService.getUserDashboards(null, this.operation, pageLink, {ignoreLoading: true}, + this.mobileService.isMobileApp()); } } return dashboardsObservable;