Skip to content

Commit

Permalink
Implement "completed" guide animation (elastic#149530)
Browse files Browse the repository at this point in the history
Fixes elastic#147387

### Screenshots

<img width="522" alt="Screenshot 2023-01-27 at 14 49 09"
src="https://user-images.githubusercontent.com/91763/215115481-beab7f69-60c6-48f5-8ab0-d8dcb67fabb7.png">

<img width="559" alt="Screenshot 2023-01-27 at 14 49 52"
src="https://user-images.githubusercontent.com/91763/215115506-5bf328a0-7b47-44d5-b9db-62f5a30dfed7.png">
  • Loading branch information
claracruz authored and kqualters-elastic committed Feb 6, 2023
1 parent 9f2b582 commit ce73652
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 2 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ export const getGuidePanelStyles = ({
setupButton: css`
margin-right: ${euiTheme.size.m};
`,
wellDoneAnimatedPrompt: css`
text-align: left;
`,
flyoutOverrides: {
flyoutHeader: css`
background: url(${isDarkTheme ? panelBgTopDark : panelBgTop}) top right no-repeat;
Expand Down
25 changes: 23 additions & 2 deletions src/plugins/guided_onboarding/public/components/guide_panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import {
EuiFlexItem,
useEuiTheme,
EuiEmptyPrompt,
EuiImage,
} from '@elastic/eui';

import { i18n } from '@kbn/i18n';
Expand All @@ -42,6 +43,9 @@ import { QuitGuideModal } from './quit_guide_modal';
import { getGuidePanelStyles } from './guide_panel.styles';
import { GuideButton } from './guide_button';

import wellDoneAnimatedGif from '../../assets/well_done_animated.gif';
import wellDoneAnimatedDarkGif from '../../assets/well_done_animated_dark.gif';

interface GuidePanelProps {
api: GuidedOnboardingApi;
application: ApplicationStart;
Expand Down Expand Up @@ -220,6 +224,9 @@ export const GuidePanel = ({ api, application, notifications, uiSettings }: Guid

const stepsCompleted = getProgress(pluginState?.activeGuide);
const isGuideReadyToComplete = pluginState?.activeGuide?.status === 'ready_to_complete';
const getImageUrl = () => {
return isDarkTheme ? wellDoneAnimatedDarkGif : wellDoneAnimatedGif;
};

const backToGuidesButton = (
<EuiButtonEmpty
Expand Down Expand Up @@ -277,13 +284,27 @@ export const GuidePanel = ({ api, application, notifications, uiSettings }: Guid

<EuiFlyoutBody css={styles.flyoutOverrides.flyoutBody}>
<div>
{isGuideReadyToComplete && (
<>
<EuiImage
size="fullWidth"
src={getImageUrl()}
alt={i18n.translate('guidedOnboarding.dropdownPanel.wellDoneAnimatedGif', {
defaultMessage: `Guide completed animated gif`,
})}
/>

<EuiSpacer />
</>
)}

<EuiText size="m">
<p data-test-subj="guideDescription">
{isGuideReadyToComplete
? i18n.translate(
'guidedOnboarding.dropdownPanel.completeGuideFlyoutDescription',
{
defaultMessage: `You've completed the Elastic {guideName} guide.`,
defaultMessage: `You've completed the Elastic {guideName} guide. Feel free to come back to the Guides for more onboarding help or a refresher.`,
values: {
guideName: guideConfig.guideName,
},
Expand All @@ -295,7 +316,7 @@ export const GuidePanel = ({ api, application, notifications, uiSettings }: Guid

{guideConfig.docs && (
<>
<EuiSpacer size="s" />
<EuiSpacer size="l" />
<EuiText size="m">
<EuiLink external target="_blank" href={guideConfig.docs.url}>
{guideConfig.docs.text}
Expand Down

0 comments on commit ce73652

Please sign in to comment.