feat: Rewrite aiMixin to a composable (#9955)

This PR will replace the usage of aiMixin with the useAI composable.

Fixes https://linear.app/chatwoot/issue/CW-3443/rewrite-aimixin-mixin-to-a-composable

Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
Co-authored-by: Shivam Mishra <scm.mymail@gmail.com>
This commit is contained in:
Sivin Varghese
2024-08-22 13:58:51 +05:30
committed by GitHub
parent c63a6ed8ec
commit d19a9c38d7
11 changed files with 372 additions and 223 deletions

View File

@@ -1,6 +1,7 @@
<script>
import '@chatwoot/ninja-keys';
import { useConversationLabels } from 'dashboard/composables/useConversationLabels';
import { useAI } from 'dashboard/composables/useAI';
import { useAgentsList } from 'dashboard/composables/useAgentsList';
import wootConstants from 'dashboard/constants/globals';
import conversationHotKeysMixin from './conversationHotKeys';
@@ -27,6 +28,7 @@ export default {
removeLabelFromConversation,
} = useConversationLabels();
const { isAIIntegrationEnabled } = useAI();
const { agentsList, assignableAgents } = useAgentsList();
return {
@@ -36,6 +38,7 @@ export default {
inactiveLabels,
addLabelToConversation,
removeLabelFromConversation,
isAIIntegrationEnabled,
};
},
data() {

View File

@@ -4,7 +4,6 @@ import { emitter } from 'shared/helpers/mitt';
import { CMD_AI_ASSIST } from './commandBarBusEvents';
import { REPLY_EDITOR_MODES } from 'dashboard/components/widgets/WootWriter/constants';
import aiMixin from 'dashboard/mixins/aiMixin';
import {
ICON_ADD_LABEL,
ICON_ASSIGN_AGENT,
@@ -36,7 +35,6 @@ import {
isAInboxViewRoute,
} from '../../../helper/routeHelpers';
export default {
mixins: [aiMixin],
watch: {
assignableAgents() {
this.setCommandbarData();