feat: Add None option in automation assign agent actions (#7900)
This commit is contained in:
@@ -120,9 +120,18 @@ export const generateConditionOptions = (options, key = 'id') => {
|
||||
});
|
||||
};
|
||||
|
||||
// Add the "None" option to the agent list
|
||||
export const agentList = agents => [
|
||||
{
|
||||
id: 'nil',
|
||||
name: 'None',
|
||||
},
|
||||
...(agents || []),
|
||||
];
|
||||
|
||||
export const getActionOptions = ({ agents, teams, labels, type }) => {
|
||||
const actionsMap = {
|
||||
assign_agent: agents,
|
||||
assign_agent: agentList(agents),
|
||||
assign_team: teams,
|
||||
send_email_to_team: teams,
|
||||
add_label: generateConditionOptions(labels, 'title'),
|
||||
|
||||
@@ -32,6 +32,8 @@ class ActionService
|
||||
end
|
||||
|
||||
def assign_agent(agent_ids = [])
|
||||
return @conversation.update!(assignee_id: nil) if agent_ids[0] == 'nil'
|
||||
|
||||
return unless agent_belongs_to_inbox?(agent_ids)
|
||||
|
||||
@agent = @account.users.find_by(id: agent_ids)
|
||||
|
||||
Reference in New Issue
Block a user