mirror of
https://github.com/lingble/chatwoot.git
synced 2025-11-03 12:37:56 +00:00
feat: Add an action in Macro to change the priority (#6940)
This commit is contained in:
@@ -36,6 +36,7 @@ describe('#resolveActionName', () => {
|
|||||||
expect(resolveActionName(MACRO_ACTION_TYPES[1].key)).not.toEqual(
|
expect(resolveActionName(MACRO_ACTION_TYPES[1].key)).not.toEqual(
|
||||||
MACRO_ACTION_TYPES[0].label
|
MACRO_ACTION_TYPES[0].label
|
||||||
);
|
);
|
||||||
|
expect(resolveActionName('change_priority')).toEqual('Change Priority');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import { PRIORITY_CONDITION_VALUES } from 'dashboard/helper/automationHelper.js';
|
||||||
export default {
|
export default {
|
||||||
methods: {
|
methods: {
|
||||||
getDropdownValues(type) {
|
getDropdownValues(type) {
|
||||||
@@ -15,6 +16,8 @@ export default {
|
|||||||
name: i.title,
|
name: i.title,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
case 'change_priority':
|
||||||
|
return PRIORITY_CONDITION_VALUES;
|
||||||
default:
|
default:
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import { createWrapper } from '@vue/test-utils';
|
|||||||
import macrosMixin from '../macrosMixin';
|
import macrosMixin from '../macrosMixin';
|
||||||
import Vue from 'vue';
|
import Vue from 'vue';
|
||||||
import { teams, labels, agents } from '../../helper/specs/macrosFixtures';
|
import { teams, labels, agents } from '../../helper/specs/macrosFixtures';
|
||||||
|
import { PRIORITY_CONDITION_VALUES } from 'dashboard/helper/automationHelper.js';
|
||||||
describe('webhookMixin', () => {
|
describe('webhookMixin', () => {
|
||||||
describe('#getEventLabel', () => {
|
describe('#getEventLabel', () => {
|
||||||
it('returns correct i18n translation:', () => {
|
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('send_email_to_team')).toEqual(teams);
|
||||||
expect(wrapper.vm.getDropdownValues('add_label')).toEqual(resolvedLabels);
|
expect(wrapper.vm.getDropdownValues('add_label')).toEqual(resolvedLabels);
|
||||||
expect(wrapper.vm.getDropdownValues('assign_agent')).toEqual(agents);
|
expect(wrapper.vm.getDropdownValues('assign_agent')).toEqual(agents);
|
||||||
|
expect(wrapper.vm.getDropdownValues('change_priority')).toEqual(
|
||||||
|
PRIORITY_CONDITION_VALUES
|
||||||
|
);
|
||||||
expect(wrapper.vm.getDropdownValues()).toEqual([]);
|
expect(wrapper.vm.getDropdownValues()).toEqual([]);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -59,4 +59,9 @@ export const MACRO_ACTION_TYPES = [
|
|||||||
label: 'Add a private note',
|
label: 'Add a private note',
|
||||||
inputType: 'textarea',
|
inputType: 'textarea',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
key: 'change_priority',
|
||||||
|
label: 'Change Priority',
|
||||||
|
inputType: 'search_select',
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ class Macro < ApplicationRecord
|
|||||||
validate :json_actions_format
|
validate :json_actions_format
|
||||||
|
|
||||||
ACTIONS_ATTRS = %w[send_message add_label assign_team assign_agent mute_conversation change_status remove_label remove_assigned_team
|
ACTIONS_ATTRS = %w[send_message add_label assign_team assign_agent mute_conversation change_status remove_label remove_assigned_team
|
||||||
resolve_conversation snooze_conversation send_email_transcript send_attachment add_private_note].freeze
|
resolve_conversation snooze_conversation change_priority send_email_transcript send_attachment add_private_note].freeze
|
||||||
|
|
||||||
def set_visibility(user, params)
|
def set_visibility(user, params)
|
||||||
self.visibility = params[:visibility]
|
self.visibility = params[:visibility]
|
||||||
|
|||||||
Reference in New Issue
Block a user