Skip to content

Commit

Permalink
[ECO] Dashboards do not link on EEM Service View (#196345)
Browse files Browse the repository at this point in the history
  • Loading branch information
cauemarcondes committed Oct 16, 2024
1 parent 44eb0ca commit 4c5f0a0
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,25 @@ 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 },
} = useAnyOfApmParams(
'/services/{serviceName}/dashboards',
'/mobile-services/{serviceName}/dashboards'
);
const { serviceEntitySummary, serviceEntitySummaryStatus } = useApmServiceContext();
const checkForEntities = serviceEntitySummary?.dataStreamTypes
? isLogsOnlySignal(serviceEntitySummary.dataStreamTypes)
: false;
const [dashboard, setDashboard] = useState<DashboardApi | undefined>();
const [serviceDashboards, setServiceDashboards] = useState<MergedServiceDashboard[]>([]);
const [currentDashboard, setCurrentDashboard] = useState<MergedServiceDashboard>();
Expand Down Expand Up @@ -150,7 +156,7 @@ export function ServiceDashboards({ checkForEntities = false }: { checkForEntiti

return (
<EuiPanel hasBorder={true}>
{status === FETCH_STATUS.LOADING ? (
{status === FETCH_STATUS.LOADING || serviceEntitySummaryStatus === FETCH_STATUS.LOADING ? (
<EuiEmptyPrompt
icon={<EuiLoadingLogo logo="logoObservability" size="xl" />}
title={
Expand Down

0 comments on commit 4c5f0a0

Please sign in to comment.