Merge pull request #1919 from influxdata/dataLoaders/add-new-source
Fix(ui/dataLoaders): Update streaming button to send you to the streaming steppull/10616/head
commit
3d8564759b
|
@ -27,7 +27,7 @@ interface Props {
|
|||
notify: NotificationAction
|
||||
onTabClick: (tabID: string) => void
|
||||
currentStepIndex: number
|
||||
handleNewSourceClick: () => void
|
||||
onNewSourceClick: () => void
|
||||
}
|
||||
|
||||
const configStateToTabStatus = (cs: ConfigurationState): TabStatus => {
|
||||
|
@ -71,7 +71,7 @@ class OnboardingSideBar extends Component<Props> {
|
|||
}
|
||||
|
||||
private get buttons(): JSX.Element[] {
|
||||
const {handleNewSourceClick} = this.props
|
||||
const {onNewSourceClick} = this.props
|
||||
return [
|
||||
<SideBar.Button
|
||||
key="Download Config File"
|
||||
|
@ -87,7 +87,7 @@ class OnboardingSideBar extends Component<Props> {
|
|||
titleText="Add New Source"
|
||||
color={ComponentColor.Default}
|
||||
icon={IconFont.Plus}
|
||||
onClick={handleNewSourceClick}
|
||||
onClick={onNewSourceClick}
|
||||
/>,
|
||||
]
|
||||
}
|
||||
|
|
|
@ -63,7 +63,10 @@ interface OwnProps {
|
|||
onIncrementCurrentStepIndex: () => void
|
||||
onDecrementCurrentStepIndex: () => void
|
||||
onSetCurrentStepIndex: (stepNumber: number) => void
|
||||
onSetCurrentSubStepIndex: (stepNumber: number, substepNumber: number) => void
|
||||
onSetCurrentSubStepIndex: (
|
||||
stepNumber: number,
|
||||
substep: number | 'streaming'
|
||||
) => void
|
||||
}
|
||||
|
||||
interface DispatchProps {
|
||||
|
@ -121,7 +124,6 @@ class OnboardingWizard extends PureComponent<Props> {
|
|||
onRemovePluginBundle,
|
||||
setupParams,
|
||||
notify,
|
||||
onDecrementCurrentStepIndex,
|
||||
} = this.props
|
||||
|
||||
return (
|
||||
|
@ -136,7 +138,7 @@ class OnboardingWizard extends PureComponent<Props> {
|
|||
title="Plugins to Configure"
|
||||
visible={this.sideBarVisible}
|
||||
currentStepIndex={currentStepIndex}
|
||||
handleNewSourceClick={onDecrementCurrentStepIndex}
|
||||
onNewSourceClick={this.handleNewSourceClick}
|
||||
/>
|
||||
<div className="wizard-step--container">
|
||||
<OnboardingStepSwitcher
|
||||
|
@ -201,6 +203,11 @@ class OnboardingWizard extends PureComponent<Props> {
|
|||
return isStreaming && isSideBarStep
|
||||
}
|
||||
|
||||
private handleNewSourceClick = () => {
|
||||
const {onSetCurrentSubStepIndex} = this.props
|
||||
onSetCurrentSubStepIndex(2, 'streaming')
|
||||
}
|
||||
|
||||
private handleClickSideBarTab = (telegrafPluginID: string) => {
|
||||
const {
|
||||
onSetCurrentSubStepIndex,
|
||||
|
|
|
@ -93,10 +93,10 @@ export class OnboardingWizardPage extends PureComponent<Props, State> {
|
|||
router.push(`/onboarding/${index}`)
|
||||
}
|
||||
|
||||
private setSubstepIndex = (index: number, subIndex: number) => {
|
||||
private setSubstepIndex = (index: number, subStep: number | 'streaming') => {
|
||||
const {router} = this.props
|
||||
|
||||
router.push(`/onboarding/${index}/${subIndex}`)
|
||||
router.push(`/onboarding/${index}/${subStep}`)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue