Skip to content

Conversation

gondzo
Copy link
Collaborator

@gondzo gondzo commented Feb 19, 2019

Changes as part of appirio-tech/connect-app#2837

initiatorUserId: req.authUser.userId,
}, logger);

if (role === PROJECT_MEMBER_ROLE.COPILOT && status === INVITE_STATUS.ACCEPTED) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gondzo should we send only copilot events only in this case and bypass the event on line https://github.com/topcoder-platform/tc-project-service/pull/254/files#diff-42ae3999a1a28855656e72e3e1e1ea71R727 ? otherwise I think it would result in duplicate emails being sent from tc-notifications ?

initiatorUserId: req.authUser.userId,
}, logger);

if (role === PROJECT_MEMBER_ROLE.COPILOT) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gondzo same as the issue mentioned in case of updated event below, should we bypass create event in case of requested event event thrown ?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we should skip raising the created event in this case.

Copy link
Contributor

@RishiRajSahu RishiRajSahu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gondzo added comments, please address.

src/constants.js Outdated
PROJECT_MEMBER_INVITE_CREATED: 'notifications.connect.project.member.invite.created',
PROJECT_MEMBER_INVITE_REQUESTED: 'notifications.connect.project.member.invite.requested',
PROJECT_MEMBER_INVITE_UPDATED: 'notifications.connect.project.member.invite.updated',
PROJECT_MEMBER_COPILOT_ADDED: 'notifications.connect.project.member.copilot.added',

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renaming of events needed as suggested in other PR topcoder-platform/tc-notifications#89

src/constants.js Outdated
PROJECT_MEMBER_INVITE_REQUESTED: 'notifications.connect.project.member.invite.requested',
PROJECT_MEMBER_INVITE_UPDATED: 'notifications.connect.project.member.invite.updated',
PROJECT_MEMBER_COPILOT_ADDED: 'notifications.connect.project.member.copilot.added',
PROJECT_MEMBER_COPILOT_REFUSED: 'notifications.connect.project.member.copilot.refused',

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renaming of events needed as suggested in other PR topcoder-platform/tc-notifications#89

);
// send email invite (async)
if (v.email && !v.userId) {
if (v.email && !v.userId && v.role !== PROJECT_MEMBER_ROLE.COPILOT) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we better check the status (v.status === 'pending') of the invite itself rather than depending of the role? We might have some future requirements where we might need to add more roles where we need workflow like this.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, we don't send the email for copilots only - invite status is still the same regardless of role

@gondzo gondzo merged commit b1737e5 into dev Feb 21, 2019
@vikasrohit vikasrohit deleted the feature/copilotWorkflow branch July 29, 2019 06:28
@vikasrohit vikasrohit restored the feature/copilotWorkflow branch July 29, 2019 06:29
@eisbilir eisbilir deleted the feature/copilotWorkflow branch November 9, 2023 20:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants