Skip to content

Commit b517e30

Browse files
authored
fix: add bucket prop back to execute query page (#5175)
* fix: add bucket prop back to execute query page
1 parent 63d52ad commit b517e30

File tree

1 file changed

+18
-5
lines changed

1 file changed

+18
-5
lines changed

src/homepageExperience/components/steps/cli/ExecuteQuery.tsx

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,28 @@
1+
// Libraries
12
import React from 'react'
23

4+
// Components
35
import CodeSnippet from 'src/shared/components/CodeSnippet'
6+
7+
// Constants
8+
import {DEFAULT_BUCKET} from 'src/writeData/components/WriteDataDetailsContext'
9+
10+
// Utils
411
import {event} from 'src/cloud/utils/reporting'
512
import {SafeBlankLink} from 'src/utils/SafeBlankLink'
613

714
const logCopyCodeSnippet = () => {
815
event('firstMile.cliWizard.executeQuery.code.copied')
916
}
1017

11-
export const ExecuteQuery = () => {
12-
const query = `influx query 'from(bucket:"sample-bucket") |> range(start:-10m)' --raw`
18+
type OwnProps = {
19+
bucket: string
20+
}
21+
22+
export const ExecuteQuery = (props: OwnProps) => {
23+
const {bucket} = props
24+
const bucketName = bucket === DEFAULT_BUCKET ? 'sample-bucket' : bucket
25+
const query = `influx query 'from(bucket:"${bucketName}") |> range(start:-10m)' --raw`
1326

1427
const fluxExample = `from(bucket: “weather-data”)
1528
|> range(start: -10m)
@@ -35,9 +48,9 @@ export const ExecuteQuery = () => {
3548
language="properties"
3649
></CodeSnippet>
3750
<p style={{marginTop: '60px'}}>
38-
Let's write a Flux query in the InfluxCLI to read back all of the data
39-
you wrote in the previous step. Copy the code snippet below into the
40-
InfluxCLI.
51+
Let's write a Flux query in the InfluxDB CLI to read back all of the
52+
data you wrote in the previous step. Copy the code snippet below into
53+
the InfluxDB CLI.
4154
</p>
4255
<CodeSnippet
4356
text={query}

0 commit comments

Comments
 (0)