@commercetools-frontend-extensions/import-resources-modal 1.8.0 → 1.8.1

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.
Files changed (19) hide show
  1. package/dist/{active-drag-drop-area-b645657a.cjs.dev.js → active-drag-drop-area-b84dd578.cjs.dev.js} +1 -1
  2. package/dist/{active-drag-drop-area-34cca429.esm.js → active-drag-drop-area-b855fcf6.esm.js} +1 -1
  3. package/dist/{active-drag-drop-area-cf5791e7.cjs.prod.js → active-drag-drop-area-c906211c.cjs.prod.js} +1 -1
  4. package/dist/commercetools-frontend-extensions-import-resources-modal.cjs.dev.js +1 -1
  5. package/dist/commercetools-frontend-extensions-import-resources-modal.cjs.prod.js +1 -1
  6. package/dist/commercetools-frontend-extensions-import-resources-modal.esm.js +1 -1
  7. package/dist/{disabled-drop-area-9a4072d5.cjs.dev.js → disabled-drop-area-48c8a29e.cjs.dev.js} +1 -1
  8. package/dist/{disabled-drop-area-460a605b.esm.js → disabled-drop-area-d56b2ffb.esm.js} +1 -1
  9. package/dist/{disabled-drop-area-c8e04dd6.cjs.prod.js → disabled-drop-area-ead9d6e5.cjs.prod.js} +1 -1
  10. package/dist/{enabled-drop-area-c2591e72.esm.js → enabled-drop-area-4745c8da.esm.js} +1 -1
  11. package/dist/{enabled-drop-area-5d1a684a.cjs.dev.js → enabled-drop-area-5c4ea376.cjs.dev.js} +1 -1
  12. package/dist/{enabled-drop-area-c30c7c5f.cjs.prod.js → enabled-drop-area-e81190f8.cjs.prod.js} +1 -1
  13. package/dist/{file-dropped-area-1c5c2843.cjs.dev.js → file-dropped-area-2d51d63b.cjs.dev.js} +1 -1
  14. package/dist/{file-dropped-area-27c8a11f.cjs.prod.js → file-dropped-area-48990997.cjs.prod.js} +1 -1
  15. package/dist/{file-dropped-area-cf7278ba.esm.js → file-dropped-area-bf648f2e.esm.js} +1 -1
  16. package/dist/{index-757e3f18.cjs.prod.js → index-762eed18.cjs.prod.js} +224 -10
  17. package/dist/{index-7e118bb3.cjs.dev.js → index-a2c55a09.cjs.dev.js} +224 -10
  18. package/dist/{index-066e573b.esm.js → index-d6f6d164.esm.js} +224 -10
  19. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var dist_commercetoolsFrontendExtensionsImportResourcesModal = require('./index-7e118bb3.cjs.dev.js');
3
+ var dist_commercetoolsFrontendExtensionsImportResourcesModal = require('./index-a2c55a09.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');
@@ -1,4 +1,4 @@
1
- import { F as FileDropped, E as EnabledDropArea } from './index-066e573b.esm.js';
1
+ import { F as FileDropped, E as EnabledDropArea } from './index-d6f6d164.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';
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var dist_commercetoolsFrontendExtensionsImportResourcesModal = require('./index-757e3f18.cjs.prod.js');
3
+ var dist_commercetoolsFrontendExtensionsImportResourcesModal = require('./index-762eed18.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');
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var dist_commercetoolsFrontendExtensionsImportResourcesModal = require('./index-7e118bb3.cjs.dev.js');
5
+ var dist_commercetoolsFrontendExtensionsImportResourcesModal = require('./index-a2c55a09.cjs.dev.js');
6
6
  require('react');
7
7
  require('@babel/runtime-corejs3/core-js-stable/object/keys');
8
8
  require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols');
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var dist_commercetoolsFrontendExtensionsImportResourcesModal = require('./index-757e3f18.cjs.prod.js');
5
+ var dist_commercetoolsFrontendExtensionsImportResourcesModal = require('./index-762eed18.cjs.prod.js');
6
6
  require('react');
7
7
  require('@babel/runtime-corejs3/core-js-stable/object/keys');
8
8
  require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols');
@@ -1,4 +1,4 @@
1
- export { I as default, b as useImportPermission } from './index-066e573b.esm.js';
1
+ export { I as default, b as useImportPermission } from './index-d6f6d164.esm.js';
2
2
  import 'react';
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';
@@ -14,7 +14,7 @@ require('@babel/runtime-corejs3/helpers/slicedToArray');
14
14
  require('react');
15
15
  require('@commercetools-frontend/application-shell-connectors');
16
16
  require('@commercetools-frontend/sdk');
17
- require('./index-7e118bb3.cjs.dev.js');
17
+ require('./index-a2c55a09.cjs.dev.js');
18
18
  require('@commercetools-frontend/constants');
19
19
  require('@commercetools-frontend/application-shell');
20
20
  require('@babel/runtime-corejs3/core-js-stable/reflect/construct');
@@ -12,7 +12,7 @@ import '@babel/runtime-corejs3/helpers/slicedToArray';
12
12
  import 'react';
13
13
  import '@commercetools-frontend/application-shell-connectors';
14
14
  import '@commercetools-frontend/sdk';
15
- import './index-066e573b.esm.js';
15
+ import './index-d6f6d164.esm.js';
16
16
  import '@commercetools-frontend/constants';
17
17
  import '@commercetools-frontend/application-shell';
18
18
  import '@babel/runtime-corejs3/core-js-stable/reflect/construct';
@@ -14,7 +14,7 @@ require('@babel/runtime-corejs3/helpers/slicedToArray');
14
14
  require('react');
15
15
  require('@commercetools-frontend/application-shell-connectors');
16
16
  require('@commercetools-frontend/sdk');
17
- require('./index-757e3f18.cjs.prod.js');
17
+ require('./index-762eed18.cjs.prod.js');
18
18
  require('@commercetools-frontend/constants');
19
19
  require('@commercetools-frontend/application-shell');
20
20
  require('@babel/runtime-corejs3/core-js-stable/reflect/construct');
@@ -12,7 +12,7 @@ import '@babel/runtime-corejs3/helpers/slicedToArray';
12
12
  import 'react';
13
13
  import '@commercetools-frontend/application-shell-connectors';
14
14
  import '@commercetools-frontend/sdk';
15
- import { a as FileIcon, m as messages } from './index-066e573b.esm.js';
15
+ import { a as FileIcon, m as messages } from './index-d6f6d164.esm.js';
16
16
  import '@commercetools-frontend/constants';
17
17
  import '@commercetools-frontend/application-shell';
18
18
  import '@babel/runtime-corejs3/core-js-stable/reflect/construct';
@@ -14,7 +14,7 @@ require('@babel/runtime-corejs3/helpers/slicedToArray');
14
14
  require('react');
15
15
  require('@commercetools-frontend/application-shell-connectors');
16
16
  require('@commercetools-frontend/sdk');
17
- var dist_commercetoolsFrontendExtensionsImportResourcesModal = require('./index-7e118bb3.cjs.dev.js');
17
+ var dist_commercetoolsFrontendExtensionsImportResourcesModal = require('./index-a2c55a09.cjs.dev.js');
18
18
  require('@commercetools-frontend/constants');
19
19
  require('@commercetools-frontend/application-shell');
20
20
  require('@babel/runtime-corejs3/core-js-stable/reflect/construct');
@@ -14,7 +14,7 @@ require('@babel/runtime-corejs3/helpers/slicedToArray');
14
14
  require('react');
15
15
  require('@commercetools-frontend/application-shell-connectors');
16
16
  require('@commercetools-frontend/sdk');
17
- var dist_commercetoolsFrontendExtensionsImportResourcesModal = require('./index-757e3f18.cjs.prod.js');
17
+ var dist_commercetoolsFrontendExtensionsImportResourcesModal = require('./index-762eed18.cjs.prod.js');
18
18
  require('@commercetools-frontend/constants');
19
19
  require('@commercetools-frontend/application-shell');
20
20
  require('@babel/runtime-corejs3/core-js-stable/reflect/construct');
@@ -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-7e118bb3.cjs.dev.js');
5
+ var dist_commercetoolsFrontendExtensionsImportResourcesModal = require('./index-a2c55a09.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');
@@ -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-757e3f18.cjs.prod.js');
5
+ var dist_commercetoolsFrontendExtensionsImportResourcesModal = require('./index-762eed18.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');
@@ -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-066e573b.esm.js';
3
+ import { u as useImportResourcesContext, m as messages } from './index-d6f6d164.esm.js';
4
4
  import '@babel/runtime-corejs3/core-js-stable/object/keys';
5
5
  import '@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols';
6
6
  import '@babel/runtime-corejs3/core-js-stable/instance/filter';
@@ -462,7 +462,164 @@ var sharedMessages = reactIntl.defineMessages({
462
462
  id: 'ImportResourcesModal.delimiterTab',
463
463
  description: 'Label for the delimiter name tab',
464
464
  defaultMessage: 'tab'
465
+ },
466
+ // Resource types
467
+ product: {
468
+ id: 'ImportResourcesModal.product',
469
+ description: 'Label for the product resource type',
470
+ defaultMessage: 'Product'
471
+ },
472
+ products: {
473
+ id: 'ImportResourcesModal.products',
474
+ description: 'Label for the products resource type',
475
+ defaultMessage: 'Products'
476
+ },
477
+ inventory: {
478
+ id: 'ImportResourcesModal.inventory',
479
+ description: 'Label for the inventory entry resource type',
480
+ defaultMessage: 'Inventory'
481
+ },
482
+ inventories: {
483
+ id: 'ImportResourcesModal.inventories',
484
+ description: 'Label for the inventories entry resource type',
485
+ defaultMessage: 'Inventories'
486
+ },
487
+ category: {
488
+ id: 'ImportResourcesModal.category',
489
+ description: 'Label for the category resource type',
490
+ defaultMessage: 'Category'
491
+ },
492
+ categories: {
493
+ id: 'ImportResourcesModal.categories',
494
+ description: 'Label for the categories resource type',
495
+ defaultMessage: 'Categories'
496
+ },
497
+ 'custom-object': {
498
+ id: 'ImportResourcesModal.custom-object',
499
+ description: 'Label for the custom-object resource type',
500
+ defaultMessage: 'Custom object'
501
+ },
502
+ 'custom-objects': {
503
+ id: 'ImportResourcesModal.custom-objects',
504
+ description: 'Label for the custom-objects resource type',
505
+ defaultMessage: 'Custom objects'
506
+ },
507
+ customer: {
508
+ id: 'ImportResourcesModal.customer',
509
+ description: 'Label for the customer resource type',
510
+ defaultMessage: 'Customer'
511
+ },
512
+ customers: {
513
+ id: 'ImportResourcesModal.customers',
514
+ description: 'Label for the customers resource type',
515
+ defaultMessage: 'Customers'
516
+ },
517
+ order: {
518
+ id: 'ImportResourcesModal.order',
519
+ description: 'Label for the order resource type',
520
+ defaultMessage: 'Order'
521
+ },
522
+ orders: {
523
+ id: 'ImportResourcesModal.orders',
524
+ description: 'Label for the orders resource type',
525
+ defaultMessage: 'Orders'
526
+ },
527
+ 'order-patch': {
528
+ id: 'ImportResourcesModal.order-patch',
529
+ description: 'Label for the order-patch resource type',
530
+ defaultMessage: 'Order patch'
531
+ },
532
+ 'order-patches': {
533
+ id: 'ImportResourcesModal.order-patches',
534
+ description: 'Label for the order-patches resource type',
535
+ defaultMessage: 'Order patches'
536
+ },
537
+ price: {
538
+ id: 'ImportResourcesModal.price',
539
+ description: 'Label for the price resource type',
540
+ defaultMessage: 'Price'
541
+ },
542
+ prices: {
543
+ id: 'ImportResourcesModal.prices',
544
+ description: 'Label for the prices resource type',
545
+ defaultMessage: 'Prices'
546
+ },
547
+ 'product-draft': {
548
+ id: 'ImportResourcesModal.product-draft',
549
+ description: 'Label for the product-draft resource type',
550
+ defaultMessage: 'Product draft'
551
+ },
552
+ 'product-drafts': {
553
+ id: 'ImportResourcesModal.product-drafts',
554
+ description: 'Label for the product-drafts resource type',
555
+ defaultMessage: 'Product drafts'
556
+ },
557
+ 'product-type': {
558
+ id: 'ImportResourcesModal.product-type',
559
+ description: 'Label for the product-type resource type',
560
+ defaultMessage: 'Product type'
561
+ },
562
+ 'product-types': {
563
+ id: 'ImportResourcesModal.product-types',
564
+ description: 'Label for the product-types resource type',
565
+ defaultMessage: 'Product types'
566
+ },
567
+ 'product-variant': {
568
+ id: 'ImportResourcesModal.product-variant',
569
+ description: 'Label for the product-variant resource type',
570
+ defaultMessage: 'Product variant'
571
+ },
572
+ 'product-variants': {
573
+ id: 'ImportResourcesModal.product-variants',
574
+ description: 'Label for the product-variants resource type',
575
+ defaultMessage: 'Product variants'
576
+ },
577
+ 'product-variant-patch': {
578
+ id: 'ImportResourcesModal.product-variant-patch',
579
+ description: 'Label for the product-variant-patch resource type',
580
+ defaultMessage: 'Product variant patch'
581
+ },
582
+ 'product-variant-patches': {
583
+ id: 'ImportResourcesModal.product-variant-patches',
584
+ description: 'Label for the product-variant-patches resource type',
585
+ defaultMessage: 'Product variant patches'
586
+ },
587
+ 'standalone-price': {
588
+ id: 'ImportResourcesModal.standalone-price',
589
+ description: 'Label for the standalone-price resource type',
590
+ defaultMessage: 'Standalone price'
591
+ },
592
+ 'standalone-prices': {
593
+ id: 'ImportResourcesModal.standalone-prices',
594
+ description: 'Label for the standalone-prices resource type',
595
+ defaultMessage: 'Standalone prices'
596
+ },
597
+ type: {
598
+ id: 'ImportResourcesModal.type',
599
+ description: 'Label for the type resource type',
600
+ defaultMessage: 'Type'
601
+ },
602
+ types: {
603
+ id: 'ImportResourcesModal.types',
604
+ description: 'Label for the types resource type',
605
+ defaultMessage: 'Types'
606
+ },
607
+ 'discount-code': {
608
+ id: 'ImportResourcesModal.discount-code',
609
+ description: 'Label for the discount-code resource type',
610
+ defaultMessage: 'Discount code'
611
+ },
612
+ 'discount-codes': {
613
+ id: 'ImportResourcesModal.discount-codes',
614
+ description: 'Label for the discount-codes resource type',
615
+ defaultMessage: 'Discount codes'
616
+ },
617
+ unknownResourceType: {
618
+ id: 'ImportResourcesModal.unknown-resource-type',
619
+ description: 'Label for the unknown resource type',
620
+ defaultMessage: 'Unknown resource type'
465
621
  }
622
+ //
466
623
  });
467
624
 
468
625
  function ownKeys$f(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; }
@@ -610,6 +767,57 @@ function formatErrorCode(code) {
610
767
  return code;
611
768
  }
612
769
  }
770
+ function resourceTypeToMessage(resourceType) {
771
+ const resourceTypeMap = {
772
+ category: sharedMessages.category,
773
+ product: sharedMessages.product,
774
+ 'product-type': sharedMessages['product-type'],
775
+ order: sharedMessages.order,
776
+ customer: sharedMessages.customer,
777
+ 'discount-code': sharedMessages['discount-code'],
778
+ inventory: sharedMessages.inventory,
779
+ // TODO: remove `inventory` after aligning the resource type names in the file upload API
780
+ 'inventory-entry': sharedMessages.inventory,
781
+ 'order-patch': sharedMessages['order-patch'],
782
+ price: sharedMessages.price,
783
+ 'product-draft': sharedMessages['product-draft'],
784
+ 'product-variant': sharedMessages['product-variant'],
785
+ 'product-variant-patch': sharedMessages['product-variant-patch'],
786
+ 'standalone-price': sharedMessages['standalone-price'],
787
+ 'custom-object': sharedMessages['custom-object'],
788
+ type: sharedMessages.type
789
+ };
790
+ const message = resourceTypeMap[resourceType];
791
+ if (!message) {
792
+ return sharedMessages.unknownResourceType;
793
+ }
794
+ return message;
795
+ }
796
+ function resourceTypeToPluralMessage(resourceType) {
797
+ const resourceTypePluralMap = {
798
+ category: sharedMessages.categories,
799
+ 'custom-object': sharedMessages['custom-objects'],
800
+ product: sharedMessages.products,
801
+ 'product-type': sharedMessages['product-types'],
802
+ order: sharedMessages.orders,
803
+ customer: sharedMessages.customers,
804
+ 'discount-code': sharedMessages['discount-codes'],
805
+ inventory: sharedMessages.inventories,
806
+ // TODO: remove `inventory` after aligning the resource type names in the file upload API
807
+ 'inventory-entry': sharedMessages.inventories,
808
+ 'order-patch': sharedMessages['order-patches'],
809
+ price: sharedMessages.prices,
810
+ 'product-draft': sharedMessages['product-drafts'],
811
+ 'product-variant': sharedMessages['product-variants'],
812
+ 'product-variant-patch': sharedMessages['product-variant-patches'],
813
+ 'standalone-price': sharedMessages['standalone-prices']
814
+ };
815
+ const message = resourceTypePluralMap[resourceType];
816
+ if (!message) {
817
+ return sharedMessages.unknownResourceType;
818
+ }
819
+ return message;
820
+ }
613
821
 
614
822
  const encodeFileNameWithTimestampToContainerKey = fileName => {
615
823
  return btoa(_JSON$stringify__default["default"]({
@@ -851,13 +1059,13 @@ function getDefaultDropWrapperStyles(_dropAreaState) {
851
1059
  return /*#__PURE__*/react.css("" , "" );
852
1060
  }
853
1061
 
854
- var ActiveDragDropArea = /*#__PURE__*/React.lazy(() => Promise.resolve().then(function () { return require('./active-drag-drop-area-cf5791e7.cjs.prod.js' /* webpackChunkName: "active-drag-drop-area" */); }));
1062
+ var ActiveDragDropArea = /*#__PURE__*/React.lazy(() => Promise.resolve().then(function () { return require('./active-drag-drop-area-c906211c.cjs.prod.js' /* webpackChunkName: "active-drag-drop-area" */); }));
855
1063
 
856
- var DisabledDropArea = /*#__PURE__*/React.lazy(() => Promise.resolve().then(function () { return require('./disabled-drop-area-c8e04dd6.cjs.prod.js' /* webpackChunkName: "disabled-drop-area" */); }));
1064
+ var DisabledDropArea = /*#__PURE__*/React.lazy(() => Promise.resolve().then(function () { return require('./disabled-drop-area-ead9d6e5.cjs.prod.js' /* webpackChunkName: "disabled-drop-area" */); }));
857
1065
 
858
- var EnabledDropArea = /*#__PURE__*/React.lazy(() => Promise.resolve().then(function () { return require('./enabled-drop-area-c30c7c5f.cjs.prod.js' /* webpackChunkName: "enabled-drop-area" */); }));
1066
+ var EnabledDropArea = /*#__PURE__*/React.lazy(() => Promise.resolve().then(function () { return require('./enabled-drop-area-e81190f8.cjs.prod.js' /* webpackChunkName: "enabled-drop-area" */); }));
859
1067
 
860
- var FileDropped = /*#__PURE__*/React.lazy(() => Promise.resolve().then(function () { return require('./file-dropped-area-27c8a11f.cjs.prod.js' /* webpackChunkName: "filed-dropped-area" */); }));
1068
+ var FileDropped = /*#__PURE__*/React.lazy(() => Promise.resolve().then(function () { return require('./file-dropped-area-48990997.cjs.prod.js' /* webpackChunkName: "filed-dropped-area" */); }));
861
1069
 
862
1070
  function getDropArea(_ref) {
863
1071
  let dropAreaState = _ref.dropAreaState,
@@ -1657,10 +1865,10 @@ var messages$3 = reactIntl.defineMessages({
1657
1865
  description: 'Label for modal path',
1658
1866
  defaultMessage: "Here's a preview of your import"
1659
1867
  },
1660
- rowsToBeImported: {
1661
- id: 'ImportResourcesModal.rowsToBeImported',
1662
- description: 'This message indicates the number of rows that are ready to be imported into the system.',
1663
- defaultMessage: '{rowCount, plural, one {<b>1</b> row to be imported} other {<b>{rowCount}</b> rows to be imported}}{publish, select, true { and published} other {}}'
1868
+ itemsToBeImported: {
1869
+ id: 'ImportResourcesModal.itemsToBeImported',
1870
+ description: 'This message indicates the number of items that are ready to be imported into the project.',
1871
+ defaultMessage: '{itemCount, plural, one {<b>1</b> {resourceType} to be imported{publish, select, true { and published} other {}}} other {<b>{itemCount}</b> {resourceTypePlural} to be imported{publish, select, true { and published} other {}}}}'
1664
1872
  },
1665
1873
  columnsToBeImported: {
1666
1874
  id: 'ImportResourcesModal.columnsToBeImported',
@@ -1754,6 +1962,10 @@ function UploadPreviewModal() {
1754
1962
  actions = _useImportResourcesCo2.actions,
1755
1963
  onClose = _useImportResourcesCo2.onClose;
1756
1964
  if (!state.resourceType || !state.uploadFileResponse) return null;
1965
+ const resourceTypeMessage = resourceTypeToMessage(state.resourceType);
1966
+ const resourceType = intl.formatMessage(resourceTypeMessage).toLowerCase();
1967
+ const resourceTypePluralMessage = resourceTypeToPluralMessage(state.resourceType);
1968
+ const resourceTypePlural = intl.formatMessage(resourceTypePluralMessage).toLowerCase();
1757
1969
  const ignoredColumns = state.uploadFileResponse.ignoredColumns;
1758
1970
  const validatedColumns = getValidatedColumns(state.uploadFileResponse.columns, ignoredColumns);
1759
1971
  return jsxRuntime.jsx(applicationComponents.FormDialog, {
@@ -1791,9 +2003,11 @@ function UploadPreviewModal() {
1791
2003
  children: [jsxRuntime.jsx(uiKit.CheckBoldIcon, {
1792
2004
  color: "success"
1793
2005
  }), jsxRuntime.jsx(uiKit.Text.Body, {
1794
- intlMessage: _objectSpread$5(_objectSpread$5({}, messages$3.rowsToBeImported), {}, {
2006
+ intlMessage: _objectSpread$5(_objectSpread$5({}, messages$3.itemsToBeImported), {}, {
1795
2007
  values: {
1796
- rowCount: intl.formatNumber(state.uploadFileResponse.rowsCount),
2008
+ resourceType,
2009
+ resourceTypePlural,
2010
+ itemCount: intl.formatNumber(state.uploadFileResponse.itemsCount),
1797
2011
  publish: state.resourceType === 'product' && state.settings?.publish,
1798
2012
  b: getBold$1
1799
2013
  }
@@ -462,7 +462,164 @@ var sharedMessages = reactIntl.defineMessages({
462
462
  id: 'ImportResourcesModal.delimiterTab',
463
463
  description: 'Label for the delimiter name tab',
464
464
  defaultMessage: 'tab'
465
+ },
466
+ // Resource types
467
+ product: {
468
+ id: 'ImportResourcesModal.product',
469
+ description: 'Label for the product resource type',
470
+ defaultMessage: 'Product'
471
+ },
472
+ products: {
473
+ id: 'ImportResourcesModal.products',
474
+ description: 'Label for the products resource type',
475
+ defaultMessage: 'Products'
476
+ },
477
+ inventory: {
478
+ id: 'ImportResourcesModal.inventory',
479
+ description: 'Label for the inventory entry resource type',
480
+ defaultMessage: 'Inventory'
481
+ },
482
+ inventories: {
483
+ id: 'ImportResourcesModal.inventories',
484
+ description: 'Label for the inventories entry resource type',
485
+ defaultMessage: 'Inventories'
486
+ },
487
+ category: {
488
+ id: 'ImportResourcesModal.category',
489
+ description: 'Label for the category resource type',
490
+ defaultMessage: 'Category'
491
+ },
492
+ categories: {
493
+ id: 'ImportResourcesModal.categories',
494
+ description: 'Label for the categories resource type',
495
+ defaultMessage: 'Categories'
496
+ },
497
+ 'custom-object': {
498
+ id: 'ImportResourcesModal.custom-object',
499
+ description: 'Label for the custom-object resource type',
500
+ defaultMessage: 'Custom object'
501
+ },
502
+ 'custom-objects': {
503
+ id: 'ImportResourcesModal.custom-objects',
504
+ description: 'Label for the custom-objects resource type',
505
+ defaultMessage: 'Custom objects'
506
+ },
507
+ customer: {
508
+ id: 'ImportResourcesModal.customer',
509
+ description: 'Label for the customer resource type',
510
+ defaultMessage: 'Customer'
511
+ },
512
+ customers: {
513
+ id: 'ImportResourcesModal.customers',
514
+ description: 'Label for the customers resource type',
515
+ defaultMessage: 'Customers'
516
+ },
517
+ order: {
518
+ id: 'ImportResourcesModal.order',
519
+ description: 'Label for the order resource type',
520
+ defaultMessage: 'Order'
521
+ },
522
+ orders: {
523
+ id: 'ImportResourcesModal.orders',
524
+ description: 'Label for the orders resource type',
525
+ defaultMessage: 'Orders'
526
+ },
527
+ 'order-patch': {
528
+ id: 'ImportResourcesModal.order-patch',
529
+ description: 'Label for the order-patch resource type',
530
+ defaultMessage: 'Order patch'
531
+ },
532
+ 'order-patches': {
533
+ id: 'ImportResourcesModal.order-patches',
534
+ description: 'Label for the order-patches resource type',
535
+ defaultMessage: 'Order patches'
536
+ },
537
+ price: {
538
+ id: 'ImportResourcesModal.price',
539
+ description: 'Label for the price resource type',
540
+ defaultMessage: 'Price'
541
+ },
542
+ prices: {
543
+ id: 'ImportResourcesModal.prices',
544
+ description: 'Label for the prices resource type',
545
+ defaultMessage: 'Prices'
546
+ },
547
+ 'product-draft': {
548
+ id: 'ImportResourcesModal.product-draft',
549
+ description: 'Label for the product-draft resource type',
550
+ defaultMessage: 'Product draft'
551
+ },
552
+ 'product-drafts': {
553
+ id: 'ImportResourcesModal.product-drafts',
554
+ description: 'Label for the product-drafts resource type',
555
+ defaultMessage: 'Product drafts'
556
+ },
557
+ 'product-type': {
558
+ id: 'ImportResourcesModal.product-type',
559
+ description: 'Label for the product-type resource type',
560
+ defaultMessage: 'Product type'
561
+ },
562
+ 'product-types': {
563
+ id: 'ImportResourcesModal.product-types',
564
+ description: 'Label for the product-types resource type',
565
+ defaultMessage: 'Product types'
566
+ },
567
+ 'product-variant': {
568
+ id: 'ImportResourcesModal.product-variant',
569
+ description: 'Label for the product-variant resource type',
570
+ defaultMessage: 'Product variant'
571
+ },
572
+ 'product-variants': {
573
+ id: 'ImportResourcesModal.product-variants',
574
+ description: 'Label for the product-variants resource type',
575
+ defaultMessage: 'Product variants'
576
+ },
577
+ 'product-variant-patch': {
578
+ id: 'ImportResourcesModal.product-variant-patch',
579
+ description: 'Label for the product-variant-patch resource type',
580
+ defaultMessage: 'Product variant patch'
581
+ },
582
+ 'product-variant-patches': {
583
+ id: 'ImportResourcesModal.product-variant-patches',
584
+ description: 'Label for the product-variant-patches resource type',
585
+ defaultMessage: 'Product variant patches'
586
+ },
587
+ 'standalone-price': {
588
+ id: 'ImportResourcesModal.standalone-price',
589
+ description: 'Label for the standalone-price resource type',
590
+ defaultMessage: 'Standalone price'
591
+ },
592
+ 'standalone-prices': {
593
+ id: 'ImportResourcesModal.standalone-prices',
594
+ description: 'Label for the standalone-prices resource type',
595
+ defaultMessage: 'Standalone prices'
596
+ },
597
+ type: {
598
+ id: 'ImportResourcesModal.type',
599
+ description: 'Label for the type resource type',
600
+ defaultMessage: 'Type'
601
+ },
602
+ types: {
603
+ id: 'ImportResourcesModal.types',
604
+ description: 'Label for the types resource type',
605
+ defaultMessage: 'Types'
606
+ },
607
+ 'discount-code': {
608
+ id: 'ImportResourcesModal.discount-code',
609
+ description: 'Label for the discount-code resource type',
610
+ defaultMessage: 'Discount code'
611
+ },
612
+ 'discount-codes': {
613
+ id: 'ImportResourcesModal.discount-codes',
614
+ description: 'Label for the discount-codes resource type',
615
+ defaultMessage: 'Discount codes'
616
+ },
617
+ unknownResourceType: {
618
+ id: 'ImportResourcesModal.unknown-resource-type',
619
+ description: 'Label for the unknown resource type',
620
+ defaultMessage: 'Unknown resource type'
465
621
  }
622
+ //
466
623
  });
467
624
 
468
625
  function ownKeys$f(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; }
@@ -610,6 +767,57 @@ function formatErrorCode(code) {
610
767
  return code;
611
768
  }
612
769
  }
770
+ function resourceTypeToMessage(resourceType) {
771
+ const resourceTypeMap = {
772
+ category: sharedMessages.category,
773
+ product: sharedMessages.product,
774
+ 'product-type': sharedMessages['product-type'],
775
+ order: sharedMessages.order,
776
+ customer: sharedMessages.customer,
777
+ 'discount-code': sharedMessages['discount-code'],
778
+ inventory: sharedMessages.inventory,
779
+ // TODO: remove `inventory` after aligning the resource type names in the file upload API
780
+ 'inventory-entry': sharedMessages.inventory,
781
+ 'order-patch': sharedMessages['order-patch'],
782
+ price: sharedMessages.price,
783
+ 'product-draft': sharedMessages['product-draft'],
784
+ 'product-variant': sharedMessages['product-variant'],
785
+ 'product-variant-patch': sharedMessages['product-variant-patch'],
786
+ 'standalone-price': sharedMessages['standalone-price'],
787
+ 'custom-object': sharedMessages['custom-object'],
788
+ type: sharedMessages.type
789
+ };
790
+ const message = resourceTypeMap[resourceType];
791
+ if (!message) {
792
+ return sharedMessages.unknownResourceType;
793
+ }
794
+ return message;
795
+ }
796
+ function resourceTypeToPluralMessage(resourceType) {
797
+ const resourceTypePluralMap = {
798
+ category: sharedMessages.categories,
799
+ 'custom-object': sharedMessages['custom-objects'],
800
+ product: sharedMessages.products,
801
+ 'product-type': sharedMessages['product-types'],
802
+ order: sharedMessages.orders,
803
+ customer: sharedMessages.customers,
804
+ 'discount-code': sharedMessages['discount-codes'],
805
+ inventory: sharedMessages.inventories,
806
+ // TODO: remove `inventory` after aligning the resource type names in the file upload API
807
+ 'inventory-entry': sharedMessages.inventories,
808
+ 'order-patch': sharedMessages['order-patches'],
809
+ price: sharedMessages.prices,
810
+ 'product-draft': sharedMessages['product-drafts'],
811
+ 'product-variant': sharedMessages['product-variants'],
812
+ 'product-variant-patch': sharedMessages['product-variant-patches'],
813
+ 'standalone-price': sharedMessages['standalone-prices']
814
+ };
815
+ const message = resourceTypePluralMap[resourceType];
816
+ if (!message) {
817
+ return sharedMessages.unknownResourceType;
818
+ }
819
+ return message;
820
+ }
613
821
 
614
822
  const encodeFileNameWithTimestampToContainerKey = fileName => {
615
823
  return btoa(_JSON$stringify__default["default"]({
@@ -854,13 +1062,13 @@ function getDefaultDropWrapperStyles(_dropAreaState) {
854
1062
  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== */");
855
1063
  }
856
1064
 
857
- var ActiveDragDropArea = /*#__PURE__*/React.lazy(() => Promise.resolve().then(function () { return require('./active-drag-drop-area-b645657a.cjs.dev.js' /* webpackChunkName: "active-drag-drop-area" */); }));
1065
+ var ActiveDragDropArea = /*#__PURE__*/React.lazy(() => Promise.resolve().then(function () { return require('./active-drag-drop-area-b84dd578.cjs.dev.js' /* webpackChunkName: "active-drag-drop-area" */); }));
858
1066
 
859
- var DisabledDropArea = /*#__PURE__*/React.lazy(() => Promise.resolve().then(function () { return require('./disabled-drop-area-9a4072d5.cjs.dev.js' /* webpackChunkName: "disabled-drop-area" */); }));
1067
+ var DisabledDropArea = /*#__PURE__*/React.lazy(() => Promise.resolve().then(function () { return require('./disabled-drop-area-48c8a29e.cjs.dev.js' /* webpackChunkName: "disabled-drop-area" */); }));
860
1068
 
861
- var EnabledDropArea = /*#__PURE__*/React.lazy(() => Promise.resolve().then(function () { return require('./enabled-drop-area-5d1a684a.cjs.dev.js' /* webpackChunkName: "enabled-drop-area" */); }));
1069
+ var EnabledDropArea = /*#__PURE__*/React.lazy(() => Promise.resolve().then(function () { return require('./enabled-drop-area-5c4ea376.cjs.dev.js' /* webpackChunkName: "enabled-drop-area" */); }));
862
1070
 
863
- var FileDropped = /*#__PURE__*/React.lazy(() => Promise.resolve().then(function () { return require('./file-dropped-area-1c5c2843.cjs.dev.js' /* webpackChunkName: "filed-dropped-area" */); }));
1071
+ var FileDropped = /*#__PURE__*/React.lazy(() => Promise.resolve().then(function () { return require('./file-dropped-area-2d51d63b.cjs.dev.js' /* webpackChunkName: "filed-dropped-area" */); }));
864
1072
 
865
1073
  function getDropArea(_ref) {
866
1074
  let dropAreaState = _ref.dropAreaState,
@@ -1660,10 +1868,10 @@ var messages$3 = reactIntl.defineMessages({
1660
1868
  description: 'Label for modal path',
1661
1869
  defaultMessage: "Here's a preview of your import"
1662
1870
  },
1663
- rowsToBeImported: {
1664
- id: 'ImportResourcesModal.rowsToBeImported',
1665
- description: 'This message indicates the number of rows that are ready to be imported into the system.',
1666
- defaultMessage: '{rowCount, plural, one {<b>1</b> row to be imported} other {<b>{rowCount}</b> rows to be imported}}{publish, select, true { and published} other {}}'
1871
+ itemsToBeImported: {
1872
+ id: 'ImportResourcesModal.itemsToBeImported',
1873
+ description: 'This message indicates the number of items that are ready to be imported into the project.',
1874
+ defaultMessage: '{itemCount, plural, one {<b>1</b> {resourceType} to be imported{publish, select, true { and published} other {}}} other {<b>{itemCount}</b> {resourceTypePlural} to be imported{publish, select, true { and published} other {}}}}'
1667
1875
  },
1668
1876
  columnsToBeImported: {
1669
1877
  id: 'ImportResourcesModal.columnsToBeImported',
@@ -1772,6 +1980,10 @@ function UploadPreviewModal() {
1772
1980
  actions = _useImportResourcesCo2.actions,
1773
1981
  onClose = _useImportResourcesCo2.onClose;
1774
1982
  if (!state.resourceType || !state.uploadFileResponse) return null;
1983
+ const resourceTypeMessage = resourceTypeToMessage(state.resourceType);
1984
+ const resourceType = intl.formatMessage(resourceTypeMessage).toLowerCase();
1985
+ const resourceTypePluralMessage = resourceTypeToPluralMessage(state.resourceType);
1986
+ const resourceTypePlural = intl.formatMessage(resourceTypePluralMessage).toLowerCase();
1775
1987
  const ignoredColumns = state.uploadFileResponse.ignoredColumns;
1776
1988
  const validatedColumns = getValidatedColumns(state.uploadFileResponse.columns, ignoredColumns);
1777
1989
  return jsxRuntime.jsx(applicationComponents.FormDialog, {
@@ -1809,9 +2021,11 @@ function UploadPreviewModal() {
1809
2021
  children: [jsxRuntime.jsx(uiKit.CheckBoldIcon, {
1810
2022
  color: "success"
1811
2023
  }), jsxRuntime.jsx(uiKit.Text.Body, {
1812
- intlMessage: _objectSpread$5(_objectSpread$5({}, messages$3.rowsToBeImported), {}, {
2024
+ intlMessage: _objectSpread$5(_objectSpread$5({}, messages$3.itemsToBeImported), {}, {
1813
2025
  values: {
1814
- rowCount: intl.formatNumber(state.uploadFileResponse.rowsCount),
2026
+ resourceType,
2027
+ resourceTypePlural,
2028
+ itemCount: intl.formatNumber(state.uploadFileResponse.itemsCount),
1815
2029
  publish: state.resourceType === 'product' && state.settings?.publish,
1816
2030
  b: getBold$1
1817
2031
  }
@@ -434,7 +434,164 @@ var sharedMessages = defineMessages({
434
434
  id: 'ImportResourcesModal.delimiterTab',
435
435
  description: 'Label for the delimiter name tab',
436
436
  defaultMessage: 'tab'
437
+ },
438
+ // Resource types
439
+ product: {
440
+ id: 'ImportResourcesModal.product',
441
+ description: 'Label for the product resource type',
442
+ defaultMessage: 'Product'
443
+ },
444
+ products: {
445
+ id: 'ImportResourcesModal.products',
446
+ description: 'Label for the products resource type',
447
+ defaultMessage: 'Products'
448
+ },
449
+ inventory: {
450
+ id: 'ImportResourcesModal.inventory',
451
+ description: 'Label for the inventory entry resource type',
452
+ defaultMessage: 'Inventory'
453
+ },
454
+ inventories: {
455
+ id: 'ImportResourcesModal.inventories',
456
+ description: 'Label for the inventories entry resource type',
457
+ defaultMessage: 'Inventories'
458
+ },
459
+ category: {
460
+ id: 'ImportResourcesModal.category',
461
+ description: 'Label for the category resource type',
462
+ defaultMessage: 'Category'
463
+ },
464
+ categories: {
465
+ id: 'ImportResourcesModal.categories',
466
+ description: 'Label for the categories resource type',
467
+ defaultMessage: 'Categories'
468
+ },
469
+ 'custom-object': {
470
+ id: 'ImportResourcesModal.custom-object',
471
+ description: 'Label for the custom-object resource type',
472
+ defaultMessage: 'Custom object'
473
+ },
474
+ 'custom-objects': {
475
+ id: 'ImportResourcesModal.custom-objects',
476
+ description: 'Label for the custom-objects resource type',
477
+ defaultMessage: 'Custom objects'
478
+ },
479
+ customer: {
480
+ id: 'ImportResourcesModal.customer',
481
+ description: 'Label for the customer resource type',
482
+ defaultMessage: 'Customer'
483
+ },
484
+ customers: {
485
+ id: 'ImportResourcesModal.customers',
486
+ description: 'Label for the customers resource type',
487
+ defaultMessage: 'Customers'
488
+ },
489
+ order: {
490
+ id: 'ImportResourcesModal.order',
491
+ description: 'Label for the order resource type',
492
+ defaultMessage: 'Order'
493
+ },
494
+ orders: {
495
+ id: 'ImportResourcesModal.orders',
496
+ description: 'Label for the orders resource type',
497
+ defaultMessage: 'Orders'
498
+ },
499
+ 'order-patch': {
500
+ id: 'ImportResourcesModal.order-patch',
501
+ description: 'Label for the order-patch resource type',
502
+ defaultMessage: 'Order patch'
503
+ },
504
+ 'order-patches': {
505
+ id: 'ImportResourcesModal.order-patches',
506
+ description: 'Label for the order-patches resource type',
507
+ defaultMessage: 'Order patches'
508
+ },
509
+ price: {
510
+ id: 'ImportResourcesModal.price',
511
+ description: 'Label for the price resource type',
512
+ defaultMessage: 'Price'
513
+ },
514
+ prices: {
515
+ id: 'ImportResourcesModal.prices',
516
+ description: 'Label for the prices resource type',
517
+ defaultMessage: 'Prices'
518
+ },
519
+ 'product-draft': {
520
+ id: 'ImportResourcesModal.product-draft',
521
+ description: 'Label for the product-draft resource type',
522
+ defaultMessage: 'Product draft'
523
+ },
524
+ 'product-drafts': {
525
+ id: 'ImportResourcesModal.product-drafts',
526
+ description: 'Label for the product-drafts resource type',
527
+ defaultMessage: 'Product drafts'
528
+ },
529
+ 'product-type': {
530
+ id: 'ImportResourcesModal.product-type',
531
+ description: 'Label for the product-type resource type',
532
+ defaultMessage: 'Product type'
533
+ },
534
+ 'product-types': {
535
+ id: 'ImportResourcesModal.product-types',
536
+ description: 'Label for the product-types resource type',
537
+ defaultMessage: 'Product types'
538
+ },
539
+ 'product-variant': {
540
+ id: 'ImportResourcesModal.product-variant',
541
+ description: 'Label for the product-variant resource type',
542
+ defaultMessage: 'Product variant'
543
+ },
544
+ 'product-variants': {
545
+ id: 'ImportResourcesModal.product-variants',
546
+ description: 'Label for the product-variants resource type',
547
+ defaultMessage: 'Product variants'
548
+ },
549
+ 'product-variant-patch': {
550
+ id: 'ImportResourcesModal.product-variant-patch',
551
+ description: 'Label for the product-variant-patch resource type',
552
+ defaultMessage: 'Product variant patch'
553
+ },
554
+ 'product-variant-patches': {
555
+ id: 'ImportResourcesModal.product-variant-patches',
556
+ description: 'Label for the product-variant-patches resource type',
557
+ defaultMessage: 'Product variant patches'
558
+ },
559
+ 'standalone-price': {
560
+ id: 'ImportResourcesModal.standalone-price',
561
+ description: 'Label for the standalone-price resource type',
562
+ defaultMessage: 'Standalone price'
563
+ },
564
+ 'standalone-prices': {
565
+ id: 'ImportResourcesModal.standalone-prices',
566
+ description: 'Label for the standalone-prices resource type',
567
+ defaultMessage: 'Standalone prices'
568
+ },
569
+ type: {
570
+ id: 'ImportResourcesModal.type',
571
+ description: 'Label for the type resource type',
572
+ defaultMessage: 'Type'
573
+ },
574
+ types: {
575
+ id: 'ImportResourcesModal.types',
576
+ description: 'Label for the types resource type',
577
+ defaultMessage: 'Types'
578
+ },
579
+ 'discount-code': {
580
+ id: 'ImportResourcesModal.discount-code',
581
+ description: 'Label for the discount-code resource type',
582
+ defaultMessage: 'Discount code'
583
+ },
584
+ 'discount-codes': {
585
+ id: 'ImportResourcesModal.discount-codes',
586
+ description: 'Label for the discount-codes resource type',
587
+ defaultMessage: 'Discount codes'
588
+ },
589
+ unknownResourceType: {
590
+ id: 'ImportResourcesModal.unknown-resource-type',
591
+ description: 'Label for the unknown resource type',
592
+ defaultMessage: 'Unknown resource type'
437
593
  }
594
+ //
438
595
  });
439
596
 
440
597
  function ownKeys$f(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; }
@@ -582,6 +739,57 @@ function formatErrorCode(code) {
582
739
  return code;
583
740
  }
584
741
  }
742
+ function resourceTypeToMessage(resourceType) {
743
+ const resourceTypeMap = {
744
+ category: sharedMessages.category,
745
+ product: sharedMessages.product,
746
+ 'product-type': sharedMessages['product-type'],
747
+ order: sharedMessages.order,
748
+ customer: sharedMessages.customer,
749
+ 'discount-code': sharedMessages['discount-code'],
750
+ inventory: sharedMessages.inventory,
751
+ // TODO: remove `inventory` after aligning the resource type names in the file upload API
752
+ 'inventory-entry': sharedMessages.inventory,
753
+ 'order-patch': sharedMessages['order-patch'],
754
+ price: sharedMessages.price,
755
+ 'product-draft': sharedMessages['product-draft'],
756
+ 'product-variant': sharedMessages['product-variant'],
757
+ 'product-variant-patch': sharedMessages['product-variant-patch'],
758
+ 'standalone-price': sharedMessages['standalone-price'],
759
+ 'custom-object': sharedMessages['custom-object'],
760
+ type: sharedMessages.type
761
+ };
762
+ const message = resourceTypeMap[resourceType];
763
+ if (!message) {
764
+ return sharedMessages.unknownResourceType;
765
+ }
766
+ return message;
767
+ }
768
+ function resourceTypeToPluralMessage(resourceType) {
769
+ const resourceTypePluralMap = {
770
+ category: sharedMessages.categories,
771
+ 'custom-object': sharedMessages['custom-objects'],
772
+ product: sharedMessages.products,
773
+ 'product-type': sharedMessages['product-types'],
774
+ order: sharedMessages.orders,
775
+ customer: sharedMessages.customers,
776
+ 'discount-code': sharedMessages['discount-codes'],
777
+ inventory: sharedMessages.inventories,
778
+ // TODO: remove `inventory` after aligning the resource type names in the file upload API
779
+ 'inventory-entry': sharedMessages.inventories,
780
+ 'order-patch': sharedMessages['order-patches'],
781
+ price: sharedMessages.prices,
782
+ 'product-draft': sharedMessages['product-drafts'],
783
+ 'product-variant': sharedMessages['product-variants'],
784
+ 'product-variant-patch': sharedMessages['product-variant-patches'],
785
+ 'standalone-price': sharedMessages['standalone-prices']
786
+ };
787
+ const message = resourceTypePluralMap[resourceType];
788
+ if (!message) {
789
+ return sharedMessages.unknownResourceType;
790
+ }
791
+ return message;
792
+ }
585
793
 
586
794
  const encodeFileNameWithTimestampToContainerKey = fileName => {
587
795
  return btoa(_JSON$stringify({
@@ -826,13 +1034,13 @@ function getDefaultDropWrapperStyles(_dropAreaState) {
826
1034
  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== */");
827
1035
  }
828
1036
 
829
- var ActiveDragDropArea = /*#__PURE__*/lazy(() => import('./active-drag-drop-area-34cca429.esm.js' /* webpackChunkName: "active-drag-drop-area" */));
1037
+ var ActiveDragDropArea = /*#__PURE__*/lazy(() => import('./active-drag-drop-area-b855fcf6.esm.js' /* webpackChunkName: "active-drag-drop-area" */));
830
1038
 
831
- var DisabledDropArea = /*#__PURE__*/lazy(() => import('./disabled-drop-area-460a605b.esm.js' /* webpackChunkName: "disabled-drop-area" */));
1039
+ var DisabledDropArea = /*#__PURE__*/lazy(() => import('./disabled-drop-area-d56b2ffb.esm.js' /* webpackChunkName: "disabled-drop-area" */));
832
1040
 
833
- var EnabledDropArea = /*#__PURE__*/lazy(() => import('./enabled-drop-area-c2591e72.esm.js' /* webpackChunkName: "enabled-drop-area" */));
1041
+ var EnabledDropArea = /*#__PURE__*/lazy(() => import('./enabled-drop-area-4745c8da.esm.js' /* webpackChunkName: "enabled-drop-area" */));
834
1042
 
835
- var FileDropped = /*#__PURE__*/lazy(() => import('./file-dropped-area-cf7278ba.esm.js' /* webpackChunkName: "filed-dropped-area" */));
1043
+ var FileDropped = /*#__PURE__*/lazy(() => import('./file-dropped-area-bf648f2e.esm.js' /* webpackChunkName: "filed-dropped-area" */));
836
1044
 
837
1045
  function getDropArea(_ref) {
838
1046
  let dropAreaState = _ref.dropAreaState,
@@ -1632,10 +1840,10 @@ var messages$3 = defineMessages({
1632
1840
  description: 'Label for modal path',
1633
1841
  defaultMessage: "Here's a preview of your import"
1634
1842
  },
1635
- rowsToBeImported: {
1636
- id: 'ImportResourcesModal.rowsToBeImported',
1637
- description: 'This message indicates the number of rows that are ready to be imported into the system.',
1638
- defaultMessage: '{rowCount, plural, one {<b>1</b> row to be imported} other {<b>{rowCount}</b> rows to be imported}}{publish, select, true { and published} other {}}'
1843
+ itemsToBeImported: {
1844
+ id: 'ImportResourcesModal.itemsToBeImported',
1845
+ description: 'This message indicates the number of items that are ready to be imported into the project.',
1846
+ defaultMessage: '{itemCount, plural, one {<b>1</b> {resourceType} to be imported{publish, select, true { and published} other {}}} other {<b>{itemCount}</b> {resourceTypePlural} to be imported{publish, select, true { and published} other {}}}}'
1639
1847
  },
1640
1848
  columnsToBeImported: {
1641
1849
  id: 'ImportResourcesModal.columnsToBeImported',
@@ -1744,6 +1952,10 @@ function UploadPreviewModal() {
1744
1952
  actions = _useImportResourcesCo2.actions,
1745
1953
  onClose = _useImportResourcesCo2.onClose;
1746
1954
  if (!state.resourceType || !state.uploadFileResponse) return null;
1955
+ const resourceTypeMessage = resourceTypeToMessage(state.resourceType);
1956
+ const resourceType = intl.formatMessage(resourceTypeMessage).toLowerCase();
1957
+ const resourceTypePluralMessage = resourceTypeToPluralMessage(state.resourceType);
1958
+ const resourceTypePlural = intl.formatMessage(resourceTypePluralMessage).toLowerCase();
1747
1959
  const ignoredColumns = state.uploadFileResponse.ignoredColumns;
1748
1960
  const validatedColumns = getValidatedColumns(state.uploadFileResponse.columns, ignoredColumns);
1749
1961
  return jsx(FormDialog, {
@@ -1781,9 +1993,11 @@ function UploadPreviewModal() {
1781
1993
  children: [jsx(CheckBoldIcon, {
1782
1994
  color: "success"
1783
1995
  }), jsx(Text.Body, {
1784
- intlMessage: _objectSpread$5(_objectSpread$5({}, messages$3.rowsToBeImported), {}, {
1996
+ intlMessage: _objectSpread$5(_objectSpread$5({}, messages$3.itemsToBeImported), {}, {
1785
1997
  values: {
1786
- rowCount: intl.formatNumber(state.uploadFileResponse.rowsCount),
1998
+ resourceType,
1999
+ resourceTypePlural,
2000
+ itemCount: intl.formatNumber(state.uploadFileResponse.itemsCount),
1787
2001
  publish: state.resourceType === 'product' && state.settings?.publish,
1788
2002
  b: getBold$1
1789
2003
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@commercetools-frontend-extensions/import-resources-modal",
3
3
  "description": "Shared import modal for importing resources",
4
- "version": "1.8.0",
4
+ "version": "1.8.1",
5
5
  "license": "BSD-3-Clause",
6
6
  "publishConfig": {
7
7
  "access": "public"