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,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
|
-
<
|
|
70
|
-
<
|
|
71
|
-
|
|
72
|
-
</ApplicationModuleLoader>
|
|
73
|
-
</ThemeProvider>
|
|
68
|
+
<ApplicationModuleLoader>
|
|
69
|
+
<TestComp />
|
|
70
|
+
</ApplicationModuleLoader>
|
|
74
71
|
</Provider>,
|
|
75
72
|
"when mounted",
|
|
76
73
|
"to exhaustively satisfy",
|
|
77
|
-
<
|
|
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
|
-
<
|
|
88
|
-
<
|
|
89
|
-
|
|
90
|
-
</ApplicationModuleLoader>
|
|
91
|
-
</ThemeProvider>
|
|
82
|
+
<ApplicationModuleLoader>
|
|
83
|
+
<TestComp />
|
|
84
|
+
</ApplicationModuleLoader>
|
|
92
85
|
</Provider>,
|
|
93
86
|
"when mounted",
|
|
94
87
|
"to exhaustively satisfy",
|
|
95
|
-
<
|
|
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
|
-
<
|
|
107
|
-
<
|
|
108
|
-
|
|
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
|
-
<
|
|
132
|
-
<
|
|
133
|
-
|
|
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
|
|
3
|
-
import {
|
|
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
|
-
<
|
|
34
|
+
<div className={classes.wrapper}>
|
|
37
35
|
<h1>Not logged in</h1>
|
|
38
|
-
</
|
|
36
|
+
</div>
|
|
39
37
|
);
|
|
40
38
|
}
|
|
41
39
|
return (
|
|
42
|
-
<
|
|
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
|
-
</
|
|
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 <
|
|
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
|
|
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
|
-
<
|
|
68
|
-
<
|
|
69
|
-
|
|
70
|
-
</Authenticate>
|
|
71
|
-
</ThemeProvider>
|
|
67
|
+
<Authenticate>
|
|
68
|
+
<TestComp />
|
|
69
|
+
</Authenticate>
|
|
72
70
|
</Provider>,
|
|
73
71
|
"when mounted",
|
|
74
72
|
"to exhaustively satisfy",
|
|
75
|
-
<
|
|
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
|
-
<
|
|
86
|
-
<
|
|
87
|
-
|
|
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
|
-
<
|
|
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
|
|
109
|
-
<
|
|
100
|
+
"to satisfy",
|
|
101
|
+
<div>
|
|
110
102
|
<h1>Not logged in</h1>
|
|
111
|
-
</
|
|
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
|
|
131
|
-
<
|
|
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
|
-
</
|
|
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
|
|
162
|
-
<
|
|
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
|
-
</
|
|
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:
|
|
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:
|
|
28
|
+
borderRadius: theme.spacing(0.5),
|
|
29
29
|
listStyleType: "none",
|
|
30
|
-
padding:
|
|
30
|
+
padding: theme.spacing(0.5, 0),
|
|
31
31
|
margin: "0",
|
|
32
32
|
fontFamily: "Open Sans, sans-serif",
|
|
33
|
-
fontSize:
|
|
33
|
+
fontSize: theme.spacing(1.2),
|
|
34
34
|
width: "max-content",
|
|
35
35
|
},
|
|
36
36
|
item: {
|
|
37
37
|
boxSizing: "border-box",
|
|
38
|
-
height:
|
|
39
|
-
minWidth:
|
|
40
|
-
padding:
|
|
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:
|
|
51
|
-
fontSize:
|
|
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
|
|
3
|
-
import { getThemeProp } from "../utils";
|
|
4
|
-
import Placeholder from "./Placeholder";
|
|
2
|
+
import Placeholder from "./MaterialUI/DataDisplay/PredefinedElements/Placeholder";
|
|
5
3
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { Provider } from "react-redux";
|
|
3
|
-
import
|
|
4
|
-
import Placeholder from "./Placeholder";
|
|
3
|
+
import Placeholder from "./MaterialUI/DataDisplay/PredefinedElements/Placeholder";
|
|
5
4
|
import ErrorPlaceholder from "./ErrorPlaceholder";
|
|
6
5
|
|
|
7
6
|
describe("ErrorPlaceholder", () => {
|
|
@@ -14,9 +13,7 @@ describe("ErrorPlaceholder", () => {
|
|
|
14
13
|
getState: () => ({}),
|
|
15
14
|
}}
|
|
16
15
|
>
|
|
17
|
-
<
|
|
18
|
-
<ErrorPlaceholder message="Error" />
|
|
19
|
-
</ThemeProvider>
|
|
16
|
+
<ErrorPlaceholder message="Error" />
|
|
20
17
|
</Provider>,
|
|
21
18
|
"when mounted",
|
|
22
19
|
"to satisfy",
|
|
@@ -27,7 +24,7 @@ describe("ErrorPlaceholder", () => {
|
|
|
27
24
|
getState: () => ({}),
|
|
28
25
|
}}
|
|
29
26
|
>
|
|
30
|
-
<Placeholder icon="
|
|
27
|
+
<Placeholder icon="report-problem-triangle" error title="Error" />
|
|
31
28
|
</Provider>,
|
|
32
29
|
));
|
|
33
30
|
|
|
@@ -40,9 +37,7 @@ describe("ErrorPlaceholder", () => {
|
|
|
40
37
|
getState: () => ({}),
|
|
41
38
|
}}
|
|
42
39
|
>
|
|
43
|
-
<
|
|
44
|
-
<ErrorPlaceholder message="Error" description="This failed" />
|
|
45
|
-
</ThemeProvider>
|
|
40
|
+
<ErrorPlaceholder message="Error" description="This failed" />
|
|
46
41
|
</Provider>,
|
|
47
42
|
"when mounted",
|
|
48
43
|
"to satisfy",
|
|
@@ -53,7 +48,7 @@ describe("ErrorPlaceholder", () => {
|
|
|
53
48
|
getState: () => ({}),
|
|
54
49
|
}}
|
|
55
50
|
>
|
|
56
|
-
<Placeholder icon="
|
|
51
|
+
<Placeholder icon="report-problem-triangle" error title="Error" subtitle="This failed" />
|
|
57
52
|
</Provider>,
|
|
58
53
|
));
|
|
59
54
|
|
|
@@ -67,9 +62,7 @@ describe("ErrorPlaceholder", () => {
|
|
|
67
62
|
getState: () => ({}),
|
|
68
63
|
}}
|
|
69
64
|
>
|
|
70
|
-
<
|
|
71
|
-
<ErrorPlaceholder message="Error" onClick={handler} />
|
|
72
|
-
</ThemeProvider>
|
|
65
|
+
<ErrorPlaceholder message="Error" onClick={handler} />
|
|
73
66
|
</Provider>,
|
|
74
67
|
"when mounted",
|
|
75
68
|
"to satisfy",
|
|
@@ -80,7 +73,7 @@ describe("ErrorPlaceholder", () => {
|
|
|
80
73
|
getState: () => ({}),
|
|
81
74
|
}}
|
|
82
75
|
>
|
|
83
|
-
<Placeholder icon="
|
|
76
|
+
<Placeholder icon="report-problem-triangle" error title="Error" onClick={handler} />
|
|
84
77
|
</Provider>,
|
|
85
78
|
);
|
|
86
79
|
});
|
|
@@ -7,13 +7,13 @@ const useStyles = makeStyles(theme => ({
|
|
|
7
7
|
flex: "0 1 auto",
|
|
8
8
|
display: "flex",
|
|
9
9
|
flexDirection: "column",
|
|
10
|
-
marginTop:
|
|
10
|
+
marginTop: theme.spacing(2),
|
|
11
11
|
position: "relative",
|
|
12
12
|
},
|
|
13
13
|
label: {
|
|
14
|
-
minHeight:
|
|
14
|
+
minHeight: theme.spacing(1.7),
|
|
15
15
|
color: theme.palette.text.hint,
|
|
16
|
-
marginBottom:
|
|
16
|
+
marginBottom: theme.spacing(1),
|
|
17
17
|
},
|
|
18
18
|
invalidLabel: {
|
|
19
19
|
color: theme.palette.error.main,
|
|
@@ -22,7 +22,7 @@ const useStyles = makeStyles(theme => ({
|
|
|
22
22
|
textAlign: "center",
|
|
23
23
|
},
|
|
24
24
|
labelOnly: {
|
|
25
|
-
marginBottom:
|
|
25
|
+
marginBottom: 0,
|
|
26
26
|
},
|
|
27
27
|
requiredLabel: {
|
|
28
28
|
"&::after": {
|
|
@@ -114,10 +114,11 @@ describe("InputField", () => {
|
|
|
114
114
|
if (type === "MultiSelector") {
|
|
115
115
|
val = ["thing"];
|
|
116
116
|
emptyVal = [];
|
|
117
|
+
target = "[role='button']";
|
|
117
118
|
} else {
|
|
118
119
|
val = "thing";
|
|
120
|
+
target = "select";
|
|
119
121
|
}
|
|
120
|
-
target = "select";
|
|
121
122
|
} else if (type === "SwitchInput") {
|
|
122
123
|
val = true;
|
|
123
124
|
} else if (type === "DateInput") {
|
|
@@ -9,10 +9,10 @@ const useStyles = makeStyles(theme => ({
|
|
|
9
9
|
positionedButton: {
|
|
10
10
|
width: "max-content",
|
|
11
11
|
position: "relative",
|
|
12
|
-
padding:
|
|
12
|
+
padding: `${theme.spacing(0.6, 1.4)} !important`,
|
|
13
13
|
"&:hover": {
|
|
14
14
|
borderColor: "#4fa1f0",
|
|
15
|
-
boxShadow:
|
|
15
|
+
boxShadow: `${theme.spacing(0, 0, 0.4)} #4fa1f0`,
|
|
16
16
|
outline: "none",
|
|
17
17
|
backgroundColor: "#f7f7f7 !important",
|
|
18
18
|
},
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { useIntl } from "react-intl";
|
|
3
|
+
import Select from "../../MaterialUI/Inputs/Select";
|
|
4
|
+
import SelectProps from "../../MaterialUI/Inputs/SelectProps";
|
|
5
|
+
import sharedMessages from "../../../sharedMessages";
|
|
6
|
+
|
|
7
|
+
const clearValue = "__#Clear#__";
|
|
8
|
+
const selectAllValue = "__#SelectAll#__";
|
|
9
|
+
|
|
10
|
+
const MultiSelector = ({ value, width = 700, options, update, addClearSelectAll, multipleRenderValue, ...props }) => {
|
|
11
|
+
const { formatMessage } = useIntl();
|
|
12
|
+
|
|
13
|
+
const valueUpdater = value => {
|
|
14
|
+
if (value.indexOf(clearValue) >= 0) {
|
|
15
|
+
update([]);
|
|
16
|
+
} else if (value.indexOf(selectAllValue) >= 0) {
|
|
17
|
+
update(options.map(x => x.value));
|
|
18
|
+
} else {
|
|
19
|
+
update(value);
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const selectProps = new SelectProps();
|
|
24
|
+
|
|
25
|
+
const selectionOptions = [];
|
|
26
|
+
|
|
27
|
+
if (addClearSelectAll) {
|
|
28
|
+
if (value.length > 0) {
|
|
29
|
+
selectionOptions.push({
|
|
30
|
+
label: formatMessage(sharedMessages.clear),
|
|
31
|
+
value: clearValue,
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
if (value.length !== options.length) {
|
|
35
|
+
selectionOptions.push({
|
|
36
|
+
label: formatMessage(sharedMessages.selectAll),
|
|
37
|
+
value: selectAllValue,
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const allOptions = [...selectionOptions, ...options];
|
|
43
|
+
|
|
44
|
+
selectProps.set(SelectProps.propNames.value, value);
|
|
45
|
+
selectProps.set(SelectProps.propNames.onClose, props.onBlur);
|
|
46
|
+
selectProps.set(SelectProps.propNames.disabled, props.disabled);
|
|
47
|
+
selectProps.set(SelectProps.propNames.multiple, true);
|
|
48
|
+
selectProps.set(SelectProps.propNames.multipleSelectWidth, width);
|
|
49
|
+
selectProps.set(SelectProps.propNames.update, valueUpdater);
|
|
50
|
+
selectProps.set(SelectProps.propNames.autoWidth, false);
|
|
51
|
+
selectProps.set(SelectProps.propNames.autoFocus, false);
|
|
52
|
+
selectProps.set(
|
|
53
|
+
SelectProps.propNames.renderValue,
|
|
54
|
+
multipleRenderValue ? () => multipleRenderValue(value, options) : null,
|
|
55
|
+
);
|
|
56
|
+
selectProps.set(SelectProps.propNames.positionOverride, {
|
|
57
|
+
anchorOrigin: {
|
|
58
|
+
vertical: "bottom",
|
|
59
|
+
horizontal: "left",
|
|
60
|
+
},
|
|
61
|
+
transformOrigin: {
|
|
62
|
+
vertical: "top",
|
|
63
|
+
horizontal: "left",
|
|
64
|
+
},
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
const hasError = props.required && (!Array.isArray(value) || value.length === 0);
|
|
68
|
+
selectProps.set(SelectProps.propNames.error, hasError);
|
|
69
|
+
|
|
70
|
+
return <Select options={allOptions} selectProps={selectProps} />;
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
export default MultiSelector;
|