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

Update retention policy for bucket if time changes #11997

Merged
merged 1 commit into from
Feb 20, 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 @@ -5,6 +5,7 @@
1. [11990](https://github.com/influxdata/influxdb/pull/11990): Add the ability to select a custom time range in explorer and dashboard

### Bug Fixes
1. [11997](https://github.com/influxdata/influxdb/pull/11997): Update the bucket retention policy to update the time in seconds

### UI Improvements

Expand Down
3 changes: 3 additions & 0 deletions ui/src/organizations/components/Retention.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ interface Props {
onChangeRuleType: (type: BucketRetentionRules.TypeEnum) => void
}

export const DEFAULT_SECONDS = 0

export default class Retention extends PureComponent<Props> {
public render() {
const {retentionSeconds, type} = this.props
Expand Down Expand Up @@ -56,6 +58,7 @@ export default class Retention extends PureComponent<Props> {
}

private handleRadioClick = (type: BucketRetentionRules.TypeEnum) => {
this.props.onChangeRetentionRule(DEFAULT_SECONDS)
this.props.onChangeRuleType(type)
}

Expand Down
7 changes: 5 additions & 2 deletions ui/src/organizations/components/UpdateBucketOverlay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ import {
} from 'src/clockface'
import BucketOverlayForm from 'src/organizations/components/BucketOverlayForm'

// Constants
import {DEFAULT_SECONDS} from 'src/organizations/components/Retention'

// Types
import {Bucket, BucketRetentionRules} from '@influxdata/influx'

Expand Down Expand Up @@ -75,7 +78,7 @@ export default class BucketOverlay extends PureComponent<Props, State> {
)

if (!rule) {
return 3600
return DEFAULT_SECONDS
}

return rule.everySeconds
Expand Down Expand Up @@ -104,7 +107,7 @@ export default class BucketOverlay extends PureComponent<Props, State> {
this.setState({bucket})
}

private handleChangeRuleType = ruleType => {
private handleChangeRuleType = (ruleType: BucketRetentionRules.TypeEnum) => {
this.setState({ruleType})
}

Expand Down