Skip to content

Commit 1af5e2b

Browse files
authored
feat: add prepare ide step to arduino onboarding (#5356)
* feat: add prepare ide step to arduino onboarding
1 parent 4cc526c commit 1af5e2b

File tree

3 files changed

+106
-14
lines changed

3 files changed

+106
-14
lines changed
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
// Libraries
2+
import React from 'react'
3+
4+
const listStyle = {
5+
fontSize: '16px',
6+
fontWeight: 'normal',
7+
}
8+
9+
export const PrepareIde = () => {
10+
return (
11+
<>
12+
<h1>Prepare Arduino IDE</h1>
13+
<p>
14+
The easiest way to get started with the InfluxDB Arduino client is with
15+
the ESP8266 or ESP32 board.
16+
</p>
17+
<p>
18+
If you haven't already, add the board you wish to use (ESP8266 or ESP32)
19+
to the Arduino IDE by following these steps:
20+
</p>
21+
<p>
22+
<b>For ESP8266:</b>
23+
</p>
24+
<ol style={listStyle}>
25+
<li>Open the Arduino Preferences (Arduino &rarr; Preferences) </li>
26+
<li>
27+
Look for "Additional Boards Manager URLs" input box and paste
28+
"http://arduino.esp8266.com/stable/package_esp8266com_index.json" in
29+
it.
30+
</li>
31+
<li>Click OK.</li>
32+
<li>Then under Tools &rarr; Boards: , click on Boards Manager.</li>
33+
<li>Search for ESP8266 in the boards.</li>
34+
<li>Install the ESP8266 board by ESP8266 Community.</li>
35+
</ol>
36+
<p>
37+
<b>For ESP32:</b>
38+
</p>
39+
<ol style={listStyle}>
40+
<li>Open the Arduino Preferences (Arduino &rarr; Preferences) </li>
41+
<li>
42+
Look for "Additional Boards Manager URLs" input box and paste
43+
"https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json"
44+
in it.
45+
</li>
46+
<li>Click OK.</li>
47+
<li>Then under Tools &rarr; Boards: , click on Boards Manager.</li>
48+
<li>Search for ESP32 in the boards.</li>
49+
<li>Install the ESP32 board by ESP32 Community.</li>
50+
</ol>
51+
</>
52+
)
53+
}

src/homepageExperience/containers/ArduinoWizard.tsx

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,13 @@ import {Finish} from 'src/homepageExperience/components/steps/Finish'
2020
import {InitializeClient} from 'src/homepageExperience/components/steps/arduino/InitializeClient'
2121
import {InstallDependencies} from 'src/homepageExperience/components/steps/arduino/InstallDependencies'
2222
import {Overview} from 'src/homepageExperience/components/steps/Overview'
23+
import {PrepareIde} from 'src/homepageExperience/components/steps/arduino/PrepareIde'
2324
import {WriteData} from 'src/homepageExperience/components/steps/arduino/WriteData'
2425
import WriteDataDetailsContextProvider from 'src/writeData/components/WriteDataDetailsContext'
2526

2627
// Utils
2728
import {event} from 'src/cloud/utils/reporting'
28-
import {HOMEPAGE_NAVIGATION_STEPS_SHORT} from 'src/homepageExperience/utils'
29+
import {HOMEPAGE_NAVIGATION_STEPS_ARDUINO} from 'src/homepageExperience/utils'
2930
import {normalizeEventName} from 'src/cloud/utils/reporting'
3031
import RateLimitAlert from 'src/cloud/components/RateLimitAlert'
3132

@@ -67,7 +68,7 @@ export class ArduinoWizard extends PureComponent<{}, State> {
6768
{
6869
currentStep: Math.min(
6970
this.state.currentStep + 1,
70-
HOMEPAGE_NAVIGATION_STEPS_SHORT.length
71+
HOMEPAGE_NAVIGATION_STEPS_ARDUINO.length
7172
),
7273
},
7374
() => {
@@ -76,10 +77,10 @@ export class ArduinoWizard extends PureComponent<{}, State> {
7677
{},
7778
{
7879
clickedButtonAtStep: normalizeEventName(
79-
HOMEPAGE_NAVIGATION_STEPS_SHORT[this.state.currentStep - 1].name
80+
HOMEPAGE_NAVIGATION_STEPS_ARDUINO[this.state.currentStep - 1].name
8081
),
8182
currentStep: normalizeEventName(
82-
HOMEPAGE_NAVIGATION_STEPS_SHORT[this.state.currentStep].name
83+
HOMEPAGE_NAVIGATION_STEPS_ARDUINO[this.state.currentStep].name
8384
),
8485
}
8586
)
@@ -96,10 +97,10 @@ export class ArduinoWizard extends PureComponent<{}, State> {
9697
{},
9798
{
9899
clickedButtonAtStep: normalizeEventName(
99-
HOMEPAGE_NAVIGATION_STEPS_SHORT[this.state.currentStep - 1].name
100+
HOMEPAGE_NAVIGATION_STEPS_ARDUINO[this.state.currentStep - 1].name
100101
),
101102
currentStep: normalizeEventName(
102-
HOMEPAGE_NAVIGATION_STEPS_SHORT[this.state.currentStep].name
103+
HOMEPAGE_NAVIGATION_STEPS_ARDUINO[this.state.currentStep].name
103104
),
104105
}
105106
)
@@ -114,7 +115,7 @@ export class ArduinoWizard extends PureComponent<{}, State> {
114115
{},
115116
{
116117
currentStep: normalizeEventName(
117-
HOMEPAGE_NAVIGATION_STEPS_SHORT[clickedStep - 1].name
118+
HOMEPAGE_NAVIGATION_STEPS_ARDUINO[clickedStep - 1].name
118119
),
119120
}
120121
)
@@ -126,9 +127,12 @@ export class ArduinoWizard extends PureComponent<{}, State> {
126127
return <Overview wizard="arduinoWizard" />
127128
}
128129
case 2: {
129-
return <InstallDependencies />
130+
return <PrepareIde />
130131
}
131132
case 3: {
133+
return <InstallDependencies />
134+
}
135+
case 4: {
132136
return (
133137
<InitializeClient
134138
setTokenValue={this.setTokenValue}
@@ -137,16 +141,16 @@ export class ArduinoWizard extends PureComponent<{}, State> {
137141
/>
138142
)
139143
}
140-
case 4: {
144+
case 5: {
141145
return <WriteData bucket={this.state.selectedBucket} />
142146
}
143-
case 5: {
147+
case 6: {
144148
return <ExecuteQuery bucket={this.state.selectedBucket} />
145149
}
146-
case 6: {
150+
case 7: {
147151
return <ExecuteAggregateQuery bucket={this.state.selectedBucket} />
148152
}
149-
case 7: {
153+
case 8: {
150154
return (
151155
<Finish
152156
wizardEventName="arduinoWizard"
@@ -178,7 +182,7 @@ export class ArduinoWizard extends PureComponent<{}, State> {
178182
<SubwayNav
179183
currentStep={this.state.currentStep}
180184
onStepClick={this.handleNavClick}
181-
navigationSteps={HOMEPAGE_NAVIGATION_STEPS_SHORT}
185+
navigationSteps={HOMEPAGE_NAVIGATION_STEPS_ARDUINO}
182186
settingUpIcon={ArduinoIcon}
183187
settingUpText="Arduino"
184188
setupTime="5 minutes"
@@ -193,7 +197,7 @@ export class ArduinoWizard extends PureComponent<{}, State> {
193197
verticallyCentered:
194198
this.state.currentStep === 1 ||
195199
this.state.currentStep ===
196-
HOMEPAGE_NAVIGATION_STEPS_SHORT.length,
200+
HOMEPAGE_NAVIGATION_STEPS_ARDUINO.length,
197201
}
198202
)}
199203
>

src/homepageExperience/utils.ts

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,38 @@ export const HOMEPAGE_NAVIGATION_STEPS_SHORT = [
6565
glyph: IconFont.StarSmile,
6666
},
6767
]
68+
69+
export const HOMEPAGE_NAVIGATION_STEPS_ARDUINO = [
70+
{
71+
name: 'Overview',
72+
glyph: IconFont.BookOutline,
73+
},
74+
{
75+
name: 'Prepare\n Arduino IDE',
76+
glyph: IconFont.Braces,
77+
},
78+
{
79+
name: 'Install\n Dependencies',
80+
glyph: IconFont.Install,
81+
},
82+
{
83+
name: 'Initialize\n Client',
84+
glyph: IconFont.CogSolid_New,
85+
},
86+
{
87+
name: 'Write\n Data',
88+
glyph: IconFont.Pencil,
89+
},
90+
{
91+
name: 'Execute\n Flux Query',
92+
glyph: IconFont.Play,
93+
},
94+
{
95+
name: 'Execute\n Aggregate',
96+
glyph: IconFont.Play,
97+
},
98+
{
99+
name: 'Finished!',
100+
glyph: IconFont.StarSmile,
101+
},
102+
]

0 commit comments

Comments
 (0)