@webitel/ui-sdk 0.9.32 → 0.9.36

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": "0.9.32",
3
+ "version": "0.9.36",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve-lib": "vue-cli-service serve",
@@ -40,7 +40,8 @@
40
40
  "vue-multiselect": "^2.1.6",
41
41
  "vue-observe-visibility": "^1.0.0",
42
42
  "vue-router": "^3.2.0",
43
- "vuejs-datepicker": "^1.6.2"
43
+ "vuejs-datepicker": "^1.6.2",
44
+ "webitel-sdk": "^0.1.84"
44
45
  },
45
46
  "devDependencies": {
46
47
  "@testing-library/jest-dom": "^5.11.4",
@@ -8,10 +8,11 @@
8
8
  v-for="(option, index) in options"
9
9
  :key="index"
10
10
  >
11
+ <!-- <a> click.prevent prevents redirect to # -->
11
12
  <a
12
13
  class="wt-context-menu__option"
13
14
  href="#"
14
- @click="$emit('click', { option, index })"
15
+ @click.prevent="$emit('click', { option, index })"
15
16
  >
16
17
  {{ option.text || option }}
17
18
  </a>
@@ -40,6 +41,7 @@ export default {
40
41
  .wt-context-menu {
41
42
  @extend %typo-body-sm;
42
43
  min-width: var(--context-menu-min-width);
44
+ max-width: var(--context-menu-max-width);
43
45
  background-color: var(--context-menu-background-color);
44
46
  border-radius: var(--border-radius);
45
47
  box-shadow: var(--box-shadow);
@@ -22,7 +22,6 @@
22
22
  :class="{'wt-button-select__select-arrow--active': isOpened}"
23
23
  v-bind="$attrs"
24
24
  icon="arrow-down"
25
- size="sm"
26
25
  ></wt-icon>
27
26
  </wt-button>
28
27
 
@@ -60,7 +59,7 @@ export default {
60
59
 
61
60
  .wt-context-menu {
62
61
  position: absolute;
63
- top: 100%;
62
+ top: calc(100% + 1px);
64
63
  left: 0;
65
64
  }
66
65
  }
@@ -1,8 +1,10 @@
1
1
  .wt-context-menu {
2
+ --context-menu-min-width : 160px;
3
+ --context-menu-max-width : 300px;
4
+
2
5
  --context-menu-option-color--hover: var(--secondary-color);
3
6
 
4
7
  --context-menu-background-color: var(--main-color);
5
8
 
6
9
  --context-menu-option-padding: var(--spacing--sm);
7
- --context-menu-min-width : 150px;
8
10
  }
@@ -4,7 +4,7 @@
4
4
  Reduce 1px from "spacing--md" for align a difference between arrow size in "wt-button-select__select"
5
5
  and line-height of text in "wt-button-select__button"
6
6
  */
7
- --button-select-icon-button-padding: calc(var(--spacing--md) - 1px);
7
+ --button-select-icon-button-padding: calc(var(--spacing--sm) - 1px);
8
8
 
9
9
  --button-select-buttons-gap: 1px;
10
10
 
@@ -1,3 +1,6 @@
1
+ import { AgentStatus, CallDirection } from 'webitel-sdk';
2
+ import { QueueType } from 'webitel-sdk/esm2015/enums';
3
+ import { snakeToCamel } from '../../scripts/caseConverters';
1
4
  import AdminSections from '../../enums/WebitelApplications/AdminSections.enum';
2
5
  import SupervisorSections from '../../enums/WebitelApplications/SupervisorSections.enum';
3
6
  import WebitelApplications from '../../enums/WebitelApplications/WebitelApplications.enum';
@@ -34,6 +37,32 @@ export default {
34
37
  supervisor: 'Supervisor | Supervisors',
35
38
  auditor: 'Auditor | Auditors',
36
39
  region: 'Region | Regions',
40
+ queue: {
41
+ type: {
42
+ [QueueType.INBOUND_QUEUE]: 'Inbound queue',
43
+ [QueueType.OFFLINE_QUEUE]: 'Offline queue',
44
+ [QueueType.OUTBOUND_IVR_QUEUE]: 'Outbound IVR queue',
45
+ [QueueType.PREDICTIVE_DIALER]: 'Predictive dialer',
46
+ [QueueType.PROGRESSIVE_DIALER]: 'Progressive dialer',
47
+ [QueueType.PREVIEW_DIALER]: 'Preview dialer',
48
+ [QueueType.CHAT_INBOUND_QUEUE]: 'Chat queue',
49
+ [QueueType.TASK_QUEUE]: 'Task queue',
50
+ },
51
+ },
52
+ agent: {
53
+ status: {
54
+ [AgentStatus.Online]: 'Online',
55
+ [AgentStatus.Pause]: 'Pause',
56
+ [AgentStatus.Offline]: 'Offline',
57
+ [snakeToCamel(AgentStatus.BreakOut)]: 'Break out',
58
+ },
59
+ },
60
+ },
61
+ calls: {
62
+ direction: {
63
+ [CallDirection.Inbound]: 'Inbound',
64
+ [CallDirection.Outbound]: 'Outbound',
65
+ },
37
66
  },
38
67
  // describes Webitel FRONTEND applications + their navs
39
68
  WebitelApplications: {
@@ -1,6 +1,9 @@
1
+ import { AgentStatus, CallDirection } from 'webitel-sdk';
2
+ import { QueueType } from 'webitel-sdk/esm2015/enums';
1
3
  import AdminSections from '../../enums/WebitelApplications/AdminSections.enum';
2
4
  import SupervisorSections from '../../enums/WebitelApplications/SupervisorSections.enum';
3
5
  import WebitelApplications from '../../enums/WebitelApplications/WebitelApplications.enum';
6
+ import { snakeToCamel } from '../../scripts/caseConverters';
4
7
 
5
8
  export default {
6
9
  // describes reusable buttons, actions, default titles, and other ui elements
@@ -34,6 +37,32 @@ export default {
34
37
  supervisor: 'Супервизор | Супервизоры',
35
38
  auditor: 'Аудитор | Аудиторы',
36
39
  region: 'Регион | Регионы',
40
+ queue: {
41
+ type: {
42
+ [QueueType.INBOUND_QUEUE]: 'Входящая очередь',
43
+ [QueueType.OFFLINE_QUEUE]: 'Оффлайн очередь',
44
+ [QueueType.OUTBOUND_IVR_QUEUE]: 'Исходящий IVR',
45
+ [QueueType.PREDICTIVE_DIALER]: 'Предиктивный обзвон',
46
+ [QueueType.PROGRESSIVE_DIALER]: 'Прогрессивный обзвон',
47
+ [QueueType.PREVIEW_DIALER]: 'Превью обзвон',
48
+ [QueueType.CHAT_INBOUND_QUEUE]: 'Очередь чатов',
49
+ [QueueType.TASK_QUEUE]: 'Очередь задач',
50
+ },
51
+ },
52
+ agent: {
53
+ status: {
54
+ [AgentStatus.Online]: 'Онлайн',
55
+ [AgentStatus.Pause]: 'Пауза',
56
+ [AgentStatus.Offline]: 'Оффлайн',
57
+ [snakeToCamel(AgentStatus.BreakOut)]: 'Принудительный перерыв',
58
+ },
59
+ },
60
+ },
61
+ calls: {
62
+ direction: {
63
+ [CallDirection.Inbound]: 'Входящий | Входящие',
64
+ [CallDirection.Outbound]: 'Исходящий | Исходящие',
65
+ },
37
66
  },
38
67
  // describes Webitel FRONTEND applications + their navs
39
68
  WebitelApplications: {
@@ -1,6 +1,9 @@
1
+ import { AgentStatus, CallDirection } from 'webitel-sdk';
2
+ import { QueueType } from 'webitel-sdk/esm2015/enums';
1
3
  import AdminSections from '../../enums/WebitelApplications/AdminSections.enum';
2
4
  import SupervisorSections from '../../enums/WebitelApplications/SupervisorSections.enum';
3
5
  import WebitelApplications from '../../enums/WebitelApplications/WebitelApplications.enum';
6
+ import { snakeToCamel } from '../../scripts/caseConverters';
4
7
 
5
8
  export default {
6
9
  // describes reusable buttons, actions, default titles, and other ui elements
@@ -34,6 +37,32 @@ export default {
34
37
  supervisor: 'Супервізор | Супервізори',
35
38
  auditor: 'Аудитор | Аудитори',
36
39
  region: 'Регіон | Регіони',
40
+ queue: {
41
+ type: {
42
+ [QueueType.INBOUND_QUEUE]: 'Вхідна черга',
43
+ [QueueType.OFFLINE_QUEUE]: 'Оффлайн черга',
44
+ [QueueType.OUTBOUND_IVR_QUEUE]: 'Вихідний IVR',
45
+ [QueueType.PREDICTIVE_DIALER]: 'Предиктивний обзвін',
46
+ [QueueType.PROGRESSIVE_DIALER]: 'Прогресивний обзвін',
47
+ [QueueType.PREVIEW_DIALER]: 'Прев\'ю обзвін',
48
+ [QueueType.CHAT_INBOUND_QUEUE]: 'Черга чатів',
49
+ [QueueType.TASK_QUEUE]: 'Черга задач',
50
+ },
51
+ },
52
+ agent: {
53
+ status: {
54
+ [AgentStatus.Online]: 'Онлайн',
55
+ [AgentStatus.Pause]: 'Пауза',
56
+ [AgentStatus.Offline]: 'Офлайн',
57
+ [snakeToCamel(AgentStatus.BreakOut)]: 'Примусова перерва',
58
+ },
59
+ },
60
+ },
61
+ calls: {
62
+ direction: {
63
+ [CallDirection.Inbound]: 'Вхідний | Вхідні',
64
+ [CallDirection.Outbound]: 'Вихідний | Вихідні',
65
+ },
37
66
  },
38
67
  // describes Webitel FRONTEND applications + their navs
39
68
  WebitelApplications: {
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <wt-select
3
3
  :value="filterSchema.value"
4
- :options="filterSchema.options"
4
+ :options="localizedOptions"
5
5
  :label="$t(filterSchema.locale.label)"
6
6
  :track-by="filterSchema.storedProp"
7
7
  :multiple="filterSchema.multiple"
@@ -45,10 +45,26 @@ describe('Enum filter mixin', () => {
45
45
  });
46
46
 
47
47
  it('Sets empty array value if $route query is empty', async () => {
48
- const wrapper = shallowMount(Component, {
48
+ shallowMount(Component, {
49
49
  localVue,
50
50
  router,
51
51
  });
52
52
  expect(setValue).not.toHaveBeenCalled();
53
53
  });
54
+
55
+ it('Attaches locales to options, if they have "locale" key', async () => {
56
+ const options = [{
57
+ locale: 'jest.locale',
58
+ }];
59
+ const expectedOptions = [{
60
+ locale: options[0].locale,
61
+ name: options[0].locale,
62
+ }];
63
+ const wrapper = shallowMount(Component, {
64
+ localVue,
65
+ router,
66
+ data: () => ({ options }),
67
+ });
68
+ expect(wrapper.vm.localizedOptions).toEqual(expectedOptions);
69
+ });
54
70
  });
@@ -4,7 +4,7 @@ export default {
4
4
  mixins: [baseFilterMixin],
5
5
  computed: {
6
6
  options() {
7
- return this.filterSchema.options;
7
+ return this.filterSchema?.options;
8
8
  },
9
9
  locale() {
10
10
  return this.filterSchema?.locale;
@@ -18,6 +18,13 @@ export default {
18
18
  closeOnSelect() {
19
19
  return this.filterSchema?.storedProp;
20
20
  },
21
+ localizedOptions() {
22
+ const optsHaveLocale = this.options.length && this.options[0].locale; // just check 1st el
23
+ if (optsHaveLocale) {
24
+ return this.options.map((opt) => ({ ...opt, name: this.$t(opt.locale) }));
25
+ }
26
+ return this.options;
27
+ },
21
28
  },
22
29
  methods: {
23
30
  restoreValue(value) {