@commercetools-frontend-extensions/export-resources-modal 1.2.2 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/commercetools-frontend-extensions-export-resources-modal.cjs.dev.js +241 -430
- package/dist/commercetools-frontend-extensions-export-resources-modal.cjs.prod.js +241 -428
- package/dist/commercetools-frontend-extensions-export-resources-modal.esm.js +242 -430
- package/package.json +44 -39
|
@@ -39,8 +39,6 @@ var _valuesInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/ins
|
|
|
39
39
|
var designSystem = require('@commercetools-uikit/design-system');
|
|
40
40
|
var react$1 = require('@emotion/react');
|
|
41
41
|
var _styled = require('@emotion/styled/base');
|
|
42
|
-
var _asyncToGenerator = require('@babel/runtime-corejs3/helpers/asyncToGenerator');
|
|
43
|
-
var _regeneratorRuntime = require('@babel/runtime-corejs3/regenerator');
|
|
44
42
|
var sdk = require('@commercetools-frontend/sdk');
|
|
45
43
|
var actionsGlobal = require('@commercetools-frontend/actions-global');
|
|
46
44
|
var constants = require('@commercetools-frontend/constants');
|
|
@@ -65,131 +63,98 @@ var moment__default = /*#__PURE__*/_interopDefault(moment);
|
|
|
65
63
|
var omitEmpty__default = /*#__PURE__*/_interopDefault(omitEmpty);
|
|
66
64
|
var _valuesInstanceProperty__default = /*#__PURE__*/_interopDefault(_valuesInstanceProperty);
|
|
67
65
|
var _styled__default = /*#__PURE__*/_interopDefault(_styled);
|
|
68
|
-
var _regeneratorRuntime__default = /*#__PURE__*/_interopDefault(_regeneratorRuntime);
|
|
69
66
|
|
|
70
|
-
|
|
67
|
+
const EXPORTABLE_RESOURCES = {
|
|
71
68
|
CATEGORY: 'category',
|
|
72
69
|
PRODUCT: 'product',
|
|
73
70
|
DISCOUNT_CODE: 'discountCode'
|
|
74
71
|
};
|
|
75
|
-
|
|
72
|
+
const EXPORT_SELECTION_TYPES = {
|
|
76
73
|
ALL_RESOURCES: 'allResources',
|
|
77
74
|
ONLY_MATCHING: 'onlyMatching',
|
|
78
75
|
ONLY_SELECTED: 'onlySelected'
|
|
79
76
|
};
|
|
80
|
-
|
|
77
|
+
const OUTPUT_FORMATS = {
|
|
81
78
|
JSON: 'json',
|
|
82
79
|
CSV: 'csv'
|
|
83
80
|
};
|
|
84
|
-
|
|
81
|
+
const EXPORT_OPERATION_STATES = {
|
|
85
82
|
PROCESSING: 'processing',
|
|
86
83
|
COMPLETED: 'completed',
|
|
87
84
|
FAILED: 'failed'
|
|
88
85
|
};
|
|
89
86
|
|
|
90
87
|
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); }; }
|
|
91
|
-
|
|
92
88
|
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; } }
|
|
93
|
-
|
|
94
|
-
var UnexpectedSelectionTypeError = /*#__PURE__*/function (_Error) {
|
|
89
|
+
let UnexpectedSelectionTypeError = /*#__PURE__*/function (_Error) {
|
|
95
90
|
_inherits(UnexpectedSelectionTypeError, _Error);
|
|
96
|
-
|
|
97
91
|
var _super = _createSuper$3(UnexpectedSelectionTypeError);
|
|
98
|
-
|
|
99
92
|
function UnexpectedSelectionTypeError(exportSelectionType) {
|
|
100
93
|
var _this;
|
|
101
|
-
|
|
102
94
|
_classCallCheck(this, UnexpectedSelectionTypeError);
|
|
103
|
-
|
|
104
95
|
_this = _super.call(this, "Unexpected column: ".concat(exportSelectionType));
|
|
105
96
|
_this.name = 'UnexpectedSelectionTypeError';
|
|
106
97
|
return _this;
|
|
107
98
|
}
|
|
108
|
-
|
|
109
99
|
return _createClass(UnexpectedSelectionTypeError);
|
|
110
100
|
}( /*#__PURE__*/_wrapNativeSuper(Error));
|
|
111
101
|
|
|
112
102
|
function _createSuper$2(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$2(); 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); }; }
|
|
113
|
-
|
|
114
103
|
function _isNativeReflectConstruct$2() { 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; } }
|
|
115
|
-
|
|
116
|
-
var MissingExportResourceProviderError = /*#__PURE__*/function (_Error) {
|
|
104
|
+
let MissingExportResourceProviderError = /*#__PURE__*/function (_Error) {
|
|
117
105
|
_inherits(MissingExportResourceProviderError, _Error);
|
|
118
|
-
|
|
119
106
|
var _super = _createSuper$2(MissingExportResourceProviderError);
|
|
120
|
-
|
|
121
107
|
function MissingExportResourceProviderError() {
|
|
122
108
|
var _this;
|
|
123
|
-
|
|
124
109
|
_classCallCheck(this, MissingExportResourceProviderError);
|
|
125
|
-
|
|
126
110
|
_this = _super.call(this, 'useExportResourcesContext must be used within ExportResourcesContextProvider');
|
|
127
111
|
_this.name = 'MissingExportResourceProviderError';
|
|
128
112
|
return _this;
|
|
129
113
|
}
|
|
130
|
-
|
|
131
114
|
return _createClass(MissingExportResourceProviderError);
|
|
132
115
|
}( /*#__PURE__*/_wrapNativeSuper(Error));
|
|
133
116
|
|
|
134
117
|
function _createSuper$1(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$1(); 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); }; }
|
|
135
|
-
|
|
136
118
|
function _isNativeReflectConstruct$1() { 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; } }
|
|
137
|
-
|
|
138
|
-
var UnexpectedExportOperationStateError = /*#__PURE__*/function (_Error) {
|
|
119
|
+
let UnexpectedExportOperationStateError = /*#__PURE__*/function (_Error) {
|
|
139
120
|
_inherits(UnexpectedExportOperationStateError, _Error);
|
|
140
|
-
|
|
141
121
|
var _super = _createSuper$1(UnexpectedExportOperationStateError);
|
|
142
|
-
|
|
143
122
|
function UnexpectedExportOperationStateError(state) {
|
|
144
123
|
var _this;
|
|
145
|
-
|
|
146
124
|
_classCallCheck(this, UnexpectedExportOperationStateError);
|
|
147
|
-
|
|
148
125
|
_this = _super.call(this, "Unexpected export operation state \"".concat(state, "\""));
|
|
149
126
|
_this.name = 'UnexpectedExportOperationStateError';
|
|
150
127
|
return _this;
|
|
151
128
|
}
|
|
152
|
-
|
|
153
129
|
return _createClass(UnexpectedExportOperationStateError);
|
|
154
130
|
}( /*#__PURE__*/_wrapNativeSuper(Error));
|
|
155
131
|
|
|
156
132
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); 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); }; }
|
|
157
|
-
|
|
158
133
|
function _isNativeReflectConstruct() { 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; } }
|
|
159
|
-
|
|
160
|
-
var UnexpectedResourceTypeError = /*#__PURE__*/function (_Error) {
|
|
134
|
+
let UnexpectedResourceTypeError = /*#__PURE__*/function (_Error) {
|
|
161
135
|
_inherits(UnexpectedResourceTypeError, _Error);
|
|
162
|
-
|
|
163
136
|
var _super = _createSuper(UnexpectedResourceTypeError);
|
|
164
|
-
|
|
165
137
|
function UnexpectedResourceTypeError(resourceType) {
|
|
166
138
|
var _this;
|
|
167
|
-
|
|
168
139
|
_classCallCheck(this, UnexpectedResourceTypeError);
|
|
169
|
-
|
|
170
140
|
_this = _super.call(this, "Unexpected resource type: ".concat(resourceType));
|
|
171
141
|
_this.name = 'UnexpectedResourceTypeError';
|
|
172
142
|
return _this;
|
|
173
143
|
}
|
|
174
|
-
|
|
175
144
|
return _createClass(UnexpectedResourceTypeError);
|
|
176
145
|
}( /*#__PURE__*/_wrapNativeSuper(Error));
|
|
177
146
|
|
|
178
147
|
function resourceTypeToPlural(_ref) {
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
148
|
+
let resourceType = _ref.resourceType,
|
|
149
|
+
_ref$isUpperCase = _ref.isUpperCase,
|
|
150
|
+
isUpperCase = _ref$isUpperCase === void 0 ? false : _ref$isUpperCase;
|
|
183
151
|
switch (resourceType) {
|
|
184
152
|
case EXPORTABLE_RESOURCES.CATEGORY:
|
|
185
153
|
return isUpperCase ? 'Categories' : 'categories';
|
|
186
|
-
|
|
187
154
|
case EXPORTABLE_RESOURCES.PRODUCT:
|
|
188
155
|
return isUpperCase ? 'Products' : 'products';
|
|
189
|
-
|
|
190
156
|
case EXPORTABLE_RESOURCES.DISCOUNT_CODE:
|
|
191
157
|
return isUpperCase ? 'Discount codes' : 'discount codes';
|
|
192
|
-
|
|
193
158
|
default:
|
|
194
159
|
throw UnexpectedResourceTypeError(resourceType);
|
|
195
160
|
}
|
|
@@ -198,13 +163,10 @@ function resourceTypeToOperationName(resourceType) {
|
|
|
198
163
|
switch (resourceType) {
|
|
199
164
|
case EXPORTABLE_RESOURCES.CATEGORY:
|
|
200
165
|
return 'categories';
|
|
201
|
-
|
|
202
166
|
case EXPORTABLE_RESOURCES.PRODUCT:
|
|
203
167
|
return 'products';
|
|
204
|
-
|
|
205
168
|
case EXPORTABLE_RESOURCES.DISCOUNT_CODE:
|
|
206
169
|
return 'discountCodes';
|
|
207
|
-
|
|
208
170
|
default:
|
|
209
171
|
throw UnexpectedResourceTypeError(resourceType);
|
|
210
172
|
}
|
|
@@ -218,13 +180,11 @@ function isFilledArray(maybeArray) {
|
|
|
218
180
|
|
|
219
181
|
function buildGraphQuery(exportSettings) {
|
|
220
182
|
var _context;
|
|
221
|
-
|
|
222
|
-
var operation = resourceTypeToOperationName(exportSettings.resourceType);
|
|
223
|
-
|
|
183
|
+
const operation = resourceTypeToOperationName(exportSettings.resourceType);
|
|
224
184
|
switch (exportSettings.exportSelectionType) {
|
|
225
185
|
case EXPORT_SELECTION_TYPES.ALL_RESOURCES:
|
|
226
186
|
return gqlQueryBuilder.query({
|
|
227
|
-
operation
|
|
187
|
+
operation,
|
|
228
188
|
fields: [{
|
|
229
189
|
results: buildFields({
|
|
230
190
|
fields: exportSettings.fields,
|
|
@@ -233,10 +193,9 @@ function buildGraphQuery(exportSettings) {
|
|
|
233
193
|
}],
|
|
234
194
|
variables: {}
|
|
235
195
|
});
|
|
236
|
-
|
|
237
196
|
case EXPORT_SELECTION_TYPES.ONLY_SELECTED:
|
|
238
197
|
return gqlQueryBuilder.query({
|
|
239
|
-
operation
|
|
198
|
+
operation,
|
|
240
199
|
fields: [{
|
|
241
200
|
results: buildFields({
|
|
242
201
|
fields: exportSettings.fields,
|
|
@@ -244,40 +203,34 @@ function buildGraphQuery(exportSettings) {
|
|
|
244
203
|
})
|
|
245
204
|
}],
|
|
246
205
|
variables: {
|
|
247
|
-
where: "id in (".concat(_mapInstanceProperty__default["default"](_context = exportSettings.selectedResourceIds).call(_context,
|
|
248
|
-
return "\\\"".concat(id, "\\\"");
|
|
249
|
-
}).join(', '), ")")
|
|
206
|
+
where: "id in (".concat(_mapInstanceProperty__default["default"](_context = exportSettings.selectedResourceIds).call(_context, id => "\\\"".concat(id, "\\\"")).join(', '), ")")
|
|
250
207
|
}
|
|
251
208
|
});
|
|
252
|
-
|
|
253
209
|
case EXPORT_SELECTION_TYPES.ONLY_MATCHING:
|
|
254
210
|
// TODO: gql query for exporting filtered resources.
|
|
255
211
|
throw new UnexpectedSelectionTypeError(exportSettings.exportSelectionType);
|
|
256
|
-
|
|
257
212
|
default:
|
|
258
213
|
throw new UnexpectedSelectionTypeError(exportSettings.exportSelectionType);
|
|
259
214
|
}
|
|
260
215
|
}
|
|
261
|
-
|
|
262
216
|
function buildFields(_ref) {
|
|
263
217
|
var _context2;
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
if (field.isLocalized) return _mapInstanceProperty__default["default"](languages).call(languages, function (language) {
|
|
218
|
+
let fields = _ref.fields,
|
|
219
|
+
languages = _ref.languages;
|
|
220
|
+
return _flatInstanceProperty__default["default"](_context2 = _mapInstanceProperty__default["default"](fields).call(fields, field => {
|
|
221
|
+
if (field.isLocalized) return _mapInstanceProperty__default["default"](languages).call(languages, language => {
|
|
269
222
|
var _context3, _context4, _context5;
|
|
270
|
-
|
|
271
|
-
var alias = replaceSpecialCharsWithUnderscore(_concatInstanceProperty__default["default"](_context3 = "".concat(field.key, "_")).call(_context3, language));
|
|
223
|
+
const alias = replaceSpecialCharsWithUnderscore(_concatInstanceProperty__default["default"](_context3 = "".concat(field.key, "_")).call(_context3, language));
|
|
272
224
|
return _concatInstanceProperty__default["default"](_context4 = _concatInstanceProperty__default["default"](_context5 = "".concat(alias, ": ")).call(_context5, field.key, "(locale: \"")).call(_context4, language, "\")");
|
|
273
225
|
});else {
|
|
274
226
|
if (isFilledArray(field.fields)) {
|
|
275
|
-
return
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
227
|
+
return {
|
|
228
|
+
[field.key]: buildFields({
|
|
229
|
+
fields: field.fields,
|
|
230
|
+
languages
|
|
231
|
+
})
|
|
232
|
+
};
|
|
279
233
|
}
|
|
280
|
-
|
|
281
234
|
return field.key;
|
|
282
235
|
}
|
|
283
236
|
})).call(_context2);
|
|
@@ -436,7 +389,7 @@ var messages = reactIntl.defineMessages({
|
|
|
436
389
|
}
|
|
437
390
|
});
|
|
438
391
|
|
|
439
|
-
|
|
392
|
+
const ExportResourcesContext = /*#__PURE__*/react.createContext();
|
|
440
393
|
|
|
441
394
|
PropTypes__default["default"].shape({
|
|
442
395
|
resourceType: PropTypes__default["default"].string.isRequired,
|
|
@@ -464,37 +417,29 @@ PropTypes__default["default"].shape({
|
|
|
464
417
|
}).isRequired;
|
|
465
418
|
|
|
466
419
|
function validate(values) {
|
|
467
|
-
|
|
420
|
+
const errors = {
|
|
468
421
|
fileName: {},
|
|
469
422
|
languages: {}
|
|
470
423
|
};
|
|
471
|
-
|
|
472
424
|
if (uiKit.TextInput.isEmpty(values.fileName)) {
|
|
473
425
|
errors.fileName.missing = true;
|
|
474
426
|
} else if (!/^[a-zA-Z0-9-_]+$/.test(values.fileName)) {
|
|
475
427
|
errors.fileName.invalidInput = true;
|
|
476
428
|
}
|
|
477
|
-
|
|
478
429
|
if (values.languages.length < 1) {
|
|
479
430
|
errors.languages.missing = true;
|
|
480
431
|
}
|
|
481
|
-
|
|
482
432
|
return omitEmpty__default["default"](errors);
|
|
483
433
|
}
|
|
484
434
|
|
|
485
|
-
|
|
435
|
+
const ExportResourcesContextProvider = props => {
|
|
486
436
|
var _context;
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
var _useApplicationContex = applicationShellConnectors.useApplicationContext(function (applicationContext) {
|
|
491
|
-
return {
|
|
437
|
+
const todayFormatted = moment__default["default"]().format('DD-MM-YY_HH-mm');
|
|
438
|
+
const _useApplicationContex = applicationShellConnectors.useApplicationContext(applicationContext => ({
|
|
492
439
|
language: applicationContext.dataLocale
|
|
493
|
-
}
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
var formik$1 = formik.useFormik({
|
|
440
|
+
})),
|
|
441
|
+
language = _useApplicationContex.language;
|
|
442
|
+
const formik$1 = formik.useFormik({
|
|
498
443
|
initialValues: {
|
|
499
444
|
outputFormat: props.outputFormat,
|
|
500
445
|
fileName: _concatInstanceProperty__default["default"](_context = "".concat(resourceTypeToPlural({
|
|
@@ -508,14 +453,12 @@ var ExportResourcesContextProvider = function ExportResourcesContextProvider(pro
|
|
|
508
453
|
exportSelectionType: props.exportSelectionType,
|
|
509
454
|
isAllLanguagesChecked: false
|
|
510
455
|
},
|
|
511
|
-
validate
|
|
456
|
+
validate
|
|
512
457
|
});
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
setExportOperationStarted = _useState2[1];
|
|
518
|
-
|
|
458
|
+
const _useState = react.useState(false),
|
|
459
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
460
|
+
exportOperationStarted = _useState2[0],
|
|
461
|
+
setExportOperationStarted = _useState2[1];
|
|
519
462
|
return jsxRuntime.jsx(ExportResourcesContext.Provider, {
|
|
520
463
|
value: {
|
|
521
464
|
formik: formik$1,
|
|
@@ -523,66 +466,57 @@ var ExportResourcesContextProvider = function ExportResourcesContextProvider(pro
|
|
|
523
466
|
allResourcesCount: props.allResourcesCount,
|
|
524
467
|
matchingResourcesCount: props.matchingResourcesCount,
|
|
525
468
|
selectedResourceIds: props.selectedResourceIds,
|
|
526
|
-
exportOperationStarted
|
|
527
|
-
setExportOperationStarted
|
|
469
|
+
exportOperationStarted,
|
|
470
|
+
setExportOperationStarted
|
|
528
471
|
},
|
|
529
472
|
children: props.children
|
|
530
473
|
});
|
|
531
474
|
};
|
|
532
|
-
|
|
533
475
|
ExportResourcesContextProvider.displayName = 'ExportResourcesContextProvider';
|
|
534
476
|
ExportResourcesContextProvider.propTypes = {};
|
|
535
477
|
|
|
536
478
|
function useExportResourcesContext() {
|
|
537
|
-
|
|
538
|
-
|
|
479
|
+
const context = react.useContext(ExportResourcesContext);
|
|
539
480
|
if (!context) {
|
|
540
481
|
throw new MissingExportResourceProviderError();
|
|
541
482
|
}
|
|
542
|
-
|
|
543
483
|
return context;
|
|
544
484
|
}
|
|
545
485
|
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
var isNewTheme = _ref.isNewTheme;
|
|
486
|
+
const smallTopPadding = /*#__PURE__*/react$1.css("padding-top:", designSystem.customProperties.spacingXs, ";" + ("" ), "" );
|
|
487
|
+
const tagListContainer = _ref => {
|
|
488
|
+
let isNewTheme = _ref.isNewTheme;
|
|
550
489
|
return /*#__PURE__*/react$1.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;}" + ("" ), "" );
|
|
551
490
|
};
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
var notBold = {
|
|
491
|
+
const tagListItem = /*#__PURE__*/react$1.css("margin:0 ", designSystem.customProperties.spacingXs, " ", designSystem.customProperties.spacingXs, " 0;display:flex;min-width:0;" + ("" ), "" );
|
|
492
|
+
const divider = /*#__PURE__*/react$1.css("box-sizing:border-box;width:100%;margin:0;border:0;border-top:1px solid ", designSystem.customProperties.colorNeutral60, ";" + ("" ), "" );
|
|
493
|
+
const notBold = {
|
|
556
494
|
name: "lugakg",
|
|
557
495
|
styles: "font-weight:normal"
|
|
558
496
|
} ;
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
tagListItem
|
|
562
|
-
tagListContainer
|
|
563
|
-
smallTopPadding
|
|
564
|
-
divider
|
|
565
|
-
notBold
|
|
566
|
-
successMessage
|
|
497
|
+
const successMessage = /*#__PURE__*/react$1.css("margin-bottom:", designSystem.customProperties.spacingL, ";" + ("" ), "" );
|
|
498
|
+
const styles = {
|
|
499
|
+
tagListItem,
|
|
500
|
+
tagListContainer,
|
|
501
|
+
smallTopPadding,
|
|
502
|
+
divider,
|
|
503
|
+
notBold,
|
|
504
|
+
successMessage
|
|
567
505
|
};
|
|
568
506
|
|
|
569
507
|
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; }
|
|
570
|
-
|
|
571
508
|
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; }
|
|
572
509
|
function ExportSelectionRadioButtons() {
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
selectedResourceIds = _useExportResourcesCo.selectedResourceIds;
|
|
584
|
-
|
|
585
|
-
var resourceTypePlural = resourceTypeToPlural({
|
|
510
|
+
const _useTheme = designSystem.useTheme(),
|
|
511
|
+
isNewTheme = _useTheme.isNewTheme;
|
|
512
|
+
const intl = reactIntl.useIntl();
|
|
513
|
+
const _useExportResourcesCo = useExportResourcesContext(),
|
|
514
|
+
formik = _useExportResourcesCo.formik,
|
|
515
|
+
resourceType = _useExportResourcesCo.resourceType,
|
|
516
|
+
allResourcesCount = _useExportResourcesCo.allResourcesCount,
|
|
517
|
+
matchingResourcesCount = _useExportResourcesCo.matchingResourcesCount,
|
|
518
|
+
selectedResourceIds = _useExportResourcesCo.selectedResourceIds;
|
|
519
|
+
const resourceTypePlural = resourceTypeToPlural({
|
|
586
520
|
resourceType: resourceType
|
|
587
521
|
});
|
|
588
522
|
return jsxRuntime.jsx(uiKit.Spacings.Inline, {
|
|
@@ -646,20 +580,17 @@ function getBold(msg) {
|
|
|
646
580
|
}
|
|
647
581
|
|
|
648
582
|
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; }
|
|
649
|
-
|
|
650
583
|
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; }
|
|
651
584
|
function ExportTextMessage() {
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
var resourceTypePlural = resourceTypeToPlural({
|
|
585
|
+
const _useExportResourcesCo = useExportResourcesContext(),
|
|
586
|
+
resourceType = _useExportResourcesCo.resourceType,
|
|
587
|
+
allResourcesCount = _useExportResourcesCo.allResourcesCount,
|
|
588
|
+
selectedResourceIds = _useExportResourcesCo.selectedResourceIds,
|
|
589
|
+
matchingResourcesCount = _useExportResourcesCo.matchingResourcesCount,
|
|
590
|
+
formik = _useExportResourcesCo.formik;
|
|
591
|
+
const resourceTypePlural = resourceTypeToPlural({
|
|
660
592
|
resourceType: resourceType
|
|
661
593
|
});
|
|
662
|
-
|
|
663
594
|
switch (_valuesInstanceProperty__default["default"](formik).exportSelectionType) {
|
|
664
595
|
case EXPORT_SELECTION_TYPES.ALL_RESOURCES:
|
|
665
596
|
return jsxRuntime.jsx(uiKit.Text.Body, {
|
|
@@ -671,7 +602,6 @@ function ExportTextMessage() {
|
|
|
671
602
|
}
|
|
672
603
|
})
|
|
673
604
|
});
|
|
674
|
-
|
|
675
605
|
case EXPORT_SELECTION_TYPES.ONLY_MATCHING:
|
|
676
606
|
return jsxRuntime.jsx(uiKit.Text.Body, {
|
|
677
607
|
intlMessage: _objectSpread$9(_objectSpread$9({}, messages.exportMatchingMessage), {}, {
|
|
@@ -682,7 +612,6 @@ function ExportTextMessage() {
|
|
|
682
612
|
}
|
|
683
613
|
})
|
|
684
614
|
});
|
|
685
|
-
|
|
686
615
|
case EXPORT_SELECTION_TYPES.ONLY_SELECTED:
|
|
687
616
|
return jsxRuntime.jsx(uiKit.Text.Body, {
|
|
688
617
|
intlMessage: _objectSpread$9(_objectSpread$9({}, messages.exportSelectedMessage), {}, {
|
|
@@ -693,42 +622,35 @@ function ExportTextMessage() {
|
|
|
693
622
|
}
|
|
694
623
|
})
|
|
695
624
|
});
|
|
696
|
-
|
|
697
625
|
default:
|
|
698
626
|
throw new UnexpectedSelectionTypeError(_valuesInstanceProperty__default["default"](formik).exportSelectionType);
|
|
699
627
|
}
|
|
700
628
|
}
|
|
701
629
|
|
|
702
630
|
function TagList(props) {
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
631
|
+
const _useTheme = designSystem.useTheme(),
|
|
632
|
+
isNewTheme = _useTheme.isNewTheme;
|
|
706
633
|
return jsxRuntime.jsx("div", {
|
|
707
634
|
css: styles.tagListContainer({
|
|
708
|
-
isNewTheme
|
|
635
|
+
isNewTheme
|
|
709
636
|
}),
|
|
710
637
|
"data-testid": props['data-testid'],
|
|
711
|
-
children: _mapInstanceProperty__default["default"](react.Children).call(react.Children, props.children,
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
});
|
|
716
|
-
})
|
|
638
|
+
children: _mapInstanceProperty__default["default"](react.Children).call(react.Children, props.children, tag => jsxRuntime.jsx("div", {
|
|
639
|
+
css: styles.tagListItem,
|
|
640
|
+
children: tag
|
|
641
|
+
}))
|
|
717
642
|
});
|
|
718
643
|
}
|
|
719
644
|
TagList.displayName = 'TagList';
|
|
720
645
|
TagList.propTypes = {};
|
|
721
646
|
|
|
722
647
|
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; }
|
|
723
|
-
|
|
724
648
|
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; }
|
|
725
649
|
function AppliedFilters(_ref) {
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
isNewTheme = _useTheme.isNewTheme;
|
|
731
|
-
|
|
650
|
+
let filters = _ref.filters,
|
|
651
|
+
onFilterRemove = _ref.onFilterRemove;
|
|
652
|
+
const _useTheme = designSystem.useTheme(),
|
|
653
|
+
isNewTheme = _useTheme.isNewTheme;
|
|
732
654
|
if (isNewTheme) return jsxRuntime.jsx(uiKit.CollapsiblePanel, {
|
|
733
655
|
condensed: true,
|
|
734
656
|
isDefaultClosed: !Boolean(filters.length),
|
|
@@ -740,17 +662,15 @@ function AppliedFilters(_ref) {
|
|
|
740
662
|
})
|
|
741
663
|
}),
|
|
742
664
|
children: jsxRuntime.jsx(TagList, {
|
|
743
|
-
children: _mapInstanceProperty__default["default"](filters).call(filters,
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
}, filter);
|
|
753
|
-
})
|
|
665
|
+
children: _mapInstanceProperty__default["default"](filters).call(filters, filter => jsxRuntime.jsx("div", {
|
|
666
|
+
"data-testid": "test-filter-".concat(filter),
|
|
667
|
+
children: jsxRuntime.jsx(uiKit.Tag, {
|
|
668
|
+
onRemove: () => {
|
|
669
|
+
onFilterRemove(filter);
|
|
670
|
+
},
|
|
671
|
+
children: filter
|
|
672
|
+
})
|
|
673
|
+
}, filter))
|
|
754
674
|
})
|
|
755
675
|
});
|
|
756
676
|
return jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
@@ -771,17 +691,15 @@ function AppliedFilters(_ref) {
|
|
|
771
691
|
})
|
|
772
692
|
})]
|
|
773
693
|
}), jsxRuntime.jsx(TagList, {
|
|
774
|
-
children: _mapInstanceProperty__default["default"](filters).call(filters,
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
}, filter);
|
|
784
|
-
})
|
|
694
|
+
children: _mapInstanceProperty__default["default"](filters).call(filters, filter => jsxRuntime.jsx("div", {
|
|
695
|
+
"data-testid": "test-filter-".concat(filter),
|
|
696
|
+
children: jsxRuntime.jsx(uiKit.Tag, {
|
|
697
|
+
onRemove: () => {
|
|
698
|
+
onFilterRemove(filter);
|
|
699
|
+
},
|
|
700
|
+
children: filter
|
|
701
|
+
})
|
|
702
|
+
}, filter))
|
|
785
703
|
})]
|
|
786
704
|
});
|
|
787
705
|
}
|
|
@@ -789,9 +707,8 @@ AppliedFilters.propTypes = {};
|
|
|
789
707
|
|
|
790
708
|
// TODO: @redesign cleanup
|
|
791
709
|
function ExportBasedOnMyViewsSelectField() {
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
710
|
+
const _useTheme = designSystem.useTheme(),
|
|
711
|
+
themedValue = _useTheme.themedValue;
|
|
795
712
|
return jsxRuntime.jsxs(uiKit.Spacings.Inline, {
|
|
796
713
|
scale: "m",
|
|
797
714
|
alignItems: "center",
|
|
@@ -810,19 +727,14 @@ function ExportBasedOnMyViewsSelectField() {
|
|
|
810
727
|
}
|
|
811
728
|
|
|
812
729
|
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; }
|
|
813
|
-
|
|
814
730
|
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; }
|
|
815
|
-
|
|
816
|
-
var IconPlaceholder = /*#__PURE__*/_styled__default["default"]("div", {
|
|
731
|
+
const IconPlaceholder = /*#__PURE__*/_styled__default["default"]("div", {
|
|
817
732
|
target: "e1nl5t3e0"
|
|
818
733
|
} )("width:", uiKit.customProperties.spacingM, ";" + ("" ));
|
|
819
|
-
|
|
820
734
|
function AppliedSearchTerms(_ref) {
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
isNewTheme = _useTheme.isNewTheme;
|
|
825
|
-
|
|
735
|
+
let appliedSearchTerms = _ref.appliedSearchTerms;
|
|
736
|
+
const _useTheme = designSystem.useTheme(),
|
|
737
|
+
isNewTheme = _useTheme.isNewTheme;
|
|
826
738
|
if (isNewTheme) return jsxRuntime.jsx(uiKit.CollapsiblePanel, {
|
|
827
739
|
condensed: true,
|
|
828
740
|
isDefaultClosed: !Boolean(appliedSearchTerms.length),
|
|
@@ -866,51 +778,39 @@ function AppliedSearchTerms(_ref) {
|
|
|
866
778
|
AppliedSearchTerms.propTypes = {};
|
|
867
779
|
|
|
868
780
|
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; }
|
|
869
|
-
|
|
870
781
|
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; }
|
|
871
|
-
|
|
872
782
|
function normalizeFields(fields) {
|
|
873
|
-
|
|
783
|
+
const result = _mapInstanceProperty__default["default"](fields).call(fields, field => {
|
|
874
784
|
if (isFilledArray(field.fields)) {
|
|
875
785
|
var _context;
|
|
876
|
-
|
|
877
|
-
return _mapInstanceProperty__default["default"](_context = normalizeFields(field.fields)).call(_context, function (nestedField) {
|
|
786
|
+
return _mapInstanceProperty__default["default"](_context = normalizeFields(field.fields)).call(_context, nestedField => {
|
|
878
787
|
var _context2;
|
|
879
|
-
|
|
880
788
|
return _objectSpread$6(_objectSpread$6({}, nestedField), {}, {
|
|
881
789
|
key: _concatInstanceProperty__default["default"](_context2 = "".concat(field.key, ".")).call(_context2, nestedField.key)
|
|
882
790
|
});
|
|
883
791
|
});
|
|
884
792
|
}
|
|
885
|
-
|
|
886
793
|
return field;
|
|
887
794
|
});
|
|
888
|
-
|
|
889
795
|
return _flatInstanceProperty__default["default"](result).call(result);
|
|
890
796
|
}
|
|
891
|
-
|
|
892
797
|
function FieldsRenderer(_ref) {
|
|
893
|
-
|
|
894
|
-
|
|
798
|
+
let fields = _ref.fields;
|
|
799
|
+
const allFields = normalizeFields(fields);
|
|
895
800
|
return jsxRuntime.jsx(TagList, {
|
|
896
|
-
children: _mapInstanceProperty__default["default"](allFields).call(allFields,
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
children:
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
}, field.key);
|
|
903
|
-
})
|
|
801
|
+
children: _mapInstanceProperty__default["default"](allFields).call(allFields, field => jsxRuntime.jsx("div", {
|
|
802
|
+
"data-testid": "test-field-".concat(field.key),
|
|
803
|
+
children: jsxRuntime.jsx(uiKit.Tag, {
|
|
804
|
+
children: field.label || field.key
|
|
805
|
+
})
|
|
806
|
+
}, field.key))
|
|
904
807
|
});
|
|
905
808
|
}
|
|
906
|
-
|
|
907
809
|
FieldsRenderer.propTypes = {};
|
|
908
810
|
function ExportFields(_ref2) {
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
isNewTheme = _useTheme.isNewTheme;
|
|
913
|
-
|
|
811
|
+
let fields = _ref2.fields;
|
|
812
|
+
const _useTheme = designSystem.useTheme(),
|
|
813
|
+
isNewTheme = _useTheme.isNewTheme;
|
|
914
814
|
if (isNewTheme) return jsxRuntime.jsx(uiKit.CollapsiblePanel, {
|
|
915
815
|
condensed: true,
|
|
916
816
|
isDefaultClosed: !Boolean(fields.length),
|
|
@@ -949,21 +849,15 @@ function ExportFields(_ref2) {
|
|
|
949
849
|
}
|
|
950
850
|
ExportFields.propTypes = {};
|
|
951
851
|
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
var onAppliedFilterRemove = function onAppliedFilterRemove(filter) {
|
|
852
|
+
const ExportSelection = () => {
|
|
853
|
+
const _useTheme = designSystem.useTheme(),
|
|
854
|
+
isNewTheme = _useTheme.isNewTheme;
|
|
855
|
+
const _useExportResourcesCo = useExportResourcesContext(),
|
|
856
|
+
formik = _useExportResourcesCo.formik;
|
|
857
|
+
const onAppliedFilterRemove = filter => {
|
|
960
858
|
var _context;
|
|
961
|
-
|
|
962
|
-
formik.setFieldValue('appliedFilters', _filterInstanceProperty__default["default"](_context = _valuesInstanceProperty__default["default"](formik).appliedFilters).call(_context, function (appliedFilter) {
|
|
963
|
-
return appliedFilter !== filter;
|
|
964
|
-
}));
|
|
859
|
+
formik.setFieldValue('appliedFilters', _filterInstanceProperty__default["default"](_context = _valuesInstanceProperty__default["default"](formik).appliedFilters).call(_context, appliedFilter => appliedFilter !== filter));
|
|
965
860
|
};
|
|
966
|
-
|
|
967
861
|
if (isNewTheme) return jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
968
862
|
scale: "xl",
|
|
969
863
|
children: [jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
@@ -1018,12 +912,10 @@ var ExportSelection = function ExportSelection() {
|
|
|
1018
912
|
};
|
|
1019
913
|
|
|
1020
914
|
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; }
|
|
1021
|
-
|
|
1022
915
|
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; }
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
916
|
+
const ExportProperties = props => {
|
|
917
|
+
const _useTheme = designSystem.useTheme(),
|
|
918
|
+
isNewTheme = _useTheme.isNewTheme;
|
|
1027
919
|
if (typeof props.renderProperties !== 'function') return null;
|
|
1028
920
|
if (isNewTheme) return jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
1029
921
|
scale: "m",
|
|
@@ -1045,16 +937,13 @@ var ExportProperties = function ExportProperties(props) {
|
|
|
1045
937
|
ExportProperties.propTypes = {};
|
|
1046
938
|
|
|
1047
939
|
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; }
|
|
1048
|
-
|
|
1049
940
|
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; }
|
|
1050
941
|
function renderFileNameError(key) {
|
|
1051
942
|
switch (key) {
|
|
1052
943
|
case 'missing':
|
|
1053
944
|
return jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$4({}, messages.missingFileNameError));
|
|
1054
|
-
|
|
1055
945
|
case 'invalidInput':
|
|
1056
946
|
return jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$4({}, messages.invalidFileNameError));
|
|
1057
|
-
|
|
1058
947
|
default:
|
|
1059
948
|
return null;
|
|
1060
949
|
}
|
|
@@ -1063,52 +952,41 @@ function renderLanguageError(key) {
|
|
|
1063
952
|
switch (key) {
|
|
1064
953
|
case 'missing':
|
|
1065
954
|
return jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$4({}, messages.missingLanguageError));
|
|
1066
|
-
|
|
1067
955
|
default:
|
|
1068
956
|
return null;
|
|
1069
957
|
}
|
|
1070
958
|
}
|
|
1071
959
|
|
|
1072
960
|
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; }
|
|
1073
|
-
|
|
1074
961
|
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; }
|
|
1075
|
-
|
|
962
|
+
const outputFormatOptions = [{
|
|
1076
963
|
value: OUTPUT_FORMATS.JSON,
|
|
1077
964
|
label: 'JSON'
|
|
1078
965
|
}, {
|
|
1079
966
|
value: OUTPUT_FORMATS.CSV,
|
|
1080
967
|
label: 'CSV'
|
|
1081
968
|
}];
|
|
1082
|
-
|
|
1083
969
|
function mapLanguagesToOptions(languages) {
|
|
1084
|
-
return _mapInstanceProperty__default["default"](languages).call(languages,
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
};
|
|
1089
|
-
});
|
|
970
|
+
return _mapInstanceProperty__default["default"](languages).call(languages, language => ({
|
|
971
|
+
value: language,
|
|
972
|
+
label: language
|
|
973
|
+
}));
|
|
1090
974
|
}
|
|
1091
|
-
|
|
1092
975
|
function ExportFileSettings(props) {
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
};
|
|
1108
|
-
}),
|
|
1109
|
-
languages = _useApplicationContex.languages,
|
|
1110
|
-
language = _useApplicationContex.language;
|
|
1111
|
-
|
|
976
|
+
const _useTheme = designSystem.useTheme(),
|
|
977
|
+
isNewTheme = _useTheme.isNewTheme;
|
|
978
|
+
const intl = reactIntl.useIntl();
|
|
979
|
+
const _useExportResourcesCo = useExportResourcesContext(),
|
|
980
|
+
formik = _useExportResourcesCo.formik;
|
|
981
|
+
const _useApplicationContex = applicationShellConnectors.useApplicationContext(applicationContext => {
|
|
982
|
+
var _applicationContext$p;
|
|
983
|
+
return {
|
|
984
|
+
language: applicationContext.dataLocale,
|
|
985
|
+
languages: ((_applicationContext$p = applicationContext.project) === null || _applicationContext$p === void 0 ? void 0 : _applicationContext$p.languages) || []
|
|
986
|
+
};
|
|
987
|
+
}),
|
|
988
|
+
languages = _useApplicationContex.languages,
|
|
989
|
+
language = _useApplicationContex.language;
|
|
1112
990
|
if (isNewTheme) return jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
1113
991
|
scale: "xxxl",
|
|
1114
992
|
children: [jsxRuntime.jsx(applicationComponents.PageContentNarrow, {
|
|
@@ -1133,7 +1011,7 @@ function ExportFileSettings(props) {
|
|
|
1133
1011
|
options: mapLanguagesToOptions(languages),
|
|
1134
1012
|
isMulti: true
|
|
1135
1013
|
}, formik.getFieldProps('languages')), {}, {
|
|
1136
|
-
onChange:
|
|
1014
|
+
onChange: e => {
|
|
1137
1015
|
formik.handleChange(e);
|
|
1138
1016
|
formik.setFieldValue('isAllLanguagesChecked', false);
|
|
1139
1017
|
},
|
|
@@ -1143,7 +1021,7 @@ function ExportFileSettings(props) {
|
|
|
1143
1021
|
})), jsxRuntime.jsx(uiKit.CheckboxInput, {
|
|
1144
1022
|
name: "isAllLanguagesChecked",
|
|
1145
1023
|
isChecked: _valuesInstanceProperty__default["default"](formik).isAllLanguagesChecked,
|
|
1146
|
-
onChange:
|
|
1024
|
+
onChange: e => {
|
|
1147
1025
|
if (e.target.checked) formik.setFieldValue('languages', languages);else formik.setFieldValue('languages', [language]);
|
|
1148
1026
|
formik.handleChange(e);
|
|
1149
1027
|
},
|
|
@@ -1189,7 +1067,7 @@ function ExportFileSettings(props) {
|
|
|
1189
1067
|
}), jsxRuntime.jsx(uiKit.CheckboxInput, {
|
|
1190
1068
|
name: "isAllLanguagesChecked",
|
|
1191
1069
|
isChecked: _valuesInstanceProperty__default["default"](formik).isAllLanguagesChecked,
|
|
1192
|
-
onChange:
|
|
1070
|
+
onChange: e => {
|
|
1193
1071
|
if (e.target.checked) formik.setFieldValue('languages', languages);else formik.setFieldValue('languages', [language]);
|
|
1194
1072
|
formik.handleChange(e);
|
|
1195
1073
|
},
|
|
@@ -1202,7 +1080,7 @@ function ExportFileSettings(props) {
|
|
|
1202
1080
|
options: mapLanguagesToOptions(languages),
|
|
1203
1081
|
isMulti: true
|
|
1204
1082
|
}, formik.getFieldProps('languages')), {}, {
|
|
1205
|
-
onChange:
|
|
1083
|
+
onChange: e => {
|
|
1206
1084
|
formik.handleChange(e);
|
|
1207
1085
|
formik.setFieldValue('isAllLanguagesChecked', false);
|
|
1208
1086
|
},
|
|
@@ -1219,89 +1097,61 @@ function ExportFileSettings(props) {
|
|
|
1219
1097
|
ExportFileSettings.displayName = 'ExportFileSettings';
|
|
1220
1098
|
ExportFileSettings.propTypes = {};
|
|
1221
1099
|
|
|
1222
|
-
function createExportOperation(
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
mcApiProxyTarget: constants.MC_API_PROXY_TARGETS.EXPORT,
|
|
1238
|
-
uri: uri,
|
|
1239
|
-
headers: {
|
|
1240
|
-
accept: 'application/json'
|
|
1241
|
-
},
|
|
1242
|
-
payload: {
|
|
1243
|
-
query: graphQuery
|
|
1244
|
-
}
|
|
1245
|
-
}));
|
|
1246
|
-
|
|
1247
|
-
case 4:
|
|
1248
|
-
response = _context.sent;
|
|
1249
|
-
return _context.abrupt("return", response);
|
|
1250
|
-
|
|
1251
|
-
case 6:
|
|
1252
|
-
case "end":
|
|
1253
|
-
return _context.stop();
|
|
1254
|
-
}
|
|
1255
|
-
}, _callee);
|
|
1100
|
+
async function createExportOperation(_ref) {
|
|
1101
|
+
let projectKey = _ref.projectKey,
|
|
1102
|
+
graphQuery = _ref.graphQuery,
|
|
1103
|
+
asyncDispatchFn = _ref.asyncDispatchFn;
|
|
1104
|
+
const uri = "/proxy/export/".concat(projectKey, "/export-operations");
|
|
1105
|
+
const response = await asyncDispatchFn(sdk.actions.post({
|
|
1106
|
+
// FIXME: EXPORT is undefined
|
|
1107
|
+
mcApiProxyTarget: constants.MC_API_PROXY_TARGETS.EXPORT,
|
|
1108
|
+
uri: uri,
|
|
1109
|
+
headers: {
|
|
1110
|
+
accept: 'application/json'
|
|
1111
|
+
},
|
|
1112
|
+
payload: {
|
|
1113
|
+
query: graphQuery
|
|
1114
|
+
}
|
|
1256
1115
|
}));
|
|
1257
|
-
return
|
|
1116
|
+
return response;
|
|
1258
1117
|
}
|
|
1259
1118
|
|
|
1260
1119
|
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; }
|
|
1261
|
-
|
|
1262
|
-
function _objectSpread$2(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$2(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$2(Object(source))).call(_context3, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
1120
|
+
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; }
|
|
1263
1121
|
function ExportConfirmationModal(props) {
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
}
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
var intl = reactIntl.useIntl();
|
|
1284
|
-
var asyncDispatch = sdk.useAsyncDispatch();
|
|
1285
|
-
var resourceTypePlural = resourceTypeToPlural({
|
|
1122
|
+
const _useApplicationContex = applicationShellConnectors.useApplicationContext(applicationContext => {
|
|
1123
|
+
var _applicationContext$p, _applicationContext$p2;
|
|
1124
|
+
return {
|
|
1125
|
+
projectName: (_applicationContext$p = applicationContext.project) === null || _applicationContext$p === void 0 ? void 0 : _applicationContext$p.name,
|
|
1126
|
+
projectKey: (_applicationContext$p2 = applicationContext.project) === null || _applicationContext$p2 === void 0 ? void 0 : _applicationContext$p2.key
|
|
1127
|
+
};
|
|
1128
|
+
}),
|
|
1129
|
+
projectName = _useApplicationContex.projectName,
|
|
1130
|
+
projectKey = _useApplicationContex.projectKey;
|
|
1131
|
+
const _useExportResourcesCo = useExportResourcesContext(),
|
|
1132
|
+
formik = _useExportResourcesCo.formik,
|
|
1133
|
+
allResourcesCount = _useExportResourcesCo.allResourcesCount,
|
|
1134
|
+
matchingResourcesCount = _useExportResourcesCo.matchingResourcesCount,
|
|
1135
|
+
selectedResourceIds = _useExportResourcesCo.selectedResourceIds,
|
|
1136
|
+
resourceType = _useExportResourcesCo.resourceType,
|
|
1137
|
+
setExportOperationStarted = _useExportResourcesCo.setExportOperationStarted;
|
|
1138
|
+
const intl = reactIntl.useIntl();
|
|
1139
|
+
const asyncDispatch = sdk.useAsyncDispatch();
|
|
1140
|
+
const resourceTypePlural = resourceTypeToPlural({
|
|
1286
1141
|
resourceType: props.resourceType
|
|
1287
1142
|
});
|
|
1288
|
-
|
|
1289
|
-
var countInConfirmationMessage = function countInConfirmationMessage() {
|
|
1143
|
+
const countInConfirmationMessage = () => {
|
|
1290
1144
|
switch (_valuesInstanceProperty__default["default"](formik).exportSelectionType) {
|
|
1291
1145
|
case EXPORT_SELECTION_TYPES.ALL_RESOURCES:
|
|
1292
1146
|
return allResourcesCount;
|
|
1293
|
-
|
|
1294
1147
|
case EXPORT_SELECTION_TYPES.ONLY_MATCHING:
|
|
1295
1148
|
return matchingResourcesCount;
|
|
1296
|
-
|
|
1297
1149
|
case EXPORT_SELECTION_TYPES.ONLY_SELECTED:
|
|
1298
1150
|
return selectedResourceIds.length;
|
|
1299
|
-
|
|
1300
1151
|
default:
|
|
1301
1152
|
throw new UnexpectedSelectionTypeError(_valuesInstanceProperty__default["default"](formik).exportSelectionType);
|
|
1302
1153
|
}
|
|
1303
1154
|
};
|
|
1304
|
-
|
|
1305
1155
|
return jsxRuntime.jsx(applicationComponents.ConfirmationDialog, {
|
|
1306
1156
|
dataAttributesPrimaryButton: {
|
|
1307
1157
|
'data-testid': 'confirm-export-button'
|
|
@@ -1315,58 +1165,36 @@ function ExportConfirmationModal(props) {
|
|
|
1315
1165
|
isOpen: props.isOpen,
|
|
1316
1166
|
onClose: props.closeModal,
|
|
1317
1167
|
onCancel: props.closeModal,
|
|
1318
|
-
onConfirm:
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
asyncDispatchFn: asyncDispatch
|
|
1338
|
-
});
|
|
1339
|
-
|
|
1340
|
-
case 6:
|
|
1341
|
-
response = _context.sent;
|
|
1342
|
-
_context.t0 = response.state;
|
|
1343
|
-
_context.next = _context.t0 === EXPORT_OPERATION_STATES.PROCESSING ? 10 : _context.t0 === EXPORT_OPERATION_STATES.COMPLETED ? 10 : 12;
|
|
1344
|
-
break;
|
|
1345
|
-
|
|
1346
|
-
case 10:
|
|
1168
|
+
onConfirm: async () => {
|
|
1169
|
+
setExportOperationStarted(false);
|
|
1170
|
+
const graphQuery = buildGraphQuery({
|
|
1171
|
+
resourceType: resourceType,
|
|
1172
|
+
selectedResourceIds: selectedResourceIds,
|
|
1173
|
+
fields: _valuesInstanceProperty__default["default"](formik).fields,
|
|
1174
|
+
exportSelectionType: _valuesInstanceProperty__default["default"](formik).exportSelectionType,
|
|
1175
|
+
languages: _valuesInstanceProperty__default["default"](formik).languages
|
|
1176
|
+
});
|
|
1177
|
+
props.closeModal();
|
|
1178
|
+
try {
|
|
1179
|
+
const response = await createExportOperation({
|
|
1180
|
+
projectKey,
|
|
1181
|
+
graphQuery,
|
|
1182
|
+
asyncDispatchFn: asyncDispatch
|
|
1183
|
+
});
|
|
1184
|
+
switch (response.state) {
|
|
1185
|
+
case EXPORT_OPERATION_STATES.PROCESSING:
|
|
1186
|
+
case EXPORT_OPERATION_STATES.COMPLETED:
|
|
1347
1187
|
setExportOperationStarted(true);
|
|
1348
|
-
return _context.abrupt("break", 13);
|
|
1349
|
-
|
|
1350
|
-
case 12:
|
|
1351
|
-
throw new UnexpectedExportOperationStateError(response.state);
|
|
1352
|
-
|
|
1353
|
-
case 13:
|
|
1354
|
-
_context.next = 18;
|
|
1355
1188
|
break;
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
_context.prev = 15;
|
|
1359
|
-
_context.t1 = _context["catch"](3);
|
|
1360
|
-
actionsGlobal.showApiErrorNotification({
|
|
1361
|
-
errors: _context.t1
|
|
1362
|
-
});
|
|
1363
|
-
|
|
1364
|
-
case 18:
|
|
1365
|
-
case "end":
|
|
1366
|
-
return _context.stop();
|
|
1189
|
+
default:
|
|
1190
|
+
throw new UnexpectedExportOperationStateError(response.state);
|
|
1367
1191
|
}
|
|
1368
|
-
}
|
|
1369
|
-
|
|
1192
|
+
} catch (errors) {
|
|
1193
|
+
actionsGlobal.showApiErrorNotification({
|
|
1194
|
+
errors
|
|
1195
|
+
});
|
|
1196
|
+
}
|
|
1197
|
+
},
|
|
1370
1198
|
children: jsxRuntime.jsxs("div", {
|
|
1371
1199
|
children: [jsxRuntime.jsx(uiKit.Text.Body, {
|
|
1372
1200
|
intlMessage: _objectSpread$2(_objectSpread$2({}, messages.confirmationBodyPlan), {}, {
|
|
@@ -1386,28 +1214,20 @@ function ExportConfirmationModal(props) {
|
|
|
1386
1214
|
ExportConfirmationModal.propTypes = {};
|
|
1387
1215
|
|
|
1388
1216
|
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; }
|
|
1389
|
-
|
|
1390
1217
|
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__default["default"](_context = ownKeys$1(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$1(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
children: msg
|
|
1396
|
-
});
|
|
1397
|
-
};
|
|
1398
|
-
|
|
1218
|
+
const getExportLogsLink = (projectKey, msg) => jsxRuntime.jsx(uiKit.Link, {
|
|
1219
|
+
to: "/".concat(projectKey, "/operations/export/logs"),
|
|
1220
|
+
children: msg
|
|
1221
|
+
});
|
|
1399
1222
|
function ExportOperationSuccessMessage(_ref) {
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
}),
|
|
1409
|
-
projectKey = _useApplicationContex.projectKey;
|
|
1410
|
-
|
|
1223
|
+
let isShown = _ref.isShown;
|
|
1224
|
+
const _useApplicationContex = applicationShellConnectors.useApplicationContext(applicationContext => {
|
|
1225
|
+
var _applicationContext$p;
|
|
1226
|
+
return {
|
|
1227
|
+
projectKey: (_applicationContext$p = applicationContext.project) === null || _applicationContext$p === void 0 ? void 0 : _applicationContext$p.key
|
|
1228
|
+
};
|
|
1229
|
+
}),
|
|
1230
|
+
projectKey = _useApplicationContex.projectKey;
|
|
1411
1231
|
if (!isShown) return null;
|
|
1412
1232
|
return jsxRuntime.jsx("div", {
|
|
1413
1233
|
css: styles.successMessage,
|
|
@@ -1418,9 +1238,7 @@ function ExportOperationSuccessMessage(_ref) {
|
|
|
1418
1238
|
type: "success",
|
|
1419
1239
|
intlMessage: _objectSpread$1(_objectSpread$1({}, messages.exportOperationSuccessMessage), {}, {
|
|
1420
1240
|
values: {
|
|
1421
|
-
logsLink:
|
|
1422
|
-
return getExportLogsLink(projectKey, msg);
|
|
1423
|
-
}
|
|
1241
|
+
logsLink: msg => getExportLogsLink(projectKey, msg)
|
|
1424
1242
|
}
|
|
1425
1243
|
})
|
|
1426
1244
|
})
|
|
@@ -1429,26 +1247,22 @@ function ExportOperationSuccessMessage(_ref) {
|
|
|
1429
1247
|
}
|
|
1430
1248
|
ExportOperationSuccessMessage.propTypes = {};
|
|
1431
1249
|
|
|
1432
|
-
|
|
1433
|
-
|
|
1250
|
+
const _excluded = ["renderProperties"];
|
|
1434
1251
|
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; }
|
|
1435
|
-
|
|
1436
1252
|
function _objectSpread(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(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(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
var confirmationModal = applicationComponents.useModalState();
|
|
1444
|
-
var resourceTypePlural = resourceTypeToPlural({
|
|
1253
|
+
const ExportResourcesModal = _ref => {
|
|
1254
|
+
let renderProperties = _ref.renderProperties,
|
|
1255
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
1256
|
+
const intl = reactIntl.useIntl();
|
|
1257
|
+
const confirmationModal = applicationComponents.useModalState();
|
|
1258
|
+
const resourceTypePlural = resourceTypeToPlural({
|
|
1445
1259
|
resourceType: props.resourceType
|
|
1446
1260
|
});
|
|
1447
1261
|
return jsxRuntime.jsx(ExportResourcesContextProvider, _objectSpread(_objectSpread({}, props), {}, {
|
|
1448
1262
|
children: jsxRuntime.jsx(ExportResourcesContext.Consumer, {
|
|
1449
|
-
children:
|
|
1450
|
-
|
|
1451
|
-
|
|
1263
|
+
children: _ref2 => {
|
|
1264
|
+
let formik = _ref2.formik,
|
|
1265
|
+
exportOperationStarted = _ref2.exportOperationStarted;
|
|
1452
1266
|
return jsxRuntime.jsxs(applicationComponents.FormModalPage, {
|
|
1453
1267
|
title: intl.formatMessage(messages.modalTitle, {
|
|
1454
1268
|
resourceType: resourceTypePlural
|
|
@@ -1479,7 +1293,6 @@ var ExportResourcesModal = function ExportResourcesModal(_ref) {
|
|
|
1479
1293
|
})
|
|
1480
1294
|
}));
|
|
1481
1295
|
};
|
|
1482
|
-
|
|
1483
1296
|
ExportResourcesModal.displayName = 'ExportResourcesModal';
|
|
1484
1297
|
ExportResourcesModal.propTypes = {};
|
|
1485
1298
|
ExportResourcesModal.defaultProps = {
|