Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ECO] Dashboards do not link on EEM Service View #196345

Merged
merged 4 commits into from
Oct 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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