orc-shared 1.2.2-dev.0 → 1.2.2

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.
Files changed (303) hide show
  1. package/dist/actions/applications.js +12 -50
  2. package/dist/actions/authentication.js +8 -43
  3. package/dist/actions/countries.js +4 -34
  4. package/dist/actions/locale.js +12 -52
  5. package/dist/actions/makeApiAction.js +6 -52
  6. package/dist/actions/makeOrcApiAction.js +0 -25
  7. package/dist/actions/metadata.js +60 -171
  8. package/dist/actions/modules.js +0 -26
  9. package/dist/actions/navigation.js +0 -32
  10. package/dist/actions/requestState.js +0 -18
  11. package/dist/actions/requestsApi.js +0 -17
  12. package/dist/actions/scopes.js +12 -54
  13. package/dist/actions/timezones.js +4 -34
  14. package/dist/actions/toasts.js +3 -23
  15. package/dist/actions/versionInfo.js +4 -37
  16. package/dist/actions/view.js +0 -38
  17. package/dist/buildStore.js +0 -52
  18. package/dist/components/AppFrame/About.js +3 -67
  19. package/dist/components/AppFrame/Anchor.js +1 -25
  20. package/dist/components/AppFrame/AppFrame.js +21 -90
  21. package/dist/components/AppFrame/ApplicationSelector/ApplicationDialog.js +4 -35
  22. package/dist/components/AppFrame/ApplicationSelector/Header.js +2 -32
  23. package/dist/components/AppFrame/ApplicationSelector/index.js +1 -30
  24. package/dist/components/AppFrame/ConnectedToastList.js +0 -31
  25. package/dist/components/AppFrame/Help.js +0 -25
  26. package/dist/components/AppFrame/MenuItem.js +18 -71
  27. package/dist/components/AppFrame/Preferences.js +12 -76
  28. package/dist/components/AppFrame/Sidebar.js +9 -54
  29. package/dist/components/AppFrame/Topbar.js +9 -65
  30. package/dist/components/AppFrame/index.js +0 -20
  31. package/dist/components/AppFrame/useApplicationHelpUrl.js +0 -22
  32. package/dist/components/ApplicationModuleLoader.js +5 -44
  33. package/dist/components/Authenticate.js +5 -48
  34. package/dist/components/Button.js +0 -24
  35. package/dist/components/CategoryList.js +25 -80
  36. package/dist/components/Checkbox.js +4 -42
  37. package/dist/components/ColumnWrapper.js +0 -19
  38. package/dist/components/Culture.js +0 -29
  39. package/dist/components/DevPages.js +0 -21
  40. package/dist/components/DropMenu/Menu.js +4 -36
  41. package/dist/components/DropMenu/index.js +10 -48
  42. package/dist/components/ErrorPlaceholder.js +3 -31
  43. package/dist/components/Form/Combination.js +3 -28
  44. package/dist/components/Form/Field.js +7 -38
  45. package/dist/components/Form/FieldElements.js +10 -42
  46. package/dist/components/Form/FieldList.js +23 -89
  47. package/dist/components/Form/Fieldset.js +1 -27
  48. package/dist/components/Form/Form.js +6 -37
  49. package/dist/components/Form/FormElement.js +1 -20
  50. package/dist/components/Form/InputField.js +16 -65
  51. package/dist/components/Form/Inputs/Button.js +6 -36
  52. package/dist/components/Form/Inputs/Date.js +3 -29
  53. package/dist/components/Form/Inputs/FieldButtons.js +0 -25
  54. package/dist/components/Form/Inputs/Number.js +8 -47
  55. package/dist/components/Form/Inputs/ReadOnly.js +0 -29
  56. package/dist/components/Form/Inputs/SmallButton.js +7 -39
  57. package/dist/components/Form/Inputs/Text.js +9 -42
  58. package/dist/components/Form/Inputs/Time.js +5 -34
  59. package/dist/components/Form/Inputs/Toggles.js +6 -40
  60. package/dist/components/Form/Inputs/Translation.js +17 -76
  61. package/dist/components/Form/Inputs/index.js +0 -28
  62. package/dist/components/Form/index.js +0 -20
  63. package/dist/components/Head.js +0 -22
  64. package/dist/components/I18n.js +1 -29
  65. package/dist/components/Icon.js +1 -27
  66. package/dist/components/IconButton.js +2 -32
  67. package/dist/components/Input.js +3 -43
  68. package/dist/components/InternetExplorerWarningMessage.js +0 -31
  69. package/dist/components/List/DataCell.js +4 -43
  70. package/dist/components/List/HeadCell.js +3 -43
  71. package/dist/components/List/HeadRow.js +2 -25
  72. package/dist/components/List/List.js +35 -105
  73. package/dist/components/List/Row.js +7 -38
  74. package/dist/components/List/enhanceColumnDefs.js +0 -28
  75. package/dist/components/List/index.js +0 -20
  76. package/dist/components/Loader.js +3 -46
  77. package/dist/components/LoadingIcon.js +0 -24
  78. package/dist/components/MaterialUI/DataDisplay/Badge.js +2 -31
  79. package/dist/components/MaterialUI/DataDisplay/Chip.js +1 -33
  80. package/dist/components/MaterialUI/DataDisplay/CollapsableList.js +5 -49
  81. package/dist/components/MaterialUI/DataDisplay/Divider.js +0 -30
  82. package/dist/components/MaterialUI/DataDisplay/Icon.js +3 -29
  83. package/dist/components/MaterialUI/DataDisplay/List.js +16 -55
  84. package/dist/components/MaterialUI/DataDisplay/Modal.js +1 -36
  85. package/dist/components/MaterialUI/DataDisplay/Notification.js +12 -66
  86. package/dist/components/MaterialUI/DataDisplay/NotificationProps.js +1 -34
  87. package/dist/components/MaterialUI/DataDisplay/PopperedElements/PopperedIcon.js +1 -23
  88. package/dist/components/MaterialUI/DataDisplay/PredefinedElements/ActionModal.js +5 -37
  89. package/dist/components/MaterialUI/DataDisplay/PredefinedElements/Address.js +1 -33
  90. package/dist/components/MaterialUI/DataDisplay/PredefinedElements/ConfirmationModal.js +7 -28
  91. package/dist/components/MaterialUI/DataDisplay/PredefinedElements/DiscountedPrice.js +2 -32
  92. package/dist/components/MaterialUI/DataDisplay/PredefinedElements/InformationItem.js +14 -54
  93. package/dist/components/MaterialUI/DataDisplay/PredefinedElements/Placeholder.js +4 -33
  94. package/dist/components/MaterialUI/DataDisplay/PredefinedElements/SectionTitle.js +0 -25
  95. package/dist/components/MaterialUI/DataDisplay/PredefinedElements/StepperModal.js +12 -58
  96. package/dist/components/MaterialUI/DataDisplay/PredefinedElements/TableInfoBar.js +0 -29
  97. package/dist/components/MaterialUI/DataDisplay/PredefinedElements/Translations.js +11 -57
  98. package/dist/components/MaterialUI/DataDisplay/SelectionList.js +21 -68
  99. package/dist/components/MaterialUI/DataDisplay/Table.js +33 -122
  100. package/dist/components/MaterialUI/DataDisplay/TableHeaderCell.js +0 -35
  101. package/dist/components/MaterialUI/DataDisplay/TableProps.js +1 -49
  102. package/dist/components/MaterialUI/DataDisplay/Timeline.js +1 -21
  103. package/dist/components/MaterialUI/DataDisplay/TimelineItem.js +4 -32
  104. package/dist/components/MaterialUI/DataDisplay/TooltippedElements/MultipleLinesText.js +6 -45
  105. package/dist/components/MaterialUI/DataDisplay/TooltippedElements/TooltippedIcon.js +4 -30
  106. package/dist/components/MaterialUI/DataDisplay/TooltippedElements/TooltippedTypography.js +1 -22
  107. package/dist/components/MaterialUI/DataDisplay/TransferList.js +28 -95
  108. package/dist/components/MaterialUI/DataDisplay/chipProps.js +1 -38
  109. package/dist/components/MaterialUI/DataDisplay/collapsableListProps.js +1 -37
  110. package/dist/components/MaterialUI/DataDisplay/dividerProps.js +1 -41
  111. package/dist/components/MaterialUI/DataDisplay/index.js +0 -33
  112. package/dist/components/MaterialUI/DataDisplay/modalProps.js +1 -36
  113. package/dist/components/MaterialUI/DataDisplay/tableHelpers.js +3 -66
  114. package/dist/components/MaterialUI/DataDisplay/useTableSelection.js +6 -45
  115. package/dist/components/MaterialUI/Feedback/NotificationContext.js +3 -38
  116. package/dist/components/MaterialUI/Feedback/loadingScreen.js +3 -42
  117. package/dist/components/MaterialUI/Feedback/useNotification.js +0 -21
  118. package/dist/components/MaterialUI/Inputs/Autocomplete.js +3 -44
  119. package/dist/components/MaterialUI/Inputs/AutocompleteProps.js +1 -37
  120. package/dist/components/MaterialUI/Inputs/Checkbox.js +0 -39
  121. package/dist/components/MaterialUI/Inputs/CheckboxGroup.js +0 -42
  122. package/dist/components/MaterialUI/Inputs/CheckboxGroupProps.js +1 -38
  123. package/dist/components/MaterialUI/Inputs/CheckboxProps.js +1 -39
  124. package/dist/components/MaterialUI/Inputs/DatePicker.js +14 -52
  125. package/dist/components/MaterialUI/Inputs/InputBase.js +5 -54
  126. package/dist/components/MaterialUI/Inputs/InputBaseProps.js +1 -49
  127. package/dist/components/MaterialUI/Inputs/PredefinedElements/SearchControl.js +10 -63
  128. package/dist/components/MaterialUI/Inputs/PredefinedElements/TitledSelect.js +3 -31
  129. package/dist/components/MaterialUI/Inputs/Radio.js +8 -54
  130. package/dist/components/MaterialUI/Inputs/RadioProps.js +1 -41
  131. package/dist/components/MaterialUI/Inputs/Select.js +6 -70
  132. package/dist/components/MaterialUI/Inputs/SelectProps.js +1 -46
  133. package/dist/components/MaterialUI/Inputs/StandaloneRadio.js +0 -34
  134. package/dist/components/MaterialUI/Inputs/Switch.js +1 -37
  135. package/dist/components/MaterialUI/Inputs/SwitchProps.js +1 -40
  136. package/dist/components/MaterialUI/Inputs/TimePicker.js +12 -89
  137. package/dist/components/MaterialUI/Inputs/createInput.js +3 -30
  138. package/dist/components/MaterialUI/Inputs/index.js +0 -35
  139. package/dist/components/MaterialUI/Inputs/standaloneRadioProps.js +1 -41
  140. package/dist/components/MaterialUI/Navigation/DropDownMenu.js +10 -54
  141. package/dist/components/MaterialUI/Navigation/DropDownMenuProps.js +1 -33
  142. package/dist/components/MaterialUI/Navigation/ExternalLink.js +2 -27
  143. package/dist/components/MaterialUI/Navigation/PredefinedElements/ActionMenu.js +4 -31
  144. package/dist/components/MaterialUI/Navigation/TabBar.js +21 -102
  145. package/dist/components/MaterialUI/Navigation/TabLabel.js +5 -39
  146. package/dist/components/MaterialUI/ScopeSelector/ScopeSelector.js +7 -42
  147. package/dist/components/MaterialUI/ScopeSelector/ScopeTreeView.js +20 -60
  148. package/dist/components/MaterialUI/ScopeSelector/TreeItem.js +13 -67
  149. package/dist/components/MaterialUI/Surfaces/ExpansionPanel.js +13 -53
  150. package/dist/components/MaterialUI/Surfaces/Paper.js +1 -31
  151. package/dist/components/MaterialUI/Surfaces/PredefinedElements/TitledPaper.js +3 -28
  152. package/dist/components/MaterialUI/Surfaces/SectionExpansionPanel.js +17 -60
  153. package/dist/components/MaterialUI/Surfaces/expansionPanelProps.js +1 -55
  154. package/dist/components/MaterialUI/Surfaces/paperProps.js +1 -36
  155. package/dist/components/MaterialUI/componentProps.js +0 -28
  156. package/dist/components/MaterialUI/hocs/withDeferredPopper.js +9 -58
  157. package/dist/components/MaterialUI/hocs/withDeferredTooltip.js +7 -43
  158. package/dist/components/MaterialUI/muiThemes.js +2 -56
  159. package/dist/components/MaterialUI/textProps.js +1 -33
  160. package/dist/components/Modal/Background.js +0 -19
  161. package/dist/components/Modal/Dialog.js +2 -26
  162. package/dist/components/Modal/Wrapper.js +0 -26
  163. package/dist/components/Modal/index.js +6 -42
  164. package/dist/components/Modules.js +18 -90
  165. package/dist/components/MultiSelector.js +20 -73
  166. package/dist/components/Navigation/Bar.js +24 -87
  167. package/dist/components/Navigation/Tab.js +20 -72
  168. package/dist/components/Navigation/index.js +2 -21
  169. package/dist/components/Navigation/useNavigationState.js +85 -172
  170. package/dist/components/Placeholder.js +6 -44
  171. package/dist/components/Provision.js +4 -36
  172. package/dist/components/Routing/FullPage.js +14 -37
  173. package/dist/components/Routing/Page.js +13 -50
  174. package/dist/components/Routing/Segment.js +5 -30
  175. package/dist/components/Routing/SegmentPage.js +25 -105
  176. package/dist/components/Routing/SubPage.js +7 -55
  177. package/dist/components/Routing/withWaypointing.js +3 -36
  178. package/dist/components/Scope/ScopeModificationConfirmationDialog.js +3 -30
  179. package/dist/components/Scope/ScopeNode.js +6 -47
  180. package/dist/components/Scope/Selector.js +8 -44
  181. package/dist/components/Scope/index.js +24 -93
  182. package/dist/components/Scope/useScopeConfirmationModalState.js +11 -74
  183. package/dist/components/Scope/useScopeData.js +0 -25
  184. package/dist/components/Scope/useScopeSelect.js +0 -26
  185. package/dist/components/Selector.js +14 -75
  186. package/dist/components/Sidepanel.js +0 -28
  187. package/dist/components/Spritesheet.js +0 -26
  188. package/dist/components/Switch.js +12 -52
  189. package/dist/components/Text.js +4 -48
  190. package/dist/components/ToastList.js +5 -45
  191. package/dist/components/Toolbar.js +17 -75
  192. package/dist/components/Tooltip.js +0 -24
  193. package/dist/components/Treeview/Branch.js +0 -25
  194. package/dist/components/Treeview/Label.js +0 -29
  195. package/dist/components/Treeview/Leaf.js +0 -21
  196. package/dist/components/Treeview/Node.js +15 -55
  197. package/dist/components/Treeview/index.js +20 -63
  198. package/dist/components/Treeview/settings.js +0 -17
  199. package/dist/constants.js +2 -17
  200. package/dist/getTheme.js +0 -29
  201. package/dist/getThemeOverrides.js +0 -21
  202. package/dist/hocs/routingConnector.js +0 -21
  203. package/dist/hocs/withAuthentication.js +4 -26
  204. package/dist/hocs/withClickOutside.js +3 -29
  205. package/dist/hocs/withErrorBoundary.js +4 -39
  206. package/dist/hocs/withId.js +2 -31
  207. package/dist/hocs/withInfiniteScroll.js +15 -32
  208. package/dist/hocs/withInitialLoad.js +0 -20
  209. package/dist/hocs/withLocaleSwitch.js +0 -19
  210. package/dist/hocs/withNavigationLink.js +3 -30
  211. package/dist/hocs/withRequestActivity.js +0 -21
  212. package/dist/hocs/withScopeData.js +4 -31
  213. package/dist/hocs/withScrollBox.js +3 -32
  214. package/dist/hocs/withToggle.js +4 -34
  215. package/dist/hocs/withUpdateHandler.js +0 -22
  216. package/dist/hocs/withViewState.js +3 -30
  217. package/dist/hooks/useDispatchWithModulesData.js +0 -26
  218. package/dist/hooks/useEditState.js +3 -102
  219. package/dist/hooks/useEntityLoader.js +13 -64
  220. package/dist/hooks/useFullEntityEditState.js +4 -53
  221. package/dist/hooks/useInfiniteScroll.js +3 -31
  222. package/dist/hooks/useLabelMessage.js +0 -41
  223. package/dist/hooks/useLoader.js +0 -27
  224. package/dist/hooks/useMultipleFieldEditState.js +0 -39
  225. package/dist/hooks/useNavigationHandler.js +3 -28
  226. package/dist/hooks/useNotificationRequestState.js +14 -46
  227. package/dist/hooks/usePreviousModified.js +0 -24
  228. package/dist/hooks/useRequestState.js +8 -38
  229. package/dist/hooks/useSelectorAndUnwrap.js +0 -23
  230. package/dist/hooks/useToggle.js +3 -33
  231. package/dist/hooks/useViewState.js +0 -23
  232. package/dist/index.js +1 -2
  233. package/dist/reducers/applications.js +0 -23
  234. package/dist/reducers/authentication.js +4 -35
  235. package/dist/reducers/countries.js +0 -25
  236. package/dist/reducers/localeFactory.js +0 -30
  237. package/dist/reducers/metadata.js +2 -62
  238. package/dist/reducers/modules.js +0 -36
  239. package/dist/reducers/navigation.js +8 -47
  240. package/dist/reducers/request.js +0 -28
  241. package/dist/reducers/requestStates.js +0 -42
  242. package/dist/reducers/scopes.js +0 -28
  243. package/dist/reducers/settings.js +4 -39
  244. package/dist/reducers/timezones.js +0 -25
  245. package/dist/reducers/toasts.js +0 -27
  246. package/dist/reducers/versionInfo.js +0 -24
  247. package/dist/reducers/view.js +36 -84
  248. package/dist/schemas/countries.js +0 -17
  249. package/dist/schemas/definitions.js +0 -17
  250. package/dist/schemas/metadata.js +0 -17
  251. package/dist/schemas/productDefinitions.js +0 -17
  252. package/dist/schemas/scopes.js +0 -17
  253. package/dist/schemas/timezones.js +0 -17
  254. package/dist/selectors/applications.js +0 -20
  255. package/dist/selectors/authentication.js +0 -40
  256. package/dist/selectors/countries.js +0 -22
  257. package/dist/selectors/locale.js +1 -29
  258. package/dist/selectors/metadata.js +1 -44
  259. package/dist/selectors/modules.js +0 -21
  260. package/dist/selectors/navigation.js +9 -39
  261. package/dist/selectors/requestStates.js +0 -22
  262. package/dist/selectors/requests.js +2 -22
  263. package/dist/selectors/route.js +0 -21
  264. package/dist/selectors/scope.js +0 -32
  265. package/dist/selectors/settings.js +0 -18
  266. package/dist/selectors/timezones.js +0 -19
  267. package/dist/selectors/versionInfo.js +0 -18
  268. package/dist/selectors/view.js +3 -74
  269. package/dist/sharedMessages.js +0 -17
  270. package/dist/spawnerMiddleware.js +0 -24
  271. package/dist/utils/buildUrl.js +5 -36
  272. package/dist/utils/countryHelper.js +0 -18
  273. package/dist/utils/curry.js +0 -19
  274. package/dist/utils/debounce.js +1 -20
  275. package/dist/utils/displayModeHelper.js +0 -24
  276. package/dist/utils/domHelper.js +0 -17
  277. package/dist/utils/flatten.js +2 -35
  278. package/dist/utils/index.js +0 -31
  279. package/dist/utils/insertIcons.js +0 -21
  280. package/dist/utils/localizationHelper.js +0 -26
  281. package/dist/utils/logPass.js +1 -22
  282. package/dist/utils/mapHelper.js +1 -25
  283. package/dist/utils/memoize.js +0 -23
  284. package/dist/utils/modelValidationHelper.js +0 -41
  285. package/dist/utils/normalizeForSearch.js +2 -19
  286. package/dist/utils/objectHelper.js +0 -22
  287. package/dist/utils/parseHelper.js +0 -32
  288. package/dist/utils/profilerHelper.js +0 -18
  289. package/dist/utils/propertyHelper.js +1 -38
  290. package/dist/utils/propertyValidator.js +0 -25
  291. package/dist/utils/requestProcessingHelper.js +0 -24
  292. package/dist/utils/safeGet.js +0 -18
  293. package/dist/utils/setTranslation.js +0 -27
  294. package/dist/utils/setTranslationWithFallback.js +0 -32
  295. package/dist/utils/stripKey.js +1 -23
  296. package/dist/utils/styledPropFuncs.js +3 -29
  297. package/dist/utils/testUtils.js +19 -86
  298. package/dist/utils/timezoneHelper.js +0 -31
  299. package/dist/utils/unwrapImmutable.js +0 -19
  300. package/dist/utils/urlHelper.js +2 -27
  301. package/dist/whyDidYouRerender.js +0 -5
  302. package/package.json +1 -1
  303. package/src/utils/testUtils.js +10 -1
@@ -2,41 +2,28 @@
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
20
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
31
-
32
21
  var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) {
33
22
  return a;
34
23
  };
35
-
36
24
  var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) {
37
25
  return a;
38
26
  };
39
-
40
27
  /* This hook is used when a component has a dynamic number of fields that can be edited (e.g.: Orders' Custom Configuration Parameters).
41
28
  It calls `useSelector` only once and handles the fields' states itself using in a similar structure to useEditState.
42
29
 
@@ -57,40 +44,30 @@ var useMultipleFieldEditState = function useMultipleFieldEditState(entityId, sec
57
44
  if (extendedValidationRules === void 0) {
58
45
  extendedValidationRules = {};
59
46
  }
60
-
61
47
  var dispatch = (0, _useDispatchWithModulesData.useDispatchWithModulesData)();
62
-
63
48
  var mergedValidationRules = _objectSpread(_objectSpread({}, _modelValidationHelper.validationRules), extendedValidationRules);
64
-
65
49
  var modifiedStates = (0, _reactRedux.useSelector)((0, _view.getModifiedModels)(entityId))[sectionName] || {};
66
-
67
50
  var useDynamicFieldState = function useDynamicFieldState(id, fieldName, errorTypes) {
68
51
  var _initialValues$id$fie, _initialValues$id, _modifiedStates$id$fi, _modifiedStates$id, _editState$value;
69
-
70
52
  if (errorTypes === void 0) {
71
53
  errorTypes = [];
72
54
  }
73
-
74
55
  var keys = [id, fieldName];
75
56
  var initialValue = (_initialValues$id$fie = (_initialValues$id = initialValues[id]) == null ? void 0 : _initialValues$id[fieldName]) != null ? _initialValues$id$fie : "";
76
57
  var editState = (_modifiedStates$id$fi = (_modifiedStates$id = modifiedStates[id]) == null ? void 0 : _modifiedStates$id[fieldName]) != null ? _modifiedStates$id$fi : {};
77
58
  editState.value = (_editState$value = editState.value) != null ? _editState$value : initialValue;
78
-
79
59
  var updateEditState = function updateEditState(newValue) {
80
60
  dispatch(_view2.setEditModelField, [keys, newValue, initialValue, entityId, sectionName]);
81
61
  isEditStateValid(newValue);
82
62
  };
83
-
84
63
  var resetEditState = function resetEditState() {
85
64
  dispatch(_view2.setEditModelField, [keys, initialValue, initialValue, entityId, sectionName]);
86
65
  };
87
-
88
66
  var isEditStateValid = function isEditStateValid(value) {
89
67
  var valueToValidate = value != null ? value : editState.value;
90
68
  var hasAnyValidationErrors = false;
91
69
  errorTypes.forEach(function (errorType) {
92
70
  var isValid = mergedValidationRules[errorType](valueToValidate, id, fieldName);
93
-
94
71
  if (isValid === false) {
95
72
  dispatch(_view2.setEditModelFieldError, [keys, errorType, entityId, sectionName]);
96
73
  hasAnyValidationErrors = true;
@@ -99,7 +76,6 @@ var useMultipleFieldEditState = function useMultipleFieldEditState(entityId, sec
99
76
  });
100
77
  return !hasAnyValidationErrors;
101
78
  };
102
-
103
79
  return {
104
80
  state: editState,
105
81
  update: updateEditState,
@@ -107,57 +83,42 @@ var useMultipleFieldEditState = function useMultipleFieldEditState(entityId, sec
107
83
  isValid: isEditStateValid
108
84
  };
109
85
  };
110
-
111
86
  return [useDynamicFieldState, modifiedStates];
112
87
  };
113
-
114
88
  __signature__(useMultipleFieldEditState, "useDispatchWithModulesData{dispatch}\nuseSelector{}", function () {
115
89
  return [_useDispatchWithModulesData.useDispatchWithModulesData, _reactRedux.useSelector];
116
90
  });
117
-
118
91
  __signature__(useMultipleFieldEditState, "useDispatchWithModulesData{dispatch}\nuseSelector{}", function () {
119
92
  return [_useDispatchWithModulesData.useDispatchWithModulesData, _reactRedux.useSelector];
120
93
  });
121
-
122
94
  var _default = useMultipleFieldEditState;
123
95
  var _default2 = _default;
124
96
  var _default3 = _default2;
125
97
  exports.default = _default3;
126
98
  ;
127
-
128
99
  (function () {
129
100
  var reactHotLoader = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default : undefined;
130
-
131
101
  if (!reactHotLoader) {
132
102
  return;
133
103
  }
134
-
135
104
  reactHotLoader.register(useMultipleFieldEditState, "useMultipleFieldEditState", "/home/vsts/work/1/s/src/hooks/useMultipleFieldEditState.js");
136
105
  reactHotLoader.register(_default, "default", "/home/vsts/work/1/s/src/hooks/useMultipleFieldEditState.js");
137
106
  })();
138
-
139
107
  ;
140
-
141
108
  (function () {
142
109
  var leaveModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.leaveModule : undefined;
143
110
  leaveModule && leaveModule(module);
144
111
  })();
145
-
146
112
  ;
147
-
148
113
  (function () {
149
114
  var reactHotLoader = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default : undefined;
150
-
151
115
  if (!reactHotLoader) {
152
116
  return;
153
117
  }
154
-
155
118
  reactHotLoader.register(useMultipleFieldEditState, "useMultipleFieldEditState", "/home/vsts/work/1/s/src/hooks/useMultipleFieldEditState.js");
156
119
  reactHotLoader.register(_default2, "default", "/home/vsts/work/1/s/src/hooks/useMultipleFieldEditState.js");
157
120
  })();
158
-
159
121
  ;
160
-
161
122
  (function () {
162
123
  var leaveModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.leaveModule : undefined;
163
124
  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
- local = _analyzeHref.local,
43
- self = _analyzeHref.self,
44
- active = _analyzeHref.active;
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,29 @@
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
21
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
33
-
34
22
  var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) {
35
23
  return a;
36
24
  };
37
-
38
25
  var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) {
39
26
  return a;
40
27
  };
41
-
42
28
  /*
43
29
  This hook is used to handle the notification message for deletes and updates.
44
30
  It uses useRequestState internally to know when to display messages.
@@ -56,45 +42,41 @@ var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoader
56
42
  }
57
43
  }
58
44
  */
45
+
59
46
  var useNotificationRequestState = function useNotificationRequestState(_ref) {
60
47
  var keys = _ref.keys,
61
- operation = _ref.operation,
62
- successMessageId = _ref.successMessageId,
63
- successMessageValues = _ref.successMessageValues,
64
- successAction = _ref.successAction,
65
- errorMessageId = _ref.errorMessageId,
66
- errorMessageValues = _ref.errorMessageValues,
67
- errorAction = _ref.errorAction;
68
-
48
+ operation = _ref.operation,
49
+ successMessageId = _ref.successMessageId,
50
+ successMessageValues = _ref.successMessageValues,
51
+ successAction = _ref.successAction,
52
+ errorMessageId = _ref.errorMessageId,
53
+ errorMessageValues = _ref.errorMessageValues,
54
+ errorAction = _ref.errorAction;
69
55
  var _useIntl = (0, _reactIntl.useIntl)(),
70
- formatMessage = _useIntl.formatMessage;
71
-
56
+ formatMessage = _useIntl.formatMessage;
72
57
  var _useContext = (0, _react.useContext)(_NotificationContext.NotificationContext),
73
- addNotification = _useContext.addNotification;
74
-
58
+ addNotification = _useContext.addNotification;
75
59
  var onSuccess = (0, _react.useCallback)(function () {
76
60
  var message = formatMessage(successMessageId, successMessageValues);
77
61
  addNotification(message, "success");
78
-
79
62
  if (successAction) {
80
63
  successAction();
81
- } // addNotification causes issues in the deps
64
+ }
65
+ // addNotification causes issues in the deps
82
66
  // eslint-disable-next-line react-hooks/exhaustive-deps
83
-
84
67
  }, [formatMessage, successAction, successMessageId, successMessageValues]);
85
68
  var onError = (0, _react.useCallback)(function (errorResponse) {
86
69
  var _errorResponse$respon, _errorResponse$respon2, _errorResponse$respon3;
87
-
88
70
  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
71
  var message = formatMessage(errorMessageId, _objectSpread(_objectSpread({}, errorMessageValues), {}, {
90
72
  errorMessage: errorMessage != null ? errorMessage : formatMessage(_sharedMessages.default.errorUnknown)
91
73
  }));
92
74
  addNotification(message, "error");
93
-
94
75
  if (errorAction) {
95
76
  errorAction(errorResponse);
96
77
  }
97
- }, // addNotification causes issues in the deps
78
+ },
79
+ // addNotification causes issues in the deps
98
80
  // eslint-disable-next-line react-hooks/exhaustive-deps
99
81
  [errorAction, errorMessageId, errorMessageValues, formatMessage]);
100
82
  var buildRequestState = (0, _useRequestState.default)({
@@ -105,54 +87,40 @@ var useNotificationRequestState = function useNotificationRequestState(_ref) {
105
87
  });
106
88
  return buildRequestState;
107
89
  };
108
-
109
90
  __signature__(useNotificationRequestState, "useIntl{{ formatMessage }}\nuseContext{{ addNotification }}\nuseCallback{onSuccess}\nuseCallback{onError}\nuseRequestState{buildRequestState}", function () {
110
91
  return [_reactIntl.useIntl, _useRequestState.default];
111
92
  });
112
-
113
93
  __signature__(useNotificationRequestState, "useIntl{{ formatMessage }}\nuseContext{{ addNotification }}\nuseCallback{onSuccess}\nuseCallback{onError}\nuseRequestState{buildRequestState}", function () {
114
94
  return [_reactIntl.useIntl, _useRequestState.default];
115
95
  });
116
-
117
96
  var _default = useNotificationRequestState;
118
97
  var _default2 = _default;
119
98
  var _default3 = _default2;
120
99
  exports.default = _default3;
121
100
  ;
122
-
123
101
  (function () {
124
102
  var reactHotLoader = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default : undefined;
125
-
126
103
  if (!reactHotLoader) {
127
104
  return;
128
105
  }
129
-
130
106
  reactHotLoader.register(useNotificationRequestState, "useNotificationRequestState", "/home/vsts/work/1/s/src/hooks/useNotificationRequestState.js");
131
107
  reactHotLoader.register(_default, "default", "/home/vsts/work/1/s/src/hooks/useNotificationRequestState.js");
132
108
  })();
133
-
134
109
  ;
135
-
136
110
  (function () {
137
111
  var leaveModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.leaveModule : undefined;
138
112
  leaveModule && leaveModule(module);
139
113
  })();
140
-
141
114
  ;
142
-
143
115
  (function () {
144
116
  var reactHotLoader = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default : undefined;
145
-
146
117
  if (!reactHotLoader) {
147
118
  return;
148
119
  }
149
-
150
120
  reactHotLoader.register(useNotificationRequestState, "useNotificationRequestState", "/home/vsts/work/1/s/src/hooks/useNotificationRequestState.js");
151
121
  reactHotLoader.register(_default2, "default", "/home/vsts/work/1/s/src/hooks/useNotificationRequestState.js");
152
122
  })();
153
-
154
123
  ;
155
-
156
124
  (function () {
157
125
  var leaveModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.leaveModule : undefined;
158
126
  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);
@@ -2,37 +2,26 @@
2
2
 
3
3
  exports.__esModule = true;
4
4
  exports.default = void 0;
5
-
6
5
  var _useSelectorAndUnwrap2 = _interopRequireDefault(require("./useSelectorAndUnwrap"));
7
-
8
6
  var _requestStates = require("../selectors/requestStates");
9
-
10
7
  var _react = require("react");
11
-
12
8
  var _reactRedux = require("react-redux");
13
-
14
9
  var _requestState = require("../actions/requestState");
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
  var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) {
29
20
  return a;
30
21
  };
31
-
32
22
  var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) {
33
23
  return a;
34
24
  };
35
-
36
25
  /*
37
26
  This hook is used to handle custom action after deletes and updates requests. We can add additional operation if required.
38
27
  We have a reducer scanning every request for a special payload (meta.requestState).
@@ -54,92 +43,73 @@ var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoader
54
43
  }
55
44
  }
56
45
  */
46
+
57
47
  var useRequestState = function useRequestState(_ref) {
58
48
  var keys = _ref.keys,
59
- operation = _ref.operation,
60
- successAction = _ref.successAction,
61
- errorAction = _ref.errorAction;
62
-
49
+ operation = _ref.operation,
50
+ successAction = _ref.successAction,
51
+ errorAction = _ref.errorAction;
63
52
  var _useSelectorAndUnwrap = (0, _useSelectorAndUnwrap2.default)((0, _requestStates.getRequestStateInfo)(operation, keys)),
64
- inProgress = _useSelectorAndUnwrap.inProgress,
65
- value = _useSelectorAndUnwrap.value,
66
- error = _useSelectorAndUnwrap.error,
67
- errorResponse = _useSelectorAndUnwrap.errorResponse;
68
-
53
+ inProgress = _useSelectorAndUnwrap.inProgress,
54
+ value = _useSelectorAndUnwrap.value,
55
+ error = _useSelectorAndUnwrap.error,
56
+ errorResponse = _useSelectorAndUnwrap.errorResponse;
69
57
  var dispatch = (0, _reactRedux.useDispatch)();
70
58
  (0, _react.useEffect)(function () {
71
59
  if (value && !inProgress && !error) {
72
60
  dispatch((0, _requestState.resetRequestState)(keys, operation));
73
-
74
61
  if (successAction) {
75
62
  successAction();
76
63
  }
77
64
  } else if (!value && !inProgress && error) {
78
65
  dispatch((0, _requestState.resetRequestState)(keys, operation));
79
-
80
66
  if (errorAction) {
81
67
  errorAction(errorResponse);
82
68
  }
83
69
  }
84
70
  }, [dispatch, keys, operation, successAction, errorAction, errorResponse, inProgress, value, error]);
85
-
86
71
  var buildRequestState = function buildRequestState() {
87
72
  return {
88
73
  keys: keys,
89
74
  operation: operation
90
75
  };
91
76
  };
92
-
93
77
  return [buildRequestState];
94
78
  };
95
-
96
79
  __signature__(useRequestState, "useSelectorAndUnwrap{{ inProgress, value, error, errorResponse }}\nuseDispatch{dispatch}\nuseEffect{}", function () {
97
80
  return [_useSelectorAndUnwrap2.default, _reactRedux.useDispatch];
98
81
  });
99
-
100
82
  __signature__(useRequestState, "useSelectorAndUnwrap{{ inProgress, value, error, errorResponse }}\nuseDispatch{dispatch}\nuseEffect{}", function () {
101
83
  return [_useSelectorAndUnwrap2.default, _reactRedux.useDispatch];
102
84
  });
103
-
104
85
  var _default = useRequestState;
105
86
  var _default2 = _default;
106
87
  var _default3 = _default2;
107
88
  exports.default = _default3;
108
89
  ;
109
-
110
90
  (function () {
111
91
  var reactHotLoader = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default : undefined;
112
-
113
92
  if (!reactHotLoader) {
114
93
  return;
115
94
  }
116
-
117
95
  reactHotLoader.register(useRequestState, "useRequestState", "/home/vsts/work/1/s/src/hooks/useRequestState.js");
118
96
  reactHotLoader.register(_default, "default", "/home/vsts/work/1/s/src/hooks/useRequestState.js");
119
97
  })();
120
-
121
98
  ;
122
-
123
99
  (function () {
124
100
  var leaveModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.leaveModule : undefined;
125
101
  leaveModule && leaveModule(module);
126
102
  })();
127
-
128
103
  ;
129
-
130
104
  (function () {
131
105
  var reactHotLoader = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default : undefined;
132
-
133
106
  if (!reactHotLoader) {
134
107
  return;
135
108
  }
136
-
137
109
  reactHotLoader.register(useRequestState, "useRequestState", "/home/vsts/work/1/s/src/hooks/useRequestState.js");
138
110
  reactHotLoader.register(_default2, "default", "/home/vsts/work/1/s/src/hooks/useRequestState.js");
139
111
  })();
140
-
141
112
  ;
142
-
143
113
  (function () {
144
114
  var leaveModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.leaveModule : undefined;
145
115
  leaveModule && leaveModule(module);