-
Notifications
You must be signed in to change notification settings - Fork 15
Copilot workflow changes #89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks good, just need some event renaming for better logical understanding of the action.
connect/constants.js
Outdated
@@ -30,6 +30,9 @@ module.exports = { | |||
ASSIGNED_AS_OWNER: 'notifications.connect.project.member.assignedAsOwner', | |||
INVITE_CREATED: 'notifications.connect.project.member.invite.created', | |||
INVITE_UPDATED: 'notifications.connect.project.member.invite.updated', | |||
INVITE_REQUESTED: 'notifications.connect.project.member.invite.requested', | |||
COPILOT_ADDED: 'notifications.connect.project.member.copilot.added', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gondzo I would like to rename this event to INVITE_APPROVED : notifications.connect.project.member.invite.approved
connect/constants.js
Outdated
@@ -30,6 +30,9 @@ module.exports = { | |||
ASSIGNED_AS_OWNER: 'notifications.connect.project.member.assignedAsOwner', | |||
INVITE_CREATED: 'notifications.connect.project.member.invite.created', | |||
INVITE_UPDATED: 'notifications.connect.project.member.invite.updated', | |||
INVITE_REQUESTED: 'notifications.connect.project.member.invite.requested', | |||
COPILOT_ADDED: 'notifications.connect.project.member.copilot.added', | |||
COPILOT_REFUSED: 'notifications.connect.project.member.copilot.refused', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like to rename this event to INVITE_REJECTED : notifications.connect.project.member.invite.rejected
connect/events-config.js
Outdated
}, { | ||
type: BUS_API_EVENT.CONNECT.MEMBER.COPILOT_ADDED, | ||
toUserHandle: true, | ||
creator: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gondzo Can we have better naming for creator
? I mean creator
is too generic to relate to any event. My example would be something like originator
(not be confused with initiatorId
which is the user who is performing the current operation)
{{#if [notifications.connect.project.member.invite.requested]}} | ||
You are requested to add <strong>{{userFullName}}</strong> as a copilot | ||
{{/if}} | ||
{{#if [notifications.connect.project.member.copilot.added]}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just for keep track of, this would be updated as per event rename suggested above.
@@ -307,6 +335,7 @@ const handler = (topic, message, logger, callback) => { | |||
// - check that event has everything required or throw error | |||
getNotificationsForTopicStarter(eventConfig, message.topicId), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gondzo we might reuse the logic of originator
, which I mentioned in other comment, here to be generic enough to send notifications to the originator.
@@ -13,6 +13,7 @@ module.exports = { | |||
// These variables are currently being used to retrieve above role members using API V3 `/roles` endpoint. | |||
// As soon as this endpoint is replaced with more suitable one, these variables has to be removed if no need anymore. | |||
CONNECT_MANAGER_ROLE_ID: 8, | |||
CONNECT_COPILOT_MANAGER_ROLE_ID: 113, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gondzo I forgot how do we manage these ids when we test the application in dev env?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We just use what is set in the admin app - role ids should be consistent between dev and prod
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor comment to address.
@@ -63,15 +63,15 @@ | |||
{{#if [notifications.connect.project.member.invite.requested]}} | |||
You are requested to add <strong>{{userFullName}}</strong> as a copilot | |||
{{/if}} | |||
{{#if [notifications.connect.project.member.copilot.added]}} | |||
{{#if [notifications.connect.project.member.invite.approved]}} | |||
{{#if [creator]}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gondzo I think we need to rename this creator as well, need not we ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is done already @RishiRajSahu
@RishiRajSahu merge conflicts resolved |
Changes as part of appirio-tech/connect-app#2837