Groups assign tasks (#7887)

* Added initial code for creating and reading group tasks

* Separated group task routes. Separated shared task functions

* Added taskOrder to group

* Minor style fixes

* Fixed lint issues

* Added unit tests for task manager

* Updated task helper functions

* Fixed history test

* Fixed group task query

* Removed extra var

* Updated with new file structure

* Updated noset values

* Removed unecessary undefineds, fixed comments, Added apiignore

* Separated group task routes. Separated shared task functions

* Added unit tests for task manager

* Added initial groups assign route and tests

* Added sync assigned task to user

* Added unassign route and unlink method

* Added remove and unlink group task

* Updated linking and unlinking. Add test for updating task info

* Added delete group task and tests

* Added sync on task update and tests

* Added multiple users assignment

* Updated unassign for multiple users

* Added test for delete task with multiple assigend users

* Added update task for multiple assigned users

* Fixed issue with get tasks

* Abstracted syncable attributes and add tests

* Fixed merge conflicts

* Fixed style issues, limited group query fields, and added await

* Fixed group fields needed. Removed api v2 code

* Fixed style issues

* Moved group field under group sub document. Updated tests. Fixed other broken tests

* Renamed linkedTaskId and fixed broken alias tests

* Added debug middleware to new routes

* Fixed debug middleware import

* Added additional user id check for original group tasks

* Updated challenge task check to look for challenge id

* Added checklist sync fix
This commit is contained in:
Keith Holliday
2016-09-03 03:54:55 -05:00
committed by Matteo Pagliazzi
parent 173b3f3f84
commit 836cee2531
17 changed files with 1488 additions and 162 deletions

View File

@@ -3,6 +3,7 @@ import mongoose from 'mongoose';
import { defaultsDeep as defaults } from 'lodash';
import { model as User } from '../../website/server/models/user';
import { model as Group } from '../../website/server/models/group';
import { model as Challenge } from '../../website/server/models/challenge';
import mongo from './mongo'; // eslint-disable-line
import moment from 'moment';
import i18n from '../../common/script/i18n';
@@ -20,7 +21,11 @@ export function generateUser (options = {}) {
}
export function generateGroup (options = {}) {
return new Group(options).toObject();
return new Group(options);
}
export function generateChallenge (options = {}) {
return new Challenge(options);
}
export function generateRes (options = {}) {