Compare commits

..

5 commits

Author SHA1 Message Date
Tejaswini Chile
ee4b458d1a fix: Activity message for assign agent 2022-12-27 19:35:12 +05:30
iamsivin
c67e18e9e9 fix: failed specs 2022-12-26 09:54:25 +05:30
iamsivin
1c9458b823 fix: Specs 2022-12-26 09:37:02 +05:30
Sivin Varghese
9fb9887348
Merge branch 'develop' into feat/assign-agent-automation 2022-12-24 11:28:48 +05:30
iamsivin
b0c5918d5d feat: Adds automation view for assigning an agent 2022-12-21 20:40:53 +05:30
8 changed files with 40 additions and 11 deletions

View file

@ -97,8 +97,9 @@ export const generateConditionOptions = (options, key = 'id') => {
});
};
export const getActionOptions = ({ teams, labels, type }) => {
export const getActionOptions = ({ agents, teams, labels, type }) => {
const actionsMap = {
assign_agent: agents,
assign_team: teams,
send_email_to_team: teams,
add_label: generateConditionOptions(labels, 'title'),
@ -178,7 +179,7 @@ export const getDefaultConditions = eventName => {
export const getDefaultActions = () => {
return [
{
action_name: 'assign_team',
action_name: 'assign_agent',
action_params: [],
},
];
@ -213,7 +214,7 @@ export const isCustomAttribute = (attrs, key) => {
export const generateCustomAttributes = (
conversationAttributes = [],
contactAttribtues = [],
contactAttributes = [],
conversationlabel,
contactlabel
) => {
@ -228,14 +229,14 @@ export const generateCustomAttributes = (
...conversationAttributes
);
}
if (contactAttribtues.length) {
if (contactAttributes.length) {
customAttributes.push(
{
key: `contact_custom_attribute`,
name: contactlabel,
disabled: true,
},
...contactAttribtues
...contactAttributes
);
}
return customAttributes;

View file

@ -250,8 +250,8 @@ export default {
};
},
getActionDropdownValues(type) {
const { labels, teams } = this;
return getActionOptions({ labels, teams, type });
const { agents, labels, teams } = this;
return getActionOptions({ agents, labels, teams, type });
},
manifestCustomAttributes() {
const conversationCustomAttributesRaw = this.$store.getters[

View file

@ -187,7 +187,7 @@ export default {
],
actions: [
{
action_name: 'assign_team',
action_name: 'assign_agent',
action_params: [],
},
],

View file

@ -30,6 +30,11 @@ export const AUTOMATIONS = {
},
],
actions: [
{
key: 'assign_agent',
name: 'Assign to agent',
attributeI18nKey: 'ASSIGN_AGENT',
},
{
key: 'assign_team',
name: 'Assign a team',
@ -129,6 +134,11 @@ export const AUTOMATIONS = {
},
],
actions: [
{
key: 'assign_agent',
name: 'Assign to agent',
attributeI18nKey: 'ASSIGN_AGENT',
},
{
key: 'assign_team',
name: 'Assign a team',
@ -241,6 +251,11 @@ export const AUTOMATIONS = {
},
],
actions: [
{
key: 'assign_agent',
name: 'Assign to agent',
attributeI18nKey: 'ASSIGN_AGENT',
},
{
key: 'assign_team',
name: 'Assign a team',
@ -311,6 +326,11 @@ export const AUTOMATION_RULE_EVENTS = [
];
export const AUTOMATION_ACTION_TYPES = [
{
key: 'assign_agent',
label: 'Assign to agent',
inputType: 'search_select',
},
{
key: 'assign_team',
label: 'Assign a team',

View file

@ -214,7 +214,7 @@ describe('automationMethodsMixin', () => {
it('getDefaultActions returns the resp default action model', () => {
const genericActionModel = [
{
action_name: 'assign_team',
action_name: 'assign_agent',
action_params: [],
},
];

View file

@ -209,7 +209,7 @@ describe('automationMethodsMixin', () => {
it('appendNewAction appends a new condition to the automation data property', () => {
const action = {
action_name: 'assign_team',
action_name: 'assign_agent',
action_params: [],
};
const data = () => {
@ -339,6 +339,9 @@ describe('automationMethodsMixin', () => {
};
};
const computed = {
agents() {
return agents;
},
labels() {
return labels;
},
@ -419,6 +422,9 @@ describe('automationMethodsMixin', () => {
return {};
};
const computed = {
agents() {
return agents;
},
labels() {
return labels;
},

View file

@ -174,7 +174,7 @@ export default {
feedback_message: this.feedbackMessage,
};
} catch (error) {
const errorMessage = error?.response?.data?.error;
const errorMessage = error?.response?.data?.message;
this.errorMessage = errorMessage || this.$t('SURVEY.API.ERROR_MESSAGE');
} finally {
this.isUpdating = false;

View file

@ -104,6 +104,8 @@ module ActivityMessageHandler
end
def create_assignee_change_activity(user_name)
user_name = activity_message_ownner(user_name)
return unless user_name
content = generate_assignee_change_activity_content(user_name)