From 133fb1bcf621b80198d51e693def6e402552fcb5 Mon Sep 17 00:00:00 2001 From: Shivam Mishra Date: Mon, 2 Feb 2026 11:59:51 +0530 Subject: [PATCH] feat: add mark pending action to automation (#13378) --- .../dashboard/helper/validations.js | 1 + .../dashboard/i18n/locale/en/automation.json | 3 ++- .../settings/automation/constants.js | 21 +++++++++++++++++++ app/models/automation_rule.rb | 4 ++-- app/services/action_service.rb | 4 ++++ 5 files changed, 30 insertions(+), 3 deletions(-) diff --git a/app/javascript/dashboard/helper/validations.js b/app/javascript/dashboard/helper/validations.js index edebc4656..e425047a2 100644 --- a/app/javascript/dashboard/helper/validations.js +++ b/app/javascript/dashboard/helper/validations.js @@ -127,6 +127,7 @@ const validateSingleAction = action => { 'resolve_conversation', 'remove_assigned_team', 'open_conversation', + 'pending_conversation', ]; if ( diff --git a/app/javascript/dashboard/i18n/locale/en/automation.json b/app/javascript/dashboard/i18n/locale/en/automation.json index 43245a1d5..341027299 100644 --- a/app/javascript/dashboard/i18n/locale/en/automation.json +++ b/app/javascript/dashboard/i18n/locale/en/automation.json @@ -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", diff --git a/app/javascript/dashboard/routes/dashboard/settings/automation/constants.js b/app/javascript/dashboard/routes/dashboard/settings/automation/constants.js index bc767040b..3acca3e2e 100644 --- a/app/javascript/dashboard/routes/dashboard/settings/automation/constants.js +++ b/app/javascript/dashboard/routes/dashboard/settings/automation/constants.js @@ -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', diff --git a/app/models/automation_rule.rb b/app/models/automation_rule.rb index 9dc4d97eb..8162abb91 100644 --- a/app/models/automation_rule.rb +++ b/app/models/automation_rule.rb @@ -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 diff --git a/app/services/action_service.rb b/app/services/action_service.rb index a50b11193..80caac392 100644 --- a/app/services/action_service.rb +++ b/app/services/action_service.rb @@ -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