mirror of
https://github.com/elastic/kibana.git
synced 2025-06-28 03:01:21 -04:00
[Guided onboarding] Add guide config route (#146149)
## Summary Fixes https://github.com/elastic/kibana/issues/145871 Fixes https://github.com/elastic/kibana/issues/145875 This PR adds an internal API endpoint that returns all existing config guides. The client side code (api service) is updated to use the endpoint instead of a guide configs file. Note: This PR deletes the docs link for the kube-state-metrics from the "Add data" step in the Kubernetes guide. I opened https://github.com/elastic/kibana/issues/146404 to follow up on this. ### Checklist - [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>
This commit is contained in:
parent
9e6f24a331
commit
e7da574c5d
29 changed files with 723 additions and 206 deletions
|
@ -27,7 +27,6 @@ import {
|
|||
} from '@elastic/eui';
|
||||
import type { GuideState, GuideStepIds, GuideId, GuideStep } from '@kbn/guided-onboarding';
|
||||
import type { GuidedOnboardingPluginStart } from '@kbn/guided-onboarding-plugin/public';
|
||||
import { guidesConfig } from '@kbn/guided-onboarding-plugin/public';
|
||||
|
||||
interface MainProps {
|
||||
guidedOnboarding: GuidedOnboardingPluginStart;
|
||||
|
@ -75,7 +74,15 @@ export const Main = (props: MainProps) => {
|
|||
};
|
||||
|
||||
const updateGuideState = async () => {
|
||||
const selectedGuideConfig = guidesConfig[selectedGuide!];
|
||||
if (!selectedGuide) {
|
||||
return;
|
||||
}
|
||||
|
||||
const selectedGuideConfig = await guidedOnboardingApi?.getGuideConfig(selectedGuide);
|
||||
|
||||
if (!selectedGuideConfig) {
|
||||
return;
|
||||
}
|
||||
const selectedStepIndex = selectedGuideConfig.steps.findIndex(
|
||||
(step) => step.id === selectedStep!
|
||||
);
|
||||
|
@ -199,7 +206,7 @@ export const Main = (props: MainProps) => {
|
|||
</EuiText>
|
||||
<EuiSpacer />
|
||||
<EuiFlexGroup>
|
||||
{(Object.keys(guidesConfig) as GuideId[]).map((guideId) => {
|
||||
{(['search', 'security', 'observability', 'testGuide'] as GuideId[]).map((guideId) => {
|
||||
const guideState = guidesState?.find((guide) => guide.guideId === guideId);
|
||||
return (
|
||||
<EuiFlexItem>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue