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
@@ -1,404 +0,0 @@
1
- import Immutable from "immutable";
2
- import { GET_TASK_LIST_SUCCESS, GET_TASK_LOG_SUCCESS, clearTaskLog, GET_TASKINFO_SUCCESS } from "actions/tasks";
3
- import reducer from "./tasks";
4
- import { DELETE_TASK_REQUEST } from "../actions/tasks";
5
-
6
- describe("reports", () => {
7
- it("behaves as a reducer should", () =>
8
- expect(reducer, "to be a reducer with initial state", {
9
- taskInfos: {},
10
- tasks: [],
11
- logs: {},
12
- }));
13
-
14
- describe("load task info", () => {
15
- it("stores task info from the server", () => {
16
- const oldState = Immutable.fromJS({
17
- new: false,
18
- taskInfos: {
19
- "8908517403b84b44832e99f5c59eb4eb": {
20
- taskId: "8908517403b84b44832e99f5c59eb4eb",
21
- name: "Report export (Report Export)",
22
- created: "2023-03-24T15:26:32.9986622Z",
23
- status: "RanToCompletion",
24
- resultBlobUrl: "packages/Report_20190430_11324479637592.xlsx",
25
- type: "Orckestra.Overture.Providers.CommerceEngine.Reporting.ReportExportTask, Orckestra.Overture.Providers.CommerceEngine",
26
- },
27
- },
28
- });
29
- const action = {
30
- type: GET_TASKINFO_SUCCESS,
31
- payload: {
32
- taskId: "5cb96f72f9bb47fc9e4feb5f9817772e",
33
- created: "2023-03-14T15:26:32.9986622Z",
34
- name: "Report export (Customer Extract)",
35
- type: "Orckestra.Overture.Providers.CommerceEngine.Reporting.ReportExportTask, Orckestra.Overture.Providers.CommerceEngine",
36
- status: "Faulted",
37
- requester: "gert.sonderby@orckestra.com",
38
- },
39
- };
40
- const newState = reducer(oldState, action);
41
- return expect(newState, "not to be", oldState).and(
42
- "value at",
43
- "taskInfos",
44
- "to equal",
45
- Immutable.fromJS({
46
- "8908517403b84b44832e99f5c59eb4eb": {
47
- taskId: "8908517403b84b44832e99f5c59eb4eb",
48
- created: "2023-03-24T15:26:32.9986622Z",
49
- name: "Report export (Report Export)",
50
- status: "RanToCompletion",
51
- resultBlobUrl: "packages/Report_20190430_11324479637592.xlsx",
52
- type: "Orckestra.Overture.Providers.CommerceEngine.Reporting.ReportExportTask, Orckestra.Overture.Providers.CommerceEngine",
53
- },
54
- "5cb96f72f9bb47fc9e4feb5f9817772e": {
55
- taskId: "5cb96f72f9bb47fc9e4feb5f9817772e",
56
- created: "2023-03-14T15:26:32.9986622Z",
57
- name: "Report export (Customer Extract)",
58
- type: "Orckestra.Overture.Providers.CommerceEngine.Reporting.ReportExportTask, Orckestra.Overture.Providers.CommerceEngine",
59
- status: "Faulted",
60
- requester: "gert.sonderby@orckestra.com",
61
- },
62
- }),
63
- );
64
- });
65
- });
66
-
67
- describe("load task list", () => {
68
- it("stores new tasks as loaded from the server", () => {
69
- const oldState = Immutable.fromJS({
70
- new: false,
71
- tasks: [
72
- {
73
- taskId: "8908517403b84b44832e99f5c59eb4eb",
74
- name: "Report export (Report Export)",
75
- status: "RanToCompletion",
76
- resultBlobUrl: "packages/Report_20190430_11324479637592.xlsx",
77
- type: "Orckestra.Overture.Providers.CommerceEngine.Reporting.ReportExportTask, Orckestra.Overture.Providers.CommerceEngine",
78
- },
79
- ],
80
- });
81
- const action = {
82
- type: GET_TASK_LIST_SUCCESS,
83
- payload: [
84
- {
85
- taskId: "8908517403b84b44832e99f5c59eb4eb",
86
- created: "2023-03-24T15:26:32.9986622Z",
87
- name: "Report export (Report Export)",
88
- status: "RanToCompletion",
89
- resultBlobUrl: "packages/Report_20190430_11324479637592.xlsx",
90
- type: "Orckestra.Overture.Providers.CommerceEngine.Reporting.ReportExportTask, Orckestra.Overture.Providers.CommerceEngine",
91
- },
92
- {
93
- taskId: "5cb96f72f9bb47fc9e4feb5f9817772e",
94
- created: "2023-03-14T15:26:32.9986622Z",
95
- name: "Report export (Customer Extract)",
96
- type: "Orckestra.Overture.Providers.CommerceEngine.Reporting.ReportExportTask, Orckestra.Overture.Providers.CommerceEngine",
97
- status: "Faulted",
98
- requester: "gert.sonderby@orckestra.com",
99
- },
100
- ],
101
- };
102
- const newState = reducer(oldState, action);
103
- return expect(newState, "not to be", oldState).and(
104
- "value at",
105
- "tasks",
106
- "to equal",
107
- Immutable.fromJS([
108
- {
109
- taskId: "5cb96f72f9bb47fc9e4feb5f9817772e",
110
- created: "2023-03-14T15:26:32.9986622Z",
111
- name: "Report export (Customer Extract)",
112
- type: "Orckestra.Overture.Providers.CommerceEngine.Reporting.ReportExportTask, Orckestra.Overture.Providers.CommerceEngine",
113
- status: "Faulted",
114
- requester: "gert.sonderby@orckestra.com",
115
- },
116
- {
117
- taskId: "8908517403b84b44832e99f5c59eb4eb",
118
- created: "2023-03-24T15:26:32.9986622Z",
119
- name: "Report export (Report Export)",
120
- status: "RanToCompletion",
121
- resultBlobUrl: "packages/Report_20190430_11324479637592.xlsx",
122
- type: "Orckestra.Overture.Providers.CommerceEngine.Reporting.ReportExportTask, Orckestra.Overture.Providers.CommerceEngine",
123
- },
124
- ]),
125
- );
126
- });
127
- });
128
-
129
- describe("removes a task from the list", () => {
130
- it("removes a task from the list", () => {
131
- const oldState = Immutable.fromJS({
132
- new: false,
133
- taskInfos: {
134
- "5cb96f72f9bb47fc9e4feb5f9817772e": {},
135
- "8908517403b84b44832e99f5c59eb4eb": {},
136
- },
137
- tasks: [
138
- {
139
- taskId: "8908517403b84b44832e99f5c59eb4eb",
140
- name: "Report export (Report Export)",
141
- status: "RanToCompletion",
142
- resultBlobUrl: "packages/Report_20190430_11324479637592.xlsx",
143
- type: "Orckestra.Overture.Providers.CommerceEngine.Reporting.ReportExportTask, Orckestra.Overture.Providers.CommerceEngine",
144
- },
145
- {
146
- taskId: "5cb96f72f9bb47fc9e4feb5f9817772e",
147
- name: "Report export (Customer Extract)",
148
- type: "Orckestra.Overture.Providers.CommerceEngine.Reporting.ReportExportTask, Orckestra.Overture.Providers.CommerceEngine",
149
- status: "Faulted",
150
- },
151
- ],
152
- logs: {
153
- "8908517403b84b44832e99f5c59eb4eb": ["a"],
154
- "5cb96f72f9bb47fc9e4feb5f9817772e": ["b"],
155
- },
156
- });
157
- const action = {
158
- type: DELETE_TASK_REQUEST,
159
- meta: { taskId: "8908517403b84b44832e99f5c59eb4eb" },
160
- };
161
- const newState = reducer(oldState, action);
162
- return expect(newState, "not to be", oldState)
163
- .and(
164
- "value at",
165
- "tasks",
166
- "to equal",
167
- Immutable.fromJS([
168
- {
169
- taskId: "5cb96f72f9bb47fc9e4feb5f9817772e",
170
- name: "Report export (Customer Extract)",
171
- type: "Orckestra.Overture.Providers.CommerceEngine.Reporting.ReportExportTask, Orckestra.Overture.Providers.CommerceEngine",
172
- status: "Faulted",
173
- },
174
- ]),
175
- )
176
- .and(
177
- "value at",
178
- "logs",
179
- "to equal",
180
- Immutable.fromJS({
181
- "5cb96f72f9bb47fc9e4feb5f9817772e": ["b"],
182
- }),
183
- )
184
- .and(
185
- "value at",
186
- "taskInfos",
187
- "to equal",
188
- Immutable.fromJS({
189
- "5cb96f72f9bb47fc9e4feb5f9817772e": {},
190
- }),
191
- );
192
- });
193
- });
194
-
195
- describe("load task log", () => {
196
- it("stores a log loaded from server", () => {
197
- const oldState = Immutable.fromJS({
198
- logs: {
199
- "5cb96f72f9bb47fc9e4feb5f9817772e": [{ id: "1" }, { id: "2" }],
200
- },
201
- });
202
- const action = {
203
- type: GET_TASK_LOG_SUCCESS,
204
- meta: { taskId: "641b80e5-2bad-454b-b9c2-18753348d121" },
205
- payload: [
206
- {
207
- id: "41debbd4-c229-449b-96b4-4c3a98d53fc3",
208
- taskId: "641b80e5-2bad-454b-b9c2-18753348d121",
209
- logLevel: "Info",
210
- message: "[Information] Exported report to path: packages/Report_20190515_07045925463191.pdf\r\n",
211
- executionTime: "2019-05-15T07:04:59.3641552Z",
212
- },
213
- {
214
- id: "80b42d72-6bf2-44ce-beb4-a75cd3867d9d",
215
- taskId: "641b80e5-2bad-454b-b9c2-18753348d121",
216
- logLevel: "Info",
217
- message:
218
- "[Information] Parameters used for the export:\nName: Scope\nValue: BetterRetail\n\r\nName: StartDate\nValue: 05/15/2014 00:00:00\n\r\nName: EndDate\nValue: 05/15/2019 00:00:00\n\r\n\r\n",
219
- executionTime: "2019-05-10T07:04:57.8172100Z",
220
- },
221
- {
222
- id: "2955e65f-744e-4225-beb1-d298a8fd02f6",
223
- taskId: "641b80e5-2bad-454b-b9c2-18753348d121",
224
- logLevel: "Info",
225
- message: '[Information] Starting report export: Report Export. Export as "Pdf"\r\n',
226
- executionTime: "2019-05-19T07:04:57.8016097Z",
227
- },
228
- ],
229
- };
230
- const newState = reducer(oldState, action);
231
- return expect(newState, "not to be", oldState).and(
232
- "value at",
233
- "logs",
234
- "to equal",
235
- Immutable.fromJS({
236
- "5cb96f72f9bb47fc9e4feb5f9817772e": [{ id: "1" }, { id: "2" }],
237
- "641b80e5-2bad-454b-b9c2-18753348d121": [
238
- {
239
- id: "80b42d72-6bf2-44ce-beb4-a75cd3867d9d",
240
- taskId: "641b80e5-2bad-454b-b9c2-18753348d121",
241
- logLevel: "Info",
242
- message:
243
- "[Information] Parameters used for the export:\nName: Scope\nValue: BetterRetail\n\r\nName: StartDate\nValue: 05/15/2014 00:00:00\n\r\nName: EndDate\nValue: 05/15/2019 00:00:00\n\r\n\r\n",
244
- executionTime: "2019-05-10T07:04:57.8172100Z",
245
- },
246
- {
247
- id: "41debbd4-c229-449b-96b4-4c3a98d53fc3",
248
- taskId: "641b80e5-2bad-454b-b9c2-18753348d121",
249
- logLevel: "Info",
250
- message: "[Information] Exported report to path: packages/Report_20190515_07045925463191.pdf\r\n",
251
- executionTime: "2019-05-15T07:04:59.3641552Z",
252
- },
253
- {
254
- id: "2955e65f-744e-4225-beb1-d298a8fd02f6",
255
- taskId: "641b80e5-2bad-454b-b9c2-18753348d121",
256
- logLevel: "Info",
257
- message: '[Information] Starting report export: Report Export. Export as "Pdf"\r\n',
258
- executionTime: "2019-05-19T07:04:57.8016097Z",
259
- },
260
- ],
261
- }),
262
- );
263
- });
264
-
265
- it("log is replaced", () => {
266
- const oldState = Immutable.fromJS({
267
- logs: {
268
- "5cb96f72f9bb47fc9e4feb5f9817772e": [{ id: "1" }, { id: "2" }],
269
- "641b80e5-2bad-454b-b9c2-18753348d121": [{ id: "1" }, { id: "2" }],
270
- },
271
- });
272
- const action = {
273
- type: GET_TASK_LOG_SUCCESS,
274
- meta: { taskId: "641b80e5-2bad-454b-b9c2-18753348d121" },
275
- payload: [
276
- {
277
- id: "41debbd4-c229-449b-96b4-4c3a98d53fc3",
278
- taskId: "641b80e5-2bad-454b-b9c2-18753348d121",
279
- logLevel: "Info",
280
- message: "[Information] Exported report to path: packages/Report_20190515_07045925463191.pdf\r\n",
281
- executionTime: "2019-05-15T07:04:59.3641552Z",
282
- },
283
- {
284
- id: "80b42d72-6bf2-44ce-beb4-a75cd3867d9d",
285
- taskId: "641b80e5-2bad-454b-b9c2-18753348d121",
286
- logLevel: "Info",
287
- message:
288
- "[Information] Parameters used for the export:\nName: Scope\nValue: BetterRetail\n\r\nName: StartDate\nValue: 05/15/2014 00:00:00\n\r\nName: EndDate\nValue: 05/15/2019 00:00:00\n\r\n\r\n",
289
- executionTime: "2019-05-10T07:04:57.8172100Z",
290
- },
291
- {
292
- id: "2955e65f-744e-4225-beb1-d298a8fd02f6",
293
- taskId: "641b80e5-2bad-454b-b9c2-18753348d121",
294
- logLevel: "Info",
295
- message: '[Information] Starting report export: Report Export. Export as "Pdf"\r\n',
296
- executionTime: "2019-05-19T07:04:57.8016097Z",
297
- },
298
- ],
299
- };
300
- const newState = reducer(oldState, action);
301
- return expect(newState, "not to be", oldState).and(
302
- "value at",
303
- "logs",
304
- "to equal",
305
- Immutable.fromJS({
306
- "5cb96f72f9bb47fc9e4feb5f9817772e": [{ id: "1" }, { id: "2" }],
307
- "641b80e5-2bad-454b-b9c2-18753348d121": [
308
- {
309
- id: "80b42d72-6bf2-44ce-beb4-a75cd3867d9d",
310
- taskId: "641b80e5-2bad-454b-b9c2-18753348d121",
311
- logLevel: "Info",
312
- message:
313
- "[Information] Parameters used for the export:\nName: Scope\nValue: BetterRetail\n\r\nName: StartDate\nValue: 05/15/2014 00:00:00\n\r\nName: EndDate\nValue: 05/15/2019 00:00:00\n\r\n\r\n",
314
- executionTime: "2019-05-10T07:04:57.8172100Z",
315
- },
316
- {
317
- id: "41debbd4-c229-449b-96b4-4c3a98d53fc3",
318
- taskId: "641b80e5-2bad-454b-b9c2-18753348d121",
319
- logLevel: "Info",
320
- message: "[Information] Exported report to path: packages/Report_20190515_07045925463191.pdf\r\n",
321
- executionTime: "2019-05-15T07:04:59.3641552Z",
322
- },
323
- {
324
- id: "2955e65f-744e-4225-beb1-d298a8fd02f6",
325
- taskId: "641b80e5-2bad-454b-b9c2-18753348d121",
326
- logLevel: "Info",
327
- message: '[Information] Starting report export: Report Export. Export as "Pdf"\r\n',
328
- executionTime: "2019-05-19T07:04:57.8016097Z",
329
- },
330
- ],
331
- }),
332
- );
333
- });
334
-
335
- it("log is removed because of empty list", () => {
336
- const oldState = Immutable.fromJS({
337
- logs: {
338
- "5cb96f72f9bb47fc9e4feb5f9817772e": [{ id: "1" }, { id: "2" }],
339
- "641b80e5-2bad-454b-b9c2-18753348d121": [{ id: "1" }, { id: "2" }],
340
- },
341
- });
342
- const action = {
343
- type: GET_TASK_LOG_SUCCESS,
344
- meta: { taskId: "641b80e5-2bad-454b-b9c2-18753348d121" },
345
- payload: [],
346
- };
347
- const newState = reducer(oldState, action);
348
- return expect(newState, "not to be", oldState).and(
349
- "value at",
350
- "logs",
351
- "to equal",
352
- Immutable.fromJS({
353
- "5cb96f72f9bb47fc9e4feb5f9817772e": [{ id: "1" }, { id: "2" }],
354
- }),
355
- );
356
- });
357
- });
358
-
359
- describe("clear task log", () => {
360
- it("deletes the task log", () => {
361
- const oldState = Immutable.fromJS({
362
- logs: {
363
- "5cb96f72f9bb47fc9e4feb5f9817772e": [{ id: "1" }, { id: "2" }],
364
- FFb96f72f9bb47fc9e4feb5f981777FF: [{ id: "3" }, { id: "4" }],
365
- "641b80e5-2bad-454b-b9c2-18753348d121": [
366
- {
367
- id: "80b42d72-6bf2-44ce-beb4-a75cd3867d9d",
368
- taskId: "641b80e5-2bad-454b-b9c2-18753348d121",
369
- logLevel: "Info",
370
- message:
371
- "[Information] Parameters used for the export:\nName: Scope\nValue: BetterRetail\n\r\nName: StartDate\nValue: 05/15/2014 00:00:00\n\r\nName: EndDate\nValue: 05/15/2019 00:00:00\n\r\n\r\n",
372
- executionTime: "2019-05-10T07:04:57.8172100Z",
373
- },
374
- {
375
- id: "41debbd4-c229-449b-96b4-4c3a98d53fc3",
376
- taskId: "641b80e5-2bad-454b-b9c2-18753348d121",
377
- logLevel: "Info",
378
- message: "[Information] Exported report to path: packages/Report_20190515_07045925463191.pdf\r\n",
379
- executionTime: "2019-05-15T07:04:59.3641552Z",
380
- },
381
- {
382
- id: "2955e65f-744e-4225-beb1-d298a8fd02f6",
383
- taskId: "641b80e5-2bad-454b-b9c2-18753348d121",
384
- logLevel: "Info",
385
- message: '[Information] Starting report export: Report Export. Export as "Pdf"\r\n',
386
- executionTime: "2019-05-19T07:04:57.8016097Z",
387
- },
388
- ],
389
- },
390
- });
391
- const action = clearTaskLog("641b80e5-2bad-454b-b9c2-18753348d121");
392
- const newState = reducer(oldState, action);
393
- return expect(newState, "not to be", oldState).and(
394
- "value at",
395
- "logs",
396
- "to equal",
397
- Immutable.fromJS({
398
- "5cb96f72f9bb47fc9e4feb5f9817772e": [{ id: "1" }, { id: "2" }],
399
- FFb96f72f9bb47fc9e4feb5f981777FF: [{ id: "3" }, { id: "4" }],
400
- }),
401
- );
402
- });
403
- });
404
- });
@@ -1,11 +0,0 @@
1
- import { createSelector } from "reselect";
2
-
3
- const globalMsgData = state => state.get("globalErrorMessages");
4
-
5
- export const firstDialogErrorMessageSelector = createSelector(globalMsgData, data => {
6
- const msgs = data.getIn(["dialog", "errorMessages"]);
7
- if (msgs.size === 0) {
8
- return null;
9
- }
10
- return msgs.first().toJS();
11
- });
@@ -1,25 +0,0 @@
1
- import Immutable from "immutable";
2
- import { firstDialogErrorMessageSelector } from "./globalErrorMessages";
3
-
4
- describe("firstDialogErrorMessageSelector", () => {
5
- let state;
6
- beforeEach(() => {
7
- state = Immutable.fromJS({
8
- globalErrorMessages: {
9
- dialog: {
10
- errorMessages: [{ msg: "123" }, { msg: "456" }],
11
- },
12
- },
13
- view: {},
14
- });
15
- });
16
-
17
- it("gets the first message", () => {
18
- expect(firstDialogErrorMessageSelector, "called with", [state], "to satisfy", { msg: "123" });
19
- });
20
-
21
- it("gets the first message on an empty list", () => {
22
- state = state.setIn(["globalErrorMessages", "dialog", "errorMessages"], Immutable.fromJS([]));
23
- expect(firstDialogErrorMessageSelector, "called with", [state], "to satisfy", null);
24
- });
25
- });
@@ -1,5 +0,0 @@
1
- import { createSelector } from "reselect";
2
-
3
- const scopeRouteStateData = state => state.get("scopeRouteState");
4
-
5
- export const getScopeChangeInProgress = createSelector(scopeRouteStateData, data => data.get("scopeChangeInProgress"));
@@ -1,13 +0,0 @@
1
- import Immutable from "immutable";
2
- import { getScopeChangeInProgress } from "./scopeRouteState";
3
-
4
- describe("getScopeChangeInProgress", () => {
5
- it("return the value from the store", () => {
6
- const state = Immutable.fromJS({
7
- scopeRouteState: {
8
- scopeChangeInProgress: true,
9
- },
10
- });
11
- return expect(getScopeChangeInProgress, "called with", [state], "to equal", true);
12
- });
13
- });
@@ -1,16 +0,0 @@
1
- import Immutable from "immutable";
2
- import { createSelector } from "reselect";
3
-
4
- const tasksData = state => state.get("tasks");
5
-
6
- export const taskInfo = taskId => {
7
- return createSelector(tasksData, tasks => {
8
- return tasks.getIn(["taskInfos", taskId]) || null;
9
- });
10
- };
11
-
12
- export const taskLogs = taskId => {
13
- return createSelector(tasksData, tasks => {
14
- return tasks.getIn(["logs", taskId]) || Immutable.List();
15
- });
16
- };
@@ -1,60 +0,0 @@
1
- import Immutable from "immutable";
2
- import { taskInfo, taskLogs } from "./tasks";
3
-
4
- const defaultState = {
5
- tasks: [],
6
- taskInfos: {
7
- "8908517403b84b44832e99f5c59eb4eb": {
8
- taskId: "8908517403b84b44832e99f5c59eb4eb",
9
- name: "Report export (Report Export)",
10
- status: "RanToCompletion",
11
- resultBlobUrl: "packages/Report_20190430_11324479637592.xlsx",
12
- type: "Orckestra.Overture.Providers.CommerceEngine.Reporting.ReportExportTask, Orckestra.Overture.Providers.CommerceEngine",
13
- },
14
- },
15
- logs: {
16
- "8908517403b84b44832e99f5c59eb4eb": ["a"],
17
- "5cb96f72f9bb47fc9e4feb5f9817772e": ["b"],
18
- },
19
- };
20
-
21
- describe("Tasks Selectors", () => {
22
- let state;
23
- beforeEach(() => {
24
- state = Immutable.fromJS({
25
- tasks: defaultState,
26
- });
27
- });
28
-
29
- it("Retrieves task info by id", () => {
30
- expect(
31
- taskInfo,
32
- "when called with",
33
- ["8908517403b84b44832e99f5c59eb4eb"],
34
- "called with",
35
- [state],
36
- "to satisfy",
37
- Immutable.fromJS(defaultState.taskInfos["8908517403b84b44832e99f5c59eb4eb"]),
38
- );
39
- });
40
-
41
- it("Retrieves unknown task info by id", () => {
42
- expect(taskInfo, "when called with", ["404"], "called with", [state], "to be null");
43
- });
44
-
45
- it("Retrieves task logs by id", () => {
46
- expect(
47
- taskLogs,
48
- "when called with",
49
- ["8908517403b84b44832e99f5c59eb4eb"],
50
- "called with",
51
- [state],
52
- "to satisfy",
53
- defaultState.logs["8908517403b84b44832e99f5c59eb4eb"],
54
- );
55
- });
56
-
57
- it("Retrieves unknown task logs by id", () => {
58
- expect(taskLogs, "when called with", ["404"], "called with", [state], "to satisfy", Immutable.List());
59
- });
60
- });
@@ -1,42 +0,0 @@
1
- export const extractStandardErrorMessagesFromResponse = (response, validationLookupModule, validationLookupName) => {
2
- let hasErrors = false;
3
- const messages = [];
4
-
5
- if (response?.error) {
6
- hasErrors = true;
7
-
8
- if (response.payload?.status === 422) {
9
- if (response.payload?.response?.failures) {
10
- // uses structure from our .Net ValidationFailuresExceptionHandler
11
- response.payload.response.failures.forEach(failure => {
12
- if (failure.errorCode) {
13
- messages.push({
14
- message: failure.errorMessage,
15
- lookupModule: validationLookupModule,
16
- lookupName: validationLookupName,
17
- lookupKey: failure.errorCode,
18
- });
19
- }
20
- });
21
- }
22
- } else if (response.payload?.status === 500) {
23
- if (response.payload?.response?.errors) {
24
- // uses structure from our .Net OrckestraExceptionErrorHandler
25
- response.payload.response.errors.forEach(err => {
26
- messages.push({
27
- message: err.message,
28
- lookupModule: err.lookupModule,
29
- lookupName: err.lookupName,
30
- lookupKey: err.lookupKey,
31
- lookupReplacementValues: err.lookupReplacementValues,
32
- });
33
- });
34
- }
35
- }
36
- }
37
-
38
- return {
39
- hasErrors,
40
- messages,
41
- };
42
- };