diff --git a/CHANGELOG.md b/CHANGELOG.md index 31cb1690edd..9712d9b0cd3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/ui/src/organizations/components/Retention.tsx b/ui/src/organizations/components/Retention.tsx index 65b4c660de8..5c41d917041 100644 --- a/ui/src/organizations/components/Retention.tsx +++ b/ui/src/organizations/components/Retention.tsx @@ -23,6 +23,8 @@ interface Props { onChangeRuleType: (type: BucketRetentionRules.TypeEnum) => void } +export const DEFAULT_SECONDS = 0 + export default class Retention extends PureComponent { public render() { const {retentionSeconds, type} = this.props @@ -56,6 +58,7 @@ export default class Retention extends PureComponent { } private handleRadioClick = (type: BucketRetentionRules.TypeEnum) => { + this.props.onChangeRetentionRule(DEFAULT_SECONDS) this.props.onChangeRuleType(type) } diff --git a/ui/src/organizations/components/UpdateBucketOverlay.tsx b/ui/src/organizations/components/UpdateBucketOverlay.tsx index 4b8d1295e47..c3685f775f6 100644 --- a/ui/src/organizations/components/UpdateBucketOverlay.tsx +++ b/ui/src/organizations/components/UpdateBucketOverlay.tsx @@ -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' @@ -75,7 +78,7 @@ export default class BucketOverlay extends PureComponent { ) if (!rule) { - return 3600 + return DEFAULT_SECONDS } return rule.everySeconds @@ -104,7 +107,7 @@ export default class BucketOverlay extends PureComponent { this.setState({bucket}) } - private handleChangeRuleType = ruleType => { + private handleChangeRuleType = (ruleType: BucketRetentionRules.TypeEnum) => { this.setState({ruleType}) }