Skip to content

Commit 342dcfd

Browse files
committed
Issue 1545 of Connect App - Skip notifications for managers - missed files
Fix lint errors
1 parent e60ab0a commit 342dcfd

File tree

4 files changed

+8
-3
lines changed

4 files changed

+8
-3
lines changed

connect/config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@ module.exports = {
1717
ADMINISTRATOR_ROLE_ID: 1,
1818

1919
// id of the BOT user which creates post with various events in discussions
20-
TCWEBSERVICE_ID: process.env.TCWEBSERVICE_ID || '22838965',
20+
TCWEBSERVICE_ID: process.env.TCWEBSERVICE_ID || '22838965',
2121
};

connect/events-config.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ const TOPCODER_ROLE_RULES = {
4040
* toUserHandle {Boolean} [optional] If set to true, user defined in `message.userHandle` will get notification
4141
* toTopicStarter {Boolean} [optional] If set to true, than will find who started topic `message.topicId` and
4242
* send notification to him
43+
* exclude {Object} [optional] May contains any rules like `projectRoles`, `toUserHandle` etc
44+
* but these rules will forbid sending notifications to members who satisfy them
4345
*
4446
* @type {Array}
4547
*/
@@ -48,6 +50,9 @@ const EVENTS = [
4850
{
4951
type: 'notifications.connect.project.created',
5052
projectRoles: [PROJECT_ROLE_OWNER],
53+
exclude: {
54+
topcoderRoles: [ROLE_CONNECT_MANAGER, ROLE_ADMINISTRATOR],
55+
},
5156
}, {
5257
type: 'notifications.connect.project.submittedForReview',
5358
projectRoles: [PROJECT_ROLE_OWNER],

src/app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ function start(handlers) {
110110
apiRouter[verb](url, helper.autoWrapExpress(actions));
111111
});
112112
});
113-
113+
114114
app.use('/notifications/debug', (req, res) => {
115115
const options = {
116116
from: new Date - 1 * 60 * 60 * 1000,

src/models/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ const NotificationSetting = require('./NotificationSetting')(sequelize, DataType
1818
module.exports = {
1919
Notification,
2020
NotificationSetting,
21-
init: () => sequelize.sync({ force:true }),
21+
init: () => sequelize.sync({ force: true }),
2222
};

0 commit comments

Comments
 (0)