@webitel/ui-sdk 24.6.30 → 24.6.31
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/dist/ui-sdk.css +1 -1
- package/dist/ui-sdk.js +31 -31
- package/dist/ui-sdk.umd.cjs +6 -6
- package/package.json +1 -1
- package/src/api/clients/users/__tests__/users.spec.js +88 -42
- package/src/components/wt-app-header/wt-app-navigator.vue +1 -1
- package/src/components/wt-app-header/wt-header-actions.vue +1 -1
- package/src/components/wt-button/wt-button.vue +1 -1
- package/src/components/wt-checkbox/wt-checkbox.vue +1 -1
- package/src/components/wt-chip/wt-chip.scss +1 -2
- package/src/components/wt-context-menu/wt-context-menu.vue +1 -1
- package/src/components/wt-datepicker/wt-datepicker.vue +1 -1
- package/src/components/wt-dummy/wt-dummy.vue +1 -1
- package/src/components/wt-expansion-panel/wt-expansion-panel.vue +1 -1
- package/src/components/wt-headline/wt-headline.vue +1 -1
- package/src/components/wt-headline-nav/wt-headline-nav.vue +1 -1
- package/src/components/wt-indicator/wt-indicator.vue +1 -1
- package/src/components/wt-input/wt-input.vue +1 -1
- package/src/components/wt-input-info/wt-input-info.vue +1 -1
- package/src/components/wt-label/wt-label.vue +1 -1
- package/src/components/wt-navigation-bar/wt-navigation-bar.vue +1 -1
- package/src/components/wt-notification/wt-notification.vue +3 -3
- package/src/components/wt-notifications-bar/wt-notifications-bar.vue +1 -1
- package/src/components/wt-pagination/wt-pagination.vue +1 -1
- package/src/components/wt-player/wt-player.vue +1 -1
- package/src/components/wt-popup/wt-popup.vue +1 -1
- package/src/components/wt-radio/wt-radio.vue +1 -1
- package/src/components/wt-search-bar/wt-search-bar.vue +1 -1
- package/src/components/wt-select/_multiselect.scss +1 -2
- package/src/components/wt-switcher/wt-switcher.vue +1 -1
- package/src/components/wt-table/wt-table.vue +1 -1
- package/src/components/wt-table-column-select/wt-table-column-select.vue +1 -1
- package/src/components/wt-tabs/wt-tabs.vue +1 -1
- package/src/components/wt-textarea/wt-textarea.vue +1 -1
- package/src/components/wt-time-input/wt-time-input.vue +1 -1
- package/src/components/wt-tooltip/wt-tooltip.vue +1 -1
- package/src/css/main.scss +0 -1
- package/src/enums/QueueType/QueueType.enum.js +1 -1
- package/src/locale/en/en.js +2 -1
- package/src/locale/es/es.js +2 -1
- package/src/locale/kz/kz.js +2 -1
- package/src/locale/ru/ru.js +2 -1
- package/src/locale/ua/ua.js +2 -1
- package/src/modules/CardStoreModule/store/CardStoreModule.js +2 -1
- package/src/modules/Filters/store/FiltersStoreModule.js +1 -1
- package/src/modules/TableStoreModule/store/TableStoreModule.js +14 -8
- package/src/modules/TableStoreModule/store/__tests__/TableStoreModule.spec.js +2 -2
package/package.json
CHANGED
|
@@ -1,39 +1,31 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
default: {
|
|
9
|
-
post: vi.fn(),
|
|
10
|
-
get: vi.fn(),
|
|
11
|
-
delete: vi.fn(),
|
|
12
|
-
put: vi.fn(),
|
|
13
|
-
patch: vi.fn(),
|
|
14
|
-
create: vi.fn().mockReturnThis(),
|
|
15
|
-
interceptors: {
|
|
16
|
-
request: {
|
|
17
|
-
use: vi.fn(), eject: vi.fn(),
|
|
18
|
-
}, response: {
|
|
19
|
-
use: vi.fn(), eject: vi.fn(),
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
};
|
|
24
|
-
});
|
|
1
|
+
import axiosMock from '../../../../tests/mocks/axiosMock.js';
|
|
2
|
+
|
|
3
|
+
const instanceMock = axiosMock()().default;
|
|
4
|
+
|
|
5
|
+
vi.doMock('../../../defaults/getDefaultInstance/getDefaultInstance.js', () => ({
|
|
6
|
+
default: () => instanceMock,
|
|
7
|
+
}));
|
|
25
8
|
|
|
26
9
|
describe('UsersAPI', () => {
|
|
10
|
+
beforeEach(() => {
|
|
11
|
+
Object.assign(instanceMock, axiosMock()().default);
|
|
12
|
+
});
|
|
13
|
+
|
|
27
14
|
it('correctly computes "getList" method api call', async () => {
|
|
15
|
+
const get = vi.fn(() => Promise.resolve({
|
|
16
|
+
data: {},
|
|
17
|
+
}));
|
|
18
|
+
|
|
19
|
+
instanceMock.get = get;
|
|
20
|
+
|
|
21
|
+
const UsersAPI = (await import('../users.js')).default;
|
|
22
|
+
|
|
28
23
|
const inputParams = {
|
|
29
24
|
fields: ['id', 'name', 'vitest'],
|
|
30
25
|
};
|
|
31
26
|
const url = '/users?fields=id&fields=name&fields=vitest&page=1&size=10';
|
|
32
|
-
const mock = axios.get.mockImplementationOnce(() => Promise.resolve({
|
|
33
|
-
data: {},
|
|
34
|
-
}));
|
|
35
27
|
await UsersAPI.getList(inputParams);
|
|
36
|
-
expect(
|
|
28
|
+
expect(get).toHaveBeenCalledWith(url);
|
|
37
29
|
});
|
|
38
30
|
|
|
39
31
|
it('correctly computes "getList" method output', async () => {
|
|
@@ -57,7 +49,13 @@ describe('UsersAPI', () => {
|
|
|
57
49
|
], next: true,
|
|
58
50
|
},
|
|
59
51
|
};
|
|
60
|
-
|
|
52
|
+
|
|
53
|
+
const get = vi.fn(() => Promise.resolve(response));
|
|
54
|
+
|
|
55
|
+
instanceMock.get = get;
|
|
56
|
+
|
|
57
|
+
const UsersAPI = (await import('../users.js')).default;
|
|
58
|
+
|
|
61
59
|
expect(await UsersAPI.getList({})).toEqual(output);
|
|
62
60
|
});
|
|
63
61
|
|
|
@@ -66,11 +64,17 @@ describe('UsersAPI', () => {
|
|
|
66
64
|
itemId: 1,
|
|
67
65
|
};
|
|
68
66
|
const url = '/users/1';
|
|
69
|
-
|
|
67
|
+
|
|
68
|
+
const get = vi.fn(() => Promise.resolve({
|
|
70
69
|
data: {},
|
|
71
70
|
}));
|
|
71
|
+
|
|
72
|
+
instanceMock.get = get;
|
|
73
|
+
|
|
74
|
+
const UsersAPI = (await import('../users.js')).default;
|
|
75
|
+
|
|
72
76
|
await UsersAPI.get(inputParams);
|
|
73
|
-
expect(
|
|
77
|
+
expect(get).toHaveBeenCalledWith(url);
|
|
74
78
|
});
|
|
75
79
|
|
|
76
80
|
it('correctly computes "get" method output', async () => {
|
|
@@ -87,7 +91,13 @@ describe('UsersAPI', () => {
|
|
|
87
91
|
id: 1,
|
|
88
92
|
},
|
|
89
93
|
};
|
|
90
|
-
|
|
94
|
+
|
|
95
|
+
const get = vi.fn(() => Promise.resolve(response));
|
|
96
|
+
|
|
97
|
+
instanceMock.get = get;
|
|
98
|
+
|
|
99
|
+
const UsersAPI = (await import('../users.js')).default;
|
|
100
|
+
|
|
91
101
|
expect(await UsersAPI.get({})).toEqual(output);
|
|
92
102
|
});
|
|
93
103
|
|
|
@@ -104,11 +114,17 @@ describe('UsersAPI', () => {
|
|
|
104
114
|
};
|
|
105
115
|
|
|
106
116
|
const url = '/users';
|
|
107
|
-
|
|
117
|
+
|
|
118
|
+
const post = vi.fn(() => Promise.resolve({
|
|
108
119
|
data: {},
|
|
109
120
|
}));
|
|
121
|
+
|
|
122
|
+
instanceMock.post = post;
|
|
123
|
+
|
|
124
|
+
const UsersAPI = (await import('../users.js')).default;
|
|
125
|
+
|
|
110
126
|
await UsersAPI.add(input);
|
|
111
|
-
expect(
|
|
127
|
+
expect(post).toHaveBeenCalledWith(url, body);
|
|
112
128
|
});
|
|
113
129
|
|
|
114
130
|
it('correctly computes "add" method output', async () => {
|
|
@@ -123,7 +139,13 @@ describe('UsersAPI', () => {
|
|
|
123
139
|
check_case: '',
|
|
124
140
|
},
|
|
125
141
|
};
|
|
126
|
-
|
|
142
|
+
|
|
143
|
+
const post = vi.fn(() => Promise.resolve(response));
|
|
144
|
+
|
|
145
|
+
instanceMock.post = post;
|
|
146
|
+
|
|
147
|
+
const UsersAPI = (await import('../users.js')).default;
|
|
148
|
+
|
|
127
149
|
expect(await UsersAPI.add({ itemInstance: {} })).toEqual(output);
|
|
128
150
|
});
|
|
129
151
|
|
|
@@ -141,11 +163,17 @@ describe('UsersAPI', () => {
|
|
|
141
163
|
};
|
|
142
164
|
|
|
143
165
|
const url = '/users/1';
|
|
144
|
-
|
|
166
|
+
|
|
167
|
+
const put = vi.fn(() => Promise.resolve({
|
|
145
168
|
data: {},
|
|
146
169
|
}));
|
|
170
|
+
|
|
171
|
+
instanceMock.put = put;
|
|
172
|
+
|
|
173
|
+
const UsersAPI = (await import('../users.js')).default;
|
|
174
|
+
|
|
147
175
|
await UsersAPI.update(input);
|
|
148
|
-
expect(
|
|
176
|
+
expect(put).toHaveBeenCalledWith(url, body);
|
|
149
177
|
});
|
|
150
178
|
|
|
151
179
|
it('correctly computes "update" method output', async () => {
|
|
@@ -160,7 +188,13 @@ describe('UsersAPI', () => {
|
|
|
160
188
|
check_case: '',
|
|
161
189
|
},
|
|
162
190
|
};
|
|
163
|
-
|
|
191
|
+
|
|
192
|
+
const put = vi.fn(() => Promise.resolve(response));
|
|
193
|
+
|
|
194
|
+
instanceMock.put = put;
|
|
195
|
+
|
|
196
|
+
const UsersAPI = (await import('../users.js')).default;
|
|
197
|
+
|
|
164
198
|
expect(await UsersAPI.update({ itemInstance: {}, itemId: 1 }))
|
|
165
199
|
.toEqual(output);
|
|
166
200
|
});
|
|
@@ -178,11 +212,17 @@ describe('UsersAPI', () => {
|
|
|
178
212
|
};
|
|
179
213
|
|
|
180
214
|
const url = '/users/1';
|
|
181
|
-
|
|
215
|
+
|
|
216
|
+
const patch = vi.fn(() => Promise.resolve({
|
|
182
217
|
data: {},
|
|
183
218
|
}));
|
|
219
|
+
|
|
220
|
+
instanceMock.patch = patch;
|
|
221
|
+
|
|
222
|
+
const UsersAPI = (await import('../users.js')).default;
|
|
223
|
+
|
|
184
224
|
await UsersAPI.patch(input);
|
|
185
|
-
expect(
|
|
225
|
+
expect(patch).toHaveBeenCalledWith(url, body);
|
|
186
226
|
});
|
|
187
227
|
|
|
188
228
|
it('correctly computes "delete" method api call', async () => {
|
|
@@ -191,10 +231,16 @@ describe('UsersAPI', () => {
|
|
|
191
231
|
};
|
|
192
232
|
|
|
193
233
|
const url = '/users/1?permanent=true';
|
|
194
|
-
|
|
234
|
+
|
|
235
|
+
const _delete = vi.fn(() => Promise.resolve({
|
|
195
236
|
data: {},
|
|
196
237
|
}));
|
|
238
|
+
|
|
239
|
+
instanceMock.delete = _delete;
|
|
240
|
+
|
|
241
|
+
const UsersAPI = (await import('../users.js')).default;
|
|
242
|
+
|
|
197
243
|
await UsersAPI.delete(input);
|
|
198
|
-
expect(
|
|
244
|
+
expect(_delete).toHaveBeenCalledWith(url);
|
|
199
245
|
});
|
|
200
246
|
});
|
|
@@ -55,15 +55,15 @@ export default {
|
|
|
55
55
|
</style>
|
|
56
56
|
|
|
57
57
|
<style lang="scss" scoped>
|
|
58
|
-
@import 'src/css/main.scss';
|
|
58
|
+
@import '../../../src/css/main.scss';
|
|
59
59
|
|
|
60
60
|
.wt-notification {
|
|
61
61
|
@extend %typo-body-1;
|
|
62
|
-
width: fit-content;
|
|
63
|
-
|
|
64
62
|
position: relative;
|
|
63
|
+
|
|
65
64
|
display: flex;
|
|
66
65
|
align-items: flex-start;
|
|
66
|
+
width: fit-content;
|
|
67
67
|
min-width: var(--wt-notification-min-width);
|
|
68
68
|
max-width: var(--wt-notification-max-width);
|
|
69
69
|
padding: var(--wt-notification-padding);
|
|
@@ -130,7 +130,7 @@ export default {
|
|
|
130
130
|
</script>
|
|
131
131
|
|
|
132
132
|
<style lang="scss" scoped>
|
|
133
|
-
@import 'src/css/main.scss';
|
|
133
|
+
@import '../../../src/css/main.scss';
|
|
134
134
|
|
|
135
135
|
$list-height: 400px;
|
|
136
136
|
$list-width-sm: calc(500px - var(--spacing-xl)); // all popup width - (paddings + overflow-padding)
|
package/src/css/main.scss
CHANGED
package/src/locale/en/en.js
CHANGED
|
@@ -6,7 +6,8 @@ import {
|
|
|
6
6
|
EngineRoutingSchemaType,
|
|
7
7
|
} from 'webitel-sdk';
|
|
8
8
|
import QueueType from '../../enums/QueueType/QueueType.enum.js';
|
|
9
|
-
import AdminSections
|
|
9
|
+
import AdminSections
|
|
10
|
+
from '../../enums/WebitelApplications/AdminSections.enum.js';
|
|
10
11
|
import AuditorSections
|
|
11
12
|
from '../../enums/WebitelApplications/AuditorSections.enum.js';
|
|
12
13
|
import CrmSections from '../../enums/WebitelApplications/CrmSections.enum.js';
|
package/src/locale/es/es.js
CHANGED
|
@@ -6,7 +6,8 @@ import {
|
|
|
6
6
|
EngineRoutingSchemaType,
|
|
7
7
|
} from 'webitel-sdk';
|
|
8
8
|
import QueueType from '../../enums/QueueType/QueueType.enum.js';
|
|
9
|
-
import AdminSections
|
|
9
|
+
import AdminSections
|
|
10
|
+
from '../../enums/WebitelApplications/AdminSections.enum.js';
|
|
10
11
|
import AuditorSections
|
|
11
12
|
from '../../enums/WebitelApplications/AuditorSections.enum.js';
|
|
12
13
|
import SupervisorSections
|
package/src/locale/kz/kz.js
CHANGED
|
@@ -6,7 +6,8 @@ import {
|
|
|
6
6
|
EngineRoutingSchemaType,
|
|
7
7
|
} from 'webitel-sdk';
|
|
8
8
|
import QueueType from '../../enums/QueueType/QueueType.enum.js';
|
|
9
|
-
import AdminSections
|
|
9
|
+
import AdminSections
|
|
10
|
+
from '../../enums/WebitelApplications/AdminSections.enum.js';
|
|
10
11
|
import CrmSections from '../../enums/WebitelApplications/CrmSections.enum.js';
|
|
11
12
|
import SupervisorSections
|
|
12
13
|
from '../../enums/WebitelApplications/SupervisorSections.enum.js';
|
package/src/locale/ru/ru.js
CHANGED
|
@@ -6,7 +6,8 @@ import {
|
|
|
6
6
|
EngineRoutingSchemaType,
|
|
7
7
|
} from 'webitel-sdk';
|
|
8
8
|
import QueueType from '../../enums/QueueType/QueueType.enum.js';
|
|
9
|
-
import AdminSections
|
|
9
|
+
import AdminSections
|
|
10
|
+
from '../../enums/WebitelApplications/AdminSections.enum.js';
|
|
10
11
|
import AuditorSections
|
|
11
12
|
from '../../enums/WebitelApplications/AuditorSections.enum.js';
|
|
12
13
|
import CrmSections from '../../enums/WebitelApplications/CrmSections.enum.js';
|
package/src/locale/ua/ua.js
CHANGED
|
@@ -6,7 +6,8 @@ import {
|
|
|
6
6
|
EngineRoutingSchemaType,
|
|
7
7
|
} from 'webitel-sdk';
|
|
8
8
|
import QueueType from '../../enums/QueueType/QueueType.enum.js';
|
|
9
|
-
import AdminSections
|
|
9
|
+
import AdminSections
|
|
10
|
+
from '../../enums/WebitelApplications/AdminSections.enum.js';
|
|
10
11
|
import AuditorSections
|
|
11
12
|
from '../../enums/WebitelApplications/AuditorSections.enum.js';
|
|
12
13
|
import CrmSections from '../../enums/WebitelApplications/CrmSections.enum.js';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import deepCopy from 'deep-copy';
|
|
2
2
|
import set from 'lodash/set.js';
|
|
3
|
-
import BaseStoreModule
|
|
3
|
+
import BaseStoreModule
|
|
4
|
+
from '../../../store/BaseStoreModules/BaseStoreModule.js';
|
|
4
5
|
|
|
5
6
|
export default class CardStoreModule extends BaseStoreModule {
|
|
6
7
|
state = {
|