From c8b5129ef59298501b800fb110ad427d8b4efff5 Mon Sep 17 00:00:00 2001 From: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Date: Thu, 17 Oct 2024 04:40:35 +1100 Subject: [PATCH] [8.x] [ECO] Dashboards do not link on EEM Service View (#196345) (#196571) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Backport This will backport the following commits from `main` to `8.x`: - [[ECO] Dashboards do not link on EEM Service View (#196345)](https://github.com/elastic/kibana/pull/196345) ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) Co-authored-by: CauĂȘ Marcondes <55978943+cauemarcondes@users.noreply.github.com> --- .../public/components/app/service_dashboards/index.tsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/x-pack/plugins/observability_solution/apm/public/components/app/service_dashboards/index.tsx b/x-pack/plugins/observability_solution/apm/public/components/app/service_dashboards/index.tsx index 627c314bf72e6..a92d781e3dd7c 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/app/service_dashboards/index.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/app/service_dashboards/index.tsx @@ -40,12 +40,14 @@ import { useDashboardFetcher } from '../../../hooks/use_dashboards_fetcher'; import { useTimeRange } from '../../../hooks/use_time_range'; import { APM_APP_LOCATOR_ID } from '../../../locator/service_detail_locator'; import { useApmPluginContext } from '../../../context/apm_plugin/use_apm_plugin_context'; +import { useApmServiceContext } from '../../../context/apm_service/use_apm_service_context'; +import { isLogsOnlySignal } from '../../../utils/get_signal_type'; export interface MergedServiceDashboard extends SavedApmCustomDashboard { title: string; } -export function ServiceDashboards({ checkForEntities = false }: { checkForEntities?: boolean }) { +export function ServiceDashboards() { const { path: { serviceName }, query: { environment, kuery, rangeFrom, rangeTo, dashboardId }, @@ -53,6 +55,10 @@ export function ServiceDashboards({ checkForEntities = false }: { checkForEntiti '/services/{serviceName}/dashboards', '/mobile-services/{serviceName}/dashboards' ); + const { serviceEntitySummary, serviceEntitySummaryStatus } = useApmServiceContext(); + const checkForEntities = serviceEntitySummary?.dataStreamTypes + ? isLogsOnlySignal(serviceEntitySummary.dataStreamTypes) + : false; const [dashboard, setDashboard] = useState(); const [serviceDashboards, setServiceDashboards] = useState([]); const [currentDashboard, setCurrentDashboard] = useState(); @@ -150,7 +156,7 @@ export function ServiceDashboards({ checkForEntities = false }: { checkForEntiti return ( - {status === FETCH_STATUS.LOADING ? ( + {status === FETCH_STATUS.LOADING || serviceEntitySummaryStatus === FETCH_STATUS.LOADING ? ( } title={