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

WIP: Recurring task with subtasks #96

Merged
merged 3 commits into from
Nov 22, 2015

Conversation

bartj3
Copy link
Contributor

@bartj3 bartj3 commented Nov 6, 2015

Hi,
I'd like to use this plugin but for my use case I need to recur the tasks subtasks as well, is this a functionality you'd consider to merge into the plugin if I would create a PR for this?

I'd imagine this to be a preference when creating a new recurrence (like the current Fixed schedule?). When true subtasks will be recreated in the same schedule as it's parent.

@nutso
Copy link
Owner

nutso commented Oct 28, 2015

Hi,
Sure, always happy to have good contributions. Having the preference settable for each recurring task sounds like it won't impact current expected behavior while also providing a new capability.

@bartj3
Copy link
Contributor Author

bartj3 commented Nov 6, 2015

I've just attached my progress to this issue, there's still some work to do on the start_date & due_date of the subtasks as it now just assumes they'll be the same as the main issue but that doesn't have to be the case.

There's another issue i'd like to have your opinion on though:

For copying an issue issue.copy is used, by default this does copy the subtasks. However because the plugin never updated the values in the new subtasks they stayed closed. By changing update.copy to issue.copy nil, subtasks: recur_descendants? subtasks are only copied if the user wants to recur them, which seems to me like the proper way to go. However this is not backwards compatible. If users for some reason depended on the copied closed subtasks that will no longer work.

Do you think nobody is currently using the closed copied subtasks, and would this be an ok change for a minor release? Or should I just stick with the old issue.copy for now and add the subtasks option in the next major release of the plugin?

@bartj3 bartj3 changed the title Recurring task with subtasks WIP: Recurring task with subtasks Nov 6, 2015
Renamed the descendants value because the option is called subtasks as
well, and descendants is actually incorrect as the copy function works
with children, not descendants.

Fixes subtask dates to have the correct start & due date, and save the
parent task a second time after setting the subtasks to force the proper
date. Because changing subtasks dates change the parent task dates.
@bartj3
Copy link
Contributor Author

bartj3 commented Nov 11, 2015

Because of how Redmine couples the subtask dates with the parent dates this was a bit trickier then expected. It seems to be fixed now but I still need to write some extra tests to make sure it works in all of the edge cases. I didn't include the tests here because it might be better to create a new PR for that where more is tested then just the subtask recurrence.

@nutso nutso added this to the v2.0.0 milestone Nov 22, 2015
@nutso nutso self-assigned this Nov 22, 2015
nutso added a commit that referenced this pull request Nov 22, 2015
@nutso nutso merged commit 6b708f1 into nutso:master Nov 22, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants