-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
feat: Execute macro actions, for the conversation #5066
Conversation
b019893
to
4f9e285
Compare
@tejaswinichile, unlike automation performed by the system, for macros, the actions should come under the agent who performed the action. Think of it as a sequence of actions that you perform as an agent everyday, so that you want that to be done in one click. Also, for the macros endpoint, we will need to accept an array of conversation ids if we are thinking about having it in bulk actions. cc: @pranavrajs |
@sojan-official Yes, this is correct. The user context should be used. Unlike automation, the action is performed by the agent, so every action should consider the user context (e.g., A message should be sent in the name of the agent, or labels should have the agent name, etc.). Also, we need support for multiple conversation ids in the API. @tejaswinichile Noticed that the add_label action didn't work in the screencast. |
@pranavrajs Yeah because I didn't have those labels added to my account, it works, let me add the updated video.
@pranavrajs @sojan-official Should I update the PR for the bulk actions?
Updating it. I added the Macro as a performer. |
Screen.Recording.2022-07-20.at.10.39.12.PM.movHey, @pranavrajs @sojan-official Please have a look at this updated video. |
I guess you can update the conversation_id parameter in the API to use |
c7a96ed
to
06eaa70
Compare
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.
Added a couple of comments. Looks good overall.
@@ -34,6 +34,12 @@ def update | |||
end | |||
end | |||
|
|||
def execute | |||
::MacrosExecutionJob.perform_later(@macro, conversation_ids: params[:conversation_ids], user: current_user) |
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.
let's use Current.user
instead. We are trying to remove the usage current_user
in favor of this.
|
||
def send_email_to_team(_params); end | ||
|
||
def agent_belongs_to_account?(agent_ids) |
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.
some of these methods seem repetitive to what we have in automation service
def agent_belongs_to_account?(agent_ids) |
can we extract them to a common base class or a helper and avoid the repetition?
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.
Yes, we can have a common action service may be. The issue was just with the activity execution, let me check.
81a8374
to
7855fb9
Compare
a380f78
to
a60b740
Compare
a60b740
to
1fceae6
Compare
@sojan-official This has been fixed please have a look. |
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.
LGTM
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Pull Request Template
Description
Execute macros actions for the conversation.
Fixes #5013
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Tested on local and with test cases.
Checklist:
Screen.Recording.2022-07-20.at.1.17.00.PM.mov