@webitel/ui-sdk 24.12.21 → 24.12.23

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webitel/ui-sdk",
3
- "version": "24.12.21",
3
+ "version": "24.12.23",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "dev": "vite",
@@ -132,7 +132,7 @@
132
132
  "vue-multiselect": "^3.1.0",
133
133
  "vue-observe-visibility": "^2.0.0-alpha.1",
134
134
  "vue-router": "^4.4.5",
135
- "webitel-sdk": "^24.10.2",
135
+ "webitel-sdk": "^24.10.4",
136
136
  "xlsx": "^0.18.5"
137
137
  },
138
138
  "devDependencies": {
@@ -22,7 +22,8 @@ const getChatsList = async (params) => {
22
22
  const {
23
23
  size,
24
24
  page,
25
- onlyClosed
25
+ onlyClosed,
26
+ onlyUnprocessed,
26
27
  } = applyTransform(params, [
27
28
  merge(getDefaultGetParams()),
28
29
  ]);
@@ -35,6 +36,7 @@ const getChatsList = async (params) => {
35
36
  undefined,
36
37
  undefined,
37
38
  onlyClosed,
39
+ onlyUnprocessed,
38
40
  );
39
41
  const { items, next } = applyTransform(response.data, [
40
42
  snakeToCamel(),
@@ -1,3 +1,4 @@
1
+ import deepCopy from 'deep-copy';
1
2
  import FilterEvent from '../../../../modules/Filters/enums/FilterEvent.enum.js';
2
3
  import {
3
4
  queryToSortAdapter,
@@ -11,6 +12,7 @@ const state = () => ({
11
12
  error: {},
12
13
  isLoading: false,
13
14
  isNextPage: false,
15
+ _resettable: {},
14
16
  });
15
17
 
16
18
  const getters = {
@@ -199,6 +201,7 @@ const actions = {
199
201
  throw err;
200
202
  } finally {
201
203
  await context.dispatch('LOAD_DATA_LIST');
204
+ await context.dispatch('SET_SELECTED', []);
202
205
 
203
206
  /* if no items on current page after DELETE, move to prev page [WTEL-3793] */
204
207
  if (!context.state.dataList.length && context.getters.FILTERS.page > 1) {
@@ -234,10 +237,21 @@ const actions = {
234
237
  context,
235
238
  payload,
236
239
  ) => context.dispatch('api/DELETE_ITEM', payload),
240
+
241
+ RESET_TABLE_STATE: async (context) => {
242
+ context.commit('RESET_TABLE_STATE');
243
+ },
244
+ };
245
+
246
+ const mutations = {
247
+ RESET_TABLE_STATE: (state) => {
248
+ Object.assign(state, deepCopy(state._resettable));
249
+ },
237
250
  };
238
251
 
239
252
  export default () => ({
240
253
  state: state(),
241
254
  getters,
242
255
  actions,
256
+ mutations,
243
257
  });
@@ -46,6 +46,10 @@ export const useTableStore = (namespace) => {
46
46
  return store.dispatch(`${tableNamespace}/SET_SELECTED`, payload);
47
47
  }
48
48
 
49
+ function resetState(payload) {
50
+ return store.dispatch(`${tableNamespace}/RESET_TABLE_STATE`, payload);
51
+ }
52
+
49
53
  return {
50
54
  namespace: tableNamespace,
51
55
 
@@ -62,5 +66,6 @@ export const useTableStore = (namespace) => {
62
66
  deleteData,
63
67
  sort,
64
68
  setSelected,
69
+ resetState,
65
70
  };
66
71
  };