Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix mismatch in bucket row and header #12684

Merged
merged 1 commit into from
Mar 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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