Skip to content

Commit

Permalink
chore(client_libs): update Node.js wizard to use new v3 client
Browse files Browse the repository at this point in the history
  • Loading branch information
bednar committed Jul 13, 2023
1 parent d625f5e commit 2ce0678
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ export const QueryDataAccordion: FC = () => {
'C#': 'new-user-setup/csharp',
Go: 'new-user-setup/golang',
Java: 'new-user-setup/java',
'Node.js': 'new-user-setup/nodejs',
Python: 'new-user-setup/python',
}

Expand Down
56 changes: 52 additions & 4 deletions src/homepageExperience/containers/NodejsWizard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import {event} from 'src/cloud/utils/reporting'
import {
scrollNextPageIntoView,
HOMEPAGE_NAVIGATION_STEPS,
HOMEPAGE_NAVIGATION_STEPS_WRITE_ONLY,
HOMEPAGE_NAVIGATION_STEPS_SQL,
} from 'src/homepageExperience/utils'
import {isFlagEnabled} from 'src/shared/utils/featureFlag'

Expand Down Expand Up @@ -67,7 +67,7 @@ export class NodejsWizard extends PureComponent<null, State> {
}

subwayNavSteps = isFlagEnabled('ioxOnboarding')
? HOMEPAGE_NAVIGATION_STEPS_WRITE_ONLY
? HOMEPAGE_NAVIGATION_STEPS_SQL
: HOMEPAGE_NAVIGATION_STEPS

handleNextClick = () => {
Expand Down Expand Up @@ -131,7 +131,53 @@ export class NodejsWizard extends PureComponent<null, State> {
scrollNextPageIntoView()
}

renderStep = () => {
renderSqlStep = () => {
switch (this.state.currentStep) {
case 1: {
return <Overview wizard="nodejsWizard" />
}
case 2: {
return <InstallDependencies />
}
case 3: {
return (
<Tokens
wizardEventName="nodejsWizard"
setTokenValue={this.setTokenValue}
tokenValue={this.state.tokenValue}
/>
)
}
case 4: {
return <InitializeClient />
}
case 5: {
return <WriteData onSelectBucket={this.handleSelectBucket} />
}
case 6: {
return <ExecuteQuery bucket={this.state.selectedBucket} />
}
case 7: {
return <ExecuteAggregateQuery bucket={this.state.selectedBucket} />
}
case 8: {
return (
<Finish
wizardEventName="nodejsWizard"
markStepAsCompleted={this.handleMarkStepAsCompleted}
finishStepCompleted={this.state.finishStepCompleted}
finalFeedback={this.state.finalFeedback}
setFinalFeedback={this.setFinalFeedback}
/>
)
}
default: {
return <Overview wizard="nodejsWizard" />
}
}
}

renderFluxStep = () => {
switch (this.state.currentStep) {
case 1: {
return <Overview wizard="nodejsWizard" />
Expand Down Expand Up @@ -219,7 +265,9 @@ export class NodejsWizard extends PureComponent<null, State> {
)}
>
<WriteDataDetailsContextProvider>
{this.renderStep()}
{isFlagEnabled('ioxOnboarding')
? this.renderSqlStep()
: this.renderFluxStep()}
</WriteDataDetailsContextProvider>
</div>

Expand Down

0 comments on commit 2ce0678

Please sign in to comment.