diff --git a/x-pack/plugins/security_solution/public/timelines/pages/timelines_page.test.tsx b/x-pack/plugins/security_solution/public/timelines/pages/timelines_page.test.tsx
index 2e59dbb72233f..f9097ddef6490 100644
--- a/x-pack/plugins/security_solution/public/timelines/pages/timelines_page.test.tsx
+++ b/x-pack/plugins/security_solution/public/timelines/pages/timelines_page.test.tsx
@@ -21,6 +21,16 @@ jest.mock('react-router-dom', () => {
};
});
jest.mock('../../overview/components/events_by_dataset');
+jest.mock('../../common/containers/source', () => {
+ const originalModule = jest.requireActual('../../common/containers/source');
+
+ return {
+ ...originalModule,
+ useWithSource: jest.fn().mockReturnValue({
+ indicesExist: true,
+ }),
+ };
+});
jest.mock('../../common/lib/kibana', () => {
const originalModule = jest.requireActual('../../common/lib/kibana');
diff --git a/x-pack/plugins/security_solution/public/timelines/pages/timelines_page.tsx b/x-pack/plugins/security_solution/public/timelines/pages/timelines_page.tsx
index 56aff3ec8aaac..b59f9e90f8e74 100644
--- a/x-pack/plugins/security_solution/public/timelines/pages/timelines_page.tsx
+++ b/x-pack/plugins/security_solution/public/timelines/pages/timelines_page.tsx
@@ -15,6 +15,8 @@ import { WrapperPage } from '../../common/components/wrapper_page';
import { useKibana } from '../../common/lib/kibana';
import { SpyRoute } from '../../common/utils/route/spy_routes';
import { useApolloClient } from '../../common/utils/apollo_context';
+import { useWithSource } from '../../common/containers/source';
+import { OverviewEmpty } from '../../overview/components/overview_empty';
import { StatefulOpenTimeline } from '../components/open_timeline';
import { NEW_TEMPLATE_TIMELINE } from '../components/timeline/properties/translations';
@@ -36,61 +38,71 @@ export const TimelinesPageComponent: React.FC = () => {
const onImportTimelineBtnClick = useCallback(() => {
setImportDataModalToggle(true);
}, [setImportDataModalToggle]);
+ const { indicesExist } = useWithSource();
const apolloClient = useApolloClient();
- const uiCapabilities = useKibana().services.application.capabilities;
- const capabilitiesCanUserCRUD: boolean = !!uiCapabilities.siem.crud;
+ const capabilitiesCanUserCRUD: boolean = !!useKibana().services.application.capabilities.siem
+ .crud;
return (
<>
-
-
-
-
- {capabilitiesCanUserCRUD && (
-
- {i18n.ALL_TIMELINES_IMPORT_TIMELINE_TITLE}
-
- )}
-
- {tabName === TimelineType.default ? (
-
- {capabilitiesCanUserCRUD && (
-
+ {indicesExist ? (
+ <>
+
+
+
+
+ {capabilitiesCanUserCRUD && (
+
+ {i18n.ALL_TIMELINES_IMPORT_TIMELINE_TITLE}
+
+ )}
+
+ {tabName === TimelineType.default ? (
+
+ {capabilitiesCanUserCRUD && (
+
+ )}
+
+ ) : (
+
+
+
)}
-
- ) : (
-
-
-
- )}
-
-
+
+
-
-
-
-
+
+
+
+
+ >
+ ) : (
+
+
+
+
+ )}
>