orc-shared 5.8.0-dev.2 → 5.8.0-dev.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (318) hide show
  1. package/dist/actions/applications.js +5 -5
  2. package/dist/actions/authentication.js +5 -5
  3. package/dist/actions/countries.js +5 -5
  4. package/dist/actions/locale.js +5 -5
  5. package/dist/actions/makeApiAction.js +8 -8
  6. package/dist/actions/makeOrcApiAction.js +3 -3
  7. package/dist/actions/metadata.js +8 -8
  8. package/dist/actions/navigation.js +3 -3
  9. package/dist/actions/scopes.js +5 -5
  10. package/dist/actions/tasks.js +5 -5
  11. package/dist/actions/timezones.js +5 -5
  12. package/dist/actions/versionInfo.js +5 -5
  13. package/dist/buildStore.js +5 -5
  14. package/dist/components/AppFrame/About.js +14 -13
  15. package/dist/components/AppFrame/Anchor.js +1 -1
  16. package/dist/components/AppFrame/AppFrame.js +6 -6
  17. package/dist/components/AppFrame/ApplicationSelector/ApplicationDialog.js +1 -1
  18. package/dist/components/AppFrame/ApplicationSelector/Header.js +4 -4
  19. package/dist/components/AppFrame/ApplicationSelector/index.js +3 -3
  20. package/dist/components/AppFrame/ConnectedToastList.js +2 -2
  21. package/dist/components/AppFrame/Help.js +1 -1
  22. package/dist/components/AppFrame/MenuItem.js +6 -6
  23. package/dist/components/AppFrame/Preferences.js +8 -9
  24. package/dist/components/AppFrame/Sidebar.js +5 -5
  25. package/dist/components/AppFrame/Topbar.js +3 -3
  26. package/dist/components/AppFrame/index.js +2 -2
  27. package/dist/components/ApplicationModuleLoader.js +5 -5
  28. package/dist/components/Authenticate.js +2 -2
  29. package/dist/components/Button.js +1 -1
  30. package/dist/components/CategoryList.js +6 -6
  31. package/dist/components/Checkbox.js +5 -5
  32. package/dist/components/ColumnWrapper.js +1 -1
  33. package/dist/components/Culture.js +1 -1
  34. package/dist/components/DevPages.js +1 -1
  35. package/dist/components/DropMenu/Menu.js +2 -2
  36. package/dist/components/DropMenu/index.js +5 -5
  37. package/dist/components/ErrorPlaceholder.js +4 -4
  38. package/dist/components/Form/Combination.js +2 -2
  39. package/dist/components/Form/Field.js +3 -3
  40. package/dist/components/Form/FieldElements.js +4 -4
  41. package/dist/components/Form/FieldList.js +10 -11
  42. package/dist/components/Form/Fieldset.js +1 -1
  43. package/dist/components/Form/Form.js +2 -2
  44. package/dist/components/Form/FormElement.js +1 -1
  45. package/dist/components/Form/InputField.js +10 -10
  46. package/dist/components/Form/Inputs/Button.js +4 -4
  47. package/dist/components/Form/Inputs/Date.js +4 -4
  48. package/dist/components/Form/Inputs/FieldButtons.js +2 -2
  49. package/dist/components/Form/Inputs/Number.js +4 -4
  50. package/dist/components/Form/Inputs/ReadOnly.js +1 -1
  51. package/dist/components/Form/Inputs/SmallButton.js +4 -4
  52. package/dist/components/Form/Inputs/Text.js +4 -5
  53. package/dist/components/Form/Inputs/Time.js +4 -4
  54. package/dist/components/Form/Inputs/Toggles.js +4 -4
  55. package/dist/components/Form/Inputs/Translation.js +12 -12
  56. package/dist/components/Form/Inputs/index.js +1 -1
  57. package/dist/components/Form/index.js +2 -2
  58. package/dist/components/I18n.js +2 -2
  59. package/dist/components/Icon.js +3 -3
  60. package/dist/components/IconButton.js +3 -3
  61. package/dist/components/Input.js +5 -5
  62. package/dist/components/InternetExplorerWarningMessage.js +1 -1
  63. package/dist/components/List/DataCell.js +2 -2
  64. package/dist/components/List/HeadCell.js +2 -2
  65. package/dist/components/List/HeadRow.js +1 -1
  66. package/dist/components/List/List.js +5 -5
  67. package/dist/components/List/Row.js +2 -2
  68. package/dist/components/List/enhanceColumnDefs.js +3 -3
  69. package/dist/components/List/index.js +2 -2
  70. package/dist/components/Loader.js +6 -6
  71. package/dist/components/LoadingIcon.js +2 -2
  72. package/dist/components/MaterialUI/DataDisplay/Badge.js +4 -4
  73. package/dist/components/MaterialUI/DataDisplay/Chip.js +2 -2
  74. package/dist/components/MaterialUI/DataDisplay/CollapsableList.js +6 -6
  75. package/dist/components/MaterialUI/DataDisplay/Divider.js +2 -2
  76. package/dist/components/MaterialUI/DataDisplay/Icon.js +4 -4
  77. package/dist/components/MaterialUI/DataDisplay/List.js +1 -1
  78. package/dist/components/MaterialUI/DataDisplay/Modal.js +5 -5
  79. package/dist/components/MaterialUI/DataDisplay/Notification.js +9 -9
  80. package/dist/components/MaterialUI/DataDisplay/NotificationProps.js +7 -7
  81. package/dist/components/MaterialUI/DataDisplay/PopperedElements/PopperedIcon.js +2 -2
  82. package/dist/components/MaterialUI/DataDisplay/PredefinedElements/ActionModal.js +1 -1
  83. package/dist/components/MaterialUI/DataDisplay/PredefinedElements/Address.js +2 -2
  84. package/dist/components/MaterialUI/DataDisplay/PredefinedElements/ConfirmationModal.js +1 -1
  85. package/dist/components/MaterialUI/DataDisplay/PredefinedElements/DiscountedPrice.js +1 -1
  86. package/dist/components/MaterialUI/DataDisplay/PredefinedElements/GlobalErrorMessages.js +1 -1
  87. package/dist/components/MaterialUI/DataDisplay/PredefinedElements/InformationItem.js +24 -14
  88. package/dist/components/MaterialUI/DataDisplay/PredefinedElements/LookupDisplayValue.js +4 -4
  89. package/dist/components/MaterialUI/DataDisplay/PredefinedElements/Placeholder.js +1 -1
  90. package/dist/components/MaterialUI/DataDisplay/PredefinedElements/SectionTitle.js +1 -1
  91. package/dist/components/MaterialUI/DataDisplay/PredefinedElements/StepperModal.js +25 -11
  92. package/dist/components/MaterialUI/DataDisplay/PredefinedElements/TableInfoBar.js +1 -1
  93. package/dist/components/MaterialUI/DataDisplay/PredefinedElements/Translations.js +10 -10
  94. package/dist/components/MaterialUI/DataDisplay/SelectionList.js +17 -25
  95. package/dist/components/MaterialUI/DataDisplay/Table.js +9 -9
  96. package/dist/components/MaterialUI/DataDisplay/TableHeaderCell.js +1 -1
  97. package/dist/components/MaterialUI/DataDisplay/TableProps.js +7 -7
  98. package/dist/components/MaterialUI/DataDisplay/Timeline.js +1 -1
  99. package/dist/components/MaterialUI/DataDisplay/TimelineItem.js +1 -1
  100. package/dist/components/MaterialUI/DataDisplay/TooltippedElements/MultipleLinesText.js +7 -7
  101. package/dist/components/MaterialUI/DataDisplay/TooltippedElements/TooltippedIcon.js +4 -4
  102. package/dist/components/MaterialUI/DataDisplay/TooltippedElements/TooltippedTypography.js +2 -2
  103. package/dist/components/MaterialUI/DataDisplay/TransferList.js +10 -10
  104. package/dist/components/MaterialUI/DataDisplay/chipProps.js +7 -7
  105. package/dist/components/MaterialUI/DataDisplay/collapsableListProps.js +7 -7
  106. package/dist/components/MaterialUI/DataDisplay/dividerProps.js +7 -7
  107. package/dist/components/MaterialUI/DataDisplay/index.js +1 -1
  108. package/dist/components/MaterialUI/DataDisplay/modalProps.js +7 -7
  109. package/dist/components/MaterialUI/DataDisplay/tableHelpers.js +9 -5
  110. package/dist/components/MaterialUI/DataDisplay/useTableSelection.js +7 -7
  111. package/dist/components/MaterialUI/Feedback/NotificationContext.js +6 -6
  112. package/dist/components/MaterialUI/Feedback/loadingScreen.js +6 -6
  113. package/dist/components/MaterialUI/Inputs/Autocomplete.js +6 -6
  114. package/dist/components/MaterialUI/Inputs/AutocompleteProps.js +7 -7
  115. package/dist/components/MaterialUI/Inputs/Checkbox.js +5 -5
  116. package/dist/components/MaterialUI/Inputs/CheckboxGroup.js +5 -5
  117. package/dist/components/MaterialUI/Inputs/CheckboxGroupProps.js +7 -7
  118. package/dist/components/MaterialUI/Inputs/CheckboxProps.js +7 -7
  119. package/dist/components/MaterialUI/Inputs/DatePicker.js +16 -17
  120. package/dist/components/MaterialUI/Inputs/InputBase.js +15 -12
  121. package/dist/components/MaterialUI/Inputs/InputBaseProps.js +7 -7
  122. package/dist/components/MaterialUI/Inputs/LookupSelect.js +3 -3
  123. package/dist/components/MaterialUI/Inputs/PredefinedElements/SearchControl.js +2 -2
  124. package/dist/components/MaterialUI/Inputs/PredefinedElements/TitledSelect.js +1 -1
  125. package/dist/components/MaterialUI/Inputs/Radio.js +2 -2
  126. package/dist/components/MaterialUI/Inputs/RadioProps.js +7 -7
  127. package/dist/components/MaterialUI/Inputs/Select.js +24 -11
  128. package/dist/components/MaterialUI/Inputs/SelectProps.js +9 -8
  129. package/dist/components/MaterialUI/Inputs/StandaloneRadio.js +5 -5
  130. package/dist/components/MaterialUI/Inputs/Switch.js +33 -21
  131. package/dist/components/MaterialUI/Inputs/SwitchProps.js +7 -7
  132. package/dist/components/MaterialUI/Inputs/TimePicker.js +7 -7
  133. package/dist/components/MaterialUI/Inputs/createInput.js +6 -6
  134. package/dist/components/MaterialUI/Inputs/index.js +1 -1
  135. package/dist/components/MaterialUI/Inputs/standaloneRadioProps.js +7 -7
  136. package/dist/components/MaterialUI/Navigation/DropDownMenu.js +6 -6
  137. package/dist/components/MaterialUI/Navigation/DropDownMenuProps.js +7 -7
  138. package/dist/components/MaterialUI/Navigation/ExternalLink.js +1 -1
  139. package/dist/components/MaterialUI/Navigation/PredefinedElements/ActionMenu.js +1 -1
  140. package/dist/components/MaterialUI/Navigation/TabBar.js +60 -38
  141. package/dist/components/MaterialUI/Navigation/TabLabel.js +5 -5
  142. package/dist/components/MaterialUI/ScopeSelector/ScopeSelector.js +1 -1
  143. package/dist/components/MaterialUI/ScopeSelector/ScopeTreeView.js +5 -5
  144. package/dist/components/MaterialUI/ScopeSelector/TreeItem.js +13 -8
  145. package/dist/components/MaterialUI/Surfaces/ExpansionPanel.js +5 -5
  146. package/dist/components/MaterialUI/Surfaces/Paper.js +2 -2
  147. package/dist/components/MaterialUI/Surfaces/PredefinedElements/TitledPaper.js +1 -1
  148. package/dist/components/MaterialUI/Surfaces/SectionExpansionPanel.js +5 -5
  149. package/dist/components/MaterialUI/Surfaces/expansionPanelProps.js +8 -8
  150. package/dist/components/MaterialUI/Surfaces/paperProps.js +7 -7
  151. package/dist/components/MaterialUI/componentProps.js +3 -3
  152. package/dist/components/MaterialUI/hocs/withDeferredPopper.js +10 -16
  153. package/dist/components/MaterialUI/hocs/withDeferredTooltip.js +10 -9
  154. package/dist/components/MaterialUI/muiThemes.js +3 -3
  155. package/dist/components/MaterialUI/textProps.js +7 -7
  156. package/dist/components/Modal/Background.js +1 -1
  157. package/dist/components/Modal/Dialog.js +2 -2
  158. package/dist/components/Modal/Wrapper.js +2 -2
  159. package/dist/components/Modal/index.js +6 -6
  160. package/dist/components/Modules.js +9 -9
  161. package/dist/components/MultiSelector.js +9 -9
  162. package/dist/components/Navigation/Bar.js +9 -9
  163. package/dist/components/Navigation/Tab.js +8 -8
  164. package/dist/components/Navigation/index.js +2 -1
  165. package/dist/components/Navigation/useNavigationState.js +9 -9
  166. package/dist/components/Placeholder.js +5 -5
  167. package/dist/components/Provision.js +1 -1
  168. package/dist/components/Routing/FullPage.js +1 -1
  169. package/dist/components/Routing/Page.js +7 -7
  170. package/dist/components/Routing/Segment.js +2 -2
  171. package/dist/components/Routing/SegmentPage.js +11 -11
  172. package/dist/components/Routing/SubPage.js +5 -5
  173. package/dist/components/Routing/withWaypointing.js +5 -5
  174. package/dist/components/Scope/ScopeModificationConfirmationDialog.js +1 -1
  175. package/dist/components/Scope/ScopeNode.js +6 -6
  176. package/dist/components/Scope/Selector.js +1 -1
  177. package/dist/components/Scope/index.js +9 -9
  178. package/dist/components/Scope/useScopeConfirmationModalState.js +10 -10
  179. package/dist/components/Scope/useScopeSelect.js +1 -1
  180. package/dist/components/ScopeExtendedConfigurationLoader.js +5 -5
  181. package/dist/components/Selector.js +9 -9
  182. package/dist/components/Sidepanel.js +2 -2
  183. package/dist/components/Spritesheet.js +1 -1
  184. package/dist/components/Switch.js +5 -5
  185. package/dist/components/TaskDetailsModal.js +2 -2
  186. package/dist/components/Text.js +6 -6
  187. package/dist/components/ToastList.js +9 -6
  188. package/dist/components/Toolbar.js +5 -5
  189. package/dist/components/Tooltip.js +1 -1
  190. package/dist/components/Treeview/Branch.js +1 -1
  191. package/dist/components/Treeview/Label.js +2 -2
  192. package/dist/components/Treeview/Leaf.js +1 -1
  193. package/dist/components/Treeview/Node.js +7 -7
  194. package/dist/components/Treeview/index.js +11 -11
  195. package/dist/constants.js +7 -1
  196. package/dist/getThemeOverrides.js +3 -3
  197. package/dist/hocs/withAuthentication.js +2 -2
  198. package/dist/hocs/withClickOutside.js +4 -4
  199. package/dist/hocs/withErrorBoundary.js +7 -7
  200. package/dist/hocs/withId.js +4 -4
  201. package/dist/hocs/withNavigationLink.js +5 -5
  202. package/dist/hocs/withScopeData.js +5 -5
  203. package/dist/hocs/withScrollBox.js +4 -4
  204. package/dist/hocs/withToggle.js +8 -8
  205. package/dist/hocs/withUpdateHandler.js +3 -3
  206. package/dist/hocs/withViewState.js +5 -5
  207. package/dist/hooks/useEditState.js +3 -3
  208. package/dist/hooks/useEntityLoader.js +8 -8
  209. package/dist/hooks/useFullEntityEditState.js +8 -8
  210. package/dist/hooks/useInfiniteScroll.js +4 -4
  211. package/dist/hooks/useLabelMessage.js +4 -4
  212. package/dist/hooks/useMultipleFieldEditState.js +3 -3
  213. package/dist/hooks/useNotificationRequestState.js +4 -4
  214. package/dist/hooks/useRequestState.js +1 -1
  215. package/dist/hooks/useScopeGuardLoader.js +1 -1
  216. package/dist/hooks/useSelectorAndUnwrap.js +1 -1
  217. package/dist/hooks/useToggle.js +4 -4
  218. package/dist/reducers/applications.js +1 -1
  219. package/dist/reducers/authentication.js +5 -5
  220. package/dist/reducers/countries.js +1 -1
  221. package/dist/reducers/globalErrorMessages.js +1 -1
  222. package/dist/reducers/localeFactory.js +1 -1
  223. package/dist/reducers/metadata.js +18 -10
  224. package/dist/reducers/modules.js +1 -1
  225. package/dist/reducers/navigation.js +1 -1
  226. package/dist/reducers/request.js +1 -1
  227. package/dist/reducers/requestStates.js +1 -1
  228. package/dist/reducers/scopeRouteState.js +1 -1
  229. package/dist/reducers/scopes.js +1 -1
  230. package/dist/reducers/scopesExtendedConfiguration.js +1 -1
  231. package/dist/reducers/settings.js +1 -1
  232. package/dist/reducers/tasks.js +1 -1
  233. package/dist/reducers/timezones.js +1 -1
  234. package/dist/reducers/toasts.js +1 -1
  235. package/dist/reducers/versionInfo.js +1 -1
  236. package/dist/reducers/view.js +1 -1
  237. package/dist/selectors/locale.js +1 -1
  238. package/dist/selectors/metadata.js +4 -4
  239. package/dist/selectors/modules.js +3 -3
  240. package/dist/selectors/navigation.js +1 -1
  241. package/dist/selectors/route.js +1 -1
  242. package/dist/selectors/scope.js +1 -1
  243. package/dist/selectors/tasks.js +1 -1
  244. package/dist/utils/buildUrl.js +19 -5
  245. package/dist/utils/filterHelper.js +4 -2
  246. package/dist/utils/flatten.js +7 -7
  247. package/dist/utils/index.js +1 -1
  248. package/dist/utils/inputHelper.js +71 -0
  249. package/dist/utils/logPass.js +1 -1
  250. package/dist/utils/memoize.js +1 -1
  251. package/dist/utils/modelValidationHelper.js +3 -3
  252. package/dist/utils/normalizeForSearch.js +4 -1
  253. package/dist/utils/propertyBagHelper.js +4 -4
  254. package/dist/utils/propertyHelper.js +6 -6
  255. package/dist/utils/propertyValidator.js +1 -1
  256. package/dist/utils/setTranslation.js +3 -3
  257. package/dist/utils/setTranslationWithFallback.js +3 -3
  258. package/dist/utils/stripKey.js +4 -4
  259. package/dist/utils/styledPropFuncs.js +1 -1
  260. package/dist/utils/testUtils.js +8 -5
  261. package/dist/utils/timezoneHelper.js +6 -6
  262. package/dist/utils/unwrapImmutable.js +1 -1
  263. package/dist/utils/urlHelper.js +3 -3
  264. package/dist/whyDidYouRerender.js +1 -1
  265. package/package.json +2 -5
  266. package/src/components/AppFrame/About.js +4 -3
  267. package/src/components/AppFrame/About.test.js +61 -0
  268. package/src/components/AppFrame/ConnectedToastList.test.js +3 -1
  269. package/src/components/DropMenu/DropMenu.test.js +2 -0
  270. package/src/components/Form/InputField.js +1 -1
  271. package/src/components/Form/InputField.test.js +1 -1
  272. package/src/components/MaterialUI/DataDisplay/Badge.js +1 -1
  273. package/src/components/MaterialUI/DataDisplay/PredefinedElements/InformationItem.js +29 -8
  274. package/src/components/MaterialUI/DataDisplay/PredefinedElements/InformationItem.test.js +18 -6
  275. package/src/components/MaterialUI/DataDisplay/PredefinedElements/StepperModal.js +27 -6
  276. package/src/components/MaterialUI/DataDisplay/PredefinedElements/StepperModal.test.js +202 -0
  277. package/src/components/MaterialUI/DataDisplay/SelectionList.js +6 -20
  278. package/src/components/MaterialUI/DataDisplay/SelectionList.test.js +0 -6
  279. package/src/components/MaterialUI/DataDisplay/tableHelpers.js +14 -4
  280. package/src/components/MaterialUI/Feedback/loadingScreen.test.js +1 -0
  281. package/src/components/MaterialUI/Feedback/useNotification.test.js +1 -0
  282. package/src/components/MaterialUI/Inputs/DatePicker.js +16 -4
  283. package/src/components/MaterialUI/Inputs/DatePicker.test.js +35 -1
  284. package/src/components/MaterialUI/Inputs/InputBase.js +2 -0
  285. package/src/components/MaterialUI/Inputs/InputBase.test.js +49 -0
  286. package/src/components/MaterialUI/Inputs/Select.js +13 -1
  287. package/src/components/MaterialUI/Inputs/Select.test.js +37 -0
  288. package/src/components/MaterialUI/Inputs/SelectProps.js +1 -0
  289. package/src/components/MaterialUI/Inputs/Switch.js +28 -6
  290. package/src/components/MaterialUI/Inputs/Switch.test.js +39 -0
  291. package/src/components/MaterialUI/Navigation/TabBar.js +55 -34
  292. package/src/components/MaterialUI/ScopeSelector/TreeItem.js +6 -2
  293. package/src/components/MaterialUI/ScopeSelector/TreeItem.test.js +39 -0
  294. package/src/components/MaterialUI/hocs/withDeferredPopper.js +1 -4
  295. package/src/components/MaterialUI/hocs/withDeferredPopper.test.js +2 -0
  296. package/src/components/Modal/Modal.test.js +3 -1
  297. package/src/components/Modal/Wrapper.test.js +3 -1
  298. package/src/components/Routing/SegmentPage.js +2 -1
  299. package/src/components/Scope/Scope.test.js +3 -1
  300. package/src/components/Sidepanel.test.js +3 -1
  301. package/src/components/ToastList.js +2 -2
  302. package/src/constants.js +5 -0
  303. package/src/hocs/withErrorBoundary.test.js +4 -3
  304. package/src/hooks/useEditState.test.js +2 -0
  305. package/src/hooks/useLabelMessage.test.js +2 -0
  306. package/src/reducers/metadata.js +12 -17
  307. package/src/reducers/metadata.test.js +318 -156
  308. package/src/utils/buildUrl.js +15 -0
  309. package/src/utils/buildUrl.test.js +27 -1
  310. package/src/utils/filterHelper.js +4 -2
  311. package/src/utils/filterHelper.test.js +6 -6
  312. package/src/utils/inputHelper.js +22 -0
  313. package/src/utils/inputHelper.test.js +47 -0
  314. package/src/utils/normalizeForSearch.js +2 -0
  315. package/src/utils/propertyBagHelper.js +6 -3
  316. package/src/utils/propertyHelper.js +6 -6
  317. package/src/utils/testUtils.js +25 -22
  318. package/src/utils/testUtils.test.js +4 -4
@@ -178,11 +178,27 @@ describe("metadata", () => {
178
178
  });
179
179
 
180
180
  it("get order lookup success", () => {
181
- const lookups = {
182
- CanceledStatusReasons: {
181
+ const oldState = Immutable.fromJS({
182
+ lookups: {
183
+ order: {
184
+ index: {
185
+ CartStatus: {
186
+ lookupName: "CartStatus",
187
+ values: {},
188
+ isActive: true,
189
+ isSystem: true,
190
+ },
191
+ },
192
+ list: [],
193
+ },
194
+ },
195
+ });
196
+ const action = {
197
+ type: GET_ORDER_LOOKUP_SUCCESS,
198
+ payload: {
183
199
  lookupName: "CanceledStatusReasons",
184
- values: {
185
- CanceledReason1: {
200
+ values: [
201
+ {
186
202
  id: "e16d07f847284775b77cfb985724cf58",
187
203
  value: "CanceledReason1",
188
204
  lookupId: "CanceledStatusReasons",
@@ -190,7 +206,7 @@ describe("metadata", () => {
190
206
  isActive: true,
191
207
  isSystem: true,
192
208
  },
193
- CanceledReason2: {
209
+ {
194
210
  id: "6bbfe77703c745d68b8eaceb9cd484b1",
195
211
  value: "CanceledReason2",
196
212
  lookupId: "CanceledStatusReasons",
@@ -198,37 +214,48 @@ describe("metadata", () => {
198
214
  isActive: true,
199
215
  isSystem: true,
200
216
  },
201
- },
202
- isActive: true,
203
- isSystem: true,
204
- },
205
- CartStatus: {
206
- lookupName: "CartStatus",
207
- values: {},
217
+ ],
208
218
  isActive: true,
209
219
  isSystem: true,
210
220
  },
211
221
  };
212
-
213
- const oldState = Immutable.fromJS({
214
- lookups: {
215
- order: {
216
- index: { CartStatus: lookups.CartStatus },
217
- list: [],
218
- },
219
- },
220
- });
221
- const action = {
222
- type: GET_ORDER_LOOKUP_SUCCESS,
223
- payload: lookups.CanceledStatusReasons,
224
- };
225
222
  const newState = reducer(oldState, action);
226
223
  return expect(newState, "not to be", oldState).and(
227
224
  "to equal",
228
225
  Immutable.fromJS({
229
226
  lookups: {
230
227
  order: {
231
- index: lookups,
228
+ index: {
229
+ CanceledStatusReasons: {
230
+ lookupName: "CanceledStatusReasons",
231
+ values: {
232
+ CanceledReason1: {
233
+ id: "e16d07f847284775b77cfb985724cf58",
234
+ value: "CanceledReason1",
235
+ lookupId: "CanceledStatusReasons",
236
+ sortOrder: 0,
237
+ isActive: true,
238
+ isSystem: true,
239
+ },
240
+ CanceledReason2: {
241
+ id: "6bbfe77703c745d68b8eaceb9cd484b1",
242
+ value: "CanceledReason2",
243
+ lookupId: "CanceledStatusReasons",
244
+ sortOrder: 0,
245
+ isActive: true,
246
+ isSystem: true,
247
+ },
248
+ },
249
+ isActive: true,
250
+ isSystem: true,
251
+ },
252
+ CartStatus: {
253
+ lookupName: "CartStatus",
254
+ values: {},
255
+ isActive: true,
256
+ isSystem: true,
257
+ },
258
+ },
232
259
  list: [],
233
260
  },
234
261
  },
@@ -237,11 +264,27 @@ describe("metadata", () => {
237
264
  });
238
265
 
239
266
  it("save order metadata success", () => {
240
- const lookups = {
241
- CanceledStatusReasons: {
267
+ const oldState = Immutable.fromJS({
268
+ lookups: {
269
+ order: {
270
+ index: {
271
+ CartStatus: {
272
+ lookupName: "CartStatus",
273
+ values: {},
274
+ isActive: true,
275
+ isSystem: true,
276
+ },
277
+ },
278
+ list: [],
279
+ },
280
+ },
281
+ });
282
+ const action = {
283
+ type: SAVE_ORDER_LOOKUP_SUCCESS,
284
+ payload: {
242
285
  lookupName: "CanceledStatusReasons",
243
- values: {
244
- CanceledReason1: {
286
+ values: [
287
+ {
245
288
  id: "e16d07f847284775b77cfb985724cf58",
246
289
  value: "CanceledReason1",
247
290
  lookupId: "CanceledStatusReasons",
@@ -249,7 +292,7 @@ describe("metadata", () => {
249
292
  isActive: true,
250
293
  isSystem: true,
251
294
  },
252
- CanceledReason2: {
295
+ {
253
296
  id: "6bbfe77703c745d68b8eaceb9cd484b1",
254
297
  value: "CanceledReason2",
255
298
  lookupId: "CanceledStatusReasons",
@@ -257,29 +300,10 @@ describe("metadata", () => {
257
300
  isActive: true,
258
301
  isSystem: true,
259
302
  },
260
- },
303
+ ],
261
304
  isActive: true,
262
305
  isSystem: true,
263
306
  },
264
- CartStatus: {
265
- lookupName: "CartStatus",
266
- values: {},
267
- isActive: true,
268
- isSystem: true,
269
- },
270
- };
271
-
272
- const oldState = Immutable.fromJS({
273
- lookups: {
274
- order: {
275
- index: { CartStatus: lookups.CartStatus },
276
- list: [],
277
- },
278
- },
279
- });
280
- const action = {
281
- type: SAVE_ORDER_LOOKUP_SUCCESS,
282
- payload: lookups.CanceledStatusReasons,
283
307
  };
284
308
  const newState = reducer(oldState, action);
285
309
  return expect(newState, "not to be", oldState).and(
@@ -287,7 +311,37 @@ describe("metadata", () => {
287
311
  Immutable.fromJS({
288
312
  lookups: {
289
313
  order: {
290
- index: lookups,
314
+ index: {
315
+ CanceledStatusReasons: {
316
+ lookupName: "CanceledStatusReasons",
317
+ values: {
318
+ CanceledReason1: {
319
+ id: "e16d07f847284775b77cfb985724cf58",
320
+ value: "CanceledReason1",
321
+ lookupId: "CanceledStatusReasons",
322
+ sortOrder: 0,
323
+ isActive: true,
324
+ isSystem: true,
325
+ },
326
+ CanceledReason2: {
327
+ id: "6bbfe77703c745d68b8eaceb9cd484b1",
328
+ value: "CanceledReason2",
329
+ lookupId: "CanceledStatusReasons",
330
+ sortOrder: 0,
331
+ isActive: true,
332
+ isSystem: true,
333
+ },
334
+ },
335
+ isActive: true,
336
+ isSystem: true,
337
+ },
338
+ CartStatus: {
339
+ lookupName: "CartStatus",
340
+ values: {},
341
+ isActive: true,
342
+ isSystem: true,
343
+ },
344
+ },
291
345
  list: [],
292
346
  },
293
347
  },
@@ -296,11 +350,27 @@ describe("metadata", () => {
296
350
  });
297
351
 
298
352
  it("add order metadata success", () => {
299
- const lookups = {
300
- NewStatusReasons: {
353
+ const oldState = Immutable.fromJS({
354
+ lookups: {
355
+ order: {
356
+ index: {
357
+ CartStatus: {
358
+ lookupName: "CartStatus",
359
+ values: {},
360
+ isActive: true,
361
+ isSystem: true,
362
+ },
363
+ },
364
+ list: [],
365
+ },
366
+ },
367
+ });
368
+ const action = {
369
+ type: ADD_ORDER_LOOKUP_SUCCESS,
370
+ payload: {
301
371
  lookupName: "NewStatusReasons",
302
- values: {
303
- CanceledReason1: {
372
+ values: [
373
+ {
304
374
  id: "e16d07f847284775b77cfb985724cf58",
305
375
  value: "CanceledReason1",
306
376
  lookupId: "CanceledStatusReasons",
@@ -308,7 +378,7 @@ describe("metadata", () => {
308
378
  isActive: true,
309
379
  isSystem: true,
310
380
  },
311
- CanceledReason2: {
381
+ {
312
382
  id: "6bbfe77703c745d68b8eaceb9cd484b1",
313
383
  value: "CanceledReason2",
314
384
  lookupId: "CanceledStatusReasons",
@@ -316,37 +386,48 @@ describe("metadata", () => {
316
386
  isActive: true,
317
387
  isSystem: true,
318
388
  },
319
- },
320
- isActive: true,
321
- isSystem: true,
322
- },
323
- CartStatus: {
324
- lookupName: "CartStatus",
325
- values: {},
389
+ ],
326
390
  isActive: true,
327
391
  isSystem: true,
328
392
  },
329
393
  };
330
-
331
- const oldState = Immutable.fromJS({
332
- lookups: {
333
- order: {
334
- index: { CartStatus: lookups.CartStatus },
335
- list: [],
336
- },
337
- },
338
- });
339
- const action = {
340
- type: ADD_ORDER_LOOKUP_SUCCESS,
341
- payload: lookups.NewStatusReasons,
342
- };
343
394
  const newState = reducer(oldState, action);
344
395
  return expect(newState, "not to be", oldState).and(
345
396
  "to equal",
346
397
  Immutable.fromJS({
347
398
  lookups: {
348
399
  order: {
349
- index: lookups,
400
+ index: {
401
+ NewStatusReasons: {
402
+ lookupName: "NewStatusReasons",
403
+ values: {
404
+ CanceledReason1: {
405
+ id: "e16d07f847284775b77cfb985724cf58",
406
+ value: "CanceledReason1",
407
+ lookupId: "CanceledStatusReasons",
408
+ sortOrder: 0,
409
+ isActive: true,
410
+ isSystem: true,
411
+ },
412
+ CanceledReason2: {
413
+ id: "6bbfe77703c745d68b8eaceb9cd484b1",
414
+ value: "CanceledReason2",
415
+ lookupId: "CanceledStatusReasons",
416
+ sortOrder: 0,
417
+ isActive: true,
418
+ isSystem: true,
419
+ },
420
+ },
421
+ isActive: true,
422
+ isSystem: true,
423
+ },
424
+ CartStatus: {
425
+ lookupName: "CartStatus",
426
+ values: {},
427
+ isActive: true,
428
+ isSystem: true,
429
+ },
430
+ },
350
431
  list: ["CartStatus", "NewStatusReasons"],
351
432
  totalCount: 2,
352
433
  },
@@ -745,11 +826,27 @@ describe("metadata", () => {
745
826
  });
746
827
 
747
828
  it("get customer lookup success", () => {
748
- const lookups = {
749
- CanceledStatusReasons: {
829
+ const oldState = Immutable.fromJS({
830
+ lookups: {
831
+ customer: {
832
+ index: {
833
+ CartStatus: {
834
+ lookupName: "CartStatus",
835
+ values: {},
836
+ isActive: true,
837
+ isSystem: true,
838
+ },
839
+ },
840
+ list: [],
841
+ },
842
+ },
843
+ });
844
+ const action = {
845
+ type: GET_CUSTOMER_LOOKUP_SUCCESS,
846
+ payload: {
750
847
  lookupName: "CanceledStatusReasons",
751
- values: {
752
- CanceledReason1: {
848
+ values: [
849
+ {
753
850
  id: "e16d07f847284775b77cfb985724cf58",
754
851
  value: "CanceledReason1",
755
852
  lookupId: "CanceledStatusReasons",
@@ -757,7 +854,7 @@ describe("metadata", () => {
757
854
  isActive: true,
758
855
  isSystem: true,
759
856
  },
760
- CanceledReason2: {
857
+ {
761
858
  id: "6bbfe77703c745d68b8eaceb9cd484b1",
762
859
  value: "CanceledReason2",
763
860
  lookupId: "CanceledStatusReasons",
@@ -765,37 +862,48 @@ describe("metadata", () => {
765
862
  isActive: true,
766
863
  isSystem: true,
767
864
  },
768
- },
769
- isActive: true,
770
- isSystem: true,
771
- },
772
- CartStatus: {
773
- lookupName: "CartStatus",
774
- values: {},
865
+ ],
775
866
  isActive: true,
776
867
  isSystem: true,
777
868
  },
778
869
  };
779
-
780
- const oldState = Immutable.fromJS({
781
- lookups: {
782
- customer: {
783
- index: { CartStatus: lookups.CartStatus },
784
- list: [],
785
- },
786
- },
787
- });
788
- const action = {
789
- type: GET_CUSTOMER_LOOKUP_SUCCESS,
790
- payload: lookups.CanceledStatusReasons,
791
- };
792
870
  const newState = reducer(oldState, action);
793
871
  return expect(newState, "not to be", oldState).and(
794
872
  "to equal",
795
873
  Immutable.fromJS({
796
874
  lookups: {
797
875
  customer: {
798
- index: lookups,
876
+ index: {
877
+ CanceledStatusReasons: {
878
+ lookupName: "CanceledStatusReasons",
879
+ values: {
880
+ CanceledReason1: {
881
+ id: "e16d07f847284775b77cfb985724cf58",
882
+ value: "CanceledReason1",
883
+ lookupId: "CanceledStatusReasons",
884
+ sortOrder: 0,
885
+ isActive: true,
886
+ isSystem: true,
887
+ },
888
+ CanceledReason2: {
889
+ id: "6bbfe77703c745d68b8eaceb9cd484b1",
890
+ value: "CanceledReason2",
891
+ lookupId: "CanceledStatusReasons",
892
+ sortOrder: 0,
893
+ isActive: true,
894
+ isSystem: true,
895
+ },
896
+ },
897
+ isActive: true,
898
+ isSystem: true,
899
+ },
900
+ CartStatus: {
901
+ lookupName: "CartStatus",
902
+ values: {},
903
+ isActive: true,
904
+ isSystem: true,
905
+ },
906
+ },
799
907
  list: [],
800
908
  },
801
909
  },
@@ -804,11 +912,27 @@ describe("metadata", () => {
804
912
  });
805
913
 
806
914
  it("save customer metadata success", () => {
807
- const lookups = {
808
- CanceledStatusReasons: {
915
+ const oldState = Immutable.fromJS({
916
+ lookups: {
917
+ customer: {
918
+ index: {
919
+ CartStatus: {
920
+ lookupName: "CartStatus",
921
+ values: {},
922
+ isActive: true,
923
+ isSystem: true,
924
+ },
925
+ },
926
+ list: [],
927
+ },
928
+ },
929
+ });
930
+ const action = {
931
+ type: SAVE_CUSTOMER_LOOKUP_SUCCESS,
932
+ payload: {
809
933
  lookupName: "CanceledStatusReasons",
810
- values: {
811
- CanceledReason1: {
934
+ values: [
935
+ {
812
936
  id: "e16d07f847284775b77cfb985724cf58",
813
937
  value: "CanceledReason1",
814
938
  lookupId: "CanceledStatusReasons",
@@ -816,7 +940,7 @@ describe("metadata", () => {
816
940
  isActive: true,
817
941
  isSystem: true,
818
942
  },
819
- CanceledReason2: {
943
+ {
820
944
  id: "6bbfe77703c745d68b8eaceb9cd484b1",
821
945
  value: "CanceledReason2",
822
946
  lookupId: "CanceledStatusReasons",
@@ -824,29 +948,10 @@ describe("metadata", () => {
824
948
  isActive: true,
825
949
  isSystem: true,
826
950
  },
827
- },
951
+ ],
828
952
  isActive: true,
829
953
  isSystem: true,
830
954
  },
831
- CartStatus: {
832
- lookupName: "CartStatus",
833
- values: {},
834
- isActive: true,
835
- isSystem: true,
836
- },
837
- };
838
-
839
- const oldState = Immutable.fromJS({
840
- lookups: {
841
- customer: {
842
- index: { CartStatus: lookups.CartStatus },
843
- list: [],
844
- },
845
- },
846
- });
847
- const action = {
848
- type: SAVE_CUSTOMER_LOOKUP_SUCCESS,
849
- payload: lookups.CanceledStatusReasons,
850
955
  };
851
956
  const newState = reducer(oldState, action);
852
957
  return expect(newState, "not to be", oldState).and(
@@ -854,7 +959,37 @@ describe("metadata", () => {
854
959
  Immutable.fromJS({
855
960
  lookups: {
856
961
  customer: {
857
- index: lookups,
962
+ index: {
963
+ CanceledStatusReasons: {
964
+ lookupName: "CanceledStatusReasons",
965
+ values: {
966
+ CanceledReason1: {
967
+ id: "e16d07f847284775b77cfb985724cf58",
968
+ value: "CanceledReason1",
969
+ lookupId: "CanceledStatusReasons",
970
+ sortOrder: 0,
971
+ isActive: true,
972
+ isSystem: true,
973
+ },
974
+ CanceledReason2: {
975
+ id: "6bbfe77703c745d68b8eaceb9cd484b1",
976
+ value: "CanceledReason2",
977
+ lookupId: "CanceledStatusReasons",
978
+ sortOrder: 0,
979
+ isActive: true,
980
+ isSystem: true,
981
+ },
982
+ },
983
+ isActive: true,
984
+ isSystem: true,
985
+ },
986
+ CartStatus: {
987
+ lookupName: "CartStatus",
988
+ values: {},
989
+ isActive: true,
990
+ isSystem: true,
991
+ },
992
+ },
858
993
  list: [],
859
994
  },
860
995
  },
@@ -863,11 +998,27 @@ describe("metadata", () => {
863
998
  });
864
999
 
865
1000
  it("add customer metadata success", () => {
866
- const lookups = {
867
- NewStatusReasons: {
1001
+ const oldState = Immutable.fromJS({
1002
+ lookups: {
1003
+ customer: {
1004
+ index: {
1005
+ CartStatus: {
1006
+ lookupName: "CartStatus",
1007
+ values: {},
1008
+ isActive: true,
1009
+ isSystem: true,
1010
+ },
1011
+ },
1012
+ list: [],
1013
+ },
1014
+ },
1015
+ });
1016
+ const action = {
1017
+ type: ADD_CUSTOMER_LOOKUP_SUCCESS,
1018
+ payload: {
868
1019
  lookupName: "NewStatusReasons",
869
- values: {
870
- CanceledReason1: {
1020
+ values: [
1021
+ {
871
1022
  id: "e16d07f847284775b77cfb985724cf58",
872
1023
  value: "CanceledReason1",
873
1024
  lookupId: "CanceledStatusReasons",
@@ -875,7 +1026,7 @@ describe("metadata", () => {
875
1026
  isActive: true,
876
1027
  isSystem: true,
877
1028
  },
878
- CanceledReason2: {
1029
+ {
879
1030
  id: "6bbfe77703c745d68b8eaceb9cd484b1",
880
1031
  value: "CanceledReason2",
881
1032
  lookupId: "CanceledStatusReasons",
@@ -883,37 +1034,48 @@ describe("metadata", () => {
883
1034
  isActive: true,
884
1035
  isSystem: true,
885
1036
  },
886
- },
887
- isActive: true,
888
- isSystem: true,
889
- },
890
- CartStatus: {
891
- lookupName: "CartStatus",
892
- values: {},
1037
+ ],
893
1038
  isActive: true,
894
1039
  isSystem: true,
895
1040
  },
896
1041
  };
897
-
898
- const oldState = Immutable.fromJS({
899
- lookups: {
900
- customer: {
901
- index: { CartStatus: lookups.CartStatus },
902
- list: [],
903
- },
904
- },
905
- });
906
- const action = {
907
- type: ADD_CUSTOMER_LOOKUP_SUCCESS,
908
- payload: lookups.NewStatusReasons,
909
- };
910
1042
  const newState = reducer(oldState, action);
911
1043
  return expect(newState, "not to be", oldState).and(
912
1044
  "to equal",
913
1045
  Immutable.fromJS({
914
1046
  lookups: {
915
1047
  customer: {
916
- index: lookups,
1048
+ index: {
1049
+ NewStatusReasons: {
1050
+ lookupName: "NewStatusReasons",
1051
+ values: {
1052
+ CanceledReason1: {
1053
+ id: "e16d07f847284775b77cfb985724cf58",
1054
+ value: "CanceledReason1",
1055
+ lookupId: "CanceledStatusReasons",
1056
+ sortOrder: 0,
1057
+ isActive: true,
1058
+ isSystem: true,
1059
+ },
1060
+ CanceledReason2: {
1061
+ id: "6bbfe77703c745d68b8eaceb9cd484b1",
1062
+ value: "CanceledReason2",
1063
+ lookupId: "CanceledStatusReasons",
1064
+ sortOrder: 0,
1065
+ isActive: true,
1066
+ isSystem: true,
1067
+ },
1068
+ },
1069
+ isActive: true,
1070
+ isSystem: true,
1071
+ },
1072
+ CartStatus: {
1073
+ lookupName: "CartStatus",
1074
+ values: {},
1075
+ isActive: true,
1076
+ isSystem: true,
1077
+ },
1078
+ },
917
1079
  list: ["CartStatus", "NewStatusReasons"],
918
1080
  totalCount: 2,
919
1081
  },
@@ -1,3 +1,5 @@
1
+ import { applications } from "../constants";
2
+
1
3
  /* Constructs a URL search string from an object with key value pairs */
2
4
  const buildParamString = params =>
3
5
  Object.entries(params)
@@ -32,6 +34,19 @@ export const loadConfig = () =>
32
34
  `${host}/${pathParts.join("/")}` + (parameters ? "?" + buildParamString(parameters) : "");
33
35
  });
34
36
 
37
+ export const buildExternalAppUrl = (app, relativeUrl) => {
38
+ const url = relativeUrl[0] === "/" ? relativeUrl.substring(1) : relativeUrl;
39
+
40
+ let lowercaseApp = app.toLowerCase();
41
+ switch (lowercaseApp) {
42
+ case applications.oms:
43
+ case applications.pim:
44
+ return `/${lowercaseApp}/app/${url}`;
45
+ default:
46
+ throw new Error("Not implemented app '" + app + "'");
47
+ }
48
+ };
49
+
35
50
  /* Reset function for testing, never use this in actual code */
36
51
  export const resetConfig = () => {
37
52
  buildUrl = placeholder;