-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Logs onboarding] Added entry points for observability onboarding lan…
…ding page (#163300) Closes #162230. ### Changes - Card `Collect and analyse my logs` in getting started is now pointing to `app/observabilityOnboarding`. - `Data assistant for observability` callout in observability overview was removed in favour of `Collect and analyse logs in observability` callout. #### Getting started - Before https://github.com/elastic/kibana/assets/1313018/4a3a0f64-ee34-48c5-9395-f3965763a1d1 #### Getting started - After https://github.com/elastic/kibana/assets/1313018/d30c2cf0-dc01-4a9d-a808-7caa5da7c008 #### Observability overview - before https://github.com/elastic/kibana/assets/1313018/6960b178-4e3e-49a6-bea8-4501778f1e12 #### Observability overview - after https://github.com/elastic/kibana/assets/1313018/316f27f7-5ac2-44a9-85a6-7f8c2b343300 --------- Co-authored-by: Achyut Jhunjhunwala <[email protected]>
- Loading branch information
1 parent
ccc252d
commit 5e49bfd
Showing
7 changed files
with
153 additions
and
39 deletions.
There are no files selected for viewing
3 changes: 1 addition & 2 deletions
3
...kbn-guided-onboarding/src/components/landing_page/__snapshots__/guide_cards.test.tsx.snap
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
x-pack/plugins/observability/public/hooks/use_observability_onboarding.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import { useState, useCallback } from 'react'; | ||
|
||
export const LOCAL_STORAGE_DISMISS_OBSERVABILITY_ONBOARDING_KEY = | ||
'DISMISS_OBSERVABILITY_ONBOARDING'; | ||
|
||
export function useObservabilityOnboarding() { | ||
const dismissedObservabilityOnboardingLocalStorage = window.localStorage.getItem( | ||
LOCAL_STORAGE_DISMISS_OBSERVABILITY_ONBOARDING_KEY | ||
); | ||
const [isObservabilityOnboardingDismissed, setIsObservabilityOnboardingDismissed] = | ||
useState<boolean>(JSON.parse(dismissedObservabilityOnboardingLocalStorage || 'false')); | ||
|
||
const dismissObservabilityOnboarding = useCallback(() => { | ||
window.localStorage.setItem(LOCAL_STORAGE_DISMISS_OBSERVABILITY_ONBOARDING_KEY, 'true'); | ||
setIsObservabilityOnboardingDismissed(true); | ||
}, []); | ||
|
||
return { | ||
isObservabilityOnboardingDismissed, | ||
dismissObservabilityOnboarding, | ||
}; | ||
} |
95 changes: 95 additions & 0 deletions
95
...ugins/observability/public/pages/overview/components/observability_onboarding_callout.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
import { | ||
EuiButton, | ||
EuiButtonEmpty, | ||
EuiFlexGroup, | ||
EuiFlexItem, | ||
EuiPanel, | ||
EuiSpacer, | ||
EuiText, | ||
EuiTitle, | ||
} from '@elastic/eui'; | ||
import { FormattedMessage } from '@kbn/i18n-react'; | ||
import { useKibana } from '@kbn/kibana-react-plugin/public'; | ||
import { useUiTracker } from '@kbn/observability-shared-plugin/public'; | ||
import React, { useCallback } from 'react'; | ||
import { useObservabilityOnboarding } from '../../../hooks/use_observability_onboarding'; | ||
|
||
export function ObservabilityOnboardingCallout() { | ||
const { application } = useKibana().services; | ||
|
||
const trackMetric = useUiTracker({ app: 'observability-overview' }); | ||
const { isObservabilityOnboardingDismissed, dismissObservabilityOnboarding } = | ||
useObservabilityOnboarding(); | ||
|
||
const dismissOnboarding = useCallback(() => { | ||
dismissObservabilityOnboarding(); | ||
trackMetric({ metric: 'observability_onboarding_dismiss' }); | ||
}, [dismissObservabilityOnboarding, trackMetric]); | ||
|
||
const getStarted = () => { | ||
trackMetric({ metric: 'observability_onboarding_get_started' }); | ||
application?.navigateToApp('observabilityOnboarding'); | ||
}; | ||
|
||
return !isObservabilityOnboardingDismissed ? ( | ||
<> | ||
<EuiPanel color="primary" data-test-subj="observability-onboarding-callout"> | ||
<EuiFlexGroup> | ||
<EuiFlexItem> | ||
<EuiTitle size="xxs"> | ||
<h2> | ||
<FormattedMessage | ||
id="xpack.observability.overview.observabilityOnboarding" | ||
defaultMessage="Collect and analyze logs in observability" | ||
/> | ||
</h2> | ||
</EuiTitle> | ||
<EuiText size="xs" color="subdued"> | ||
<p> | ||
<FormattedMessage | ||
id="xpack.observability.overview.observabilityOnboarding.description" | ||
defaultMessage="Onboard your data in up to 5 minutes to start analysing it straight away." | ||
/> | ||
</p> | ||
</EuiText> | ||
</EuiFlexItem> | ||
<EuiFlexItem grow={false}> | ||
<EuiFlexGroup responsive={false} direction="row" alignItems="center"> | ||
<EuiFlexItem> | ||
<EuiButtonEmpty | ||
data-test-subj="o11yObservabilityOnboardingDismissButton" | ||
size="s" | ||
onClick={dismissOnboarding} | ||
> | ||
<FormattedMessage | ||
id="xpack.observability.overview.observabilityOnboarding.dismiss" | ||
defaultMessage="Dismiss" | ||
/> | ||
</EuiButtonEmpty> | ||
</EuiFlexItem> | ||
<EuiFlexItem> | ||
<EuiButton | ||
data-test-subj="o11yObservabilityOnboardingGetStartedButton" | ||
size="s" | ||
onClick={getStarted} | ||
> | ||
<FormattedMessage | ||
id="xpack.observability.overview.observabilityOnboarding.getStarted" | ||
defaultMessage="Get started" | ||
/> | ||
</EuiButton> | ||
</EuiFlexItem> | ||
</EuiFlexGroup> | ||
</EuiFlexItem> | ||
</EuiFlexGroup> | ||
</EuiPanel> | ||
<EuiSpacer /> | ||
</> | ||
) : null; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters