orc-shared 1.5.0-dev.1 → 1.5.0-dev.11
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 +14 -52
- package/dist/actions/authentication.js +10 -45
- package/dist/actions/countries.js +6 -36
- package/dist/actions/locale.js +14 -54
- package/dist/actions/makeApiAction.js +31 -79
- package/dist/actions/makeOrcApiAction.js +3 -26
- package/dist/actions/metadata.js +65 -174
- package/dist/actions/modules.js +0 -26
- package/dist/actions/navigation.js +3 -33
- package/dist/actions/requestState.js +0 -18
- package/dist/actions/requestsApi.js +0 -17
- package/dist/actions/scopes.js +14 -56
- package/dist/actions/tasks.js +190 -0
- package/dist/actions/timezones.js +6 -36
- package/dist/actions/toasts.js +3 -23
- package/dist/actions/versionInfo.js +6 -39
- package/dist/actions/view.js +0 -38
- package/dist/buildStore.js +6 -54
- package/dist/components/AppFrame/About.js +8 -70
- package/dist/components/AppFrame/Anchor.js +1 -25
- package/dist/components/AppFrame/AppFrame.js +23 -92
- package/dist/components/AppFrame/ApplicationSelector/ApplicationDialog.js +4 -35
- package/dist/components/AppFrame/ApplicationSelector/Header.js +1 -31
- package/dist/components/AppFrame/ApplicationSelector/index.js +1 -30
- package/dist/components/AppFrame/ConnectedToastList.js +0 -31
- package/dist/components/AppFrame/Help.js +0 -25
- package/dist/components/AppFrame/MenuItem.js +17 -70
- package/dist/components/AppFrame/Preferences.js +17 -79
- package/dist/components/AppFrame/Sidebar.js +12 -61
- package/dist/components/AppFrame/Topbar.js +9 -65
- package/dist/components/AppFrame/index.js +0 -20
- package/dist/components/AppFrame/useApplicationHelpUrl.js +0 -22
- package/dist/components/ApplicationModuleLoader.js +7 -46
- package/dist/components/Authenticate.js +5 -48
- package/dist/components/Button.js +0 -24
- package/dist/components/CategoryList.js +27 -82
- package/dist/components/Checkbox.js +3 -41
- package/dist/components/ColumnWrapper.js +0 -19
- package/dist/components/Culture.js +0 -29
- package/dist/components/DevPages.js +0 -21
- package/dist/components/DropMenu/Menu.js +4 -36
- package/dist/components/DropMenu/index.js +12 -50
- package/dist/components/ErrorPlaceholder.js +3 -31
- package/dist/components/Form/Combination.js +3 -28
- package/dist/components/Form/Field.js +6 -37
- package/dist/components/Form/FieldElements.js +9 -41
- package/dist/components/Form/FieldList.js +28 -92
- package/dist/components/Form/Fieldset.js +1 -27
- package/dist/components/Form/Form.js +6 -37
- package/dist/components/Form/FormElement.js +1 -20
- package/dist/components/Form/InputField.js +17 -66
- package/dist/components/Form/Inputs/Button.js +5 -35
- package/dist/components/Form/Inputs/Date.js +2 -28
- package/dist/components/Form/Inputs/FieldButtons.js +0 -25
- package/dist/components/Form/Inputs/Number.js +7 -46
- package/dist/components/Form/Inputs/ReadOnly.js +0 -29
- package/dist/components/Form/Inputs/SmallButton.js +6 -38
- package/dist/components/Form/Inputs/Text.js +8 -41
- package/dist/components/Form/Inputs/Time.js +4 -33
- package/dist/components/Form/Inputs/Toggles.js +5 -39
- package/dist/components/Form/Inputs/Translation.js +21 -78
- package/dist/components/Form/Inputs/index.js +0 -28
- package/dist/components/Form/index.js +0 -20
- package/dist/components/Head.js +0 -22
- package/dist/components/I18n.js +0 -28
- package/dist/components/Icon.js +1 -27
- package/dist/components/IconButton.js +2 -32
- package/dist/components/Input.js +2 -42
- package/dist/components/InternetExplorerWarningMessage.js +0 -31
- package/dist/components/List/DataCell.js +3 -42
- package/dist/components/List/HeadCell.js +3 -43
- package/dist/components/List/HeadRow.js +2 -25
- package/dist/components/List/List.js +37 -107
- package/dist/components/List/Row.js +7 -38
- package/dist/components/List/enhanceColumnDefs.js +3 -29
- package/dist/components/List/index.js +0 -20
- package/dist/components/Loader.js +5 -48
- package/dist/components/LoadingIcon.js +0 -24
- package/dist/components/MaterialUI/DataDisplay/Badge.js +2 -31
- package/dist/components/MaterialUI/DataDisplay/Chip.js +1 -33
- package/dist/components/MaterialUI/DataDisplay/CollapsableList.js +7 -51
- package/dist/components/MaterialUI/DataDisplay/Divider.js +0 -30
- package/dist/components/MaterialUI/DataDisplay/Icon.js +2 -28
- package/dist/components/MaterialUI/DataDisplay/List.js +16 -55
- package/dist/components/MaterialUI/DataDisplay/Modal.js +4 -37
- package/dist/components/MaterialUI/DataDisplay/Notification.js +17 -69
- package/dist/components/MaterialUI/DataDisplay/NotificationProps.js +3 -34
- package/dist/components/MaterialUI/DataDisplay/PopperedElements/PopperedIcon.js +0 -22
- package/dist/components/MaterialUI/DataDisplay/PredefinedElements/ActionModal.js +5 -37
- package/dist/components/MaterialUI/DataDisplay/PredefinedElements/Address.js +1 -33
- package/dist/components/MaterialUI/DataDisplay/PredefinedElements/ConfirmationModal.js +7 -28
- package/dist/components/MaterialUI/DataDisplay/PredefinedElements/DiscountedPrice.js +2 -32
- package/dist/components/MaterialUI/DataDisplay/PredefinedElements/InformationItem.js +17 -57
- package/dist/components/MaterialUI/DataDisplay/PredefinedElements/Placeholder.js +4 -33
- package/dist/components/MaterialUI/DataDisplay/PredefinedElements/SectionTitle.js +0 -25
- package/dist/components/MaterialUI/DataDisplay/PredefinedElements/StepperModal.js +14 -60
- package/dist/components/MaterialUI/DataDisplay/PredefinedElements/TableInfoBar.js +0 -29
- package/dist/components/MaterialUI/DataDisplay/PredefinedElements/Translations.js +15 -59
- package/dist/components/MaterialUI/DataDisplay/SelectionList.js +23 -70
- package/dist/components/MaterialUI/DataDisplay/Table.js +34 -123
- package/dist/components/MaterialUI/DataDisplay/TableHeaderCell.js +0 -35
- package/dist/components/MaterialUI/DataDisplay/TableProps.js +3 -49
- package/dist/components/MaterialUI/DataDisplay/Timeline.js +1 -21
- package/dist/components/MaterialUI/DataDisplay/TimelineItem.js +4 -32
- package/dist/components/MaterialUI/DataDisplay/TooltippedElements/MultipleLinesText.js +7 -46
- package/dist/components/MaterialUI/DataDisplay/TooltippedElements/TooltippedIcon.js +3 -29
- package/dist/components/MaterialUI/DataDisplay/TooltippedElements/TooltippedTypography.js +0 -21
- package/dist/components/MaterialUI/DataDisplay/TransferList.js +32 -97
- package/dist/components/MaterialUI/DataDisplay/chipProps.js +3 -38
- package/dist/components/MaterialUI/DataDisplay/collapsableListProps.js +3 -37
- package/dist/components/MaterialUI/DataDisplay/dividerProps.js +3 -41
- package/dist/components/MaterialUI/DataDisplay/index.js +0 -33
- package/dist/components/MaterialUI/DataDisplay/modalProps.js +3 -36
- package/dist/components/MaterialUI/DataDisplay/tableHelpers.js +5 -68
- package/dist/components/MaterialUI/DataDisplay/useTableSelection.js +11 -48
- package/dist/components/MaterialUI/Feedback/NotificationContext.js +5 -40
- package/dist/components/MaterialUI/Feedback/loadingScreen.js +5 -44
- package/dist/components/MaterialUI/Feedback/useNotification.js +0 -21
- package/dist/components/MaterialUI/Inputs/Autocomplete.js +5 -44
- package/dist/components/MaterialUI/Inputs/AutocompleteProps.js +3 -37
- package/dist/components/MaterialUI/Inputs/Checkbox.js +3 -40
- package/dist/components/MaterialUI/Inputs/CheckboxGroup.js +3 -43
- package/dist/components/MaterialUI/Inputs/CheckboxGroupProps.js +3 -38
- package/dist/components/MaterialUI/Inputs/CheckboxProps.js +3 -39
- package/dist/components/MaterialUI/Inputs/DatePicker.js +18 -57
- package/dist/components/MaterialUI/Inputs/InputBase.js +7 -56
- package/dist/components/MaterialUI/Inputs/InputBaseProps.js +3 -51
- package/dist/components/MaterialUI/Inputs/PredefinedElements/SearchControl.js +12 -65
- package/dist/components/MaterialUI/Inputs/PredefinedElements/TitledSelect.js +3 -31
- package/dist/components/MaterialUI/Inputs/Radio.js +8 -54
- package/dist/components/MaterialUI/Inputs/RadioProps.js +3 -41
- package/dist/components/MaterialUI/Inputs/Select.js +10 -72
- package/dist/components/MaterialUI/Inputs/SelectProps.js +3 -46
- package/dist/components/MaterialUI/Inputs/StandaloneRadio.js +3 -35
- package/dist/components/MaterialUI/Inputs/Switch.js +4 -38
- package/dist/components/MaterialUI/Inputs/SwitchProps.js +3 -40
- package/dist/components/MaterialUI/Inputs/TimePicker.js +14 -91
- package/dist/components/MaterialUI/Inputs/createInput.js +5 -30
- package/dist/components/MaterialUI/Inputs/index.js +0 -35
- package/dist/components/MaterialUI/Inputs/standaloneRadioProps.js +3 -41
- package/dist/components/MaterialUI/Navigation/DropDownMenu.js +12 -56
- package/dist/components/MaterialUI/Navigation/DropDownMenuProps.js +3 -33
- package/dist/components/MaterialUI/Navigation/ExternalLink.js +2 -27
- package/dist/components/MaterialUI/Navigation/PredefinedElements/ActionMenu.js +4 -31
- package/dist/components/MaterialUI/Navigation/TabBar.js +22 -103
- package/dist/components/MaterialUI/Navigation/TabLabel.js +7 -41
- package/dist/components/MaterialUI/ScopeSelector/ScopeSelector.js +7 -42
- package/dist/components/MaterialUI/ScopeSelector/ScopeTreeView.js +22 -62
- package/dist/components/MaterialUI/ScopeSelector/TreeItem.js +16 -68
- package/dist/components/MaterialUI/Surfaces/ExpansionPanel.js +15 -55
- package/dist/components/MaterialUI/Surfaces/Paper.js +1 -31
- package/dist/components/MaterialUI/Surfaces/PredefinedElements/TitledPaper.js +3 -28
- package/dist/components/MaterialUI/Surfaces/SectionExpansionPanel.js +19 -62
- package/dist/components/MaterialUI/Surfaces/expansionPanelProps.js +3 -55
- package/dist/components/MaterialUI/Surfaces/paperProps.js +3 -36
- package/dist/components/MaterialUI/componentProps.js +3 -29
- package/dist/components/MaterialUI/hocs/withDeferredPopper.js +10 -59
- package/dist/components/MaterialUI/hocs/withDeferredTooltip.js +8 -44
- package/dist/components/MaterialUI/muiThemes.js +5 -57
- package/dist/components/MaterialUI/textProps.js +3 -33
- package/dist/components/Modal/Background.js +0 -19
- package/dist/components/Modal/Dialog.js +2 -26
- package/dist/components/Modal/Wrapper.js +0 -26
- package/dist/components/Modal/index.js +8 -44
- package/dist/components/Modules.js +21 -93
- package/dist/components/MultiSelector.js +21 -74
- package/dist/components/Navigation/Bar.js +29 -90
- package/dist/components/Navigation/Tab.js +22 -74
- package/dist/components/Navigation/index.js +2 -21
- package/dist/components/Navigation/useNavigationState.js +90 -173
- package/dist/components/Placeholder.js +5 -43
- package/dist/components/Provision.js +4 -36
- package/dist/components/Routing/FullPage.js +14 -37
- package/dist/components/Routing/Page.js +14 -51
- package/dist/components/Routing/Segment.js +5 -30
- package/dist/components/Routing/SegmentPage.js +26 -106
- package/dist/components/Routing/SubPage.js +22 -59
- package/dist/components/Routing/withWaypointing.js +5 -36
- package/dist/components/Scope/ScopeModificationConfirmationDialog.js +3 -30
- package/dist/components/Scope/ScopeNode.js +8 -49
- package/dist/components/Scope/Selector.js +8 -44
- package/dist/components/Scope/index.js +29 -96
- package/dist/components/Scope/useScopeConfirmationModalState.js +33 -100
- package/dist/components/Scope/useScopeData.js +0 -25
- package/dist/components/Scope/useScopeSelect.js +0 -26
- package/dist/components/Selector.js +15 -76
- package/dist/components/Sidepanel.js +0 -28
- package/dist/components/Spritesheet.js +0 -26
- package/dist/components/Switch.js +11 -51
- package/dist/components/TaskDetailsModal.js +193 -0
- package/dist/components/Text.js +6 -50
- package/dist/components/ToastList.js +5 -45
- package/dist/components/Toolbar.js +16 -74
- package/dist/components/Tooltip.js +0 -24
- package/dist/components/Treeview/Branch.js +0 -25
- package/dist/components/Treeview/Label.js +0 -29
- package/dist/components/Treeview/Leaf.js +0 -21
- package/dist/components/Treeview/Node.js +17 -55
- package/dist/components/Treeview/index.js +25 -66
- package/dist/components/Treeview/settings.js +0 -17
- package/dist/constants.js +21 -19
- package/dist/content/iconsSheet.svg +22 -0
- package/dist/content/orckestra-logo-white.png +0 -0
- package/dist/getTheme.js +0 -29
- package/dist/getThemeOverrides.js +3 -22
- package/dist/hocs/routingConnector.js +0 -21
- package/dist/hocs/withAuthentication.js +4 -26
- package/dist/hocs/withClickOutside.js +2 -28
- package/dist/hocs/withErrorBoundary.js +2 -37
- package/dist/hocs/withId.js +1 -30
- package/dist/hocs/withInfiniteScroll.js +15 -32
- package/dist/hocs/withInitialLoad.js +0 -20
- package/dist/hocs/withLocaleSwitch.js +0 -19
- package/dist/hocs/withNavigationLink.js +5 -32
- package/dist/hocs/withRequestActivity.js +0 -21
- package/dist/hocs/withScopeData.js +6 -33
- package/dist/hocs/withScrollBox.js +2 -31
- package/dist/hocs/withToggle.js +9 -37
- package/dist/hocs/withUpdateHandler.js +3 -23
- package/dist/hocs/withViewState.js +5 -32
- package/dist/hooks/useDispatchWithModulesData.js +0 -26
- package/dist/hooks/useEditState.js +10 -105
- package/dist/hooks/useEntityLoader.js +18 -67
- package/dist/hooks/useFullEntityEditState.js +9 -56
- package/dist/hooks/useInfiniteScroll.js +5 -33
- package/dist/hooks/useLabelMessage.js +3 -42
- package/dist/hooks/useLoader.js +0 -27
- package/dist/hooks/useMultipleFieldEditState.js +3 -40
- package/dist/hooks/useNavigationHandler.js +3 -28
- package/dist/hooks/useNotificationRequestState.js +17 -47
- package/dist/hooks/usePreviousModified.js +0 -24
- package/dist/hooks/useRequestState.js +8 -38
- package/dist/hooks/useSelectorAndUnwrap.js +0 -23
- package/dist/hooks/useToggle.js +5 -35
- package/dist/hooks/useViewState.js +0 -23
- package/dist/index.js +1 -2
- package/dist/reducers/applications.js +0 -23
- package/dist/reducers/authentication.js +6 -37
- package/dist/reducers/countries.js +0 -25
- package/dist/reducers/localeFactory.js +0 -30
- package/dist/reducers/metadata.js +3 -63
- package/dist/reducers/modules.js +0 -36
- package/dist/reducers/navigation.js +8 -47
- package/dist/reducers/request.js +4 -28
- package/dist/reducers/requestStates.js +0 -42
- package/dist/reducers/scopes.js +0 -28
- package/dist/reducers/settings.js +4 -39
- package/dist/reducers/tasks.js +99 -0
- package/dist/reducers/timezones.js +0 -25
- package/dist/reducers/toasts.js +0 -27
- package/dist/reducers/versionInfo.js +0 -24
- package/dist/reducers/view.js +36 -84
- package/dist/schemas/countries.js +0 -17
- package/dist/schemas/definitions.js +0 -17
- package/dist/schemas/metadata.js +0 -17
- package/dist/schemas/productDefinitions.js +0 -17
- package/dist/schemas/scopes.js +0 -17
- package/dist/schemas/timezones.js +0 -17
- package/dist/selectors/applications.js +0 -20
- package/dist/selectors/authentication.js +17 -41
- package/dist/selectors/countries.js +0 -22
- package/dist/selectors/locale.js +1 -29
- package/dist/selectors/metadata.js +4 -45
- package/dist/selectors/modules.js +3 -22
- package/dist/selectors/navigation.js +9 -39
- package/dist/selectors/requestStates.js +0 -22
- package/dist/selectors/requests.js +2 -22
- package/dist/selectors/route.js +0 -21
- package/dist/selectors/scope.js +0 -32
- package/dist/selectors/settings.js +0 -18
- package/dist/selectors/tasks.js +66 -0
- package/dist/selectors/timezones.js +0 -19
- package/dist/selectors/versionInfo.js +0 -18
- package/dist/selectors/view.js +3 -74
- package/dist/sharedMessages.js +17 -18
- package/dist/spawnerMiddleware.js +0 -24
- package/dist/utils/buildUrl.js +7 -38
- package/dist/utils/countryHelper.js +0 -18
- package/dist/utils/curry.js +0 -19
- package/dist/utils/debounce.js +1 -20
- package/dist/utils/displayModeHelper.js +0 -24
- package/dist/utils/domHelper.js +0 -17
- package/dist/utils/flatten.js +7 -38
- package/dist/utils/index.js +0 -31
- package/dist/utils/insertIcons.js +0 -21
- package/dist/utils/localizationHelper.js +0 -26
- package/dist/utils/logPass.js +1 -22
- package/dist/utils/mapHelper.js +1 -25
- package/dist/utils/memoize.js +0 -23
- package/dist/utils/modelValidationHelper.js +3 -42
- package/dist/utils/normalizeForSearch.js +2 -19
- package/dist/utils/objectHelper.js +2 -24
- package/dist/utils/parseHelper.js +0 -32
- package/dist/utils/profilerHelper.js +0 -18
- package/dist/utils/propertyHelper.js +36 -38
- package/dist/utils/propertyValidator.js +0 -25
- package/dist/utils/requestProcessingHelper.js +0 -24
- package/dist/utils/safeGet.js +0 -18
- package/dist/utils/setTranslation.js +1 -28
- package/dist/utils/setTranslationWithFallback.js +1 -33
- package/dist/utils/stripKey.js +1 -23
- package/dist/utils/styledPropFuncs.js +3 -29
- package/dist/utils/testUtils.js +14 -91
- package/dist/utils/timezoneHelper.js +8 -46
- package/dist/utils/unwrapImmutable.js +0 -19
- package/dist/utils/urlHelper.js +3 -28
- package/dist/whyDidYouRerender.js +0 -5
- package/package.json +3 -3
- package/src/actions/tasks.js +77 -0
- package/src/actions/tasks.test.js +169 -0
- package/src/buildStore.js +2 -0
- package/src/components/AppFrame/About.test.js +3 -3
- package/src/components/AppFrame/Sidebar.js +4 -3
- package/src/components/Routing/SubPage.js +17 -2
- package/src/components/Routing/SubPage.test.js +168 -1
- package/src/components/TaskDetailsModal.js +132 -0
- package/src/components/TaskDetailsModal.test.js +317 -0
- package/src/components/Text.test.js +44 -59
- package/src/constants.js +15 -0
- package/src/content/iconsSheet.svg +22 -0
- package/src/content/orckestra-logo-white.png +0 -0
- package/src/hooks/useEditState.js +12 -2
- package/src/hooks/useEditState.test.js +1 -1
- package/src/hooks/useLabelMessage.test.js +16 -10
- package/src/reducers/request.js +4 -0
- package/src/reducers/request.test.js +11 -0
- package/src/reducers/tasks.js +56 -0
- package/src/reducers/tasks.test.js +404 -0
- package/src/selectors/authentication.js +13 -0
- package/src/selectors/authentication.test.js +322 -0
- package/src/selectors/tasks.js +16 -0
- package/src/selectors/tasks.test.js +60 -0
- package/src/sharedMessages.js +17 -1
- package/src/translations/en-US.json +16 -12
- package/src/translations/fr-CA.json +16 -12
- package/src/utils/propertyHelper.js +38 -0
- package/src/utils/propertyHelper.test.js +160 -0
- package/src/utils/timezoneHelper.test.js +4 -2
package/dist/hooks/useLoader.js
CHANGED
|
@@ -2,54 +2,41 @@
|
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports.default = void 0;
|
|
5
|
-
|
|
6
5
|
var _react = require("react");
|
|
7
|
-
|
|
8
6
|
var _reactRedux = require("react-redux");
|
|
9
|
-
|
|
10
7
|
var _requests = require("../selectors/requests");
|
|
11
|
-
|
|
12
8
|
(function () {
|
|
13
9
|
var enterModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.enterModule : undefined;
|
|
14
10
|
enterModule && enterModule(module);
|
|
15
11
|
})();
|
|
16
|
-
|
|
17
12
|
(function () {
|
|
18
13
|
var enterModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.enterModule : undefined;
|
|
19
14
|
enterModule && enterModule(module);
|
|
20
15
|
})();
|
|
21
|
-
|
|
22
16
|
var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) {
|
|
23
17
|
return a;
|
|
24
18
|
};
|
|
25
|
-
|
|
26
19
|
var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) {
|
|
27
20
|
return a;
|
|
28
21
|
};
|
|
29
|
-
|
|
30
22
|
var hasWarned = false;
|
|
31
|
-
|
|
32
23
|
var noCutout = function noCutout() {
|
|
33
24
|
/* istanbul ignore next */
|
|
34
25
|
if (!hasWarned) {
|
|
35
26
|
console.warn("useLoader hook called without cutout selector, loader will never be dispatched.");
|
|
36
27
|
hasWarned = true;
|
|
37
28
|
}
|
|
38
|
-
|
|
39
29
|
return true;
|
|
40
30
|
};
|
|
41
|
-
|
|
42
31
|
var useLoader = function useLoader(loadActions, cutoutSelector) {
|
|
43
32
|
if (cutoutSelector === void 0) {
|
|
44
33
|
cutoutSelector = noCutout;
|
|
45
34
|
}
|
|
46
|
-
|
|
47
35
|
var dispatch = (0, _reactRedux.useDispatch)();
|
|
48
36
|
var needLogin = (0, _reactRedux.useSelector)(_requests.logoutSelector);
|
|
49
37
|
var cutout = !!(0, _reactRedux.useSelector)(cutoutSelector, _reactRedux.shallowEqual) || needLogin;
|
|
50
38
|
(0, _react.useEffect)(function () {
|
|
51
39
|
var actions = Array.isArray(loadActions) ? loadActions : [loadActions];
|
|
52
|
-
|
|
53
40
|
if (!cutout) {
|
|
54
41
|
actions.forEach(function (action) {
|
|
55
42
|
return dispatch(action);
|
|
@@ -57,58 +44,44 @@ var useLoader = function useLoader(loadActions, cutoutSelector) {
|
|
|
57
44
|
}
|
|
58
45
|
}, [dispatch, loadActions, cutout]);
|
|
59
46
|
};
|
|
60
|
-
|
|
61
47
|
__signature__(useLoader, "useDispatch{dispatch}\nuseSelector{needLogin}\nuseSelector{}\nuseEffect{}", function () {
|
|
62
48
|
return [_reactRedux.useDispatch, _reactRedux.useSelector, _reactRedux.useSelector];
|
|
63
49
|
});
|
|
64
|
-
|
|
65
50
|
__signature__(useLoader, "useDispatch{dispatch}\nuseSelector{needLogin}\nuseSelector{}\nuseEffect{}", function () {
|
|
66
51
|
return [_reactRedux.useDispatch, _reactRedux.useSelector, _reactRedux.useSelector];
|
|
67
52
|
});
|
|
68
|
-
|
|
69
53
|
var _default = useLoader;
|
|
70
54
|
var _default2 = _default;
|
|
71
55
|
var _default3 = _default2;
|
|
72
56
|
exports.default = _default3;
|
|
73
57
|
;
|
|
74
|
-
|
|
75
58
|
(function () {
|
|
76
59
|
var reactHotLoader = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default : undefined;
|
|
77
|
-
|
|
78
60
|
if (!reactHotLoader) {
|
|
79
61
|
return;
|
|
80
62
|
}
|
|
81
|
-
|
|
82
63
|
reactHotLoader.register(hasWarned, "hasWarned", "/home/vsts/work/1/s/src/hooks/useLoader.js");
|
|
83
64
|
reactHotLoader.register(noCutout, "noCutout", "/home/vsts/work/1/s/src/hooks/useLoader.js");
|
|
84
65
|
reactHotLoader.register(useLoader, "useLoader", "/home/vsts/work/1/s/src/hooks/useLoader.js");
|
|
85
66
|
reactHotLoader.register(_default, "default", "/home/vsts/work/1/s/src/hooks/useLoader.js");
|
|
86
67
|
})();
|
|
87
|
-
|
|
88
68
|
;
|
|
89
|
-
|
|
90
69
|
(function () {
|
|
91
70
|
var leaveModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.leaveModule : undefined;
|
|
92
71
|
leaveModule && leaveModule(module);
|
|
93
72
|
})();
|
|
94
|
-
|
|
95
73
|
;
|
|
96
|
-
|
|
97
74
|
(function () {
|
|
98
75
|
var reactHotLoader = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default : undefined;
|
|
99
|
-
|
|
100
76
|
if (!reactHotLoader) {
|
|
101
77
|
return;
|
|
102
78
|
}
|
|
103
|
-
|
|
104
79
|
reactHotLoader.register(hasWarned, "hasWarned", "/home/vsts/work/1/s/src/hooks/useLoader.js");
|
|
105
80
|
reactHotLoader.register(noCutout, "noCutout", "/home/vsts/work/1/s/src/hooks/useLoader.js");
|
|
106
81
|
reactHotLoader.register(useLoader, "useLoader", "/home/vsts/work/1/s/src/hooks/useLoader.js");
|
|
107
82
|
reactHotLoader.register(_default2, "default", "/home/vsts/work/1/s/src/hooks/useLoader.js");
|
|
108
83
|
})();
|
|
109
|
-
|
|
110
84
|
;
|
|
111
|
-
|
|
112
85
|
(function () {
|
|
113
86
|
var leaveModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.leaveModule : undefined;
|
|
114
87
|
leaveModule && leaveModule(module);
|
|
@@ -2,41 +2,30 @@
|
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports.default = void 0;
|
|
5
|
-
|
|
6
5
|
var _reactRedux = require("react-redux");
|
|
7
|
-
|
|
8
6
|
var _modelValidationHelper = require("../utils/modelValidationHelper");
|
|
9
|
-
|
|
10
7
|
var _view = require("../selectors/view");
|
|
11
|
-
|
|
12
8
|
var _view2 = require("../actions/view");
|
|
13
|
-
|
|
14
9
|
var _useDispatchWithModulesData = require("./../hooks/useDispatchWithModulesData");
|
|
15
|
-
|
|
16
10
|
(function () {
|
|
17
11
|
var enterModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.enterModule : undefined;
|
|
18
12
|
enterModule && enterModule(module);
|
|
19
13
|
})();
|
|
20
|
-
|
|
21
14
|
(function () {
|
|
22
15
|
var enterModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.enterModule : undefined;
|
|
23
16
|
enterModule && enterModule(module);
|
|
24
17
|
})();
|
|
25
|
-
|
|
26
18
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
27
|
-
|
|
28
19
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
29
|
-
|
|
30
|
-
function
|
|
31
|
-
|
|
20
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
21
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
22
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
32
23
|
var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) {
|
|
33
24
|
return a;
|
|
34
25
|
};
|
|
35
|
-
|
|
36
26
|
var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) {
|
|
37
27
|
return a;
|
|
38
28
|
};
|
|
39
|
-
|
|
40
29
|
/* This hook is used when a component has a dynamic number of fields that can be edited (e.g.: Orders' Custom Configuration Parameters).
|
|
41
30
|
It calls `useSelector` only once and handles the fields' states itself using in a similar structure to useEditState.
|
|
42
31
|
|
|
@@ -57,40 +46,30 @@ var useMultipleFieldEditState = function useMultipleFieldEditState(entityId, sec
|
|
|
57
46
|
if (extendedValidationRules === void 0) {
|
|
58
47
|
extendedValidationRules = {};
|
|
59
48
|
}
|
|
60
|
-
|
|
61
49
|
var dispatch = (0, _useDispatchWithModulesData.useDispatchWithModulesData)();
|
|
62
|
-
|
|
63
50
|
var mergedValidationRules = _objectSpread(_objectSpread({}, _modelValidationHelper.validationRules), extendedValidationRules);
|
|
64
|
-
|
|
65
51
|
var modifiedStates = (0, _reactRedux.useSelector)((0, _view.getModifiedModels)(entityId))[sectionName] || {};
|
|
66
|
-
|
|
67
52
|
var useDynamicFieldState = function useDynamicFieldState(id, fieldName, errorTypes) {
|
|
68
53
|
var _initialValues$id$fie, _initialValues$id, _modifiedStates$id$fi, _modifiedStates$id, _editState$value;
|
|
69
|
-
|
|
70
54
|
if (errorTypes === void 0) {
|
|
71
55
|
errorTypes = [];
|
|
72
56
|
}
|
|
73
|
-
|
|
74
57
|
var keys = [id, fieldName];
|
|
75
58
|
var initialValue = (_initialValues$id$fie = (_initialValues$id = initialValues[id]) == null ? void 0 : _initialValues$id[fieldName]) != null ? _initialValues$id$fie : "";
|
|
76
59
|
var editState = (_modifiedStates$id$fi = (_modifiedStates$id = modifiedStates[id]) == null ? void 0 : _modifiedStates$id[fieldName]) != null ? _modifiedStates$id$fi : {};
|
|
77
60
|
editState.value = (_editState$value = editState.value) != null ? _editState$value : initialValue;
|
|
78
|
-
|
|
79
61
|
var updateEditState = function updateEditState(newValue) {
|
|
80
62
|
dispatch(_view2.setEditModelField, [keys, newValue, initialValue, entityId, sectionName]);
|
|
81
63
|
isEditStateValid(newValue);
|
|
82
64
|
};
|
|
83
|
-
|
|
84
65
|
var resetEditState = function resetEditState() {
|
|
85
66
|
dispatch(_view2.setEditModelField, [keys, initialValue, initialValue, entityId, sectionName]);
|
|
86
67
|
};
|
|
87
|
-
|
|
88
68
|
var isEditStateValid = function isEditStateValid(value) {
|
|
89
69
|
var valueToValidate = value != null ? value : editState.value;
|
|
90
70
|
var hasAnyValidationErrors = false;
|
|
91
71
|
errorTypes.forEach(function (errorType) {
|
|
92
72
|
var isValid = mergedValidationRules[errorType](valueToValidate, id, fieldName);
|
|
93
|
-
|
|
94
73
|
if (isValid === false) {
|
|
95
74
|
dispatch(_view2.setEditModelFieldError, [keys, errorType, entityId, sectionName]);
|
|
96
75
|
hasAnyValidationErrors = true;
|
|
@@ -99,7 +78,6 @@ var useMultipleFieldEditState = function useMultipleFieldEditState(entityId, sec
|
|
|
99
78
|
});
|
|
100
79
|
return !hasAnyValidationErrors;
|
|
101
80
|
};
|
|
102
|
-
|
|
103
81
|
return {
|
|
104
82
|
state: editState,
|
|
105
83
|
update: updateEditState,
|
|
@@ -107,57 +85,42 @@ var useMultipleFieldEditState = function useMultipleFieldEditState(entityId, sec
|
|
|
107
85
|
isValid: isEditStateValid
|
|
108
86
|
};
|
|
109
87
|
};
|
|
110
|
-
|
|
111
88
|
return [useDynamicFieldState, modifiedStates];
|
|
112
89
|
};
|
|
113
|
-
|
|
114
90
|
__signature__(useMultipleFieldEditState, "useDispatchWithModulesData{dispatch}\nuseSelector{}", function () {
|
|
115
91
|
return [_useDispatchWithModulesData.useDispatchWithModulesData, _reactRedux.useSelector];
|
|
116
92
|
});
|
|
117
|
-
|
|
118
93
|
__signature__(useMultipleFieldEditState, "useDispatchWithModulesData{dispatch}\nuseSelector{}", function () {
|
|
119
94
|
return [_useDispatchWithModulesData.useDispatchWithModulesData, _reactRedux.useSelector];
|
|
120
95
|
});
|
|
121
|
-
|
|
122
96
|
var _default = useMultipleFieldEditState;
|
|
123
97
|
var _default2 = _default;
|
|
124
98
|
var _default3 = _default2;
|
|
125
99
|
exports.default = _default3;
|
|
126
100
|
;
|
|
127
|
-
|
|
128
101
|
(function () {
|
|
129
102
|
var reactHotLoader = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default : undefined;
|
|
130
|
-
|
|
131
103
|
if (!reactHotLoader) {
|
|
132
104
|
return;
|
|
133
105
|
}
|
|
134
|
-
|
|
135
106
|
reactHotLoader.register(useMultipleFieldEditState, "useMultipleFieldEditState", "/home/vsts/work/1/s/src/hooks/useMultipleFieldEditState.js");
|
|
136
107
|
reactHotLoader.register(_default, "default", "/home/vsts/work/1/s/src/hooks/useMultipleFieldEditState.js");
|
|
137
108
|
})();
|
|
138
|
-
|
|
139
109
|
;
|
|
140
|
-
|
|
141
110
|
(function () {
|
|
142
111
|
var leaveModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.leaveModule : undefined;
|
|
143
112
|
leaveModule && leaveModule(module);
|
|
144
113
|
})();
|
|
145
|
-
|
|
146
114
|
;
|
|
147
|
-
|
|
148
115
|
(function () {
|
|
149
116
|
var reactHotLoader = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default : undefined;
|
|
150
|
-
|
|
151
117
|
if (!reactHotLoader) {
|
|
152
118
|
return;
|
|
153
119
|
}
|
|
154
|
-
|
|
155
120
|
reactHotLoader.register(useMultipleFieldEditState, "useMultipleFieldEditState", "/home/vsts/work/1/s/src/hooks/useMultipleFieldEditState.js");
|
|
156
121
|
reactHotLoader.register(_default2, "default", "/home/vsts/work/1/s/src/hooks/useMultipleFieldEditState.js");
|
|
157
122
|
})();
|
|
158
|
-
|
|
159
123
|
;
|
|
160
|
-
|
|
161
124
|
(function () {
|
|
162
125
|
var leaveModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.leaveModule : undefined;
|
|
163
126
|
leaveModule && leaveModule(module);
|
|
@@ -2,27 +2,21 @@
|
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports.useNavigationHandler = exports.default = void 0;
|
|
5
|
-
|
|
6
5
|
var _reactRouterDom = require("react-router-dom");
|
|
7
|
-
|
|
8
6
|
(function () {
|
|
9
7
|
var enterModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.enterModule : undefined;
|
|
10
8
|
enterModule && enterModule(module);
|
|
11
9
|
})();
|
|
12
|
-
|
|
13
10
|
(function () {
|
|
14
11
|
var enterModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.enterModule : undefined;
|
|
15
12
|
enterModule && enterModule(module);
|
|
16
13
|
})();
|
|
17
|
-
|
|
18
14
|
var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) {
|
|
19
15
|
return a;
|
|
20
16
|
};
|
|
21
|
-
|
|
22
17
|
var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) {
|
|
23
18
|
return a;
|
|
24
19
|
};
|
|
25
|
-
|
|
26
20
|
var analyzeHref = function analyzeHref(href, location) {
|
|
27
21
|
var url = new URL(href || "", window.location.origin);
|
|
28
22
|
var local = url.origin === window.location.origin;
|
|
@@ -33,78 +27,59 @@ var analyzeHref = function analyzeHref(href, location) {
|
|
|
33
27
|
active: href && local && location.pathname.substr(0, url.pathname.length) === url.pathname
|
|
34
28
|
};
|
|
35
29
|
};
|
|
36
|
-
|
|
37
30
|
var useNavigationHandler = function useNavigationHandler(href) {
|
|
38
31
|
var location = (0, _reactRouterDom.useLocation)();
|
|
39
32
|
var history = (0, _reactRouterDom.useHistory)();
|
|
40
|
-
|
|
41
33
|
var _analyzeHref = analyzeHref(href, location),
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
34
|
+
local = _analyzeHref.local,
|
|
35
|
+
self = _analyzeHref.self,
|
|
36
|
+
active = _analyzeHref.active;
|
|
46
37
|
return [function (event) {
|
|
47
38
|
if (local) {
|
|
48
39
|
event.preventDefault();
|
|
49
|
-
|
|
50
40
|
if (href && !self) {
|
|
51
41
|
history.push(href);
|
|
52
42
|
}
|
|
53
43
|
}
|
|
54
44
|
}, active];
|
|
55
45
|
};
|
|
56
|
-
|
|
57
46
|
exports.useNavigationHandler = useNavigationHandler;
|
|
58
|
-
|
|
59
47
|
__signature__(useNavigationHandler, "useLocation{location}\nuseHistory{history}", function () {
|
|
60
48
|
return [_reactRouterDom.useLocation, _reactRouterDom.useHistory];
|
|
61
49
|
});
|
|
62
|
-
|
|
63
50
|
__signature__(useNavigationHandler, "useLocation{location}\nuseHistory{history}", function () {
|
|
64
51
|
return [_reactRouterDom.useLocation, _reactRouterDom.useHistory];
|
|
65
52
|
});
|
|
66
|
-
|
|
67
53
|
var _default = useNavigationHandler;
|
|
68
54
|
var _default2 = _default;
|
|
69
55
|
var _default3 = _default2;
|
|
70
56
|
exports.default = _default3;
|
|
71
57
|
;
|
|
72
|
-
|
|
73
58
|
(function () {
|
|
74
59
|
var reactHotLoader = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default : undefined;
|
|
75
|
-
|
|
76
60
|
if (!reactHotLoader) {
|
|
77
61
|
return;
|
|
78
62
|
}
|
|
79
|
-
|
|
80
63
|
reactHotLoader.register(analyzeHref, "analyzeHref", "/home/vsts/work/1/s/src/hooks/useNavigationHandler.js");
|
|
81
64
|
reactHotLoader.register(useNavigationHandler, "useNavigationHandler", "/home/vsts/work/1/s/src/hooks/useNavigationHandler.js");
|
|
82
65
|
reactHotLoader.register(_default, "default", "/home/vsts/work/1/s/src/hooks/useNavigationHandler.js");
|
|
83
66
|
})();
|
|
84
|
-
|
|
85
67
|
;
|
|
86
|
-
|
|
87
68
|
(function () {
|
|
88
69
|
var leaveModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.leaveModule : undefined;
|
|
89
70
|
leaveModule && leaveModule(module);
|
|
90
71
|
})();
|
|
91
|
-
|
|
92
72
|
;
|
|
93
|
-
|
|
94
73
|
(function () {
|
|
95
74
|
var reactHotLoader = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default : undefined;
|
|
96
|
-
|
|
97
75
|
if (!reactHotLoader) {
|
|
98
76
|
return;
|
|
99
77
|
}
|
|
100
|
-
|
|
101
78
|
reactHotLoader.register(analyzeHref, "analyzeHref", "/home/vsts/work/1/s/src/hooks/useNavigationHandler.js");
|
|
102
79
|
reactHotLoader.register(useNavigationHandler, "useNavigationHandler", "/home/vsts/work/1/s/src/hooks/useNavigationHandler.js");
|
|
103
80
|
reactHotLoader.register(_default2, "default", "/home/vsts/work/1/s/src/hooks/useNavigationHandler.js");
|
|
104
81
|
})();
|
|
105
|
-
|
|
106
82
|
;
|
|
107
|
-
|
|
108
83
|
(function () {
|
|
109
84
|
var leaveModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.leaveModule : undefined;
|
|
110
85
|
leaveModule && leaveModule(module);
|
|
@@ -2,43 +2,31 @@
|
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports.default = void 0;
|
|
5
|
-
|
|
6
5
|
var _reactIntl = require("react-intl");
|
|
7
|
-
|
|
8
6
|
var _react = require("react");
|
|
9
|
-
|
|
10
7
|
var _NotificationContext = require("../components/MaterialUI/Feedback/NotificationContext");
|
|
11
|
-
|
|
12
8
|
var _useRequestState = _interopRequireDefault(require("./useRequestState"));
|
|
13
|
-
|
|
14
9
|
var _sharedMessages = _interopRequireDefault(require("../sharedMessages"));
|
|
15
|
-
|
|
16
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
-
|
|
18
11
|
(function () {
|
|
19
12
|
var enterModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.enterModule : undefined;
|
|
20
13
|
enterModule && enterModule(module);
|
|
21
14
|
})();
|
|
22
|
-
|
|
23
15
|
(function () {
|
|
24
16
|
var enterModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.enterModule : undefined;
|
|
25
17
|
enterModule && enterModule(module);
|
|
26
18
|
})();
|
|
27
|
-
|
|
28
19
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
29
|
-
|
|
30
20
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
31
|
-
|
|
32
|
-
function
|
|
33
|
-
|
|
21
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
22
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
23
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
34
24
|
var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) {
|
|
35
25
|
return a;
|
|
36
26
|
};
|
|
37
|
-
|
|
38
27
|
var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) {
|
|
39
28
|
return a;
|
|
40
29
|
};
|
|
41
|
-
|
|
42
30
|
/*
|
|
43
31
|
This hook is used to handle the notification message for deletes and updates.
|
|
44
32
|
It uses useRequestState internally to know when to display messages.
|
|
@@ -56,45 +44,41 @@ var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoader
|
|
|
56
44
|
}
|
|
57
45
|
}
|
|
58
46
|
*/
|
|
47
|
+
|
|
59
48
|
var useNotificationRequestState = function useNotificationRequestState(_ref) {
|
|
60
49
|
var keys = _ref.keys,
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
50
|
+
operation = _ref.operation,
|
|
51
|
+
successMessageId = _ref.successMessageId,
|
|
52
|
+
successMessageValues = _ref.successMessageValues,
|
|
53
|
+
successAction = _ref.successAction,
|
|
54
|
+
errorMessageId = _ref.errorMessageId,
|
|
55
|
+
errorMessageValues = _ref.errorMessageValues,
|
|
56
|
+
errorAction = _ref.errorAction;
|
|
69
57
|
var _useIntl = (0, _reactIntl.useIntl)(),
|
|
70
|
-
|
|
71
|
-
|
|
58
|
+
formatMessage = _useIntl.formatMessage;
|
|
72
59
|
var _useContext = (0, _react.useContext)(_NotificationContext.NotificationContext),
|
|
73
|
-
|
|
74
|
-
|
|
60
|
+
addNotification = _useContext.addNotification;
|
|
75
61
|
var onSuccess = (0, _react.useCallback)(function () {
|
|
76
62
|
var message = formatMessage(successMessageId, successMessageValues);
|
|
77
63
|
addNotification(message, "success");
|
|
78
|
-
|
|
79
64
|
if (successAction) {
|
|
80
65
|
successAction();
|
|
81
|
-
}
|
|
66
|
+
}
|
|
67
|
+
// addNotification causes issues in the deps
|
|
82
68
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
83
|
-
|
|
84
69
|
}, [formatMessage, successAction, successMessageId, successMessageValues]);
|
|
85
70
|
var onError = (0, _react.useCallback)(function (errorResponse) {
|
|
86
71
|
var _errorResponse$respon, _errorResponse$respon2, _errorResponse$respon3;
|
|
87
|
-
|
|
88
72
|
var errorMessage = (_errorResponse$respon = errorResponse == null ? void 0 : (_errorResponse$respon2 = errorResponse.response) == null ? void 0 : (_errorResponse$respon3 = _errorResponse$respon2.responseStatus) == null ? void 0 : _errorResponse$respon3.message) != null ? _errorResponse$respon : null;
|
|
89
73
|
var message = formatMessage(errorMessageId, _objectSpread(_objectSpread({}, errorMessageValues), {}, {
|
|
90
74
|
errorMessage: errorMessage != null ? errorMessage : formatMessage(_sharedMessages.default.errorUnknown)
|
|
91
75
|
}));
|
|
92
76
|
addNotification(message, "error");
|
|
93
|
-
|
|
94
77
|
if (errorAction) {
|
|
95
78
|
errorAction(errorResponse);
|
|
96
79
|
}
|
|
97
|
-
},
|
|
80
|
+
},
|
|
81
|
+
// addNotification causes issues in the deps
|
|
98
82
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
99
83
|
[errorAction, errorMessageId, errorMessageValues, formatMessage]);
|
|
100
84
|
var buildRequestState = (0, _useRequestState.default)({
|
|
@@ -105,54 +89,40 @@ var useNotificationRequestState = function useNotificationRequestState(_ref) {
|
|
|
105
89
|
});
|
|
106
90
|
return buildRequestState;
|
|
107
91
|
};
|
|
108
|
-
|
|
109
92
|
__signature__(useNotificationRequestState, "useIntl{{ formatMessage }}\nuseContext{{ addNotification }}\nuseCallback{onSuccess}\nuseCallback{onError}\nuseRequestState{buildRequestState}", function () {
|
|
110
93
|
return [_reactIntl.useIntl, _useRequestState.default];
|
|
111
94
|
});
|
|
112
|
-
|
|
113
95
|
__signature__(useNotificationRequestState, "useIntl{{ formatMessage }}\nuseContext{{ addNotification }}\nuseCallback{onSuccess}\nuseCallback{onError}\nuseRequestState{buildRequestState}", function () {
|
|
114
96
|
return [_reactIntl.useIntl, _useRequestState.default];
|
|
115
97
|
});
|
|
116
|
-
|
|
117
98
|
var _default = useNotificationRequestState;
|
|
118
99
|
var _default2 = _default;
|
|
119
100
|
var _default3 = _default2;
|
|
120
101
|
exports.default = _default3;
|
|
121
102
|
;
|
|
122
|
-
|
|
123
103
|
(function () {
|
|
124
104
|
var reactHotLoader = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default : undefined;
|
|
125
|
-
|
|
126
105
|
if (!reactHotLoader) {
|
|
127
106
|
return;
|
|
128
107
|
}
|
|
129
|
-
|
|
130
108
|
reactHotLoader.register(useNotificationRequestState, "useNotificationRequestState", "/home/vsts/work/1/s/src/hooks/useNotificationRequestState.js");
|
|
131
109
|
reactHotLoader.register(_default, "default", "/home/vsts/work/1/s/src/hooks/useNotificationRequestState.js");
|
|
132
110
|
})();
|
|
133
|
-
|
|
134
111
|
;
|
|
135
|
-
|
|
136
112
|
(function () {
|
|
137
113
|
var leaveModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.leaveModule : undefined;
|
|
138
114
|
leaveModule && leaveModule(module);
|
|
139
115
|
})();
|
|
140
|
-
|
|
141
116
|
;
|
|
142
|
-
|
|
143
117
|
(function () {
|
|
144
118
|
var reactHotLoader = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default : undefined;
|
|
145
|
-
|
|
146
119
|
if (!reactHotLoader) {
|
|
147
120
|
return;
|
|
148
121
|
}
|
|
149
|
-
|
|
150
122
|
reactHotLoader.register(useNotificationRequestState, "useNotificationRequestState", "/home/vsts/work/1/s/src/hooks/useNotificationRequestState.js");
|
|
151
123
|
reactHotLoader.register(_default2, "default", "/home/vsts/work/1/s/src/hooks/useNotificationRequestState.js");
|
|
152
124
|
})();
|
|
153
|
-
|
|
154
125
|
;
|
|
155
|
-
|
|
156
126
|
(function () {
|
|
157
127
|
var leaveModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.leaveModule : undefined;
|
|
158
128
|
leaveModule && leaveModule(module);
|
|
@@ -2,98 +2,74 @@
|
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports.default = void 0;
|
|
5
|
-
|
|
6
5
|
var _react = require("react");
|
|
7
|
-
|
|
8
6
|
(function () {
|
|
9
7
|
var enterModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.enterModule : undefined;
|
|
10
8
|
enterModule && enterModule(module);
|
|
11
9
|
})();
|
|
12
|
-
|
|
13
10
|
(function () {
|
|
14
11
|
var enterModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.enterModule : undefined;
|
|
15
12
|
enterModule && enterModule(module);
|
|
16
13
|
})();
|
|
17
|
-
|
|
18
14
|
var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) {
|
|
19
15
|
return a;
|
|
20
16
|
};
|
|
21
|
-
|
|
22
17
|
var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) {
|
|
23
18
|
return a;
|
|
24
19
|
};
|
|
25
|
-
|
|
26
20
|
var defaultPredicate = function defaultPredicate(previous, current) {
|
|
27
21
|
return previous !== undefined && previous !== null && previous !== current;
|
|
28
22
|
};
|
|
29
|
-
|
|
30
23
|
var usePreviousModified = function usePreviousModified(value, effectAction, predicate) {
|
|
31
24
|
if (effectAction === void 0) {
|
|
32
25
|
effectAction = null;
|
|
33
26
|
}
|
|
34
|
-
|
|
35
27
|
if (predicate === void 0) {
|
|
36
28
|
predicate = defaultPredicate;
|
|
37
29
|
}
|
|
38
|
-
|
|
39
30
|
var ref = (0, _react.useRef)(value);
|
|
40
31
|
var predicateResult = predicate(ref.current, value);
|
|
41
32
|
(0, _react.useEffect)(function () {
|
|
42
33
|
if (effectAction != null && predicateResult) {
|
|
43
34
|
effectAction(value, ref.current);
|
|
44
35
|
}
|
|
45
|
-
|
|
46
36
|
ref.current = value;
|
|
47
37
|
}, [value]); // eslint-disable-line react-hooks/exhaustive-deps
|
|
48
38
|
|
|
49
39
|
return predicateResult;
|
|
50
40
|
};
|
|
51
|
-
|
|
52
41
|
__signature__(usePreviousModified, "useRef{ref}\nuseEffect{}");
|
|
53
|
-
|
|
54
42
|
__signature__(usePreviousModified, "useRef{ref}\nuseEffect{}");
|
|
55
|
-
|
|
56
43
|
var _default = usePreviousModified;
|
|
57
44
|
var _default2 = _default;
|
|
58
45
|
var _default3 = _default2;
|
|
59
46
|
exports.default = _default3;
|
|
60
47
|
;
|
|
61
|
-
|
|
62
48
|
(function () {
|
|
63
49
|
var reactHotLoader = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default : undefined;
|
|
64
|
-
|
|
65
50
|
if (!reactHotLoader) {
|
|
66
51
|
return;
|
|
67
52
|
}
|
|
68
|
-
|
|
69
53
|
reactHotLoader.register(defaultPredicate, "defaultPredicate", "/home/vsts/work/1/s/src/hooks/usePreviousModified.js");
|
|
70
54
|
reactHotLoader.register(usePreviousModified, "usePreviousModified", "/home/vsts/work/1/s/src/hooks/usePreviousModified.js");
|
|
71
55
|
reactHotLoader.register(_default, "default", "/home/vsts/work/1/s/src/hooks/usePreviousModified.js");
|
|
72
56
|
})();
|
|
73
|
-
|
|
74
57
|
;
|
|
75
|
-
|
|
76
58
|
(function () {
|
|
77
59
|
var leaveModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.leaveModule : undefined;
|
|
78
60
|
leaveModule && leaveModule(module);
|
|
79
61
|
})();
|
|
80
|
-
|
|
81
62
|
;
|
|
82
|
-
|
|
83
63
|
(function () {
|
|
84
64
|
var reactHotLoader = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default : undefined;
|
|
85
|
-
|
|
86
65
|
if (!reactHotLoader) {
|
|
87
66
|
return;
|
|
88
67
|
}
|
|
89
|
-
|
|
90
68
|
reactHotLoader.register(defaultPredicate, "defaultPredicate", "/home/vsts/work/1/s/src/hooks/usePreviousModified.js");
|
|
91
69
|
reactHotLoader.register(usePreviousModified, "usePreviousModified", "/home/vsts/work/1/s/src/hooks/usePreviousModified.js");
|
|
92
70
|
reactHotLoader.register(_default2, "default", "/home/vsts/work/1/s/src/hooks/usePreviousModified.js");
|
|
93
71
|
})();
|
|
94
|
-
|
|
95
72
|
;
|
|
96
|
-
|
|
97
73
|
(function () {
|
|
98
74
|
var leaveModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.leaveModule : undefined;
|
|
99
75
|
leaveModule && leaveModule(module);
|