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.
- package/dist/components/AppFrame/About.js +13 -13
- package/dist/components/AppFrame/Anchor.js +7 -7
- package/dist/components/AppFrame/AppFrame.js +3 -3
- package/dist/components/AppFrame/Help.js +4 -4
- package/dist/components/AppFrame/MenuItem.js +17 -26
- package/dist/components/AppFrame/Preferences.js +14 -14
- package/dist/components/AppFrame/Sidebar.js +6 -6
- package/dist/components/AppFrame/Topbar.js +6 -6
- package/dist/components/ApplicationModuleLoader.js +3 -2
- package/dist/components/Authenticate.js +29 -22
- package/dist/components/DropMenu/Menu.js +9 -9
- package/dist/components/ErrorPlaceholder.js +8 -24
- package/dist/components/Form/Field.js +4 -4
- package/dist/components/Form/Inputs/Button.js +2 -2
- package/dist/components/Form/Inputs/MultiSelector.js +137 -0
- package/dist/components/Form/Inputs/Selector.js +13 -10
- package/dist/components/Form/Inputs/index.js +1 -1
- package/dist/components/InternetExplorerWarningMessage.js +15 -15
- package/dist/components/LoadingIcon.js +38 -17
- package/dist/components/MaterialUI/DataDisplay/Modal.js +3 -3
- package/dist/components/MaterialUI/DataDisplay/PredefinedElements/Placeholder.js +6 -6
- package/dist/components/MaterialUI/DataDisplay/PredefinedElements/StepperModal.js +1 -1
- package/dist/components/MaterialUI/DataDisplay/PredefinedElements/TableInfoBar.js +1 -1
- package/dist/components/MaterialUI/DataDisplay/SelectionList.js +1 -1
- package/dist/components/MaterialUI/DataDisplay/Table.js +2 -1
- package/dist/components/MaterialUI/DataDisplay/TableProps.js +3 -1
- package/dist/components/MaterialUI/DataDisplay/TransferList.js +1 -1
- package/dist/components/MaterialUI/Inputs/CheckboxGroup.js +1 -1
- package/dist/components/MaterialUI/Inputs/DatePicker.js +1 -1
- package/dist/components/MaterialUI/Inputs/PredefinedElements/SearchControl.js +1 -1
- package/dist/components/MaterialUI/Inputs/Select.js +175 -109
- package/dist/components/MaterialUI/Inputs/SelectProps.js +11 -1
- package/dist/components/MaterialUI/Inputs/Switch.js +1 -1
- package/dist/components/MaterialUI/Navigation/DropDownMenu.js +2 -4
- package/dist/components/MaterialUI/ScopeSelector/ScopeSelector.js +1 -1
- package/dist/components/MaterialUI/ScopeSelector/TreeItem.js +27 -42
- package/dist/components/MaterialUI/Surfaces/Paper.js +1 -1
- package/dist/components/MaterialUI/Surfaces/SectionExpansionPanel.js +3 -2
- package/dist/components/MaterialUI/muiThemes.js +3 -1
- package/dist/components/Provision.js +30 -13
- package/dist/components/Routing/SegmentPage.js +117 -56
- package/dist/components/Scope/ScopeNode.js +62 -57
- package/dist/components/Sidepanel.js +59 -23
- package/dist/components/Spritesheet.js +35 -17
- package/dist/components/Text.js +1 -60
- package/dist/components/ToastList.js +95 -64
- package/dist/components/Treeview/Branch.js +82 -20
- package/dist/components/Treeview/Label.js +108 -31
- package/dist/components/Treeview/Leaf.js +56 -12
- package/dist/components/Treeview/Node.js +22 -9
- package/dist/components/Treeview/index.js +7 -1
- package/dist/components/Treeview/settings.js +17 -6
- package/dist/{components/Modal/index.js → hooks/useWindowSize.js} +38 -36
- package/dist/sharedMessages.js +8 -0
- package/dist/utils/index.js +0 -4
- package/dist/utils/testUtils.js +1 -12
- package/dist/{components/Modal/Background.js → utils/toastHelper.js} +11 -14
- package/package.json +2 -2
- package/src/components/AppFrame/About.js +13 -13
- package/src/components/AppFrame/Anchor.js +7 -7
- package/src/components/AppFrame/AppFrame.js +3 -3
- package/src/components/AppFrame/Help.js +4 -4
- package/src/components/AppFrame/MenuItem.js +15 -23
- package/src/components/AppFrame/Preferences.js +14 -14
- package/src/components/AppFrame/Sidebar.js +6 -6
- package/src/components/AppFrame/Topbar.js +6 -6
- package/src/components/ApplicationModuleLoader.js +2 -2
- package/src/components/ApplicationModuleLoader.test.js +15 -28
- package/src/components/Authenticate.js +21 -23
- package/src/components/Authenticate.test.js +19 -27
- package/src/components/DropMenu/Menu.js +9 -9
- package/src/components/ErrorPlaceholder.js +4 -21
- package/src/components/ErrorPlaceholder.test.js +7 -14
- package/src/components/Form/Field.js +4 -4
- package/src/components/Form/InputField.test.js +2 -1
- package/src/components/Form/Inputs/Button.js +2 -2
- package/src/components/Form/Inputs/MultiSelector.js +73 -0
- package/src/components/Form/Inputs/MultiSelector.test.js +332 -0
- package/src/components/Form/Inputs/Selector.js +12 -4
- package/src/components/Form/Inputs/Selector.test.js +27 -12
- package/src/components/Form/Inputs/index.js +1 -1
- package/src/components/InternetExplorerWarningMessage.js +15 -15
- package/src/components/Loader.test.js +50 -59
- package/src/components/LoadingIcon.js +27 -14
- package/src/components/LoadingIcon.test.js +11 -15
- package/src/components/MaterialUI/DataDisplay/Modal.js +3 -3
- package/src/components/MaterialUI/DataDisplay/PredefinedElements/Placeholder.js +6 -6
- package/src/components/MaterialUI/DataDisplay/PredefinedElements/StepperModal.js +1 -1
- package/src/components/MaterialUI/DataDisplay/PredefinedElements/TableInfoBar.js +1 -1
- package/src/components/MaterialUI/DataDisplay/SelectionList.js +1 -1
- package/src/components/MaterialUI/DataDisplay/Table.js +6 -1
- package/src/components/MaterialUI/DataDisplay/Table.test.js +21 -1
- package/src/components/MaterialUI/DataDisplay/TableProps.js +2 -0
- package/src/components/MaterialUI/DataDisplay/TableProps.test.js +20 -2
- package/src/components/MaterialUI/DataDisplay/TransferList.js +1 -1
- package/src/components/MaterialUI/Inputs/CheckboxGroup.js +1 -1
- package/src/components/MaterialUI/Inputs/DatePicker.js +1 -1
- package/src/components/MaterialUI/Inputs/PredefinedElements/SearchControl.js +1 -1
- package/src/components/MaterialUI/Inputs/PredefinedElements/SearchControl.test.js +1 -1
- package/src/components/MaterialUI/Inputs/Select.js +143 -83
- package/src/components/MaterialUI/Inputs/Select.test.js +199 -14
- package/src/components/MaterialUI/Inputs/SelectProps.js +10 -0
- package/src/components/MaterialUI/Inputs/SelectProps.test.js +10 -0
- package/src/components/MaterialUI/Inputs/Switch.js +1 -1
- package/src/components/MaterialUI/Navigation/DropDownMenu.js +2 -2
- package/src/components/MaterialUI/Navigation/DropDownMenu.test.js +5 -6
- package/src/components/MaterialUI/ScopeSelector/ScopeSelector.js +1 -2
- package/src/components/MaterialUI/ScopeSelector/TreeItem.js +8 -31
- package/src/components/MaterialUI/Surfaces/Paper.js +1 -1
- package/src/components/MaterialUI/Surfaces/SectionExpansionPanel.js +2 -1
- package/src/components/MaterialUI/muiThemes.js +4 -1
- package/src/components/Navigation/Navigation.test.js +0 -5
- package/src/components/Navigation/useNavigationState.test.js +79 -222
- package/src/components/Provision.js +36 -42
- package/src/components/Provision.test.js +10 -26
- package/src/components/Routing/SegmentPage.js +68 -52
- package/src/components/Routing/SegmentPage.test.js +4 -12
- package/src/components/Scope/ScopeNode.js +44 -55
- package/src/components/Scope/ScopeNode.test.js +84 -163
- package/src/components/ScopeExtendedConfigurationLoader.test.js +1 -4
- package/src/components/Sidepanel.js +38 -32
- package/src/components/Sidepanel.test.js +54 -27
- package/src/components/Spritesheet.js +23 -21
- package/src/components/Spritesheet.test.js +10 -10
- package/src/components/Text.js +0 -49
- package/src/components/ToastList.js +79 -90
- package/src/components/ToastList.test.js +29 -103
- package/src/components/Treeview/Branch.js +65 -47
- package/src/components/Treeview/Branch.test.js +2 -43
- package/src/components/Treeview/Label.js +68 -54
- package/src/components/Treeview/Label.test.js +55 -63
- package/src/components/Treeview/Leaf.js +41 -22
- package/src/components/Treeview/Leaf.test.js +1 -15
- package/src/components/Treeview/Node.js +16 -9
- package/src/components/Treeview/Node.test.js +269 -200
- package/src/components/Treeview/Treeview.test.js +248 -248
- package/src/components/Treeview/index.js +6 -0
- package/src/components/Treeview/settings.js +10 -6
- package/src/hooks/useMultipleFieldEditState.test.js +0 -1
- package/src/hooks/useWindowSize.js +39 -0
- package/src/hooks/useWindowSize.test.js +68 -0
- package/src/sharedMessages.js +8 -0
- package/src/translations/en-US.json +2 -0
- package/src/translations/fr-CA.json +2 -0
- package/src/utils/index.js +0 -4
- package/src/utils/testUtils.js +0 -10
- package/src/utils/testUtils.test.js +0 -68
- package/src/utils/toastHelper.js +8 -0
- package/src/utils/toastHelper.test.js +41 -0
- package/dist/components/Button.js +0 -70
- package/dist/components/CategoryList.js +0 -197
- package/dist/components/Checkbox.js +0 -103
- package/dist/components/Icon.js +0 -69
- package/dist/components/IconButton.js +0 -80
- package/dist/components/Input.js +0 -101
- package/dist/components/List/DataCell.js +0 -129
- package/dist/components/List/HeadCell.js +0 -125
- package/dist/components/List/HeadRow.js +0 -73
- package/dist/components/List/List.js +0 -274
- package/dist/components/List/Row.js +0 -109
- package/dist/components/List/enhanceColumnDefs.js +0 -111
- package/dist/components/List/index.js +0 -59
- package/dist/components/Modal/Dialog.js +0 -75
- package/dist/components/Modal/Wrapper.js +0 -69
- package/dist/components/MultiSelector.js +0 -187
- package/dist/components/Navigation/Bar.js +0 -293
- package/dist/components/Navigation/Tab.js +0 -182
- package/dist/components/Placeholder.js +0 -114
- package/dist/components/Scope/Selector.js +0 -123
- package/dist/components/Selector.js +0 -185
- package/dist/components/Switch.js +0 -128
- package/dist/components/Toolbar.js +0 -227
- package/dist/components/Tooltip.js +0 -66
- package/dist/getTheme.js +0 -158
- package/dist/getThemeOverrides.js +0 -93
- package/dist/hocs/withAuthentication.js +0 -72
- package/dist/utils/styledPropFuncs.js +0 -88
- package/src/components/Button.js +0 -90
- package/src/components/Button.test.js +0 -49
- package/src/components/CategoryList.js +0 -140
- package/src/components/CategoryList.test.js +0 -667
- package/src/components/Checkbox.js +0 -63
- package/src/components/Checkbox.test.js +0 -122
- package/src/components/Icon.js +0 -18
- package/src/components/IconButton.js +0 -30
- package/src/components/IconButton.test.js +0 -61
- package/src/components/Input.js +0 -35
- package/src/components/Input.test.js +0 -34
- package/src/components/List/DataCell.js +0 -77
- package/src/components/List/DataCell.test.js +0 -357
- package/src/components/List/HeadCell.js +0 -105
- package/src/components/List/HeadCell.test.js +0 -331
- package/src/components/List/HeadRow.js +0 -21
- package/src/components/List/HeadRow.test.js +0 -27
- package/src/components/List/List.js +0 -162
- package/src/components/List/List.test.js +0 -705
- package/src/components/List/Row.js +0 -72
- package/src/components/List/Row.test.js +0 -194
- package/src/components/List/enhanceColumnDefs.js +0 -54
- package/src/components/List/enhanceColumnDefs.test.js +0 -179
- package/src/components/List/index.js +0 -6
- package/src/components/Modal/Background.js +0 -10
- package/src/components/Modal/Dialog.js +0 -27
- package/src/components/Modal/Dialog.test.js +0 -20
- package/src/components/Modal/Modal.test.js +0 -52
- package/src/components/Modal/Wrapper.js +0 -32
- package/src/components/Modal/Wrapper.test.js +0 -55
- package/src/components/Modal/index.js +0 -22
- package/src/components/MultiSelector.js +0 -104
- package/src/components/MultiSelector.test.js +0 -348
- package/src/components/Navigation/Bar.js +0 -212
- package/src/components/Navigation/Bar.test.js +0 -552
- package/src/components/Navigation/Tab.js +0 -156
- package/src/components/Navigation/Tab.test.js +0 -404
- package/src/components/Placeholder.js +0 -61
- package/src/components/Placeholder.test.js +0 -106
- package/src/components/Scope/Selector.js +0 -70
- package/src/components/Scope/Selector.test.js +0 -138
- package/src/components/Selector.js +0 -191
- package/src/components/Selector.test.js +0 -157
- package/src/components/Switch.js +0 -112
- package/src/components/Switch.test.js +0 -130
- package/src/components/Text.test.js +0 -132
- package/src/components/Toolbar.js +0 -178
- package/src/components/Toolbar.test.js +0 -478
- package/src/components/Tooltip.js +0 -51
- package/src/components/Tooltip.test.js +0 -21
- package/src/getTheme.js +0 -103
- package/src/getTheme.test.js +0 -92
- package/src/getThemeOverrides.js +0 -27
- package/src/hocs/withAuthentication.js +0 -18
- package/src/hocs/withAuthentication.test.js +0 -120
- package/src/utils/styledPropFuncs.js +0 -20
- package/src/utils/styledPropFuncs.test.js +0 -166
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { Provider } from "react-redux";
|
|
3
|
-
import { ThemeProvider } from "styled-components";
|
|
4
3
|
import { mount, act } from "unexpected-reaction";
|
|
5
4
|
import sinon from "sinon";
|
|
6
|
-
import { spyOnConsole } from "../utils/testUtils";
|
|
5
|
+
import { createMuiTheme, spyOnConsole, TestWrapper } from "../utils/testUtils";
|
|
7
6
|
import ErrorPlaceholder from "./ErrorPlaceholder";
|
|
8
7
|
import Loader, { Loading } from "./Loader";
|
|
8
|
+
import ColumnWrapper from "./ColumnWrapper";
|
|
9
|
+
import LoadingIcon from "./LoadingIcon";
|
|
10
|
+
|
|
11
|
+
const theme = createMuiTheme();
|
|
9
12
|
|
|
10
13
|
describe("Loader placeholder", () => {
|
|
11
14
|
let clock;
|
|
@@ -18,11 +21,11 @@ describe("Loader placeholder", () => {
|
|
|
18
21
|
|
|
19
22
|
it("renders null, then load spinner if no props set", () => {
|
|
20
23
|
const loader = mount(
|
|
21
|
-
<
|
|
24
|
+
<TestWrapper stylesProvider muiThemeProvider={{ theme }}>
|
|
22
25
|
<div>
|
|
23
26
|
<Loading />
|
|
24
27
|
</div>
|
|
25
|
-
</
|
|
28
|
+
</TestWrapper>,
|
|
26
29
|
);
|
|
27
30
|
expect(loader, "to satisfy", <div />);
|
|
28
31
|
act(() => {
|
|
@@ -30,12 +33,12 @@ describe("Loader placeholder", () => {
|
|
|
30
33
|
});
|
|
31
34
|
expect(
|
|
32
35
|
loader,
|
|
33
|
-
"queried for first",
|
|
34
|
-
"svg",
|
|
35
36
|
"to satisfy",
|
|
36
|
-
<
|
|
37
|
-
<
|
|
38
|
-
|
|
37
|
+
<TestWrapper stylesProvider muiThemeProvider={{ theme }}>
|
|
38
|
+
<div>
|
|
39
|
+
<LoadingIcon />
|
|
40
|
+
</div>
|
|
41
|
+
</TestWrapper>,
|
|
39
42
|
);
|
|
40
43
|
});
|
|
41
44
|
|
|
@@ -50,9 +53,7 @@ describe("Loader placeholder", () => {
|
|
|
50
53
|
getState: () => ({}),
|
|
51
54
|
}}
|
|
52
55
|
>
|
|
53
|
-
<
|
|
54
|
-
<Loading {...{ error }} />
|
|
55
|
-
</ThemeProvider>
|
|
56
|
+
<Loading {...{ error }} />
|
|
56
57
|
</Provider>,
|
|
57
58
|
"when mounted",
|
|
58
59
|
"to satisfy",
|
|
@@ -63,9 +64,7 @@ describe("Loader placeholder", () => {
|
|
|
63
64
|
getState: () => ({}),
|
|
64
65
|
}}
|
|
65
66
|
>
|
|
66
|
-
<
|
|
67
|
-
<ErrorPlaceholder message="This is a test" />
|
|
68
|
-
</ThemeProvider>
|
|
67
|
+
<ErrorPlaceholder message="This is a test" />
|
|
69
68
|
</Provider>,
|
|
70
69
|
);
|
|
71
70
|
});
|
|
@@ -73,9 +72,9 @@ describe("Loader placeholder", () => {
|
|
|
73
72
|
});
|
|
74
73
|
|
|
75
74
|
describe("Loader", () => {
|
|
76
|
-
let clock,
|
|
75
|
+
let clock, componentLoader, errorLoader;
|
|
77
76
|
beforeEach(() => {
|
|
78
|
-
|
|
77
|
+
componentLoader = () => import("./ColumnWrapper");
|
|
79
78
|
errorLoader = () => Promise.reject(new Error("This is not right"));
|
|
80
79
|
clock = sinon.useFakeTimers();
|
|
81
80
|
});
|
|
@@ -85,13 +84,13 @@ describe("Loader", () => {
|
|
|
85
84
|
spyOnConsole(["error"]);
|
|
86
85
|
|
|
87
86
|
it("loads the component", () => {
|
|
88
|
-
const Comp = Loader(
|
|
87
|
+
const Comp = Loader(componentLoader);
|
|
89
88
|
const loader = mount(
|
|
90
|
-
<
|
|
89
|
+
<TestWrapper stylesProvider muiThemeProvider={{ theme }}>
|
|
91
90
|
<div>
|
|
92
91
|
<Comp />
|
|
93
92
|
</div>
|
|
94
|
-
</
|
|
93
|
+
</TestWrapper>,
|
|
95
94
|
);
|
|
96
95
|
expect(loader, "to satisfy", <div />);
|
|
97
96
|
act(() => {
|
|
@@ -99,12 +98,12 @@ describe("Loader", () => {
|
|
|
99
98
|
});
|
|
100
99
|
expect(
|
|
101
100
|
loader,
|
|
102
|
-
"queried for first",
|
|
103
|
-
"svg",
|
|
104
101
|
"to satisfy",
|
|
105
|
-
<
|
|
106
|
-
<
|
|
107
|
-
|
|
102
|
+
<TestWrapper stylesProvider muiThemeProvider={{ theme }}>
|
|
103
|
+
<div>
|
|
104
|
+
<LoadingIcon />
|
|
105
|
+
</div>
|
|
106
|
+
</TestWrapper>,
|
|
108
107
|
);
|
|
109
108
|
let load;
|
|
110
109
|
act(() => {
|
|
@@ -114,29 +113,29 @@ describe("Loader", () => {
|
|
|
114
113
|
expect(
|
|
115
114
|
loader,
|
|
116
115
|
"to satisfy",
|
|
117
|
-
<
|
|
118
|
-
<
|
|
119
|
-
|
|
116
|
+
<TestWrapper stylesProvider muiThemeProvider={{ theme }}>
|
|
117
|
+
<div>
|
|
118
|
+
<ColumnWrapper />
|
|
119
|
+
</div>
|
|
120
|
+
</TestWrapper>,
|
|
120
121
|
).then(() => expect(console.error, "was not called")),
|
|
121
122
|
);
|
|
122
123
|
});
|
|
123
124
|
|
|
124
125
|
it("errors out", () => {
|
|
125
126
|
const Comp = Loader(errorLoader);
|
|
127
|
+
const store = {
|
|
128
|
+
subscribe: () => {},
|
|
129
|
+
dispatch: () => {},
|
|
130
|
+
getState: () => ({}),
|
|
131
|
+
};
|
|
132
|
+
|
|
126
133
|
const loader = mount(
|
|
127
|
-
<
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
}}
|
|
133
|
-
>
|
|
134
|
-
<ThemeProvider theme={{}}>
|
|
135
|
-
<div>
|
|
136
|
-
<Comp />
|
|
137
|
-
</div>
|
|
138
|
-
</ThemeProvider>
|
|
139
|
-
</Provider>,
|
|
134
|
+
<TestWrapper provider={{ store }} stylesProvider muiThemeProvider={{ theme }}>
|
|
135
|
+
<div>
|
|
136
|
+
<Comp />
|
|
137
|
+
</div>
|
|
138
|
+
</TestWrapper>,
|
|
140
139
|
);
|
|
141
140
|
expect(loader, "to satisfy", <div />);
|
|
142
141
|
act(() => {
|
|
@@ -144,12 +143,12 @@ describe("Loader", () => {
|
|
|
144
143
|
});
|
|
145
144
|
expect(
|
|
146
145
|
loader,
|
|
147
|
-
"queried for first",
|
|
148
|
-
"svg",
|
|
149
146
|
"to satisfy",
|
|
150
|
-
<
|
|
151
|
-
<
|
|
152
|
-
|
|
147
|
+
<TestWrapper stylesProvider muiThemeProvider={{ theme }}>
|
|
148
|
+
<div>
|
|
149
|
+
<LoadingIcon />
|
|
150
|
+
</div>
|
|
151
|
+
</TestWrapper>,
|
|
153
152
|
);
|
|
154
153
|
let load;
|
|
155
154
|
act(() => {
|
|
@@ -159,19 +158,11 @@ describe("Loader", () => {
|
|
|
159
158
|
expect(
|
|
160
159
|
loader,
|
|
161
160
|
"to satisfy",
|
|
162
|
-
<
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
}}
|
|
168
|
-
>
|
|
169
|
-
<ThemeProvider theme={{}}>
|
|
170
|
-
<div>
|
|
171
|
-
<ErrorPlaceholder message="This is not right" />
|
|
172
|
-
</div>
|
|
173
|
-
</ThemeProvider>
|
|
174
|
-
</Provider>,
|
|
161
|
+
<TestWrapper provider={{ store }} stylesProvider muiThemeProvider={{ theme }}>
|
|
162
|
+
<div>
|
|
163
|
+
<ErrorPlaceholder message="This is not right" />
|
|
164
|
+
</div>
|
|
165
|
+
</TestWrapper>,
|
|
175
166
|
).then(() => expect(console.error, "was called")),
|
|
176
167
|
);
|
|
177
168
|
});
|
|
@@ -1,19 +1,32 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import Placeholder from "./Placeholder";
|
|
2
|
+
import CircularProgress from "@material-ui/core/CircularProgress";
|
|
3
|
+
import { makeStyles } from "@material-ui/core";
|
|
5
4
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
5
|
+
const useStyles = makeStyles(theme => ({
|
|
6
|
+
progressContainer: {
|
|
7
|
+
top: 0,
|
|
8
|
+
left: 0,
|
|
9
|
+
right: 0,
|
|
10
|
+
bottom: 0,
|
|
11
|
+
display: "flex",
|
|
12
|
+
position: "fixed",
|
|
13
|
+
alignItems: "center",
|
|
14
|
+
justifyContent: "center",
|
|
15
|
+
zIndex: 999,
|
|
16
|
+
},
|
|
17
|
+
progress: {
|
|
18
|
+
color: theme.palette.primary.main,
|
|
19
|
+
},
|
|
20
|
+
}));
|
|
14
21
|
|
|
15
|
-
const LoadingIcon =
|
|
16
|
-
|
|
17
|
-
|
|
22
|
+
const LoadingIcon = () => {
|
|
23
|
+
const classes = useStyles();
|
|
24
|
+
|
|
25
|
+
return (
|
|
26
|
+
<div className={classes.progressContainer}>
|
|
27
|
+
<CircularProgress className={classes.progress} size={100} color="inherit" />
|
|
28
|
+
</div>
|
|
29
|
+
);
|
|
30
|
+
};
|
|
18
31
|
|
|
19
32
|
export default LoadingIcon;
|
|
@@ -1,26 +1,22 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import
|
|
3
|
-
import Placeholder from "./Placeholder";
|
|
2
|
+
import CircularProgress from "@material-ui/core/CircularProgress";
|
|
4
3
|
import LoadingIcon from "./LoadingIcon";
|
|
4
|
+
import { createMuiTheme, TestWrapper } from "../utils/testUtils";
|
|
5
|
+
|
|
6
|
+
const theme = createMuiTheme();
|
|
5
7
|
|
|
6
8
|
describe("LoadingIcon", () => {
|
|
7
9
|
it("shows a spinning load icon", () =>
|
|
8
10
|
expect(
|
|
9
|
-
<
|
|
10
|
-
<LoadingIcon />
|
|
11
|
-
</ThemeProvider>,
|
|
12
|
-
"when mounted",
|
|
13
|
-
"to satisfy",
|
|
14
|
-
<Placeholder icon="loading" animate />,
|
|
15
|
-
));
|
|
16
|
-
|
|
17
|
-
it("gets icon from theme", () =>
|
|
18
|
-
expect(
|
|
19
|
-
<ThemeProvider theme={{ icons: { loading: "spinner" } }}>
|
|
11
|
+
<TestWrapper stylesProvider muiThemeProvider={{ theme }}>
|
|
20
12
|
<LoadingIcon />
|
|
21
|
-
</
|
|
13
|
+
</TestWrapper>,
|
|
22
14
|
"when mounted",
|
|
23
15
|
"to satisfy",
|
|
24
|
-
<
|
|
16
|
+
<TestWrapper stylesProvider muiThemeProvider={{ theme }}>
|
|
17
|
+
<div>
|
|
18
|
+
<CircularProgress size={100} color="inherit" />
|
|
19
|
+
</div>
|
|
20
|
+
</TestWrapper>,
|
|
25
21
|
));
|
|
26
22
|
});
|
|
@@ -24,12 +24,12 @@ const useStyles = makeStyles(theme => ({
|
|
|
24
24
|
},
|
|
25
25
|
containerWide: {
|
|
26
26
|
width: theme.spacing(106.4),
|
|
27
|
-
height: `calc(100% -
|
|
27
|
+
height: `calc(100% - ${theme.spacing(8)})`,
|
|
28
28
|
maxHeight: theme.spacing(73),
|
|
29
29
|
},
|
|
30
30
|
containerFullwidth: {
|
|
31
|
-
width: `calc(100% -
|
|
32
|
-
height: `calc(100% -
|
|
31
|
+
width: `calc(100% - ${theme.spacing(8)})`,
|
|
32
|
+
height: `calc(100% - ${theme.spacing(8)})`,
|
|
33
33
|
},
|
|
34
34
|
title: {
|
|
35
35
|
height: theme.spacing(4),
|
|
@@ -44,18 +44,18 @@ const useStyles = makeStyles(theme => ({
|
|
|
44
44
|
},
|
|
45
45
|
textSkeleton: {
|
|
46
46
|
width: "100%",
|
|
47
|
-
height: 6,
|
|
47
|
+
height: theme.spacing(0.6),
|
|
48
48
|
animation: false,
|
|
49
49
|
},
|
|
50
50
|
chipSkeleton: {
|
|
51
|
-
width:
|
|
52
|
-
height:
|
|
51
|
+
width: theme.spacing(6),
|
|
52
|
+
height: theme.spacing(2.5),
|
|
53
53
|
animation: false,
|
|
54
|
-
borderRadius:
|
|
54
|
+
borderRadius: theme.spacing(1.5),
|
|
55
55
|
},
|
|
56
56
|
radioSkeleton: {
|
|
57
|
-
width:
|
|
58
|
-
height:
|
|
57
|
+
width: theme.spacing(1.7),
|
|
58
|
+
height: theme.spacing(1.7),
|
|
59
59
|
animation: false,
|
|
60
60
|
},
|
|
61
61
|
root: {
|
|
@@ -73,7 +73,7 @@ const useStyles = makeStyles(theme => ({
|
|
|
73
73
|
},
|
|
74
74
|
active: {
|
|
75
75
|
backgroundColor: `${theme.palette.primary.dark} !important`,
|
|
76
|
-
boxShadow:
|
|
76
|
+
boxShadow: `inset ${theme.spacing(1, 0, 1, 0.1)} rgba(0,0,0,0.18)`,
|
|
77
77
|
|
|
78
78
|
"&:after": {
|
|
79
79
|
borderLeftColor: `${theme.palette.primary.dark} !important`,
|
|
@@ -29,7 +29,7 @@ const useStyles = makeStyles(theme => ({
|
|
|
29
29
|
},
|
|
30
30
|
"&::-webkit-scrollbar-thumb": {
|
|
31
31
|
background: theme.palette.grey.borders,
|
|
32
|
-
border:
|
|
32
|
+
border: `${theme.spacing(0.5)} white solid`,
|
|
33
33
|
backgroundClip: "padding-box",
|
|
34
34
|
borderRadius: theme.spacing(1.5),
|
|
35
35
|
},
|
|
@@ -352,7 +352,11 @@ const DefaultFullTable = React.forwardRef((props, ref) => {
|
|
|
352
352
|
context={props.context}
|
|
353
353
|
/>
|
|
354
354
|
</TableMui>
|
|
355
|
-
{props.tableRows.length > 0 ? null :
|
|
355
|
+
{props.tableRows.length > 0 ? null : (
|
|
356
|
+
<div className={classNames(props.classes.placeholder, props.customClasses.placeholderContainer)}>
|
|
357
|
+
{props.placeholder}
|
|
358
|
+
</div>
|
|
359
|
+
)}
|
|
356
360
|
</div>
|
|
357
361
|
);
|
|
358
362
|
});
|
|
@@ -441,6 +445,7 @@ const Table = React.forwardRef(
|
|
|
441
445
|
customClasses["tableCell"] = tableProps?.getStyle(TableProps.ruleNames.tableCell) || null;
|
|
442
446
|
customClasses["headerCell"] = tableProps?.getStyle(TableProps.ruleNames.headerCell) || null;
|
|
443
447
|
customClasses["tableContainer"] = tableProps?.getStyle(TableProps.ruleNames.tableContainer) || null;
|
|
448
|
+
customClasses["placeholderContainer"] = tableProps?.getStyle(TableProps.ruleNames.placeholderContainer) || null;
|
|
444
449
|
customClasses["container"] = tableProps?.getStyle(TableProps.ruleNames.container) || null;
|
|
445
450
|
customClasses["table"] = tableProps?.getStyle(TableProps.ruleNames.table) || null;
|
|
446
451
|
|
|
@@ -8,7 +8,7 @@ import TableMui from "@material-ui/core/Table";
|
|
|
8
8
|
import TableHead from "@material-ui/core/TableHead";
|
|
9
9
|
import TableRow from "@material-ui/core/TableRow";
|
|
10
10
|
import { buildHeaderAndRowFromConfig } from "./tableHelpers";
|
|
11
|
-
import Placeholder from "
|
|
11
|
+
import Placeholder from "./PredefinedElements/Placeholder";
|
|
12
12
|
import TableInfoBar from "./PredefinedElements/TableInfoBar";
|
|
13
13
|
import { ignoreConsoleError } from "../../../utils/testUtils";
|
|
14
14
|
import TableProps from "./TableProps";
|
|
@@ -1102,6 +1102,26 @@ describe("Table", () => {
|
|
|
1102
1102
|
expect(placeHolder.length, "to equal", 1);
|
|
1103
1103
|
});
|
|
1104
1104
|
|
|
1105
|
+
it("Renders Table with placeholder and custom class if rows are empty", () => {
|
|
1106
|
+
const { headers, rows } = buildHeaderAndRowFromConfig(config, []);
|
|
1107
|
+
|
|
1108
|
+
const placeholder = <Placeholder />;
|
|
1109
|
+
|
|
1110
|
+
const tableProps = new TableProps();
|
|
1111
|
+
tableProps.setStyle(TableProps.ruleNames.placeholderContainer, "placeholder-container-custom-class");
|
|
1112
|
+
|
|
1113
|
+
const component = <Table rows={rows} headers={headers} placeholder={placeholder} tableProps={tableProps} />;
|
|
1114
|
+
|
|
1115
|
+
const mountedComponent = mount(component);
|
|
1116
|
+
|
|
1117
|
+
const placeHolder = mountedComponent.find(Placeholder);
|
|
1118
|
+
expect(placeHolder.exists(), "to be true");
|
|
1119
|
+
|
|
1120
|
+
const placeholderContainer = placeHolder.parent();
|
|
1121
|
+
expect(placeholderContainer.exists(), "to be true");
|
|
1122
|
+
expect(placeholderContainer.hasClass("placeholder-container-custom-class"), "to be true");
|
|
1123
|
+
});
|
|
1124
|
+
|
|
1105
1125
|
it("Renders Table with tableInfo if provided", () => {
|
|
1106
1126
|
const { headers, rows } = buildHeaderAndRowFromConfig(config, []);
|
|
1107
1127
|
|
|
@@ -24,6 +24,7 @@ class TableProps extends ComponentProps {
|
|
|
24
24
|
tableContainer: "tableContainer",
|
|
25
25
|
container: "container",
|
|
26
26
|
table: "table",
|
|
27
|
+
placeholderContainer: "placeholderContainer",
|
|
27
28
|
};
|
|
28
29
|
|
|
29
30
|
constructor() {
|
|
@@ -47,6 +48,7 @@ class TableProps extends ComponentProps {
|
|
|
47
48
|
this.componentClasses.set(this.constructor.ruleNames.tableCell, null);
|
|
48
49
|
this.componentClasses.set(this.constructor.ruleNames.headerCell, null);
|
|
49
50
|
this.componentClasses.set(this.constructor.ruleNames.tableContainer, null);
|
|
51
|
+
this.componentClasses.set(this.constructor.ruleNames.placeholderContainer, null);
|
|
50
52
|
this.componentClasses.set(this.constructor.ruleNames.container, null);
|
|
51
53
|
this.componentClasses.set(this.constructor.ruleNames.table, null);
|
|
52
54
|
|
|
@@ -12,7 +12,16 @@ describe("TableProps Props", () => {
|
|
|
12
12
|
"constrained",
|
|
13
13
|
];
|
|
14
14
|
|
|
15
|
-
const ruleNames = [
|
|
15
|
+
const ruleNames = [
|
|
16
|
+
"tableHeader",
|
|
17
|
+
"tableRow",
|
|
18
|
+
"tableCell",
|
|
19
|
+
"headerCell",
|
|
20
|
+
"tableContainer",
|
|
21
|
+
"placeholderContainer",
|
|
22
|
+
"container",
|
|
23
|
+
"table",
|
|
24
|
+
];
|
|
16
25
|
|
|
17
26
|
expect(TableProps.propNames, "to have keys", propNames);
|
|
18
27
|
expect(TableProps.ruleNames, "to have keys", ruleNames);
|
|
@@ -34,7 +43,16 @@ describe("TableProps Props", () => {
|
|
|
34
43
|
"saveScrollbarPosition",
|
|
35
44
|
];
|
|
36
45
|
|
|
37
|
-
const ruleNames = [
|
|
46
|
+
const ruleNames = [
|
|
47
|
+
"tableHeader",
|
|
48
|
+
"tableRow",
|
|
49
|
+
"tableCell",
|
|
50
|
+
"headerCell",
|
|
51
|
+
"tableContainer",
|
|
52
|
+
"placeholderContainer",
|
|
53
|
+
"container",
|
|
54
|
+
"table",
|
|
55
|
+
];
|
|
38
56
|
|
|
39
57
|
const tableProps = new TableProps();
|
|
40
58
|
|
|
@@ -30,7 +30,7 @@ const useStyles = makeStyles(theme => ({
|
|
|
30
30
|
},
|
|
31
31
|
"&::-webkit-scrollbar-thumb": {
|
|
32
32
|
background: theme.palette.grey.borders,
|
|
33
|
-
border:
|
|
33
|
+
border: `${theme.spacing(0.5)} white solid`,
|
|
34
34
|
backgroundClip: "padding-box",
|
|
35
35
|
borderRadius: theme.spacing(1.5),
|
|
36
36
|
},
|
|
@@ -27,7 +27,7 @@ const useStyles = makeStyles(theme => ({
|
|
|
27
27
|
"&:focus, &:focus-within": {
|
|
28
28
|
borderRadius: theme.shape.borderRadius,
|
|
29
29
|
borderColor: theme.palette.focus,
|
|
30
|
-
boxShadow: `0 0
|
|
30
|
+
boxShadow: `0 0 ${theme.spacing(0.4)} ${theme.palette.focus}`,
|
|
31
31
|
outline: "none",
|
|
32
32
|
},
|
|
33
33
|
"& .react-datepicker": {
|
|
@@ -104,7 +104,7 @@ export const useStyles = makeStyles(theme => ({
|
|
|
104
104
|
"&:focus-within": {
|
|
105
105
|
zIndex: 99,
|
|
106
106
|
border: `${theme.spacing(0.1)} solid ${theme.palette.focus}`,
|
|
107
|
-
boxShadow: `0 0
|
|
107
|
+
boxShadow: `0 0 ${theme.spacing(0.4)} ${theme.palette.focus}`,
|
|
108
108
|
},
|
|
109
109
|
},
|
|
110
110
|
selectRoot: {
|
|
@@ -47,7 +47,7 @@ describe("useStyles", () => {
|
|
|
47
47
|
expect
|
|
48
48
|
.it("to contain", "z-index: 99;")
|
|
49
49
|
.and("to contain", "border: 0.0625rem solid #4fa1f0;")
|
|
50
|
-
.and("to contain", "box-shadow: 0 0
|
|
50
|
+
.and("to contain", "box-shadow: 0 0 0.25rem #4fa1f0;"),
|
|
51
51
|
);
|
|
52
52
|
});
|
|
53
53
|
});
|