@webitel/ui-sdk 3.2.51 → 3.2.53

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": "3.2.51",
3
+ "version": "3.2.53",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve-lib": "vue-cli-service serve",
@@ -0,0 +1,9 @@
1
+ const restore = (localStorageKey) => ({ query }) => {
2
+ if (!query) {
3
+ const value = localStorage.getItem(localStorageKey);
4
+ return value ? value.split(',') : null;
5
+ }
6
+ return query;
7
+ };
8
+
9
+ export default restore;
@@ -29,7 +29,11 @@ export default class FiltersStoreModule extends BaseStoreModule {
29
29
  };
30
30
 
31
31
  actions = {
32
- SET_FILTER: async (context, { filter, value }) => {
32
+ SET_FILTER: async (context, {
33
+ filter,
34
+ value,
35
+ source, // === restore, if this is filters restore call
36
+ }) => {
33
37
  const { multiple, defaultValue } = context.state[filter];
34
38
  let newValue = value;
35
39
  if (newValue) {
@@ -43,12 +47,12 @@ export default class FiltersStoreModule extends BaseStoreModule {
43
47
  });
44
48
  context.commit('SET_FILTER', { filter, value: newValue });
45
49
 
46
- if (filter !== 'page') {
47
- context.dispatch('SET_FILTER', {
48
- filter: 'page',
49
- value: 1,
50
- });
51
- }
50
+ if (source !== 'restore' && filter !== 'page') {
51
+ context.dispatch('SET_FILTER', {
52
+ filter: 'page',
53
+ value: 1,
54
+ });
55
+ }
52
56
 
53
57
  return context.dispatch('ON_FILTER_SET', { filter, value });
54
58
  },
@@ -96,7 +100,7 @@ export default class FiltersStoreModule extends BaseStoreModule {
96
100
  === 'sort') await context.dispatch('RESTORE_SORT', { value });
97
101
  else if (filter
98
102
  === 'fields') await context.dispatch('RESTORE_FIELDS', { value });
99
- await context.dispatch('SET_FILTER', ({ filter, value }));
103
+ await context.dispatch('SET_FILTER', ({ filter, value, source: 'restore' }));
100
104
  return true;
101
105
  }
102
106
  return false;
@@ -53,6 +53,13 @@ export default class TableStoreModule extends BaseStoreModule {
53
53
 
54
54
  actions = {
55
55
  LOAD_DATA_LIST: async (context, query) => {
56
+ /*
57
+ https://my.webitel.com/browse/WTEL-3560
58
+ preventively disable isNext to handle case when user is clicking
59
+ "next" faster than actual request is made
60
+ */
61
+ context.commit('SET_IS_NEXT', false);
62
+
56
63
  const params = context.getters.GET_LIST_PARAMS(query);
57
64
  try {
58
65
  context.commit('SET_LOADING', true);