Tasks score notes (#8507)

* Added setting and modal for score notes

* Added persistent score notes

* Fixed linting issues and documented new field

* Added max length to task score notes

* Added check for score notes existence

* Combined tasks perferences
This commit is contained in:
Keith Holliday
2017-02-27 14:56:34 -07:00
committed by GitHub
parent 68a042cdb9
commit 93befcebcc
12 changed files with 102 additions and 9 deletions

View File

@@ -210,11 +210,15 @@ module.exports = function scoreTask (options = {}, req = {}) {
_gainMP(user, _.max([0.25, 0.0025 * user._statsComputed.maxMP]) * (direction === 'down' ? -1 : 1));
task.history = task.history || [];
// Add history entry, even more than 1 per day
task.history.push({
let historyEntry = {
date: Number(new Date()),
value: task.value,
});
};
if (task.scoreNotes) historyEntry.scoreNotes = task.scoreNotes;
task.history.push(historyEntry);
_updateCounter(task, direction, times);
} else if (task.type === 'daily') {