feat: add mark pending action to automation (#13378)
This commit is contained in:
@@ -127,6 +127,7 @@ const validateSingleAction = action => {
|
||||
'resolve_conversation',
|
||||
'remove_assigned_team',
|
||||
'open_conversation',
|
||||
'pending_conversation',
|
||||
];
|
||||
|
||||
if (
|
||||
|
||||
@@ -150,7 +150,8 @@
|
||||
"ADD_PRIVATE_NOTE": "Add a Private Note",
|
||||
"CHANGE_PRIORITY": "Change Priority",
|
||||
"ADD_SLA": "Add SLA",
|
||||
"OPEN_CONVERSATION": "Open conversation"
|
||||
"OPEN_CONVERSATION": "Open conversation",
|
||||
"PENDING_CONVERSATION": "Mark conversation as pending"
|
||||
},
|
||||
"MESSAGE_TYPES": {
|
||||
"INCOMING": "Incoming Message",
|
||||
|
||||
@@ -116,6 +116,10 @@ export const AUTOMATIONS = {
|
||||
key: 'open_conversation',
|
||||
name: 'OPEN_CONVERSATION',
|
||||
},
|
||||
{
|
||||
key: 'pending_conversation',
|
||||
name: 'PENDING_CONVERSATION',
|
||||
},
|
||||
{
|
||||
key: 'resolve_conversation',
|
||||
name: 'RESOLVE_CONVERSATION',
|
||||
@@ -232,6 +236,10 @@ export const AUTOMATIONS = {
|
||||
key: 'snooze_conversation',
|
||||
name: 'SNOOZE_CONVERSATION',
|
||||
},
|
||||
{
|
||||
key: 'pending_conversation',
|
||||
name: 'PENDING_CONVERSATION',
|
||||
},
|
||||
{
|
||||
key: 'resolve_conversation',
|
||||
name: 'RESOLVE_CONVERSATION',
|
||||
@@ -360,6 +368,10 @@ export const AUTOMATIONS = {
|
||||
key: 'snooze_conversation',
|
||||
name: 'SNOOZE_CONVERSATION',
|
||||
},
|
||||
{
|
||||
key: 'pending_conversation',
|
||||
name: 'PENDING_CONVERSATION',
|
||||
},
|
||||
{
|
||||
key: 'resolve_conversation',
|
||||
name: 'RESOLVE_CONVERSATION',
|
||||
@@ -482,6 +494,10 @@ export const AUTOMATIONS = {
|
||||
key: 'snooze_conversation',
|
||||
name: 'SNOOZE_CONVERSATION',
|
||||
},
|
||||
{
|
||||
key: 'pending_conversation',
|
||||
name: 'PENDING_CONVERSATION',
|
||||
},
|
||||
{
|
||||
key: 'send_webhook_event',
|
||||
name: 'SEND_WEBHOOK_EVENT',
|
||||
@@ -668,6 +684,11 @@ export const AUTOMATION_ACTION_TYPES = [
|
||||
label: 'OPEN_CONVERSATION',
|
||||
inputType: null,
|
||||
},
|
||||
{
|
||||
key: 'pending_conversation',
|
||||
label: 'PENDING_CONVERSATION',
|
||||
inputType: null,
|
||||
},
|
||||
{
|
||||
key: 'send_webhook_event',
|
||||
label: 'SEND_WEBHOOK_EVENT',
|
||||
|
||||
@@ -41,8 +41,8 @@ class AutomationRule < ApplicationRecord
|
||||
|
||||
def actions_attributes
|
||||
%w[send_message add_label remove_label send_email_to_team assign_team assign_agent send_webhook_event mute_conversation
|
||||
send_attachment change_status resolve_conversation open_conversation snooze_conversation change_priority send_email_transcript
|
||||
add_private_note].freeze
|
||||
send_attachment change_status resolve_conversation open_conversation pending_conversation snooze_conversation change_priority
|
||||
send_email_transcript add_private_note].freeze
|
||||
end
|
||||
|
||||
def file_base_data
|
||||
|
||||
@@ -22,6 +22,10 @@ class ActionService
|
||||
@conversation.open!
|
||||
end
|
||||
|
||||
def pending_conversation(_params)
|
||||
@conversation.pending!
|
||||
end
|
||||
|
||||
def change_status(status)
|
||||
@conversation.update!(status: status[0])
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user