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

fix(tasks): clear existing task schedule when changing types #12793

Merged
merged 1 commit into from
Mar 20, 2019

Conversation

AlirieGray
Copy link
Contributor

@AlirieGray AlirieGray commented Mar 20, 2019

Closes #12690

This PR fixes an issue where switching between the "cron" and "interval" schedule types would cause an error when creating or editing a task. Now the reducer for setting a task option will clear the previous task schedule type when a new one is added.

The v2 folders for task actions and reducers are also removed in this PR.

  • CHANGELOG.md updated with a link to the PR (not the Issue)
  • Rebased/mergeable
  • Tests pass

@AlirieGray AlirieGray force-pushed the fix/switching-cron-every-on-tasks branch from 7c22be9 to e03c97b Compare March 20, 2019 21:12
Copy link
Contributor

@Palakp41 Palakp41 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, looks good!

@AlirieGray AlirieGray force-pushed the fix/switching-cron-every-on-tasks branch 4 times, most recently from 30a6c7b to 909c3ec Compare March 20, 2019 21:49
import {TaskSchedule} from 'src/utils/taskOptionsToFluxScript'

describe('tasksReducer', () => {
it('clears the cron property from the task options when interval is selected', () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these tests could have a another describe for the action these reducers are responding to. i.e."

describe('tasksReducer', () => {
  describe('setTaskOption', () => {
    ... setTaskOption tests here
   })
})

@AlirieGray AlirieGray force-pushed the fix/switching-cron-every-on-tasks branch from 909c3ec to 5bf72b9 Compare March 20, 2019 22:03
@AlirieGray AlirieGray merged commit f301bbd into master Mar 20, 2019
@AlirieGray AlirieGray deleted the fix/switching-cron-every-on-tasks branch March 20, 2019 22:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Impossible to change a task to cron after using every
3 participants