@webitel/ui-sdk 24.10.6 → 24.10.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
package/src/api/crm/contacts.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ContactsApiFactory } from 'webitel-sdk';
|
|
2
|
+
import deepCopy from 'deep-copy';
|
|
2
3
|
import {
|
|
3
4
|
getDefaultGetListResponse,
|
|
4
5
|
getDefaultGetParams,
|
|
@@ -82,7 +83,7 @@ const getList = async (params) => {
|
|
|
82
83
|
searchKey = ContactsSearchMode.VARIABLES;
|
|
83
84
|
} else if (params[ContactsSearchMode.DESTINATION]) {
|
|
84
85
|
searchValue = params[ContactsSearchMode.DESTINATION];
|
|
85
|
-
searchKey = 'emails,phones';
|
|
86
|
+
searchKey = 'emails,phones,imclients{user{name}}';
|
|
86
87
|
}
|
|
87
88
|
|
|
88
89
|
// This code needed for adding starToSearch method to applyTransform while searchKey !== SearchMode.VARIABLES because '*' in variables search mode brokes backend logic.
|
|
@@ -143,6 +144,7 @@ const get = async ({ itemId: id }) => {
|
|
|
143
144
|
const itemResponseHandler = (item) => {
|
|
144
145
|
return {
|
|
145
146
|
...item,
|
|
147
|
+
name: item.name.commonName,
|
|
146
148
|
labels: item.labels ? [...item.labels.data] : [],
|
|
147
149
|
managers: item.managers ? [...item.managers.data] : [],
|
|
148
150
|
timezones: item.timezones ? [...item.timezones.data] : [],
|
|
@@ -178,8 +180,17 @@ const sanitizeTimezones = (itemInstance) => {
|
|
|
178
180
|
return { ...itemInstance, timezones };
|
|
179
181
|
};
|
|
180
182
|
|
|
183
|
+
const preRequestHandler = (item) => {
|
|
184
|
+
const copy = deepCopy(item);
|
|
185
|
+
copy.name = {
|
|
186
|
+
commonName: copy.name,
|
|
187
|
+
};
|
|
188
|
+
return copy;
|
|
189
|
+
};
|
|
190
|
+
|
|
181
191
|
const add = async ({ itemInstance }) => {
|
|
182
192
|
const item = applyTransform(itemInstance, [
|
|
193
|
+
preRequestHandler,
|
|
183
194
|
sanitizeManagers,
|
|
184
195
|
sanitizeTimezones,
|
|
185
196
|
sanitize(fieldsToSend),
|
|
@@ -196,6 +207,7 @@ const add = async ({ itemInstance }) => {
|
|
|
196
207
|
const update = async ({ itemInstance }) => {
|
|
197
208
|
const { etag } = itemInstance;
|
|
198
209
|
const item = applyTransform(itemInstance, [
|
|
210
|
+
preRequestHandler,
|
|
199
211
|
sanitizeManagers,
|
|
200
212
|
sanitizeTimezones,
|
|
201
213
|
sanitize(fieldsToSend),
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
const CrmConfigurationSections = Object.freeze({
|
|
2
|
+
LOOKUPS: 'lookups',
|
|
3
|
+
SLA: 'sla',
|
|
4
|
+
SERVICE_CATALOG: 'service-catalog',
|
|
5
|
+
PRIORITIES: 'priorities',
|
|
6
|
+
STATUSES: 'statuses',
|
|
7
|
+
CLOSURE_REASONS: 'closure-reasons',
|
|
8
|
+
CONTACT_GROUPS: 'contact-groups',
|
|
9
|
+
CASE_SOURCES: 'case-sources',
|
|
10
|
+
CUSTOM_LOOKUPS: 'custom-lookups',
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
export default CrmConfigurationSections;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
const WebitelApplications = Object.freeze({
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
ADMIN: 'admin',
|
|
3
|
+
AGENT: 'agent',
|
|
4
|
+
SUPERVISOR: 'supervisor',
|
|
5
|
+
HISTORY: 'history',
|
|
6
|
+
AUDIT: 'audit',
|
|
7
|
+
ANALYTICS: 'grafana',
|
|
8
|
+
CRM: 'crm',
|
|
9
9
|
});
|
|
10
10
|
|
|
11
11
|
export default WebitelApplications;
|