mirror of
https://github.com/lingble/chatwoot.git
synced 2025-11-02 12:08:01 +00:00
feat: allow automation rules to remove labels (#8346)
This commit is contained in:
@@ -135,6 +135,7 @@ export const getActionOptions = ({ agents, teams, labels, type }) => {
|
||||
assign_team: teams,
|
||||
send_email_to_team: teams,
|
||||
add_label: generateConditionOptions(labels, 'title'),
|
||||
remove_label: generateConditionOptions(labels, 'title'),
|
||||
change_priority: PRIORITY_CONDITION_VALUES,
|
||||
};
|
||||
return actionsMap[type];
|
||||
|
||||
@@ -67,6 +67,11 @@ export const AUTOMATIONS = {
|
||||
name: 'Add a label',
|
||||
attributeI18nKey: 'ADD_LABEL',
|
||||
},
|
||||
{
|
||||
key: 'remove_label',
|
||||
name: 'Remove a label',
|
||||
attributeI18nKey: 'REMOVE_LABEL',
|
||||
},
|
||||
{
|
||||
key: 'send_email_to_team',
|
||||
name: 'Send an email to team',
|
||||
@@ -556,6 +561,11 @@ export const AUTOMATION_ACTION_TYPES = [
|
||||
label: 'Add a label',
|
||||
inputType: 'multi_select',
|
||||
},
|
||||
{
|
||||
key: 'remove_label',
|
||||
label: 'Remove a label',
|
||||
inputType: 'multi_select',
|
||||
},
|
||||
{
|
||||
key: 'send_email_to_team',
|
||||
label: 'Send an email to team',
|
||||
|
||||
@@ -32,8 +32,8 @@ class AutomationRule < ApplicationRecord
|
||||
|
||||
CONDITIONS_ATTRS = %w[content email country_code status message_type browser_language assignee_id team_id referer city company inbox_id
|
||||
mail_subject phone_number priority conversation_language].freeze
|
||||
ACTIONS_ATTRS = %w[send_message add_label send_email_to_team assign_team assign_agent send_webhook_event mute_conversation send_attachment
|
||||
change_status resolve_conversation snooze_conversation change_priority send_email_transcript].freeze
|
||||
ACTIONS_ATTRS = %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 snooze_conversation change_priority send_email_transcript].freeze
|
||||
|
||||
def file_base_data
|
||||
files.map do |file|
|
||||
|
||||
Reference in New Issue
Block a user