@commercetools-frontend-extensions/export-resources-modal 5.2.0 → 5.3.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.
- package/dist/{active-drag-drop-area-42bf7adf.cjs.dev.js → active-drag-drop-area-e3f74c13.cjs.dev.js} +2 -2
- package/dist/{active-drag-drop-area-6571c6f1.cjs.prod.js → active-drag-drop-area-e9bf7129.cjs.prod.js} +2 -2
- package/dist/{active-drag-drop-area-0c0e312e.esm.js → active-drag-drop-area-fb905a01.esm.js} +2 -2
- package/dist/commercetools-frontend-extensions-export-resources-modal.cjs.dev.js +2 -2
- package/dist/commercetools-frontend-extensions-export-resources-modal.cjs.prod.js +2 -2
- package/dist/commercetools-frontend-extensions-export-resources-modal.esm.js +2 -2
- package/dist/{de-458f4116.esm.js → de-324f2829.esm.js} +64 -20
- package/dist/{de-c18aeb38.cjs.dev.js → de-44143469.cjs.dev.js} +64 -20
- package/dist/{de-172c3905.cjs.prod.js → de-850971a3.cjs.prod.js} +64 -20
- package/dist/declarations/src/@constants/delimiters.d.ts +19 -0
- package/dist/declarations/src/@types/export-api.d.ts +10 -0
- package/dist/declarations/src/@types/form.d.ts +2 -0
- package/dist/{en-bf084198.esm.js → en-015fa203.esm.js} +64 -20
- package/dist/{en-951cd344.cjs.prod.js → en-6928b534.cjs.dev.js} +64 -20
- package/dist/{en-68174953.cjs.dev.js → en-89430bcb.cjs.prod.js} +64 -20
- package/dist/{enabled-drop-area-a86820f8.cjs.prod.js → enabled-drop-area-3161efde.cjs.prod.js} +2 -2
- package/dist/{enabled-drop-area-07845761.esm.js → enabled-drop-area-5d5a61c8.esm.js} +2 -2
- package/dist/{enabled-drop-area-f0ede72d.cjs.dev.js → enabled-drop-area-b35ddf49.cjs.dev.js} +2 -2
- package/dist/{es-a8553ca8.esm.js → es-735dbaf2.esm.js} +64 -20
- package/dist/{es-b0a9fb31.cjs.prod.js → es-e6dd1e27.cjs.dev.js} +64 -20
- package/dist/{es-38a3a3ae.cjs.dev.js → es-e73368be.cjs.prod.js} +64 -20
- package/dist/{file-dropped-area-7de84e37.cjs.prod.js → file-dropped-area-85fb3d1d.cjs.prod.js} +1 -1
- package/dist/{file-dropped-area-016972ea.esm.js → file-dropped-area-aad1bd09.esm.js} +1 -1
- package/dist/{file-dropped-area-2c4b364b.cjs.dev.js → file-dropped-area-ff7e0b8e.cjs.dev.js} +1 -1
- package/dist/{fr-FR-97c22617.cjs.dev.js → fr-FR-0eab30ec.cjs.prod.js} +64 -20
- package/dist/{fr-FR-8146efa8.cjs.prod.js → fr-FR-62affef0.cjs.dev.js} +64 -20
- package/dist/{fr-FR-87237d20.esm.js → fr-FR-96dce16c.esm.js} +64 -20
- package/dist/{index-7cbf648f.cjs.dev.js → index-2ed12fce.cjs.dev.js} +276 -126
- package/dist/{index-47c5bc92.cjs.prod.js → index-e73d846c.cjs.prod.js} +276 -126
- package/dist/{index-b6f8d138.esm.js → index-f0396960.esm.js} +276 -126
- package/dist/{pt-BR-c725734e.cjs.prod.js → pt-BR-13243e64.cjs.dev.js} +64 -20
- package/dist/{pt-BR-cf6abfcc.esm.js → pt-BR-7fd72f5d.esm.js} +64 -20
- package/dist/{pt-BR-c42a98aa.cjs.dev.js → pt-BR-ced88ff5.cjs.prod.js} +64 -20
- package/package.json +4 -4
|
@@ -22,6 +22,7 @@ var jsxRuntime = require('@emotion/react/jsx-runtime');
|
|
|
22
22
|
var _valuesInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/values');
|
|
23
23
|
var applicationComponents = require('@commercetools-frontend/application-components');
|
|
24
24
|
var fullstory = require('@commercetools-frontend/fullstory');
|
|
25
|
+
var _mapInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/map');
|
|
25
26
|
var React = require('react');
|
|
26
27
|
var _Reflect$construct = require('@babel/runtime-corejs3/core-js-stable/reflect/construct');
|
|
27
28
|
var _createClass = require('@babel/runtime-corejs3/helpers/createClass');
|
|
@@ -36,7 +37,6 @@ var omitEmpty = require('omit-empty-es');
|
|
|
36
37
|
var _someInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/some');
|
|
37
38
|
var _findInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/find');
|
|
38
39
|
var _everyInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/every');
|
|
39
|
-
var _mapInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/map');
|
|
40
40
|
var _Array$isArray = require('@babel/runtime-corejs3/core-js-stable/array/is-array');
|
|
41
41
|
var _Set = require('@babel/runtime-corejs3/core-js-stable/set');
|
|
42
42
|
var _sortInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/sort');
|
|
@@ -77,6 +77,7 @@ var _Object$getOwnPropertyDescriptors__default = /*#__PURE__*/_interopDefault(_O
|
|
|
77
77
|
var _Object$defineProperties__default = /*#__PURE__*/_interopDefault(_Object$defineProperties);
|
|
78
78
|
var _Object$defineProperty__default = /*#__PURE__*/_interopDefault(_Object$defineProperty);
|
|
79
79
|
var _valuesInstanceProperty__default = /*#__PURE__*/_interopDefault(_valuesInstanceProperty);
|
|
80
|
+
var _mapInstanceProperty__default = /*#__PURE__*/_interopDefault(_mapInstanceProperty);
|
|
80
81
|
var React__default = /*#__PURE__*/_interopDefault(React);
|
|
81
82
|
var _Reflect$construct__default = /*#__PURE__*/_interopDefault(_Reflect$construct);
|
|
82
83
|
var _reduceInstanceProperty__default = /*#__PURE__*/_interopDefault(_reduceInstanceProperty);
|
|
@@ -85,7 +86,6 @@ var omitEmpty__default = /*#__PURE__*/_interopDefault(omitEmpty);
|
|
|
85
86
|
var _someInstanceProperty__default = /*#__PURE__*/_interopDefault(_someInstanceProperty);
|
|
86
87
|
var _findInstanceProperty__default = /*#__PURE__*/_interopDefault(_findInstanceProperty);
|
|
87
88
|
var _everyInstanceProperty__default = /*#__PURE__*/_interopDefault(_everyInstanceProperty);
|
|
88
|
-
var _mapInstanceProperty__default = /*#__PURE__*/_interopDefault(_mapInstanceProperty);
|
|
89
89
|
var _Array$isArray__default = /*#__PURE__*/_interopDefault(_Array$isArray);
|
|
90
90
|
var _Set__default = /*#__PURE__*/_interopDefault(_Set);
|
|
91
91
|
var _sortInstanceProperty__default = /*#__PURE__*/_interopDefault(_sortInstanceProperty);
|
|
@@ -642,6 +642,61 @@ var messages = reactIntl.defineMessages({
|
|
|
642
642
|
id: 'ExportResourcesModal.noResourcesToExportForQueryPredicate',
|
|
643
643
|
description: 'Error message when there are no resources to export for given query predicate',
|
|
644
644
|
defaultMessage: 'No resources match your query predicate. Please check your query predicate and try again.'
|
|
645
|
+
},
|
|
646
|
+
separators: {
|
|
647
|
+
id: 'ExportResourcesModal.separators',
|
|
648
|
+
description: 'Label for separators',
|
|
649
|
+
defaultMessage: 'Separators'
|
|
650
|
+
},
|
|
651
|
+
separatorsDescription: {
|
|
652
|
+
id: 'ExportResourcesModal.separatorsDescription',
|
|
653
|
+
description: 'Description for column separators',
|
|
654
|
+
defaultMessage: 'Configure how columns are separated in the exported file'
|
|
655
|
+
},
|
|
656
|
+
columns: {
|
|
657
|
+
id: 'ExportResourcesModal.columns',
|
|
658
|
+
description: 'Label for column separator select',
|
|
659
|
+
defaultMessage: 'Columns:'
|
|
660
|
+
},
|
|
661
|
+
decimal: {
|
|
662
|
+
id: 'ExportResourcesModal.decimal',
|
|
663
|
+
description: 'Label for decimal separator select',
|
|
664
|
+
defaultMessage: 'Decimals:'
|
|
665
|
+
},
|
|
666
|
+
columnSeparatorComma: {
|
|
667
|
+
id: 'ExportResourcesModal.columnSeparatorComma',
|
|
668
|
+
description: 'Label for comma column separator option',
|
|
669
|
+
defaultMessage: 'comma (,)'
|
|
670
|
+
},
|
|
671
|
+
columnSeparatorSemicolon: {
|
|
672
|
+
id: 'ExportResourcesModal.columnSeparatorSemicolon',
|
|
673
|
+
description: 'Label for semicolon column separator option',
|
|
674
|
+
defaultMessage: 'semicolon (;)'
|
|
675
|
+
},
|
|
676
|
+
decimalSeparatorPoint: {
|
|
677
|
+
id: 'ExportResourcesModal.decimalSeparatorPoint',
|
|
678
|
+
description: 'Label for point decimal separator option',
|
|
679
|
+
defaultMessage: 'point (.)'
|
|
680
|
+
},
|
|
681
|
+
decimalSeparatorComma: {
|
|
682
|
+
id: 'ExportResourcesModal.decimalSeparatorComma',
|
|
683
|
+
description: 'Label for comma decimal separator option',
|
|
684
|
+
defaultMessage: 'comma (,)'
|
|
685
|
+
},
|
|
686
|
+
columnSeparatorTab: {
|
|
687
|
+
id: 'ExportResourcesModal.columnSeparatorTab',
|
|
688
|
+
description: 'Label for tab column separator option',
|
|
689
|
+
defaultMessage: 'tab (\\t)'
|
|
690
|
+
},
|
|
691
|
+
columnSeparatorPipe: {
|
|
692
|
+
id: 'ExportResourcesModal.columnSeparatorPipe',
|
|
693
|
+
description: 'Label for pipe column separator option',
|
|
694
|
+
defaultMessage: 'pipe (|)'
|
|
695
|
+
},
|
|
696
|
+
csvSettings: {
|
|
697
|
+
id: 'ExportResourcesModal.csvSettings',
|
|
698
|
+
description: 'Label for CSV settings section',
|
|
699
|
+
defaultMessage: 'CSV settings:'
|
|
645
700
|
}
|
|
646
701
|
});
|
|
647
702
|
|
|
@@ -678,10 +733,128 @@ const renderQueryPredicateError = key => {
|
|
|
678
733
|
}
|
|
679
734
|
};
|
|
680
735
|
|
|
736
|
+
const Z_INDEX_DROPDOWN = 30000;
|
|
737
|
+
const OPERATIONS_EXPORT_RESOURCES_MODAL_SELECTION = 'OPERATIONS_EXPORT_RESOURCES_MODAL_SELECTION';
|
|
738
|
+
const OPERATIONS_EXPORT_RESOURCES_MODAL_EXPANDED_GROUP = 'OPERATIONS_EXPORT_RESOURCES_MODAL_EXPANDED_GROUP';
|
|
739
|
+
const TOTAL_STEPS = 3;
|
|
740
|
+
|
|
741
|
+
const DELIMITERS$1 = {
|
|
742
|
+
COMMA: ',',
|
|
743
|
+
SEMICOLON: ';',
|
|
744
|
+
POINT: '.',
|
|
745
|
+
TAB: '\t',
|
|
746
|
+
PIPE: '|'
|
|
747
|
+
};
|
|
748
|
+
const COLUMN_DELIMITER_OPTIONS = [{
|
|
749
|
+
label: messages.columnSeparatorComma,
|
|
750
|
+
value: DELIMITERS$1.COMMA
|
|
751
|
+
}, {
|
|
752
|
+
label: messages.columnSeparatorSemicolon,
|
|
753
|
+
value: DELIMITERS$1.SEMICOLON
|
|
754
|
+
}, {
|
|
755
|
+
label: messages.columnSeparatorTab,
|
|
756
|
+
value: DELIMITERS$1.TAB
|
|
757
|
+
}, {
|
|
758
|
+
label: messages.columnSeparatorPipe,
|
|
759
|
+
value: DELIMITERS$1.PIPE
|
|
760
|
+
}];
|
|
761
|
+
const DECIMAL_DELIMITER_OPTIONS = [{
|
|
762
|
+
label: messages.decimalSeparatorPoint,
|
|
763
|
+
value: DELIMITERS$1.POINT
|
|
764
|
+
}, {
|
|
765
|
+
label: messages.decimalSeparatorComma,
|
|
766
|
+
value: DELIMITERS$1.COMMA
|
|
767
|
+
}];
|
|
768
|
+
|
|
769
|
+
const EXPORT_OPERATION_STATES = {
|
|
770
|
+
PROCESSING: 'processing',
|
|
771
|
+
COMPLETED: 'completed',
|
|
772
|
+
FAILED: 'failed',
|
|
773
|
+
QUEUED: 'queued'
|
|
774
|
+
};
|
|
775
|
+
|
|
776
|
+
const EXPORT_TYPES = {
|
|
777
|
+
ALL: 'all',
|
|
778
|
+
FILTERED: 'filtered',
|
|
779
|
+
SELECTED: 'selected',
|
|
780
|
+
QUERY_PREDICATE: 'query-predicate'
|
|
781
|
+
};
|
|
782
|
+
|
|
783
|
+
const EXPORTABLE_RESOURCES = {
|
|
784
|
+
CATEGORY: 'category',
|
|
785
|
+
PRODUCT: 'product',
|
|
786
|
+
PRODUCT_TYPE: 'product-type',
|
|
787
|
+
DISCOUNT_CODE: 'discount-code',
|
|
788
|
+
INVENTORY_ENTRY: 'inventory-entry',
|
|
789
|
+
ORDER: 'order',
|
|
790
|
+
CUSTOMER: 'customer'
|
|
791
|
+
};
|
|
792
|
+
|
|
793
|
+
const OUTPUT_FORMATS = {
|
|
794
|
+
JSON: 'json',
|
|
795
|
+
CSV: 'csv'
|
|
796
|
+
};
|
|
797
|
+
const OUTPUT_FORMAT_OPTIONS = [{
|
|
798
|
+
value: OUTPUT_FORMATS.CSV,
|
|
799
|
+
label: 'CSV'
|
|
800
|
+
}, {
|
|
801
|
+
value: OUTPUT_FORMATS.JSON,
|
|
802
|
+
label: 'JSON'
|
|
803
|
+
}];
|
|
804
|
+
|
|
681
805
|
const EXPORT_DATA_DOCUMENTATION_LINK = 'https://docs.commercetools.com/merchant-center/export-data';
|
|
682
806
|
const CSV_TEMPLATES_LINK = 'https://docs.commercetools.com/merchant-center/import-data#download-a-template';
|
|
683
807
|
const CSV_STRUCTURE_DOCUMENTATION_LINK = 'https://docs.commercetools.com/merchant-center/export-data#structure-of-exported-csv-files';
|
|
684
808
|
|
|
809
|
+
const resourceTypeMessages = {
|
|
810
|
+
[EXPORTABLE_RESOURCES.CATEGORY]: {
|
|
811
|
+
exportScopeAll: messages.exportScopeAllCategories,
|
|
812
|
+
exportScopeSelected: messages.exportScopeSelectedCategories,
|
|
813
|
+
exportScopeFiltered: messages.exportScopeFilteredCategories
|
|
814
|
+
},
|
|
815
|
+
[EXPORTABLE_RESOURCES.PRODUCT]: {
|
|
816
|
+
exportScopeAll: messages.exportScopeAllProducts,
|
|
817
|
+
exportScopeSelected: messages.exportScopeSelectedProducts,
|
|
818
|
+
exportScopeFiltered: messages.exportScopeFilteredProducts
|
|
819
|
+
},
|
|
820
|
+
[EXPORTABLE_RESOURCES.PRODUCT_TYPE]: {
|
|
821
|
+
exportScopeAll: messages.exportScopeAllProductTypes,
|
|
822
|
+
exportScopeSelected: messages.exportScopeSelectedProductTypes,
|
|
823
|
+
exportScopeFiltered: messages.exportScopeFilteredProductTypes
|
|
824
|
+
},
|
|
825
|
+
[EXPORTABLE_RESOURCES.INVENTORY_ENTRY]: {
|
|
826
|
+
exportScopeAll: messages.exportInventoriesForAllProducts,
|
|
827
|
+
exportScopeSelected: messages.exportInventoriesForSelectedProducts,
|
|
828
|
+
exportScopeFiltered: messages.exportInventoriesForFilteredProducts
|
|
829
|
+
},
|
|
830
|
+
[EXPORTABLE_RESOURCES.DISCOUNT_CODE]: {
|
|
831
|
+
exportScopeAll: messages.exportScopeAllDiscountCodes,
|
|
832
|
+
exportScopeSelected: messages.exportScopeSelectedDiscountCodes,
|
|
833
|
+
exportScopeFiltered: messages.exportScopeFilteredDiscountCodes
|
|
834
|
+
},
|
|
835
|
+
[EXPORTABLE_RESOURCES.ORDER]: {
|
|
836
|
+
exportScopeAll: messages.exportScopeAllOrders,
|
|
837
|
+
exportScopeSelected: messages.exportScopeSelectedOrders,
|
|
838
|
+
exportScopeFiltered: messages.exportScopeFilteredOrders
|
|
839
|
+
},
|
|
840
|
+
[EXPORTABLE_RESOURCES.CUSTOMER]: {
|
|
841
|
+
exportScopeAll: messages.exportScopeAllCustomers,
|
|
842
|
+
exportScopeSelected: messages.exportScopeSelectedCustomers,
|
|
843
|
+
exportScopeFiltered: messages.exportScopeFilteredCustomers
|
|
844
|
+
}
|
|
845
|
+
};
|
|
846
|
+
|
|
847
|
+
const FIELD_SELECTION_MODES = {
|
|
848
|
+
SELECTED_FIELDS: 'selected-fields',
|
|
849
|
+
IMPORTED_CSV_TEMPLATE: 'imported-csv-template'
|
|
850
|
+
};
|
|
851
|
+
|
|
852
|
+
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; }
|
|
853
|
+
function _objectSpread$g(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$g(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$g(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
854
|
+
const DEFAULT_SHORT_LIVED_FLAGS = {};
|
|
855
|
+
const DEFAULT_LONG_LIVED_FLAGS = {};
|
|
856
|
+
_objectSpread$g(_objectSpread$g({}, DEFAULT_SHORT_LIVED_FLAGS), DEFAULT_LONG_LIVED_FLAGS);
|
|
857
|
+
|
|
685
858
|
function _callSuper$3(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$3() ? _Reflect$construct__default["default"](o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
686
859
|
function _isNativeReflectConstruct$3() { try { var t = !Boolean.prototype.valueOf.call(_Reflect$construct__default["default"](Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct$3 = function () { return !!t; })(); }
|
|
687
860
|
let MissingExportResourceProviderError = /*#__PURE__*/function (_Error) {
|
|
@@ -747,8 +920,8 @@ function useExportResourcesModalContext() {
|
|
|
747
920
|
return context;
|
|
748
921
|
}
|
|
749
922
|
|
|
750
|
-
function ownKeys$
|
|
751
|
-
function _objectSpread$
|
|
923
|
+
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; }
|
|
924
|
+
function _objectSpread$f(e) { for (var r = 1; r < arguments.length; r++) { var _context2, _context3; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys$f(Object(t), !0)).call(_context2, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys$f(Object(t))).call(_context3, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
752
925
|
const defaultOptions = {
|
|
753
926
|
storageType: 'local',
|
|
754
927
|
segregateByUser: true
|
|
@@ -766,7 +939,7 @@ const getStorage = storageType => storageType === 'session' ? sessionStorage : l
|
|
|
766
939
|
const isNil = value => typeof value === 'undefined' || value === null;
|
|
767
940
|
const useStorage = (storageKey, initialStorageValue, options) => {
|
|
768
941
|
var _context;
|
|
769
|
-
const mergedOptions = _objectSpread$
|
|
942
|
+
const mergedOptions = _objectSpread$f(_objectSpread$f({}, defaultOptions), options);
|
|
770
943
|
const userId = applicationShellConnectors.useApplicationContext(context => context.user?.id);
|
|
771
944
|
const scopedStorageKey = _filterInstanceProperty__default["default"](_context = [mergedOptions.segregateByUser && userId, storageKey]).call(_context, Boolean).join('/');
|
|
772
945
|
const readFromStorage = React.useCallback(() => {
|
|
@@ -810,96 +983,6 @@ const useStorage = (storageKey, initialStorageValue, options) => {
|
|
|
810
983
|
return [actualStorageValue, writeToStorage, readFromStorage];
|
|
811
984
|
};
|
|
812
985
|
|
|
813
|
-
const Z_INDEX_DROPDOWN = 30000;
|
|
814
|
-
const OPERATIONS_EXPORT_RESOURCES_MODAL_SELECTION = 'OPERATIONS_EXPORT_RESOURCES_MODAL_SELECTION';
|
|
815
|
-
const OPERATIONS_EXPORT_RESOURCES_MODAL_EXPANDED_GROUP = 'OPERATIONS_EXPORT_RESOURCES_MODAL_EXPANDED_GROUP';
|
|
816
|
-
const TOTAL_STEPS = 3;
|
|
817
|
-
|
|
818
|
-
const EXPORT_OPERATION_STATES = {
|
|
819
|
-
PROCESSING: 'processing',
|
|
820
|
-
COMPLETED: 'completed',
|
|
821
|
-
FAILED: 'failed',
|
|
822
|
-
QUEUED: 'queued'
|
|
823
|
-
};
|
|
824
|
-
|
|
825
|
-
const EXPORT_TYPES = {
|
|
826
|
-
ALL: 'all',
|
|
827
|
-
FILTERED: 'filtered',
|
|
828
|
-
SELECTED: 'selected',
|
|
829
|
-
QUERY_PREDICATE: 'query-predicate'
|
|
830
|
-
};
|
|
831
|
-
|
|
832
|
-
const EXPORTABLE_RESOURCES = {
|
|
833
|
-
CATEGORY: 'category',
|
|
834
|
-
PRODUCT: 'product',
|
|
835
|
-
PRODUCT_TYPE: 'product-type',
|
|
836
|
-
DISCOUNT_CODE: 'discount-code',
|
|
837
|
-
INVENTORY_ENTRY: 'inventory-entry',
|
|
838
|
-
ORDER: 'order',
|
|
839
|
-
CUSTOMER: 'customer'
|
|
840
|
-
};
|
|
841
|
-
|
|
842
|
-
const OUTPUT_FORMATS = {
|
|
843
|
-
JSON: 'json',
|
|
844
|
-
CSV: 'csv'
|
|
845
|
-
};
|
|
846
|
-
const OUTPUT_FORMAT_OPTIONS = [{
|
|
847
|
-
value: OUTPUT_FORMATS.CSV,
|
|
848
|
-
label: 'CSV'
|
|
849
|
-
}, {
|
|
850
|
-
value: OUTPUT_FORMATS.JSON,
|
|
851
|
-
label: 'JSON'
|
|
852
|
-
}];
|
|
853
|
-
|
|
854
|
-
const resourceTypeMessages = {
|
|
855
|
-
[EXPORTABLE_RESOURCES.CATEGORY]: {
|
|
856
|
-
exportScopeAll: messages.exportScopeAllCategories,
|
|
857
|
-
exportScopeSelected: messages.exportScopeSelectedCategories,
|
|
858
|
-
exportScopeFiltered: messages.exportScopeFilteredCategories
|
|
859
|
-
},
|
|
860
|
-
[EXPORTABLE_RESOURCES.PRODUCT]: {
|
|
861
|
-
exportScopeAll: messages.exportScopeAllProducts,
|
|
862
|
-
exportScopeSelected: messages.exportScopeSelectedProducts,
|
|
863
|
-
exportScopeFiltered: messages.exportScopeFilteredProducts
|
|
864
|
-
},
|
|
865
|
-
[EXPORTABLE_RESOURCES.PRODUCT_TYPE]: {
|
|
866
|
-
exportScopeAll: messages.exportScopeAllProductTypes,
|
|
867
|
-
exportScopeSelected: messages.exportScopeSelectedProductTypes,
|
|
868
|
-
exportScopeFiltered: messages.exportScopeFilteredProductTypes
|
|
869
|
-
},
|
|
870
|
-
[EXPORTABLE_RESOURCES.INVENTORY_ENTRY]: {
|
|
871
|
-
exportScopeAll: messages.exportInventoriesForAllProducts,
|
|
872
|
-
exportScopeSelected: messages.exportInventoriesForSelectedProducts,
|
|
873
|
-
exportScopeFiltered: messages.exportInventoriesForFilteredProducts
|
|
874
|
-
},
|
|
875
|
-
[EXPORTABLE_RESOURCES.DISCOUNT_CODE]: {
|
|
876
|
-
exportScopeAll: messages.exportScopeAllDiscountCodes,
|
|
877
|
-
exportScopeSelected: messages.exportScopeSelectedDiscountCodes,
|
|
878
|
-
exportScopeFiltered: messages.exportScopeFilteredDiscountCodes
|
|
879
|
-
},
|
|
880
|
-
[EXPORTABLE_RESOURCES.ORDER]: {
|
|
881
|
-
exportScopeAll: messages.exportScopeAllOrders,
|
|
882
|
-
exportScopeSelected: messages.exportScopeSelectedOrders,
|
|
883
|
-
exportScopeFiltered: messages.exportScopeFilteredOrders
|
|
884
|
-
},
|
|
885
|
-
[EXPORTABLE_RESOURCES.CUSTOMER]: {
|
|
886
|
-
exportScopeAll: messages.exportScopeAllCustomers,
|
|
887
|
-
exportScopeSelected: messages.exportScopeSelectedCustomers,
|
|
888
|
-
exportScopeFiltered: messages.exportScopeFilteredCustomers
|
|
889
|
-
}
|
|
890
|
-
};
|
|
891
|
-
|
|
892
|
-
const FIELD_SELECTION_MODES = {
|
|
893
|
-
SELECTED_FIELDS: 'selected-fields',
|
|
894
|
-
IMPORTED_CSV_TEMPLATE: 'imported-csv-template'
|
|
895
|
-
};
|
|
896
|
-
|
|
897
|
-
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; }
|
|
898
|
-
function _objectSpread$f(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$f(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$f(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
899
|
-
const DEFAULT_SHORT_LIVED_FLAGS = {};
|
|
900
|
-
const DEFAULT_LONG_LIVED_FLAGS = {};
|
|
901
|
-
_objectSpread$f(_objectSpread$f({}, DEFAULT_SHORT_LIVED_FLAGS), DEFAULT_LONG_LIVED_FLAGS);
|
|
902
|
-
|
|
903
986
|
function resourceTypeToFileName(resourceType, locale) {
|
|
904
987
|
var _context;
|
|
905
988
|
const date = new Date();
|
|
@@ -1489,13 +1572,14 @@ const useInitialValues = props => {
|
|
|
1489
1572
|
groups = updateFieldGroupsWithIsCheckedValue(groups, cachedSelectedGroups?.[props.resourceType] || {});
|
|
1490
1573
|
groups = updateFieldGroupsWithIsExpandedValue(groups, cachedExpandedGroups?.[props.resourceType] || {});
|
|
1491
1574
|
return {
|
|
1492
|
-
outputFormat: props.outputFormat,
|
|
1493
1575
|
fileName: `${resourceTypeToFileName(props.resourceType, userLocale)}`,
|
|
1494
1576
|
locales: [locale],
|
|
1495
1577
|
groups: updateFieldGroupWithAdditionalFieldExtensions(groups),
|
|
1496
1578
|
queryPredicate: '',
|
|
1497
|
-
// Preferences
|
|
1498
1579
|
fillRows: false,
|
|
1580
|
+
outputFormat: props.outputFormat,
|
|
1581
|
+
columnSeparator: DELIMITERS$1.COMMA,
|
|
1582
|
+
decimalSeparator: DELIMITERS$1.POINT,
|
|
1499
1583
|
importedCsvTemplateFile: null
|
|
1500
1584
|
};
|
|
1501
1585
|
}, [props.fieldGroups, props.resourceType, props.outputFormat, cachedSelectedGroups, cachedExpandedGroups, locale, userLocale]);
|
|
@@ -1571,13 +1655,18 @@ const useStartExportOperation = props => {
|
|
|
1571
1655
|
if (localeOption !== 'onlyLocalesFoundInCsvFile') {
|
|
1572
1656
|
locales = values.locales;
|
|
1573
1657
|
}
|
|
1658
|
+
const isCsv = values.outputFormat === 'csv';
|
|
1574
1659
|
const response = await createExportOperation({
|
|
1575
1660
|
projectKey,
|
|
1576
1661
|
resourceType: props.resourceType,
|
|
1577
1662
|
fileName: appendCsvOrJsonExtensionIfAbsent(values.fileName, values.outputFormat),
|
|
1578
1663
|
fileFormat: values.outputFormat,
|
|
1579
1664
|
locales,
|
|
1580
|
-
fillRows:
|
|
1665
|
+
fillRows: isCsv && values.fillRows,
|
|
1666
|
+
separator: isCsv ? {
|
|
1667
|
+
columns: values.columnSeparator,
|
|
1668
|
+
decimal: values.decimalSeparator
|
|
1669
|
+
} : undefined,
|
|
1581
1670
|
fields,
|
|
1582
1671
|
where,
|
|
1583
1672
|
filters
|
|
@@ -1811,25 +1900,78 @@ function _objectSpread$a(e) { for (var r = 1; r < arguments.length; r++) { var _
|
|
|
1811
1900
|
const ExportPreferenceSection = () => {
|
|
1812
1901
|
const _useExportResourcesMo = useExportResourcesModalContext(),
|
|
1813
1902
|
formik = _useExportResourcesMo.formik;
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1903
|
+
const columnSeparatorOptions = _mapInstanceProperty__default["default"](COLUMN_DELIMITER_OPTIONS).call(COLUMN_DELIMITER_OPTIONS, option => _objectSpread$a(_objectSpread$a({}, option), {}, {
|
|
1904
|
+
label: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$a({}, option.label))
|
|
1905
|
+
}));
|
|
1906
|
+
const decimalSeparatorOptions = _mapInstanceProperty__default["default"](DECIMAL_DELIMITER_OPTIONS).call(DECIMAL_DELIMITER_OPTIONS, option => _objectSpread$a(_objectSpread$a({}, option), {}, {
|
|
1907
|
+
label: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$a({}, option.label))
|
|
1908
|
+
}));
|
|
1909
|
+
return jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
1910
|
+
scale: "m",
|
|
1911
|
+
children: [jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
1912
|
+
scale: "s",
|
|
1913
|
+
children: [jsxRuntime.jsxs("div", {
|
|
1914
|
+
children: [jsxRuntime.jsx(uiKit.Text.Body, {
|
|
1915
|
+
intlMessage: messages.separators
|
|
1916
|
+
}), jsxRuntime.jsx(uiKit.Text.Caption, {
|
|
1917
|
+
intlMessage: messages.separatorsDescription
|
|
1918
|
+
})]
|
|
1919
|
+
}), jsxRuntime.jsxs(uiKit.Spacings.Inline, {
|
|
1920
|
+
scale: "s",
|
|
1921
|
+
children: [jsxRuntime.jsxs(uiKit.Spacings.Inline, {
|
|
1922
|
+
scale: "xs",
|
|
1923
|
+
alignItems: "center",
|
|
1924
|
+
children: [jsxRuntime.jsx(uiKit.Text.Body, {
|
|
1925
|
+
intlMessage: messages.columns
|
|
1926
|
+
}), jsxRuntime.jsx(uiKit.SelectInput, {
|
|
1927
|
+
horizontalConstraint: 4,
|
|
1928
|
+
isSearchable: false,
|
|
1929
|
+
options: columnSeparatorOptions,
|
|
1930
|
+
value: _valuesInstanceProperty__default["default"](formik).columnSeparator,
|
|
1931
|
+
onChange: e => {
|
|
1932
|
+
formik.setFieldValue('columnSeparator', e.target.value);
|
|
1933
|
+
},
|
|
1934
|
+
menuPortalTarget: document.body,
|
|
1935
|
+
menuPortalZIndex: Z_INDEX_DROPDOWN
|
|
1936
|
+
})]
|
|
1937
|
+
}), jsxRuntime.jsxs(uiKit.Spacings.Inline, {
|
|
1938
|
+
scale: "s",
|
|
1939
|
+
alignItems: "center",
|
|
1940
|
+
children: [jsxRuntime.jsx(uiKit.Text.Body, {
|
|
1941
|
+
intlMessage: messages.decimal
|
|
1942
|
+
}), jsxRuntime.jsx(uiKit.SelectInput, {
|
|
1943
|
+
isSearchable: false,
|
|
1944
|
+
options: decimalSeparatorOptions,
|
|
1945
|
+
value: _valuesInstanceProperty__default["default"](formik).decimalSeparator,
|
|
1946
|
+
onChange: e => {
|
|
1947
|
+
formik.setFieldValue('decimalSeparator', e.target.value);
|
|
1948
|
+
},
|
|
1949
|
+
menuPortalTarget: document.body,
|
|
1950
|
+
horizontalConstraint: 4,
|
|
1951
|
+
menuPortalZIndex: Z_INDEX_DROPDOWN
|
|
1952
|
+
})]
|
|
1953
|
+
})]
|
|
1954
|
+
})]
|
|
1955
|
+
}), jsxRuntime.jsxs("div", {
|
|
1956
|
+
children: [jsxRuntime.jsx(uiKit.CheckboxInput, {
|
|
1957
|
+
isChecked: _valuesInstanceProperty__default["default"](formik).fillRows,
|
|
1958
|
+
onChange: e => {
|
|
1959
|
+
formik.setFieldValue('fillRows', e.target.checked);
|
|
1960
|
+
},
|
|
1961
|
+
children: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$a({}, messages.fillRows))
|
|
1962
|
+
}), jsxRuntime.jsxs(uiKit.Spacings.Inline, {
|
|
1963
|
+
scale: "xl",
|
|
1964
|
+
children: [jsxRuntime.jsx("div", {}), jsxRuntime.jsx(uiKit.Text.Caption, {
|
|
1965
|
+
intlMessage: _objectSpread$a(_objectSpread$a({}, messages.moreInformation), {}, {
|
|
1966
|
+
values: {
|
|
1967
|
+
documentationLink: jsxRuntime.jsx(uiKit.Link, {
|
|
1968
|
+
intlMessage: messages.documentation,
|
|
1969
|
+
isExternal: true,
|
|
1970
|
+
to: CSV_STRUCTURE_DOCUMENTATION_LINK
|
|
1971
|
+
}, "documentation-link")
|
|
1972
|
+
}
|
|
1973
|
+
})
|
|
1974
|
+
})]
|
|
1833
1975
|
})]
|
|
1834
1976
|
})]
|
|
1835
1977
|
});
|
|
@@ -1983,8 +2125,16 @@ const ExportFileSettingsStep = () => {
|
|
|
1983
2125
|
options: OUTPUT_FORMAT_OPTIONS,
|
|
1984
2126
|
menuPortalTarget: document.body,
|
|
1985
2127
|
menuPortalZIndex: Z_INDEX_DROPDOWN
|
|
1986
|
-
})
|
|
2128
|
+
})]
|
|
1987
2129
|
})
|
|
2130
|
+
}), shouldShowPreferences && jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
2131
|
+
children: [jsxRuntime.jsx(uiKit.Grid.Item, {
|
|
2132
|
+
children: jsxRuntime.jsx(uiKit.Text.Body, {
|
|
2133
|
+
intlMessage: messages.csvSettings
|
|
2134
|
+
})
|
|
2135
|
+
}), jsxRuntime.jsx(uiKit.Grid.Item, {
|
|
2136
|
+
children: jsxRuntime.jsx(ExportPreferenceSection, {})
|
|
2137
|
+
})]
|
|
1988
2138
|
})]
|
|
1989
2139
|
})
|
|
1990
2140
|
})
|
|
@@ -3172,11 +3322,11 @@ function getDefaultDropWrapperStyles(_dropAreaState) {
|
|
|
3172
3322
|
return /*#__PURE__*/react.css("" , "" );
|
|
3173
3323
|
}
|
|
3174
3324
|
|
|
3175
|
-
var ActiveDragDropArea = /*#__PURE__*/React.lazy(() => Promise.resolve().then(function () { return require('./active-drag-drop-area-
|
|
3325
|
+
var ActiveDragDropArea = /*#__PURE__*/React.lazy(() => Promise.resolve().then(function () { return require('./active-drag-drop-area-e9bf7129.cjs.prod.js' /* webpackChunkName: "active-drag-drop-area" */); }));
|
|
3176
3326
|
|
|
3177
|
-
var EnabledDropArea = /*#__PURE__*/React.lazy(() => Promise.resolve().then(function () { return require('./enabled-drop-area-
|
|
3327
|
+
var EnabledDropArea = /*#__PURE__*/React.lazy(() => Promise.resolve().then(function () { return require('./enabled-drop-area-3161efde.cjs.prod.js' /* webpackChunkName: "enabled-drop-area" */); }));
|
|
3178
3328
|
|
|
3179
|
-
var FileDropped = /*#__PURE__*/React.lazy(() => Promise.resolve().then(function () { return require('./file-dropped-area-
|
|
3329
|
+
var FileDropped = /*#__PURE__*/React.lazy(() => Promise.resolve().then(function () { return require('./file-dropped-area-85fb3d1d.cjs.prod.js' /* webpackChunkName: "filed-dropped-area" */); }));
|
|
3180
3330
|
|
|
3181
3331
|
function getDropArea(_ref) {
|
|
3182
3332
|
let dropAreaState = _ref.dropAreaState,
|
|
@@ -3257,17 +3407,17 @@ const getChunkImport = locale => {
|
|
|
3257
3407
|
const intlLocale = i18n.mapLocaleToIntlLocale(locale);
|
|
3258
3408
|
switch (intlLocale) {
|
|
3259
3409
|
case 'de':
|
|
3260
|
-
return Promise.resolve().then(function () { return require(/* webpackChunkName: "export-resources-modal-i18n-de" */'./de-
|
|
3410
|
+
return Promise.resolve().then(function () { return require(/* webpackChunkName: "export-resources-modal-i18n-de" */'./de-850971a3.cjs.prod.js'); });
|
|
3261
3411
|
case 'es':
|
|
3262
|
-
return Promise.resolve().then(function () { return require(/* webpackChunkName: "export-resources-modal-i18n-es" */'./es-
|
|
3412
|
+
return Promise.resolve().then(function () { return require(/* webpackChunkName: "export-resources-modal-i18n-es" */'./es-e73368be.cjs.prod.js'); });
|
|
3263
3413
|
case 'fr-FR':
|
|
3264
|
-
return Promise.resolve().then(function () { return require(/* webpackChunkName: "export-resources-modal-i18n-fr-FR" */'./fr-FR-
|
|
3414
|
+
return Promise.resolve().then(function () { return require(/* webpackChunkName: "export-resources-modal-i18n-fr-FR" */'./fr-FR-0eab30ec.cjs.prod.js'); });
|
|
3265
3415
|
case 'ja':
|
|
3266
3416
|
return Promise.resolve().then(function () { return require(/* webpackChunkName: "export-resources-modal-i18n-ja" */'./ja-37632763.cjs.prod.js'); });
|
|
3267
3417
|
case 'pt-BR':
|
|
3268
|
-
return Promise.resolve().then(function () { return require(/* webpackChunkName: "change-history-i18n-pt-BR" */'./pt-BR-
|
|
3418
|
+
return Promise.resolve().then(function () { return require(/* webpackChunkName: "change-history-i18n-pt-BR" */'./pt-BR-ced88ff5.cjs.prod.js'); });
|
|
3269
3419
|
default:
|
|
3270
|
-
return Promise.resolve().then(function () { return require(/* webpackChunkName: "export-resources-modal-i18n-en" */'./en-
|
|
3420
|
+
return Promise.resolve().then(function () { return require(/* webpackChunkName: "export-resources-modal-i18n-en" */'./en-89430bcb.cjs.prod.js'); });
|
|
3271
3421
|
}
|
|
3272
3422
|
};
|
|
3273
3423
|
const loadMessages = async locale => {
|