orc-shared 1.7.0-dev.8 → 5.2.0-dev.1

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 (175) hide show
  1. package/dist/actions/modules.js +15 -1
  2. package/dist/actions/navigation.js +1 -14
  3. package/dist/actions/scopes.js +2 -3
  4. package/dist/buildStore.js +1 -7
  5. package/dist/components/AppFrame/Sidebar.js +8 -4
  6. package/dist/components/MaterialUI/DataDisplay/Notification.js +0 -6
  7. package/dist/components/MaterialUI/DataDisplay/PredefinedElements/InformationItem.js +6 -18
  8. package/dist/components/MaterialUI/DataDisplay/PredefinedElements/StepperModal.js +1 -2
  9. package/dist/components/MaterialUI/DataDisplay/TooltippedElements/MultipleLinesText.js +2 -4
  10. package/dist/components/MaterialUI/DataDisplay/tableHelpers.js +7 -7
  11. package/dist/components/MaterialUI/Inputs/Autocomplete.js +0 -5
  12. package/dist/components/MaterialUI/Inputs/DatePicker.js +8 -15
  13. package/dist/components/MaterialUI/Inputs/InputBase.js +16 -102
  14. package/dist/components/MaterialUI/Inputs/InputBaseProps.js +1 -7
  15. package/dist/components/MaterialUI/Inputs/PredefinedElements/SearchControl.js +46 -43
  16. package/dist/components/MaterialUI/Inputs/TimePicker.js +2 -5
  17. package/dist/components/MaterialUI/Navigation/DropDownMenu.js +1 -6
  18. package/dist/components/MaterialUI/Surfaces/SectionExpansionPanel.js +0 -1
  19. package/dist/components/MaterialUI/hocs/withDeferredTooltip.js +1 -3
  20. package/dist/components/Routing/Page.js +1 -4
  21. package/dist/components/Routing/SegmentPage.js +1 -4
  22. package/dist/components/Routing/SubPage.js +8 -38
  23. package/dist/components/Scope/useScopeConfirmationModalState.js +3 -1
  24. package/dist/constants.js +2 -18
  25. package/dist/content/icons/hide.svg +1 -10
  26. package/dist/content/icons/open-in-new-tab.svg +1 -3
  27. package/dist/content/iconsSheet.svg +650 -117
  28. package/dist/content/orckestra-logo-white.png +0 -0
  29. package/dist/hooks/useEditState.js +2 -4
  30. package/dist/reducers/modules.js +3 -4
  31. package/dist/reducers/navigation.js +0 -16
  32. package/dist/reducers/request.js +1 -6
  33. package/dist/reducers/scopes.js +0 -3
  34. package/dist/reducers/view.js +1 -1
  35. package/dist/selectors/authentication.js +1 -15
  36. package/dist/selectors/metadata.js +1 -1
  37. package/dist/sharedMessages.js +1 -17
  38. package/dist/utils/propertyHelper.js +0 -33
  39. package/dist/utils/timezoneHelper.js +1 -23
  40. package/package.json +7 -10
  41. package/src/actions/modules.js +10 -0
  42. package/src/actions/modules.test.js +14 -0
  43. package/src/actions/navigation.js +0 -7
  44. package/src/actions/navigation.test.js +0 -12
  45. package/src/actions/scopes.js +1 -2
  46. package/src/actions/scopes.test.js +1 -2
  47. package/src/buildStore.js +0 -6
  48. package/src/components/AppFrame/About.test.js +3 -3
  49. package/src/components/AppFrame/Sidebar.js +3 -4
  50. package/src/components/Form/InputField.test.js +0 -18
  51. package/src/components/Form/Inputs/Date.test.js +0 -18
  52. package/src/components/MaterialUI/DataDisplay/Notification.js +0 -6
  53. package/src/components/MaterialUI/DataDisplay/Notification.test.js +0 -37
  54. package/src/components/MaterialUI/DataDisplay/PredefinedElements/InformationItem.js +5 -23
  55. package/src/components/MaterialUI/DataDisplay/PredefinedElements/InformationItem.test.js +0 -121
  56. package/src/components/MaterialUI/DataDisplay/PredefinedElements/StepperModal.js +1 -2
  57. package/src/components/MaterialUI/DataDisplay/PredefinedElements/StepperModal.test.js +0 -20
  58. package/src/components/MaterialUI/DataDisplay/TooltippedElements/MultipleLinesText.js +1 -2
  59. package/src/components/MaterialUI/DataDisplay/tableHelpers.js +8 -8
  60. package/src/components/MaterialUI/DataDisplay/tableHelpers.test.js +0 -93
  61. package/src/components/MaterialUI/Inputs/Autocomplete.js +0 -5
  62. package/src/components/MaterialUI/Inputs/Autocomplete.test.js +0 -15
  63. package/src/components/MaterialUI/Inputs/DatePicker.js +3 -17
  64. package/src/components/MaterialUI/Inputs/DatePicker.test.js +1 -143
  65. package/src/components/MaterialUI/Inputs/InputBase.js +15 -103
  66. package/src/components/MaterialUI/Inputs/InputBase.test.js +1 -376
  67. package/src/components/MaterialUI/Inputs/InputBaseProps.js +0 -6
  68. package/src/components/MaterialUI/Inputs/InputBaseProps.test.js +0 -6
  69. package/src/components/MaterialUI/Inputs/PredefinedElements/SearchControl.js +27 -39
  70. package/src/components/MaterialUI/Inputs/PredefinedElements/SearchControl.test.js +34 -39
  71. package/src/components/MaterialUI/Inputs/TimePicker.js +1 -5
  72. package/src/components/MaterialUI/Navigation/DropDownMenu.js +1 -6
  73. package/src/components/MaterialUI/Surfaces/SectionExpansionPanel.js +0 -1
  74. package/src/components/MaterialUI/hocs/withDeferredTooltip.js +1 -2
  75. package/src/components/MaterialUI/hocs/withDeferredTooltip.test.js +0 -52
  76. package/src/components/Routing/Page.js +1 -12
  77. package/src/components/Routing/SegmentPage.js +1 -12
  78. package/src/components/Routing/SubPage.js +9 -41
  79. package/src/components/Routing/SubPage.test.js +1 -295
  80. package/src/components/Scope/useScopeConfirmationModalState.js +3 -1
  81. package/src/components/Scope/useScopeConfirmationModalState.test.js +35 -4
  82. package/src/components/Text.test.js +59 -44
  83. package/src/constants.js +0 -15
  84. package/src/content/icons/hide.svg +1 -10
  85. package/src/content/icons/open-in-new-tab.svg +1 -3
  86. package/src/content/iconsSheet.svg +650 -117
  87. package/src/content/orckestra-logo-white.png +0 -0
  88. package/src/hooks/useEditState.js +2 -12
  89. package/src/hooks/useEditState.test.js +1 -1
  90. package/src/hooks/useLabelMessage.test.js +10 -16
  91. package/src/reducers/modules.js +4 -4
  92. package/src/reducers/modules.test.js +5 -5
  93. package/src/reducers/navigation.js +0 -24
  94. package/src/reducers/navigation.test.js +0 -38
  95. package/src/reducers/request.js +1 -6
  96. package/src/reducers/request.test.js +0 -34
  97. package/src/reducers/scopes.js +0 -3
  98. package/src/reducers/scopes.test.js +0 -47
  99. package/src/reducers/view.js +1 -1
  100. package/src/reducers/view.test.js +8 -1
  101. package/src/selectors/authentication.js +0 -13
  102. package/src/selectors/authentication.test.js +0 -322
  103. package/src/selectors/metadata.js +1 -1
  104. package/src/selectors/metadata.test.js +0 -12
  105. package/src/sharedMessages.js +1 -17
  106. package/src/translations/en-US.json +12 -16
  107. package/src/translations/fr-CA.json +12 -16
  108. package/src/utils/propertyHelper.js +0 -38
  109. package/src/utils/propertyHelper.test.js +0 -160
  110. package/src/utils/timezoneHelper.js +0 -18
  111. package/src/utils/timezoneHelper.test.js +1 -23
  112. package/dist/actions/globalErrorMessages.js +0 -63
  113. package/dist/actions/tasks.js +0 -170
  114. package/dist/components/MaterialUI/DataDisplay/PredefinedElements/GlobalErrorMessages.js +0 -160
  115. package/dist/components/MaterialUI/DataDisplay/PredefinedElements/LookupDisplayValue.js +0 -88
  116. package/dist/components/TaskDetailsModal.js +0 -191
  117. package/dist/content/icons/anonymize.svg +0 -3
  118. package/dist/content/icons/archives.svg +0 -3
  119. package/dist/content/icons/clean-index.svg +0 -3
  120. package/dist/content/icons/date-index.svg +0 -3
  121. package/dist/content/icons/inventory.svg +0 -4
  122. package/dist/content/icons/query-tester.svg +0 -10
  123. package/dist/content/icons/reciprocity.svg +0 -10
  124. package/dist/content/icons/schema.svg +0 -11
  125. package/dist/content/icons/synonyms.svg +0 -3
  126. package/dist/content/icons/tenant.svg +0 -3
  127. package/dist/content/icons/time-index.svg +0 -3
  128. package/dist/hooks/useDispatchWithErrorHandling.js +0 -103
  129. package/dist/hooks/useScopeGuardLoader.js +0 -77
  130. package/dist/reducers/globalErrorMessages.js +0 -78
  131. package/dist/reducers/scopeRouteState.js +0 -83
  132. package/dist/reducers/tasks.js +0 -98
  133. package/dist/selectors/globalErrorMessages.js +0 -57
  134. package/dist/selectors/scopeRouteState.js +0 -53
  135. package/dist/selectors/tasks.js +0 -64
  136. package/dist/utils/responseProcessingHelper.js +0 -86
  137. package/src/actions/globalErrorMessages.js +0 -12
  138. package/src/actions/globalErrorMessages.test.js +0 -21
  139. package/src/actions/tasks.js +0 -77
  140. package/src/actions/tasks.test.js +0 -169
  141. package/src/components/MaterialUI/DataDisplay/PredefinedElements/GlobalErrorMessages.js +0 -108
  142. package/src/components/MaterialUI/DataDisplay/PredefinedElements/GlobalErrorMessages.test.js +0 -468
  143. package/src/components/MaterialUI/DataDisplay/PredefinedElements/LookupDisplayValue.js +0 -29
  144. package/src/components/MaterialUI/DataDisplay/PredefinedElements/LookupDisplayValue.test.js +0 -147
  145. package/src/components/TaskDetailsModal.js +0 -132
  146. package/src/components/TaskDetailsModal.test.js +0 -317
  147. package/src/content/icons/anonymize.svg +0 -3
  148. package/src/content/icons/archives.svg +0 -3
  149. package/src/content/icons/clean-index.svg +0 -3
  150. package/src/content/icons/date-index.svg +0 -3
  151. package/src/content/icons/inventory.svg +0 -4
  152. package/src/content/icons/query-tester.svg +0 -10
  153. package/src/content/icons/reciprocity.svg +0 -10
  154. package/src/content/icons/schema.svg +0 -11
  155. package/src/content/icons/synonyms.svg +0 -3
  156. package/src/content/icons/tenant.svg +0 -3
  157. package/src/content/icons/time-index.svg +0 -3
  158. package/src/hooks/useDispatchWithErrorHandling.js +0 -57
  159. package/src/hooks/useDispatchWithErrorHandling.test.js +0 -230
  160. package/src/hooks/useScopeGuardLoader.js +0 -25
  161. package/src/hooks/useScopeGuardLoader.test.js +0 -187
  162. package/src/reducers/globalErrorMessages.js +0 -25
  163. package/src/reducers/globalErrorMessages.test.js +0 -66
  164. package/src/reducers/scopeRouteState.js +0 -29
  165. package/src/reducers/scopeRouteState.test.js +0 -49
  166. package/src/reducers/tasks.js +0 -56
  167. package/src/reducers/tasks.test.js +0 -404
  168. package/src/selectors/globalErrorMessages.js +0 -11
  169. package/src/selectors/globalErrorMessages.test.js +0 -25
  170. package/src/selectors/scopeRouteState.js +0 -5
  171. package/src/selectors/scopeRouteState.test.js +0 -13
  172. package/src/selectors/tasks.js +0 -16
  173. package/src/selectors/tasks.test.js +0 -60
  174. package/src/utils/responseProcessingHelper.js +0 -42
  175. package/src/utils/responseProcessingHelper.test.js +0 -218
@@ -15,25 +15,8 @@ describe("DatePicker", () => {
15
15
  locale: {
16
16
  locale: "en-CA",
17
17
  },
18
- metadata: {
19
- lookups: {
20
- customer: {
21
- index: {
22
- TimeZone: {
23
- values: {
24
- UTC: {
25
- value: "Eastern Standard Time",
26
- displayName: {
27
- "en-US": "Eastern Standard Time",
28
- },
29
- },
30
- },
31
- },
32
- },
33
- },
34
- },
35
- },
36
18
  });
19
+
37
20
  store = {
38
21
  subscribe: () => {},
39
22
  dispatch: () => {},
@@ -328,131 +311,6 @@ describe("DatePicker", () => {
328
311
 
329
312
  input.at(0).simulate("change", event);
330
313
  });
331
-
332
- it("should call onChange prop with timezone", () => {
333
- const onChangeMock = jest.fn();
334
- const date = new Date("2020-06-30T00:00:00");
335
- const event = {
336
- preventDefault() {},
337
- target: { value: "" },
338
- };
339
- const requestTimeZone = "Eastern Standard Time";
340
-
341
- const component = (
342
- <TestWrapper provider={{ store }} intlProvider>
343
- <DatePicker
344
- onChange={onChangeMock}
345
- value={date}
346
- useTime={true}
347
- useDate={false}
348
- showTimeSelectOnly={true}
349
- timePickerTimeZone={requestTimeZone}
350
- />
351
- </TestWrapper>
352
- );
353
- const mountedComponent = mount(component);
354
-
355
- const input = mountedComponent.find("input");
356
- input.at(0).simulate("change", event);
357
- expect(onChangeMock.mock.calls.length, "to equal", 1);
358
- });
359
-
360
- it("should call onChange prop with null timezone", () => {
361
- const onChangeMock = jest.fn();
362
- const date = new Date("2020-06-30T00:00:00");
363
- const event = {
364
- preventDefault() {},
365
- target: { value: "" },
366
- };
367
-
368
- const component = (
369
- <TestWrapper provider={{ store }} intlProvider>
370
- <DatePicker
371
- onChange={onChangeMock}
372
- value={date}
373
- useTime={true}
374
- useDate={false}
375
- showTimeSelectOnly={true}
376
- timePickerTimeZone={null}
377
- />
378
- </TestWrapper>
379
- );
380
- const mountedComponent = mount(component);
381
-
382
- const input = mountedComponent.find("input");
383
- input.at(0).simulate("change", event);
384
- expect(onChangeMock.mock.calls.length, "to equal", 1);
385
- });
386
-
387
- it("should call onChange prop with timezone without date value", () => {
388
- const onChangeMock = jest.fn();
389
- const event = {
390
- preventDefault() {},
391
- target: { value: "" },
392
- };
393
- const requestTimeZone = "Eastern Standard Time";
394
- const component = (
395
- <TestWrapper provider={{ store }} intlProvider>
396
- <DatePicker
397
- onChange={onChangeMock}
398
- useTime={true}
399
- useDate={false}
400
- showTimeSelectOnly={true}
401
- timePickerTimeZone={requestTimeZone}
402
- />
403
- </TestWrapper>
404
- );
405
- const mountedComponent = mount(component);
406
-
407
- const input = mountedComponent.find("input");
408
- input.at(0).simulate("change", event);
409
- });
410
-
411
- it("should call onChange prop with timezone and not use time", () => {
412
- const date = new Date("2020-06-30T00:00:00");
413
- const event = {
414
- preventDefault() {},
415
- target: { value: "" },
416
- };
417
- const requestTimeZone = "Eastern Standard Time";
418
- const component = (
419
- <TestWrapper provider={{ store }} intlProvider>
420
- <DatePicker value={date} useDate={false} showTimeSelectOnly={true} timePickerTimeZone={requestTimeZone} />
421
- </TestWrapper>
422
- );
423
- const mountedComponent = mount(component);
424
-
425
- const input = mountedComponent.find("input");
426
- input.at(0).simulate("change", event);
427
- });
428
-
429
- it("should call onChange prop with useTimeZone", () => {
430
- const onChangeMock = jest.fn();
431
- const date = new Date("2020-06-30T00:00:00");
432
- const event = {
433
- preventDefault() {},
434
- target: { value: "" },
435
- };
436
- const requestTimeZone = "Eastern Standard Time";
437
- const component = (
438
- <TestWrapper provider={{ store }} intlProvider>
439
- <DatePicker
440
- onChange={onChangeMock}
441
- value={date}
442
- useTime={true}
443
- useDate={false}
444
- useTimeZone={true}
445
- showTimeSelectOnly={true}
446
- timePickerTimeZone={requestTimeZone}
447
- />
448
- </TestWrapper>
449
- );
450
- const mountedComponent = mount(component);
451
-
452
- const input = mountedComponent.find("input");
453
- input.at(0).simulate("change", event);
454
- expect(onChangeMock.mock.calls.length, "to equal", 1);
455
- });
456
314
  });
457
315
 
458
316
  describe("createFormat", () => {
@@ -1,9 +1,8 @@
1
- import React, { useRef } from "react";
1
+ import React from "react";
2
2
  import { makeStyles } from "@material-ui/core/styles";
3
3
  import InputBaseMUI from "@material-ui/core/InputBase";
4
4
  import InputBaseProps, { isInputProps } from "./InputBaseProps";
5
5
  import classNames from "classnames";
6
- import { NumericFormat, numericFormatter } from "react-number-format";
7
6
 
8
7
  export const useStyles = makeStyles(theme => ({
9
8
  container: {
@@ -80,27 +79,6 @@ export const useStyles = makeStyles(theme => ({
80
79
  },
81
80
  }));
82
81
 
83
- export const AdvancedNumericInput = props => {
84
- const { inputRef, onChange, ...other } = props;
85
-
86
- // https://github.com/s-yadav/react-number-format
87
-
88
- return (
89
- <NumericFormat
90
- {...other}
91
- getInputRef={inputRef}
92
- onValueChange={values => {
93
- onChange({
94
- target: {
95
- name: props.name,
96
- value: values.value,
97
- },
98
- });
99
- }}
100
- />
101
- );
102
- };
103
-
104
82
  const InputBase = ({ inputProps }) => {
105
83
  if (isInputProps(inputProps) === false) {
106
84
  throw new TypeError("inputProps property is not of type InputBaseProps");
@@ -121,25 +99,6 @@ const InputBase = ({ inputProps }) => {
121
99
  const endAdornment = inputProps?.get(InputBaseProps.propNames.endAdornment);
122
100
  const metadata = inputProps?.get(InputBaseProps.propNames.metadata);
123
101
  const autoComplete = inputProps?.get(InputBaseProps.propNames.autoComplete);
124
- const timeoutDelay = inputProps?.get(InputBaseProps.propNames.timeoutDelay) || 100;
125
- const rowsProps = inputProps?.get(InputBaseProps.propNames.rows);
126
- const numericInputProps = inputProps?.get(InputBaseProps.propNames.numericInputProps) || null;
127
-
128
- const isAdvancedNumericInput = type.toLowerCase() === "advancednumericinput";
129
- const inputComponent = isAdvancedNumericInput ? AdvancedNumericInput : undefined;
130
- const inputControlType = isAdvancedNumericInput ? "text" : type;
131
-
132
- if (isAdvancedNumericInput && numericInputProps) {
133
- Object.keys(numericInputProps).forEach(key => {
134
- if (key !== "blurFormattingSkipFixedDecimalScale") {
135
- inputAttributes[key] = numericInputProps[key];
136
- }
137
- });
138
- }
139
-
140
- const defaultRows = 4;
141
- let rows = rowsProps;
142
- if (rows === null || rows === undefined) rows = defaultRows;
143
102
 
144
103
  const tooltipText = type === "text" ? value : "";
145
104
 
@@ -151,80 +110,34 @@ const InputBase = ({ inputProps }) => {
151
110
  const classes = useStyles({ label, errorPosition });
152
111
 
153
112
  const onChangeHandler = event => {
154
- if (event.persist) {
155
- event.persist();
156
- }
113
+ event.persist();
157
114
 
158
115
  if (!event.target.value || window.bypassDebounce === true) {
159
116
  update(event.target.value, metadata);
160
117
  }
161
- setInputText(event.target.value);
162
- };
163
-
164
- const timerId = useRef(null);
165
-
166
- React.useEffect(() => {
167
- return () => {
168
- clearTimeout(timerId.current);
169
- timerId.current = null;
170
- };
171
- }, []);
172
118
 
173
- const onBlurInternal = e => {
174
- let updateValue = (inputText ?? value).toString(); // value cannot be null as defined above
175
-
176
- if (timerId.current) {
177
- clearTimeout(timerId.current);
178
- timerId.current = null;
179
- }
180
-
181
- if (isAdvancedNumericInput) {
182
- const formattingProps = { ...numericInputProps };
183
- delete formattingProps.blurFormattingSkipFixedDecimalScale;
184
-
185
- if (numericInputProps?.blurFormattingSkipFixedDecimalScale !== true) {
186
- formattingProps.fixedDecimalScale = true;
187
- }
188
-
189
- updateValue = numericFormatter(updateValue, formattingProps);
190
- }
191
-
192
- update(updateValue, metadata);
193
- setInputText(null);
194
-
195
- if (onBlur) {
196
- onBlur(e);
197
- }
119
+ setInputText(event.target.value);
198
120
  };
199
121
 
200
122
  const inputBaseInputStyle = inputProps?.getStyle(InputBaseProps.ruleNames.input);
201
123
  const errorTextStyle = inputProps?.getStyle(InputBaseProps.ruleNames.errorText);
124
+
202
125
  const [inputText, setInputText] = React.useState(null);
126
+
203
127
  const textToDisplay = inputText ?? value;
204
128
 
205
129
  React.useEffect(() => {
206
- if (inputText === null || window.bypassDebounce === true) {
207
- return;
208
- }
209
-
210
- if (inputText !== value) {
211
- clearTimeout(timerId.current);
212
- timerId.current = setTimeout(() => {
213
- update(inputText, metadata);
130
+ if (inputText !== value && inputText != null && window.bypassDebounce !== true) {
131
+ const timeOutId = setTimeout(() => {
132
+ const updateValue = update(inputText, metadata);
214
133
  setInputText(null);
215
- }, timeoutDelay);
216
134
 
217
- return () => {
218
- clearTimeout(timerId.current);
219
- timerId.current = null;
220
- };
221
- } else {
222
- setInputText(null);
223
- clearTimeout(timerId.current);
135
+ return updateValue;
136
+ }, 100);
137
+ return () => clearTimeout(timeOutId);
224
138
  }
225
-
226
139
  // eslint-disable-next-line react-hooks/exhaustive-deps
227
- }, [inputText, metadata, timeoutDelay, update, value]);
140
+ }, [inputText, value]);
228
141
 
229
142
  return (
230
143
  <div className={classes.container}>
@@ -238,21 +151,20 @@ const InputBase = ({ inputProps }) => {
238
151
  multiline: classes.multiline,
239
152
  inputMultiline: classes.inputMultiline,
240
153
  }}
241
- onBlur={onBlurInternal}
154
+ onBlur={onBlur}
242
155
  onClick={onClick}
243
- type={inputControlType}
156
+ type={type}
244
157
  placeholder={placeholder}
245
158
  value={textToDisplay}
246
159
  fullWidth={true}
247
160
  onChange={event => onChangeHandler(event)}
248
161
  error={!!error}
249
162
  inputProps={inputAttributes}
250
- inputComponent={inputComponent}
251
163
  disabled={disabled}
252
164
  multiline={multiline}
253
165
  startAdornment={startAdornment}
254
166
  endAdornment={endAdornment}
255
- minRows={rows}
167
+ rows={4}
256
168
  title={tooltipText}
257
169
  autoComplete={autoComplete}
258
170
  />