orc-shared 5.10.2 → 5.99.0-dev.10

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 (234) hide show
  1. package/dist/components/AppFrame/About.js +13 -13
  2. package/dist/components/AppFrame/Anchor.js +7 -7
  3. package/dist/components/AppFrame/AppFrame.js +3 -3
  4. package/dist/components/AppFrame/Help.js +4 -4
  5. package/dist/components/AppFrame/MenuItem.js +17 -26
  6. package/dist/components/AppFrame/Preferences.js +14 -14
  7. package/dist/components/AppFrame/Sidebar.js +6 -6
  8. package/dist/components/AppFrame/Topbar.js +6 -6
  9. package/dist/components/ApplicationModuleLoader.js +3 -2
  10. package/dist/components/Authenticate.js +29 -22
  11. package/dist/components/DropMenu/Menu.js +9 -9
  12. package/dist/components/ErrorPlaceholder.js +8 -24
  13. package/dist/components/Form/Field.js +4 -4
  14. package/dist/components/Form/Inputs/Button.js +2 -2
  15. package/dist/components/Form/Inputs/MultiSelector.js +137 -0
  16. package/dist/components/Form/Inputs/Selector.js +13 -10
  17. package/dist/components/Form/Inputs/index.js +1 -1
  18. package/dist/components/InternetExplorerWarningMessage.js +15 -15
  19. package/dist/components/LoadingIcon.js +38 -17
  20. package/dist/components/MaterialUI/DataDisplay/Modal.js +3 -3
  21. package/dist/components/MaterialUI/DataDisplay/PredefinedElements/Placeholder.js +6 -6
  22. package/dist/components/MaterialUI/DataDisplay/PredefinedElements/StepperModal.js +1 -1
  23. package/dist/components/MaterialUI/DataDisplay/PredefinedElements/TableInfoBar.js +1 -1
  24. package/dist/components/MaterialUI/DataDisplay/SelectionList.js +1 -1
  25. package/dist/components/MaterialUI/DataDisplay/Table.js +2 -1
  26. package/dist/components/MaterialUI/DataDisplay/TableProps.js +3 -1
  27. package/dist/components/MaterialUI/DataDisplay/TransferList.js +1 -1
  28. package/dist/components/MaterialUI/Inputs/CheckboxGroup.js +1 -1
  29. package/dist/components/MaterialUI/Inputs/DatePicker.js +1 -1
  30. package/dist/components/MaterialUI/Inputs/PredefinedElements/SearchControl.js +1 -1
  31. package/dist/components/MaterialUI/Inputs/Select.js +175 -109
  32. package/dist/components/MaterialUI/Inputs/SelectProps.js +11 -1
  33. package/dist/components/MaterialUI/Inputs/Switch.js +1 -1
  34. package/dist/components/MaterialUI/Navigation/DropDownMenu.js +2 -4
  35. package/dist/components/MaterialUI/ScopeSelector/ScopeSelector.js +1 -1
  36. package/dist/components/MaterialUI/ScopeSelector/TreeItem.js +27 -42
  37. package/dist/components/MaterialUI/Surfaces/Paper.js +1 -1
  38. package/dist/components/MaterialUI/Surfaces/SectionExpansionPanel.js +3 -2
  39. package/dist/components/MaterialUI/muiThemes.js +3 -1
  40. package/dist/components/Provision.js +30 -13
  41. package/dist/components/Routing/SegmentPage.js +117 -56
  42. package/dist/components/Scope/ScopeNode.js +62 -57
  43. package/dist/components/Sidepanel.js +59 -23
  44. package/dist/components/Spritesheet.js +35 -17
  45. package/dist/components/Text.js +1 -60
  46. package/dist/components/ToastList.js +95 -64
  47. package/dist/components/Treeview/Branch.js +82 -20
  48. package/dist/components/Treeview/Label.js +108 -31
  49. package/dist/components/Treeview/Leaf.js +56 -12
  50. package/dist/components/Treeview/Node.js +22 -9
  51. package/dist/components/Treeview/index.js +7 -1
  52. package/dist/components/Treeview/settings.js +17 -6
  53. package/dist/{components/Modal/index.js → hooks/useWindowSize.js} +38 -36
  54. package/dist/sharedMessages.js +8 -0
  55. package/dist/utils/index.js +0 -4
  56. package/dist/utils/testUtils.js +1 -12
  57. package/dist/{components/Modal/Background.js → utils/toastHelper.js} +11 -14
  58. package/package.json +2 -2
  59. package/src/components/AppFrame/About.js +13 -13
  60. package/src/components/AppFrame/Anchor.js +7 -7
  61. package/src/components/AppFrame/AppFrame.js +3 -3
  62. package/src/components/AppFrame/Help.js +4 -4
  63. package/src/components/AppFrame/MenuItem.js +15 -23
  64. package/src/components/AppFrame/Preferences.js +14 -14
  65. package/src/components/AppFrame/Sidebar.js +6 -6
  66. package/src/components/AppFrame/Topbar.js +6 -6
  67. package/src/components/ApplicationModuleLoader.js +2 -2
  68. package/src/components/ApplicationModuleLoader.test.js +15 -28
  69. package/src/components/Authenticate.js +21 -23
  70. package/src/components/Authenticate.test.js +19 -27
  71. package/src/components/DropMenu/Menu.js +9 -9
  72. package/src/components/ErrorPlaceholder.js +4 -21
  73. package/src/components/ErrorPlaceholder.test.js +7 -14
  74. package/src/components/Form/Field.js +4 -4
  75. package/src/components/Form/InputField.test.js +2 -1
  76. package/src/components/Form/Inputs/Button.js +2 -2
  77. package/src/components/Form/Inputs/MultiSelector.js +73 -0
  78. package/src/components/Form/Inputs/MultiSelector.test.js +332 -0
  79. package/src/components/Form/Inputs/Selector.js +12 -4
  80. package/src/components/Form/Inputs/Selector.test.js +27 -12
  81. package/src/components/Form/Inputs/index.js +1 -1
  82. package/src/components/InternetExplorerWarningMessage.js +15 -15
  83. package/src/components/Loader.test.js +50 -59
  84. package/src/components/LoadingIcon.js +27 -14
  85. package/src/components/LoadingIcon.test.js +11 -15
  86. package/src/components/MaterialUI/DataDisplay/Modal.js +3 -3
  87. package/src/components/MaterialUI/DataDisplay/PredefinedElements/Placeholder.js +6 -6
  88. package/src/components/MaterialUI/DataDisplay/PredefinedElements/StepperModal.js +1 -1
  89. package/src/components/MaterialUI/DataDisplay/PredefinedElements/TableInfoBar.js +1 -1
  90. package/src/components/MaterialUI/DataDisplay/SelectionList.js +1 -1
  91. package/src/components/MaterialUI/DataDisplay/Table.js +6 -1
  92. package/src/components/MaterialUI/DataDisplay/Table.test.js +21 -1
  93. package/src/components/MaterialUI/DataDisplay/TableProps.js +2 -0
  94. package/src/components/MaterialUI/DataDisplay/TableProps.test.js +20 -2
  95. package/src/components/MaterialUI/DataDisplay/TransferList.js +1 -1
  96. package/src/components/MaterialUI/Inputs/CheckboxGroup.js +1 -1
  97. package/src/components/MaterialUI/Inputs/DatePicker.js +1 -1
  98. package/src/components/MaterialUI/Inputs/PredefinedElements/SearchControl.js +1 -1
  99. package/src/components/MaterialUI/Inputs/PredefinedElements/SearchControl.test.js +1 -1
  100. package/src/components/MaterialUI/Inputs/Select.js +143 -83
  101. package/src/components/MaterialUI/Inputs/Select.test.js +199 -14
  102. package/src/components/MaterialUI/Inputs/SelectProps.js +10 -0
  103. package/src/components/MaterialUI/Inputs/SelectProps.test.js +10 -0
  104. package/src/components/MaterialUI/Inputs/Switch.js +1 -1
  105. package/src/components/MaterialUI/Navigation/DropDownMenu.js +2 -2
  106. package/src/components/MaterialUI/Navigation/DropDownMenu.test.js +5 -6
  107. package/src/components/MaterialUI/ScopeSelector/ScopeSelector.js +1 -2
  108. package/src/components/MaterialUI/ScopeSelector/TreeItem.js +8 -31
  109. package/src/components/MaterialUI/Surfaces/Paper.js +1 -1
  110. package/src/components/MaterialUI/Surfaces/SectionExpansionPanel.js +2 -1
  111. package/src/components/MaterialUI/muiThemes.js +4 -1
  112. package/src/components/Navigation/Navigation.test.js +0 -5
  113. package/src/components/Navigation/useNavigationState.test.js +79 -222
  114. package/src/components/Provision.js +36 -42
  115. package/src/components/Provision.test.js +10 -26
  116. package/src/components/Routing/SegmentPage.js +68 -52
  117. package/src/components/Routing/SegmentPage.test.js +4 -12
  118. package/src/components/Scope/ScopeNode.js +44 -55
  119. package/src/components/Scope/ScopeNode.test.js +84 -163
  120. package/src/components/ScopeExtendedConfigurationLoader.test.js +1 -4
  121. package/src/components/Sidepanel.js +38 -32
  122. package/src/components/Sidepanel.test.js +54 -27
  123. package/src/components/Spritesheet.js +23 -21
  124. package/src/components/Spritesheet.test.js +10 -10
  125. package/src/components/Text.js +0 -49
  126. package/src/components/ToastList.js +79 -90
  127. package/src/components/ToastList.test.js +29 -103
  128. package/src/components/Treeview/Branch.js +65 -47
  129. package/src/components/Treeview/Branch.test.js +2 -43
  130. package/src/components/Treeview/Label.js +68 -54
  131. package/src/components/Treeview/Label.test.js +55 -63
  132. package/src/components/Treeview/Leaf.js +41 -22
  133. package/src/components/Treeview/Leaf.test.js +1 -15
  134. package/src/components/Treeview/Node.js +16 -9
  135. package/src/components/Treeview/Node.test.js +269 -200
  136. package/src/components/Treeview/Treeview.test.js +248 -248
  137. package/src/components/Treeview/index.js +6 -0
  138. package/src/components/Treeview/settings.js +10 -6
  139. package/src/hooks/useMultipleFieldEditState.test.js +0 -1
  140. package/src/hooks/useWindowSize.js +39 -0
  141. package/src/hooks/useWindowSize.test.js +68 -0
  142. package/src/sharedMessages.js +8 -0
  143. package/src/translations/en-US.json +2 -0
  144. package/src/translations/fr-CA.json +2 -0
  145. package/src/utils/index.js +0 -4
  146. package/src/utils/testUtils.js +0 -10
  147. package/src/utils/testUtils.test.js +0 -68
  148. package/src/utils/toastHelper.js +8 -0
  149. package/src/utils/toastHelper.test.js +41 -0
  150. package/dist/components/Button.js +0 -70
  151. package/dist/components/CategoryList.js +0 -197
  152. package/dist/components/Checkbox.js +0 -103
  153. package/dist/components/Icon.js +0 -69
  154. package/dist/components/IconButton.js +0 -80
  155. package/dist/components/Input.js +0 -101
  156. package/dist/components/List/DataCell.js +0 -129
  157. package/dist/components/List/HeadCell.js +0 -125
  158. package/dist/components/List/HeadRow.js +0 -73
  159. package/dist/components/List/List.js +0 -274
  160. package/dist/components/List/Row.js +0 -109
  161. package/dist/components/List/enhanceColumnDefs.js +0 -111
  162. package/dist/components/List/index.js +0 -59
  163. package/dist/components/Modal/Dialog.js +0 -75
  164. package/dist/components/Modal/Wrapper.js +0 -69
  165. package/dist/components/MultiSelector.js +0 -187
  166. package/dist/components/Navigation/Bar.js +0 -293
  167. package/dist/components/Navigation/Tab.js +0 -182
  168. package/dist/components/Placeholder.js +0 -114
  169. package/dist/components/Scope/Selector.js +0 -123
  170. package/dist/components/Selector.js +0 -185
  171. package/dist/components/Switch.js +0 -128
  172. package/dist/components/Toolbar.js +0 -227
  173. package/dist/components/Tooltip.js +0 -66
  174. package/dist/getTheme.js +0 -158
  175. package/dist/getThemeOverrides.js +0 -93
  176. package/dist/hocs/withAuthentication.js +0 -72
  177. package/dist/utils/styledPropFuncs.js +0 -88
  178. package/src/components/Button.js +0 -90
  179. package/src/components/Button.test.js +0 -49
  180. package/src/components/CategoryList.js +0 -140
  181. package/src/components/CategoryList.test.js +0 -667
  182. package/src/components/Checkbox.js +0 -63
  183. package/src/components/Checkbox.test.js +0 -122
  184. package/src/components/Icon.js +0 -18
  185. package/src/components/IconButton.js +0 -30
  186. package/src/components/IconButton.test.js +0 -61
  187. package/src/components/Input.js +0 -35
  188. package/src/components/Input.test.js +0 -34
  189. package/src/components/List/DataCell.js +0 -77
  190. package/src/components/List/DataCell.test.js +0 -357
  191. package/src/components/List/HeadCell.js +0 -105
  192. package/src/components/List/HeadCell.test.js +0 -331
  193. package/src/components/List/HeadRow.js +0 -21
  194. package/src/components/List/HeadRow.test.js +0 -27
  195. package/src/components/List/List.js +0 -162
  196. package/src/components/List/List.test.js +0 -705
  197. package/src/components/List/Row.js +0 -72
  198. package/src/components/List/Row.test.js +0 -194
  199. package/src/components/List/enhanceColumnDefs.js +0 -54
  200. package/src/components/List/enhanceColumnDefs.test.js +0 -179
  201. package/src/components/List/index.js +0 -6
  202. package/src/components/Modal/Background.js +0 -10
  203. package/src/components/Modal/Dialog.js +0 -27
  204. package/src/components/Modal/Dialog.test.js +0 -20
  205. package/src/components/Modal/Modal.test.js +0 -52
  206. package/src/components/Modal/Wrapper.js +0 -32
  207. package/src/components/Modal/Wrapper.test.js +0 -55
  208. package/src/components/Modal/index.js +0 -22
  209. package/src/components/MultiSelector.js +0 -104
  210. package/src/components/MultiSelector.test.js +0 -348
  211. package/src/components/Navigation/Bar.js +0 -212
  212. package/src/components/Navigation/Bar.test.js +0 -552
  213. package/src/components/Navigation/Tab.js +0 -156
  214. package/src/components/Navigation/Tab.test.js +0 -404
  215. package/src/components/Placeholder.js +0 -61
  216. package/src/components/Placeholder.test.js +0 -106
  217. package/src/components/Scope/Selector.js +0 -70
  218. package/src/components/Scope/Selector.test.js +0 -138
  219. package/src/components/Selector.js +0 -191
  220. package/src/components/Selector.test.js +0 -157
  221. package/src/components/Switch.js +0 -112
  222. package/src/components/Switch.test.js +0 -130
  223. package/src/components/Text.test.js +0 -132
  224. package/src/components/Toolbar.js +0 -178
  225. package/src/components/Toolbar.test.js +0 -478
  226. package/src/components/Tooltip.js +0 -51
  227. package/src/components/Tooltip.test.js +0 -21
  228. package/src/getTheme.js +0 -103
  229. package/src/getTheme.test.js +0 -92
  230. package/src/getThemeOverrides.js +0 -27
  231. package/src/hocs/withAuthentication.js +0 -18
  232. package/src/hocs/withAuthentication.test.js +0 -120
  233. package/src/utils/styledPropFuncs.js +0 -20
  234. package/src/utils/styledPropFuncs.test.js +0 -166
@@ -1,5 +1,4 @@
1
1
  import React from "react";
2
- import { Provider } from "react-redux";
3
2
  import ReactDOM from "react-dom";
4
3
  import sinon from "sinon";
5
4
  import { mount } from "enzyme";
@@ -14,7 +13,7 @@ describe("DropDownMenu", () => {
14
13
  let store, menuItems, container;
15
14
  beforeEach(() => {
16
15
  menuItems = [
17
- { title: "asd", action: sinon.spy().named("action"), itemContext: "aContext" },
16
+ { title: { id: "asd", defaultMessage: "asd" }, action: sinon.spy().named("action"), itemContext: "aContext" },
18
17
  { title: "asd2", action: sinon.spy().named("action"), itemContext: "myContext" },
19
18
  ];
20
19
  store = {
@@ -73,9 +72,9 @@ describe("DropDownMenu", () => {
73
72
  const payload = "payload";
74
73
 
75
74
  ReactDOM.render(
76
- <Provider store={store}>
75
+ <TestWrapper provider={{ store }} intlProvider>
77
76
  <DropDownMenu payload={payload} menuItems={menuItems} />
78
- </Provider>,
77
+ </TestWrapper>,
79
78
  container,
80
79
  );
81
80
 
@@ -98,9 +97,9 @@ describe("DropDownMenu", () => {
98
97
  const payload = "payload";
99
98
 
100
99
  const component = (
101
- <Provider store={store}>
100
+ <TestWrapper provider={{ store }} intlProvider>
102
101
  <DropDownMenu payload={payload} menuItems={menuItems} />
103
- </Provider>
102
+ </TestWrapper>
104
103
  );
105
104
 
106
105
  const mountedComponent = mount(component);
@@ -15,7 +15,6 @@ const useStyles = makeStyles(theme => ({
15
15
  backgroundColor: theme.palette.grey.light,
16
16
  border: `1px solid ${theme.palette.grey.borders}`,
17
17
  boxShadow: "0 2px 4px rgba(0,0,0,0.5)",
18
- width: theme.spacing(50),
19
18
  display: "flex",
20
19
  },
21
20
  scopeContainer: {
@@ -65,7 +64,7 @@ const ScopeSelector = ({ show, getScope, selectedScope, closeSelector, filter, u
65
64
  );
66
65
 
67
66
  const scopeSelector = (
68
- <Sidepanel className={classes.container} in={show} timeout={300}>
67
+ <Sidepanel className={classes.container} widthSpacing={50} in={show} timeout={300}>
69
68
  <ClickAwayListener onClickAway={e => closeSelector(e)}>
70
69
  {/* this div is required since ClickAwayListener child element should be able to hold ref */}
71
70
  <div className={classes.scopeContainer}>{show ? scopeSelectorContent : null}</div>
@@ -11,19 +11,6 @@ import { scopeTypes } from "./../../../constants";
11
11
  const useStyles = makeStyles(theme => ({
12
12
  group: {
13
13
  marginLeft: props => (props.isRootScope ? theme.spacing(1.2) : theme.spacing(3.2)),
14
- // to hide unnecessary border part
15
- // "& > div > div > :last-child": {
16
- // "&:after": {
17
- // content: "''",
18
- // backgroundColor: theme.palette.grey.light,
19
- // position: "absolute",
20
- // top: theme.spacing(1.2),
21
- // left: theme.spacing(-2.1),
22
- // height: "100%",
23
- // bottom: 0,
24
- // width: "1px",
25
- // },
26
- // }
27
14
  },
28
15
  rootIconContainer: {
29
16
  marginRight: 0,
@@ -73,33 +60,23 @@ const useStyles = makeStyles(theme => ({
73
60
  },
74
61
  }));
75
62
 
76
- export const ScopeIcon = ({ type }) => {
63
+ export const ScopeIcon = ({ type, scopeIconClass }) => {
77
64
  const classes = useStyles();
78
65
  const theme = useTheme();
79
66
 
80
- const globalIcon = <Icon className={classes.scopeIcon} color="primary" fontSize="medium" id="global-scope" />;
81
- const virtualIcon = (
82
- <Icon className={classes.scopeIcon} themeColor={theme.palette.grey.dark} fontSize="medium" id="virtual-scope" />
83
- );
84
- const salesIcon = <Icon className={classes.scopeIcon} color="primary" fontSize="medium" id="sales-scope" />;
85
- const dependentIcon = (
86
- <Icon
87
- className={classes.scopeIcon}
88
- themeColor={theme.palette.success.main}
89
- fontSize="medium"
90
- id="dependent-scope"
91
- />
92
- );
67
+ const iconClass = classNames(classes.scopeIcon, scopeIconClass);
93
68
 
94
69
  switch (type) {
95
70
  case scopeTypes.global:
96
- return globalIcon;
71
+ return <Icon className={iconClass} color="primary" fontSize="medium" id="global-scope" />;
97
72
  case scopeTypes.virtual:
98
- return virtualIcon;
73
+ return <Icon className={iconClass} themeColor={theme.palette.grey.dark} fontSize="medium" id="virtual-scope" />;
99
74
  case scopeTypes.sale:
100
- return salesIcon;
75
+ return <Icon className={iconClass} color="primary" fontSize="medium" id="sales-scope" />;
101
76
  case scopeTypes.dependant:
102
- return dependentIcon;
77
+ return (
78
+ <Icon className={iconClass} themeColor={theme.palette.success.main} fontSize="medium" id="dependent-scope" />
79
+ );
103
80
  default:
104
81
  return null;
105
82
  }
@@ -13,7 +13,7 @@ const useStyle = makeStyles(theme => ({
13
13
  },
14
14
  "&::-webkit-scrollbar-thumb": {
15
15
  background: theme.palette.grey.borders,
16
- border: `5px transparent solid`,
16
+ border: `${theme.spacing(0.5)} transparent solid`,
17
17
  backgroundClip: "padding-box",
18
18
  borderRadius: theme.spacing(1.5),
19
19
  },
@@ -69,6 +69,7 @@ const SectionExpansionPanel = ({
69
69
  expansionPanelId,
70
70
  expansionPanelProps,
71
71
  expansionPanelActionsProps,
72
+ headerClassName,
72
73
  }) => {
73
74
  if (isExpansionPanelProps(expansionPanelProps) === false) {
74
75
  throw new TypeError("expansionPanelProps property is not of type ExpansionPanelProps");
@@ -122,7 +123,7 @@ const SectionExpansionPanel = ({
122
123
  expandIcon={<Icon id="dropdown-chevron-down" />}
123
124
  IconButtonProps={defaultSummaryStyles}
124
125
  classes={{
125
- root: classNames(classes.summaryRoot, constrained ? classes.constrainedSummaryRoot : ""),
126
+ root: classNames(classes.summaryRoot, headerClassName, constrained ? classes.constrainedSummaryRoot : ""),
126
127
  expanded: classNames(classes.panelExpanded),
127
128
  content: classNames(classes.summaryContent, constrained ? classes.constrainedSummaryContent : ""),
128
129
  expandIcon: classNames(classes.summaryExpandIconRoot),
@@ -1,3 +1,6 @@
1
+ import "@fontsource/open-sans/latin.css";
2
+ import "@fontsource/roboto-condensed/latin.css";
3
+
1
4
  import { createTheme } from "@material-ui/core/styles";
2
5
  import { alpha, darken } from "@material-ui/core/styles/colorManipulator";
3
6
 
@@ -32,7 +35,7 @@ const commonTheme = {
32
35
  fontWeightBlack: 900,
33
36
  button: {
34
37
  fontFamily: '"Roboto Condensed", sans-serif',
35
- fontWeight: 500,
38
+ fontWeight: 400,
36
39
  fontSize: 13,
37
40
  lineHeight: 1.0,
38
41
  letterSpacing: "0.0em",
@@ -5,11 +5,6 @@ import Navigation from "./index";
5
5
  import TabBar from "../MaterialUI/Navigation/TabBar";
6
6
  import { TestWrapper, createMuiTheme } from "./../../utils/testUtils";
7
7
 
8
- jest.mock("./Tab", () => ({
9
- __esModule: true,
10
- default: require("../../utils/testUtils").PropStruct,
11
- }));
12
-
13
8
  const TestComp = () => <div />;
14
9
  const TestComp1 = () => <div />;
15
10
  const TestComp2 = () => <div />;