Skip to content

Commit 2e01607

Browse files
authored
feat: add deeplink, routing by feature flag, and csv loader (#5186)
* feat: add feature flag and routing to cli * test: add deeplink cli test
1 parent 226034f commit 2e01607

File tree

6 files changed

+31
-3
lines changed

6 files changed

+31
-3
lines changed

cypress/e2e/shared/deepLinks.test.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ describe('Deep linking', () => {
7070
cy.visit('/me/secrets')
7171
cy.location('pathname').should('eq', `/orgs/${org.id}/settings/secrets`)
7272

73+
cy.visit('/me/setup-cli')
74+
cy.location('pathname').should('eq', `/orgs/${org.id}/new-user-setup/cli`)
75+
7376
cy.visit('/me/setup-golang')
7477
cy.location('pathname').should(
7578
'eq',

src/homepageExperience/containers/HomepageContainer.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@ export const HomepageContainer: FC = () => {
4949
const org = useSelector(getOrg)
5050
const telegrafs = useSelector(getAllTelegrafs)
5151
const pythonWizardLink = `/orgs/${org.id}/new-user-setup/python`
52-
const cliPageLink = `/orgs/${org.id}/load-data/file-upload/csv`
52+
const cliPageLink = isFlagEnabled('onboardCLI')
53+
? `/orgs/${org.id}/new-user-setup/cli`
54+
: `/orgs/${org.id}/load-data/file-upload/csv`
5355
const telegrafPageLink = `/orgs/${org.id}/load-data/telegrafs`
5456
const newTelegrafPageLink = `/orgs/${org.id}/load-data/telegrafs/new`
5557
const golangLink = `/orgs/${org.id}/new-user-setup/golang`

src/shared/containers/SetOrg.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import {
1313
BucketsIndex,
1414
CheckHistory,
1515
ClientLibrariesPage,
16+
CliWizard,
1617
DashboardContainer,
1718
DashboardsIndex,
1819
DashboardsIndexPaginated,
@@ -322,6 +323,13 @@ const SetOrg: FC = () => {
322323
component={GoWizard}
323324
/>,
324325
]}
326+
{isFlagEnabled('onboardCLI') && (
327+
<Route
328+
exact
329+
path="/orgs/:orgID/new-user-setup/cli"
330+
component={CliWizard}
331+
/>
332+
)}
325333

326334
<Route component={NotFound} />
327335
</Switch>

src/shared/containers/index.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,12 @@ export const GoWizard = lazy(() =>
127127
}))
128128
)
129129

130+
export const CliWizard = lazy(() =>
131+
import('src/homepageExperience/containers/CliWizard').then(module => ({
132+
default: module.CliWizard,
133+
}))
134+
)
135+
130136
export const DetailsSubscriptionPage = lazy(() =>
131137
import('src/writeData/subscriptions/components/DetailsSubscriptionPage')
132138
)

src/utils/deepLinks.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,10 @@ export const buildDeepLinkingMap = (org: Organization) => ({
2121
'/me/notebooks': `/orgs/${org.id}/${PROJECT_NAME_PLURAL.toLowerCase()}`,
2222
'/me/pythonclient': `/orgs/${org.id}/load-data/client-libraries/python`,
2323
'/me/secrets': `/orgs/${org.id}/settings/secrets`,
24-
'/me/setup-python': `/orgs/${org.id}/new-user-setup/python`,
25-
'/me/setup-nodejs': `/orgs/${org.id}/new-user-setup/nodejs`,
24+
'/me/setup-cli': `/orgs/${org.id}/new-user-setup/cli`,
2625
'/me/setup-golang': `/orgs/${org.id}/new-user-setup/golang`,
26+
'/me/setup-nodejs': `/orgs/${org.id}/new-user-setup/nodejs`,
27+
'/me/setup-python': `/orgs/${org.id}/new-user-setup/python`,
2728
'/me/tasks': `/orgs/${org.id}/tasks`,
2829
'/me/telegraf-mqtt': `/orgs/${org.id}/load-data/telegraf-plugins/mqtt_consumer`,
2930
'/me/telegrafs': `/orgs/${org.id}/load-data/telegrafs`,

webpack.common.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,14 @@ module.exports = {
129129
},
130130
],
131131
},
132+
{
133+
test: /\.csv$/,
134+
use: [
135+
{
136+
loader: 'raw-loader',
137+
},
138+
],
139+
},
132140
],
133141
},
134142
plugins: [

0 commit comments

Comments
 (0)