@webitel/ui-sdk 24.10.10 → 24.10.12

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.10.10",
3
+ "version": "24.10.12",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "dev": "vite",
@@ -18,6 +18,7 @@ const AdminSections = Object.freeze({
18
18
  COMMUNICATIONS: 'communications', // scope: lookups
19
19
  PAUSE_CAUSE: 'pause-cause', // scope: lookups
20
20
  MEDIA: 'media', // scope: media_file
21
+ SHIFT_TEMPLATES: 'shift-templates', // scope: shift_templates
21
22
 
22
23
  // CONTACT CENTER
23
24
  SKILLS: 'skills', // scope: lookups
@@ -223,6 +223,7 @@ export default {
223
223
  [AdminSections.SKILLS]: 'Agent skills',
224
224
  [AdminSections.BUCKETS]: 'Buckets',
225
225
  [AdminSections.MEDIA]: 'Media files',
226
+ [AdminSections.SHIFT_TEMPLATES]: 'Shift templates',
226
227
  [AdminSections.BLACKLIST]: 'Lists',
227
228
  [AdminSections.CALENDARS]: 'Calendars',
228
229
  [AdminSections.REGIONS]: 'Locations',
@@ -222,6 +222,7 @@ export default {
222
222
  [AdminSections.SKILLS]: 'Навыки оператора',
223
223
  [AdminSections.BUCKETS]: 'Корзины',
224
224
  [AdminSections.MEDIA]: 'Медиафайлы',
225
+ [AdminSections.SHIFT_TEMPLATES]: 'Шаблон смен',
225
226
  [AdminSections.BLACKLIST]: 'Cписки',
226
227
  [AdminSections.CALENDARS]: 'Календари',
227
228
  [AdminSections.COMMUNICATIONS]: 'Типы связи',
@@ -222,6 +222,7 @@ export default {
222
222
  [AdminSections.SKILLS]: 'Навички оператора',
223
223
  [AdminSections.BUCKETS]: 'Кошики',
224
224
  [AdminSections.MEDIA]: 'Медіафайли',
225
+ [AdminSections.SHIFT_TEMPLATES]: 'Шаблон змін',
225
226
  [AdminSections.BLACKLIST]: 'Cписки',
226
227
  [AdminSections.CALENDARS]: 'Календарі',
227
228
  [AdminSections.REGIONS]: 'Розташування',
@@ -0,0 +1,23 @@
1
+ function triggerSound(soundVolume = 1.0, soundDuration = 0.2) {
2
+ // Initialize the AudioContext if it hasn't been created yet
3
+ let audioContext;
4
+ if (!audioContext) {
5
+ audioContext = new (window.AudioContext || window.webkitAudioContext)();
6
+ }
7
+
8
+ const oscillator = audioContext.createOscillator();
9
+
10
+ oscillator.frequency.setValueAtTime(440, audioContext.currentTime); // Standard A4 note
11
+
12
+ const gainNode = audioContext.createGain();
13
+ gainNode.gain.value = soundVolume; // Set the ringtoneVolume based on the selected value
14
+
15
+ oscillator.connect(gainNode);
16
+ gainNode.connect(audioContext.destination);
17
+
18
+ oscillator.start();
19
+
20
+ oscillator.stop(audioContext.currentTime + soundDuration);
21
+ }
22
+
23
+ export default triggerSound;
@@ -1,7 +1,7 @@
1
1
  import { CallActions, ChatActions, JobState } from 'webitel-sdk';
2
2
  import i18n from '../../../locale/i18n.js';
3
3
  import BaseStoreModule from '../../../store/BaseStoreModules/BaseStoreModule.js';
4
- import endCallSound from '../assets/audio/end-call.mp3';
4
+ import triggerSound from '../assets/audio/triggerSound.js';
5
5
  import endChatSound from '../assets/audio/end-chat.wav';
6
6
  import newChatSound from '../assets/audio/new-chat.wav';
7
7
  import newMessageSound from '../assets/audio/new-message.wav';
@@ -23,7 +23,7 @@ const getNotificationSound = (action) => {
23
23
  // default call ringtone sound
24
24
  return new Audio(ringingSound);
25
25
  case CallActions.Hangup:
26
- return new Audio(endCallSound);
26
+ return triggerSound();
27
27
  default:
28
28
  return false;
29
29
  }
@@ -102,6 +102,10 @@ const applicationsAccess = (value = true) => ({
102
102
  _enabled: value,
103
103
  _locale: `WebitelApplications.${WebitelApplications.ADMIN}.sections.${AdminSections.MEDIA}`,
104
104
  },
105
+ [AdminSections.SHIFT_TEMPLATES]: {
106
+ _enabled: value,
107
+ _locale: `WebitelApplications.${WebitelApplications.ADMIN}.sections.${AdminSections.SHIFT_TEMPLATES}`,
108
+ },
105
109
  [AdminSections.AGENTS]: {
106
110
  _enabled: value,
107
111
  _locale: `WebitelApplications.${WebitelApplications.ADMIN}.sections.${AdminSections.AGENTS}`,