mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
[Serverless] Improve observability project empty state in analytics apps (#168598)
## Summary
fix https://github.com/elastic/kibana/issues/166233 (this is a short
term fix that removes "analytics" references from the empty state page
in serverless observability analytics apps)

This commit is contained in:
parent
42742241f7
commit
b207f24dab
8 changed files with 79 additions and 18 deletions
|
@ -16,6 +16,9 @@ xpack.serverless.observability.enabled: true
|
|||
## Set the home route
|
||||
uiSettings.overrides.defaultRoute: /app/observability/landing
|
||||
|
||||
# Customize empty page state for analytics apps
|
||||
no_data_page.analyticsNoDataPageFlavor: 'serverless_observability'
|
||||
|
||||
## Set the dev project switch current type
|
||||
xpack.serverless.plugin.developer.projectSwitcher.currentType: 'observability'
|
||||
|
||||
|
|
|
@ -147,5 +147,25 @@ describe('AnalyticsNoDataPageComponent', () => {
|
|||
await screen.findByTestId('kbnOverviewElasticsearchGettingStarted');
|
||||
});
|
||||
});
|
||||
|
||||
describe('serverless_observability flavor', () => {
|
||||
it('renders getting started card', async () => {
|
||||
render(
|
||||
<I18nProvider>
|
||||
<AnalyticsNoDataPageProvider {...{ ...services, hasESData: async () => false }}>
|
||||
<AnalyticsNoDataPage
|
||||
pageFlavor={'serverless_observability'}
|
||||
onDataViewCreated={onDataViewCreated}
|
||||
kibanaGuideDocLink={'http://www.test.com'}
|
||||
showPlainSpinner={false}
|
||||
prependBasePath={(path: string) => path}
|
||||
/>
|
||||
</AnalyticsNoDataPageProvider>
|
||||
</I18nProvider>
|
||||
);
|
||||
|
||||
await screen.findByTestId('kbnObservabilityNoData');
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -79,6 +79,31 @@ const flavors: {
|
|||
},
|
||||
},
|
||||
}),
|
||||
serverless_observability: ({ prependBasePath }) => ({
|
||||
solution: i18n.translate('sharedUXPackages.noDataConfig.observability', {
|
||||
defaultMessage: 'Observability',
|
||||
}),
|
||||
pageTitle: i18n.translate('sharedUXPackages.noDataConfig.observabilityPageTitle', {
|
||||
defaultMessage: 'Welcome to Elastic Observability!',
|
||||
}),
|
||||
pageDescription: i18n.translate('sharedUXPackages.noDataConfig.observabilityPageDescription', {
|
||||
defaultMessage:
|
||||
'Converge metrics, logs, and traces to monitor the health of your applications.',
|
||||
}),
|
||||
logo: 'logoObservability',
|
||||
action: {
|
||||
observability: {
|
||||
title: i18n.translate('sharedUXPackages.noDataConfig.observabilityTitle', {
|
||||
defaultMessage: 'Add data',
|
||||
}),
|
||||
description: i18n.translate('sharedUXPackages.noDataConfig.observabilityDescription', {
|
||||
defaultMessage: 'Get started by collecting data using one of our many integrations.',
|
||||
}),
|
||||
'data-test-subj': 'kbnObservabilityNoData',
|
||||
href: prependBasePath('/app/observabilityOnboarding/'),
|
||||
},
|
||||
},
|
||||
}),
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
@ -26,7 +26,7 @@ export interface Services {
|
|||
*/
|
||||
export type AnalyticsNoDataPageServices = Services & KibanaNoDataPageServices;
|
||||
|
||||
export type AnalyticsNoDataPageFlavor = 'kibana' | 'serverless_search';
|
||||
export type AnalyticsNoDataPageFlavor = 'kibana' | 'serverless_search' | 'serverless_observability';
|
||||
|
||||
export interface KibanaDependencies {
|
||||
coreStart: {
|
||||
|
|
|
@ -24,6 +24,7 @@ export const NoDataPage = ({
|
|||
action,
|
||||
docsLink,
|
||||
pageTitle,
|
||||
pageDescription,
|
||||
className,
|
||||
}: NoDataPageProps) => {
|
||||
const title =
|
||||
|
@ -39,21 +40,23 @@ export const NoDataPage = ({
|
|||
</EuiLink>
|
||||
) : null;
|
||||
|
||||
const message = link ? (
|
||||
<FormattedMessage
|
||||
id="sharedUXPackages.noDataPage.intro"
|
||||
defaultMessage="Add your data to get started, or {link} about {solution}."
|
||||
values={{
|
||||
solution,
|
||||
link,
|
||||
}}
|
||||
/>
|
||||
) : (
|
||||
<FormattedMessage
|
||||
id="sharedUXPackages.noDataPage.introNoDocLink"
|
||||
defaultMessage="Add your data to get started."
|
||||
/>
|
||||
);
|
||||
const message =
|
||||
pageDescription ??
|
||||
(link ? (
|
||||
<FormattedMessage
|
||||
id="sharedUXPackages.noDataPage.intro"
|
||||
defaultMessage="Add your data to get started, or {link} about {solution}."
|
||||
values={{
|
||||
solution,
|
||||
link,
|
||||
}}
|
||||
/>
|
||||
) : (
|
||||
<FormattedMessage
|
||||
id="sharedUXPackages.noDataPage.introNoDocLink"
|
||||
defaultMessage="Add your data to get started."
|
||||
/>
|
||||
));
|
||||
|
||||
return (
|
||||
<EuiPageTemplate.Section
|
||||
|
|
|
@ -42,6 +42,10 @@ export interface NoDataPageProps extends CommonProps, ActionCardProps {
|
|||
* Optionally replace the auto-generated page title (h1)
|
||||
*/
|
||||
pageTitle?: string;
|
||||
/**
|
||||
* Optionally replace the auto-generated page description
|
||||
*/
|
||||
pageDescription?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -11,7 +11,13 @@ import { schema, TypeOf, offeringBasedSchema } from '@kbn/config-schema';
|
|||
export const configSchema = schema.object({
|
||||
analyticsNoDataPageFlavor: offeringBasedSchema({
|
||||
serverless: schema.oneOf(
|
||||
[schema.oneOf([schema.literal('kibana'), schema.literal('serverless_search')])],
|
||||
[
|
||||
schema.oneOf([
|
||||
schema.literal('kibana'),
|
||||
schema.literal('serverless_search'),
|
||||
schema.literal('serverless_observability'),
|
||||
]),
|
||||
],
|
||||
{ defaultValue: 'kibana' as const }
|
||||
),
|
||||
}),
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
*/
|
||||
|
||||
export interface NoDataPagePluginSetup {
|
||||
getAnalyticsNoDataPageFlavor: () => 'kibana' | 'serverless_search';
|
||||
getAnalyticsNoDataPageFlavor: () => 'kibana' | 'serverless_search' | 'serverless_observability';
|
||||
}
|
||||
|
||||
export type NoDataPagePluginStart = NoDataPagePluginSetup;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue