Skip to content

Commit

Permalink
Merge pull request #12684 from influxdata/fix/org-bucket-mismatch
Browse files Browse the repository at this point in the history
Fix mismatch in bucket row and header
  • Loading branch information
ischolten committed Mar 18, 2019
2 parents c0980e8 + 2bf7c0a commit dfb06f1
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 618 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
1. [12663](https://github.com/influxdata/influxdb/pull/12663): Insert flux function near cursor in flux editor

### Bug Fixes
1. [12684](https://github.com/influxdata/influxdb/pull/12684): Fix mismatch in bucket row and header

### UI Improvements

Expand Down
13 changes: 11 additions & 2 deletions ui/src/organizations/components/BucketRow.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Libraries
import React, {PureComponent} from 'react'
import {withRouter, WithRouterProps} from 'react-router'

// Components
import {IndexList, ConfirmationButton, Context} from 'src/clockface'
Expand Down Expand Up @@ -33,7 +34,7 @@ interface Props {
onFilterChange: (searchTerm: string) => void
}

export default class BucketRow extends PureComponent<Props> {
class BucketRow extends PureComponent<Props & WithRouterProps> {
public render() {
const {bucket, onDeleteBucket} = this.props
return (
Expand All @@ -47,7 +48,7 @@ export default class BucketRow extends PureComponent<Props> {
noNameString={DEFAULT_BUCKET_NAME}
/>
</IndexList.Cell>
<IndexList.Cell>{bucket.organization}</IndexList.Cell>
{this.organization}
<IndexList.Cell>{bucket.ruleString}</IndexList.Cell>
<IndexList.Cell revealOnHover={true} alignment={Alignment.Right}>
<ConfirmationButton
Expand Down Expand Up @@ -91,6 +92,12 @@ export default class BucketRow extends PureComponent<Props> {
)
}

private get organization(): JSX.Element {
if (!this.props.params.orgID) {
return <IndexList.Cell>{this.props.bucket.organization}</IndexList.Cell>
}
}

private handleUpdateBucketName = async (value: string) => {
await this.props.onUpdateBucket({...this.props.bucket, name: value})
}
Expand All @@ -111,3 +118,5 @@ export default class BucketRow extends PureComponent<Props> {
this.props.onAddData(this.props.bucket, DataLoaderType.Scraping)
}
}

export default withRouter<Props>(BucketRow)
Loading

0 comments on commit dfb06f1

Please sign in to comment.