-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Guided onboarding] Update header button logic (#144634)
## Summary Fixes #141129 Fixes #144515 This PR introduces a new state to the guided onboarding plugin. The state keeps track of the `creationDate` and of the overall `status` of the plugin. The creation date allows us to detect an "active" period during which the header button will be displayed more prominently in the header. Currently, the active period is set to 30 days. During this time, if the user has not started any guide, has quit a guide before completion or skipped the guide on the landing page, the header button will be displayed and when clicked, redirect the user to the landing page to start/continue a guide. Also this PR adds a check for Cloud deployments and prevents the code from sending any API requests when not on Cloud, because guided onboarding is disabled on prem. #### Screenshot <img width="298" alt="Screenshot 2022-11-10 at 18 42 18" src="https://user-images.githubusercontent.com/6585477/201168414-391a7cd4-0709-492b-9001-1432b5bed3c8.png"> ### Checklist - [x] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md) - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
- Loading branch information
1 parent
e2d3bb9
commit 879b101
Showing
37 changed files
with
1,539 additions
and
932 deletions.
There are no files selected for viewing
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
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
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,26 @@ | ||
/* | ||
* 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 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
import { GuideState } from '@kbn/guided-onboarding'; | ||
|
||
/** | ||
* Guided onboarding overall status: | ||
* not_started: no guides have been started yet | ||
* in_progress: a guide is currently active | ||
* complete: at least one guide has been completed | ||
* quit: the user quit a guide before completion | ||
* skipped: the user skipped on the landing page | ||
*/ | ||
export type PluginStatus = 'not_started' | 'in_progress' | 'complete' | 'quit' | 'skipped'; | ||
|
||
export interface PluginState { | ||
status: PluginStatus; | ||
// a specific period after deployment creation when guided onboarding UI is highlighted | ||
isActivePeriod: boolean; | ||
activeGuide?: GuideState; | ||
} |
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
Oops, something went wrong.