@commercetools-frontend-extensions/export-resources-modal 2.0.0 → 3.0.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 +89 -59
- package/dist/commercetools-frontend-extensions-export-resources-modal.cjs.dev.js +779 -984
- package/dist/commercetools-frontend-extensions-export-resources-modal.cjs.prod.js +748 -948
- package/dist/commercetools-frontend-extensions-export-resources-modal.esm.js +1015 -0
- package/package.json +49 -32
|
@@ -11,7 +11,7 @@ var _Object$getOwnPropertyDescriptors = require('@babel/runtime-corejs3/core-js-
|
|
|
11
11
|
var _Object$defineProperties = require('@babel/runtime-corejs3/core-js-stable/object/define-properties');
|
|
12
12
|
var _Object$defineProperty = require('@babel/runtime-corejs3/core-js-stable/object/define-property');
|
|
13
13
|
var _defineProperty = require('@babel/runtime-corejs3/helpers/defineProperty');
|
|
14
|
-
var
|
|
14
|
+
var React = require('react');
|
|
15
15
|
var reactIntl = require('react-intl');
|
|
16
16
|
var applicationComponents = require('@commercetools-frontend/application-components');
|
|
17
17
|
var _mapInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/map');
|
|
@@ -25,24 +25,28 @@ var _inherits = require('@babel/runtime-corejs3/helpers/inherits');
|
|
|
25
25
|
var _possibleConstructorReturn = require('@babel/runtime-corejs3/helpers/possibleConstructorReturn');
|
|
26
26
|
var _getPrototypeOf = require('@babel/runtime-corejs3/helpers/getPrototypeOf');
|
|
27
27
|
var _wrapNativeSuper = require('@babel/runtime-corejs3/helpers/wrapNativeSuper');
|
|
28
|
-
var
|
|
29
|
-
var
|
|
30
|
-
var
|
|
31
|
-
var
|
|
32
|
-
var applicationShellConnectors = require('@commercetools-frontend/application-shell-connectors');
|
|
33
|
-
var react = require('react');
|
|
28
|
+
var _objectWithoutProperties = require('@babel/runtime-corejs3/helpers/objectWithoutProperties');
|
|
29
|
+
var _Array$isArray = require('@babel/runtime-corejs3/core-js-stable/array/is-array');
|
|
30
|
+
var _findInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/find');
|
|
31
|
+
var _Object$assign = require('@babel/runtime-corejs3/core-js-stable/object/assign');
|
|
34
32
|
var uiKit = require('@commercetools-frontend/ui-kit');
|
|
35
|
-
var omitEmpty = require('omit-empty-es');
|
|
36
33
|
var jsxRuntime = require('@emotion/react/jsx-runtime');
|
|
37
34
|
var _valuesInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/values');
|
|
38
|
-
var
|
|
39
|
-
var
|
|
40
|
-
var
|
|
41
|
-
|
|
42
|
-
var
|
|
35
|
+
var omitEmpty = require('omit-empty-es');
|
|
36
|
+
var _findIndexInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/find-index');
|
|
37
|
+
var _spliceInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/splice');
|
|
38
|
+
require('@commercetools-uikit/design-system');
|
|
39
|
+
var applicationShellConnectors = require('@commercetools-frontend/application-shell-connectors');
|
|
40
|
+
var moment = require('moment');
|
|
43
41
|
var sdk = require('@commercetools-frontend/sdk');
|
|
44
42
|
var actionsGlobal = require('@commercetools-frontend/actions-global');
|
|
45
43
|
var constants = require('@commercetools-frontend/constants');
|
|
44
|
+
var _styled = require('@emotion/styled/base');
|
|
45
|
+
var _everyInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/every');
|
|
46
|
+
var _someInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/some');
|
|
47
|
+
var PropTypes = require('prop-types');
|
|
48
|
+
var _slicedToArray = require('@babel/runtime-corejs3/helpers/slicedToArray');
|
|
49
|
+
var formik = require('formik');
|
|
46
50
|
|
|
47
51
|
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
48
52
|
|
|
@@ -54,197 +58,358 @@ var _forEachInstanceProperty__default = /*#__PURE__*/_interopDefault(_forEachIns
|
|
|
54
58
|
var _Object$getOwnPropertyDescriptors__default = /*#__PURE__*/_interopDefault(_Object$getOwnPropertyDescriptors);
|
|
55
59
|
var _Object$defineProperties__default = /*#__PURE__*/_interopDefault(_Object$defineProperties);
|
|
56
60
|
var _Object$defineProperty__default = /*#__PURE__*/_interopDefault(_Object$defineProperty);
|
|
61
|
+
var React__default = /*#__PURE__*/_interopDefault(React);
|
|
57
62
|
var _mapInstanceProperty__default = /*#__PURE__*/_interopDefault(_mapInstanceProperty);
|
|
58
63
|
var _flatInstanceProperty__default = /*#__PURE__*/_interopDefault(_flatInstanceProperty);
|
|
59
64
|
var _concatInstanceProperty__default = /*#__PURE__*/_interopDefault(_concatInstanceProperty);
|
|
60
65
|
var _Reflect$construct__default = /*#__PURE__*/_interopDefault(_Reflect$construct);
|
|
61
|
-
var
|
|
62
|
-
var
|
|
63
|
-
var
|
|
66
|
+
var _Array$isArray__default = /*#__PURE__*/_interopDefault(_Array$isArray);
|
|
67
|
+
var _findInstanceProperty__default = /*#__PURE__*/_interopDefault(_findInstanceProperty);
|
|
68
|
+
var _Object$assign__default = /*#__PURE__*/_interopDefault(_Object$assign);
|
|
64
69
|
var _valuesInstanceProperty__default = /*#__PURE__*/_interopDefault(_valuesInstanceProperty);
|
|
70
|
+
var omitEmpty__default = /*#__PURE__*/_interopDefault(omitEmpty);
|
|
71
|
+
var _findIndexInstanceProperty__default = /*#__PURE__*/_interopDefault(_findIndexInstanceProperty);
|
|
72
|
+
var _spliceInstanceProperty__default = /*#__PURE__*/_interopDefault(_spliceInstanceProperty);
|
|
73
|
+
var moment__default = /*#__PURE__*/_interopDefault(moment);
|
|
65
74
|
var _styled__default = /*#__PURE__*/_interopDefault(_styled);
|
|
66
|
-
var
|
|
75
|
+
var _everyInstanceProperty__default = /*#__PURE__*/_interopDefault(_everyInstanceProperty);
|
|
76
|
+
var _someInstanceProperty__default = /*#__PURE__*/_interopDefault(_someInstanceProperty);
|
|
77
|
+
var PropTypes__default = /*#__PURE__*/_interopDefault(PropTypes);
|
|
67
78
|
|
|
68
|
-
|
|
69
|
-
CATEGORY: 'category',
|
|
70
|
-
PRODUCT: 'product'
|
|
71
|
-
};
|
|
72
|
-
var EXPORT_SELECTION_TYPES = {
|
|
73
|
-
ALL_RESOURCES: 'allResources',
|
|
74
|
-
ONLY_MATCHING: 'onlyMatching',
|
|
75
|
-
ONLY_SELECTED: 'onlySelected'
|
|
76
|
-
};
|
|
77
|
-
var OUTPUT_FORMATS = {
|
|
78
|
-
JSON: 'json',
|
|
79
|
-
CSV: 'csv'
|
|
80
|
-
};
|
|
81
|
-
var EXPORT_OPERATION_STATES = {
|
|
79
|
+
const EXPORT_OPERATION_STATES = {
|
|
82
80
|
PROCESSING: 'processing',
|
|
83
81
|
COMPLETED: 'completed',
|
|
84
82
|
FAILED: 'failed'
|
|
85
83
|
};
|
|
86
84
|
|
|
87
|
-
|
|
85
|
+
const EXPORT_TYPES = {
|
|
86
|
+
ALL: 'all',
|
|
87
|
+
FILTERED: 'filtered',
|
|
88
|
+
SELECTED: 'selected'
|
|
89
|
+
};
|
|
88
90
|
|
|
89
|
-
|
|
91
|
+
const EXPORTABLE_RESOURCES = {
|
|
92
|
+
CATEGORY: 'category',
|
|
93
|
+
PRODUCT: 'product',
|
|
94
|
+
DISCOUNT_CODE: 'discountCode'
|
|
95
|
+
};
|
|
90
96
|
|
|
91
|
-
|
|
92
|
-
|
|
97
|
+
const OUTPUT_FORMATS = {
|
|
98
|
+
JSON: 'json',
|
|
99
|
+
CSV: 'csv'
|
|
100
|
+
};
|
|
101
|
+
const OUTPUT_FORMAT_OPTIONS = [{
|
|
102
|
+
value: OUTPUT_FORMATS.CSV,
|
|
103
|
+
label: 'CSV'
|
|
104
|
+
}, {
|
|
105
|
+
value: OUTPUT_FORMATS.JSON,
|
|
106
|
+
label: 'JSON'
|
|
107
|
+
}];
|
|
93
108
|
|
|
94
|
-
|
|
109
|
+
const COLUMN_DEFINITIONS_URLS = {
|
|
110
|
+
category: 'https://docs-proxy-sarm-product-import-csv.commercetools.vercel.app/merchant-center/import-categories#supported-headers-and-values'
|
|
111
|
+
};
|
|
95
112
|
|
|
96
|
-
|
|
113
|
+
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); }; }
|
|
114
|
+
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; } }
|
|
115
|
+
let UnexpectedExportTypeError = /*#__PURE__*/function (_Error) {
|
|
116
|
+
_inherits(UnexpectedExportTypeError, _Error);
|
|
117
|
+
var _super = _createSuper$3(UnexpectedExportTypeError);
|
|
118
|
+
function UnexpectedExportTypeError(exportType) {
|
|
97
119
|
var _this;
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
_this = _super.call(this, "Unexpected column: ".concat(exportSelectionType));
|
|
102
|
-
_this.name = 'UnexpectedSelectionTypeError';
|
|
120
|
+
_classCallCheck(this, UnexpectedExportTypeError);
|
|
121
|
+
_this = _super.call(this, "Unexpected export type: ".concat(exportType));
|
|
122
|
+
_this.name = 'UnexpectedExportTypeError';
|
|
103
123
|
return _this;
|
|
104
124
|
}
|
|
105
|
-
|
|
106
|
-
return _createClass(UnexpectedSelectionTypeError);
|
|
125
|
+
return _createClass(UnexpectedExportTypeError);
|
|
107
126
|
}( /*#__PURE__*/_wrapNativeSuper(Error));
|
|
108
127
|
|
|
109
|
-
function _createSuper$
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
var MissingExportResourceProviderError = /*#__PURE__*/function (_Error) {
|
|
128
|
+
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); }; }
|
|
129
|
+
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; } }
|
|
130
|
+
let MissingExportResourceProviderError = /*#__PURE__*/function (_Error) {
|
|
114
131
|
_inherits(MissingExportResourceProviderError, _Error);
|
|
115
|
-
|
|
116
|
-
var _super = _createSuper$1(MissingExportResourceProviderError);
|
|
117
|
-
|
|
132
|
+
var _super = _createSuper$2(MissingExportResourceProviderError);
|
|
118
133
|
function MissingExportResourceProviderError() {
|
|
119
134
|
var _this;
|
|
120
|
-
|
|
121
135
|
_classCallCheck(this, MissingExportResourceProviderError);
|
|
122
|
-
|
|
123
|
-
_this = _super.call(this, 'useExportResourcesContext must be used within ExportResourcesContextProvider');
|
|
136
|
+
_this = _super.call(this, 'useExportResourcesContext must be used within ExportResourcesProvider');
|
|
124
137
|
_this.name = 'MissingExportResourceProviderError';
|
|
125
138
|
return _this;
|
|
126
139
|
}
|
|
127
|
-
|
|
128
140
|
return _createClass(MissingExportResourceProviderError);
|
|
129
141
|
}( /*#__PURE__*/_wrapNativeSuper(Error));
|
|
130
142
|
|
|
131
|
-
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); }; }
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
var UnexpectedExportOperationStateError = /*#__PURE__*/function (_Error) {
|
|
143
|
+
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); }; }
|
|
144
|
+
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; } }
|
|
145
|
+
let UnexpectedExportOperationStateError = /*#__PURE__*/function (_Error) {
|
|
136
146
|
_inherits(UnexpectedExportOperationStateError, _Error);
|
|
137
|
-
|
|
138
|
-
var _super = _createSuper(UnexpectedExportOperationStateError);
|
|
139
|
-
|
|
147
|
+
var _super = _createSuper$1(UnexpectedExportOperationStateError);
|
|
140
148
|
function UnexpectedExportOperationStateError(state) {
|
|
141
149
|
var _this;
|
|
142
|
-
|
|
143
150
|
_classCallCheck(this, UnexpectedExportOperationStateError);
|
|
144
|
-
|
|
145
151
|
_this = _super.call(this, "Unexpected export operation state \"".concat(state, "\""));
|
|
146
152
|
_this.name = 'UnexpectedExportOperationStateError';
|
|
147
153
|
return _this;
|
|
148
154
|
}
|
|
149
|
-
|
|
150
155
|
return _createClass(UnexpectedExportOperationStateError);
|
|
151
156
|
}( /*#__PURE__*/_wrapNativeSuper(Error));
|
|
152
157
|
|
|
153
|
-
function
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
158
|
+
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); }; }
|
|
159
|
+
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; } }
|
|
160
|
+
let UnexpectedResourceTypeError = /*#__PURE__*/function (_Error) {
|
|
161
|
+
_inherits(UnexpectedResourceTypeError, _Error);
|
|
162
|
+
var _super = _createSuper(UnexpectedResourceTypeError);
|
|
163
|
+
function UnexpectedResourceTypeError(resourceType) {
|
|
164
|
+
var _this;
|
|
165
|
+
_classCallCheck(this, UnexpectedResourceTypeError);
|
|
166
|
+
_this = _super.call(this, "Unexpected resource type: ".concat(resourceType));
|
|
167
|
+
_this.name = 'UnexpectedResourceTypeError';
|
|
168
|
+
return _this;
|
|
169
|
+
}
|
|
170
|
+
return _createClass(UnexpectedResourceTypeError);
|
|
171
|
+
}( /*#__PURE__*/_wrapNativeSuper(Error));
|
|
157
172
|
|
|
173
|
+
const _excluded$1 = ["name"];
|
|
174
|
+
function ownKeys$6(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
175
|
+
function _objectSpread$6(e) { for (var r = 1; r < arguments.length; r++) { var _context4, _context5; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context4 = ownKeys$6(Object(t), !0)).call(_context4, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context5 = ownKeys$6(Object(t))).call(_context5, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
176
|
+
function resourceTypeToPlural(_ref) {
|
|
177
|
+
let resourceType = _ref.resourceType,
|
|
178
|
+
_ref$isUpperCase = _ref.isUpperCase,
|
|
179
|
+
isUpperCase = _ref$isUpperCase === void 0 ? false : _ref$isUpperCase;
|
|
158
180
|
switch (resourceType) {
|
|
159
181
|
case EXPORTABLE_RESOURCES.CATEGORY:
|
|
160
182
|
return isUpperCase ? 'Categories' : 'categories';
|
|
161
|
-
|
|
162
183
|
case EXPORTABLE_RESOURCES.PRODUCT:
|
|
163
184
|
return isUpperCase ? 'Products' : 'products';
|
|
164
|
-
|
|
185
|
+
case EXPORTABLE_RESOURCES.DISCOUNT_CODE:
|
|
186
|
+
return isUpperCase ? 'Discount codes' : 'discount codes';
|
|
187
|
+
default:
|
|
188
|
+
throw UnexpectedResourceTypeError(resourceType);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
function resourceTypeToOperationName(resourceType) {
|
|
192
|
+
switch (resourceType) {
|
|
193
|
+
case EXPORTABLE_RESOURCES.CATEGORY:
|
|
194
|
+
return 'categories';
|
|
195
|
+
case EXPORTABLE_RESOURCES.PRODUCT:
|
|
196
|
+
return 'products';
|
|
197
|
+
case EXPORTABLE_RESOURCES.DISCOUNT_CODE:
|
|
198
|
+
return 'discountCodes';
|
|
165
199
|
default:
|
|
166
|
-
|
|
167
|
-
console.warn("Unexpected resource type: \"".concat(resourceType, "\""));
|
|
168
|
-
return resourceType;
|
|
200
|
+
throw UnexpectedResourceTypeError(resourceType);
|
|
169
201
|
}
|
|
170
202
|
}
|
|
203
|
+
function mapLocalesToOptions(locales) {
|
|
204
|
+
return _mapInstanceProperty__default["default"](locales).call(locales, locale => ({
|
|
205
|
+
value: locale,
|
|
206
|
+
label: locale
|
|
207
|
+
}));
|
|
208
|
+
}
|
|
171
209
|
function replaceSpecialCharsWithUnderscore(string) {
|
|
172
210
|
return string.replace(/[^a-zA-Z0-9]/g, '_');
|
|
173
211
|
}
|
|
174
|
-
|
|
175
|
-
|
|
212
|
+
function isFilledArray(maybeArray) {
|
|
213
|
+
return _Array$isArray__default["default"](maybeArray) && maybeArray.length;
|
|
214
|
+
}
|
|
215
|
+
function appendCsvOrJsonExtensionIfAbsent(fileName, fileFormat) {
|
|
176
216
|
var _context;
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
217
|
+
const extensionRegex = /\.(csv|json)$/i;
|
|
218
|
+
if (!extensionRegex.test(fileName)) return _concatInstanceProperty__default["default"](_context = "".concat(fileName, ".")).call(_context, fileFormat);
|
|
219
|
+
return fileName;
|
|
220
|
+
}
|
|
221
|
+
function flattenNestedFields(fields) {
|
|
222
|
+
const result = (fields === null || fields === void 0 ? void 0 : _mapInstanceProperty__default["default"](fields).call(fields, field => {
|
|
223
|
+
if (isFilledArray(field.fields)) {
|
|
224
|
+
var _context2;
|
|
225
|
+
return _mapInstanceProperty__default["default"](_context2 = flattenNestedFields(field.fields)).call(_context2, nestedField => {
|
|
226
|
+
var _context3;
|
|
227
|
+
return _objectSpread$6(_objectSpread$6({}, nestedField), {}, {
|
|
228
|
+
name: _concatInstanceProperty__default["default"](_context3 = "".concat(field.name, ".")).call(_context3, nestedField.name)
|
|
229
|
+
});
|
|
230
|
+
});
|
|
231
|
+
}
|
|
232
|
+
return field;
|
|
233
|
+
})) || [];
|
|
234
|
+
return _flatInstanceProperty__default["default"](result).call(result);
|
|
235
|
+
}
|
|
236
|
+
function unflattenNestedFields(flattenedFields) {
|
|
237
|
+
const reconstructed = [];
|
|
238
|
+
_forEachInstanceProperty__default["default"](flattenedFields).call(flattenedFields, field => {
|
|
239
|
+
const fieldNames = field.name.split('.');
|
|
240
|
+
let currentLevel = reconstructed;
|
|
241
|
+
_forEachInstanceProperty__default["default"](fieldNames).call(fieldNames, (name, index) => {
|
|
242
|
+
let existingField = _findInstanceProperty__default["default"](currentLevel).call(currentLevel, f => f.name === name);
|
|
243
|
+
if (!existingField) {
|
|
244
|
+
existingField = {
|
|
245
|
+
name,
|
|
246
|
+
fields: []
|
|
247
|
+
};
|
|
248
|
+
currentLevel.push(existingField);
|
|
249
|
+
}
|
|
250
|
+
if (index === fieldNames.length - 1) {
|
|
251
|
+
field.name;
|
|
252
|
+
const otherProps = _objectWithoutProperties(field, _excluded$1);
|
|
253
|
+
_Object$assign__default["default"](existingField, otherProps);
|
|
254
|
+
} else {
|
|
255
|
+
currentLevel = existingField.fields;
|
|
256
|
+
}
|
|
257
|
+
});
|
|
180
258
|
});
|
|
259
|
+
return reconstructed;
|
|
260
|
+
}
|
|
261
|
+
function getSelectedFields(fields) {
|
|
262
|
+
return _filterInstanceProperty__default["default"](fields).call(fields, field => field.isChecked);
|
|
263
|
+
}
|
|
264
|
+
function getFieldNames(fields) {
|
|
265
|
+
return _mapInstanceProperty__default["default"](fields).call(fields, field => field.name);
|
|
266
|
+
}
|
|
267
|
+
function checkRequiredFields(fields) {
|
|
268
|
+
return _mapInstanceProperty__default["default"](fields).call(fields, field => field.isRequired ? _objectSpread$6(_objectSpread$6({}, field), {}, {
|
|
269
|
+
isChecked: true
|
|
270
|
+
}) : field);
|
|
271
|
+
}
|
|
272
|
+
const getExportLogsLink = (projectKey, msg) => jsxRuntime.jsx(uiKit.Link, {
|
|
273
|
+
to: "/".concat(projectKey, "/operations/export/logs"),
|
|
274
|
+
children: msg
|
|
275
|
+
});
|
|
181
276
|
|
|
182
|
-
|
|
183
|
-
|
|
277
|
+
/*
|
|
278
|
+
* This function is responsible for constructing the GraphQL query based on the export settings
|
|
279
|
+
*
|
|
280
|
+
* Depending on the type of export selection (all, selected, or filtered) it constructs different types of queries:
|
|
281
|
+
* - For 'all', it generates a query that fetches all fields and locales specified in the export settings.
|
|
282
|
+
* - For 'selected', it creates a query that fetches only the fields and locales of the selected resources. The ids of the selected resources are included in the query.
|
|
283
|
+
* - The 'filtered' case is a placeholder for future development where a query will be constructed based on certain filtering criteria using the `where` parameter.
|
|
284
|
+
*/
|
|
285
|
+
function buildGraphQuery(exportSettings) {
|
|
286
|
+
var _context;
|
|
287
|
+
const operation = resourceTypeToOperationName(exportSettings.resourceType);
|
|
288
|
+
switch (exportSettings.exportType) {
|
|
289
|
+
case EXPORT_TYPES.ALL:
|
|
184
290
|
return gqlQueryBuilder.query({
|
|
185
|
-
operation
|
|
291
|
+
operation,
|
|
186
292
|
fields: [{
|
|
187
|
-
results:
|
|
293
|
+
results: buildFields({
|
|
294
|
+
fields: exportSettings.fields,
|
|
295
|
+
locales: exportSettings.locales
|
|
296
|
+
})
|
|
188
297
|
}],
|
|
189
298
|
variables: {}
|
|
190
299
|
});
|
|
191
|
-
|
|
192
|
-
case EXPORT_SELECTION_TYPES.ONLY_SELECTED:
|
|
300
|
+
case EXPORT_TYPES.SELECTED:
|
|
193
301
|
return gqlQueryBuilder.query({
|
|
194
|
-
operation
|
|
302
|
+
operation,
|
|
195
303
|
fields: [{
|
|
196
|
-
results:
|
|
304
|
+
results: buildFields({
|
|
305
|
+
fields: exportSettings.fields,
|
|
306
|
+
locales: exportSettings.locales
|
|
307
|
+
})
|
|
197
308
|
}],
|
|
198
309
|
variables: {
|
|
199
|
-
where: "id in (".concat(_mapInstanceProperty__default["default"](_context = exportSettings.selectedResourceIds).call(_context,
|
|
200
|
-
return "\\\"".concat(id, "\\\"");
|
|
201
|
-
}).join(', '), ")")
|
|
310
|
+
where: "id in (".concat(_mapInstanceProperty__default["default"](_context = exportSettings.selectedResourceIds).call(_context, id => "\"".concat(id, "\"")).join(', '), ")")
|
|
202
311
|
}
|
|
203
312
|
});
|
|
204
|
-
|
|
205
|
-
case EXPORT_SELECTION_TYPES.ONLY_MATCHING:
|
|
313
|
+
case EXPORT_TYPES.FILTERED:
|
|
206
314
|
// TODO: gql query for exporting filtered resources.
|
|
207
|
-
throw new
|
|
208
|
-
|
|
315
|
+
throw new UnexpectedExportTypeError(exportSettings.exportType);
|
|
209
316
|
default:
|
|
210
|
-
throw new
|
|
317
|
+
throw new UnexpectedExportTypeError(exportSettings.exportType);
|
|
211
318
|
}
|
|
212
319
|
}
|
|
213
320
|
|
|
214
|
-
|
|
321
|
+
/*
|
|
322
|
+
* This function builds the necessary field structure for our GraphQL queries, tt is specifically designed to handle different types of fields
|
|
323
|
+
*
|
|
324
|
+
* For fields whose values change depending on the locale aka localised fields, a unique request format is used
|
|
325
|
+
* This format combines the field and the locale, separated by '______'. This approach is adopted as our system disallows the use of hyphens `-` in these situations
|
|
326
|
+
*
|
|
327
|
+
* Fields that don't vary by locale but contain additional subfields (known as 'nested fields') are also addressed
|
|
328
|
+
* In these cases the function is used recursively on these subfields to generate the appropriate request.
|
|
329
|
+
*
|
|
330
|
+
* Overall, this function enables us to accurately request different types of data, including those varying by locale or containing subfields.
|
|
331
|
+
*
|
|
332
|
+
* More details can be found in the related PR: https://github.com/commercetools/commercetools-exporter/pull/103
|
|
333
|
+
*/
|
|
334
|
+
|
|
335
|
+
function buildFields(_ref) {
|
|
215
336
|
var _context2;
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
337
|
+
let fields = _ref.fields,
|
|
338
|
+
locales = _ref.locales;
|
|
339
|
+
return _flatInstanceProperty__default["default"](_context2 = _mapInstanceProperty__default["default"](fields).call(fields, field => {
|
|
340
|
+
if (field.isLocalized) return _mapInstanceProperty__default["default"](locales).call(locales, locale => {
|
|
219
341
|
var _context3, _context4, _context5;
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
342
|
+
const alias = replaceSpecialCharsWithUnderscore(_concatInstanceProperty__default["default"](_context3 = "".concat(field.name, "______")).call(_context3, locale));
|
|
343
|
+
return _concatInstanceProperty__default["default"](_context4 = _concatInstanceProperty__default["default"](_context5 = "".concat(alias, ": ")).call(_context5, field.name, "(locale: \"")).call(_context4, locale, "\")");
|
|
344
|
+
});else {
|
|
345
|
+
if (isFilledArray(field.fields)) {
|
|
346
|
+
return {
|
|
347
|
+
[field.name]: buildFields({
|
|
348
|
+
fields: field.fields,
|
|
349
|
+
locales
|
|
350
|
+
})
|
|
351
|
+
};
|
|
352
|
+
}
|
|
353
|
+
return field.name;
|
|
354
|
+
}
|
|
224
355
|
})).call(_context2);
|
|
225
356
|
}
|
|
226
357
|
|
|
358
|
+
function validate(_ref) {
|
|
359
|
+
let values = _valuesInstanceProperty__default["default"](_ref),
|
|
360
|
+
step = _ref.step;
|
|
361
|
+
const errors = {
|
|
362
|
+
fileName: {},
|
|
363
|
+
locales: {},
|
|
364
|
+
fields: {}
|
|
365
|
+
};
|
|
366
|
+
// Always validate these fields (first and second steps)
|
|
367
|
+
if (uiKit.TextInput.isEmpty(values.fileName)) {
|
|
368
|
+
errors.fileName.missing = true;
|
|
369
|
+
} else if (!/^[a-zA-Z0-9-_.]+$/.test(values.fileName)) {
|
|
370
|
+
errors.fileName.invalidInput = true;
|
|
371
|
+
}
|
|
372
|
+
if (values.locales.length < 1) {
|
|
373
|
+
errors.locales.missing = true;
|
|
374
|
+
}
|
|
375
|
+
//
|
|
376
|
+
|
|
377
|
+
// Only validate these fields on the 2nd step
|
|
378
|
+
if (step === 2) {
|
|
379
|
+
var _context;
|
|
380
|
+
const checkedFields = _filterInstanceProperty__default["default"](_context = values.fields).call(_context, field => field.isChecked);
|
|
381
|
+
if (checkedFields.length < 2) {
|
|
382
|
+
errors.fields.missing = true;
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
return omitEmpty__default["default"](errors);
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
const categoryColumnExtension = columns => {
|
|
389
|
+
const extendedColumns = [...columns];
|
|
390
|
+
const parentKeyIndex = _findIndexInstanceProperty__default["default"](columns).call(columns, column => column === 'parent.key');
|
|
391
|
+
if (parentKeyIndex !== -1) {
|
|
392
|
+
_spliceInstanceProperty__default["default"](extendedColumns).call(extendedColumns, parentKeyIndex + 1, 0, 'parent.typeId');
|
|
393
|
+
}
|
|
394
|
+
return extendedColumns;
|
|
395
|
+
};
|
|
396
|
+
const defaultColumnExtension = columns => columns;
|
|
397
|
+
const columnExtensionByResourceType = {
|
|
398
|
+
default: defaultColumnExtension,
|
|
399
|
+
category: categoryColumnExtension
|
|
400
|
+
};
|
|
401
|
+
|
|
402
|
+
const extendColumns = (columns, resourceType) => {
|
|
403
|
+
const extensionFunction = columnExtensionByResourceType[resourceType] || columnExtensionByResourceType.default;
|
|
404
|
+
return extensionFunction(columns);
|
|
405
|
+
};
|
|
406
|
+
|
|
227
407
|
var messages = reactIntl.defineMessages({
|
|
228
408
|
modalTitle: {
|
|
229
409
|
id: 'ExportResourcesModal.modalTitle',
|
|
230
410
|
description: 'Label for the modal title',
|
|
231
411
|
defaultMessage: 'Export {resourceType}'
|
|
232
412
|
},
|
|
233
|
-
modalSubTitle: {
|
|
234
|
-
id: 'ExportResourcesModal.modalSubTitle',
|
|
235
|
-
description: 'Label for the modal subtitle',
|
|
236
|
-
defaultMessage: 'Define export settings'
|
|
237
|
-
},
|
|
238
|
-
topBarPreviousPathLabel: {
|
|
239
|
-
id: 'ExportResourcesModal.topBarPreviousPathLabel',
|
|
240
|
-
description: 'Label for the topBar previous label',
|
|
241
|
-
defaultMessage: 'To {resourceType} List'
|
|
242
|
-
},
|
|
243
|
-
exportButton: {
|
|
244
|
-
id: 'ExportResourcesModal.exportButton',
|
|
245
|
-
description: 'Export primary button',
|
|
246
|
-
defaultMessage: 'Export {resourceType}'
|
|
247
|
-
},
|
|
248
413
|
outputFormat: {
|
|
249
414
|
id: 'ExportResourcesModal.outputFormat',
|
|
250
415
|
description: 'File format like (csv, xls, ...etc)',
|
|
@@ -255,10 +420,10 @@ var messages = reactIntl.defineMessages({
|
|
|
255
420
|
description: 'exported file name',
|
|
256
421
|
defaultMessage: 'File name'
|
|
257
422
|
},
|
|
258
|
-
|
|
259
|
-
id: 'ExportResourcesModal.
|
|
260
|
-
description: '
|
|
261
|
-
defaultMessage: '
|
|
423
|
+
locale: {
|
|
424
|
+
id: 'ExportResourcesModal.locale',
|
|
425
|
+
description: 'Locale',
|
|
426
|
+
defaultMessage: 'Locale'
|
|
262
427
|
},
|
|
263
428
|
exportSelection: {
|
|
264
429
|
id: 'ExportResourcesModal.exportSelection',
|
|
@@ -270,11 +435,6 @@ var messages = reactIntl.defineMessages({
|
|
|
270
435
|
description: 'Export All selection',
|
|
271
436
|
defaultMessage: 'Export all {resourceType} ({count})'
|
|
272
437
|
},
|
|
273
|
-
exportOnlyMatchingResources: {
|
|
274
|
-
id: 'ExportResourcesModal.exportOnlyMatchingResources',
|
|
275
|
-
description: 'Export resources only matching search/filter',
|
|
276
|
-
defaultMessage: 'Export list matching search/filter ({count})'
|
|
277
|
-
},
|
|
278
438
|
exportOnlySelectedResources: {
|
|
279
439
|
id: 'ExportResourcesModal.exportOnlySelectedResources',
|
|
280
440
|
description: 'Export only selected resources',
|
|
@@ -297,63 +457,33 @@ var messages = reactIntl.defineMessages({
|
|
|
297
457
|
},
|
|
298
458
|
columnsMessage: {
|
|
299
459
|
id: 'ExportResourcesModal.columnsMessage',
|
|
300
|
-
description: 'Exported columns based on table settings',
|
|
301
|
-
defaultMessage: '
|
|
302
|
-
},
|
|
303
|
-
appliedSearchTermsMessage: {
|
|
304
|
-
id: 'ExportResourcesModal.appliedSearchTermsMessage',
|
|
305
|
-
description: 'Applied Search Term(s)',
|
|
306
|
-
defaultMessage: '<b>Applied search term(s):</b> {searchTermsCount}'
|
|
307
|
-
},
|
|
308
|
-
appliedFiltersMessage: {
|
|
309
|
-
id: 'ExportResourcesModal.appliedFiltersMessage',
|
|
310
|
-
description: 'Applied Filter(s)',
|
|
311
|
-
defaultMessage: '<b>Applied Filter(s):</b> {filtersCount}'
|
|
460
|
+
description: 'Exported columns and attributes based on table settings',
|
|
461
|
+
defaultMessage: 'Exported columns/attributes based on table settings: {columnsCount}'
|
|
312
462
|
},
|
|
313
463
|
exportBasedOnMyViewsMessage: {
|
|
314
464
|
id: 'ExportResourcesModal.exportBasedOnMyViewsMessage',
|
|
315
465
|
description: 'Select Export setttings based on my views',
|
|
316
|
-
defaultMessage: 'Select export settings based on
|
|
466
|
+
defaultMessage: 'Select export settings based on:'
|
|
317
467
|
},
|
|
318
468
|
propertiesPanelLabel: {
|
|
319
469
|
id: 'ExportResourcesModal.propertiesPanelLabel',
|
|
320
470
|
description: 'properties panel label',
|
|
321
471
|
defaultMessage: 'Properties'
|
|
322
472
|
},
|
|
323
|
-
confirmationTitle: {
|
|
324
|
-
id: 'ExportResourcesModal.confirmationTitle',
|
|
325
|
-
description: 'Title for the confirmation dialog',
|
|
326
|
-
defaultMessage: 'Export {resourceType} data'
|
|
327
|
-
},
|
|
328
|
-
confirmationBodyPlan: {
|
|
329
|
-
id: 'ExportResourcesModal.confirmationBodyPlan',
|
|
330
|
-
description: 'Confirmation dialog action plan',
|
|
331
|
-
defaultMessage: 'You are about to export <bold>{count}</bold> {resourceType} from the project: <bold>{projectName}</bold>.'
|
|
332
|
-
},
|
|
333
|
-
confirmationBodyQuestion: {
|
|
334
|
-
id: 'ExportResourcesModal.confirmationBodyQuestion',
|
|
335
|
-
description: 'Confirmation question',
|
|
336
|
-
defaultMessage: 'Are you sure you want to continue?'
|
|
337
|
-
},
|
|
338
473
|
exportOperationSuccessMessage: {
|
|
339
474
|
id: 'ExportResourcesModal.exportOperationSuccessMessage',
|
|
340
475
|
description: 'Success message',
|
|
341
|
-
defaultMessage: 'Your export has started
|
|
342
|
-
},
|
|
343
|
-
exportConfirmationLabel: {
|
|
344
|
-
id: 'ExportResourcesModal.exportConfirmationLabel',
|
|
345
|
-
description: 'Label for the export button in confirmation dialog',
|
|
346
|
-
defaultMessage: 'Export {resourceType}'
|
|
476
|
+
defaultMessage: '<b>Your export has started.</b> <newline></newline><logsLink>Go to Export logs</logsLink> to view the progress and download the file.'
|
|
347
477
|
},
|
|
348
478
|
nothingApplied: {
|
|
349
479
|
id: 'ExportResourcesModal.nothingApplied',
|
|
350
480
|
description: 'Shown when there is no filter applied',
|
|
351
481
|
defaultMessage: 'nothing applied'
|
|
352
482
|
},
|
|
353
|
-
|
|
354
|
-
id: 'ExportResourcesModal.
|
|
355
|
-
description: 'label for "
|
|
356
|
-
defaultMessage: '
|
|
483
|
+
selectAllLocales: {
|
|
484
|
+
id: 'ExportResourcesModal.selectAllLocales',
|
|
485
|
+
description: 'label for "Select all locales" checkbox',
|
|
486
|
+
defaultMessage: 'Select all locales'
|
|
357
487
|
},
|
|
358
488
|
missingFileNameError: {
|
|
359
489
|
id: 'ExportResourcesModal.missingFileNameError',
|
|
@@ -365,890 +495,555 @@ var messages = reactIntl.defineMessages({
|
|
|
365
495
|
description: 'Error when file name field is not valid',
|
|
366
496
|
defaultMessage: 'File name may only contain alphanumeric characters, hyphens and underscores'
|
|
367
497
|
},
|
|
368
|
-
|
|
369
|
-
id: 'ExportResourcesModal.
|
|
370
|
-
description: 'Error when no
|
|
371
|
-
defaultMessage: 'Please select at least one
|
|
498
|
+
missingLocaleError: {
|
|
499
|
+
id: 'ExportResourcesModal.missingLocaleError',
|
|
500
|
+
description: 'Error when no locale is selected',
|
|
501
|
+
defaultMessage: 'Please select at least one locale'
|
|
502
|
+
},
|
|
503
|
+
myViews: {
|
|
504
|
+
id: 'ExportResourcesModal.myViews',
|
|
505
|
+
description: 'Label for "My Views" Select Field',
|
|
506
|
+
defaultMessage: 'My Views'
|
|
507
|
+
},
|
|
508
|
+
selectColumnsToExport: {
|
|
509
|
+
id: 'ExportResourcesModal.selectColumnsToExport',
|
|
510
|
+
defaultMessage: 'Select columns to export'
|
|
511
|
+
},
|
|
512
|
+
back: {
|
|
513
|
+
id: 'ExportResourcesModal.back',
|
|
514
|
+
description: 'Label for "Back" button',
|
|
515
|
+
defaultMessage: 'Back'
|
|
516
|
+
},
|
|
517
|
+
startExport: {
|
|
518
|
+
id: 'ExportResourcesModal.startExport',
|
|
519
|
+
description: 'Label for "Start export" button',
|
|
520
|
+
defaultMessage: 'Start export'
|
|
521
|
+
},
|
|
522
|
+
continue: {
|
|
523
|
+
id: 'ExportResourcesModal.continue',
|
|
524
|
+
description: 'Label for "Continue" button',
|
|
525
|
+
defaultMessage: 'Continue'
|
|
526
|
+
},
|
|
527
|
+
columnDefinitions: {
|
|
528
|
+
id: 'ExportResourcesModal.columnDefinitions',
|
|
529
|
+
description: 'Label for "Column Definitions" link',
|
|
530
|
+
defaultMessage: 'Column definitions'
|
|
531
|
+
},
|
|
532
|
+
allGeneralFields: {
|
|
533
|
+
id: 'ExportResourcesModal.allGeneralFields',
|
|
534
|
+
description: 'Label for "All general fields" checkbox',
|
|
535
|
+
defaultMessage: 'All general fields'
|
|
372
536
|
}
|
|
373
537
|
});
|
|
374
538
|
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
allResourcesCount: PropTypes__default["default"].number.isRequired,
|
|
383
|
-
matchingResourcesCount: PropTypes__default["default"].number,
|
|
384
|
-
selectedResourceIds: PropTypes__default["default"].array,
|
|
385
|
-
columns: PropTypes__default["default"].arrayOf({
|
|
386
|
-
key: PropTypes__default["default"].string.isRequired,
|
|
387
|
-
isLocalised: PropTypes__default["default"].bool
|
|
388
|
-
}).isRequired,
|
|
389
|
-
exportSelectionType: PropTypes__default["default"].string,
|
|
390
|
-
appliedSearchTerms: PropTypes__default["default"].array,
|
|
391
|
-
appliedFilters: PropTypes__default["default"].array,
|
|
392
|
-
renderProperties: PropTypes__default["default"].func
|
|
393
|
-
});
|
|
539
|
+
function getBold(msg) {
|
|
540
|
+
return jsxRuntime.jsx(uiKit.Text.Body, {
|
|
541
|
+
as: "span",
|
|
542
|
+
isBold: true,
|
|
543
|
+
children: msg
|
|
544
|
+
});
|
|
545
|
+
}
|
|
394
546
|
|
|
395
|
-
function
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
languages: {}
|
|
399
|
-
};
|
|
547
|
+
function getNewLine() {
|
|
548
|
+
return jsxRuntime.jsx("br", {});
|
|
549
|
+
}
|
|
400
550
|
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
551
|
+
function ownKeys$5(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
552
|
+
function _objectSpread$5(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$5(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$5(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
553
|
+
function renderFileNameError(key) {
|
|
554
|
+
switch (key) {
|
|
555
|
+
case 'missing':
|
|
556
|
+
return jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$5({}, messages.missingFileNameError));
|
|
557
|
+
case 'invalidInput':
|
|
558
|
+
return jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$5({}, messages.invalidFileNameError));
|
|
559
|
+
default:
|
|
560
|
+
return null;
|
|
405
561
|
}
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
562
|
+
}
|
|
563
|
+
function renderLocaleError(key) {
|
|
564
|
+
switch (key) {
|
|
565
|
+
case 'missing':
|
|
566
|
+
return jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$5({}, messages.missingLocaleError));
|
|
567
|
+
default:
|
|
568
|
+
return null;
|
|
409
569
|
}
|
|
410
|
-
|
|
411
|
-
return omitEmpty__default["default"](errors);
|
|
412
570
|
}
|
|
413
571
|
|
|
414
|
-
function ownKeys$b(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
415
|
-
|
|
416
|
-
function _objectSpread$b(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys$b(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys$b(Object(source))).call(_context3, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
417
|
-
|
|
418
|
-
var ExportResourcesContextProvider = function ExportResourcesContextProvider(props) {
|
|
419
|
-
var _context;
|
|
420
|
-
|
|
421
|
-
var todayFormatted = moment__default["default"]().format('DD-MM-YY_HH-mm');
|
|
422
|
-
|
|
423
|
-
var _useApplicationContex = applicationShellConnectors.useApplicationContext(function (applicationContext) {
|
|
424
|
-
return {
|
|
425
|
-
language: applicationContext.dataLocale
|
|
426
|
-
};
|
|
427
|
-
}),
|
|
428
|
-
language = _useApplicationContex.language;
|
|
429
|
-
|
|
430
|
-
var formik$1 = formik.useFormik({
|
|
431
|
-
initialValues: {
|
|
432
|
-
outputFormat: props.outputFormat,
|
|
433
|
-
fileName: _concatInstanceProperty__default["default"](_context = "".concat(resourceTypeToPlural({
|
|
434
|
-
resourceType: props.resourceType,
|
|
435
|
-
isUpperCase: true
|
|
436
|
-
}), "_Export_")).call(_context, todayFormatted),
|
|
437
|
-
languages: [language],
|
|
438
|
-
columns: props.columns,
|
|
439
|
-
appliedSearchTerms: props.appliedSearchTerms,
|
|
440
|
-
appliedFilters: props.appliedFilters,
|
|
441
|
-
exportSelectionType: props.exportSelectionType,
|
|
442
|
-
isAllLanguagesChecked: false
|
|
443
|
-
},
|
|
444
|
-
validate: validate
|
|
445
|
-
});
|
|
446
|
-
|
|
447
|
-
var _useState = react.useState(false),
|
|
448
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
449
|
-
exportOperationStarted = _useState2[0],
|
|
450
|
-
setExportOperationStarted = _useState2[1];
|
|
451
|
-
|
|
452
|
-
return jsxRuntime.jsx(ExportResourcesContext.Provider, {
|
|
453
|
-
value: {
|
|
454
|
-
formik: formik$1,
|
|
455
|
-
resourceType: props.resourceType,
|
|
456
|
-
allResourcesCount: props.allResourcesCount,
|
|
457
|
-
matchingResourcesCount: props.matchingResourcesCount,
|
|
458
|
-
selectedResourceIds: props.selectedResourceIds,
|
|
459
|
-
exportOperationStarted: exportOperationStarted,
|
|
460
|
-
setExportOperationStarted: setExportOperationStarted
|
|
461
|
-
},
|
|
462
|
-
children: props.children
|
|
463
|
-
});
|
|
464
|
-
};
|
|
465
|
-
|
|
466
|
-
ExportResourcesContextProvider.displayName = 'ExportResourcesContextProvider';
|
|
467
|
-
ExportResourcesContextProvider.propTypes = process.env.NODE_ENV !== "production" ? _objectSpread$b(_objectSpread$b({}, ExportResourcesModalShape), {}, {
|
|
468
|
-
children: PropTypes__default["default"].node
|
|
469
|
-
}) : {};
|
|
470
|
-
|
|
471
572
|
function useExportResourcesContext() {
|
|
472
|
-
|
|
473
|
-
|
|
573
|
+
const context = React.useContext(ExportResourcesContext);
|
|
474
574
|
if (!context) {
|
|
475
575
|
throw new MissingExportResourceProviderError();
|
|
476
576
|
}
|
|
477
|
-
|
|
478
577
|
return context;
|
|
479
578
|
}
|
|
480
579
|
|
|
481
|
-
|
|
482
|
-
var
|
|
483
|
-
var
|
|
484
|
-
|
|
485
|
-
var
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
}
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
}
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
tagListItem: tagListItem,
|
|
498
|
-
tagListContainer: tagListContainer,
|
|
499
|
-
smallTopPadding: smallTopPadding,
|
|
500
|
-
divider: divider,
|
|
501
|
-
notBold: notBold,
|
|
502
|
-
successMessage: successMessage
|
|
503
|
-
};
|
|
504
|
-
|
|
505
|
-
function ExportSelectionRadioButtons() {
|
|
506
|
-
var intl = reactIntl.useIntl();
|
|
507
|
-
|
|
508
|
-
var _useExportResourcesCo = useExportResourcesContext(),
|
|
509
|
-
formik = _useExportResourcesCo.formik,
|
|
510
|
-
resourceType = _useExportResourcesCo.resourceType,
|
|
511
|
-
allResourcesCount = _useExportResourcesCo.allResourcesCount,
|
|
512
|
-
matchingResourcesCount = _useExportResourcesCo.matchingResourcesCount,
|
|
513
|
-
selectedResourceIds = _useExportResourcesCo.selectedResourceIds;
|
|
514
|
-
|
|
515
|
-
var resourceTypePlural = resourceTypeToPlural({
|
|
516
|
-
resourceType: resourceType
|
|
517
|
-
});
|
|
518
|
-
return jsxRuntime.jsx(uiKit.Spacings.Inline, {
|
|
519
|
-
scale: "xl",
|
|
520
|
-
children: jsxRuntime.jsxs(uiKit.RadioInput.Group, {
|
|
521
|
-
name: "exportSelectionType",
|
|
522
|
-
value: _valuesInstanceProperty__default["default"](formik).exportSelectionType,
|
|
523
|
-
direction: "inline",
|
|
524
|
-
directionProps: {
|
|
525
|
-
scale: 'xl'
|
|
526
|
-
},
|
|
527
|
-
onChange: formik.handleChange,
|
|
528
|
-
children: [jsxRuntime.jsx(uiKit.RadioInput.Option, {
|
|
529
|
-
value: EXPORT_SELECTION_TYPES.ALL_RESOURCES,
|
|
530
|
-
"data-testid": 'test-all-resources',
|
|
531
|
-
children: jsxRuntime.jsx("b", {
|
|
532
|
-
children: intl.formatMessage(messages.exportAllResources, {
|
|
533
|
-
resourceType: resourceTypePlural,
|
|
534
|
-
count: allResourcesCount
|
|
535
|
-
})
|
|
536
|
-
})
|
|
537
|
-
}), jsxRuntime.jsx(uiKit.RadioInput.Option, {
|
|
538
|
-
value: EXPORT_SELECTION_TYPES.ONLY_MATCHING,
|
|
539
|
-
"data-testid": 'test-only-matching',
|
|
540
|
-
isDisabled: !Boolean(matchingResourcesCount),
|
|
541
|
-
children: jsxRuntime.jsx("b", {
|
|
542
|
-
children: intl.formatMessage(messages.exportOnlyMatchingResources, {
|
|
543
|
-
count: matchingResourcesCount || intl.formatMessage(messages.nothingApplied)
|
|
544
|
-
})
|
|
545
|
-
})
|
|
546
|
-
}), jsxRuntime.jsx(uiKit.RadioInput.Option, {
|
|
547
|
-
value: EXPORT_SELECTION_TYPES.ONLY_SELECTED,
|
|
548
|
-
"data-testid": 'test-only-selected',
|
|
549
|
-
isDisabled: !Boolean(selectedResourceIds.length),
|
|
550
|
-
children: jsxRuntime.jsx("b", {
|
|
551
|
-
children: intl.formatMessage(messages.exportOnlySelectedResources, {
|
|
552
|
-
resourceType: resourceTypePlural,
|
|
553
|
-
count: selectedResourceIds.length
|
|
554
|
-
})
|
|
555
|
-
})
|
|
556
|
-
})]
|
|
557
|
-
})
|
|
580
|
+
const _excluded = ["isSelectedByDefault"];
|
|
581
|
+
function ownKeys$4(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
582
|
+
function _objectSpread$4(e) { for (var r = 1; r < arguments.length; r++) { var _context3, _context4; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context3 = ownKeys$4(Object(t), !0)).call(_context3, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context4 = ownKeys$4(Object(t))).call(_context4, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
583
|
+
const useInitialValues = props => {
|
|
584
|
+
var _context;
|
|
585
|
+
const todayFormatted = moment__default["default"]().format('DD-MM-YY_HH-mm');
|
|
586
|
+
const _useApplicationContex = applicationShellConnectors.useApplicationContext(applicationContext => ({
|
|
587
|
+
locale: applicationContext.dataLocale
|
|
588
|
+
})),
|
|
589
|
+
locale = _useApplicationContex.locale;
|
|
590
|
+
const fields = _mapInstanceProperty__default["default"](_context = flattenNestedFields(props.fields)).call(_context, _ref => {
|
|
591
|
+
let isSelectedByDefault = _ref.isSelectedByDefault,
|
|
592
|
+
field = _objectWithoutProperties(_ref, _excluded);
|
|
593
|
+
return _objectSpread$4(_objectSpread$4({}, field), {}, {
|
|
594
|
+
isChecked: isSelectedByDefault !== null && isSelectedByDefault !== void 0 ? isSelectedByDefault : true
|
|
595
|
+
});
|
|
558
596
|
});
|
|
559
|
-
|
|
597
|
+
return React__default["default"].useMemo(() => {
|
|
598
|
+
var _context2;
|
|
599
|
+
return {
|
|
600
|
+
outputFormat: props.outputFormat,
|
|
601
|
+
fileName: _concatInstanceProperty__default["default"](_context2 = "".concat(resourceTypeToPlural({
|
|
602
|
+
resourceType: props.resourceType,
|
|
603
|
+
isUpperCase: true
|
|
604
|
+
}), "_Export_")).call(_context2, todayFormatted),
|
|
605
|
+
locales: [locale],
|
|
606
|
+
fields: checkRequiredFields(fields)
|
|
607
|
+
};
|
|
608
|
+
}, [props, locale, todayFormatted, fields]);
|
|
609
|
+
};
|
|
560
610
|
|
|
561
|
-
function
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
611
|
+
async function createExportOperation(_ref) {
|
|
612
|
+
let fileName = _ref.fileName,
|
|
613
|
+
fileFormat = _ref.fileFormat,
|
|
614
|
+
columns = _ref.columns,
|
|
615
|
+
locales = _ref.locales,
|
|
616
|
+
projectKey = _ref.projectKey,
|
|
617
|
+
graphQuery = _ref.graphQuery,
|
|
618
|
+
asyncDispatchFn = _ref.asyncDispatchFn;
|
|
619
|
+
const uri = "/proxy/export/".concat(projectKey, "/export-operations");
|
|
620
|
+
const response = await asyncDispatchFn(sdk.actions.post({
|
|
621
|
+
// FIXME: EXPORT is undefined
|
|
622
|
+
mcApiProxyTarget: constants.MC_API_PROXY_TARGETS.EXPORT,
|
|
623
|
+
uri: uri,
|
|
624
|
+
headers: {
|
|
625
|
+
accept: 'application/json'
|
|
626
|
+
},
|
|
627
|
+
payload: {
|
|
628
|
+
fileName,
|
|
629
|
+
fileFormat,
|
|
630
|
+
columns,
|
|
631
|
+
locales,
|
|
632
|
+
query: graphQuery
|
|
633
|
+
}
|
|
634
|
+
}));
|
|
635
|
+
return response;
|
|
567
636
|
}
|
|
568
637
|
|
|
569
|
-
|
|
638
|
+
const useStartExportOperation = props => {
|
|
639
|
+
const intl = reactIntl.useIntl();
|
|
640
|
+
const asyncDispatch = sdk.useAsyncDispatch();
|
|
641
|
+
const showNotification = actionsGlobal.useShowNotification();
|
|
642
|
+
const _useApplicationContex = applicationShellConnectors.useApplicationContext(applicationContext => {
|
|
643
|
+
var _applicationContext$p;
|
|
644
|
+
return {
|
|
645
|
+
locale: applicationContext.dataLocale,
|
|
646
|
+
projectKey: (_applicationContext$p = applicationContext.project) === null || _applicationContext$p === void 0 ? void 0 : _applicationContext$p.key
|
|
647
|
+
};
|
|
648
|
+
}),
|
|
649
|
+
projectKey = _useApplicationContex.projectKey;
|
|
650
|
+
const startExportOperation = async values => {
|
|
651
|
+
const graphQuery = buildGraphQuery({
|
|
652
|
+
resourceType: props.resourceType,
|
|
653
|
+
exportType: props.exportType,
|
|
654
|
+
selectedResourceIds: props.selectedResourceIds,
|
|
655
|
+
fields: unflattenNestedFields(getSelectedFields(values.fields)),
|
|
656
|
+
locales: values.locales
|
|
657
|
+
});
|
|
658
|
+
try {
|
|
659
|
+
const response = await createExportOperation({
|
|
660
|
+
fileName: appendCsvOrJsonExtensionIfAbsent(values.fileName, values.outputFormat),
|
|
661
|
+
fileFormat: values.outputFormat,
|
|
662
|
+
locales: values.locales,
|
|
663
|
+
columns: extendColumns(getFieldNames(getSelectedFields(values.fields)), props.resourceType),
|
|
664
|
+
projectKey,
|
|
665
|
+
graphQuery,
|
|
666
|
+
asyncDispatchFn: asyncDispatch
|
|
667
|
+
});
|
|
668
|
+
switch (response.state) {
|
|
669
|
+
case EXPORT_OPERATION_STATES.PROCESSING:
|
|
670
|
+
case EXPORT_OPERATION_STATES.COMPLETED:
|
|
671
|
+
showNotification({
|
|
672
|
+
kind: 'info',
|
|
673
|
+
domain: constants.DOMAINS.SIDE,
|
|
674
|
+
text: intl.formatMessage(messages.exportOperationSuccessMessage, {
|
|
675
|
+
newline: getNewLine,
|
|
676
|
+
logsLink: msg => getExportLogsLink(projectKey, msg),
|
|
677
|
+
b: getBold
|
|
678
|
+
})
|
|
679
|
+
}, {
|
|
680
|
+
dismissAfter: 5000
|
|
681
|
+
});
|
|
682
|
+
break;
|
|
683
|
+
default:
|
|
684
|
+
throw new UnexpectedExportOperationStateError(response.state);
|
|
685
|
+
}
|
|
686
|
+
} catch (errors) {
|
|
687
|
+
// TODO: custom error messages for each error type
|
|
688
|
+
actionsGlobal.showApiErrorNotification({
|
|
689
|
+
errors
|
|
690
|
+
});
|
|
691
|
+
} finally {
|
|
692
|
+
if (typeof props.onClose === 'function') props.onClose();
|
|
693
|
+
}
|
|
694
|
+
};
|
|
695
|
+
return {
|
|
696
|
+
startExportOperation
|
|
697
|
+
};
|
|
698
|
+
};
|
|
570
699
|
|
|
571
|
-
function
|
|
700
|
+
function ownKeys$3(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
701
|
+
function _objectSpread$3(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$3(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$3(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
572
702
|
function ExportTextMessage() {
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
var resourceTypePlural = resourceTypeToPlural({
|
|
703
|
+
const _useExportResourcesCo = useExportResourcesContext(),
|
|
704
|
+
resourceType = _useExportResourcesCo.resourceType,
|
|
705
|
+
totalResourcesCount = _useExportResourcesCo.totalResourcesCount,
|
|
706
|
+
selectedResourceIds = _useExportResourcesCo.selectedResourceIds,
|
|
707
|
+
exportType = _useExportResourcesCo.exportType;
|
|
708
|
+
const resourceTypePlural = resourceTypeToPlural({
|
|
581
709
|
resourceType: resourceType
|
|
582
710
|
});
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
});
|
|
595
|
-
|
|
596
|
-
case EXPORT_SELECTION_TYPES.ONLY_MATCHING:
|
|
597
|
-
return jsxRuntime.jsx(uiKit.Text.Body, {
|
|
598
|
-
intlMessage: _objectSpread$a(_objectSpread$a({}, messages.exportMatchingMessage), {}, {
|
|
599
|
-
values: {
|
|
600
|
-
count: matchingResourcesCount,
|
|
601
|
-
resourceType: resourceTypePlural,
|
|
602
|
-
b: getBold
|
|
603
|
-
}
|
|
604
|
-
})
|
|
605
|
-
});
|
|
606
|
-
|
|
607
|
-
case EXPORT_SELECTION_TYPES.ONLY_SELECTED:
|
|
608
|
-
return jsxRuntime.jsx(uiKit.Text.Body, {
|
|
609
|
-
intlMessage: _objectSpread$a(_objectSpread$a({}, messages.exportSelectedMessage), {}, {
|
|
610
|
-
values: {
|
|
611
|
-
count: selectedResourceIds.length,
|
|
612
|
-
resourceType: resourceTypePlural,
|
|
613
|
-
b: getBold
|
|
614
|
-
}
|
|
615
|
-
})
|
|
616
|
-
});
|
|
617
|
-
|
|
711
|
+
let message;
|
|
712
|
+
let count;
|
|
713
|
+
switch (exportType) {
|
|
714
|
+
case EXPORT_TYPES.ALL:
|
|
715
|
+
message = messages.exportAllMessage;
|
|
716
|
+
count = totalResourcesCount;
|
|
717
|
+
break;
|
|
718
|
+
case EXPORT_TYPES.SELECTED:
|
|
719
|
+
message = messages.exportSelectedMessage;
|
|
720
|
+
count = selectedResourceIds.length;
|
|
721
|
+
break;
|
|
618
722
|
default:
|
|
619
|
-
throw new
|
|
723
|
+
throw new UnexpectedExportTypeError(exportType);
|
|
620
724
|
}
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
css: styles.tagListItem,
|
|
630
|
-
children: tag
|
|
631
|
-
});
|
|
725
|
+
return jsxRuntime.jsx(uiKit.Text.Body, {
|
|
726
|
+
"data-testid": "export-description",
|
|
727
|
+
intlMessage: _objectSpread$3(_objectSpread$3({}, message), {}, {
|
|
728
|
+
values: {
|
|
729
|
+
count: count,
|
|
730
|
+
resourceType: resourceTypePlural,
|
|
731
|
+
b: getBold
|
|
732
|
+
}
|
|
632
733
|
})
|
|
633
734
|
});
|
|
634
735
|
}
|
|
635
|
-
TagList.displayName = 'TagList';
|
|
636
|
-
TagList.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
637
|
-
children: PropTypes__default["default"].node.isRequired,
|
|
638
|
-
'data-testid': PropTypes__default["default"].string
|
|
639
|
-
} : {};
|
|
640
|
-
|
|
641
|
-
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; }
|
|
642
736
|
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
737
|
+
const ExportFileSettingsStep = () => {
|
|
738
|
+
const intl = reactIntl.useIntl();
|
|
739
|
+
const _useExportResourcesCo = useExportResourcesContext(),
|
|
740
|
+
formik = _useExportResourcesCo.formik;
|
|
741
|
+
const _useApplicationContex = applicationShellConnectors.useApplicationContext(applicationContext => {
|
|
742
|
+
var _applicationContext$p;
|
|
743
|
+
return {
|
|
744
|
+
locale: applicationContext.dataLocale,
|
|
745
|
+
locales: ((_applicationContext$p = applicationContext.project) === null || _applicationContext$p === void 0 ? void 0 : _applicationContext$p.languages) || []
|
|
746
|
+
};
|
|
747
|
+
}),
|
|
748
|
+
locales = _useApplicationContex.locales,
|
|
749
|
+
locale = _useApplicationContex.locale;
|
|
750
|
+
const areAllLocalesChecked = _valuesInstanceProperty__default["default"](formik).locales.length === locales.length;
|
|
647
751
|
return jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
648
|
-
scale: "
|
|
649
|
-
children: [jsxRuntime.jsxs(uiKit.Spacings.
|
|
650
|
-
scale: "
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
752
|
+
scale: "xxxl",
|
|
753
|
+
children: [jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
754
|
+
scale: "l",
|
|
755
|
+
children: [jsxRuntime.jsxs(uiKit.Spacings.Inline, {
|
|
756
|
+
alignItems: "center",
|
|
757
|
+
children: [jsxRuntime.jsx(uiKit.ExportIcon, {
|
|
758
|
+
size: "medium",
|
|
759
|
+
color: "neutral60"
|
|
760
|
+
}), jsxRuntime.jsx(ExportTextMessage, {})]
|
|
761
|
+
}), jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
762
|
+
scale: "m",
|
|
763
|
+
children: [jsxRuntime.jsx(uiKit.SelectField, {
|
|
764
|
+
name: "outputFormat",
|
|
765
|
+
onChange: formik.handleChange,
|
|
766
|
+
onBlur: formik.handleBlur,
|
|
767
|
+
value: _valuesInstanceProperty__default["default"](formik).outputFormat,
|
|
768
|
+
title: intl.formatMessage(messages.outputFormat),
|
|
769
|
+
options: OUTPUT_FORMAT_OPTIONS
|
|
770
|
+
}), jsxRuntime.jsx(uiKit.TextField, {
|
|
771
|
+
name: "fileName",
|
|
772
|
+
onChange: formik.handleChange,
|
|
773
|
+
onBlur: formik.handleBlur,
|
|
774
|
+
value: _valuesInstanceProperty__default["default"](formik).fileName,
|
|
775
|
+
title: intl.formatMessage(messages.fileName),
|
|
776
|
+
touched: formik.touched.fileName,
|
|
777
|
+
errors: formik.errors.fileName,
|
|
778
|
+
renderError: renderFileNameError
|
|
779
|
+
}), jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
780
|
+
scale: "xs",
|
|
781
|
+
children: [jsxRuntime.jsx(uiKit.SelectField, {
|
|
782
|
+
id: "locales",
|
|
783
|
+
name: "locales",
|
|
784
|
+
value: _valuesInstanceProperty__default["default"](formik).locales,
|
|
785
|
+
title: intl.formatMessage(messages.locale),
|
|
786
|
+
options: mapLocalesToOptions(locales),
|
|
787
|
+
isMulti: true,
|
|
788
|
+
onChange: formik.handleChange,
|
|
789
|
+
onBlur: formik.handleBlur,
|
|
790
|
+
touched: formik.touched.locales,
|
|
791
|
+
errors: formik.errors.locales,
|
|
792
|
+
renderError: renderLocaleError
|
|
793
|
+
}), jsxRuntime.jsx(uiKit.CheckboxInput, {
|
|
794
|
+
isChecked: areAllLocalesChecked,
|
|
795
|
+
onChange: e => {
|
|
796
|
+
if (e.target.checked) formik.setFieldValue('locales', locales);else formik.setFieldValue('locales', [locale]);
|
|
671
797
|
},
|
|
672
|
-
children:
|
|
673
|
-
})
|
|
674
|
-
}
|
|
675
|
-
})
|
|
676
|
-
})
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
} : {};
|
|
683
|
-
|
|
684
|
-
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; }
|
|
685
|
-
|
|
686
|
-
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; }
|
|
687
|
-
function ExportBasedOnMyViewsSelectField() {
|
|
688
|
-
return jsxRuntime.jsxs(uiKit.Spacings.Inline, {
|
|
689
|
-
scale: "m",
|
|
690
|
-
alignItems: "center",
|
|
691
|
-
children: [jsxRuntime.jsx(uiKit.Text.Body, {
|
|
692
|
-
intlMessage: _objectSpread$8(_objectSpread$8({}, messages.exportBasedOnMyViewsMessage), {}, {
|
|
693
|
-
values: {
|
|
694
|
-
b: getBold
|
|
695
|
-
}
|
|
696
|
-
})
|
|
697
|
-
}), jsxRuntime.jsx(uiKit.Constraints.Horizontal, {
|
|
698
|
-
max: 4,
|
|
699
|
-
children: jsxRuntime.jsx(uiKit.SelectInput, {
|
|
700
|
-
isDisabled: true,
|
|
701
|
-
placeholder: "Default"
|
|
798
|
+
children: intl.formatMessage(messages.selectAllLocales)
|
|
799
|
+
})]
|
|
800
|
+
})]
|
|
801
|
+
})]
|
|
802
|
+
}), jsxRuntime.jsx(uiKit.Spacings.Inline, {
|
|
803
|
+
justifyContent: "flex-end",
|
|
804
|
+
children: jsxRuntime.jsx(uiKit.PrimaryButton, {
|
|
805
|
+
label: intl.formatMessage(messages.continue),
|
|
806
|
+
onClick: formik.submitForm,
|
|
807
|
+
isDisabled: !formik.isValid
|
|
702
808
|
})
|
|
703
809
|
})]
|
|
704
810
|
});
|
|
705
|
-
}
|
|
706
|
-
|
|
707
|
-
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; }
|
|
708
|
-
|
|
709
|
-
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; }
|
|
811
|
+
};
|
|
710
812
|
|
|
711
|
-
var
|
|
712
|
-
|
|
813
|
+
function ownKeys$2(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
814
|
+
function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var _context6, _context7; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context6 = ownKeys$2(Object(t), !0)).call(_context6, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context7 = ownKeys$2(Object(t))).call(_context7, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
815
|
+
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)."; }
|
|
816
|
+
const StyledCard = /*#__PURE__*/_styled__default["default"](uiKit.Card, process.env.NODE_ENV === "production" ? {
|
|
817
|
+
target: "e1ocu3bb2"
|
|
713
818
|
} : {
|
|
714
|
-
target: "
|
|
715
|
-
label: "
|
|
716
|
-
})(
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
819
|
+
target: "e1ocu3bb2",
|
|
820
|
+
label: "StyledCard"
|
|
821
|
+
})(process.env.NODE_ENV === "production" ? {
|
|
822
|
+
name: "1jtoq3b",
|
|
823
|
+
styles: "border-radius:4px 0px 0px 4px;&>div{height:490px;overflow-y:auto;}"
|
|
824
|
+
} : {
|
|
825
|
+
name: "1jtoq3b",
|
|
826
|
+
styles: "border-radius:4px 0px 0px 4px;&>div{height:490px;overflow-y:auto;}",
|
|
827
|
+
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImV4cG9ydC1maWVsZHMtc2VsZWN0aW9uLXN0ZXAuanN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQW1CK0IiLCJmaWxlIjoiZXhwb3J0LWZpZWxkcy1zZWxlY3Rpb24tc3RlcC5qc3giLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgUmVhY3QgZnJvbSAncmVhY3QnXG5pbXBvcnQgeyB1c2VJbnRsIH0gZnJvbSAncmVhY3QtaW50bCdcbmltcG9ydCBzdHlsZWQgZnJvbSAnQGVtb3Rpb24vc3R5bGVkJ1xuaW1wb3J0IHtcbiAgQ2FyZCxcbiAgQ2hlY2tib3hJbnB1dCxcbiAgR3JpZCxcbiAgTGluayxcbiAgUHJpbWFyeUJ1dHRvbixcbiAgU2Vjb25kYXJ5QnV0dG9uLFxuICBTcGFjaW5ncyxcbiAgVGV4dCxcbiAgY3VzdG9tUHJvcGVydGllcyxcbn0gZnJvbSAnQGNvbW1lcmNldG9vbHMtZnJvbnRlbmQvdWkta2l0J1xuaW1wb3J0IG1lc3NhZ2VzIGZyb20gJy4uL21lc3NhZ2VzJ1xuaW1wb3J0IHsgdXNlRXhwb3J0UmVzb3VyY2VzQ29udGV4dCB9IGZyb20gJy4uL0Bob29rcydcbmltcG9ydCB7IENPTFVNTl9ERUZJTklUSU9OU19VUkxTIH0gZnJvbSAnLi4vQGNvbnN0YW50cydcblxuLy8gVE9ETzogUmVtb3ZlIHRoZXNlIHN0eWxlZCBjb21wb25lbnRzIGFzIGl0J3Mgbm90IGEgcmVjb21tZW5kZWQgcHJhY3RpY2UgdG8gdXNlIHRoZW0uIFdlIHNob3VsZCBhbGlnbiB3aXRoIE1DIFVJIEtpdC9wYXR0ZXJucyBpbiB0ZXJtcyBvZiBzdHlsaW5nICh0byBiZSBkaXNjdXNzZWQgd2l0aCB0aGUgVUkvVVgpLlxuY29uc3QgU3R5bGVkQ2FyZCA9IHN0eWxlZChDYXJkKWBcbiAgYm9yZGVyLXJhZGl1czogNHB4IDBweCAwcHggNHB4O1xuICAmID4gZGl2IHtcbiAgICBoZWlnaHQ6IDQ5MHB4O1xuICAgIG92ZXJmbG93LXk6IGF1dG87XG4gIH1cbmBcbmNvbnN0IFN0eWxlZENhcmRMZWZ0ID0gc3R5bGVkKFN0eWxlZENhcmQpYFxuICBiYWNrZ3JvdW5kLWNvbG9yOiAjZjlmOWZiO1xuYFxuY29uc3QgU3R5bGVkQ2FyZFJpZ2h0ID0gc3R5bGVkKFN0eWxlZENhcmQpYFxuICBib3JkZXItcmFkaXVzOiAwcHggNHB4IDRweCAwcHg7XG4gIGJvcmRlci1sZWZ0OiAwO1xuYFxuXG5leHBvcnQgY29uc3QgRXhwb3J0RmllbGRzU2VsZWN0aW9uU3RlcCA9ICgpID0+IHtcbiAgY29uc3QgaW50bCA9IHVzZUludGwoKVxuICBjb25zdCB7IGZvcm1paywgc2V0Q3VycmVudFN0ZXAsIHJlc291cmNlVHlwZSB9ID0gdXNlRXhwb3J0UmVzb3VyY2VzQ29udGV4dCgpXG4gIGNvbnN0IGFyZUFsbEZpZWxkc0NoZWNrZWQgPSBmb3JtaWsudmFsdWVzLmZpZWxkcy5ldmVyeShcbiAgICAoZmllbGQpID0+IGZpZWxkLmlzQ2hlY2tlZFxuICApXG4gIGNvbnN0IGlzQXRMZWFzdE9uZUZpZWxkQ2hlY2tlZCA9IGZvcm1pay52YWx1ZXMuZmllbGRzLnNvbWUoXG4gICAgKGZpZWxkKSA9PiBmaWVsZC5pc0NoZWNrZWRcbiAgKVxuXG4gIHJldHVybiAoXG4gICAgPFNwYWNpbmdzLlN0YWNrIHNjYWxlPVwieGxcIj5cbiAgICAgIDxTcGFjaW5ncy5TdGFjayBzY2FsZT1cIm1cIj5cbiAgICAgICAgPFNwYWNpbmdzLklubGluZSBqdXN0aWZ5Q29udGVudD1cInNwYWNlLWJldHdlZW5cIj5cbiAgICAgICAgICA8VGV4dC5Cb2R5IGludGxNZXNzYWdlPXttZXNzYWdlcy5zZWxlY3RDb2x1bW5zVG9FeHBvcnR9IC8+XG4gICAgICAgICAgPExpbmtcbiAgICAgICAgICAgIGlzRXh0ZXJuYWxcbiAgICAgICAgICAgIHRvbmU9XCJzZWNvbmRhcnlcIlxuICAgICAgICAgICAgaW50bE1lc3NhZ2U9e21lc3NhZ2VzLmNvbHVtbkRlZmluaXRpb25zfVxuICAgICAgICAgICAgdG89e0NPTFVNTl9ERUZJTklUSU9OU19VUkxTW3Jlc291cmNlVHlwZV19XG4gICAgICAgICAgLz5cbiAgICAgICAgPC9TcGFjaW5ncy5JbmxpbmU+XG4gICAgICAgIDxHcmlkXG4gICAgICAgICAgZ3JpZEF1dG9GbG93PVwiY29sdW1uXCJcbiAgICAgICAgICBncmlkVGVtcGxhdGVDb2x1bW5zPXtgJHtjdXN0b21Qcm9wZXJ0aWVzLmNvbnN0cmFpbnQ1fSBhdXRvYH1cbiAgICAgICAgPlxuICAgICAgICAgIDxHcmlkLkl0ZW0+XG4gICAgICAgICAgICA8U3R5bGVkQ2FyZExlZnQgaW5zZXRTY2FsZT1cImxcIj5cbiAgICAgICAgICAgICAgPENoZWNrYm94SW5wdXRcbiAgICAgICAgICAgICAgICBpc0luZGV0ZXJtaW5hdGU9e1xuICAgICAgICAgICAgICAgICAgIWFyZUFsbEZpZWxkc0NoZWNrZWQgJiYgaXNBdExlYXN0T25lRmllbGRDaGVja2VkXG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlzQ2hlY2tlZD17YXJlQWxsRmllbGRzQ2hlY2tlZH1cbiAgICAgICAgICAgICAgICBvbkNoYW5nZT17KGUpID0+IHtcbiAgICAgICAgICAgICAgICAgIGZvcm1pay5zZXRGaWVsZFZhbHVlKFxuICAgICAgICAgICAgICAgICAgICAnZmllbGRzJyxcbiAgICAgICAgICAgICAgICAgICAgZm9ybWlrLnZhbHVlcy5maWVsZHMubWFwKChmaWVsZCkgPT4gKHtcbiAgICAgICAgICAgICAgICAgICAgICAuLi5maWVsZCxcbiAgICAgICAgICAgICAgICAgICAgICBpc0NoZWNrZWQ6IGZpZWxkLmlzUmVxdWlyZWQgPyB0cnVlIDogZS50YXJnZXQuY2hlY2tlZCxcbiAgICAgICAgICAgICAgICAgICAgfSkpXG4gICAgICAgICAgICAgICAgICApXG4gICAgICAgICAgICAgICAgfX1cbiAgICAgICAgICAgICAgPlxuICAgICAgICAgICAgICAgIDxUZXh0LkJvZHkgaW50bE1lc3NhZ2U9e21lc3NhZ2VzLmFsbEdlbmVyYWxGaWVsZHN9IC8+XG4gICAgICAgICAgICAgIDwvQ2hlY2tib3hJbnB1dD5cbiAgICAgICAgICAgIDwvU3R5bGVkQ2FyZExlZnQ+XG4gICAgICAgICAgPC9HcmlkLkl0ZW0+XG4gICAgICAgICAgPEdyaWQuSXRlbT5cbiAgICAgICAgICAgIDxTdHlsZWRDYXJkUmlnaHQgaW5zZXRTY2FsZT1cImxcIj5cbiAgICAgICAgICAgICAge2Zvcm1pay52YWx1ZXMuZmllbGRzLm1hcCgoZmllbGQpID0+IChcbiAgICAgICAgICAgICAgICA8Q2hlY2tib3hJbnB1dFxuICAgICAgICAgICAgICAgICAga2V5PXtmaWVsZC5uYW1lfVxuICAgICAgICAgICAgICAgICAgaXNSZWFkT25seT17ZmllbGQuaXNSZXF1aXJlZH1cbiAgICAgICAgICAgICAgICAgIGlzQ2hlY2tlZD17ZmllbGQuaXNDaGVja2VkfVxuICAgICAgICAgICAgICAgICAgb25DaGFuZ2U9eyhlKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgIGZvcm1pay5zZXRGaWVsZFZhbHVlKFxuICAgICAgICAgICAgICAgICAgICAgICdmaWVsZHMnLFxuICAgICAgICAgICAgICAgICAgICAgIGZvcm1pay52YWx1ZXMuZmllbGRzLm1hcCgoX2ZpZWxkKSA9PlxuICAgICAgICAgICAgICAgICAgICAgICAgZmllbGQubmFtZSA9PT0gX2ZpZWxkLm5hbWVcbiAgICAgICAgICAgICAgICAgICAgICAgICAgPyB7IC4uLl9maWVsZCwgaXNDaGVja2VkOiBlLnRhcmdldC5jaGVja2VkIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgOiBfZmllbGRcbiAgICAgICAgICAgICAgICAgICAgICApXG4gICAgICAgICAgICAgICAgICAgIClcbiAgICAgICAgICAgICAgICAgIH19XG4gICAgICAgICAgICAgICAgPlxuICAgICAgICAgICAgICAgICAgPFRleHQuQm9keT5cbiAgICAgICAgICAgICAgICAgICAge2ZpZWxkLmxhYmVsfSB7ZmllbGQuaXNSZXF1aXJlZCAmJiAnKid9XG4gICAgICAgICAgICAgICAgICA8L1RleHQuQm9keT5cbiAgICAgICAgICAgICAgICA8L0NoZWNrYm94SW5wdXQ+XG4gICAgICAgICAgICAgICkpfVxuICAgICAgICAgICAgPC9TdHlsZWRDYXJkUmlnaHQ+XG4gICAgICAgICAgPC9HcmlkLkl0ZW0+XG4gICAgICAgIDwvR3JpZD5cbiAgICAgIDwvU3BhY2luZ3MuU3RhY2s+XG4gICAgICA8U3BhY2luZ3MuSW5saW5lIHNjYWxlPVwibVwiIGp1c3RpZnlDb250ZW50PVwiZmxleC1lbmRcIj5cbiAgICAgICAgPFNlY29uZGFyeUJ1dHRvblxuICAgICAgICAgIGxhYmVsPXtpbnRsLmZvcm1hdE1lc3NhZ2UobWVzc2FnZXMuYmFjayl9XG4gICAgICAgICAgb25DbGljaz17KCkgPT4gc2V0Q3VycmVudFN0ZXAoMSl9XG4gICAgICAgIC8+XG4gICAgICAgIDxQcmltYXJ5QnV0dG9uXG4gICAgICAgICAgbGFiZWw9e2ludGwuZm9ybWF0TWVzc2FnZShtZXNzYWdlcy5zdGFydEV4cG9ydCl9XG4gICAgICAgICAgb25DbGljaz17Zm9ybWlrLnN1Ym1pdEZvcm19XG4gICAgICAgICAgaXNEaXNhYmxlZD17IWZvcm1pay5pc1ZhbGlkfVxuICAgICAgICAvPlxuICAgICAgPC9TcGFjaW5ncy5JbmxpbmU+XG4gICAgPC9TcGFjaW5ncy5TdGFjaz5cbiAgKVxufVxuIl19 */",
|
|
828
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
829
|
+
});
|
|
830
|
+
const StyledCardLeft = /*#__PURE__*/_styled__default["default"](StyledCard, process.env.NODE_ENV === "production" ? {
|
|
831
|
+
target: "e1ocu3bb1"
|
|
832
|
+
} : {
|
|
833
|
+
target: "e1ocu3bb1",
|
|
834
|
+
label: "StyledCardLeft"
|
|
835
|
+
})(process.env.NODE_ENV === "production" ? {
|
|
836
|
+
name: "65buvr",
|
|
837
|
+
styles: "background-color:#f9f9fb"
|
|
838
|
+
} : {
|
|
839
|
+
name: "65buvr",
|
|
840
|
+
styles: "background-color:#f9f9fb",
|
|
841
|
+
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImV4cG9ydC1maWVsZHMtc2VsZWN0aW9uLXN0ZXAuanN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQTBCeUMiLCJmaWxlIjoiZXhwb3J0LWZpZWxkcy1zZWxlY3Rpb24tc3RlcC5qc3giLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgUmVhY3QgZnJvbSAncmVhY3QnXG5pbXBvcnQgeyB1c2VJbnRsIH0gZnJvbSAncmVhY3QtaW50bCdcbmltcG9ydCBzdHlsZWQgZnJvbSAnQGVtb3Rpb24vc3R5bGVkJ1xuaW1wb3J0IHtcbiAgQ2FyZCxcbiAgQ2hlY2tib3hJbnB1dCxcbiAgR3JpZCxcbiAgTGluayxcbiAgUHJpbWFyeUJ1dHRvbixcbiAgU2Vjb25kYXJ5QnV0dG9uLFxuICBTcGFjaW5ncyxcbiAgVGV4dCxcbiAgY3VzdG9tUHJvcGVydGllcyxcbn0gZnJvbSAnQGNvbW1lcmNldG9vbHMtZnJvbnRlbmQvdWkta2l0J1xuaW1wb3J0IG1lc3NhZ2VzIGZyb20gJy4uL21lc3NhZ2VzJ1xuaW1wb3J0IHsgdXNlRXhwb3J0UmVzb3VyY2VzQ29udGV4dCB9IGZyb20gJy4uL0Bob29rcydcbmltcG9ydCB7IENPTFVNTl9ERUZJTklUSU9OU19VUkxTIH0gZnJvbSAnLi4vQGNvbnN0YW50cydcblxuLy8gVE9ETzogUmVtb3ZlIHRoZXNlIHN0eWxlZCBjb21wb25lbnRzIGFzIGl0J3Mgbm90IGEgcmVjb21tZW5kZWQgcHJhY3RpY2UgdG8gdXNlIHRoZW0uIFdlIHNob3VsZCBhbGlnbiB3aXRoIE1DIFVJIEtpdC9wYXR0ZXJucyBpbiB0ZXJtcyBvZiBzdHlsaW5nICh0byBiZSBkaXNjdXNzZWQgd2l0aCB0aGUgVUkvVVgpLlxuY29uc3QgU3R5bGVkQ2FyZCA9IHN0eWxlZChDYXJkKWBcbiAgYm9yZGVyLXJhZGl1czogNHB4IDBweCAwcHggNHB4O1xuICAmID4gZGl2IHtcbiAgICBoZWlnaHQ6IDQ5MHB4O1xuICAgIG92ZXJmbG93LXk6IGF1dG87XG4gIH1cbmBcbmNvbnN0IFN0eWxlZENhcmRMZWZ0ID0gc3R5bGVkKFN0eWxlZENhcmQpYFxuICBiYWNrZ3JvdW5kLWNvbG9yOiAjZjlmOWZiO1xuYFxuY29uc3QgU3R5bGVkQ2FyZFJpZ2h0ID0gc3R5bGVkKFN0eWxlZENhcmQpYFxuICBib3JkZXItcmFkaXVzOiAwcHggNHB4IDRweCAwcHg7XG4gIGJvcmRlci1sZWZ0OiAwO1xuYFxuXG5leHBvcnQgY29uc3QgRXhwb3J0RmllbGRzU2VsZWN0aW9uU3RlcCA9ICgpID0+IHtcbiAgY29uc3QgaW50bCA9IHVzZUludGwoKVxuICBjb25zdCB7IGZvcm1paywgc2V0Q3VycmVudFN0ZXAsIHJlc291cmNlVHlwZSB9ID0gdXNlRXhwb3J0UmVzb3VyY2VzQ29udGV4dCgpXG4gIGNvbnN0IGFyZUFsbEZpZWxkc0NoZWNrZWQgPSBmb3JtaWsudmFsdWVzLmZpZWxkcy5ldmVyeShcbiAgICAoZmllbGQpID0+IGZpZWxkLmlzQ2hlY2tlZFxuICApXG4gIGNvbnN0IGlzQXRMZWFzdE9uZUZpZWxkQ2hlY2tlZCA9IGZvcm1pay52YWx1ZXMuZmllbGRzLnNvbWUoXG4gICAgKGZpZWxkKSA9PiBmaWVsZC5pc0NoZWNrZWRcbiAgKVxuXG4gIHJldHVybiAoXG4gICAgPFNwYWNpbmdzLlN0YWNrIHNjYWxlPVwieGxcIj5cbiAgICAgIDxTcGFjaW5ncy5TdGFjayBzY2FsZT1cIm1cIj5cbiAgICAgICAgPFNwYWNpbmdzLklubGluZSBqdXN0aWZ5Q29udGVudD1cInNwYWNlLWJldHdlZW5cIj5cbiAgICAgICAgICA8VGV4dC5Cb2R5IGludGxNZXNzYWdlPXttZXNzYWdlcy5zZWxlY3RDb2x1bW5zVG9FeHBvcnR9IC8+XG4gICAgICAgICAgPExpbmtcbiAgICAgICAgICAgIGlzRXh0ZXJuYWxcbiAgICAgICAgICAgIHRvbmU9XCJzZWNvbmRhcnlcIlxuICAgICAgICAgICAgaW50bE1lc3NhZ2U9e21lc3NhZ2VzLmNvbHVtbkRlZmluaXRpb25zfVxuICAgICAgICAgICAgdG89e0NPTFVNTl9ERUZJTklUSU9OU19VUkxTW3Jlc291cmNlVHlwZV19XG4gICAgICAgICAgLz5cbiAgICAgICAgPC9TcGFjaW5ncy5JbmxpbmU+XG4gICAgICAgIDxHcmlkXG4gICAgICAgICAgZ3JpZEF1dG9GbG93PVwiY29sdW1uXCJcbiAgICAgICAgICBncmlkVGVtcGxhdGVDb2x1bW5zPXtgJHtjdXN0b21Qcm9wZXJ0aWVzLmNvbnN0cmFpbnQ1fSBhdXRvYH1cbiAgICAgICAgPlxuICAgICAgICAgIDxHcmlkLkl0ZW0+XG4gICAgICAgICAgICA8U3R5bGVkQ2FyZExlZnQgaW5zZXRTY2FsZT1cImxcIj5cbiAgICAgICAgICAgICAgPENoZWNrYm94SW5wdXRcbiAgICAgICAgICAgICAgICBpc0luZGV0ZXJtaW5hdGU9e1xuICAgICAgICAgICAgICAgICAgIWFyZUFsbEZpZWxkc0NoZWNrZWQgJiYgaXNBdExlYXN0T25lRmllbGRDaGVja2VkXG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlzQ2hlY2tlZD17YXJlQWxsRmllbGRzQ2hlY2tlZH1cbiAgICAgICAgICAgICAgICBvbkNoYW5nZT17KGUpID0+IHtcbiAgICAgICAgICAgICAgICAgIGZvcm1pay5zZXRGaWVsZFZhbHVlKFxuICAgICAgICAgICAgICAgICAgICAnZmllbGRzJyxcbiAgICAgICAgICAgICAgICAgICAgZm9ybWlrLnZhbHVlcy5maWVsZHMubWFwKChmaWVsZCkgPT4gKHtcbiAgICAgICAgICAgICAgICAgICAgICAuLi5maWVsZCxcbiAgICAgICAgICAgICAgICAgICAgICBpc0NoZWNrZWQ6IGZpZWxkLmlzUmVxdWlyZWQgPyB0cnVlIDogZS50YXJnZXQuY2hlY2tlZCxcbiAgICAgICAgICAgICAgICAgICAgfSkpXG4gICAgICAgICAgICAgICAgICApXG4gICAgICAgICAgICAgICAgfX1cbiAgICAgICAgICAgICAgPlxuICAgICAgICAgICAgICAgIDxUZXh0LkJvZHkgaW50bE1lc3NhZ2U9e21lc3NhZ2VzLmFsbEdlbmVyYWxGaWVsZHN9IC8+XG4gICAgICAgICAgICAgIDwvQ2hlY2tib3hJbnB1dD5cbiAgICAgICAgICAgIDwvU3R5bGVkQ2FyZExlZnQ+XG4gICAgICAgICAgPC9HcmlkLkl0ZW0+XG4gICAgICAgICAgPEdyaWQuSXRlbT5cbiAgICAgICAgICAgIDxTdHlsZWRDYXJkUmlnaHQgaW5zZXRTY2FsZT1cImxcIj5cbiAgICAgICAgICAgICAge2Zvcm1pay52YWx1ZXMuZmllbGRzLm1hcCgoZmllbGQpID0+IChcbiAgICAgICAgICAgICAgICA8Q2hlY2tib3hJbnB1dFxuICAgICAgICAgICAgICAgICAga2V5PXtmaWVsZC5uYW1lfVxuICAgICAgICAgICAgICAgICAgaXNSZWFkT25seT17ZmllbGQuaXNSZXF1aXJlZH1cbiAgICAgICAgICAgICAgICAgIGlzQ2hlY2tlZD17ZmllbGQuaXNDaGVja2VkfVxuICAgICAgICAgICAgICAgICAgb25DaGFuZ2U9eyhlKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgIGZvcm1pay5zZXRGaWVsZFZhbHVlKFxuICAgICAgICAgICAgICAgICAgICAgICdmaWVsZHMnLFxuICAgICAgICAgICAgICAgICAgICAgIGZvcm1pay52YWx1ZXMuZmllbGRzLm1hcCgoX2ZpZWxkKSA9PlxuICAgICAgICAgICAgICAgICAgICAgICAgZmllbGQubmFtZSA9PT0gX2ZpZWxkLm5hbWVcbiAgICAgICAgICAgICAgICAgICAgICAgICAgPyB7IC4uLl9maWVsZCwgaXNDaGVja2VkOiBlLnRhcmdldC5jaGVja2VkIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgOiBfZmllbGRcbiAgICAgICAgICAgICAgICAgICAgICApXG4gICAgICAgICAgICAgICAgICAgIClcbiAgICAgICAgICAgICAgICAgIH19XG4gICAgICAgICAgICAgICAgPlxuICAgICAgICAgICAgICAgICAgPFRleHQuQm9keT5cbiAgICAgICAgICAgICAgICAgICAge2ZpZWxkLmxhYmVsfSB7ZmllbGQuaXNSZXF1aXJlZCAmJiAnKid9XG4gICAgICAgICAgICAgICAgICA8L1RleHQuQm9keT5cbiAgICAgICAgICAgICAgICA8L0NoZWNrYm94SW5wdXQ+XG4gICAgICAgICAgICAgICkpfVxuICAgICAgICAgICAgPC9TdHlsZWRDYXJkUmlnaHQ+XG4gICAgICAgICAgPC9HcmlkLkl0ZW0+XG4gICAgICAgIDwvR3JpZD5cbiAgICAgIDwvU3BhY2luZ3MuU3RhY2s+XG4gICAgICA8U3BhY2luZ3MuSW5saW5lIHNjYWxlPVwibVwiIGp1c3RpZnlDb250ZW50PVwiZmxleC1lbmRcIj5cbiAgICAgICAgPFNlY29uZGFyeUJ1dHRvblxuICAgICAgICAgIGxhYmVsPXtpbnRsLmZvcm1hdE1lc3NhZ2UobWVzc2FnZXMuYmFjayl9XG4gICAgICAgICAgb25DbGljaz17KCkgPT4gc2V0Q3VycmVudFN0ZXAoMSl9XG4gICAgICAgIC8+XG4gICAgICAgIDxQcmltYXJ5QnV0dG9uXG4gICAgICAgICAgbGFiZWw9e2ludGwuZm9ybWF0TWVzc2FnZShtZXNzYWdlcy5zdGFydEV4cG9ydCl9XG4gICAgICAgICAgb25DbGljaz17Zm9ybWlrLnN1Ym1pdEZvcm19XG4gICAgICAgICAgaXNEaXNhYmxlZD17IWZvcm1pay5pc1ZhbGlkfVxuICAgICAgICAvPlxuICAgICAgPC9TcGFjaW5ncy5JbmxpbmU+XG4gICAgPC9TcGFjaW5ncy5TdGFjaz5cbiAgKVxufVxuIl19 */",
|
|
842
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
843
|
+
});
|
|
844
|
+
const StyledCardRight = /*#__PURE__*/_styled__default["default"](StyledCard, process.env.NODE_ENV === "production" ? {
|
|
845
|
+
target: "e1ocu3bb0"
|
|
846
|
+
} : {
|
|
847
|
+
target: "e1ocu3bb0",
|
|
848
|
+
label: "StyledCardRight"
|
|
849
|
+
})(process.env.NODE_ENV === "production" ? {
|
|
850
|
+
name: "1oktwfs",
|
|
851
|
+
styles: "border-radius:0px 4px 4px 0px;border-left:0"
|
|
852
|
+
} : {
|
|
853
|
+
name: "1oktwfs",
|
|
854
|
+
styles: "border-radius:0px 4px 4px 0px;border-left:0",
|
|
855
|
+
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImV4cG9ydC1maWVsZHMtc2VsZWN0aW9uLXN0ZXAuanN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQTZCMEMiLCJmaWxlIjoiZXhwb3J0LWZpZWxkcy1zZWxlY3Rpb24tc3RlcC5qc3giLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgUmVhY3QgZnJvbSAncmVhY3QnXG5pbXBvcnQgeyB1c2VJbnRsIH0gZnJvbSAncmVhY3QtaW50bCdcbmltcG9ydCBzdHlsZWQgZnJvbSAnQGVtb3Rpb24vc3R5bGVkJ1xuaW1wb3J0IHtcbiAgQ2FyZCxcbiAgQ2hlY2tib3hJbnB1dCxcbiAgR3JpZCxcbiAgTGluayxcbiAgUHJpbWFyeUJ1dHRvbixcbiAgU2Vjb25kYXJ5QnV0dG9uLFxuICBTcGFjaW5ncyxcbiAgVGV4dCxcbiAgY3VzdG9tUHJvcGVydGllcyxcbn0gZnJvbSAnQGNvbW1lcmNldG9vbHMtZnJvbnRlbmQvdWkta2l0J1xuaW1wb3J0IG1lc3NhZ2VzIGZyb20gJy4uL21lc3NhZ2VzJ1xuaW1wb3J0IHsgdXNlRXhwb3J0UmVzb3VyY2VzQ29udGV4dCB9IGZyb20gJy4uL0Bob29rcydcbmltcG9ydCB7IENPTFVNTl9ERUZJTklUSU9OU19VUkxTIH0gZnJvbSAnLi4vQGNvbnN0YW50cydcblxuLy8gVE9ETzogUmVtb3ZlIHRoZXNlIHN0eWxlZCBjb21wb25lbnRzIGFzIGl0J3Mgbm90IGEgcmVjb21tZW5kZWQgcHJhY3RpY2UgdG8gdXNlIHRoZW0uIFdlIHNob3VsZCBhbGlnbiB3aXRoIE1DIFVJIEtpdC9wYXR0ZXJucyBpbiB0ZXJtcyBvZiBzdHlsaW5nICh0byBiZSBkaXNjdXNzZWQgd2l0aCB0aGUgVUkvVVgpLlxuY29uc3QgU3R5bGVkQ2FyZCA9IHN0eWxlZChDYXJkKWBcbiAgYm9yZGVyLXJhZGl1czogNHB4IDBweCAwcHggNHB4O1xuICAmID4gZGl2IHtcbiAgICBoZWlnaHQ6IDQ5MHB4O1xuICAgIG92ZXJmbG93LXk6IGF1dG87XG4gIH1cbmBcbmNvbnN0IFN0eWxlZENhcmRMZWZ0ID0gc3R5bGVkKFN0eWxlZENhcmQpYFxuICBiYWNrZ3JvdW5kLWNvbG9yOiAjZjlmOWZiO1xuYFxuY29uc3QgU3R5bGVkQ2FyZFJpZ2h0ID0gc3R5bGVkKFN0eWxlZENhcmQpYFxuICBib3JkZXItcmFkaXVzOiAwcHggNHB4IDRweCAwcHg7XG4gIGJvcmRlci1sZWZ0OiAwO1xuYFxuXG5leHBvcnQgY29uc3QgRXhwb3J0RmllbGRzU2VsZWN0aW9uU3RlcCA9ICgpID0+IHtcbiAgY29uc3QgaW50bCA9IHVzZUludGwoKVxuICBjb25zdCB7IGZvcm1paywgc2V0Q3VycmVudFN0ZXAsIHJlc291cmNlVHlwZSB9ID0gdXNlRXhwb3J0UmVzb3VyY2VzQ29udGV4dCgpXG4gIGNvbnN0IGFyZUFsbEZpZWxkc0NoZWNrZWQgPSBmb3JtaWsudmFsdWVzLmZpZWxkcy5ldmVyeShcbiAgICAoZmllbGQpID0+IGZpZWxkLmlzQ2hlY2tlZFxuICApXG4gIGNvbnN0IGlzQXRMZWFzdE9uZUZpZWxkQ2hlY2tlZCA9IGZvcm1pay52YWx1ZXMuZmllbGRzLnNvbWUoXG4gICAgKGZpZWxkKSA9PiBmaWVsZC5pc0NoZWNrZWRcbiAgKVxuXG4gIHJldHVybiAoXG4gICAgPFNwYWNpbmdzLlN0YWNrIHNjYWxlPVwieGxcIj5cbiAgICAgIDxTcGFjaW5ncy5TdGFjayBzY2FsZT1cIm1cIj5cbiAgICAgICAgPFNwYWNpbmdzLklubGluZSBqdXN0aWZ5Q29udGVudD1cInNwYWNlLWJldHdlZW5cIj5cbiAgICAgICAgICA8VGV4dC5Cb2R5IGludGxNZXNzYWdlPXttZXNzYWdlcy5zZWxlY3RDb2x1bW5zVG9FeHBvcnR9IC8+XG4gICAgICAgICAgPExpbmtcbiAgICAgICAgICAgIGlzRXh0ZXJuYWxcbiAgICAgICAgICAgIHRvbmU9XCJzZWNvbmRhcnlcIlxuICAgICAgICAgICAgaW50bE1lc3NhZ2U9e21lc3NhZ2VzLmNvbHVtbkRlZmluaXRpb25zfVxuICAgICAgICAgICAgdG89e0NPTFVNTl9ERUZJTklUSU9OU19VUkxTW3Jlc291cmNlVHlwZV19XG4gICAgICAgICAgLz5cbiAgICAgICAgPC9TcGFjaW5ncy5JbmxpbmU+XG4gICAgICAgIDxHcmlkXG4gICAgICAgICAgZ3JpZEF1dG9GbG93PVwiY29sdW1uXCJcbiAgICAgICAgICBncmlkVGVtcGxhdGVDb2x1bW5zPXtgJHtjdXN0b21Qcm9wZXJ0aWVzLmNvbnN0cmFpbnQ1fSBhdXRvYH1cbiAgICAgICAgPlxuICAgICAgICAgIDxHcmlkLkl0ZW0+XG4gICAgICAgICAgICA8U3R5bGVkQ2FyZExlZnQgaW5zZXRTY2FsZT1cImxcIj5cbiAgICAgICAgICAgICAgPENoZWNrYm94SW5wdXRcbiAgICAgICAgICAgICAgICBpc0luZGV0ZXJtaW5hdGU9e1xuICAgICAgICAgICAgICAgICAgIWFyZUFsbEZpZWxkc0NoZWNrZWQgJiYgaXNBdExlYXN0T25lRmllbGRDaGVja2VkXG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlzQ2hlY2tlZD17YXJlQWxsRmllbGRzQ2hlY2tlZH1cbiAgICAgICAgICAgICAgICBvbkNoYW5nZT17KGUpID0+IHtcbiAgICAgICAgICAgICAgICAgIGZvcm1pay5zZXRGaWVsZFZhbHVlKFxuICAgICAgICAgICAgICAgICAgICAnZmllbGRzJyxcbiAgICAgICAgICAgICAgICAgICAgZm9ybWlrLnZhbHVlcy5maWVsZHMubWFwKChmaWVsZCkgPT4gKHtcbiAgICAgICAgICAgICAgICAgICAgICAuLi5maWVsZCxcbiAgICAgICAgICAgICAgICAgICAgICBpc0NoZWNrZWQ6IGZpZWxkLmlzUmVxdWlyZWQgPyB0cnVlIDogZS50YXJnZXQuY2hlY2tlZCxcbiAgICAgICAgICAgICAgICAgICAgfSkpXG4gICAgICAgICAgICAgICAgICApXG4gICAgICAgICAgICAgICAgfX1cbiAgICAgICAgICAgICAgPlxuICAgICAgICAgICAgICAgIDxUZXh0LkJvZHkgaW50bE1lc3NhZ2U9e21lc3NhZ2VzLmFsbEdlbmVyYWxGaWVsZHN9IC8+XG4gICAgICAgICAgICAgIDwvQ2hlY2tib3hJbnB1dD5cbiAgICAgICAgICAgIDwvU3R5bGVkQ2FyZExlZnQ+XG4gICAgICAgICAgPC9HcmlkLkl0ZW0+XG4gICAgICAgICAgPEdyaWQuSXRlbT5cbiAgICAgICAgICAgIDxTdHlsZWRDYXJkUmlnaHQgaW5zZXRTY2FsZT1cImxcIj5cbiAgICAgICAgICAgICAge2Zvcm1pay52YWx1ZXMuZmllbGRzLm1hcCgoZmllbGQpID0+IChcbiAgICAgICAgICAgICAgICA8Q2hlY2tib3hJbnB1dFxuICAgICAgICAgICAgICAgICAga2V5PXtmaWVsZC5uYW1lfVxuICAgICAgICAgICAgICAgICAgaXNSZWFkT25seT17ZmllbGQuaXNSZXF1aXJlZH1cbiAgICAgICAgICAgICAgICAgIGlzQ2hlY2tlZD17ZmllbGQuaXNDaGVja2VkfVxuICAgICAgICAgICAgICAgICAgb25DaGFuZ2U9eyhlKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgIGZvcm1pay5zZXRGaWVsZFZhbHVlKFxuICAgICAgICAgICAgICAgICAgICAgICdmaWVsZHMnLFxuICAgICAgICAgICAgICAgICAgICAgIGZvcm1pay52YWx1ZXMuZmllbGRzLm1hcCgoX2ZpZWxkKSA9PlxuICAgICAgICAgICAgICAgICAgICAgICAgZmllbGQubmFtZSA9PT0gX2ZpZWxkLm5hbWVcbiAgICAgICAgICAgICAgICAgICAgICAgICAgPyB7IC4uLl9maWVsZCwgaXNDaGVja2VkOiBlLnRhcmdldC5jaGVja2VkIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgOiBfZmllbGRcbiAgICAgICAgICAgICAgICAgICAgICApXG4gICAgICAgICAgICAgICAgICAgIClcbiAgICAgICAgICAgICAgICAgIH19XG4gICAgICAgICAgICAgICAgPlxuICAgICAgICAgICAgICAgICAgPFRleHQuQm9keT5cbiAgICAgICAgICAgICAgICAgICAge2ZpZWxkLmxhYmVsfSB7ZmllbGQuaXNSZXF1aXJlZCAmJiAnKid9XG4gICAgICAgICAgICAgICAgICA8L1RleHQuQm9keT5cbiAgICAgICAgICAgICAgICA8L0NoZWNrYm94SW5wdXQ+XG4gICAgICAgICAgICAgICkpfVxuICAgICAgICAgICAgPC9TdHlsZWRDYXJkUmlnaHQ+XG4gICAgICAgICAgPC9HcmlkLkl0ZW0+XG4gICAgICAgIDwvR3JpZD5cbiAgICAgIDwvU3BhY2luZ3MuU3RhY2s+XG4gICAgICA8U3BhY2luZ3MuSW5saW5lIHNjYWxlPVwibVwiIGp1c3RpZnlDb250ZW50PVwiZmxleC1lbmRcIj5cbiAgICAgICAgPFNlY29uZGFyeUJ1dHRvblxuICAgICAgICAgIGxhYmVsPXtpbnRsLmZvcm1hdE1lc3NhZ2UobWVzc2FnZXMuYmFjayl9XG4gICAgICAgICAgb25DbGljaz17KCkgPT4gc2V0Q3VycmVudFN0ZXAoMSl9XG4gICAgICAgIC8+XG4gICAgICAgIDxQcmltYXJ5QnV0dG9uXG4gICAgICAgICAgbGFiZWw9e2ludGwuZm9ybWF0TWVzc2FnZShtZXNzYWdlcy5zdGFydEV4cG9ydCl9XG4gICAgICAgICAgb25DbGljaz17Zm9ybWlrLnN1Ym1pdEZvcm19XG4gICAgICAgICAgaXNEaXNhYmxlZD17IWZvcm1pay5pc1ZhbGlkfVxuICAgICAgICAvPlxuICAgICAgPC9TcGFjaW5ncy5JbmxpbmU+XG4gICAgPC9TcGFjaW5ncy5TdGFjaz5cbiAgKVxufVxuIl19 */",
|
|
856
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
857
|
+
});
|
|
858
|
+
const ExportFieldsSelectionStep = () => {
|
|
859
|
+
var _context, _context2, _context4;
|
|
860
|
+
const intl = reactIntl.useIntl();
|
|
861
|
+
const _useExportResourcesCo = useExportResourcesContext(),
|
|
862
|
+
formik = _useExportResourcesCo.formik,
|
|
863
|
+
setCurrentStep = _useExportResourcesCo.setCurrentStep,
|
|
864
|
+
resourceType = _useExportResourcesCo.resourceType;
|
|
865
|
+
const areAllFieldsChecked = _everyInstanceProperty__default["default"](_context = _valuesInstanceProperty__default["default"](formik).fields).call(_context, field => field.isChecked);
|
|
866
|
+
const isAtLeastOneFieldChecked = _someInstanceProperty__default["default"](_context2 = _valuesInstanceProperty__default["default"](formik).fields).call(_context2, field => field.isChecked);
|
|
720
867
|
return jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
721
|
-
scale: "
|
|
722
|
-
children: [jsxRuntime.jsxs(uiKit.Spacings.
|
|
723
|
-
scale: "
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
868
|
+
scale: "xl",
|
|
869
|
+
children: [jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
870
|
+
scale: "m",
|
|
871
|
+
children: [jsxRuntime.jsxs(uiKit.Spacings.Inline, {
|
|
872
|
+
justifyContent: "space-between",
|
|
873
|
+
children: [jsxRuntime.jsx(uiKit.Text.Body, {
|
|
874
|
+
intlMessage: messages.selectColumnsToExport
|
|
875
|
+
}), jsxRuntime.jsx(uiKit.Link, {
|
|
876
|
+
isExternal: true,
|
|
877
|
+
tone: "secondary",
|
|
878
|
+
intlMessage: messages.columnDefinitions,
|
|
879
|
+
to: COLUMN_DEFINITIONS_URLS[resourceType]
|
|
880
|
+
})]
|
|
881
|
+
}), jsxRuntime.jsxs(uiKit.Grid, {
|
|
882
|
+
gridAutoFlow: "column",
|
|
883
|
+
gridTemplateColumns: "".concat(uiKit.customProperties.constraint5, " auto"),
|
|
884
|
+
children: [jsxRuntime.jsx(uiKit.Grid.Item, {
|
|
885
|
+
children: jsxRuntime.jsx(StyledCardLeft, {
|
|
886
|
+
insetScale: "l",
|
|
887
|
+
children: jsxRuntime.jsx(uiKit.CheckboxInput, {
|
|
888
|
+
isIndeterminate: !areAllFieldsChecked && isAtLeastOneFieldChecked,
|
|
889
|
+
isChecked: areAllFieldsChecked,
|
|
890
|
+
onChange: e => {
|
|
891
|
+
var _context3;
|
|
892
|
+
formik.setFieldValue('fields', _mapInstanceProperty__default["default"](_context3 = _valuesInstanceProperty__default["default"](formik).fields).call(_context3, field => _objectSpread$2(_objectSpread$2({}, field), {}, {
|
|
893
|
+
isChecked: field.isRequired ? true : e.target.checked
|
|
894
|
+
})));
|
|
895
|
+
},
|
|
896
|
+
children: jsxRuntime.jsx(uiKit.Text.Body, {
|
|
897
|
+
intlMessage: messages.allGeneralFields
|
|
898
|
+
})
|
|
899
|
+
})
|
|
900
|
+
})
|
|
901
|
+
}), jsxRuntime.jsx(uiKit.Grid.Item, {
|
|
902
|
+
children: jsxRuntime.jsx(StyledCardRight, {
|
|
903
|
+
insetScale: "l",
|
|
904
|
+
children: _mapInstanceProperty__default["default"](_context4 = _valuesInstanceProperty__default["default"](formik).fields).call(_context4, field => jsxRuntime.jsx(uiKit.CheckboxInput, {
|
|
905
|
+
isReadOnly: field.isRequired,
|
|
906
|
+
isChecked: field.isChecked,
|
|
907
|
+
onChange: e => {
|
|
908
|
+
var _context5;
|
|
909
|
+
formik.setFieldValue('fields', _mapInstanceProperty__default["default"](_context5 = _valuesInstanceProperty__default["default"](formik).fields).call(_context5, _field => field.name === _field.name ? _objectSpread$2(_objectSpread$2({}, _field), {}, {
|
|
910
|
+
isChecked: e.target.checked
|
|
911
|
+
}) : _field));
|
|
912
|
+
},
|
|
913
|
+
children: jsxRuntime.jsxs(uiKit.Text.Body, {
|
|
914
|
+
children: [field.label, " ", field.isRequired && '*']
|
|
915
|
+
})
|
|
916
|
+
}, field.name))
|
|
917
|
+
})
|
|
918
|
+
})]
|
|
736
919
|
})]
|
|
737
920
|
}), jsxRuntime.jsxs(uiKit.Spacings.Inline, {
|
|
738
|
-
scale: "
|
|
739
|
-
|
|
740
|
-
children: [jsxRuntime.jsx(
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
appliedSearchTerms: PropTypes__default["default"].array.isRequired
|
|
748
|
-
} : {};
|
|
749
|
-
|
|
750
|
-
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; }
|
|
751
|
-
|
|
752
|
-
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__default["default"](_context = ownKeys$6(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$6(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
753
|
-
function Columns(_ref) {
|
|
754
|
-
var columns = _ref.columns;
|
|
755
|
-
return jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
756
|
-
scale: "s",
|
|
757
|
-
children: [jsxRuntime.jsxs(uiKit.Spacings.Inline, {
|
|
758
|
-
scale: "s",
|
|
759
|
-
alignItems: "flex-start",
|
|
760
|
-
children: [jsxRuntime.jsx(uiKit.AngleRightIcon, {
|
|
761
|
-
"data-testid": "test-arrowRight",
|
|
762
|
-
size: "medium",
|
|
763
|
-
color: "neutral60"
|
|
764
|
-
}), jsxRuntime.jsx(uiKit.Text.Body, {
|
|
765
|
-
intlMessage: _objectSpread$6(_objectSpread$6({}, messages.columnsMessage), {}, {
|
|
766
|
-
values: {
|
|
767
|
-
columnsCount: columns.length,
|
|
768
|
-
b: getBold
|
|
769
|
-
}
|
|
770
|
-
})
|
|
771
|
-
})]
|
|
772
|
-
}), jsxRuntime.jsx(TagList, {
|
|
773
|
-
children: _mapInstanceProperty__default["default"](columns).call(columns, function (column) {
|
|
774
|
-
return jsxRuntime.jsx("div", {
|
|
775
|
-
"data-testid": "test-column-".concat(column.exportLabel),
|
|
776
|
-
children: jsxRuntime.jsx(uiKit.Tag, {
|
|
777
|
-
children: column.key
|
|
778
|
-
})
|
|
779
|
-
}, column.exportLabel);
|
|
780
|
-
})
|
|
781
|
-
})]
|
|
782
|
-
});
|
|
783
|
-
}
|
|
784
|
-
Columns.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
785
|
-
columns: PropTypes__default["default"].arrayOf({
|
|
786
|
-
key: PropTypes__default["default"].string.isRequired,
|
|
787
|
-
isLocalised: PropTypes__default["default"].bool
|
|
788
|
-
}).isRequired
|
|
789
|
-
} : {};
|
|
790
|
-
|
|
791
|
-
var ExportSelection = function ExportSelection() {
|
|
792
|
-
var _useExportResourcesCo = useExportResourcesContext(),
|
|
793
|
-
formik = _useExportResourcesCo.formik;
|
|
794
|
-
|
|
795
|
-
var onAppliedFilterRemove = function onAppliedFilterRemove(filter) {
|
|
796
|
-
var _context;
|
|
797
|
-
|
|
798
|
-
formik.setFieldValue('appliedFilters', _filterInstanceProperty__default["default"](_context = _valuesInstanceProperty__default["default"](formik).appliedFilters).call(_context, function (appliedFilter) {
|
|
799
|
-
return appliedFilter !== filter;
|
|
800
|
-
}));
|
|
801
|
-
};
|
|
802
|
-
|
|
803
|
-
return jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
804
|
-
scale: "s",
|
|
805
|
-
children: [jsxRuntime.jsx(uiKit.Text.Body, {
|
|
806
|
-
isBold: true,
|
|
807
|
-
intlMessage: messages.exportSelection
|
|
808
|
-
}), jsxRuntime.jsxs(uiKit.Card, {
|
|
809
|
-
theme: "dark",
|
|
810
|
-
type: "raised",
|
|
811
|
-
insetScale: "none",
|
|
812
|
-
children: [jsxRuntime.jsx(uiKit.Spacings.Inset, {
|
|
813
|
-
scale: "m",
|
|
814
|
-
children: jsxRuntime.jsx(ExportSelectionRadioButtons, {})
|
|
815
|
-
}), jsxRuntime.jsx("div", {
|
|
816
|
-
css: styles.divider
|
|
817
|
-
}), jsxRuntime.jsx(uiKit.Spacings.Inset, {
|
|
818
|
-
scale: "m",
|
|
819
|
-
children: jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
820
|
-
scale: "l",
|
|
821
|
-
children: [jsxRuntime.jsx(ExportTextMessage, {}), _valuesInstanceProperty__default["default"](formik).exportSelectionType === EXPORT_SELECTION_TYPES.ONLY_MATCHING && jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
822
|
-
children: [jsxRuntime.jsx(ExportBasedOnMyViewsSelectField, {}), jsxRuntime.jsx(AppliedSearchTerms, {
|
|
823
|
-
appliedSearchTerms: _valuesInstanceProperty__default["default"](formik).appliedSearchTerms
|
|
824
|
-
}), jsxRuntime.jsx(AppliedFilters, {
|
|
825
|
-
filters: _valuesInstanceProperty__default["default"](formik).appliedFilters,
|
|
826
|
-
onFilterRemove: onAppliedFilterRemove
|
|
827
|
-
})]
|
|
828
|
-
}), _valuesInstanceProperty__default["default"](formik).columns.length > 0 && jsxRuntime.jsx(Columns, {
|
|
829
|
-
columns: _valuesInstanceProperty__default["default"](formik).columns
|
|
830
|
-
})]
|
|
831
|
-
})
|
|
921
|
+
scale: "m",
|
|
922
|
+
justifyContent: "flex-end",
|
|
923
|
+
children: [jsxRuntime.jsx(uiKit.SecondaryButton, {
|
|
924
|
+
label: intl.formatMessage(messages.back),
|
|
925
|
+
onClick: () => setCurrentStep(1)
|
|
926
|
+
}), jsxRuntime.jsx(uiKit.PrimaryButton, {
|
|
927
|
+
label: intl.formatMessage(messages.startExport),
|
|
928
|
+
onClick: formik.submitForm,
|
|
929
|
+
isDisabled: !formik.isValid
|
|
832
930
|
})]
|
|
833
931
|
})]
|
|
834
932
|
});
|
|
835
933
|
};
|
|
836
934
|
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
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; }
|
|
840
|
-
var ExportPropertiesPanel = function ExportPropertiesPanel(props) {
|
|
841
|
-
if (typeof props.renderProperties !== 'function') return null;
|
|
842
|
-
return jsxRuntime.jsx(uiKit.CollapsiblePanel, {
|
|
843
|
-
header: jsxRuntime.jsx(uiKit.Text.Body, {
|
|
844
|
-
isBold: true,
|
|
845
|
-
intlMessage: _objectSpread$5({}, messages.propertiesPanelLabel)
|
|
846
|
-
}),
|
|
847
|
-
children: props.renderProperties()
|
|
848
|
-
});
|
|
849
|
-
};
|
|
850
|
-
ExportPropertiesPanel.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
935
|
+
process.env.NODE_ENV !== "production" ? {
|
|
851
936
|
renderProperties: PropTypes__default["default"].func
|
|
852
937
|
} : {};
|
|
853
938
|
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
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; }
|
|
857
|
-
function renderFileNameError(key) {
|
|
858
|
-
switch (key) {
|
|
859
|
-
case 'missing':
|
|
860
|
-
return jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$4({}, messages.missingFileNameError));
|
|
861
|
-
|
|
862
|
-
case 'invalidInput':
|
|
863
|
-
return jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$4({}, messages.invalidFileNameError));
|
|
864
|
-
|
|
865
|
-
default:
|
|
866
|
-
return null;
|
|
867
|
-
}
|
|
868
|
-
}
|
|
869
|
-
function renderLanguageError(key) {
|
|
870
|
-
switch (key) {
|
|
871
|
-
case 'missing':
|
|
872
|
-
return jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$4({}, messages.missingLanguageError));
|
|
873
|
-
|
|
874
|
-
default:
|
|
875
|
-
return null;
|
|
876
|
-
}
|
|
877
|
-
}
|
|
878
|
-
|
|
879
|
-
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; }
|
|
880
|
-
|
|
881
|
-
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; }
|
|
882
|
-
var outputFormatOptions = [{
|
|
883
|
-
value: OUTPUT_FORMATS.JSON,
|
|
884
|
-
label: 'JSON'
|
|
885
|
-
}, {
|
|
886
|
-
value: OUTPUT_FORMATS.CSV,
|
|
887
|
-
label: 'CSV'
|
|
888
|
-
}];
|
|
889
|
-
|
|
890
|
-
function mapLanguagesToOptions(languages) {
|
|
891
|
-
return _mapInstanceProperty__default["default"](languages).call(languages, function (language) {
|
|
892
|
-
return {
|
|
893
|
-
value: language,
|
|
894
|
-
label: language
|
|
895
|
-
};
|
|
896
|
-
});
|
|
897
|
-
}
|
|
898
|
-
|
|
899
|
-
function ExportFileSettings(props) {
|
|
900
|
-
var intl = reactIntl.useIntl();
|
|
939
|
+
const ExportResourcesContext = /*#__PURE__*/React.createContext();
|
|
901
940
|
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
options: outputFormatOptions,
|
|
923
|
-
horizontalConstraint: 7
|
|
924
|
-
})), jsxRuntime.jsx(uiKit.TextField, _objectSpread$3(_objectSpread$3({
|
|
925
|
-
title: intl.formatMessage(messages.fileName)
|
|
926
|
-
}, formik.getFieldProps('fileName')), {}, {
|
|
927
|
-
touched: formik.touched.fileName,
|
|
928
|
-
errors: formik.errors.fileName,
|
|
929
|
-
renderError: renderFileNameError,
|
|
930
|
-
horizontalConstraint: 7
|
|
931
|
-
}))]
|
|
932
|
-
}), jsxRuntime.jsx(uiKit.Spacings.Inline, {
|
|
933
|
-
children: jsxRuntime.jsx(uiKit.SelectField, _objectSpread$3(_objectSpread$3({
|
|
934
|
-
id: "languages",
|
|
935
|
-
title: jsxRuntime.jsxs(uiKit.Spacings.Inline, {
|
|
936
|
-
scale: "s",
|
|
937
|
-
children: [jsxRuntime.jsx("label", {
|
|
938
|
-
htmlFor: "languages",
|
|
939
|
-
children: intl.formatMessage(messages.localLanguage)
|
|
940
|
-
}), jsxRuntime.jsx(uiKit.CheckboxInput, {
|
|
941
|
-
name: "isAllLanguagesChecked",
|
|
942
|
-
isChecked: _valuesInstanceProperty__default["default"](formik).isAllLanguagesChecked,
|
|
943
|
-
onChange: function onChange(e) {
|
|
944
|
-
if (e.target.checked) formik.setFieldValue('languages', languages);else formik.setFieldValue('languages', [language]);
|
|
945
|
-
formik.handleChange(e);
|
|
946
|
-
},
|
|
947
|
-
children: jsxRuntime.jsx("div", {
|
|
948
|
-
css: styles.notBold,
|
|
949
|
-
children: intl.formatMessage(messages.all)
|
|
950
|
-
})
|
|
951
|
-
})]
|
|
952
|
-
}),
|
|
953
|
-
options: mapLanguagesToOptions(languages),
|
|
954
|
-
isMulti: true
|
|
955
|
-
}, formik.getFieldProps('languages')), {}, {
|
|
956
|
-
onChange: function onChange(e) {
|
|
957
|
-
formik.handleChange(e);
|
|
958
|
-
formik.setFieldValue('isAllLanguagesChecked', false);
|
|
959
|
-
},
|
|
960
|
-
touched: formik.touched.languages,
|
|
961
|
-
errors: formik.errors.languages,
|
|
962
|
-
renderError: renderLanguageError,
|
|
963
|
-
horizontalConstraint: 7
|
|
964
|
-
}))
|
|
965
|
-
}), jsxRuntime.jsx(ExportSelection, {}), jsxRuntime.jsx(ExportPropertiesPanel, {
|
|
966
|
-
renderProperties: props.renderProperties
|
|
967
|
-
})]
|
|
968
|
-
});
|
|
969
|
-
}
|
|
970
|
-
ExportFileSettings.displayName = 'ExportFileSettings';
|
|
971
|
-
ExportFileSettings.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
941
|
+
const ExportResourcesModalShape = PropTypes__default["default"].shape({
|
|
942
|
+
resourceType: PropTypes__default["default"].string.isRequired,
|
|
943
|
+
outputFormat: PropTypes__default["default"].string,
|
|
944
|
+
onClose: PropTypes__default["default"].func,
|
|
945
|
+
totalResourcesCount: PropTypes__default["default"].number.isRequired,
|
|
946
|
+
selectedResourceIds: PropTypes__default["default"].array,
|
|
947
|
+
// TODO: Circular reference
|
|
948
|
+
fields: PropTypes__default["default"].arrayOf(PropTypes__default["default"].shape({
|
|
949
|
+
name: PropTypes__default["default"].string.isRequired,
|
|
950
|
+
label: PropTypes__default["default"].string,
|
|
951
|
+
isLocalized: PropTypes__default["default"].bool,
|
|
952
|
+
fields: PropTypes__default["default"].arrayOf(PropTypes__default["default"].shape({
|
|
953
|
+
name: PropTypes__default["default"].string.isRequired,
|
|
954
|
+
label: PropTypes__default["default"].string,
|
|
955
|
+
isLocalized: PropTypes__default["default"].bool,
|
|
956
|
+
isSelectedByDefault: PropTypes__default["default"].bool,
|
|
957
|
+
isRequired: PropTypes__default["default"].bool
|
|
958
|
+
}))
|
|
959
|
+
})).isRequired,
|
|
960
|
+
exportType: PropTypes__default["default"].string,
|
|
972
961
|
renderProperties: PropTypes__default["default"].func
|
|
973
|
-
}
|
|
974
|
-
|
|
975
|
-
function
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
// FIXME: EXPORT is undefined
|
|
991
|
-
mcApiProxyTarget: constants.MC_API_PROXY_TARGETS.EXPORT,
|
|
992
|
-
uri: uri,
|
|
993
|
-
headers: {
|
|
994
|
-
accept: 'application/json'
|
|
995
|
-
},
|
|
996
|
-
payload: {
|
|
997
|
-
query: graphQuery
|
|
998
|
-
}
|
|
999
|
-
}));
|
|
1000
|
-
|
|
1001
|
-
case 4:
|
|
1002
|
-
response = _context.sent;
|
|
1003
|
-
return _context.abrupt("return", response);
|
|
1004
|
-
|
|
1005
|
-
case 6:
|
|
1006
|
-
case "end":
|
|
1007
|
-
return _context.stop();
|
|
1008
|
-
}
|
|
1009
|
-
}
|
|
1010
|
-
}, _callee);
|
|
1011
|
-
}));
|
|
1012
|
-
return _createExportOperation.apply(this, arguments);
|
|
1013
|
-
}
|
|
1014
|
-
|
|
1015
|
-
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; }
|
|
1016
|
-
|
|
1017
|
-
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; }
|
|
1018
|
-
function ExportConfirmationModal(props) {
|
|
1019
|
-
var _useApplicationContex = applicationShellConnectors.useApplicationContext(function (applicationContext) {
|
|
1020
|
-
return {
|
|
1021
|
-
projectName: applicationContext.project.name,
|
|
1022
|
-
projectKey: applicationContext.project.key
|
|
1023
|
-
};
|
|
1024
|
-
}),
|
|
1025
|
-
projectName = _useApplicationContex.projectName,
|
|
1026
|
-
projectKey = _useApplicationContex.projectKey;
|
|
1027
|
-
|
|
1028
|
-
var _useExportResourcesCo = useExportResourcesContext(),
|
|
1029
|
-
formik = _useExportResourcesCo.formik,
|
|
1030
|
-
allResourcesCount = _useExportResourcesCo.allResourcesCount,
|
|
1031
|
-
matchingResourcesCount = _useExportResourcesCo.matchingResourcesCount,
|
|
1032
|
-
selectedResourceIds = _useExportResourcesCo.selectedResourceIds,
|
|
1033
|
-
resourceType = _useExportResourcesCo.resourceType,
|
|
1034
|
-
setExportOperationStarted = _useExportResourcesCo.setExportOperationStarted;
|
|
1035
|
-
|
|
1036
|
-
var intl = reactIntl.useIntl();
|
|
1037
|
-
var asyncDispatch = sdk.useAsyncDispatch();
|
|
1038
|
-
var resourceTypePlural = resourceTypeToPlural({
|
|
1039
|
-
resourceType: props.resourceType
|
|
1040
|
-
});
|
|
1041
|
-
|
|
1042
|
-
var countInConfirmationMessage = function countInConfirmationMessage() {
|
|
1043
|
-
switch (_valuesInstanceProperty__default["default"](formik).exportSelectionType) {
|
|
1044
|
-
case EXPORT_SELECTION_TYPES.ALL_RESOURCES:
|
|
1045
|
-
return allResourcesCount;
|
|
1046
|
-
|
|
1047
|
-
case EXPORT_SELECTION_TYPES.ONLY_MATCHING:
|
|
1048
|
-
return matchingResourcesCount;
|
|
1049
|
-
|
|
1050
|
-
case EXPORT_SELECTION_TYPES.ONLY_SELECTED:
|
|
1051
|
-
return selectedResourceIds.length;
|
|
1052
|
-
|
|
1053
|
-
default:
|
|
1054
|
-
throw new UnexpectedSelectionTypeError(_valuesInstanceProperty__default["default"](formik).exportSelectionType);
|
|
962
|
+
}).isRequired;
|
|
963
|
+
|
|
964
|
+
function ownKeys$1(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
965
|
+
function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$1(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$1(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
966
|
+
const ExportResourcesProvider = props => {
|
|
967
|
+
const _useStartExportOperat = useStartExportOperation(props),
|
|
968
|
+
startExportOperation = _useStartExportOperat.startExportOperation;
|
|
969
|
+
const initialValues = useInitialValues(props);
|
|
970
|
+
const _React$useState = React__default["default"].useState(1),
|
|
971
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
972
|
+
currentStep = _React$useState2[0],
|
|
973
|
+
setCurrentStep = _React$useState2[1];
|
|
974
|
+
const onSubmit = async values => {
|
|
975
|
+
if (currentStep === 1) {
|
|
976
|
+
setCurrentStep(2);
|
|
977
|
+
} else {
|
|
978
|
+
startExportOperation(values);
|
|
1055
979
|
}
|
|
1056
980
|
};
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
title: intl.formatMessage(messages.confirmationTitle, {
|
|
1063
|
-
resourceType: resourceTypePlural
|
|
1064
|
-
}),
|
|
1065
|
-
labelPrimary: intl.formatMessage(messages.exportConfirmationLabel, {
|
|
1066
|
-
resourceType: resourceTypePlural
|
|
981
|
+
const formik$1 = formik.useFormik({
|
|
982
|
+
initialValues,
|
|
983
|
+
validate: values => validate({
|
|
984
|
+
values,
|
|
985
|
+
step: currentStep
|
|
1067
986
|
}),
|
|
1068
|
-
|
|
1069
|
-
onClose: props.closeModal,
|
|
1070
|
-
onCancel: props.closeModal,
|
|
1071
|
-
onConfirm: /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee() {
|
|
1072
|
-
var graphQuery, response;
|
|
1073
|
-
return _regeneratorRuntime__default["default"].wrap(function _callee$(_context) {
|
|
1074
|
-
while (1) {
|
|
1075
|
-
switch (_context.prev = _context.next) {
|
|
1076
|
-
case 0:
|
|
1077
|
-
setExportOperationStarted(false);
|
|
1078
|
-
graphQuery = buildGraphQuery({
|
|
1079
|
-
resourceType: resourceType,
|
|
1080
|
-
selectedResourceIds: selectedResourceIds,
|
|
1081
|
-
columns: _valuesInstanceProperty__default["default"](formik).columns,
|
|
1082
|
-
exportSelectionType: _valuesInstanceProperty__default["default"](formik).exportSelectionType,
|
|
1083
|
-
languages: _valuesInstanceProperty__default["default"](formik).languages
|
|
1084
|
-
});
|
|
1085
|
-
props.closeModal();
|
|
1086
|
-
_context.prev = 3;
|
|
1087
|
-
_context.next = 6;
|
|
1088
|
-
return createExportOperation({
|
|
1089
|
-
projectKey: projectKey,
|
|
1090
|
-
graphQuery: graphQuery,
|
|
1091
|
-
asyncDispatchFn: asyncDispatch
|
|
1092
|
-
});
|
|
1093
|
-
|
|
1094
|
-
case 6:
|
|
1095
|
-
response = _context.sent;
|
|
1096
|
-
_context.t0 = response.state;
|
|
1097
|
-
_context.next = _context.t0 === EXPORT_OPERATION_STATES.PROCESSING ? 10 : _context.t0 === EXPORT_OPERATION_STATES.COMPLETED ? 10 : 12;
|
|
1098
|
-
break;
|
|
1099
|
-
|
|
1100
|
-
case 10:
|
|
1101
|
-
setExportOperationStarted(true);
|
|
1102
|
-
return _context.abrupt("break", 13);
|
|
1103
|
-
|
|
1104
|
-
case 12:
|
|
1105
|
-
throw new UnexpectedExportOperationStateError(response.state);
|
|
1106
|
-
|
|
1107
|
-
case 13:
|
|
1108
|
-
_context.next = 18;
|
|
1109
|
-
break;
|
|
1110
|
-
|
|
1111
|
-
case 15:
|
|
1112
|
-
_context.prev = 15;
|
|
1113
|
-
_context.t1 = _context["catch"](3);
|
|
1114
|
-
actionsGlobal.showApiErrorNotification({
|
|
1115
|
-
errors: _context.t1
|
|
1116
|
-
});
|
|
1117
|
-
|
|
1118
|
-
case 18:
|
|
1119
|
-
case "end":
|
|
1120
|
-
return _context.stop();
|
|
1121
|
-
}
|
|
1122
|
-
}
|
|
1123
|
-
}, _callee, null, [[3, 15]]);
|
|
1124
|
-
})),
|
|
1125
|
-
children: jsxRuntime.jsxs("div", {
|
|
1126
|
-
children: [jsxRuntime.jsx(uiKit.Text.Body, {
|
|
1127
|
-
intlMessage: _objectSpread$2(_objectSpread$2({}, messages.confirmationBodyPlan), {}, {
|
|
1128
|
-
values: {
|
|
1129
|
-
resourceType: resourceTypePlural,
|
|
1130
|
-
projectName: projectName,
|
|
1131
|
-
count: countInConfirmationMessage(),
|
|
1132
|
-
bold: getBold
|
|
1133
|
-
}
|
|
1134
|
-
})
|
|
1135
|
-
}), jsxRuntime.jsx(uiKit.Text.Body, {
|
|
1136
|
-
intlMessage: messages.confirmationBodyQuestion
|
|
1137
|
-
})]
|
|
1138
|
-
})
|
|
987
|
+
onSubmit
|
|
1139
988
|
});
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
children: msg
|
|
989
|
+
React__default["default"].useEffect(() => {
|
|
990
|
+
formik$1.validateForm();
|
|
991
|
+
}, [currentStep]);
|
|
992
|
+
return jsxRuntime.jsx(ExportResourcesContext.Provider, {
|
|
993
|
+
value: {
|
|
994
|
+
currentStep,
|
|
995
|
+
setCurrentStep,
|
|
996
|
+
formik: formik$1,
|
|
997
|
+
resourceType: props.resourceType,
|
|
998
|
+
exportType: props.exportType,
|
|
999
|
+
totalResourcesCount: props.totalResourcesCount,
|
|
1000
|
+
selectedResourceIds: props.selectedResourceIds
|
|
1001
|
+
},
|
|
1002
|
+
children: props.children
|
|
1155
1003
|
});
|
|
1156
1004
|
};
|
|
1005
|
+
ExportResourcesProvider.displayName = 'ExportResourcesProvider';
|
|
1006
|
+
ExportResourcesProvider.propTypes = process.env.NODE_ENV !== "production" ? _objectSpread$1(_objectSpread$1({}, ExportResourcesModalShape), {}, {
|
|
1007
|
+
children: PropTypes__default["default"].node
|
|
1008
|
+
}) : {};
|
|
1157
1009
|
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
if (!isShown) return null;
|
|
1169
|
-
return jsxRuntime.jsx("div", {
|
|
1170
|
-
css: styles.successMessage,
|
|
1171
|
-
"data-testid": "export-started-message",
|
|
1172
|
-
children: jsxRuntime.jsx(uiKit.Constraints.Horizontal, {
|
|
1173
|
-
max: 16,
|
|
1174
|
-
children: jsxRuntime.jsx(uiKit.ContentNotification, {
|
|
1175
|
-
type: "success",
|
|
1176
|
-
intlMessage: _objectSpread$1(_objectSpread$1({}, messages.exportOperationSuccessMessage), {}, {
|
|
1177
|
-
values: {
|
|
1178
|
-
logsLink: function logsLink(msg) {
|
|
1179
|
-
return getExportLogsLink(projectKey, msg);
|
|
1180
|
-
}
|
|
1181
|
-
}
|
|
1182
|
-
})
|
|
1183
|
-
})
|
|
1184
|
-
})
|
|
1185
|
-
});
|
|
1186
|
-
}
|
|
1187
|
-
ExportOperationSuccessMessage.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
1188
|
-
isShown: PropTypes__default["default"].bool.isRequired
|
|
1189
|
-
} : {};
|
|
1190
|
-
|
|
1191
|
-
var _excluded = ["renderProperties"];
|
|
1192
|
-
|
|
1193
|
-
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; }
|
|
1194
|
-
|
|
1195
|
-
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; }
|
|
1196
|
-
|
|
1197
|
-
var ExportResourcesModal = function ExportResourcesModal(_ref) {
|
|
1198
|
-
var renderProperties = _ref.renderProperties,
|
|
1199
|
-
props = _objectWithoutProperties(_ref, _excluded);
|
|
1010
|
+
const CurrentStep = () => {
|
|
1011
|
+
const _useExportResourcesCo = useExportResourcesContext(),
|
|
1012
|
+
currentStep = _useExportResourcesCo.currentStep;
|
|
1013
|
+
const steps = {
|
|
1014
|
+
1: jsxRuntime.jsx(ExportFileSettingsStep, {}),
|
|
1015
|
+
2: jsxRuntime.jsx(ExportFieldsSelectionStep, {})
|
|
1016
|
+
};
|
|
1017
|
+
return steps[currentStep] || null;
|
|
1018
|
+
};
|
|
1200
1019
|
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1020
|
+
function ownKeys(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
1021
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
1022
|
+
const ExportResourcesModal = props => {
|
|
1023
|
+
const intl = reactIntl.useIntl();
|
|
1024
|
+
const resourceTypePlural = resourceTypeToPlural({
|
|
1204
1025
|
resourceType: props.resourceType
|
|
1205
1026
|
});
|
|
1206
|
-
return jsxRuntime.jsx(
|
|
1207
|
-
children: jsxRuntime.jsx(
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
isOpen: props.isOpen,
|
|
1216
|
-
onClose: props.closeModal,
|
|
1217
|
-
onSecondaryButtonClick: props.closeModal,
|
|
1218
|
-
isPrimaryButtonDisabled: !formik.isValid,
|
|
1219
|
-
labelPrimaryButton: intl.formatMessage(messages.exportButton, {
|
|
1220
|
-
resourceType: resourceTypePlural
|
|
1221
|
-
}),
|
|
1222
|
-
subtitle: intl.formatMessage(messages.modalSubTitle),
|
|
1223
|
-
topBarPreviousPathLabel: intl.formatMessage(messages.topBarPreviousPathLabel, {
|
|
1224
|
-
resourceType: props.resourceType
|
|
1225
|
-
}),
|
|
1226
|
-
onPrimaryButtonClick: confirmationModal.openModal,
|
|
1227
|
-
children: [jsxRuntime.jsx(ExportOperationSuccessMessage, {
|
|
1228
|
-
isShown: exportOperationStarted
|
|
1229
|
-
}), jsxRuntime.jsx(ExportFileSettings, {
|
|
1230
|
-
renderProperties: renderProperties
|
|
1231
|
-
}), jsxRuntime.jsx(ExportConfirmationModal, {
|
|
1232
|
-
resourceType: props.resourceType,
|
|
1233
|
-
isOpen: confirmationModal.isModalOpen,
|
|
1234
|
-
closeModal: confirmationModal.closeModal
|
|
1235
|
-
})]
|
|
1236
|
-
});
|
|
1237
|
-
}
|
|
1027
|
+
return jsxRuntime.jsx(ExportResourcesProvider, _objectSpread(_objectSpread({}, props), {}, {
|
|
1028
|
+
children: jsxRuntime.jsx(applicationComponents.InfoDialog, {
|
|
1029
|
+
isOpen: true,
|
|
1030
|
+
title: intl.formatMessage(messages.modalTitle, {
|
|
1031
|
+
resourceType: resourceTypePlural
|
|
1032
|
+
}),
|
|
1033
|
+
onClose: props.onClose,
|
|
1034
|
+
size: 16,
|
|
1035
|
+
children: jsxRuntime.jsx(CurrentStep, {})
|
|
1238
1036
|
})
|
|
1239
1037
|
}));
|
|
1240
1038
|
};
|
|
1241
|
-
|
|
1242
1039
|
ExportResourcesModal.displayName = 'ExportResourcesModal';
|
|
1243
1040
|
ExportResourcesModal.propTypes = process.env.NODE_ENV !== "production" ? ExportResourcesModalShape : {};
|
|
1244
1041
|
ExportResourcesModal.defaultProps = {
|
|
1245
1042
|
selectedResourceIds: [],
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
matchingResourcesCount: 0,
|
|
1249
|
-
exportSelectionType: EXPORT_SELECTION_TYPES.ALL_RESOURCES,
|
|
1250
|
-
outputFormat: OUTPUT_FORMATS.JSON
|
|
1043
|
+
exportType: EXPORT_TYPES.ALL,
|
|
1044
|
+
outputFormat: OUTPUT_FORMATS.CSV
|
|
1251
1045
|
};
|
|
1252
1046
|
|
|
1253
|
-
exports.
|
|
1047
|
+
exports.EXPORTABLE_RESOURCES = EXPORTABLE_RESOURCES;
|
|
1048
|
+
exports.EXPORT_TYPES = EXPORT_TYPES;
|
|
1254
1049
|
exports["default"] = ExportResourcesModal;
|