Skip to content

Commit

Permalink
feat(ui): new load data page (#19351)
Browse files Browse the repository at this point in the history
* Revert "Revert "feat(ui): redesign load data page (#19246)" (#19336)"

This reverts commit 0111f02.

* fix: guard against no tokens or buckets

* fix: typo

* refactor: name sources page titles properly

* fix: avoid referencing image asset inline
  • Loading branch information
alexpaxton authored Aug 18, 2020
1 parent 3a8f3e4 commit ebf41ec
Show file tree
Hide file tree
Showing 460 changed files with 61,723 additions and 2,928 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

### Features

1. [19246](https://github.com/influxdata/influxdb/pull/19246): Redesign load data page to increase discovery and ease of use
1. [19334](https://github.com/influxdata/influxdb/pull/19334): Add --active-config flag to influx to set config for single command

### Bug Fixes
Expand Down
68 changes: 0 additions & 68 deletions ui/cypress/e2e/clientLibraries.test.ts

This file was deleted.

7 changes: 6 additions & 1 deletion ui/cypress/e2e/explorer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,12 @@ describe('DataExplorer', () => {
cy.get('.view-lines').type(fluxCode)
})
cy.contains('Submit').click()
cy.getByTestID('nav-item-load-data').click()
cy.get('.cf-tree-nav--toggle').click()
// Can't use the testID to select this nav item because Clockface is silly and uses the same testID twice
// Issue: https://github.com/influxdata/clockface/issues/539
cy.get('.cf-tree-nav--sub-item-label')
.contains('Buckets')
.click()
cy.getByTestID('bucket--card--name _tasks').click()
cy.getByTestID('query-builder').should('exist')
})
Expand Down
50 changes: 50 additions & 0 deletions ui/cypress/e2e/loadDataSources.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
describe('Load Data Sources', () => {
beforeEach(() => {
cy.flush()

cy.signin().then(({body}) => {
const {
org: {id},
} = body
cy.wrap(body.org).as('org')

cy.fixture('routes').then(({orgs}) => {
cy.visit(`${orgs}/${id}/load-data/sources`)
})
})
})

it('navigate to Client Library details view and render it with essentials', () => {
cy.getByTestID('write-data--section client-libraries').within(() => {
cy.getByTestID('square-grid').within(() => {
cy.getByTestIDSubStr('load-data-item')
.first()
.click()
})
})

const contentContainer = cy.getByTestID('load-data-details-content')
contentContainer.should('exist')
contentContainer.children().should('exist')

const logoElement = cy.getByTestID('load-data-details-thumb')
logoElement.should('exist')
})

it('navigate to Telegraf Plugin details view and render it with essentials', () => {
cy.getByTestID('write-data--section telegraf-plugins').within(() => {
cy.getByTestID('square-grid').within(() => {
cy.getByTestIDSubStr('load-data-item')
.first()
.click()
})
})

const contentContainer = cy.getByTestID('load-data-details-content')
contentContainer.should('exist')
contentContainer.children().should('exist')

const logoElement = cy.getByTestID('load-data-details-thumb')
logoElement.should('exist')
})
})
18 changes: 14 additions & 4 deletions ui/global.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,21 @@ declare global {
interface Window {
monaco: MonacoType
}
}
declare module '*.png' {
const value: any
export = value
}

declare module "*.png" {
const value: any;
export = value;
declare module '*.md' {
const value: string
export default value
}

declare module '*.svg' {
export const ReactComponent: SFC<SVGProps<SVGSVGElement>>
const src: string
export default src
}
}

window.monaco = window.monaco || {}
11 changes: 8 additions & 3 deletions ui/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1425,7 +1425,12 @@ declare module 'src/external/dygraph' {

// Allow typescript to recognize json files

declare module "*.json" {
const value: any;
export default value;
declare module '*.json' {
const value: any
export default value
}

declare module '*.md' {
const value: string
export default value
}
2 changes: 1 addition & 1 deletion ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
"mutation-observer": "^1.0.3",
"optimize-css-assets-webpack-plugin": "^5.0.3",
"prettier": "^1.19.1",
"raw-loader": "^4.0.0",
"raw-loader": "^4.0.1",
"sass": "^1.22.7",
"sass-loader": "^7.1.0",
"source-map-loader": "^0.2.4",
Expand Down
2 changes: 1 addition & 1 deletion ui/src/authorizations/components/ViewTokenOverlay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export default class ViewTokenOverlay extends PureComponent<Props> {
}

return (
<Overlay.Container>
<Overlay.Container maxWidth={830}>
<Overlay.Header
title={description}
onDismiss={this.handleDismiss}
Expand Down
19 changes: 4 additions & 15 deletions ui/src/authorizations/containers/TokensIndex.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Libraries
import React, {Component} from 'react'
import {connect, ConnectedProps} from 'react-redux'
import {Switch, Route} from 'react-router-dom'

// Components
Expand All @@ -17,28 +16,22 @@ import {

// Utils
import {pageTitleSuffixer} from 'src/shared/utils/pageTitles'
import {getOrg} from 'src/organizations/selectors'

// Types
import {AppState, ResourceType} from 'src/types'
import {ResourceType} from 'src/types'

import {ORGS, ORG_ID, TOKENS} from 'src/shared/constants/routes'

const tokensPath = `/${ORGS}/${ORG_ID}/load-data/${TOKENS}/generate`

type ReduxProps = ConnectedProps<typeof connector>
type Props = ReduxProps

@ErrorHandling
class TokensIndex extends Component<Props> {
class TokensIndex extends Component {
public render() {
const {org} = this.props

return (
<>
<Page titleTag={pageTitleSuffixer(['Tokens', 'Load Data'])}>
<LoadDataHeader />
<LoadDataTabbedPage activeTab="tokens" orgID={org.id}>
<LoadDataTabbedPage activeTab="tokens">
<GetResources resources={[ResourceType.Authorizations]}>
<TokensTab />
</GetResources>
Expand All @@ -59,8 +52,4 @@ class TokensIndex extends Component<Props> {
}
}

const mstp = (state: AppState) => ({org: getOrg(state)})

const connector = connect(mstp)

export default connector(TokensIndex)
export default TokensIndex
22 changes: 4 additions & 18 deletions ui/src/buckets/containers/BucketsIndex.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Libraries
import React, {Component} from 'react'
import {connect} from 'react-redux'
import {Switch, Route} from 'react-router-dom'

// Components
Expand All @@ -21,31 +20,24 @@ import {Page} from '@influxdata/clockface'

// Utils
import {pageTitleSuffixer} from 'src/shared/utils/pageTitles'
import {getOrg} from 'src/organizations/selectors'

// Constants
import {ORGS, ORG_ID, BUCKETS, BUCKET_ID} from 'src/shared/constants/routes'

// Types
import {AppState, Organization, ResourceType} from 'src/types'

interface StateProps {
org: Organization
}
import {ResourceType} from 'src/types'

const bucketsPath = `/${ORGS}/${ORG_ID}/load-data/${BUCKETS}/${BUCKET_ID}`

@ErrorHandling
class BucketsIndex extends Component<StateProps> {
class BucketsIndex extends Component {
public render() {
const {org} = this.props

return (
<>
<Page titleTag={pageTitleSuffixer(['Buckets', 'Load Data'])}>
<LimitChecker>
<LoadDataHeader />
<LoadDataTabbedPage activeTab="buckets" orgID={org.id}>
<LoadDataTabbedPage activeTab="buckets">
<GetResources
resources={[
ResourceType.Buckets,
Expand Down Expand Up @@ -88,10 +80,4 @@ class BucketsIndex extends Component<StateProps> {
}
}

const mstp = (state: AppState) => {
const org = getOrg(state)

return {org}
}

export default connect<StateProps, {}, {}>(mstp, null)(BucketsIndex)
export default BucketsIndex
Loading

0 comments on commit ebf41ec

Please sign in to comment.