Skip to content

Commit

Permalink
fix(tasks): clear existing task schedule when changing types
Browse files Browse the repository at this point in the history
  • Loading branch information
AlirieGray committed Mar 20, 2019
1 parent 160fa26 commit e03c97b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
1. [12684](https://github.com/influxdata/influxdb/pull/12684): Fix mismatch in bucket row and header
1. [12703](https://github.com/influxdata/influxdb/pull/12703): Allows user to edit note on cell
1. [12764](https://github.com/influxdata/influxdb/pull/12764): Fix empty state styles in scrapers in org view
1. [12793](https://github.com/influxdata/influxdb/pull/12793): Fix task creation error when switching schedule types.

### UI Improvements

Expand Down
14 changes: 14 additions & 0 deletions ui/src/tasks/reducers/v2/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,20 @@ export default (state: State = defaultState, action: Action): State => {
case 'SET_TASK_OPTION':
const {key, value} = action.payload

if (key === 'taskScheduleType') {
if (value === TaskSchedule.cron) {
return {
...state,
taskOptions: {...state.taskOptions, interval: '', [key]: value},
}
} else if (value === TaskSchedule.interval) {
return {
...state,
taskOptions: {...state.taskOptions, cron: '', [key]: value},
}
}
}

return {
...state,
taskOptions: {...state.taskOptions, [key]: value},
Expand Down

0 comments on commit e03c97b

Please sign in to comment.