@commercetools-frontend-extensions/export-resources-modal 1.3.1 → 1.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -26,22 +26,21 @@ var _possibleConstructorReturn = require('@babel/runtime-corejs3/helpers/possibl
|
|
|
26
26
|
var _getPrototypeOf = require('@babel/runtime-corejs3/helpers/getPrototypeOf');
|
|
27
27
|
var _wrapNativeSuper = require('@babel/runtime-corejs3/helpers/wrapNativeSuper');
|
|
28
28
|
var _Array$isArray = require('@babel/runtime-corejs3/core-js-stable/array/is-array');
|
|
29
|
-
var _slicedToArray = require('@babel/runtime-corejs3/helpers/slicedToArray');
|
|
30
|
-
var PropTypes = require('prop-types');
|
|
31
|
-
var formik = require('formik');
|
|
32
|
-
var moment = require('moment');
|
|
33
|
-
var applicationShellConnectors = require('@commercetools-frontend/application-shell-connectors');
|
|
34
|
-
var react = require('react');
|
|
35
29
|
var uiKit = require('@commercetools-frontend/ui-kit');
|
|
36
30
|
var omitEmpty = require('omit-empty-es');
|
|
37
31
|
var jsxRuntime = require('@emotion/react/jsx-runtime');
|
|
38
|
-
var _valuesInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/values');
|
|
39
32
|
var designSystem = require('@commercetools-uikit/design-system');
|
|
40
|
-
var
|
|
33
|
+
var PropTypes = require('prop-types');
|
|
34
|
+
var react$1 = require('react');
|
|
35
|
+
var react = require('@emotion/react');
|
|
41
36
|
var _styled = require('@emotion/styled/base');
|
|
37
|
+
var _valuesInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/values');
|
|
38
|
+
var applicationShellConnectors = require('@commercetools-frontend/application-shell-connectors');
|
|
42
39
|
var sdk = require('@commercetools-frontend/sdk');
|
|
43
|
-
var actionsGlobal = require('@commercetools-frontend/actions-global');
|
|
44
40
|
var constants = require('@commercetools-frontend/constants');
|
|
41
|
+
var actionsGlobal = require('@commercetools-frontend/actions-global');
|
|
42
|
+
var formik = require('formik');
|
|
43
|
+
var moment = require('moment');
|
|
45
44
|
|
|
46
45
|
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
47
46
|
|
|
@@ -58,31 +57,34 @@ var _flatInstanceProperty__default = /*#__PURE__*/_interopDefault(_flatInstanceP
|
|
|
58
57
|
var _concatInstanceProperty__default = /*#__PURE__*/_interopDefault(_concatInstanceProperty);
|
|
59
58
|
var _Reflect$construct__default = /*#__PURE__*/_interopDefault(_Reflect$construct);
|
|
60
59
|
var _Array$isArray__default = /*#__PURE__*/_interopDefault(_Array$isArray);
|
|
61
|
-
var PropTypes__default = /*#__PURE__*/_interopDefault(PropTypes);
|
|
62
|
-
var moment__default = /*#__PURE__*/_interopDefault(moment);
|
|
63
60
|
var omitEmpty__default = /*#__PURE__*/_interopDefault(omitEmpty);
|
|
64
|
-
var
|
|
61
|
+
var PropTypes__default = /*#__PURE__*/_interopDefault(PropTypes);
|
|
65
62
|
var _styled__default = /*#__PURE__*/_interopDefault(_styled);
|
|
63
|
+
var _valuesInstanceProperty__default = /*#__PURE__*/_interopDefault(_valuesInstanceProperty);
|
|
64
|
+
var moment__default = /*#__PURE__*/_interopDefault(moment);
|
|
66
65
|
|
|
67
|
-
const
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
66
|
+
const EXPORT_OPERATION_STATES = {
|
|
67
|
+
PROCESSING: 'processing',
|
|
68
|
+
COMPLETED: 'completed',
|
|
69
|
+
FAILED: 'failed'
|
|
71
70
|
};
|
|
71
|
+
|
|
72
72
|
const EXPORT_SELECTION_TYPES = {
|
|
73
73
|
ALL_RESOURCES: 'allResources',
|
|
74
74
|
ONLY_MATCHING: 'onlyMatching',
|
|
75
75
|
ONLY_SELECTED: 'onlySelected'
|
|
76
76
|
};
|
|
77
|
+
|
|
78
|
+
const EXPORTABLE_RESOURCES = {
|
|
79
|
+
CATEGORY: 'category',
|
|
80
|
+
PRODUCT: 'product',
|
|
81
|
+
DISCOUNT_CODE: 'discountCode'
|
|
82
|
+
};
|
|
83
|
+
|
|
77
84
|
const OUTPUT_FORMATS = {
|
|
78
85
|
JSON: 'json',
|
|
79
86
|
CSV: 'csv'
|
|
80
87
|
};
|
|
81
|
-
const EXPORT_OPERATION_STATES = {
|
|
82
|
-
PROCESSING: 'processing',
|
|
83
|
-
COMPLETED: 'completed',
|
|
84
|
-
FAILED: 'failed'
|
|
85
|
-
};
|
|
86
88
|
|
|
87
89
|
function _createSuper$3(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$3(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = _Reflect$construct__default["default"](Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
88
90
|
function _isNativeReflectConstruct$3() { if (typeof Reflect === "undefined" || !_Reflect$construct__default["default"]) return false; if (_Reflect$construct__default["default"].sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct__default["default"](Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
@@ -178,6 +180,14 @@ function isFilledArray(maybeArray) {
|
|
|
178
180
|
return _Array$isArray__default["default"](maybeArray) && maybeArray.length;
|
|
179
181
|
}
|
|
180
182
|
|
|
183
|
+
/*
|
|
184
|
+
* This function is responsible for constructing the GraphQL query based on the export settings
|
|
185
|
+
*
|
|
186
|
+
* Depending on the type of export selection (all resources, only selected, or only matching/filtered) it constructs different types of queries:
|
|
187
|
+
* - For 'all resources', it generates a query that fetches all fields and languages specified in the export settings.
|
|
188
|
+
* - For 'only selected', it creates a query that fetches only the fields and languages of the selected resources. The ids of the selected resources are included in the query.
|
|
189
|
+
* - The 'only matching' case is a placeholder for future development where a query will be constructed based on certain filtering criteria using the `where` parameter.
|
|
190
|
+
*/
|
|
181
191
|
function buildGraphQuery(exportSettings) {
|
|
182
192
|
var _context;
|
|
183
193
|
const operation = resourceTypeToOperationName(exportSettings.resourceType);
|
|
@@ -213,6 +223,21 @@ function buildGraphQuery(exportSettings) {
|
|
|
213
223
|
throw new UnexpectedSelectionTypeError(exportSettings.exportSelectionType);
|
|
214
224
|
}
|
|
215
225
|
}
|
|
226
|
+
|
|
227
|
+
/*
|
|
228
|
+
* This function builds the necessary field structure for our GraphQL queries, tt is specifically designed to handle different types of fields
|
|
229
|
+
*
|
|
230
|
+
* For fields whose values change depending on the language aka localised fields, a unique request format is used
|
|
231
|
+
* This format combines the field and the language, separated by '_____'. This approach is adopted as our system disallows the use of hyphens `-` in these situations
|
|
232
|
+
*
|
|
233
|
+
* Fields that don't vary by language but contain additional subfields (known as 'nested fields') are also addressed
|
|
234
|
+
* In these cases the function is used recursively on these subfields to generate the appropriate request.
|
|
235
|
+
*
|
|
236
|
+
* Overall, this function enables us to accurately request different types of data, including those varying by language or containing subfields.
|
|
237
|
+
*
|
|
238
|
+
* More details can be found in the related PR: https://github.com/commercetools/commercetools-exporter/pull/103
|
|
239
|
+
*/
|
|
240
|
+
|
|
216
241
|
function buildFields(_ref) {
|
|
217
242
|
var _context2;
|
|
218
243
|
let fields = _ref.fields,
|
|
@@ -220,7 +245,7 @@ function buildFields(_ref) {
|
|
|
220
245
|
return _flatInstanceProperty__default["default"](_context2 = _mapInstanceProperty__default["default"](fields).call(fields, field => {
|
|
221
246
|
if (field.isLocalized) return _mapInstanceProperty__default["default"](languages).call(languages, language => {
|
|
222
247
|
var _context3, _context4, _context5;
|
|
223
|
-
const alias = replaceSpecialCharsWithUnderscore(_concatInstanceProperty__default["default"](_context3 = "".concat(field.key, "
|
|
248
|
+
const alias = replaceSpecialCharsWithUnderscore(_concatInstanceProperty__default["default"](_context3 = "".concat(field.key, "_____")).call(_context3, language));
|
|
224
249
|
return _concatInstanceProperty__default["default"](_context4 = _concatInstanceProperty__default["default"](_context5 = "".concat(alias, ": ")).call(_context5, field.key, "(locale: \"")).call(_context4, language, "\")");
|
|
225
250
|
});else {
|
|
226
251
|
if (isFilledArray(field.fields)) {
|
|
@@ -236,6 +261,22 @@ function buildFields(_ref) {
|
|
|
236
261
|
})).call(_context2);
|
|
237
262
|
}
|
|
238
263
|
|
|
264
|
+
function validate(values) {
|
|
265
|
+
const errors = {
|
|
266
|
+
fileName: {},
|
|
267
|
+
languages: {}
|
|
268
|
+
};
|
|
269
|
+
if (uiKit.TextInput.isEmpty(values.fileName)) {
|
|
270
|
+
errors.fileName.missing = true;
|
|
271
|
+
} else if (!/^[a-zA-Z0-9-_]+$/.test(values.fileName)) {
|
|
272
|
+
errors.fileName.invalidInput = true;
|
|
273
|
+
}
|
|
274
|
+
if (values.languages.length < 1) {
|
|
275
|
+
errors.languages.missing = true;
|
|
276
|
+
}
|
|
277
|
+
return omitEmpty__default["default"](errors);
|
|
278
|
+
}
|
|
279
|
+
|
|
239
280
|
var messages = reactIntl.defineMessages({
|
|
240
281
|
modalTitle: {
|
|
241
282
|
id: 'ExportResourcesModal.modalTitle',
|
|
@@ -350,7 +391,7 @@ var messages = reactIntl.defineMessages({
|
|
|
350
391
|
exportOperationSuccessMessage: {
|
|
351
392
|
id: 'ExportResourcesModal.exportOperationSuccessMessage',
|
|
352
393
|
description: 'Success message',
|
|
353
|
-
defaultMessage: 'Your export has started
|
|
394
|
+
defaultMessage: '<b>Your export has started.</b> <newline></newline><logsLink>Go to Export logs</logsLink> to view the progress and download the file.'
|
|
354
395
|
},
|
|
355
396
|
exportConfirmationLabel: {
|
|
356
397
|
id: 'ExportResourcesModal.exportConfirmationLabel',
|
|
@@ -389,122 +430,36 @@ var messages = reactIntl.defineMessages({
|
|
|
389
430
|
}
|
|
390
431
|
});
|
|
391
432
|
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
isOpen: PropTypes__default["default"].bool.isRequired,
|
|
398
|
-
closeModal: PropTypes__default["default"].func.isRequired,
|
|
399
|
-
allResourcesCount: PropTypes__default["default"].number.isRequired,
|
|
400
|
-
matchingResourcesCount: PropTypes__default["default"].number,
|
|
401
|
-
selectedResourceIds: PropTypes__default["default"].array,
|
|
402
|
-
// TODO: Circular reference
|
|
403
|
-
fields: PropTypes__default["default"].arrayOf(PropTypes__default["default"].shape({
|
|
404
|
-
key: PropTypes__default["default"].string.isRequired,
|
|
405
|
-
label: PropTypes__default["default"].string,
|
|
406
|
-
isLocalized: PropTypes__default["default"].bool,
|
|
407
|
-
fields: PropTypes__default["default"].arrayOf(PropTypes__default["default"].shape({
|
|
408
|
-
key: PropTypes__default["default"].string.isRequired,
|
|
409
|
-
label: PropTypes__default["default"].string,
|
|
410
|
-
isLocalized: PropTypes__default["default"].bool
|
|
411
|
-
}))
|
|
412
|
-
})).isRequired,
|
|
413
|
-
exportSelectionType: PropTypes__default["default"].string,
|
|
414
|
-
appliedSearchTerms: PropTypes__default["default"].array,
|
|
415
|
-
appliedFilters: PropTypes__default["default"].array,
|
|
416
|
-
renderProperties: PropTypes__default["default"].func
|
|
417
|
-
}).isRequired;
|
|
418
|
-
|
|
419
|
-
function validate(values) {
|
|
420
|
-
const errors = {
|
|
421
|
-
fileName: {},
|
|
422
|
-
languages: {}
|
|
423
|
-
};
|
|
424
|
-
if (uiKit.TextInput.isEmpty(values.fileName)) {
|
|
425
|
-
errors.fileName.missing = true;
|
|
426
|
-
} else if (!/^[a-zA-Z0-9-_]+$/.test(values.fileName)) {
|
|
427
|
-
errors.fileName.invalidInput = true;
|
|
428
|
-
}
|
|
429
|
-
if (values.languages.length < 1) {
|
|
430
|
-
errors.languages.missing = true;
|
|
431
|
-
}
|
|
432
|
-
return omitEmpty__default["default"](errors);
|
|
433
|
-
}
|
|
434
|
-
|
|
435
|
-
function ownKeys$b(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
436
|
-
function _objectSpread$b(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys$b(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys$b(Object(source))).call(_context3, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
437
|
-
const ExportResourcesContextProvider = props => {
|
|
438
|
-
var _context;
|
|
439
|
-
const todayFormatted = moment__default["default"]().format('DD-MM-YY_HH-mm');
|
|
440
|
-
const _useApplicationContex = applicationShellConnectors.useApplicationContext(applicationContext => ({
|
|
441
|
-
language: applicationContext.dataLocale
|
|
442
|
-
})),
|
|
443
|
-
language = _useApplicationContex.language;
|
|
444
|
-
const formik$1 = formik.useFormik({
|
|
445
|
-
initialValues: {
|
|
446
|
-
outputFormat: props.outputFormat,
|
|
447
|
-
fileName: _concatInstanceProperty__default["default"](_context = "".concat(resourceTypeToPlural({
|
|
448
|
-
resourceType: props.resourceType,
|
|
449
|
-
isUpperCase: true
|
|
450
|
-
}), "_Export_")).call(_context, todayFormatted),
|
|
451
|
-
languages: [language],
|
|
452
|
-
fields: props.fields,
|
|
453
|
-
appliedSearchTerms: props.appliedSearchTerms,
|
|
454
|
-
appliedFilters: props.appliedFilters,
|
|
455
|
-
exportSelectionType: props.exportSelectionType,
|
|
456
|
-
isAllLanguagesChecked: false
|
|
457
|
-
},
|
|
458
|
-
validate
|
|
459
|
-
});
|
|
460
|
-
const _useState = react.useState(false),
|
|
461
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
462
|
-
exportOperationStarted = _useState2[0],
|
|
463
|
-
setExportOperationStarted = _useState2[1];
|
|
464
|
-
return jsxRuntime.jsx(ExportResourcesContext.Provider, {
|
|
465
|
-
value: {
|
|
466
|
-
formik: formik$1,
|
|
467
|
-
resourceType: props.resourceType,
|
|
468
|
-
allResourcesCount: props.allResourcesCount,
|
|
469
|
-
matchingResourcesCount: props.matchingResourcesCount,
|
|
470
|
-
selectedResourceIds: props.selectedResourceIds,
|
|
471
|
-
exportOperationStarted,
|
|
472
|
-
setExportOperationStarted
|
|
473
|
-
},
|
|
474
|
-
children: props.children
|
|
433
|
+
function getBold(msg) {
|
|
434
|
+
return jsxRuntime.jsx(uiKit.Text.Body, {
|
|
435
|
+
as: "span",
|
|
436
|
+
isBold: true,
|
|
437
|
+
children: msg
|
|
475
438
|
});
|
|
476
|
-
}
|
|
477
|
-
ExportResourcesContextProvider.displayName = 'ExportResourcesContextProvider';
|
|
478
|
-
ExportResourcesContextProvider.propTypes = process.env.NODE_ENV !== "production" ? _objectSpread$b(_objectSpread$b({}, ExportResourcesModalShape), {}, {
|
|
479
|
-
children: PropTypes__default["default"].node
|
|
480
|
-
}) : {};
|
|
439
|
+
}
|
|
481
440
|
|
|
482
|
-
function
|
|
483
|
-
|
|
484
|
-
if (!context) {
|
|
485
|
-
throw new MissingExportResourceProviderError();
|
|
486
|
-
}
|
|
487
|
-
return context;
|
|
441
|
+
function getNewLine() {
|
|
442
|
+
return jsxRuntime.jsx("br", {});
|
|
488
443
|
}
|
|
489
444
|
|
|
490
445
|
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)."; }
|
|
491
|
-
const smallTopPadding = /*#__PURE__*/react
|
|
446
|
+
const smallTopPadding = /*#__PURE__*/react.css("padding-top:", designSystem.customProperties.spacingXs, ";" + (process.env.NODE_ENV === "production" ? "" : ";label:smallTopPadding;"), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;char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l6aW5nOiBib3JkZXItYm94O1xuICB3aWR0aDogMTAwJTtcbiAgbWFyZ2luOiAwO1xuICBib3JkZXI6IDA7XG4gIGJvcmRlci10b3A6IDFweCBzb2xpZCAke2N1c3RvbVByb3BlcnRpZXMuY29sb3JOZXV0cmFsNjB9O1xuYFxuXG5jb25zdCBub3RCb2xkID0gY3NzYFxuICBmb250LXdlaWdodDogbm9ybWFsO1xuYFxuXG5jb25zdCBzdWNjZXNzTWVzc2FnZSA9IGNzc2BcbiAgbWFyZ2luLWJvdHRvbTogJHtjdXN0b21Qcm9wZXJ0aWVzLnNwYWNpbmdMfTtcbmBcblxuZXhwb3J0IGNvbnN0IHN0eWxlcyA9IHtcbiAgdGFnTGlzdEl0ZW0sXG4gIHRhZ0xpc3RDb250YWluZXIsXG4gIHNtYWxsVG9wUGFkZGluZyxcbiAgZGl2aWRlcixcbiAgbm90Qm9sZCxcbiAgc3VjY2Vzc01lc3NhZ2UsXG59XG4iXX0= */");
|
|
492
447
|
const tagListContainer = _ref => {
|
|
493
448
|
let isNewTheme = _ref.isNewTheme;
|
|
494
|
-
return /*#__PURE__*/react
|
|
449
|
+
return /*#__PURE__*/react.css("width:100%;display:flex;flex-wrap:wrap;display:inline-flex;padding:0 ", isNewTheme ? 0 : designSystem.customProperties.spacingL, ";&>div{margin:0 ", designSystem.customProperties.spacingS, " ", designSystem.customProperties.spacingS, " 0;}" + (process.env.NODE_ENV === "production" ? "" : ";label:tagListContainer;"), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInN0eWxlcy5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFRZ0QiLCJmaWxlIjoic3R5bGVzLmpzIiwic291cmNlc0NvbnRlbnQiOlsiLy8gVE9ETzogQHJlZGVzaWduIGNsZWFudXBcbmltcG9ydCB7IGNzcyB9IGZyb20gJ0BlbW90aW9uL3JlYWN0J1xu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dWNjZXNzTWVzc2FnZSA9IGNzc2BcbiAgbWFyZ2luLWJvdHRvbTogJHtjdXN0b21Qcm9wZXJ0aWVzLnNwYWNpbmdMfTtcbmBcblxuZXhwb3J0IGNvbnN0IHN0eWxlcyA9IHtcbiAgdGFnTGlzdEl0ZW0sXG4gIHRhZ0xpc3RDb250YWluZXIsXG4gIHNtYWxsVG9wUGFkZGluZyxcbiAgZGl2aWRlcixcbiAgbm90Qm9sZCxcbiAgc3VjY2Vzc01lc3NhZ2UsXG59XG4iXX0= */");
|
|
495
450
|
};
|
|
496
|
-
const tagListItem = /*#__PURE__*/react
|
|
497
|
-
const divider = /*#__PURE__*/react
|
|
451
|
+
const tagListItem = /*#__PURE__*/react.css("margin:0 ", designSystem.customProperties.spacingXs, " ", designSystem.customProperties.spacingXs, " 0;display:flex;min-width:0;" + (process.env.NODE_ENV === "production" ? "" : ";label:tagListItem;"), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInN0eWxlcy5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFtQnVCIiwiZmlsZSI6InN0eWxlcy5qcyIsInNvdXJjZXNDb250ZW50IjpbIi8vIFRPRE86IEByZWRlc2lnbiBjbGVhbnVwXG5pbXBvcnQgeyBjc3MgfSBmcm9tICdAZW1vdGlvbi9yZWFjdCdcbmltcG9ydCB7IGN1c3RvbVByb3BlcnRpZXMgfSBmcm9tICdAY29tbWVyY2V0b29scy11aWtpdC9kZXNpZ24tc3lzdGVtJ1xuXG5jb25zdCBzbWFsbFRvcFBhZGRpbmcgPSBjc3NgXG4gIHBhZGRpbmctdG9wOiAke2N1c3RvbVByb3BlcnRpZXMuc3BhY2luZ1hzfTtcbmBcblxuY29uc3QgdGFnTGlzdENvbnRhaW5lciA9ICh7IGlzTmV3VGhlbWUgfSkgPT4gY3NzYFxuICB3aWR0aDogMTAwJTtcbiAgZGlzc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("box-sizing:border-box;width:100%;margin:0;border:0;border-top:1px solid ", designSystem.customProperties.colorNeutral60, ";" + (process.env.NODE_ENV === "production" ? "" : ";label:divider;"), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInN0eWxlcy5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUF5Qm1CIiwiZmlsZSI6InN0eWxlcy5qcyIsInNvdXJjZXNDb250ZW50IjpbIi8vIFRPRE86IEByZWRlc2lnbiBjbGVhbnVwXG5pbXBvcnQgeyBjc3MgfSBmcm9tICdAZW1vdGlvbi9yZWFjdCdcbmltcG9ydCB7IGN1c3RvbVByb3BlcnRpZXMgfSBmcm9tICdAY29tbWVyY2V0b29scy11aWtpdC9kZXNpZ24tc3lzdGVtJ1xuXG5jb25zdCBzbWFsbFRvcFBhZGRpbmcgPSBjc3NgXG4gIHBhZGRpbmctdG9wOiAke2N1c3RvbVByb3BlcnRpZXMuc3BhY2luZ1hzfTtcbmBcblxuY29uc3QgdGFnTGlzdENvbnRhaW5lciA9ICh7IGlzTmV3VGhlbWUgfSkgPT4gY3NzYFxuICB3aWR0aDogMTAwJTtcbiAgZGlzcGxheTogZmxleDtcbiAgZmxleC13cmFwOiB3cmFwO1xuICBkaXNwbGF5OiBpbmxpbmUtZmxleDtcbiAgcGFkZGluZzogMCAke2lzTmV3VGhlbWUgPyAwIDogY3VzdG9tUHJvcGVydGllcy5zcGFjaW5nTH07XG4gICYgPiBkaXYge1xuICAgIG1hcmdpbjogMCAke2N1c3RvbVByb3BlcnRpZXMuc3BhY2luZ1N9ICR7Y3VzdG9tUHJvcGVydGllcy5zcGFjaW5nU30gMDtcbiAgfVxuYFxuXG5jb25zdCB0YWdMaXN0SXRlbSA9IGNzc2BcbiAgbWFyZ2luOiAwICR7Y3VzdG9tUHJvcGVydGllcy5zcGFjaW5nWHN9ICR7Y3VzdG9tUHJvcGVydGllcy5zcGFjaW5nWHN9IDA7XG4gIGRpc3BsYXk6IGZsZXg7XG4gIG1pbi13aWR0aDogMDtcbmBcblxuY29uc3QgZGl2aWRlciA9IGNzc2BcbiAgYm94LXNpemluZzogYm9yZGVyLWJveDtcbiAgd2lkdGg6IDEwMCU7XG4gIG1hcmdpbjogMDtcbiAgYm9yZGVyOiAwO1xuICBib3JkZXItdG9wOiAxcHggc29saWQgJHtjdXN0b21Qcm9wZXJ0aWVzLmNvbG9yTmV1dHJhbDYwfTtcbmBcblxuY29uc3Qgbm90Qm9sZCA9IGNzc2BcbiAgZm9udC13ZWlnaHQ6IG5vcm1hbDtcbmBcblxuY29uc3Qgc3VjY2Vzc01lc3NhZ2UgPSBjc3NgXG4gIG1hcmdpbi1ib3R0b206ICR7Y3VzdG9tUHJvcGVydGllcy5zcGFjaW5nTH07XG5gXG5cbmV4cG9ydCBjb25zdCBzdHlsZXMgPSB7XG4gIHRhZ0xpc3RJdGVtLFxuICB0YWdMaXN0Q29udGFpbmVyLFxuICBzbWFsbFRvcFBhZGRpbmcsXG4gIGRpdmlkZXIsXG4gIG5vdEJvbGQsXG4gIHN1Y2Nlc3NNZXNzYWdlLFxufVxuIl19 */");
|
|
498
453
|
const notBold = process.env.NODE_ENV === "production" ? {
|
|
499
454
|
name: "lugakg",
|
|
500
455
|
styles: "font-weight:normal"
|
|
501
456
|
} : {
|
|
502
457
|
name: "w02aau-notBold",
|
|
503
458
|
styles: "font-weight:normal;label:notBold;",
|
|
504
|
-
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
459
|
+
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInN0eWxlcy5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFpQ21CIiwiZmlsZSI6InN0eWxlcy5qcyIsInNvdXJjZXNDb250ZW50IjpbIi8vIFRPRE86IEByZWRlc2lnbiBjbGVhbnVwXG5pbXB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aHQ6IG5vcm1hbDtcbmBcblxuY29uc3Qgc3VjY2Vzc01lc3NhZ2UgPSBjc3NgXG4gIG1hcmdpbi1ib3R0b206ICR7Y3VzdG9tUHJvcGVydGllcy5zcGFjaW5nTH07XG5gXG5cbmV4cG9ydCBjb25zdCBzdHlsZXMgPSB7XG4gIHRhZ0xpc3RJdGVtLFxuICB0YWdMaXN0Q29udGFpbmVyLFxuICBzbWFsbFRvcFBhZGRpbmcsXG4gIGRpdmlkZXIsXG4gIG5vdEJvbGQsXG4gIHN1Y2Nlc3NNZXNzYWdlLFxufVxuIl19 */",
|
|
505
460
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
506
461
|
};
|
|
507
|
-
const successMessage = /*#__PURE__*/react
|
|
462
|
+
const successMessage = /*#__PURE__*/react.css("margin-bottom:", designSystem.customProperties.spacingL, ";" + (process.env.NODE_ENV === "production" ? "" : ";label:successMessage;"), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInN0eWxlcy5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFxQzBCIiwiZmlsZSI6InN0eWxlcy5qcyIsInNvdXJjZXNDb250ZW50IjpbIi8vIFRPRE86IEByZWRlc2lnbiBjbGVhbnVwXG5pbXBvcnQgeyBjc3MgfSBmcm9tICdAZW1vdGlvbi9yZWFjdCdcbmltcG9ydCB7IGN1c3RvbVByb3BlcnRpZXMgfSBmcm9tICdAY29tbWVyY2V0b29scy11aWtpdC9kZXNpZ24tc3lzdGVtJ1xuXG5jb25zdCBzbWFsbFRvcFBhZGRpbmcgPSBjc3NgXG4gIHBhZGRpbmctdG9wOiAke2N1c3RvbVByb3BlcnRpZXMuc3BhY2luZ1hzfTtcbmBcblxuY29uc3QgdGFnTGlzdENvbnRhaW5lciA9ICh7IGlzTmV3VGhlbWUgfSkgPT4gY3NzYFxuICB3aWR0aDogMTAwJTtc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|
509
464
|
tagListItem,
|
|
510
465
|
tagListContainer,
|
|
@@ -514,176 +469,53 @@ const styles = {
|
|
|
514
469
|
successMessage
|
|
515
470
|
};
|
|
516
471
|
|
|
472
|
+
function TagList(props) {
|
|
473
|
+
const _useTheme = designSystem.useTheme(),
|
|
474
|
+
isNewTheme = _useTheme.isNewTheme;
|
|
475
|
+
return jsxRuntime.jsx("div", {
|
|
476
|
+
css: styles.tagListContainer({
|
|
477
|
+
isNewTheme
|
|
478
|
+
}),
|
|
479
|
+
"data-testid": props['data-testid'],
|
|
480
|
+
children: _mapInstanceProperty__default["default"](react$1.Children).call(react$1.Children, props.children, tag => jsxRuntime.jsx("div", {
|
|
481
|
+
css: styles.tagListItem,
|
|
482
|
+
children: tag
|
|
483
|
+
}))
|
|
484
|
+
});
|
|
485
|
+
}
|
|
486
|
+
TagList.displayName = 'TagList';
|
|
487
|
+
TagList.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
488
|
+
children: PropTypes__default["default"].node.isRequired,
|
|
489
|
+
'data-testid': PropTypes__default["default"].string
|
|
490
|
+
} : {};
|
|
491
|
+
|
|
517
492
|
function ownKeys$a(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
518
493
|
function _objectSpread$a(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$a(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$a(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
519
|
-
function
|
|
494
|
+
function AppliedFilters(_ref) {
|
|
495
|
+
let filters = _ref.filters,
|
|
496
|
+
onFilterRemove = _ref.onFilterRemove;
|
|
520
497
|
const _useTheme = designSystem.useTheme(),
|
|
521
498
|
isNewTheme = _useTheme.isNewTheme;
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
},
|
|
541
|
-
onChange: formik.handleChange,
|
|
542
|
-
children: [jsxRuntime.jsx(uiKit.RadioInput.Option, {
|
|
543
|
-
value: EXPORT_SELECTION_TYPES.ALL_RESOURCES,
|
|
544
|
-
"data-testid": 'test-all-resources',
|
|
545
|
-
children: jsxRuntime.jsx(uiKit.Text.Body, {
|
|
546
|
-
isBold: !isNewTheme,
|
|
547
|
-
intlMessage: _objectSpread$a(_objectSpread$a({}, messages.exportAllResources), {}, {
|
|
548
|
-
values: {
|
|
549
|
-
resourceType: resourceTypePlural,
|
|
550
|
-
count: allResourcesCount
|
|
551
|
-
}
|
|
552
|
-
})
|
|
553
|
-
})
|
|
554
|
-
}), jsxRuntime.jsx(uiKit.RadioInput.Option, {
|
|
555
|
-
value: EXPORT_SELECTION_TYPES.ONLY_MATCHING,
|
|
556
|
-
"data-testid": 'test-only-matching',
|
|
557
|
-
isDisabled: !Boolean(matchingResourcesCount),
|
|
558
|
-
children: jsxRuntime.jsx(uiKit.Text.Body, {
|
|
559
|
-
isBold: !isNewTheme,
|
|
560
|
-
intlMessage: _objectSpread$a(_objectSpread$a({}, messages.exportOnlyMatchingResources), {}, {
|
|
561
|
-
values: {
|
|
562
|
-
count: matchingResourcesCount || intl.formatMessage(messages.nothingApplied)
|
|
563
|
-
}
|
|
564
|
-
})
|
|
565
|
-
})
|
|
566
|
-
}), jsxRuntime.jsx(uiKit.RadioInput.Option, {
|
|
567
|
-
value: EXPORT_SELECTION_TYPES.ONLY_SELECTED,
|
|
568
|
-
"data-testid": 'test-only-selected',
|
|
569
|
-
isDisabled: !Boolean(selectedResourceIds.length),
|
|
570
|
-
children: jsxRuntime.jsx(uiKit.Text.Body, {
|
|
571
|
-
isBold: !isNewTheme,
|
|
572
|
-
intlMessage: _objectSpread$a(_objectSpread$a({}, messages.exportOnlySelectedResources), {}, {
|
|
573
|
-
values: {
|
|
574
|
-
resourceType: resourceTypePlural,
|
|
575
|
-
count: selectedResourceIds.length
|
|
576
|
-
}
|
|
577
|
-
})
|
|
499
|
+
if (isNewTheme) return jsxRuntime.jsx(uiKit.CollapsiblePanel, {
|
|
500
|
+
condensed: true,
|
|
501
|
+
isDefaultClosed: !Boolean(filters.length),
|
|
502
|
+
header: jsxRuntime.jsx(uiKit.Text.Body, {
|
|
503
|
+
intlMessage: _objectSpread$a(_objectSpread$a({}, messages.appliedFiltersMessage), {}, {
|
|
504
|
+
values: {
|
|
505
|
+
filtersCount: filters.length
|
|
506
|
+
}
|
|
507
|
+
})
|
|
508
|
+
}),
|
|
509
|
+
children: jsxRuntime.jsx(TagList, {
|
|
510
|
+
children: _mapInstanceProperty__default["default"](filters).call(filters, filter => jsxRuntime.jsx("div", {
|
|
511
|
+
"data-testid": "test-filter-".concat(filter),
|
|
512
|
+
children: jsxRuntime.jsx(uiKit.Tag, {
|
|
513
|
+
onRemove: () => {
|
|
514
|
+
onFilterRemove(filter);
|
|
515
|
+
},
|
|
516
|
+
children: filter
|
|
578
517
|
})
|
|
579
|
-
})
|
|
580
|
-
})
|
|
581
|
-
});
|
|
582
|
-
}
|
|
583
|
-
|
|
584
|
-
function getBold(msg) {
|
|
585
|
-
return jsxRuntime.jsx(uiKit.Text.Body, {
|
|
586
|
-
as: "span",
|
|
587
|
-
isBold: true,
|
|
588
|
-
children: msg
|
|
589
|
-
});
|
|
590
|
-
}
|
|
591
|
-
|
|
592
|
-
function ownKeys$9(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
593
|
-
function _objectSpread$9(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$9(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$9(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
594
|
-
function ExportTextMessage() {
|
|
595
|
-
const _useExportResourcesCo = useExportResourcesContext(),
|
|
596
|
-
resourceType = _useExportResourcesCo.resourceType,
|
|
597
|
-
allResourcesCount = _useExportResourcesCo.allResourcesCount,
|
|
598
|
-
selectedResourceIds = _useExportResourcesCo.selectedResourceIds,
|
|
599
|
-
matchingResourcesCount = _useExportResourcesCo.matchingResourcesCount,
|
|
600
|
-
formik = _useExportResourcesCo.formik;
|
|
601
|
-
const resourceTypePlural = resourceTypeToPlural({
|
|
602
|
-
resourceType: resourceType
|
|
603
|
-
});
|
|
604
|
-
switch (_valuesInstanceProperty__default["default"](formik).exportSelectionType) {
|
|
605
|
-
case EXPORT_SELECTION_TYPES.ALL_RESOURCES:
|
|
606
|
-
return jsxRuntime.jsx(uiKit.Text.Body, {
|
|
607
|
-
intlMessage: _objectSpread$9(_objectSpread$9({}, messages.exportAllMessage), {}, {
|
|
608
|
-
values: {
|
|
609
|
-
count: allResourcesCount,
|
|
610
|
-
resourceType: resourceTypePlural,
|
|
611
|
-
b: getBold
|
|
612
|
-
}
|
|
613
|
-
})
|
|
614
|
-
});
|
|
615
|
-
case EXPORT_SELECTION_TYPES.ONLY_MATCHING:
|
|
616
|
-
return jsxRuntime.jsx(uiKit.Text.Body, {
|
|
617
|
-
intlMessage: _objectSpread$9(_objectSpread$9({}, messages.exportMatchingMessage), {}, {
|
|
618
|
-
values: {
|
|
619
|
-
count: matchingResourcesCount,
|
|
620
|
-
resourceType: resourceTypePlural,
|
|
621
|
-
b: getBold
|
|
622
|
-
}
|
|
623
|
-
})
|
|
624
|
-
});
|
|
625
|
-
case EXPORT_SELECTION_TYPES.ONLY_SELECTED:
|
|
626
|
-
return jsxRuntime.jsx(uiKit.Text.Body, {
|
|
627
|
-
intlMessage: _objectSpread$9(_objectSpread$9({}, messages.exportSelectedMessage), {}, {
|
|
628
|
-
values: {
|
|
629
|
-
count: selectedResourceIds.length,
|
|
630
|
-
resourceType: resourceTypePlural,
|
|
631
|
-
b: getBold
|
|
632
|
-
}
|
|
633
|
-
})
|
|
634
|
-
});
|
|
635
|
-
default:
|
|
636
|
-
throw new UnexpectedSelectionTypeError(_valuesInstanceProperty__default["default"](formik).exportSelectionType);
|
|
637
|
-
}
|
|
638
|
-
}
|
|
639
|
-
|
|
640
|
-
function TagList(props) {
|
|
641
|
-
const _useTheme = designSystem.useTheme(),
|
|
642
|
-
isNewTheme = _useTheme.isNewTheme;
|
|
643
|
-
return jsxRuntime.jsx("div", {
|
|
644
|
-
css: styles.tagListContainer({
|
|
645
|
-
isNewTheme
|
|
646
|
-
}),
|
|
647
|
-
"data-testid": props['data-testid'],
|
|
648
|
-
children: _mapInstanceProperty__default["default"](react.Children).call(react.Children, props.children, tag => jsxRuntime.jsx("div", {
|
|
649
|
-
css: styles.tagListItem,
|
|
650
|
-
children: tag
|
|
651
|
-
}))
|
|
652
|
-
});
|
|
653
|
-
}
|
|
654
|
-
TagList.displayName = 'TagList';
|
|
655
|
-
TagList.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
656
|
-
children: PropTypes__default["default"].node.isRequired,
|
|
657
|
-
'data-testid': PropTypes__default["default"].string
|
|
658
|
-
} : {};
|
|
659
|
-
|
|
660
|
-
function ownKeys$8(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
661
|
-
function _objectSpread$8(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$8(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$8(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
662
|
-
function AppliedFilters(_ref) {
|
|
663
|
-
let filters = _ref.filters,
|
|
664
|
-
onFilterRemove = _ref.onFilterRemove;
|
|
665
|
-
const _useTheme = designSystem.useTheme(),
|
|
666
|
-
isNewTheme = _useTheme.isNewTheme;
|
|
667
|
-
if (isNewTheme) return jsxRuntime.jsx(uiKit.CollapsiblePanel, {
|
|
668
|
-
condensed: true,
|
|
669
|
-
isDefaultClosed: !Boolean(filters.length),
|
|
670
|
-
header: jsxRuntime.jsx(uiKit.Text.Body, {
|
|
671
|
-
intlMessage: _objectSpread$8(_objectSpread$8({}, messages.appliedFiltersMessage), {}, {
|
|
672
|
-
values: {
|
|
673
|
-
filtersCount: filters.length
|
|
674
|
-
}
|
|
675
|
-
})
|
|
676
|
-
}),
|
|
677
|
-
children: jsxRuntime.jsx(TagList, {
|
|
678
|
-
children: _mapInstanceProperty__default["default"](filters).call(filters, filter => jsxRuntime.jsx("div", {
|
|
679
|
-
"data-testid": "test-filter-".concat(filter),
|
|
680
|
-
children: jsxRuntime.jsx(uiKit.Tag, {
|
|
681
|
-
onRemove: () => {
|
|
682
|
-
onFilterRemove(filter);
|
|
683
|
-
},
|
|
684
|
-
children: filter
|
|
685
|
-
})
|
|
686
|
-
}, filter))
|
|
518
|
+
}, filter))
|
|
687
519
|
})
|
|
688
520
|
});
|
|
689
521
|
return jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
@@ -697,7 +529,7 @@ function AppliedFilters(_ref) {
|
|
|
697
529
|
color: "neutral60"
|
|
698
530
|
}), jsxRuntime.jsx(uiKit.Text.Body, {
|
|
699
531
|
isBold: true,
|
|
700
|
-
intlMessage: _objectSpread$
|
|
532
|
+
intlMessage: _objectSpread$a(_objectSpread$a({}, messages.appliedFiltersMessage), {}, {
|
|
701
533
|
values: {
|
|
702
534
|
filtersCount: filters.length
|
|
703
535
|
}
|
|
@@ -721,35 +553,14 @@ AppliedFilters.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
721
553
|
onFilterRemove: PropTypes__default["default"].func.isRequired
|
|
722
554
|
} : {};
|
|
723
555
|
|
|
724
|
-
|
|
725
|
-
function
|
|
726
|
-
const _useTheme = designSystem.useTheme(),
|
|
727
|
-
themedValue = _useTheme.themedValue;
|
|
728
|
-
return jsxRuntime.jsxs(uiKit.Spacings.Inline, {
|
|
729
|
-
scale: "m",
|
|
730
|
-
alignItems: "center",
|
|
731
|
-
children: [jsxRuntime.jsx(uiKit.Text.Body, {
|
|
732
|
-
intlMessage: messages.exportBasedOnMyViewsMessage
|
|
733
|
-
}), jsxRuntime.jsx(uiKit.Text.Body, {
|
|
734
|
-
intlMessage: messages.myViews
|
|
735
|
-
}), jsxRuntime.jsx(uiKit.Constraints.Horizontal, {
|
|
736
|
-
max: themedValue(4, 7),
|
|
737
|
-
children: jsxRuntime.jsx(uiKit.SelectInput, {
|
|
738
|
-
isDisabled: true,
|
|
739
|
-
placeholder: "Default"
|
|
740
|
-
})
|
|
741
|
-
})]
|
|
742
|
-
});
|
|
743
|
-
}
|
|
744
|
-
|
|
745
|
-
function ownKeys$7(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
746
|
-
function _objectSpread$7(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$7(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$7(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
556
|
+
function ownKeys$9(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
557
|
+
function _objectSpread$9(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$9(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$9(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
747
558
|
const IconPlaceholder = /*#__PURE__*/_styled__default["default"]("div", process.env.NODE_ENV === "production" ? {
|
|
748
|
-
target: "
|
|
559
|
+
target: "e1oion860"
|
|
749
560
|
} : {
|
|
750
|
-
target: "
|
|
561
|
+
target: "e1oion860",
|
|
751
562
|
label: "IconPlaceholder"
|
|
752
|
-
})("width:", uiKit.customProperties.spacingM, ";" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
563
|
+
})("width:", uiKit.customProperties.spacingM, ";" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImFwcGxpZWQtc2VhcmNoLXRlcm1zLmpzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFha0MiLCJmaWxlIjoiYXBwbGllZC1zZWFyY2gtdGVybXMuanN4Iiwic291cmNlc0NvbnRlbnQiOlsiLy8gVE9ETzogQHJlZGVzaWduIGNsZWFudXBcbmltcG9ydCB7IHVzZVRoZW1lIH0gZnJvbSAnQGNvbW1lcmNldG9vbHMtdWlraXQvZGVzaWduLXN5c3RlbSdcbmltcG9ydCBQcm9wVHlwZXMgZnJvbSAncHJvcC10eXBlcydcbmltcG9ydCB7XG4gIEFuZ2xlUmlnaHRJY29uLFxuICBDb2xsYXBzaWJsZVBhbmVsLFxuICBjdXN0b21Qcm9wZXJ0aWVzLFxuICBTcG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
|
753
564
|
function AppliedSearchTerms(_ref) {
|
|
754
565
|
let appliedSearchTerms = _ref.appliedSearchTerms;
|
|
755
566
|
const _useTheme = designSystem.useTheme(),
|
|
@@ -758,7 +569,7 @@ function AppliedSearchTerms(_ref) {
|
|
|
758
569
|
condensed: true,
|
|
759
570
|
isDefaultClosed: !Boolean(appliedSearchTerms.length),
|
|
760
571
|
header: jsxRuntime.jsx(uiKit.Text.Body, {
|
|
761
|
-
intlMessage: _objectSpread$
|
|
572
|
+
intlMessage: _objectSpread$9(_objectSpread$9({}, messages.appliedSearchTermsMessage), {}, {
|
|
762
573
|
values: {
|
|
763
574
|
searchTermsCount: appliedSearchTerms.length
|
|
764
575
|
}
|
|
@@ -779,7 +590,7 @@ function AppliedSearchTerms(_ref) {
|
|
|
779
590
|
color: "neutral60"
|
|
780
591
|
}), jsxRuntime.jsx(uiKit.Text.Body, {
|
|
781
592
|
isBold: true,
|
|
782
|
-
intlMessage: _objectSpread$
|
|
593
|
+
intlMessage: _objectSpread$9(_objectSpread$9({}, messages.appliedSearchTermsMessage), {}, {
|
|
783
594
|
values: {
|
|
784
595
|
searchTermsCount: appliedSearchTerms.length
|
|
785
596
|
}
|
|
@@ -798,6 +609,189 @@ AppliedSearchTerms.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
798
609
|
appliedSearchTerms: PropTypes__default["default"].array.isRequired
|
|
799
610
|
} : {};
|
|
800
611
|
|
|
612
|
+
// TODO: @redesign cleanup
|
|
613
|
+
function ExportBasedOnMyViewsSelectField() {
|
|
614
|
+
const _useTheme = designSystem.useTheme(),
|
|
615
|
+
themedValue = _useTheme.themedValue;
|
|
616
|
+
return jsxRuntime.jsxs(uiKit.Spacings.Inline, {
|
|
617
|
+
scale: "m",
|
|
618
|
+
alignItems: "center",
|
|
619
|
+
children: [jsxRuntime.jsx(uiKit.Text.Body, {
|
|
620
|
+
intlMessage: messages.exportBasedOnMyViewsMessage
|
|
621
|
+
}), jsxRuntime.jsx(uiKit.Text.Body, {
|
|
622
|
+
intlMessage: messages.myViews
|
|
623
|
+
}), jsxRuntime.jsx(uiKit.Constraints.Horizontal, {
|
|
624
|
+
max: themedValue(4, 7),
|
|
625
|
+
children: jsxRuntime.jsx(uiKit.SelectInput, {
|
|
626
|
+
isDisabled: true,
|
|
627
|
+
placeholder: "Default"
|
|
628
|
+
})
|
|
629
|
+
})]
|
|
630
|
+
});
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
function ownKeys$8(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
634
|
+
function _objectSpread$8(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$8(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$8(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
635
|
+
function renderFileNameError(key) {
|
|
636
|
+
switch (key) {
|
|
637
|
+
case 'missing':
|
|
638
|
+
return jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$8({}, messages.missingFileNameError));
|
|
639
|
+
case 'invalidInput':
|
|
640
|
+
return jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$8({}, messages.invalidFileNameError));
|
|
641
|
+
default:
|
|
642
|
+
return null;
|
|
643
|
+
}
|
|
644
|
+
}
|
|
645
|
+
function renderLanguageError(key) {
|
|
646
|
+
switch (key) {
|
|
647
|
+
case 'missing':
|
|
648
|
+
return jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$8({}, messages.missingLanguageError));
|
|
649
|
+
default:
|
|
650
|
+
return null;
|
|
651
|
+
}
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
function useExportResourcesContext() {
|
|
655
|
+
const context = react$1.useContext(ExportResourcesContext);
|
|
656
|
+
if (!context) {
|
|
657
|
+
throw new MissingExportResourceProviderError();
|
|
658
|
+
}
|
|
659
|
+
return context;
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
async function createExportOperation(_ref) {
|
|
663
|
+
let projectKey = _ref.projectKey,
|
|
664
|
+
graphQuery = _ref.graphQuery,
|
|
665
|
+
asyncDispatchFn = _ref.asyncDispatchFn;
|
|
666
|
+
const uri = "/proxy/export/".concat(projectKey, "/export-operations");
|
|
667
|
+
const response = await asyncDispatchFn(sdk.actions.post({
|
|
668
|
+
// FIXME: EXPORT is undefined
|
|
669
|
+
mcApiProxyTarget: constants.MC_API_PROXY_TARGETS.EXPORT,
|
|
670
|
+
uri: uri,
|
|
671
|
+
headers: {
|
|
672
|
+
accept: 'application/json'
|
|
673
|
+
},
|
|
674
|
+
payload: {
|
|
675
|
+
query: graphQuery
|
|
676
|
+
}
|
|
677
|
+
}));
|
|
678
|
+
return response;
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
function ownKeys$7(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
682
|
+
function _objectSpread$7(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$7(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$7(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
683
|
+
const getExportLogsLink = (projectKey, msg) => jsxRuntime.jsx(uiKit.Link, {
|
|
684
|
+
to: "/".concat(projectKey, "/operations/export/logs"),
|
|
685
|
+
children: msg
|
|
686
|
+
});
|
|
687
|
+
function ExportConfirmationModal(props) {
|
|
688
|
+
const _useApplicationContex = applicationShellConnectors.useApplicationContext(applicationContext => {
|
|
689
|
+
var _applicationContext$p, _applicationContext$p2;
|
|
690
|
+
return {
|
|
691
|
+
projectName: (_applicationContext$p = applicationContext.project) === null || _applicationContext$p === void 0 ? void 0 : _applicationContext$p.name,
|
|
692
|
+
projectKey: (_applicationContext$p2 = applicationContext.project) === null || _applicationContext$p2 === void 0 ? void 0 : _applicationContext$p2.key
|
|
693
|
+
};
|
|
694
|
+
}),
|
|
695
|
+
projectName = _useApplicationContex.projectName,
|
|
696
|
+
projectKey = _useApplicationContex.projectKey;
|
|
697
|
+
const _useExportResourcesCo = useExportResourcesContext(),
|
|
698
|
+
formik = _useExportResourcesCo.formik,
|
|
699
|
+
allResourcesCount = _useExportResourcesCo.allResourcesCount,
|
|
700
|
+
matchingResourcesCount = _useExportResourcesCo.matchingResourcesCount,
|
|
701
|
+
selectedResourceIds = _useExportResourcesCo.selectedResourceIds,
|
|
702
|
+
resourceType = _useExportResourcesCo.resourceType;
|
|
703
|
+
const showNotification = actionsGlobal.useShowNotification();
|
|
704
|
+
const intl = reactIntl.useIntl();
|
|
705
|
+
const asyncDispatch = sdk.useAsyncDispatch();
|
|
706
|
+
const resourceTypePlural = resourceTypeToPlural({
|
|
707
|
+
resourceType: props.resourceType
|
|
708
|
+
});
|
|
709
|
+
const countInConfirmationMessage = () => {
|
|
710
|
+
switch (_valuesInstanceProperty__default["default"](formik).exportSelectionType) {
|
|
711
|
+
case EXPORT_SELECTION_TYPES.ALL_RESOURCES:
|
|
712
|
+
return allResourcesCount;
|
|
713
|
+
case EXPORT_SELECTION_TYPES.ONLY_MATCHING:
|
|
714
|
+
return matchingResourcesCount;
|
|
715
|
+
case EXPORT_SELECTION_TYPES.ONLY_SELECTED:
|
|
716
|
+
return selectedResourceIds.length;
|
|
717
|
+
default:
|
|
718
|
+
throw new UnexpectedSelectionTypeError(_valuesInstanceProperty__default["default"](formik).exportSelectionType);
|
|
719
|
+
}
|
|
720
|
+
};
|
|
721
|
+
return jsxRuntime.jsx(applicationComponents.ConfirmationDialog, {
|
|
722
|
+
dataAttributesPrimaryButton: {
|
|
723
|
+
'data-testid': 'confirm-export-button'
|
|
724
|
+
},
|
|
725
|
+
title: intl.formatMessage(messages.confirmationTitle, {
|
|
726
|
+
resourceType: resourceTypePlural
|
|
727
|
+
}),
|
|
728
|
+
labelPrimary: intl.formatMessage(messages.exportConfirmationLabel, {
|
|
729
|
+
resourceType: resourceTypePlural
|
|
730
|
+
}),
|
|
731
|
+
isOpen: props.isOpen,
|
|
732
|
+
onClose: props.closeModal,
|
|
733
|
+
onCancel: props.closeModal,
|
|
734
|
+
onConfirm: async () => {
|
|
735
|
+
const graphQuery = buildGraphQuery({
|
|
736
|
+
resourceType: resourceType,
|
|
737
|
+
selectedResourceIds: selectedResourceIds,
|
|
738
|
+
fields: _valuesInstanceProperty__default["default"](formik).fields,
|
|
739
|
+
exportSelectionType: _valuesInstanceProperty__default["default"](formik).exportSelectionType,
|
|
740
|
+
languages: _valuesInstanceProperty__default["default"](formik).languages
|
|
741
|
+
});
|
|
742
|
+
props.closeModal();
|
|
743
|
+
try {
|
|
744
|
+
const response = await createExportOperation({
|
|
745
|
+
projectKey,
|
|
746
|
+
graphQuery,
|
|
747
|
+
asyncDispatchFn: asyncDispatch
|
|
748
|
+
});
|
|
749
|
+
switch (response.state) {
|
|
750
|
+
case EXPORT_OPERATION_STATES.PROCESSING:
|
|
751
|
+
case EXPORT_OPERATION_STATES.COMPLETED:
|
|
752
|
+
showNotification({
|
|
753
|
+
kind: 'success',
|
|
754
|
+
domain: constants.DOMAINS.SIDE,
|
|
755
|
+
text: intl.formatMessage(messages.exportOperationSuccessMessage, {
|
|
756
|
+
newline: getNewLine,
|
|
757
|
+
logsLink: msg => getExportLogsLink(projectKey, msg),
|
|
758
|
+
b: getBold
|
|
759
|
+
})
|
|
760
|
+
});
|
|
761
|
+
props.onCloseParentModal();
|
|
762
|
+
break;
|
|
763
|
+
default:
|
|
764
|
+
throw new UnexpectedExportOperationStateError(response.state);
|
|
765
|
+
}
|
|
766
|
+
} catch (errors) {
|
|
767
|
+
actionsGlobal.showApiErrorNotification({
|
|
768
|
+
errors
|
|
769
|
+
});
|
|
770
|
+
}
|
|
771
|
+
},
|
|
772
|
+
children: jsxRuntime.jsxs("div", {
|
|
773
|
+
children: [jsxRuntime.jsx(uiKit.Text.Body, {
|
|
774
|
+
intlMessage: _objectSpread$7(_objectSpread$7({}, messages.confirmationBodyPlan), {}, {
|
|
775
|
+
values: {
|
|
776
|
+
resourceType: resourceTypePlural,
|
|
777
|
+
projectName: projectName,
|
|
778
|
+
count: countInConfirmationMessage(),
|
|
779
|
+
bold: getBold
|
|
780
|
+
}
|
|
781
|
+
})
|
|
782
|
+
}), jsxRuntime.jsx(uiKit.Text.Body, {
|
|
783
|
+
intlMessage: messages.confirmationBodyQuestion
|
|
784
|
+
})]
|
|
785
|
+
})
|
|
786
|
+
});
|
|
787
|
+
}
|
|
788
|
+
ExportConfirmationModal.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
789
|
+
isOpen: PropTypes__default["default"].bool.isRequired,
|
|
790
|
+
resourceType: PropTypes__default["default"].string.isRequired,
|
|
791
|
+
closeModal: PropTypes__default["default"].func.isRequired,
|
|
792
|
+
onCloseParentModal: PropTypes__default["default"].func.isRequired
|
|
793
|
+
} : {};
|
|
794
|
+
|
|
801
795
|
function ownKeys$6(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
802
796
|
function _objectSpread$6(target) { for (var i = 1; i < arguments.length; i++) { var _context3, _context4; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context3 = ownKeys$6(Object(source), !0)).call(_context3, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context4 = ownKeys$6(Object(source))).call(_context4, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
803
797
|
function normalizeFields(fields) {
|
|
@@ -859,28 +853,143 @@ function ExportFields(_ref2) {
|
|
|
859
853
|
isBold: true,
|
|
860
854
|
intlMessage: _objectSpread$6(_objectSpread$6({}, messages.columnsMessage), {}, {
|
|
861
855
|
values: {
|
|
862
|
-
columnsCount: fields.length
|
|
856
|
+
columnsCount: fields.length
|
|
857
|
+
}
|
|
858
|
+
})
|
|
859
|
+
})]
|
|
860
|
+
}), jsxRuntime.jsx(FieldsRenderer, {
|
|
861
|
+
fields: fields
|
|
862
|
+
})]
|
|
863
|
+
});
|
|
864
|
+
}
|
|
865
|
+
ExportFields.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
866
|
+
// TODO: Circular reference
|
|
867
|
+
fields: PropTypes__default["default"].arrayOf(PropTypes__default["default"].shape({
|
|
868
|
+
key: PropTypes__default["default"].string.isRequired,
|
|
869
|
+
label: PropTypes__default["default"].string,
|
|
870
|
+
isLocalized: PropTypes__default["default"].bool,
|
|
871
|
+
fields: PropTypes__default["default"].arrayOf(PropTypes__default["default"].shape({
|
|
872
|
+
key: PropTypes__default["default"].string.isRequired,
|
|
873
|
+
label: PropTypes__default["default"].string,
|
|
874
|
+
isLocalized: PropTypes__default["default"].bool
|
|
875
|
+
}))
|
|
876
|
+
})).isRequired
|
|
877
|
+
} : {};
|
|
878
|
+
|
|
879
|
+
function ownKeys$5(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
880
|
+
function _objectSpread$5(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$5(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$5(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
881
|
+
function ExportSelectionRadioButtons() {
|
|
882
|
+
const _useTheme = designSystem.useTheme(),
|
|
883
|
+
isNewTheme = _useTheme.isNewTheme;
|
|
884
|
+
const intl = reactIntl.useIntl();
|
|
885
|
+
const _useExportResourcesCo = useExportResourcesContext(),
|
|
886
|
+
formik = _useExportResourcesCo.formik,
|
|
887
|
+
resourceType = _useExportResourcesCo.resourceType,
|
|
888
|
+
allResourcesCount = _useExportResourcesCo.allResourcesCount,
|
|
889
|
+
matchingResourcesCount = _useExportResourcesCo.matchingResourcesCount,
|
|
890
|
+
selectedResourceIds = _useExportResourcesCo.selectedResourceIds;
|
|
891
|
+
const resourceTypePlural = resourceTypeToPlural({
|
|
892
|
+
resourceType: resourceType
|
|
893
|
+
});
|
|
894
|
+
return jsxRuntime.jsx(uiKit.Spacings.Inline, {
|
|
895
|
+
scale: "xl",
|
|
896
|
+
children: jsxRuntime.jsxs(uiKit.RadioInput.Group, {
|
|
897
|
+
name: "exportSelectionType",
|
|
898
|
+
value: _valuesInstanceProperty__default["default"](formik).exportSelectionType,
|
|
899
|
+
direction: "inline",
|
|
900
|
+
directionProps: {
|
|
901
|
+
scale: 'xl'
|
|
902
|
+
},
|
|
903
|
+
onChange: formik.handleChange,
|
|
904
|
+
children: [jsxRuntime.jsx(uiKit.RadioInput.Option, {
|
|
905
|
+
value: EXPORT_SELECTION_TYPES.ALL_RESOURCES,
|
|
906
|
+
"data-testid": 'test-all-resources',
|
|
907
|
+
children: jsxRuntime.jsx(uiKit.Text.Body, {
|
|
908
|
+
isBold: !isNewTheme,
|
|
909
|
+
intlMessage: _objectSpread$5(_objectSpread$5({}, messages.exportAllResources), {}, {
|
|
910
|
+
values: {
|
|
911
|
+
resourceType: resourceTypePlural,
|
|
912
|
+
count: allResourcesCount
|
|
913
|
+
}
|
|
914
|
+
})
|
|
915
|
+
})
|
|
916
|
+
}), jsxRuntime.jsx(uiKit.RadioInput.Option, {
|
|
917
|
+
value: EXPORT_SELECTION_TYPES.ONLY_MATCHING,
|
|
918
|
+
"data-testid": 'test-only-matching',
|
|
919
|
+
isDisabled: !Boolean(matchingResourcesCount),
|
|
920
|
+
children: jsxRuntime.jsx(uiKit.Text.Body, {
|
|
921
|
+
isBold: !isNewTheme,
|
|
922
|
+
intlMessage: _objectSpread$5(_objectSpread$5({}, messages.exportOnlyMatchingResources), {}, {
|
|
923
|
+
values: {
|
|
924
|
+
count: matchingResourcesCount || intl.formatMessage(messages.nothingApplied)
|
|
925
|
+
}
|
|
926
|
+
})
|
|
927
|
+
})
|
|
928
|
+
}), jsxRuntime.jsx(uiKit.RadioInput.Option, {
|
|
929
|
+
value: EXPORT_SELECTION_TYPES.ONLY_SELECTED,
|
|
930
|
+
"data-testid": 'test-only-selected',
|
|
931
|
+
isDisabled: !Boolean(selectedResourceIds.length),
|
|
932
|
+
children: jsxRuntime.jsx(uiKit.Text.Body, {
|
|
933
|
+
isBold: !isNewTheme,
|
|
934
|
+
intlMessage: _objectSpread$5(_objectSpread$5({}, messages.exportOnlySelectedResources), {}, {
|
|
935
|
+
values: {
|
|
936
|
+
resourceType: resourceTypePlural,
|
|
937
|
+
count: selectedResourceIds.length
|
|
938
|
+
}
|
|
939
|
+
})
|
|
940
|
+
})
|
|
941
|
+
})]
|
|
942
|
+
})
|
|
943
|
+
});
|
|
944
|
+
}
|
|
945
|
+
|
|
946
|
+
function ownKeys$4(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
947
|
+
function _objectSpread$4(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$4(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$4(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
948
|
+
function ExportTextMessage() {
|
|
949
|
+
const _useExportResourcesCo = useExportResourcesContext(),
|
|
950
|
+
resourceType = _useExportResourcesCo.resourceType,
|
|
951
|
+
allResourcesCount = _useExportResourcesCo.allResourcesCount,
|
|
952
|
+
selectedResourceIds = _useExportResourcesCo.selectedResourceIds,
|
|
953
|
+
matchingResourcesCount = _useExportResourcesCo.matchingResourcesCount,
|
|
954
|
+
formik = _useExportResourcesCo.formik;
|
|
955
|
+
const resourceTypePlural = resourceTypeToPlural({
|
|
956
|
+
resourceType: resourceType
|
|
957
|
+
});
|
|
958
|
+
switch (_valuesInstanceProperty__default["default"](formik).exportSelectionType) {
|
|
959
|
+
case EXPORT_SELECTION_TYPES.ALL_RESOURCES:
|
|
960
|
+
return jsxRuntime.jsx(uiKit.Text.Body, {
|
|
961
|
+
intlMessage: _objectSpread$4(_objectSpread$4({}, messages.exportAllMessage), {}, {
|
|
962
|
+
values: {
|
|
963
|
+
count: allResourcesCount,
|
|
964
|
+
resourceType: resourceTypePlural,
|
|
965
|
+
b: getBold
|
|
966
|
+
}
|
|
967
|
+
})
|
|
968
|
+
});
|
|
969
|
+
case EXPORT_SELECTION_TYPES.ONLY_MATCHING:
|
|
970
|
+
return jsxRuntime.jsx(uiKit.Text.Body, {
|
|
971
|
+
intlMessage: _objectSpread$4(_objectSpread$4({}, messages.exportMatchingMessage), {}, {
|
|
972
|
+
values: {
|
|
973
|
+
count: matchingResourcesCount,
|
|
974
|
+
resourceType: resourceTypePlural,
|
|
975
|
+
b: getBold
|
|
863
976
|
}
|
|
864
977
|
})
|
|
865
|
-
})
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
978
|
+
});
|
|
979
|
+
case EXPORT_SELECTION_TYPES.ONLY_SELECTED:
|
|
980
|
+
return jsxRuntime.jsx(uiKit.Text.Body, {
|
|
981
|
+
intlMessage: _objectSpread$4(_objectSpread$4({}, messages.exportSelectedMessage), {}, {
|
|
982
|
+
values: {
|
|
983
|
+
count: selectedResourceIds.length,
|
|
984
|
+
resourceType: resourceTypePlural,
|
|
985
|
+
b: getBold
|
|
986
|
+
}
|
|
987
|
+
})
|
|
988
|
+
});
|
|
989
|
+
default:
|
|
990
|
+
throw new UnexpectedSelectionTypeError(_valuesInstanceProperty__default["default"](formik).exportSelectionType);
|
|
991
|
+
}
|
|
870
992
|
}
|
|
871
|
-
ExportFields.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
872
|
-
// TODO: Circular reference
|
|
873
|
-
fields: PropTypes__default["default"].arrayOf(PropTypes__default["default"].shape({
|
|
874
|
-
key: PropTypes__default["default"].string.isRequired,
|
|
875
|
-
label: PropTypes__default["default"].string,
|
|
876
|
-
isLocalized: PropTypes__default["default"].bool,
|
|
877
|
-
fields: PropTypes__default["default"].arrayOf(PropTypes__default["default"].shape({
|
|
878
|
-
key: PropTypes__default["default"].string.isRequired,
|
|
879
|
-
label: PropTypes__default["default"].string,
|
|
880
|
-
isLocalized: PropTypes__default["default"].bool
|
|
881
|
-
}))
|
|
882
|
-
})).isRequired
|
|
883
|
-
} : {};
|
|
884
993
|
|
|
885
994
|
const ExportSelection = () => {
|
|
886
995
|
const _useTheme = designSystem.useTheme(),
|
|
@@ -944,8 +1053,8 @@ const ExportSelection = () => {
|
|
|
944
1053
|
});
|
|
945
1054
|
};
|
|
946
1055
|
|
|
947
|
-
function ownKeys$
|
|
948
|
-
function _objectSpread$
|
|
1056
|
+
function ownKeys$3(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
1057
|
+
function _objectSpread$3(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$3(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$3(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
949
1058
|
const ExportProperties = props => {
|
|
950
1059
|
const _useTheme = designSystem.useTheme(),
|
|
951
1060
|
isNewTheme = _useTheme.isNewTheme;
|
|
@@ -962,7 +1071,7 @@ const ExportProperties = props => {
|
|
|
962
1071
|
return jsxRuntime.jsx(uiKit.CollapsiblePanel, {
|
|
963
1072
|
header: jsxRuntime.jsx(uiKit.Text.Body, {
|
|
964
1073
|
isBold: true,
|
|
965
|
-
intlMessage: _objectSpread$
|
|
1074
|
+
intlMessage: _objectSpread$3({}, messages.propertiesPanelLabel)
|
|
966
1075
|
}),
|
|
967
1076
|
children: props.renderProperties()
|
|
968
1077
|
});
|
|
@@ -971,29 +1080,8 @@ ExportProperties.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
971
1080
|
renderProperties: PropTypes__default["default"].func
|
|
972
1081
|
} : {};
|
|
973
1082
|
|
|
974
|
-
function ownKeys$
|
|
975
|
-
function _objectSpread$
|
|
976
|
-
function renderFileNameError(key) {
|
|
977
|
-
switch (key) {
|
|
978
|
-
case 'missing':
|
|
979
|
-
return jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$4({}, messages.missingFileNameError));
|
|
980
|
-
case 'invalidInput':
|
|
981
|
-
return jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$4({}, messages.invalidFileNameError));
|
|
982
|
-
default:
|
|
983
|
-
return null;
|
|
984
|
-
}
|
|
985
|
-
}
|
|
986
|
-
function renderLanguageError(key) {
|
|
987
|
-
switch (key) {
|
|
988
|
-
case 'missing':
|
|
989
|
-
return jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$4({}, messages.missingLanguageError));
|
|
990
|
-
default:
|
|
991
|
-
return null;
|
|
992
|
-
}
|
|
993
|
-
}
|
|
994
|
-
|
|
995
|
-
function ownKeys$3(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
996
|
-
function _objectSpread$3(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$3(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$3(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
1083
|
+
function ownKeys$2(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
1084
|
+
function _objectSpread$2(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$2(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$2(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
997
1085
|
const outputFormatOptions = [{
|
|
998
1086
|
value: OUTPUT_FORMATS.JSON,
|
|
999
1087
|
label: 'JSON'
|
|
@@ -1027,12 +1115,12 @@ function ExportFileSettings(props) {
|
|
|
1027
1115
|
children: [jsxRuntime.jsx(applicationComponents.PageContentNarrow, {
|
|
1028
1116
|
children: jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
1029
1117
|
scale: "xl",
|
|
1030
|
-
children: [jsxRuntime.jsx(uiKit.SelectField, _objectSpread$
|
|
1118
|
+
children: [jsxRuntime.jsx(uiKit.SelectField, _objectSpread$2(_objectSpread$2({
|
|
1031
1119
|
isDisabled: true
|
|
1032
1120
|
}, formik.getFieldProps('outputFormat')), {}, {
|
|
1033
1121
|
title: intl.formatMessage(messages.outputFormat),
|
|
1034
1122
|
options: outputFormatOptions
|
|
1035
|
-
})), jsxRuntime.jsx(uiKit.TextField, _objectSpread$
|
|
1123
|
+
})), jsxRuntime.jsx(uiKit.TextField, _objectSpread$2(_objectSpread$2({
|
|
1036
1124
|
title: intl.formatMessage(messages.fileName)
|
|
1037
1125
|
}, formik.getFieldProps('fileName')), {}, {
|
|
1038
1126
|
touched: formik.touched.fileName,
|
|
@@ -1040,7 +1128,7 @@ function ExportFileSettings(props) {
|
|
|
1040
1128
|
renderError: renderFileNameError
|
|
1041
1129
|
})), jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
1042
1130
|
scale: "xs",
|
|
1043
|
-
children: [jsxRuntime.jsx(uiKit.SelectField, _objectSpread$
|
|
1131
|
+
children: [jsxRuntime.jsx(uiKit.SelectField, _objectSpread$2(_objectSpread$2({
|
|
1044
1132
|
id: "languages",
|
|
1045
1133
|
title: intl.formatMessage(messages.localLanguage),
|
|
1046
1134
|
options: mapLanguagesToOptions(languages),
|
|
@@ -1077,13 +1165,13 @@ function ExportFileSettings(props) {
|
|
|
1077
1165
|
scale: "l",
|
|
1078
1166
|
children: [jsxRuntime.jsxs(uiKit.Spacings.Inline, {
|
|
1079
1167
|
scale: "l",
|
|
1080
|
-
children: [jsxRuntime.jsx(uiKit.SelectField, _objectSpread$
|
|
1168
|
+
children: [jsxRuntime.jsx(uiKit.SelectField, _objectSpread$2(_objectSpread$2({
|
|
1081
1169
|
isDisabled: true
|
|
1082
1170
|
}, formik.getFieldProps('outputFormat')), {}, {
|
|
1083
1171
|
title: intl.formatMessage(messages.outputFormat),
|
|
1084
1172
|
options: outputFormatOptions,
|
|
1085
1173
|
horizontalConstraint: 7
|
|
1086
|
-
})), jsxRuntime.jsx(uiKit.TextField, _objectSpread$
|
|
1174
|
+
})), jsxRuntime.jsx(uiKit.TextField, _objectSpread$2(_objectSpread$2({
|
|
1087
1175
|
title: intl.formatMessage(messages.fileName)
|
|
1088
1176
|
}, formik.getFieldProps('fileName')), {}, {
|
|
1089
1177
|
touched: formik.touched.fileName,
|
|
@@ -1092,7 +1180,7 @@ function ExportFileSettings(props) {
|
|
|
1092
1180
|
horizontalConstraint: 7
|
|
1093
1181
|
}))]
|
|
1094
1182
|
}), jsxRuntime.jsx(uiKit.Spacings.Inline, {
|
|
1095
|
-
children: jsxRuntime.jsx(uiKit.SelectField, _objectSpread$
|
|
1183
|
+
children: jsxRuntime.jsx(uiKit.SelectField, _objectSpread$2(_objectSpread$2({
|
|
1096
1184
|
id: "languages",
|
|
1097
1185
|
title: jsxRuntime.jsxs(uiKit.Spacings.Inline, {
|
|
1098
1186
|
scale: "s",
|
|
@@ -1134,161 +1222,73 @@ ExportFileSettings.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
1134
1222
|
renderProperties: PropTypes__default["default"].func
|
|
1135
1223
|
} : {};
|
|
1136
1224
|
|
|
1137
|
-
|
|
1138
|
-
let projectKey = _ref.projectKey,
|
|
1139
|
-
graphQuery = _ref.graphQuery,
|
|
1140
|
-
asyncDispatchFn = _ref.asyncDispatchFn;
|
|
1141
|
-
const uri = "/proxy/export/".concat(projectKey, "/export-operations");
|
|
1142
|
-
const response = await asyncDispatchFn(sdk.actions.post({
|
|
1143
|
-
// FIXME: EXPORT is undefined
|
|
1144
|
-
mcApiProxyTarget: constants.MC_API_PROXY_TARGETS.EXPORT,
|
|
1145
|
-
uri: uri,
|
|
1146
|
-
headers: {
|
|
1147
|
-
accept: 'application/json'
|
|
1148
|
-
},
|
|
1149
|
-
payload: {
|
|
1150
|
-
query: graphQuery
|
|
1151
|
-
}
|
|
1152
|
-
}));
|
|
1153
|
-
return response;
|
|
1154
|
-
}
|
|
1225
|
+
const ExportResourcesContext = /*#__PURE__*/react$1.createContext();
|
|
1155
1226
|
|
|
1156
|
-
|
|
1157
|
-
function _objectSpread$2(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$2(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$2(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
1158
|
-
function ExportConfirmationModal(props) {
|
|
1159
|
-
const _useApplicationContex = applicationShellConnectors.useApplicationContext(applicationContext => {
|
|
1160
|
-
var _applicationContext$p, _applicationContext$p2;
|
|
1161
|
-
return {
|
|
1162
|
-
projectName: (_applicationContext$p = applicationContext.project) === null || _applicationContext$p === void 0 ? void 0 : _applicationContext$p.name,
|
|
1163
|
-
projectKey: (_applicationContext$p2 = applicationContext.project) === null || _applicationContext$p2 === void 0 ? void 0 : _applicationContext$p2.key
|
|
1164
|
-
};
|
|
1165
|
-
}),
|
|
1166
|
-
projectName = _useApplicationContex.projectName,
|
|
1167
|
-
projectKey = _useApplicationContex.projectKey;
|
|
1168
|
-
const _useExportResourcesCo = useExportResourcesContext(),
|
|
1169
|
-
formik = _useExportResourcesCo.formik,
|
|
1170
|
-
allResourcesCount = _useExportResourcesCo.allResourcesCount,
|
|
1171
|
-
matchingResourcesCount = _useExportResourcesCo.matchingResourcesCount,
|
|
1172
|
-
selectedResourceIds = _useExportResourcesCo.selectedResourceIds,
|
|
1173
|
-
resourceType = _useExportResourcesCo.resourceType,
|
|
1174
|
-
setExportOperationStarted = _useExportResourcesCo.setExportOperationStarted;
|
|
1175
|
-
const intl = reactIntl.useIntl();
|
|
1176
|
-
const asyncDispatch = sdk.useAsyncDispatch();
|
|
1177
|
-
const resourceTypePlural = resourceTypeToPlural({
|
|
1178
|
-
resourceType: props.resourceType
|
|
1179
|
-
});
|
|
1180
|
-
const countInConfirmationMessage = () => {
|
|
1181
|
-
switch (_valuesInstanceProperty__default["default"](formik).exportSelectionType) {
|
|
1182
|
-
case EXPORT_SELECTION_TYPES.ALL_RESOURCES:
|
|
1183
|
-
return allResourcesCount;
|
|
1184
|
-
case EXPORT_SELECTION_TYPES.ONLY_MATCHING:
|
|
1185
|
-
return matchingResourcesCount;
|
|
1186
|
-
case EXPORT_SELECTION_TYPES.ONLY_SELECTED:
|
|
1187
|
-
return selectedResourceIds.length;
|
|
1188
|
-
default:
|
|
1189
|
-
throw new UnexpectedSelectionTypeError(_valuesInstanceProperty__default["default"](formik).exportSelectionType);
|
|
1190
|
-
}
|
|
1191
|
-
};
|
|
1192
|
-
return jsxRuntime.jsx(applicationComponents.ConfirmationDialog, {
|
|
1193
|
-
dataAttributesPrimaryButton: {
|
|
1194
|
-
'data-testid': 'confirm-export-button'
|
|
1195
|
-
},
|
|
1196
|
-
title: intl.formatMessage(messages.confirmationTitle, {
|
|
1197
|
-
resourceType: resourceTypePlural
|
|
1198
|
-
}),
|
|
1199
|
-
labelPrimary: intl.formatMessage(messages.exportConfirmationLabel, {
|
|
1200
|
-
resourceType: resourceTypePlural
|
|
1201
|
-
}),
|
|
1202
|
-
isOpen: props.isOpen,
|
|
1203
|
-
onClose: props.closeModal,
|
|
1204
|
-
onCancel: props.closeModal,
|
|
1205
|
-
onConfirm: async () => {
|
|
1206
|
-
setExportOperationStarted(false);
|
|
1207
|
-
const graphQuery = buildGraphQuery({
|
|
1208
|
-
resourceType: resourceType,
|
|
1209
|
-
selectedResourceIds: selectedResourceIds,
|
|
1210
|
-
fields: _valuesInstanceProperty__default["default"](formik).fields,
|
|
1211
|
-
exportSelectionType: _valuesInstanceProperty__default["default"](formik).exportSelectionType,
|
|
1212
|
-
languages: _valuesInstanceProperty__default["default"](formik).languages
|
|
1213
|
-
});
|
|
1214
|
-
props.closeModal();
|
|
1215
|
-
try {
|
|
1216
|
-
const response = await createExportOperation({
|
|
1217
|
-
projectKey,
|
|
1218
|
-
graphQuery,
|
|
1219
|
-
asyncDispatchFn: asyncDispatch
|
|
1220
|
-
});
|
|
1221
|
-
switch (response.state) {
|
|
1222
|
-
case EXPORT_OPERATION_STATES.PROCESSING:
|
|
1223
|
-
case EXPORT_OPERATION_STATES.COMPLETED:
|
|
1224
|
-
setExportOperationStarted(true);
|
|
1225
|
-
break;
|
|
1226
|
-
default:
|
|
1227
|
-
throw new UnexpectedExportOperationStateError(response.state);
|
|
1228
|
-
}
|
|
1229
|
-
} catch (errors) {
|
|
1230
|
-
actionsGlobal.showApiErrorNotification({
|
|
1231
|
-
errors
|
|
1232
|
-
});
|
|
1233
|
-
}
|
|
1234
|
-
},
|
|
1235
|
-
children: jsxRuntime.jsxs("div", {
|
|
1236
|
-
children: [jsxRuntime.jsx(uiKit.Text.Body, {
|
|
1237
|
-
intlMessage: _objectSpread$2(_objectSpread$2({}, messages.confirmationBodyPlan), {}, {
|
|
1238
|
-
values: {
|
|
1239
|
-
resourceType: resourceTypePlural,
|
|
1240
|
-
projectName: projectName,
|
|
1241
|
-
count: countInConfirmationMessage(),
|
|
1242
|
-
bold: getBold
|
|
1243
|
-
}
|
|
1244
|
-
})
|
|
1245
|
-
}), jsxRuntime.jsx(uiKit.Text.Body, {
|
|
1246
|
-
intlMessage: messages.confirmationBodyQuestion
|
|
1247
|
-
})]
|
|
1248
|
-
})
|
|
1249
|
-
});
|
|
1250
|
-
}
|
|
1251
|
-
ExportConfirmationModal.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
1252
|
-
isOpen: PropTypes__default["default"].bool.isRequired,
|
|
1227
|
+
const ExportResourcesModalShape = PropTypes__default["default"].shape({
|
|
1253
1228
|
resourceType: PropTypes__default["default"].string.isRequired,
|
|
1254
|
-
|
|
1255
|
-
|
|
1229
|
+
outputFormat: PropTypes__default["default"].string,
|
|
1230
|
+
isOpen: PropTypes__default["default"].bool.isRequired,
|
|
1231
|
+
closeModal: PropTypes__default["default"].func.isRequired,
|
|
1232
|
+
allResourcesCount: PropTypes__default["default"].number.isRequired,
|
|
1233
|
+
matchingResourcesCount: PropTypes__default["default"].number,
|
|
1234
|
+
selectedResourceIds: PropTypes__default["default"].array,
|
|
1235
|
+
// TODO: Circular reference
|
|
1236
|
+
fields: PropTypes__default["default"].arrayOf(PropTypes__default["default"].shape({
|
|
1237
|
+
key: PropTypes__default["default"].string.isRequired,
|
|
1238
|
+
label: PropTypes__default["default"].string,
|
|
1239
|
+
isLocalized: PropTypes__default["default"].bool,
|
|
1240
|
+
fields: PropTypes__default["default"].arrayOf(PropTypes__default["default"].shape({
|
|
1241
|
+
key: PropTypes__default["default"].string.isRequired,
|
|
1242
|
+
label: PropTypes__default["default"].string,
|
|
1243
|
+
isLocalized: PropTypes__default["default"].bool
|
|
1244
|
+
}))
|
|
1245
|
+
})).isRequired,
|
|
1246
|
+
exportSelectionType: PropTypes__default["default"].string,
|
|
1247
|
+
appliedSearchTerms: PropTypes__default["default"].array,
|
|
1248
|
+
appliedFilters: PropTypes__default["default"].array,
|
|
1249
|
+
renderProperties: PropTypes__default["default"].func
|
|
1250
|
+
}).isRequired;
|
|
1256
1251
|
|
|
1257
1252
|
function ownKeys$1(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
1258
|
-
function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var
|
|
1259
|
-
const
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
values: {
|
|
1282
|
-
logsLink: msg => getExportLogsLink(projectKey, msg)
|
|
1283
|
-
}
|
|
1284
|
-
})
|
|
1285
|
-
})
|
|
1286
|
-
})
|
|
1253
|
+
function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys$1(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys$1(Object(source))).call(_context3, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
1254
|
+
const ExportResourcesContextProvider = props => {
|
|
1255
|
+
var _context;
|
|
1256
|
+
const todayFormatted = moment__default["default"]().format('DD-MM-YY_HH-mm');
|
|
1257
|
+
const _useApplicationContex = applicationShellConnectors.useApplicationContext(applicationContext => ({
|
|
1258
|
+
language: applicationContext.dataLocale
|
|
1259
|
+
})),
|
|
1260
|
+
language = _useApplicationContex.language;
|
|
1261
|
+
const formik$1 = formik.useFormik({
|
|
1262
|
+
initialValues: {
|
|
1263
|
+
outputFormat: props.outputFormat,
|
|
1264
|
+
fileName: _concatInstanceProperty__default["default"](_context = "".concat(resourceTypeToPlural({
|
|
1265
|
+
resourceType: props.resourceType,
|
|
1266
|
+
isUpperCase: true
|
|
1267
|
+
}), "_Export_")).call(_context, todayFormatted),
|
|
1268
|
+
languages: [language],
|
|
1269
|
+
fields: props.fields,
|
|
1270
|
+
appliedSearchTerms: props.appliedSearchTerms,
|
|
1271
|
+
appliedFilters: props.appliedFilters,
|
|
1272
|
+
exportSelectionType: props.exportSelectionType,
|
|
1273
|
+
isAllLanguagesChecked: false
|
|
1274
|
+
},
|
|
1275
|
+
validate
|
|
1287
1276
|
});
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1277
|
+
return jsxRuntime.jsx(ExportResourcesContext.Provider, {
|
|
1278
|
+
value: {
|
|
1279
|
+
formik: formik$1,
|
|
1280
|
+
resourceType: props.resourceType,
|
|
1281
|
+
allResourcesCount: props.allResourcesCount,
|
|
1282
|
+
matchingResourcesCount: props.matchingResourcesCount,
|
|
1283
|
+
selectedResourceIds: props.selectedResourceIds
|
|
1284
|
+
},
|
|
1285
|
+
children: props.children
|
|
1286
|
+
});
|
|
1287
|
+
};
|
|
1288
|
+
ExportResourcesContextProvider.displayName = 'ExportResourcesContextProvider';
|
|
1289
|
+
ExportResourcesContextProvider.propTypes = process.env.NODE_ENV !== "production" ? _objectSpread$1(_objectSpread$1({}, ExportResourcesModalShape), {}, {
|
|
1290
|
+
children: PropTypes__default["default"].node
|
|
1291
|
+
}) : {};
|
|
1292
1292
|
|
|
1293
1293
|
const _excluded = ["renderProperties"];
|
|
1294
1294
|
function ownKeys(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
@@ -1304,8 +1304,7 @@ const ExportResourcesModal = _ref => {
|
|
|
1304
1304
|
return jsxRuntime.jsx(ExportResourcesContextProvider, _objectSpread(_objectSpread({}, props), {}, {
|
|
1305
1305
|
children: jsxRuntime.jsx(ExportResourcesContext.Consumer, {
|
|
1306
1306
|
children: _ref2 => {
|
|
1307
|
-
let formik = _ref2.formik
|
|
1308
|
-
exportOperationStarted = _ref2.exportOperationStarted;
|
|
1307
|
+
let formik = _ref2.formik;
|
|
1309
1308
|
return jsxRuntime.jsxs(applicationComponents.FormModalPage, {
|
|
1310
1309
|
title: intl.formatMessage(messages.modalTitle, {
|
|
1311
1310
|
resourceType: resourceTypePlural
|
|
@@ -1322,14 +1321,13 @@ const ExportResourcesModal = _ref => {
|
|
|
1322
1321
|
resourceType: props.resourceType
|
|
1323
1322
|
}),
|
|
1324
1323
|
onPrimaryButtonClick: confirmationModal.openModal,
|
|
1325
|
-
children: [jsxRuntime.jsx(
|
|
1326
|
-
isShown: exportOperationStarted
|
|
1327
|
-
}), jsxRuntime.jsx(ExportFileSettings, {
|
|
1324
|
+
children: [jsxRuntime.jsx(ExportFileSettings, {
|
|
1328
1325
|
renderProperties: renderProperties
|
|
1329
1326
|
}), jsxRuntime.jsx(ExportConfirmationModal, {
|
|
1330
1327
|
resourceType: props.resourceType,
|
|
1331
1328
|
isOpen: confirmationModal.isModalOpen,
|
|
1332
|
-
closeModal: confirmationModal.closeModal
|
|
1329
|
+
closeModal: confirmationModal.closeModal,
|
|
1330
|
+
onCloseParentModal: props.closeModal
|
|
1333
1331
|
})]
|
|
1334
1332
|
});
|
|
1335
1333
|
}
|