@webitel/ui-sdk 3.1.0-2 → 3.1.0

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.
Files changed (24) hide show
  1. package/dist/ui-sdk.common.js +1 -106
  2. package/dist/ui-sdk.common.js.map +1 -1
  3. package/dist/ui-sdk.umd.js +4 -109
  4. package/dist/ui-sdk.umd.js.map +1 -1
  5. package/dist/ui-sdk.umd.min.js +3 -3
  6. package/dist/ui-sdk.umd.min.js.map +1 -1
  7. package/package.json +1 -1
  8. package/src/components/index.js +0 -2
  9. package/src/components/organisms/wt-table/__tests__/WtTableDeleteAction.spec.js +9 -0
  10. package/src/components/organisms/wt-table/__tests__/WtTableEditAction.spec.js +9 -0
  11. package/src/components/organisms/{wt-icon-action/_internals/wt-delete-icon-action.vue → wt-table/table-cells/wt-table-delete-action.vue} +2 -2
  12. package/src/components/organisms/{wt-icon-action/_internals/wt-edit-icon-action.vue → wt-table/table-cells/wt-table-edit-action.vue} +2 -2
  13. package/src/locale/en/en.js +7 -7
  14. package/src/locale/es/es.js +265 -265
  15. package/src/locale/ru/ru.js +8 -9
  16. package/src/locale/ua/ua.js +8 -9
  17. package/src/modules/QueryFilters/mixins/_urlControllerMixin/_urlControllerMixin.js +2 -2
  18. package/src/store/BaseStoreModules/ApiStoreModule.js +6 -6
  19. package/src/store/BaseStoreModules/ObjectStoreModule.js +4 -0
  20. package/src/store/BaseStoreModules/TableStoreModule.js +3 -3
  21. package/src/components/organisms/wt-icon-action/__tests__/WtIconAction.spec.js +0 -9
  22. package/src/components/organisms/wt-icon-action/_internals/__tests__/WtDeleteIconAction.spec.js +0 -9
  23. package/src/components/organisms/wt-icon-action/_internals/__tests__/WtEditIconAction.spec.js +0 -9
  24. package/src/components/organisms/wt-icon-action/wt-icon-action.vue +0 -31
@@ -2,17 +2,14 @@ import {
2
2
  AgentStatus,
3
3
  CallDirection,
4
4
  ChannelState,
5
- ChannelType,
6
- EngineRoutingSchemaType,
5
+ ChannelType, EngineRoutingSchemaType,
7
6
  } from 'webitel-sdk';
8
7
  import { QueueType } from 'webitel-sdk/esm2015/enums';
9
8
  import AdminSections from '../../enums/WebitelApplications/AdminSections.enum';
9
+ import SupervisorSections from '../../enums/WebitelApplications/SupervisorSections.enum';
10
+ import WebitelApplications from '../../enums/WebitelApplications/WebitelApplications.enum';
10
11
  import AuditorSections
11
12
  from '../../enums/WebitelApplications/AuditorSections.enum';
12
- import SupervisorSections
13
- from '../../enums/WebitelApplications/SupervisorSections.enum';
14
- import WebitelApplications
15
- from '../../enums/WebitelApplications/WebitelApplications.enum';
16
13
  import { snakeToCamel } from '../../scripts/caseConverters';
17
14
 
18
15
  export default {
@@ -261,9 +258,11 @@ export default {
261
258
  offline: 'Оффлайн',
262
259
  breakOut: 'Принудительный перерыв',
263
260
  },
264
- iconAction: {
265
- deleteActionHint: 'Удалить',
266
- editActionHint: 'Редактировать',
261
+ table: {
262
+ tableCells: {
263
+ deleteActionHint: 'Удалить',
264
+ editActionHint: 'Редактировать',
265
+ },
267
266
  },
268
267
  errorPages: {
269
268
  goBack: 'Вернуться назад',
@@ -2,17 +2,14 @@ import {
2
2
  AgentStatus,
3
3
  CallDirection,
4
4
  ChannelState,
5
- ChannelType,
6
- EngineRoutingSchemaType,
5
+ ChannelType, EngineRoutingSchemaType,
7
6
  } from 'webitel-sdk';
8
7
  import { QueueType } from 'webitel-sdk/esm2015/enums';
9
8
  import AdminSections from '../../enums/WebitelApplications/AdminSections.enum';
9
+ import SupervisorSections from '../../enums/WebitelApplications/SupervisorSections.enum';
10
+ import WebitelApplications from '../../enums/WebitelApplications/WebitelApplications.enum';
10
11
  import AuditorSections
11
12
  from '../../enums/WebitelApplications/AuditorSections.enum';
12
- import SupervisorSections
13
- from '../../enums/WebitelApplications/SupervisorSections.enum';
14
- import WebitelApplications
15
- from '../../enums/WebitelApplications/WebitelApplications.enum';
16
13
  import { snakeToCamel } from '../../scripts/caseConverters';
17
14
 
18
15
  export default {
@@ -261,9 +258,11 @@ export default {
261
258
  offline: 'Оффлайн',
262
259
  breakOut: 'Примусова перерва',
263
260
  },
264
- iconAction: {
265
- deleteActionHint: 'Видалити',
266
- editActionHint: 'Редагувати',
261
+ table: {
262
+ tableCells: {
263
+ deleteActionHint: 'Видалити',
264
+ editActionHint: 'Редагувати',
265
+ },
267
266
  },
268
267
  errorPages: {
269
268
  goBack: 'Повернутись назад',
@@ -11,7 +11,7 @@ export default {
11
11
  });
12
12
  },
13
13
 
14
- async setValueToQuery({ filterQuery, value, storedProp = 'id' }) {
14
+ setValueToQuery({ filterQuery, value, storedProp = 'id' }) {
15
15
  let newValue = '';
16
16
  if (Array.isArray(value)) {
17
17
  if (value.length && typeof value[0] !== 'object') {
@@ -25,7 +25,7 @@ export default {
25
25
  newValue = value;
26
26
  }
27
27
  if (!deepEqual(this.$route.query[filterQuery], newValue)) {
28
- await this.changeRouteQuery({
28
+ this.changeRouteQuery({
29
29
  value: newValue,
30
30
  filterQuery,
31
31
  });
@@ -8,22 +8,22 @@ export default class ApiStoreModule extends BaseStoreModule {
8
8
  .GET_LIST = (
9
9
  context,
10
10
  params = {},
11
- ) => api.getList({ ...context.state, ...params });
11
+ ) => this.api.getList({ ...context.state, ...params });
12
12
  this.actions
13
13
  .GET_ITEM = (
14
14
  context,
15
15
  params = {},
16
- ) => api.get({ ...context.state, ...params });
16
+ ) => this.api.get({ ...context.state, ...params });
17
17
  this.actions
18
- .POST_ITEM = (context) => api.add(context.state);
18
+ .POST_ITEM = (context) => this.api.add(context.state);
19
19
  this.actions
20
20
  .PATCH_ITEM = (context, { id, changes }) => (
21
- api.patch({ ...context.state, id, changes })
21
+ this.api.patch({ ...context.state, id, changes })
22
22
  );
23
23
  this.actions
24
- .UPD_ITEM = (context) => api.update(context.state);
24
+ .UPD_ITEM = (context) => this.api.update(context.state);
25
25
  this.actions
26
- .DELETE_ITEM = (context, id) => api.delete({ ...context.state, id });
26
+ .DELETE_ITEM = (context, id) => this.api.delete({ ...context.state, id });
27
27
  return this;
28
28
  }
29
29
  }
@@ -0,0 +1,4 @@
1
+ import BaseStoreModule from '@webitel/ui-sdk/src/store/BaseStoreModules/BaseStoreModule';
2
+
3
+ export default class ObjectStoreModule extends BaseStoreModule {
4
+ }
@@ -27,7 +27,7 @@ export default class TableStoreModule extends BaseStoreModule {
27
27
  let {
28
28
  items = [],
29
29
  next = false,
30
- } = await context.dispatch('api/GET_LIST', query);
30
+ } = await context.dispatch('GET_LIST', query);
31
31
  /* we should set _isSelected property to all items in tables cause their checkbox selection
32
32
  * is based on this property. Previously, this prop was set it api consumers, but now
33
33
  * admin-specific were replaced by webitel-sdk consumers and i supposed it will be
@@ -100,7 +100,7 @@ export default class TableStoreModule extends BaseStoreModule {
100
100
  const id = item?.id || context.state.dataList[index].id;
101
101
  const changes = { [prop]: value };
102
102
  try {
103
- await context.dispatch('api/PATCH_ITEM', { id, changes });
103
+ await context.dispatch('PATCH_ITEM', { id, changes });
104
104
  context.commit('PATCH_ITEM_PROPERTY', {
105
105
  item, index, prop, value,
106
106
  });
@@ -124,7 +124,7 @@ export default class TableStoreModule extends BaseStoreModule {
124
124
  },
125
125
  DELETE_SINGLE: async (context, { id }) => {
126
126
  try {
127
- await context.dispatch('api/DELETE_ITEM', id);
127
+ await context.dispatch('DELETE_ITEM', id);
128
128
  } catch (err) {
129
129
  throw err;
130
130
  }
@@ -1,9 +0,0 @@
1
- import { shallowMount } from '@vue/test-utils';
2
- import WtIconAction from '../wt-icon-action.vue';
3
-
4
- describe('WtIconAction', () => {
5
- it('renders a component', () => {
6
- const wrapper = shallowMount(WtIconAction, { props: { action: 'edit' } });
7
- expect(wrapper.isVisible()).toBe(true);
8
- });
9
- });
@@ -1,9 +0,0 @@
1
- import { shallowMount } from '@vue/test-utils';
2
- import WtDeleteIconAction from '../wt-delete-icon-action.vue';
3
-
4
- describe('WtDeleteIconAction', () => {
5
- it('renders a component', () => {
6
- const wrapper = shallowMount(WtDeleteIconAction);
7
- expect(wrapper.exists()).toBe(true);
8
- });
9
- });
@@ -1,9 +0,0 @@
1
- import { shallowMount } from '@vue/test-utils';
2
- import WtEditIconAction from '../wt-edit-icon-action.vue';
3
-
4
- describe('WtEditIconAction', () => {
5
- it('renders a component', () => {
6
- const wrapper = shallowMount(WtEditIconAction);
7
- expect(wrapper.exists()).toBe(true);
8
- });
9
- });
@@ -1,31 +0,0 @@
1
- <template>
2
- <component
3
- :is="actionComponent"
4
- ></component>
5
- </template>
6
-
7
- <script setup>
8
- import { computed } from 'vue';
9
- import WtDeleteIconAction from './_internals/wt-delete-icon-action.vue';
10
- import WtEditIconAction from './_internals/wt-edit-icon-action.vue';
11
-
12
- const props = defineProps({
13
- action: {
14
- type: String,
15
- required: true,
16
- options: ['delete', 'edit'],
17
- },
18
- });
19
-
20
- const actionComponent = computed(() => {
21
- switch (props.action) {
22
- case 'edit': return WtEditIconAction;
23
- case 'delete': return WtDeleteIconAction;
24
- default: return WtEditIconAction;
25
- }
26
- });
27
- </script>
28
-
29
- <style lang="scss" scoped>
30
-
31
- </style>