orc-shared 5.10.0-dev.2 → 5.10.0-dev.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/actions/metadata.js +30 -11
- package/dist/actions/requestsApi.js +10 -1
- package/dist/components/AppFrame/About.js +136 -100
- package/dist/components/AppFrame/Anchor.js +45 -21
- package/dist/components/AppFrame/AppFrame.js +53 -31
- package/dist/components/AppFrame/Help.js +35 -15
- package/dist/components/AppFrame/MenuItem.js +148 -114
- package/dist/components/AppFrame/Preferences.js +136 -97
- package/dist/components/AppFrame/Sidebar.js +51 -28
- package/dist/components/AppFrame/Topbar.js +61 -36
- package/dist/components/ColumnWrapper.js +28 -5
- package/dist/components/Culture.js +33 -14
- package/dist/components/DropMenu/Menu.js +79 -45
- package/dist/components/DropMenu/index.js +34 -29
- package/dist/components/Form/Combination.js +45 -16
- package/dist/components/Form/Field.js +57 -38
- package/dist/components/Form/FieldElements.js +0 -11
- package/dist/components/Form/Fieldset.js +47 -19
- package/dist/components/Form/Form.js +22 -9
- package/dist/components/Form/FormElement.js +40 -7
- package/dist/components/Form/Inputs/Button.js +63 -18
- package/dist/components/Form/Inputs/ReadOnly.js +50 -27
- package/dist/components/{AppFrame/ApplicationSelector/Header.js → Form/Inputs/Selector.js} +30 -31
- package/dist/components/Form/Inputs/Text.js +20 -37
- package/dist/components/Form/Inputs/Toggles.js +39 -40
- package/dist/components/Form/Inputs/index.js +2 -13
- package/dist/components/MaterialUI/DataDisplay/PredefinedElements/Placeholder.js +31 -11
- package/dist/components/MaterialUI/DataDisplay/PredefinedElements/SectionToolbar.js +89 -0
- package/dist/components/MaterialUI/DataDisplay/Table.js +109 -18
- package/dist/components/MaterialUI/DataDisplay/TableProps.js +5 -1
- package/dist/components/MaterialUI/DataDisplay/TableWithInMemoryPaging.js +198 -0
- package/dist/components/MaterialUI/DataDisplay/TooltippedElements/MultipleLinesText.js +4 -1
- package/dist/components/MaterialUI/Inputs/DatePicker.js +14 -14
- package/dist/components/MaterialUI/Inputs/PredefinedElements/SearchControl.js +1 -0
- package/dist/components/MaterialUI/Inputs/Select.js +2 -0
- package/dist/components/MaterialUI/Inputs/SelectProps.js +2 -0
- package/dist/components/MaterialUI/Inputs/Switch.js +17 -1
- package/dist/components/MaterialUI/Inputs/SwitchProps.js +2 -0
- package/dist/components/MaterialUI/Inputs/TimePicker.js +14 -21
- package/dist/components/MaterialUI/hocs/withDeferredTooltip.js +3 -1
- package/dist/components/MaterialUI/muiThemes.js +2 -1
- package/dist/components/Provision.js +1 -1
- package/dist/constants.js +2 -1
- package/dist/content/iconsSheet.svg +740 -116
- package/dist/hocs/withScrollBox.js +27 -12
- package/dist/hooks/useDaysAndMonthsLocalization.js +77 -0
- package/dist/hooks/useInMemoryPaging.js +135 -0
- package/dist/hooks/useMultipleFieldEditState.js +12 -3
- package/dist/reducers/metadata.js +6 -0
- package/dist/schemas/metadata.js +9 -1
- package/dist/selectors/locale.js +1 -0
- package/dist/selectors/metadata.js +14 -11
- package/dist/sharedMessages.js +184 -0
- package/dist/utils/ListHelper.js +271 -0
- package/dist/utils/comparisonHelper.js +185 -0
- package/dist/utils/propertyBagHelper.js +3 -1
- package/dist/utils/timezoneHelper.js +18 -31
- package/package.json +4 -3
- package/src/actions/metadata.js +11 -0
- package/src/actions/metadata.test.js +27 -0
- package/src/actions/requestsApi.js +6 -0
- package/src/components/AppFrame/About.js +97 -117
- package/src/components/AppFrame/About.test.js +128 -90
- package/src/components/AppFrame/Anchor.js +34 -36
- package/src/components/AppFrame/Anchor.test.js +5 -68
- package/src/components/AppFrame/AppFrame.js +31 -40
- package/src/components/AppFrame/AppFrame.test.js +424 -445
- package/src/components/AppFrame/Help.js +23 -20
- package/src/components/AppFrame/Help.test.js +3 -3
- package/src/components/AppFrame/MenuItem.js +106 -126
- package/src/components/AppFrame/MenuItem.test.js +78 -169
- package/src/components/AppFrame/Preferences.js +110 -98
- package/src/components/AppFrame/Preferences.test.js +115 -219
- package/src/components/AppFrame/Sidebar.js +39 -41
- package/src/components/AppFrame/Sidebar.test.js +88 -168
- package/src/components/AppFrame/Topbar.js +59 -52
- package/src/components/AppFrame/Topbar.test.js +31 -39
- package/src/components/ColumnWrapper.js +18 -9
- package/src/components/Culture.js +20 -10
- package/src/components/Culture.test.js +27 -16
- package/src/components/DropMenu/DropMenu.test.js +185 -224
- package/src/components/DropMenu/Menu.js +73 -80
- package/src/components/DropMenu/Menu.test.js +35 -86
- package/src/components/DropMenu/index.js +19 -15
- package/src/components/Form/Combination.js +35 -28
- package/src/components/Form/Combination.test.js +6 -19
- package/src/components/Form/Field.js +53 -66
- package/src/components/Form/Field.test.js +29 -51
- package/src/components/Form/FieldElements.js +0 -14
- package/src/components/Form/FieldElements.test.js +104 -111
- package/src/components/Form/Fieldset.js +42 -37
- package/src/components/Form/Fieldset.test.js +14 -7
- package/src/components/Form/Form.js +11 -7
- package/src/components/Form/Form.test.js +75 -56
- package/src/components/Form/FormElement.js +24 -16
- package/src/components/Form/InputField.test.js +24 -30
- package/src/components/Form/Inputs/Button.js +58 -14
- package/src/components/Form/Inputs/Button.test.js +32 -7
- package/src/components/Form/Inputs/Inputs.test.js +0 -7
- package/src/components/Form/Inputs/ReadOnly.js +34 -28
- package/src/components/Form/Inputs/ReadOnly.test.js +45 -7
- package/src/components/Form/Inputs/Selector.js +22 -0
- package/src/components/Form/Inputs/Selector.test.js +105 -0
- package/src/components/Form/Inputs/Text.js +15 -44
- package/src/components/Form/Inputs/Text.test.js +20 -29
- package/src/components/Form/Inputs/Toggles.js +27 -26
- package/src/components/Form/Inputs/Toggles.test.js +22 -28
- package/src/components/Form/Inputs/index.js +4 -15
- package/src/components/MaterialUI/DataDisplay/PredefinedElements/InformationItem.test.js +1 -4
- package/src/components/MaterialUI/DataDisplay/PredefinedElements/Placeholder.js +32 -6
- package/src/components/MaterialUI/DataDisplay/PredefinedElements/Placeholder.test.js +3 -1
- package/src/components/MaterialUI/DataDisplay/PredefinedElements/SectionToolbar.js +39 -0
- package/src/components/MaterialUI/DataDisplay/Table.js +190 -114
- package/src/components/MaterialUI/DataDisplay/Table.test.js +246 -1
- package/src/components/MaterialUI/DataDisplay/TableProps.js +4 -0
- package/src/components/MaterialUI/DataDisplay/TableProps.test.js +2 -0
- package/src/components/MaterialUI/DataDisplay/TableWithInMemoryPaging.js +145 -0
- package/src/components/MaterialUI/DataDisplay/TableWithInMemoryPaging.test.js +457 -0
- package/src/components/MaterialUI/DataDisplay/TooltippedElements/MultipleLinesText.js +5 -1
- package/src/components/MaterialUI/DataDisplay/TooltippedElements/MultipleLinesText.test.js +7 -1
- package/src/components/MaterialUI/Inputs/DatePicker.js +19 -20
- package/src/components/MaterialUI/Inputs/DatePicker.test.js +11 -6
- package/src/components/MaterialUI/Inputs/PredefinedElements/SearchControl.js +1 -0
- package/src/components/MaterialUI/Inputs/Select.js +2 -0
- package/src/components/MaterialUI/Inputs/SelectProps.js +2 -0
- package/src/components/MaterialUI/Inputs/SelectProps.test.js +2 -0
- package/src/components/MaterialUI/Inputs/Switch.js +22 -1
- package/src/components/MaterialUI/Inputs/Switch.test.js +23 -0
- package/src/components/MaterialUI/Inputs/SwitchProps.js +2 -0
- package/src/components/MaterialUI/Inputs/SwitchProps.test.js +2 -0
- package/src/components/MaterialUI/Inputs/TimePicker.js +10 -19
- package/src/components/MaterialUI/Inputs/TimePicker.test.js +278 -117
- package/src/components/MaterialUI/hocs/withDeferredTooltip.js +4 -1
- package/src/components/MaterialUI/hocs/withDeferredTooltip.test.js +27 -0
- package/src/components/MaterialUI/muiThemes.js +1 -0
- package/src/components/Navigation/Bar.test.js +92 -87
- package/src/components/Provision.js +1 -1
- package/src/components/TaskDetailsModal.test.js +1 -3
- package/src/constants.js +1 -0
- package/src/content/iconsSheet.svg +740 -116
- package/src/hocs/withScrollBox.js +32 -19
- package/src/hocs/withScrollBox.test.js +15 -3
- package/src/hooks/useDaysAndMonthsLocalization.js +79 -0
- package/src/hooks/useDaysAndMonthsLocalization.test.js +107 -0
- package/src/hooks/useInMemoryPaging.js +78 -0
- package/src/hooks/useInMemoryPaging.test.js +515 -0
- package/src/hooks/useMultipleFieldEditState.js +11 -4
- package/src/hooks/useMultipleFieldEditState.test.js +49 -1
- package/src/reducers/metadata.js +6 -1
- package/src/reducers/metadata.test.js +31 -0
- package/src/requests +1 -0
- package/src/schemas/metadata.js +3 -0
- package/src/selectors/locale.js +1 -1
- package/src/selectors/metadata.js +12 -9
- package/src/selectors/metadata.test.js +92 -11
- package/src/sharedMessages.js +184 -0
- package/src/timezones.json +883 -0
- package/src/translations/en-US.json +46 -0
- package/src/translations/fr-CA.json +46 -0
- package/src/utils/ListHelper.js +203 -0
- package/src/utils/ListHelper.test.js +710 -0
- package/src/utils/comparisonHelper.js +135 -0
- package/src/utils/comparisonHelper.test.js +334 -0
- package/src/utils/propertyBagHelper.js +2 -0
- package/src/utils/propertyBagHelper.test.js +6 -0
- package/src/utils/timezoneHelper.js +10 -135
- package/src/utils/timezoneHelper.test.js +7 -7
- package/dist/components/Form/FieldList.js +0 -270
- package/dist/components/Form/Inputs/FieldButtons.js +0 -66
- package/dist/components/Form/Inputs/Number.js +0 -117
- package/dist/components/Form/Inputs/SmallButton.js +0 -91
- package/dist/components/Form/Inputs/Time.js +0 -86
- package/dist/components/Form/Inputs/Translation.js +0 -169
- package/src/components/AppFrame/ApplicationSelector/Header.js +0 -34
- package/src/components/AppFrame/ApplicationSelector/Header.test.js +0 -23
- package/src/components/Form/FieldList.js +0 -210
- package/src/components/Form/FieldList.test.js +0 -558
- package/src/components/Form/Inputs/FieldButtons.js +0 -90
- package/src/components/Form/Inputs/Number.js +0 -60
- package/src/components/Form/Inputs/Number.test.js +0 -435
- package/src/components/Form/Inputs/SmallButton.js +0 -37
- package/src/components/Form/Inputs/SmallButton.test.js +0 -65
- package/src/components/Form/Inputs/Time.js +0 -32
- package/src/components/Form/Inputs/Time.test.js +0 -41
- package/src/components/Form/Inputs/Translation.js +0 -93
- package/src/components/Form/Inputs/Translation.test.js +0 -204
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import Immutable from "immutable";
|
|
3
|
-
import { Provider } from "react-redux";
|
|
4
|
-
import { IntlProvider } from "react-intl";
|
|
5
3
|
import { RSAA } from "redux-api-middleware";
|
|
6
4
|
import sinon from "sinon";
|
|
7
5
|
import { Ignore } from "unexpected-reaction";
|
|
8
|
-
import { getStyledClassSelector } from "../../utils/testUtils";
|
|
9
6
|
import { CHANGE_LOCALE } from "../../actions/locale";
|
|
10
7
|
import {
|
|
11
8
|
SET_DEFAULT_LANGUAGE_REQUEST,
|
|
@@ -18,22 +15,13 @@ import {
|
|
|
18
15
|
SET_MY_APPLICATION_FAILURE,
|
|
19
16
|
} from "../../actions/applications";
|
|
20
17
|
import { setValue } from "../../actions/view";
|
|
21
|
-
import {
|
|
22
|
-
import { Wrapper as SelectorWrapper } from "../Selector";
|
|
23
|
-
import Preferences, {
|
|
24
|
-
Header,
|
|
25
|
-
PrefForm,
|
|
26
|
-
Footer,
|
|
27
|
-
PrefButton,
|
|
28
|
-
createGetUpdater,
|
|
29
|
-
Wrapper,
|
|
30
|
-
PREFS_NAME,
|
|
31
|
-
clickOutsideHandler,
|
|
32
|
-
} from "./Preferences";
|
|
18
|
+
import Preferences, { PREFS_NAME, clickOutsideHandler, stateEventUpdater } from "./Preferences";
|
|
33
19
|
import { RESET_VERSION_INFO } from "../../actions/versionInfo";
|
|
34
|
-
import { extractMessages } from "./../../utils/testUtils";
|
|
20
|
+
import { extractMessages, TestWrapper } from "./../../utils/testUtils";
|
|
35
21
|
import sharedMessages from "./../../sharedMessages";
|
|
36
22
|
import { stringifyWithoutQuotes } from "./../../utils/parseHelper";
|
|
23
|
+
import InformationItem from "../MaterialUI/DataDisplay/PredefinedElements/InformationItem";
|
|
24
|
+
import Button from "@material-ui/core/Button";
|
|
37
25
|
|
|
38
26
|
const messages = extractMessages(sharedMessages);
|
|
39
27
|
|
|
@@ -151,11 +139,9 @@ describe("Preferences", () => {
|
|
|
151
139
|
|
|
152
140
|
it("renders a form dialog", () => {
|
|
153
141
|
return expect(
|
|
154
|
-
<
|
|
155
|
-
<
|
|
156
|
-
|
|
157
|
-
</IntlProvider>
|
|
158
|
-
</Provider>,
|
|
142
|
+
<TestWrapper provider={{ store }} intlProvider={{ messages }} stylesProvider>
|
|
143
|
+
<Preferences />
|
|
144
|
+
</TestWrapper>,
|
|
159
145
|
"when mounted",
|
|
160
146
|
"to satisfy",
|
|
161
147
|
null,
|
|
@@ -166,48 +152,34 @@ describe("Preferences", () => {
|
|
|
166
152
|
"with event",
|
|
167
153
|
{
|
|
168
154
|
type: "click",
|
|
169
|
-
target:
|
|
155
|
+
target: "#savePrefs",
|
|
170
156
|
},
|
|
171
157
|
"to satisfy",
|
|
172
|
-
<
|
|
158
|
+
<TestWrapper provider={{ store }} intlProvider={{ messages }} stylesProvider>
|
|
173
159
|
<div>
|
|
174
|
-
<
|
|
175
|
-
<
|
|
176
|
-
|
|
177
|
-
<
|
|
178
|
-
<
|
|
179
|
-
<SelectorWrapper>
|
|
180
|
-
<select id="language" value="en-US" onChange={() => {}}>
|
|
181
|
-
<option>English</option>
|
|
182
|
-
<option>EnglishCa</option>
|
|
183
|
-
<option>Francais</option>
|
|
184
|
-
<option>Francais-Qc</option>
|
|
185
|
-
</select>
|
|
186
|
-
<Ignore />
|
|
160
|
+
<div>
|
|
161
|
+
<div>
|
|
162
|
+
<div>{stringifyWithoutQuotes(messages["orc-shared.preferences"])}</div>
|
|
163
|
+
<div>
|
|
164
|
+
<InformationItem label={sharedMessages.displayLanguage}>
|
|
187
165
|
<Ignore />
|
|
188
|
-
</
|
|
189
|
-
|
|
190
|
-
<FieldBox>
|
|
191
|
-
<Label id="application_label">{stringifyWithoutQuotes(messages["orc-shared.defaultApp"])}</Label>
|
|
192
|
-
<SelectorWrapper>
|
|
193
|
-
<select id="application" value={4} onChange={() => {}}>
|
|
194
|
-
<option>Marketing Legacy</option>
|
|
195
|
-
<option>Product Information</option>
|
|
196
|
-
</select>
|
|
166
|
+
</InformationItem>
|
|
167
|
+
<InformationItem label={sharedMessages.defaultApp}>
|
|
197
168
|
<Ignore />
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
169
|
+
</InformationItem>
|
|
170
|
+
</div>
|
|
171
|
+
<div>
|
|
172
|
+
<Button id="cancelPrefs" variant="outlined">
|
|
173
|
+
{stringifyWithoutQuotes(messages["orc-shared.cancel"])}
|
|
174
|
+
</Button>
|
|
175
|
+
<Button id="savePrefs" variant="outlined" color="primary">
|
|
176
|
+
{stringifyWithoutQuotes(messages["orc-shared.save"])}
|
|
177
|
+
</Button>
|
|
178
|
+
</div>
|
|
179
|
+
</div>
|
|
180
|
+
</div>
|
|
209
181
|
</div>
|
|
210
|
-
</
|
|
182
|
+
</TestWrapper>,
|
|
211
183
|
),
|
|
212
184
|
)
|
|
213
185
|
.then(() =>
|
|
@@ -222,11 +194,9 @@ describe("Preferences", () => {
|
|
|
222
194
|
it("shows view state fields, saves language change", () => {
|
|
223
195
|
state = state.setIn(["view", PREFS_NAME], Immutable.fromJS({ show: true, language: "fr-CA" }));
|
|
224
196
|
return expect(
|
|
225
|
-
<
|
|
226
|
-
<
|
|
227
|
-
|
|
228
|
-
</IntlProvider>
|
|
229
|
-
</Provider>,
|
|
197
|
+
<TestWrapper provider={{ store }} intlProvider={{ messages }} stylesProvider>
|
|
198
|
+
<Preferences />
|
|
199
|
+
</TestWrapper>,
|
|
230
200
|
"when mounted",
|
|
231
201
|
"to satisfy",
|
|
232
202
|
null,
|
|
@@ -237,43 +207,27 @@ describe("Preferences", () => {
|
|
|
237
207
|
"with event",
|
|
238
208
|
{
|
|
239
209
|
type: "click",
|
|
240
|
-
target:
|
|
210
|
+
target: "#savePrefs",
|
|
241
211
|
},
|
|
242
212
|
"to satisfy",
|
|
243
|
-
<
|
|
213
|
+
<TestWrapper provider={{ store }} intlProvider={{ messages }} stylesProvider>
|
|
244
214
|
<div>
|
|
245
|
-
<
|
|
246
|
-
<
|
|
247
|
-
|
|
248
|
-
<
|
|
249
|
-
<
|
|
250
|
-
<SelectorWrapper>
|
|
251
|
-
<select id="language" value="fr-CA" onChange={() => {}}>
|
|
252
|
-
<option>English</option>
|
|
253
|
-
<option>EnglishCa</option>
|
|
254
|
-
<option>Francais</option>
|
|
255
|
-
<option>Francais-Qc</option>
|
|
256
|
-
</select>
|
|
257
|
-
<Ignore />
|
|
215
|
+
<div>
|
|
216
|
+
<div>
|
|
217
|
+
<Ignore />
|
|
218
|
+
<div>
|
|
219
|
+
<InformationItem label={sharedMessages.displayLanguage}>
|
|
258
220
|
<Ignore />
|
|
259
|
-
</
|
|
260
|
-
|
|
261
|
-
<FieldBox>
|
|
262
|
-
<Label id="application_label">{stringifyWithoutQuotes(messages["orc-shared.defaultApp"])}</Label>
|
|
263
|
-
<SelectorWrapper>
|
|
264
|
-
<select id="application" value={4} onChange={() => {}}>
|
|
265
|
-
<option>Marketing Legacy</option>
|
|
266
|
-
<option>Product Information</option>
|
|
267
|
-
</select>
|
|
221
|
+
</InformationItem>
|
|
222
|
+
<InformationItem label={sharedMessages.defaultApp}>
|
|
268
223
|
<Ignore />
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
</
|
|
273
|
-
|
|
274
|
-
</Wrapper>
|
|
224
|
+
</InformationItem>
|
|
225
|
+
</div>
|
|
226
|
+
<Ignore />
|
|
227
|
+
</div>
|
|
228
|
+
</div>
|
|
275
229
|
</div>
|
|
276
|
-
</
|
|
230
|
+
</TestWrapper>,
|
|
277
231
|
),
|
|
278
232
|
)
|
|
279
233
|
.then(() =>
|
|
@@ -351,11 +305,9 @@ describe("Preferences", () => {
|
|
|
351
305
|
it("shows view state fields, saves application change", () => {
|
|
352
306
|
state = state.setIn(["view", PREFS_NAME], Immutable.fromJS({ show: true, application: 3 }));
|
|
353
307
|
return expect(
|
|
354
|
-
<
|
|
355
|
-
<
|
|
356
|
-
|
|
357
|
-
</IntlProvider>
|
|
358
|
-
</Provider>,
|
|
308
|
+
<TestWrapper provider={{ store }} intlProvider={{ messages }} stylesProvider>
|
|
309
|
+
<Preferences />
|
|
310
|
+
</TestWrapper>,
|
|
359
311
|
"when mounted",
|
|
360
312
|
"to satisfy",
|
|
361
313
|
null,
|
|
@@ -366,43 +318,27 @@ describe("Preferences", () => {
|
|
|
366
318
|
"with event",
|
|
367
319
|
{
|
|
368
320
|
type: "click",
|
|
369
|
-
target:
|
|
321
|
+
target: "#savePrefs",
|
|
370
322
|
},
|
|
371
323
|
"to satisfy",
|
|
372
|
-
<
|
|
324
|
+
<TestWrapper provider={{ store }} intlProvider={{ messages }} stylesProvider>
|
|
373
325
|
<div>
|
|
374
|
-
<
|
|
375
|
-
<
|
|
376
|
-
|
|
377
|
-
<
|
|
378
|
-
<
|
|
379
|
-
<SelectorWrapper>
|
|
380
|
-
<select id="language" value="en-US" onChange={() => {}}>
|
|
381
|
-
<option>English</option>
|
|
382
|
-
<option>EnglishCa</option>
|
|
383
|
-
<option>Francais</option>
|
|
384
|
-
<option>Francais-Qc</option>
|
|
385
|
-
</select>
|
|
386
|
-
<Ignore />
|
|
387
|
-
<Ignore />
|
|
388
|
-
</SelectorWrapper>
|
|
389
|
-
</FieldBox>
|
|
390
|
-
<FieldBox>
|
|
391
|
-
<Label id="application_label">{stringifyWithoutQuotes(messages["orc-shared.defaultApp"])}</Label>
|
|
392
|
-
<SelectorWrapper>
|
|
393
|
-
<select id="application" value={3} onChange={() => {}}>
|
|
394
|
-
<option>Marketing Legacy</option>
|
|
395
|
-
<option>Product Information</option>
|
|
396
|
-
</select>
|
|
326
|
+
<div>
|
|
327
|
+
<div>
|
|
328
|
+
<Ignore />
|
|
329
|
+
<div>
|
|
330
|
+
<InformationItem label={sharedMessages.displayLanguage}>
|
|
397
331
|
<Ignore />
|
|
332
|
+
</InformationItem>
|
|
333
|
+
<InformationItem label={sharedMessages.defaultApp}>
|
|
398
334
|
<Ignore />
|
|
399
|
-
</
|
|
400
|
-
</
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
</
|
|
335
|
+
</InformationItem>
|
|
336
|
+
</div>
|
|
337
|
+
<Ignore />
|
|
338
|
+
</div>
|
|
339
|
+
</div>
|
|
404
340
|
</div>
|
|
405
|
-
</
|
|
341
|
+
</TestWrapper>,
|
|
406
342
|
),
|
|
407
343
|
)
|
|
408
344
|
.then(() =>
|
|
@@ -444,11 +380,9 @@ describe("Preferences", () => {
|
|
|
444
380
|
it("clears and closes", () => {
|
|
445
381
|
state = state.setIn(["view", PREFS_NAME], Immutable.fromJS({ show: true, language: "fr-CA", application: 3 }));
|
|
446
382
|
return expect(
|
|
447
|
-
<
|
|
448
|
-
<
|
|
449
|
-
|
|
450
|
-
</IntlProvider>
|
|
451
|
-
</Provider>,
|
|
383
|
+
<TestWrapper provider={{ store }} intlProvider={{ messages }} stylesProvider>
|
|
384
|
+
<Preferences />
|
|
385
|
+
</TestWrapper>,
|
|
452
386
|
"when mounted",
|
|
453
387
|
"to satisfy",
|
|
454
388
|
null,
|
|
@@ -459,43 +393,27 @@ describe("Preferences", () => {
|
|
|
459
393
|
"with event",
|
|
460
394
|
{
|
|
461
395
|
type: "click",
|
|
462
|
-
target:
|
|
396
|
+
target: "#cancelPrefs",
|
|
463
397
|
},
|
|
464
398
|
"to satisfy",
|
|
465
|
-
<
|
|
399
|
+
<TestWrapper provider={{ store }} intlProvider={{ messages }} stylesProvider>
|
|
466
400
|
<div>
|
|
467
|
-
<
|
|
468
|
-
<
|
|
469
|
-
|
|
470
|
-
<
|
|
471
|
-
<
|
|
472
|
-
<SelectorWrapper>
|
|
473
|
-
<select id="language" value="fr-CA" onChange={() => {}}>
|
|
474
|
-
<option>English</option>
|
|
475
|
-
<option>EnglishCa</option>
|
|
476
|
-
<option>Francais</option>
|
|
477
|
-
<option>Francais-Qc</option>
|
|
478
|
-
</select>
|
|
401
|
+
<div>
|
|
402
|
+
<div>
|
|
403
|
+
<Ignore />
|
|
404
|
+
<div>
|
|
405
|
+
<InformationItem label={sharedMessages.displayLanguage}>
|
|
479
406
|
<Ignore />
|
|
407
|
+
</InformationItem>
|
|
408
|
+
<InformationItem label={sharedMessages.defaultApp}>
|
|
480
409
|
<Ignore />
|
|
481
|
-
</
|
|
482
|
-
</
|
|
483
|
-
<
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
<select id="application" value={3} onChange={() => {}}>
|
|
487
|
-
<option>Marketing Legacy</option>
|
|
488
|
-
<option>Product Information</option>
|
|
489
|
-
</select>
|
|
490
|
-
<Ignore />
|
|
491
|
-
<Ignore />
|
|
492
|
-
</SelectorWrapper>
|
|
493
|
-
</FieldBox>
|
|
494
|
-
</PrefForm>
|
|
495
|
-
<Ignore />
|
|
496
|
-
</Wrapper>
|
|
410
|
+
</InformationItem>
|
|
411
|
+
</div>
|
|
412
|
+
<Ignore />
|
|
413
|
+
</div>
|
|
414
|
+
</div>
|
|
497
415
|
</div>
|
|
498
|
-
</
|
|
416
|
+
</TestWrapper>,
|
|
499
417
|
),
|
|
500
418
|
)
|
|
501
419
|
.then(() =>
|
|
@@ -518,11 +436,9 @@ describe("Preferences", () => {
|
|
|
518
436
|
.deleteIn(["locale", "defaultCulture"])
|
|
519
437
|
.deleteIn(["settings", "defaultApp"]);
|
|
520
438
|
expect(
|
|
521
|
-
<
|
|
522
|
-
<
|
|
523
|
-
|
|
524
|
-
</IntlProvider>
|
|
525
|
-
</Provider>,
|
|
439
|
+
<TestWrapper provider={{ store }} intlProvider={{ messages }} stylesProvider>
|
|
440
|
+
<Preferences />
|
|
441
|
+
</TestWrapper>,
|
|
526
442
|
"when mounted",
|
|
527
443
|
"to satisfy",
|
|
528
444
|
null,
|
|
@@ -530,66 +446,46 @@ describe("Preferences", () => {
|
|
|
530
446
|
expect(
|
|
531
447
|
modalRoot,
|
|
532
448
|
"to satisfy",
|
|
533
|
-
<
|
|
449
|
+
<TestWrapper provider={{ store }} intlProvider={{ messages }} stylesProvider>
|
|
534
450
|
<div>
|
|
535
|
-
<
|
|
536
|
-
<
|
|
537
|
-
|
|
538
|
-
<
|
|
539
|
-
<
|
|
540
|
-
<SelectorWrapper>
|
|
541
|
-
<select id="language" value="" onChange={() => {}}>
|
|
542
|
-
<option>English</option>
|
|
543
|
-
<option>EnglishCa</option>
|
|
544
|
-
<option>Francais</option>
|
|
545
|
-
<option>Francais-Qc</option>
|
|
546
|
-
</select>
|
|
547
|
-
<Ignore />
|
|
548
|
-
<Ignore />
|
|
549
|
-
</SelectorWrapper>
|
|
550
|
-
</FieldBox>
|
|
551
|
-
<FieldBox>
|
|
552
|
-
<Label id="application_label">{stringifyWithoutQuotes(messages["orc-shared.defaultApp"])}</Label>
|
|
553
|
-
<SelectorWrapper>
|
|
554
|
-
<select id="application" value="" onChange={() => {}}>
|
|
555
|
-
<option>Marketing Legacy</option>
|
|
556
|
-
<option>Product Information</option>
|
|
557
|
-
</select>
|
|
451
|
+
<div>
|
|
452
|
+
<div>
|
|
453
|
+
<Ignore />
|
|
454
|
+
<div>
|
|
455
|
+
<InformationItem label={sharedMessages.displayLanguage}>
|
|
558
456
|
<Ignore />
|
|
457
|
+
</InformationItem>
|
|
458
|
+
<InformationItem label={sharedMessages.defaultApp}>
|
|
559
459
|
<Ignore />
|
|
560
|
-
</
|
|
561
|
-
</
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
</
|
|
460
|
+
</InformationItem>
|
|
461
|
+
</div>
|
|
462
|
+
<Ignore />
|
|
463
|
+
</div>
|
|
464
|
+
</div>
|
|
565
465
|
</div>
|
|
566
|
-
</
|
|
466
|
+
</TestWrapper>,
|
|
567
467
|
),
|
|
568
468
|
);
|
|
569
469
|
});
|
|
570
470
|
|
|
571
|
-
describe("
|
|
572
|
-
let update
|
|
471
|
+
describe("stateEventUpdater", () => {
|
|
472
|
+
let update;
|
|
573
473
|
beforeEach(() => {
|
|
574
474
|
update = sinon.spy().named("update");
|
|
575
|
-
update2 = () => {};
|
|
576
475
|
});
|
|
577
|
-
it("returns an update function", () =>
|
|
578
|
-
expect(createGetUpdater, "when called with", [update], "called with", ["testField"], "called with", [
|
|
579
|
-
"testValue",
|
|
580
|
-
]).then(() => expect(update, "to have calls satisfying", [{ args: ["testField", "testValue"] }])));
|
|
581
476
|
|
|
582
|
-
it("
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
477
|
+
it("creates a handler for an event and calls update with the value of the target", () =>
|
|
478
|
+
expect(stateEventUpdater, "called with", [update, "application"], "called with", ["foo"]).then(() =>
|
|
479
|
+
expect(update, "to have calls satisfying", [{ args: ["application", "foo"] }]),
|
|
480
|
+
));
|
|
481
|
+
|
|
482
|
+
it("is memoized", () =>
|
|
483
|
+
expect(
|
|
484
|
+
stateEventUpdater,
|
|
485
|
+
"called with",
|
|
486
|
+
[update, "application"],
|
|
487
|
+
"to be",
|
|
488
|
+
stateEventUpdater(update, "application"),
|
|
489
|
+
));
|
|
594
490
|
});
|
|
595
491
|
});
|
|
@@ -1,34 +1,36 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { useSelector } from "react-redux";
|
|
3
|
-
import
|
|
3
|
+
import { makeStyles } from "@material-ui/core/styles";
|
|
4
4
|
import { useLocation } from "react-router-dom";
|
|
5
|
-
import { getThemeProp } from "../../utils";
|
|
6
5
|
import { selectPrependHrefConfig } from "../../selectors/navigation";
|
|
7
6
|
import MenuItem from "./MenuItem";
|
|
8
7
|
import { getScopeModuleInformationSelector } from "../../selectors/modules";
|
|
9
8
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
9
|
+
const useStyles = makeStyles(theme => ({
|
|
10
|
+
bar: {
|
|
11
|
+
boxSizing: "border-box",
|
|
12
|
+
paddingTop: "60px",
|
|
13
|
+
height: "calc(100% - 40px)",
|
|
14
|
+
width: "200px",
|
|
15
|
+
display: "flex",
|
|
16
|
+
flexDirection: "column",
|
|
17
|
+
justifyContent: "flex-start",
|
|
18
|
+
color: theme.palette.text.hint,
|
|
19
|
+
},
|
|
20
|
+
logoSvg: {
|
|
21
|
+
flex: "0 0 auto",
|
|
22
|
+
margin: "auto 12.5px 7px",
|
|
23
|
+
height: "25px",
|
|
24
|
+
width: "25px",
|
|
25
|
+
fillRule: "evenodd",
|
|
26
|
+
clipRule: "evenodd",
|
|
27
|
+
fill: "#666666",
|
|
28
|
+
},
|
|
29
|
+
}));
|
|
20
30
|
|
|
21
|
-
export const MenuToggle =
|
|
22
|
-
<MenuItem
|
|
23
|
-
|
|
24
|
-
menuToggle
|
|
25
|
-
open={open}
|
|
26
|
-
icon={(open ? getThemeProp(["icons", "sidebarOpen"], "layers") : getThemeProp(["icons", "sidebarClosed"], "menu"))({
|
|
27
|
-
theme,
|
|
28
|
-
})}
|
|
29
|
-
onClick={toggle}
|
|
30
|
-
/>
|
|
31
|
-
));
|
|
31
|
+
export const MenuToggle = ({ open, toggle }) => (
|
|
32
|
+
<MenuItem id="sidebarMenuToggle" menuToggle open={open} icon={open ? "collapse" : "expand"} onClick={toggle} />
|
|
33
|
+
);
|
|
32
34
|
|
|
33
35
|
const useEnhancement = id => {
|
|
34
36
|
const location = useLocation();
|
|
@@ -49,27 +51,23 @@ export const EnhancedMenuItem = ({ id, ...props }) => {
|
|
|
49
51
|
return <MenuItem {...props} {...useEnhancement(id)} isHidden={isHidden} />;
|
|
50
52
|
};
|
|
51
53
|
|
|
52
|
-
const
|
|
53
|
-
|
|
54
|
-
margin: auto 12.5px 7px;
|
|
55
|
-
height: 25px;
|
|
56
|
-
width: 25px;
|
|
57
|
-
fill-rule: evenodd;
|
|
58
|
-
clip-rule: evenodd;
|
|
59
|
-
fill: #666666;
|
|
60
|
-
`;
|
|
54
|
+
export const Logo = () => {
|
|
55
|
+
const classes = useStyles();
|
|
61
56
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
);
|
|
57
|
+
return (
|
|
58
|
+
<svg viewBox="0 0 354 354" className={classes.logoSvg}>
|
|
59
|
+
<g>
|
|
60
|
+
<path d="M0 241.41c0-65.49 50.53-111.98 119.66-111.98s119.25 46.49 119.25 111.98c0 65.49-50.13 111.97-119.25 111.97S0 306.9 0 241.41Zm175.04 0c0-37.6-23.85-60.23-55.38-60.23s-55.79 22.64-55.79 60.23c0 37.59 24.26 60.23 55.79 60.23 31.53 0 55.38-22.64 55.38-60.23Zm178.1-76.35h-77.48c0-48.29-39.29-87.58-87.58-87.58V0c91.02 0 165.07 74.05 165.07 165.06h-.01Z" />
|
|
61
|
+
</g>
|
|
62
|
+
</svg>
|
|
63
|
+
);
|
|
64
|
+
};
|
|
69
65
|
|
|
70
66
|
const Sidebar = ({ open, toggle, modules = [], activeModules = [] }) => {
|
|
67
|
+
const classes = useStyles();
|
|
68
|
+
|
|
71
69
|
return (
|
|
72
|
-
<
|
|
70
|
+
<div open={open} className={classes.bar}>
|
|
73
71
|
<MenuToggle open={open} toggle={toggle} />
|
|
74
72
|
{modules.map(item => (
|
|
75
73
|
<EnhancedMenuItem
|
|
@@ -81,7 +79,7 @@ const Sidebar = ({ open, toggle, modules = [], activeModules = [] }) => {
|
|
|
81
79
|
/>
|
|
82
80
|
))}
|
|
83
81
|
<Logo />
|
|
84
|
-
</
|
|
82
|
+
</div>
|
|
85
83
|
);
|
|
86
84
|
};
|
|
87
85
|
|