@commercetools-frontend-extensions/export-resources-modal 5.15.0 → 5.15.2
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.
|
@@ -18,6 +18,7 @@ import { useApplicationContext } from '@commercetools-frontend/application-shell
|
|
|
18
18
|
import { Text, TextInput, Spacings, SelectField, CheckboxInput, ContentNotification, Link, RadioInput, TextField, AngleRightIcon, Grid, designTokens, FieldLabel, Constraints, Tooltip, SupportIcon, Stamp, IconButton, AngleDownIcon, CollapsibleMotion, Card, SearchTextInput, LoadingSpinner, 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
|
+
import _concatInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/concat';
|
|
21
22
|
import { FormDialog } from '@commercetools-frontend/application-components';
|
|
22
23
|
import { Masking } from '@commercetools-frontend/fullstory';
|
|
23
24
|
import { DELIMITERS as DELIMITERS$1, appendCsvOrJsonExtensionIfAbsent, mapFormikErrors, FileDroppedArea, EnabledDropArea, ActiveDragDropArea, FileDropArea as FileDropArea$1 } from '@commercetools-frontend-extensions/operations';
|
|
@@ -34,7 +35,6 @@ import _reduceInstanceProperty from '@babel/runtime-corejs3/core-js-stable/insta
|
|
|
34
35
|
import _someInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/some';
|
|
35
36
|
import _includesInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/includes';
|
|
36
37
|
import { reportErrorToSentry } from '@commercetools-frontend/sentry';
|
|
37
|
-
import _concatInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/concat';
|
|
38
38
|
import omitEmpty from 'omit-empty-es';
|
|
39
39
|
import _findInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/find';
|
|
40
40
|
import _everyInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/every';
|
|
@@ -43,7 +43,6 @@ import _Set from '@babel/runtime-corejs3/core-js-stable/set';
|
|
|
43
43
|
import _sortInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/sort';
|
|
44
44
|
import _indexOfInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/index-of';
|
|
45
45
|
import _trimInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/trim';
|
|
46
|
-
import _bindInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/bind';
|
|
47
46
|
import _Promise from '@babel/runtime-corejs3/core-js-stable/promise';
|
|
48
47
|
import _sliceInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/slice';
|
|
49
48
|
import _Object$values from '@babel/runtime-corejs3/core-js-stable/object/values';
|
|
@@ -959,7 +958,7 @@ let UnexpectedExportOperationStateError = /*#__PURE__*/function (_Error) {
|
|
|
959
958
|
function UnexpectedExportOperationStateError(state) {
|
|
960
959
|
var _this;
|
|
961
960
|
_classCallCheck(this, UnexpectedExportOperationStateError);
|
|
962
|
-
_this = _callSuper$3(this, UnexpectedExportOperationStateError, [
|
|
961
|
+
_this = _callSuper$3(this, UnexpectedExportOperationStateError, ["Unexpected export operation state \"".concat(state, "\"")]);
|
|
963
962
|
_this.name = 'UnexpectedExportOperationStateError';
|
|
964
963
|
return _this;
|
|
965
964
|
}
|
|
@@ -973,7 +972,7 @@ let UnexpectedResourceTypeError = /*#__PURE__*/function (_Error) {
|
|
|
973
972
|
function UnexpectedResourceTypeError(resourceType) {
|
|
974
973
|
var _this;
|
|
975
974
|
_classCallCheck(this, UnexpectedResourceTypeError);
|
|
976
|
-
_this = _callSuper$2(this, UnexpectedResourceTypeError, [
|
|
975
|
+
_this = _callSuper$2(this, UnexpectedResourceTypeError, ["Unexpected resource type \"".concat(resourceType, "\"")]);
|
|
977
976
|
_this.name = 'UnexpectedResourceTypeError';
|
|
978
977
|
return _this;
|
|
979
978
|
}
|
|
@@ -1020,7 +1019,7 @@ function useExportResourcesModalContext() {
|
|
|
1020
1019
|
}
|
|
1021
1020
|
|
|
1022
1021
|
function ownKeys$e(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; }
|
|
1023
|
-
function _objectSpread$e(e) { for (var r = 1; r < arguments.length; r++) { var
|
|
1022
|
+
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(_context4 = ownKeys$e(Object(t), !0)).call(_context4, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context5 = ownKeys$e(Object(t))).call(_context5, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
1024
1023
|
const defaultOptions = {
|
|
1025
1024
|
storageType: 'local',
|
|
1026
1025
|
segregateByUser: true
|
|
@@ -1030,7 +1029,7 @@ const safeParse = value => {
|
|
|
1030
1029
|
if (value === null) return value;
|
|
1031
1030
|
try {
|
|
1032
1031
|
return JSON.parse(value);
|
|
1033
|
-
} catch {
|
|
1032
|
+
} catch (_unused) {
|
|
1034
1033
|
return value;
|
|
1035
1034
|
}
|
|
1036
1035
|
};
|
|
@@ -1054,7 +1053,10 @@ const clearStaleExportModalEntries = (storage, currentKey) => {
|
|
|
1054
1053
|
const useStorage = (storageKey, initialStorageValue, options) => {
|
|
1055
1054
|
var _context;
|
|
1056
1055
|
const mergedOptions = _objectSpread$e(_objectSpread$e({}, defaultOptions), options);
|
|
1057
|
-
const userId = useApplicationContext(context =>
|
|
1056
|
+
const userId = useApplicationContext(context => {
|
|
1057
|
+
var _context$user;
|
|
1058
|
+
return (_context$user = context.user) === null || _context$user === void 0 ? void 0 : _context$user.id;
|
|
1059
|
+
});
|
|
1058
1060
|
const scopedStorageKey = _filterInstanceProperty(_context = [mergedOptions.segregateByUser && userId, storageKey]).call(_context, Boolean).join('/');
|
|
1059
1061
|
const readFromStorage = useCallback(() => {
|
|
1060
1062
|
const rawStorageValue = getStorage(mergedOptions.storageType).getItem(scopedStorageKey);
|
|
@@ -1073,8 +1075,9 @@ const useStorage = (storageKey, initialStorageValue, options) => {
|
|
|
1073
1075
|
return parsedStorageValue;
|
|
1074
1076
|
}, [mergedOptions.storageType, scopedStorageKey]);
|
|
1075
1077
|
const initializeStorageValue = () => {
|
|
1078
|
+
var _ref, _readFromStorage;
|
|
1076
1079
|
// default the storage value to the initial provided value when provided
|
|
1077
|
-
return readFromStorage()
|
|
1080
|
+
return (_ref = (_readFromStorage = readFromStorage()) !== null && _readFromStorage !== void 0 ? _readFromStorage : initialStorageValue) !== null && _ref !== void 0 ? _ref : null;
|
|
1078
1081
|
};
|
|
1079
1082
|
const _useState = useState(initializeStorageValue),
|
|
1080
1083
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -1094,14 +1097,16 @@ const useStorage = (storageKey, initialStorageValue, options) => {
|
|
|
1094
1097
|
storage.setItem(scopedStorageKey, serializedValue);
|
|
1095
1098
|
writeSucceeded = true;
|
|
1096
1099
|
} catch (retryError) {
|
|
1097
|
-
|
|
1100
|
+
var _context2;
|
|
1101
|
+
reportErrorToSentry(new Error(_concatInstanceProperty(_context2 = "Failed to persist \"".concat(scopedStorageKey, "\" to ")).call(_context2, mergedOptions.storageType, "Storage after cleanup. The selection will not be remembered for future sessions.")), {
|
|
1098
1102
|
extra: {
|
|
1099
1103
|
error: retryError
|
|
1100
1104
|
}
|
|
1101
1105
|
});
|
|
1102
1106
|
}
|
|
1103
1107
|
} else {
|
|
1104
|
-
|
|
1108
|
+
var _context3;
|
|
1109
|
+
reportErrorToSentry(new Error(_concatInstanceProperty(_context3 = "Failed to persist \"".concat(scopedStorageKey, "\" to ")).call(_context3, mergedOptions.storageType, "Storage. The selection will not be remembered for future sessions.")), {
|
|
1105
1110
|
extra: {
|
|
1106
1111
|
error
|
|
1107
1112
|
}
|
|
@@ -1126,7 +1131,7 @@ const useStorage = (storageKey, initialStorageValue, options) => {
|
|
|
1126
1131
|
};
|
|
1127
1132
|
|
|
1128
1133
|
function resourceTypeToFileName(resourceType, locale) {
|
|
1129
|
-
var _context;
|
|
1134
|
+
var _context, _context2, _context3, _context4;
|
|
1130
1135
|
const date = new Date();
|
|
1131
1136
|
const dateFormatter = new Intl.DateTimeFormat(locale, {
|
|
1132
1137
|
year: '2-digit',
|
|
@@ -1144,7 +1149,7 @@ function resourceTypeToFileName(resourceType, locale) {
|
|
|
1144
1149
|
return acc;
|
|
1145
1150
|
}, {});
|
|
1146
1151
|
const orderedDateParts = _mapInstanceProperty(_context = _filterInstanceProperty(parts).call(parts, part => part.type === 'day' || part.type === 'month' || part.type === 'year')).call(_context, part => dateParts[part.type]).join('-');
|
|
1147
|
-
const formattedDate =
|
|
1152
|
+
const formattedDate = _concatInstanceProperty(_context2 = _concatInstanceProperty(_context3 = "".concat(orderedDateParts, "_")).call(_context3, dateParts.hour, "-")).call(_context2, dateParts.minute);
|
|
1148
1153
|
const resourceTypeMap = {
|
|
1149
1154
|
[EXPORTABLE_RESOURCES.CATEGORY]: 'Categories',
|
|
1150
1155
|
[EXPORTABLE_RESOURCES.PRODUCT]: 'Products',
|
|
@@ -1161,7 +1166,7 @@ function resourceTypeToFileName(resourceType, locale) {
|
|
|
1161
1166
|
if (!displayName) {
|
|
1162
1167
|
throw new UnexpectedResourceTypeError(resourceType);
|
|
1163
1168
|
}
|
|
1164
|
-
return
|
|
1169
|
+
return _concatInstanceProperty(_context4 = "".concat(displayName, "_Export_")).call(_context4, formattedDate);
|
|
1165
1170
|
}
|
|
1166
1171
|
function mapLocalesToOptions(locales) {
|
|
1167
1172
|
return _mapInstanceProperty(locales).call(locales, locale => ({
|
|
@@ -1198,9 +1203,9 @@ function sortFieldsByFieldOrder(_ref) {
|
|
|
1198
1203
|
return fieldNames;
|
|
1199
1204
|
}
|
|
1200
1205
|
function buildSelectedExportFilters(selectedResourceIds) {
|
|
1201
|
-
if (!selectedResourceIds || selectedResourceIds
|
|
1202
|
-
const formattedIds = _mapInstanceProperty(selectedResourceIds).call(selectedResourceIds, id =>
|
|
1203
|
-
return
|
|
1206
|
+
if (!selectedResourceIds || (selectedResourceIds === null || selectedResourceIds === void 0 ? void 0 : selectedResourceIds.length) === 0) return undefined;
|
|
1207
|
+
const formattedIds = _mapInstanceProperty(selectedResourceIds).call(selectedResourceIds, id => "\"".concat(id, "\"")).join(', ');
|
|
1208
|
+
return "id in (".concat(formattedIds, ")");
|
|
1204
1209
|
}
|
|
1205
1210
|
function isQueryFilter(filters) {
|
|
1206
1211
|
if (!filters) return false;
|
|
@@ -1221,28 +1226,29 @@ function validateFilters(filtersObject) {
|
|
|
1221
1226
|
return Boolean(isQueryFilter(filtersObject.filters) || isSearchFilter(filtersObject.filters) || isPredicateFilter(filtersObject));
|
|
1222
1227
|
}
|
|
1223
1228
|
function areFiltersApplied(filtersObject) {
|
|
1224
|
-
var
|
|
1229
|
+
var _context5;
|
|
1225
1230
|
if (!filtersObject) {
|
|
1226
1231
|
return false;
|
|
1227
1232
|
}
|
|
1228
|
-
if (filtersObject.where && _trimInstanceProperty(
|
|
1233
|
+
if (filtersObject.where && _trimInstanceProperty(_context5 = filtersObject.where).call(_context5) !== '') {
|
|
1229
1234
|
return true;
|
|
1230
1235
|
}
|
|
1231
1236
|
if (isQueryFilter(filtersObject.filters)) {
|
|
1232
1237
|
return Boolean(filtersObject.filters.query);
|
|
1233
1238
|
}
|
|
1234
1239
|
if (isSearchFilter(filtersObject.filters)) {
|
|
1235
|
-
var
|
|
1240
|
+
var _filters$filters, _filters$fullText;
|
|
1236
1241
|
const _filters = filtersObject.filters;
|
|
1237
|
-
return Boolean(_filters.filters
|
|
1242
|
+
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(_filters$fullText).call(_filters$fullText)));
|
|
1238
1243
|
}
|
|
1239
1244
|
return false;
|
|
1240
1245
|
}
|
|
1241
1246
|
function getInitialExportType(args) {
|
|
1242
|
-
|
|
1247
|
+
var _args$selectedResourc, _args$filters;
|
|
1248
|
+
if ((_args$selectedResourc = args.selectedResourceIds) !== null && _args$selectedResourc !== void 0 && _args$selectedResourc.length) {
|
|
1243
1249
|
return EXPORT_TYPES.SELECTED;
|
|
1244
1250
|
}
|
|
1245
|
-
if (args.filters
|
|
1251
|
+
if ((_args$filters = args.filters) !== null && _args$filters !== void 0 && _args$filters.total && areFiltersApplied(args.filters)) {
|
|
1246
1252
|
return EXPORT_TYPES.FILTERED;
|
|
1247
1253
|
}
|
|
1248
1254
|
return EXPORT_TYPES.ALL;
|
|
@@ -1256,7 +1262,7 @@ const isAnyFieldChecked = fields => {
|
|
|
1256
1262
|
};
|
|
1257
1263
|
const hasDependentFields = field => {
|
|
1258
1264
|
var _context;
|
|
1259
|
-
return Boolean(field
|
|
1265
|
+
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(_context = field.fields).call(_context, nestedField => hasDependentFields(nestedField)));
|
|
1260
1266
|
};
|
|
1261
1267
|
const isFieldOrNestedFieldChecked = (field, fieldName) => {
|
|
1262
1268
|
if (field.name === fieldName && field.isChecked) {
|
|
@@ -1274,7 +1280,8 @@ const getIndependentFields = group => {
|
|
|
1274
1280
|
const independentFields = [];
|
|
1275
1281
|
const findIndependentFields = fields => {
|
|
1276
1282
|
_forEachInstanceProperty(fields).call(fields, field => {
|
|
1277
|
-
|
|
1283
|
+
var _field$dependentGroup, _field$dependentField;
|
|
1284
|
+
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)) {
|
|
1278
1285
|
independentFields.push(field);
|
|
1279
1286
|
}
|
|
1280
1287
|
if (field.fields) {
|
|
@@ -1368,11 +1375,12 @@ const extractFieldNamesFromGroups = (groups, fieldOrder) => {
|
|
|
1368
1375
|
let checkedFields = [];
|
|
1369
1376
|
const getCheckedFields = fields => {
|
|
1370
1377
|
return _filterInstanceProperty(fields).call(fields, field => {
|
|
1378
|
+
var _field$isChecked;
|
|
1371
1379
|
if (field.fields) {
|
|
1372
1380
|
return getCheckedFields(field.fields);
|
|
1373
1381
|
}
|
|
1374
1382
|
if (field.isChecked) checkedFields.push(field);
|
|
1375
|
-
return field.isChecked
|
|
1383
|
+
return (_field$isChecked = field.isChecked) !== null && _field$isChecked !== void 0 ? _field$isChecked : false;
|
|
1376
1384
|
});
|
|
1377
1385
|
};
|
|
1378
1386
|
_forEachInstanceProperty(groups).call(groups, group => {
|
|
@@ -1454,7 +1462,7 @@ function isFieldNameValid(header) {
|
|
|
1454
1462
|
}
|
|
1455
1463
|
|
|
1456
1464
|
function ownKeys$d(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; }
|
|
1457
|
-
function _objectSpread$d(e) { for (var r = 1; r < arguments.length; r++) { var
|
|
1465
|
+
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(_context7 = ownKeys$d(Object(t), !0)).call(_context7, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context8 = ownKeys$d(Object(t))).call(_context8, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
1458
1466
|
const updateFieldGroupsWithIsCheckedValue = (groups, cachedSelectedGroups) => {
|
|
1459
1467
|
const updateFields = (fields, isParentChecked, parentFieldPath) => {
|
|
1460
1468
|
return _mapInstanceProperty(fields).call(fields, field => {
|
|
@@ -1462,8 +1470,10 @@ const updateFieldGroupsWithIsCheckedValue = (groups, cachedSelectedGroups) => {
|
|
|
1462
1470
|
if (field.isRequired) {
|
|
1463
1471
|
isChecked = true;
|
|
1464
1472
|
} else {
|
|
1465
|
-
|
|
1466
|
-
|
|
1473
|
+
var _context;
|
|
1474
|
+
if (cachedSelectedGroups[_concatInstanceProperty(_context = "".concat(parentFieldPath, ".")).call(_context, field.name)] !== undefined) {
|
|
1475
|
+
var _context2;
|
|
1476
|
+
isChecked = cachedSelectedGroups[_concatInstanceProperty(_context2 = "".concat(parentFieldPath, ".")).call(_context2, field.name)];
|
|
1467
1477
|
} else if (!hasDependentFields(field) && field.isSelectedByDefault) {
|
|
1468
1478
|
isChecked = true;
|
|
1469
1479
|
} else if (isParentChecked) {
|
|
@@ -1472,7 +1482,8 @@ const updateFieldGroupsWithIsCheckedValue = (groups, cachedSelectedGroups) => {
|
|
|
1472
1482
|
}
|
|
1473
1483
|
let updatedFields = field.fields;
|
|
1474
1484
|
if (field.fields) {
|
|
1475
|
-
|
|
1485
|
+
var _context3;
|
|
1486
|
+
updatedFields = updateFields(field.fields, isChecked, _concatInstanceProperty(_context3 = "".concat(parentFieldPath, ".")).call(_context3, field.name));
|
|
1476
1487
|
isChecked = false;
|
|
1477
1488
|
}
|
|
1478
1489
|
return _objectSpread$d(_objectSpread$d({}, field), {}, {
|
|
@@ -1519,14 +1530,15 @@ const updateFieldGroupWithAdditionalFieldExtensions = groups => {
|
|
|
1519
1530
|
});
|
|
1520
1531
|
};
|
|
1521
1532
|
const getIsExpanded = (field, groupName, cachedExpandedGroups) => {
|
|
1533
|
+
var _context4, _ref, _cachedExpandedGroups;
|
|
1522
1534
|
if (!field.isExpandable) {
|
|
1523
1535
|
return false;
|
|
1524
1536
|
}
|
|
1525
1537
|
if (field.fields && field.maxVisibleChildren && field.fields.length > field.maxVisibleChildren) {
|
|
1526
1538
|
return false;
|
|
1527
1539
|
}
|
|
1528
|
-
const cacheKey =
|
|
1529
|
-
return cachedExpandedGroups[cacheKey]
|
|
1540
|
+
const cacheKey = _concatInstanceProperty(_context4 = "".concat(groupName, ".")).call(_context4, field.name);
|
|
1541
|
+
return (_ref = (_cachedExpandedGroups = cachedExpandedGroups[cacheKey]) !== null && _cachedExpandedGroups !== void 0 ? _cachedExpandedGroups : field.isExpanded) !== null && _ref !== void 0 ? _ref : false;
|
|
1530
1542
|
};
|
|
1531
1543
|
const updateFieldGroupsWithIsExpandedValue = (groups, cachedExpandedGroups) => {
|
|
1532
1544
|
function updateFields(fields, groupName) {
|
|
@@ -1547,28 +1559,33 @@ const updateFieldGroupsWithIsExpandedValue = (groups, cachedExpandedGroups) => {
|
|
|
1547
1559
|
});
|
|
1548
1560
|
}
|
|
1549
1561
|
return _mapInstanceProperty(groups).call(groups, group => {
|
|
1562
|
+
var _ref2, _cachedExpandedGroups2;
|
|
1550
1563
|
const updatedFields = updateFields(group.fields, group.groupName);
|
|
1551
1564
|
return _objectSpread$d(_objectSpread$d({}, group), {}, {
|
|
1552
|
-
isExpanded: cachedExpandedGroups[group.groupName]
|
|
1565
|
+
isExpanded: (_ref2 = (_cachedExpandedGroups2 = cachedExpandedGroups[group.groupName]) !== null && _cachedExpandedGroups2 !== void 0 ? _cachedExpandedGroups2 : group.isExpanded) !== null && _ref2 !== void 0 ? _ref2 : false,
|
|
1553
1566
|
fields: updatedFields
|
|
1554
1567
|
});
|
|
1555
1568
|
});
|
|
1556
1569
|
};
|
|
1557
1570
|
const updateFieldDependenciesStatus = formik => {
|
|
1558
|
-
var
|
|
1571
|
+
var _context6;
|
|
1559
1572
|
const updateFields = (fields, path) => {
|
|
1560
1573
|
_forEachInstanceProperty(fields).call(fields, (field, index) => {
|
|
1561
|
-
|
|
1574
|
+
var _context5;
|
|
1575
|
+
const currentPath = _concatInstanceProperty(_context5 = "".concat(path, ".fields[")).call(_context5, index, "]");
|
|
1562
1576
|
if (hasDependentFields(field)) {
|
|
1563
|
-
|
|
1577
|
+
const nextIsChecked = isAnyDependentChecked(_valuesInstanceProperty(formik).groups, field.dependentGroupNames, field.dependentFieldNames);
|
|
1578
|
+
if (field.isChecked !== nextIsChecked) {
|
|
1579
|
+
formik.setFieldValue("".concat(currentPath, ".isChecked"), nextIsChecked, false);
|
|
1580
|
+
}
|
|
1564
1581
|
}
|
|
1565
1582
|
if (field.fields) {
|
|
1566
1583
|
updateFields(field.fields, currentPath);
|
|
1567
1584
|
}
|
|
1568
1585
|
});
|
|
1569
1586
|
};
|
|
1570
|
-
_forEachInstanceProperty(
|
|
1571
|
-
updateFields(group.fields,
|
|
1587
|
+
_forEachInstanceProperty(_context6 = _valuesInstanceProperty(formik).groups).call(_context6, (group, index) => {
|
|
1588
|
+
updateFields(group.fields, "groups[".concat(index, "]"));
|
|
1572
1589
|
});
|
|
1573
1590
|
};
|
|
1574
1591
|
|
|
@@ -1588,8 +1605,8 @@ const getCsvHeaders = file => {
|
|
|
1588
1605
|
};
|
|
1589
1606
|
reader.onload = e => {
|
|
1590
1607
|
try {
|
|
1591
|
-
var _context, _context2;
|
|
1592
|
-
const text = e.target
|
|
1608
|
+
var _e$target, _context, _context2;
|
|
1609
|
+
const text = (_e$target = e.target) === null || _e$target === void 0 ? void 0 : _e$target.result;
|
|
1593
1610
|
entireFile += text;
|
|
1594
1611
|
const firstLineEnd = _indexOfInstanceProperty(entireFile).call(entireFile, '\n');
|
|
1595
1612
|
if (firstLineEnd === -1 && offset < file.size) {
|
|
@@ -1612,29 +1629,30 @@ const getCsvHeaders = file => {
|
|
|
1612
1629
|
};
|
|
1613
1630
|
|
|
1614
1631
|
function ownKeys$c(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; }
|
|
1615
|
-
function _objectSpread$c(e) { for (var r = 1; r < arguments.length; r++) { var
|
|
1632
|
+
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(_context6 = ownKeys$c(Object(t), !0)).call(_context6, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context7 = ownKeys$c(Object(t))).call(_context7, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
1616
1633
|
function groupFieldValidationErrors(errors, intl) {
|
|
1617
|
-
var
|
|
1634
|
+
var _context3, _context5;
|
|
1618
1635
|
const errorsByCode = _reduceInstanceProperty(errors).call(errors, (groups, error) => {
|
|
1619
|
-
var _context;
|
|
1620
|
-
const groupKey = error.code === 'AttributeLevelMismatch' && error.actualLevel ?
|
|
1636
|
+
var _context, _context2;
|
|
1637
|
+
const groupKey = error.code === 'AttributeLevelMismatch' && error.actualLevel ? _concatInstanceProperty(_context = "".concat(error.code, "-")).call(_context, error.actualLevel) : error.code;
|
|
1621
1638
|
const group = groups[groupKey] || {
|
|
1622
1639
|
code: error.code,
|
|
1623
1640
|
originalErrors: [],
|
|
1624
1641
|
fieldNames: []
|
|
1625
1642
|
};
|
|
1626
|
-
if (error.field && !_includesInstanceProperty(
|
|
1643
|
+
if (error.field && !_includesInstanceProperty(_context2 = group.fieldNames).call(_context2, error.field)) {
|
|
1627
1644
|
group.fieldNames.push(error.field);
|
|
1628
1645
|
}
|
|
1629
1646
|
group.originalErrors.push(error);
|
|
1630
1647
|
groups[groupKey] = group;
|
|
1631
1648
|
return groups;
|
|
1632
1649
|
}, {});
|
|
1633
|
-
_forEachInstanceProperty(
|
|
1634
|
-
var
|
|
1635
|
-
_sortInstanceProperty(
|
|
1650
|
+
_forEachInstanceProperty(_context3 = _Object$values(errorsByCode)).call(_context3, group => {
|
|
1651
|
+
var _context4;
|
|
1652
|
+
_sortInstanceProperty(_context4 = group.fieldNames).call(_context4);
|
|
1636
1653
|
});
|
|
1637
|
-
return _mapInstanceProperty(
|
|
1654
|
+
return _mapInstanceProperty(_context5 = _Object$values(errorsByCode)).call(_context5, group => {
|
|
1655
|
+
var _group$originalErrors;
|
|
1638
1656
|
let messageTitle;
|
|
1639
1657
|
switch (group.code) {
|
|
1640
1658
|
case 'NotSupportedField':
|
|
@@ -1658,21 +1676,21 @@ function groupFieldValidationErrors(errors, intl) {
|
|
|
1658
1676
|
case 'AttributeLevelMismatch':
|
|
1659
1677
|
{
|
|
1660
1678
|
const referenceError = group.originalErrors[0];
|
|
1661
|
-
if (referenceError
|
|
1679
|
+
if ((referenceError === null || referenceError === void 0 ? void 0 : referenceError.actualLevel) === 'Product') {
|
|
1662
1680
|
messageTitle = intl.formatMessage(messages.attributeLevelMismatchProductLevelTitle, {
|
|
1663
1681
|
b: getSmallBold
|
|
1664
1682
|
});
|
|
1665
|
-
} else if (referenceError
|
|
1683
|
+
} else if ((referenceError === null || referenceError === void 0 ? void 0 : referenceError.actualLevel) === 'Variant') {
|
|
1666
1684
|
messageTitle = intl.formatMessage(messages.attributeLevelMismatchVariantLevelTitle, {
|
|
1667
1685
|
b: getSmallBold
|
|
1668
1686
|
});
|
|
1669
1687
|
} else {
|
|
1670
|
-
messageTitle = referenceError
|
|
1688
|
+
messageTitle = (referenceError === null || referenceError === void 0 ? void 0 : referenceError.message) || intl.formatMessage(messages.unknownError);
|
|
1671
1689
|
}
|
|
1672
1690
|
break;
|
|
1673
1691
|
}
|
|
1674
1692
|
default:
|
|
1675
|
-
messageTitle = group.originalErrors[0]
|
|
1693
|
+
messageTitle = ((_group$originalErrors = group.originalErrors[0]) === null || _group$originalErrors === void 0 ? void 0 : _group$originalErrors.message) || intl.formatMessage(messages.unknownError);
|
|
1676
1694
|
}
|
|
1677
1695
|
return _objectSpread$c(_objectSpread$c({}, group), {}, {
|
|
1678
1696
|
messageTitle
|
|
@@ -1692,22 +1710,28 @@ function isExportApiErrorResponse(error) {
|
|
|
1692
1710
|
}
|
|
1693
1711
|
|
|
1694
1712
|
const useInitialValues = props => {
|
|
1695
|
-
var _context;
|
|
1696
|
-
const _useApplicationContex = useApplicationContext(applicationContext =>
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1713
|
+
var _context, _context2, _context3;
|
|
1714
|
+
const _useApplicationContex = useApplicationContext(applicationContext => {
|
|
1715
|
+
var _applicationContext$u;
|
|
1716
|
+
return {
|
|
1717
|
+
locale: applicationContext.dataLocale,
|
|
1718
|
+
userLocale: (_applicationContext$u = applicationContext.user) === null || _applicationContext$u === void 0 ? void 0 : _applicationContext$u.locale
|
|
1719
|
+
};
|
|
1720
|
+
}),
|
|
1700
1721
|
locale = _useApplicationContex.locale,
|
|
1701
1722
|
userLocale = _useApplicationContex.userLocale;
|
|
1702
|
-
const _useApplicationContex2 = useApplicationContext(context =>
|
|
1703
|
-
|
|
1704
|
-
|
|
1723
|
+
const _useApplicationContex2 = useApplicationContext(context => {
|
|
1724
|
+
var _context$project;
|
|
1725
|
+
return {
|
|
1726
|
+
projectKey: (_context$project = context.project) === null || _context$project === void 0 ? void 0 : _context$project.key
|
|
1727
|
+
};
|
|
1728
|
+
}),
|
|
1705
1729
|
projectKey = _useApplicationContex2.projectKey;
|
|
1706
|
-
const _useStorage = useStorage(
|
|
1730
|
+
const _useStorage = useStorage(_concatInstanceProperty(_context = "".concat(projectKey, "/")).call(_context, OPERATIONS_EXPORT_RESOURCES_MODAL_SELECTION), {}),
|
|
1707
1731
|
_useStorage2 = _slicedToArray(_useStorage, 1),
|
|
1708
1732
|
cachedSelectedGroups = _useStorage2[0];
|
|
1709
|
-
const _useStorage3 = useStorage(
|
|
1710
|
-
[props.resourceType]: _reduceInstanceProperty(
|
|
1733
|
+
const _useStorage3 = useStorage(_concatInstanceProperty(_context2 = "".concat(projectKey, "/")).call(_context2, OPERATIONS_EXPORT_RESOURCES_MODAL_EXPANDED_GROUP), {
|
|
1734
|
+
[props.resourceType]: _reduceInstanceProperty(_context3 = props.fieldGroups).call(_context3, (acc, group) => {
|
|
1711
1735
|
acc[group.groupName] = group.isExpanded;
|
|
1712
1736
|
return acc;
|
|
1713
1737
|
}, {})
|
|
@@ -1716,10 +1740,10 @@ const useInitialValues = props => {
|
|
|
1716
1740
|
cachedExpandedGroups = _useStorage4[0];
|
|
1717
1741
|
return React.useMemo(() => {
|
|
1718
1742
|
let groups = removeEmptyGroups(props.fieldGroups);
|
|
1719
|
-
groups = updateFieldGroupsWithIsCheckedValue(groups, cachedSelectedGroups
|
|
1720
|
-
groups = updateFieldGroupsWithIsExpandedValue(groups, cachedExpandedGroups
|
|
1743
|
+
groups = updateFieldGroupsWithIsCheckedValue(groups, (cachedSelectedGroups === null || cachedSelectedGroups === void 0 ? void 0 : cachedSelectedGroups[props.resourceType]) || {});
|
|
1744
|
+
groups = updateFieldGroupsWithIsExpandedValue(groups, (cachedExpandedGroups === null || cachedExpandedGroups === void 0 ? void 0 : cachedExpandedGroups[props.resourceType]) || {});
|
|
1721
1745
|
return {
|
|
1722
|
-
fileName:
|
|
1746
|
+
fileName: "".concat(resourceTypeToFileName(props.resourceType, userLocale)),
|
|
1723
1747
|
locales: [locale],
|
|
1724
1748
|
groups: updateFieldGroupWithAdditionalFieldExtensions(groups),
|
|
1725
1749
|
queryPredicate: '',
|
|
@@ -1739,7 +1763,7 @@ function _objectSpread$b(e) { for (var r = 1; r < arguments.length; r++) { var _
|
|
|
1739
1763
|
async function makeExportRequest(params, asyncDispatchFn) {
|
|
1740
1764
|
const projectKey = params.projectKey,
|
|
1741
1765
|
requestData = _objectWithoutProperties(params, _excluded$3);
|
|
1742
|
-
const uri =
|
|
1766
|
+
const uri = "/".concat(projectKey, "/export-operations");
|
|
1743
1767
|
const requestAction = actions.post({
|
|
1744
1768
|
mcApiProxyTarget: MC_API_PROXY_TARGETS.EXPORT,
|
|
1745
1769
|
uri,
|
|
@@ -1770,22 +1794,27 @@ function validateExportOperation(params, asyncDispatchFn) {
|
|
|
1770
1794
|
}
|
|
1771
1795
|
|
|
1772
1796
|
const mergeWhereClause = (base, user) => {
|
|
1797
|
+
var _context;
|
|
1773
1798
|
if (!base && !user) return undefined;
|
|
1774
1799
|
if (base && !user) return base;
|
|
1775
1800
|
if (!base && user) return user;
|
|
1776
|
-
return
|
|
1801
|
+
return _concatInstanceProperty(_context = "(".concat(base, ") and (")).call(_context, user, ")");
|
|
1777
1802
|
};
|
|
1778
1803
|
const useStartExportOperation = props => {
|
|
1779
1804
|
const intl = useIntl();
|
|
1780
1805
|
const asyncDispatch = useAsyncDispatch();
|
|
1781
1806
|
const showNotification = useShowNotification();
|
|
1782
|
-
const _useApplicationContex = useApplicationContext(applicationContext =>
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1807
|
+
const _useApplicationContex = useApplicationContext(applicationContext => {
|
|
1808
|
+
var _applicationContext$p;
|
|
1809
|
+
return {
|
|
1810
|
+
locale: applicationContext.dataLocale,
|
|
1811
|
+
projectKey: (_applicationContext$p = applicationContext.project) === null || _applicationContext$p === void 0 ? void 0 : _applicationContext$p.key
|
|
1812
|
+
};
|
|
1813
|
+
}),
|
|
1786
1814
|
projectKey = _useApplicationContex.projectKey;
|
|
1787
1815
|
const startExportOperation = async (values, exportType, fieldSelectionMode, localeOption, importedHeaders, selectedStoreKey) => {
|
|
1788
1816
|
try {
|
|
1817
|
+
var _props$selectedResour, _props$baseFilters;
|
|
1789
1818
|
if (!projectKey) throw new Error('Project key is missing');
|
|
1790
1819
|
let fields = [];
|
|
1791
1820
|
if (fieldSelectionMode === 'imported-csv-template' && values.importedCsvTemplateFile) {
|
|
@@ -1795,7 +1824,7 @@ const useStartExportOperation = props => {
|
|
|
1795
1824
|
}
|
|
1796
1825
|
let where = undefined;
|
|
1797
1826
|
let filters = undefined;
|
|
1798
|
-
if (exportType === EXPORT_TYPES.SELECTED && props.selectedResourceIds
|
|
1827
|
+
if (exportType === EXPORT_TYPES.SELECTED && (_props$selectedResour = props.selectedResourceIds) !== null && _props$selectedResour !== void 0 && _props$selectedResour.length) {
|
|
1799
1828
|
where = props.selectedScopeQueryPredicateBuilder ? props.selectedScopeQueryPredicateBuilder(props.selectedResourceIds) : buildSelectedExportFilters(props.selectedResourceIds);
|
|
1800
1829
|
} else if (exportType === EXPORT_TYPES.FILTERED && props.filters) {
|
|
1801
1830
|
where = props.filters.where;
|
|
@@ -1805,12 +1834,12 @@ const useStartExportOperation = props => {
|
|
|
1805
1834
|
filters = props.filters.filters;
|
|
1806
1835
|
}
|
|
1807
1836
|
} else if (exportType === EXPORT_TYPES.QUERY_PREDICATE) {
|
|
1808
|
-
var
|
|
1809
|
-
where = _trimInstanceProperty(
|
|
1837
|
+
var _context2;
|
|
1838
|
+
where = _trimInstanceProperty(_context2 = values.queryPredicate).call(_context2);
|
|
1810
1839
|
} else if (exportType === EXPORT_TYPES.SPECIFIC_STORE) {
|
|
1811
|
-
where =
|
|
1840
|
+
where = "store(key=\"".concat(selectedStoreKey, "\")");
|
|
1812
1841
|
}
|
|
1813
|
-
where = mergeWhereClause(props.baseFilters
|
|
1842
|
+
where = mergeWhereClause((_props$baseFilters = props.baseFilters) === null || _props$baseFilters === void 0 ? void 0 : _props$baseFilters.where, where);
|
|
1814
1843
|
let locales = undefined;
|
|
1815
1844
|
if (localeOption !== 'onlyLocalesFoundInCsvFile') {
|
|
1816
1845
|
locales = values.locales;
|
|
@@ -1887,7 +1916,7 @@ const useStartExportOperation = props => {
|
|
|
1887
1916
|
|
|
1888
1917
|
const _excluded$2 = ["fields"];
|
|
1889
1918
|
function ownKeys$a(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; }
|
|
1890
|
-
function _objectSpread$a(e) { for (var r = 1; r < arguments.length; r++) { var
|
|
1919
|
+
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(_context2 = ownKeys$a(Object(t), !0)).call(_context2, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context3 = ownKeys$a(Object(t))).call(_context3, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
1891
1920
|
const getFieldFullName = _ref => {
|
|
1892
1921
|
var _context;
|
|
1893
1922
|
let fieldPrefix = _ref.fieldPrefix,
|
|
@@ -1897,7 +1926,6 @@ const getFieldFullName = _ref => {
|
|
|
1897
1926
|
const localizeTypeDefinitionLabels = function () {
|
|
1898
1927
|
let fieldDefinitions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
1899
1928
|
return _mapInstanceProperty(fieldDefinitions).call(fieldDefinitions, _ref2 => {
|
|
1900
|
-
var _context2, _context3;
|
|
1901
1929
|
let fields = _ref2.fields,
|
|
1902
1930
|
fieldsType = _objectWithoutProperties(_ref2, _excluded$2);
|
|
1903
1931
|
const isFieldTypeLabelLocalized = _Array$isArray(fieldsType.label);
|
|
@@ -1907,7 +1935,7 @@ const localizeTypeDefinitionLabels = function () {
|
|
|
1907
1935
|
from: 'label',
|
|
1908
1936
|
to: 'label'
|
|
1909
1937
|
}]).label : fieldsType.label,
|
|
1910
|
-
fields: (
|
|
1938
|
+
fields: (fields === null || fields === void 0 ? void 0 : _mapInstanceProperty(fields).call(fields, field => {
|
|
1911
1939
|
const isFieldLabelLocalized = _Array$isArray(field.label);
|
|
1912
1940
|
if (!isFieldLabelLocalized) {
|
|
1913
1941
|
return field;
|
|
@@ -1916,22 +1944,26 @@ const localizeTypeDefinitionLabels = function () {
|
|
|
1916
1944
|
from: 'label',
|
|
1917
1945
|
to: 'label'
|
|
1918
1946
|
}]));
|
|
1919
|
-
}) || []
|
|
1947
|
+
})) || []
|
|
1920
1948
|
};
|
|
1921
1949
|
});
|
|
1922
1950
|
};
|
|
1923
1951
|
const useConvertFieldDefinitionsForExport = () => {
|
|
1924
|
-
const _useApplicationContex = useApplicationContext(applicationContext =>
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1952
|
+
const _useApplicationContex = useApplicationContext(applicationContext => {
|
|
1953
|
+
var _applicationContext$p;
|
|
1954
|
+
return {
|
|
1955
|
+
language: applicationContext.dataLocale,
|
|
1956
|
+
languages: (_applicationContext$p = applicationContext.project) === null || _applicationContext$p === void 0 ? void 0 : _applicationContext$p.languages
|
|
1957
|
+
};
|
|
1958
|
+
}),
|
|
1928
1959
|
language = _useApplicationContex.language,
|
|
1929
1960
|
languages = _useApplicationContex.languages;
|
|
1930
1961
|
const sortByField = (fields, fieldName) => {
|
|
1931
1962
|
if (!fields) return [];
|
|
1932
1963
|
if (fieldName) {
|
|
1933
1964
|
return sortBy(fields, field => {
|
|
1934
|
-
|
|
1965
|
+
var _field$fieldName;
|
|
1966
|
+
return (_field$fieldName = field[fieldName]) === null || _field$fieldName === void 0 ? void 0 : _field$fieldName.toLowerCase();
|
|
1935
1967
|
});
|
|
1936
1968
|
}
|
|
1937
1969
|
return fields;
|
|
@@ -1945,7 +1977,7 @@ const useConvertFieldDefinitionsForExport = () => {
|
|
|
1945
1977
|
if (!fieldDefinitions) return [];
|
|
1946
1978
|
const localizedTypeDefinitions = localizeTypeDefinitionLabels(fieldDefinitions);
|
|
1947
1979
|
const results = _mapInstanceProperty(localizedTypeDefinitions).call(localizedTypeDefinitions, transformedType => {
|
|
1948
|
-
var
|
|
1980
|
+
var _transformedType$fiel;
|
|
1949
1981
|
const isTypeLabelLocalized = typeof transformedType.label !== 'string';
|
|
1950
1982
|
return {
|
|
1951
1983
|
isExpandable: true,
|
|
@@ -1959,7 +1991,7 @@ const useConvertFieldDefinitionsForExport = () => {
|
|
|
1959
1991
|
fallbackOrder: languages,
|
|
1960
1992
|
fallback: transformedType.name
|
|
1961
1993
|
}) : transformedType.label,
|
|
1962
|
-
fields: sortByField((
|
|
1994
|
+
fields: sortByField((_transformedType$fiel = transformedType.fields) === null || _transformedType$fiel === void 0 ? void 0 : _mapInstanceProperty(_transformedType$fiel).call(_transformedType$fiel, fieldDefinition => {
|
|
1963
1995
|
const isFieldLabelLocalized = typeof fieldDefinition.label !== 'string';
|
|
1964
1996
|
return {
|
|
1965
1997
|
name: getFieldFullName({
|
|
@@ -1990,13 +2022,16 @@ const useValidateExportOperation = () => {
|
|
|
1990
2022
|
const intl = useIntl();
|
|
1991
2023
|
const asyncDispatch = useAsyncDispatch();
|
|
1992
2024
|
const showNotification = useShowNotification();
|
|
1993
|
-
const _useApplicationContex = useApplicationContext(context =>
|
|
1994
|
-
|
|
1995
|
-
|
|
2025
|
+
const _useApplicationContex = useApplicationContext(context => {
|
|
2026
|
+
var _context$project;
|
|
2027
|
+
return {
|
|
2028
|
+
projectKey: (_context$project = context.project) === null || _context$project === void 0 ? void 0 : _context$project.key
|
|
2029
|
+
};
|
|
2030
|
+
}),
|
|
1996
2031
|
projectKey = _useApplicationContex.projectKey;
|
|
1997
2032
|
const validateExport = async params => {
|
|
1998
2033
|
try {
|
|
1999
|
-
var _context,
|
|
2034
|
+
var _context, _params$queryPredicat;
|
|
2000
2035
|
if (!projectKey) return;
|
|
2001
2036
|
const invalidFields = _filterInstanceProperty(_context = params.fields).call(_context, field => !isFieldNameValid(field));
|
|
2002
2037
|
if (invalidFields.length > 0) {
|
|
@@ -2015,7 +2050,7 @@ const useValidateExportOperation = () => {
|
|
|
2015
2050
|
fileFormat: params.outputFormat,
|
|
2016
2051
|
fields: params.fields,
|
|
2017
2052
|
locales: params.locales,
|
|
2018
|
-
where: ((
|
|
2053
|
+
where: ((_params$queryPredicat = params.queryPredicate) === null || _params$queryPredicat === void 0 ? void 0 : _trimInstanceProperty(_params$queryPredicat).call(_params$queryPredicat)) || undefined
|
|
2019
2054
|
}, asyncDispatch);
|
|
2020
2055
|
if (isExportApiSuccessResponse(response) && response.resourceCount === 0) {
|
|
2021
2056
|
return {
|
|
@@ -2028,11 +2063,12 @@ const useValidateExportOperation = () => {
|
|
|
2028
2063
|
};
|
|
2029
2064
|
} catch (error) {
|
|
2030
2065
|
if (isExportApiErrorResponse(error)) {
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2066
|
+
var _error$body$errors, _error$body$validatio;
|
|
2067
|
+
if ((_error$body$errors = error.body.errors) !== null && _error$body$errors !== void 0 && _error$body$errors.length) {
|
|
2068
|
+
var _context2;
|
|
2069
|
+
const whereError = _findInstanceProperty(_context2 = error.body.errors).call(_context2, error => {
|
|
2070
|
+
var _context3;
|
|
2071
|
+
return error.message && _includesInstanceProperty(_context3 = error.message).call(_context3, 'Malformed parameter: where');
|
|
2036
2072
|
});
|
|
2037
2073
|
if (whereError) {
|
|
2038
2074
|
return {
|
|
@@ -2041,7 +2077,7 @@ const useValidateExportOperation = () => {
|
|
|
2041
2077
|
};
|
|
2042
2078
|
}
|
|
2043
2079
|
}
|
|
2044
|
-
if (error.body.validationErrors
|
|
2080
|
+
if ((_error$body$validatio = error.body.validationErrors) !== null && _error$body$validatio !== void 0 && _error$body$validatio.length) {
|
|
2045
2081
|
return {
|
|
2046
2082
|
success: false,
|
|
2047
2083
|
validationErrors: error.body.validationErrors
|
|
@@ -2219,10 +2255,10 @@ function ExportScopeSection() {
|
|
|
2219
2255
|
})
|
|
2220
2256
|
}), !hideExportSelectedResourcesOption && jsx(RadioInput.Option, {
|
|
2221
2257
|
value: EXPORT_TYPES.SELECTED,
|
|
2222
|
-
isDisabled: !selectedResourceIds
|
|
2258
|
+
isDisabled: !(selectedResourceIds !== null && selectedResourceIds !== void 0 && selectedResourceIds.length),
|
|
2223
2259
|
children: jsx(Text.Body, {
|
|
2224
|
-
tone: !selectedResourceIds
|
|
2225
|
-
intlMessage: selectedResourceIds
|
|
2260
|
+
tone: !(selectedResourceIds !== null && selectedResourceIds !== void 0 && selectedResourceIds.length) ? 'tertiary' : undefined,
|
|
2261
|
+
intlMessage: selectedResourceIds !== null && selectedResourceIds !== void 0 && selectedResourceIds.length ? _objectSpread$8(_objectSpread$8({}, resourceTypeMessages[resourceType].exportScopeSelected), {}, {
|
|
2226
2262
|
values: {
|
|
2227
2263
|
total: selectedResourceIds.length
|
|
2228
2264
|
}
|
|
@@ -2267,6 +2303,7 @@ function ExportScopeSection() {
|
|
|
2267
2303
|
}
|
|
2268
2304
|
|
|
2269
2305
|
const ExportFileSettingsStep = () => {
|
|
2306
|
+
var _context, _context2, _context3;
|
|
2270
2307
|
const intl = useIntl();
|
|
2271
2308
|
const _useExportResourcesMo = useExportResourcesModalContext(),
|
|
2272
2309
|
formik = _useExportResourcesMo.formik,
|
|
@@ -2287,13 +2324,13 @@ const ExportFileSettingsStep = () => {
|
|
|
2287
2324
|
const shouldShowPreferences = _valuesInstanceProperty(formik).outputFormat === 'csv';
|
|
2288
2325
|
return jsx(FormDialog, {
|
|
2289
2326
|
isOpen: true,
|
|
2290
|
-
title:
|
|
2327
|
+
title: _concatInstanceProperty(_context = "".concat(intl.formatMessage(messages.stepCount, {
|
|
2291
2328
|
currentStep: 1,
|
|
2292
2329
|
totalSteps: TOTAL_STEPS
|
|
2293
|
-
})
|
|
2294
|
-
labelPrimary:
|
|
2330
|
+
}), ": ")).call(_context, intl.formatMessage(messages["modalTitle.".concat(resourceType)])),
|
|
2331
|
+
labelPrimary: _concatInstanceProperty(_context2 = "".concat(intl.formatMessage(messages.stepNumber, {
|
|
2295
2332
|
stepNumber: 2
|
|
2296
|
-
})
|
|
2333
|
+
}), ": ")).call(_context2, intl.formatMessage(messages.selectContentToExport)),
|
|
2297
2334
|
iconLeftPrimaryButton: jsx(AngleRightIcon, {}),
|
|
2298
2335
|
onPrimaryButtonClick: formik.submitForm,
|
|
2299
2336
|
isPrimaryButtonDisabled: !formik.isValid || isStoreSelectionMissing,
|
|
@@ -2303,7 +2340,7 @@ const ExportFileSettingsStep = () => {
|
|
|
2303
2340
|
children: jsx(Masking.Unmask, {
|
|
2304
2341
|
children: jsxs(Grid, {
|
|
2305
2342
|
gridRowGap: designTokens.spacingXl,
|
|
2306
|
-
gridTemplateColumns:
|
|
2343
|
+
gridTemplateColumns: _concatInstanceProperty(_context3 = "calc(".concat(designTokens.constraint3, " + ")).call(_context3, designTokens.spacingL, ") auto"),
|
|
2307
2344
|
children: [jsx(Grid.Item, {
|
|
2308
2345
|
children: jsx(Text.Body, {
|
|
2309
2346
|
intlMessage: messages.scope
|
|
@@ -2360,10 +2397,13 @@ const ExportLocaleSelectField = () => {
|
|
|
2360
2397
|
fieldSelectionMode = _useExportResourcesMo.fieldSelectionMode,
|
|
2361
2398
|
localeOption = _useExportResourcesMo.localeOption,
|
|
2362
2399
|
setLocaleOption = _useExportResourcesMo.setLocaleOption;
|
|
2363
|
-
const _useApplicationContex = useApplicationContext(applicationContext =>
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
|
|
2400
|
+
const _useApplicationContex = useApplicationContext(applicationContext => {
|
|
2401
|
+
var _applicationContext$p;
|
|
2402
|
+
return {
|
|
2403
|
+
locale: applicationContext.dataLocale,
|
|
2404
|
+
locales: ((_applicationContext$p = applicationContext.project) === null || _applicationContext$p === void 0 ? void 0 : _applicationContext$p.languages) || []
|
|
2405
|
+
};
|
|
2406
|
+
}),
|
|
2367
2407
|
locales = _useApplicationContex.locales,
|
|
2368
2408
|
locale = _useApplicationContex.locale;
|
|
2369
2409
|
const isOnlyLocalesFoundInCsvFileOptionDisabled = React.useMemo(() => {
|
|
@@ -2469,25 +2509,29 @@ const ImportedCsvTemplateFieldsForm = () => {
|
|
|
2469
2509
|
};
|
|
2470
2510
|
|
|
2471
2511
|
function ownKeys$6(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; }
|
|
2472
|
-
function _objectSpread$6(e) { for (var r = 1; r < arguments.length; r++) { var
|
|
2512
|
+
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(_context2 = ownKeys$6(Object(t), !0)).call(_context2, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context3 = ownKeys$6(Object(t))).call(_context3, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
2473
2513
|
const exportFieldSelectionContextDefaultValues = {
|
|
2474
2514
|
updateExpandedGroups: (_name, _value) => {}
|
|
2475
2515
|
};
|
|
2476
2516
|
const ExportFieldSelectionContext = /*#__PURE__*/createContext(exportFieldSelectionContextDefaultValues);
|
|
2477
2517
|
const ExportFieldSelectionProvider = _ref => {
|
|
2518
|
+
var _context;
|
|
2478
2519
|
let resourceType = _ref.resourceType,
|
|
2479
2520
|
children = _ref.children;
|
|
2480
|
-
const _useApplicationContex = useApplicationContext(context =>
|
|
2481
|
-
|
|
2482
|
-
|
|
2521
|
+
const _useApplicationContex = useApplicationContext(context => {
|
|
2522
|
+
var _context$project;
|
|
2523
|
+
return {
|
|
2524
|
+
projectKey: (_context$project = context.project) === null || _context$project === void 0 ? void 0 : _context$project.key
|
|
2525
|
+
};
|
|
2526
|
+
}),
|
|
2483
2527
|
projectKey = _useApplicationContex.projectKey;
|
|
2484
|
-
const _useStorage = useStorage(
|
|
2528
|
+
const _useStorage = useStorage(_concatInstanceProperty(_context = "".concat(projectKey, "/")).call(_context, OPERATIONS_EXPORT_RESOURCES_MODAL_EXPANDED_GROUP), {}),
|
|
2485
2529
|
_useStorage2 = _slicedToArray(_useStorage, 2),
|
|
2486
2530
|
cachedExpandedGroups = _useStorage2[0],
|
|
2487
2531
|
setCachedExpandedGroups = _useStorage2[1];
|
|
2488
2532
|
const updateExpandedGroups = useCallback((name, value) => {
|
|
2489
2533
|
setCachedExpandedGroups(_objectSpread$6(_objectSpread$6({}, cachedExpandedGroups), {}, {
|
|
2490
|
-
[resourceType]: _objectSpread$6(_objectSpread$6({}, cachedExpandedGroups
|
|
2534
|
+
[resourceType]: _objectSpread$6(_objectSpread$6({}, (cachedExpandedGroups === null || cachedExpandedGroups === void 0 ? void 0 : cachedExpandedGroups[resourceType]) || {}), {}, {
|
|
2491
2535
|
[name]: value
|
|
2492
2536
|
})
|
|
2493
2537
|
}));
|
|
@@ -2546,7 +2590,7 @@ const CollapsibleFieldWrapper = _ref => {
|
|
|
2546
2590
|
registerContentNode
|
|
2547
2591
|
});
|
|
2548
2592
|
}
|
|
2549
|
-
},
|
|
2593
|
+
}, "".concat(isForceExpanded));
|
|
2550
2594
|
return children({
|
|
2551
2595
|
isOpen: true,
|
|
2552
2596
|
toggle: () => {},
|
|
@@ -2554,7 +2598,6 @@ const CollapsibleFieldWrapper = _ref => {
|
|
|
2554
2598
|
});
|
|
2555
2599
|
};
|
|
2556
2600
|
const FieldSection = _ref3 => {
|
|
2557
|
-
var _context, _context2, _context7, _context8;
|
|
2558
2601
|
let fields = _ref3.fields,
|
|
2559
2602
|
parentKeys = _ref3.parentKeys,
|
|
2560
2603
|
formik = _ref3.formik,
|
|
@@ -2564,11 +2607,11 @@ const FieldSection = _ref3 => {
|
|
|
2564
2607
|
maxVisibleChildren = _ref3.maxVisibleChildren;
|
|
2565
2608
|
const _useExportFieldSelect = useExportFieldSelectionContext(),
|
|
2566
2609
|
updateExpandedGroups = _useExportFieldSelect.updateExpandedGroups;
|
|
2567
|
-
const visibleFields = isSearchActive || !maxVisibleChildren ? fields :
|
|
2610
|
+
const visibleFields = isSearchActive || !maxVisibleChildren ? fields : fields === null || fields === void 0 ? void 0 : _sliceInstanceProperty(fields).call(fields, 0, maxVisibleChildren);
|
|
2568
2611
|
const hasMoreFields = maxVisibleChildren && !isSearchActive && fields && fields.length > maxVisibleChildren;
|
|
2569
2612
|
const visibleIndex = field => {
|
|
2570
|
-
var
|
|
2571
|
-
return (
|
|
2613
|
+
var _context;
|
|
2614
|
+
return (fields === null || fields === void 0 ? void 0 : _indexOfInstanceProperty(_context = _filterInstanceProperty(fields).call(fields, f => !f.isHidden)).call(_context, field)) || -1;
|
|
2572
2615
|
};
|
|
2573
2616
|
const shouldDisplayField = field => {
|
|
2574
2617
|
if (field.isHidden) return false;
|
|
@@ -2580,13 +2623,15 @@ const FieldSection = _ref3 => {
|
|
|
2580
2623
|
};
|
|
2581
2624
|
return jsxs(Spacings.Stack, {
|
|
2582
2625
|
scale: "s",
|
|
2583
|
-
children: [
|
|
2626
|
+
children: [visibleFields === null || visibleFields === void 0 ? void 0 : _mapInstanceProperty(visibleFields).call(visibleFields, (field, index) => {
|
|
2627
|
+
var _field$dependentGroup, _field$dependentField, _context2;
|
|
2584
2628
|
const isChildrenCountDisplayed = shouldDisplayChildrenCount(field);
|
|
2585
|
-
const hasDependents = Boolean(field.dependentGroupNames
|
|
2629
|
+
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));
|
|
2586
2630
|
const isAnyOfTheChildFieldsChecked = isAnyFieldChecked(field.fields || []);
|
|
2587
2631
|
const allFieldsChecked = areAllFieldsChecked(field.fields || []);
|
|
2588
2632
|
const getIsChecked = () => {
|
|
2589
|
-
|
|
2633
|
+
var _field$fields;
|
|
2634
|
+
const isParent = Boolean(field.fields && ((_field$fields = field.fields) === null || _field$fields === void 0 ? void 0 : _field$fields.length) > 0);
|
|
2590
2635
|
if (isParent) return areAllFieldsChecked(field.fields);
|
|
2591
2636
|
return field.isChecked;
|
|
2592
2637
|
};
|
|
@@ -2595,6 +2640,7 @@ const FieldSection = _ref3 => {
|
|
|
2595
2640
|
isForceExpanded: isSearchActive,
|
|
2596
2641
|
field: field,
|
|
2597
2642
|
children: _ref4 => {
|
|
2643
|
+
var _context3;
|
|
2598
2644
|
let isOpen = _ref4.isOpen,
|
|
2599
2645
|
toggle = _ref4.toggle,
|
|
2600
2646
|
registerContentNode = _ref4.registerContentNode;
|
|
@@ -2604,11 +2650,12 @@ const FieldSection = _ref3 => {
|
|
|
2604
2650
|
size: "20",
|
|
2605
2651
|
style: {
|
|
2606
2652
|
position: 'absolute',
|
|
2607
|
-
left:
|
|
2653
|
+
left: "calc(-1 * ".concat(designTokens.spacingXl, ")")
|
|
2608
2654
|
},
|
|
2609
2655
|
onClick: () => {
|
|
2610
2656
|
if (!isSearchActive) {
|
|
2611
|
-
|
|
2657
|
+
var _context4;
|
|
2658
|
+
updateExpandedGroups(_concatInstanceProperty(_context4 = "".concat(groupName, ".")).call(_context4, field.name), !isOpen);
|
|
2612
2659
|
}
|
|
2613
2660
|
toggle();
|
|
2614
2661
|
},
|
|
@@ -2622,17 +2669,19 @@ const FieldSection = _ref3 => {
|
|
|
2622
2669
|
isChecked: getIsChecked(),
|
|
2623
2670
|
isReadOnly: hasDependents || field.isRequired,
|
|
2624
2671
|
onChange: e => {
|
|
2625
|
-
|
|
2672
|
+
var _context5, _field$fields3;
|
|
2673
|
+
const path = _concatInstanceProperty(_context5 = "".concat(parentKeys.join('.'), ".fields[")).call(_context5, index, "]");
|
|
2626
2674
|
const checked = e.target.checked;
|
|
2627
2675
|
// Update all child fields
|
|
2628
2676
|
const updateAllChildFieldsChecked = (path, checked) => {
|
|
2629
2677
|
const item = get(_valuesInstanceProperty(formik), path);
|
|
2630
2678
|
if (item && item.fields) {
|
|
2631
|
-
var
|
|
2632
|
-
_forEachInstanceProperty(
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
|
|
2679
|
+
var _context6;
|
|
2680
|
+
_forEachInstanceProperty(_context6 = item.fields).call(_context6, (field, i) => {
|
|
2681
|
+
var _context7, _field$fields2;
|
|
2682
|
+
const fieldPath = _concatInstanceProperty(_context7 = "".concat(path, ".fields[")).call(_context7, i, "]");
|
|
2683
|
+
if (!((_field$fields2 = field.fields) !== null && _field$fields2 !== void 0 && _field$fields2.length)) {
|
|
2684
|
+
formik.setFieldValue("".concat(fieldPath, ".isChecked"), checked || field.isRequired,
|
|
2636
2685
|
// pass `false` to avoid revalidating the form with intermediate values
|
|
2637
2686
|
false);
|
|
2638
2687
|
}
|
|
@@ -2640,8 +2689,8 @@ const FieldSection = _ref3 => {
|
|
|
2640
2689
|
});
|
|
2641
2690
|
}
|
|
2642
2691
|
};
|
|
2643
|
-
if (!field.fields
|
|
2644
|
-
formik.setFieldValue(
|
|
2692
|
+
if (!((_field$fields3 = field.fields) !== null && _field$fields3 !== void 0 && _field$fields3.length)) {
|
|
2693
|
+
formik.setFieldValue("".concat(path, ".isChecked"), checked || field.isRequired,
|
|
2645
2694
|
// pass `false` to avoid revalidating the form with intermediate values
|
|
2646
2695
|
false);
|
|
2647
2696
|
}
|
|
@@ -2666,16 +2715,16 @@ const FieldSection = _ref3 => {
|
|
|
2666
2715
|
fields: field.fields,
|
|
2667
2716
|
maxVisibleChildren: field.maxVisibleChildren,
|
|
2668
2717
|
formik: formik,
|
|
2669
|
-
parentKeys: [...parentKeys,
|
|
2718
|
+
parentKeys: [...parentKeys, "fields[".concat(index, "]")],
|
|
2670
2719
|
isAnySiblingChecked: isAnySiblingChecked,
|
|
2671
2720
|
isSearchActive: isSearchActive,
|
|
2672
2721
|
groupName: groupName
|
|
2673
2722
|
})]
|
|
2674
2723
|
})
|
|
2675
2724
|
})]
|
|
2676
|
-
},
|
|
2725
|
+
}, _concatInstanceProperty(_context3 = "".concat(field.name, "-")).call(_context3, index));
|
|
2677
2726
|
}
|
|
2678
|
-
},
|
|
2727
|
+
}, _concatInstanceProperty(_context2 = "".concat(field.name, ".")).call(_context2, isSearchActive));
|
|
2679
2728
|
}), hasMoreFields && jsx("div", {
|
|
2680
2729
|
css: /*#__PURE__*/css("padding-left:", designTokens.spacingXs, ";" + (process.env.NODE_ENV === "production" ? "" : ";label:FieldSection;"), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImZpZWxkLXNlY3Rpb24udHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQXFQa0IiLCJmaWxlIjoiZmllbGQtc2VjdGlvbi50c3giLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBGcmFnbWVudCB9IGZyb20gJ3JlYWN0J1xuaW1wb3J0IHtcbiAgQW5nbGVEb3duSWNvbixcbiAgQW5nbGVSaWdodEljb24sXG4gIENoZWNrYm94SW5wdXQsXG4gIENvbGxhcHNpYmxlTW90aW9uLFxuICBJY29uQnV0dG9uLFxuICBTcGFjaW5ncyxcbiAgVGV4dCxcbiAgZGVzaWduVG9rZW5zLFxufSBmcm9tICdAY29tbWVyY2V0b29scy1mcm9udGVuZC91aS1raXQnXG5pbXBvcnQgeyBjc3MgfSBmcm9tICdAZW1vdGlvbi9yZWFjdCdcbmltcG9ydCBzdHlsZWQgZnJvbSAnQGVtb3Rpb24vc3R5bGVkJ1xuaW1wb3J0IHR5cGUgeyBGb3JtaWtQcm9wcyB9IGZyb20gJ2Zvcm1paydcbmltcG9ydCBnZXQgZnJvbS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XJuIG51bGxcbiAgICAgICAgcmV0dXJuIChcbiAgICAgICAgICA8Q29sbGFwc2libGVGaWVsZFdyYXBwZXJcbiAgICAgICAgICAgIGlzRm9yY2VFeHBhbmRlZD17aXNTZWFyY2hBY3RpdmV9XG4gICAgICAgICAgICBmaWVsZD17ZmllbGR9XG4gICAgICAgICAgICBrZXk9e2Ake2ZpZWxkLm5hbWV9LiR7aXNTZWFyY2hBY3RpdmV9YH1cbiAgICAgICAgICA+XG4gICAgICAgICAgICB7KHsgaXNPcGVuLCB0b2dnbGUsIHJlZ2lzdGVyQ29udGVudE5vZGUgfSkgPT4gKFxuICAgICAgICAgICAgICA8RnJhZ21lbnQga2V5PXtgJHtmaWVsZC5uYW1lfS0ke2luZGV4fWB9PlxuICAgICAgICAgICAgICAgIDxGaWVsZFdyYXBwZXI+XG4gICAgICAgICAgICAgICAgICB7ZmllbGQuaXNFeHBhbmRhYmxlICYmIChcbiAgICAgICAgICAgICAgICAgICAgPEljb25CdXR0b25cbiAgICAgICAgICAgICAgICAgICAgICBzaXplPVwiMjBcIlxuICAgICAgICAgICAgICAgICAgICAgIHN0eWxlPXt7XG4gICAgICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbjogJ2Fic29sdXRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgIGxlZnQ6IGBjYWxjKC0xICogJHtkZXNpZ25Ub2tlbnMuc3BhY2luZ1hsfSlgLFxuICAgICAgICAgICAgICAgICAgICAgIH19XG4gICAgICAgICAgICAgICAgICAgICAgb25DbGljaz17KCkgPT4ge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFpc1NlYXJjaEFjdGl2ZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICB1cGRhdGVFeHBhbmRlZEdyb3VwcyhcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBgJHtncm91cE5hbWV9LiR7ZmllbGQubmFtZX1gLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICFpc09wZW5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgKVxuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgdG9nZ2xlKClcbiAgICAgICAgICAgICAgICAgICAgICB9fVxuICAgICAgICAgICAgICAgICAgICAgIGljb249e2lzT3BlbiA/IDxBbmdsZURvd25JY29uIC8+IDogPEFuZ2xlUmlnaHRJY29uIC8+fVxuICAgICAgICAgICAgICAgICAgICAgIGxhYmVsPVwiXCJcbiAgICAgICAgICAgICAgICAgICAgLz5cbiAgICAgICAgICAgICAgICAgICl9XG4gICAgICAgICAgICAgICAgICA8U3BhY2luZ3MuSW5saW5lIHNjYWxlPVwic1wiIGFsaWduSXRlbXM9XCJjZW50ZXJcIj5cbiAgICAgICAgICAgICAgICAgICAgPENoZWNrYm94SW5wdXRcbiAgICAgICAgICAgICAgICAgICAgICBpc0luZGV0ZXJtaW5hdGU9e1xuICAgICAgICAgICAgICAgICAgICAgICAgZmllbGQuaXNFeHBhbmRhYmxlICYmXG4gICAgICAgICAgICAgICAgICAgICAgICAhYWxsRmllbGRzQ2hlY2tlZCAmJlxuICAgICAgICAgICAgICAgICAgICAgICAgaXNBbnlPZlRoZUNoaWxkRmllbGRzQ2hlY2tlZFxuICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICBpc0NoZWNrZWQ9e2dldElzQ2hlY2tlZCgpfVxuICAgICAgICAgICAgICAgICAgICAgIGlzUmVhZE9ubHk9e2hhc0RlcGVuZGVudHMgfHwgZmllbGQuaXNSZXF1aXJlZH1cbiAgICAgICAgICAgICAgICAgICAgICBvbkNoYW5nZT17KGUpID0+IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHBhdGggPSBgJHtwYXJlbnRLZXlzLmpvaW4oJy4nKX0uZmllbGRzWyR7aW5kZXh9XWBcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IGNoZWNrZWQgPSBlLnRhcmdldC5jaGVja2VkXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBVcGRhdGUgYWxsIGNoaWxkIGZpZWxkc1xuICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgdXBkYXRlQWxsQ2hpbGRGaWVsZHNDaGVja2VkID0gKFxuICAgICAgICAgICAgICAgICAgICAgICAgICBwYXRoOiBzdHJpbmcsXG4gICAgICAgICAgICAgICAgICAgICAgICAgIGNoZWNrZWQ6IGJvb2xlYW5cbiAgICAgICAgICAgICAgICAgICAgICAgICkgPT4ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBpdGVtID0gZ2V0KGZvcm1pay52YWx1ZXMsIHBhdGgpIGFzIEZvcm1GaWVsZFxuICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaXRlbSAmJiBpdGVtLmZpZWxkcykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGl0ZW0uZmllbGRzLmZvckVhY2goKGZpZWxkLCBpKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBmaWVsZFBhdGggPSBgJHtwYXRofS5maWVsZHNbJHtpfV1gXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWZpZWxkLmZpZWxkcz8ubGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvcm1pay5zZXRGaWVsZFZhbHVlKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGAke2ZpZWxkUGF0aH0uaXNDaGVja2VkYCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaGVja2VkIHx8IGZpZWxkLmlzUmVxdWlyZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gcGFzcyBgZmFsc2VgIHRvIGF2b2lkIHJldmFsaWRhdGluZyB0aGUgZm9ybSB3aXRoIGludGVybWVkaWF0ZSB2YWx1ZXNcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmYWxzZVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cGRhdGVBbGxDaGlsZEZpZWxkc0NoZWNrZWQoZmllbGRQYXRoLCBjaGVja2VkKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICghZmllbGQuZmllbGRzPy5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgZm9ybWlrLnNldEZpZWxkVmFsdWUoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYCR7cGF0aH0uaXNDaGVja2VkYCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaGVja2VkIHx8IGZpZWxkLmlzUmVxdWlyZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gcGFzcyBgZmFsc2VgIHRvIGF2b2lkIHJldmFsaWRhdGluZyB0aGUgZm9ybSB3aXRoIGludGVybWVkaWF0ZSB2YWx1ZXNcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmYWxzZVxuICAgICAgICAgICAgICAgICAgICAgICAgICApXG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB1cGRhdGVBbGxDaGlsZEZpZWxkc0NoZWNrZWQocGF0aCwgY2hlY2tlZClcbiAgICAgICAgICAgICAgICAgICAgICB9fVxuICAgICAgICAgICAgICAgICAgICA+XG4gICAgICAgICAgICAgICAgICAgICAge2ZpZWxkLmxhYmVsfVxuICAgICAgICAgICAgICAgICAgICAgIHsoaGFzRGVwZW5kZW50cyB8fCBmaWVsZC5pc1JlcXVpcmVkKSAmJiAnIConfVxuICAgICAgICAgICAgICAgICAgICA8L0NoZWNrYm94SW5wdXQ+XG4gICAgICAgICAgICAgICAgICAgIHtpc0NoaWxkcmVuQ291bnREaXNwbGF5ZWQgJiZcbiAgICAgICAgICAgICAgICAgICAgICBmaWVsZC5maWVsZHMgJiZcbiAgICAgICAgICAgICAgICAgICAgICBmaWVsZC5maWVsZHMubGVuZ3RoID4gMCAmJiAoXG4gICAgICAgICAgICAgICAgICAgICAgICA8ZGl2XG4gICAgICAgICAgICAgICAgICAgICAgICAgIHN0eWxlPXt7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZmxleDogJzAgMCBhdXRvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgfX1cbiAgICAgICAgICAgICAgICAgICAgICAgID5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgPEZpZWxkc0NvdW50U3RhbXAgY291bnQ9e2ZpZWxkLmZpZWxkcy5sZW5ndGh9IC8+XG4gICAgICAgICAgICAgICAgICAgICAgICA8L2Rpdj5cbiAgICAgICAgICAgICAgICAgICAgICApfVxuICAgICAgICAgICAgICAgICAgPC9TcGFjaW5ncy5JbmxpbmU+XG4gICAgICAgICAgICAgICAgPC9GaWVsZFdyYXBwZXI+XG4gICAgICAgICAgICAgICAge2ZpZWxkLmZpZWxkcyAmJiBmaWVsZC5maWVsZHMubGVuZ3RoID4gMCAmJiAoXG4gICAgICAgICAgICAgICAgICA8U3R5bGVkRXhwYW5kYWJsZUNvbnRlbnRcbiAgICAgICAgICAgICAgICAgICAgcmVmPXtyZWdpc3RlckNvbnRlbnROb2RlfVxuICAgICAgICAgICAgICAgICAgICBpc09wZW49e2lzT3Blbn1cbiAgICAgICAgICAgICAgICAgID5cbiAgICAgICAgICAgICAgICAgICAge2lzT3BlbiAmJiAoXG4gICAgICAgICAgICAgICAgICAgICAgPFNwYWNpbmdzLklubGluZSBzY2FsZT1cInhsXCI+XG4gICAgICAgICAgICAgICAgICAgICAgICA8ZGl2IC8+XG4gICAgICAgICAgICAgICAgICAgICAgICA8RmllbGRTZWN0aW9uXG4gICAgICAgICAgICAgICAgICAgICAgICAgIGZpZWxkcz17ZmllbGQuZmllbGRzfVxuICAgICAgICAgICAgICAgICAgICAgICAgICBtYXhWaXNpYmxlQ2hpbGRyZW49e2ZpZWxkLm1heFZpc2libGVDaGlsZHJlbn1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgZm9ybWlrPXtmb3JtaWt9XG4gICAgICAgICAgICAgICAgICAgICAgICAgIHBhcmVudEtleXM9e1suLi5wYXJlbnRLZXlzLCBgZmllbGRzWyR7aW5kZXh9XWBdfVxuICAgICAgICAgICAgICAgICAgICAgICAgICBpc0FueVNpYmxpbmdDaGVja2VkPXtpc0FueVNpYmxpbmdDaGVja2VkfVxuICAgICAgICAgICAgICAgICAgICAgICAgICBpc1NlYXJjaEFjdGl2ZT17aXNTZWFyY2hBY3RpdmV9XG4gICAgICAgICAgICAgICAgICAgICAgICAgIGdyb3VwTmFtZT17Z3JvdXBOYW1lfVxuICAgICAgICAgICAgICAgICAgICAgICAgLz5cbiAgICAgICAgICAgICAgICAgICAgICA8L1NwYWNpbmdzLklubGluZT5cbiAgICAgICAgICAgICAgICAgICAgKX1cbiAgICAgICAgICAgICAgICAgIDwvU3R5bGVkRXhwYW5kYWJsZUNvbnRlbnQ+XG4gICAgICAgICAgICAgICAgKX1cbiAgICAgICAgICAgICAgPC9GcmFnbWVudD5cbiAgICAgICAgICAgICl9XG4gICAgICAgICAgPC9Db2xsYXBzaWJsZUZpZWxkV3JhcHBlcj5cbiAgICAgICAgKVxuICAgICAgfSl9XG4gICAgICB7aGFzTW9yZUZpZWxkcyAmJiAoXG4gICAgICAgIDxkaXZcbiAgICAgICAgICBjc3M9e2Nzc2BcbiAgICAgICAgICAgIHBhZGRpbmctbGVmdDogJHtkZXNpZ25Ub2tlbnMuc3BhY2luZ1hzfTtcbiAgICAgICAgICBgfVxuICAgICAgICA+XG4gICAgICAgICAgPFRleHQuRGV0YWlsIHRvbmU9XCJ0ZXJ0aWFyeVwiIGludGxNZXNzYWdlPXttZXNzYWdlcy5sb2FkTW9yZUZpZWxkc30gLz5cbiAgICAgICAgPC9kaXY+XG4gICAgICApfVxuICAgIDwvU3BhY2luZ3MuU3RhY2s+XG4gIClcbn1cbiJdfQ== */"),
|
|
2681
2730
|
children: jsx(Text.Detail, {
|
|
@@ -2744,7 +2793,7 @@ const FieldGroupSection = _ref2 => {
|
|
|
2744
2793
|
const isAnyFieldInGroupChecked = useMemo(() => isAnyFieldChecked(group.fields), [group.fields]);
|
|
2745
2794
|
const _useExportFieldSelect = useExportFieldSelectionContext(),
|
|
2746
2795
|
updateExpandedGroups = _useExportFieldSelect.updateExpandedGroups;
|
|
2747
|
-
const parentKey =
|
|
2796
|
+
const parentKey = "groups[".concat(index, "]");
|
|
2748
2797
|
const handleChangeAllFields = e => {
|
|
2749
2798
|
const item = get(_valuesInstanceProperty(formik), parentKey);
|
|
2750
2799
|
function updateAllFields(fields, checked) {
|
|
@@ -2826,7 +2875,7 @@ const FieldGroupSection = _ref2 => {
|
|
|
2826
2875
|
})]
|
|
2827
2876
|
});
|
|
2828
2877
|
}
|
|
2829
|
-
},
|
|
2878
|
+
}, "".concat(isSearchActive));
|
|
2830
2879
|
};
|
|
2831
2880
|
|
|
2832
2881
|
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
@@ -2865,7 +2914,7 @@ const NoSearchResults = () => {
|
|
|
2865
2914
|
};
|
|
2866
2915
|
|
|
2867
2916
|
function ownKeys$4(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; }
|
|
2868
|
-
function _objectSpread$4(e) { for (var r = 1; r < arguments.length; r++) { var
|
|
2917
|
+
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(_context9 = ownKeys$4(Object(t), !0)).call(_context9, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context0 = ownKeys$4(Object(t))).call(_context0, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
2869
2918
|
const totalSpacing = 56 +
|
|
2870
2919
|
// MC header
|
|
2871
2920
|
32 * 2 + (
|
|
@@ -2910,30 +2959,34 @@ const StyledGridCard = /*#__PURE__*/_styled(Card, process.env.NODE_ENV === "prod
|
|
|
2910
2959
|
label: "StyledGridCard"
|
|
2911
2960
|
})("max-height:calc(100vh - ", totalSpacing, "px);overflow:auto;" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNlbGVjdGVkLWZpZWxkcy1mb3JtLnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUE0Q21DIiwiZmlsZSI6InNlbGVjdGVkLWZpZWxkcy1mb3JtLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBSZWFjdCBmcm9tICdyZWFjdCdcbmltcG9ydCB7IHVzZUludGwgfSBmcm9tICdyZWFjdC1pbnRsJ1xuaW1wb3J0IHsgdXNlQXBwbGljYXRpb25Db250ZXh0IH0gZnJvbSAnQGNvbW1lcmNldG9vbHMtZnJvbnRlbmQvYXBwbGljYXRpb24tc2hlbGwtY29ubmVjdG9ycydcbmltcG9ydCB7XG4gIENhcmQsXG4gIEdyaWQsXG4gIFNwYWNpbmdzLFxuICBTZWFyY2hUZXh0SW5wdXQsXG4gIGRlc2lnblRva2Vucyxcbn0gZnJvbSAnQGNvbW1lcmNldG9vbHMtZnJvbnRlbmQvdWkta2l0J1xu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AgICAgICBncm91cD17Z3JvdXB9XG4gICAgICAgICAgICAgICAgICBpbmRleD17aW5kZXh9XG4gICAgICAgICAgICAgICAgICBmb3JtaWs9e2Zvcm1pa31cbiAgICAgICAgICAgICAgICAgIGlzU2VhcmNoQWN0aXZlPXtpc1NlYXJjaEFjdGl2ZX1cbiAgICAgICAgICAgICAgICAvPlxuICAgICAgICAgICAgICApKX1cbiAgICAgICAgICAgIDwvR3JpZD5cbiAgICAgICAgICA8L1N0eWxlZEdyaWRDYXJkPlxuICAgICAgICApIDogKFxuICAgICAgICAgIDxOb1NlYXJjaFJlc3VsdHMgLz5cbiAgICAgICAgKX1cbiAgICAgIDwvU3BhY2luZ3MuU3RhY2s+XG4gICAgPC9FeHBvcnRGaWVsZFNlbGVjdGlvblByb3ZpZGVyPlxuICApXG59XG4iXX0= */"));
|
|
2912
2961
|
const SelectedFieldsForm = () => {
|
|
2913
|
-
var _context,
|
|
2962
|
+
var _context, _fieldSearchTerm$trim, _context7, _context8;
|
|
2914
2963
|
const intl = useIntl();
|
|
2915
2964
|
const _React$useState = React.useState(''),
|
|
2916
2965
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
2917
2966
|
fieldSearchTerm = _React$useState2[0],
|
|
2918
2967
|
setFieldSearchTerm = _React$useState2[1];
|
|
2919
|
-
const _useApplicationContex = useApplicationContext(context =>
|
|
2920
|
-
|
|
2921
|
-
|
|
2968
|
+
const _useApplicationContex = useApplicationContext(context => {
|
|
2969
|
+
var _context$project;
|
|
2970
|
+
return {
|
|
2971
|
+
projectKey: (_context$project = context.project) === null || _context$project === void 0 ? void 0 : _context$project.key
|
|
2972
|
+
};
|
|
2973
|
+
}),
|
|
2922
2974
|
projectKey = _useApplicationContex.projectKey;
|
|
2923
|
-
const _useStorage = useStorage(
|
|
2975
|
+
const _useStorage = useStorage(_concatInstanceProperty(_context = "".concat(projectKey, "/")).call(_context, OPERATIONS_EXPORT_RESOURCES_MODAL_SELECTION), {}),
|
|
2924
2976
|
_useStorage2 = _slicedToArray(_useStorage, 2),
|
|
2925
2977
|
cachedSelectedGroups = _useStorage2[0],
|
|
2926
2978
|
setCachedSelectedGroups = _useStorage2[1];
|
|
2927
2979
|
const _useExportResourcesMo = useExportResourcesModalContext(),
|
|
2928
2980
|
formik = _useExportResourcesMo.formik,
|
|
2929
2981
|
resourceType = _useExportResourcesMo.resourceType;
|
|
2930
|
-
const isSearchActive = (
|
|
2982
|
+
const isSearchActive = (fieldSearchTerm === null || fieldSearchTerm === void 0 || (_fieldSearchTerm$trim = _trimInstanceProperty(fieldSearchTerm).call(fieldSearchTerm)) === null || _fieldSearchTerm$trim === void 0 ? void 0 : _fieldSearchTerm$trim.length) >= MIN_SEARCH_LENGTH;
|
|
2931
2983
|
React.useEffect(() => {
|
|
2932
2984
|
var _context4;
|
|
2933
2985
|
updateFieldDependenciesStatus(formik);
|
|
2934
2986
|
const checkedFields = {};
|
|
2935
2987
|
function getCheckedFields(field, groupName) {
|
|
2936
|
-
|
|
2988
|
+
var _context2;
|
|
2989
|
+
const fieldName = field.name ? _concatInstanceProperty(_context2 = "".concat(groupName, ".")).call(_context2, field.name) : groupName;
|
|
2937
2990
|
if (field.fields) {
|
|
2938
2991
|
var _context3;
|
|
2939
2992
|
_forEachInstanceProperty(_context3 = field.fields).call(_context3, f => getCheckedFields(f, fieldName));
|
|
@@ -3013,7 +3066,7 @@ const SelectedFieldsForm = () => {
|
|
|
3013
3066
|
insetScale: "none",
|
|
3014
3067
|
children: jsx(Grid, {
|
|
3015
3068
|
gridAutoFlow: "row",
|
|
3016
|
-
gridTemplateColumns:
|
|
3069
|
+
gridTemplateColumns: _concatInstanceProperty(_context7 = _concatInstanceProperty(_context8 = "calc(".concat(designTokens.spacingL, " + ")).call(_context8, designTokens.constraint5, " + ")).call(_context7, designTokens.spacingL, ") auto"),
|
|
3017
3070
|
children: _mapInstanceProperty(filteredGroups).call(filteredGroups, (group, index) => jsx(FieldGroupSection, {
|
|
3018
3071
|
group: group,
|
|
3019
3072
|
index: index,
|
|
@@ -3034,6 +3087,7 @@ const Divider = /*#__PURE__*/_styled("hr", process.env.NODE_ENV === "production"
|
|
|
3034
3087
|
})("display:block;height:1px;border:0;border-top:1px solid ", designTokens.colorNeutral90, ";margin:0;padding:0;" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImRpdmlkZXIudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUdnQyIsImZpbGUiOiJkaXZpZGVyLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IGRlc2lnblRva2VucyB9IGZyb20gJ0Bjb21tZXJjZXRvb2xzLWZyb250ZW5kL3VpLWtpdCdcbmltcG9ydCBzdHlsZWQgZnJvbSAnQGVtb3Rpb24vc3R5bGVkJ1xuXG5leHBvcnQgY29uc3QgRGl2aWRlciA9IHN0eWxlZC5ocmBcbiAgZGlzcGxheTogYmxvY2s7XG4gIGhlaWdodDogMXB4O1xuICBib3JkZXI6IDA7XG4gIGJvcmRlci10b3A6IDFweCBzb2xpZCAke2Rlc2lnblRva2Vucy5jb2xvck5ldXRyYWw5MH07XG4gIG1hcmdpbjogMDtcbiAgcGFkZGluZzogMDtcbmBcbiJdfQ== */"));
|
|
3035
3088
|
|
|
3036
3089
|
const ExportFieldsSelectionStep = () => {
|
|
3090
|
+
var _context, _context2;
|
|
3037
3091
|
const intl = useIntl();
|
|
3038
3092
|
const _useExportResourcesMo = useExportResourcesModalContext(),
|
|
3039
3093
|
formik = _useExportResourcesMo.formik,
|
|
@@ -3055,13 +3109,13 @@ const ExportFieldsSelectionStep = () => {
|
|
|
3055
3109
|
};
|
|
3056
3110
|
return jsx(FormDialog, {
|
|
3057
3111
|
isOpen: true,
|
|
3058
|
-
title:
|
|
3112
|
+
title: _concatInstanceProperty(_context = "".concat(intl.formatMessage(messages.stepCount, {
|
|
3059
3113
|
currentStep: 2,
|
|
3060
3114
|
totalSteps: TOTAL_STEPS
|
|
3061
|
-
})
|
|
3062
|
-
labelPrimary:
|
|
3115
|
+
}), ": ")).call(_context, intl.formatMessage(messages.selectFieldsToExport)),
|
|
3116
|
+
labelPrimary: _concatInstanceProperty(_context2 = "".concat(intl.formatMessage(messages.stepNumber, {
|
|
3063
3117
|
stepNumber: 3
|
|
3064
|
-
})
|
|
3118
|
+
}), ": ")).call(_context2, intl.formatMessage(messages.confirmSelection)),
|
|
3065
3119
|
iconLeftPrimaryButton: jsx(AngleRightIcon, {}),
|
|
3066
3120
|
onPrimaryButtonClick: formik.submitForm,
|
|
3067
3121
|
isPrimaryButtonDisabled: isLoading || !formik.isValid,
|
|
@@ -3070,7 +3124,7 @@ const ExportFieldsSelectionStep = () => {
|
|
|
3070
3124
|
onClose: onClose,
|
|
3071
3125
|
size: 16,
|
|
3072
3126
|
dataAttributesPrimaryButton: {
|
|
3073
|
-
'data-tracking-target':
|
|
3127
|
+
'data-tracking-target': "".concat(resourceType, "_export-start_export_button")
|
|
3074
3128
|
},
|
|
3075
3129
|
children: isLoading ? jsx(Spacings.Stack, {
|
|
3076
3130
|
scale: "m",
|
|
@@ -3174,11 +3228,11 @@ const ExportResourcesProvider = _ref => {
|
|
|
3174
3228
|
locales: values.locales,
|
|
3175
3229
|
queryPredicate: values.queryPredicate
|
|
3176
3230
|
});
|
|
3177
|
-
if (validationResult
|
|
3231
|
+
if (validationResult !== null && validationResult !== void 0 && validationResult.invalidQueryPredicate) {
|
|
3178
3232
|
formik.setFieldError('queryPredicate', 'invalidInput');
|
|
3179
3233
|
return;
|
|
3180
3234
|
}
|
|
3181
|
-
if (validationResult
|
|
3235
|
+
if (validationResult !== null && validationResult !== void 0 && validationResult.noResourcesToExportForQueryPredicate) {
|
|
3182
3236
|
formik.setFieldError('queryPredicate', 'noResourcesToExportForQueryPredicate');
|
|
3183
3237
|
return;
|
|
3184
3238
|
}
|
|
@@ -3198,10 +3252,10 @@ const ExportResourcesProvider = _ref => {
|
|
|
3198
3252
|
locales: isUsingImportedCsvLocales ? undefined : values.locales,
|
|
3199
3253
|
queryPredicate: values.queryPredicate
|
|
3200
3254
|
});
|
|
3201
|
-
if (validationResult
|
|
3255
|
+
if (validationResult !== null && validationResult !== void 0 && validationResult.success) {
|
|
3202
3256
|
setCurrentStep(Step.ConfirmExport);
|
|
3203
3257
|
} else {
|
|
3204
|
-
setValidationErrors(validationResult
|
|
3258
|
+
setValidationErrors(validationResult === null || validationResult === void 0 ? void 0 : validationResult.validationErrors);
|
|
3205
3259
|
setCurrentStep(Step.ValidationErrors);
|
|
3206
3260
|
}
|
|
3207
3261
|
} else {
|
|
@@ -3212,23 +3266,18 @@ const ExportResourcesProvider = _ref => {
|
|
|
3212
3266
|
React.useEffect(() => {
|
|
3213
3267
|
formik.validateForm();
|
|
3214
3268
|
}, [currentStep, fieldSelectionMode, importedHeaders, exportType]);
|
|
3215
|
-
|
|
3216
|
-
// The modal can be mounted before the data backing `fieldGroups` is ready
|
|
3217
|
-
// (the consumer opens it immediately and passes `isLoading`). Formik snapshots
|
|
3218
|
-
// the initial values once and does not reinitialize, so when the groups
|
|
3219
|
-
// arrive we set just the `groups` field — leaving any file settings the user
|
|
3220
|
-
// already changed on step 1 untouched. Guarded to run once, and only when the
|
|
3221
|
-
// form actually mounted without groups (a no-op for consumers that pass the
|
|
3222
|
-
// full `fieldGroups` upfront).
|
|
3269
|
+
const mountedWhileLoadingRef = React.useRef(Boolean(props.isLoading));
|
|
3223
3270
|
const hasPopulatedFieldGroups = React.useRef(false);
|
|
3224
3271
|
React.useLayoutEffect(() => {
|
|
3225
|
-
if (hasPopulatedFieldGroups.current)
|
|
3226
|
-
|
|
3272
|
+
if (!mountedWhileLoadingRef.current || hasPopulatedFieldGroups.current) {
|
|
3273
|
+
return;
|
|
3274
|
+
}
|
|
3275
|
+
if (!props.isLoading && initialValues.groups.length > 0) {
|
|
3227
3276
|
formik.setFieldValue('groups', initialValues.groups);
|
|
3228
3277
|
hasPopulatedFieldGroups.current = true;
|
|
3229
3278
|
}
|
|
3230
3279
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
3231
|
-
}, [initialValues.groups]);
|
|
3280
|
+
}, [props.isLoading, initialValues.groups]);
|
|
3232
3281
|
return jsx(ExportResourcesContext.Provider, {
|
|
3233
3282
|
value: {
|
|
3234
3283
|
formik,
|
|
@@ -3262,7 +3311,7 @@ const ExportResourcesProvider = _ref => {
|
|
|
3262
3311
|
|
|
3263
3312
|
const ExportLogsLink = props => {
|
|
3264
3313
|
return jsx(Link, {
|
|
3265
|
-
to:
|
|
3314
|
+
to: "/".concat(props.projectKey, "/operations/export/logs"),
|
|
3266
3315
|
tone: props.tone,
|
|
3267
3316
|
children: props.msg
|
|
3268
3317
|
}, "link");
|
|
@@ -3303,12 +3352,16 @@ const FieldsPreview = _ref => {
|
|
|
3303
3352
|
};
|
|
3304
3353
|
|
|
3305
3354
|
function ownKeys$3(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; }
|
|
3306
|
-
function _objectSpread$3(e) { for (var r = 1; r < arguments.length; r++) { var
|
|
3355
|
+
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(_context3 = ownKeys$3(Object(t), !0)).call(_context3, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context4 = ownKeys$3(Object(t))).call(_context4, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
3307
3356
|
const ExportConfirmationStep = () => {
|
|
3357
|
+
var _context2;
|
|
3308
3358
|
const intl = useIntl();
|
|
3309
|
-
const _useApplicationContex = useApplicationContext(applicationContext =>
|
|
3310
|
-
|
|
3311
|
-
|
|
3359
|
+
const _useApplicationContex = useApplicationContext(applicationContext => {
|
|
3360
|
+
var _applicationContext$p;
|
|
3361
|
+
return {
|
|
3362
|
+
projectKey: (_applicationContext$p = applicationContext.project) === null || _applicationContext$p === void 0 ? void 0 : _applicationContext$p.key
|
|
3363
|
+
};
|
|
3364
|
+
}),
|
|
3312
3365
|
projectKey = _useApplicationContex.projectKey;
|
|
3313
3366
|
const _useExportResourcesMo = useExportResourcesModalContext(),
|
|
3314
3367
|
formik = _useExportResourcesMo.formik,
|
|
@@ -3317,17 +3370,23 @@ const ExportConfirmationStep = () => {
|
|
|
3317
3370
|
localeOption = _useExportResourcesMo.localeOption,
|
|
3318
3371
|
setCurrentStep = _useExportResourcesMo.setCurrentStep,
|
|
3319
3372
|
onClose = _useExportResourcesMo.onClose;
|
|
3320
|
-
const groupsWithSelectedFields = getGroupsWithSelectedFields(_valuesInstanceProperty(formik).groups);
|
|
3321
3373
|
const isUsingImportedCsvTemplate = fieldSelectionMode === 'imported-csv-template';
|
|
3322
3374
|
const isUsingImportedCsvLocales = localeOption === 'onlyLocalesFoundInCsvFile';
|
|
3323
|
-
const
|
|
3375
|
+
const selectedFieldsByGroup = useMemo(() => {
|
|
3376
|
+
var _context;
|
|
3377
|
+
return _mapInstanceProperty(_context = getGroupsWithSelectedFields(_valuesInstanceProperty(formik).groups)).call(_context, group => ({
|
|
3378
|
+
group,
|
|
3379
|
+
fields: getSelectedFieldLabels(group)
|
|
3380
|
+
}));
|
|
3381
|
+
}, [_valuesInstanceProperty(formik).groups]);
|
|
3382
|
+
const allSelectedFieldCount = useMemo(() => isUsingImportedCsvTemplate ? importedHeaders.length : getAllSelectedFieldCount(_valuesInstanceProperty(formik).groups), [isUsingImportedCsvTemplate, importedHeaders, _valuesInstanceProperty(formik).groups]);
|
|
3324
3383
|
const returnToFieldsSelection = () => setCurrentStep(Step.FieldsSelection);
|
|
3325
3384
|
return jsx(FormDialog, {
|
|
3326
3385
|
isOpen: true,
|
|
3327
|
-
title:
|
|
3386
|
+
title: _concatInstanceProperty(_context2 = "".concat(intl.formatMessage(messages.stepCount, {
|
|
3328
3387
|
currentStep: 3,
|
|
3329
3388
|
totalSteps: TOTAL_STEPS
|
|
3330
|
-
})
|
|
3389
|
+
}), ": ")).call(_context2, intl.formatMessage(messages.exportPreview)),
|
|
3331
3390
|
labelPrimary: intl.formatMessage(messages.startExport),
|
|
3332
3391
|
onPrimaryButtonClick: formik.submitForm,
|
|
3333
3392
|
labelSecondary: intl.formatMessage(messages.selectDifferentFields),
|
|
@@ -3367,11 +3426,12 @@ const ExportConfirmationStep = () => {
|
|
|
3367
3426
|
})]
|
|
3368
3427
|
}), isUsingImportedCsvTemplate ? jsx(FieldsPreview, {
|
|
3369
3428
|
fields: importedHeaders
|
|
3370
|
-
}) : _mapInstanceProperty(
|
|
3371
|
-
|
|
3429
|
+
}) : _mapInstanceProperty(selectedFieldsByGroup).call(selectedFieldsByGroup, _ref => {
|
|
3430
|
+
let group = _ref.group,
|
|
3431
|
+
fields = _ref.fields;
|
|
3372
3432
|
return jsx(FieldsPreview, {
|
|
3373
3433
|
previewGroupLabel: group.previewGroupLabel,
|
|
3374
|
-
fields:
|
|
3434
|
+
fields: fields
|
|
3375
3435
|
}, group.groupName);
|
|
3376
3436
|
})]
|
|
3377
3437
|
})
|
|
@@ -3397,7 +3457,7 @@ const ExportConfirmationStep = () => {
|
|
|
3397
3457
|
};
|
|
3398
3458
|
|
|
3399
3459
|
function ownKeys$2(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; }
|
|
3400
|
-
function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var
|
|
3460
|
+
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(_context4 = ownKeys$2(Object(t), !0)).call(_context4, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context5 = ownKeys$2(Object(t))).call(_context5, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
3401
3461
|
const getColumns = () => [{
|
|
3402
3462
|
key: 'errorType',
|
|
3403
3463
|
label: jsx(FormattedMessage, _objectSpread$2({}, messages.errorType)),
|
|
@@ -3410,7 +3470,8 @@ const ErrorTable = props => {
|
|
|
3410
3470
|
var _context;
|
|
3411
3471
|
const intl = useIntl();
|
|
3412
3472
|
const rows = _mapInstanceProperty(_context = props.errors).call(_context, row => {
|
|
3413
|
-
|
|
3473
|
+
var _row$originalErrors$, _context2;
|
|
3474
|
+
const id = row.code === 'AttributeLevelMismatch' && (_row$originalErrors$ = row.originalErrors[0]) !== null && _row$originalErrors$ !== void 0 && _row$originalErrors$.actualLevel ? _concatInstanceProperty(_context2 = "".concat(row.code, "-")).call(_context2, row.originalErrors[0].actualLevel) : row.code;
|
|
3414
3475
|
return _objectSpread$2(_objectSpread$2({}, row), {}, {
|
|
3415
3476
|
id
|
|
3416
3477
|
});
|
|
@@ -3427,7 +3488,7 @@ const ErrorTable = props => {
|
|
|
3427
3488
|
});
|
|
3428
3489
|
};
|
|
3429
3490
|
function itemRenderer(item, column, intl) {
|
|
3430
|
-
var
|
|
3491
|
+
var _context3;
|
|
3431
3492
|
switch (column.key) {
|
|
3432
3493
|
case 'errorType':
|
|
3433
3494
|
return jsx(Stamp, {
|
|
@@ -3445,7 +3506,7 @@ function itemRenderer(item, column, intl) {
|
|
|
3445
3506
|
margin: 0,
|
|
3446
3507
|
paddingLeft: designTokens.spacingL
|
|
3447
3508
|
},
|
|
3448
|
-
children: _mapInstanceProperty(
|
|
3509
|
+
children: _mapInstanceProperty(_context3 = item.fieldNames).call(_context3, (field, index) => jsx("li", {
|
|
3449
3510
|
children: jsx(Text.Detail, {
|
|
3450
3511
|
children: field
|
|
3451
3512
|
})
|
|
@@ -3482,6 +3543,7 @@ function getErrorTypeLabel(errorCode, intl) {
|
|
|
3482
3543
|
function ownKeys$1(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; }
|
|
3483
3544
|
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(_context = ownKeys$1(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context2 = ownKeys$1(Object(t))).call(_context2, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
3484
3545
|
const ExportValidationErrorsStep = () => {
|
|
3546
|
+
var _formik$values$import;
|
|
3485
3547
|
const intl = useIntl();
|
|
3486
3548
|
const _useExportResourcesMo = useExportResourcesModalContext(),
|
|
3487
3549
|
formik = _useExportResourcesMo.formik,
|
|
@@ -3524,7 +3586,7 @@ const ExportValidationErrorsStep = () => {
|
|
|
3524
3586
|
intlMessage: _objectSpread$1(_objectSpread$1({}, messages.uploadErrorsDetected), {}, {
|
|
3525
3587
|
values: {
|
|
3526
3588
|
total: intl.formatNumber(validationErrors.length),
|
|
3527
|
-
fileName: _valuesInstanceProperty(formik).importedCsvTemplateFile
|
|
3589
|
+
fileName: (_formik$values$import = _valuesInstanceProperty(formik).importedCsvTemplateFile) === null || _formik$values$import === void 0 ? void 0 : _formik$values$import.name,
|
|
3528
3590
|
b: msg => jsx("b", {
|
|
3529
3591
|
children: msg
|
|
3530
3592
|
}, crypto.randomUUID()),
|
|
@@ -3632,17 +3694,20 @@ const FileDropArea = () => {
|
|
|
3632
3694
|
'text/csv': ['.csv']
|
|
3633
3695
|
},
|
|
3634
3696
|
getDropAreaState: getState,
|
|
3635
|
-
children: dropAreaState =>
|
|
3636
|
-
|
|
3637
|
-
|
|
3638
|
-
|
|
3639
|
-
|
|
3640
|
-
|
|
3641
|
-
|
|
3642
|
-
|
|
3643
|
-
|
|
3644
|
-
|
|
3645
|
-
|
|
3697
|
+
children: dropAreaState => {
|
|
3698
|
+
var _formik$values$import;
|
|
3699
|
+
return getDropArea({
|
|
3700
|
+
dropAreaState,
|
|
3701
|
+
isFileDropped: Boolean(_valuesInstanceProperty(formik).importedCsvTemplateFile),
|
|
3702
|
+
fileName: (_formik$values$import = _valuesInstanceProperty(formik).importedCsvTemplateFile) === null || _formik$values$import === void 0 ? void 0 : _formik$values$import.name,
|
|
3703
|
+
messages: {
|
|
3704
|
+
chooseFile: intl.formatMessage(messages.chooseFile),
|
|
3705
|
+
dragAndDropCSV: intl.formatMessage(messages.dragAndDropCSV),
|
|
3706
|
+
or: intl.formatMessage(messages.or),
|
|
3707
|
+
browseFile: intl.formatMessage(messages.browseFile)
|
|
3708
|
+
}
|
|
3709
|
+
});
|
|
3710
|
+
}
|
|
3646
3711
|
});
|
|
3647
3712
|
};
|
|
3648
3713
|
|
|
@@ -3669,8 +3734,8 @@ const loadMessages = async locale => {
|
|
|
3669
3734
|
return parseChunkImport(chunkImport);
|
|
3670
3735
|
} catch (error) {
|
|
3671
3736
|
// eslint-disable-next-line no-console
|
|
3672
|
-
console.warn(
|
|
3673
|
-
reportErrorToSentry(new Error(
|
|
3737
|
+
console.warn("Something went wrong while loading the export-resources-modal messages for ".concat(locale), error);
|
|
3738
|
+
reportErrorToSentry(new Error("Something went wrong while loading the export-resources-modal messages for ".concat(locale)), {
|
|
3674
3739
|
extra: error
|
|
3675
3740
|
});
|
|
3676
3741
|
return {};
|