Merge pull request #1919 from influxdata/dataLoaders/add-new-source

Fix(ui/dataLoaders): Update streaming button to send you to the streaming step
pull/10616/head
Iris Scholten 2018-12-13 09:58:20 -08:00 committed by GitHub
commit 3d8564759b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 8 deletions

View File

@ -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}
/>,
]
}

View File

@ -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,

View File

@ -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}`)
}
}