diff --git a/x-pack/plugins/apm/public/components/routing/templates/apm_main_template.tsx b/x-pack/plugins/apm/public/components/routing/templates/apm_main_template.tsx index 6a4ab5d7d9bc5..ac0b8a1517b20 100644 --- a/x-pack/plugins/apm/public/components/routing/templates/apm_main_template.tsx +++ b/x-pack/plugins/apm/public/components/routing/templates/apm_main_template.tsx @@ -5,10 +5,13 @@ * 2.0. */ -import { EuiPageHeaderProps, EuiPageTemplateProps } from '@elastic/eui'; +import { EuiPageHeaderProps } from '@elastic/eui'; import React from 'react'; import { useLocation } from 'react-router-dom'; -import { useKibana } from '../../../../../../../src/plugins/kibana_react/public'; +import { + useKibana, + KibanaPageTemplateProps, +} from '../../../../../../../src/plugins/kibana_react/public'; import { useFetcher } from '../../../hooks/use_fetcher'; import { ApmPluginStartDeps } from '../../../plugin'; import { ApmEnvironmentFilter } from '../../shared/EnvironmentFilter'; @@ -35,7 +38,7 @@ export function ApmMainTemplate({ pageTitle?: React.ReactNode; pageHeader?: EuiPageHeaderProps; children: React.ReactNode; -} & EuiPageTemplateProps) { +} & KibanaPageTemplateProps) { const location = useLocation(); const { services } = useKibana(); diff --git a/x-pack/plugins/infra/public/pages/logs/log_entry_categories/page_content.tsx b/x-pack/plugins/infra/public/pages/logs/log_entry_categories/page_content.tsx index a8d98ea843c96..542b1dcd21d80 100644 --- a/x-pack/plugins/infra/public/pages/logs/log_entry_categories/page_content.tsx +++ b/x-pack/plugins/infra/public/pages/logs/log_entry_categories/page_content.tsx @@ -25,6 +25,7 @@ import { LogEntryCategoriesResultsContent } from './page_results_content'; import { LogEntryCategoriesSetupContent } from './page_setup_content'; import { LogsPageTemplate } from '../page_template'; import type { LazyObservabilityPageTemplateProps } from '../../../../../observability/public'; +import { useLogSourceContext } from '../../../containers/logs/log_source'; const logCategoriesTitle = i18n.translate('xpack.infra.logs.logCategoriesTitle', { defaultMessage: 'Categories', @@ -114,8 +115,10 @@ const CategoriesPageTemplate: React.FC = ({ children, ...rest }) => { + const { sourceStatus } = useLogSourceContext(); return ( = ({ children, ...rest }) => { + const { sourceStatus } = useLogSourceContext(); return ( ], diff --git a/x-pack/plugins/infra/public/pages/logs/page_template.tsx b/x-pack/plugins/infra/public/pages/logs/page_template.tsx index 42ca992e9402d..7ee60ab84bf25 100644 --- a/x-pack/plugins/infra/public/pages/logs/page_template.tsx +++ b/x-pack/plugins/infra/public/pages/logs/page_template.tsx @@ -6,19 +6,61 @@ */ import React from 'react'; +import { i18n } from '@kbn/i18n'; import { useKibanaContextForPlugin } from '../../hooks/use_kibana'; import type { LazyObservabilityPageTemplateProps } from '../../../../observability/public'; +import { + KibanaPageTemplateProps, + useKibana, +} from '../../../../../../src/plugins/kibana_react/public'; -export const LogsPageTemplate: React.FC = ( - pageTemplateProps -) => { +interface LogsPageTemplateProps extends LazyObservabilityPageTemplateProps { + hasData?: boolean; +} + +export const LogsPageTemplate: React.FC = ({ + hasData = true, + 'data-test-subj': _dataTestSubj, + ...pageTemplateProps +}) => { const { services: { observability: { navigation: { PageTemplate }, }, + docLinks, }, } = useKibanaContextForPlugin(); - return ; + const { http } = useKibana().services; + const basePath = http!.basePath.get(); + + const noDataConfig: KibanaPageTemplateProps['noDataConfig'] = hasData + ? undefined + : { + solution: i18n.translate('xpack.infra.logs.noDataConfig.solutionName', { + defaultMessage: 'Observability', + }), + actions: { + beats: { + title: i18n.translate('xpack.infra.logs.noDataConfig.beatsCard.title', { + defaultMessage: 'Add logs with Beats', + }), + description: i18n.translate('xpack.infra.logs.noDataConfig.beatsCard.description', { + defaultMessage: + 'Use Beats to send logs to Elasticsearch. We make it easy with modules for many popular systems and apps.', + }), + href: basePath + `/app/home#/tutorial_directory/logging`, + }, + }, + docsLink: docLinks.links.observability.guide, + }; + + return ( + + ); }; diff --git a/x-pack/plugins/infra/public/pages/logs/stream/page_content.tsx b/x-pack/plugins/infra/public/pages/logs/stream/page_content.tsx index 527dc79726044..7f8ed4fa6a951 100644 --- a/x-pack/plugins/infra/public/pages/logs/stream/page_content.tsx +++ b/x-pack/plugins/infra/public/pages/logs/stream/page_content.tsx @@ -11,7 +11,6 @@ import { LogSourceErrorPage } from '../../../components/logging/log_source_error import { SourceLoadingPage } from '../../../components/source_loading_page'; import { useLogSourceContext } from '../../../containers/logs/log_source'; import { LogsPageLogsContent } from './page_logs_content'; -import { LogsPageNoIndicesContent } from './page_no_indices_content'; import { LogsPageTemplate } from '../page_template'; import { euiStyled } from '../../../../../../../src/plugins/kibana_react/common'; import { APP_WRAPPER_CLASS } from '../../../../../../../src/core/public'; @@ -34,10 +33,11 @@ export const StreamPageContent: React.FunctionComponent = () => { return ; } else if (hasFailedLoading) { return ; - } else if (sourceStatus?.logIndexStatus !== 'missing') { + } else { return ( { ); - } else { - return ; } }; diff --git a/x-pack/plugins/infra/public/pages/metrics/inventory_view/index.tsx b/x-pack/plugins/infra/public/pages/metrics/inventory_view/index.tsx index 353997d5fe3ff..67e39a11c12e7 100644 --- a/x-pack/plugins/infra/public/pages/metrics/inventory_view/index.tsx +++ b/x-pack/plugins/infra/public/pages/metrics/inventory_view/index.tsx @@ -5,23 +5,19 @@ * 2.0. */ -import { EuiButton, EuiErrorBoundary, EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; +import { EuiErrorBoundary } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import React, { useContext } from 'react'; import { FilterBar } from './components/filter_bar'; import { DocumentTitle } from '../../../components/document_title'; -import { NoIndices } from '../../../components/empty_states/no_indices'; import { SourceErrorPage } from '../../../components/source_error_page'; import { SourceLoadingPage } from '../../../components/source_loading_page'; -import { ViewSourceConfigurationButton } from '../../../components/source_configuration/view_source_configuration_button'; import { Source } from '../../../containers/metrics_source'; import { useTrackPageview } from '../../../../../observability/public'; import { useMetricsBreadcrumbs } from '../../../hooks/use_metrics_breadcrumbs'; -import { useKibana } from '../../../../../../../src/plugins/kibana_react/public'; import { LayoutView } from './components/layout_view'; -import { useLinkProps } from '../../../hooks/use_link_props'; import { SavedViewProvider } from '../../../containers/saved_view/saved_view'; import { DEFAULT_WAFFLE_VIEW_STATE } from './hooks/use_waffle_view_state'; import { useWaffleOptionsContext } from './hooks/use_waffle_options'; @@ -32,7 +28,6 @@ import { inventoryTitle } from '../../../translations'; import { SavedViews } from './components/saved_views'; export const SnapshotPage = () => { - const uiCapabilities = useKibana().services.application?.capabilities; const { hasFailedLoadingSource, isLoading, @@ -45,11 +40,6 @@ export const SnapshotPage = () => { useTrackPageview({ app: 'infra_metrics', path: 'inventory', delay: 15000 }); const { source: optionsSource } = useWaffleOptionsContext(); - const tutorialLinkProps = useLinkProps({ - app: 'home', - hash: '/tutorial_directory/metrics', - }); - useMetricsBreadcrumbs([ { text: inventoryTitle, @@ -79,6 +69,7 @@ export const SnapshotPage = () => { defaultViewState={DEFAULT_WAFFLE_VIEW_STATE} > ], @@ -96,43 +87,7 @@ export const SnapshotPage = () => { ) : hasFailedLoadingSource ? ( ) : ( - - - - {i18n.translate('xpack.infra.homePage.noMetricsIndicesInstructionsActionLabel', { - defaultMessage: 'View setup instructions', - })} - - - {uiCapabilities?.infrastructure?.configureSource ? ( - - - {i18n.translate('xpack.infra.configureSourceActionLabel', { - defaultMessage: 'Change source configuration', - })} - - - ) : null} - - } - data-test-subj="noMetricsIndicesPrompt" - /> + )} ); diff --git a/x-pack/plugins/infra/public/pages/metrics/metric_detail/components/node_details_page.tsx b/x-pack/plugins/infra/public/pages/metrics/metric_detail/components/node_details_page.tsx index 496a57cf7273a..8da96586be979 100644 --- a/x-pack/plugins/infra/public/pages/metrics/metric_detail/components/node_details_page.tsx +++ b/x-pack/plugins/infra/public/pages/metrics/metric_detail/components/node_details_page.tsx @@ -5,10 +5,11 @@ * 2.0. */ -import React, { useCallback, useEffect, useState } from 'react'; +import React, { useCallback, useEffect, useState, useContext } from 'react'; import dateMath from '@elastic/datemath'; import moment from 'moment'; import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; +import { Source } from '../../../../containers/metrics_source'; import { InventoryMetric, InventoryItemType } from '../../../../../common/inventory_models/types'; import { useNodeDetails } from '../hooks/use_node_details'; import { MetricsSideNav } from './side_nav'; @@ -52,6 +53,7 @@ const parseRange = (range: MetricsTimeInput) => { }; export const NodeDetailsPage = (props: Props) => { + const { metricIndicesExist } = useContext(Source.Context); const [parsedTimeRange, setParsedTimeRange] = useState(parseRange(props.timeRange)); const { metrics, loading, makeRequest, error } = useNodeDetails( props.requiredMetrics, @@ -80,6 +82,7 @@ export const NodeDetailsPage = (props: Props) => { return ( + { if (currentView) { onViewStateChange(currentView); @@ -85,6 +86,7 @@ export const MetricsExplorerPage = ({ source, derivedIndexPattern }: MetricsExpl } /> = ( - pageTemplateProps -) => { +interface MetricsPageTemplateProps extends LazyObservabilityPageTemplateProps { + hasData?: boolean; +} + +export const MetricsPageTemplate: React.FC = ({ + hasData = true, + 'data-test-subj': _dataTestSubj, + ...pageTemplateProps +}) => { const { services: { observability: { navigation: { PageTemplate }, }, + docLinks, }, } = useKibanaContextForPlugin(); - return ; + const tutorialLinkProps = useLinkProps({ + app: 'home', + hash: '/tutorial_directory/metrics', + }); + + const noDataConfig: KibanaPageTemplateProps['noDataConfig'] = hasData + ? undefined + : { + solution: i18n.translate('xpack.infra.metrics.noDataConfig.solutionName', { + defaultMessage: 'Observability', + }), + actions: { + beats: { + title: i18n.translate('xpack.infra.metrics.noDataConfig.beatsCard.title', { + defaultMessage: 'Add metrics with Beats', + }), + description: i18n.translate('xpack.infra.metrics.noDataConfig.beatsCard.description', { + defaultMessage: + 'Use Beats to send metrics data to Elasticsearch. We make it easy with modules for many popular systems and apps.', + }), + ...tutorialLinkProps, + }, + }, + docsLink: docLinks.links.observability.guide, + }; + + return ( + + ); }; diff --git a/x-pack/plugins/observability/public/components/app/empty_sections/index.tsx b/x-pack/plugins/observability/public/components/app/empty_sections/index.tsx index 47417a2bbb545..21aaba99ac5dc 100644 --- a/x-pack/plugins/observability/public/components/app/empty_sections/index.tsx +++ b/x-pack/plugins/observability/public/components/app/empty_sections/index.tsx @@ -50,8 +50,8 @@ export function EmptySections() { diff --git a/x-pack/plugins/observability/public/pages/cases/cases.stories.tsx b/x-pack/plugins/observability/public/pages/cases/cases.stories.tsx index a9c83fa650394..41fa2744397c7 100644 --- a/x-pack/plugins/observability/public/pages/cases/cases.stories.tsx +++ b/x-pack/plugins/observability/public/pages/cases/cases.stories.tsx @@ -5,11 +5,13 @@ * 2.0. */ -import { EuiPageTemplate } from '@elastic/eui'; import React, { ComponentType } from 'react'; import { MemoryRouter } from 'react-router-dom'; import { CoreStart } from '../../../../../../src/core/public'; -import { createKibanaReactContext } from '../../../../../../src/plugins/kibana_react/public'; +import { + createKibanaReactContext, + KibanaPageTemplate, +} from '../../../../../../src/plugins/kibana_react/public'; import { casesFeatureId } from '../../../common'; import { PluginContext, PluginContextValue } from '../../context/plugin_context'; import { AllCasesPage } from './all_cases'; @@ -34,7 +36,7 @@ export default { } as unknown as Partial); const pluginContextValue = { - ObservabilityPageTemplate: EuiPageTemplate, + ObservabilityPageTemplate: KibanaPageTemplate, } as unknown as PluginContextValue; return ( diff --git a/x-pack/plugins/translations/translations/ja-JP.json b/x-pack/plugins/translations/translations/ja-JP.json index a36ad0e2543f4..75d0fac3656a8 100644 --- a/x-pack/plugins/translations/translations/ja-JP.json +++ b/x-pack/plugins/translations/translations/ja-JP.json @@ -12700,9 +12700,7 @@ "xpack.infra.homePage.documentTitle": "メトリック", "xpack.infra.homePage.inventoryTabTitle": "インベントリ", "xpack.infra.homePage.metricsExplorerTabTitle": "メトリックエクスプローラー", - "xpack.infra.homePage.noMetricsIndicesDescription": "追加しましょう!", "xpack.infra.homePage.noMetricsIndicesInstructionsActionLabel": "セットアップの手順を表示", - "xpack.infra.homePage.noMetricsIndicesTitle": "メトリックインデックスがないようです。", "xpack.infra.homePage.settingsTabTitle": "設定", "xpack.infra.homePage.toolbar.kqlSearchFieldPlaceholder": "インフラストラクチャデータを検索…(例:host.name:host-1)", "xpack.infra.homePage.toolbar.showingLastOneMinuteDataText": "指定期間のデータの最後の{duration}", diff --git a/x-pack/plugins/translations/translations/zh-CN.json b/x-pack/plugins/translations/translations/zh-CN.json index 1bd9430f063e5..f07bd504f37cd 100644 --- a/x-pack/plugins/translations/translations/zh-CN.json +++ b/x-pack/plugins/translations/translations/zh-CN.json @@ -12870,9 +12870,7 @@ "xpack.infra.homePage.documentTitle": "指标", "xpack.infra.homePage.inventoryTabTitle": "库存", "xpack.infra.homePage.metricsExplorerTabTitle": "指标浏览器", - "xpack.infra.homePage.noMetricsIndicesDescription": "让我们添加一些!", "xpack.infra.homePage.noMetricsIndicesInstructionsActionLabel": "查看设置说明", - "xpack.infra.homePage.noMetricsIndicesTitle": "似乎您没有任何指标索引。", "xpack.infra.homePage.settingsTabTitle": "设置", "xpack.infra.homePage.toolbar.kqlSearchFieldPlaceholder": "搜索基础设施数据……(例如 host.name:host-1)", "xpack.infra.homePage.toolbar.showingLastOneMinuteDataText": "选定时间过去 {duration}的数据", diff --git a/x-pack/plugins/uptime/e2e/journeys/uptime.journey.ts b/x-pack/plugins/uptime/e2e/journeys/uptime.journey.ts index 7407a1433ffaa..59a289ef21e7b 100644 --- a/x-pack/plugins/uptime/e2e/journeys/uptime.journey.ts +++ b/x-pack/plugins/uptime/e2e/journeys/uptime.journey.ts @@ -67,8 +67,4 @@ journey('uptime', ({ page, params }) => { step('Click on my monitor', async () => { await page.click('[data-test-subj=monitor-page-link-0001-up]'); }); - - step('Navigates to details page', async () => { - await page.click('[data-test-subj=uptimeMonitorPage]'); - }); }); diff --git a/x-pack/plugins/uptime/e2e/playwright_start.ts b/x-pack/plugins/uptime/e2e/playwright_start.ts index 99ceb591b90c8..aedb255b058be 100644 --- a/x-pack/plugins/uptime/e2e/playwright_start.ts +++ b/x-pack/plugins/uptime/e2e/playwright_start.ts @@ -42,7 +42,7 @@ async function playwrightStart(getService: any) { const res = await playwrightRun({ params: { kibanaUrl }, - playwrightOptions: { chromiumSandbox: false }, + playwrightOptions: { chromiumSandbox: false, timeout: 60 * 1000 }, }); console.log('Removing esArchiver...'); diff --git a/x-pack/plugins/uptime/public/apps/uptime_app.tsx b/x-pack/plugins/uptime/public/apps/uptime_app.tsx index f82a312ef91f5..73f228f621540 100644 --- a/x-pack/plugins/uptime/public/apps/uptime_app.tsx +++ b/x-pack/plugins/uptime/public/apps/uptime_app.tsx @@ -126,11 +126,9 @@ const Application = (props: UptimeAppProps) => { className={APP_WRAPPER_CLASS} application={core.application} > -
- - - -
+ + + diff --git a/x-pack/plugins/uptime/public/apps/uptime_page_template.tsx b/x-pack/plugins/uptime/public/apps/uptime_page_template.tsx index 033fdcb61b28b..817bbf9bedcb1 100644 --- a/x-pack/plugins/uptime/public/apps/uptime_page_template.tsx +++ b/x-pack/plugins/uptime/public/apps/uptime_page_template.tsx @@ -8,7 +8,7 @@ import React, { useMemo } from 'react'; import styled from 'styled-components'; import { EuiPageHeaderProps } from '@elastic/eui'; -import { OVERVIEW_ROUTE } from '../../common/constants'; +import { CERTIFICATES_ROUTE, OVERVIEW_ROUTE } from '../../common/constants'; import { useKibana } from '../../../../../src/plugins/kibana_react/public'; import { ClientPluginsStart } from './plugin'; import { useNoDataConfig } from './use_no_data_config'; @@ -44,14 +44,16 @@ export const UptimePageTemplateComponent: React.FC = ({ path, pageHeader, return ; } - const showLoading = loading && path === OVERVIEW_ROUTE && !data; + const isMainRoute = path === OVERVIEW_ROUTE || path === CERTIFICATES_ROUTE; + + const showLoading = loading && isMainRoute && !data; return ( <> -
{showLoading && }
{ return ( <> - +

{statusMessage( steps.reduce(reduceStepStatus, { failed: 0, skipped: 0, succeeded: 0 }), diff --git a/x-pack/test/functional/apps/infra/feature_controls/infrastructure_security.ts b/x-pack/test/functional/apps/infra/feature_controls/infrastructure_security.ts index 0118cfdafc2b3..65b9019f556fd 100644 --- a/x-pack/test/functional/apps/infra/feature_controls/infrastructure_security.ts +++ b/x-pack/test/functional/apps/infra/feature_controls/infrastructure_security.ts @@ -66,13 +66,12 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { }); describe('infrastructure landing page without data', () => { - it(`shows 'Change source configuration' button`, async () => { + it('shows no data page', async () => { await PageObjects.common.navigateToUrlWithBrowserHistory('infraOps', '', undefined, { ensureCurrentUrl: true, shouldLoginIfPrompted: false, }); - await testSubjects.existOrFail('~infrastructureViewSetupInstructionsButton'); - await testSubjects.existOrFail('~configureSourceButton'); + await testSubjects.existOrFail('~noDataPage'); }); it(`doesn't show read-only badge`, async () => { @@ -164,13 +163,12 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { }); describe('infrastructure landing page without data', () => { - it(`doesn't show 'Change source configuration' button`, async () => { + it('shows No data page', async () => { await PageObjects.common.navigateToUrlWithBrowserHistory('infraOps', '', undefined, { ensureCurrentUrl: true, shouldLoginIfPrompted: false, }); - await testSubjects.existOrFail('~infrastructureViewSetupInstructionsButton'); - await testSubjects.missingOrFail('~configureSourceButton'); + await testSubjects.existOrFail('~noDataPage'); }); it(`shows read-only badge`, async () => { diff --git a/x-pack/test/functional/apps/infra/feature_controls/infrastructure_spaces.ts b/x-pack/test/functional/apps/infra/feature_controls/infrastructure_spaces.ts index 94886a89002b2..545eb08223693 100644 --- a/x-pack/test/functional/apps/infra/feature_controls/infrastructure_spaces.ts +++ b/x-pack/test/functional/apps/infra/feature_controls/infrastructure_spaces.ts @@ -51,7 +51,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { await PageObjects.common.navigateToApp('infraOps', { basePath: '/s/custom_space', }); - await testSubjects.existOrFail('~noMetricsIndicesPrompt'); + await testSubjects.existOrFail('~noDataPage'); }); }); @@ -118,7 +118,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { await PageObjects.common.navigateToApp('infraOps', { basePath: '/s/custom_space', }); - await testSubjects.existOrFail('~noMetricsIndicesPrompt'); + await testSubjects.existOrFail('~noDataPage'); }); }); @@ -143,7 +143,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { await PageObjects.common.navigateToApp('infraOps', { basePath: '/s/custom_space', }); - await testSubjects.existOrFail('~noMetricsIndicesPrompt'); + await testSubjects.existOrFail('~noDataPage'); }); }); }); diff --git a/x-pack/test/functional/apps/infra/feature_controls/logs_security.ts b/x-pack/test/functional/apps/infra/feature_controls/logs_security.ts index d5e22af657d6a..d120a6c582c7b 100644 --- a/x-pack/test/functional/apps/infra/feature_controls/logs_security.ts +++ b/x-pack/test/functional/apps/infra/feature_controls/logs_security.ts @@ -63,14 +63,13 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { }); describe('logs landing page without data', () => { - it(`shows 'Change source configuration' button`, async () => { + it(`shows the 'No data' page`, async () => { await PageObjects.common.navigateToUrlWithBrowserHistory('infraLogs', '', undefined, { ensureCurrentUrl: true, shouldLoginIfPrompted: false, }); await testSubjects.existOrFail('~infraLogsPage'); - await testSubjects.existOrFail('~logsViewSetupInstructionsButton'); - await testSubjects.existOrFail('~configureSourceButton'); + await testSubjects.existOrFail('~noDataPage'); }); it(`doesn't show read-only badge`, async () => { @@ -126,14 +125,13 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { }); describe('logs landing page without data', () => { - it(`doesn't show 'Change source configuration' button`, async () => { + it(`Shows the 'No data' page`, async () => { await PageObjects.common.navigateToUrlWithBrowserHistory('infraLogs', '', undefined, { ensureCurrentUrl: true, shouldLoginIfPrompted: false, }); await testSubjects.existOrFail('~infraLogsPage'); - await testSubjects.existOrFail('~logsViewSetupInstructionsButton'); - await testSubjects.missingOrFail('~configureSourceButton'); + await testSubjects.existOrFail('~noDataPage'); }); it(`shows read-only badge`, async () => { diff --git a/x-pack/test/functional/apps/infra/feature_controls/logs_spaces.ts b/x-pack/test/functional/apps/infra/feature_controls/logs_spaces.ts index a67d7d1858af3..9c5e5667cf39c 100644 --- a/x-pack/test/functional/apps/infra/feature_controls/logs_spaces.ts +++ b/x-pack/test/functional/apps/infra/feature_controls/logs_spaces.ts @@ -43,15 +43,14 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { }); describe('logs landing page without data', () => { - it(`shows 'Change source configuration' button`, async () => { + it(`shows 'No data' page`, async () => { await PageObjects.common.navigateToUrlWithBrowserHistory('infraLogs', '', undefined, { basePath: '/s/custom_space', ensureCurrentUrl: true, shouldLoginIfPrompted: false, }); await testSubjects.existOrFail('~infraLogsPage'); - await testSubjects.existOrFail('~logsViewSetupInstructionsButton'); - await testSubjects.existOrFail('~configureSourceButton'); + await testSubjects.existOrFail('~noDataPage'); }); }); }); diff --git a/x-pack/test/functional/apps/infra/log_entry_categories_tab.ts b/x-pack/test/functional/apps/infra/log_entry_categories_tab.ts index 33133e6306efe..11587845aae9c 100644 --- a/x-pack/test/functional/apps/infra/log_entry_categories_tab.ts +++ b/x-pack/test/functional/apps/infra/log_entry_categories_tab.ts @@ -10,6 +10,7 @@ import expect from '@kbn/expect'; import { FtrProviderContext } from '../../ftr_provider_context'; export default ({ getService }: FtrProviderContext) => { + const esArchiver = getService('esArchiver'); const logsUi = getService('logsUi'); const retry = getService('retry'); @@ -17,12 +18,22 @@ export default ({ getService }: FtrProviderContext) => { this.tags('includeFirefox'); describe('with a trial license', () => { - it('is visible', async () => { + it('Shows no data page when indices do not exist', async () => { + await logsUi.logEntryCategoriesPage.navigateTo(); + + await retry.try(async () => { + expect(await logsUi.logEntryCategoriesPage.getNoDataScreen()).to.be.ok(); + }); + }); + + it('shows setup page when indices exist', async () => { + await esArchiver.load('x-pack/test/functional/es_archives/infra/simple_logs'); await logsUi.logEntryCategoriesPage.navigateTo(); await retry.try(async () => { expect(await logsUi.logEntryCategoriesPage.getSetupScreen()).to.be.ok(); }); + await esArchiver.unload('x-pack/test/functional/es_archives/infra/simple_logs'); }); }); }); diff --git a/x-pack/test/functional/apps/infra/log_entry_rate_tab.ts b/x-pack/test/functional/apps/infra/log_entry_rate_tab.ts index 1635824529749..632b1e6917ca0 100644 --- a/x-pack/test/functional/apps/infra/log_entry_rate_tab.ts +++ b/x-pack/test/functional/apps/infra/log_entry_rate_tab.ts @@ -12,17 +12,28 @@ import { FtrProviderContext } from '../../ftr_provider_context'; export default ({ getService }: FtrProviderContext) => { const logsUi = getService('logsUi'); const retry = getService('retry'); + const esArchiver = getService('esArchiver'); describe('Log Entry Rate Tab', function () { this.tags('includeFirefox'); describe('with a trial license', () => { - it('is visible', async () => { + it('Shows no data page when indices do not exist', async () => { + await logsUi.logEntryRatePage.navigateTo(); + + await retry.try(async () => { + expect(await logsUi.logEntryRatePage.getNoDataScreen()).to.be.ok(); + }); + }); + + it('shows setup page when indices exist', async () => { + await esArchiver.load('x-pack/test/functional/es_archives/infra/simple_logs'); await logsUi.logEntryRatePage.navigateTo(); await retry.try(async () => { expect(await logsUi.logEntryRatePage.getSetupScreen()).to.be.ok(); }); + await esArchiver.unload('x-pack/test/functional/es_archives/infra/simple_logs'); }); }); }); diff --git a/x-pack/test/functional/apps/infra/logs_source_configuration.ts b/x-pack/test/functional/apps/infra/logs_source_configuration.ts index b84109637885c..dcbe30864640b 100644 --- a/x-pack/test/functional/apps/infra/logs_source_configuration.ts +++ b/x-pack/test/functional/apps/infra/logs_source_configuration.ts @@ -60,7 +60,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { await logsUi.logStreamPage.navigateTo(); await retry.try(async () => { - await logsUi.logStreamPage.getNoLogsIndicesPrompt(); + await logsUi.logStreamPage.getNoDataPage(); }); }); diff --git a/x-pack/test/functional/page_objects/infra_home_page.ts b/x-pack/test/functional/page_objects/infra_home_page.ts index 0790c694e772c..726668e3b1b0a 100644 --- a/x-pack/test/functional/page_objects/infra_home_page.ts +++ b/x-pack/test/functional/page_objects/infra_home_page.ts @@ -141,7 +141,7 @@ export function InfraHomePageProvider({ getService, getPageObjects }: FtrProvide }, async getNoMetricsIndicesPrompt() { - return await testSubjects.find('noMetricsIndicesPrompt'); + return await testSubjects.find('noDataPage'); }, async getNoMetricsDataPrompt() { diff --git a/x-pack/test/functional/services/logs_ui/log_entry_categories.ts b/x-pack/test/functional/services/logs_ui/log_entry_categories.ts index b244360ce4ce4..0aec1cbea2210 100644 --- a/x-pack/test/functional/services/logs_ui/log_entry_categories.ts +++ b/x-pack/test/functional/services/logs_ui/log_entry_categories.ts @@ -17,6 +17,10 @@ export function LogEntryCategoriesPageProvider({ getPageObjects, getService }: F await pageObjects.infraLogs.navigateToTab('log-categories'); }, + async getNoDataScreen(): Promise { + return await testSubjects.find('noDataPage'); + }, + async getSetupScreen(): Promise { return await testSubjects.find('logEntryCategoriesSetupPage'); }, diff --git a/x-pack/test/functional/services/logs_ui/log_entry_rate.ts b/x-pack/test/functional/services/logs_ui/log_entry_rate.ts index e517fd76a06dc..6be84edeb1940 100644 --- a/x-pack/test/functional/services/logs_ui/log_entry_rate.ts +++ b/x-pack/test/functional/services/logs_ui/log_entry_rate.ts @@ -20,5 +20,9 @@ export function LogEntryRatePageProvider({ getPageObjects, getService }: FtrProv async getSetupScreen(): Promise { return await testSubjects.find('logEntryRateSetupPage'); }, + + async getNoDataScreen() { + return await testSubjects.find('noDataPage'); + }, }; } diff --git a/x-pack/test/functional/services/logs_ui/log_stream.ts b/x-pack/test/functional/services/logs_ui/log_stream.ts index 89afae57507d9..214290bd21ef4 100644 --- a/x-pack/test/functional/services/logs_ui/log_stream.ts +++ b/x-pack/test/functional/services/logs_ui/log_stream.ts @@ -46,5 +46,9 @@ export function LogStreamPageProvider({ getPageObjects, getService }: FtrProvide async getNoLogsIndicesPrompt() { return await testSubjects.find('noLogsIndicesPrompt'); }, + + async getNoDataPage() { + return await testSubjects.find('noDataPage'); + }, }; }