@commercetools-frontend-extensions/export-resources-modal 1.3.2 → 1.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -31,17 +31,16 @@ var omitEmpty = require('omit-empty-es');
|
|
|
31
31
|
var jsxRuntime = require('@emotion/react/jsx-runtime');
|
|
32
32
|
var designSystem = require('@commercetools-uikit/design-system');
|
|
33
33
|
var PropTypes = require('prop-types');
|
|
34
|
-
var
|
|
34
|
+
var react$1 = require('react');
|
|
35
35
|
var react = require('@emotion/react');
|
|
36
36
|
var _styled = require('@emotion/styled/base');
|
|
37
37
|
var _valuesInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/values');
|
|
38
38
|
var applicationShellConnectors = require('@commercetools-frontend/application-shell-connectors');
|
|
39
39
|
var sdk = require('@commercetools-frontend/sdk');
|
|
40
|
+
var constants = require('@commercetools-frontend/constants');
|
|
40
41
|
var actionsGlobal = require('@commercetools-frontend/actions-global');
|
|
41
|
-
var _slicedToArray = require('@babel/runtime-corejs3/helpers/slicedToArray');
|
|
42
42
|
var formik = require('formik');
|
|
43
43
|
var moment = require('moment');
|
|
44
|
-
var constants = require('@commercetools-frontend/constants');
|
|
45
44
|
|
|
46
45
|
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
47
46
|
|
|
@@ -60,7 +59,6 @@ var _Reflect$construct__default = /*#__PURE__*/_interopDefault(_Reflect$construc
|
|
|
60
59
|
var _Array$isArray__default = /*#__PURE__*/_interopDefault(_Array$isArray);
|
|
61
60
|
var omitEmpty__default = /*#__PURE__*/_interopDefault(omitEmpty);
|
|
62
61
|
var PropTypes__default = /*#__PURE__*/_interopDefault(PropTypes);
|
|
63
|
-
var React__default = /*#__PURE__*/_interopDefault(React);
|
|
64
62
|
var _styled__default = /*#__PURE__*/_interopDefault(_styled);
|
|
65
63
|
var _valuesInstanceProperty__default = /*#__PURE__*/_interopDefault(_valuesInstanceProperty);
|
|
66
64
|
var moment__default = /*#__PURE__*/_interopDefault(moment);
|
|
@@ -393,7 +391,7 @@ var messages = reactIntl.defineMessages({
|
|
|
393
391
|
exportOperationSuccessMessage: {
|
|
394
392
|
id: 'ExportResourcesModal.exportOperationSuccessMessage',
|
|
395
393
|
description: 'Success message',
|
|
396
|
-
defaultMessage: 'Your export has started
|
|
394
|
+
defaultMessage: '<b>Your export has started.</b> <newline></newline><logsLink>Go to Export logs</logsLink> to view the progress and download the file.'
|
|
397
395
|
},
|
|
398
396
|
exportConfirmationLabel: {
|
|
399
397
|
id: 'ExportResourcesModal.exportConfirmationLabel',
|
|
@@ -440,6 +438,10 @@ function getBold(msg) {
|
|
|
440
438
|
});
|
|
441
439
|
}
|
|
442
440
|
|
|
441
|
+
function getNewLine() {
|
|
442
|
+
return jsxRuntime.jsx("br", {});
|
|
443
|
+
}
|
|
444
|
+
|
|
443
445
|
const smallTopPadding = /*#__PURE__*/react.css("padding-top:", designSystem.customProperties.spacingXs, ";" + ("" ), "" );
|
|
444
446
|
const tagListContainer = _ref => {
|
|
445
447
|
let isNewTheme = _ref.isNewTheme;
|
|
@@ -469,7 +471,7 @@ function TagList(props) {
|
|
|
469
471
|
isNewTheme
|
|
470
472
|
}),
|
|
471
473
|
"data-testid": props['data-testid'],
|
|
472
|
-
children: _mapInstanceProperty__default["default"](
|
|
474
|
+
children: _mapInstanceProperty__default["default"](react$1.Children).call(react$1.Children, props.children, tag => jsxRuntime.jsx("div", {
|
|
473
475
|
css: styles.tagListItem,
|
|
474
476
|
children: tag
|
|
475
477
|
}))
|
|
@@ -478,8 +480,8 @@ function TagList(props) {
|
|
|
478
480
|
TagList.displayName = 'TagList';
|
|
479
481
|
TagList.propTypes = {};
|
|
480
482
|
|
|
481
|
-
function ownKeys$
|
|
482
|
-
function _objectSpread$
|
|
483
|
+
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; }
|
|
484
|
+
function _objectSpread$9(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$9(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$9(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
483
485
|
function AppliedFilters(_ref) {
|
|
484
486
|
let filters = _ref.filters,
|
|
485
487
|
onFilterRemove = _ref.onFilterRemove;
|
|
@@ -489,7 +491,7 @@ function AppliedFilters(_ref) {
|
|
|
489
491
|
condensed: true,
|
|
490
492
|
isDefaultClosed: !Boolean(filters.length),
|
|
491
493
|
header: jsxRuntime.jsx(uiKit.Text.Body, {
|
|
492
|
-
intlMessage: _objectSpread$
|
|
494
|
+
intlMessage: _objectSpread$9(_objectSpread$9({}, messages.appliedFiltersMessage), {}, {
|
|
493
495
|
values: {
|
|
494
496
|
filtersCount: filters.length
|
|
495
497
|
}
|
|
@@ -518,7 +520,7 @@ function AppliedFilters(_ref) {
|
|
|
518
520
|
color: "neutral60"
|
|
519
521
|
}), jsxRuntime.jsx(uiKit.Text.Body, {
|
|
520
522
|
isBold: true,
|
|
521
|
-
intlMessage: _objectSpread$
|
|
523
|
+
intlMessage: _objectSpread$9(_objectSpread$9({}, messages.appliedFiltersMessage), {}, {
|
|
522
524
|
values: {
|
|
523
525
|
filtersCount: filters.length
|
|
524
526
|
}
|
|
@@ -539,8 +541,8 @@ function AppliedFilters(_ref) {
|
|
|
539
541
|
}
|
|
540
542
|
AppliedFilters.propTypes = {};
|
|
541
543
|
|
|
542
|
-
function ownKeys$
|
|
543
|
-
function _objectSpread$
|
|
544
|
+
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; }
|
|
545
|
+
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; }
|
|
544
546
|
const IconPlaceholder = /*#__PURE__*/_styled__default["default"]("div", {
|
|
545
547
|
target: "e1oion860"
|
|
546
548
|
} )("width:", uiKit.customProperties.spacingM, ";" + ("" ));
|
|
@@ -552,7 +554,7 @@ function AppliedSearchTerms(_ref) {
|
|
|
552
554
|
condensed: true,
|
|
553
555
|
isDefaultClosed: !Boolean(appliedSearchTerms.length),
|
|
554
556
|
header: jsxRuntime.jsx(uiKit.Text.Body, {
|
|
555
|
-
intlMessage: _objectSpread$
|
|
557
|
+
intlMessage: _objectSpread$8(_objectSpread$8({}, messages.appliedSearchTermsMessage), {}, {
|
|
556
558
|
values: {
|
|
557
559
|
searchTermsCount: appliedSearchTerms.length
|
|
558
560
|
}
|
|
@@ -573,7 +575,7 @@ function AppliedSearchTerms(_ref) {
|
|
|
573
575
|
color: "neutral60"
|
|
574
576
|
}), jsxRuntime.jsx(uiKit.Text.Body, {
|
|
575
577
|
isBold: true,
|
|
576
|
-
intlMessage: _objectSpread$
|
|
578
|
+
intlMessage: _objectSpread$8(_objectSpread$8({}, messages.appliedSearchTermsMessage), {}, {
|
|
577
579
|
values: {
|
|
578
580
|
searchTermsCount: appliedSearchTerms.length
|
|
579
581
|
}
|
|
@@ -611,14 +613,14 @@ function ExportBasedOnMyViewsSelectField() {
|
|
|
611
613
|
});
|
|
612
614
|
}
|
|
613
615
|
|
|
614
|
-
function ownKeys$
|
|
615
|
-
function _objectSpread$
|
|
616
|
+
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; }
|
|
617
|
+
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; }
|
|
616
618
|
function renderFileNameError(key) {
|
|
617
619
|
switch (key) {
|
|
618
620
|
case 'missing':
|
|
619
|
-
return jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$
|
|
621
|
+
return jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$7({}, messages.missingFileNameError));
|
|
620
622
|
case 'invalidInput':
|
|
621
|
-
return jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$
|
|
623
|
+
return jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$7({}, messages.invalidFileNameError));
|
|
622
624
|
default:
|
|
623
625
|
return null;
|
|
624
626
|
}
|
|
@@ -626,14 +628,14 @@ function renderFileNameError(key) {
|
|
|
626
628
|
function renderLanguageError(key) {
|
|
627
629
|
switch (key) {
|
|
628
630
|
case 'missing':
|
|
629
|
-
return jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$
|
|
631
|
+
return jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$7({}, messages.missingLanguageError));
|
|
630
632
|
default:
|
|
631
633
|
return null;
|
|
632
634
|
}
|
|
633
635
|
}
|
|
634
636
|
|
|
635
637
|
function useExportResourcesContext() {
|
|
636
|
-
const context =
|
|
638
|
+
const context = react$1.useContext(ExportResourcesContext);
|
|
637
639
|
if (!context) {
|
|
638
640
|
throw new MissingExportResourceProviderError();
|
|
639
641
|
}
|
|
@@ -659,8 +661,12 @@ async function createExportOperation(_ref) {
|
|
|
659
661
|
return response;
|
|
660
662
|
}
|
|
661
663
|
|
|
662
|
-
function ownKeys$
|
|
663
|
-
function _objectSpread$
|
|
664
|
+
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; }
|
|
665
|
+
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; }
|
|
666
|
+
const getExportLogsLink = (projectKey, msg) => jsxRuntime.jsx(uiKit.Link, {
|
|
667
|
+
to: "/".concat(projectKey, "/operations/export/logs"),
|
|
668
|
+
children: msg
|
|
669
|
+
});
|
|
664
670
|
function ExportConfirmationModal(props) {
|
|
665
671
|
const _useApplicationContex = applicationShellConnectors.useApplicationContext(applicationContext => {
|
|
666
672
|
var _applicationContext$p, _applicationContext$p2;
|
|
@@ -676,8 +682,8 @@ function ExportConfirmationModal(props) {
|
|
|
676
682
|
allResourcesCount = _useExportResourcesCo.allResourcesCount,
|
|
677
683
|
matchingResourcesCount = _useExportResourcesCo.matchingResourcesCount,
|
|
678
684
|
selectedResourceIds = _useExportResourcesCo.selectedResourceIds,
|
|
679
|
-
resourceType = _useExportResourcesCo.resourceType
|
|
680
|
-
|
|
685
|
+
resourceType = _useExportResourcesCo.resourceType;
|
|
686
|
+
const showNotification = actionsGlobal.useShowNotification();
|
|
681
687
|
const intl = reactIntl.useIntl();
|
|
682
688
|
const asyncDispatch = sdk.useAsyncDispatch();
|
|
683
689
|
const resourceTypePlural = resourceTypeToPlural({
|
|
@@ -709,7 +715,6 @@ function ExportConfirmationModal(props) {
|
|
|
709
715
|
onClose: props.closeModal,
|
|
710
716
|
onCancel: props.closeModal,
|
|
711
717
|
onConfirm: async () => {
|
|
712
|
-
setExportOperationStarted(false);
|
|
713
718
|
const graphQuery = buildGraphQuery({
|
|
714
719
|
resourceType: resourceType,
|
|
715
720
|
selectedResourceIds: selectedResourceIds,
|
|
@@ -727,7 +732,16 @@ function ExportConfirmationModal(props) {
|
|
|
727
732
|
switch (response.state) {
|
|
728
733
|
case EXPORT_OPERATION_STATES.PROCESSING:
|
|
729
734
|
case EXPORT_OPERATION_STATES.COMPLETED:
|
|
730
|
-
|
|
735
|
+
showNotification({
|
|
736
|
+
kind: 'success',
|
|
737
|
+
domain: constants.DOMAINS.SIDE,
|
|
738
|
+
text: intl.formatMessage(messages.exportOperationSuccessMessage, {
|
|
739
|
+
newline: getNewLine,
|
|
740
|
+
logsLink: msg => getExportLogsLink(projectKey, msg),
|
|
741
|
+
b: getBold
|
|
742
|
+
})
|
|
743
|
+
});
|
|
744
|
+
props.onCloseParentModal();
|
|
731
745
|
break;
|
|
732
746
|
default:
|
|
733
747
|
throw new UnexpectedExportOperationStateError(response.state);
|
|
@@ -740,7 +754,7 @@ function ExportConfirmationModal(props) {
|
|
|
740
754
|
},
|
|
741
755
|
children: jsxRuntime.jsxs("div", {
|
|
742
756
|
children: [jsxRuntime.jsx(uiKit.Text.Body, {
|
|
743
|
-
intlMessage: _objectSpread$
|
|
757
|
+
intlMessage: _objectSpread$6(_objectSpread$6({}, messages.confirmationBodyPlan), {}, {
|
|
744
758
|
values: {
|
|
745
759
|
resourceType: resourceTypePlural,
|
|
746
760
|
projectName: projectName,
|
|
@@ -756,15 +770,15 @@ function ExportConfirmationModal(props) {
|
|
|
756
770
|
}
|
|
757
771
|
ExportConfirmationModal.propTypes = {};
|
|
758
772
|
|
|
759
|
-
function ownKeys$
|
|
760
|
-
function _objectSpread$
|
|
773
|
+
function ownKeys$5(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
774
|
+
function _objectSpread$5(target) { for (var i = 1; i < arguments.length; i++) { var _context3, _context4; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context3 = ownKeys$5(Object(source), !0)).call(_context3, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context4 = ownKeys$5(Object(source))).call(_context4, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
761
775
|
function normalizeFields(fields) {
|
|
762
776
|
const result = _mapInstanceProperty__default["default"](fields).call(fields, field => {
|
|
763
777
|
if (isFilledArray(field.fields)) {
|
|
764
778
|
var _context;
|
|
765
779
|
return _mapInstanceProperty__default["default"](_context = normalizeFields(field.fields)).call(_context, nestedField => {
|
|
766
780
|
var _context2;
|
|
767
|
-
return _objectSpread$
|
|
781
|
+
return _objectSpread$5(_objectSpread$5({}, nestedField), {}, {
|
|
768
782
|
key: _concatInstanceProperty__default["default"](_context2 = "".concat(field.key, ".")).call(_context2, nestedField.key)
|
|
769
783
|
});
|
|
770
784
|
});
|
|
@@ -794,7 +808,7 @@ function ExportFields(_ref2) {
|
|
|
794
808
|
condensed: true,
|
|
795
809
|
isDefaultClosed: !Boolean(fields.length),
|
|
796
810
|
header: jsxRuntime.jsx(uiKit.Text.Body, {
|
|
797
|
-
intlMessage: _objectSpread$
|
|
811
|
+
intlMessage: _objectSpread$5(_objectSpread$5({}, messages.columnsMessage), {}, {
|
|
798
812
|
values: {
|
|
799
813
|
columnsCount: fields.length
|
|
800
814
|
}
|
|
@@ -815,7 +829,7 @@ function ExportFields(_ref2) {
|
|
|
815
829
|
color: "neutral60"
|
|
816
830
|
}), jsxRuntime.jsx(uiKit.Text.Body, {
|
|
817
831
|
isBold: true,
|
|
818
|
-
intlMessage: _objectSpread$
|
|
832
|
+
intlMessage: _objectSpread$5(_objectSpread$5({}, messages.columnsMessage), {}, {
|
|
819
833
|
values: {
|
|
820
834
|
columnsCount: fields.length
|
|
821
835
|
}
|
|
@@ -828,8 +842,8 @@ function ExportFields(_ref2) {
|
|
|
828
842
|
}
|
|
829
843
|
ExportFields.propTypes = {};
|
|
830
844
|
|
|
831
|
-
function ownKeys$
|
|
832
|
-
function _objectSpread$
|
|
845
|
+
function ownKeys$4(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
846
|
+
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; }
|
|
833
847
|
function ExportSelectionRadioButtons() {
|
|
834
848
|
const _useTheme = designSystem.useTheme(),
|
|
835
849
|
isNewTheme = _useTheme.isNewTheme;
|
|
@@ -858,7 +872,7 @@ function ExportSelectionRadioButtons() {
|
|
|
858
872
|
"data-testid": 'test-all-resources',
|
|
859
873
|
children: jsxRuntime.jsx(uiKit.Text.Body, {
|
|
860
874
|
isBold: !isNewTheme,
|
|
861
|
-
intlMessage: _objectSpread$
|
|
875
|
+
intlMessage: _objectSpread$4(_objectSpread$4({}, messages.exportAllResources), {}, {
|
|
862
876
|
values: {
|
|
863
877
|
resourceType: resourceTypePlural,
|
|
864
878
|
count: allResourcesCount
|
|
@@ -871,7 +885,7 @@ function ExportSelectionRadioButtons() {
|
|
|
871
885
|
isDisabled: !Boolean(matchingResourcesCount),
|
|
872
886
|
children: jsxRuntime.jsx(uiKit.Text.Body, {
|
|
873
887
|
isBold: !isNewTheme,
|
|
874
|
-
intlMessage: _objectSpread$
|
|
888
|
+
intlMessage: _objectSpread$4(_objectSpread$4({}, messages.exportOnlyMatchingResources), {}, {
|
|
875
889
|
values: {
|
|
876
890
|
count: matchingResourcesCount || intl.formatMessage(messages.nothingApplied)
|
|
877
891
|
}
|
|
@@ -883,7 +897,7 @@ function ExportSelectionRadioButtons() {
|
|
|
883
897
|
isDisabled: !Boolean(selectedResourceIds.length),
|
|
884
898
|
children: jsxRuntime.jsx(uiKit.Text.Body, {
|
|
885
899
|
isBold: !isNewTheme,
|
|
886
|
-
intlMessage: _objectSpread$
|
|
900
|
+
intlMessage: _objectSpread$4(_objectSpread$4({}, messages.exportOnlySelectedResources), {}, {
|
|
887
901
|
values: {
|
|
888
902
|
resourceType: resourceTypePlural,
|
|
889
903
|
count: selectedResourceIds.length
|
|
@@ -895,8 +909,8 @@ function ExportSelectionRadioButtons() {
|
|
|
895
909
|
});
|
|
896
910
|
}
|
|
897
911
|
|
|
898
|
-
function ownKeys$
|
|
899
|
-
function _objectSpread$
|
|
912
|
+
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; }
|
|
913
|
+
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; }
|
|
900
914
|
function ExportTextMessage() {
|
|
901
915
|
const _useExportResourcesCo = useExportResourcesContext(),
|
|
902
916
|
resourceType = _useExportResourcesCo.resourceType,
|
|
@@ -910,7 +924,7 @@ function ExportTextMessage() {
|
|
|
910
924
|
switch (_valuesInstanceProperty__default["default"](formik).exportSelectionType) {
|
|
911
925
|
case EXPORT_SELECTION_TYPES.ALL_RESOURCES:
|
|
912
926
|
return jsxRuntime.jsx(uiKit.Text.Body, {
|
|
913
|
-
intlMessage: _objectSpread$
|
|
927
|
+
intlMessage: _objectSpread$3(_objectSpread$3({}, messages.exportAllMessage), {}, {
|
|
914
928
|
values: {
|
|
915
929
|
count: allResourcesCount,
|
|
916
930
|
resourceType: resourceTypePlural,
|
|
@@ -920,7 +934,7 @@ function ExportTextMessage() {
|
|
|
920
934
|
});
|
|
921
935
|
case EXPORT_SELECTION_TYPES.ONLY_MATCHING:
|
|
922
936
|
return jsxRuntime.jsx(uiKit.Text.Body, {
|
|
923
|
-
intlMessage: _objectSpread$
|
|
937
|
+
intlMessage: _objectSpread$3(_objectSpread$3({}, messages.exportMatchingMessage), {}, {
|
|
924
938
|
values: {
|
|
925
939
|
count: matchingResourcesCount,
|
|
926
940
|
resourceType: resourceTypePlural,
|
|
@@ -930,7 +944,7 @@ function ExportTextMessage() {
|
|
|
930
944
|
});
|
|
931
945
|
case EXPORT_SELECTION_TYPES.ONLY_SELECTED:
|
|
932
946
|
return jsxRuntime.jsx(uiKit.Text.Body, {
|
|
933
|
-
intlMessage: _objectSpread$
|
|
947
|
+
intlMessage: _objectSpread$3(_objectSpread$3({}, messages.exportSelectedMessage), {}, {
|
|
934
948
|
values: {
|
|
935
949
|
count: selectedResourceIds.length,
|
|
936
950
|
resourceType: resourceTypePlural,
|
|
@@ -1005,8 +1019,8 @@ const ExportSelection = () => {
|
|
|
1005
1019
|
});
|
|
1006
1020
|
};
|
|
1007
1021
|
|
|
1008
|
-
function ownKeys$
|
|
1009
|
-
function _objectSpread$
|
|
1022
|
+
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; }
|
|
1023
|
+
function _objectSpread$2(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$2(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$2(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
1010
1024
|
const ExportProperties = props => {
|
|
1011
1025
|
const _useTheme = designSystem.useTheme(),
|
|
1012
1026
|
isNewTheme = _useTheme.isNewTheme;
|
|
@@ -1023,15 +1037,15 @@ const ExportProperties = props => {
|
|
|
1023
1037
|
return jsxRuntime.jsx(uiKit.CollapsiblePanel, {
|
|
1024
1038
|
header: jsxRuntime.jsx(uiKit.Text.Body, {
|
|
1025
1039
|
isBold: true,
|
|
1026
|
-
intlMessage: _objectSpread$
|
|
1040
|
+
intlMessage: _objectSpread$2({}, messages.propertiesPanelLabel)
|
|
1027
1041
|
}),
|
|
1028
1042
|
children: props.renderProperties()
|
|
1029
1043
|
});
|
|
1030
1044
|
};
|
|
1031
1045
|
ExportProperties.propTypes = {};
|
|
1032
1046
|
|
|
1033
|
-
function ownKeys$
|
|
1034
|
-
function _objectSpread$
|
|
1047
|
+
function ownKeys$1(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
1048
|
+
function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$1(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$1(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
1035
1049
|
const outputFormatOptions = [{
|
|
1036
1050
|
value: OUTPUT_FORMATS.JSON,
|
|
1037
1051
|
label: 'JSON'
|
|
@@ -1065,12 +1079,12 @@ function ExportFileSettings(props) {
|
|
|
1065
1079
|
children: [jsxRuntime.jsx(applicationComponents.PageContentNarrow, {
|
|
1066
1080
|
children: jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
1067
1081
|
scale: "xl",
|
|
1068
|
-
children: [jsxRuntime.jsx(uiKit.SelectField, _objectSpread$
|
|
1082
|
+
children: [jsxRuntime.jsx(uiKit.SelectField, _objectSpread$1(_objectSpread$1({
|
|
1069
1083
|
isDisabled: true
|
|
1070
1084
|
}, formik.getFieldProps('outputFormat')), {}, {
|
|
1071
1085
|
title: intl.formatMessage(messages.outputFormat),
|
|
1072
1086
|
options: outputFormatOptions
|
|
1073
|
-
})), jsxRuntime.jsx(uiKit.TextField, _objectSpread$
|
|
1087
|
+
})), jsxRuntime.jsx(uiKit.TextField, _objectSpread$1(_objectSpread$1({
|
|
1074
1088
|
title: intl.formatMessage(messages.fileName)
|
|
1075
1089
|
}, formik.getFieldProps('fileName')), {}, {
|
|
1076
1090
|
touched: formik.touched.fileName,
|
|
@@ -1078,7 +1092,7 @@ function ExportFileSettings(props) {
|
|
|
1078
1092
|
renderError: renderFileNameError
|
|
1079
1093
|
})), jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
1080
1094
|
scale: "xs",
|
|
1081
|
-
children: [jsxRuntime.jsx(uiKit.SelectField, _objectSpread$
|
|
1095
|
+
children: [jsxRuntime.jsx(uiKit.SelectField, _objectSpread$1(_objectSpread$1({
|
|
1082
1096
|
id: "languages",
|
|
1083
1097
|
title: intl.formatMessage(messages.localLanguage),
|
|
1084
1098
|
options: mapLanguagesToOptions(languages),
|
|
@@ -1115,13 +1129,13 @@ function ExportFileSettings(props) {
|
|
|
1115
1129
|
scale: "l",
|
|
1116
1130
|
children: [jsxRuntime.jsxs(uiKit.Spacings.Inline, {
|
|
1117
1131
|
scale: "l",
|
|
1118
|
-
children: [jsxRuntime.jsx(uiKit.SelectField, _objectSpread$
|
|
1132
|
+
children: [jsxRuntime.jsx(uiKit.SelectField, _objectSpread$1(_objectSpread$1({
|
|
1119
1133
|
isDisabled: true
|
|
1120
1134
|
}, formik.getFieldProps('outputFormat')), {}, {
|
|
1121
1135
|
title: intl.formatMessage(messages.outputFormat),
|
|
1122
1136
|
options: outputFormatOptions,
|
|
1123
1137
|
horizontalConstraint: 7
|
|
1124
|
-
})), jsxRuntime.jsx(uiKit.TextField, _objectSpread$
|
|
1138
|
+
})), jsxRuntime.jsx(uiKit.TextField, _objectSpread$1(_objectSpread$1({
|
|
1125
1139
|
title: intl.formatMessage(messages.fileName)
|
|
1126
1140
|
}, formik.getFieldProps('fileName')), {}, {
|
|
1127
1141
|
touched: formik.touched.fileName,
|
|
@@ -1130,7 +1144,7 @@ function ExportFileSettings(props) {
|
|
|
1130
1144
|
horizontalConstraint: 7
|
|
1131
1145
|
}))]
|
|
1132
1146
|
}), jsxRuntime.jsx(uiKit.Spacings.Inline, {
|
|
1133
|
-
children: jsxRuntime.jsx(uiKit.SelectField, _objectSpread$
|
|
1147
|
+
children: jsxRuntime.jsx(uiKit.SelectField, _objectSpread$1(_objectSpread$1({
|
|
1134
1148
|
id: "languages",
|
|
1135
1149
|
title: jsxRuntime.jsxs(uiKit.Spacings.Inline, {
|
|
1136
1150
|
scale: "s",
|
|
@@ -1170,41 +1184,7 @@ function ExportFileSettings(props) {
|
|
|
1170
1184
|
ExportFileSettings.displayName = 'ExportFileSettings';
|
|
1171
1185
|
ExportFileSettings.propTypes = {};
|
|
1172
1186
|
|
|
1173
|
-
|
|
1174
|
-
function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$1(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$1(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
1175
|
-
const getExportLogsLink = (projectKey, msg) => jsxRuntime.jsx(uiKit.Link, {
|
|
1176
|
-
to: "/".concat(projectKey, "/operations/export/logs"),
|
|
1177
|
-
children: msg
|
|
1178
|
-
});
|
|
1179
|
-
function ExportOperationSuccessMessage(_ref) {
|
|
1180
|
-
let isShown = _ref.isShown;
|
|
1181
|
-
const _useApplicationContex = applicationShellConnectors.useApplicationContext(applicationContext => {
|
|
1182
|
-
var _applicationContext$p;
|
|
1183
|
-
return {
|
|
1184
|
-
projectKey: (_applicationContext$p = applicationContext.project) === null || _applicationContext$p === void 0 ? void 0 : _applicationContext$p.key
|
|
1185
|
-
};
|
|
1186
|
-
}),
|
|
1187
|
-
projectKey = _useApplicationContex.projectKey;
|
|
1188
|
-
if (!isShown) return null;
|
|
1189
|
-
return jsxRuntime.jsx("div", {
|
|
1190
|
-
css: styles.successMessage,
|
|
1191
|
-
"data-testid": "export-started-message",
|
|
1192
|
-
children: jsxRuntime.jsx(uiKit.Constraints.Horizontal, {
|
|
1193
|
-
max: 16,
|
|
1194
|
-
children: jsxRuntime.jsx(uiKit.ContentNotification, {
|
|
1195
|
-
type: "success",
|
|
1196
|
-
intlMessage: _objectSpread$1(_objectSpread$1({}, messages.exportOperationSuccessMessage), {}, {
|
|
1197
|
-
values: {
|
|
1198
|
-
logsLink: msg => getExportLogsLink(projectKey, msg)
|
|
1199
|
-
}
|
|
1200
|
-
})
|
|
1201
|
-
})
|
|
1202
|
-
})
|
|
1203
|
-
});
|
|
1204
|
-
}
|
|
1205
|
-
ExportOperationSuccessMessage.propTypes = {};
|
|
1206
|
-
|
|
1207
|
-
const ExportResourcesContext = /*#__PURE__*/React.createContext();
|
|
1187
|
+
const ExportResourcesContext = /*#__PURE__*/react$1.createContext();
|
|
1208
1188
|
|
|
1209
1189
|
PropTypes__default["default"].shape({
|
|
1210
1190
|
resourceType: PropTypes__default["default"].string.isRequired,
|
|
@@ -1254,19 +1234,13 @@ const ExportResourcesContextProvider = props => {
|
|
|
1254
1234
|
},
|
|
1255
1235
|
validate
|
|
1256
1236
|
});
|
|
1257
|
-
const _React$useState = React__default["default"].useState(false),
|
|
1258
|
-
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
1259
|
-
exportOperationStarted = _React$useState2[0],
|
|
1260
|
-
setExportOperationStarted = _React$useState2[1];
|
|
1261
1237
|
return jsxRuntime.jsx(ExportResourcesContext.Provider, {
|
|
1262
1238
|
value: {
|
|
1263
1239
|
formik: formik$1,
|
|
1264
1240
|
resourceType: props.resourceType,
|
|
1265
1241
|
allResourcesCount: props.allResourcesCount,
|
|
1266
1242
|
matchingResourcesCount: props.matchingResourcesCount,
|
|
1267
|
-
selectedResourceIds: props.selectedResourceIds
|
|
1268
|
-
exportOperationStarted,
|
|
1269
|
-
setExportOperationStarted
|
|
1243
|
+
selectedResourceIds: props.selectedResourceIds
|
|
1270
1244
|
},
|
|
1271
1245
|
children: props.children
|
|
1272
1246
|
});
|
|
@@ -1288,8 +1262,7 @@ const ExportResourcesModal = _ref => {
|
|
|
1288
1262
|
return jsxRuntime.jsx(ExportResourcesContextProvider, _objectSpread(_objectSpread({}, props), {}, {
|
|
1289
1263
|
children: jsxRuntime.jsx(ExportResourcesContext.Consumer, {
|
|
1290
1264
|
children: _ref2 => {
|
|
1291
|
-
let formik = _ref2.formik
|
|
1292
|
-
exportOperationStarted = _ref2.exportOperationStarted;
|
|
1265
|
+
let formik = _ref2.formik;
|
|
1293
1266
|
return jsxRuntime.jsxs(applicationComponents.FormModalPage, {
|
|
1294
1267
|
title: intl.formatMessage(messages.modalTitle, {
|
|
1295
1268
|
resourceType: resourceTypePlural
|
|
@@ -1306,14 +1279,13 @@ const ExportResourcesModal = _ref => {
|
|
|
1306
1279
|
resourceType: props.resourceType
|
|
1307
1280
|
}),
|
|
1308
1281
|
onPrimaryButtonClick: confirmationModal.openModal,
|
|
1309
|
-
children: [jsxRuntime.jsx(
|
|
1310
|
-
isShown: exportOperationStarted
|
|
1311
|
-
}), jsxRuntime.jsx(ExportFileSettings, {
|
|
1282
|
+
children: [jsxRuntime.jsx(ExportFileSettings, {
|
|
1312
1283
|
renderProperties: renderProperties
|
|
1313
1284
|
}), jsxRuntime.jsx(ExportConfirmationModal, {
|
|
1314
1285
|
resourceType: props.resourceType,
|
|
1315
1286
|
isOpen: confirmationModal.isModalOpen,
|
|
1316
|
-
closeModal: confirmationModal.closeModal
|
|
1287
|
+
closeModal: confirmationModal.closeModal,
|
|
1288
|
+
onCloseParentModal: props.closeModal
|
|
1317
1289
|
})]
|
|
1318
1290
|
});
|
|
1319
1291
|
}
|