@webitel/ui-sdk 23.12.39 → 23.12.40

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": "23.12.39",
3
+ "version": "23.12.40",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "build": "vue-cli-service build --target lib --name ui-sdk ./src/install.js",
@@ -0,0 +1,9 @@
1
+ import { shallowMount } from '@vue/test-utils';
2
+ import WtSaveFailedPopup from '../wt-save-failed-popup.vue';
3
+
4
+ describe('WtSaveFailedPopup', () => {
5
+ it('renders a component', () => {
6
+ const wrapper = shallowMount(WtSaveFailedPopup);
7
+ expect(wrapper.classes('wt-save-failed-popup')).toBe(true);
8
+ });
9
+ });
@@ -0,0 +1,70 @@
1
+ <template>
2
+ <wt-popup
3
+ class="wt-save-failed-popup"
4
+ :width="500"
5
+ @close="closePopup"
6
+ >
7
+ <template #title>
8
+ {{ $t('webitelUI.saveFailedPopup.title') }}
9
+ </template>
10
+ <template #main>
11
+ <div class="flow-save-filed-popup__wrapper">
12
+ <wt-icon
13
+ color="error"
14
+ icon="attention"
15
+ />
16
+ <p>{{ $t('webitelUI.saveFailedPopup.label') }}</p>
17
+ </div>
18
+ </template>
19
+ <template #actions>
20
+ <wt-button
21
+ @click="save"
22
+ >
23
+ {{ $t('reusable.retry') }}
24
+ </wt-button>
25
+ <wt-button
26
+ color="secondary"
27
+ @click="download"
28
+ >
29
+ {{ $t('webitelUI.saveFailedPopup.exportToJson') }}
30
+ </wt-button>
31
+ <wt-button
32
+ color="secondary"
33
+ @click="closePopup"
34
+ >
35
+ {{ $t('reusable.close') }}
36
+ </wt-button>
37
+ </template>
38
+ </wt-popup>
39
+ </template>
40
+
41
+ <script>
42
+ export default {
43
+ name: 'FlowSaveFailedPopup',
44
+ emits: ['close-popup', 'save', 'download'],
45
+ methods: {
46
+ closePopup() {
47
+ this.$emit('close-popup');
48
+ },
49
+ save() {
50
+ this.$emit('save');
51
+ },
52
+ download() {
53
+ this.$emit('download');
54
+ },
55
+ },
56
+ };
57
+ </script>
58
+
59
+ <style lang="scss" scoped>
60
+ .flow-save-filed-popup__wrapper {
61
+ display: flex;
62
+ align-items: center;
63
+ flex-direction: column;
64
+ text-align: center;
65
+
66
+ .wt-icon {
67
+ margin-bottom: var(--spacing-sm);
68
+ }
69
+ }
70
+ </style>
@@ -359,5 +359,10 @@ export default {
359
359
  message: 'The limit for agents to take a pause has been exceeded. The pause is unavailable right now.',
360
360
  },
361
361
  },
362
+ saveFailedPopup: {
363
+ title: 'Save failed',
364
+ label: 'Something went wrong, please try again',
365
+ exportToJson: 'Export to JSON',
366
+ },
362
367
  },
363
368
  };
@@ -322,5 +322,10 @@ export default {
322
322
  unlimited: 'Шексіз',
323
323
  },
324
324
  },
325
+ saveFailedPopup: {
326
+ title: 'Қатені сақтау',
327
+ label: 'Бірдеңе дұрыс болмады.',
328
+ exportToJson: 'JSON файлына экспорттау',
329
+ },
325
330
  },
326
331
  };
@@ -357,5 +357,10 @@ export default {
357
357
  message: 'Лимит операторов в паузе превышен. Перерыв сейчас недоступен.',
358
358
  },
359
359
  },
360
+ saveFailedPopup: {
361
+ title: 'Ошибка сохранения',
362
+ label: 'Что-то пошло не так. Пожалуйста, попробуйте еще раз',
363
+ exportToJson: 'Экспортировать в JSON',
364
+ },
360
365
  },
361
366
  };
@@ -357,5 +357,10 @@ export default {
357
357
  message: 'Ліміт операторів в паузі перевищено. Перерва наразі недоступна.',
358
358
  },
359
359
  },
360
+ saveFailedPopup: {
361
+ title: 'Помилка збереження',
362
+ label: 'Щось пішло не так. Будь ласка, спробуйте ще раз',
363
+ exportToJson: 'Експортувати в JSON',
364
+ },
360
365
  },
361
366
  };
@@ -0,0 +1,7 @@
1
+ import { saveAs } from 'file-saver';
2
+
3
+ export const saveAsJSON = (name, content) => {
4
+ const fileName = name.replace(/[ ,]+/g, '-');
5
+ const file = new Blob([JSON.stringify(content, null, 4)], { type: 'application/json' });
6
+ saveAs(file, fileName);
7
+ };
Binary file