orc-shared 1.5.0-dev.10 → 1.5.0-dev.11

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.
@@ -0,0 +1,404 @@
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
+ });
@@ -0,0 +1,16 @@
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
+ };
@@ -0,0 +1,60 @@
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
+ });
@@ -56,7 +56,7 @@ const sharedMessages = defineMessages({
56
56
  },
57
57
  copyright: {
58
58
  id: "orc-shared.copyright",
59
- defaultMessage: "© 2021 Orckestra Technologies Inc.",
59
+ defaultMessage: "© {year} Orckestra Technologies Inc.",
60
60
  },
61
61
  allRightsReserved: {
62
62
  id: "orc-shared.allRightsReserved",
@@ -255,6 +255,22 @@ const sharedMessages = defineMessages({
255
255
  id: "orc-shared.errorUnknown",
256
256
  defaultMessage: "Unknown Error",
257
257
  },
258
+ taskInProgressModalTitle: {
259
+ id: "orc-shared.taskInProgressModalTitle",
260
+ defaultMessage: "Task In Progress",
261
+ },
262
+ taskId: {
263
+ id: "orc-shared.taskId",
264
+ defaultMessage: "Task ID",
265
+ },
266
+ taskStatus: {
267
+ id: "orc-shared.taskStatus",
268
+ defaultMessage: "Status",
269
+ },
270
+ taskLogs: {
271
+ id: "orc-shared.taskLogs",
272
+ defaultMessage: "Logs",
273
+ },
258
274
  });
259
275
 
260
276
  export default sharedMessages;
@@ -3,8 +3,8 @@
3
3
  "orc-shared.active": "Active",
4
4
  "orc-shared.add": "Add",
5
5
  "orc-shared.allRightsReserved": "All rights reserved.",
6
- "orc-shared.applyChanges": "Apply Changes",
7
6
  "orc-shared.appSelectorTitle": "Orckestra Commerce Cloud Applications List",
7
+ "orc-shared.applyChanges": "Apply Changes",
8
8
  "orc-shared.back": "Back",
9
9
  "orc-shared.cancel": "Cancel",
10
10
  "orc-shared.ccDescription": "The API-first commerce platform that makes omnichannel retail work.",
@@ -14,12 +14,21 @@
14
14
  "orc-shared.confirmation": "Confirmation",
15
15
  "orc-shared.copyright": "© {year} Orckestra Technologies Inc.",
16
16
  "orc-shared.copyrightTermsNotice": "This computer program is protected by copyright laws and international treaties. Unauthorized reproduction or redistribution of this program, or any portion of it, may result in severe civil and criminal penalties, and will be prosecuted to the maximum extent possible under the law. Orckestra is a trademark of Orckestra Technologies Inc. All other trademarks are property of the respective owners.",
17
+ "orc-shared.dataTypeBoolean": "Yes/No Choice",
18
+ "orc-shared.dataTypeDate": "Date/Calendar",
19
+ "orc-shared.dataTypeDecimal": "Decimal Number",
20
+ "orc-shared.dataTypeEntityReference": "Profile Reference",
21
+ "orc-shared.dataTypeInteger": "Whole Number",
22
+ "orc-shared.dataTypeLookup": "Lookup List",
23
+ "orc-shared.dataTypeText": "Text",
17
24
  "orc-shared.defaultApp": "Default application",
18
25
  "orc-shared.delete": "Delete",
19
26
  "orc-shared.description": "Description",
20
27
  "orc-shared.displayLanguage": "Display language",
21
28
  "orc-shared.displayName": "Display Name",
29
+ "orc-shared.embedded": "Embedded",
22
30
  "orc-shared.error": "Error",
31
+ "orc-shared.errorUnknown": "Unknown Error",
23
32
  "orc-shared.fieldIsRequired": "This field is required",
24
33
  "orc-shared.fieldMustBeValidEmail": "This field must be a valid email",
25
34
  "orc-shared.fieldMustBeValidPhoneExtension": "This field must be a valid phone extension",
@@ -44,22 +53,17 @@
44
53
  "orc-shared.scopeChangeWithUnsavedDataConfirmation": "One or more entities opened will be closed with unsaved data. Would you like to change scope?",
45
54
  "orc-shared.scopeChangeWithUnsavedDataTitle": "Confirm scope change without saving data",
46
55
  "orc-shared.scopeFilterPlaceholder": "Type a scope name",
56
+ "orc-shared.shared": "Shared",
47
57
  "orc-shared.showFewerLanguages": "Show fewer languages",
48
58
  "orc-shared.showMoreLanguages": "Show more languages",
49
59
  "orc-shared.signOut": "Sign out",
50
60
  "orc-shared.sortOrder": "Sort Order",
51
61
  "orc-shared.status": "Status",
62
+ "orc-shared.taskId": "Task ID",
63
+ "orc-shared.taskInProgressModalTitle": "Task In Progress",
64
+ "orc-shared.taskLogs": "Logs",
65
+ "orc-shared.taskStatus": "Status",
52
66
  "orc-shared.unsavedChanges": "This entity has unsaved changes. All changes will be lost.\n\nAre you sure you want to close it?",
53
67
  "orc-shared.valueName": "Value Name",
54
- "orc-shared.yes": "Yes",
55
- "orc-shared.embedded": "Embedded",
56
- "orc-shared.shared": "Shared",
57
- "orc-shared.dataTypeText": "Text",
58
- "orc-shared.dataTypeBoolean": "Yes/No Choice",
59
- "orc-shared.dataTypeDate": "Date/Calendar",
60
- "orc-shared.dataTypeDecimal": "Decimal Number",
61
- "orc-shared.dataTypeInteger": "Whole Number",
62
- "orc-shared.dataTypeEntityReference": "Profile Reference",
63
- "orc-shared.dataTypeLookup": "Lookup List",
64
- "orc-shared.errorUnknown": "Unknown Error"
68
+ "orc-shared.yes": "Yes"
65
69
  }
@@ -3,8 +3,8 @@
3
3
  "orc-shared.active": "Actif",
4
4
  "orc-shared.add": "Ajouter",
5
5
  "orc-shared.allRightsReserved": "Tout droits réservés.",
6
- "orc-shared.applyChanges": "Appliquer les modifications",
7
6
  "orc-shared.appSelectorTitle": "Orckestra Commerce Cloud : Liste des applications",
7
+ "orc-shared.applyChanges": "Appliquer les modifications",
8
8
  "orc-shared.back": "Précédent",
9
9
  "orc-shared.cancel": "Annuler",
10
10
  "orc-shared.ccDescription": "La plateforme de commerce « API-first » qui rend le commerce de détail omnicanal fluide.",
@@ -14,12 +14,21 @@
14
14
  "orc-shared.confirmation": "Confirmation",
15
15
  "orc-shared.copyright": "© {year} Technologies Orckestra Inc.",
16
16
  "orc-shared.copyrightTermsNotice": "Avertissement: Ce programme est protégé par la loi relative au droit d'auteur et par les conventions internationales. Toute reproduction ou distribution partielle ou totale du logiciel, par quelque moyen que ce soit, est strictement interdite. Toute personne ne respectant pas ces dispositions se rendra coupable du délit de contrefaçon et sera passible des sanctions pénales prévues par la loi. Orckestra est une marque de commerce déposée et détenue par Technologies Orckestra Inc. Toutes les autres marques de commerce sont la propriété de leurs détenteurs respectifs.",
17
+ "orc-shared.dataTypeBoolean": "Choix Oui/Non",
18
+ "orc-shared.dataTypeDate": "Date/Calendrier",
19
+ "orc-shared.dataTypeDecimal": "Nombre décimal",
20
+ "orc-shared.dataTypeEntityReference": "Profil de référence",
21
+ "orc-shared.dataTypeInteger": "Nombre entier",
22
+ "orc-shared.dataTypeLookup": "Index des listes",
23
+ "orc-shared.dataTypeText": "Texte",
17
24
  "orc-shared.defaultApp": "Application par défaut",
18
25
  "orc-shared.delete": "Supprimer",
19
26
  "orc-shared.description": "Description",
20
27
  "orc-shared.displayLanguage": "Langue d'affichage",
21
28
  "orc-shared.displayName": "Nom d'affichage",
29
+ "orc-shared.embedded": "Intégré",
22
30
  "orc-shared.error": "Erreur",
31
+ "orc-shared.errorUnknown": "Erreur inconnue",
23
32
  "orc-shared.fieldIsRequired": "Est requis",
24
33
  "orc-shared.fieldMustBeValidEmail": "Ce champ doit contenir un courriel valide",
25
34
  "orc-shared.fieldMustBeValidPhoneExtension": "Ce champ doit contenir une extension de téléphone valide",
@@ -44,22 +53,17 @@
44
53
  "orc-shared.scopeChangeWithUnsavedDataConfirmation": "Une ou plusieurs entités ouvertes seront fermées, entraînant la perte de données non-sauvegardées. Voulez-vous vraiment changer de Scope?",
45
54
  "orc-shared.scopeChangeWithUnsavedDataTitle": "Confirmation du changement de Scope sans sauvegarde",
46
55
  "orc-shared.scopeFilterPlaceholder": "Entrez un nom de Scope",
56
+ "orc-shared.shared": "Partagé",
47
57
  "orc-shared.showFewerLanguages": "Afficher moins de langues",
48
58
  "orc-shared.showMoreLanguages": "Afficher plus de langues",
49
59
  "orc-shared.signOut": "Se déconnecter",
50
60
  "orc-shared.sortOrder": "Ordre de tri",
51
61
  "orc-shared.status": "Statut",
62
+ "orc-shared.taskId": "Identifiant de la tâche",
63
+ "orc-shared.taskInProgressModalTitle": "Tâche en cours",
64
+ "orc-shared.taskLogs": "Journal",
65
+ "orc-shared.taskStatus": "Statut",
52
66
  "orc-shared.unsavedChanges": "Ce dossier contient des modifications qui ne sont sauvegardées. Si vous quittez, les modifications seront perdues.\n\nVoulez vous vraiment quitter?",
53
67
  "orc-shared.valueName": "Nom de la valeur",
54
- "orc-shared.yes": "Oui",
55
- "orc-shared.embedded": "Intégré",
56
- "orc-shared.shared": "Partagé",
57
- "orc-shared.dataTypeText": "Texte",
58
- "orc-shared.dataTypeBoolean": "Choix Oui/Non",
59
- "orc-shared.dataTypeDate": "Date/Calendrier",
60
- "orc-shared.dataTypeDecimal": "Nombre décimal",
61
- "orc-shared.dataTypeInteger": "Nombre entier",
62
- "orc-shared.dataTypeEntityReference": "Profil de référence",
63
- "orc-shared.dataTypeLookup": "Index des listes",
64
- "orc-shared.errorUnknown": "Erreur inconnue"
68
+ "orc-shared.yes": "Oui"
65
69
  }
@@ -67,3 +67,41 @@ export const isObjectContainsPropertyWithAnyValue = (obj, propertyName) => {
67
67
 
68
68
  return false;
69
69
  };
70
+
71
+ export const compareObjectProperty = (obj1, obj2, propertyName) => {
72
+ if (propertyName == null || propertyName === "") {
73
+ return 0;
74
+ }
75
+
76
+ const val1 = obj1?.[propertyName];
77
+ const val2 = obj2?.[propertyName];
78
+
79
+ if (val1 === val2) {
80
+ return 0;
81
+ }
82
+
83
+ if (val1 < val2) {
84
+ return -1;
85
+ }
86
+
87
+ return 1;
88
+ };
89
+
90
+ export const compareObjectPropertyDescending = (obj1, obj2, propertyName) => {
91
+ if (propertyName == null || propertyName === "") {
92
+ return 0;
93
+ }
94
+
95
+ const val1 = obj1?.[propertyName];
96
+ const val2 = obj2?.[propertyName];
97
+
98
+ if (val1 === val2) {
99
+ return 0;
100
+ }
101
+
102
+ if (val1 > val2) {
103
+ return -1;
104
+ }
105
+
106
+ return 1;
107
+ };