Fix prettier issues

pull/15058/head
Palak Bhojani 2019-09-09 10:39:24 -07:00
parent 0c3ec69f37
commit 4ea2650ff1
2 changed files with 42 additions and 43 deletions

View File

@ -1,6 +1,6 @@
// Libraries
import React, { PureComponent } from 'react'
import { withRouter, WithRouterProps } from 'react-router'
import React, {PureComponent} from 'react'
import {withRouter, WithRouterProps} from 'react-router'
import _ from 'lodash'
// Components
@ -13,11 +13,11 @@ import {
} from '@influxdata/clockface'
import BucketContextMenu from 'src/buckets/components/BucketContextMenu'
import BucketAddDataButton from 'src/buckets/components/BucketAddDataButton'
import { FeatureFlag } from 'src/shared/utils/featureFlag'
import {FeatureFlag} from 'src/shared/utils/featureFlag'
// Types
import { Bucket } from 'src/types'
import { DataLoaderType } from 'src/types/dataLoaders'
import {Bucket} from 'src/types'
import {DataLoaderType} from 'src/types/dataLoaders'
export interface PrettyBucket extends Bucket {
ruleString: string
@ -35,7 +35,7 @@ interface Props {
class BucketRow extends PureComponent<Props & WithRouterProps> {
public render() {
const { bucket, onDeleteBucket } = this.props
const {bucket, onDeleteBucket} = this.props
return (
<ResourceCard
testID="bucket--card"
@ -54,7 +54,7 @@ class BucketRow extends PureComponent<Props & WithRouterProps> {
<FlexBox
direction={FlexDirection.Row}
margin={ComponentSize.Small}
style={{ marginTop: '4px' }}
style={{marginTop: '4px'}}
>
<BucketAddDataButton
onAddCollector={this.handleAddCollector}
@ -76,9 +76,9 @@ class BucketRow extends PureComponent<Props & WithRouterProps> {
}
private get renameButton() {
const { bucket } = this.props
const {bucket} = this.props
if (bucket.type === 'user') {
console.log("here")
console.log('here')
return (
<Button
text="Rename"
@ -91,15 +91,15 @@ class BucketRow extends PureComponent<Props & WithRouterProps> {
}
private handleDeleteData = () => {
const { onDeleteData, bucket } = this.props
const {onDeleteData, bucket} = this.props
onDeleteData(bucket)
}
private handleRenameBucket = () => {
const {
params: { orgID },
bucket: { id },
params: {orgID},
bucket: {id},
router,
} = this.props
@ -108,8 +108,8 @@ class BucketRow extends PureComponent<Props & WithRouterProps> {
private handleNameClick = (): void => {
const {
params: { orgID },
bucket: { id },
params: {orgID},
bucket: {id},
router,
} = this.props
@ -118,8 +118,8 @@ class BucketRow extends PureComponent<Props & WithRouterProps> {
private handleAddCollector = (): void => {
const {
params: { orgID },
bucket: { id },
params: {orgID},
bucket: {id},
} = this.props
const link = `/orgs/${orgID}/load-data/buckets/${id}/telegrafs/new`
@ -128,8 +128,8 @@ class BucketRow extends PureComponent<Props & WithRouterProps> {
private handleAddLineProtocol = (): void => {
const {
params: { orgID },
bucket: { id },
params: {orgID},
bucket: {id},
} = this.props
const link = `/orgs/${orgID}/load-data/buckets/${id}/line-protocols/new`
@ -138,8 +138,8 @@ class BucketRow extends PureComponent<Props & WithRouterProps> {
private handleAddScraper = (): void => {
const {
params: { orgID },
bucket: { id },
params: {orgID},
bucket: {id},
} = this.props
const link = `/orgs/${orgID}/load-data/buckets/${id}/scrapers/new`

View File

@ -1,8 +1,8 @@
// Libraries
import React, { PureComponent } from 'react'
import React, {PureComponent} from 'react'
// Components
import { Context, Alignment, ComponentSize } from 'src/clockface'
import {Context, Alignment, ComponentSize} from 'src/clockface'
import {
ButtonShape,
@ -14,7 +14,7 @@ import {
} from '@influxdata/clockface'
// Types
import { PrettyBucket } from 'src/buckets/components/BucketCard'
import {PrettyBucket} from 'src/buckets/components/BucketCard'
interface Props {
bucket: PrettyBucket
@ -23,8 +23,6 @@ interface Props {
export default class BucketContextMenu extends PureComponent<Props> {
public render() {
const { bucket, onDeleteBucket } = this.props
return (
<>
<Context align={Alignment.Center}>
@ -41,23 +39,24 @@ export default class BucketContextMenu extends PureComponent<Props> {
}
private get deleteButton() {
const { bucket, onDeleteBucket } = this.props
if (bucket.type === "user") {
return (<Context.Menu
icon={IconFont.Trash}
color={ComponentColor.Danger}
shape={ButtonShape.Default}
text="Delete Bucket"
testID="context-delete-menu"
>
<Context.Item
label="Confirm"
action={onDeleteBucket}
value={bucket}
testID="context-delete-task"
/>
</Context.Menu>)
}
else return (<></>)
const {bucket, onDeleteBucket} = this.props
if (bucket.type === 'user') {
return (
<Context.Menu
icon={IconFont.Trash}
color={ComponentColor.Danger}
shape={ButtonShape.Default}
text="Delete Bucket"
testID="context-delete-menu"
>
<Context.Item
label="Confirm"
action={onDeleteBucket}
value={bucket}
testID="context-delete-task"
/>
</Context.Menu>
)
} else return <></>
}
}