@webitel/ui-sdk 24.10.71 → 24.10.72
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/CHANGELOG.md +14 -0
- package/package.json +2 -1
- package/src/modules/FilesExport/FilesExport.js +21 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
+
## [v24.10.71] - 2024-11-12
|
|
4
|
+
### :sparkles: New Features
|
|
5
|
+
- [`d0bcba0`](https://github.com/webitel/webitel-ui-sdk/commit/d0bcba0b49949566e9487da167b6557f76218585) - Update version [WTEL-5432](https://webitel.atlassian.net/browse/WTEL-5432)
|
|
6
|
+
- [`e09911a`](https://github.com/webitel/webitel-ui-sdk/commit/e09911a2ddfdf5479c8c1eeac102d9f8bba78c2e) - Update usage confirm dialog. Implement callback function [WTEL-5432](https://webitel.atlassian.net/browse/WTEL-5432)
|
|
7
|
+
- [`323aa43`](https://github.com/webitel/webitel-ui-sdk/commit/323aa4392fb59d15d9f16e8d5b75a5f2724d9ea8) - Remove docs and use specs for wt-confirm-dialog [WTEL-5432](https://webitel.atlassian.net/browse/WTEL-5432)
|
|
8
|
+
- [`8d8be47`](https://github.com/webitel/webitel-ui-sdk/commit/8d8be47c16be826aafcbcd6955472f65a445a9cf) - Update package version [WTEL-5432](https://webitel.atlassian.net/browse/WTEL-5432)
|
|
9
|
+
- [`474fb3a`](https://github.com/webitel/webitel-ui-sdk/commit/474fb3a2328d4fca5cba4eb364dd0443616ae500) - Update docs for wt-confirm-dialog. Update examples for confirm dialog. Update props and events wt-confirm-dialog [WTEL-5432](https://webitel.atlassian.net/browse/WTEL-5432)
|
|
10
|
+
- [`ac269ce`](https://github.com/webitel/webitel-ui-sdk/commit/ac269ce83b1f7f2d95afeae7b5edb4a911722753) - Implement wt-confirm-dialog component. Update delete-confirmation-popup module [WTEL-5432](https://webitel.atlassian.net/browse/WTEL-5432)
|
|
11
|
+
|
|
12
|
+
### :bug: Bug Fixes
|
|
13
|
+
- [`fc8b838`](https://github.com/webitel/webitel-ui-sdk/commit/fc8b838984b68f4d8b198394f7b8c567da3d3e56) - implement fix for delete-confirmation-popup [WTEL-5432](https://webitel.atlassian.net/browse/WTEL-5432)
|
|
14
|
+
|
|
15
|
+
|
|
3
16
|
## [v24.10.69] - 2024-11-11
|
|
4
17
|
### :recycle: Refactors
|
|
5
18
|
- [`f9f6155`](https://github.com/webitel/webitel-ui-sdk/commit/f9f615521aadf07c279f40f0bf937ec0c33439d5) - simplified plyr icons SO MUCH! (upd webitel-ui) [WTEL-5475](https://webitel.atlassian.net/browse/WTEL-5475) *(commit by [@dlohvinov](https://github.com/dlohvinov))*
|
|
@@ -141,3 +154,4 @@
|
|
|
141
154
|
[v24.10.66]: https://github.com/webitel/webitel-ui-sdk/compare/v24.10.65...v24.10.66
|
|
142
155
|
[v24.10.67]: https://github.com/webitel/webitel-ui-sdk/compare/v24.10.66...v24.10.67
|
|
143
156
|
[v24.10.69]: https://github.com/webitel/webitel-ui-sdk/compare/v24.10.68...v24.10.69
|
|
157
|
+
[v24.10.71]: https://github.com/webitel/webitel-ui-sdk/compare/v24.10.69...v24.10.71
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webitel/ui-sdk",
|
|
3
|
-
"version": "24.10.
|
|
3
|
+
"version": "24.10.72",
|
|
4
4
|
"private": false,
|
|
5
5
|
"scripts": {
|
|
6
6
|
"dev": "vite",
|
|
@@ -150,6 +150,7 @@
|
|
|
150
150
|
"postcss-prefix-selector": "^2.1.0",
|
|
151
151
|
"prismjs": "^1.29.0",
|
|
152
152
|
"sass": "^1.80.6",
|
|
153
|
+
"tslib": "^2.8.1",
|
|
153
154
|
"vite": "^5.4.11",
|
|
154
155
|
"vite-plugin-node-polyfills": "^0.22.0",
|
|
155
156
|
"vite-plugin-static-copy": "^2.1.0",
|
|
@@ -2,6 +2,7 @@ import { saveAs } from 'file-saver-es';
|
|
|
2
2
|
import JSZip from 'jszip';
|
|
3
3
|
import jszipUtils from 'jszip-utils';
|
|
4
4
|
import path from 'path-browserify';
|
|
5
|
+
import { _wtUiLog } from '../../scripts/logger.js';
|
|
5
6
|
import generateMediaURL from './scripts/generateMediaURL.js';
|
|
6
7
|
|
|
7
8
|
export default class FilesExport {
|
|
@@ -11,16 +12,19 @@ export default class FilesExport {
|
|
|
11
12
|
|
|
12
13
|
isLoading = false;
|
|
13
14
|
|
|
15
|
+
skipFilesWithError = false;
|
|
16
|
+
|
|
14
17
|
downloadProgress = { count: 0 };
|
|
15
18
|
|
|
16
19
|
zippingProgress = { percent: 0 };
|
|
17
20
|
|
|
18
21
|
filesURL = generateMediaURL;
|
|
19
22
|
|
|
20
|
-
constructor({ fetchMethod, filename, filesURL }) {
|
|
23
|
+
constructor({ fetchMethod, filename, filesURL, skipFilesWithError = false }) {
|
|
21
24
|
if (fetchMethod) this.fetchMethod = fetchMethod;
|
|
22
25
|
if (filename) this.filename = filename;
|
|
23
26
|
if (filesURL) this.filesURL = filesURL;
|
|
27
|
+
this.skipFilesWithError = skipFilesWithError;
|
|
24
28
|
}
|
|
25
29
|
|
|
26
30
|
_fetchFileBinary(fileId) {
|
|
@@ -46,12 +50,22 @@ export default class FilesExport {
|
|
|
46
50
|
if (item.files) {
|
|
47
51
|
await this._addFilesToZip(item.files, zip);
|
|
48
52
|
} else {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
try {
|
|
54
|
+
const binary = await this._fetchFileBinary(item.id);
|
|
55
|
+
const ext = item.mimeType.split('/').pop();
|
|
56
|
+
// itemName needed to remove extension from item.name https://stackoverflow.com/a/31615711
|
|
57
|
+
const itemName = path.parse(item.name).name;
|
|
58
|
+
zip.file(`${itemName}.${ext}`, binary);
|
|
59
|
+
this.downloadProgress.count += 1;
|
|
60
|
+
} catch (err) {
|
|
61
|
+
_wtUiLog.warn({ entity: 'script', module: 'FilesExport' })(
|
|
62
|
+
`An error occurred while downloading a file id=${item.id}`,
|
|
63
|
+
err,
|
|
64
|
+
);
|
|
65
|
+
if (!this.skipFilesWithError) {
|
|
66
|
+
throw err;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
55
69
|
}
|
|
56
70
|
}
|
|
57
71
|
}
|