@commercetools-frontend-extensions/import-resources-modal 2.3.1 → 2.3.3

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.
@@ -36,6 +36,7 @@ var _mapInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instan
36
36
  var _sliceInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/slice');
37
37
  var _styled = require('@emotion/styled/base');
38
38
  require('@emotion/react');
39
+ var _Object$assign = require('@babel/runtime-corejs3/core-js-stable/object/assign');
39
40
  var i18n = require('@commercetools-frontend/i18n');
40
41
 
41
42
  function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
@@ -54,6 +55,7 @@ var _Reflect$construct__default = /*#__PURE__*/_interopDefault(_Reflect$construc
54
55
  var _mapInstanceProperty__default = /*#__PURE__*/_interopDefault(_mapInstanceProperty);
55
56
  var _sliceInstanceProperty__default = /*#__PURE__*/_interopDefault(_sliceInstanceProperty);
56
57
  var _styled__default = /*#__PURE__*/_interopDefault(_styled);
58
+ var _Object$assign__default = /*#__PURE__*/_interopDefault(_Object$assign);
57
59
 
58
60
  let CurrentStep$1 = /*#__PURE__*/function (CurrentStep) {
59
61
  CurrentStep["Upload"] = "upload";
@@ -479,20 +481,6 @@ var messages$6 = reactIntl.defineMessages({
479
481
  }
480
482
  });
481
483
 
482
- function _callSuper$1(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$1() ? _Reflect$construct__default["default"](o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
483
- function _isNativeReflectConstruct$1() { try { var t = !Boolean.prototype.valueOf.call(_Reflect$construct__default["default"](Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct$1 = function () { return !!t; })(); }
484
- let UnexpectedResourceTypeError = /*#__PURE__*/function (_Error) {
485
- function UnexpectedResourceTypeError(resourceType) {
486
- var _this;
487
- _classCallCheck(this, UnexpectedResourceTypeError);
488
- _this = _callSuper$1(this, UnexpectedResourceTypeError, [`Unexpected resource type "${resourceType}"`]);
489
- _this.name = 'UnexpectedResourceTypeError';
490
- return _this;
491
- }
492
- _inherits(UnexpectedResourceTypeError, _Error);
493
- return _createClass(UnexpectedResourceTypeError);
494
- }(/*#__PURE__*/_wrapNativeSuper(Error));
495
-
496
484
  function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? _Reflect$construct__default["default"](o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
497
485
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(_Reflect$construct__default["default"](Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function () { return !!t; })(); }
498
486
  let MissingImportResourceProviderError = /*#__PURE__*/function (_Error) {
@@ -683,184 +671,7 @@ var sharedMessages = reactIntl.defineMessages({
683
671
  id: 'ImportResourcesModal.delimiterTab',
684
672
  description: 'Label for the delimiter name tab',
685
673
  defaultMessage: 'tab'
686
- },
687
- // Resource types
688
- product: {
689
- id: 'ImportResourcesModal.product',
690
- description: 'Label for the product resource type',
691
- defaultMessage: 'Product'
692
- },
693
- products: {
694
- id: 'ImportResourcesModal.products',
695
- description: 'Label for the products resource type',
696
- defaultMessage: 'Products'
697
- },
698
- inventory: {
699
- id: 'ImportResourcesModal.inventory',
700
- description: 'Label for the inventory entry resource type',
701
- defaultMessage: 'Inventory'
702
- },
703
- inventories: {
704
- id: 'ImportResourcesModal.inventories',
705
- description: 'Label for the inventories entry resource type',
706
- defaultMessage: 'Inventories'
707
- },
708
- category: {
709
- id: 'ImportResourcesModal.category',
710
- description: 'Label for the category resource type',
711
- defaultMessage: 'Category'
712
- },
713
- categories: {
714
- id: 'ImportResourcesModal.categories',
715
- description: 'Label for the categories resource type',
716
- defaultMessage: 'Categories'
717
- },
718
- 'custom-object': {
719
- id: 'ImportResourcesModal.custom-object',
720
- description: 'Label for the custom-object resource type',
721
- defaultMessage: 'Custom object'
722
- },
723
- 'custom-objects': {
724
- id: 'ImportResourcesModal.custom-objects',
725
- description: 'Label for the custom-objects resource type',
726
- defaultMessage: 'Custom objects'
727
- },
728
- customer: {
729
- id: 'ImportResourcesModal.customer',
730
- description: 'Label for the customer resource type',
731
- defaultMessage: 'Customer'
732
- },
733
- customers: {
734
- id: 'ImportResourcesModal.customers',
735
- description: 'Label for the customers resource type',
736
- defaultMessage: 'Customers'
737
- },
738
- order: {
739
- id: 'ImportResourcesModal.order',
740
- description: 'Label for the order resource type',
741
- defaultMessage: 'Order'
742
- },
743
- orders: {
744
- id: 'ImportResourcesModal.orders',
745
- description: 'Label for the orders resource type',
746
- defaultMessage: 'Orders'
747
- },
748
- 'order-patch': {
749
- id: 'ImportResourcesModal.order-patch',
750
- description: 'Label for the order-patch resource type',
751
- defaultMessage: 'Order patch'
752
- },
753
- 'order-patches': {
754
- id: 'ImportResourcesModal.order-patches',
755
- description: 'Label for the order-patches resource type',
756
- defaultMessage: 'Order patches'
757
- },
758
- price: {
759
- id: 'ImportResourcesModal.price',
760
- description: 'Label for the price resource type',
761
- defaultMessage: 'Price'
762
- },
763
- prices: {
764
- id: 'ImportResourcesModal.prices',
765
- description: 'Label for the prices resource type',
766
- defaultMessage: 'Prices'
767
- },
768
- 'product-draft': {
769
- id: 'ImportResourcesModal.product-draft',
770
- description: 'Label for the product-draft resource type',
771
- defaultMessage: 'Product draft'
772
- },
773
- 'product-drafts': {
774
- id: 'ImportResourcesModal.product-drafts',
775
- description: 'Label for the product-drafts resource type',
776
- defaultMessage: 'Product drafts'
777
- },
778
- 'product-type': {
779
- id: 'ImportResourcesModal.product-type',
780
- description: 'Label for the product-type resource type',
781
- defaultMessage: 'Product type'
782
- },
783
- 'product-types': {
784
- id: 'ImportResourcesModal.product-types',
785
- description: 'Label for the product-types resource type',
786
- defaultMessage: 'Product types'
787
- },
788
- 'product-variant': {
789
- id: 'ImportResourcesModal.product-variant',
790
- description: 'Label for the product-variant resource type',
791
- defaultMessage: 'Product variant'
792
- },
793
- 'product-variants': {
794
- id: 'ImportResourcesModal.product-variants',
795
- description: 'Label for the product-variants resource type',
796
- defaultMessage: 'Product variants'
797
- },
798
- 'product-variant-patch': {
799
- id: 'ImportResourcesModal.product-variant-patch',
800
- description: 'Label for the product-variant-patch resource type',
801
- defaultMessage: 'Product variant patch'
802
- },
803
- 'product-variant-patches': {
804
- id: 'ImportResourcesModal.product-variant-patches',
805
- description: 'Label for the product-variant-patches resource type',
806
- defaultMessage: 'Product variant patches'
807
- },
808
- 'standalone-price': {
809
- id: 'ImportResourcesModal.standalone-price',
810
- description: 'Label for the standalone-price resource type',
811
- defaultMessage: 'Standalone price'
812
- },
813
- 'standalone-prices': {
814
- id: 'ImportResourcesModal.standalone-prices',
815
- description: 'Label for the standalone-prices resource type',
816
- defaultMessage: 'Standalone prices'
817
- },
818
- type: {
819
- id: 'ImportResourcesModal.type',
820
- description: 'Label for the type resource type',
821
- defaultMessage: 'Type'
822
- },
823
- types: {
824
- id: 'ImportResourcesModal.types',
825
- description: 'Label for the types resource type',
826
- defaultMessage: 'Types'
827
- },
828
- 'discount-code': {
829
- id: 'ImportResourcesModal.discount-code',
830
- description: 'Label for the discount-code resource type',
831
- defaultMessage: 'Discount code'
832
- },
833
- 'discount-codes': {
834
- id: 'ImportResourcesModal.discount-codes',
835
- description: 'Label for the discount-codes resource type',
836
- defaultMessage: 'Discount codes'
837
- },
838
- 'business-unit': {
839
- id: 'ImportResourcesModal.business-unit',
840
- description: 'Label for the business-unit resource type',
841
- defaultMessage: 'Business unit'
842
- },
843
- 'business-units': {
844
- id: 'ImportResourcesModal.business-units',
845
- description: 'Label for the business-units resource type',
846
- defaultMessage: 'Business units'
847
- },
848
- 'product-tailoring': {
849
- id: 'ImportResourcesModal.product-tailoring',
850
- description: 'Label for the product-tailoring resource type',
851
- defaultMessage: 'Tailored product'
852
- },
853
- 'product-tailorings': {
854
- id: 'ImportResourcesModal.product-tailorings',
855
- description: 'Label for the product-tailorings resource type',
856
- defaultMessage: 'Tailored products'
857
- },
858
- unknownResourceType: {
859
- id: 'ImportResourcesModal.unknown-resource-type',
860
- description: 'Label for the unknown resource type',
861
- defaultMessage: 'Unknown resource type'
862
674
  }
863
- //
864
675
  });
865
676
 
866
677
  const formatAllowedDelimitersForMessageDisplay = intl => {
@@ -893,60 +704,6 @@ const formatAllowedDelimitersForMessageDisplay = intl => {
893
704
  return `${descriptions.join(', ')} ${localizedOr} ${lastDescription}`;
894
705
  };
895
706
 
896
- function resourceTypeToMessage(resourceType) {
897
- const resourceTypeMap = {
898
- category: sharedMessages.category,
899
- product: sharedMessages.product,
900
- 'product-type': sharedMessages['product-type'],
901
- order: sharedMessages.order,
902
- customer: sharedMessages.customer,
903
- 'discount-code': sharedMessages['discount-code'],
904
- inventory: sharedMessages.inventory,
905
- 'inventory-entry': sharedMessages.inventory,
906
- 'order-patch': sharedMessages['order-patch'],
907
- price: sharedMessages.price,
908
- 'product-draft': sharedMessages['product-draft'],
909
- 'product-variant': sharedMessages['product-variant'],
910
- 'product-variant-patch': sharedMessages['product-variant-patch'],
911
- 'standalone-price': sharedMessages['standalone-price'],
912
- 'custom-object': sharedMessages['custom-object'],
913
- 'business-unit': sharedMessages['business-unit'],
914
- type: sharedMessages.type
915
- };
916
- const message = resourceTypeMap[resourceType];
917
- if (!message) {
918
- console.warn(new UnexpectedResourceTypeError(resourceType));
919
- return sharedMessages.unknownResourceType;
920
- }
921
- return message;
922
- }
923
- function resourceTypeToPluralMessage(resourceType) {
924
- const resourceTypePluralMap = {
925
- category: sharedMessages.categories,
926
- 'custom-object': sharedMessages['custom-objects'],
927
- product: sharedMessages.products,
928
- 'product-type': sharedMessages['product-types'],
929
- order: sharedMessages.orders,
930
- customer: sharedMessages.customers,
931
- 'discount-code': sharedMessages['discount-codes'],
932
- inventory: sharedMessages.inventories,
933
- 'inventory-entry': sharedMessages.inventories,
934
- 'order-patch': sharedMessages['order-patches'],
935
- price: sharedMessages.prices,
936
- 'product-draft': sharedMessages['product-drafts'],
937
- 'product-variant': sharedMessages['product-variants'],
938
- 'product-variant-patch': sharedMessages['product-variant-patches'],
939
- 'standalone-price': sharedMessages['standalone-prices'],
940
- 'business-unit': sharedMessages['business-units']
941
- };
942
- const message = resourceTypePluralMap[resourceType];
943
- if (!message) {
944
- console.warn(new UnexpectedResourceTypeError(resourceType));
945
- return sharedMessages.unknownResourceType;
946
- }
947
- return message;
948
- }
949
-
950
707
  function ownKeys$8(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; }
951
708
  function _objectSpread$8(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$8(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$8(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
952
709
  const useUpload = () => {
@@ -1832,9 +1589,9 @@ function UploadPreviewModal() {
1832
1589
  actions = _useImportResourcesCo2.actions,
1833
1590
  onClose = _useImportResourcesCo2.onClose;
1834
1591
  if (!state.resourceType || !state.uploadFileResponse) return null;
1835
- const resourceTypeMessage = resourceTypeToMessage(state.resourceType);
1592
+ const resourceTypeMessage = operations.resourceTypeToMessage(state.resourceType);
1836
1593
  const resourceType = intl.formatMessage(resourceTypeMessage).toLowerCase();
1837
- const resourceTypePluralMessage = resourceTypeToPluralMessage(state.resourceType);
1594
+ const resourceTypePluralMessage = operations.resourceTypeToPluralMessage(state.resourceType);
1838
1595
  const resourceTypePlural = intl.formatMessage(resourceTypePluralMessage).toLowerCase();
1839
1596
  const ignoredFields = state.uploadFileResponse.ignoredFields;
1840
1597
  const validatedFields = operations.getValidatedColumns(state.uploadFileResponse.fields, ignoredFields);
@@ -2265,25 +2022,25 @@ const getChunkImport = locale => {
2265
2022
  const intlLocale = i18n.mapLocaleToIntlLocale(locale);
2266
2023
  switch (intlLocale) {
2267
2024
  case 'de':
2268
- return Promise.resolve().then(function () { return require('./de-0448f656.cjs.dev.js'); });
2025
+ return Promise.resolve().then(function () { return require('./de-a31d2063.cjs.dev.js'); });
2269
2026
  case 'es':
2270
- return Promise.resolve().then(function () { return require('./es-940bc30c.cjs.dev.js'); });
2027
+ return Promise.resolve().then(function () { return require('./es-81c2ca0d.cjs.dev.js'); });
2271
2028
  case 'fr-FR':
2272
- return Promise.resolve().then(function () { return require('./fr-FR-d70727e6.cjs.dev.js'); });
2029
+ return Promise.resolve().then(function () { return require('./fr-FR-623135de.cjs.dev.js'); });
2273
2030
  case 'ja':
2274
2031
  return Promise.resolve().then(function () { return require('./ja-9bd5f452.cjs.dev.js'); });
2275
2032
  case 'pt-BR':
2276
- return Promise.resolve().then(function () { return require('./pt-BR-44964d81.cjs.dev.js'); });
2033
+ return Promise.resolve().then(function () { return require('./pt-BR-738d57c6.cjs.dev.js'); });
2277
2034
  default:
2278
- return Promise.resolve().then(function () { return require('./en-68bea2f6.cjs.dev.js'); });
2035
+ return Promise.resolve().then(function () { return require('./en-35a7944d.cjs.dev.js'); });
2279
2036
  }
2280
2037
  };
2281
2038
  const loadMessages = async locale => {
2282
2039
  try {
2040
+ const operationsSharedMessages = await operations.loadOperationsSharedMessages(locale);
2283
2041
  const chunkImport = await getChunkImport(locale);
2284
- return i18n.parseChunkImport(chunkImport);
2042
+ return _Object$assign__default["default"]({}, operationsSharedMessages, i18n.parseChunkImport(chunkImport));
2285
2043
  } catch (error) {
2286
- // eslint-disable-next-line no-console
2287
2044
  console.warn(`Something went wrong while loading the import-resources-modal messages for ${locale}`, error);
2288
2045
  sentry.reportErrorToSentry(new Error(`Something went wrong while loading the import-resources-modal messages for ${locale}`), {
2289
2046
  extra: error
@@ -36,6 +36,7 @@ var _mapInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instan
36
36
  var _sliceInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/slice');
37
37
  var _styled = require('@emotion/styled/base');
38
38
  require('@emotion/react');
39
+ var _Object$assign = require('@babel/runtime-corejs3/core-js-stable/object/assign');
39
40
  var i18n = require('@commercetools-frontend/i18n');
40
41
 
41
42
  function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
@@ -54,6 +55,7 @@ var _Reflect$construct__default = /*#__PURE__*/_interopDefault(_Reflect$construc
54
55
  var _mapInstanceProperty__default = /*#__PURE__*/_interopDefault(_mapInstanceProperty);
55
56
  var _sliceInstanceProperty__default = /*#__PURE__*/_interopDefault(_sliceInstanceProperty);
56
57
  var _styled__default = /*#__PURE__*/_interopDefault(_styled);
58
+ var _Object$assign__default = /*#__PURE__*/_interopDefault(_Object$assign);
57
59
 
58
60
  let CurrentStep$1 = /*#__PURE__*/function (CurrentStep) {
59
61
  CurrentStep["Upload"] = "upload";
@@ -479,20 +481,6 @@ var messages$6 = reactIntl.defineMessages({
479
481
  }
480
482
  });
481
483
 
482
- function _callSuper$1(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$1() ? _Reflect$construct__default["default"](o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
483
- function _isNativeReflectConstruct$1() { try { var t = !Boolean.prototype.valueOf.call(_Reflect$construct__default["default"](Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct$1 = function () { return !!t; })(); }
484
- let UnexpectedResourceTypeError = /*#__PURE__*/function (_Error) {
485
- function UnexpectedResourceTypeError(resourceType) {
486
- var _this;
487
- _classCallCheck(this, UnexpectedResourceTypeError);
488
- _this = _callSuper$1(this, UnexpectedResourceTypeError, [`Unexpected resource type "${resourceType}"`]);
489
- _this.name = 'UnexpectedResourceTypeError';
490
- return _this;
491
- }
492
- _inherits(UnexpectedResourceTypeError, _Error);
493
- return _createClass(UnexpectedResourceTypeError);
494
- }(/*#__PURE__*/_wrapNativeSuper(Error));
495
-
496
484
  function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? _Reflect$construct__default["default"](o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
497
485
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(_Reflect$construct__default["default"](Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function () { return !!t; })(); }
498
486
  let MissingImportResourceProviderError = /*#__PURE__*/function (_Error) {
@@ -683,184 +671,7 @@ var sharedMessages = reactIntl.defineMessages({
683
671
  id: 'ImportResourcesModal.delimiterTab',
684
672
  description: 'Label for the delimiter name tab',
685
673
  defaultMessage: 'tab'
686
- },
687
- // Resource types
688
- product: {
689
- id: 'ImportResourcesModal.product',
690
- description: 'Label for the product resource type',
691
- defaultMessage: 'Product'
692
- },
693
- products: {
694
- id: 'ImportResourcesModal.products',
695
- description: 'Label for the products resource type',
696
- defaultMessage: 'Products'
697
- },
698
- inventory: {
699
- id: 'ImportResourcesModal.inventory',
700
- description: 'Label for the inventory entry resource type',
701
- defaultMessage: 'Inventory'
702
- },
703
- inventories: {
704
- id: 'ImportResourcesModal.inventories',
705
- description: 'Label for the inventories entry resource type',
706
- defaultMessage: 'Inventories'
707
- },
708
- category: {
709
- id: 'ImportResourcesModal.category',
710
- description: 'Label for the category resource type',
711
- defaultMessage: 'Category'
712
- },
713
- categories: {
714
- id: 'ImportResourcesModal.categories',
715
- description: 'Label for the categories resource type',
716
- defaultMessage: 'Categories'
717
- },
718
- 'custom-object': {
719
- id: 'ImportResourcesModal.custom-object',
720
- description: 'Label for the custom-object resource type',
721
- defaultMessage: 'Custom object'
722
- },
723
- 'custom-objects': {
724
- id: 'ImportResourcesModal.custom-objects',
725
- description: 'Label for the custom-objects resource type',
726
- defaultMessage: 'Custom objects'
727
- },
728
- customer: {
729
- id: 'ImportResourcesModal.customer',
730
- description: 'Label for the customer resource type',
731
- defaultMessage: 'Customer'
732
- },
733
- customers: {
734
- id: 'ImportResourcesModal.customers',
735
- description: 'Label for the customers resource type',
736
- defaultMessage: 'Customers'
737
- },
738
- order: {
739
- id: 'ImportResourcesModal.order',
740
- description: 'Label for the order resource type',
741
- defaultMessage: 'Order'
742
- },
743
- orders: {
744
- id: 'ImportResourcesModal.orders',
745
- description: 'Label for the orders resource type',
746
- defaultMessage: 'Orders'
747
- },
748
- 'order-patch': {
749
- id: 'ImportResourcesModal.order-patch',
750
- description: 'Label for the order-patch resource type',
751
- defaultMessage: 'Order patch'
752
- },
753
- 'order-patches': {
754
- id: 'ImportResourcesModal.order-patches',
755
- description: 'Label for the order-patches resource type',
756
- defaultMessage: 'Order patches'
757
- },
758
- price: {
759
- id: 'ImportResourcesModal.price',
760
- description: 'Label for the price resource type',
761
- defaultMessage: 'Price'
762
- },
763
- prices: {
764
- id: 'ImportResourcesModal.prices',
765
- description: 'Label for the prices resource type',
766
- defaultMessage: 'Prices'
767
- },
768
- 'product-draft': {
769
- id: 'ImportResourcesModal.product-draft',
770
- description: 'Label for the product-draft resource type',
771
- defaultMessage: 'Product draft'
772
- },
773
- 'product-drafts': {
774
- id: 'ImportResourcesModal.product-drafts',
775
- description: 'Label for the product-drafts resource type',
776
- defaultMessage: 'Product drafts'
777
- },
778
- 'product-type': {
779
- id: 'ImportResourcesModal.product-type',
780
- description: 'Label for the product-type resource type',
781
- defaultMessage: 'Product type'
782
- },
783
- 'product-types': {
784
- id: 'ImportResourcesModal.product-types',
785
- description: 'Label for the product-types resource type',
786
- defaultMessage: 'Product types'
787
- },
788
- 'product-variant': {
789
- id: 'ImportResourcesModal.product-variant',
790
- description: 'Label for the product-variant resource type',
791
- defaultMessage: 'Product variant'
792
- },
793
- 'product-variants': {
794
- id: 'ImportResourcesModal.product-variants',
795
- description: 'Label for the product-variants resource type',
796
- defaultMessage: 'Product variants'
797
- },
798
- 'product-variant-patch': {
799
- id: 'ImportResourcesModal.product-variant-patch',
800
- description: 'Label for the product-variant-patch resource type',
801
- defaultMessage: 'Product variant patch'
802
- },
803
- 'product-variant-patches': {
804
- id: 'ImportResourcesModal.product-variant-patches',
805
- description: 'Label for the product-variant-patches resource type',
806
- defaultMessage: 'Product variant patches'
807
- },
808
- 'standalone-price': {
809
- id: 'ImportResourcesModal.standalone-price',
810
- description: 'Label for the standalone-price resource type',
811
- defaultMessage: 'Standalone price'
812
- },
813
- 'standalone-prices': {
814
- id: 'ImportResourcesModal.standalone-prices',
815
- description: 'Label for the standalone-prices resource type',
816
- defaultMessage: 'Standalone prices'
817
- },
818
- type: {
819
- id: 'ImportResourcesModal.type',
820
- description: 'Label for the type resource type',
821
- defaultMessage: 'Type'
822
- },
823
- types: {
824
- id: 'ImportResourcesModal.types',
825
- description: 'Label for the types resource type',
826
- defaultMessage: 'Types'
827
- },
828
- 'discount-code': {
829
- id: 'ImportResourcesModal.discount-code',
830
- description: 'Label for the discount-code resource type',
831
- defaultMessage: 'Discount code'
832
- },
833
- 'discount-codes': {
834
- id: 'ImportResourcesModal.discount-codes',
835
- description: 'Label for the discount-codes resource type',
836
- defaultMessage: 'Discount codes'
837
- },
838
- 'business-unit': {
839
- id: 'ImportResourcesModal.business-unit',
840
- description: 'Label for the business-unit resource type',
841
- defaultMessage: 'Business unit'
842
- },
843
- 'business-units': {
844
- id: 'ImportResourcesModal.business-units',
845
- description: 'Label for the business-units resource type',
846
- defaultMessage: 'Business units'
847
- },
848
- 'product-tailoring': {
849
- id: 'ImportResourcesModal.product-tailoring',
850
- description: 'Label for the product-tailoring resource type',
851
- defaultMessage: 'Tailored product'
852
- },
853
- 'product-tailorings': {
854
- id: 'ImportResourcesModal.product-tailorings',
855
- description: 'Label for the product-tailorings resource type',
856
- defaultMessage: 'Tailored products'
857
- },
858
- unknownResourceType: {
859
- id: 'ImportResourcesModal.unknown-resource-type',
860
- description: 'Label for the unknown resource type',
861
- defaultMessage: 'Unknown resource type'
862
674
  }
863
- //
864
675
  });
865
676
 
866
677
  const formatAllowedDelimitersForMessageDisplay = intl => {
@@ -893,60 +704,6 @@ const formatAllowedDelimitersForMessageDisplay = intl => {
893
704
  return `${descriptions.join(', ')} ${localizedOr} ${lastDescription}`;
894
705
  };
895
706
 
896
- function resourceTypeToMessage(resourceType) {
897
- const resourceTypeMap = {
898
- category: sharedMessages.category,
899
- product: sharedMessages.product,
900
- 'product-type': sharedMessages['product-type'],
901
- order: sharedMessages.order,
902
- customer: sharedMessages.customer,
903
- 'discount-code': sharedMessages['discount-code'],
904
- inventory: sharedMessages.inventory,
905
- 'inventory-entry': sharedMessages.inventory,
906
- 'order-patch': sharedMessages['order-patch'],
907
- price: sharedMessages.price,
908
- 'product-draft': sharedMessages['product-draft'],
909
- 'product-variant': sharedMessages['product-variant'],
910
- 'product-variant-patch': sharedMessages['product-variant-patch'],
911
- 'standalone-price': sharedMessages['standalone-price'],
912
- 'custom-object': sharedMessages['custom-object'],
913
- 'business-unit': sharedMessages['business-unit'],
914
- type: sharedMessages.type
915
- };
916
- const message = resourceTypeMap[resourceType];
917
- if (!message) {
918
- console.warn(new UnexpectedResourceTypeError(resourceType));
919
- return sharedMessages.unknownResourceType;
920
- }
921
- return message;
922
- }
923
- function resourceTypeToPluralMessage(resourceType) {
924
- const resourceTypePluralMap = {
925
- category: sharedMessages.categories,
926
- 'custom-object': sharedMessages['custom-objects'],
927
- product: sharedMessages.products,
928
- 'product-type': sharedMessages['product-types'],
929
- order: sharedMessages.orders,
930
- customer: sharedMessages.customers,
931
- 'discount-code': sharedMessages['discount-codes'],
932
- inventory: sharedMessages.inventories,
933
- 'inventory-entry': sharedMessages.inventories,
934
- 'order-patch': sharedMessages['order-patches'],
935
- price: sharedMessages.prices,
936
- 'product-draft': sharedMessages['product-drafts'],
937
- 'product-variant': sharedMessages['product-variants'],
938
- 'product-variant-patch': sharedMessages['product-variant-patches'],
939
- 'standalone-price': sharedMessages['standalone-prices'],
940
- 'business-unit': sharedMessages['business-units']
941
- };
942
- const message = resourceTypePluralMap[resourceType];
943
- if (!message) {
944
- console.warn(new UnexpectedResourceTypeError(resourceType));
945
- return sharedMessages.unknownResourceType;
946
- }
947
- return message;
948
- }
949
-
950
707
  function ownKeys$8(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; }
951
708
  function _objectSpread$8(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$8(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$8(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
952
709
  const useUpload = () => {
@@ -1817,9 +1574,9 @@ function UploadPreviewModal() {
1817
1574
  actions = _useImportResourcesCo2.actions,
1818
1575
  onClose = _useImportResourcesCo2.onClose;
1819
1576
  if (!state.resourceType || !state.uploadFileResponse) return null;
1820
- const resourceTypeMessage = resourceTypeToMessage(state.resourceType);
1577
+ const resourceTypeMessage = operations.resourceTypeToMessage(state.resourceType);
1821
1578
  const resourceType = intl.formatMessage(resourceTypeMessage).toLowerCase();
1822
- const resourceTypePluralMessage = resourceTypeToPluralMessage(state.resourceType);
1579
+ const resourceTypePluralMessage = operations.resourceTypeToPluralMessage(state.resourceType);
1823
1580
  const resourceTypePlural = intl.formatMessage(resourceTypePluralMessage).toLowerCase();
1824
1581
  const ignoredFields = state.uploadFileResponse.ignoredFields;
1825
1582
  const validatedFields = operations.getValidatedColumns(state.uploadFileResponse.fields, ignoredFields);
@@ -2241,25 +1998,25 @@ const getChunkImport = locale => {
2241
1998
  const intlLocale = i18n.mapLocaleToIntlLocale(locale);
2242
1999
  switch (intlLocale) {
2243
2000
  case 'de':
2244
- return Promise.resolve().then(function () { return require('./de-47c75212.cjs.prod.js'); });
2001
+ return Promise.resolve().then(function () { return require('./de-0ce529e5.cjs.prod.js'); });
2245
2002
  case 'es':
2246
- return Promise.resolve().then(function () { return require('./es-8928a452.cjs.prod.js'); });
2003
+ return Promise.resolve().then(function () { return require('./es-f002fb75.cjs.prod.js'); });
2247
2004
  case 'fr-FR':
2248
- return Promise.resolve().then(function () { return require('./fr-FR-009e5200.cjs.prod.js'); });
2005
+ return Promise.resolve().then(function () { return require('./fr-FR-6934dd9a.cjs.prod.js'); });
2249
2006
  case 'ja':
2250
2007
  return Promise.resolve().then(function () { return require('./ja-37632763.cjs.prod.js'); });
2251
2008
  case 'pt-BR':
2252
- return Promise.resolve().then(function () { return require('./pt-BR-896c08dd.cjs.prod.js'); });
2009
+ return Promise.resolve().then(function () { return require('./pt-BR-fc6fee1b.cjs.prod.js'); });
2253
2010
  default:
2254
- return Promise.resolve().then(function () { return require('./en-7485a81f.cjs.prod.js'); });
2011
+ return Promise.resolve().then(function () { return require('./en-20fa3390.cjs.prod.js'); });
2255
2012
  }
2256
2013
  };
2257
2014
  const loadMessages = async locale => {
2258
2015
  try {
2016
+ const operationsSharedMessages = await operations.loadOperationsSharedMessages(locale);
2259
2017
  const chunkImport = await getChunkImport(locale);
2260
- return i18n.parseChunkImport(chunkImport);
2018
+ return _Object$assign__default["default"]({}, operationsSharedMessages, i18n.parseChunkImport(chunkImport));
2261
2019
  } catch (error) {
2262
- // eslint-disable-next-line no-console
2263
2020
  console.warn(`Something went wrong while loading the import-resources-modal messages for ${locale}`, error);
2264
2021
  sentry.reportErrorToSentry(new Error(`Something went wrong while loading the import-resources-modal messages for ${locale}`), {
2265
2022
  extra: error