Skip to content

Commit

Permalink
Update retention policy for bucket if time changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Palakp41 committed Feb 20, 2019
1 parent ec1019b commit 46cd249
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 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. [11954](https://github.com/influxdata/influxdb/pull/11954): Add the ability to run a task manually from tasks page

### 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
}

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
8 changes: 5 additions & 3 deletions ui/src/organizations/components/UpdateBucketOverlay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export default class BucketOverlay extends PureComponent<Props, State> {
)

if (!rule) {
return 3600
return 0
}

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

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

private handleSubmit = (e): void => {
Expand Down

0 comments on commit 46cd249

Please sign in to comment.