Skip to content

Commit

Permalink
feature: added tab hook in teams [WTEL-4246]
Browse files Browse the repository at this point in the history
  • Loading branch information
lizacoma committed Mar 26, 2024
1 parent 30a79fd commit 34dbe3e
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,7 @@ export default {
}, {
text: this.$tc('objects.ccenter.agents.agents', 2),
value: 'agents',
},
{
}, {
text: this.$tc('objects.ccenter.queues.hooks.hooks', 2),
value: 'hooks',
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ import applyTransform, {
snakeToCamel,
starToSearch,
} from '@webitel/ui-sdk/src/api/transformers';
import { TeamHookServiceApi } from 'webitel-sdk';
import { TeamHookServiceApiFactory } from 'webitel-sdk';
import instance from '../../../../../../../app/api/instance';
import configuration from '../../../../../../../app/api/openAPIConfig';

const teamHookService = new TeamHookServiceApi(configuration, '', instance);
const teamHookService = new TeamHookServiceApiFactory(configuration, '', instance);

const fieldsToSend = ['event', 'properties', 'schema', 'enabled'];

Expand Down Expand Up @@ -52,6 +52,7 @@ const getTeamHooksList = async (params) => {
fields,
id,
);
console.log('getTeamHooksList');
const { items, next } = applyTransform(response.data, [
snakeToCamel(),
merge(getDefaultGetListResponse()),
Expand Down Expand Up @@ -97,6 +98,7 @@ const addTeamHook = async ({ parentId, itemInstance }) => {
camelToSnake(),
]);
try {
console.log('addTeamHook item', item);
const response = await teamHookService.createTeamHook(parentId, item);
return applyTransform(response.data, [
snakeToCamel(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
@close="close"
>
<template #title>
<!-- {{ $tc('objects.ccenter.queues.hooks.hooks', 1) }}-->
{{ $tc('objects.ccenter.queues.hooks.hooks', 1) }}
</template>
<template #main>
<form>
Expand Down Expand Up @@ -74,15 +74,15 @@ export default {
computed: {
eventOptions() {
return Object.values(HookEvent).map((event) => ({
// name: this.$t(`objects.ccenter.queues.hooks.eventTypes.${event}`),
name: event,
value: event,
}));
},
event: {
get() {
const { event } = this.itemInstance;
return event ? {
// name: this.$t(`objects.ccenter.queues.hooks.eventTypes.${event}`),
name: event,
value: event,
} : {};
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<header class="content-header">
<h3 class="content-title">
<!-- {{ $tc('objects.ccenter.queues.hooks.hooks', 2) }}-->
{{ $tc('objects.ccenter.queues.hooks.hooks', 2) }}
</h3>
<div class="content-header__actions-wrap">
<wt-table-actions
Expand All @@ -24,7 +24,7 @@
v-if="!disableUserInput"
class="icon-action"
icon="plus"
@click="openPopup"
@click="create"
/>
</wt-table-actions>
</div>
Expand All @@ -43,7 +43,7 @@
@sort="sort"
>
<template #event="{ item }">
<!-- {{ $t(objects.ccenter.queues.hooks.eventTypes.${item.event}) }}-->
{{ item.event }}
</template>
<template #schema="{ item }">
{{ item.schema.name }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
export default Object.freeze({
JOINED: 'joined',
ANSWERED: 'answered',
OFFERING: 'offering',
BRIDGED: 'bridged',
MISSED: 'missed',
LEAVING: 'leaving',
PROCESSING: 'processing',
ACTIVE: 'active',
AGENT_STATUS: 'agent_status',
});
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { AgentServiceApiFactory } from 'webitel-sdk';import {
import { AgentServiceApiFactory } from 'webitel-sdk';
import {
getDefaultGetListResponse,
getDefaultGetParams,
} from '@webitel/ui-sdk/src/api/defaults';
Expand Down
3 changes: 2 additions & 1 deletion src/modules/contact-center/modules/teams/store/teams.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const actions = {
context.commit('RESET_ITEM_STATE');
context.dispatch('ccenter/teams/supervisors/RESET_STATE', {}, { root: true });
context.dispatch('ccenter/teams/agents/RESET_STATE', {}, { root: true });
context.dispatch('ccenter/teams/hooks/RESET_STATE', {}, { root: true });
},
};

Expand All @@ -39,7 +40,7 @@ const permissions = new PermissionsStoreModule()
const teams = new ObjectStoreModule({ resettableState, headers })
.attachAPIModule(TeamsAPI)
.generateAPIActions()
.setChildModules({ supervisors, agents, hooks, permissions })
.setChildModules({ supervisors, agents, permissions, hooks })
.getModule({ actions });

export default teams;

0 comments on commit 34dbe3e

Please sign in to comment.