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

Group plans reorder tasks #8358

Merged
merged 6 commits into from
Jan 11, 2017

Conversation

TheHollidayInn
Copy link
Contributor

Fixes put_issue_url_here

Changes

  • Added a new endpoint for reordering group tasks
  • Added front end check to see if we need to reorder group task and to call the correct end point if so

UUID:

let order = group.tasksOrder[`${task.type}s`];
let currentIndex = order.indexOf(task._id);

// If for some reason the task isn't ordered (should never happen), push it in the new position
Copy link
Contributor

Choose a reason for hiding this comment

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

is it possible to abstract this logic so that we don't duplicate code between group and user (and maybe challenges) tasks reordering?

let taskId = req.params.taskId;
let task = await Tasks.Task.findOne({
_id: taskId,
});
Copy link
Contributor

Choose a reason for hiding this comment

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

missing .exec()

@Alys
Copy link
Contributor

Alys commented Jan 4, 2017 via email

@TheHollidayInn TheHollidayInn force-pushed the group-plans-reorder-tasks branch from 1b5509c to 89e85ad Compare January 10, 2017 17:28
@TheHollidayInn
Copy link
Contributor Author

Updated.

@paglias
Copy link
Contributor

paglias commented Jan 10, 2017

Looks good 👍 a unit test for the move task would be perfect but feel free to merge it without

@paglias paglias merged commit 1590d95 into HabitRPG:develop Jan 11, 2017
phillipthelen pushed a commit to phillipthelen/habitrpg that referenced this pull request Jan 25, 2017
* Added move route for group tasks

* Added group task reorder to front end

* Added syncing with group task order

* Fixed linting issues

* Added missing exec and abstracted move code

* Added unit test for moveTask
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.

3 participants