From 61606cb69d20385058b906e2e6ee492880e63783 Mon Sep 17 00:00:00 2001 From: negue Date: Fri, 4 Jan 2019 21:04:41 +0100 Subject: [PATCH] change to User ID - change mail var _DISPLAYNAME _DISPLAY_NAME --- website/common/errors/apiErrorMessages.js | 2 +- website/common/locales/en/groups.json | 4 ++-- website/common/locales/en/messages.json | 2 +- website/server/controllers/api-v3/challenges.js | 2 +- website/server/controllers/api-v3/chat.js | 2 +- website/server/controllers/api-v3/groups.js | 14 +++++++------- website/server/controllers/api-v3/hall.js | 4 ++-- website/server/controllers/api-v4/members.js | 5 +++-- website/server/libs/chatReporting/chatReporter.js | 4 ++-- website/server/libs/setupPassport.js | 2 +- website/server/models/group.js | 2 +- 11 files changed, 22 insertions(+), 21 deletions(-) diff --git a/website/common/errors/apiErrorMessages.js b/website/common/errors/apiErrorMessages.js index 5690cdfe9d..f10747b12c 100644 --- a/website/common/errors/apiErrorMessages.js +++ b/website/common/errors/apiErrorMessages.js @@ -15,7 +15,7 @@ module.exports = { guildsPaginateBooleanString: 'req.query.paginate must be a boolean string.', groupIdRequired: 'req.params.groupId must contain a groupId.', groupRemainOrLeaveChallenges: 'req.query.keep must be either "remain-in-challenges" or "leave-challenges"', - managerIdRequired: 'req.body.managerId must contain a user ID.', + managerIdRequired: 'req.body.managerId must contain a User ID.', noSudoAccess: 'You don\'t have sudo access.', eventRequired: '"req.params.event" is required.', diff --git a/website/common/locales/en/groups.json b/website/common/locales/en/groups.json index 65c4c5506c..573b041901 100644 --- a/website/common/locales/en/groups.json +++ b/website/common/locales/en/groups.json @@ -230,9 +230,9 @@ "memberCannotRemoveYourself": "You cannot remove yourself!", "groupMemberNotFound": "User not found among group's members", "mustBeGroupMember": "Must be member of the group.", - "canOnlyInviteEmailUuid": "Can only invite using user IDs, emails, or usernames.", + "canOnlyInviteEmailUuid": "Can only invite using User IDs, emails, or usernames.", "inviteMissingEmail": "Missing email address in invite.", - "inviteMissingUuid": "Missing user id in invite", + "inviteMissingUuid": "Missing User ID in invite", "inviteMustNotBeEmpty": "Invite must not be empty.", "partyMustbePrivate": "Parties must be private", "userAlreadyInGroup": "UserID: <%= userId %>, User \"<%= username %>\" already in that group.", diff --git a/website/common/locales/en/messages.json b/website/common/locales/en/messages.json index 470ce23af5..b1aa99d069 100644 --- a/website/common/locales/en/messages.json +++ b/website/common/locales/en/messages.json @@ -45,7 +45,7 @@ "messageAuthEmailTaken": "Email already taken", "messageAuthNoUserFound": "No user found.", "messageAuthMustBeLoggedIn": "You must be logged in.", - "messageAuthMustIncludeTokens": "You must include a token and uid (user id) in your request", + "messageAuthMustIncludeTokens": "You must include a token and uid (User ID) in your request", "messageGroupAlreadyInParty": "Already in a party, try refreshing.", "messageGroupOnlyLeaderCanUpdate": "Only the group leader can update the group!", diff --git a/website/server/controllers/api-v3/challenges.js b/website/server/controllers/api-v3/challenges.js index 6405eb59ad..53116282c9 100644 --- a/website/server/controllers/api-v3/challenges.js +++ b/website/server/controllers/api-v3/challenges.js @@ -49,7 +49,7 @@ let api = {}; * @apiSuccess {String} challenge.name Full name of challenge. * @apiSuccess {String} challenge.shortName A shortened name for the challenge, to be used as a tag. * @apiSuccess {Object} challenge.leader User details of challenge leader. - * @apiSuccess {UUID} challenge.leader._id User id of challenge leader. + * @apiSuccess {UUID} challenge.leader._id User ID of challenge leader. * @apiSuccess {Object} challenge.leader.profile Profile information of leader. * @apiSuccess {Object} challenge.leader.profile.name Display Name of leader. * @apiSuccess {String} challenge.updatedAt Timestamp of last update. diff --git a/website/server/controllers/api-v3/chat.js b/website/server/controllers/api-v3/chat.js index 048311c6d0..f6df89b78d 100644 --- a/website/server/controllers/api-v3/chat.js +++ b/website/server/controllers/api-v3/chat.js @@ -289,7 +289,7 @@ api.likeChat = { * @apiSuccess {Object} data.likes The likes of the message * @apiSuccess {Object} data.flags The flags of the message * @apiSuccess {Number} data.flagCount The number of flags the message has - * @apiSuccess {UUID} data.uuid The user id of the author of the message + * @apiSuccess {UUID} data.uuid The User ID of the author of the message * @apiSuccess {String} data.user The username of the author of the message * * @apiUse GroupNotFound diff --git a/website/server/controllers/api-v3/groups.js b/website/server/controllers/api-v3/groups.js index e17362c0f6..34dd291128 100644 --- a/website/server/controllers/api-v3/groups.js +++ b/website/server/controllers/api-v3/groups.js @@ -941,11 +941,11 @@ api.removeGroupMember = { * {"name": "User2", "email": "user-2@example.com"} * ] * } - * @apiParamExample {json} User Ids + * @apiParamExample {json} User IDs * { * "uuids": ["user-id-of-existing-user", "user-id-of-another-existing-user"] * } - * @apiParamExample {json} User Ids and Emails + * @apiParamExample {json} User IDs and Emails * { * "emails": [ * {"email": "user-1@example.com"}, @@ -955,7 +955,7 @@ api.removeGroupMember = { * } * * @apiSuccess {Array} data The invites - * @apiSuccess {Object} data[0] If the invitation was a user id, you'll receive back an object. You'll receive one Object for each succesful user id invite. + * @apiSuccess {Object} data[0] If the invitation was a User ID, you'll receive back an object. You'll receive one Object for each succesful User ID invite. * @apiSuccess {String} data[1] If the invitation was an email, you'll receive back the email. You'll receive one String for each successful email invite. * * @apiSuccessExample {json} Successful Response with Emails @@ -966,13 +966,13 @@ api.removeGroupMember = { * ] * } * - * @apiSuccessExample {json} Successful Response with User Id + * @apiSuccessExample {json} Successful Response with User ID * { * "data": [ * { id: 'the-id-of-the-invited-user', name: 'The group name', inviter: 'your-user-id' } * ] * } - * @apiSuccessExample {json} Successful Response with User Ids and Emails + * @apiSuccessExample {json} Successful Response with User IDs and Emails * { * "data": [ * "user-1@example.com", @@ -987,9 +987,9 @@ api.removeGroupMember = { * param `Array`. * @apiError (400) {BadRequest} UuidOrEmailOnly The `emails` and `uuids` params were both missing and/or a * key other than `emails` or `uuids` was provided in the body param. - * @apiError (400) {BadRequest} CannotInviteSelf User id or email of invitee matches that of the inviter. + * @apiError (400) {BadRequest} CannotInviteSelf User ID or email of invitee matches that of the inviter. * @apiError (400) {BadRequest} MustBeArray The `uuids` or `emails` body param was not an array. - * @apiError (400) {BadRequest} TooManyInvites A max of 100 invites (combined emails and user ids) can + * @apiError (400) {BadRequest} TooManyInvites A max of 100 invites (combined emails and User IDs) can * be sent out at a time. * @apiError (400) {BadRequest} ExceedsMembersLimit A max of 30 members can join a party. * diff --git a/website/server/controllers/api-v3/hall.js b/website/server/controllers/api-v3/hall.js index 21dfdadbb0..2d4cc19240 100644 --- a/website/server/controllers/api-v3/hall.js +++ b/website/server/controllers/api-v3/hall.js @@ -143,7 +143,7 @@ const heroAdminFields = 'contributor balance profile.name purchased items auth f /** * @api {get} /api/v3/hall/heroes/:heroId Get any user ("hero") given the UUID - * @apiParam (Path) {UUID} heroId user ID + * @apiParam (Path) {UUID} heroId User ID * @apiName GetHero * @apiGroup Hall * @apiPermission Admin @@ -188,7 +188,7 @@ const gemsPerTier = {1: 3, 2: 3, 3: 3, 4: 4, 5: 4, 6: 4, 7: 4, 8: 0, 9: 0}; /** * @api {put} /api/v3/hall/heroes/:heroId Update any user ("hero") - * @apiParam (Path) {UUID} heroId user ID + * @apiParam (Path) {UUID} heroId User ID * @apiName UpdateHero * @apiGroup Hall * @apiPermission Admin diff --git a/website/server/controllers/api-v4/members.js b/website/server/controllers/api-v4/members.js index c810cba836..57a1b39ddd 100644 --- a/website/server/controllers/api-v4/members.js +++ b/website/server/controllers/api-v4/members.js @@ -18,12 +18,13 @@ let api = {}; * @apiSuccess {Object} data.likes The likes of the message (always an empty object) * @apiSuccess {Object} data.flags The flags of the message * @apiSuccess {Number} data.flagCount The number of flags the message has - * @apiSuccess {UUID} data.uuid The user id of the author of the message, or of the recipient if `sent` is true + * @apiSuccess {UUID} data.uuid The User ID of the author of the message, or of the recipient if `sent` is true * @apiSuccess {String} data.user The Display Name of the author of the message, or of the recipient if `sent` is true + * @apiSuccess {String} data.username The Username of the author of the message, or of the recipient if `sent` is true * * @apiUse MessageNotFound * @apiUse MessageIdRequired - * @apiError (400) {BadRequest} messageGroupChatFlagAlreadyReported The message has already been flagged + * @apiError (400) {BadRequest} messageGroupChatFlagAlreadyReported You have already reported this message */ api.flagPrivateMessage = { method: 'POST', diff --git a/website/server/libs/chatReporting/chatReporter.js b/website/server/libs/chatReporting/chatReporter.js index af44748d0b..d55a95c353 100644 --- a/website/server/libs/chatReporting/chatReporter.js +++ b/website/server/libs/chatReporting/chatReporter.js @@ -19,7 +19,7 @@ export default class ChatReporter { {name: 'MESSAGE_TIME', content: (new Date(message.timestamp)).toString()}, {name: 'MESSAGE_TEXT', content: message.text}, - {name: 'REPORTER_DISPLAYNAME', content: this.user.profile.name}, + {name: 'REPORTER_DISPLAY_NAME', content: this.user.profile.name}, {name: 'REPORTER_USERNAME', content: this.user.auth.local.username}, {name: 'REPORTER_UUID', content: this.user._id}, {name: 'REPORTER_EMAIL', content: reporterEmail}, @@ -36,7 +36,7 @@ export default class ChatReporter { createGenericAuthorVariables (prefix, {user, username, uuid, email}) { return [ - {name: `${prefix}_DISPLAYNAME`, content: user}, + {name: `${prefix}_DISPLAY_NAME`, content: user}, {name: `${prefix}_USERNAME`, content: username}, {name: `${prefix}_UUID`, content: uuid}, {name: `${prefix}_EMAIL`, content: email}, diff --git a/website/server/libs/setupPassport.js b/website/server/libs/setupPassport.js index 9f17200fd1..215c91daa5 100644 --- a/website/server/libs/setupPassport.js +++ b/website/server/libs/setupPassport.js @@ -6,7 +6,7 @@ import { Strategy as GoogleStrategy } from 'passport-google-oauth20'; // Passport session setup. // To support persistent login sessions, Passport needs to be able to // serialize users into and deserialize users out of the session. Typically, -// this will be as simple as storing the user ID when serializing, and finding +// this will be as simple as storing the User ID when serializing, and finding // the user by ID when deserializing. However, since this example does not // have a database of user records, the complete Facebook profile is serialized // and deserialized. diff --git a/website/server/models/group.js b/website/server/models/group.js index 9a0d4c2d29..827b0b6875 100644 --- a/website/server/models/group.js +++ b/website/server/models/group.js @@ -392,7 +392,7 @@ function getInviteCount (uuids, emails) { /** * Checks invitation uuids and emails for possible errors. * - * @param uuids An array of user ids + * @param uuids An array of User IDs * @param emails An array of emails * @param res Express res object for use with translations * @throws BadRequest An error describing the issue with the invitations