@commercetools-frontend-extensions/export-resources-modal 1.3.1 → 1.3.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.
|
@@ -8,8 +8,8 @@ import _Object$defineProperties from '@babel/runtime-corejs3/core-js-stable/obje
|
|
|
8
8
|
import _Object$defineProperty from '@babel/runtime-corejs3/core-js-stable/object/define-property';
|
|
9
9
|
import _defineProperty from '@babel/runtime-corejs3/helpers/esm/defineProperty';
|
|
10
10
|
import _objectWithoutProperties from '@babel/runtime-corejs3/helpers/esm/objectWithoutProperties';
|
|
11
|
-
import { defineMessages,
|
|
12
|
-
import { PageContentNarrow, PageContentWide,
|
|
11
|
+
import { defineMessages, FormattedMessage, useIntl } from 'react-intl';
|
|
12
|
+
import { ConfirmationDialog, PageContentNarrow, PageContentWide, useModalState, FormModalPage } from '@commercetools-frontend/application-components';
|
|
13
13
|
import _mapInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/map';
|
|
14
14
|
import _flatInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/flat';
|
|
15
15
|
import _concatInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/concat';
|
|
@@ -22,42 +22,45 @@ import _possibleConstructorReturn from '@babel/runtime-corejs3/helpers/esm/possi
|
|
|
22
22
|
import _getPrototypeOf from '@babel/runtime-corejs3/helpers/esm/getPrototypeOf';
|
|
23
23
|
import _wrapNativeSuper from '@babel/runtime-corejs3/helpers/esm/wrapNativeSuper';
|
|
24
24
|
import _Array$isArray from '@babel/runtime-corejs3/core-js-stable/array/is-array';
|
|
25
|
-
import
|
|
26
|
-
import PropTypes from 'prop-types';
|
|
27
|
-
import { useFormik } from 'formik';
|
|
28
|
-
import moment from 'moment';
|
|
29
|
-
import { useApplicationContext } from '@commercetools-frontend/application-shell-connectors';
|
|
30
|
-
import { createContext, useState, useContext, Children } from 'react';
|
|
31
|
-
import { TextInput, Spacings, RadioInput, Text, CollapsiblePanel, Tag, AngleRightIcon, Constraints, SelectInput, customProperties as customProperties$1, Card, SelectField, TextField, CheckboxInput, ContentNotification, Link } from '@commercetools-frontend/ui-kit';
|
|
25
|
+
import { TextInput, Text, CollapsiblePanel, Tag, Spacings, AngleRightIcon, customProperties as customProperties$1, Constraints, SelectInput, RadioInput, Card, SelectField, TextField, CheckboxInput, ContentNotification, Link } from '@commercetools-frontend/ui-kit';
|
|
32
26
|
import omitEmpty from 'omit-empty-es';
|
|
33
27
|
import { jsx, jsxs, Fragment } from '@emotion/react/jsx-runtime';
|
|
34
|
-
import _valuesInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/values';
|
|
35
28
|
import { customProperties, useTheme } from '@commercetools-uikit/design-system';
|
|
29
|
+
import PropTypes from 'prop-types';
|
|
30
|
+
import React, { Children, useContext, createContext } from 'react';
|
|
36
31
|
import { css } from '@emotion/react';
|
|
37
32
|
import _styled from '@emotion/styled/base';
|
|
33
|
+
import _valuesInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/values';
|
|
34
|
+
import { useApplicationContext } from '@commercetools-frontend/application-shell-connectors';
|
|
38
35
|
import { actions, useAsyncDispatch } from '@commercetools-frontend/sdk';
|
|
39
36
|
import { showApiErrorNotification } from '@commercetools-frontend/actions-global';
|
|
37
|
+
import _slicedToArray from '@babel/runtime-corejs3/helpers/esm/slicedToArray';
|
|
38
|
+
import { useFormik } from 'formik';
|
|
39
|
+
import moment from 'moment';
|
|
40
40
|
import { MC_API_PROXY_TARGETS } from '@commercetools-frontend/constants';
|
|
41
41
|
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
42
|
+
const EXPORT_OPERATION_STATES = {
|
|
43
|
+
PROCESSING: 'processing',
|
|
44
|
+
COMPLETED: 'completed',
|
|
45
|
+
FAILED: 'failed'
|
|
46
46
|
};
|
|
47
|
+
|
|
47
48
|
const EXPORT_SELECTION_TYPES = {
|
|
48
49
|
ALL_RESOURCES: 'allResources',
|
|
49
50
|
ONLY_MATCHING: 'onlyMatching',
|
|
50
51
|
ONLY_SELECTED: 'onlySelected'
|
|
51
52
|
};
|
|
53
|
+
|
|
54
|
+
const EXPORTABLE_RESOURCES = {
|
|
55
|
+
CATEGORY: 'category',
|
|
56
|
+
PRODUCT: 'product',
|
|
57
|
+
DISCOUNT_CODE: 'discountCode'
|
|
58
|
+
};
|
|
59
|
+
|
|
52
60
|
const OUTPUT_FORMATS = {
|
|
53
61
|
JSON: 'json',
|
|
54
62
|
CSV: 'csv'
|
|
55
63
|
};
|
|
56
|
-
const EXPORT_OPERATION_STATES = {
|
|
57
|
-
PROCESSING: 'processing',
|
|
58
|
-
COMPLETED: 'completed',
|
|
59
|
-
FAILED: 'failed'
|
|
60
|
-
};
|
|
61
64
|
|
|
62
65
|
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(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
63
66
|
function _isNativeReflectConstruct$3() { if (typeof Reflect === "undefined" || !_Reflect$construct) return false; if (_Reflect$construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
@@ -153,6 +156,14 @@ function isFilledArray(maybeArray) {
|
|
|
153
156
|
return _Array$isArray(maybeArray) && maybeArray.length;
|
|
154
157
|
}
|
|
155
158
|
|
|
159
|
+
/*
|
|
160
|
+
* This function is responsible for constructing the GraphQL query based on the export settings
|
|
161
|
+
*
|
|
162
|
+
* Depending on the type of export selection (all resources, only selected, or only matching/filtered) it constructs different types of queries:
|
|
163
|
+
* - For 'all resources', it generates a query that fetches all fields and languages specified in the export settings.
|
|
164
|
+
* - 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.
|
|
165
|
+
* - 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.
|
|
166
|
+
*/
|
|
156
167
|
function buildGraphQuery(exportSettings) {
|
|
157
168
|
var _context;
|
|
158
169
|
const operation = resourceTypeToOperationName(exportSettings.resourceType);
|
|
@@ -188,6 +199,21 @@ function buildGraphQuery(exportSettings) {
|
|
|
188
199
|
throw new UnexpectedSelectionTypeError(exportSettings.exportSelectionType);
|
|
189
200
|
}
|
|
190
201
|
}
|
|
202
|
+
|
|
203
|
+
/*
|
|
204
|
+
* This function builds the necessary field structure for our GraphQL queries, tt is specifically designed to handle different types of fields
|
|
205
|
+
*
|
|
206
|
+
* For fields whose values change depending on the language aka localised fields, a unique request format is used
|
|
207
|
+
* 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
|
|
208
|
+
*
|
|
209
|
+
* Fields that don't vary by language but contain additional subfields (known as 'nested fields') are also addressed
|
|
210
|
+
* In these cases the function is used recursively on these subfields to generate the appropriate request.
|
|
211
|
+
*
|
|
212
|
+
* Overall, this function enables us to accurately request different types of data, including those varying by language or containing subfields.
|
|
213
|
+
*
|
|
214
|
+
* More details can be found in the related PR: https://github.com/commercetools/commercetools-exporter/pull/103
|
|
215
|
+
*/
|
|
216
|
+
|
|
191
217
|
function buildFields(_ref) {
|
|
192
218
|
var _context2;
|
|
193
219
|
let fields = _ref.fields,
|
|
@@ -195,7 +221,7 @@ function buildFields(_ref) {
|
|
|
195
221
|
return _flatInstanceProperty(_context2 = _mapInstanceProperty(fields).call(fields, field => {
|
|
196
222
|
if (field.isLocalized) return _mapInstanceProperty(languages).call(languages, language => {
|
|
197
223
|
var _context3, _context4, _context5;
|
|
198
|
-
const alias = replaceSpecialCharsWithUnderscore(_concatInstanceProperty(_context3 = "".concat(field.key, "
|
|
224
|
+
const alias = replaceSpecialCharsWithUnderscore(_concatInstanceProperty(_context3 = "".concat(field.key, "_____")).call(_context3, language));
|
|
199
225
|
return _concatInstanceProperty(_context4 = _concatInstanceProperty(_context5 = "".concat(alias, ": ")).call(_context5, field.key, "(locale: \"")).call(_context4, language, "\")");
|
|
200
226
|
});else {
|
|
201
227
|
if (isFilledArray(field.fields)) {
|
|
@@ -211,6 +237,22 @@ function buildFields(_ref) {
|
|
|
211
237
|
})).call(_context2);
|
|
212
238
|
}
|
|
213
239
|
|
|
240
|
+
function validate(values) {
|
|
241
|
+
const errors = {
|
|
242
|
+
fileName: {},
|
|
243
|
+
languages: {}
|
|
244
|
+
};
|
|
245
|
+
if (TextInput.isEmpty(values.fileName)) {
|
|
246
|
+
errors.fileName.missing = true;
|
|
247
|
+
} else if (!/^[a-zA-Z0-9-_]+$/.test(values.fileName)) {
|
|
248
|
+
errors.fileName.invalidInput = true;
|
|
249
|
+
}
|
|
250
|
+
if (values.languages.length < 1) {
|
|
251
|
+
errors.languages.missing = true;
|
|
252
|
+
}
|
|
253
|
+
return omitEmpty(errors);
|
|
254
|
+
}
|
|
255
|
+
|
|
214
256
|
var messages = defineMessages({
|
|
215
257
|
modalTitle: {
|
|
216
258
|
id: 'ExportResourcesModal.modalTitle',
|
|
@@ -364,122 +406,32 @@ var messages = defineMessages({
|
|
|
364
406
|
}
|
|
365
407
|
});
|
|
366
408
|
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
isOpen: PropTypes.bool.isRequired,
|
|
373
|
-
closeModal: PropTypes.func.isRequired,
|
|
374
|
-
allResourcesCount: PropTypes.number.isRequired,
|
|
375
|
-
matchingResourcesCount: PropTypes.number,
|
|
376
|
-
selectedResourceIds: PropTypes.array,
|
|
377
|
-
// TODO: Circular reference
|
|
378
|
-
fields: PropTypes.arrayOf(PropTypes.shape({
|
|
379
|
-
key: PropTypes.string.isRequired,
|
|
380
|
-
label: PropTypes.string,
|
|
381
|
-
isLocalized: PropTypes.bool,
|
|
382
|
-
fields: PropTypes.arrayOf(PropTypes.shape({
|
|
383
|
-
key: PropTypes.string.isRequired,
|
|
384
|
-
label: PropTypes.string,
|
|
385
|
-
isLocalized: PropTypes.bool
|
|
386
|
-
}))
|
|
387
|
-
})).isRequired,
|
|
388
|
-
exportSelectionType: PropTypes.string,
|
|
389
|
-
appliedSearchTerms: PropTypes.array,
|
|
390
|
-
appliedFilters: PropTypes.array,
|
|
391
|
-
renderProperties: PropTypes.func
|
|
392
|
-
}).isRequired;
|
|
393
|
-
|
|
394
|
-
function validate(values) {
|
|
395
|
-
const errors = {
|
|
396
|
-
fileName: {},
|
|
397
|
-
languages: {}
|
|
398
|
-
};
|
|
399
|
-
if (TextInput.isEmpty(values.fileName)) {
|
|
400
|
-
errors.fileName.missing = true;
|
|
401
|
-
} else if (!/^[a-zA-Z0-9-_]+$/.test(values.fileName)) {
|
|
402
|
-
errors.fileName.invalidInput = true;
|
|
403
|
-
}
|
|
404
|
-
if (values.languages.length < 1) {
|
|
405
|
-
errors.languages.missing = true;
|
|
406
|
-
}
|
|
407
|
-
return omitEmpty(errors);
|
|
408
|
-
}
|
|
409
|
-
|
|
410
|
-
function ownKeys$b(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
411
|
-
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(_context2 = ownKeys$b(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context3 = ownKeys$b(Object(source))).call(_context3, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
412
|
-
const ExportResourcesContextProvider = props => {
|
|
413
|
-
var _context;
|
|
414
|
-
const todayFormatted = moment().format('DD-MM-YY_HH-mm');
|
|
415
|
-
const _useApplicationContex = useApplicationContext(applicationContext => ({
|
|
416
|
-
language: applicationContext.dataLocale
|
|
417
|
-
})),
|
|
418
|
-
language = _useApplicationContex.language;
|
|
419
|
-
const formik = useFormik({
|
|
420
|
-
initialValues: {
|
|
421
|
-
outputFormat: props.outputFormat,
|
|
422
|
-
fileName: _concatInstanceProperty(_context = "".concat(resourceTypeToPlural({
|
|
423
|
-
resourceType: props.resourceType,
|
|
424
|
-
isUpperCase: true
|
|
425
|
-
}), "_Export_")).call(_context, todayFormatted),
|
|
426
|
-
languages: [language],
|
|
427
|
-
fields: props.fields,
|
|
428
|
-
appliedSearchTerms: props.appliedSearchTerms,
|
|
429
|
-
appliedFilters: props.appliedFilters,
|
|
430
|
-
exportSelectionType: props.exportSelectionType,
|
|
431
|
-
isAllLanguagesChecked: false
|
|
432
|
-
},
|
|
433
|
-
validate
|
|
434
|
-
});
|
|
435
|
-
const _useState = useState(false),
|
|
436
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
437
|
-
exportOperationStarted = _useState2[0],
|
|
438
|
-
setExportOperationStarted = _useState2[1];
|
|
439
|
-
return jsx(ExportResourcesContext.Provider, {
|
|
440
|
-
value: {
|
|
441
|
-
formik,
|
|
442
|
-
resourceType: props.resourceType,
|
|
443
|
-
allResourcesCount: props.allResourcesCount,
|
|
444
|
-
matchingResourcesCount: props.matchingResourcesCount,
|
|
445
|
-
selectedResourceIds: props.selectedResourceIds,
|
|
446
|
-
exportOperationStarted,
|
|
447
|
-
setExportOperationStarted
|
|
448
|
-
},
|
|
449
|
-
children: props.children
|
|
409
|
+
function getBold(msg) {
|
|
410
|
+
return jsx(Text.Body, {
|
|
411
|
+
as: "span",
|
|
412
|
+
isBold: true,
|
|
413
|
+
children: msg
|
|
450
414
|
});
|
|
451
|
-
};
|
|
452
|
-
ExportResourcesContextProvider.displayName = 'ExportResourcesContextProvider';
|
|
453
|
-
ExportResourcesContextProvider.propTypes = process.env.NODE_ENV !== "production" ? _objectSpread$b(_objectSpread$b({}, ExportResourcesModalShape), {}, {
|
|
454
|
-
children: PropTypes.node
|
|
455
|
-
}) : {};
|
|
456
|
-
|
|
457
|
-
function useExportResourcesContext() {
|
|
458
|
-
const context = useContext(ExportResourcesContext);
|
|
459
|
-
if (!context) {
|
|
460
|
-
throw new MissingExportResourceProviderError();
|
|
461
|
-
}
|
|
462
|
-
return context;
|
|
463
415
|
}
|
|
464
416
|
|
|
465
417
|
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)."; }
|
|
466
|
-
const smallTopPadding = /*#__PURE__*/css("padding-top:", customProperties.spacingXs, ";" + (process.env.NODE_ENV === "production" ? "" : ";label:smallTopPadding;"), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInN0eWxlcy5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFJMkIiLCJmaWxlIjoic3R5bGVzLmpzIiwic291cmNlc0NvbnRlbnQiOlsiLy8gVE9ETzogQHJlZGVzaWduIGNsZWFudXBcbmltcG9ydCB7IGNzcyB9IGZyb20gJ0BlbW90aW9uL3JlYWN0J1xuaW1wb3J0IHsgY3VzdG9tUHJvcGVydGllcyB9IGZyb20gJ0Bjb21tZXJjZXRvb2xzLXVpa2l0L2Rlc2lnbi1zeXN0ZW0nXG5cbmNvbnN0IHNtYWxsVG9wUGFkZGluZyA9IGNzc2BcbiAgcGFkZGluZy10b3A6ICR7Y3VzdG9tUHJvcGVydGllcy5zcGFjaW5nWHN9O1xuYFxuXG5jb25zdCB0YWdMaXN0Q29udGFpbmVyID0gKHsgaXNOZXdUaGVtZSB9KSA9PiBjc3NgXG4gIHdpZHRoOiAxMDAlO1xuICBkaXNwbGF5OiBmbGV4O1xuICBmbGV4LXdyYXA6IHdyYXA7XG4gIGRpc3BsYXk6IGlubGluZS1mbGV4O1xuICBwYWRkaW5nOiAwICR7aXNOZXdUaGVtZSA/IDAgOiBjdXN0b21Qcm9wZXJ0aWVzLnNwYWNpbmdMfTtcbiAgJiA+
|
|
418
|
+
const smallTopPadding = /*#__PURE__*/css("padding-top:", customProperties.spacingXs, ";" + (process.env.NODE_ENV === "production" ? "" : ";label:smallTopPadding;"), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInN0eWxlcy5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFJMkIiLCJmaWxlIjoic3R5bGVzLmpzIiwic291cmNlc0NvbnRlbnQiOlsiLy8gVE9ETzogQHJlZGVzaWduIGNsZWFudXBcbmltcG9ydCB7IGNzcyB9IGZyb20gJ0BlbW90aW9uL3JlYWN0J1xuaW1wb3J0IHsgY3VzdG9tUHJvcGVydGllcyB9IGZyb20gJ0Bjb21tZXJjZXRvb2xzLXVpa2l0L2Rlc2lnbi1zeXN0ZW0nXG5cbmNvbnN0IHNtYWxsVG9wUGFkZGluZyA9IGNzc2BcbiAgcGFkZGluZy10b3A6ICR7Y3VzdG9tUHJvcGVydGllcy5zcGFjaW5nWHN9O1xuYFxuXG5jb25zdCB0YWdMaXN0Q29udGFpbmVyID0gKHsgaXNOZXdUaGVtZSB9KSA9PiBjc3NgXG4gIHdpZHRoOiAxMDAlO1xuICBkaXNwbGF5OiBmbGV4O1xuICBmbGV4LXdyYXA6IHdyYXA7XG4gIGRpc3BsYXk6IGlubGluZS1mbGV4O1xuICBwYWRkaW5nOiAwICR7aXNOZXdUaGVtZSA/IDAgOiBjdXN0b21Qcm9wZXJ0aWVzLnNwYWNpbmdMfTtcbiAgJiA+IGRpdiB7XG4gICAgbWFyZ2luOiAwICR7Y3VzdG9tUHJvcGVydGllcy5zcGFjaW5nU30gJHtjdXN0b21Qcm9wZXJ0aWVzLnNwYWNpbmdTfSAwO1xuICB9XG5gXG5cbmNvbnN0IHRhZ0xpc3RJdGVtID0gY3NzYFxuICBtYXJnaW46IDAgJHtjdXN0b21Qcm9wZXJ0aWVzLnNwYWNpbmdYc30gJHtjdXN0b21Qcm9wZXJ0aWVzLnNwYWNpbmdYc30gMDtcbiAgZGlzcGxheTogZmxleDtcbiAgbWluLXdpZHRoOiAwO1xuYFxuXG5jb25zdCBkaXZpZGVyID0gY3NzYFxuICBib3gtc2l6aW5nOiBib3JkZXItYm94O1xuICB3aWR0aDogMTAwJTtcbiAgbWFyZ2luOiAwO1xuICBib3JkZXI6IDA7XG4gIGJvcmRlci10b3A6IDFweCBzb2xpZCAke2N1c3RvbVByb3BlcnRpZXMuY29sb3JOZXV0cmFsNjB9O1xuYFxuXG5jb25zdCBub3RCb2xkID0gY3NzYFxuICBmb250LXdlaWdodDogbm9ybWFsO1xuYFxuXG5jb25zdCBzdWNjZXNzTWVzc2FnZSA9IGNzc2BcbiAgbWFyZ2luLWJvdHRvbTogJHtjdXN0b21Qcm9wZXJ0aWVzLnNwYWNpbmdMfTtcbmBcblxuZXhwb3J0IGNvbnN0IHN0eWxlcyA9IHtcbiAgdGFnTGlzdEl0ZW0sXG4gIHRhZ0xpc3RDb250YWluZXIsXG4gIHNtYWxsVG9wUGFkZGluZyxcbiAgZGl2aWRlcixcbiAgbm90Qm9sZCxcbiAgc3VjY2Vzc01lc3NhZ2UsXG59XG4iXX0= */");
|
|
467
419
|
const tagListContainer = _ref => {
|
|
468
420
|
let isNewTheme = _ref.isNewTheme;
|
|
469
|
-
return /*#__PURE__*/css("width:100%;display:flex;flex-wrap:wrap;display:inline-flex;padding:0 ", isNewTheme ? 0 : customProperties.spacingL, ";&>div{margin:0 ", customProperties.spacingS, " ", customProperties.spacingS, " 0;}" + (process.env.NODE_ENV === "production" ? "" : ";label:tagListContainer;"), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInN0eWxlcy5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFRZ0QiLCJmaWxlIjoic3R5bGVzLmpzIiwic291cmNlc0NvbnRlbnQiOlsiLy8gVE9ETzogQHJlZGVzaWduIGNsZWFudXBcbmltcG9ydCB7IGNzcyB9IGZyb20gJ0BlbW90aW9uL3JlYWN0J1xuaW1wb3J0IHsgY3VzdG9tUHJvcGVydGllcyB9IGZyb20gJ0Bjb21tZXJjZXRvb2xzLXVpa2l0L2Rlc2lnbi1zeXN0ZW0nXG5cbmNvbnN0IHNtYWxsVG9wUGFkZGluZyA9IGNzc2BcbiAgcGFkZGluZy10b3A6ICR7Y3VzdG9tUHJvcGVydGllcy5zcGFjaW5nWHN9O1xuYFxuXG5jb25zdCB0YWdMaXN0Q29udGFpbmVyID0gKHsgaXNOZXdUaGVtZSB9KSA9PiBjc3NgXG4gIHdpZHRoOiAxMDAlO1xuICBkaXNwbGF5OiBmbGV4O1xuICBmbGV4LXdyYXA6IHdyYXA7XG4gIGRpc3BsYXk6IGlubGluZS1mbGV4O1xuICBwYWRkaW5nOiAwICR7aXNOZXdUaGVtZSA/IDAgOiBjdXN0b21Qcm9wZXJ0aWVzLnNwYWNpbmdMfTtcbiAgJiA+
|
|
421
|
+
return /*#__PURE__*/css("width:100%;display:flex;flex-wrap:wrap;display:inline-flex;padding:0 ", isNewTheme ? 0 : customProperties.spacingL, ";&>div{margin:0 ", customProperties.spacingS, " ", customProperties.spacingS, " 0;}" + (process.env.NODE_ENV === "production" ? "" : ";label:tagListContainer;"), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInN0eWxlcy5qcyJdLCJuYW1lcyI6W10sIm1hcHBp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GJvcmRlci10b3A6IDFweCBzb2xpZCAke2N1c3RvbVByb3BlcnRpZXMuY29sb3JOZXV0cmFsNjB9O1xuYFxuXG5jb25zdCBub3RCb2xkID0gY3NzYFxuICBmb250LXdlaWdodDogbm9ybWFsO1xuYFxuXG5jb25zdCBzdWNjZXNzTWVzc2FnZSA9IGNzc2BcbiAgbWFyZ2luLWJvdHRvbTogJHtjdXN0b21Qcm9wZXJ0aWVzLnNwYWNpbmdMfTtcbmBcblxuZXhwb3J0IGNvbnN0IHN0eWxlcyA9IHtcbiAgdGFnTGlzdEl0ZW0sXG4gIHRhZ0xpc3RDb250YWluZXIsXG4gIHNtYWxsVG9wUGFkZGluZyxcbiAgZGl2aWRlcixcbiAgbm90Qm9sZCxcbiAgc3VjY2Vzc01lc3NhZ2UsXG59XG4iXX0= */");
|
|
470
422
|
};
|
|
471
|
-
const tagListItem = /*#__PURE__*/css("margin:0 ", customProperties.spacingXs, " ", 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,
|
|
472
|
-
const divider = /*#__PURE__*/css("box-sizing:border-box;width:100%;margin:0;border:0;border-top:1px solid ", customProperties.colorNeutral60, ";" + (process.env.NODE_ENV === "production" ? "" : ";label:divider;"), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
423
|
+
const tagListItem = /*#__PURE__*/css("margin:0 ", customProperties.spacingXs, " ", 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,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInN0eWxlcy5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFtQnVCIiwiZmlsZSI6InN0eWxlcy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9yTmV1dHJhbDYwfTtcbmBcblxuY29uc3Qgbm90Qm9sZCA9IGNzc2BcbiAgZm9udC13ZWlnaHQ6IG5vcm1hbDtcbmBcblxuY29uc3Qgc3VjY2Vzc01lc3NhZ2UgPSBjc3NgXG4gIG1hcmdpbi1ib3R0b206ICR7Y3VzdG9tUHJvcGVydGllcy5zcGFjaW5nTH07XG5gXG5cbmV4cG9ydCBjb25zdCBzdHlsZXMgPSB7XG4gIHRhZ0xpc3RJdGVtLFxuICB0YWdMaXN0Q29udGFpbmVyLFxuICBzbWFsbFRvcFBhZGRpbmcsXG4gIGRpdmlkZXIsXG4gIG5vdEJvbGQsXG4gIHN1Y2Nlc3NNZXNzYWdlLFxufVxuIl19 */");
|
|
424
|
+
const divider = /*#__PURE__*/css("box-sizing:border-box;width:100%;margin:0;border:0;border-top:1px solid ", customProperties.colorNeutral60, ";" + (process.env.NODE_ENV === "production" ? "" : ";label:divider;"), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInN0eWxlcy5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUF5Qm1CIiwiZmlsZSI6InN0eWxlcy5qcyIsInNvdXJjZXNDb250ZW50IjpbIi8vIFRPRE86IEByZWRlc2lnbiBjbGVhbnVwXG5pbXBvcnQgeyBjc3MgfSBmcm9tICdAZW1vdGlvbi9yZWFjdCdcbmltcG9ydCB7IGN1c3RvbVByb3BlcnRpZXMgfSBmcm9tICdAY29tbWVyY2V0b29scy11aWtpdC9kZXNpZ24tc3lzdGVtJ1xuXG5jb25zdCBzbWFsbFRvcFBhZGRpbmcgPSBjc3NgXG4gIHBhZGRpbmctdG9wOiAke2N1c3RvbVByb3BlcnRpZXMuc3BhY2luZ1hzfTtcbmBcblxuY29uc3QgdGFnTGlzdENvbnRhaW5lciA9ICh7IGlzTmV3VGhlbWUgfSkgPT4gY3NzYFxuICB3aWR0aDog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const notBold = process.env.NODE_ENV === "production" ? {
|
|
474
426
|
name: "lugakg",
|
|
475
427
|
styles: "font-weight:normal"
|
|
476
428
|
} : {
|
|
477
429
|
name: "w02aau-notBold",
|
|
478
430
|
styles: "font-weight:normal;label:notBold;",
|
|
479
|
-
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
431
|
+
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInN0eWxlcy5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFpQ21CIiwiZmlsZSI6InN0eWxlcy5qcyIsInNvdXJjZXNDb250ZW50IjpbIi8vIFRPRE86IEByZWRlc2lnbiBjbGVhbnVwXG5pbXBvcnQgeyBjc3MgfSBmcm9tICdAZW1vdGlvbi9yZWFjdCdcbmltcG9ydCB7IGN1c3RvbVByb3BlcnRpZXMgfSBmcm9tICdAY29tbWVyY2V0b29scy11aWtpdC9kZXNpZ24tc3lzdGVtJ1xuXG5jb25zdCBzbWFsbFRvcFBhZGRpbmcgPSBjc3NgXG4gIHBhZGRpbmctdG9wOiAke2N1c3RvbVByb3BlcnRpZXMuc3BhY2luZ1hzfTtcbmBcblxuY29uc3QgdGFnTGlzdENvbnRhaW5lciA9ICh7IGlzTmV3VGhlbWUgfSkgPT4gY3NzYFxuICB3aWR0aDogMTAwJTtcbiAgZGlzcGxheTogZmxleDtcbiAgZmxleC13cmFwOiB3cmFwO1xuICBkaXNwbGF5OiBpbmxpbmUtZmxleDtcbiAgcGFkZGluZzogMCAke2lzTmV3VGhlbWUgPyAwIDogY3VzdG9tUHJvcGVydGllcy5zcGFjaW5nTH07XG4gICYgPiBkaXYge1xuICAgIG1hcmdpbjogMCAke2N1c3RvbVByb3BlcnRpZXMuc3BhY2luZ1N9ICR7Y3VzdG9tUHJvcGVydGllcy5zcGFjaW5nU30gMDtcbiAgfVxuYFxuXG5jb25zdCB0YWdMaXN0SXRlbSA9IGNzc2BcbiAgbWFyZ2luOiAwICR7Y3VzdG9tUHJvcGVydGllcy5zcGFjaW5nWHN9ICR7Y3VzdG9tUHJvcGVydGllcy5zcGFjaW5nWHN9IDA7XG4gIGRpc3BsYXk6IGZsZXg7XG4gIG1pbi13aWR0aDogMDtcbmBcblxuY29uc3QgZGl2aWRlciA9IGNzc2BcbiAgYm94LXNpemluZzogYm9yZGVyLWJveDtcbiAgd2lkdGg6IDEwMCU7XG4gIG1hcmdpbjogMDtcbiAgYm9yZGVyOiAwO1xuICBib3JkZXItdG9wOiAxcHggc29saWQgJHtjdXN0b21Qcm9wZXJ0aWVzLmNvbG9yTmV1dHJhbDYwfTtcbmBcblxuY29uc3Qgbm90Qm9sZCA9IGNzc2BcbiAgZm9udC13ZWlnaHQ6IG5vcm1hbDtcbmBcblxuY29uc3Qgc3VjY2Vzc01lc3NhZ2UgPSBjc3NgXG4gIG1hcmdpbi1ib3R0b206ICR7Y3VzdG9tUHJvcGVydGllcy5zcGFjaW5nTH07XG5gXG5cbmV4cG9ydCBjb25zdCBzdHlsZXMgPSB7XG4gIHRhZ0xpc3RJdGVtLFxuICB0YWdMaXN0Q29udGFpbmVyLFxuICBzbWFsbFRvcFBhZGRpbmcsXG4gIGRpdmlkZXIsXG4gIG5vdEJvbGQsXG4gIHN1Y2Nlc3NNZXNzYWdlLFxufVxuIl19 */",
|
|
480
432
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
481
433
|
};
|
|
482
|
-
const successMessage = /*#__PURE__*/css("margin-bottom:", customProperties.spacingL, ";" + (process.env.NODE_ENV === "production" ? "" : ";label:successMessage;"), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
434
|
+
const successMessage = /*#__PURE__*/css("margin-bottom:", customProperties.spacingL, ";" + (process.env.NODE_ENV === "production" ? "" : ";label:successMessage;"), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZX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MCU7XG4gIG1hcmdpbjogMDtcbiAgYm9yZGVyOiAwO1xuICBib3JkZXItdG9wOiAxcHggc29saWQgJHtjdXN0b21Qcm9wZXJ0aWVzLmNvbG9yTmV1dHJhbDYwfTtcbmBcblxuY29uc3Qgbm90Qm9sZCA9IGNzc2BcbiAgZm9udC13ZWlnaHQ6IG5vcm1hbDtcbmBcblxuY29uc3Qgc3VjY2Vzc01lc3NhZ2UgPSBjc3NgXG4gIG1hcmdpbi1ib3R0b206ICR7Y3VzdG9tUHJvcGVydGllcy5zcGFjaW5nTH07XG5gXG5cbmV4cG9ydCBjb25zdCBzdHlsZXMgPSB7XG4gIHRhZ0xpc3RJdGVtLFxuICB0YWdMaXN0Q29udGFpbmVyLFxuICBzbWFsbFRvcFBhZGRpbmcsXG4gIGRpdmlkZXIsXG4gIG5vdEJvbGQsXG4gIHN1Y2Nlc3NNZXNzYWdlLFxufVxuIl19 */");
|
|
483
435
|
const styles = {
|
|
484
436
|
tagListItem,
|
|
485
437
|
tagListContainer,
|
|
@@ -489,177 +441,54 @@ const styles = {
|
|
|
489
441
|
successMessage
|
|
490
442
|
};
|
|
491
443
|
|
|
492
|
-
function
|
|
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(_context = ownKeys$a(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$a(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
494
|
-
function ExportSelectionRadioButtons() {
|
|
444
|
+
function TagList(props) {
|
|
495
445
|
const _useTheme = useTheme(),
|
|
496
446
|
isNewTheme = _useTheme.isNewTheme;
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
});
|
|
507
|
-
return jsx(Spacings.Inline, {
|
|
508
|
-
scale: "xl",
|
|
509
|
-
children: jsxs(RadioInput.Group, {
|
|
510
|
-
name: "exportSelectionType",
|
|
511
|
-
value: _valuesInstanceProperty(formik).exportSelectionType,
|
|
512
|
-
direction: "inline",
|
|
513
|
-
directionProps: {
|
|
514
|
-
scale: 'xl'
|
|
515
|
-
},
|
|
516
|
-
onChange: formik.handleChange,
|
|
517
|
-
children: [jsx(RadioInput.Option, {
|
|
518
|
-
value: EXPORT_SELECTION_TYPES.ALL_RESOURCES,
|
|
519
|
-
"data-testid": 'test-all-resources',
|
|
520
|
-
children: jsx(Text.Body, {
|
|
521
|
-
isBold: !isNewTheme,
|
|
522
|
-
intlMessage: _objectSpread$a(_objectSpread$a({}, messages.exportAllResources), {}, {
|
|
523
|
-
values: {
|
|
524
|
-
resourceType: resourceTypePlural,
|
|
525
|
-
count: allResourcesCount
|
|
526
|
-
}
|
|
527
|
-
})
|
|
528
|
-
})
|
|
529
|
-
}), jsx(RadioInput.Option, {
|
|
530
|
-
value: EXPORT_SELECTION_TYPES.ONLY_MATCHING,
|
|
531
|
-
"data-testid": 'test-only-matching',
|
|
532
|
-
isDisabled: !Boolean(matchingResourcesCount),
|
|
533
|
-
children: jsx(Text.Body, {
|
|
534
|
-
isBold: !isNewTheme,
|
|
535
|
-
intlMessage: _objectSpread$a(_objectSpread$a({}, messages.exportOnlyMatchingResources), {}, {
|
|
536
|
-
values: {
|
|
537
|
-
count: matchingResourcesCount || intl.formatMessage(messages.nothingApplied)
|
|
538
|
-
}
|
|
539
|
-
})
|
|
540
|
-
})
|
|
541
|
-
}), jsx(RadioInput.Option, {
|
|
542
|
-
value: EXPORT_SELECTION_TYPES.ONLY_SELECTED,
|
|
543
|
-
"data-testid": 'test-only-selected',
|
|
544
|
-
isDisabled: !Boolean(selectedResourceIds.length),
|
|
545
|
-
children: jsx(Text.Body, {
|
|
546
|
-
isBold: !isNewTheme,
|
|
547
|
-
intlMessage: _objectSpread$a(_objectSpread$a({}, messages.exportOnlySelectedResources), {}, {
|
|
548
|
-
values: {
|
|
549
|
-
resourceType: resourceTypePlural,
|
|
550
|
-
count: selectedResourceIds.length
|
|
551
|
-
}
|
|
552
|
-
})
|
|
553
|
-
})
|
|
554
|
-
})]
|
|
555
|
-
})
|
|
447
|
+
return jsx("div", {
|
|
448
|
+
css: styles.tagListContainer({
|
|
449
|
+
isNewTheme
|
|
450
|
+
}),
|
|
451
|
+
"data-testid": props['data-testid'],
|
|
452
|
+
children: _mapInstanceProperty(Children).call(Children, props.children, tag => jsx("div", {
|
|
453
|
+
css: styles.tagListItem,
|
|
454
|
+
children: tag
|
|
455
|
+
}))
|
|
556
456
|
});
|
|
557
457
|
}
|
|
458
|
+
TagList.displayName = 'TagList';
|
|
459
|
+
TagList.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
460
|
+
children: PropTypes.node.isRequired,
|
|
461
|
+
'data-testid': PropTypes.string
|
|
462
|
+
} : {};
|
|
558
463
|
|
|
559
|
-
function
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
}
|
|
588
|
-
})
|
|
589
|
-
});
|
|
590
|
-
case EXPORT_SELECTION_TYPES.ONLY_MATCHING:
|
|
591
|
-
return jsx(Text.Body, {
|
|
592
|
-
intlMessage: _objectSpread$9(_objectSpread$9({}, messages.exportMatchingMessage), {}, {
|
|
593
|
-
values: {
|
|
594
|
-
count: matchingResourcesCount,
|
|
595
|
-
resourceType: resourceTypePlural,
|
|
596
|
-
b: getBold
|
|
597
|
-
}
|
|
598
|
-
})
|
|
599
|
-
});
|
|
600
|
-
case EXPORT_SELECTION_TYPES.ONLY_SELECTED:
|
|
601
|
-
return jsx(Text.Body, {
|
|
602
|
-
intlMessage: _objectSpread$9(_objectSpread$9({}, messages.exportSelectedMessage), {}, {
|
|
603
|
-
values: {
|
|
604
|
-
count: selectedResourceIds.length,
|
|
605
|
-
resourceType: resourceTypePlural,
|
|
606
|
-
b: getBold
|
|
607
|
-
}
|
|
608
|
-
})
|
|
609
|
-
});
|
|
610
|
-
default:
|
|
611
|
-
throw new UnexpectedSelectionTypeError(_valuesInstanceProperty(formik).exportSelectionType);
|
|
612
|
-
}
|
|
613
|
-
}
|
|
614
|
-
|
|
615
|
-
function TagList(props) {
|
|
616
|
-
const _useTheme = useTheme(),
|
|
617
|
-
isNewTheme = _useTheme.isNewTheme;
|
|
618
|
-
return jsx("div", {
|
|
619
|
-
css: styles.tagListContainer({
|
|
620
|
-
isNewTheme
|
|
621
|
-
}),
|
|
622
|
-
"data-testid": props['data-testid'],
|
|
623
|
-
children: _mapInstanceProperty(Children).call(Children, props.children, tag => jsx("div", {
|
|
624
|
-
css: styles.tagListItem,
|
|
625
|
-
children: tag
|
|
626
|
-
}))
|
|
627
|
-
});
|
|
628
|
-
}
|
|
629
|
-
TagList.displayName = 'TagList';
|
|
630
|
-
TagList.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
631
|
-
children: PropTypes.node.isRequired,
|
|
632
|
-
'data-testid': PropTypes.string
|
|
633
|
-
} : {};
|
|
634
|
-
|
|
635
|
-
function ownKeys$8(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
636
|
-
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(_context = ownKeys$8(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$8(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
637
|
-
function AppliedFilters(_ref) {
|
|
638
|
-
let filters = _ref.filters,
|
|
639
|
-
onFilterRemove = _ref.onFilterRemove;
|
|
640
|
-
const _useTheme = useTheme(),
|
|
641
|
-
isNewTheme = _useTheme.isNewTheme;
|
|
642
|
-
if (isNewTheme) return jsx(CollapsiblePanel, {
|
|
643
|
-
condensed: true,
|
|
644
|
-
isDefaultClosed: !Boolean(filters.length),
|
|
645
|
-
header: jsx(Text.Body, {
|
|
646
|
-
intlMessage: _objectSpread$8(_objectSpread$8({}, messages.appliedFiltersMessage), {}, {
|
|
647
|
-
values: {
|
|
648
|
-
filtersCount: filters.length
|
|
649
|
-
}
|
|
650
|
-
})
|
|
651
|
-
}),
|
|
652
|
-
children: jsx(TagList, {
|
|
653
|
-
children: _mapInstanceProperty(filters).call(filters, filter => jsx("div", {
|
|
654
|
-
"data-testid": "test-filter-".concat(filter),
|
|
655
|
-
children: jsx(Tag, {
|
|
656
|
-
onRemove: () => {
|
|
657
|
-
onFilterRemove(filter);
|
|
658
|
-
},
|
|
659
|
-
children: filter
|
|
660
|
-
})
|
|
661
|
-
}, filter))
|
|
662
|
-
})
|
|
464
|
+
function ownKeys$b(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
465
|
+
function _objectSpread$b(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$b(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$b(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
466
|
+
function AppliedFilters(_ref) {
|
|
467
|
+
let filters = _ref.filters,
|
|
468
|
+
onFilterRemove = _ref.onFilterRemove;
|
|
469
|
+
const _useTheme = useTheme(),
|
|
470
|
+
isNewTheme = _useTheme.isNewTheme;
|
|
471
|
+
if (isNewTheme) return jsx(CollapsiblePanel, {
|
|
472
|
+
condensed: true,
|
|
473
|
+
isDefaultClosed: !Boolean(filters.length),
|
|
474
|
+
header: jsx(Text.Body, {
|
|
475
|
+
intlMessage: _objectSpread$b(_objectSpread$b({}, messages.appliedFiltersMessage), {}, {
|
|
476
|
+
values: {
|
|
477
|
+
filtersCount: filters.length
|
|
478
|
+
}
|
|
479
|
+
})
|
|
480
|
+
}),
|
|
481
|
+
children: jsx(TagList, {
|
|
482
|
+
children: _mapInstanceProperty(filters).call(filters, filter => jsx("div", {
|
|
483
|
+
"data-testid": "test-filter-".concat(filter),
|
|
484
|
+
children: jsx(Tag, {
|
|
485
|
+
onRemove: () => {
|
|
486
|
+
onFilterRemove(filter);
|
|
487
|
+
},
|
|
488
|
+
children: filter
|
|
489
|
+
})
|
|
490
|
+
}, filter))
|
|
491
|
+
})
|
|
663
492
|
});
|
|
664
493
|
return jsxs(Spacings.Stack, {
|
|
665
494
|
scale: "s",
|
|
@@ -672,7 +501,7 @@ function AppliedFilters(_ref) {
|
|
|
672
501
|
color: "neutral60"
|
|
673
502
|
}), jsx(Text.Body, {
|
|
674
503
|
isBold: true,
|
|
675
|
-
intlMessage: _objectSpread$
|
|
504
|
+
intlMessage: _objectSpread$b(_objectSpread$b({}, messages.appliedFiltersMessage), {}, {
|
|
676
505
|
values: {
|
|
677
506
|
filtersCount: filters.length
|
|
678
507
|
}
|
|
@@ -696,35 +525,14 @@ AppliedFilters.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
696
525
|
onFilterRemove: PropTypes.func.isRequired
|
|
697
526
|
} : {};
|
|
698
527
|
|
|
699
|
-
|
|
700
|
-
function
|
|
701
|
-
const _useTheme = useTheme(),
|
|
702
|
-
themedValue = _useTheme.themedValue;
|
|
703
|
-
return jsxs(Spacings.Inline, {
|
|
704
|
-
scale: "m",
|
|
705
|
-
alignItems: "center",
|
|
706
|
-
children: [jsx(Text.Body, {
|
|
707
|
-
intlMessage: messages.exportBasedOnMyViewsMessage
|
|
708
|
-
}), jsx(Text.Body, {
|
|
709
|
-
intlMessage: messages.myViews
|
|
710
|
-
}), jsx(Constraints.Horizontal, {
|
|
711
|
-
max: themedValue(4, 7),
|
|
712
|
-
children: jsx(SelectInput, {
|
|
713
|
-
isDisabled: true,
|
|
714
|
-
placeholder: "Default"
|
|
715
|
-
})
|
|
716
|
-
})]
|
|
717
|
-
});
|
|
718
|
-
}
|
|
719
|
-
|
|
720
|
-
function ownKeys$7(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
721
|
-
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(_context = ownKeys$7(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$7(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
528
|
+
function ownKeys$a(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
529
|
+
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(_context = ownKeys$a(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$a(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
722
530
|
const IconPlaceholder = /*#__PURE__*/_styled("div", process.env.NODE_ENV === "production" ? {
|
|
723
|
-
target: "
|
|
531
|
+
target: "e1oion860"
|
|
724
532
|
} : {
|
|
725
|
-
target: "
|
|
533
|
+
target: "e1oion860",
|
|
726
534
|
label: "IconPlaceholder"
|
|
727
|
-
})("width:", customProperties$1.spacingM, ";" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
535
|
+
})("width:", customProperties$1.spacingM, ";" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImFwcGxpZWQtc2VhcmNoLXRlcm1zLmpzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoi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tcz1cImZsZXgtc3RhcnRcIj5cbiAgICAgICAgPEljb25QbGFjZWhvbGRlciAvPlxuICAgICAgICA8VGV4dC5Cb2R5PnthcHBsaWVkU2VhcmNoVGVybXMuam9pbignLCAnKX08L1RleHQuQm9keT5cbiAgICAgIDwvU3BhY2luZ3MuSW5saW5lPlxuICAgIDwvU3BhY2luZ3MuU3RhY2s+XG4gIClcbn1cbkFwcGxpZWRTZWFyY2hUZXJtcy5wcm9wVHlwZXMgPSB7XG4gIGFwcGxpZWRTZWFyY2hUZXJtczogUHJvcFR5cGVzLmFycmF5LmlzUmVxdWlyZWQsXG59XG4iXX0= */"));
|
|
728
536
|
function AppliedSearchTerms(_ref) {
|
|
729
537
|
let appliedSearchTerms = _ref.appliedSearchTerms;
|
|
730
538
|
const _useTheme = useTheme(),
|
|
@@ -733,7 +541,7 @@ function AppliedSearchTerms(_ref) {
|
|
|
733
541
|
condensed: true,
|
|
734
542
|
isDefaultClosed: !Boolean(appliedSearchTerms.length),
|
|
735
543
|
header: jsx(Text.Body, {
|
|
736
|
-
intlMessage: _objectSpread$
|
|
544
|
+
intlMessage: _objectSpread$a(_objectSpread$a({}, messages.appliedSearchTermsMessage), {}, {
|
|
737
545
|
values: {
|
|
738
546
|
searchTermsCount: appliedSearchTerms.length
|
|
739
547
|
}
|
|
@@ -754,7 +562,7 @@ function AppliedSearchTerms(_ref) {
|
|
|
754
562
|
color: "neutral60"
|
|
755
563
|
}), jsx(Text.Body, {
|
|
756
564
|
isBold: true,
|
|
757
|
-
intlMessage: _objectSpread$
|
|
565
|
+
intlMessage: _objectSpread$a(_objectSpread$a({}, messages.appliedSearchTermsMessage), {}, {
|
|
758
566
|
values: {
|
|
759
567
|
searchTermsCount: appliedSearchTerms.length
|
|
760
568
|
}
|
|
@@ -773,15 +581,185 @@ AppliedSearchTerms.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
773
581
|
appliedSearchTerms: PropTypes.array.isRequired
|
|
774
582
|
} : {};
|
|
775
583
|
|
|
776
|
-
|
|
777
|
-
function
|
|
584
|
+
// TODO: @redesign cleanup
|
|
585
|
+
function ExportBasedOnMyViewsSelectField() {
|
|
586
|
+
const _useTheme = useTheme(),
|
|
587
|
+
themedValue = _useTheme.themedValue;
|
|
588
|
+
return jsxs(Spacings.Inline, {
|
|
589
|
+
scale: "m",
|
|
590
|
+
alignItems: "center",
|
|
591
|
+
children: [jsx(Text.Body, {
|
|
592
|
+
intlMessage: messages.exportBasedOnMyViewsMessage
|
|
593
|
+
}), jsx(Text.Body, {
|
|
594
|
+
intlMessage: messages.myViews
|
|
595
|
+
}), jsx(Constraints.Horizontal, {
|
|
596
|
+
max: themedValue(4, 7),
|
|
597
|
+
children: jsx(SelectInput, {
|
|
598
|
+
isDisabled: true,
|
|
599
|
+
placeholder: "Default"
|
|
600
|
+
})
|
|
601
|
+
})]
|
|
602
|
+
});
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
function ownKeys$9(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
606
|
+
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(_context = ownKeys$9(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$9(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
607
|
+
function renderFileNameError(key) {
|
|
608
|
+
switch (key) {
|
|
609
|
+
case 'missing':
|
|
610
|
+
return jsx(FormattedMessage, _objectSpread$9({}, messages.missingFileNameError));
|
|
611
|
+
case 'invalidInput':
|
|
612
|
+
return jsx(FormattedMessage, _objectSpread$9({}, messages.invalidFileNameError));
|
|
613
|
+
default:
|
|
614
|
+
return null;
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
function renderLanguageError(key) {
|
|
618
|
+
switch (key) {
|
|
619
|
+
case 'missing':
|
|
620
|
+
return jsx(FormattedMessage, _objectSpread$9({}, messages.missingLanguageError));
|
|
621
|
+
default:
|
|
622
|
+
return null;
|
|
623
|
+
}
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
function useExportResourcesContext() {
|
|
627
|
+
const context = useContext(ExportResourcesContext);
|
|
628
|
+
if (!context) {
|
|
629
|
+
throw new MissingExportResourceProviderError();
|
|
630
|
+
}
|
|
631
|
+
return context;
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
async function createExportOperation(_ref) {
|
|
635
|
+
let projectKey = _ref.projectKey,
|
|
636
|
+
graphQuery = _ref.graphQuery,
|
|
637
|
+
asyncDispatchFn = _ref.asyncDispatchFn;
|
|
638
|
+
const uri = "/proxy/export/".concat(projectKey, "/export-operations");
|
|
639
|
+
const response = await asyncDispatchFn(actions.post({
|
|
640
|
+
// FIXME: EXPORT is undefined
|
|
641
|
+
mcApiProxyTarget: MC_API_PROXY_TARGETS.EXPORT,
|
|
642
|
+
uri: uri,
|
|
643
|
+
headers: {
|
|
644
|
+
accept: 'application/json'
|
|
645
|
+
},
|
|
646
|
+
payload: {
|
|
647
|
+
query: graphQuery
|
|
648
|
+
}
|
|
649
|
+
}));
|
|
650
|
+
return response;
|
|
651
|
+
}
|
|
652
|
+
|
|
653
|
+
function ownKeys$8(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
654
|
+
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(_context = ownKeys$8(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$8(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
655
|
+
function ExportConfirmationModal(props) {
|
|
656
|
+
const _useApplicationContex = useApplicationContext(applicationContext => {
|
|
657
|
+
var _applicationContext$p, _applicationContext$p2;
|
|
658
|
+
return {
|
|
659
|
+
projectName: (_applicationContext$p = applicationContext.project) === null || _applicationContext$p === void 0 ? void 0 : _applicationContext$p.name,
|
|
660
|
+
projectKey: (_applicationContext$p2 = applicationContext.project) === null || _applicationContext$p2 === void 0 ? void 0 : _applicationContext$p2.key
|
|
661
|
+
};
|
|
662
|
+
}),
|
|
663
|
+
projectName = _useApplicationContex.projectName,
|
|
664
|
+
projectKey = _useApplicationContex.projectKey;
|
|
665
|
+
const _useExportResourcesCo = useExportResourcesContext(),
|
|
666
|
+
formik = _useExportResourcesCo.formik,
|
|
667
|
+
allResourcesCount = _useExportResourcesCo.allResourcesCount,
|
|
668
|
+
matchingResourcesCount = _useExportResourcesCo.matchingResourcesCount,
|
|
669
|
+
selectedResourceIds = _useExportResourcesCo.selectedResourceIds,
|
|
670
|
+
resourceType = _useExportResourcesCo.resourceType,
|
|
671
|
+
setExportOperationStarted = _useExportResourcesCo.setExportOperationStarted;
|
|
672
|
+
const intl = useIntl();
|
|
673
|
+
const asyncDispatch = useAsyncDispatch();
|
|
674
|
+
const resourceTypePlural = resourceTypeToPlural({
|
|
675
|
+
resourceType: props.resourceType
|
|
676
|
+
});
|
|
677
|
+
const countInConfirmationMessage = () => {
|
|
678
|
+
switch (_valuesInstanceProperty(formik).exportSelectionType) {
|
|
679
|
+
case EXPORT_SELECTION_TYPES.ALL_RESOURCES:
|
|
680
|
+
return allResourcesCount;
|
|
681
|
+
case EXPORT_SELECTION_TYPES.ONLY_MATCHING:
|
|
682
|
+
return matchingResourcesCount;
|
|
683
|
+
case EXPORT_SELECTION_TYPES.ONLY_SELECTED:
|
|
684
|
+
return selectedResourceIds.length;
|
|
685
|
+
default:
|
|
686
|
+
throw new UnexpectedSelectionTypeError(_valuesInstanceProperty(formik).exportSelectionType);
|
|
687
|
+
}
|
|
688
|
+
};
|
|
689
|
+
return jsx(ConfirmationDialog, {
|
|
690
|
+
dataAttributesPrimaryButton: {
|
|
691
|
+
'data-testid': 'confirm-export-button'
|
|
692
|
+
},
|
|
693
|
+
title: intl.formatMessage(messages.confirmationTitle, {
|
|
694
|
+
resourceType: resourceTypePlural
|
|
695
|
+
}),
|
|
696
|
+
labelPrimary: intl.formatMessage(messages.exportConfirmationLabel, {
|
|
697
|
+
resourceType: resourceTypePlural
|
|
698
|
+
}),
|
|
699
|
+
isOpen: props.isOpen,
|
|
700
|
+
onClose: props.closeModal,
|
|
701
|
+
onCancel: props.closeModal,
|
|
702
|
+
onConfirm: async () => {
|
|
703
|
+
setExportOperationStarted(false);
|
|
704
|
+
const graphQuery = buildGraphQuery({
|
|
705
|
+
resourceType: resourceType,
|
|
706
|
+
selectedResourceIds: selectedResourceIds,
|
|
707
|
+
fields: _valuesInstanceProperty(formik).fields,
|
|
708
|
+
exportSelectionType: _valuesInstanceProperty(formik).exportSelectionType,
|
|
709
|
+
languages: _valuesInstanceProperty(formik).languages
|
|
710
|
+
});
|
|
711
|
+
props.closeModal();
|
|
712
|
+
try {
|
|
713
|
+
const response = await createExportOperation({
|
|
714
|
+
projectKey,
|
|
715
|
+
graphQuery,
|
|
716
|
+
asyncDispatchFn: asyncDispatch
|
|
717
|
+
});
|
|
718
|
+
switch (response.state) {
|
|
719
|
+
case EXPORT_OPERATION_STATES.PROCESSING:
|
|
720
|
+
case EXPORT_OPERATION_STATES.COMPLETED:
|
|
721
|
+
setExportOperationStarted(true);
|
|
722
|
+
break;
|
|
723
|
+
default:
|
|
724
|
+
throw new UnexpectedExportOperationStateError(response.state);
|
|
725
|
+
}
|
|
726
|
+
} catch (errors) {
|
|
727
|
+
showApiErrorNotification({
|
|
728
|
+
errors
|
|
729
|
+
});
|
|
730
|
+
}
|
|
731
|
+
},
|
|
732
|
+
children: jsxs("div", {
|
|
733
|
+
children: [jsx(Text.Body, {
|
|
734
|
+
intlMessage: _objectSpread$8(_objectSpread$8({}, messages.confirmationBodyPlan), {}, {
|
|
735
|
+
values: {
|
|
736
|
+
resourceType: resourceTypePlural,
|
|
737
|
+
projectName: projectName,
|
|
738
|
+
count: countInConfirmationMessage(),
|
|
739
|
+
bold: getBold
|
|
740
|
+
}
|
|
741
|
+
})
|
|
742
|
+
}), jsx(Text.Body, {
|
|
743
|
+
intlMessage: messages.confirmationBodyQuestion
|
|
744
|
+
})]
|
|
745
|
+
})
|
|
746
|
+
});
|
|
747
|
+
}
|
|
748
|
+
ExportConfirmationModal.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
749
|
+
isOpen: PropTypes.bool.isRequired,
|
|
750
|
+
resourceType: PropTypes.string.isRequired,
|
|
751
|
+
closeModal: PropTypes.func.isRequired
|
|
752
|
+
} : {};
|
|
753
|
+
|
|
754
|
+
function ownKeys$7(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
755
|
+
function _objectSpread$7(target) { for (var i = 1; i < arguments.length; i++) { var _context3, _context4; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context3 = ownKeys$7(Object(source), !0)).call(_context3, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context4 = ownKeys$7(Object(source))).call(_context4, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
778
756
|
function normalizeFields(fields) {
|
|
779
757
|
const result = _mapInstanceProperty(fields).call(fields, field => {
|
|
780
758
|
if (isFilledArray(field.fields)) {
|
|
781
759
|
var _context;
|
|
782
760
|
return _mapInstanceProperty(_context = normalizeFields(field.fields)).call(_context, nestedField => {
|
|
783
761
|
var _context2;
|
|
784
|
-
return _objectSpread$
|
|
762
|
+
return _objectSpread$7(_objectSpread$7({}, nestedField), {}, {
|
|
785
763
|
key: _concatInstanceProperty(_context2 = "".concat(field.key, ".")).call(_context2, nestedField.key)
|
|
786
764
|
});
|
|
787
765
|
});
|
|
@@ -811,7 +789,7 @@ function ExportFields(_ref2) {
|
|
|
811
789
|
condensed: true,
|
|
812
790
|
isDefaultClosed: !Boolean(fields.length),
|
|
813
791
|
header: jsx(Text.Body, {
|
|
814
|
-
intlMessage: _objectSpread$
|
|
792
|
+
intlMessage: _objectSpread$7(_objectSpread$7({}, messages.columnsMessage), {}, {
|
|
815
793
|
values: {
|
|
816
794
|
columnsCount: fields.length
|
|
817
795
|
}
|
|
@@ -832,30 +810,145 @@ function ExportFields(_ref2) {
|
|
|
832
810
|
color: "neutral60"
|
|
833
811
|
}), jsx(Text.Body, {
|
|
834
812
|
isBold: true,
|
|
835
|
-
intlMessage: _objectSpread$
|
|
813
|
+
intlMessage: _objectSpread$7(_objectSpread$7({}, messages.columnsMessage), {}, {
|
|
814
|
+
values: {
|
|
815
|
+
columnsCount: fields.length
|
|
816
|
+
}
|
|
817
|
+
})
|
|
818
|
+
})]
|
|
819
|
+
}), jsx(FieldsRenderer, {
|
|
820
|
+
fields: fields
|
|
821
|
+
})]
|
|
822
|
+
});
|
|
823
|
+
}
|
|
824
|
+
ExportFields.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
825
|
+
// TODO: Circular reference
|
|
826
|
+
fields: PropTypes.arrayOf(PropTypes.shape({
|
|
827
|
+
key: PropTypes.string.isRequired,
|
|
828
|
+
label: PropTypes.string,
|
|
829
|
+
isLocalized: PropTypes.bool,
|
|
830
|
+
fields: PropTypes.arrayOf(PropTypes.shape({
|
|
831
|
+
key: PropTypes.string.isRequired,
|
|
832
|
+
label: PropTypes.string,
|
|
833
|
+
isLocalized: PropTypes.bool
|
|
834
|
+
}))
|
|
835
|
+
})).isRequired
|
|
836
|
+
} : {};
|
|
837
|
+
|
|
838
|
+
function ownKeys$6(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
839
|
+
function _objectSpread$6(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$6(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$6(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
840
|
+
function ExportSelectionRadioButtons() {
|
|
841
|
+
const _useTheme = useTheme(),
|
|
842
|
+
isNewTheme = _useTheme.isNewTheme;
|
|
843
|
+
const intl = useIntl();
|
|
844
|
+
const _useExportResourcesCo = useExportResourcesContext(),
|
|
845
|
+
formik = _useExportResourcesCo.formik,
|
|
846
|
+
resourceType = _useExportResourcesCo.resourceType,
|
|
847
|
+
allResourcesCount = _useExportResourcesCo.allResourcesCount,
|
|
848
|
+
matchingResourcesCount = _useExportResourcesCo.matchingResourcesCount,
|
|
849
|
+
selectedResourceIds = _useExportResourcesCo.selectedResourceIds;
|
|
850
|
+
const resourceTypePlural = resourceTypeToPlural({
|
|
851
|
+
resourceType: resourceType
|
|
852
|
+
});
|
|
853
|
+
return jsx(Spacings.Inline, {
|
|
854
|
+
scale: "xl",
|
|
855
|
+
children: jsxs(RadioInput.Group, {
|
|
856
|
+
name: "exportSelectionType",
|
|
857
|
+
value: _valuesInstanceProperty(formik).exportSelectionType,
|
|
858
|
+
direction: "inline",
|
|
859
|
+
directionProps: {
|
|
860
|
+
scale: 'xl'
|
|
861
|
+
},
|
|
862
|
+
onChange: formik.handleChange,
|
|
863
|
+
children: [jsx(RadioInput.Option, {
|
|
864
|
+
value: EXPORT_SELECTION_TYPES.ALL_RESOURCES,
|
|
865
|
+
"data-testid": 'test-all-resources',
|
|
866
|
+
children: jsx(Text.Body, {
|
|
867
|
+
isBold: !isNewTheme,
|
|
868
|
+
intlMessage: _objectSpread$6(_objectSpread$6({}, messages.exportAllResources), {}, {
|
|
869
|
+
values: {
|
|
870
|
+
resourceType: resourceTypePlural,
|
|
871
|
+
count: allResourcesCount
|
|
872
|
+
}
|
|
873
|
+
})
|
|
874
|
+
})
|
|
875
|
+
}), jsx(RadioInput.Option, {
|
|
876
|
+
value: EXPORT_SELECTION_TYPES.ONLY_MATCHING,
|
|
877
|
+
"data-testid": 'test-only-matching',
|
|
878
|
+
isDisabled: !Boolean(matchingResourcesCount),
|
|
879
|
+
children: jsx(Text.Body, {
|
|
880
|
+
isBold: !isNewTheme,
|
|
881
|
+
intlMessage: _objectSpread$6(_objectSpread$6({}, messages.exportOnlyMatchingResources), {}, {
|
|
882
|
+
values: {
|
|
883
|
+
count: matchingResourcesCount || intl.formatMessage(messages.nothingApplied)
|
|
884
|
+
}
|
|
885
|
+
})
|
|
886
|
+
})
|
|
887
|
+
}), jsx(RadioInput.Option, {
|
|
888
|
+
value: EXPORT_SELECTION_TYPES.ONLY_SELECTED,
|
|
889
|
+
"data-testid": 'test-only-selected',
|
|
890
|
+
isDisabled: !Boolean(selectedResourceIds.length),
|
|
891
|
+
children: jsx(Text.Body, {
|
|
892
|
+
isBold: !isNewTheme,
|
|
893
|
+
intlMessage: _objectSpread$6(_objectSpread$6({}, messages.exportOnlySelectedResources), {}, {
|
|
894
|
+
values: {
|
|
895
|
+
resourceType: resourceTypePlural,
|
|
896
|
+
count: selectedResourceIds.length
|
|
897
|
+
}
|
|
898
|
+
})
|
|
899
|
+
})
|
|
900
|
+
})]
|
|
901
|
+
})
|
|
902
|
+
});
|
|
903
|
+
}
|
|
904
|
+
|
|
905
|
+
function ownKeys$5(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
906
|
+
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(_context = ownKeys$5(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$5(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
907
|
+
function ExportTextMessage() {
|
|
908
|
+
const _useExportResourcesCo = useExportResourcesContext(),
|
|
909
|
+
resourceType = _useExportResourcesCo.resourceType,
|
|
910
|
+
allResourcesCount = _useExportResourcesCo.allResourcesCount,
|
|
911
|
+
selectedResourceIds = _useExportResourcesCo.selectedResourceIds,
|
|
912
|
+
matchingResourcesCount = _useExportResourcesCo.matchingResourcesCount,
|
|
913
|
+
formik = _useExportResourcesCo.formik;
|
|
914
|
+
const resourceTypePlural = resourceTypeToPlural({
|
|
915
|
+
resourceType: resourceType
|
|
916
|
+
});
|
|
917
|
+
switch (_valuesInstanceProperty(formik).exportSelectionType) {
|
|
918
|
+
case EXPORT_SELECTION_TYPES.ALL_RESOURCES:
|
|
919
|
+
return jsx(Text.Body, {
|
|
920
|
+
intlMessage: _objectSpread$5(_objectSpread$5({}, messages.exportAllMessage), {}, {
|
|
836
921
|
values: {
|
|
837
|
-
|
|
922
|
+
count: allResourcesCount,
|
|
923
|
+
resourceType: resourceTypePlural,
|
|
924
|
+
b: getBold
|
|
838
925
|
}
|
|
839
926
|
})
|
|
840
|
-
})
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
927
|
+
});
|
|
928
|
+
case EXPORT_SELECTION_TYPES.ONLY_MATCHING:
|
|
929
|
+
return jsx(Text.Body, {
|
|
930
|
+
intlMessage: _objectSpread$5(_objectSpread$5({}, messages.exportMatchingMessage), {}, {
|
|
931
|
+
values: {
|
|
932
|
+
count: matchingResourcesCount,
|
|
933
|
+
resourceType: resourceTypePlural,
|
|
934
|
+
b: getBold
|
|
935
|
+
}
|
|
936
|
+
})
|
|
937
|
+
});
|
|
938
|
+
case EXPORT_SELECTION_TYPES.ONLY_SELECTED:
|
|
939
|
+
return jsx(Text.Body, {
|
|
940
|
+
intlMessage: _objectSpread$5(_objectSpread$5({}, messages.exportSelectedMessage), {}, {
|
|
941
|
+
values: {
|
|
942
|
+
count: selectedResourceIds.length,
|
|
943
|
+
resourceType: resourceTypePlural,
|
|
944
|
+
b: getBold
|
|
945
|
+
}
|
|
946
|
+
})
|
|
947
|
+
});
|
|
948
|
+
default:
|
|
949
|
+
throw new UnexpectedSelectionTypeError(_valuesInstanceProperty(formik).exportSelectionType);
|
|
950
|
+
}
|
|
845
951
|
}
|
|
846
|
-
ExportFields.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
847
|
-
// TODO: Circular reference
|
|
848
|
-
fields: PropTypes.arrayOf(PropTypes.shape({
|
|
849
|
-
key: PropTypes.string.isRequired,
|
|
850
|
-
label: PropTypes.string,
|
|
851
|
-
isLocalized: PropTypes.bool,
|
|
852
|
-
fields: PropTypes.arrayOf(PropTypes.shape({
|
|
853
|
-
key: PropTypes.string.isRequired,
|
|
854
|
-
label: PropTypes.string,
|
|
855
|
-
isLocalized: PropTypes.bool
|
|
856
|
-
}))
|
|
857
|
-
})).isRequired
|
|
858
|
-
} : {};
|
|
859
952
|
|
|
860
953
|
const ExportSelection = () => {
|
|
861
954
|
const _useTheme = useTheme(),
|
|
@@ -919,8 +1012,8 @@ const ExportSelection = () => {
|
|
|
919
1012
|
});
|
|
920
1013
|
};
|
|
921
1014
|
|
|
922
|
-
function ownKeys$
|
|
923
|
-
function _objectSpread$
|
|
1015
|
+
function ownKeys$4(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
1016
|
+
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(_context = ownKeys$4(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$4(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
924
1017
|
const ExportProperties = props => {
|
|
925
1018
|
const _useTheme = useTheme(),
|
|
926
1019
|
isNewTheme = _useTheme.isNewTheme;
|
|
@@ -937,7 +1030,7 @@ const ExportProperties = props => {
|
|
|
937
1030
|
return jsx(CollapsiblePanel, {
|
|
938
1031
|
header: jsx(Text.Body, {
|
|
939
1032
|
isBold: true,
|
|
940
|
-
intlMessage: _objectSpread$
|
|
1033
|
+
intlMessage: _objectSpread$4({}, messages.propertiesPanelLabel)
|
|
941
1034
|
}),
|
|
942
1035
|
children: props.renderProperties()
|
|
943
1036
|
});
|
|
@@ -946,27 +1039,6 @@ ExportProperties.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
946
1039
|
renderProperties: PropTypes.func
|
|
947
1040
|
} : {};
|
|
948
1041
|
|
|
949
|
-
function ownKeys$4(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
950
|
-
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(_context = ownKeys$4(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$4(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
951
|
-
function renderFileNameError(key) {
|
|
952
|
-
switch (key) {
|
|
953
|
-
case 'missing':
|
|
954
|
-
return jsx(FormattedMessage, _objectSpread$4({}, messages.missingFileNameError));
|
|
955
|
-
case 'invalidInput':
|
|
956
|
-
return jsx(FormattedMessage, _objectSpread$4({}, messages.invalidFileNameError));
|
|
957
|
-
default:
|
|
958
|
-
return null;
|
|
959
|
-
}
|
|
960
|
-
}
|
|
961
|
-
function renderLanguageError(key) {
|
|
962
|
-
switch (key) {
|
|
963
|
-
case 'missing':
|
|
964
|
-
return jsx(FormattedMessage, _objectSpread$4({}, messages.missingLanguageError));
|
|
965
|
-
default:
|
|
966
|
-
return null;
|
|
967
|
-
}
|
|
968
|
-
}
|
|
969
|
-
|
|
970
1042
|
function ownKeys$3(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
971
1043
|
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(_context = ownKeys$3(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$3(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
972
1044
|
const outputFormatOptions = [{
|
|
@@ -1109,128 +1181,8 @@ ExportFileSettings.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
1109
1181
|
renderProperties: PropTypes.func
|
|
1110
1182
|
} : {};
|
|
1111
1183
|
|
|
1112
|
-
async function createExportOperation(_ref) {
|
|
1113
|
-
let projectKey = _ref.projectKey,
|
|
1114
|
-
graphQuery = _ref.graphQuery,
|
|
1115
|
-
asyncDispatchFn = _ref.asyncDispatchFn;
|
|
1116
|
-
const uri = "/proxy/export/".concat(projectKey, "/export-operations");
|
|
1117
|
-
const response = await asyncDispatchFn(actions.post({
|
|
1118
|
-
// FIXME: EXPORT is undefined
|
|
1119
|
-
mcApiProxyTarget: MC_API_PROXY_TARGETS.EXPORT,
|
|
1120
|
-
uri: uri,
|
|
1121
|
-
headers: {
|
|
1122
|
-
accept: 'application/json'
|
|
1123
|
-
},
|
|
1124
|
-
payload: {
|
|
1125
|
-
query: graphQuery
|
|
1126
|
-
}
|
|
1127
|
-
}));
|
|
1128
|
-
return response;
|
|
1129
|
-
}
|
|
1130
|
-
|
|
1131
1184
|
function ownKeys$2(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
1132
1185
|
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(_context = ownKeys$2(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$2(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
1133
|
-
function ExportConfirmationModal(props) {
|
|
1134
|
-
const _useApplicationContex = useApplicationContext(applicationContext => {
|
|
1135
|
-
var _applicationContext$p, _applicationContext$p2;
|
|
1136
|
-
return {
|
|
1137
|
-
projectName: (_applicationContext$p = applicationContext.project) === null || _applicationContext$p === void 0 ? void 0 : _applicationContext$p.name,
|
|
1138
|
-
projectKey: (_applicationContext$p2 = applicationContext.project) === null || _applicationContext$p2 === void 0 ? void 0 : _applicationContext$p2.key
|
|
1139
|
-
};
|
|
1140
|
-
}),
|
|
1141
|
-
projectName = _useApplicationContex.projectName,
|
|
1142
|
-
projectKey = _useApplicationContex.projectKey;
|
|
1143
|
-
const _useExportResourcesCo = useExportResourcesContext(),
|
|
1144
|
-
formik = _useExportResourcesCo.formik,
|
|
1145
|
-
allResourcesCount = _useExportResourcesCo.allResourcesCount,
|
|
1146
|
-
matchingResourcesCount = _useExportResourcesCo.matchingResourcesCount,
|
|
1147
|
-
selectedResourceIds = _useExportResourcesCo.selectedResourceIds,
|
|
1148
|
-
resourceType = _useExportResourcesCo.resourceType,
|
|
1149
|
-
setExportOperationStarted = _useExportResourcesCo.setExportOperationStarted;
|
|
1150
|
-
const intl = useIntl();
|
|
1151
|
-
const asyncDispatch = useAsyncDispatch();
|
|
1152
|
-
const resourceTypePlural = resourceTypeToPlural({
|
|
1153
|
-
resourceType: props.resourceType
|
|
1154
|
-
});
|
|
1155
|
-
const countInConfirmationMessage = () => {
|
|
1156
|
-
switch (_valuesInstanceProperty(formik).exportSelectionType) {
|
|
1157
|
-
case EXPORT_SELECTION_TYPES.ALL_RESOURCES:
|
|
1158
|
-
return allResourcesCount;
|
|
1159
|
-
case EXPORT_SELECTION_TYPES.ONLY_MATCHING:
|
|
1160
|
-
return matchingResourcesCount;
|
|
1161
|
-
case EXPORT_SELECTION_TYPES.ONLY_SELECTED:
|
|
1162
|
-
return selectedResourceIds.length;
|
|
1163
|
-
default:
|
|
1164
|
-
throw new UnexpectedSelectionTypeError(_valuesInstanceProperty(formik).exportSelectionType);
|
|
1165
|
-
}
|
|
1166
|
-
};
|
|
1167
|
-
return jsx(ConfirmationDialog, {
|
|
1168
|
-
dataAttributesPrimaryButton: {
|
|
1169
|
-
'data-testid': 'confirm-export-button'
|
|
1170
|
-
},
|
|
1171
|
-
title: intl.formatMessage(messages.confirmationTitle, {
|
|
1172
|
-
resourceType: resourceTypePlural
|
|
1173
|
-
}),
|
|
1174
|
-
labelPrimary: intl.formatMessage(messages.exportConfirmationLabel, {
|
|
1175
|
-
resourceType: resourceTypePlural
|
|
1176
|
-
}),
|
|
1177
|
-
isOpen: props.isOpen,
|
|
1178
|
-
onClose: props.closeModal,
|
|
1179
|
-
onCancel: props.closeModal,
|
|
1180
|
-
onConfirm: async () => {
|
|
1181
|
-
setExportOperationStarted(false);
|
|
1182
|
-
const graphQuery = buildGraphQuery({
|
|
1183
|
-
resourceType: resourceType,
|
|
1184
|
-
selectedResourceIds: selectedResourceIds,
|
|
1185
|
-
fields: _valuesInstanceProperty(formik).fields,
|
|
1186
|
-
exportSelectionType: _valuesInstanceProperty(formik).exportSelectionType,
|
|
1187
|
-
languages: _valuesInstanceProperty(formik).languages
|
|
1188
|
-
});
|
|
1189
|
-
props.closeModal();
|
|
1190
|
-
try {
|
|
1191
|
-
const response = await createExportOperation({
|
|
1192
|
-
projectKey,
|
|
1193
|
-
graphQuery,
|
|
1194
|
-
asyncDispatchFn: asyncDispatch
|
|
1195
|
-
});
|
|
1196
|
-
switch (response.state) {
|
|
1197
|
-
case EXPORT_OPERATION_STATES.PROCESSING:
|
|
1198
|
-
case EXPORT_OPERATION_STATES.COMPLETED:
|
|
1199
|
-
setExportOperationStarted(true);
|
|
1200
|
-
break;
|
|
1201
|
-
default:
|
|
1202
|
-
throw new UnexpectedExportOperationStateError(response.state);
|
|
1203
|
-
}
|
|
1204
|
-
} catch (errors) {
|
|
1205
|
-
showApiErrorNotification({
|
|
1206
|
-
errors
|
|
1207
|
-
});
|
|
1208
|
-
}
|
|
1209
|
-
},
|
|
1210
|
-
children: jsxs("div", {
|
|
1211
|
-
children: [jsx(Text.Body, {
|
|
1212
|
-
intlMessage: _objectSpread$2(_objectSpread$2({}, messages.confirmationBodyPlan), {}, {
|
|
1213
|
-
values: {
|
|
1214
|
-
resourceType: resourceTypePlural,
|
|
1215
|
-
projectName: projectName,
|
|
1216
|
-
count: countInConfirmationMessage(),
|
|
1217
|
-
bold: getBold
|
|
1218
|
-
}
|
|
1219
|
-
})
|
|
1220
|
-
}), jsx(Text.Body, {
|
|
1221
|
-
intlMessage: messages.confirmationBodyQuestion
|
|
1222
|
-
})]
|
|
1223
|
-
})
|
|
1224
|
-
});
|
|
1225
|
-
}
|
|
1226
|
-
ExportConfirmationModal.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
1227
|
-
isOpen: PropTypes.bool.isRequired,
|
|
1228
|
-
resourceType: PropTypes.string.isRequired,
|
|
1229
|
-
closeModal: PropTypes.func.isRequired
|
|
1230
|
-
} : {};
|
|
1231
|
-
|
|
1232
|
-
function ownKeys$1(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
1233
|
-
function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys$1(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$1(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
1234
1186
|
const getExportLogsLink = (projectKey, msg) => jsx(Link, {
|
|
1235
1187
|
to: "/".concat(projectKey, "/operations/export/logs"),
|
|
1236
1188
|
children: msg
|
|
@@ -1252,7 +1204,7 @@ function ExportOperationSuccessMessage(_ref) {
|
|
|
1252
1204
|
max: 16,
|
|
1253
1205
|
children: jsx(ContentNotification, {
|
|
1254
1206
|
type: "success",
|
|
1255
|
-
intlMessage: _objectSpread$
|
|
1207
|
+
intlMessage: _objectSpread$2(_objectSpread$2({}, messages.exportOperationSuccessMessage), {}, {
|
|
1256
1208
|
values: {
|
|
1257
1209
|
logsLink: msg => getExportLogsLink(projectKey, msg)
|
|
1258
1210
|
}
|
|
@@ -1265,6 +1217,80 @@ ExportOperationSuccessMessage.propTypes = process.env.NODE_ENV !== "production"
|
|
|
1265
1217
|
isShown: PropTypes.bool.isRequired
|
|
1266
1218
|
} : {};
|
|
1267
1219
|
|
|
1220
|
+
const ExportResourcesContext = /*#__PURE__*/createContext();
|
|
1221
|
+
|
|
1222
|
+
const ExportResourcesModalShape = PropTypes.shape({
|
|
1223
|
+
resourceType: PropTypes.string.isRequired,
|
|
1224
|
+
outputFormat: PropTypes.string,
|
|
1225
|
+
isOpen: PropTypes.bool.isRequired,
|
|
1226
|
+
closeModal: PropTypes.func.isRequired,
|
|
1227
|
+
allResourcesCount: PropTypes.number.isRequired,
|
|
1228
|
+
matchingResourcesCount: PropTypes.number,
|
|
1229
|
+
selectedResourceIds: PropTypes.array,
|
|
1230
|
+
// TODO: Circular reference
|
|
1231
|
+
fields: PropTypes.arrayOf(PropTypes.shape({
|
|
1232
|
+
key: PropTypes.string.isRequired,
|
|
1233
|
+
label: PropTypes.string,
|
|
1234
|
+
isLocalized: PropTypes.bool,
|
|
1235
|
+
fields: PropTypes.arrayOf(PropTypes.shape({
|
|
1236
|
+
key: PropTypes.string.isRequired,
|
|
1237
|
+
label: PropTypes.string,
|
|
1238
|
+
isLocalized: PropTypes.bool
|
|
1239
|
+
}))
|
|
1240
|
+
})).isRequired,
|
|
1241
|
+
exportSelectionType: PropTypes.string,
|
|
1242
|
+
appliedSearchTerms: PropTypes.array,
|
|
1243
|
+
appliedFilters: PropTypes.array,
|
|
1244
|
+
renderProperties: PropTypes.func
|
|
1245
|
+
}).isRequired;
|
|
1246
|
+
|
|
1247
|
+
function ownKeys$1(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
1248
|
+
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(_context2 = ownKeys$1(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context3 = ownKeys$1(Object(source))).call(_context3, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
1249
|
+
const ExportResourcesContextProvider = props => {
|
|
1250
|
+
var _context;
|
|
1251
|
+
const todayFormatted = moment().format('DD-MM-YY_HH-mm');
|
|
1252
|
+
const _useApplicationContex = useApplicationContext(applicationContext => ({
|
|
1253
|
+
language: applicationContext.dataLocale
|
|
1254
|
+
})),
|
|
1255
|
+
language = _useApplicationContex.language;
|
|
1256
|
+
const formik = useFormik({
|
|
1257
|
+
initialValues: {
|
|
1258
|
+
outputFormat: props.outputFormat,
|
|
1259
|
+
fileName: _concatInstanceProperty(_context = "".concat(resourceTypeToPlural({
|
|
1260
|
+
resourceType: props.resourceType,
|
|
1261
|
+
isUpperCase: true
|
|
1262
|
+
}), "_Export_")).call(_context, todayFormatted),
|
|
1263
|
+
languages: [language],
|
|
1264
|
+
fields: props.fields,
|
|
1265
|
+
appliedSearchTerms: props.appliedSearchTerms,
|
|
1266
|
+
appliedFilters: props.appliedFilters,
|
|
1267
|
+
exportSelectionType: props.exportSelectionType,
|
|
1268
|
+
isAllLanguagesChecked: false
|
|
1269
|
+
},
|
|
1270
|
+
validate
|
|
1271
|
+
});
|
|
1272
|
+
const _React$useState = React.useState(false),
|
|
1273
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
1274
|
+
exportOperationStarted = _React$useState2[0],
|
|
1275
|
+
setExportOperationStarted = _React$useState2[1];
|
|
1276
|
+
return jsx(ExportResourcesContext.Provider, {
|
|
1277
|
+
value: {
|
|
1278
|
+
formik,
|
|
1279
|
+
resourceType: props.resourceType,
|
|
1280
|
+
allResourcesCount: props.allResourcesCount,
|
|
1281
|
+
matchingResourcesCount: props.matchingResourcesCount,
|
|
1282
|
+
selectedResourceIds: props.selectedResourceIds,
|
|
1283
|
+
exportOperationStarted,
|
|
1284
|
+
setExportOperationStarted
|
|
1285
|
+
},
|
|
1286
|
+
children: props.children
|
|
1287
|
+
});
|
|
1288
|
+
};
|
|
1289
|
+
ExportResourcesContextProvider.displayName = 'ExportResourcesContextProvider';
|
|
1290
|
+
ExportResourcesContextProvider.propTypes = process.env.NODE_ENV !== "production" ? _objectSpread$1(_objectSpread$1({}, ExportResourcesModalShape), {}, {
|
|
1291
|
+
children: PropTypes.node
|
|
1292
|
+
}) : {};
|
|
1293
|
+
|
|
1268
1294
|
const _excluded = ["renderProperties"];
|
|
1269
1295
|
function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
1270
1296
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|