orc-shared 5.8.0-dev.8 → 5.8.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/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 +7 -7
- package/dist/actions/makeOrcApiAction.js +2 -2
- package/dist/actions/metadata.js +7 -7
- package/dist/actions/navigation.js +2 -2
- 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 +4 -4
- package/dist/components/AppFrame/About.js +9 -9
- 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 +7 -7
- 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 +6 -6
- 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 -4
- 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 +11 -11
- 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 +2 -2
- 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 +4 -4
- package/dist/components/MaterialUI/DataDisplay/Notification.js +8 -8
- package/dist/components/MaterialUI/DataDisplay/NotificationProps.js +6 -6
- 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 +3 -3
- 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 +28 -12
- package/dist/components/MaterialUI/DataDisplay/PredefinedElements/TableInfoBar.js +1 -1
- package/dist/components/MaterialUI/DataDisplay/PredefinedElements/Translations.js +9 -9
- 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 +6 -6
- 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 +9 -9
- package/dist/components/MaterialUI/DataDisplay/chipProps.js +6 -6
- package/dist/components/MaterialUI/DataDisplay/collapsableListProps.js +6 -6
- package/dist/components/MaterialUI/DataDisplay/dividerProps.js +6 -6
- package/dist/components/MaterialUI/DataDisplay/index.js +1 -1
- package/dist/components/MaterialUI/DataDisplay/modalProps.js +6 -6
- package/dist/components/MaterialUI/DataDisplay/tableHelpers.js +9 -5
- package/dist/components/MaterialUI/DataDisplay/useTableSelection.js +6 -6
- 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 +5 -5
- package/dist/components/MaterialUI/Inputs/AutocompleteProps.js +6 -6
- package/dist/components/MaterialUI/Inputs/Checkbox.js +4 -4
- package/dist/components/MaterialUI/Inputs/CheckboxGroup.js +4 -4
- package/dist/components/MaterialUI/Inputs/CheckboxGroupProps.js +6 -6
- package/dist/components/MaterialUI/Inputs/CheckboxProps.js +6 -6
- package/dist/components/MaterialUI/Inputs/DatePicker.js +15 -16
- package/dist/components/MaterialUI/Inputs/InputBase.js +11 -11
- package/dist/components/MaterialUI/Inputs/InputBaseProps.js +6 -6
- 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 +4 -3
- package/dist/components/MaterialUI/Inputs/RadioProps.js +6 -6
- package/dist/components/MaterialUI/Inputs/Select.js +23 -10
- package/dist/components/MaterialUI/Inputs/SelectProps.js +8 -7
- package/dist/components/MaterialUI/Inputs/StandaloneRadio.js +4 -4
- package/dist/components/MaterialUI/Inputs/Switch.js +32 -20
- package/dist/components/MaterialUI/Inputs/SwitchProps.js +6 -6
- package/dist/components/MaterialUI/Inputs/TimePicker.js +7 -7
- package/dist/components/MaterialUI/Inputs/createInput.js +5 -5
- package/dist/components/MaterialUI/Inputs/index.js +1 -1
- package/dist/components/MaterialUI/Inputs/standaloneRadioProps.js +6 -6
- package/dist/components/MaterialUI/Navigation/DropDownMenu.js +6 -6
- package/dist/components/MaterialUI/Navigation/DropDownMenuProps.js +6 -6
- 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 +12 -6
- 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 +7 -7
- package/dist/components/MaterialUI/Surfaces/paperProps.js +6 -6
- package/dist/components/MaterialUI/componentProps.js +2 -2
- package/dist/components/MaterialUI/hocs/withDeferredPopper.js +10 -16
- package/dist/components/MaterialUI/hocs/withDeferredTooltip.js +9 -9
- package/dist/components/MaterialUI/muiThemes.js +2 -2
- package/dist/components/MaterialUI/textProps.js +6 -6
- 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 +8 -8
- package/dist/components/Navigation/Tab.js +8 -8
- package/dist/components/Navigation/index.js +1 -1
- package/dist/components/Navigation/useNavigationState.js +8 -8
- 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 +10 -10
- package/dist/components/Routing/SubPage.js +5 -5
- package/dist/components/Routing/withWaypointing.js +4 -4
- 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 +8 -8
- 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 +6 -6
- package/dist/components/Treeview/index.js +10 -10
- package/dist/constants.js +7 -1
- package/dist/getThemeOverrides.js +2 -2
- 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 +7 -7
- package/dist/hocs/withUpdateHandler.js +2 -2
- package/dist/hocs/withViewState.js +5 -5
- package/dist/hooks/useEditState.js +2 -2
- package/dist/hooks/useEntityLoader.js +7 -7
- package/dist/hooks/useFullEntityEditState.js +7 -7
- package/dist/hooks/useInfiniteScroll.js +4 -4
- package/dist/hooks/useLabelMessage.js +3 -3
- package/dist/hooks/useMultipleFieldEditState.js +2 -2
- package/dist/hooks/useNotificationRequestState.js +3 -3
- 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 +6 -6
- 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 +3 -3
- package/dist/selectors/modules.js +2 -2
- 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/flatten.js +6 -6
- package/dist/utils/index.js +1 -1
- package/dist/utils/inputHelper.js +14 -2
- package/dist/utils/logPass.js +1 -1
- package/dist/utils/memoize.js +1 -1
- package/dist/utils/modelValidationHelper.js +2 -2
- 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 +3 -3
- 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 -2
- 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/StepperModal.js +33 -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/Radio.js +1 -1
- package/src/components/MaterialUI/Inputs/Radio.test.js +35 -1
- 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 +1 -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/utils/buildUrl.js +15 -0
- package/src/utils/buildUrl.test.js +27 -1
- package/src/utils/inputHelper.js +18 -2
- package/src/utils/inputHelper.test.js +18 -2
- 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
|
@@ -11,9 +11,9 @@ var _flatten = require("./flatten");
|
|
|
11
11
|
var enterModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.enterModule : undefined;
|
|
12
12
|
enterModule && enterModule(module);
|
|
13
13
|
})();
|
|
14
|
-
function _createForOfIteratorHelperLoose(
|
|
15
|
-
function _unsupportedIterableToArray(
|
|
16
|
-
function _arrayLikeToArray(
|
|
14
|
+
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."); }
|
|
15
|
+
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; } }
|
|
16
|
+
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; }
|
|
17
17
|
var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) {
|
|
18
18
|
return a;
|
|
19
19
|
};
|
|
@@ -11,9 +11,9 @@ var _flatten = require("./flatten");
|
|
|
11
11
|
var enterModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.enterModule : undefined;
|
|
12
12
|
enterModule && enterModule(module);
|
|
13
13
|
})();
|
|
14
|
-
function _createForOfIteratorHelperLoose(
|
|
15
|
-
function _unsupportedIterableToArray(
|
|
16
|
-
function _arrayLikeToArray(
|
|
14
|
+
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."); }
|
|
15
|
+
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; } }
|
|
16
|
+
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; }
|
|
17
17
|
var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) {
|
|
18
18
|
return a;
|
|
19
19
|
};
|
package/dist/utils/stripKey.js
CHANGED
|
@@ -10,9 +10,9 @@ exports.default = void 0;
|
|
|
10
10
|
var enterModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.enterModule : undefined;
|
|
11
11
|
enterModule && enterModule(module);
|
|
12
12
|
})();
|
|
13
|
-
function _objectWithoutProperties(
|
|
14
|
-
function _objectWithoutPropertiesLoose(
|
|
15
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i :
|
|
13
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], t.indexOf(o) >= 0 || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
14
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.indexOf(n) >= 0) continue; t[n] = r[n]; } return t; }
|
|
15
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
16
16
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
17
17
|
var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) {
|
|
18
18
|
return a;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports.switchEnum = exports.ifFlag = exports.getThemeProp = void 0;
|
|
5
5
|
var _safeGet = _interopRequireDefault(require("./safeGet"));
|
|
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/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
|
|
3
|
+
"version": "5.8.0",
|
|
4
4
|
"description": "Shared code for Orckestra applications",
|
|
5
5
|
"main": "./src/index.js",
|
|
6
6
|
"exports": {
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"@testing-library/react": "^10.4.9"
|
|
56
56
|
},
|
|
57
57
|
"dependencies": {
|
|
58
|
-
"orc-scripts": "^
|
|
58
|
+
"orc-scripts": "^4.0.1",
|
|
59
59
|
"react-number-format": "^5.3.0"
|
|
60
60
|
},
|
|
61
61
|
"sideEffects": false,
|
|
@@ -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}>
|
|
@@ -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,33 @@ 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
|
|
184
|
+
variant="contained"
|
|
185
|
+
color="primary"
|
|
186
|
+
disabled={nextDisabled}
|
|
187
|
+
onClick={() => nextClick()}
|
|
188
|
+
disableElevation
|
|
189
|
+
>
|
|
190
|
+
<FormattedMessage {...sharedMessages.next} />
|
|
191
|
+
</Button>
|
|
192
|
+
))}
|
|
193
|
+
|
|
167
194
|
{currentStep === steps.length - 1 && (
|
|
168
195
|
<Button
|
|
169
196
|
variant="contained"
|
|
@@ -133,6 +133,208 @@ describe("StepperModal", () => {
|
|
|
133
133
|
expect(component, "when mounted", "to satisfy", expected);
|
|
134
134
|
});
|
|
135
135
|
|
|
136
|
+
it("Renders StepperModal correctly with custom actions", () => {
|
|
137
|
+
const open = true;
|
|
138
|
+
const title = "title";
|
|
139
|
+
const backdropClickCallback = jest.fn();
|
|
140
|
+
const okCallback = jest.fn();
|
|
141
|
+
const cancelCallback = jest.fn();
|
|
142
|
+
const modalProps = new ModalProps();
|
|
143
|
+
const actions = [
|
|
144
|
+
{
|
|
145
|
+
value: "first value",
|
|
146
|
+
label: "first action",
|
|
147
|
+
Handler: () => {},
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
value: "second value",
|
|
151
|
+
label: "second action",
|
|
152
|
+
Handler: () => {},
|
|
153
|
+
},
|
|
154
|
+
];
|
|
155
|
+
const steps = [{ title: "step1", content: <div>content</div>, actions }, { title: "step2" }];
|
|
156
|
+
|
|
157
|
+
const titleComponent = (
|
|
158
|
+
<div>
|
|
159
|
+
<div>{title}</div>
|
|
160
|
+
<div>step1</div>
|
|
161
|
+
<div>step2</div>
|
|
162
|
+
</div>
|
|
163
|
+
);
|
|
164
|
+
const messageComponent = <div>{steps[0].content}</div>;
|
|
165
|
+
|
|
166
|
+
modalProps.set(ModalProps.propNames.title, titleComponent);
|
|
167
|
+
modalProps.set(ModalProps.propNames.open, open);
|
|
168
|
+
modalProps.set(ModalProps.propNames.backdropClickCallback, backdropClickCallback);
|
|
169
|
+
modalProps.set(ModalProps.propNames.type, "wide");
|
|
170
|
+
|
|
171
|
+
const actionPanel = (
|
|
172
|
+
<div>
|
|
173
|
+
<div></div>
|
|
174
|
+
<div>
|
|
175
|
+
<Button variant="outlined" disabled={false} onClick={() => cancelCallback()}>
|
|
176
|
+
{sharedMessages.cancel.defaultMessage}
|
|
177
|
+
</Button>
|
|
178
|
+
<Button variant="contained" color="primary" disabled={false} onClick={() => {}} disableElevation>
|
|
179
|
+
first action
|
|
180
|
+
</Button>
|
|
181
|
+
<Button variant="contained" color="primary" disabled={false} onClick={() => {}} disableElevation>
|
|
182
|
+
second action
|
|
183
|
+
</Button>
|
|
184
|
+
</div>
|
|
185
|
+
</div>
|
|
186
|
+
);
|
|
187
|
+
|
|
188
|
+
modalProps.set(ModalProps.propNames.actionPanel, actionPanel);
|
|
189
|
+
|
|
190
|
+
const component = (
|
|
191
|
+
<IntlProvider locale="en-US" messages={messages}>
|
|
192
|
+
<StepperModal
|
|
193
|
+
steps={steps}
|
|
194
|
+
title={title}
|
|
195
|
+
open={open}
|
|
196
|
+
confirmCallback={okCallback}
|
|
197
|
+
closeCallback={cancelCallback}
|
|
198
|
+
/>
|
|
199
|
+
</IntlProvider>
|
|
200
|
+
);
|
|
201
|
+
|
|
202
|
+
const expected = (
|
|
203
|
+
<IntlProvider locale="en-US" messages={messages}>
|
|
204
|
+
<Modal message={messageComponent} modalProps={modalProps} />
|
|
205
|
+
</IntlProvider>
|
|
206
|
+
);
|
|
207
|
+
|
|
208
|
+
expect(component, "when mounted", "to satisfy", expected);
|
|
209
|
+
});
|
|
210
|
+
|
|
211
|
+
it("Renders StepperModal correctly with disabled custom actions", () => {
|
|
212
|
+
const open = true;
|
|
213
|
+
const title = "title";
|
|
214
|
+
const backdropClickCallback = jest.fn();
|
|
215
|
+
const okCallback = jest.fn();
|
|
216
|
+
const cancelCallback = jest.fn();
|
|
217
|
+
const modalProps = new ModalProps();
|
|
218
|
+
const actions = [
|
|
219
|
+
{
|
|
220
|
+
value: "first value",
|
|
221
|
+
label: "first action",
|
|
222
|
+
Handler: () => {},
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
value: "second value",
|
|
226
|
+
label: "second action",
|
|
227
|
+
Handler: () => {},
|
|
228
|
+
},
|
|
229
|
+
];
|
|
230
|
+
const steps = [
|
|
231
|
+
{ title: "step1", nextDisabled: () => true, content: <div>content</div>, actions },
|
|
232
|
+
{ title: "step2" },
|
|
233
|
+
];
|
|
234
|
+
|
|
235
|
+
const titleComponent = (
|
|
236
|
+
<div>
|
|
237
|
+
<div>{title}</div>
|
|
238
|
+
<div>step1</div>
|
|
239
|
+
<div>step2</div>
|
|
240
|
+
</div>
|
|
241
|
+
);
|
|
242
|
+
const messageComponent = <div>{steps[0].content}</div>;
|
|
243
|
+
|
|
244
|
+
modalProps.set(ModalProps.propNames.title, titleComponent);
|
|
245
|
+
modalProps.set(ModalProps.propNames.open, open);
|
|
246
|
+
modalProps.set(ModalProps.propNames.backdropClickCallback, backdropClickCallback);
|
|
247
|
+
modalProps.set(ModalProps.propNames.type, "wide");
|
|
248
|
+
|
|
249
|
+
const actionPanel = (
|
|
250
|
+
<div>
|
|
251
|
+
<div></div>
|
|
252
|
+
<div>
|
|
253
|
+
<Button variant="outlined" disabled={false} onClick={() => cancelCallback()}>
|
|
254
|
+
{sharedMessages.cancel.defaultMessage}
|
|
255
|
+
</Button>
|
|
256
|
+
<Button variant="contained" color="primary" disabled={true} onClick={() => {}} disableElevation>
|
|
257
|
+
first action
|
|
258
|
+
</Button>
|
|
259
|
+
<Button variant="contained" color="primary" disabled={true} onClick={() => {}} disableElevation>
|
|
260
|
+
second action
|
|
261
|
+
</Button>
|
|
262
|
+
</div>
|
|
263
|
+
</div>
|
|
264
|
+
);
|
|
265
|
+
|
|
266
|
+
modalProps.set(ModalProps.propNames.actionPanel, actionPanel);
|
|
267
|
+
|
|
268
|
+
const component = (
|
|
269
|
+
<IntlProvider locale="en-US" messages={messages}>
|
|
270
|
+
<StepperModal
|
|
271
|
+
steps={steps}
|
|
272
|
+
title={title}
|
|
273
|
+
open={open}
|
|
274
|
+
confirmCallback={okCallback}
|
|
275
|
+
closeCallback={cancelCallback}
|
|
276
|
+
/>
|
|
277
|
+
</IntlProvider>
|
|
278
|
+
);
|
|
279
|
+
|
|
280
|
+
const expected = (
|
|
281
|
+
<IntlProvider locale="en-US" messages={messages}>
|
|
282
|
+
<Modal message={messageComponent} modalProps={modalProps} />
|
|
283
|
+
</IntlProvider>
|
|
284
|
+
);
|
|
285
|
+
|
|
286
|
+
expect(component, "when mounted", "to satisfy", expected);
|
|
287
|
+
});
|
|
288
|
+
|
|
289
|
+
it("Renders StepperModal correctly when custom action is clicked", () => {
|
|
290
|
+
const open = true;
|
|
291
|
+
const actions = [
|
|
292
|
+
{
|
|
293
|
+
value: "first value",
|
|
294
|
+
label: "first action",
|
|
295
|
+
handler: jest.fn(),
|
|
296
|
+
},
|
|
297
|
+
{
|
|
298
|
+
value: "second value",
|
|
299
|
+
label: "second action",
|
|
300
|
+
handler: jest.fn(),
|
|
301
|
+
},
|
|
302
|
+
];
|
|
303
|
+
|
|
304
|
+
const okCallback = sinon.spy();
|
|
305
|
+
const cancelCallback = sinon.spy();
|
|
306
|
+
const steps = [
|
|
307
|
+
{ title: "step1", content: "content", actions },
|
|
308
|
+
{ title: "step2", content: "content2" },
|
|
309
|
+
];
|
|
310
|
+
|
|
311
|
+
const component = (
|
|
312
|
+
<IntlProvider locale="en-US" messages={messages}>
|
|
313
|
+
<StepperModal open={open} steps={steps} closeCallback={cancelCallback} confirmCallback={okCallback} />
|
|
314
|
+
</IntlProvider>
|
|
315
|
+
);
|
|
316
|
+
|
|
317
|
+
const mountedComponent = mount(component);
|
|
318
|
+
|
|
319
|
+
const firstAction = mountedComponent.find(Button).at(1);
|
|
320
|
+
firstAction.invoke("onClick")();
|
|
321
|
+
|
|
322
|
+
expect(mountedComponent.containsMatchingElement(steps[1].content), "to be truthy");
|
|
323
|
+
|
|
324
|
+
const back = mountedComponent.find(Button).at(0);
|
|
325
|
+
back.invoke("onClick")();
|
|
326
|
+
|
|
327
|
+
expect(mountedComponent.containsMatchingElement(steps[0].content), "to be truthy");
|
|
328
|
+
|
|
329
|
+
const secondAction = mountedComponent.find(Button).at(2);
|
|
330
|
+
secondAction.invoke("onClick")();
|
|
331
|
+
|
|
332
|
+
const okButton = mountedComponent.find(Button).at(2);
|
|
333
|
+
okButton.invoke("onClick")();
|
|
334
|
+
|
|
335
|
+
expect(okCallback, "was called");
|
|
336
|
+
});
|
|
337
|
+
|
|
136
338
|
it("Render closed modal", () => {
|
|
137
339
|
const open = false;
|
|
138
340
|
|
|
@@ -2,8 +2,6 @@ import React, { useState, useEffect } from "react";
|
|
|
2
2
|
import { makeStyles } from "@material-ui/core/styles";
|
|
3
3
|
import Grid from "@material-ui/core/Grid";
|
|
4
4
|
import { ScrollableCustomList } from "./TransferList";
|
|
5
|
-
import Divider from "./Divider";
|
|
6
|
-
import DividerProps from "./dividerProps";
|
|
7
5
|
|
|
8
6
|
const useStyles = makeStyles(theme => ({
|
|
9
7
|
title: {
|
|
@@ -14,6 +12,10 @@ const useStyles = makeStyles(theme => ({
|
|
|
14
12
|
listHeight: {
|
|
15
13
|
height: props => props.height && theme.spacing(props.height),
|
|
16
14
|
},
|
|
15
|
+
listHeightWithBorder: {
|
|
16
|
+
height: props => props.height && theme.spacing(props.height),
|
|
17
|
+
borderRight: `1px solid ${theme.palette.grey.borders}`,
|
|
18
|
+
},
|
|
17
19
|
paper: {
|
|
18
20
|
flexGrow: 1,
|
|
19
21
|
height: "1px", // forces the container to takes 100%
|
|
@@ -32,9 +34,6 @@ const useStyles = makeStyles(theme => ({
|
|
|
32
34
|
borderRadius: theme.spacing(1.5),
|
|
33
35
|
},
|
|
34
36
|
},
|
|
35
|
-
divider: {
|
|
36
|
-
margin: "auto",
|
|
37
|
-
},
|
|
38
37
|
paperLeft: {
|
|
39
38
|
border: `1px solid ${theme.palette.grey.borders}`,
|
|
40
39
|
},
|
|
@@ -45,6 +44,7 @@ const useStyles = makeStyles(theme => ({
|
|
|
45
44
|
display: "flex",
|
|
46
45
|
flexDirection: "column",
|
|
47
46
|
height: "100%",
|
|
47
|
+
boxSizing: "border-box",
|
|
48
48
|
},
|
|
49
49
|
}));
|
|
50
50
|
|
|
@@ -98,16 +98,10 @@ const SelectionList = ({
|
|
|
98
98
|
};
|
|
99
99
|
|
|
100
100
|
const showDivider = infoPanel && divider;
|
|
101
|
-
const dividerProps = new DividerProps();
|
|
102
|
-
dividerProps.set(DividerProps.propNames.orientation, "vertical");
|
|
103
|
-
dividerProps.set(DividerProps.propNames.light, true);
|
|
104
|
-
dividerProps.setStyle(DividerProps.ruleNames.vertical, classes.divider);
|
|
105
101
|
|
|
106
102
|
infoPanelXs = infoPanelXs ?? defaultInfoPanelXs;
|
|
107
103
|
infoPanel = infoPanel ?? defaultPanel;
|
|
108
104
|
|
|
109
|
-
const dividerDiff = showDivider ? 1 : 0;
|
|
110
|
-
|
|
111
105
|
const listComponent = (
|
|
112
106
|
<div className={classes.listContainer}>
|
|
113
107
|
<div className={classes.title}>{listData.title}</div>
|
|
@@ -129,23 +123,15 @@ const SelectionList = ({
|
|
|
129
123
|
</div>
|
|
130
124
|
);
|
|
131
125
|
|
|
132
|
-
const dividerComponent = showDivider && (
|
|
133
|
-
<Grid item>
|
|
134
|
-
<Divider dividerProps={dividerProps} />
|
|
135
|
-
</Grid>
|
|
136
|
-
);
|
|
137
|
-
|
|
138
126
|
return (
|
|
139
127
|
<Grid container spacing={2}>
|
|
140
|
-
<Grid item xs={12 - infoPanelXs
|
|
128
|
+
<Grid item xs={12 - infoPanelXs} className={showDivider ? classes.listHeightWithBorder : classes.listHeight}>
|
|
141
129
|
{listComponent}
|
|
142
130
|
</Grid>
|
|
143
|
-
{dividerComponent}
|
|
144
131
|
<Grid item xs={infoPanelXs}>
|
|
145
132
|
{infoPanel}
|
|
146
133
|
</Grid>
|
|
147
134
|
</Grid>
|
|
148
135
|
);
|
|
149
136
|
};
|
|
150
|
-
|
|
151
137
|
export default SelectionList;
|
|
@@ -95,9 +95,6 @@ describe("SelectionList", () => {
|
|
|
95
95
|
<ScrollableCustomList checked={[]} items={list} classes={{}} />
|
|
96
96
|
</div>
|
|
97
97
|
</Grid>
|
|
98
|
-
<Grid>
|
|
99
|
-
<hr />
|
|
100
|
-
</Grid>
|
|
101
98
|
<Grid>
|
|
102
99
|
<div>Test</div>
|
|
103
100
|
</Grid>
|
|
@@ -129,9 +126,6 @@ describe("SelectionList", () => {
|
|
|
129
126
|
<div>{actionPanel}</div>
|
|
130
127
|
</div>
|
|
131
128
|
</Grid>
|
|
132
|
-
<Grid>
|
|
133
|
-
<hr />
|
|
134
|
-
</Grid>
|
|
135
129
|
<Grid>{infoPanel}</Grid>
|
|
136
130
|
</Grid>
|
|
137
131
|
);
|