Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit bf6a2e7

Browse files
authoredMar 16, 2021
Merge pull request #54 from topcoder-platform/develop
v1.3
2 parents 36e9893 + 0168c3d commit bf6a2e7

File tree

3 files changed

+6
-34
lines changed

3 files changed

+6
-34
lines changed
 

‎config/template.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"urlcode": "$ { challenge.id }",
1515
"group": {
1616
"name": "${ challenge.name }",
17-
"description": "Welcome to Topcoder ${ challenge.track } challenge!\nPlease post your questions in this forum, thanks!",
17+
"description": "Welcome to ${ challenge.name }.\nPlease post your questions in this forum, thank you!",
1818
"privacy": "secret",
1919
"type": "challenge"
2020
},
@@ -57,7 +57,7 @@
5757
"urlcode": "$ { challenge.id }",
5858
"group": {
5959
"name": "${ challenge.name }",
60-
"description": "Welcome to Topcoder ${ challenge.track } challenge!\nPlease post your questions in this chat group, thanks!",
60+
"description": "Welcome to ${ challenge.name }.\nPlease post your questions in this forum, thank you!",
6161
"privacy": "secret",
6262
"type": "challenge"
6363
},
@@ -106,7 +106,7 @@
106106
"urlcode": "$ { challenge.id }",
107107
"group": {
108108
"name": "${ challenge.name }",
109-
"description": "Welcome to Topcoder ${ challenge.track } challenge!\nPlease post your questions in this chat group, thanks!",
109+
"description": "Welcome to ${ challenge.name }.\nPlease post your questions in this forum, thank you!",
110110
"privacy": "secret",
111111
"type": "challenge"
112112
},
@@ -149,7 +149,7 @@
149149
"urlcode": "$ { challenge.id }",
150150
"group": {
151151
"name": "${ challenge.name }",
152-
"description": "Welcome to Topcoder ${ challenge.track } challenge!\nPlease post your questions in this chat group, thanks!",
152+
"description": "Welcome to ${ challenge.name }.\nPlease post your questions in this forum, thank you!",
153153
"privacy": "secret",
154154
"type": "challenge"
155155
},

‎src/services/vanilla.js

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ async function manageVanillaUser (data) {
2222
const group = groups.length > 0 ? groups[0] : null
2323

2424
const watch = shouldWatchCategories(projectRole, challengeRoles)
25-
const follow = shouldFollowCategories(projectRole, challengeRoles)
2625

2726
if (!group) {
2827
throw new Error('The group wasn\'t not found by challengeID')
@@ -96,10 +95,9 @@ async function manageVanillaUser (data) {
9695
case constants.USER_ACTIONS.INVITE: {
9796
await vanillaClient.addUserToGroup(group.groupID, {
9897
userID: vanillaUser.userID,
99-
watch: watch,
100-
follow: follow
98+
watch: watch
10199
})
102-
logger.info(`User [UserID=${vanillaUser.userID}, Name=${vanillaUser.name} was added to Group [GroupID=${group.groupID}, Name=${group.name}, Watch=${watch}, Follow=${follow}]`)
100+
logger.info(`User [UserID=${vanillaUser.userID}, Name=${vanillaUser.name} was added to Group [GroupID=${group.groupID}, Name=${group.name}, Watch=${watch}]`)
103101
break
104102
}
105103
case constants.USER_ACTIONS.KICK: {
@@ -342,27 +340,6 @@ function shouldWatchCategories (projectRole, challengeRoles) {
342340
)
343341
}
344342

345-
/**
346-
* Auto-follow categories
347-
* @param projectRole string
348-
* @param challengeRoles array
349-
* @returns {boolean}
350-
*/
351-
function shouldFollowCategories (projectRole, challengeRoles) {
352-
// New user
353-
if (!projectRole && _.isEmpty(challengeRoles)) {
354-
return true
355-
}
356-
357-
// Project Copilots or Managers / Challenge Copilots, Managers and Submitters
358-
return projectRole === constants.TOPCODER.PROJECT_ROLES.COPILOT ||
359-
projectRole === constants.TOPCODER.PROJECT_ROLES.MANAGER ||
360-
(_.isArray(challengeRoles) && (_.includes(challengeRoles, constants.TOPCODER.CHALLENGE_ROLES.COPILOT) ||
361-
_.includes(challengeRoles, constants.TOPCODER.CHALLENGE_ROLES.MANAGER) ||
362-
_.includes(challengeRoles, constants.TOPCODER.CHALLENGE_ROLES.SUBMITTER))
363-
)
364-
}
365-
366343
module.exports = {
367344
manageVanillaUser,
368345
createVanillaGroup,

‎src/utils/vanilla-client.util.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,6 @@ function getVanillaClient () {
2424
throw err
2525
})
2626
},
27-
followCategory: (categoryId, data) => {
28-
return request.put(`${config.VANILLA.API_URL}/categories/${categoryId}/follow`)
29-
.query({ access_token: config.VANILLA.ADMIN_ACCESS_TOKEN })
30-
.send(data)
31-
},
3227
updateCategory: (categoryId, data) => {
3328
return request.patch(`${config.VANILLA.API_URL}/categories/${categoryId}`)
3429
.query({ access_token: config.VANILLA.ADMIN_ACCESS_TOKEN })

0 commit comments

Comments
 (0)
Please sign in to comment.