orc-shared 5.10.2-dev.4 → 5.99.0-dev.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 (226) 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/{IconButton.js → Form/Inputs/MultiSelector.js} +33 -31
  16. package/dist/components/Form/Inputs/index.js +1 -1
  17. package/dist/components/InternetExplorerWarningMessage.js +15 -15
  18. package/dist/components/LoadingIcon.js +38 -17
  19. package/dist/components/MaterialUI/DataDisplay/Modal.js +3 -3
  20. package/dist/components/MaterialUI/DataDisplay/PredefinedElements/Placeholder.js +6 -6
  21. package/dist/components/MaterialUI/DataDisplay/PredefinedElements/StepperModal.js +4 -4
  22. package/dist/components/MaterialUI/DataDisplay/SelectionList.js +1 -1
  23. package/dist/components/MaterialUI/DataDisplay/Table.js +2 -1
  24. package/dist/components/MaterialUI/DataDisplay/TableProps.js +3 -1
  25. package/dist/components/MaterialUI/DataDisplay/TransferList.js +1 -1
  26. package/dist/components/MaterialUI/Inputs/CheckboxGroup.js +1 -1
  27. package/dist/components/MaterialUI/Inputs/DatePicker.js +1 -1
  28. package/dist/components/MaterialUI/Inputs/InputBase.js +20 -188
  29. package/dist/components/MaterialUI/Inputs/PredefinedElements/SearchControl.js +1 -1
  30. package/dist/components/MaterialUI/Inputs/Select.js +10 -0
  31. package/dist/components/MaterialUI/Inputs/SelectProps.js +3 -1
  32. package/dist/components/MaterialUI/Inputs/Switch.js +1 -1
  33. package/dist/components/MaterialUI/Navigation/DropDownMenu.js +2 -4
  34. package/dist/components/MaterialUI/ScopeSelector/ScopeSelector.js +1 -1
  35. package/dist/components/MaterialUI/ScopeSelector/TreeItem.js +27 -42
  36. package/dist/components/MaterialUI/Surfaces/Paper.js +1 -1
  37. package/dist/components/MaterialUI/Surfaces/SectionExpansionPanel.js +3 -2
  38. package/dist/components/MaterialUI/muiThemes.js +2 -0
  39. package/dist/components/Provision.js +30 -13
  40. package/dist/components/Routing/SegmentPage.js +115 -56
  41. package/dist/components/Scope/ScopeNode.js +62 -57
  42. package/dist/components/Sidepanel.js +59 -23
  43. package/dist/components/Spritesheet.js +35 -17
  44. package/dist/components/Text.js +1 -60
  45. package/dist/components/ToastList.js +95 -64
  46. package/dist/components/Treeview/Branch.js +82 -20
  47. package/dist/components/Treeview/Label.js +108 -31
  48. package/dist/components/Treeview/Leaf.js +56 -12
  49. package/dist/components/Treeview/Node.js +22 -9
  50. package/dist/components/Treeview/index.js +7 -1
  51. package/dist/components/Treeview/settings.js +17 -6
  52. package/dist/utils/index.js +0 -4
  53. package/dist/utils/testUtils.js +1 -12
  54. package/dist/{components/Modal/Background.js → utils/toastHelper.js} +11 -14
  55. package/package.json +2 -2
  56. package/src/components/AppFrame/About.js +13 -13
  57. package/src/components/AppFrame/Anchor.js +7 -7
  58. package/src/components/AppFrame/AppFrame.js +3 -3
  59. package/src/components/AppFrame/Help.js +4 -4
  60. package/src/components/AppFrame/MenuItem.js +15 -23
  61. package/src/components/AppFrame/Preferences.js +14 -14
  62. package/src/components/AppFrame/Sidebar.js +6 -6
  63. package/src/components/AppFrame/Topbar.js +6 -6
  64. package/src/components/ApplicationModuleLoader.js +2 -2
  65. package/src/components/ApplicationModuleLoader.test.js +15 -28
  66. package/src/components/Authenticate.js +21 -23
  67. package/src/components/Authenticate.test.js +19 -27
  68. package/src/components/DropMenu/Menu.js +9 -9
  69. package/src/components/ErrorPlaceholder.js +4 -21
  70. package/src/components/ErrorPlaceholder.test.js +7 -14
  71. package/src/components/Form/Field.js +4 -4
  72. package/src/components/Form/InputField.test.js +2 -1
  73. package/src/components/Form/Inputs/Button.js +2 -2
  74. package/src/components/Form/Inputs/MultiSelector.js +23 -0
  75. package/src/components/Form/Inputs/MultiSelector.test.js +112 -0
  76. package/src/components/Form/Inputs/index.js +1 -1
  77. package/src/components/InternetExplorerWarningMessage.js +15 -15
  78. package/src/components/Loader.test.js +50 -59
  79. package/src/components/LoadingIcon.js +27 -14
  80. package/src/components/LoadingIcon.test.js +11 -15
  81. package/src/components/MaterialUI/DataDisplay/Modal.js +3 -3
  82. package/src/components/MaterialUI/DataDisplay/PredefinedElements/Placeholder.js +6 -6
  83. package/src/components/MaterialUI/DataDisplay/PredefinedElements/StepperModal.js +3 -3
  84. package/src/components/MaterialUI/DataDisplay/PredefinedElements/StepperModal.test.js +0 -74
  85. package/src/components/MaterialUI/DataDisplay/PredefinedElements/Translations.test.js +6 -18
  86. package/src/components/MaterialUI/DataDisplay/SelectionList.js +1 -1
  87. package/src/components/MaterialUI/DataDisplay/Table.js +6 -1
  88. package/src/components/MaterialUI/DataDisplay/Table.test.js +21 -1
  89. package/src/components/MaterialUI/DataDisplay/TableProps.js +2 -0
  90. package/src/components/MaterialUI/DataDisplay/TableProps.test.js +20 -2
  91. package/src/components/MaterialUI/DataDisplay/TransferList.js +1 -1
  92. package/src/components/MaterialUI/Inputs/CheckboxGroup.js +1 -1
  93. package/src/components/MaterialUI/Inputs/DatePicker.js +1 -1
  94. package/src/components/MaterialUI/Inputs/InputBase.js +31 -214
  95. package/src/components/MaterialUI/Inputs/InputBase.test.js +1 -460
  96. package/src/components/MaterialUI/Inputs/PredefinedElements/SearchControl.js +1 -1
  97. package/src/components/MaterialUI/Inputs/PredefinedElements/SearchControl.test.js +1 -1
  98. package/src/components/MaterialUI/Inputs/Select.js +7 -0
  99. package/src/components/MaterialUI/Inputs/Select.test.js +45 -0
  100. package/src/components/MaterialUI/Inputs/SelectProps.js +2 -0
  101. package/src/components/MaterialUI/Inputs/SelectProps.test.js +2 -0
  102. package/src/components/MaterialUI/Inputs/Switch.js +1 -1
  103. package/src/components/MaterialUI/Navigation/DropDownMenu.js +2 -2
  104. package/src/components/MaterialUI/Navigation/DropDownMenu.test.js +5 -6
  105. package/src/components/MaterialUI/ScopeSelector/ScopeSelector.js +1 -2
  106. package/src/components/MaterialUI/ScopeSelector/TreeItem.js +8 -31
  107. package/src/components/MaterialUI/Surfaces/Paper.js +1 -1
  108. package/src/components/MaterialUI/Surfaces/SectionExpansionPanel.js +2 -1
  109. package/src/components/MaterialUI/muiThemes.js +3 -0
  110. package/src/components/Navigation/Navigation.test.js +0 -5
  111. package/src/components/Navigation/useNavigationState.test.js +79 -222
  112. package/src/components/Provision.js +36 -42
  113. package/src/components/Provision.test.js +10 -26
  114. package/src/components/Routing/SegmentPage.js +68 -52
  115. package/src/components/Routing/SegmentPage.test.js +4 -12
  116. package/src/components/Scope/ScopeNode.js +44 -55
  117. package/src/components/Scope/ScopeNode.test.js +84 -163
  118. package/src/components/ScopeExtendedConfigurationLoader.test.js +1 -4
  119. package/src/components/Sidepanel.js +38 -32
  120. package/src/components/Sidepanel.test.js +54 -27
  121. package/src/components/Spritesheet.js +23 -21
  122. package/src/components/Spritesheet.test.js +10 -10
  123. package/src/components/Text.js +0 -49
  124. package/src/components/ToastList.js +79 -90
  125. package/src/components/ToastList.test.js +29 -103
  126. package/src/components/Treeview/Branch.js +65 -47
  127. package/src/components/Treeview/Branch.test.js +2 -43
  128. package/src/components/Treeview/Label.js +68 -54
  129. package/src/components/Treeview/Label.test.js +55 -63
  130. package/src/components/Treeview/Leaf.js +41 -22
  131. package/src/components/Treeview/Leaf.test.js +1 -15
  132. package/src/components/Treeview/Node.js +16 -9
  133. package/src/components/Treeview/Node.test.js +269 -200
  134. package/src/components/Treeview/Treeview.test.js +248 -248
  135. package/src/components/Treeview/index.js +6 -0
  136. package/src/components/Treeview/settings.js +10 -6
  137. package/src/utils/index.js +0 -4
  138. package/src/utils/testUtils.js +0 -10
  139. package/src/utils/testUtils.test.js +0 -68
  140. package/src/utils/toastHelper.js +8 -0
  141. package/src/utils/toastHelper.test.js +41 -0
  142. package/dist/components/Button.js +0 -70
  143. package/dist/components/CategoryList.js +0 -197
  144. package/dist/components/Checkbox.js +0 -103
  145. package/dist/components/Icon.js +0 -69
  146. package/dist/components/Input.js +0 -101
  147. package/dist/components/List/DataCell.js +0 -129
  148. package/dist/components/List/HeadCell.js +0 -125
  149. package/dist/components/List/HeadRow.js +0 -73
  150. package/dist/components/List/List.js +0 -274
  151. package/dist/components/List/Row.js +0 -109
  152. package/dist/components/List/enhanceColumnDefs.js +0 -111
  153. package/dist/components/List/index.js +0 -59
  154. package/dist/components/Modal/Dialog.js +0 -75
  155. package/dist/components/Modal/Wrapper.js +0 -69
  156. package/dist/components/Modal/index.js +0 -86
  157. package/dist/components/MultiSelector.js +0 -187
  158. package/dist/components/Navigation/Bar.js +0 -293
  159. package/dist/components/Navigation/Tab.js +0 -182
  160. package/dist/components/Placeholder.js +0 -114
  161. package/dist/components/Scope/Selector.js +0 -123
  162. package/dist/components/Selector.js +0 -185
  163. package/dist/components/Switch.js +0 -128
  164. package/dist/components/Toolbar.js +0 -227
  165. package/dist/components/Tooltip.js +0 -66
  166. package/dist/getTheme.js +0 -158
  167. package/dist/getThemeOverrides.js +0 -93
  168. package/dist/hocs/withAuthentication.js +0 -72
  169. package/dist/utils/styledPropFuncs.js +0 -88
  170. package/src/components/Button.js +0 -90
  171. package/src/components/Button.test.js +0 -49
  172. package/src/components/CategoryList.js +0 -140
  173. package/src/components/CategoryList.test.js +0 -667
  174. package/src/components/Checkbox.js +0 -63
  175. package/src/components/Checkbox.test.js +0 -122
  176. package/src/components/Icon.js +0 -18
  177. package/src/components/IconButton.js +0 -30
  178. package/src/components/IconButton.test.js +0 -61
  179. package/src/components/Input.js +0 -35
  180. package/src/components/Input.test.js +0 -34
  181. package/src/components/List/DataCell.js +0 -77
  182. package/src/components/List/DataCell.test.js +0 -357
  183. package/src/components/List/HeadCell.js +0 -105
  184. package/src/components/List/HeadCell.test.js +0 -331
  185. package/src/components/List/HeadRow.js +0 -21
  186. package/src/components/List/HeadRow.test.js +0 -27
  187. package/src/components/List/List.js +0 -162
  188. package/src/components/List/List.test.js +0 -705
  189. package/src/components/List/Row.js +0 -72
  190. package/src/components/List/Row.test.js +0 -194
  191. package/src/components/List/enhanceColumnDefs.js +0 -54
  192. package/src/components/List/enhanceColumnDefs.test.js +0 -179
  193. package/src/components/List/index.js +0 -6
  194. package/src/components/Modal/Background.js +0 -10
  195. package/src/components/Modal/Dialog.js +0 -27
  196. package/src/components/Modal/Dialog.test.js +0 -20
  197. package/src/components/Modal/Modal.test.js +0 -52
  198. package/src/components/Modal/Wrapper.js +0 -32
  199. package/src/components/Modal/Wrapper.test.js +0 -55
  200. package/src/components/Modal/index.js +0 -22
  201. package/src/components/MultiSelector.js +0 -104
  202. package/src/components/MultiSelector.test.js +0 -348
  203. package/src/components/Navigation/Bar.js +0 -212
  204. package/src/components/Navigation/Bar.test.js +0 -552
  205. package/src/components/Navigation/Tab.js +0 -156
  206. package/src/components/Navigation/Tab.test.js +0 -404
  207. package/src/components/Placeholder.js +0 -61
  208. package/src/components/Placeholder.test.js +0 -106
  209. package/src/components/Scope/Selector.js +0 -70
  210. package/src/components/Scope/Selector.test.js +0 -138
  211. package/src/components/Selector.js +0 -191
  212. package/src/components/Selector.test.js +0 -157
  213. package/src/components/Switch.js +0 -112
  214. package/src/components/Switch.test.js +0 -130
  215. package/src/components/Text.test.js +0 -132
  216. package/src/components/Toolbar.js +0 -178
  217. package/src/components/Toolbar.test.js +0 -478
  218. package/src/components/Tooltip.js +0 -51
  219. package/src/components/Tooltip.test.js +0 -21
  220. package/src/getTheme.js +0 -103
  221. package/src/getTheme.test.js +0 -92
  222. package/src/getThemeOverrides.js +0 -27
  223. package/src/hocs/withAuthentication.js +0 -18
  224. package/src/hocs/withAuthentication.test.js +0 -120
  225. package/src/utils/styledPropFuncs.js +0 -20
  226. package/src/utils/styledPropFuncs.test.js +0 -166
@@ -35,15 +35,15 @@ const useStyles = makeStyles(theme => ({
35
35
  viewPort: props => ({
36
36
  overflow: "hidden",
37
37
  backgroundColor: "white",
38
- borderTopLeftRadius: "10px",
39
- height: "calc(100% - 40px)",
38
+ borderTopLeftRadius: theme.spacing(1),
39
+ height: `calc(100% - ${theme.spacing(4)})`,
40
40
  position: "absolute",
41
41
  bottom: 0,
42
42
  right: 0,
43
43
  display: "flex",
44
44
  flexDirection: "column",
45
45
  transition: "width 0.3s ease-out",
46
- width: props.toggleOpen ? "calc(100% - 200px)" : "calc(100% - 50px)",
46
+ width: props.toggleOpen ? `calc(100% - ${theme.spacing(20)})` : `calc(100% - ${theme.spacing(5)})`,
47
47
  }),
48
48
  }));
49
49
 
@@ -6,13 +6,13 @@ import sharedMessages from "./../../sharedMessages";
6
6
  const useStyles = makeStyles(theme => ({
7
7
  helpLink: {
8
8
  fontFamily: theme.typography.button.fontFamily,
9
- fontSize: "12px",
9
+ fontSize: theme.spacing(1.2),
10
10
  textTransform: "uppercase",
11
11
  color: theme.palette.grey.borders,
12
- width: "40px",
12
+ width: theme.spacing(4),
13
13
  cursor: "pointer",
14
- paddingTop: "14px",
15
- paddingRight: "10px",
14
+ paddingTop: theme.spacing(1.4),
15
+ paddingRight: theme.spacing(1),
16
16
  textDecoration: "none",
17
17
  "&:hover": {
18
18
  color: theme.palette.primary.light,
@@ -3,22 +3,14 @@ import { makeStyles } from "@material-ui/core/styles";
3
3
  import { Link } from "react-router-dom";
4
4
  import { FormattedMessage } from "react-intl";
5
5
  import Icon from "../MaterialUI/DataDisplay/Icon";
6
-
7
- const getToastColor = (theme, alertType) => {
8
- const toastBorderColors = {
9
- error: theme.palette.error.main,
10
- warn: theme.palette.warning.main,
11
- confirm: theme.palette.success.main,
12
- };
13
- return toastBorderColors[alertType] || "red";
14
- };
6
+ import { getToastColor } from "../../utils/toastHelper";
15
7
 
16
8
  const useStyles = makeStyles(theme => ({
17
9
  block: props => ({
18
10
  display: "block",
19
11
  position: "relative",
20
- padding: "0 10px",
21
- marginBottom: "35px",
12
+ padding: theme.spacing(0, 1),
13
+ marginBottom: theme.spacing(3.5),
22
14
  textDecoration: "none",
23
15
  cursor: "pointer",
24
16
  color: props.active ? theme.palette.primary.light : theme.palette.text.hint,
@@ -32,10 +24,10 @@ const useStyles = makeStyles(theme => ({
32
24
 
33
25
  return {
34
26
  borderRadius: "50%",
35
- border: `4px solid ${toastColor}`,
27
+ border: `${theme.spacing(0.4)} solid ${toastColor}`,
36
28
  position: "absolute",
37
29
  top: 0,
38
- left: "27px",
30
+ left: theme.spacing(2.7),
39
31
  visibility: "hidden",
40
32
 
41
33
  "&.show": {
@@ -49,15 +41,15 @@ const useStyles = makeStyles(theme => ({
49
41
  return {
50
42
  position: "absolute",
51
43
  zIndex: 10000,
52
- top: "calc(-10px - 0.7em)",
53
- left: "22px",
44
+ top: `calc(${theme.spacing(-1)} - 0.7em)`,
45
+ left: theme.spacing(2.2),
54
46
  width: "max-content",
55
- borderRadius: "5px",
56
- padding: "10px 15px",
57
- boxShadow: "0 2px 4px 0 rgba(0, 0, 0, 0.5)",
47
+ borderRadius: theme.spacing(0.5),
48
+ padding: theme.spacing(1, 1.5),
49
+ boxShadow: `${theme.spacing(0, 0.2, 0.4, 0)} rgba(0, 0, 0, 0.5)`,
58
50
  color: theme.palette.grey.light,
59
51
  backgroundColor: toastColor,
60
- fontSize: "11px",
52
+ fontSize: theme.spacing(1.1),
61
53
  fontWeight: "bold",
62
54
  lineHeight: 1.2,
63
55
  transition: `transform 200ms cubic-bezier(0.68, -0.55, 0.27, 1.55), opacity 100ms 50ms ease-out`,
@@ -67,7 +59,7 @@ const useStyles = makeStyles(theme => ({
67
59
  "&::before": {
68
60
  content: "",
69
61
  position: "absolute",
70
- top: "calc(10px + 0.2em)",
62
+ top: `calc(${theme.spacing(1)} + 0.2em)`,
71
63
  left: "-0.9em",
72
64
  border: "solid transparent",
73
65
  borderWidth: "0.4em 0.9em 0.4em 0",
@@ -81,16 +73,16 @@ const useStyles = makeStyles(theme => ({
81
73
  };
82
74
  },
83
75
  menuIcon: props => ({
84
- fontSize: "24px",
76
+ fontSize: theme.spacing(2.4),
85
77
  verticalAlign: "middle",
86
78
  color: props.active ? theme.palette.primary.light : theme.palette.text.hint,
87
79
  }),
88
80
  label: props => ({
89
81
  fontFamily: theme.typography.button.fontFamily,
90
- fontSize: "13px",
82
+ fontSize: theme.spacing(1.3),
91
83
  verticalAlign: "middle",
92
84
  textTransform: "uppercase",
93
- paddingLeft: "10px",
85
+ paddingLeft: theme.spacing(1),
94
86
  transition: "opacity 0.3s ease-out",
95
87
  opacity: props.showLabel ? 1 : 0,
96
88
  }),
@@ -27,19 +27,19 @@ const useStyles = makeStyles(theme => ({
27
27
  backgroundColor: "#f7f7f7",
28
28
  borderLeft: `1px solid ${theme.palette.grey.borders}`,
29
29
  borderTop: `1px solid ${theme.palette.grey.borders}`,
30
- borderTopLeftRadius: "5px",
31
- top: "40px",
32
- boxShadow: "-3px 2px 5px 0px rgba(0, 0, 0, 0.2)",
30
+ borderTopLeftRadius: theme.spacing(0.5),
31
+ top: theme.spacing(4),
32
+ boxShadow: `${theme.spacing(-0.3, 0.2, 0.5, 0)} rgba(0, 0, 0, 0.2)`,
33
33
  zIndex: 9998,
34
34
  transition: "right 400ms ease-out",
35
35
  },
36
36
  header: {
37
37
  flex: "0 0 auto",
38
38
  borderBottom: `1px solid ${theme.palette.grey.borders}`,
39
- borderTopLeftRadius: "5px",
40
- padding: "15px 30px",
41
- height: "18px",
42
- fontSize: "15px",
39
+ borderTopLeftRadius: theme.spacing(0.5),
40
+ padding: theme.spacing(1.5, 3),
41
+ height: theme.spacing(1.8),
42
+ fontSize: theme.spacing(1.5),
43
43
  fontFamily: theme.typography.button.fontFamily,
44
44
  textTransform: "uppercase",
45
45
  color: theme.palette.primary.main,
@@ -49,8 +49,8 @@ const useStyles = makeStyles(theme => ({
49
49
  flex: "1 1 auto",
50
50
  display: "flex",
51
51
  flexDirection: "column",
52
- padding: "20px 30px",
53
- fontSize: "12px",
52
+ padding: theme.spacing(2, 3),
53
+ fontSize: theme.spacing(1.2),
54
54
  },
55
55
  footer: {
56
56
  flex: "0 0 auto",
@@ -59,12 +59,12 @@ const useStyles = makeStyles(theme => ({
59
59
  justifyContent: "flex-end",
60
60
  backgroundColor: "#ffffff",
61
61
  borderTop: `1px solid ${theme.palette.grey.borders}`,
62
- paddingRight: "10px",
63
- height: "60px",
62
+ paddingRight: theme.spacing(1),
63
+ height: theme.spacing(6),
64
64
  },
65
65
  prefButton: {
66
- marginRight: "20px",
67
- minWidth: "110px",
66
+ marginRight: theme.spacing(2),
67
+ minWidth: theme.spacing(11),
68
68
  },
69
69
  wrapper: {
70
70
  display: "flex",
@@ -139,7 +139,7 @@ export const Preferences = () => {
139
139
  const { show, save, clear, languageOptions, languageSelectProps, applicationOptions, applicationSelectProps } =
140
140
  usePreferenceSetup();
141
141
  return (
142
- <Sidepanel in={show} width="380px" timeout={400} className={classes.prefPanel}>
142
+ <Sidepanel in={show} widthSpacing={38} timeout={400} className={classes.prefPanel}>
143
143
  <Wrapper onClickOutside={clickOutsideHandler}>
144
144
  <div className={classes.header}>
145
145
  <FormattedMessage {...sharedMessages.preferences} />
@@ -9,9 +9,9 @@ import { getScopeModuleInformationSelector } from "../../selectors/modules";
9
9
  const useStyles = makeStyles(theme => ({
10
10
  bar: {
11
11
  boxSizing: "border-box",
12
- paddingTop: "60px",
13
- height: "calc(100% - 40px)",
14
- width: "200px",
12
+ paddingTop: theme.spacing(6),
13
+ height: `calc(100% - ${theme.spacing(4)})`,
14
+ width: theme.spacing(20),
15
15
  display: "flex",
16
16
  flexDirection: "column",
17
17
  justifyContent: "flex-start",
@@ -19,9 +19,9 @@ const useStyles = makeStyles(theme => ({
19
19
  },
20
20
  logoSvg: {
21
21
  flex: "0 0 auto",
22
- margin: "auto 12.5px 7px",
23
- height: "25px",
24
- width: "25px",
22
+ margin: `auto ${theme.spacing(1.25, 0.7)}`,
23
+ height: theme.spacing(2.5),
24
+ width: theme.spacing(2.5),
25
25
  fillRule: "evenodd",
26
26
  clipRule: "evenodd",
27
27
  fill: "#666666",
@@ -17,7 +17,7 @@ import { areEqualCaseInsensitive } from "../../utils/comparisonHelper";
17
17
 
18
18
  const useStyles = makeStyles(theme => ({
19
19
  wrapper: {
20
- height: "40px",
20
+ height: theme.spacing(4),
21
21
  color: theme.palette.text.hint,
22
22
  display: "flex",
23
23
  justifyContent: "space-between",
@@ -32,16 +32,16 @@ const useStyles = makeStyles(theme => ({
32
32
  backgroundColor: "#000000",
33
33
  color: theme.palette.primary.light,
34
34
  fontFamily: theme.typography.button.fontFamily,
35
- fontSize: "14px",
35
+ fontSize: theme.spacing(1.4),
36
36
  textTransform: "uppercase",
37
- paddingRight: "20px",
38
- paddingLeft: "6px",
37
+ paddingRight: theme.spacing(2),
38
+ paddingLeft: theme.spacing(0.6),
39
39
  display: "flex",
40
40
  alignItems: "center",
41
41
  },
42
42
  appLogo: {
43
- height: "30px",
44
- marginRight: "10px",
43
+ height: theme.spacing(3),
44
+ marginRight: theme.spacing(1),
45
45
  },
46
46
  qaContainerColor: {
47
47
  backgroundColor: "#9F0F18",
@@ -6,9 +6,9 @@ import {
6
6
  getApplicationModulesSelector,
7
7
  getLoadedModulesScopeSelector,
8
8
  } from "../selectors/settings";
9
- import { Loader } from "./Authenticate";
10
9
  import { overtureModule, scopeTypes } from "../constants";
11
10
  import { initializeFirstModuleScope } from "../actions/modules";
11
+ import LoadingIcon from "./LoadingIcon";
12
12
 
13
13
  const ApplicationModuleLoader = ({ children }) => {
14
14
  const dispatch = useDispatch();
@@ -43,7 +43,7 @@ const ApplicationModuleLoader = ({ children }) => {
43
43
  const applicationModuleReady = scopeLoadedFromAllModules && defaultScope != null;
44
44
 
45
45
  if (!applicationModuleReady) {
46
- return <Loader />;
46
+ return <LoadingIcon />;
47
47
  }
48
48
 
49
49
  return React.Children.only(children);
@@ -1,14 +1,13 @@
1
1
  import React from "react";
2
2
  import Immutable from "immutable";
3
3
  import { Provider } from "react-redux";
4
- import { ThemeProvider } from "styled-components";
5
- import { Loader } from "./Authenticate";
6
4
  import ApplicationModuleLoader from "./ApplicationModuleLoader";
7
5
  import { mount } from "enzyme";
8
6
  import { getDefaultScope, getScopes } from "../actions/scopes";
9
7
  import sinon from "sinon";
10
8
  import { initializeFirstModuleScope } from "../actions/modules";
11
9
  import { scopeTypes } from "../constants";
10
+ import LoadingIcon from "./LoadingIcon";
12
11
 
13
12
  const TestComp = () => {
14
13
  return <div className="test" />;
@@ -66,17 +65,13 @@ describe("ApplicationModuleLoader", () => {
66
65
  state = state.setIn(["settings", "defaultScope"], null);
67
66
  return expect(
68
67
  <Provider store={store(state)}>
69
- <ThemeProvider theme={{}}>
70
- <ApplicationModuleLoader>
71
- <TestComp />
72
- </ApplicationModuleLoader>
73
- </ThemeProvider>
68
+ <ApplicationModuleLoader>
69
+ <TestComp />
70
+ </ApplicationModuleLoader>
74
71
  </Provider>,
75
72
  "when mounted",
76
73
  "to exhaustively satisfy",
77
- <ThemeProvider theme={{}}>
78
- <Loader />
79
- </ThemeProvider>,
74
+ <LoadingIcon />,
80
75
  );
81
76
  });
82
77
 
@@ -84,17 +79,13 @@ describe("ApplicationModuleLoader", () => {
84
79
  state = state.setIn(["settings", "loadedModulesScope"], Immutable.fromJS(["moduleA"]));
85
80
  return expect(
86
81
  <Provider store={store(state)}>
87
- <ThemeProvider theme={{}}>
88
- <ApplicationModuleLoader>
89
- <TestComp />
90
- </ApplicationModuleLoader>
91
- </ThemeProvider>
82
+ <ApplicationModuleLoader>
83
+ <TestComp />
84
+ </ApplicationModuleLoader>
92
85
  </Provider>,
93
86
  "when mounted",
94
87
  "to exhaustively satisfy",
95
- <ThemeProvider theme={{}}>
96
- <Loader />
97
- </ThemeProvider>,
88
+ <LoadingIcon />,
98
89
  );
99
90
  });
100
91
 
@@ -103,11 +94,9 @@ describe("ApplicationModuleLoader", () => {
103
94
 
104
95
  const component = (
105
96
  <Provider store={theStore}>
106
- <ThemeProvider theme={{}}>
107
- <ApplicationModuleLoader>
108
- <TestComp />
109
- </ApplicationModuleLoader>
110
- </ThemeProvider>
97
+ <ApplicationModuleLoader>
98
+ <TestComp />
99
+ </ApplicationModuleLoader>
111
100
  </Provider>
112
101
  );
113
102
 
@@ -128,11 +117,9 @@ describe("ApplicationModuleLoader", () => {
128
117
 
129
118
  const component = (
130
119
  <Provider store={theStore}>
131
- <ThemeProvider theme={{}}>
132
- <ApplicationModuleLoader>
133
- <TestComp />
134
- </ApplicationModuleLoader>
135
- </ThemeProvider>
120
+ <ApplicationModuleLoader>
121
+ <TestComp />
122
+ </ApplicationModuleLoader>
136
123
  </Provider>
137
124
  );
138
125
 
@@ -1,12 +1,23 @@
1
1
  import React from "react";
2
- import styled, { withTheme } from "styled-components";
3
- import { getThemeProp, safeGet } from "../utils";
4
- import Placeholder from "../components/Placeholder";
2
+ import { makeStyles } from "@material-ui/core/styles";
3
+ import { safeGet } from "../utils";
5
4
  import { useSelector } from "react-redux";
6
5
  import { unwrapImmutable } from "../utils";
7
6
  import { GET_AUTHENTICATION_PROFILE } from "../actions/authentication";
8
7
  import { ERROR, LOGOUT } from "../reducers/request";
9
8
  import ApplicationModuleLoader from "./ApplicationModuleLoader";
9
+ import LoadingIcon from "./LoadingIcon";
10
+
11
+ const useStyles = makeStyles({
12
+ wrapper: {
13
+ display: "flex",
14
+ width: "60%",
15
+ height: "100%",
16
+ padding: "0 20vw",
17
+ flexDirection: "column",
18
+ justifyContent: "center",
19
+ },
20
+ });
10
21
 
11
22
  export const useAuthenticationData = () => ({
12
23
  loading: useSelector(state => state.getIn(["requests", "actives", GET_AUTHENTICATION_PROFILE])),
@@ -15,34 +26,21 @@ export const useAuthenticationData = () => ({
15
26
  needLogin: useSelector(state => state.getIn(["requests", LOGOUT])),
16
27
  });
17
28
 
18
- export const Wrapper = styled.div`
19
- display: flex;
20
- width: 60%;
21
- height: 100%;
22
- padding: 0 20vw;
23
- flex-direction: column;
24
- justify-content: center;
25
- `;
26
-
27
- export const Loader = withTheme(props => (
28
- <Wrapper>
29
- <Placeholder icon={getThemeProp(["icons", "loading"], "loading")(props)} animate />
30
- </Wrapper>
31
- ));
32
-
33
29
  export const Error = ({ requestError, needLogin }) => {
30
+ const classes = useStyles();
31
+
34
32
  if (needLogin) {
35
33
  return (
36
- <Wrapper>
34
+ <div className={classes.wrapper}>
37
35
  <h1>Not logged in</h1>
38
- </Wrapper>
36
+ </div>
39
37
  );
40
38
  }
41
39
  return (
42
- <Wrapper>
40
+ <div className={classes.wrapper}>
43
41
  <h1>{safeGet(requestError, "payload", "message") || "An error occurred"}</h1>
44
42
  Last failing action: <pre>{JSON.stringify(requestError, null, 2)}</pre>
45
- </Wrapper>
43
+ </div>
46
44
  );
47
45
  };
48
46
 
@@ -50,7 +48,7 @@ const Authenticate = ({ children }) => {
50
48
  const { loading, authedUser, requestError, needLogin } = useAuthenticationData();
51
49
 
52
50
  if (loading) {
53
- return <Loader />;
51
+ return <LoadingIcon />;
54
52
  }
55
53
  if (!authedUser) {
56
54
  return <Error {...{ requestError, needLogin }} />;
@@ -1,10 +1,10 @@
1
1
  import React from "react";
2
2
  import Immutable from "immutable";
3
3
  import { Provider } from "react-redux";
4
- import { ThemeProvider } from "styled-components";
5
- import Authenticate, { Loader, Wrapper } from "./Authenticate";
4
+ import Authenticate from "./Authenticate";
6
5
  import { ERROR, LOGOUT } from "../reducers/request";
7
6
  import { GET_AUTHENTICATION_PROFILE } from "../actions/authentication";
7
+ import LoadingIcon from "./LoadingIcon";
8
8
 
9
9
  const TestComp = () => {
10
10
  return <div className="test" />;
@@ -64,17 +64,13 @@ describe("Authenticate", () => {
64
64
  state = state.setIn(["requests", "actives", GET_AUTHENTICATION_PROFILE], true);
65
65
  return expect(
66
66
  <Provider store={store(state)}>
67
- <ThemeProvider theme={{}}>
68
- <Authenticate>
69
- <TestComp />
70
- </Authenticate>
71
- </ThemeProvider>
67
+ <Authenticate>
68
+ <TestComp />
69
+ </Authenticate>
72
70
  </Provider>,
73
71
  "when mounted",
74
72
  "to exhaustively satisfy",
75
- <ThemeProvider theme={{}}>
76
- <Loader />
77
- </ThemeProvider>,
73
+ <LoadingIcon />,
78
74
  );
79
75
  });
80
76
 
@@ -82,17 +78,13 @@ describe("Authenticate", () => {
82
78
  state = state.setIn(["settings", "defaultScope"], null);
83
79
  return expect(
84
80
  <Provider store={store(state)}>
85
- <ThemeProvider theme={{}}>
86
- <Authenticate applicationModuleReady={false}>
87
- <TestComp />
88
- </Authenticate>
89
- </ThemeProvider>
81
+ <Authenticate applicationModuleReady={false}>
82
+ <TestComp />
83
+ </Authenticate>
90
84
  </Provider>,
91
85
  "when mounted",
92
86
  "to exhaustively satisfy",
93
- <ThemeProvider theme={{}}>
94
- <Loader />
95
- </ThemeProvider>,
87
+ <LoadingIcon />,
96
88
  );
97
89
  });
98
90
 
@@ -105,10 +97,10 @@ describe("Authenticate", () => {
105
97
  </Authenticate>
106
98
  </Provider>,
107
99
  "when mounted",
108
- "to exhaustively satisfy",
109
- <Wrapper>
100
+ "to satisfy",
101
+ <div>
110
102
  <h1>Not logged in</h1>
111
- </Wrapper>,
103
+ </div>,
112
104
  );
113
105
  });
114
106
 
@@ -127,8 +119,8 @@ describe("Authenticate", () => {
127
119
  </Authenticate>
128
120
  </Provider>,
129
121
  "when mounted",
130
- "to exhaustively satisfy",
131
- <Wrapper>
122
+ "to satisfy",
123
+ <div>
132
124
  <h1>404 - NotFound</h1>
133
125
  {"Last failing action: "}
134
126
  <pre>
@@ -140,7 +132,7 @@ describe("Authenticate", () => {
140
132
  " }\n" +
141
133
  "}"}
142
134
  </pre>
143
- </Wrapper>,
135
+ </div>,
144
136
  );
145
137
  });
146
138
 
@@ -158,11 +150,11 @@ describe("Authenticate", () => {
158
150
  </Authenticate>
159
151
  </Provider>,
160
152
  "when mounted",
161
- "to exhaustively satisfy",
162
- <Wrapper>
153
+ "to satisfy",
154
+ <div>
163
155
  <h1>An error occurred</h1>
164
156
  Last failing action: <pre>{'{\n "type": "TEST_ACTION"\n}'}</pre>
165
- </Wrapper>,
157
+ </div>,
166
158
  );
167
159
  });
168
160
  });
@@ -7,7 +7,7 @@ const useStyles = makeStyles(theme => ({
7
7
  drawer: {
8
8
  position: "absolute",
9
9
  zIndex: 19999,
10
- margin: "4px 0 0",
10
+ margin: theme.spacing(0.4, 0, 0),
11
11
  left: props => (props.alignRight ? "auto" : "0"),
12
12
  right: props => (props.alignRight ? "0" : "auto"),
13
13
  transition: "opacity 100ms ease-out",
@@ -25,19 +25,19 @@ const useStyles = makeStyles(theme => ({
25
25
  color: theme.palette.text.primary,
26
26
  backgroundColor: "white",
27
27
  border: `1px solid ${theme.palette.text.hint}`,
28
- borderRadius: "5px",
28
+ borderRadius: theme.spacing(0.5),
29
29
  listStyleType: "none",
30
- padding: "5px 0",
30
+ padding: theme.spacing(0.5, 0),
31
31
  margin: "0",
32
32
  fontFamily: "Open Sans, sans-serif",
33
- fontSize: "12px",
33
+ fontSize: theme.spacing(1.2),
34
34
  width: "max-content",
35
35
  },
36
36
  item: {
37
37
  boxSizing: "border-box",
38
- height: "30px",
39
- minWidth: "178px",
40
- padding: "9px 12px",
38
+ height: theme.spacing(3),
39
+ minWidth: theme.spacing(17.8),
40
+ padding: theme.spacing(0.9, 1.2),
41
41
  display: "flex",
42
42
  alignItems: "center",
43
43
  cursor: "pointer",
@@ -47,8 +47,8 @@ const useStyles = makeStyles(theme => ({
47
47
  },
48
48
  },
49
49
  itemIcon: {
50
- paddingRight: "11px",
51
- fontSize: "17px",
50
+ paddingRight: theme.spacing(1.1),
51
+ fontSize: theme.spacing(1.7),
52
52
  },
53
53
  }));
54
54
 
@@ -1,25 +1,8 @@
1
1
  import React from "react";
2
- import styled, { withTheme } from "styled-components";
3
- import { getThemeProp } from "../utils";
4
- import Placeholder from "./Placeholder";
2
+ import Placeholder from "./MaterialUI/DataDisplay/PredefinedElements/Placeholder";
5
3
 
6
- export const Wrapper = styled.div`
7
- display: flex;
8
- width: 60%;
9
- height: 100%;
10
- padding: 0 20vw;
11
- flex-direction: column;
12
- justify-content: center;
13
- `;
14
-
15
- const ErrorPlaceholder = withTheme(({ message, description, onClick, ...props }) => (
16
- <Placeholder
17
- icon={getThemeProp(["icons", "reportProblem"], "error")(props)}
18
- warn
19
- title={message}
20
- subtitle={description}
21
- onClick={onClick}
22
- />
23
- ));
4
+ const ErrorPlaceholder = ({ message, description }) => (
5
+ <Placeholder icon="report-problem-triangle" error title={message} subtitle={description} />
6
+ );
24
7
 
25
8
  export default ErrorPlaceholder;