orc-shared 5.8.0-dev.2 → 5.8.0-dev.21
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/dist/actions/applications.js +5 -5
- package/dist/actions/authentication.js +5 -5
- package/dist/actions/countries.js +5 -5
- package/dist/actions/locale.js +5 -5
- package/dist/actions/makeApiAction.js +8 -8
- package/dist/actions/makeOrcApiAction.js +3 -3
- package/dist/actions/metadata.js +8 -8
- package/dist/actions/navigation.js +3 -3
- package/dist/actions/scopes.js +5 -5
- package/dist/actions/tasks.js +5 -5
- package/dist/actions/timezones.js +5 -5
- package/dist/actions/versionInfo.js +5 -5
- package/dist/buildStore.js +5 -5
- package/dist/components/AppFrame/About.js +14 -13
- package/dist/components/AppFrame/Anchor.js +1 -1
- package/dist/components/AppFrame/AppFrame.js +6 -6
- package/dist/components/AppFrame/ApplicationSelector/ApplicationDialog.js +1 -1
- package/dist/components/AppFrame/ApplicationSelector/Header.js +4 -4
- package/dist/components/AppFrame/ApplicationSelector/index.js +3 -3
- package/dist/components/AppFrame/ConnectedToastList.js +2 -2
- package/dist/components/AppFrame/Help.js +1 -1
- package/dist/components/AppFrame/MenuItem.js +6 -6
- package/dist/components/AppFrame/Preferences.js +8 -9
- package/dist/components/AppFrame/Sidebar.js +5 -5
- package/dist/components/AppFrame/Topbar.js +3 -3
- package/dist/components/AppFrame/index.js +2 -2
- package/dist/components/ApplicationModuleLoader.js +5 -5
- package/dist/components/Authenticate.js +2 -2
- package/dist/components/Button.js +1 -1
- package/dist/components/CategoryList.js +6 -6
- package/dist/components/Checkbox.js +5 -5
- package/dist/components/ColumnWrapper.js +1 -1
- package/dist/components/Culture.js +1 -1
- package/dist/components/DevPages.js +1 -1
- package/dist/components/DropMenu/Menu.js +2 -2
- package/dist/components/DropMenu/index.js +5 -5
- package/dist/components/ErrorPlaceholder.js +4 -4
- package/dist/components/Form/Combination.js +2 -2
- package/dist/components/Form/Field.js +3 -3
- package/dist/components/Form/FieldElements.js +4 -4
- package/dist/components/Form/FieldList.js +10 -11
- package/dist/components/Form/Fieldset.js +1 -1
- package/dist/components/Form/Form.js +2 -2
- package/dist/components/Form/FormElement.js +1 -1
- package/dist/components/Form/InputField.js +10 -10
- package/dist/components/Form/Inputs/Button.js +4 -4
- package/dist/components/Form/Inputs/Date.js +4 -4
- package/dist/components/Form/Inputs/FieldButtons.js +2 -2
- package/dist/components/Form/Inputs/Number.js +4 -4
- package/dist/components/Form/Inputs/ReadOnly.js +1 -1
- package/dist/components/Form/Inputs/SmallButton.js +4 -4
- package/dist/components/Form/Inputs/Text.js +4 -5
- package/dist/components/Form/Inputs/Time.js +4 -4
- package/dist/components/Form/Inputs/Toggles.js +4 -4
- package/dist/components/Form/Inputs/Translation.js +12 -12
- package/dist/components/Form/Inputs/index.js +1 -1
- package/dist/components/Form/index.js +2 -2
- package/dist/components/I18n.js +2 -2
- package/dist/components/Icon.js +3 -3
- package/dist/components/IconButton.js +3 -3
- package/dist/components/Input.js +5 -5
- package/dist/components/InternetExplorerWarningMessage.js +1 -1
- package/dist/components/List/DataCell.js +2 -2
- package/dist/components/List/HeadCell.js +2 -2
- package/dist/components/List/HeadRow.js +1 -1
- package/dist/components/List/List.js +5 -5
- package/dist/components/List/Row.js +2 -2
- package/dist/components/List/enhanceColumnDefs.js +3 -3
- package/dist/components/List/index.js +2 -2
- package/dist/components/Loader.js +6 -6
- package/dist/components/LoadingIcon.js +2 -2
- package/dist/components/MaterialUI/DataDisplay/Badge.js +4 -4
- package/dist/components/MaterialUI/DataDisplay/Chip.js +2 -2
- package/dist/components/MaterialUI/DataDisplay/CollapsableList.js +6 -6
- package/dist/components/MaterialUI/DataDisplay/Divider.js +2 -2
- package/dist/components/MaterialUI/DataDisplay/Icon.js +4 -4
- package/dist/components/MaterialUI/DataDisplay/List.js +1 -1
- package/dist/components/MaterialUI/DataDisplay/Modal.js +5 -5
- package/dist/components/MaterialUI/DataDisplay/Notification.js +9 -9
- package/dist/components/MaterialUI/DataDisplay/NotificationProps.js +7 -7
- package/dist/components/MaterialUI/DataDisplay/PopperedElements/PopperedIcon.js +2 -2
- package/dist/components/MaterialUI/DataDisplay/PredefinedElements/ActionModal.js +1 -1
- package/dist/components/MaterialUI/DataDisplay/PredefinedElements/Address.js +2 -2
- package/dist/components/MaterialUI/DataDisplay/PredefinedElements/ConfirmationModal.js +1 -1
- package/dist/components/MaterialUI/DataDisplay/PredefinedElements/DiscountedPrice.js +1 -1
- package/dist/components/MaterialUI/DataDisplay/PredefinedElements/GlobalErrorMessages.js +1 -1
- package/dist/components/MaterialUI/DataDisplay/PredefinedElements/InformationItem.js +24 -14
- package/dist/components/MaterialUI/DataDisplay/PredefinedElements/LookupDisplayValue.js +4 -4
- package/dist/components/MaterialUI/DataDisplay/PredefinedElements/Placeholder.js +1 -1
- package/dist/components/MaterialUI/DataDisplay/PredefinedElements/SectionTitle.js +1 -1
- package/dist/components/MaterialUI/DataDisplay/PredefinedElements/StepperModal.js +25 -11
- package/dist/components/MaterialUI/DataDisplay/PredefinedElements/TableInfoBar.js +1 -1
- package/dist/components/MaterialUI/DataDisplay/PredefinedElements/Translations.js +10 -10
- package/dist/components/MaterialUI/DataDisplay/SelectionList.js +17 -25
- package/dist/components/MaterialUI/DataDisplay/Table.js +9 -9
- package/dist/components/MaterialUI/DataDisplay/TableHeaderCell.js +1 -1
- package/dist/components/MaterialUI/DataDisplay/TableProps.js +7 -7
- package/dist/components/MaterialUI/DataDisplay/Timeline.js +1 -1
- package/dist/components/MaterialUI/DataDisplay/TimelineItem.js +1 -1
- package/dist/components/MaterialUI/DataDisplay/TooltippedElements/MultipleLinesText.js +7 -7
- package/dist/components/MaterialUI/DataDisplay/TooltippedElements/TooltippedIcon.js +4 -4
- package/dist/components/MaterialUI/DataDisplay/TooltippedElements/TooltippedTypography.js +2 -2
- package/dist/components/MaterialUI/DataDisplay/TransferList.js +10 -10
- package/dist/components/MaterialUI/DataDisplay/chipProps.js +7 -7
- package/dist/components/MaterialUI/DataDisplay/collapsableListProps.js +7 -7
- package/dist/components/MaterialUI/DataDisplay/dividerProps.js +7 -7
- package/dist/components/MaterialUI/DataDisplay/index.js +1 -1
- package/dist/components/MaterialUI/DataDisplay/modalProps.js +7 -7
- package/dist/components/MaterialUI/DataDisplay/tableHelpers.js +9 -5
- package/dist/components/MaterialUI/DataDisplay/useTableSelection.js +7 -7
- package/dist/components/MaterialUI/Feedback/NotificationContext.js +6 -6
- package/dist/components/MaterialUI/Feedback/loadingScreen.js +6 -6
- package/dist/components/MaterialUI/Inputs/Autocomplete.js +6 -6
- package/dist/components/MaterialUI/Inputs/AutocompleteProps.js +7 -7
- package/dist/components/MaterialUI/Inputs/Checkbox.js +5 -5
- package/dist/components/MaterialUI/Inputs/CheckboxGroup.js +5 -5
- package/dist/components/MaterialUI/Inputs/CheckboxGroupProps.js +7 -7
- package/dist/components/MaterialUI/Inputs/CheckboxProps.js +7 -7
- package/dist/components/MaterialUI/Inputs/DatePicker.js +16 -17
- package/dist/components/MaterialUI/Inputs/InputBase.js +15 -12
- package/dist/components/MaterialUI/Inputs/InputBaseProps.js +7 -7
- package/dist/components/MaterialUI/Inputs/LookupSelect.js +3 -3
- package/dist/components/MaterialUI/Inputs/PredefinedElements/SearchControl.js +2 -2
- package/dist/components/MaterialUI/Inputs/PredefinedElements/TitledSelect.js +1 -1
- package/dist/components/MaterialUI/Inputs/Radio.js +2 -2
- package/dist/components/MaterialUI/Inputs/RadioProps.js +7 -7
- package/dist/components/MaterialUI/Inputs/Select.js +24 -11
- package/dist/components/MaterialUI/Inputs/SelectProps.js +9 -8
- package/dist/components/MaterialUI/Inputs/StandaloneRadio.js +5 -5
- package/dist/components/MaterialUI/Inputs/Switch.js +33 -21
- package/dist/components/MaterialUI/Inputs/SwitchProps.js +7 -7
- package/dist/components/MaterialUI/Inputs/TimePicker.js +7 -7
- package/dist/components/MaterialUI/Inputs/createInput.js +6 -6
- package/dist/components/MaterialUI/Inputs/index.js +1 -1
- package/dist/components/MaterialUI/Inputs/standaloneRadioProps.js +7 -7
- package/dist/components/MaterialUI/Navigation/DropDownMenu.js +6 -6
- package/dist/components/MaterialUI/Navigation/DropDownMenuProps.js +7 -7
- package/dist/components/MaterialUI/Navigation/ExternalLink.js +1 -1
- package/dist/components/MaterialUI/Navigation/PredefinedElements/ActionMenu.js +1 -1
- package/dist/components/MaterialUI/Navigation/TabBar.js +60 -38
- package/dist/components/MaterialUI/Navigation/TabLabel.js +5 -5
- package/dist/components/MaterialUI/ScopeSelector/ScopeSelector.js +1 -1
- package/dist/components/MaterialUI/ScopeSelector/ScopeTreeView.js +5 -5
- package/dist/components/MaterialUI/ScopeSelector/TreeItem.js +13 -8
- package/dist/components/MaterialUI/Surfaces/ExpansionPanel.js +5 -5
- package/dist/components/MaterialUI/Surfaces/Paper.js +2 -2
- package/dist/components/MaterialUI/Surfaces/PredefinedElements/TitledPaper.js +1 -1
- package/dist/components/MaterialUI/Surfaces/SectionExpansionPanel.js +5 -5
- package/dist/components/MaterialUI/Surfaces/expansionPanelProps.js +8 -8
- package/dist/components/MaterialUI/Surfaces/paperProps.js +7 -7
- package/dist/components/MaterialUI/componentProps.js +3 -3
- package/dist/components/MaterialUI/hocs/withDeferredPopper.js +10 -16
- package/dist/components/MaterialUI/hocs/withDeferredTooltip.js +10 -9
- package/dist/components/MaterialUI/muiThemes.js +3 -3
- package/dist/components/MaterialUI/textProps.js +7 -7
- package/dist/components/Modal/Background.js +1 -1
- package/dist/components/Modal/Dialog.js +2 -2
- package/dist/components/Modal/Wrapper.js +2 -2
- package/dist/components/Modal/index.js +6 -6
- package/dist/components/Modules.js +9 -9
- package/dist/components/MultiSelector.js +9 -9
- package/dist/components/Navigation/Bar.js +9 -9
- package/dist/components/Navigation/Tab.js +8 -8
- package/dist/components/Navigation/index.js +2 -1
- package/dist/components/Navigation/useNavigationState.js +9 -9
- package/dist/components/Placeholder.js +5 -5
- package/dist/components/Provision.js +1 -1
- package/dist/components/Routing/FullPage.js +1 -1
- package/dist/components/Routing/Page.js +7 -7
- package/dist/components/Routing/Segment.js +2 -2
- package/dist/components/Routing/SegmentPage.js +11 -11
- package/dist/components/Routing/SubPage.js +5 -5
- package/dist/components/Routing/withWaypointing.js +5 -5
- package/dist/components/Scope/ScopeModificationConfirmationDialog.js +1 -1
- package/dist/components/Scope/ScopeNode.js +6 -6
- package/dist/components/Scope/Selector.js +1 -1
- package/dist/components/Scope/index.js +9 -9
- package/dist/components/Scope/useScopeConfirmationModalState.js +10 -10
- package/dist/components/Scope/useScopeSelect.js +1 -1
- package/dist/components/ScopeExtendedConfigurationLoader.js +5 -5
- package/dist/components/Selector.js +9 -9
- package/dist/components/Sidepanel.js +2 -2
- package/dist/components/Spritesheet.js +1 -1
- package/dist/components/Switch.js +5 -5
- package/dist/components/TaskDetailsModal.js +2 -2
- package/dist/components/Text.js +6 -6
- package/dist/components/ToastList.js +9 -6
- package/dist/components/Toolbar.js +5 -5
- package/dist/components/Tooltip.js +1 -1
- package/dist/components/Treeview/Branch.js +1 -1
- package/dist/components/Treeview/Label.js +2 -2
- package/dist/components/Treeview/Leaf.js +1 -1
- package/dist/components/Treeview/Node.js +7 -7
- package/dist/components/Treeview/index.js +11 -11
- package/dist/constants.js +7 -1
- package/dist/getThemeOverrides.js +3 -3
- package/dist/hocs/withAuthentication.js +2 -2
- package/dist/hocs/withClickOutside.js +4 -4
- package/dist/hocs/withErrorBoundary.js +7 -7
- package/dist/hocs/withId.js +4 -4
- package/dist/hocs/withNavigationLink.js +5 -5
- package/dist/hocs/withScopeData.js +5 -5
- package/dist/hocs/withScrollBox.js +4 -4
- package/dist/hocs/withToggle.js +8 -8
- package/dist/hocs/withUpdateHandler.js +3 -3
- package/dist/hocs/withViewState.js +5 -5
- package/dist/hooks/useEditState.js +3 -3
- package/dist/hooks/useEntityLoader.js +8 -8
- package/dist/hooks/useFullEntityEditState.js +8 -8
- package/dist/hooks/useInfiniteScroll.js +4 -4
- package/dist/hooks/useLabelMessage.js +4 -4
- package/dist/hooks/useMultipleFieldEditState.js +3 -3
- package/dist/hooks/useNotificationRequestState.js +4 -4
- package/dist/hooks/useRequestState.js +1 -1
- package/dist/hooks/useScopeGuardLoader.js +1 -1
- package/dist/hooks/useSelectorAndUnwrap.js +1 -1
- package/dist/hooks/useToggle.js +4 -4
- package/dist/reducers/applications.js +1 -1
- package/dist/reducers/authentication.js +5 -5
- package/dist/reducers/countries.js +1 -1
- package/dist/reducers/globalErrorMessages.js +1 -1
- package/dist/reducers/localeFactory.js +1 -1
- package/dist/reducers/metadata.js +18 -10
- package/dist/reducers/modules.js +1 -1
- package/dist/reducers/navigation.js +1 -1
- package/dist/reducers/request.js +1 -1
- package/dist/reducers/requestStates.js +1 -1
- package/dist/reducers/scopeRouteState.js +1 -1
- package/dist/reducers/scopes.js +1 -1
- package/dist/reducers/scopesExtendedConfiguration.js +1 -1
- package/dist/reducers/settings.js +1 -1
- package/dist/reducers/tasks.js +1 -1
- package/dist/reducers/timezones.js +1 -1
- package/dist/reducers/toasts.js +1 -1
- package/dist/reducers/versionInfo.js +1 -1
- package/dist/reducers/view.js +1 -1
- package/dist/selectors/locale.js +1 -1
- package/dist/selectors/metadata.js +4 -4
- package/dist/selectors/modules.js +3 -3
- package/dist/selectors/navigation.js +1 -1
- package/dist/selectors/route.js +1 -1
- package/dist/selectors/scope.js +1 -1
- package/dist/selectors/tasks.js +1 -1
- package/dist/utils/buildUrl.js +19 -5
- package/dist/utils/filterHelper.js +4 -2
- package/dist/utils/flatten.js +7 -7
- package/dist/utils/index.js +1 -1
- package/dist/utils/inputHelper.js +71 -0
- package/dist/utils/logPass.js +1 -1
- package/dist/utils/memoize.js +1 -1
- package/dist/utils/modelValidationHelper.js +3 -3
- package/dist/utils/normalizeForSearch.js +4 -1
- package/dist/utils/propertyBagHelper.js +4 -4
- package/dist/utils/propertyHelper.js +6 -6
- package/dist/utils/propertyValidator.js +1 -1
- package/dist/utils/setTranslation.js +3 -3
- package/dist/utils/setTranslationWithFallback.js +3 -3
- package/dist/utils/stripKey.js +4 -4
- package/dist/utils/styledPropFuncs.js +1 -1
- package/dist/utils/testUtils.js +8 -5
- package/dist/utils/timezoneHelper.js +6 -6
- package/dist/utils/unwrapImmutable.js +1 -1
- package/dist/utils/urlHelper.js +3 -3
- package/dist/whyDidYouRerender.js +1 -1
- package/package.json +2 -5
- package/src/components/AppFrame/About.js +4 -3
- package/src/components/AppFrame/About.test.js +61 -0
- package/src/components/AppFrame/ConnectedToastList.test.js +3 -1
- package/src/components/DropMenu/DropMenu.test.js +2 -0
- package/src/components/Form/InputField.js +1 -1
- package/src/components/Form/InputField.test.js +1 -1
- package/src/components/MaterialUI/DataDisplay/Badge.js +1 -1
- package/src/components/MaterialUI/DataDisplay/PredefinedElements/InformationItem.js +29 -8
- package/src/components/MaterialUI/DataDisplay/PredefinedElements/InformationItem.test.js +18 -6
- package/src/components/MaterialUI/DataDisplay/PredefinedElements/StepperModal.js +27 -6
- package/src/components/MaterialUI/DataDisplay/PredefinedElements/StepperModal.test.js +202 -0
- package/src/components/MaterialUI/DataDisplay/SelectionList.js +6 -20
- package/src/components/MaterialUI/DataDisplay/SelectionList.test.js +0 -6
- package/src/components/MaterialUI/DataDisplay/tableHelpers.js +14 -4
- package/src/components/MaterialUI/Feedback/loadingScreen.test.js +1 -0
- package/src/components/MaterialUI/Feedback/useNotification.test.js +1 -0
- package/src/components/MaterialUI/Inputs/DatePicker.js +16 -4
- package/src/components/MaterialUI/Inputs/DatePicker.test.js +35 -1
- package/src/components/MaterialUI/Inputs/InputBase.js +2 -0
- package/src/components/MaterialUI/Inputs/InputBase.test.js +49 -0
- package/src/components/MaterialUI/Inputs/Select.js +13 -1
- package/src/components/MaterialUI/Inputs/Select.test.js +37 -0
- package/src/components/MaterialUI/Inputs/SelectProps.js +1 -0
- package/src/components/MaterialUI/Inputs/Switch.js +28 -6
- package/src/components/MaterialUI/Inputs/Switch.test.js +39 -0
- package/src/components/MaterialUI/Navigation/TabBar.js +55 -34
- package/src/components/MaterialUI/ScopeSelector/TreeItem.js +6 -2
- package/src/components/MaterialUI/ScopeSelector/TreeItem.test.js +39 -0
- package/src/components/MaterialUI/hocs/withDeferredPopper.js +1 -4
- package/src/components/MaterialUI/hocs/withDeferredPopper.test.js +2 -0
- package/src/components/Modal/Modal.test.js +3 -1
- package/src/components/Modal/Wrapper.test.js +3 -1
- package/src/components/Routing/SegmentPage.js +2 -1
- package/src/components/Scope/Scope.test.js +3 -1
- package/src/components/Sidepanel.test.js +3 -1
- package/src/components/ToastList.js +2 -2
- package/src/constants.js +5 -0
- package/src/hocs/withErrorBoundary.test.js +4 -3
- package/src/hooks/useEditState.test.js +2 -0
- package/src/hooks/useLabelMessage.test.js +2 -0
- package/src/reducers/metadata.js +12 -17
- package/src/reducers/metadata.test.js +318 -156
- package/src/utils/buildUrl.js +15 -0
- package/src/utils/buildUrl.test.js +27 -1
- package/src/utils/filterHelper.js +4 -2
- package/src/utils/filterHelper.test.js +6 -6
- package/src/utils/inputHelper.js +22 -0
- package/src/utils/inputHelper.test.js +47 -0
- package/src/utils/normalizeForSearch.js +2 -0
- package/src/utils/propertyBagHelper.js +6 -3
- package/src/utils/propertyHelper.js +6 -6
- package/src/utils/testUtils.js +25 -22
- package/src/utils/testUtils.test.js +4 -4
package/dist/utils/testUtils.js
CHANGED
|
@@ -14,7 +14,7 @@ var _styles = require("@material-ui/core/styles");
|
|
|
14
14
|
var _reactIntl = require("react-intl");
|
|
15
15
|
var _reactRedux = require("react-redux");
|
|
16
16
|
var _NotificationContext = require("./../components/MaterialUI/Feedback/NotificationContext");
|
|
17
|
-
function _interopRequireDefault(
|
|
17
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
18
18
|
(function () {
|
|
19
19
|
var enterModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.enterModule : undefined;
|
|
20
20
|
enterModule && enterModule(module);
|
|
@@ -23,12 +23,12 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
23
23
|
var enterModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.enterModule : undefined;
|
|
24
24
|
enterModule && enterModule(module);
|
|
25
25
|
})();
|
|
26
|
-
function _slicedToArray(
|
|
26
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
27
27
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
28
|
-
function _unsupportedIterableToArray(
|
|
29
|
-
function _arrayLikeToArray(
|
|
28
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
29
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
30
30
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
31
|
-
function _arrayWithHoles(
|
|
31
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
32
32
|
var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) {
|
|
33
33
|
return a;
|
|
34
34
|
};
|
|
@@ -43,6 +43,7 @@ var spyOnConsole = exports.spyOnConsole = function spyOnConsole(spyNames) {
|
|
|
43
43
|
spyNames = ["log", "warn", "error"];
|
|
44
44
|
}
|
|
45
45
|
var spiedFuncs;
|
|
46
|
+
// eslint-disable-next-line no-undef
|
|
46
47
|
beforeEach(function () {
|
|
47
48
|
spiedFuncs = spyNames.map(function (funcName) {
|
|
48
49
|
var func = sinon.spy().named("console." + funcName);
|
|
@@ -51,6 +52,7 @@ var spyOnConsole = exports.spyOnConsole = function spyOnConsole(spyNames) {
|
|
|
51
52
|
return oldFunc;
|
|
52
53
|
});
|
|
53
54
|
});
|
|
55
|
+
// eslint-disable-next-line no-undef
|
|
54
56
|
afterEach(function () {
|
|
55
57
|
spiedFuncs.forEach(function (func, index) {
|
|
56
58
|
var name = spyNames[index];
|
|
@@ -117,6 +119,7 @@ var PropStruct = exports.PropStruct = _react.default.forwardRef(function (props,
|
|
|
117
119
|
);
|
|
118
120
|
});
|
|
119
121
|
var ignoreConsoleError = exports.ignoreConsoleError = function ignoreConsoleError(func) {
|
|
122
|
+
// eslint-disable-next-line no-undef
|
|
120
123
|
jest.spyOn(console, "error");
|
|
121
124
|
console.error.mockImplementation(function () {});
|
|
122
125
|
func();
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports.timeZonesList = exports.getTimeZoneName = exports.getTimeZoneByName = exports.getTimeZone = exports.convertTimeToOtherTimeZone = exports.convertTimeToLocalTimeZone = void 0;
|
|
5
5
|
var _momentTimezone = _interopRequireDefault(require("moment-timezone"));
|
|
6
|
-
function _interopRequireDefault(
|
|
6
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
7
7
|
(function () {
|
|
8
8
|
var enterModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.enterModule : undefined;
|
|
9
9
|
enterModule && enterModule(module);
|
|
@@ -12,13 +12,13 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
12
12
|
var enterModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.enterModule : undefined;
|
|
13
13
|
enterModule && enterModule(module);
|
|
14
14
|
})();
|
|
15
|
-
function _createForOfIteratorHelperLoose(
|
|
16
|
-
function _slicedToArray(
|
|
15
|
+
function _createForOfIteratorHelperLoose(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (t) return (t = t.call(r)).next.bind(t); if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var o = 0; return function () { return o >= r.length ? { done: !0 } : { done: !1, value: r[o++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
16
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
17
17
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
18
|
-
function _unsupportedIterableToArray(
|
|
19
|
-
function _arrayLikeToArray(
|
|
18
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
19
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
20
20
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
21
|
-
function _arrayWithHoles(
|
|
21
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
22
22
|
var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) {
|
|
23
23
|
return a;
|
|
24
24
|
};
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports.unwrapImmutable = exports.default = void 0;
|
|
5
5
|
var _immutable = _interopRequireDefault(require("immutable4"));
|
|
6
|
-
function _interopRequireDefault(
|
|
6
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
7
7
|
(function () {
|
|
8
8
|
var enterModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.enterModule : undefined;
|
|
9
9
|
enterModule && enterModule(module);
|
package/dist/utils/urlHelper.js
CHANGED
|
@@ -10,9 +10,9 @@ exports.tryGetNewEntityIdKey = exports.resolveEntityId = exports.getValueFromUrl
|
|
|
10
10
|
var enterModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.enterModule : undefined;
|
|
11
11
|
enterModule && enterModule(module);
|
|
12
12
|
})();
|
|
13
|
-
function _createForOfIteratorHelperLoose(
|
|
14
|
-
function _unsupportedIterableToArray(
|
|
15
|
-
function _arrayLikeToArray(
|
|
13
|
+
function _createForOfIteratorHelperLoose(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (t) return (t = t.call(r)).next.bind(t); if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var o = 0; return function () { return o >= r.length ? { done: !0 } : { done: !1, value: r[o++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
14
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
15
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
16
16
|
var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) {
|
|
17
17
|
return a;
|
|
18
18
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _react = _interopRequireDefault(require("react"));
|
|
4
|
-
function _interopRequireDefault(
|
|
4
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
5
5
|
var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) {
|
|
6
6
|
return a;
|
|
7
7
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "orc-shared",
|
|
3
|
-
"version": "5.8.0-dev.
|
|
3
|
+
"version": "5.8.0-dev.21",
|
|
4
4
|
"description": "Shared code for Orckestra applications",
|
|
5
5
|
"main": "./src/index.js",
|
|
6
6
|
"exports": {
|
|
@@ -54,11 +54,8 @@
|
|
|
54
54
|
"devDependencies": {
|
|
55
55
|
"@testing-library/react": "^10.4.9"
|
|
56
56
|
},
|
|
57
|
-
"peerDependencies": {
|
|
58
|
-
"orc-scripts": "2.0.0-dev.4"
|
|
59
|
-
},
|
|
60
57
|
"dependencies": {
|
|
61
|
-
"orc-scripts": "
|
|
58
|
+
"orc-scripts": "^4.0.0-dev.10",
|
|
62
59
|
"react-number-format": "^5.3.0"
|
|
63
60
|
},
|
|
64
61
|
"sideEffects": false,
|
|
@@ -13,6 +13,7 @@ import close from "../../content/close.png";
|
|
|
13
13
|
import { getVersionSelector } from "../../selectors/versionInfo";
|
|
14
14
|
import { currentLocaleOrDefault } from "../../selectors/locale";
|
|
15
15
|
import sharedMessages from "./../../sharedMessages";
|
|
16
|
+
import { trimStart } from "lodash";
|
|
16
17
|
|
|
17
18
|
export const ABOUT_NAME = "__aboutBox";
|
|
18
19
|
|
|
@@ -125,7 +126,7 @@ export const About = ({ currentApplication }) => {
|
|
|
125
126
|
key="orc-shared-version"
|
|
126
127
|
message={{
|
|
127
128
|
...sharedMessages.orcSharedVersion,
|
|
128
|
-
values: { version: DEPENDENCIES["orc-shared"] },
|
|
129
|
+
values: { version: trimStart(DEPENDENCIES["orc-shared"], "^") },
|
|
129
130
|
}}
|
|
130
131
|
/>,
|
|
131
132
|
]
|
|
@@ -137,7 +138,7 @@ export const About = ({ currentApplication }) => {
|
|
|
137
138
|
key="orc-scripts-version"
|
|
138
139
|
message={{
|
|
139
140
|
...sharedMessages.orcScriptsVersion,
|
|
140
|
-
values: { version: DEPENDENCIES["orc-scripts"] },
|
|
141
|
+
values: { version: trimStart(DEPENDENCIES["orc-scripts"], "^") },
|
|
141
142
|
}}
|
|
142
143
|
/>,
|
|
143
144
|
]
|
|
@@ -149,7 +150,7 @@ export const About = ({ currentApplication }) => {
|
|
|
149
150
|
key="orc-secret-version"
|
|
150
151
|
message={{
|
|
151
152
|
...sharedMessages.orcSecretVersion,
|
|
152
|
-
values: { version: DEPENDENCIES["orc-secret"] },
|
|
153
|
+
values: { version: trimStart(DEPENDENCIES["orc-secret"], "^") },
|
|
153
154
|
}}
|
|
154
155
|
/>,
|
|
155
156
|
]
|
|
@@ -88,6 +88,67 @@ describe("About", () => {
|
|
|
88
88
|
);
|
|
89
89
|
});
|
|
90
90
|
|
|
91
|
+
it("renders an about box with normalized JS version", () => {
|
|
92
|
+
const orcSharedVersion = "^2.9.0";
|
|
93
|
+
const orcScriptsVersion = "^1.2.3";
|
|
94
|
+
const orcSecretVersion = "^5.1.7";
|
|
95
|
+
|
|
96
|
+
global.DEPENDENCIES = {
|
|
97
|
+
"orc-scripts": orcScriptsVersion,
|
|
98
|
+
"orc-secret": orcSecretVersion,
|
|
99
|
+
"orc-shared": orcSharedVersion,
|
|
100
|
+
};
|
|
101
|
+
global.BUILD_NUMBER = "2.3.2";
|
|
102
|
+
expect(
|
|
103
|
+
<Provider store={store}>
|
|
104
|
+
<IntlProvider locale="en-US" messages={messages}>
|
|
105
|
+
<About viewState={{ show: true }} currentApplication={{ displayName: "An application" }} />
|
|
106
|
+
</IntlProvider>
|
|
107
|
+
</Provider>,
|
|
108
|
+
"when mounted",
|
|
109
|
+
"to satisfy",
|
|
110
|
+
<IntlProvider locale="en-US" messages={messages}>
|
|
111
|
+
<AboutBox in>
|
|
112
|
+
<CloseButton>
|
|
113
|
+
<img src={close} alt="X" />
|
|
114
|
+
</CloseButton>
|
|
115
|
+
<img src={logoImage} alt="Orckestra" />
|
|
116
|
+
<AboutParagraph>
|
|
117
|
+
{stringifyWithoutQuotes(messages["orc-shared.ccVersion"]).replace("{version}", ccVersion)}
|
|
118
|
+
<br />
|
|
119
|
+
An application 2.3.2
|
|
120
|
+
<br />
|
|
121
|
+
{stringifyWithoutQuotes(messages["orc-shared.orcSharedVersion"]).replace(
|
|
122
|
+
"{version}",
|
|
123
|
+
orcSharedVersion.replace("^", ""),
|
|
124
|
+
)}
|
|
125
|
+
<br />
|
|
126
|
+
{stringifyWithoutQuotes(messages["orc-shared.orcScriptsVersion"]).replace(
|
|
127
|
+
"{version}",
|
|
128
|
+
orcScriptsVersion.replace("^", ""),
|
|
129
|
+
)}
|
|
130
|
+
<br />
|
|
131
|
+
{stringifyWithoutQuotes(messages["orc-shared.orcSecretVersion"]).replace(
|
|
132
|
+
"{version}",
|
|
133
|
+
orcSecretVersion.replace("^", ""),
|
|
134
|
+
)}
|
|
135
|
+
</AboutParagraph>
|
|
136
|
+
<AboutParagraph long>{stringifyWithoutQuotes(messages["orc-shared.copyrightTermsNotice"])}</AboutParagraph>
|
|
137
|
+
<AboutParagraph>
|
|
138
|
+
<AboutLink href="https://www.orckestra.com">
|
|
139
|
+
{stringifyWithoutQuotes(messages["orc-shared.ccName"])}
|
|
140
|
+
</AboutLink>
|
|
141
|
+
</AboutParagraph>
|
|
142
|
+
<AboutParagraph>
|
|
143
|
+
{stringifyWithoutQuotes(messages["orc-shared.copyright"]).replace("{year}", new Date().getFullYear())}
|
|
144
|
+
<br />
|
|
145
|
+
{stringifyWithoutQuotes(messages["orc-shared.allRightsReserved"])}
|
|
146
|
+
</AboutParagraph>
|
|
147
|
+
</AboutBox>
|
|
148
|
+
</IntlProvider>,
|
|
149
|
+
);
|
|
150
|
+
});
|
|
151
|
+
|
|
91
152
|
it("view state handler update show value when clicking on close button", () =>
|
|
92
153
|
expect(
|
|
93
154
|
<Provider store={store}>
|
|
@@ -169,7 +169,9 @@ describe("ConnectedToastList", () => {
|
|
|
169
169
|
try {
|
|
170
170
|
ReactDOM.unmountComponentAtNode(appRoot);
|
|
171
171
|
ReactDOM.unmountComponentAtNode(document.getElementById("toast"));
|
|
172
|
-
} catch
|
|
172
|
+
} catch {
|
|
173
|
+
// don't do anything
|
|
174
|
+
}
|
|
173
175
|
document.body.removeChild(appRoot);
|
|
174
176
|
});
|
|
175
177
|
});
|
|
@@ -93,6 +93,7 @@ describe("DropMenu", () => {
|
|
|
93
93
|
const clock = sinon.useFakeTimers();
|
|
94
94
|
const menuNode = document.createElement("div");
|
|
95
95
|
document.body.appendChild(menuNode);
|
|
96
|
+
// eslint-disable-next-line react/no-render-return-value
|
|
96
97
|
const menu = ReactDOM.render(
|
|
97
98
|
<div>
|
|
98
99
|
<div id="outside" />
|
|
@@ -212,6 +213,7 @@ describe("DropMenu", () => {
|
|
|
212
213
|
const clock = sinon.useFakeTimers();
|
|
213
214
|
const menuNode = document.createElement("div");
|
|
214
215
|
document.body.appendChild(menuNode);
|
|
216
|
+
// eslint-disable-next-line react/no-render-return-value
|
|
215
217
|
const menu = ReactDOM.render(
|
|
216
218
|
<div>
|
|
217
219
|
<div id="outside" />
|
|
@@ -19,7 +19,7 @@ export const InputField = ({ name, type = "undefined", label, labelOnly, placeho
|
|
|
19
19
|
const Input = inputs[type];
|
|
20
20
|
if (!Input) {
|
|
21
21
|
console.error(`Unknown type "${type}", cannot render field`);
|
|
22
|
-
return <p>Cannot render unknown type
|
|
22
|
+
return <p>Cannot render unknown type &{type}&</p>;
|
|
23
23
|
}
|
|
24
24
|
return (
|
|
25
25
|
<Field
|
|
@@ -93,7 +93,7 @@ describe("InputField", () => {
|
|
|
93
93
|
</SubjectWrapper>,
|
|
94
94
|
"when mounted",
|
|
95
95
|
"to satisfy",
|
|
96
|
-
<p>Cannot render unknown type
|
|
96
|
+
<p>Cannot render unknown type &{"undefined"}&</p>,
|
|
97
97
|
).then(() =>
|
|
98
98
|
expect(console.error, "to have calls satisfying", [{ args: ['Unknown type "undefined", cannot render field'] }]),
|
|
99
99
|
));
|
|
@@ -13,7 +13,7 @@ const useStyles = makeStyles(theme => ({
|
|
|
13
13
|
|
|
14
14
|
const Badge = ({ children, badge, ...props }) => {
|
|
15
15
|
const classes = useStyles();
|
|
16
|
-
const classProp =
|
|
16
|
+
const classProp = props.classProp?.badge ? props.classProp : classes;
|
|
17
17
|
|
|
18
18
|
return (
|
|
19
19
|
<BadgeMui overlap="circular" color="primary" max={999} badgeContent={badge} classes={classProp}>
|
|
@@ -12,14 +12,16 @@ import classNames from "classnames";
|
|
|
12
12
|
const useStyles = makeStyles(theme => ({
|
|
13
13
|
title: {
|
|
14
14
|
fontSize: theme.typography.fieldLabelSize,
|
|
15
|
-
color:
|
|
15
|
+
color: theme.palette.text.hint,
|
|
16
16
|
fontFamily: theme.typography.fontFamily,
|
|
17
17
|
marginBottom: theme.spacing(1),
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
},
|
|
19
|
+
titleError: {
|
|
20
|
+
color: theme.palette.error.main,
|
|
21
|
+
},
|
|
22
|
+
titleRequired: {
|
|
23
|
+
paddingLeft: theme.spacing(0.5),
|
|
24
|
+
color: theme.palette.error.main,
|
|
23
25
|
},
|
|
24
26
|
value: {
|
|
25
27
|
fontSize: theme.typography.fontSize,
|
|
@@ -77,9 +79,26 @@ const InformationItemChildren = ({
|
|
|
77
79
|
return <MultipleLinesText textProps={multipleLinesTextProps} children={value} tooltipClasses={tooltipClasses} />;
|
|
78
80
|
};
|
|
79
81
|
|
|
80
|
-
const InformationItemHeader = ({ classes, label, headerIcon, headerIconClassName }) => {
|
|
82
|
+
const InformationItemHeader = ({ classes, label, headerIcon, headerIconClassName, required, error }) => {
|
|
81
83
|
const formattedLabel = typeof label === "object" ? <FormattedMessage {...label} /> : label;
|
|
82
|
-
const
|
|
84
|
+
const titleClasses = classNames(classes.title, { [classes.titleError]: error });
|
|
85
|
+
const headerText =
|
|
86
|
+
(formattedLabel && (
|
|
87
|
+
<Typography
|
|
88
|
+
className={titleClasses}
|
|
89
|
+
children={
|
|
90
|
+
<>
|
|
91
|
+
{formattedLabel}
|
|
92
|
+
{required && (
|
|
93
|
+
<span data-qa="required" className={classes.titleRequired}>
|
|
94
|
+
*
|
|
95
|
+
</span>
|
|
96
|
+
)}
|
|
97
|
+
</>
|
|
98
|
+
}
|
|
99
|
+
/>
|
|
100
|
+
)) ??
|
|
101
|
+
null;
|
|
83
102
|
|
|
84
103
|
if (headerIcon) {
|
|
85
104
|
return (
|
|
@@ -113,6 +132,8 @@ const InformationItem = ({
|
|
|
113
132
|
<InformationItemHeader
|
|
114
133
|
classes={classes}
|
|
115
134
|
label={label}
|
|
135
|
+
required={required}
|
|
136
|
+
error={error}
|
|
116
137
|
headerIcon={headerIcon}
|
|
117
138
|
headerIconClassName={headerIconClassName}
|
|
118
139
|
/>
|
|
@@ -237,7 +237,7 @@ describe("Information Item", () => {
|
|
|
237
237
|
|
|
238
238
|
const component = (
|
|
239
239
|
<IntlProvider locale="en" messages={{ label }}>
|
|
240
|
-
<InformationItem label={label} required={
|
|
240
|
+
<InformationItem label={label} required={false}>
|
|
241
241
|
{value}
|
|
242
242
|
</InformationItem>
|
|
243
243
|
</IntlProvider>
|
|
@@ -272,19 +272,31 @@ describe("Information Item", () => {
|
|
|
272
272
|
|
|
273
273
|
it("Renders Information Item with required", () => {
|
|
274
274
|
const label = "label";
|
|
275
|
-
const value =
|
|
275
|
+
const value = <p>Value</p>;
|
|
276
276
|
|
|
277
|
-
const component =
|
|
277
|
+
const component = (
|
|
278
278
|
<IntlProvider locale="en-US">
|
|
279
279
|
<InformationItem label={label} required={true}>
|
|
280
280
|
{value}
|
|
281
281
|
</InformationItem>
|
|
282
|
-
</IntlProvider
|
|
282
|
+
</IntlProvider>
|
|
283
283
|
);
|
|
284
284
|
|
|
285
|
-
const
|
|
285
|
+
const expected = (
|
|
286
|
+
<div>
|
|
287
|
+
<Typography
|
|
288
|
+
children={
|
|
289
|
+
<>
|
|
290
|
+
{label}
|
|
291
|
+
<span data-qa="required">*</span>
|
|
292
|
+
</>
|
|
293
|
+
}
|
|
294
|
+
/>
|
|
295
|
+
{value}
|
|
296
|
+
</div>
|
|
297
|
+
);
|
|
286
298
|
|
|
287
|
-
expect(
|
|
299
|
+
expect(component, "when mounted", "to satisfy", expected);
|
|
288
300
|
});
|
|
289
301
|
|
|
290
302
|
it("Renders Information Item properly with a header icon", () => {
|
|
@@ -142,7 +142,12 @@ const StepperModal = ({
|
|
|
142
142
|
modalProps.set(ModalProps.propNames.backdropClickCallback, backdropCallback ?? closeCallback);
|
|
143
143
|
modalProps.set(ModalProps.propNames.type, type);
|
|
144
144
|
|
|
145
|
-
const nextClick = useCallback(
|
|
145
|
+
const nextClick = useCallback(customHandler => {
|
|
146
|
+
if (customHandler) {
|
|
147
|
+
customHandler();
|
|
148
|
+
}
|
|
149
|
+
changeCurrentStep(step => step + 1);
|
|
150
|
+
}, []);
|
|
146
151
|
const backClick = useCallback(() => changeCurrentStep(step => step - 1), []);
|
|
147
152
|
|
|
148
153
|
const actionPanel = (
|
|
@@ -159,11 +164,27 @@ const StepperModal = ({
|
|
|
159
164
|
<Button variant="outlined" onClick={closeCallback}>
|
|
160
165
|
<FormattedMessage {...sharedMessages.cancel} />
|
|
161
166
|
</Button>
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
+
|
|
168
|
+
{currentStep < steps.length - 1 &&
|
|
169
|
+
(steps[currentStep]?.actions?.length > 0 ? (
|
|
170
|
+
steps[currentStep].actions.map(action => (
|
|
171
|
+
<Button
|
|
172
|
+
key={action.value}
|
|
173
|
+
variant="contained"
|
|
174
|
+
color="primary"
|
|
175
|
+
disabled={nextDisabled}
|
|
176
|
+
onClick={() => nextClick(action.handler)}
|
|
177
|
+
disableElevation
|
|
178
|
+
>
|
|
179
|
+
{action.label}
|
|
180
|
+
</Button>
|
|
181
|
+
))
|
|
182
|
+
) : (
|
|
183
|
+
<Button variant="contained" color="primary" disabled={nextDisabled} onClick={nextClick} disableElevation>
|
|
184
|
+
<FormattedMessage {...sharedMessages.next} />
|
|
185
|
+
</Button>
|
|
186
|
+
))}
|
|
187
|
+
|
|
167
188
|
{currentStep === steps.length - 1 && (
|
|
168
189
|
<Button
|
|
169
190
|
variant="contained"
|