mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-14 21:27:23 +01:00
Add username to challenge csv export (#10956)
- Adds the member's username to the challenge csv - Updates to unit tests - Issue #10955 Supports the ability for challenge owners to judge challenge winners after the added functionality enabling users to modify their name (display name). The added field ties the user to their results by their username.
This commit is contained in:
@@ -577,7 +577,7 @@ api.exportChallengeCsv = {
|
||||
.lean().exec(),
|
||||
]);
|
||||
|
||||
let resArray = members.map(member => [member._id, member.profile.name]);
|
||||
let resArray = members.map(member => [member._id, member.profile.name, member.auth.local.username]);
|
||||
|
||||
let lastUserId;
|
||||
let index = -1;
|
||||
@@ -606,7 +606,7 @@ api.exportChallengeCsv = {
|
||||
let challengeTasks = _.reduce(challenge.tasksOrder.toObject(), (result, array) => {
|
||||
return result.concat(array);
|
||||
}, []).sort();
|
||||
resArray.unshift(['UUID', 'name']);
|
||||
resArray.unshift(['UUID', 'Display Name', 'Username']);
|
||||
|
||||
_.times(challengeTasks.length, () => resArray[0].push('Task', 'Value', 'Notes', 'Streak'));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user