Skip to content

Commit

Permalink
Fix mismatch in bucket row and header
Browse files Browse the repository at this point in the history
  • Loading branch information
ischolten committed Mar 18, 2019
1 parent 8d70a01 commit 26897bd
Showing 1 changed file with 11 additions and 2 deletions.
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)

0 comments on commit 26897bd

Please sign in to comment.