@commercetools-frontend-extensions/import-resources-modal 1.3.15 → 1.3.16
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/dist/{active-drag-drop-area-2b0845a4.cjs.prod.js → active-drag-drop-area-1990c888.cjs.prod.js} +2 -2
- package/dist/{active-drag-drop-area-c0368c1e.esm.js → active-drag-drop-area-245e26d9.esm.js} +2 -2
- package/dist/{active-drag-drop-area-e62ef22b.cjs.dev.js → active-drag-drop-area-a07d4eb3.cjs.dev.js} +2 -2
- package/dist/commercetools-frontend-extensions-import-resources-modal.cjs.dev.js +2 -2
- package/dist/commercetools-frontend-extensions-import-resources-modal.cjs.prod.js +2 -2
- package/dist/commercetools-frontend-extensions-import-resources-modal.esm.js +2 -2
- package/dist/declarations/src/@types/file-upload.d.ts +9 -1
- package/dist/{enabled-drop-area-c0c903b2.esm.js → enabled-drop-area-118cf588.esm.js} +2 -2
- package/dist/{enabled-drop-area-2429c14d.cjs.dev.js → enabled-drop-area-11c61ee2.cjs.dev.js} +2 -2
- package/dist/{enabled-drop-area-134390f4.cjs.prod.js → enabled-drop-area-2c8702cd.cjs.prod.js} +2 -2
- package/dist/{file-dropped-area-353d39b6.cjs.prod.js → file-dropped-area-19c71ab9.cjs.prod.js} +2 -2
- package/dist/{file-dropped-area-8b7bffb5.cjs.dev.js → file-dropped-area-59803011.cjs.dev.js} +2 -2
- package/dist/{file-dropped-area-5560a729.esm.js → file-dropped-area-ef80a054.esm.js} +2 -2
- package/dist/{index-3905ce0c.cjs.prod.js → index-50af68b8.cjs.prod.js} +75 -39
- package/dist/{index-704cf74c.esm.js → index-a799ed10.esm.js} +74 -38
- package/dist/{index-bfc0d471.cjs.dev.js → index-aa4cebbf.cjs.dev.js} +75 -39
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var dist_commercetoolsFrontendExtensionsImportResourcesModal = require('./index-
|
|
3
|
+
var dist_commercetoolsFrontendExtensionsImportResourcesModal = require('./index-50af68b8.cjs.prod.js');
|
|
4
4
|
var jsxRuntime = require('@emotion/react/jsx-runtime');
|
|
5
5
|
require('@babel/runtime-corejs3/core-js-stable/object/keys');
|
|
6
6
|
require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols');
|
|
@@ -35,6 +35,7 @@ require('@babel/runtime-corejs3/core-js-stable/instance/find');
|
|
|
35
35
|
require('@babel/runtime-corejs3/core-js-stable/instance/includes');
|
|
36
36
|
require('papaparse');
|
|
37
37
|
require('@babel/runtime-corejs3/core-js-stable/instance/reduce');
|
|
38
|
+
require('@babel/runtime-corejs3/core-js-stable/instance/slice');
|
|
38
39
|
require('@babel/runtime-corejs3/core-js-stable/json/stringify');
|
|
39
40
|
require('@babel/runtime-corejs3/core-js-stable/instance/starts-with');
|
|
40
41
|
require('@babel/runtime-corejs3/core-js-stable/url-search-params');
|
|
@@ -48,7 +49,6 @@ require('@commercetools-frontend/actions-global');
|
|
|
48
49
|
require('@emotion/styled/base');
|
|
49
50
|
require('@emotion/react');
|
|
50
51
|
require('@commercetools-frontend/sentry');
|
|
51
|
-
require('@babel/runtime-corejs3/core-js-stable/instance/slice');
|
|
52
52
|
require('@commercetools-uikit/data-table');
|
|
53
53
|
require('@commercetools-frontend/i18n');
|
|
54
54
|
|
package/dist/{active-drag-drop-area-c0368c1e.esm.js → active-drag-drop-area-245e26d9.esm.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { F as FileDropped, E as EnabledDropArea } from './index-
|
|
1
|
+
import { F as FileDropped, E as EnabledDropArea } from './index-a799ed10.esm.js';
|
|
2
2
|
import { jsx } from '@emotion/react/jsx-runtime';
|
|
3
3
|
import '@babel/runtime-corejs3/core-js-stable/object/keys';
|
|
4
4
|
import '@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols';
|
|
@@ -33,6 +33,7 @@ import '@babel/runtime-corejs3/core-js-stable/instance/find';
|
|
|
33
33
|
import '@babel/runtime-corejs3/core-js-stable/instance/includes';
|
|
34
34
|
import 'papaparse';
|
|
35
35
|
import '@babel/runtime-corejs3/core-js-stable/instance/reduce';
|
|
36
|
+
import '@babel/runtime-corejs3/core-js-stable/instance/slice';
|
|
36
37
|
import '@babel/runtime-corejs3/core-js-stable/json/stringify';
|
|
37
38
|
import '@babel/runtime-corejs3/core-js-stable/instance/starts-with';
|
|
38
39
|
import '@babel/runtime-corejs3/core-js-stable/url-search-params';
|
|
@@ -46,7 +47,6 @@ import '@commercetools-frontend/actions-global';
|
|
|
46
47
|
import '@emotion/styled/base';
|
|
47
48
|
import '@emotion/react';
|
|
48
49
|
import '@commercetools-frontend/sentry';
|
|
49
|
-
import '@babel/runtime-corejs3/core-js-stable/instance/slice';
|
|
50
50
|
import '@commercetools-uikit/data-table';
|
|
51
51
|
import '@commercetools-frontend/i18n';
|
|
52
52
|
|
package/dist/{active-drag-drop-area-e62ef22b.cjs.dev.js → active-drag-drop-area-a07d4eb3.cjs.dev.js}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var dist_commercetoolsFrontendExtensionsImportResourcesModal = require('./index-
|
|
3
|
+
var dist_commercetoolsFrontendExtensionsImportResourcesModal = require('./index-aa4cebbf.cjs.dev.js');
|
|
4
4
|
var jsxRuntime = require('@emotion/react/jsx-runtime');
|
|
5
5
|
require('@babel/runtime-corejs3/core-js-stable/object/keys');
|
|
6
6
|
require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols');
|
|
@@ -35,6 +35,7 @@ require('@babel/runtime-corejs3/core-js-stable/instance/find');
|
|
|
35
35
|
require('@babel/runtime-corejs3/core-js-stable/instance/includes');
|
|
36
36
|
require('papaparse');
|
|
37
37
|
require('@babel/runtime-corejs3/core-js-stable/instance/reduce');
|
|
38
|
+
require('@babel/runtime-corejs3/core-js-stable/instance/slice');
|
|
38
39
|
require('@babel/runtime-corejs3/core-js-stable/json/stringify');
|
|
39
40
|
require('@babel/runtime-corejs3/core-js-stable/instance/starts-with');
|
|
40
41
|
require('@babel/runtime-corejs3/core-js-stable/url-search-params');
|
|
@@ -48,7 +49,6 @@ require('@commercetools-frontend/actions-global');
|
|
|
48
49
|
require('@emotion/styled/base');
|
|
49
50
|
require('@emotion/react');
|
|
50
51
|
require('@commercetools-frontend/sentry');
|
|
51
|
-
require('@babel/runtime-corejs3/core-js-stable/instance/slice');
|
|
52
52
|
require('@commercetools-uikit/data-table');
|
|
53
53
|
require('@commercetools-frontend/i18n');
|
|
54
54
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var dist_commercetoolsFrontendExtensionsImportResourcesModal = require('./index-
|
|
5
|
+
var dist_commercetoolsFrontendExtensionsImportResourcesModal = require('./index-aa4cebbf.cjs.dev.js');
|
|
6
6
|
require('@babel/runtime-corejs3/core-js-stable/object/keys');
|
|
7
7
|
require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols');
|
|
8
8
|
require('@babel/runtime-corejs3/core-js-stable/instance/filter');
|
|
@@ -36,6 +36,7 @@ require('@babel/runtime-corejs3/core-js-stable/instance/find');
|
|
|
36
36
|
require('@babel/runtime-corejs3/core-js-stable/instance/includes');
|
|
37
37
|
require('papaparse');
|
|
38
38
|
require('@babel/runtime-corejs3/core-js-stable/instance/reduce');
|
|
39
|
+
require('@babel/runtime-corejs3/core-js-stable/instance/slice');
|
|
39
40
|
require('@babel/runtime-corejs3/core-js-stable/json/stringify');
|
|
40
41
|
require('@babel/runtime-corejs3/core-js-stable/instance/starts-with');
|
|
41
42
|
require('@babel/runtime-corejs3/core-js-stable/url-search-params');
|
|
@@ -50,7 +51,6 @@ require('@commercetools-frontend/actions-global');
|
|
|
50
51
|
require('@emotion/styled/base');
|
|
51
52
|
require('@emotion/react');
|
|
52
53
|
require('@commercetools-frontend/sentry');
|
|
53
|
-
require('@babel/runtime-corejs3/core-js-stable/instance/slice');
|
|
54
54
|
require('@commercetools-uikit/data-table');
|
|
55
55
|
require('@commercetools-frontend/i18n');
|
|
56
56
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var dist_commercetoolsFrontendExtensionsImportResourcesModal = require('./index-
|
|
5
|
+
var dist_commercetoolsFrontendExtensionsImportResourcesModal = require('./index-50af68b8.cjs.prod.js');
|
|
6
6
|
require('@babel/runtime-corejs3/core-js-stable/object/keys');
|
|
7
7
|
require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols');
|
|
8
8
|
require('@babel/runtime-corejs3/core-js-stable/instance/filter');
|
|
@@ -36,6 +36,7 @@ require('@babel/runtime-corejs3/core-js-stable/instance/find');
|
|
|
36
36
|
require('@babel/runtime-corejs3/core-js-stable/instance/includes');
|
|
37
37
|
require('papaparse');
|
|
38
38
|
require('@babel/runtime-corejs3/core-js-stable/instance/reduce');
|
|
39
|
+
require('@babel/runtime-corejs3/core-js-stable/instance/slice');
|
|
39
40
|
require('@babel/runtime-corejs3/core-js-stable/json/stringify');
|
|
40
41
|
require('@babel/runtime-corejs3/core-js-stable/instance/starts-with');
|
|
41
42
|
require('@babel/runtime-corejs3/core-js-stable/url-search-params');
|
|
@@ -50,7 +51,6 @@ require('@commercetools-frontend/actions-global');
|
|
|
50
51
|
require('@emotion/styled/base');
|
|
51
52
|
require('@emotion/react');
|
|
52
53
|
require('@commercetools-frontend/sentry');
|
|
53
|
-
require('@babel/runtime-corejs3/core-js-stable/instance/slice');
|
|
54
54
|
require('@commercetools-uikit/data-table');
|
|
55
55
|
require('@commercetools-frontend/i18n');
|
|
56
56
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { I as default } from './index-
|
|
1
|
+
export { I as default } from './index-a799ed10.esm.js';
|
|
2
2
|
import '@babel/runtime-corejs3/core-js-stable/object/keys';
|
|
3
3
|
import '@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols';
|
|
4
4
|
import '@babel/runtime-corejs3/core-js-stable/instance/filter';
|
|
@@ -32,6 +32,7 @@ import '@babel/runtime-corejs3/core-js-stable/instance/find';
|
|
|
32
32
|
import '@babel/runtime-corejs3/core-js-stable/instance/includes';
|
|
33
33
|
import 'papaparse';
|
|
34
34
|
import '@babel/runtime-corejs3/core-js-stable/instance/reduce';
|
|
35
|
+
import '@babel/runtime-corejs3/core-js-stable/instance/slice';
|
|
35
36
|
import '@babel/runtime-corejs3/core-js-stable/json/stringify';
|
|
36
37
|
import '@babel/runtime-corejs3/core-js-stable/instance/starts-with';
|
|
37
38
|
import '@babel/runtime-corejs3/core-js-stable/url-search-params';
|
|
@@ -46,6 +47,5 @@ import '@commercetools-frontend/actions-global';
|
|
|
46
47
|
import '@emotion/styled/base';
|
|
47
48
|
import '@emotion/react';
|
|
48
49
|
import '@commercetools-frontend/sentry';
|
|
49
|
-
import '@babel/runtime-corejs3/core-js-stable/instance/slice';
|
|
50
50
|
import '@commercetools-uikit/data-table';
|
|
51
51
|
import '@commercetools-frontend/i18n';
|
|
@@ -4,7 +4,7 @@ export type DelimiterCheck = {
|
|
|
4
4
|
isValid: boolean;
|
|
5
5
|
delimiter: string | null;
|
|
6
6
|
};
|
|
7
|
-
export type
|
|
7
|
+
export type FileUploadError = {
|
|
8
8
|
title: string;
|
|
9
9
|
description: string;
|
|
10
10
|
};
|
|
@@ -53,3 +53,11 @@ export interface ProcessUploadedFileRequestParameters {
|
|
|
53
53
|
export type ProcessFileResponse = {
|
|
54
54
|
message: string;
|
|
55
55
|
};
|
|
56
|
+
export type MissingCsvFieldIdentifierError = {
|
|
57
|
+
code: string;
|
|
58
|
+
message: string;
|
|
59
|
+
rowValue: Record<string, unknown>;
|
|
60
|
+
metadata: {
|
|
61
|
+
row: number;
|
|
62
|
+
};
|
|
63
|
+
};
|
|
@@ -9,7 +9,7 @@ import _Object$defineProperty from '@babel/runtime-corejs3/core-js-stable/object
|
|
|
9
9
|
import _defineProperty from '@babel/runtime-corejs3/helpers/esm/defineProperty';
|
|
10
10
|
import 'react';
|
|
11
11
|
import { Spacings, Text, Link } from '@commercetools-frontend/ui-kit';
|
|
12
|
-
import { m as messages } from './index-
|
|
12
|
+
import { m as messages } from './index-a799ed10.esm.js';
|
|
13
13
|
import { jsxs, jsx } from '@emotion/react/jsx-runtime';
|
|
14
14
|
import '@babel/runtime-corejs3/core-js-stable/instance/every';
|
|
15
15
|
import 'react-intl';
|
|
@@ -34,6 +34,7 @@ import '@babel/runtime-corejs3/core-js-stable/instance/find';
|
|
|
34
34
|
import '@babel/runtime-corejs3/core-js-stable/instance/includes';
|
|
35
35
|
import 'papaparse';
|
|
36
36
|
import '@babel/runtime-corejs3/core-js-stable/instance/reduce';
|
|
37
|
+
import '@babel/runtime-corejs3/core-js-stable/instance/slice';
|
|
37
38
|
import '@babel/runtime-corejs3/core-js-stable/json/stringify';
|
|
38
39
|
import '@babel/runtime-corejs3/core-js-stable/instance/starts-with';
|
|
39
40
|
import '@babel/runtime-corejs3/core-js-stable/url-search-params';
|
|
@@ -46,7 +47,6 @@ import '@commercetools-frontend/actions-global';
|
|
|
46
47
|
import '@emotion/styled/base';
|
|
47
48
|
import '@emotion/react';
|
|
48
49
|
import '@commercetools-frontend/sentry';
|
|
49
|
-
import '@babel/runtime-corejs3/core-js-stable/instance/slice';
|
|
50
50
|
import '@commercetools-uikit/data-table';
|
|
51
51
|
import '@commercetools-frontend/i18n';
|
|
52
52
|
|
package/dist/{enabled-drop-area-2429c14d.cjs.dev.js → enabled-drop-area-11c61ee2.cjs.dev.js}
RENAMED
|
@@ -11,7 +11,7 @@ var _Object$defineProperty = require('@babel/runtime-corejs3/core-js-stable/obje
|
|
|
11
11
|
var _defineProperty = require('@babel/runtime-corejs3/helpers/defineProperty');
|
|
12
12
|
require('react');
|
|
13
13
|
var uiKit = require('@commercetools-frontend/ui-kit');
|
|
14
|
-
var dist_commercetoolsFrontendExtensionsImportResourcesModal = require('./index-
|
|
14
|
+
var dist_commercetoolsFrontendExtensionsImportResourcesModal = require('./index-aa4cebbf.cjs.dev.js');
|
|
15
15
|
var jsxRuntime = require('@emotion/react/jsx-runtime');
|
|
16
16
|
require('@babel/runtime-corejs3/core-js-stable/instance/every');
|
|
17
17
|
require('react-intl');
|
|
@@ -36,6 +36,7 @@ require('@babel/runtime-corejs3/core-js-stable/instance/find');
|
|
|
36
36
|
require('@babel/runtime-corejs3/core-js-stable/instance/includes');
|
|
37
37
|
require('papaparse');
|
|
38
38
|
require('@babel/runtime-corejs3/core-js-stable/instance/reduce');
|
|
39
|
+
require('@babel/runtime-corejs3/core-js-stable/instance/slice');
|
|
39
40
|
require('@babel/runtime-corejs3/core-js-stable/json/stringify');
|
|
40
41
|
require('@babel/runtime-corejs3/core-js-stable/instance/starts-with');
|
|
41
42
|
require('@babel/runtime-corejs3/core-js-stable/url-search-params');
|
|
@@ -48,7 +49,6 @@ require('@commercetools-frontend/actions-global');
|
|
|
48
49
|
require('@emotion/styled/base');
|
|
49
50
|
require('@emotion/react');
|
|
50
51
|
require('@commercetools-frontend/sentry');
|
|
51
|
-
require('@babel/runtime-corejs3/core-js-stable/instance/slice');
|
|
52
52
|
require('@commercetools-uikit/data-table');
|
|
53
53
|
require('@commercetools-frontend/i18n');
|
|
54
54
|
|
package/dist/{enabled-drop-area-134390f4.cjs.prod.js → enabled-drop-area-2c8702cd.cjs.prod.js}
RENAMED
|
@@ -11,7 +11,7 @@ var _Object$defineProperty = require('@babel/runtime-corejs3/core-js-stable/obje
|
|
|
11
11
|
var _defineProperty = require('@babel/runtime-corejs3/helpers/defineProperty');
|
|
12
12
|
require('react');
|
|
13
13
|
var uiKit = require('@commercetools-frontend/ui-kit');
|
|
14
|
-
var dist_commercetoolsFrontendExtensionsImportResourcesModal = require('./index-
|
|
14
|
+
var dist_commercetoolsFrontendExtensionsImportResourcesModal = require('./index-50af68b8.cjs.prod.js');
|
|
15
15
|
var jsxRuntime = require('@emotion/react/jsx-runtime');
|
|
16
16
|
require('@babel/runtime-corejs3/core-js-stable/instance/every');
|
|
17
17
|
require('react-intl');
|
|
@@ -36,6 +36,7 @@ require('@babel/runtime-corejs3/core-js-stable/instance/find');
|
|
|
36
36
|
require('@babel/runtime-corejs3/core-js-stable/instance/includes');
|
|
37
37
|
require('papaparse');
|
|
38
38
|
require('@babel/runtime-corejs3/core-js-stable/instance/reduce');
|
|
39
|
+
require('@babel/runtime-corejs3/core-js-stable/instance/slice');
|
|
39
40
|
require('@babel/runtime-corejs3/core-js-stable/json/stringify');
|
|
40
41
|
require('@babel/runtime-corejs3/core-js-stable/instance/starts-with');
|
|
41
42
|
require('@babel/runtime-corejs3/core-js-stable/url-search-params');
|
|
@@ -48,7 +49,6 @@ require('@commercetools-frontend/actions-global');
|
|
|
48
49
|
require('@emotion/styled/base');
|
|
49
50
|
require('@emotion/react');
|
|
50
51
|
require('@commercetools-frontend/sentry');
|
|
51
|
-
require('@babel/runtime-corejs3/core-js-stable/instance/slice');
|
|
52
52
|
require('@commercetools-uikit/data-table');
|
|
53
53
|
require('@commercetools-frontend/i18n');
|
|
54
54
|
|
package/dist/{file-dropped-area-353d39b6.cjs.prod.js → file-dropped-area-19c71ab9.cjs.prod.js}
RENAMED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var reactIntl = require('react-intl');
|
|
4
4
|
var uiKit = require('@commercetools-frontend/ui-kit');
|
|
5
|
-
var dist_commercetoolsFrontendExtensionsImportResourcesModal = require('./index-
|
|
5
|
+
var dist_commercetoolsFrontendExtensionsImportResourcesModal = require('./index-50af68b8.cjs.prod.js');
|
|
6
6
|
require('react');
|
|
7
7
|
require('@commercetools-frontend/actions-global');
|
|
8
8
|
require('@commercetools-frontend/application-shell-connectors');
|
|
@@ -35,6 +35,7 @@ require('@babel/runtime-corejs3/core-js-stable/instance/find');
|
|
|
35
35
|
require('@babel/runtime-corejs3/core-js-stable/instance/includes');
|
|
36
36
|
require('papaparse');
|
|
37
37
|
require('@babel/runtime-corejs3/core-js-stable/instance/reduce');
|
|
38
|
+
require('@babel/runtime-corejs3/core-js-stable/instance/slice');
|
|
38
39
|
require('@babel/runtime-corejs3/core-js-stable/json/stringify');
|
|
39
40
|
require('@babel/runtime-corejs3/core-js-stable/instance/starts-with');
|
|
40
41
|
require('@babel/runtime-corejs3/helpers/slicedToArray');
|
|
@@ -48,7 +49,6 @@ require('@babel/runtime-corejs3/core-js-stable/instance/some');
|
|
|
48
49
|
require('react-dropzone');
|
|
49
50
|
require('@emotion/styled/base');
|
|
50
51
|
require('@emotion/react');
|
|
51
|
-
require('@babel/runtime-corejs3/core-js-stable/instance/slice');
|
|
52
52
|
require('@commercetools-uikit/data-table');
|
|
53
53
|
require('@commercetools-frontend/i18n');
|
|
54
54
|
|
package/dist/{file-dropped-area-8b7bffb5.cjs.dev.js → file-dropped-area-59803011.cjs.dev.js}
RENAMED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var reactIntl = require('react-intl');
|
|
4
4
|
var uiKit = require('@commercetools-frontend/ui-kit');
|
|
5
|
-
var dist_commercetoolsFrontendExtensionsImportResourcesModal = require('./index-
|
|
5
|
+
var dist_commercetoolsFrontendExtensionsImportResourcesModal = require('./index-aa4cebbf.cjs.dev.js');
|
|
6
6
|
require('react');
|
|
7
7
|
require('@commercetools-frontend/actions-global');
|
|
8
8
|
require('@commercetools-frontend/application-shell-connectors');
|
|
@@ -35,6 +35,7 @@ require('@babel/runtime-corejs3/core-js-stable/instance/find');
|
|
|
35
35
|
require('@babel/runtime-corejs3/core-js-stable/instance/includes');
|
|
36
36
|
require('papaparse');
|
|
37
37
|
require('@babel/runtime-corejs3/core-js-stable/instance/reduce');
|
|
38
|
+
require('@babel/runtime-corejs3/core-js-stable/instance/slice');
|
|
38
39
|
require('@babel/runtime-corejs3/core-js-stable/json/stringify');
|
|
39
40
|
require('@babel/runtime-corejs3/core-js-stable/instance/starts-with');
|
|
40
41
|
require('@babel/runtime-corejs3/helpers/slicedToArray');
|
|
@@ -48,7 +49,6 @@ require('@babel/runtime-corejs3/core-js-stable/instance/some');
|
|
|
48
49
|
require('react-dropzone');
|
|
49
50
|
require('@emotion/styled/base');
|
|
50
51
|
require('@emotion/react');
|
|
51
|
-
require('@babel/runtime-corejs3/core-js-stable/instance/slice');
|
|
52
52
|
require('@commercetools-uikit/data-table');
|
|
53
53
|
require('@commercetools-frontend/i18n');
|
|
54
54
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useIntl } from 'react-intl';
|
|
2
2
|
import { Spacings, PaperclipIcon, Constraints, Text, SecondaryButton } from '@commercetools-frontend/ui-kit';
|
|
3
|
-
import { u as useImportResourcesContext, m as messages } from './index-
|
|
3
|
+
import { u as useImportResourcesContext, m as messages } from './index-a799ed10.esm.js';
|
|
4
4
|
import 'react';
|
|
5
5
|
import '@commercetools-frontend/actions-global';
|
|
6
6
|
import '@commercetools-frontend/application-shell-connectors';
|
|
@@ -33,6 +33,7 @@ import '@babel/runtime-corejs3/core-js-stable/instance/find';
|
|
|
33
33
|
import '@babel/runtime-corejs3/core-js-stable/instance/includes';
|
|
34
34
|
import 'papaparse';
|
|
35
35
|
import '@babel/runtime-corejs3/core-js-stable/instance/reduce';
|
|
36
|
+
import '@babel/runtime-corejs3/core-js-stable/instance/slice';
|
|
36
37
|
import '@babel/runtime-corejs3/core-js-stable/json/stringify';
|
|
37
38
|
import '@babel/runtime-corejs3/core-js-stable/instance/starts-with';
|
|
38
39
|
import '@babel/runtime-corejs3/helpers/slicedToArray';
|
|
@@ -46,7 +47,6 @@ import '@babel/runtime-corejs3/core-js-stable/instance/some';
|
|
|
46
47
|
import 'react-dropzone';
|
|
47
48
|
import '@emotion/styled/base';
|
|
48
49
|
import '@emotion/react';
|
|
49
|
-
import '@babel/runtime-corejs3/core-js-stable/instance/slice';
|
|
50
50
|
import '@commercetools-uikit/data-table';
|
|
51
51
|
import '@commercetools-frontend/i18n';
|
|
52
52
|
|
|
@@ -33,6 +33,7 @@ var _findInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/insta
|
|
|
33
33
|
var _includesInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/includes');
|
|
34
34
|
var Papa = require('papaparse');
|
|
35
35
|
var _reduceInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/reduce');
|
|
36
|
+
var _sliceInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/slice');
|
|
36
37
|
var _JSON$stringify = require('@babel/runtime-corejs3/core-js-stable/json/stringify');
|
|
37
38
|
require('@babel/runtime-corejs3/core-js-stable/instance/starts-with');
|
|
38
39
|
require('@babel/runtime-corejs3/core-js-stable/url-search-params');
|
|
@@ -47,7 +48,6 @@ var actionsGlobal = require('@commercetools-frontend/actions-global');
|
|
|
47
48
|
var _styled = require('@emotion/styled/base');
|
|
48
49
|
var react = require('@emotion/react');
|
|
49
50
|
var sentry = require('@commercetools-frontend/sentry');
|
|
50
|
-
var _sliceInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/slice');
|
|
51
51
|
var DataTable = require('@commercetools-uikit/data-table');
|
|
52
52
|
var i18n = require('@commercetools-frontend/i18n');
|
|
53
53
|
|
|
@@ -72,10 +72,10 @@ var _findInstanceProperty__default = /*#__PURE__*/_interopDefault(_findInstanceP
|
|
|
72
72
|
var _includesInstanceProperty__default = /*#__PURE__*/_interopDefault(_includesInstanceProperty);
|
|
73
73
|
var Papa__default = /*#__PURE__*/_interopDefault(Papa);
|
|
74
74
|
var _reduceInstanceProperty__default = /*#__PURE__*/_interopDefault(_reduceInstanceProperty);
|
|
75
|
+
var _sliceInstanceProperty__default = /*#__PURE__*/_interopDefault(_sliceInstanceProperty);
|
|
75
76
|
var _JSON$stringify__default = /*#__PURE__*/_interopDefault(_JSON$stringify);
|
|
76
77
|
var _someInstanceProperty__default = /*#__PURE__*/_interopDefault(_someInstanceProperty);
|
|
77
78
|
var _styled__default = /*#__PURE__*/_interopDefault(_styled);
|
|
78
|
-
var _sliceInstanceProperty__default = /*#__PURE__*/_interopDefault(_sliceInstanceProperty);
|
|
79
79
|
var DataTable__default = /*#__PURE__*/_interopDefault(DataTable);
|
|
80
80
|
|
|
81
81
|
function ownKeys$g(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
@@ -97,7 +97,7 @@ function reducer(state, action) {
|
|
|
97
97
|
if (action.type === 'cancelImport') return _objectSpread$g(_objectSpread$g({}, state), {}, {
|
|
98
98
|
currentStep: 1,
|
|
99
99
|
containerKey: undefined,
|
|
100
|
-
|
|
100
|
+
fileUploadErrors: [],
|
|
101
101
|
uploadFileResponse: undefined,
|
|
102
102
|
droppedFile: undefined,
|
|
103
103
|
dropAreaState: 'disabled',
|
|
@@ -106,7 +106,7 @@ function reducer(state, action) {
|
|
|
106
106
|
if (action.type === 'uploadNewFile') return _objectSpread$g(_objectSpread$g({}, state), {}, {
|
|
107
107
|
currentStep: 1,
|
|
108
108
|
containerKey: undefined,
|
|
109
|
-
|
|
109
|
+
fileUploadErrors: [],
|
|
110
110
|
uploadFileResponse: undefined,
|
|
111
111
|
droppedFile: undefined,
|
|
112
112
|
dropAreaState: 'ready-for-drop',
|
|
@@ -117,9 +117,9 @@ function reducer(state, action) {
|
|
|
117
117
|
droppedFile: action.droppedFile
|
|
118
118
|
});
|
|
119
119
|
}
|
|
120
|
-
if (action.type === '
|
|
120
|
+
if (action.type === 'setFileUploadErrors') {
|
|
121
121
|
return _objectSpread$g(_objectSpread$g({}, state), {}, {
|
|
122
|
-
|
|
122
|
+
fileUploadErrors: action.fileUploadErrors
|
|
123
123
|
});
|
|
124
124
|
}
|
|
125
125
|
if (action.type === 'setAbortController') {
|
|
@@ -142,7 +142,7 @@ const initialState = {
|
|
|
142
142
|
abortController: new AbortController(),
|
|
143
143
|
dropAreaState: 'disabled',
|
|
144
144
|
uploadFileResponse: undefined,
|
|
145
|
-
|
|
145
|
+
fileUploadErrors: [],
|
|
146
146
|
resourceType: 'category',
|
|
147
147
|
containerKey: undefined,
|
|
148
148
|
progress: 0
|
|
@@ -364,9 +364,9 @@ const mapUploadFileErrorsResponseToUploadFileErrorRows = uploadFileErrorsRespons
|
|
|
364
364
|
}));
|
|
365
365
|
});
|
|
366
366
|
};
|
|
367
|
-
const
|
|
367
|
+
const mapFileUploadErrorsToUploadFileErrorRows = uploadFileErrors => {
|
|
368
368
|
let idCounter = 1;
|
|
369
|
-
return _mapInstanceProperty__default["default"](
|
|
369
|
+
return _mapInstanceProperty__default["default"](uploadFileErrors).call(uploadFileErrors, uploadFileError => _objectSpread$e(_objectSpread$e({}, uploadFileError), {}, {
|
|
370
370
|
id: String(idCounter++)
|
|
371
371
|
}));
|
|
372
372
|
};
|
|
@@ -415,6 +415,23 @@ function convertFileSizeToKB(sizeInBytes) {
|
|
|
415
415
|
function isAbortError(error) {
|
|
416
416
|
return error instanceof DOMException && error.name === 'AbortError';
|
|
417
417
|
}
|
|
418
|
+
function formatKeys(obj) {
|
|
419
|
+
var _context;
|
|
420
|
+
if (typeof obj !== 'object' || obj === null) return '';
|
|
421
|
+
const keys = _mapInstanceProperty__default["default"](_context = _Object$keys__default["default"](obj)).call(_context, key => key.replace(/([a-z])([A-Z])/g, '$1 $2').toLowerCase());
|
|
422
|
+
if (keys.length === 0) return '';
|
|
423
|
+
if (keys.length === 1) return keys[0];
|
|
424
|
+
return `${_sliceInstanceProperty__default["default"](keys).call(keys, 0, -1).join(', ')} and ${keys[keys.length - 1]}`;
|
|
425
|
+
}
|
|
426
|
+
function formatErrorCode(code) {
|
|
427
|
+
try {
|
|
428
|
+
const formattedCode = code.replace(/([a-z])([A-Z])/g, '$1 $2').replace(/([A-Z])([A-Z][a-z])/g, '$1 $2').toLowerCase();
|
|
429
|
+
let result = formattedCode.charAt(0).toUpperCase() + _sliceInstanceProperty__default["default"](formattedCode).call(formattedCode, 1);
|
|
430
|
+
return result;
|
|
431
|
+
} catch (error) {
|
|
432
|
+
return code;
|
|
433
|
+
}
|
|
434
|
+
}
|
|
418
435
|
|
|
419
436
|
const encodeFileNameWithTimestampToContainerKey = fileName => {
|
|
420
437
|
return btoa(_JSON$stringify__default["default"]({
|
|
@@ -588,9 +605,9 @@ const ImportResourcesProvider = props => {
|
|
|
588
605
|
type: 'setAbortController',
|
|
589
606
|
abortController: abortController
|
|
590
607
|
});
|
|
591
|
-
const
|
|
592
|
-
type: '
|
|
593
|
-
|
|
608
|
+
const setFileUploadErrors = fileUploadErrors => dispatch({
|
|
609
|
+
type: 'setFileUploadErrors',
|
|
610
|
+
fileUploadErrors: fileUploadErrors
|
|
594
611
|
});
|
|
595
612
|
const setProgress = progress => dispatch({
|
|
596
613
|
type: 'setProgress',
|
|
@@ -622,7 +639,7 @@ const ImportResourcesProvider = props => {
|
|
|
622
639
|
setDroppedFile,
|
|
623
640
|
setContainerKey,
|
|
624
641
|
setAbortController,
|
|
625
|
-
|
|
642
|
+
setFileUploadErrors,
|
|
626
643
|
setProgress
|
|
627
644
|
}
|
|
628
645
|
},
|
|
@@ -682,13 +699,13 @@ function getDefaultDropWrapperStyles(_dropAreaState) {
|
|
|
682
699
|
return /*#__PURE__*/react.css("" , "" );
|
|
683
700
|
}
|
|
684
701
|
|
|
685
|
-
var ActiveDragDropArea = /*#__PURE__*/React.lazy(() => Promise.resolve().then(function () { return require('./active-drag-drop-area-
|
|
702
|
+
var ActiveDragDropArea = /*#__PURE__*/React.lazy(() => Promise.resolve().then(function () { return require('./active-drag-drop-area-1990c888.cjs.prod.js' /* webpackChunkName: "active-drag-drop-area" */); }));
|
|
686
703
|
|
|
687
704
|
var DisabledDropArea = /*#__PURE__*/React.lazy(() => Promise.resolve().then(function () { return require('./disabled-drop-area-99c1fa0b.cjs.prod.js' /* webpackChunkName: "disabled-drop-area" */); }));
|
|
688
705
|
|
|
689
|
-
var EnabledDropArea = /*#__PURE__*/React.lazy(() => Promise.resolve().then(function () { return require('./enabled-drop-area-
|
|
706
|
+
var EnabledDropArea = /*#__PURE__*/React.lazy(() => Promise.resolve().then(function () { return require('./enabled-drop-area-2c8702cd.cjs.prod.js' /* webpackChunkName: "enabled-drop-area" */); }));
|
|
690
707
|
|
|
691
|
-
var FileDropped = /*#__PURE__*/React.lazy(() => Promise.resolve().then(function () { return require('./file-dropped-area-
|
|
708
|
+
var FileDropped = /*#__PURE__*/React.lazy(() => Promise.resolve().then(function () { return require('./file-dropped-area-19c71ab9.cjs.prod.js' /* webpackChunkName: "filed-dropped-area" */); }));
|
|
692
709
|
|
|
693
710
|
function getDropArea(_ref) {
|
|
694
711
|
let dropAreaState = _ref.dropAreaState,
|
|
@@ -834,10 +851,20 @@ var messages$5 = reactIntl.defineMessages({
|
|
|
834
851
|
description: 'Generic notification message when file upload fails',
|
|
835
852
|
defaultMessage: 'An unexpected error occurred during the file upload. Please try again, or contact support if this error occurs again.'
|
|
836
853
|
},
|
|
854
|
+
missingRequiredField: {
|
|
855
|
+
id: 'ImportResourcesModal.missingRequiredField',
|
|
856
|
+
description: 'Error message displayed when a required field is missing',
|
|
857
|
+
defaultMessage: 'Missing required field'
|
|
858
|
+
},
|
|
837
859
|
missingKeyError: {
|
|
838
860
|
id: 'ImportResourcesModal.missingKeyError',
|
|
839
861
|
description: 'Error message displayed when the uploaded file is missing the key field',
|
|
840
862
|
defaultMessage: "The 'key' field is missing or incomplete in some rows. Please ensure every row has a 'key' value."
|
|
863
|
+
},
|
|
864
|
+
missingRequiredKeys: {
|
|
865
|
+
id: 'ImportResourcesModal.missingRequiredKeys',
|
|
866
|
+
description: 'Error message displayed when the uploaded file is missing required keys',
|
|
867
|
+
defaultMessage: 'Make sure the file contains required keys for the elements including {fieldNames}'
|
|
841
868
|
}
|
|
842
869
|
});
|
|
843
870
|
|
|
@@ -879,7 +906,7 @@ const useUpload = () => {
|
|
|
879
906
|
})
|
|
880
907
|
});
|
|
881
908
|
if (errors.length > 0) {
|
|
882
|
-
actions.
|
|
909
|
+
actions.setFileUploadErrors(errors);
|
|
883
910
|
actions.setCurrentStep(3);
|
|
884
911
|
return false;
|
|
885
912
|
}
|
|
@@ -892,12 +919,21 @@ const useUpload = () => {
|
|
|
892
919
|
}
|
|
893
920
|
if (error instanceof HttpError) {
|
|
894
921
|
if (error.errorData?.code === 'MISSING_KEY_ERROR') {
|
|
895
|
-
actions.
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
922
|
+
actions.setFileUploadErrors([{
|
|
923
|
+
title: intl.formatMessage(messages$5.missingRequiredField),
|
|
924
|
+
description: intl.formatMessage(messages$5.missingKeyError)
|
|
925
|
+
}]);
|
|
926
|
+
actions.setCurrentStep(3);
|
|
927
|
+
} else if (error.errorData?.code === 'MissingCsvFieldIdentifier') {
|
|
928
|
+
const MissingCsvFieldIdentifierError = error.errorData;
|
|
929
|
+
const fieldNames = formatKeys(MissingCsvFieldIdentifierError.rowValue);
|
|
930
|
+
actions.setFileUploadErrors([{
|
|
931
|
+
title: intl.formatMessage(messages$5.missingRequiredField),
|
|
932
|
+
description: intl.formatMessage(messages$5.missingRequiredKeys, {
|
|
933
|
+
fieldNames
|
|
934
|
+
})
|
|
935
|
+
}]);
|
|
936
|
+
actions.setCurrentStep(3);
|
|
901
937
|
} else if (error.errorData?.invalid > 0) {
|
|
902
938
|
actions.setUploadFileResponse(error.errorData);
|
|
903
939
|
actions.setCurrentStep(3);
|
|
@@ -1163,10 +1199,10 @@ var messages$4 = reactIntl.defineMessages({
|
|
|
1163
1199
|
description: 'In Upload file error modal - "Details" column',
|
|
1164
1200
|
defaultMessage: 'Details'
|
|
1165
1201
|
},
|
|
1166
|
-
|
|
1167
|
-
id: 'ImportResourcesModal.
|
|
1202
|
+
uploadErrorDescription: {
|
|
1203
|
+
id: 'ImportResourcesModal.uploadErrorDescription',
|
|
1168
1204
|
description: 'Title when errors detected while uploading file',
|
|
1169
|
-
defaultMessage: 'There are <b>{errorsCount}</b> errors detected while uploading the file <b>{fileName}</b>.'
|
|
1205
|
+
defaultMessage: 'There {errorsCount, plural, one {is <b>{errorsCount}</b> error} other {are <b>{errorsCount}</b> errors}} detected while uploading the file <b>{fileName}</b>.'
|
|
1170
1206
|
},
|
|
1171
1207
|
supportedValuesDocumentation: {
|
|
1172
1208
|
id: 'ImportResourcesModal.supportedValuesDocumentation',
|
|
@@ -1190,7 +1226,7 @@ const getColumns$1 = () => [{
|
|
|
1190
1226
|
key: 'details',
|
|
1191
1227
|
label: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$a({}, messages$4.details))
|
|
1192
1228
|
}];
|
|
1193
|
-
const
|
|
1229
|
+
const UploadErrorTable = props => {
|
|
1194
1230
|
var _context;
|
|
1195
1231
|
const pagination = uiKit.usePaginationState({
|
|
1196
1232
|
perPage: 10
|
|
@@ -1233,13 +1269,13 @@ function itemRenderer$1(item, column) {
|
|
|
1233
1269
|
|
|
1234
1270
|
function ownKeys$9(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
1235
1271
|
function _objectSpread$9(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$9(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$9(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
1236
|
-
const
|
|
1272
|
+
const UploadErrorsModal = () => {
|
|
1237
1273
|
const intl = reactIntl.useIntl();
|
|
1238
1274
|
const _useImportResourcesCo = useImportResourcesContext(),
|
|
1239
1275
|
state = _useImportResourcesCo.state,
|
|
1240
1276
|
actions = _useImportResourcesCo.actions,
|
|
1241
1277
|
onClose = _useImportResourcesCo.onClose;
|
|
1242
|
-
const errorsCount = state.
|
|
1278
|
+
const errorsCount = state.fileUploadErrors.length;
|
|
1243
1279
|
return jsxRuntime.jsx(applicationComponents.InfoDialog, {
|
|
1244
1280
|
size: 16,
|
|
1245
1281
|
isOpen: true,
|
|
@@ -1250,7 +1286,7 @@ const UploadClientSideErrorsModal = () => {
|
|
|
1250
1286
|
scale: "l",
|
|
1251
1287
|
children: [jsxRuntime.jsx(fullstory.Masking.Mask, {
|
|
1252
1288
|
children: jsxRuntime.jsx(uiKit.Text.Body, {
|
|
1253
|
-
intlMessage: _objectSpread$9(_objectSpread$9({}, messages$4.
|
|
1289
|
+
intlMessage: _objectSpread$9(_objectSpread$9({}, messages$4.uploadErrorDescription), {}, {
|
|
1254
1290
|
values: {
|
|
1255
1291
|
fileName: state.droppedFile?.name,
|
|
1256
1292
|
errorsCount: intl.formatNumber(errorsCount),
|
|
@@ -1258,8 +1294,8 @@ const UploadClientSideErrorsModal = () => {
|
|
|
1258
1294
|
}
|
|
1259
1295
|
})
|
|
1260
1296
|
})
|
|
1261
|
-
}), jsxRuntime.jsx(
|
|
1262
|
-
rows:
|
|
1297
|
+
}), jsxRuntime.jsx(UploadErrorTable, {
|
|
1298
|
+
rows: mapFileUploadErrorsToUploadFileErrorRows(state.fileUploadErrors)
|
|
1263
1299
|
}), jsxRuntime.jsxs(uiKit.Spacings.Inline, {
|
|
1264
1300
|
scale: "m",
|
|
1265
1301
|
justifyContent: "flex-end",
|
|
@@ -1298,7 +1334,7 @@ const getColumns = () => [{
|
|
|
1298
1334
|
key: 'details',
|
|
1299
1335
|
label: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$8({}, messages$4.details))
|
|
1300
1336
|
}];
|
|
1301
|
-
const
|
|
1337
|
+
const UploadRowErrorTable = props => {
|
|
1302
1338
|
var _context;
|
|
1303
1339
|
const pagination = uiKit.usePaginationState({
|
|
1304
1340
|
perPage: 10
|
|
@@ -1329,7 +1365,7 @@ function itemRenderer(item, column) {
|
|
|
1329
1365
|
case 'errorType':
|
|
1330
1366
|
return jsxRuntime.jsx(uiKit.Stamp, {
|
|
1331
1367
|
isCondensed: true,
|
|
1332
|
-
label: item.code,
|
|
1368
|
+
label: formatErrorCode(item.code),
|
|
1333
1369
|
tone: "critical"
|
|
1334
1370
|
});
|
|
1335
1371
|
case 'details':
|
|
@@ -1349,7 +1385,7 @@ function itemRenderer(item, column) {
|
|
|
1349
1385
|
|
|
1350
1386
|
function ownKeys$7(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
1351
1387
|
function _objectSpread$7(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$7(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$7(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
1352
|
-
const
|
|
1388
|
+
const UploadRowErrorsModal = () => {
|
|
1353
1389
|
const intl = reactIntl.useIntl();
|
|
1354
1390
|
const _useImportResourcesCo = useImportResourcesContext(),
|
|
1355
1391
|
state = _useImportResourcesCo.state,
|
|
@@ -1369,7 +1405,7 @@ const UploadServerSideErrorsModal = () => {
|
|
|
1369
1405
|
scale: "xs",
|
|
1370
1406
|
children: [jsxRuntime.jsx(fullstory.Masking.Mask, {
|
|
1371
1407
|
children: jsxRuntime.jsx(uiKit.Text.Body, {
|
|
1372
|
-
intlMessage: _objectSpread$7(_objectSpread$7({}, messages$4.
|
|
1408
|
+
intlMessage: _objectSpread$7(_objectSpread$7({}, messages$4.uploadErrorDescription), {}, {
|
|
1373
1409
|
values: {
|
|
1374
1410
|
fileName: state.droppedFile?.name,
|
|
1375
1411
|
errorsCount: intl.formatNumber(errorsCount),
|
|
@@ -1389,7 +1425,7 @@ const UploadServerSideErrorsModal = () => {
|
|
|
1389
1425
|
}
|
|
1390
1426
|
})
|
|
1391
1427
|
})]
|
|
1392
|
-
}), jsxRuntime.jsx(
|
|
1428
|
+
}), jsxRuntime.jsx(UploadRowErrorTable, {
|
|
1393
1429
|
rows: mapUploadFileErrorsResponseToUploadFileErrorRows(state.uploadFileResponse?.results)
|
|
1394
1430
|
}), jsxRuntime.jsxs(uiKit.Spacings.Inline, {
|
|
1395
1431
|
scale: "m",
|
|
@@ -1783,8 +1819,8 @@ function getBold(msg) {
|
|
|
1783
1819
|
const UploadResult = () => {
|
|
1784
1820
|
const _useImportResourcesCo = useImportResourcesContext(),
|
|
1785
1821
|
state = _useImportResourcesCo.state;
|
|
1786
|
-
if (state.
|
|
1787
|
-
if (state.uploadFileResponse?.invalid > 0) return jsxRuntime.jsx(
|
|
1822
|
+
if (state.fileUploadErrors.length > 0) return jsxRuntime.jsx(UploadErrorsModal, {});
|
|
1823
|
+
if (state.uploadFileResponse?.invalid > 0) return jsxRuntime.jsx(UploadRowErrorsModal, {});
|
|
1788
1824
|
return jsxRuntime.jsx(UploadPreviewModal, {});
|
|
1789
1825
|
};
|
|
1790
1826
|
|
|
@@ -31,6 +31,7 @@ import _findInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instanc
|
|
|
31
31
|
import _includesInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/includes';
|
|
32
32
|
import Papa from 'papaparse';
|
|
33
33
|
import _reduceInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/reduce';
|
|
34
|
+
import _sliceInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/slice';
|
|
34
35
|
import _JSON$stringify from '@babel/runtime-corejs3/core-js-stable/json/stringify';
|
|
35
36
|
import '@babel/runtime-corejs3/core-js-stable/instance/starts-with';
|
|
36
37
|
import '@babel/runtime-corejs3/core-js-stable/url-search-params';
|
|
@@ -45,7 +46,6 @@ import { useShowNotification } from '@commercetools-frontend/actions-global';
|
|
|
45
46
|
import _styled from '@emotion/styled/base';
|
|
46
47
|
import { css } from '@emotion/react';
|
|
47
48
|
import { reportErrorToSentry } from '@commercetools-frontend/sentry';
|
|
48
|
-
import _sliceInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/slice';
|
|
49
49
|
import DataTable from '@commercetools-uikit/data-table';
|
|
50
50
|
import { parseChunkImport, mapLocaleToIntlLocale } from '@commercetools-frontend/i18n';
|
|
51
51
|
|
|
@@ -68,7 +68,7 @@ function reducer(state, action) {
|
|
|
68
68
|
if (action.type === 'cancelImport') return _objectSpread$g(_objectSpread$g({}, state), {}, {
|
|
69
69
|
currentStep: 1,
|
|
70
70
|
containerKey: undefined,
|
|
71
|
-
|
|
71
|
+
fileUploadErrors: [],
|
|
72
72
|
uploadFileResponse: undefined,
|
|
73
73
|
droppedFile: undefined,
|
|
74
74
|
dropAreaState: 'disabled',
|
|
@@ -77,7 +77,7 @@ function reducer(state, action) {
|
|
|
77
77
|
if (action.type === 'uploadNewFile') return _objectSpread$g(_objectSpread$g({}, state), {}, {
|
|
78
78
|
currentStep: 1,
|
|
79
79
|
containerKey: undefined,
|
|
80
|
-
|
|
80
|
+
fileUploadErrors: [],
|
|
81
81
|
uploadFileResponse: undefined,
|
|
82
82
|
droppedFile: undefined,
|
|
83
83
|
dropAreaState: 'ready-for-drop',
|
|
@@ -88,9 +88,9 @@ function reducer(state, action) {
|
|
|
88
88
|
droppedFile: action.droppedFile
|
|
89
89
|
});
|
|
90
90
|
}
|
|
91
|
-
if (action.type === '
|
|
91
|
+
if (action.type === 'setFileUploadErrors') {
|
|
92
92
|
return _objectSpread$g(_objectSpread$g({}, state), {}, {
|
|
93
|
-
|
|
93
|
+
fileUploadErrors: action.fileUploadErrors
|
|
94
94
|
});
|
|
95
95
|
}
|
|
96
96
|
if (action.type === 'setAbortController') {
|
|
@@ -113,7 +113,7 @@ const initialState = {
|
|
|
113
113
|
abortController: new AbortController(),
|
|
114
114
|
dropAreaState: 'disabled',
|
|
115
115
|
uploadFileResponse: undefined,
|
|
116
|
-
|
|
116
|
+
fileUploadErrors: [],
|
|
117
117
|
resourceType: 'category',
|
|
118
118
|
containerKey: undefined,
|
|
119
119
|
progress: 0
|
|
@@ -335,9 +335,9 @@ const mapUploadFileErrorsResponseToUploadFileErrorRows = uploadFileErrorsRespons
|
|
|
335
335
|
}));
|
|
336
336
|
});
|
|
337
337
|
};
|
|
338
|
-
const
|
|
338
|
+
const mapFileUploadErrorsToUploadFileErrorRows = uploadFileErrors => {
|
|
339
339
|
let idCounter = 1;
|
|
340
|
-
return _mapInstanceProperty(
|
|
340
|
+
return _mapInstanceProperty(uploadFileErrors).call(uploadFileErrors, uploadFileError => _objectSpread$e(_objectSpread$e({}, uploadFileError), {}, {
|
|
341
341
|
id: String(idCounter++)
|
|
342
342
|
}));
|
|
343
343
|
};
|
|
@@ -386,6 +386,23 @@ function convertFileSizeToKB(sizeInBytes) {
|
|
|
386
386
|
function isAbortError(error) {
|
|
387
387
|
return error instanceof DOMException && error.name === 'AbortError';
|
|
388
388
|
}
|
|
389
|
+
function formatKeys(obj) {
|
|
390
|
+
var _context;
|
|
391
|
+
if (typeof obj !== 'object' || obj === null) return '';
|
|
392
|
+
const keys = _mapInstanceProperty(_context = _Object$keys(obj)).call(_context, key => key.replace(/([a-z])([A-Z])/g, '$1 $2').toLowerCase());
|
|
393
|
+
if (keys.length === 0) return '';
|
|
394
|
+
if (keys.length === 1) return keys[0];
|
|
395
|
+
return `${_sliceInstanceProperty(keys).call(keys, 0, -1).join(', ')} and ${keys[keys.length - 1]}`;
|
|
396
|
+
}
|
|
397
|
+
function formatErrorCode(code) {
|
|
398
|
+
try {
|
|
399
|
+
const formattedCode = code.replace(/([a-z])([A-Z])/g, '$1 $2').replace(/([A-Z])([A-Z][a-z])/g, '$1 $2').toLowerCase();
|
|
400
|
+
let result = formattedCode.charAt(0).toUpperCase() + _sliceInstanceProperty(formattedCode).call(formattedCode, 1);
|
|
401
|
+
return result;
|
|
402
|
+
} catch (error) {
|
|
403
|
+
return code;
|
|
404
|
+
}
|
|
405
|
+
}
|
|
389
406
|
|
|
390
407
|
const encodeFileNameWithTimestampToContainerKey = fileName => {
|
|
391
408
|
return btoa(_JSON$stringify({
|
|
@@ -559,9 +576,9 @@ const ImportResourcesProvider = props => {
|
|
|
559
576
|
type: 'setAbortController',
|
|
560
577
|
abortController: abortController
|
|
561
578
|
});
|
|
562
|
-
const
|
|
563
|
-
type: '
|
|
564
|
-
|
|
579
|
+
const setFileUploadErrors = fileUploadErrors => dispatch({
|
|
580
|
+
type: 'setFileUploadErrors',
|
|
581
|
+
fileUploadErrors: fileUploadErrors
|
|
565
582
|
});
|
|
566
583
|
const setProgress = progress => dispatch({
|
|
567
584
|
type: 'setProgress',
|
|
@@ -593,7 +610,7 @@ const ImportResourcesProvider = props => {
|
|
|
593
610
|
setDroppedFile,
|
|
594
611
|
setContainerKey,
|
|
595
612
|
setAbortController,
|
|
596
|
-
|
|
613
|
+
setFileUploadErrors,
|
|
597
614
|
setProgress
|
|
598
615
|
}
|
|
599
616
|
},
|
|
@@ -656,13 +673,13 @@ function getDefaultDropWrapperStyles(_dropAreaState) {
|
|
|
656
673
|
return /*#__PURE__*/css(process.env.NODE_ENV === "production" ? "" : ";label:getDefaultDropWrapperStyles;", process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImRyb3AtYXJlYS13cmFwcGVyLnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUE0QlkiLCJmaWxlIjoiZHJvcC1hcmVhLXdyYXBwZXIudHN4Iiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgdHlwZSBEcm9wem9uZVJvb3RQcm9wcyB9IGZyb20gJ3JlYWN0LWRyb3B6b25lJ1xuaW1wb3J0IHsgY3NzIH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnXG5pbXBvcnQgc3R5bGVkIGZyb20gJ0BlbW90aW9uL3N0eWxlZCdcbmltcG9ydCB7IHN0eWxlcyB9IGZyb20gJy4vc3R5bGVzJ1xuaW1wb3J0IHsgdHlwZSBEcm9wQXJlYVN0YXRlIH0gZnJvbSAnLi4vLi4vLi4vQHR5cGVzJ1xuXG5pbnRlcmZhY2UgRHJvcFdyYXBwZXJQcm9wcyBleHRlbmRzIERyb3B6b25lUm9vdFByb3BzIHtcbiAgZHJvcEFyZWFTdGF0ZTogRHJvcEFyZWFTdGF0ZVxufVxuZXhwb3J0IGNvbnN0IERyb3BXcmFwcGVyID0gc3R5bGVkLmRpdjxEcm9wV3JhcHBlclByb3BzPmBcbiAgJHtzdHlsZXMuYmFzZX1cbiAgJHsocHJvcHMpID0+IHtcbiAgICBpZiAocHJvcHMuZHJvcEFyZWFTdGF0ZSA9PT0gJ2Rpc2FibGVkJykge1xuICAgICAgcmV0dXJuIHN0eWxlcy5kaXNhYmxlZFxuICAgIH1cbiAgICBpZiAocHJvcHMuZHJvcEFyZWFTdGF0ZSA9PT0gJ3JlYWR5LWZvci1kcm9wJykge1xuICAgICAgcmV0dXJuIHN0eWxlcy5yZWFkeUZvckRyb3BcbiAgICB9XG4gICAgaWYgKHByb3BzLmRyb3BBcmVhU3RhdGUgPT09ICdhY3RpdmUtZHJhZycpIHtcbiAgICAgIHJldHVybiBzdHlsZXMuYWN0aXZlRHJhZ1xuICAgIH1cbiAgICBpZiAocHJvcHMuZHJvcEFyZWFTdGF0ZSA9PT0gJ2ZpbGUtZHJvcHBlZCcpIHtcbiAgICAgIHJldHVybiBzdHlsZXMuZmlsZURyb3BwZWRcbiAgICB9XG4gICAgcmV0dXJuIGdldERlZmF1bHREcm9wV3JhcHBlclN0eWxlcyhwcm9wcy5kcm9wQXJlYVN0YXRlKVxuICB9fVxuYFxuZnVuY3Rpb24gZ2V0RGVmYXVsdERyb3BXcmFwcGVyU3R5bGVzKF9kcm9wQXJlYVN0YXRlOiBuZXZlcikge1xuICByZXR1cm4gY3NzYGBcbn1cbiJdfQ== */");
|
|
657
674
|
}
|
|
658
675
|
|
|
659
|
-
var ActiveDragDropArea = /*#__PURE__*/lazy(() => import('./active-drag-drop-area-
|
|
676
|
+
var ActiveDragDropArea = /*#__PURE__*/lazy(() => import('./active-drag-drop-area-245e26d9.esm.js' /* webpackChunkName: "active-drag-drop-area" */));
|
|
660
677
|
|
|
661
678
|
var DisabledDropArea = /*#__PURE__*/lazy(() => import('./disabled-drop-area-2c088477.esm.js' /* webpackChunkName: "disabled-drop-area" */));
|
|
662
679
|
|
|
663
|
-
var EnabledDropArea = /*#__PURE__*/lazy(() => import('./enabled-drop-area-
|
|
680
|
+
var EnabledDropArea = /*#__PURE__*/lazy(() => import('./enabled-drop-area-118cf588.esm.js' /* webpackChunkName: "enabled-drop-area" */));
|
|
664
681
|
|
|
665
|
-
var FileDropped = /*#__PURE__*/lazy(() => import('./file-dropped-area-
|
|
682
|
+
var FileDropped = /*#__PURE__*/lazy(() => import('./file-dropped-area-ef80a054.esm.js' /* webpackChunkName: "filed-dropped-area" */));
|
|
666
683
|
|
|
667
684
|
function getDropArea(_ref) {
|
|
668
685
|
let dropAreaState = _ref.dropAreaState,
|
|
@@ -808,10 +825,20 @@ var messages$5 = defineMessages({
|
|
|
808
825
|
description: 'Generic notification message when file upload fails',
|
|
809
826
|
defaultMessage: 'An unexpected error occurred during the file upload. Please try again, or contact support if this error occurs again.'
|
|
810
827
|
},
|
|
828
|
+
missingRequiredField: {
|
|
829
|
+
id: 'ImportResourcesModal.missingRequiredField',
|
|
830
|
+
description: 'Error message displayed when a required field is missing',
|
|
831
|
+
defaultMessage: 'Missing required field'
|
|
832
|
+
},
|
|
811
833
|
missingKeyError: {
|
|
812
834
|
id: 'ImportResourcesModal.missingKeyError',
|
|
813
835
|
description: 'Error message displayed when the uploaded file is missing the key field',
|
|
814
836
|
defaultMessage: "The 'key' field is missing or incomplete in some rows. Please ensure every row has a 'key' value."
|
|
837
|
+
},
|
|
838
|
+
missingRequiredKeys: {
|
|
839
|
+
id: 'ImportResourcesModal.missingRequiredKeys',
|
|
840
|
+
description: 'Error message displayed when the uploaded file is missing required keys',
|
|
841
|
+
defaultMessage: 'Make sure the file contains required keys for the elements including {fieldNames}'
|
|
815
842
|
}
|
|
816
843
|
});
|
|
817
844
|
|
|
@@ -853,7 +880,7 @@ const useUpload = () => {
|
|
|
853
880
|
})
|
|
854
881
|
});
|
|
855
882
|
if (errors.length > 0) {
|
|
856
|
-
actions.
|
|
883
|
+
actions.setFileUploadErrors(errors);
|
|
857
884
|
actions.setCurrentStep(3);
|
|
858
885
|
return false;
|
|
859
886
|
}
|
|
@@ -866,12 +893,21 @@ const useUpload = () => {
|
|
|
866
893
|
}
|
|
867
894
|
if (error instanceof HttpError) {
|
|
868
895
|
if (error.errorData?.code === 'MISSING_KEY_ERROR') {
|
|
869
|
-
actions.
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
896
|
+
actions.setFileUploadErrors([{
|
|
897
|
+
title: intl.formatMessage(messages$5.missingRequiredField),
|
|
898
|
+
description: intl.formatMessage(messages$5.missingKeyError)
|
|
899
|
+
}]);
|
|
900
|
+
actions.setCurrentStep(3);
|
|
901
|
+
} else if (error.errorData?.code === 'MissingCsvFieldIdentifier') {
|
|
902
|
+
const MissingCsvFieldIdentifierError = error.errorData;
|
|
903
|
+
const fieldNames = formatKeys(MissingCsvFieldIdentifierError.rowValue);
|
|
904
|
+
actions.setFileUploadErrors([{
|
|
905
|
+
title: intl.formatMessage(messages$5.missingRequiredField),
|
|
906
|
+
description: intl.formatMessage(messages$5.missingRequiredKeys, {
|
|
907
|
+
fieldNames
|
|
908
|
+
})
|
|
909
|
+
}]);
|
|
910
|
+
actions.setCurrentStep(3);
|
|
875
911
|
} else if (error.errorData?.invalid > 0) {
|
|
876
912
|
actions.setUploadFileResponse(error.errorData);
|
|
877
913
|
actions.setCurrentStep(3);
|
|
@@ -1137,10 +1173,10 @@ var messages$4 = defineMessages({
|
|
|
1137
1173
|
description: 'In Upload file error modal - "Details" column',
|
|
1138
1174
|
defaultMessage: 'Details'
|
|
1139
1175
|
},
|
|
1140
|
-
|
|
1141
|
-
id: 'ImportResourcesModal.
|
|
1176
|
+
uploadErrorDescription: {
|
|
1177
|
+
id: 'ImportResourcesModal.uploadErrorDescription',
|
|
1142
1178
|
description: 'Title when errors detected while uploading file',
|
|
1143
|
-
defaultMessage: 'There are <b>{errorsCount}</b> errors detected while uploading the file <b>{fileName}</b>.'
|
|
1179
|
+
defaultMessage: 'There {errorsCount, plural, one {is <b>{errorsCount}</b> error} other {are <b>{errorsCount}</b> errors}} detected while uploading the file <b>{fileName}</b>.'
|
|
1144
1180
|
},
|
|
1145
1181
|
supportedValuesDocumentation: {
|
|
1146
1182
|
id: 'ImportResourcesModal.supportedValuesDocumentation',
|
|
@@ -1164,7 +1200,7 @@ const getColumns$1 = () => [{
|
|
|
1164
1200
|
key: 'details',
|
|
1165
1201
|
label: jsx(FormattedMessage, _objectSpread$a({}, messages$4.details))
|
|
1166
1202
|
}];
|
|
1167
|
-
const
|
|
1203
|
+
const UploadErrorTable = props => {
|
|
1168
1204
|
var _context;
|
|
1169
1205
|
const pagination = usePaginationState({
|
|
1170
1206
|
perPage: 10
|
|
@@ -1207,13 +1243,13 @@ function itemRenderer$1(item, column) {
|
|
|
1207
1243
|
|
|
1208
1244
|
function ownKeys$9(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
1209
1245
|
function _objectSpread$9(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context = ownKeys$9(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context2 = ownKeys$9(Object(t))).call(_context2, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
1210
|
-
const
|
|
1246
|
+
const UploadErrorsModal = () => {
|
|
1211
1247
|
const intl = useIntl();
|
|
1212
1248
|
const _useImportResourcesCo = useImportResourcesContext(),
|
|
1213
1249
|
state = _useImportResourcesCo.state,
|
|
1214
1250
|
actions = _useImportResourcesCo.actions,
|
|
1215
1251
|
onClose = _useImportResourcesCo.onClose;
|
|
1216
|
-
const errorsCount = state.
|
|
1252
|
+
const errorsCount = state.fileUploadErrors.length;
|
|
1217
1253
|
return jsx(InfoDialog, {
|
|
1218
1254
|
size: 16,
|
|
1219
1255
|
isOpen: true,
|
|
@@ -1224,7 +1260,7 @@ const UploadClientSideErrorsModal = () => {
|
|
|
1224
1260
|
scale: "l",
|
|
1225
1261
|
children: [jsx(Masking.Mask, {
|
|
1226
1262
|
children: jsx(Text.Body, {
|
|
1227
|
-
intlMessage: _objectSpread$9(_objectSpread$9({}, messages$4.
|
|
1263
|
+
intlMessage: _objectSpread$9(_objectSpread$9({}, messages$4.uploadErrorDescription), {}, {
|
|
1228
1264
|
values: {
|
|
1229
1265
|
fileName: state.droppedFile?.name,
|
|
1230
1266
|
errorsCount: intl.formatNumber(errorsCount),
|
|
@@ -1232,8 +1268,8 @@ const UploadClientSideErrorsModal = () => {
|
|
|
1232
1268
|
}
|
|
1233
1269
|
})
|
|
1234
1270
|
})
|
|
1235
|
-
}), jsx(
|
|
1236
|
-
rows:
|
|
1271
|
+
}), jsx(UploadErrorTable, {
|
|
1272
|
+
rows: mapFileUploadErrorsToUploadFileErrorRows(state.fileUploadErrors)
|
|
1237
1273
|
}), jsxs(Spacings.Inline, {
|
|
1238
1274
|
scale: "m",
|
|
1239
1275
|
justifyContent: "flex-end",
|
|
@@ -1272,7 +1308,7 @@ const getColumns = () => [{
|
|
|
1272
1308
|
key: 'details',
|
|
1273
1309
|
label: jsx(FormattedMessage, _objectSpread$8({}, messages$4.details))
|
|
1274
1310
|
}];
|
|
1275
|
-
const
|
|
1311
|
+
const UploadRowErrorTable = props => {
|
|
1276
1312
|
var _context;
|
|
1277
1313
|
const pagination = usePaginationState({
|
|
1278
1314
|
perPage: 10
|
|
@@ -1303,7 +1339,7 @@ function itemRenderer(item, column) {
|
|
|
1303
1339
|
case 'errorType':
|
|
1304
1340
|
return jsx(Stamp, {
|
|
1305
1341
|
isCondensed: true,
|
|
1306
|
-
label: item.code,
|
|
1342
|
+
label: formatErrorCode(item.code),
|
|
1307
1343
|
tone: "critical"
|
|
1308
1344
|
});
|
|
1309
1345
|
case 'details':
|
|
@@ -1323,7 +1359,7 @@ function itemRenderer(item, column) {
|
|
|
1323
1359
|
|
|
1324
1360
|
function ownKeys$7(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
1325
1361
|
function _objectSpread$7(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context = ownKeys$7(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context2 = ownKeys$7(Object(t))).call(_context2, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
1326
|
-
const
|
|
1362
|
+
const UploadRowErrorsModal = () => {
|
|
1327
1363
|
const intl = useIntl();
|
|
1328
1364
|
const _useImportResourcesCo = useImportResourcesContext(),
|
|
1329
1365
|
state = _useImportResourcesCo.state,
|
|
@@ -1343,7 +1379,7 @@ const UploadServerSideErrorsModal = () => {
|
|
|
1343
1379
|
scale: "xs",
|
|
1344
1380
|
children: [jsx(Masking.Mask, {
|
|
1345
1381
|
children: jsx(Text.Body, {
|
|
1346
|
-
intlMessage: _objectSpread$7(_objectSpread$7({}, messages$4.
|
|
1382
|
+
intlMessage: _objectSpread$7(_objectSpread$7({}, messages$4.uploadErrorDescription), {}, {
|
|
1347
1383
|
values: {
|
|
1348
1384
|
fileName: state.droppedFile?.name,
|
|
1349
1385
|
errorsCount: intl.formatNumber(errorsCount),
|
|
@@ -1363,7 +1399,7 @@ const UploadServerSideErrorsModal = () => {
|
|
|
1363
1399
|
}
|
|
1364
1400
|
})
|
|
1365
1401
|
})]
|
|
1366
|
-
}), jsx(
|
|
1402
|
+
}), jsx(UploadRowErrorTable, {
|
|
1367
1403
|
rows: mapUploadFileErrorsResponseToUploadFileErrorRows(state.uploadFileResponse?.results)
|
|
1368
1404
|
}), jsxs(Spacings.Inline, {
|
|
1369
1405
|
scale: "m",
|
|
@@ -1771,8 +1807,8 @@ function getBold(msg) {
|
|
|
1771
1807
|
const UploadResult = () => {
|
|
1772
1808
|
const _useImportResourcesCo = useImportResourcesContext(),
|
|
1773
1809
|
state = _useImportResourcesCo.state;
|
|
1774
|
-
if (state.
|
|
1775
|
-
if (state.uploadFileResponse?.invalid > 0) return jsx(
|
|
1810
|
+
if (state.fileUploadErrors.length > 0) return jsx(UploadErrorsModal, {});
|
|
1811
|
+
if (state.uploadFileResponse?.invalid > 0) return jsx(UploadRowErrorsModal, {});
|
|
1776
1812
|
return jsx(UploadPreviewModal, {});
|
|
1777
1813
|
};
|
|
1778
1814
|
|
|
@@ -33,6 +33,7 @@ var _findInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/insta
|
|
|
33
33
|
var _includesInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/includes');
|
|
34
34
|
var Papa = require('papaparse');
|
|
35
35
|
var _reduceInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/reduce');
|
|
36
|
+
var _sliceInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/slice');
|
|
36
37
|
var _JSON$stringify = require('@babel/runtime-corejs3/core-js-stable/json/stringify');
|
|
37
38
|
require('@babel/runtime-corejs3/core-js-stable/instance/starts-with');
|
|
38
39
|
require('@babel/runtime-corejs3/core-js-stable/url-search-params');
|
|
@@ -47,7 +48,6 @@ var actionsGlobal = require('@commercetools-frontend/actions-global');
|
|
|
47
48
|
var _styled = require('@emotion/styled/base');
|
|
48
49
|
var react = require('@emotion/react');
|
|
49
50
|
var sentry = require('@commercetools-frontend/sentry');
|
|
50
|
-
var _sliceInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/slice');
|
|
51
51
|
var DataTable = require('@commercetools-uikit/data-table');
|
|
52
52
|
var i18n = require('@commercetools-frontend/i18n');
|
|
53
53
|
|
|
@@ -72,10 +72,10 @@ var _findInstanceProperty__default = /*#__PURE__*/_interopDefault(_findInstanceP
|
|
|
72
72
|
var _includesInstanceProperty__default = /*#__PURE__*/_interopDefault(_includesInstanceProperty);
|
|
73
73
|
var Papa__default = /*#__PURE__*/_interopDefault(Papa);
|
|
74
74
|
var _reduceInstanceProperty__default = /*#__PURE__*/_interopDefault(_reduceInstanceProperty);
|
|
75
|
+
var _sliceInstanceProperty__default = /*#__PURE__*/_interopDefault(_sliceInstanceProperty);
|
|
75
76
|
var _JSON$stringify__default = /*#__PURE__*/_interopDefault(_JSON$stringify);
|
|
76
77
|
var _someInstanceProperty__default = /*#__PURE__*/_interopDefault(_someInstanceProperty);
|
|
77
78
|
var _styled__default = /*#__PURE__*/_interopDefault(_styled);
|
|
78
|
-
var _sliceInstanceProperty__default = /*#__PURE__*/_interopDefault(_sliceInstanceProperty);
|
|
79
79
|
var DataTable__default = /*#__PURE__*/_interopDefault(DataTable);
|
|
80
80
|
|
|
81
81
|
function ownKeys$g(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
@@ -97,7 +97,7 @@ function reducer(state, action) {
|
|
|
97
97
|
if (action.type === 'cancelImport') return _objectSpread$g(_objectSpread$g({}, state), {}, {
|
|
98
98
|
currentStep: 1,
|
|
99
99
|
containerKey: undefined,
|
|
100
|
-
|
|
100
|
+
fileUploadErrors: [],
|
|
101
101
|
uploadFileResponse: undefined,
|
|
102
102
|
droppedFile: undefined,
|
|
103
103
|
dropAreaState: 'disabled',
|
|
@@ -106,7 +106,7 @@ function reducer(state, action) {
|
|
|
106
106
|
if (action.type === 'uploadNewFile') return _objectSpread$g(_objectSpread$g({}, state), {}, {
|
|
107
107
|
currentStep: 1,
|
|
108
108
|
containerKey: undefined,
|
|
109
|
-
|
|
109
|
+
fileUploadErrors: [],
|
|
110
110
|
uploadFileResponse: undefined,
|
|
111
111
|
droppedFile: undefined,
|
|
112
112
|
dropAreaState: 'ready-for-drop',
|
|
@@ -117,9 +117,9 @@ function reducer(state, action) {
|
|
|
117
117
|
droppedFile: action.droppedFile
|
|
118
118
|
});
|
|
119
119
|
}
|
|
120
|
-
if (action.type === '
|
|
120
|
+
if (action.type === 'setFileUploadErrors') {
|
|
121
121
|
return _objectSpread$g(_objectSpread$g({}, state), {}, {
|
|
122
|
-
|
|
122
|
+
fileUploadErrors: action.fileUploadErrors
|
|
123
123
|
});
|
|
124
124
|
}
|
|
125
125
|
if (action.type === 'setAbortController') {
|
|
@@ -142,7 +142,7 @@ const initialState = {
|
|
|
142
142
|
abortController: new AbortController(),
|
|
143
143
|
dropAreaState: 'disabled',
|
|
144
144
|
uploadFileResponse: undefined,
|
|
145
|
-
|
|
145
|
+
fileUploadErrors: [],
|
|
146
146
|
resourceType: 'category',
|
|
147
147
|
containerKey: undefined,
|
|
148
148
|
progress: 0
|
|
@@ -364,9 +364,9 @@ const mapUploadFileErrorsResponseToUploadFileErrorRows = uploadFileErrorsRespons
|
|
|
364
364
|
}));
|
|
365
365
|
});
|
|
366
366
|
};
|
|
367
|
-
const
|
|
367
|
+
const mapFileUploadErrorsToUploadFileErrorRows = uploadFileErrors => {
|
|
368
368
|
let idCounter = 1;
|
|
369
|
-
return _mapInstanceProperty__default["default"](
|
|
369
|
+
return _mapInstanceProperty__default["default"](uploadFileErrors).call(uploadFileErrors, uploadFileError => _objectSpread$e(_objectSpread$e({}, uploadFileError), {}, {
|
|
370
370
|
id: String(idCounter++)
|
|
371
371
|
}));
|
|
372
372
|
};
|
|
@@ -415,6 +415,23 @@ function convertFileSizeToKB(sizeInBytes) {
|
|
|
415
415
|
function isAbortError(error) {
|
|
416
416
|
return error instanceof DOMException && error.name === 'AbortError';
|
|
417
417
|
}
|
|
418
|
+
function formatKeys(obj) {
|
|
419
|
+
var _context;
|
|
420
|
+
if (typeof obj !== 'object' || obj === null) return '';
|
|
421
|
+
const keys = _mapInstanceProperty__default["default"](_context = _Object$keys__default["default"](obj)).call(_context, key => key.replace(/([a-z])([A-Z])/g, '$1 $2').toLowerCase());
|
|
422
|
+
if (keys.length === 0) return '';
|
|
423
|
+
if (keys.length === 1) return keys[0];
|
|
424
|
+
return `${_sliceInstanceProperty__default["default"](keys).call(keys, 0, -1).join(', ')} and ${keys[keys.length - 1]}`;
|
|
425
|
+
}
|
|
426
|
+
function formatErrorCode(code) {
|
|
427
|
+
try {
|
|
428
|
+
const formattedCode = code.replace(/([a-z])([A-Z])/g, '$1 $2').replace(/([A-Z])([A-Z][a-z])/g, '$1 $2').toLowerCase();
|
|
429
|
+
let result = formattedCode.charAt(0).toUpperCase() + _sliceInstanceProperty__default["default"](formattedCode).call(formattedCode, 1);
|
|
430
|
+
return result;
|
|
431
|
+
} catch (error) {
|
|
432
|
+
return code;
|
|
433
|
+
}
|
|
434
|
+
}
|
|
418
435
|
|
|
419
436
|
const encodeFileNameWithTimestampToContainerKey = fileName => {
|
|
420
437
|
return btoa(_JSON$stringify__default["default"]({
|
|
@@ -588,9 +605,9 @@ const ImportResourcesProvider = props => {
|
|
|
588
605
|
type: 'setAbortController',
|
|
589
606
|
abortController: abortController
|
|
590
607
|
});
|
|
591
|
-
const
|
|
592
|
-
type: '
|
|
593
|
-
|
|
608
|
+
const setFileUploadErrors = fileUploadErrors => dispatch({
|
|
609
|
+
type: 'setFileUploadErrors',
|
|
610
|
+
fileUploadErrors: fileUploadErrors
|
|
594
611
|
});
|
|
595
612
|
const setProgress = progress => dispatch({
|
|
596
613
|
type: 'setProgress',
|
|
@@ -622,7 +639,7 @@ const ImportResourcesProvider = props => {
|
|
|
622
639
|
setDroppedFile,
|
|
623
640
|
setContainerKey,
|
|
624
641
|
setAbortController,
|
|
625
|
-
|
|
642
|
+
setFileUploadErrors,
|
|
626
643
|
setProgress
|
|
627
644
|
}
|
|
628
645
|
},
|
|
@@ -685,13 +702,13 @@ function getDefaultDropWrapperStyles(_dropAreaState) {
|
|
|
685
702
|
return /*#__PURE__*/react.css(process.env.NODE_ENV === "production" ? "" : ";label:getDefaultDropWrapperStyles;", process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImRyb3AtYXJlYS13cmFwcGVyLnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUE0QlkiLCJmaWxlIjoiZHJvcC1hcmVhLXdyYXBwZXIudHN4Iiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgdHlwZSBEcm9wem9uZVJvb3RQcm9wcyB9IGZyb20gJ3JlYWN0LWRyb3B6b25lJ1xuaW1wb3J0IHsgY3NzIH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnXG5pbXBvcnQgc3R5bGVkIGZyb20gJ0BlbW90aW9uL3N0eWxlZCdcbmltcG9ydCB7IHN0eWxlcyB9IGZyb20gJy4vc3R5bGVzJ1xuaW1wb3J0IHsgdHlwZSBEcm9wQXJlYVN0YXRlIH0gZnJvbSAnLi4vLi4vLi4vQHR5cGVzJ1xuXG5pbnRlcmZhY2UgRHJvcFdyYXBwZXJQcm9wcyBleHRlbmRzIERyb3B6b25lUm9vdFByb3BzIHtcbiAgZHJvcEFyZWFTdGF0ZTogRHJvcEFyZWFTdGF0ZVxufVxuZXhwb3J0IGNvbnN0IERyb3BXcmFwcGVyID0gc3R5bGVkLmRpdjxEcm9wV3JhcHBlclByb3BzPmBcbiAgJHtzdHlsZXMuYmFzZX1cbiAgJHsocHJvcHMpID0+IHtcbiAgICBpZiAocHJvcHMuZHJvcEFyZWFTdGF0ZSA9PT0gJ2Rpc2FibGVkJykge1xuICAgICAgcmV0dXJuIHN0eWxlcy5kaXNhYmxlZFxuICAgIH1cbiAgICBpZiAocHJvcHMuZHJvcEFyZWFTdGF0ZSA9PT0gJ3JlYWR5LWZvci1kcm9wJykge1xuICAgICAgcmV0dXJuIHN0eWxlcy5yZWFkeUZvckRyb3BcbiAgICB9XG4gICAgaWYgKHByb3BzLmRyb3BBcmVhU3RhdGUgPT09ICdhY3RpdmUtZHJhZycpIHtcbiAgICAgIHJldHVybiBzdHlsZXMuYWN0aXZlRHJhZ1xuICAgIH1cbiAgICBpZiAocHJvcHMuZHJvcEFyZWFTdGF0ZSA9PT0gJ2ZpbGUtZHJvcHBlZCcpIHtcbiAgICAgIHJldHVybiBzdHlsZXMuZmlsZURyb3BwZWRcbiAgICB9XG4gICAgcmV0dXJuIGdldERlZmF1bHREcm9wV3JhcHBlclN0eWxlcyhwcm9wcy5kcm9wQXJlYVN0YXRlKVxuICB9fVxuYFxuZnVuY3Rpb24gZ2V0RGVmYXVsdERyb3BXcmFwcGVyU3R5bGVzKF9kcm9wQXJlYVN0YXRlOiBuZXZlcikge1xuICByZXR1cm4gY3NzYGBcbn1cbiJdfQ== */");
|
|
686
703
|
}
|
|
687
704
|
|
|
688
|
-
var ActiveDragDropArea = /*#__PURE__*/React.lazy(() => Promise.resolve().then(function () { return require('./active-drag-drop-area-
|
|
705
|
+
var ActiveDragDropArea = /*#__PURE__*/React.lazy(() => Promise.resolve().then(function () { return require('./active-drag-drop-area-a07d4eb3.cjs.dev.js' /* webpackChunkName: "active-drag-drop-area" */); }));
|
|
689
706
|
|
|
690
707
|
var DisabledDropArea = /*#__PURE__*/React.lazy(() => Promise.resolve().then(function () { return require('./disabled-drop-area-aa78075b.cjs.dev.js' /* webpackChunkName: "disabled-drop-area" */); }));
|
|
691
708
|
|
|
692
|
-
var EnabledDropArea = /*#__PURE__*/React.lazy(() => Promise.resolve().then(function () { return require('./enabled-drop-area-
|
|
709
|
+
var EnabledDropArea = /*#__PURE__*/React.lazy(() => Promise.resolve().then(function () { return require('./enabled-drop-area-11c61ee2.cjs.dev.js' /* webpackChunkName: "enabled-drop-area" */); }));
|
|
693
710
|
|
|
694
|
-
var FileDropped = /*#__PURE__*/React.lazy(() => Promise.resolve().then(function () { return require('./file-dropped-area-
|
|
711
|
+
var FileDropped = /*#__PURE__*/React.lazy(() => Promise.resolve().then(function () { return require('./file-dropped-area-59803011.cjs.dev.js' /* webpackChunkName: "filed-dropped-area" */); }));
|
|
695
712
|
|
|
696
713
|
function getDropArea(_ref) {
|
|
697
714
|
let dropAreaState = _ref.dropAreaState,
|
|
@@ -837,10 +854,20 @@ var messages$5 = reactIntl.defineMessages({
|
|
|
837
854
|
description: 'Generic notification message when file upload fails',
|
|
838
855
|
defaultMessage: 'An unexpected error occurred during the file upload. Please try again, or contact support if this error occurs again.'
|
|
839
856
|
},
|
|
857
|
+
missingRequiredField: {
|
|
858
|
+
id: 'ImportResourcesModal.missingRequiredField',
|
|
859
|
+
description: 'Error message displayed when a required field is missing',
|
|
860
|
+
defaultMessage: 'Missing required field'
|
|
861
|
+
},
|
|
840
862
|
missingKeyError: {
|
|
841
863
|
id: 'ImportResourcesModal.missingKeyError',
|
|
842
864
|
description: 'Error message displayed when the uploaded file is missing the key field',
|
|
843
865
|
defaultMessage: "The 'key' field is missing or incomplete in some rows. Please ensure every row has a 'key' value."
|
|
866
|
+
},
|
|
867
|
+
missingRequiredKeys: {
|
|
868
|
+
id: 'ImportResourcesModal.missingRequiredKeys',
|
|
869
|
+
description: 'Error message displayed when the uploaded file is missing required keys',
|
|
870
|
+
defaultMessage: 'Make sure the file contains required keys for the elements including {fieldNames}'
|
|
844
871
|
}
|
|
845
872
|
});
|
|
846
873
|
|
|
@@ -882,7 +909,7 @@ const useUpload = () => {
|
|
|
882
909
|
})
|
|
883
910
|
});
|
|
884
911
|
if (errors.length > 0) {
|
|
885
|
-
actions.
|
|
912
|
+
actions.setFileUploadErrors(errors);
|
|
886
913
|
actions.setCurrentStep(3);
|
|
887
914
|
return false;
|
|
888
915
|
}
|
|
@@ -895,12 +922,21 @@ const useUpload = () => {
|
|
|
895
922
|
}
|
|
896
923
|
if (error instanceof HttpError) {
|
|
897
924
|
if (error.errorData?.code === 'MISSING_KEY_ERROR') {
|
|
898
|
-
actions.
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
925
|
+
actions.setFileUploadErrors([{
|
|
926
|
+
title: intl.formatMessage(messages$5.missingRequiredField),
|
|
927
|
+
description: intl.formatMessage(messages$5.missingKeyError)
|
|
928
|
+
}]);
|
|
929
|
+
actions.setCurrentStep(3);
|
|
930
|
+
} else if (error.errorData?.code === 'MissingCsvFieldIdentifier') {
|
|
931
|
+
const MissingCsvFieldIdentifierError = error.errorData;
|
|
932
|
+
const fieldNames = formatKeys(MissingCsvFieldIdentifierError.rowValue);
|
|
933
|
+
actions.setFileUploadErrors([{
|
|
934
|
+
title: intl.formatMessage(messages$5.missingRequiredField),
|
|
935
|
+
description: intl.formatMessage(messages$5.missingRequiredKeys, {
|
|
936
|
+
fieldNames
|
|
937
|
+
})
|
|
938
|
+
}]);
|
|
939
|
+
actions.setCurrentStep(3);
|
|
904
940
|
} else if (error.errorData?.invalid > 0) {
|
|
905
941
|
actions.setUploadFileResponse(error.errorData);
|
|
906
942
|
actions.setCurrentStep(3);
|
|
@@ -1166,10 +1202,10 @@ var messages$4 = reactIntl.defineMessages({
|
|
|
1166
1202
|
description: 'In Upload file error modal - "Details" column',
|
|
1167
1203
|
defaultMessage: 'Details'
|
|
1168
1204
|
},
|
|
1169
|
-
|
|
1170
|
-
id: 'ImportResourcesModal.
|
|
1205
|
+
uploadErrorDescription: {
|
|
1206
|
+
id: 'ImportResourcesModal.uploadErrorDescription',
|
|
1171
1207
|
description: 'Title when errors detected while uploading file',
|
|
1172
|
-
defaultMessage: 'There are <b>{errorsCount}</b> errors detected while uploading the file <b>{fileName}</b>.'
|
|
1208
|
+
defaultMessage: 'There {errorsCount, plural, one {is <b>{errorsCount}</b> error} other {are <b>{errorsCount}</b> errors}} detected while uploading the file <b>{fileName}</b>.'
|
|
1173
1209
|
},
|
|
1174
1210
|
supportedValuesDocumentation: {
|
|
1175
1211
|
id: 'ImportResourcesModal.supportedValuesDocumentation',
|
|
@@ -1193,7 +1229,7 @@ const getColumns$1 = () => [{
|
|
|
1193
1229
|
key: 'details',
|
|
1194
1230
|
label: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$a({}, messages$4.details))
|
|
1195
1231
|
}];
|
|
1196
|
-
const
|
|
1232
|
+
const UploadErrorTable = props => {
|
|
1197
1233
|
var _context;
|
|
1198
1234
|
const pagination = uiKit.usePaginationState({
|
|
1199
1235
|
perPage: 10
|
|
@@ -1236,13 +1272,13 @@ function itemRenderer$1(item, column) {
|
|
|
1236
1272
|
|
|
1237
1273
|
function ownKeys$9(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
1238
1274
|
function _objectSpread$9(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$9(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$9(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
1239
|
-
const
|
|
1275
|
+
const UploadErrorsModal = () => {
|
|
1240
1276
|
const intl = reactIntl.useIntl();
|
|
1241
1277
|
const _useImportResourcesCo = useImportResourcesContext(),
|
|
1242
1278
|
state = _useImportResourcesCo.state,
|
|
1243
1279
|
actions = _useImportResourcesCo.actions,
|
|
1244
1280
|
onClose = _useImportResourcesCo.onClose;
|
|
1245
|
-
const errorsCount = state.
|
|
1281
|
+
const errorsCount = state.fileUploadErrors.length;
|
|
1246
1282
|
return jsxRuntime.jsx(applicationComponents.InfoDialog, {
|
|
1247
1283
|
size: 16,
|
|
1248
1284
|
isOpen: true,
|
|
@@ -1253,7 +1289,7 @@ const UploadClientSideErrorsModal = () => {
|
|
|
1253
1289
|
scale: "l",
|
|
1254
1290
|
children: [jsxRuntime.jsx(fullstory.Masking.Mask, {
|
|
1255
1291
|
children: jsxRuntime.jsx(uiKit.Text.Body, {
|
|
1256
|
-
intlMessage: _objectSpread$9(_objectSpread$9({}, messages$4.
|
|
1292
|
+
intlMessage: _objectSpread$9(_objectSpread$9({}, messages$4.uploadErrorDescription), {}, {
|
|
1257
1293
|
values: {
|
|
1258
1294
|
fileName: state.droppedFile?.name,
|
|
1259
1295
|
errorsCount: intl.formatNumber(errorsCount),
|
|
@@ -1261,8 +1297,8 @@ const UploadClientSideErrorsModal = () => {
|
|
|
1261
1297
|
}
|
|
1262
1298
|
})
|
|
1263
1299
|
})
|
|
1264
|
-
}), jsxRuntime.jsx(
|
|
1265
|
-
rows:
|
|
1300
|
+
}), jsxRuntime.jsx(UploadErrorTable, {
|
|
1301
|
+
rows: mapFileUploadErrorsToUploadFileErrorRows(state.fileUploadErrors)
|
|
1266
1302
|
}), jsxRuntime.jsxs(uiKit.Spacings.Inline, {
|
|
1267
1303
|
scale: "m",
|
|
1268
1304
|
justifyContent: "flex-end",
|
|
@@ -1301,7 +1337,7 @@ const getColumns = () => [{
|
|
|
1301
1337
|
key: 'details',
|
|
1302
1338
|
label: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$8({}, messages$4.details))
|
|
1303
1339
|
}];
|
|
1304
|
-
const
|
|
1340
|
+
const UploadRowErrorTable = props => {
|
|
1305
1341
|
var _context;
|
|
1306
1342
|
const pagination = uiKit.usePaginationState({
|
|
1307
1343
|
perPage: 10
|
|
@@ -1332,7 +1368,7 @@ function itemRenderer(item, column) {
|
|
|
1332
1368
|
case 'errorType':
|
|
1333
1369
|
return jsxRuntime.jsx(uiKit.Stamp, {
|
|
1334
1370
|
isCondensed: true,
|
|
1335
|
-
label: item.code,
|
|
1371
|
+
label: formatErrorCode(item.code),
|
|
1336
1372
|
tone: "critical"
|
|
1337
1373
|
});
|
|
1338
1374
|
case 'details':
|
|
@@ -1352,7 +1388,7 @@ function itemRenderer(item, column) {
|
|
|
1352
1388
|
|
|
1353
1389
|
function ownKeys$7(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
1354
1390
|
function _objectSpread$7(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$7(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$7(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
1355
|
-
const
|
|
1391
|
+
const UploadRowErrorsModal = () => {
|
|
1356
1392
|
const intl = reactIntl.useIntl();
|
|
1357
1393
|
const _useImportResourcesCo = useImportResourcesContext(),
|
|
1358
1394
|
state = _useImportResourcesCo.state,
|
|
@@ -1372,7 +1408,7 @@ const UploadServerSideErrorsModal = () => {
|
|
|
1372
1408
|
scale: "xs",
|
|
1373
1409
|
children: [jsxRuntime.jsx(fullstory.Masking.Mask, {
|
|
1374
1410
|
children: jsxRuntime.jsx(uiKit.Text.Body, {
|
|
1375
|
-
intlMessage: _objectSpread$7(_objectSpread$7({}, messages$4.
|
|
1411
|
+
intlMessage: _objectSpread$7(_objectSpread$7({}, messages$4.uploadErrorDescription), {}, {
|
|
1376
1412
|
values: {
|
|
1377
1413
|
fileName: state.droppedFile?.name,
|
|
1378
1414
|
errorsCount: intl.formatNumber(errorsCount),
|
|
@@ -1392,7 +1428,7 @@ const UploadServerSideErrorsModal = () => {
|
|
|
1392
1428
|
}
|
|
1393
1429
|
})
|
|
1394
1430
|
})]
|
|
1395
|
-
}), jsxRuntime.jsx(
|
|
1431
|
+
}), jsxRuntime.jsx(UploadRowErrorTable, {
|
|
1396
1432
|
rows: mapUploadFileErrorsResponseToUploadFileErrorRows(state.uploadFileResponse?.results)
|
|
1397
1433
|
}), jsxRuntime.jsxs(uiKit.Spacings.Inline, {
|
|
1398
1434
|
scale: "m",
|
|
@@ -1800,8 +1836,8 @@ function getBold(msg) {
|
|
|
1800
1836
|
const UploadResult = () => {
|
|
1801
1837
|
const _useImportResourcesCo = useImportResourcesContext(),
|
|
1802
1838
|
state = _useImportResourcesCo.state;
|
|
1803
|
-
if (state.
|
|
1804
|
-
if (state.uploadFileResponse?.invalid > 0) return jsxRuntime.jsx(
|
|
1839
|
+
if (state.fileUploadErrors.length > 0) return jsxRuntime.jsx(UploadErrorsModal, {});
|
|
1840
|
+
if (state.uploadFileResponse?.invalid > 0) return jsxRuntime.jsx(UploadRowErrorsModal, {});
|
|
1805
1841
|
return jsxRuntime.jsx(UploadPreviewModal, {});
|
|
1806
1842
|
};
|
|
1807
1843
|
|
package/package.json
CHANGED