-
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] Add client side routing support for individual steps (
#161230) Closes #159500. This PR focuses on adding client-site routing support to the wizard developed for observability_onboarding plugin. ### Changes - Added routes for each step of the wizard. - Added support for `history.push` and `history.goBack` in wizard context. - Added basePath to wizard provider. https://github.com/elastic/kibana/assets/1313018/c32e25b3-2470-41a4-8c34-f2dd5ea7c366
- Loading branch information
Showing
14 changed files
with
283 additions
and
149 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
29 changes: 29 additions & 0 deletions
29
...plugins/observability_onboarding/public/components/app/custom_logs/wizard/back_button.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,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 { EuiButton } from '@elastic/eui'; | ||
import { i18n } from '@kbn/i18n'; | ||
import React from 'react'; | ||
import { useHistory } from 'react-router-dom'; | ||
import { useWizard } from '.'; | ||
|
||
export function BackButton({ onBack }: { onBack: () => void }) { | ||
const { getPath } = useWizard(); | ||
const history = useHistory(); | ||
|
||
return ( | ||
<EuiButton | ||
color="text" | ||
onClick={onBack} | ||
disabled={history.length === 1 || getPath().length === 1} | ||
> | ||
{i18n.translate('xpack.observability_onboarding.steps.back', { | ||
defaultMessage: 'Back', | ||
})} | ||
</EuiButton> | ||
); | ||
} |
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
Oops, something went wrong.