@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
|
@@ -15,11 +15,12 @@ import _Object$defineProperties from '@babel/runtime-corejs3/core-js-stable/obje
|
|
|
15
15
|
import _Object$defineProperty from '@babel/runtime-corejs3/core-js-stable/object/define-property';
|
|
16
16
|
import { defineMessages, FormattedMessage, useIntl, IntlProvider } from 'react-intl';
|
|
17
17
|
import { useApplicationContext } from '@commercetools-frontend/application-shell-connectors';
|
|
18
|
-
import { Text, TextInput,
|
|
18
|
+
import { Text, TextInput, Spacings, SelectInput, CheckboxInput, Link, RadioInput, TextField, AngleRightIcon, Grid, designTokens, SelectField, FieldLabel, Constraints, Tooltip, SupportIcon, Stamp, IconButton, AngleDownIcon, CollapsibleMotion, Card, SearchTextInput, TagList, FlatButton, AngleUpIcon, CheckBoldIcon, DataTable } from '@commercetools-frontend/ui-kit';
|
|
19
19
|
import { jsx, jsxs, Fragment } from '@emotion/react/jsx-runtime';
|
|
20
20
|
import _valuesInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/values';
|
|
21
21
|
import { FormDialog } from '@commercetools-frontend/application-components';
|
|
22
22
|
import { Masking } from '@commercetools-frontend/fullstory';
|
|
23
|
+
import _mapInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/map';
|
|
23
24
|
import React, { useContext, useCallback, useState, useEffect, createContext, Fragment as Fragment$1, useMemo, lazy } from 'react';
|
|
24
25
|
import _Reflect$construct from '@babel/runtime-corejs3/core-js-stable/reflect/construct';
|
|
25
26
|
import _createClass from '@babel/runtime-corejs3/helpers/esm/createClass';
|
|
@@ -34,7 +35,6 @@ import omitEmpty from 'omit-empty-es';
|
|
|
34
35
|
import _someInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/some';
|
|
35
36
|
import _findInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/find';
|
|
36
37
|
import _everyInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/every';
|
|
37
|
-
import _mapInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/map';
|
|
38
38
|
import _Array$isArray from '@babel/runtime-corejs3/core-js-stable/array/is-array';
|
|
39
39
|
import _Set from '@babel/runtime-corejs3/core-js-stable/set';
|
|
40
40
|
import _sortInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/sort';
|
|
@@ -601,6 +601,61 @@ var messages = defineMessages({
|
|
|
601
601
|
id: 'ExportResourcesModal.noResourcesToExportForQueryPredicate',
|
|
602
602
|
description: 'Error message when there are no resources to export for given query predicate',
|
|
603
603
|
defaultMessage: 'No resources match your query predicate. Please check your query predicate and try again.'
|
|
604
|
+
},
|
|
605
|
+
separators: {
|
|
606
|
+
id: 'ExportResourcesModal.separators',
|
|
607
|
+
description: 'Label for separators',
|
|
608
|
+
defaultMessage: 'Separators'
|
|
609
|
+
},
|
|
610
|
+
separatorsDescription: {
|
|
611
|
+
id: 'ExportResourcesModal.separatorsDescription',
|
|
612
|
+
description: 'Description for column separators',
|
|
613
|
+
defaultMessage: 'Configure how columns are separated in the exported file'
|
|
614
|
+
},
|
|
615
|
+
columns: {
|
|
616
|
+
id: 'ExportResourcesModal.columns',
|
|
617
|
+
description: 'Label for column separator select',
|
|
618
|
+
defaultMessage: 'Columns:'
|
|
619
|
+
},
|
|
620
|
+
decimal: {
|
|
621
|
+
id: 'ExportResourcesModal.decimal',
|
|
622
|
+
description: 'Label for decimal separator select',
|
|
623
|
+
defaultMessage: 'Decimals:'
|
|
624
|
+
},
|
|
625
|
+
columnSeparatorComma: {
|
|
626
|
+
id: 'ExportResourcesModal.columnSeparatorComma',
|
|
627
|
+
description: 'Label for comma column separator option',
|
|
628
|
+
defaultMessage: 'comma (,)'
|
|
629
|
+
},
|
|
630
|
+
columnSeparatorSemicolon: {
|
|
631
|
+
id: 'ExportResourcesModal.columnSeparatorSemicolon',
|
|
632
|
+
description: 'Label for semicolon column separator option',
|
|
633
|
+
defaultMessage: 'semicolon (;)'
|
|
634
|
+
},
|
|
635
|
+
decimalSeparatorPoint: {
|
|
636
|
+
id: 'ExportResourcesModal.decimalSeparatorPoint',
|
|
637
|
+
description: 'Label for point decimal separator option',
|
|
638
|
+
defaultMessage: 'point (.)'
|
|
639
|
+
},
|
|
640
|
+
decimalSeparatorComma: {
|
|
641
|
+
id: 'ExportResourcesModal.decimalSeparatorComma',
|
|
642
|
+
description: 'Label for comma decimal separator option',
|
|
643
|
+
defaultMessage: 'comma (,)'
|
|
644
|
+
},
|
|
645
|
+
columnSeparatorTab: {
|
|
646
|
+
id: 'ExportResourcesModal.columnSeparatorTab',
|
|
647
|
+
description: 'Label for tab column separator option',
|
|
648
|
+
defaultMessage: 'tab (\\t)'
|
|
649
|
+
},
|
|
650
|
+
columnSeparatorPipe: {
|
|
651
|
+
id: 'ExportResourcesModal.columnSeparatorPipe',
|
|
652
|
+
description: 'Label for pipe column separator option',
|
|
653
|
+
defaultMessage: 'pipe (|)'
|
|
654
|
+
},
|
|
655
|
+
csvSettings: {
|
|
656
|
+
id: 'ExportResourcesModal.csvSettings',
|
|
657
|
+
description: 'Label for CSV settings section',
|
|
658
|
+
defaultMessage: 'CSV settings:'
|
|
604
659
|
}
|
|
605
660
|
});
|
|
606
661
|
|
|
@@ -637,10 +692,128 @@ const renderQueryPredicateError = key => {
|
|
|
637
692
|
}
|
|
638
693
|
};
|
|
639
694
|
|
|
695
|
+
const Z_INDEX_DROPDOWN = 30000;
|
|
696
|
+
const OPERATIONS_EXPORT_RESOURCES_MODAL_SELECTION = 'OPERATIONS_EXPORT_RESOURCES_MODAL_SELECTION';
|
|
697
|
+
const OPERATIONS_EXPORT_RESOURCES_MODAL_EXPANDED_GROUP = 'OPERATIONS_EXPORT_RESOURCES_MODAL_EXPANDED_GROUP';
|
|
698
|
+
const TOTAL_STEPS = 3;
|
|
699
|
+
|
|
700
|
+
const DELIMITERS$1 = {
|
|
701
|
+
COMMA: ',',
|
|
702
|
+
SEMICOLON: ';',
|
|
703
|
+
POINT: '.',
|
|
704
|
+
TAB: '\t',
|
|
705
|
+
PIPE: '|'
|
|
706
|
+
};
|
|
707
|
+
const COLUMN_DELIMITER_OPTIONS = [{
|
|
708
|
+
label: messages.columnSeparatorComma,
|
|
709
|
+
value: DELIMITERS$1.COMMA
|
|
710
|
+
}, {
|
|
711
|
+
label: messages.columnSeparatorSemicolon,
|
|
712
|
+
value: DELIMITERS$1.SEMICOLON
|
|
713
|
+
}, {
|
|
714
|
+
label: messages.columnSeparatorTab,
|
|
715
|
+
value: DELIMITERS$1.TAB
|
|
716
|
+
}, {
|
|
717
|
+
label: messages.columnSeparatorPipe,
|
|
718
|
+
value: DELIMITERS$1.PIPE
|
|
719
|
+
}];
|
|
720
|
+
const DECIMAL_DELIMITER_OPTIONS = [{
|
|
721
|
+
label: messages.decimalSeparatorPoint,
|
|
722
|
+
value: DELIMITERS$1.POINT
|
|
723
|
+
}, {
|
|
724
|
+
label: messages.decimalSeparatorComma,
|
|
725
|
+
value: DELIMITERS$1.COMMA
|
|
726
|
+
}];
|
|
727
|
+
|
|
728
|
+
const EXPORT_OPERATION_STATES = {
|
|
729
|
+
PROCESSING: 'processing',
|
|
730
|
+
COMPLETED: 'completed',
|
|
731
|
+
FAILED: 'failed',
|
|
732
|
+
QUEUED: 'queued'
|
|
733
|
+
};
|
|
734
|
+
|
|
735
|
+
const EXPORT_TYPES = {
|
|
736
|
+
ALL: 'all',
|
|
737
|
+
FILTERED: 'filtered',
|
|
738
|
+
SELECTED: 'selected',
|
|
739
|
+
QUERY_PREDICATE: 'query-predicate'
|
|
740
|
+
};
|
|
741
|
+
|
|
742
|
+
const EXPORTABLE_RESOURCES = {
|
|
743
|
+
CATEGORY: 'category',
|
|
744
|
+
PRODUCT: 'product',
|
|
745
|
+
PRODUCT_TYPE: 'product-type',
|
|
746
|
+
DISCOUNT_CODE: 'discount-code',
|
|
747
|
+
INVENTORY_ENTRY: 'inventory-entry',
|
|
748
|
+
ORDER: 'order',
|
|
749
|
+
CUSTOMER: 'customer'
|
|
750
|
+
};
|
|
751
|
+
|
|
752
|
+
const OUTPUT_FORMATS = {
|
|
753
|
+
JSON: 'json',
|
|
754
|
+
CSV: 'csv'
|
|
755
|
+
};
|
|
756
|
+
const OUTPUT_FORMAT_OPTIONS = [{
|
|
757
|
+
value: OUTPUT_FORMATS.CSV,
|
|
758
|
+
label: 'CSV'
|
|
759
|
+
}, {
|
|
760
|
+
value: OUTPUT_FORMATS.JSON,
|
|
761
|
+
label: 'JSON'
|
|
762
|
+
}];
|
|
763
|
+
|
|
640
764
|
const EXPORT_DATA_DOCUMENTATION_LINK = 'https://docs.commercetools.com/merchant-center/export-data';
|
|
641
765
|
const CSV_TEMPLATES_LINK = 'https://docs.commercetools.com/merchant-center/import-data#download-a-template';
|
|
642
766
|
const CSV_STRUCTURE_DOCUMENTATION_LINK = 'https://docs.commercetools.com/merchant-center/export-data#structure-of-exported-csv-files';
|
|
643
767
|
|
|
768
|
+
const resourceTypeMessages = {
|
|
769
|
+
[EXPORTABLE_RESOURCES.CATEGORY]: {
|
|
770
|
+
exportScopeAll: messages.exportScopeAllCategories,
|
|
771
|
+
exportScopeSelected: messages.exportScopeSelectedCategories,
|
|
772
|
+
exportScopeFiltered: messages.exportScopeFilteredCategories
|
|
773
|
+
},
|
|
774
|
+
[EXPORTABLE_RESOURCES.PRODUCT]: {
|
|
775
|
+
exportScopeAll: messages.exportScopeAllProducts,
|
|
776
|
+
exportScopeSelected: messages.exportScopeSelectedProducts,
|
|
777
|
+
exportScopeFiltered: messages.exportScopeFilteredProducts
|
|
778
|
+
},
|
|
779
|
+
[EXPORTABLE_RESOURCES.PRODUCT_TYPE]: {
|
|
780
|
+
exportScopeAll: messages.exportScopeAllProductTypes,
|
|
781
|
+
exportScopeSelected: messages.exportScopeSelectedProductTypes,
|
|
782
|
+
exportScopeFiltered: messages.exportScopeFilteredProductTypes
|
|
783
|
+
},
|
|
784
|
+
[EXPORTABLE_RESOURCES.INVENTORY_ENTRY]: {
|
|
785
|
+
exportScopeAll: messages.exportInventoriesForAllProducts,
|
|
786
|
+
exportScopeSelected: messages.exportInventoriesForSelectedProducts,
|
|
787
|
+
exportScopeFiltered: messages.exportInventoriesForFilteredProducts
|
|
788
|
+
},
|
|
789
|
+
[EXPORTABLE_RESOURCES.DISCOUNT_CODE]: {
|
|
790
|
+
exportScopeAll: messages.exportScopeAllDiscountCodes,
|
|
791
|
+
exportScopeSelected: messages.exportScopeSelectedDiscountCodes,
|
|
792
|
+
exportScopeFiltered: messages.exportScopeFilteredDiscountCodes
|
|
793
|
+
},
|
|
794
|
+
[EXPORTABLE_RESOURCES.ORDER]: {
|
|
795
|
+
exportScopeAll: messages.exportScopeAllOrders,
|
|
796
|
+
exportScopeSelected: messages.exportScopeSelectedOrders,
|
|
797
|
+
exportScopeFiltered: messages.exportScopeFilteredOrders
|
|
798
|
+
},
|
|
799
|
+
[EXPORTABLE_RESOURCES.CUSTOMER]: {
|
|
800
|
+
exportScopeAll: messages.exportScopeAllCustomers,
|
|
801
|
+
exportScopeSelected: messages.exportScopeSelectedCustomers,
|
|
802
|
+
exportScopeFiltered: messages.exportScopeFilteredCustomers
|
|
803
|
+
}
|
|
804
|
+
};
|
|
805
|
+
|
|
806
|
+
const FIELD_SELECTION_MODES = {
|
|
807
|
+
SELECTED_FIELDS: 'selected-fields',
|
|
808
|
+
IMPORTED_CSV_TEMPLATE: 'imported-csv-template'
|
|
809
|
+
};
|
|
810
|
+
|
|
811
|
+
function ownKeys$g(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; }
|
|
812
|
+
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(_context = ownKeys$g(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context2 = ownKeys$g(Object(t))).call(_context2, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
813
|
+
const DEFAULT_SHORT_LIVED_FLAGS = {};
|
|
814
|
+
const DEFAULT_LONG_LIVED_FLAGS = {};
|
|
815
|
+
_objectSpread$g(_objectSpread$g({}, DEFAULT_SHORT_LIVED_FLAGS), DEFAULT_LONG_LIVED_FLAGS);
|
|
816
|
+
|
|
644
817
|
function _callSuper$3(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$3() ? _Reflect$construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
645
818
|
function _isNativeReflectConstruct$3() { try { var t = !Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct$3 = function () { return !!t; })(); }
|
|
646
819
|
let MissingExportResourceProviderError = /*#__PURE__*/function (_Error) {
|
|
@@ -706,8 +879,8 @@ function useExportResourcesModalContext() {
|
|
|
706
879
|
return context;
|
|
707
880
|
}
|
|
708
881
|
|
|
709
|
-
function ownKeys$
|
|
710
|
-
function _objectSpread$
|
|
882
|
+
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; }
|
|
883
|
+
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(_context2 = ownKeys$f(Object(t), !0)).call(_context2, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context3 = ownKeys$f(Object(t))).call(_context3, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
711
884
|
const defaultOptions = {
|
|
712
885
|
storageType: 'local',
|
|
713
886
|
segregateByUser: true
|
|
@@ -725,7 +898,7 @@ const getStorage = storageType => storageType === 'session' ? sessionStorage : l
|
|
|
725
898
|
const isNil = value => typeof value === 'undefined' || value === null;
|
|
726
899
|
const useStorage = (storageKey, initialStorageValue, options) => {
|
|
727
900
|
var _context;
|
|
728
|
-
const mergedOptions = _objectSpread$
|
|
901
|
+
const mergedOptions = _objectSpread$f(_objectSpread$f({}, defaultOptions), options);
|
|
729
902
|
const userId = useApplicationContext(context => context.user?.id);
|
|
730
903
|
const scopedStorageKey = _filterInstanceProperty(_context = [mergedOptions.segregateByUser && userId, storageKey]).call(_context, Boolean).join('/');
|
|
731
904
|
const readFromStorage = useCallback(() => {
|
|
@@ -769,96 +942,6 @@ const useStorage = (storageKey, initialStorageValue, options) => {
|
|
|
769
942
|
return [actualStorageValue, writeToStorage, readFromStorage];
|
|
770
943
|
};
|
|
771
944
|
|
|
772
|
-
const Z_INDEX_DROPDOWN = 30000;
|
|
773
|
-
const OPERATIONS_EXPORT_RESOURCES_MODAL_SELECTION = 'OPERATIONS_EXPORT_RESOURCES_MODAL_SELECTION';
|
|
774
|
-
const OPERATIONS_EXPORT_RESOURCES_MODAL_EXPANDED_GROUP = 'OPERATIONS_EXPORT_RESOURCES_MODAL_EXPANDED_GROUP';
|
|
775
|
-
const TOTAL_STEPS = 3;
|
|
776
|
-
|
|
777
|
-
const EXPORT_OPERATION_STATES = {
|
|
778
|
-
PROCESSING: 'processing',
|
|
779
|
-
COMPLETED: 'completed',
|
|
780
|
-
FAILED: 'failed',
|
|
781
|
-
QUEUED: 'queued'
|
|
782
|
-
};
|
|
783
|
-
|
|
784
|
-
const EXPORT_TYPES = {
|
|
785
|
-
ALL: 'all',
|
|
786
|
-
FILTERED: 'filtered',
|
|
787
|
-
SELECTED: 'selected',
|
|
788
|
-
QUERY_PREDICATE: 'query-predicate'
|
|
789
|
-
};
|
|
790
|
-
|
|
791
|
-
const EXPORTABLE_RESOURCES = {
|
|
792
|
-
CATEGORY: 'category',
|
|
793
|
-
PRODUCT: 'product',
|
|
794
|
-
PRODUCT_TYPE: 'product-type',
|
|
795
|
-
DISCOUNT_CODE: 'discount-code',
|
|
796
|
-
INVENTORY_ENTRY: 'inventory-entry',
|
|
797
|
-
ORDER: 'order',
|
|
798
|
-
CUSTOMER: 'customer'
|
|
799
|
-
};
|
|
800
|
-
|
|
801
|
-
const OUTPUT_FORMATS = {
|
|
802
|
-
JSON: 'json',
|
|
803
|
-
CSV: 'csv'
|
|
804
|
-
};
|
|
805
|
-
const OUTPUT_FORMAT_OPTIONS = [{
|
|
806
|
-
value: OUTPUT_FORMATS.CSV,
|
|
807
|
-
label: 'CSV'
|
|
808
|
-
}, {
|
|
809
|
-
value: OUTPUT_FORMATS.JSON,
|
|
810
|
-
label: 'JSON'
|
|
811
|
-
}];
|
|
812
|
-
|
|
813
|
-
const resourceTypeMessages = {
|
|
814
|
-
[EXPORTABLE_RESOURCES.CATEGORY]: {
|
|
815
|
-
exportScopeAll: messages.exportScopeAllCategories,
|
|
816
|
-
exportScopeSelected: messages.exportScopeSelectedCategories,
|
|
817
|
-
exportScopeFiltered: messages.exportScopeFilteredCategories
|
|
818
|
-
},
|
|
819
|
-
[EXPORTABLE_RESOURCES.PRODUCT]: {
|
|
820
|
-
exportScopeAll: messages.exportScopeAllProducts,
|
|
821
|
-
exportScopeSelected: messages.exportScopeSelectedProducts,
|
|
822
|
-
exportScopeFiltered: messages.exportScopeFilteredProducts
|
|
823
|
-
},
|
|
824
|
-
[EXPORTABLE_RESOURCES.PRODUCT_TYPE]: {
|
|
825
|
-
exportScopeAll: messages.exportScopeAllProductTypes,
|
|
826
|
-
exportScopeSelected: messages.exportScopeSelectedProductTypes,
|
|
827
|
-
exportScopeFiltered: messages.exportScopeFilteredProductTypes
|
|
828
|
-
},
|
|
829
|
-
[EXPORTABLE_RESOURCES.INVENTORY_ENTRY]: {
|
|
830
|
-
exportScopeAll: messages.exportInventoriesForAllProducts,
|
|
831
|
-
exportScopeSelected: messages.exportInventoriesForSelectedProducts,
|
|
832
|
-
exportScopeFiltered: messages.exportInventoriesForFilteredProducts
|
|
833
|
-
},
|
|
834
|
-
[EXPORTABLE_RESOURCES.DISCOUNT_CODE]: {
|
|
835
|
-
exportScopeAll: messages.exportScopeAllDiscountCodes,
|
|
836
|
-
exportScopeSelected: messages.exportScopeSelectedDiscountCodes,
|
|
837
|
-
exportScopeFiltered: messages.exportScopeFilteredDiscountCodes
|
|
838
|
-
},
|
|
839
|
-
[EXPORTABLE_RESOURCES.ORDER]: {
|
|
840
|
-
exportScopeAll: messages.exportScopeAllOrders,
|
|
841
|
-
exportScopeSelected: messages.exportScopeSelectedOrders,
|
|
842
|
-
exportScopeFiltered: messages.exportScopeFilteredOrders
|
|
843
|
-
},
|
|
844
|
-
[EXPORTABLE_RESOURCES.CUSTOMER]: {
|
|
845
|
-
exportScopeAll: messages.exportScopeAllCustomers,
|
|
846
|
-
exportScopeSelected: messages.exportScopeSelectedCustomers,
|
|
847
|
-
exportScopeFiltered: messages.exportScopeFilteredCustomers
|
|
848
|
-
}
|
|
849
|
-
};
|
|
850
|
-
|
|
851
|
-
const FIELD_SELECTION_MODES = {
|
|
852
|
-
SELECTED_FIELDS: 'selected-fields',
|
|
853
|
-
IMPORTED_CSV_TEMPLATE: 'imported-csv-template'
|
|
854
|
-
};
|
|
855
|
-
|
|
856
|
-
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; }
|
|
857
|
-
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(_context = ownKeys$f(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context2 = ownKeys$f(Object(t))).call(_context2, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
858
|
-
const DEFAULT_SHORT_LIVED_FLAGS = {};
|
|
859
|
-
const DEFAULT_LONG_LIVED_FLAGS = {};
|
|
860
|
-
_objectSpread$f(_objectSpread$f({}, DEFAULT_SHORT_LIVED_FLAGS), DEFAULT_LONG_LIVED_FLAGS);
|
|
861
|
-
|
|
862
945
|
function resourceTypeToFileName(resourceType, locale) {
|
|
863
946
|
var _context;
|
|
864
947
|
const date = new Date();
|
|
@@ -1448,13 +1531,14 @@ const useInitialValues = props => {
|
|
|
1448
1531
|
groups = updateFieldGroupsWithIsCheckedValue(groups, cachedSelectedGroups?.[props.resourceType] || {});
|
|
1449
1532
|
groups = updateFieldGroupsWithIsExpandedValue(groups, cachedExpandedGroups?.[props.resourceType] || {});
|
|
1450
1533
|
return {
|
|
1451
|
-
outputFormat: props.outputFormat,
|
|
1452
1534
|
fileName: `${resourceTypeToFileName(props.resourceType, userLocale)}`,
|
|
1453
1535
|
locales: [locale],
|
|
1454
1536
|
groups: updateFieldGroupWithAdditionalFieldExtensions(groups),
|
|
1455
1537
|
queryPredicate: '',
|
|
1456
|
-
// Preferences
|
|
1457
1538
|
fillRows: false,
|
|
1539
|
+
outputFormat: props.outputFormat,
|
|
1540
|
+
columnSeparator: DELIMITERS$1.COMMA,
|
|
1541
|
+
decimalSeparator: DELIMITERS$1.POINT,
|
|
1458
1542
|
importedCsvTemplateFile: null
|
|
1459
1543
|
};
|
|
1460
1544
|
}, [props.fieldGroups, props.resourceType, props.outputFormat, cachedSelectedGroups, cachedExpandedGroups, locale, userLocale]);
|
|
@@ -1530,13 +1614,18 @@ const useStartExportOperation = props => {
|
|
|
1530
1614
|
if (localeOption !== 'onlyLocalesFoundInCsvFile') {
|
|
1531
1615
|
locales = values.locales;
|
|
1532
1616
|
}
|
|
1617
|
+
const isCsv = values.outputFormat === 'csv';
|
|
1533
1618
|
const response = await createExportOperation({
|
|
1534
1619
|
projectKey,
|
|
1535
1620
|
resourceType: props.resourceType,
|
|
1536
1621
|
fileName: appendCsvOrJsonExtensionIfAbsent(values.fileName, values.outputFormat),
|
|
1537
1622
|
fileFormat: values.outputFormat,
|
|
1538
1623
|
locales,
|
|
1539
|
-
fillRows:
|
|
1624
|
+
fillRows: isCsv && values.fillRows,
|
|
1625
|
+
separator: isCsv ? {
|
|
1626
|
+
columns: values.columnSeparator,
|
|
1627
|
+
decimal: values.decimalSeparator
|
|
1628
|
+
} : undefined,
|
|
1540
1629
|
fields,
|
|
1541
1630
|
where,
|
|
1542
1631
|
filters
|
|
@@ -1770,25 +1859,78 @@ function _objectSpread$a(e) { for (var r = 1; r < arguments.length; r++) { var _
|
|
|
1770
1859
|
const ExportPreferenceSection = () => {
|
|
1771
1860
|
const _useExportResourcesMo = useExportResourcesModalContext(),
|
|
1772
1861
|
formik = _useExportResourcesMo.formik;
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1862
|
+
const columnSeparatorOptions = _mapInstanceProperty(COLUMN_DELIMITER_OPTIONS).call(COLUMN_DELIMITER_OPTIONS, option => _objectSpread$a(_objectSpread$a({}, option), {}, {
|
|
1863
|
+
label: jsx(FormattedMessage, _objectSpread$a({}, option.label))
|
|
1864
|
+
}));
|
|
1865
|
+
const decimalSeparatorOptions = _mapInstanceProperty(DECIMAL_DELIMITER_OPTIONS).call(DECIMAL_DELIMITER_OPTIONS, option => _objectSpread$a(_objectSpread$a({}, option), {}, {
|
|
1866
|
+
label: jsx(FormattedMessage, _objectSpread$a({}, option.label))
|
|
1867
|
+
}));
|
|
1868
|
+
return jsxs(Spacings.Stack, {
|
|
1869
|
+
scale: "m",
|
|
1870
|
+
children: [jsxs(Spacings.Stack, {
|
|
1871
|
+
scale: "s",
|
|
1872
|
+
children: [jsxs("div", {
|
|
1873
|
+
children: [jsx(Text.Body, {
|
|
1874
|
+
intlMessage: messages.separators
|
|
1875
|
+
}), jsx(Text.Caption, {
|
|
1876
|
+
intlMessage: messages.separatorsDescription
|
|
1877
|
+
})]
|
|
1878
|
+
}), jsxs(Spacings.Inline, {
|
|
1879
|
+
scale: "s",
|
|
1880
|
+
children: [jsxs(Spacings.Inline, {
|
|
1881
|
+
scale: "xs",
|
|
1882
|
+
alignItems: "center",
|
|
1883
|
+
children: [jsx(Text.Body, {
|
|
1884
|
+
intlMessage: messages.columns
|
|
1885
|
+
}), jsx(SelectInput, {
|
|
1886
|
+
horizontalConstraint: 4,
|
|
1887
|
+
isSearchable: false,
|
|
1888
|
+
options: columnSeparatorOptions,
|
|
1889
|
+
value: _valuesInstanceProperty(formik).columnSeparator,
|
|
1890
|
+
onChange: e => {
|
|
1891
|
+
formik.setFieldValue('columnSeparator', e.target.value);
|
|
1892
|
+
},
|
|
1893
|
+
menuPortalTarget: document.body,
|
|
1894
|
+
menuPortalZIndex: Z_INDEX_DROPDOWN
|
|
1895
|
+
})]
|
|
1896
|
+
}), jsxs(Spacings.Inline, {
|
|
1897
|
+
scale: "s",
|
|
1898
|
+
alignItems: "center",
|
|
1899
|
+
children: [jsx(Text.Body, {
|
|
1900
|
+
intlMessage: messages.decimal
|
|
1901
|
+
}), jsx(SelectInput, {
|
|
1902
|
+
isSearchable: false,
|
|
1903
|
+
options: decimalSeparatorOptions,
|
|
1904
|
+
value: _valuesInstanceProperty(formik).decimalSeparator,
|
|
1905
|
+
onChange: e => {
|
|
1906
|
+
formik.setFieldValue('decimalSeparator', e.target.value);
|
|
1907
|
+
},
|
|
1908
|
+
menuPortalTarget: document.body,
|
|
1909
|
+
horizontalConstraint: 4,
|
|
1910
|
+
menuPortalZIndex: Z_INDEX_DROPDOWN
|
|
1911
|
+
})]
|
|
1912
|
+
})]
|
|
1913
|
+
})]
|
|
1914
|
+
}), jsxs("div", {
|
|
1915
|
+
children: [jsx(CheckboxInput, {
|
|
1916
|
+
isChecked: _valuesInstanceProperty(formik).fillRows,
|
|
1917
|
+
onChange: e => {
|
|
1918
|
+
formik.setFieldValue('fillRows', e.target.checked);
|
|
1919
|
+
},
|
|
1920
|
+
children: jsx(FormattedMessage, _objectSpread$a({}, messages.fillRows))
|
|
1921
|
+
}), jsxs(Spacings.Inline, {
|
|
1922
|
+
scale: "xl",
|
|
1923
|
+
children: [jsx("div", {}), jsx(Text.Caption, {
|
|
1924
|
+
intlMessage: _objectSpread$a(_objectSpread$a({}, messages.moreInformation), {}, {
|
|
1925
|
+
values: {
|
|
1926
|
+
documentationLink: jsx(Link, {
|
|
1927
|
+
intlMessage: messages.documentation,
|
|
1928
|
+
isExternal: true,
|
|
1929
|
+
to: CSV_STRUCTURE_DOCUMENTATION_LINK
|
|
1930
|
+
}, "documentation-link")
|
|
1931
|
+
}
|
|
1932
|
+
})
|
|
1933
|
+
})]
|
|
1792
1934
|
})]
|
|
1793
1935
|
})]
|
|
1794
1936
|
});
|
|
@@ -1942,8 +2084,16 @@ const ExportFileSettingsStep = () => {
|
|
|
1942
2084
|
options: OUTPUT_FORMAT_OPTIONS,
|
|
1943
2085
|
menuPortalTarget: document.body,
|
|
1944
2086
|
menuPortalZIndex: Z_INDEX_DROPDOWN
|
|
1945
|
-
})
|
|
2087
|
+
})]
|
|
1946
2088
|
})
|
|
2089
|
+
}), shouldShowPreferences && jsxs(Fragment, {
|
|
2090
|
+
children: [jsx(Grid.Item, {
|
|
2091
|
+
children: jsx(Text.Body, {
|
|
2092
|
+
intlMessage: messages.csvSettings
|
|
2093
|
+
})
|
|
2094
|
+
}), jsx(Grid.Item, {
|
|
2095
|
+
children: jsx(ExportPreferenceSection, {})
|
|
2096
|
+
})]
|
|
1947
2097
|
})]
|
|
1948
2098
|
})
|
|
1949
2099
|
})
|
|
@@ -3167,11 +3317,11 @@ function getDefaultDropWrapperStyles(_dropAreaState) {
|
|
|
3167
3317
|
return /*#__PURE__*/css(process.env.NODE_ENV === "production" ? "" : ";label:getDefaultDropWrapperStyles;", process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImRyb3AtYXJlYS13cmFwcGVyLnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUF5QlkiLCJmaWxlIjoiZHJvcC1hcmVhLXdyYXBwZXIudHN4Iiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgdHlwZSBEcm9wem9uZVJvb3RQcm9wcyB9IGZyb20gJ3JlYWN0LWRyb3B6b25lJ1xuaW1wb3J0IHsgY3NzIH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnXG5pbXBvcnQgc3R5bGVkIGZyb20gJ0BlbW90aW9uL3N0eWxlZCdcbmltcG9ydCB7IHN0eWxlcyB9IGZyb20gJy4vc3R5bGVzJ1xuaW1wb3J0IHsgdHlwZSBEcm9wQXJlYVN0YXRlIH0gZnJvbSAnLi4vLi4vLi4vQHR5cGVzJ1xuXG5pbnRlcmZhY2UgRHJvcFdyYXBwZXJQcm9wcyBleHRlbmRzIERyb3B6b25lUm9vdFByb3BzIHtcbiAgZHJvcEFyZWFTdGF0ZTogRHJvcEFyZWFTdGF0ZVxufVxuZXhwb3J0IGNvbnN0IERyb3BXcmFwcGVyID0gc3R5bGVkLmRpdjxEcm9wV3JhcHBlclByb3BzPmBcbiAgJHtzdHlsZXMuYmFzZX1cbiAgJHsocHJvcHMpID0+IHtcbiAgICBpZiAocHJvcHMuZHJvcEFyZWFTdGF0ZSA9PT0gJ2RlZmF1bHQnKSB7XG4gICAgICByZXR1cm4gc3R5bGVzLnJlYWR5Rm9yRHJvcFxuICAgIH1cbiAgICBpZiAocHJvcHMuZHJvcEFyZWFTdGF0ZSA9PT0gJ2FjdGl2ZS1kcmFnJykge1xuICAgICAgcmV0dXJuIHN0eWxlcy5hY3RpdmVEcmFnXG4gICAgfVxuICAgIGlmIChwcm9wcy5kcm9wQXJlYVN0YXRlID09PSAnZmlsZS1kcm9wcGVkJykge1xuICAgICAgcmV0dXJuIHN0eWxlcy5maWxlRHJvcHBlZFxuICAgIH1cbiAgICByZXR1cm4gZ2V0RGVmYXVsdERyb3BXcmFwcGVyU3R5bGVzKHByb3BzLmRyb3BBcmVhU3RhdGUpXG4gIH19XG5gXG5mdW5jdGlvbiBnZXREZWZhdWx0RHJvcFdyYXBwZXJTdHlsZXMoX2Ryb3BBcmVhU3RhdGU6IG5ldmVyKSB7XG4gIHJldHVybiBjc3NgYFxufVxuIl19 */");
|
|
3168
3318
|
}
|
|
3169
3319
|
|
|
3170
|
-
var ActiveDragDropArea = /*#__PURE__*/lazy(() => import('./active-drag-drop-area-
|
|
3320
|
+
var ActiveDragDropArea = /*#__PURE__*/lazy(() => import('./active-drag-drop-area-fb905a01.esm.js' /* webpackChunkName: "active-drag-drop-area" */));
|
|
3171
3321
|
|
|
3172
|
-
var EnabledDropArea = /*#__PURE__*/lazy(() => import('./enabled-drop-area-
|
|
3322
|
+
var EnabledDropArea = /*#__PURE__*/lazy(() => import('./enabled-drop-area-5d5a61c8.esm.js' /* webpackChunkName: "enabled-drop-area" */));
|
|
3173
3323
|
|
|
3174
|
-
var FileDropped = /*#__PURE__*/lazy(() => import('./file-dropped-area-
|
|
3324
|
+
var FileDropped = /*#__PURE__*/lazy(() => import('./file-dropped-area-aad1bd09.esm.js' /* webpackChunkName: "filed-dropped-area" */));
|
|
3175
3325
|
|
|
3176
3326
|
function getDropArea(_ref) {
|
|
3177
3327
|
let dropAreaState = _ref.dropAreaState,
|
|
@@ -3252,17 +3402,17 @@ const getChunkImport = locale => {
|
|
|
3252
3402
|
const intlLocale = mapLocaleToIntlLocale(locale);
|
|
3253
3403
|
switch (intlLocale) {
|
|
3254
3404
|
case 'de':
|
|
3255
|
-
return import(/* webpackChunkName: "export-resources-modal-i18n-de" */'./de-
|
|
3405
|
+
return import(/* webpackChunkName: "export-resources-modal-i18n-de" */'./de-324f2829.esm.js');
|
|
3256
3406
|
case 'es':
|
|
3257
|
-
return import(/* webpackChunkName: "export-resources-modal-i18n-es" */'./es-
|
|
3407
|
+
return import(/* webpackChunkName: "export-resources-modal-i18n-es" */'./es-735dbaf2.esm.js');
|
|
3258
3408
|
case 'fr-FR':
|
|
3259
|
-
return import(/* webpackChunkName: "export-resources-modal-i18n-fr-FR" */'./fr-FR-
|
|
3409
|
+
return import(/* webpackChunkName: "export-resources-modal-i18n-fr-FR" */'./fr-FR-96dce16c.esm.js');
|
|
3260
3410
|
case 'ja':
|
|
3261
3411
|
return import(/* webpackChunkName: "export-resources-modal-i18n-ja" */'./ja-73c088a7.esm.js');
|
|
3262
3412
|
case 'pt-BR':
|
|
3263
|
-
return import(/* webpackChunkName: "change-history-i18n-pt-BR" */'./pt-BR-
|
|
3413
|
+
return import(/* webpackChunkName: "change-history-i18n-pt-BR" */'./pt-BR-7fd72f5d.esm.js');
|
|
3264
3414
|
default:
|
|
3265
|
-
return import(/* webpackChunkName: "export-resources-modal-i18n-en" */'./en-
|
|
3415
|
+
return import(/* webpackChunkName: "export-resources-modal-i18n-en" */'./en-015fa203.esm.js');
|
|
3266
3416
|
}
|
|
3267
3417
|
};
|
|
3268
3418
|
const loadMessages = async locale => {
|