feat: Add an action in Macro to change the priority (#6940)

This commit is contained in:
Muhsin Keloth
2023-04-24 17:14:30 +05:30
committed by GitHub
parent e3193dcabc
commit f1fc658a0d
5 changed files with 14 additions and 1 deletions

View File

@@ -36,6 +36,7 @@ describe('#resolveActionName', () => {
expect(resolveActionName(MACRO_ACTION_TYPES[1].key)).not.toEqual(
MACRO_ACTION_TYPES[0].label
);
expect(resolveActionName('change_priority')).toEqual('Change Priority');
});
});

View File

@@ -1,3 +1,4 @@
import { PRIORITY_CONDITION_VALUES } from 'dashboard/helper/automationHelper.js';
export default {
methods: {
getDropdownValues(type) {
@@ -15,6 +16,8 @@ export default {
name: i.title,
};
});
case 'change_priority':
return PRIORITY_CONDITION_VALUES;
default:
return [];
}

View File

@@ -2,6 +2,7 @@ import { createWrapper } from '@vue/test-utils';
import macrosMixin from '../macrosMixin';
import Vue from 'vue';
import { teams, labels, agents } from '../../helper/specs/macrosFixtures';
import { PRIORITY_CONDITION_VALUES } from 'dashboard/helper/automationHelper.js';
describe('webhookMixin', () => {
describe('#getEventLabel', () => {
it('returns correct i18n translation:', () => {
@@ -37,6 +38,9 @@ describe('webhookMixin', () => {
expect(wrapper.vm.getDropdownValues('send_email_to_team')).toEqual(teams);
expect(wrapper.vm.getDropdownValues('add_label')).toEqual(resolvedLabels);
expect(wrapper.vm.getDropdownValues('assign_agent')).toEqual(agents);
expect(wrapper.vm.getDropdownValues('change_priority')).toEqual(
PRIORITY_CONDITION_VALUES
);
expect(wrapper.vm.getDropdownValues()).toEqual([]);
});
});

View File

@@ -59,4 +59,9 @@ export const MACRO_ACTION_TYPES = [
label: 'Add a private note',
inputType: 'textarea',
},
{
key: 'change_priority',
label: 'Change Priority',
inputType: 'search_select',
},
];