@commercetools-frontend-extensions/export-resources-modal 5.15.1 → 5.16.0
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/commercetools-frontend-extensions-export-resources-modal.cjs.dev.js +278 -192
- package/dist/commercetools-frontend-extensions-export-resources-modal.cjs.prod.js +278 -192
- package/dist/commercetools-frontend-extensions-export-resources-modal.esm.js +277 -190
- package/dist/{de-878f4246.cjs.prod.js → de-11249ba5.cjs.prod.js} +16 -0
- package/dist/{de-ecf9ace2.cjs.dev.js → de-448f5798.cjs.dev.js} +16 -0
- package/dist/{de-887390c8.esm.js → de-6ca92bf0.esm.js} +16 -0
- package/dist/declarations/src/@constants/exportable-resources.d.ts +1 -0
- package/dist/declarations/src/@hooks/use-storage.d.ts +1 -5
- package/dist/declarations/src/@types/export-resources-modal-context.d.ts +0 -1
- package/dist/{en-02b20e80.esm.js → en-7eac8362.esm.js} +16 -0
- package/dist/{en-b0f71eaf.cjs.prod.js → en-b1e57064.cjs.prod.js} +16 -0
- package/dist/{en-3a95336a.cjs.dev.js → en-f39a23e6.cjs.dev.js} +16 -0
- package/dist/{es-374aed1b.cjs.prod.js → es-566ec5e7.cjs.prod.js} +16 -0
- package/dist/{es-a1b34b9f.cjs.dev.js → es-b4ee13a8.cjs.dev.js} +16 -0
- package/dist/{es-d39432b2.esm.js → es-cf5018bb.esm.js} +16 -0
- package/dist/{fr-FR-c903e733.cjs.dev.js → fr-FR-00860e60.cjs.dev.js} +16 -0
- package/dist/{fr-FR-4bdab72f.cjs.prod.js → fr-FR-23df0502.cjs.prod.js} +16 -0
- package/dist/{fr-FR-136fb625.esm.js → fr-FR-79f77e0a.esm.js} +16 -0
- package/dist/{pt-BR-b19cfc58.esm.js → pt-BR-0ce14c46.esm.js} +16 -0
- package/dist/{pt-BR-3ff0daf8.cjs.prod.js → pt-BR-14554160.cjs.prod.js} +16 -0
- package/dist/{pt-BR-0b67e9af.cjs.dev.js → pt-BR-63769e73.cjs.dev.js} +16 -0
- package/package.json +23 -23
|
@@ -22,6 +22,7 @@ var applicationShellConnectors = require('@commercetools-frontend/application-sh
|
|
|
22
22
|
var uiKit = require('@commercetools-frontend/ui-kit');
|
|
23
23
|
var jsxRuntime = require('@emotion/react/jsx-runtime');
|
|
24
24
|
var _valuesInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/values');
|
|
25
|
+
var _concatInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/concat');
|
|
25
26
|
var applicationComponents = require('@commercetools-frontend/application-components');
|
|
26
27
|
var fullstory = require('@commercetools-frontend/fullstory');
|
|
27
28
|
var operations = require('@commercetools-frontend-extensions/operations');
|
|
@@ -38,7 +39,6 @@ var _reduceInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/ins
|
|
|
38
39
|
var _someInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/some');
|
|
39
40
|
var _includesInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/includes');
|
|
40
41
|
var sentry = require('@commercetools-frontend/sentry');
|
|
41
|
-
var _concatInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/concat');
|
|
42
42
|
var omitEmpty = require('omit-empty-es');
|
|
43
43
|
var _findInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/find');
|
|
44
44
|
var _everyInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/every');
|
|
@@ -47,7 +47,6 @@ var _Set = require('@babel/runtime-corejs3/core-js-stable/set');
|
|
|
47
47
|
var _sortInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/sort');
|
|
48
48
|
var _indexOfInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/index-of');
|
|
49
49
|
var _trimInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/trim');
|
|
50
|
-
var _bindInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/bind');
|
|
51
50
|
var _Promise = require('@babel/runtime-corejs3/core-js-stable/promise');
|
|
52
51
|
var _sliceInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/slice');
|
|
53
52
|
var _Object$values = require('@babel/runtime-corejs3/core-js-stable/object/values');
|
|
@@ -79,13 +78,13 @@ var _Object$getOwnPropertyDescriptors__default = /*#__PURE__*/_interopDefault(_O
|
|
|
79
78
|
var _Object$defineProperties__default = /*#__PURE__*/_interopDefault(_Object$defineProperties);
|
|
80
79
|
var _Object$defineProperty__default = /*#__PURE__*/_interopDefault(_Object$defineProperty);
|
|
81
80
|
var _valuesInstanceProperty__default = /*#__PURE__*/_interopDefault(_valuesInstanceProperty);
|
|
81
|
+
var _concatInstanceProperty__default = /*#__PURE__*/_interopDefault(_concatInstanceProperty);
|
|
82
82
|
var _mapInstanceProperty__default = /*#__PURE__*/_interopDefault(_mapInstanceProperty);
|
|
83
83
|
var React__default = /*#__PURE__*/_interopDefault(React);
|
|
84
84
|
var _Reflect$construct__default = /*#__PURE__*/_interopDefault(_Reflect$construct);
|
|
85
85
|
var _reduceInstanceProperty__default = /*#__PURE__*/_interopDefault(_reduceInstanceProperty);
|
|
86
86
|
var _someInstanceProperty__default = /*#__PURE__*/_interopDefault(_someInstanceProperty);
|
|
87
87
|
var _includesInstanceProperty__default = /*#__PURE__*/_interopDefault(_includesInstanceProperty);
|
|
88
|
-
var _concatInstanceProperty__default = /*#__PURE__*/_interopDefault(_concatInstanceProperty);
|
|
89
88
|
var omitEmpty__default = /*#__PURE__*/_interopDefault(omitEmpty);
|
|
90
89
|
var _findInstanceProperty__default = /*#__PURE__*/_interopDefault(_findInstanceProperty);
|
|
91
90
|
var _everyInstanceProperty__default = /*#__PURE__*/_interopDefault(_everyInstanceProperty);
|
|
@@ -94,7 +93,6 @@ var _Set__default = /*#__PURE__*/_interopDefault(_Set);
|
|
|
94
93
|
var _sortInstanceProperty__default = /*#__PURE__*/_interopDefault(_sortInstanceProperty);
|
|
95
94
|
var _indexOfInstanceProperty__default = /*#__PURE__*/_interopDefault(_indexOfInstanceProperty);
|
|
96
95
|
var _trimInstanceProperty__default = /*#__PURE__*/_interopDefault(_trimInstanceProperty);
|
|
97
|
-
var _bindInstanceProperty__default = /*#__PURE__*/_interopDefault(_bindInstanceProperty);
|
|
98
96
|
var _Promise__default = /*#__PURE__*/_interopDefault(_Promise);
|
|
99
97
|
var _sliceInstanceProperty__default = /*#__PURE__*/_interopDefault(_sliceInstanceProperty);
|
|
100
98
|
var _Object$values__default = /*#__PURE__*/_interopDefault(_Object$values);
|
|
@@ -173,6 +171,11 @@ var messages = reactIntl.defineMessages({
|
|
|
173
171
|
description: 'Label for the standalone prices modal title',
|
|
174
172
|
defaultMessage: 'Export standalone prices'
|
|
175
173
|
},
|
|
174
|
+
'modalTitle.product-selection': {
|
|
175
|
+
id: 'ExportResourcesModal.modalTitle.productSelection',
|
|
176
|
+
description: 'Label for the product selections modal title',
|
|
177
|
+
defaultMessage: 'Export product selections'
|
|
178
|
+
},
|
|
176
179
|
outputFormat: {
|
|
177
180
|
id: 'ExportResourcesModal.outputFormat',
|
|
178
181
|
description: 'File format like (csv, xls, ...etc)',
|
|
@@ -462,6 +465,21 @@ var messages = reactIntl.defineMessages({
|
|
|
462
465
|
description: 'Label for Export Filtered customers',
|
|
463
466
|
defaultMessage: 'Export filtered: {total, plural, one {# customer} other {# customers}}'
|
|
464
467
|
},
|
|
468
|
+
exportScopeAllProductSelections: {
|
|
469
|
+
id: 'ExportResourcesModal.exportScopeAllProductSelections',
|
|
470
|
+
description: 'Label for Export All product selections',
|
|
471
|
+
defaultMessage: 'Export all: {total, plural, one {# product selection} other {# product selections}}'
|
|
472
|
+
},
|
|
473
|
+
exportScopeSelectedProductSelections: {
|
|
474
|
+
id: 'ExportResourcesModal.exportScopeSelectedProductSelections',
|
|
475
|
+
description: 'Label for Export Selected product selections',
|
|
476
|
+
defaultMessage: 'Export selected: {total, plural, one {# product selection} other {# product selections}}'
|
|
477
|
+
},
|
|
478
|
+
exportScopeFilteredProductSelections: {
|
|
479
|
+
id: 'ExportResourcesModal.exportScopeFilteredProductSelections',
|
|
480
|
+
description: 'Label for Export Filtered product selections',
|
|
481
|
+
defaultMessage: 'Export filtered: {total, plural, one {# product selection} other {# product selections}}'
|
|
482
|
+
},
|
|
465
483
|
exportScopeSelectedWithoutCount: {
|
|
466
484
|
id: 'ExportResourcesModal.exportScopeSelectedWithoutCount',
|
|
467
485
|
description: 'Label for Export Selected without count',
|
|
@@ -903,7 +921,8 @@ const EXPORTABLE_RESOURCES = {
|
|
|
903
921
|
CUSTOMER: 'customer',
|
|
904
922
|
BUSINESS_UNIT: 'business-unit',
|
|
905
923
|
PRODUCT_TAILORING: 'product-tailoring',
|
|
906
|
-
STANDALONE_PRICE: 'standalone-price'
|
|
924
|
+
STANDALONE_PRICE: 'standalone-price',
|
|
925
|
+
PRODUCT_SELECTION: 'product-selection'
|
|
907
926
|
};
|
|
908
927
|
|
|
909
928
|
const OUTPUT_FORMATS = {
|
|
@@ -974,6 +993,11 @@ const resourceTypeMessages = {
|
|
|
974
993
|
exportScopeAll: messages.exportScopeAllStandalonePrices,
|
|
975
994
|
exportScopeSelected: messages.exportScopeSelectedStandalonePrices,
|
|
976
995
|
exportScopeFiltered: messages.exportScopeFilteredStandalonePrices
|
|
996
|
+
},
|
|
997
|
+
[EXPORTABLE_RESOURCES.PRODUCT_SELECTION]: {
|
|
998
|
+
exportScopeAll: messages.exportScopeAllProductSelections,
|
|
999
|
+
exportScopeSelected: messages.exportScopeSelectedProductSelections,
|
|
1000
|
+
exportScopeFiltered: messages.exportScopeFilteredProductSelections
|
|
977
1001
|
}
|
|
978
1002
|
};
|
|
979
1003
|
|
|
@@ -1002,7 +1026,7 @@ let UnexpectedExportOperationStateError = /*#__PURE__*/function (_Error) {
|
|
|
1002
1026
|
function UnexpectedExportOperationStateError(state) {
|
|
1003
1027
|
var _this;
|
|
1004
1028
|
_classCallCheck(this, UnexpectedExportOperationStateError);
|
|
1005
|
-
_this = _callSuper$3(this, UnexpectedExportOperationStateError, [
|
|
1029
|
+
_this = _callSuper$3(this, UnexpectedExportOperationStateError, ["Unexpected export operation state \"".concat(state, "\"")]);
|
|
1006
1030
|
_this.name = 'UnexpectedExportOperationStateError';
|
|
1007
1031
|
return _this;
|
|
1008
1032
|
}
|
|
@@ -1016,7 +1040,7 @@ let UnexpectedResourceTypeError = /*#__PURE__*/function (_Error) {
|
|
|
1016
1040
|
function UnexpectedResourceTypeError(resourceType) {
|
|
1017
1041
|
var _this;
|
|
1018
1042
|
_classCallCheck(this, UnexpectedResourceTypeError);
|
|
1019
|
-
_this = _callSuper$2(this, UnexpectedResourceTypeError, [
|
|
1043
|
+
_this = _callSuper$2(this, UnexpectedResourceTypeError, ["Unexpected resource type \"".concat(resourceType, "\"")]);
|
|
1020
1044
|
_this.name = 'UnexpectedResourceTypeError';
|
|
1021
1045
|
return _this;
|
|
1022
1046
|
}
|
|
@@ -1063,7 +1087,7 @@ function useExportResourcesModalContext() {
|
|
|
1063
1087
|
}
|
|
1064
1088
|
|
|
1065
1089
|
function ownKeys$e(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; }
|
|
1066
|
-
function _objectSpread$e(e) { for (var r = 1; r < arguments.length; r++) { var
|
|
1090
|
+
function _objectSpread$e(e) { for (var r = 1; r < arguments.length; r++) { var _context4, _context5; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context4 = ownKeys$e(Object(t), !0)).call(_context4, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context5 = ownKeys$e(Object(t))).call(_context5, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
1067
1091
|
const defaultOptions = {
|
|
1068
1092
|
storageType: 'local',
|
|
1069
1093
|
segregateByUser: true
|
|
@@ -1073,7 +1097,7 @@ const safeParse = value => {
|
|
|
1073
1097
|
if (value === null) return value;
|
|
1074
1098
|
try {
|
|
1075
1099
|
return JSON.parse(value);
|
|
1076
|
-
} catch {
|
|
1100
|
+
} catch (_unused) {
|
|
1077
1101
|
return value;
|
|
1078
1102
|
}
|
|
1079
1103
|
};
|
|
@@ -1097,7 +1121,10 @@ const clearStaleExportModalEntries = (storage, currentKey) => {
|
|
|
1097
1121
|
const useStorage = (storageKey, initialStorageValue, options) => {
|
|
1098
1122
|
var _context;
|
|
1099
1123
|
const mergedOptions = _objectSpread$e(_objectSpread$e({}, defaultOptions), options);
|
|
1100
|
-
const userId = applicationShellConnectors.useApplicationContext(context =>
|
|
1124
|
+
const userId = applicationShellConnectors.useApplicationContext(context => {
|
|
1125
|
+
var _context$user;
|
|
1126
|
+
return (_context$user = context.user) === null || _context$user === void 0 ? void 0 : _context$user.id;
|
|
1127
|
+
});
|
|
1101
1128
|
const scopedStorageKey = _filterInstanceProperty__default["default"](_context = [mergedOptions.segregateByUser && userId, storageKey]).call(_context, Boolean).join('/');
|
|
1102
1129
|
const readFromStorage = React.useCallback(() => {
|
|
1103
1130
|
const rawStorageValue = getStorage(mergedOptions.storageType).getItem(scopedStorageKey);
|
|
@@ -1116,8 +1143,9 @@ const useStorage = (storageKey, initialStorageValue, options) => {
|
|
|
1116
1143
|
return parsedStorageValue;
|
|
1117
1144
|
}, [mergedOptions.storageType, scopedStorageKey]);
|
|
1118
1145
|
const initializeStorageValue = () => {
|
|
1146
|
+
var _ref, _readFromStorage;
|
|
1119
1147
|
// default the storage value to the initial provided value when provided
|
|
1120
|
-
return readFromStorage()
|
|
1148
|
+
return (_ref = (_readFromStorage = readFromStorage()) !== null && _readFromStorage !== void 0 ? _readFromStorage : initialStorageValue) !== null && _ref !== void 0 ? _ref : null;
|
|
1121
1149
|
};
|
|
1122
1150
|
const _useState = React.useState(initializeStorageValue),
|
|
1123
1151
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -1137,14 +1165,16 @@ const useStorage = (storageKey, initialStorageValue, options) => {
|
|
|
1137
1165
|
storage.setItem(scopedStorageKey, serializedValue);
|
|
1138
1166
|
writeSucceeded = true;
|
|
1139
1167
|
} catch (retryError) {
|
|
1140
|
-
|
|
1168
|
+
var _context2;
|
|
1169
|
+
sentry.reportErrorToSentry(new Error(_concatInstanceProperty__default["default"](_context2 = "Failed to persist \"".concat(scopedStorageKey, "\" to ")).call(_context2, mergedOptions.storageType, "Storage after cleanup. The selection will not be remembered for future sessions.")), {
|
|
1141
1170
|
extra: {
|
|
1142
1171
|
error: retryError
|
|
1143
1172
|
}
|
|
1144
1173
|
});
|
|
1145
1174
|
}
|
|
1146
1175
|
} else {
|
|
1147
|
-
|
|
1176
|
+
var _context3;
|
|
1177
|
+
sentry.reportErrorToSentry(new Error(_concatInstanceProperty__default["default"](_context3 = "Failed to persist \"".concat(scopedStorageKey, "\" to ")).call(_context3, mergedOptions.storageType, "Storage. The selection will not be remembered for future sessions.")), {
|
|
1148
1178
|
extra: {
|
|
1149
1179
|
error
|
|
1150
1180
|
}
|
|
@@ -1169,7 +1199,7 @@ const useStorage = (storageKey, initialStorageValue, options) => {
|
|
|
1169
1199
|
};
|
|
1170
1200
|
|
|
1171
1201
|
function resourceTypeToFileName(resourceType, locale) {
|
|
1172
|
-
var _context;
|
|
1202
|
+
var _context, _context2, _context3, _context4;
|
|
1173
1203
|
const date = new Date();
|
|
1174
1204
|
const dateFormatter = new Intl.DateTimeFormat(locale, {
|
|
1175
1205
|
year: '2-digit',
|
|
@@ -1187,7 +1217,7 @@ function resourceTypeToFileName(resourceType, locale) {
|
|
|
1187
1217
|
return acc;
|
|
1188
1218
|
}, {});
|
|
1189
1219
|
const orderedDateParts = _mapInstanceProperty__default["default"](_context = _filterInstanceProperty__default["default"](parts).call(parts, part => part.type === 'day' || part.type === 'month' || part.type === 'year')).call(_context, part => dateParts[part.type]).join('-');
|
|
1190
|
-
const formattedDate =
|
|
1220
|
+
const formattedDate = _concatInstanceProperty__default["default"](_context2 = _concatInstanceProperty__default["default"](_context3 = "".concat(orderedDateParts, "_")).call(_context3, dateParts.hour, "-")).call(_context2, dateParts.minute);
|
|
1191
1221
|
const resourceTypeMap = {
|
|
1192
1222
|
[EXPORTABLE_RESOURCES.CATEGORY]: 'Categories',
|
|
1193
1223
|
[EXPORTABLE_RESOURCES.PRODUCT]: 'Products',
|
|
@@ -1198,13 +1228,14 @@ function resourceTypeToFileName(resourceType, locale) {
|
|
|
1198
1228
|
[EXPORTABLE_RESOURCES.ORDER]: 'Orders',
|
|
1199
1229
|
[EXPORTABLE_RESOURCES.BUSINESS_UNIT]: 'Business_Units',
|
|
1200
1230
|
[EXPORTABLE_RESOURCES.PRODUCT_TAILORING]: 'Product_Tailorings',
|
|
1201
|
-
[EXPORTABLE_RESOURCES.STANDALONE_PRICE]: 'Standalone_Prices'
|
|
1231
|
+
[EXPORTABLE_RESOURCES.STANDALONE_PRICE]: 'Standalone_Prices',
|
|
1232
|
+
[EXPORTABLE_RESOURCES.PRODUCT_SELECTION]: 'Product_Selections'
|
|
1202
1233
|
};
|
|
1203
1234
|
const displayName = resourceTypeMap[resourceType];
|
|
1204
1235
|
if (!displayName) {
|
|
1205
1236
|
throw new UnexpectedResourceTypeError(resourceType);
|
|
1206
1237
|
}
|
|
1207
|
-
return
|
|
1238
|
+
return _concatInstanceProperty__default["default"](_context4 = "".concat(displayName, "_Export_")).call(_context4, formattedDate);
|
|
1208
1239
|
}
|
|
1209
1240
|
function mapLocalesToOptions(locales) {
|
|
1210
1241
|
return _mapInstanceProperty__default["default"](locales).call(locales, locale => ({
|
|
@@ -1241,9 +1272,9 @@ function sortFieldsByFieldOrder(_ref) {
|
|
|
1241
1272
|
return fieldNames;
|
|
1242
1273
|
}
|
|
1243
1274
|
function buildSelectedExportFilters(selectedResourceIds) {
|
|
1244
|
-
if (!selectedResourceIds || selectedResourceIds
|
|
1245
|
-
const formattedIds = _mapInstanceProperty__default["default"](selectedResourceIds).call(selectedResourceIds, id =>
|
|
1246
|
-
return
|
|
1275
|
+
if (!selectedResourceIds || (selectedResourceIds === null || selectedResourceIds === void 0 ? void 0 : selectedResourceIds.length) === 0) return undefined;
|
|
1276
|
+
const formattedIds = _mapInstanceProperty__default["default"](selectedResourceIds).call(selectedResourceIds, id => "\"".concat(id, "\"")).join(', ');
|
|
1277
|
+
return "id in (".concat(formattedIds, ")");
|
|
1247
1278
|
}
|
|
1248
1279
|
function isQueryFilter(filters) {
|
|
1249
1280
|
if (!filters) return false;
|
|
@@ -1264,28 +1295,29 @@ function validateFilters(filtersObject) {
|
|
|
1264
1295
|
return Boolean(isQueryFilter(filtersObject.filters) || isSearchFilter(filtersObject.filters) || isPredicateFilter(filtersObject));
|
|
1265
1296
|
}
|
|
1266
1297
|
function areFiltersApplied(filtersObject) {
|
|
1267
|
-
var
|
|
1298
|
+
var _context5;
|
|
1268
1299
|
if (!filtersObject) {
|
|
1269
1300
|
return false;
|
|
1270
1301
|
}
|
|
1271
|
-
if (filtersObject.where && _trimInstanceProperty__default["default"](
|
|
1302
|
+
if (filtersObject.where && _trimInstanceProperty__default["default"](_context5 = filtersObject.where).call(_context5) !== '') {
|
|
1272
1303
|
return true;
|
|
1273
1304
|
}
|
|
1274
1305
|
if (isQueryFilter(filtersObject.filters)) {
|
|
1275
1306
|
return Boolean(filtersObject.filters.query);
|
|
1276
1307
|
}
|
|
1277
1308
|
if (isSearchFilter(filtersObject.filters)) {
|
|
1278
|
-
var
|
|
1309
|
+
var _filters$filters, _filters$fullText;
|
|
1279
1310
|
const _filters = filtersObject.filters;
|
|
1280
|
-
return Boolean(_filters.filters
|
|
1311
|
+
return Boolean(((_filters$filters = _filters.filters) === null || _filters$filters === void 0 ? void 0 : _filters$filters.length) || ((_filters$fullText = _filters.fullText) === null || _filters$fullText === void 0 || (_filters$fullText = _filters$fullText.text) === null || _filters$fullText === void 0 ? void 0 : _trimInstanceProperty__default["default"](_filters$fullText).call(_filters$fullText)));
|
|
1281
1312
|
}
|
|
1282
1313
|
return false;
|
|
1283
1314
|
}
|
|
1284
1315
|
function getInitialExportType(args) {
|
|
1285
|
-
|
|
1316
|
+
var _args$selectedResourc, _args$filters;
|
|
1317
|
+
if ((_args$selectedResourc = args.selectedResourceIds) !== null && _args$selectedResourc !== void 0 && _args$selectedResourc.length) {
|
|
1286
1318
|
return EXPORT_TYPES.SELECTED;
|
|
1287
1319
|
}
|
|
1288
|
-
if (args.filters
|
|
1320
|
+
if ((_args$filters = args.filters) !== null && _args$filters !== void 0 && _args$filters.total && areFiltersApplied(args.filters)) {
|
|
1289
1321
|
return EXPORT_TYPES.FILTERED;
|
|
1290
1322
|
}
|
|
1291
1323
|
return EXPORT_TYPES.ALL;
|
|
@@ -1299,7 +1331,7 @@ const isAnyFieldChecked = fields => {
|
|
|
1299
1331
|
};
|
|
1300
1332
|
const hasDependentFields = field => {
|
|
1301
1333
|
var _context;
|
|
1302
|
-
return Boolean(field
|
|
1334
|
+
return Boolean((field === null || field === void 0 ? void 0 : field.dependentGroupNames) && field.dependentGroupNames.length > 0 || (field === null || field === void 0 ? void 0 : field.dependentFieldNames) && field.dependentFieldNames.length > 0 || (field === null || field === void 0 ? void 0 : field.fields) && _someInstanceProperty__default["default"](_context = field.fields).call(_context, nestedField => hasDependentFields(nestedField)));
|
|
1303
1335
|
};
|
|
1304
1336
|
const isFieldOrNestedFieldChecked = (field, fieldName) => {
|
|
1305
1337
|
if (field.name === fieldName && field.isChecked) {
|
|
@@ -1317,7 +1349,8 @@ const getIndependentFields = group => {
|
|
|
1317
1349
|
const independentFields = [];
|
|
1318
1350
|
const findIndependentFields = fields => {
|
|
1319
1351
|
_forEachInstanceProperty__default["default"](fields).call(fields, field => {
|
|
1320
|
-
|
|
1352
|
+
var _field$dependentGroup, _field$dependentField;
|
|
1353
|
+
if (!((_field$dependentGroup = field.dependentGroupNames) !== null && _field$dependentGroup !== void 0 && _field$dependentGroup.length) && !((_field$dependentField = field.dependentFieldNames) !== null && _field$dependentField !== void 0 && _field$dependentField.length)) {
|
|
1321
1354
|
independentFields.push(field);
|
|
1322
1355
|
}
|
|
1323
1356
|
if (field.fields) {
|
|
@@ -1411,11 +1444,12 @@ const extractFieldNamesFromGroups = (groups, fieldOrder) => {
|
|
|
1411
1444
|
let checkedFields = [];
|
|
1412
1445
|
const getCheckedFields = fields => {
|
|
1413
1446
|
return _filterInstanceProperty__default["default"](fields).call(fields, field => {
|
|
1447
|
+
var _field$isChecked;
|
|
1414
1448
|
if (field.fields) {
|
|
1415
1449
|
return getCheckedFields(field.fields);
|
|
1416
1450
|
}
|
|
1417
1451
|
if (field.isChecked) checkedFields.push(field);
|
|
1418
|
-
return field.isChecked
|
|
1452
|
+
return (_field$isChecked = field.isChecked) !== null && _field$isChecked !== void 0 ? _field$isChecked : false;
|
|
1419
1453
|
});
|
|
1420
1454
|
};
|
|
1421
1455
|
_forEachInstanceProperty__default["default"](groups).call(groups, group => {
|
|
@@ -1497,7 +1531,7 @@ function isFieldNameValid(header) {
|
|
|
1497
1531
|
}
|
|
1498
1532
|
|
|
1499
1533
|
function ownKeys$d(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; }
|
|
1500
|
-
function _objectSpread$d(e) { for (var r = 1; r < arguments.length; r++) { var
|
|
1534
|
+
function _objectSpread$d(e) { for (var r = 1; r < arguments.length; r++) { var _context7, _context8; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context7 = ownKeys$d(Object(t), !0)).call(_context7, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context8 = ownKeys$d(Object(t))).call(_context8, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
1501
1535
|
const updateFieldGroupsWithIsCheckedValue = (groups, cachedSelectedGroups) => {
|
|
1502
1536
|
const updateFields = (fields, isParentChecked, parentFieldPath) => {
|
|
1503
1537
|
return _mapInstanceProperty__default["default"](fields).call(fields, field => {
|
|
@@ -1505,8 +1539,10 @@ const updateFieldGroupsWithIsCheckedValue = (groups, cachedSelectedGroups) => {
|
|
|
1505
1539
|
if (field.isRequired) {
|
|
1506
1540
|
isChecked = true;
|
|
1507
1541
|
} else {
|
|
1508
|
-
|
|
1509
|
-
|
|
1542
|
+
var _context;
|
|
1543
|
+
if (cachedSelectedGroups[_concatInstanceProperty__default["default"](_context = "".concat(parentFieldPath, ".")).call(_context, field.name)] !== undefined) {
|
|
1544
|
+
var _context2;
|
|
1545
|
+
isChecked = cachedSelectedGroups[_concatInstanceProperty__default["default"](_context2 = "".concat(parentFieldPath, ".")).call(_context2, field.name)];
|
|
1510
1546
|
} else if (!hasDependentFields(field) && field.isSelectedByDefault) {
|
|
1511
1547
|
isChecked = true;
|
|
1512
1548
|
} else if (isParentChecked) {
|
|
@@ -1515,7 +1551,8 @@ const updateFieldGroupsWithIsCheckedValue = (groups, cachedSelectedGroups) => {
|
|
|
1515
1551
|
}
|
|
1516
1552
|
let updatedFields = field.fields;
|
|
1517
1553
|
if (field.fields) {
|
|
1518
|
-
|
|
1554
|
+
var _context3;
|
|
1555
|
+
updatedFields = updateFields(field.fields, isChecked, _concatInstanceProperty__default["default"](_context3 = "".concat(parentFieldPath, ".")).call(_context3, field.name));
|
|
1519
1556
|
isChecked = false;
|
|
1520
1557
|
}
|
|
1521
1558
|
return _objectSpread$d(_objectSpread$d({}, field), {}, {
|
|
@@ -1562,14 +1599,15 @@ const updateFieldGroupWithAdditionalFieldExtensions = groups => {
|
|
|
1562
1599
|
});
|
|
1563
1600
|
};
|
|
1564
1601
|
const getIsExpanded = (field, groupName, cachedExpandedGroups) => {
|
|
1602
|
+
var _context4, _ref, _cachedExpandedGroups;
|
|
1565
1603
|
if (!field.isExpandable) {
|
|
1566
1604
|
return false;
|
|
1567
1605
|
}
|
|
1568
1606
|
if (field.fields && field.maxVisibleChildren && field.fields.length > field.maxVisibleChildren) {
|
|
1569
1607
|
return false;
|
|
1570
1608
|
}
|
|
1571
|
-
const cacheKey =
|
|
1572
|
-
return cachedExpandedGroups[cacheKey]
|
|
1609
|
+
const cacheKey = _concatInstanceProperty__default["default"](_context4 = "".concat(groupName, ".")).call(_context4, field.name);
|
|
1610
|
+
return (_ref = (_cachedExpandedGroups = cachedExpandedGroups[cacheKey]) !== null && _cachedExpandedGroups !== void 0 ? _cachedExpandedGroups : field.isExpanded) !== null && _ref !== void 0 ? _ref : false;
|
|
1573
1611
|
};
|
|
1574
1612
|
const updateFieldGroupsWithIsExpandedValue = (groups, cachedExpandedGroups) => {
|
|
1575
1613
|
function updateFields(fields, groupName) {
|
|
@@ -1590,22 +1628,24 @@ const updateFieldGroupsWithIsExpandedValue = (groups, cachedExpandedGroups) => {
|
|
|
1590
1628
|
});
|
|
1591
1629
|
}
|
|
1592
1630
|
return _mapInstanceProperty__default["default"](groups).call(groups, group => {
|
|
1631
|
+
var _ref2, _cachedExpandedGroups2;
|
|
1593
1632
|
const updatedFields = updateFields(group.fields, group.groupName);
|
|
1594
1633
|
return _objectSpread$d(_objectSpread$d({}, group), {}, {
|
|
1595
|
-
isExpanded: cachedExpandedGroups[group.groupName]
|
|
1634
|
+
isExpanded: (_ref2 = (_cachedExpandedGroups2 = cachedExpandedGroups[group.groupName]) !== null && _cachedExpandedGroups2 !== void 0 ? _cachedExpandedGroups2 : group.isExpanded) !== null && _ref2 !== void 0 ? _ref2 : false,
|
|
1596
1635
|
fields: updatedFields
|
|
1597
1636
|
});
|
|
1598
1637
|
});
|
|
1599
1638
|
};
|
|
1600
1639
|
const updateFieldDependenciesStatus = formik => {
|
|
1601
|
-
var
|
|
1640
|
+
var _context6;
|
|
1602
1641
|
const updateFields = (fields, path) => {
|
|
1603
1642
|
_forEachInstanceProperty__default["default"](fields).call(fields, (field, index) => {
|
|
1604
|
-
|
|
1643
|
+
var _context5;
|
|
1644
|
+
const currentPath = _concatInstanceProperty__default["default"](_context5 = "".concat(path, ".fields[")).call(_context5, index, "]");
|
|
1605
1645
|
if (hasDependentFields(field)) {
|
|
1606
1646
|
const nextIsChecked = isAnyDependentChecked(_valuesInstanceProperty__default["default"](formik).groups, field.dependentGroupNames, field.dependentFieldNames);
|
|
1607
1647
|
if (field.isChecked !== nextIsChecked) {
|
|
1608
|
-
formik.setFieldValue(
|
|
1648
|
+
formik.setFieldValue("".concat(currentPath, ".isChecked"), nextIsChecked, false);
|
|
1609
1649
|
}
|
|
1610
1650
|
}
|
|
1611
1651
|
if (field.fields) {
|
|
@@ -1613,8 +1653,8 @@ const updateFieldDependenciesStatus = formik => {
|
|
|
1613
1653
|
}
|
|
1614
1654
|
});
|
|
1615
1655
|
};
|
|
1616
|
-
_forEachInstanceProperty__default["default"](
|
|
1617
|
-
updateFields(group.fields,
|
|
1656
|
+
_forEachInstanceProperty__default["default"](_context6 = _valuesInstanceProperty__default["default"](formik).groups).call(_context6, (group, index) => {
|
|
1657
|
+
updateFields(group.fields, "groups[".concat(index, "]"));
|
|
1618
1658
|
});
|
|
1619
1659
|
};
|
|
1620
1660
|
|
|
@@ -1634,8 +1674,8 @@ const getCsvHeaders = file => {
|
|
|
1634
1674
|
};
|
|
1635
1675
|
reader.onload = e => {
|
|
1636
1676
|
try {
|
|
1637
|
-
var _context, _context2;
|
|
1638
|
-
const text = e.target
|
|
1677
|
+
var _e$target, _context, _context2;
|
|
1678
|
+
const text = (_e$target = e.target) === null || _e$target === void 0 ? void 0 : _e$target.result;
|
|
1639
1679
|
entireFile += text;
|
|
1640
1680
|
const firstLineEnd = _indexOfInstanceProperty__default["default"](entireFile).call(entireFile, '\n');
|
|
1641
1681
|
if (firstLineEnd === -1 && offset < file.size) {
|
|
@@ -1658,29 +1698,30 @@ const getCsvHeaders = file => {
|
|
|
1658
1698
|
};
|
|
1659
1699
|
|
|
1660
1700
|
function ownKeys$c(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; }
|
|
1661
|
-
function _objectSpread$c(e) { for (var r = 1; r < arguments.length; r++) { var
|
|
1701
|
+
function _objectSpread$c(e) { for (var r = 1; r < arguments.length; r++) { var _context6, _context7; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context6 = ownKeys$c(Object(t), !0)).call(_context6, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context7 = ownKeys$c(Object(t))).call(_context7, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
1662
1702
|
function groupFieldValidationErrors(errors, intl) {
|
|
1663
|
-
var
|
|
1703
|
+
var _context3, _context5;
|
|
1664
1704
|
const errorsByCode = _reduceInstanceProperty__default["default"](errors).call(errors, (groups, error) => {
|
|
1665
|
-
var _context;
|
|
1666
|
-
const groupKey = error.code === 'AttributeLevelMismatch' && error.actualLevel ?
|
|
1705
|
+
var _context, _context2;
|
|
1706
|
+
const groupKey = error.code === 'AttributeLevelMismatch' && error.actualLevel ? _concatInstanceProperty__default["default"](_context = "".concat(error.code, "-")).call(_context, error.actualLevel) : error.code;
|
|
1667
1707
|
const group = groups[groupKey] || {
|
|
1668
1708
|
code: error.code,
|
|
1669
1709
|
originalErrors: [],
|
|
1670
1710
|
fieldNames: []
|
|
1671
1711
|
};
|
|
1672
|
-
if (error.field && !_includesInstanceProperty__default["default"](
|
|
1712
|
+
if (error.field && !_includesInstanceProperty__default["default"](_context2 = group.fieldNames).call(_context2, error.field)) {
|
|
1673
1713
|
group.fieldNames.push(error.field);
|
|
1674
1714
|
}
|
|
1675
1715
|
group.originalErrors.push(error);
|
|
1676
1716
|
groups[groupKey] = group;
|
|
1677
1717
|
return groups;
|
|
1678
1718
|
}, {});
|
|
1679
|
-
_forEachInstanceProperty__default["default"](
|
|
1680
|
-
var
|
|
1681
|
-
_sortInstanceProperty__default["default"](
|
|
1719
|
+
_forEachInstanceProperty__default["default"](_context3 = _Object$values__default["default"](errorsByCode)).call(_context3, group => {
|
|
1720
|
+
var _context4;
|
|
1721
|
+
_sortInstanceProperty__default["default"](_context4 = group.fieldNames).call(_context4);
|
|
1682
1722
|
});
|
|
1683
|
-
return _mapInstanceProperty__default["default"](
|
|
1723
|
+
return _mapInstanceProperty__default["default"](_context5 = _Object$values__default["default"](errorsByCode)).call(_context5, group => {
|
|
1724
|
+
var _group$originalErrors;
|
|
1684
1725
|
let messageTitle;
|
|
1685
1726
|
switch (group.code) {
|
|
1686
1727
|
case 'NotSupportedField':
|
|
@@ -1704,21 +1745,21 @@ function groupFieldValidationErrors(errors, intl) {
|
|
|
1704
1745
|
case 'AttributeLevelMismatch':
|
|
1705
1746
|
{
|
|
1706
1747
|
const referenceError = group.originalErrors[0];
|
|
1707
|
-
if (referenceError
|
|
1748
|
+
if ((referenceError === null || referenceError === void 0 ? void 0 : referenceError.actualLevel) === 'Product') {
|
|
1708
1749
|
messageTitle = intl.formatMessage(messages.attributeLevelMismatchProductLevelTitle, {
|
|
1709
1750
|
b: getSmallBold
|
|
1710
1751
|
});
|
|
1711
|
-
} else if (referenceError
|
|
1752
|
+
} else if ((referenceError === null || referenceError === void 0 ? void 0 : referenceError.actualLevel) === 'Variant') {
|
|
1712
1753
|
messageTitle = intl.formatMessage(messages.attributeLevelMismatchVariantLevelTitle, {
|
|
1713
1754
|
b: getSmallBold
|
|
1714
1755
|
});
|
|
1715
1756
|
} else {
|
|
1716
|
-
messageTitle = referenceError
|
|
1757
|
+
messageTitle = (referenceError === null || referenceError === void 0 ? void 0 : referenceError.message) || intl.formatMessage(messages.unknownError);
|
|
1717
1758
|
}
|
|
1718
1759
|
break;
|
|
1719
1760
|
}
|
|
1720
1761
|
default:
|
|
1721
|
-
messageTitle = group.originalErrors[0]
|
|
1762
|
+
messageTitle = ((_group$originalErrors = group.originalErrors[0]) === null || _group$originalErrors === void 0 ? void 0 : _group$originalErrors.message) || intl.formatMessage(messages.unknownError);
|
|
1722
1763
|
}
|
|
1723
1764
|
return _objectSpread$c(_objectSpread$c({}, group), {}, {
|
|
1724
1765
|
messageTitle
|
|
@@ -1738,22 +1779,28 @@ function isExportApiErrorResponse(error) {
|
|
|
1738
1779
|
}
|
|
1739
1780
|
|
|
1740
1781
|
const useInitialValues = props => {
|
|
1741
|
-
var _context;
|
|
1742
|
-
const _useApplicationContex = applicationShellConnectors.useApplicationContext(applicationContext =>
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1782
|
+
var _context, _context2, _context3;
|
|
1783
|
+
const _useApplicationContex = applicationShellConnectors.useApplicationContext(applicationContext => {
|
|
1784
|
+
var _applicationContext$u;
|
|
1785
|
+
return {
|
|
1786
|
+
locale: applicationContext.dataLocale,
|
|
1787
|
+
userLocale: (_applicationContext$u = applicationContext.user) === null || _applicationContext$u === void 0 ? void 0 : _applicationContext$u.locale
|
|
1788
|
+
};
|
|
1789
|
+
}),
|
|
1746
1790
|
locale = _useApplicationContex.locale,
|
|
1747
1791
|
userLocale = _useApplicationContex.userLocale;
|
|
1748
|
-
const _useApplicationContex2 = applicationShellConnectors.useApplicationContext(context =>
|
|
1749
|
-
|
|
1750
|
-
|
|
1792
|
+
const _useApplicationContex2 = applicationShellConnectors.useApplicationContext(context => {
|
|
1793
|
+
var _context$project;
|
|
1794
|
+
return {
|
|
1795
|
+
projectKey: (_context$project = context.project) === null || _context$project === void 0 ? void 0 : _context$project.key
|
|
1796
|
+
};
|
|
1797
|
+
}),
|
|
1751
1798
|
projectKey = _useApplicationContex2.projectKey;
|
|
1752
|
-
const _useStorage = useStorage(
|
|
1799
|
+
const _useStorage = useStorage(_concatInstanceProperty__default["default"](_context = "".concat(projectKey, "/")).call(_context, OPERATIONS_EXPORT_RESOURCES_MODAL_SELECTION), {}),
|
|
1753
1800
|
_useStorage2 = _slicedToArray(_useStorage, 1),
|
|
1754
1801
|
cachedSelectedGroups = _useStorage2[0];
|
|
1755
|
-
const _useStorage3 = useStorage(
|
|
1756
|
-
[props.resourceType]: _reduceInstanceProperty__default["default"](
|
|
1802
|
+
const _useStorage3 = useStorage(_concatInstanceProperty__default["default"](_context2 = "".concat(projectKey, "/")).call(_context2, OPERATIONS_EXPORT_RESOURCES_MODAL_EXPANDED_GROUP), {
|
|
1803
|
+
[props.resourceType]: _reduceInstanceProperty__default["default"](_context3 = props.fieldGroups).call(_context3, (acc, group) => {
|
|
1757
1804
|
acc[group.groupName] = group.isExpanded;
|
|
1758
1805
|
return acc;
|
|
1759
1806
|
}, {})
|
|
@@ -1762,10 +1809,10 @@ const useInitialValues = props => {
|
|
|
1762
1809
|
cachedExpandedGroups = _useStorage4[0];
|
|
1763
1810
|
return React__default["default"].useMemo(() => {
|
|
1764
1811
|
let groups = removeEmptyGroups(props.fieldGroups);
|
|
1765
|
-
groups = updateFieldGroupsWithIsCheckedValue(groups, cachedSelectedGroups
|
|
1766
|
-
groups = updateFieldGroupsWithIsExpandedValue(groups, cachedExpandedGroups
|
|
1812
|
+
groups = updateFieldGroupsWithIsCheckedValue(groups, (cachedSelectedGroups === null || cachedSelectedGroups === void 0 ? void 0 : cachedSelectedGroups[props.resourceType]) || {});
|
|
1813
|
+
groups = updateFieldGroupsWithIsExpandedValue(groups, (cachedExpandedGroups === null || cachedExpandedGroups === void 0 ? void 0 : cachedExpandedGroups[props.resourceType]) || {});
|
|
1767
1814
|
return {
|
|
1768
|
-
fileName:
|
|
1815
|
+
fileName: "".concat(resourceTypeToFileName(props.resourceType, userLocale)),
|
|
1769
1816
|
locales: [locale],
|
|
1770
1817
|
groups: updateFieldGroupWithAdditionalFieldExtensions(groups),
|
|
1771
1818
|
queryPredicate: '',
|
|
@@ -1785,7 +1832,7 @@ function _objectSpread$b(e) { for (var r = 1; r < arguments.length; r++) { var _
|
|
|
1785
1832
|
async function makeExportRequest(params, asyncDispatchFn) {
|
|
1786
1833
|
const projectKey = params.projectKey,
|
|
1787
1834
|
requestData = _objectWithoutProperties(params, _excluded$3);
|
|
1788
|
-
const uri =
|
|
1835
|
+
const uri = "/".concat(projectKey, "/export-operations");
|
|
1789
1836
|
const requestAction = sdk.actions.post({
|
|
1790
1837
|
mcApiProxyTarget: constants.MC_API_PROXY_TARGETS.EXPORT,
|
|
1791
1838
|
uri,
|
|
@@ -1816,22 +1863,27 @@ function validateExportOperation(params, asyncDispatchFn) {
|
|
|
1816
1863
|
}
|
|
1817
1864
|
|
|
1818
1865
|
const mergeWhereClause = (base, user) => {
|
|
1866
|
+
var _context;
|
|
1819
1867
|
if (!base && !user) return undefined;
|
|
1820
1868
|
if (base && !user) return base;
|
|
1821
1869
|
if (!base && user) return user;
|
|
1822
|
-
return
|
|
1870
|
+
return _concatInstanceProperty__default["default"](_context = "(".concat(base, ") and (")).call(_context, user, ")");
|
|
1823
1871
|
};
|
|
1824
1872
|
const useStartExportOperation = props => {
|
|
1825
1873
|
const intl = reactIntl.useIntl();
|
|
1826
1874
|
const asyncDispatch = sdk.useAsyncDispatch();
|
|
1827
1875
|
const showNotification = actionsGlobal.useShowNotification();
|
|
1828
|
-
const _useApplicationContex = applicationShellConnectors.useApplicationContext(applicationContext =>
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1876
|
+
const _useApplicationContex = applicationShellConnectors.useApplicationContext(applicationContext => {
|
|
1877
|
+
var _applicationContext$p;
|
|
1878
|
+
return {
|
|
1879
|
+
locale: applicationContext.dataLocale,
|
|
1880
|
+
projectKey: (_applicationContext$p = applicationContext.project) === null || _applicationContext$p === void 0 ? void 0 : _applicationContext$p.key
|
|
1881
|
+
};
|
|
1882
|
+
}),
|
|
1832
1883
|
projectKey = _useApplicationContex.projectKey;
|
|
1833
1884
|
const startExportOperation = async (values, exportType, fieldSelectionMode, localeOption, importedHeaders, selectedStoreKey) => {
|
|
1834
1885
|
try {
|
|
1886
|
+
var _props$selectedResour, _props$baseFilters;
|
|
1835
1887
|
if (!projectKey) throw new Error('Project key is missing');
|
|
1836
1888
|
let fields = [];
|
|
1837
1889
|
if (fieldSelectionMode === 'imported-csv-template' && values.importedCsvTemplateFile) {
|
|
@@ -1841,7 +1893,7 @@ const useStartExportOperation = props => {
|
|
|
1841
1893
|
}
|
|
1842
1894
|
let where = undefined;
|
|
1843
1895
|
let filters = undefined;
|
|
1844
|
-
if (exportType === EXPORT_TYPES.SELECTED && props.selectedResourceIds
|
|
1896
|
+
if (exportType === EXPORT_TYPES.SELECTED && (_props$selectedResour = props.selectedResourceIds) !== null && _props$selectedResour !== void 0 && _props$selectedResour.length) {
|
|
1845
1897
|
where = props.selectedScopeQueryPredicateBuilder ? props.selectedScopeQueryPredicateBuilder(props.selectedResourceIds) : buildSelectedExportFilters(props.selectedResourceIds);
|
|
1846
1898
|
} else if (exportType === EXPORT_TYPES.FILTERED && props.filters) {
|
|
1847
1899
|
where = props.filters.where;
|
|
@@ -1851,12 +1903,12 @@ const useStartExportOperation = props => {
|
|
|
1851
1903
|
filters = props.filters.filters;
|
|
1852
1904
|
}
|
|
1853
1905
|
} else if (exportType === EXPORT_TYPES.QUERY_PREDICATE) {
|
|
1854
|
-
var
|
|
1855
|
-
where = _trimInstanceProperty__default["default"](
|
|
1906
|
+
var _context2;
|
|
1907
|
+
where = _trimInstanceProperty__default["default"](_context2 = values.queryPredicate).call(_context2);
|
|
1856
1908
|
} else if (exportType === EXPORT_TYPES.SPECIFIC_STORE) {
|
|
1857
|
-
where =
|
|
1909
|
+
where = "store(key=\"".concat(selectedStoreKey, "\")");
|
|
1858
1910
|
}
|
|
1859
|
-
where = mergeWhereClause(props.baseFilters
|
|
1911
|
+
where = mergeWhereClause((_props$baseFilters = props.baseFilters) === null || _props$baseFilters === void 0 ? void 0 : _props$baseFilters.where, where);
|
|
1860
1912
|
let locales = undefined;
|
|
1861
1913
|
if (localeOption !== 'onlyLocalesFoundInCsvFile') {
|
|
1862
1914
|
locales = values.locales;
|
|
@@ -1933,7 +1985,7 @@ const useStartExportOperation = props => {
|
|
|
1933
1985
|
|
|
1934
1986
|
const _excluded$2 = ["fields"];
|
|
1935
1987
|
function ownKeys$a(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; }
|
|
1936
|
-
function _objectSpread$a(e) { for (var r = 1; r < arguments.length; r++) { var
|
|
1988
|
+
function _objectSpread$a(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$a(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$a(Object(t))).call(_context3, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
1937
1989
|
const getFieldFullName = _ref => {
|
|
1938
1990
|
var _context;
|
|
1939
1991
|
let fieldPrefix = _ref.fieldPrefix,
|
|
@@ -1943,7 +1995,6 @@ const getFieldFullName = _ref => {
|
|
|
1943
1995
|
const localizeTypeDefinitionLabels = function () {
|
|
1944
1996
|
let fieldDefinitions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
1945
1997
|
return _mapInstanceProperty__default["default"](fieldDefinitions).call(fieldDefinitions, _ref2 => {
|
|
1946
|
-
var _context2, _context3;
|
|
1947
1998
|
let fields = _ref2.fields,
|
|
1948
1999
|
fieldsType = _objectWithoutProperties(_ref2, _excluded$2);
|
|
1949
2000
|
const isFieldTypeLabelLocalized = _Array$isArray__default["default"](fieldsType.label);
|
|
@@ -1953,7 +2004,7 @@ const localizeTypeDefinitionLabels = function () {
|
|
|
1953
2004
|
from: 'label',
|
|
1954
2005
|
to: 'label'
|
|
1955
2006
|
}]).label : fieldsType.label,
|
|
1956
|
-
fields: (
|
|
2007
|
+
fields: (fields === null || fields === void 0 ? void 0 : _mapInstanceProperty__default["default"](fields).call(fields, field => {
|
|
1957
2008
|
const isFieldLabelLocalized = _Array$isArray__default["default"](field.label);
|
|
1958
2009
|
if (!isFieldLabelLocalized) {
|
|
1959
2010
|
return field;
|
|
@@ -1962,22 +2013,26 @@ const localizeTypeDefinitionLabels = function () {
|
|
|
1962
2013
|
from: 'label',
|
|
1963
2014
|
to: 'label'
|
|
1964
2015
|
}]));
|
|
1965
|
-
}) || []
|
|
2016
|
+
})) || []
|
|
1966
2017
|
};
|
|
1967
2018
|
});
|
|
1968
2019
|
};
|
|
1969
2020
|
const useConvertFieldDefinitionsForExport = () => {
|
|
1970
|
-
const _useApplicationContex = applicationShellConnectors.useApplicationContext(applicationContext =>
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
2021
|
+
const _useApplicationContex = applicationShellConnectors.useApplicationContext(applicationContext => {
|
|
2022
|
+
var _applicationContext$p;
|
|
2023
|
+
return {
|
|
2024
|
+
language: applicationContext.dataLocale,
|
|
2025
|
+
languages: (_applicationContext$p = applicationContext.project) === null || _applicationContext$p === void 0 ? void 0 : _applicationContext$p.languages
|
|
2026
|
+
};
|
|
2027
|
+
}),
|
|
1974
2028
|
language = _useApplicationContex.language,
|
|
1975
2029
|
languages = _useApplicationContex.languages;
|
|
1976
2030
|
const sortByField = (fields, fieldName) => {
|
|
1977
2031
|
if (!fields) return [];
|
|
1978
2032
|
if (fieldName) {
|
|
1979
2033
|
return sortBy__default["default"](fields, field => {
|
|
1980
|
-
|
|
2034
|
+
var _field$fieldName;
|
|
2035
|
+
return (_field$fieldName = field[fieldName]) === null || _field$fieldName === void 0 ? void 0 : _field$fieldName.toLowerCase();
|
|
1981
2036
|
});
|
|
1982
2037
|
}
|
|
1983
2038
|
return fields;
|
|
@@ -1991,7 +2046,7 @@ const useConvertFieldDefinitionsForExport = () => {
|
|
|
1991
2046
|
if (!fieldDefinitions) return [];
|
|
1992
2047
|
const localizedTypeDefinitions = localizeTypeDefinitionLabels(fieldDefinitions);
|
|
1993
2048
|
const results = _mapInstanceProperty__default["default"](localizedTypeDefinitions).call(localizedTypeDefinitions, transformedType => {
|
|
1994
|
-
var
|
|
2049
|
+
var _transformedType$fiel;
|
|
1995
2050
|
const isTypeLabelLocalized = typeof transformedType.label !== 'string';
|
|
1996
2051
|
return {
|
|
1997
2052
|
isExpandable: true,
|
|
@@ -2005,7 +2060,7 @@ const useConvertFieldDefinitionsForExport = () => {
|
|
|
2005
2060
|
fallbackOrder: languages,
|
|
2006
2061
|
fallback: transformedType.name
|
|
2007
2062
|
}) : transformedType.label,
|
|
2008
|
-
fields: sortByField((
|
|
2063
|
+
fields: sortByField((_transformedType$fiel = transformedType.fields) === null || _transformedType$fiel === void 0 ? void 0 : _mapInstanceProperty__default["default"](_transformedType$fiel).call(_transformedType$fiel, fieldDefinition => {
|
|
2009
2064
|
const isFieldLabelLocalized = typeof fieldDefinition.label !== 'string';
|
|
2010
2065
|
return {
|
|
2011
2066
|
name: getFieldFullName({
|
|
@@ -2036,13 +2091,16 @@ const useValidateExportOperation = () => {
|
|
|
2036
2091
|
const intl = reactIntl.useIntl();
|
|
2037
2092
|
const asyncDispatch = sdk.useAsyncDispatch();
|
|
2038
2093
|
const showNotification = actionsGlobal.useShowNotification();
|
|
2039
|
-
const _useApplicationContex = applicationShellConnectors.useApplicationContext(context =>
|
|
2040
|
-
|
|
2041
|
-
|
|
2094
|
+
const _useApplicationContex = applicationShellConnectors.useApplicationContext(context => {
|
|
2095
|
+
var _context$project;
|
|
2096
|
+
return {
|
|
2097
|
+
projectKey: (_context$project = context.project) === null || _context$project === void 0 ? void 0 : _context$project.key
|
|
2098
|
+
};
|
|
2099
|
+
}),
|
|
2042
2100
|
projectKey = _useApplicationContex.projectKey;
|
|
2043
2101
|
const validateExport = async params => {
|
|
2044
2102
|
try {
|
|
2045
|
-
var _context,
|
|
2103
|
+
var _context, _params$queryPredicat;
|
|
2046
2104
|
if (!projectKey) return;
|
|
2047
2105
|
const invalidFields = _filterInstanceProperty__default["default"](_context = params.fields).call(_context, field => !isFieldNameValid(field));
|
|
2048
2106
|
if (invalidFields.length > 0) {
|
|
@@ -2061,7 +2119,7 @@ const useValidateExportOperation = () => {
|
|
|
2061
2119
|
fileFormat: params.outputFormat,
|
|
2062
2120
|
fields: params.fields,
|
|
2063
2121
|
locales: params.locales,
|
|
2064
|
-
where: ((
|
|
2122
|
+
where: ((_params$queryPredicat = params.queryPredicate) === null || _params$queryPredicat === void 0 ? void 0 : _trimInstanceProperty__default["default"](_params$queryPredicat).call(_params$queryPredicat)) || undefined
|
|
2065
2123
|
}, asyncDispatch);
|
|
2066
2124
|
if (isExportApiSuccessResponse(response) && response.resourceCount === 0) {
|
|
2067
2125
|
return {
|
|
@@ -2074,11 +2132,12 @@ const useValidateExportOperation = () => {
|
|
|
2074
2132
|
};
|
|
2075
2133
|
} catch (error) {
|
|
2076
2134
|
if (isExportApiErrorResponse(error)) {
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2135
|
+
var _error$body$errors, _error$body$validatio;
|
|
2136
|
+
if ((_error$body$errors = error.body.errors) !== null && _error$body$errors !== void 0 && _error$body$errors.length) {
|
|
2137
|
+
var _context2;
|
|
2138
|
+
const whereError = _findInstanceProperty__default["default"](_context2 = error.body.errors).call(_context2, error => {
|
|
2139
|
+
var _context3;
|
|
2140
|
+
return error.message && _includesInstanceProperty__default["default"](_context3 = error.message).call(_context3, 'Malformed parameter: where');
|
|
2082
2141
|
});
|
|
2083
2142
|
if (whereError) {
|
|
2084
2143
|
return {
|
|
@@ -2087,7 +2146,7 @@ const useValidateExportOperation = () => {
|
|
|
2087
2146
|
};
|
|
2088
2147
|
}
|
|
2089
2148
|
}
|
|
2090
|
-
if (error.body.validationErrors
|
|
2149
|
+
if ((_error$body$validatio = error.body.validationErrors) !== null && _error$body$validatio !== void 0 && _error$body$validatio.length) {
|
|
2091
2150
|
return {
|
|
2092
2151
|
success: false,
|
|
2093
2152
|
validationErrors: error.body.validationErrors
|
|
@@ -2265,10 +2324,10 @@ function ExportScopeSection() {
|
|
|
2265
2324
|
})
|
|
2266
2325
|
}), !hideExportSelectedResourcesOption && jsxRuntime.jsx(uiKit.RadioInput.Option, {
|
|
2267
2326
|
value: EXPORT_TYPES.SELECTED,
|
|
2268
|
-
isDisabled: !selectedResourceIds
|
|
2327
|
+
isDisabled: !(selectedResourceIds !== null && selectedResourceIds !== void 0 && selectedResourceIds.length),
|
|
2269
2328
|
children: jsxRuntime.jsx(uiKit.Text.Body, {
|
|
2270
|
-
tone: !selectedResourceIds
|
|
2271
|
-
intlMessage: selectedResourceIds
|
|
2329
|
+
tone: !(selectedResourceIds !== null && selectedResourceIds !== void 0 && selectedResourceIds.length) ? 'tertiary' : undefined,
|
|
2330
|
+
intlMessage: selectedResourceIds !== null && selectedResourceIds !== void 0 && selectedResourceIds.length ? _objectSpread$8(_objectSpread$8({}, resourceTypeMessages[resourceType].exportScopeSelected), {}, {
|
|
2272
2331
|
values: {
|
|
2273
2332
|
total: selectedResourceIds.length
|
|
2274
2333
|
}
|
|
@@ -2313,6 +2372,7 @@ function ExportScopeSection() {
|
|
|
2313
2372
|
}
|
|
2314
2373
|
|
|
2315
2374
|
const ExportFileSettingsStep = () => {
|
|
2375
|
+
var _context, _context2, _context3;
|
|
2316
2376
|
const intl = reactIntl.useIntl();
|
|
2317
2377
|
const _useExportResourcesMo = useExportResourcesModalContext(),
|
|
2318
2378
|
formik = _useExportResourcesMo.formik,
|
|
@@ -2333,13 +2393,13 @@ const ExportFileSettingsStep = () => {
|
|
|
2333
2393
|
const shouldShowPreferences = _valuesInstanceProperty__default["default"](formik).outputFormat === 'csv';
|
|
2334
2394
|
return jsxRuntime.jsx(applicationComponents.FormDialog, {
|
|
2335
2395
|
isOpen: true,
|
|
2336
|
-
title:
|
|
2396
|
+
title: _concatInstanceProperty__default["default"](_context = "".concat(intl.formatMessage(messages.stepCount, {
|
|
2337
2397
|
currentStep: 1,
|
|
2338
2398
|
totalSteps: TOTAL_STEPS
|
|
2339
|
-
})
|
|
2340
|
-
labelPrimary:
|
|
2399
|
+
}), ": ")).call(_context, intl.formatMessage(messages["modalTitle.".concat(resourceType)])),
|
|
2400
|
+
labelPrimary: _concatInstanceProperty__default["default"](_context2 = "".concat(intl.formatMessage(messages.stepNumber, {
|
|
2341
2401
|
stepNumber: 2
|
|
2342
|
-
})
|
|
2402
|
+
}), ": ")).call(_context2, intl.formatMessage(messages.selectContentToExport)),
|
|
2343
2403
|
iconLeftPrimaryButton: jsxRuntime.jsx(uiKit.AngleRightIcon, {}),
|
|
2344
2404
|
onPrimaryButtonClick: formik.submitForm,
|
|
2345
2405
|
isPrimaryButtonDisabled: !formik.isValid || isStoreSelectionMissing,
|
|
@@ -2349,7 +2409,7 @@ const ExportFileSettingsStep = () => {
|
|
|
2349
2409
|
children: jsxRuntime.jsx(fullstory.Masking.Unmask, {
|
|
2350
2410
|
children: jsxRuntime.jsxs(uiKit.Grid, {
|
|
2351
2411
|
gridRowGap: uiKit.designTokens.spacingXl,
|
|
2352
|
-
gridTemplateColumns:
|
|
2412
|
+
gridTemplateColumns: _concatInstanceProperty__default["default"](_context3 = "calc(".concat(uiKit.designTokens.constraint3, " + ")).call(_context3, uiKit.designTokens.spacingL, ") auto"),
|
|
2353
2413
|
children: [jsxRuntime.jsx(uiKit.Grid.Item, {
|
|
2354
2414
|
children: jsxRuntime.jsx(uiKit.Text.Body, {
|
|
2355
2415
|
intlMessage: messages.scope
|
|
@@ -2406,10 +2466,13 @@ const ExportLocaleSelectField = () => {
|
|
|
2406
2466
|
fieldSelectionMode = _useExportResourcesMo.fieldSelectionMode,
|
|
2407
2467
|
localeOption = _useExportResourcesMo.localeOption,
|
|
2408
2468
|
setLocaleOption = _useExportResourcesMo.setLocaleOption;
|
|
2409
|
-
const _useApplicationContex = applicationShellConnectors.useApplicationContext(applicationContext =>
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
2469
|
+
const _useApplicationContex = applicationShellConnectors.useApplicationContext(applicationContext => {
|
|
2470
|
+
var _applicationContext$p;
|
|
2471
|
+
return {
|
|
2472
|
+
locale: applicationContext.dataLocale,
|
|
2473
|
+
locales: ((_applicationContext$p = applicationContext.project) === null || _applicationContext$p === void 0 ? void 0 : _applicationContext$p.languages) || []
|
|
2474
|
+
};
|
|
2475
|
+
}),
|
|
2413
2476
|
locales = _useApplicationContex.locales,
|
|
2414
2477
|
locale = _useApplicationContex.locale;
|
|
2415
2478
|
const isOnlyLocalesFoundInCsvFileOptionDisabled = React__default["default"].useMemo(() => {
|
|
@@ -2515,25 +2578,29 @@ const ImportedCsvTemplateFieldsForm = () => {
|
|
|
2515
2578
|
};
|
|
2516
2579
|
|
|
2517
2580
|
function ownKeys$6(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; }
|
|
2518
|
-
function _objectSpread$6(e) { for (var r = 1; r < arguments.length; r++) { var
|
|
2581
|
+
function _objectSpread$6(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$6(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$6(Object(t))).call(_context3, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
2519
2582
|
const exportFieldSelectionContextDefaultValues = {
|
|
2520
2583
|
updateExpandedGroups: (_name, _value) => {}
|
|
2521
2584
|
};
|
|
2522
2585
|
const ExportFieldSelectionContext = /*#__PURE__*/React.createContext(exportFieldSelectionContextDefaultValues);
|
|
2523
2586
|
const ExportFieldSelectionProvider = _ref => {
|
|
2587
|
+
var _context;
|
|
2524
2588
|
let resourceType = _ref.resourceType,
|
|
2525
2589
|
children = _ref.children;
|
|
2526
|
-
const _useApplicationContex = applicationShellConnectors.useApplicationContext(context =>
|
|
2527
|
-
|
|
2528
|
-
|
|
2590
|
+
const _useApplicationContex = applicationShellConnectors.useApplicationContext(context => {
|
|
2591
|
+
var _context$project;
|
|
2592
|
+
return {
|
|
2593
|
+
projectKey: (_context$project = context.project) === null || _context$project === void 0 ? void 0 : _context$project.key
|
|
2594
|
+
};
|
|
2595
|
+
}),
|
|
2529
2596
|
projectKey = _useApplicationContex.projectKey;
|
|
2530
|
-
const _useStorage = useStorage(
|
|
2597
|
+
const _useStorage = useStorage(_concatInstanceProperty__default["default"](_context = "".concat(projectKey, "/")).call(_context, OPERATIONS_EXPORT_RESOURCES_MODAL_EXPANDED_GROUP), {}),
|
|
2531
2598
|
_useStorage2 = _slicedToArray(_useStorage, 2),
|
|
2532
2599
|
cachedExpandedGroups = _useStorage2[0],
|
|
2533
2600
|
setCachedExpandedGroups = _useStorage2[1];
|
|
2534
2601
|
const updateExpandedGroups = React.useCallback((name, value) => {
|
|
2535
2602
|
setCachedExpandedGroups(_objectSpread$6(_objectSpread$6({}, cachedExpandedGroups), {}, {
|
|
2536
|
-
[resourceType]: _objectSpread$6(_objectSpread$6({}, cachedExpandedGroups
|
|
2603
|
+
[resourceType]: _objectSpread$6(_objectSpread$6({}, (cachedExpandedGroups === null || cachedExpandedGroups === void 0 ? void 0 : cachedExpandedGroups[resourceType]) || {}), {}, {
|
|
2537
2604
|
[name]: value
|
|
2538
2605
|
})
|
|
2539
2606
|
}));
|
|
@@ -2584,7 +2651,7 @@ const CollapsibleFieldWrapper = _ref => {
|
|
|
2584
2651
|
registerContentNode
|
|
2585
2652
|
});
|
|
2586
2653
|
}
|
|
2587
|
-
},
|
|
2654
|
+
}, "".concat(isForceExpanded));
|
|
2588
2655
|
return children({
|
|
2589
2656
|
isOpen: true,
|
|
2590
2657
|
toggle: () => {},
|
|
@@ -2592,7 +2659,6 @@ const CollapsibleFieldWrapper = _ref => {
|
|
|
2592
2659
|
});
|
|
2593
2660
|
};
|
|
2594
2661
|
const FieldSection = _ref3 => {
|
|
2595
|
-
var _context, _context2, _context7, _context8;
|
|
2596
2662
|
let fields = _ref3.fields,
|
|
2597
2663
|
parentKeys = _ref3.parentKeys,
|
|
2598
2664
|
formik = _ref3.formik,
|
|
@@ -2602,11 +2668,11 @@ const FieldSection = _ref3 => {
|
|
|
2602
2668
|
maxVisibleChildren = _ref3.maxVisibleChildren;
|
|
2603
2669
|
const _useExportFieldSelect = useExportFieldSelectionContext(),
|
|
2604
2670
|
updateExpandedGroups = _useExportFieldSelect.updateExpandedGroups;
|
|
2605
|
-
const visibleFields = isSearchActive || !maxVisibleChildren ? fields :
|
|
2671
|
+
const visibleFields = isSearchActive || !maxVisibleChildren ? fields : fields === null || fields === void 0 ? void 0 : _sliceInstanceProperty__default["default"](fields).call(fields, 0, maxVisibleChildren);
|
|
2606
2672
|
const hasMoreFields = maxVisibleChildren && !isSearchActive && fields && fields.length > maxVisibleChildren;
|
|
2607
2673
|
const visibleIndex = field => {
|
|
2608
|
-
var
|
|
2609
|
-
return (
|
|
2674
|
+
var _context;
|
|
2675
|
+
return (fields === null || fields === void 0 ? void 0 : _indexOfInstanceProperty__default["default"](_context = _filterInstanceProperty__default["default"](fields).call(fields, f => !f.isHidden)).call(_context, field)) || -1;
|
|
2610
2676
|
};
|
|
2611
2677
|
const shouldDisplayField = field => {
|
|
2612
2678
|
if (field.isHidden) return false;
|
|
@@ -2618,13 +2684,15 @@ const FieldSection = _ref3 => {
|
|
|
2618
2684
|
};
|
|
2619
2685
|
return jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
2620
2686
|
scale: "s",
|
|
2621
|
-
children: [
|
|
2687
|
+
children: [visibleFields === null || visibleFields === void 0 ? void 0 : _mapInstanceProperty__default["default"](visibleFields).call(visibleFields, (field, index) => {
|
|
2688
|
+
var _field$dependentGroup, _field$dependentField, _context2;
|
|
2622
2689
|
const isChildrenCountDisplayed = shouldDisplayChildrenCount(field);
|
|
2623
|
-
const hasDependents = Boolean(field.dependentGroupNames
|
|
2690
|
+
const hasDependents = Boolean(((_field$dependentGroup = field.dependentGroupNames) === null || _field$dependentGroup === void 0 ? void 0 : _field$dependentGroup.length) || ((_field$dependentField = field.dependentFieldNames) === null || _field$dependentField === void 0 ? void 0 : _field$dependentField.length));
|
|
2624
2691
|
const isAnyOfTheChildFieldsChecked = isAnyFieldChecked(field.fields || []);
|
|
2625
2692
|
const allFieldsChecked = areAllFieldsChecked(field.fields || []);
|
|
2626
2693
|
const getIsChecked = () => {
|
|
2627
|
-
|
|
2694
|
+
var _field$fields;
|
|
2695
|
+
const isParent = Boolean(field.fields && ((_field$fields = field.fields) === null || _field$fields === void 0 ? void 0 : _field$fields.length) > 0);
|
|
2628
2696
|
if (isParent) return areAllFieldsChecked(field.fields);
|
|
2629
2697
|
return field.isChecked;
|
|
2630
2698
|
};
|
|
@@ -2633,6 +2701,7 @@ const FieldSection = _ref3 => {
|
|
|
2633
2701
|
isForceExpanded: isSearchActive,
|
|
2634
2702
|
field: field,
|
|
2635
2703
|
children: _ref4 => {
|
|
2704
|
+
var _context3;
|
|
2636
2705
|
let isOpen = _ref4.isOpen,
|
|
2637
2706
|
toggle = _ref4.toggle,
|
|
2638
2707
|
registerContentNode = _ref4.registerContentNode;
|
|
@@ -2642,11 +2711,12 @@ const FieldSection = _ref3 => {
|
|
|
2642
2711
|
size: "20",
|
|
2643
2712
|
style: {
|
|
2644
2713
|
position: 'absolute',
|
|
2645
|
-
left:
|
|
2714
|
+
left: "calc(-1 * ".concat(uiKit.designTokens.spacingXl, ")")
|
|
2646
2715
|
},
|
|
2647
2716
|
onClick: () => {
|
|
2648
2717
|
if (!isSearchActive) {
|
|
2649
|
-
|
|
2718
|
+
var _context4;
|
|
2719
|
+
updateExpandedGroups(_concatInstanceProperty__default["default"](_context4 = "".concat(groupName, ".")).call(_context4, field.name), !isOpen);
|
|
2650
2720
|
}
|
|
2651
2721
|
toggle();
|
|
2652
2722
|
},
|
|
@@ -2660,17 +2730,19 @@ const FieldSection = _ref3 => {
|
|
|
2660
2730
|
isChecked: getIsChecked(),
|
|
2661
2731
|
isReadOnly: hasDependents || field.isRequired,
|
|
2662
2732
|
onChange: e => {
|
|
2663
|
-
|
|
2733
|
+
var _context5, _field$fields3;
|
|
2734
|
+
const path = _concatInstanceProperty__default["default"](_context5 = "".concat(parentKeys.join('.'), ".fields[")).call(_context5, index, "]");
|
|
2664
2735
|
const checked = e.target.checked;
|
|
2665
2736
|
// Update all child fields
|
|
2666
2737
|
const updateAllChildFieldsChecked = (path, checked) => {
|
|
2667
2738
|
const item = get__default["default"](_valuesInstanceProperty__default["default"](formik), path);
|
|
2668
2739
|
if (item && item.fields) {
|
|
2669
|
-
var
|
|
2670
|
-
_forEachInstanceProperty__default["default"](
|
|
2671
|
-
|
|
2672
|
-
|
|
2673
|
-
|
|
2740
|
+
var _context6;
|
|
2741
|
+
_forEachInstanceProperty__default["default"](_context6 = item.fields).call(_context6, (field, i) => {
|
|
2742
|
+
var _context7, _field$fields2;
|
|
2743
|
+
const fieldPath = _concatInstanceProperty__default["default"](_context7 = "".concat(path, ".fields[")).call(_context7, i, "]");
|
|
2744
|
+
if (!((_field$fields2 = field.fields) !== null && _field$fields2 !== void 0 && _field$fields2.length)) {
|
|
2745
|
+
formik.setFieldValue("".concat(fieldPath, ".isChecked"), checked || field.isRequired,
|
|
2674
2746
|
// pass `false` to avoid revalidating the form with intermediate values
|
|
2675
2747
|
false);
|
|
2676
2748
|
}
|
|
@@ -2678,8 +2750,8 @@ const FieldSection = _ref3 => {
|
|
|
2678
2750
|
});
|
|
2679
2751
|
}
|
|
2680
2752
|
};
|
|
2681
|
-
if (!field.fields
|
|
2682
|
-
formik.setFieldValue(
|
|
2753
|
+
if (!((_field$fields3 = field.fields) !== null && _field$fields3 !== void 0 && _field$fields3.length)) {
|
|
2754
|
+
formik.setFieldValue("".concat(path, ".isChecked"), checked || field.isRequired,
|
|
2683
2755
|
// pass `false` to avoid revalidating the form with intermediate values
|
|
2684
2756
|
false);
|
|
2685
2757
|
}
|
|
@@ -2704,16 +2776,16 @@ const FieldSection = _ref3 => {
|
|
|
2704
2776
|
fields: field.fields,
|
|
2705
2777
|
maxVisibleChildren: field.maxVisibleChildren,
|
|
2706
2778
|
formik: formik,
|
|
2707
|
-
parentKeys: [...parentKeys,
|
|
2779
|
+
parentKeys: [...parentKeys, "fields[".concat(index, "]")],
|
|
2708
2780
|
isAnySiblingChecked: isAnySiblingChecked,
|
|
2709
2781
|
isSearchActive: isSearchActive,
|
|
2710
2782
|
groupName: groupName
|
|
2711
2783
|
})]
|
|
2712
2784
|
})
|
|
2713
2785
|
})]
|
|
2714
|
-
},
|
|
2786
|
+
}, _concatInstanceProperty__default["default"](_context3 = "".concat(field.name, "-")).call(_context3, index));
|
|
2715
2787
|
}
|
|
2716
|
-
},
|
|
2788
|
+
}, _concatInstanceProperty__default["default"](_context2 = "".concat(field.name, ".")).call(_context2, isSearchActive));
|
|
2717
2789
|
}), hasMoreFields && jsxRuntime.jsx("div", {
|
|
2718
2790
|
css: /*#__PURE__*/react.css("padding-left:", uiKit.designTokens.spacingXs, ";" + ("" ), "" ),
|
|
2719
2791
|
children: jsxRuntime.jsx(uiKit.Text.Detail, {
|
|
@@ -2768,7 +2840,7 @@ const FieldGroupSection = _ref2 => {
|
|
|
2768
2840
|
const isAnyFieldInGroupChecked = React.useMemo(() => isAnyFieldChecked(group.fields), [group.fields]);
|
|
2769
2841
|
const _useExportFieldSelect = useExportFieldSelectionContext(),
|
|
2770
2842
|
updateExpandedGroups = _useExportFieldSelect.updateExpandedGroups;
|
|
2771
|
-
const parentKey =
|
|
2843
|
+
const parentKey = "groups[".concat(index, "]");
|
|
2772
2844
|
const handleChangeAllFields = e => {
|
|
2773
2845
|
const item = get__default["default"](_valuesInstanceProperty__default["default"](formik), parentKey);
|
|
2774
2846
|
function updateAllFields(fields, checked) {
|
|
@@ -2850,7 +2922,7 @@ const FieldGroupSection = _ref2 => {
|
|
|
2850
2922
|
})]
|
|
2851
2923
|
});
|
|
2852
2924
|
}
|
|
2853
|
-
},
|
|
2925
|
+
}, "".concat(isSearchActive));
|
|
2854
2926
|
};
|
|
2855
2927
|
|
|
2856
2928
|
var _ref = {
|
|
@@ -2884,7 +2956,7 @@ const NoSearchResults = () => {
|
|
|
2884
2956
|
};
|
|
2885
2957
|
|
|
2886
2958
|
function ownKeys$4(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; }
|
|
2887
|
-
function _objectSpread$4(e) { for (var r = 1; r < arguments.length; r++) { var
|
|
2959
|
+
function _objectSpread$4(e) { for (var r = 1; r < arguments.length; r++) { var _context9, _context0; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context9 = ownKeys$4(Object(t), !0)).call(_context9, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context0 = ownKeys$4(Object(t))).call(_context0, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
2888
2960
|
const totalSpacing = 56 +
|
|
2889
2961
|
// MC header
|
|
2890
2962
|
32 * 2 + (
|
|
@@ -2926,30 +2998,34 @@ const StyledGridCard = /*#__PURE__*/_styled__default["default"](uiKit.Card, {
|
|
|
2926
2998
|
target: "e1odwg620"
|
|
2927
2999
|
} )("max-height:calc(100vh - ", totalSpacing, "px);overflow:auto;" + ("" ));
|
|
2928
3000
|
const SelectedFieldsForm = () => {
|
|
2929
|
-
var _context,
|
|
3001
|
+
var _context, _fieldSearchTerm$trim, _context7, _context8;
|
|
2930
3002
|
const intl = reactIntl.useIntl();
|
|
2931
3003
|
const _React$useState = React__default["default"].useState(''),
|
|
2932
3004
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
2933
3005
|
fieldSearchTerm = _React$useState2[0],
|
|
2934
3006
|
setFieldSearchTerm = _React$useState2[1];
|
|
2935
|
-
const _useApplicationContex = applicationShellConnectors.useApplicationContext(context =>
|
|
2936
|
-
|
|
2937
|
-
|
|
3007
|
+
const _useApplicationContex = applicationShellConnectors.useApplicationContext(context => {
|
|
3008
|
+
var _context$project;
|
|
3009
|
+
return {
|
|
3010
|
+
projectKey: (_context$project = context.project) === null || _context$project === void 0 ? void 0 : _context$project.key
|
|
3011
|
+
};
|
|
3012
|
+
}),
|
|
2938
3013
|
projectKey = _useApplicationContex.projectKey;
|
|
2939
|
-
const _useStorage = useStorage(
|
|
3014
|
+
const _useStorage = useStorage(_concatInstanceProperty__default["default"](_context = "".concat(projectKey, "/")).call(_context, OPERATIONS_EXPORT_RESOURCES_MODAL_SELECTION), {}),
|
|
2940
3015
|
_useStorage2 = _slicedToArray(_useStorage, 2),
|
|
2941
3016
|
cachedSelectedGroups = _useStorage2[0],
|
|
2942
3017
|
setCachedSelectedGroups = _useStorage2[1];
|
|
2943
3018
|
const _useExportResourcesMo = useExportResourcesModalContext(),
|
|
2944
3019
|
formik = _useExportResourcesMo.formik,
|
|
2945
3020
|
resourceType = _useExportResourcesMo.resourceType;
|
|
2946
|
-
const isSearchActive = (
|
|
3021
|
+
const isSearchActive = (fieldSearchTerm === null || fieldSearchTerm === void 0 || (_fieldSearchTerm$trim = _trimInstanceProperty__default["default"](fieldSearchTerm).call(fieldSearchTerm)) === null || _fieldSearchTerm$trim === void 0 ? void 0 : _fieldSearchTerm$trim.length) >= MIN_SEARCH_LENGTH;
|
|
2947
3022
|
React__default["default"].useEffect(() => {
|
|
2948
3023
|
var _context4;
|
|
2949
3024
|
updateFieldDependenciesStatus(formik);
|
|
2950
3025
|
const checkedFields = {};
|
|
2951
3026
|
function getCheckedFields(field, groupName) {
|
|
2952
|
-
|
|
3027
|
+
var _context2;
|
|
3028
|
+
const fieldName = field.name ? _concatInstanceProperty__default["default"](_context2 = "".concat(groupName, ".")).call(_context2, field.name) : groupName;
|
|
2953
3029
|
if (field.fields) {
|
|
2954
3030
|
var _context3;
|
|
2955
3031
|
_forEachInstanceProperty__default["default"](_context3 = field.fields).call(_context3, f => getCheckedFields(f, fieldName));
|
|
@@ -3029,7 +3105,7 @@ const SelectedFieldsForm = () => {
|
|
|
3029
3105
|
insetScale: "none",
|
|
3030
3106
|
children: jsxRuntime.jsx(uiKit.Grid, {
|
|
3031
3107
|
gridAutoFlow: "row",
|
|
3032
|
-
gridTemplateColumns:
|
|
3108
|
+
gridTemplateColumns: _concatInstanceProperty__default["default"](_context7 = _concatInstanceProperty__default["default"](_context8 = "calc(".concat(uiKit.designTokens.spacingL, " + ")).call(_context8, uiKit.designTokens.constraint5, " + ")).call(_context7, uiKit.designTokens.spacingL, ") auto"),
|
|
3033
3109
|
children: _mapInstanceProperty__default["default"](filteredGroups).call(filteredGroups, (group, index) => jsxRuntime.jsx(FieldGroupSection, {
|
|
3034
3110
|
group: group,
|
|
3035
3111
|
index: index,
|
|
@@ -3047,6 +3123,7 @@ const Divider = /*#__PURE__*/_styled__default["default"]("hr", {
|
|
|
3047
3123
|
} )("display:block;height:1px;border:0;border-top:1px solid ", uiKit.designTokens.colorNeutral90, ";margin:0;padding:0;" + ("" ));
|
|
3048
3124
|
|
|
3049
3125
|
const ExportFieldsSelectionStep = () => {
|
|
3126
|
+
var _context, _context2;
|
|
3050
3127
|
const intl = reactIntl.useIntl();
|
|
3051
3128
|
const _useExportResourcesMo = useExportResourcesModalContext(),
|
|
3052
3129
|
formik = _useExportResourcesMo.formik,
|
|
@@ -3068,13 +3145,13 @@ const ExportFieldsSelectionStep = () => {
|
|
|
3068
3145
|
};
|
|
3069
3146
|
return jsxRuntime.jsx(applicationComponents.FormDialog, {
|
|
3070
3147
|
isOpen: true,
|
|
3071
|
-
title:
|
|
3148
|
+
title: _concatInstanceProperty__default["default"](_context = "".concat(intl.formatMessage(messages.stepCount, {
|
|
3072
3149
|
currentStep: 2,
|
|
3073
3150
|
totalSteps: TOTAL_STEPS
|
|
3074
|
-
})
|
|
3075
|
-
labelPrimary:
|
|
3151
|
+
}), ": ")).call(_context, intl.formatMessage(messages.selectFieldsToExport)),
|
|
3152
|
+
labelPrimary: _concatInstanceProperty__default["default"](_context2 = "".concat(intl.formatMessage(messages.stepNumber, {
|
|
3076
3153
|
stepNumber: 3
|
|
3077
|
-
})
|
|
3154
|
+
}), ": ")).call(_context2, intl.formatMessage(messages.confirmSelection)),
|
|
3078
3155
|
iconLeftPrimaryButton: jsxRuntime.jsx(uiKit.AngleRightIcon, {}),
|
|
3079
3156
|
onPrimaryButtonClick: formik.submitForm,
|
|
3080
3157
|
isPrimaryButtonDisabled: isLoading || !formik.isValid,
|
|
@@ -3083,7 +3160,7 @@ const ExportFieldsSelectionStep = () => {
|
|
|
3083
3160
|
onClose: onClose,
|
|
3084
3161
|
size: 16,
|
|
3085
3162
|
dataAttributesPrimaryButton: {
|
|
3086
|
-
'data-tracking-target':
|
|
3163
|
+
'data-tracking-target': "".concat(resourceType, "_export-start_export_button")
|
|
3087
3164
|
},
|
|
3088
3165
|
children: isLoading ? jsxRuntime.jsx(uiKit.Spacings.Stack, {
|
|
3089
3166
|
scale: "m",
|
|
@@ -3187,11 +3264,11 @@ const ExportResourcesProvider = _ref => {
|
|
|
3187
3264
|
locales: values.locales,
|
|
3188
3265
|
queryPredicate: values.queryPredicate
|
|
3189
3266
|
});
|
|
3190
|
-
if (validationResult
|
|
3267
|
+
if (validationResult !== null && validationResult !== void 0 && validationResult.invalidQueryPredicate) {
|
|
3191
3268
|
formik$1.setFieldError('queryPredicate', 'invalidInput');
|
|
3192
3269
|
return;
|
|
3193
3270
|
}
|
|
3194
|
-
if (validationResult
|
|
3271
|
+
if (validationResult !== null && validationResult !== void 0 && validationResult.noResourcesToExportForQueryPredicate) {
|
|
3195
3272
|
formik$1.setFieldError('queryPredicate', 'noResourcesToExportForQueryPredicate');
|
|
3196
3273
|
return;
|
|
3197
3274
|
}
|
|
@@ -3211,10 +3288,10 @@ const ExportResourcesProvider = _ref => {
|
|
|
3211
3288
|
locales: isUsingImportedCsvLocales ? undefined : values.locales,
|
|
3212
3289
|
queryPredicate: values.queryPredicate
|
|
3213
3290
|
});
|
|
3214
|
-
if (validationResult
|
|
3291
|
+
if (validationResult !== null && validationResult !== void 0 && validationResult.success) {
|
|
3215
3292
|
setCurrentStep(Step.ConfirmExport);
|
|
3216
3293
|
} else {
|
|
3217
|
-
setValidationErrors(validationResult
|
|
3294
|
+
setValidationErrors(validationResult === null || validationResult === void 0 ? void 0 : validationResult.validationErrors);
|
|
3218
3295
|
setCurrentStep(Step.ValidationErrors);
|
|
3219
3296
|
}
|
|
3220
3297
|
} else {
|
|
@@ -3270,7 +3347,7 @@ const ExportResourcesProvider = _ref => {
|
|
|
3270
3347
|
|
|
3271
3348
|
const ExportLogsLink = props => {
|
|
3272
3349
|
return jsxRuntime.jsx(uiKit.Link, {
|
|
3273
|
-
to:
|
|
3350
|
+
to: "/".concat(props.projectKey, "/operations/export/logs"),
|
|
3274
3351
|
tone: props.tone,
|
|
3275
3352
|
children: props.msg
|
|
3276
3353
|
}, "link");
|
|
@@ -3311,12 +3388,16 @@ const FieldsPreview = _ref => {
|
|
|
3311
3388
|
};
|
|
3312
3389
|
|
|
3313
3390
|
function ownKeys$3(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; }
|
|
3314
|
-
function _objectSpread$3(e) { for (var r = 1; r < arguments.length; r++) { var
|
|
3391
|
+
function _objectSpread$3(e) { for (var r = 1; r < arguments.length; r++) { var _context3, _context4; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context3 = ownKeys$3(Object(t), !0)).call(_context3, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context4 = ownKeys$3(Object(t))).call(_context4, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
3315
3392
|
const ExportConfirmationStep = () => {
|
|
3393
|
+
var _context2;
|
|
3316
3394
|
const intl = reactIntl.useIntl();
|
|
3317
|
-
const _useApplicationContex = applicationShellConnectors.useApplicationContext(applicationContext =>
|
|
3318
|
-
|
|
3319
|
-
|
|
3395
|
+
const _useApplicationContex = applicationShellConnectors.useApplicationContext(applicationContext => {
|
|
3396
|
+
var _applicationContext$p;
|
|
3397
|
+
return {
|
|
3398
|
+
projectKey: (_applicationContext$p = applicationContext.project) === null || _applicationContext$p === void 0 ? void 0 : _applicationContext$p.key
|
|
3399
|
+
};
|
|
3400
|
+
}),
|
|
3320
3401
|
projectKey = _useApplicationContex.projectKey;
|
|
3321
3402
|
const _useExportResourcesMo = useExportResourcesModalContext(),
|
|
3322
3403
|
formik = _useExportResourcesMo.formik,
|
|
@@ -3338,10 +3419,10 @@ const ExportConfirmationStep = () => {
|
|
|
3338
3419
|
const returnToFieldsSelection = () => setCurrentStep(Step.FieldsSelection);
|
|
3339
3420
|
return jsxRuntime.jsx(applicationComponents.FormDialog, {
|
|
3340
3421
|
isOpen: true,
|
|
3341
|
-
title:
|
|
3422
|
+
title: _concatInstanceProperty__default["default"](_context2 = "".concat(intl.formatMessage(messages.stepCount, {
|
|
3342
3423
|
currentStep: 3,
|
|
3343
3424
|
totalSteps: TOTAL_STEPS
|
|
3344
|
-
})
|
|
3425
|
+
}), ": ")).call(_context2, intl.formatMessage(messages.exportPreview)),
|
|
3345
3426
|
labelPrimary: intl.formatMessage(messages.startExport),
|
|
3346
3427
|
onPrimaryButtonClick: formik.submitForm,
|
|
3347
3428
|
labelSecondary: intl.formatMessage(messages.selectDifferentFields),
|
|
@@ -3412,7 +3493,7 @@ const ExportConfirmationStep = () => {
|
|
|
3412
3493
|
};
|
|
3413
3494
|
|
|
3414
3495
|
function ownKeys$2(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; }
|
|
3415
|
-
function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var
|
|
3496
|
+
function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var _context4, _context5; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context4 = ownKeys$2(Object(t), !0)).call(_context4, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context5 = ownKeys$2(Object(t))).call(_context5, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
3416
3497
|
const getColumns = () => [{
|
|
3417
3498
|
key: 'errorType',
|
|
3418
3499
|
label: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$2({}, messages.errorType)),
|
|
@@ -3425,7 +3506,8 @@ const ErrorTable = props => {
|
|
|
3425
3506
|
var _context;
|
|
3426
3507
|
const intl = reactIntl.useIntl();
|
|
3427
3508
|
const rows = _mapInstanceProperty__default["default"](_context = props.errors).call(_context, row => {
|
|
3428
|
-
|
|
3509
|
+
var _row$originalErrors$, _context2;
|
|
3510
|
+
const id = row.code === 'AttributeLevelMismatch' && (_row$originalErrors$ = row.originalErrors[0]) !== null && _row$originalErrors$ !== void 0 && _row$originalErrors$.actualLevel ? _concatInstanceProperty__default["default"](_context2 = "".concat(row.code, "-")).call(_context2, row.originalErrors[0].actualLevel) : row.code;
|
|
3429
3511
|
return _objectSpread$2(_objectSpread$2({}, row), {}, {
|
|
3430
3512
|
id
|
|
3431
3513
|
});
|
|
@@ -3442,7 +3524,7 @@ const ErrorTable = props => {
|
|
|
3442
3524
|
});
|
|
3443
3525
|
};
|
|
3444
3526
|
function itemRenderer(item, column, intl) {
|
|
3445
|
-
var
|
|
3527
|
+
var _context3;
|
|
3446
3528
|
switch (column.key) {
|
|
3447
3529
|
case 'errorType':
|
|
3448
3530
|
return jsxRuntime.jsx(uiKit.Stamp, {
|
|
@@ -3460,7 +3542,7 @@ function itemRenderer(item, column, intl) {
|
|
|
3460
3542
|
margin: 0,
|
|
3461
3543
|
paddingLeft: uiKit.designTokens.spacingL
|
|
3462
3544
|
},
|
|
3463
|
-
children: _mapInstanceProperty__default["default"](
|
|
3545
|
+
children: _mapInstanceProperty__default["default"](_context3 = item.fieldNames).call(_context3, (field, index) => jsxRuntime.jsx("li", {
|
|
3464
3546
|
children: jsxRuntime.jsx(uiKit.Text.Detail, {
|
|
3465
3547
|
children: field
|
|
3466
3548
|
})
|
|
@@ -3497,6 +3579,7 @@ function getErrorTypeLabel(errorCode, intl) {
|
|
|
3497
3579
|
function ownKeys$1(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; }
|
|
3498
3580
|
function _objectSpread$1(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$1(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$1(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
3499
3581
|
const ExportValidationErrorsStep = () => {
|
|
3582
|
+
var _formik$values$import;
|
|
3500
3583
|
const intl = reactIntl.useIntl();
|
|
3501
3584
|
const _useExportResourcesMo = useExportResourcesModalContext(),
|
|
3502
3585
|
formik = _useExportResourcesMo.formik,
|
|
@@ -3539,7 +3622,7 @@ const ExportValidationErrorsStep = () => {
|
|
|
3539
3622
|
intlMessage: _objectSpread$1(_objectSpread$1({}, messages.uploadErrorsDetected), {}, {
|
|
3540
3623
|
values: {
|
|
3541
3624
|
total: intl.formatNumber(validationErrors.length),
|
|
3542
|
-
fileName: _valuesInstanceProperty__default["default"](formik).importedCsvTemplateFile
|
|
3625
|
+
fileName: (_formik$values$import = _valuesInstanceProperty__default["default"](formik).importedCsvTemplateFile) === null || _formik$values$import === void 0 ? void 0 : _formik$values$import.name,
|
|
3543
3626
|
b: msg => jsxRuntime.jsx("b", {
|
|
3544
3627
|
children: msg
|
|
3545
3628
|
}, crypto.randomUUID()),
|
|
@@ -3647,17 +3730,20 @@ const FileDropArea = () => {
|
|
|
3647
3730
|
'text/csv': ['.csv']
|
|
3648
3731
|
},
|
|
3649
3732
|
getDropAreaState: getState,
|
|
3650
|
-
children: dropAreaState =>
|
|
3651
|
-
|
|
3652
|
-
|
|
3653
|
-
|
|
3654
|
-
|
|
3655
|
-
|
|
3656
|
-
|
|
3657
|
-
|
|
3658
|
-
|
|
3659
|
-
|
|
3660
|
-
|
|
3733
|
+
children: dropAreaState => {
|
|
3734
|
+
var _formik$values$import;
|
|
3735
|
+
return getDropArea({
|
|
3736
|
+
dropAreaState,
|
|
3737
|
+
isFileDropped: Boolean(_valuesInstanceProperty__default["default"](formik).importedCsvTemplateFile),
|
|
3738
|
+
fileName: (_formik$values$import = _valuesInstanceProperty__default["default"](formik).importedCsvTemplateFile) === null || _formik$values$import === void 0 ? void 0 : _formik$values$import.name,
|
|
3739
|
+
messages: {
|
|
3740
|
+
chooseFile: intl.formatMessage(messages.chooseFile),
|
|
3741
|
+
dragAndDropCSV: intl.formatMessage(messages.dragAndDropCSV),
|
|
3742
|
+
or: intl.formatMessage(messages.or),
|
|
3743
|
+
browseFile: intl.formatMessage(messages.browseFile)
|
|
3744
|
+
}
|
|
3745
|
+
});
|
|
3746
|
+
}
|
|
3661
3747
|
});
|
|
3662
3748
|
};
|
|
3663
3749
|
|
|
@@ -3665,17 +3751,17 @@ const getChunkImport = locale => {
|
|
|
3665
3751
|
const intlLocale = i18n.mapLocaleToIntlLocale(locale);
|
|
3666
3752
|
switch (intlLocale) {
|
|
3667
3753
|
case 'de':
|
|
3668
|
-
return Promise.resolve().then(function () { return require('./de-
|
|
3754
|
+
return Promise.resolve().then(function () { return require('./de-11249ba5.cjs.prod.js'); });
|
|
3669
3755
|
case 'es':
|
|
3670
|
-
return Promise.resolve().then(function () { return require('./es-
|
|
3756
|
+
return Promise.resolve().then(function () { return require('./es-566ec5e7.cjs.prod.js'); });
|
|
3671
3757
|
case 'fr-FR':
|
|
3672
|
-
return Promise.resolve().then(function () { return require('./fr-FR-
|
|
3758
|
+
return Promise.resolve().then(function () { return require('./fr-FR-23df0502.cjs.prod.js'); });
|
|
3673
3759
|
case 'ja':
|
|
3674
3760
|
return Promise.resolve().then(function () { return require('./ja-37632763.cjs.prod.js'); });
|
|
3675
3761
|
case 'pt-BR':
|
|
3676
|
-
return Promise.resolve().then(function () { return require('./pt-BR-
|
|
3762
|
+
return Promise.resolve().then(function () { return require('./pt-BR-14554160.cjs.prod.js'); });
|
|
3677
3763
|
default:
|
|
3678
|
-
return Promise.resolve().then(function () { return require('./en-
|
|
3764
|
+
return Promise.resolve().then(function () { return require('./en-b1e57064.cjs.prod.js'); });
|
|
3679
3765
|
}
|
|
3680
3766
|
};
|
|
3681
3767
|
const loadMessages = async locale => {
|
|
@@ -3684,8 +3770,8 @@ const loadMessages = async locale => {
|
|
|
3684
3770
|
return i18n.parseChunkImport(chunkImport);
|
|
3685
3771
|
} catch (error) {
|
|
3686
3772
|
// eslint-disable-next-line no-console
|
|
3687
|
-
console.warn(
|
|
3688
|
-
sentry.reportErrorToSentry(new Error(
|
|
3773
|
+
console.warn("Something went wrong while loading the export-resources-modal messages for ".concat(locale), error);
|
|
3774
|
+
sentry.reportErrorToSentry(new Error("Something went wrong while loading the export-resources-modal messages for ".concat(locale)), {
|
|
3689
3775
|
extra: error
|
|
3690
3776
|
});
|
|
3691
3777
|
return {};
|