orc-shared 1.5.0-dev.10 → 1.5.0-dev.12
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/requestsApi.js +1 -0
- package/dist/actions/tasks.js +190 -0
- package/dist/buildStore.js +3 -1
- package/dist/components/AppFrame/Sidebar.js +4 -8
- package/dist/components/CategoryList.js +6 -0
- package/dist/components/MaterialUI/DataDisplay/PredefinedElements/DiscountedPrice.js +1 -0
- package/dist/components/MaterialUI/Inputs/PredefinedElements/SearchControl.js +12 -3
- package/dist/components/MaterialUI/hocs/withDeferredTooltip.js +0 -1
- package/dist/components/Navigation/index.js +0 -1
- package/dist/components/Routing/withWaypointing.js +1 -1
- package/dist/components/TaskDetailsModal.js +193 -0
- package/dist/constants.js +16 -1
- package/dist/reducers/request.js +4 -0
- package/dist/reducers/tasks.js +99 -0
- package/dist/selectors/tasks.js +66 -0
- package/dist/sharedMessages.js +17 -1
- package/dist/utils/propertyHelper.js +35 -0
- package/dist/whyDidYouRerender.js +1 -0
- package/package.json +1 -1
- package/src/actions/tasks.js +77 -0
- package/src/actions/tasks.test.js +169 -0
- package/src/buildStore.js +2 -0
- package/src/components/AppFrame/About.test.js +3 -3
- package/src/components/AppFrame/Sidebar.js +4 -3
- package/src/components/MaterialUI/Inputs/PredefinedElements/SearchControl.js +10 -1
- package/src/components/MaterialUI/Inputs/PredefinedElements/SearchControl.test.js +41 -1
- package/src/components/TaskDetailsModal.js +132 -0
- package/src/components/TaskDetailsModal.test.js +317 -0
- package/src/components/Text.test.js +44 -59
- package/src/constants.js +13 -0
- package/src/hooks/useLabelMessage.test.js +16 -10
- package/src/reducers/request.js +4 -0
- package/src/reducers/request.test.js +11 -0
- package/src/reducers/tasks.js +56 -0
- package/src/reducers/tasks.test.js +404 -0
- package/src/selectors/tasks.js +16 -0
- package/src/selectors/tasks.test.js +60 -0
- package/src/sharedMessages.js +17 -1
- package/src/translations/en-US.json +16 -12
- package/src/translations/fr-CA.json +16 -12
- package/src/utils/propertyHelper.js +38 -0
- package/src/utils/propertyHelper.test.js +160 -0
- package/src/utils/timezoneHelper.test.js +4 -2
|
@@ -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
|
+
};
|
|
@@ -281,3 +281,163 @@ describe("isObjectContainsPropertyWithAnyValue", () => {
|
|
|
281
281
|
expect(result, "to be true");
|
|
282
282
|
});
|
|
283
283
|
});
|
|
284
|
+
|
|
285
|
+
describe("compareObjectProperty", () => {
|
|
286
|
+
it("Return 0 if both obj are null", () => {
|
|
287
|
+
const result = propertyHelper.compareObjectProperty(null, null, "prop");
|
|
288
|
+
|
|
289
|
+
expect(result, "to equal", 0);
|
|
290
|
+
});
|
|
291
|
+
|
|
292
|
+
it("Return 0 if obj1 is null and obj2 does not have property", () => {
|
|
293
|
+
const result = propertyHelper.compareObjectProperty(null, {}, "prop");
|
|
294
|
+
|
|
295
|
+
expect(result, "to equal", 0);
|
|
296
|
+
});
|
|
297
|
+
|
|
298
|
+
it("Return 0 if obj1 does not have property and obj1 is null", () => {
|
|
299
|
+
const result = propertyHelper.compareObjectProperty({}, null, "prop");
|
|
300
|
+
|
|
301
|
+
expect(result, "to equal", 0);
|
|
302
|
+
});
|
|
303
|
+
|
|
304
|
+
it("Return 0 if both obj does not have property", () => {
|
|
305
|
+
const result = propertyHelper.compareObjectProperty({}, null, "prop");
|
|
306
|
+
|
|
307
|
+
expect(result, "to equal", 0);
|
|
308
|
+
});
|
|
309
|
+
|
|
310
|
+
it("Return 0 if both obj have property with null value", () => {
|
|
311
|
+
const result = propertyHelper.compareObjectProperty({ prop: null }, { prop: null }, "prop");
|
|
312
|
+
|
|
313
|
+
expect(result, "to equal", 0);
|
|
314
|
+
});
|
|
315
|
+
|
|
316
|
+
it("Return 0 if propertyName is null", () => {
|
|
317
|
+
const result = propertyHelper.compareObjectProperty({}, {}, null);
|
|
318
|
+
|
|
319
|
+
expect(result, "to equal", 0);
|
|
320
|
+
});
|
|
321
|
+
|
|
322
|
+
it("Return 0 if propertyName is empty", () => {
|
|
323
|
+
const result = propertyHelper.compareObjectProperty({}, {}, "");
|
|
324
|
+
|
|
325
|
+
expect(result, "to equal", 0);
|
|
326
|
+
});
|
|
327
|
+
|
|
328
|
+
it("Return 0 if property has same value (string)", () => {
|
|
329
|
+
const result = propertyHelper.compareObjectProperty({ prop: "a" }, { prop: "a" }, "prop");
|
|
330
|
+
|
|
331
|
+
expect(result, "to equal", 0);
|
|
332
|
+
});
|
|
333
|
+
|
|
334
|
+
it("Return -1 if obj1 property is small than obj2 property (string)", () => {
|
|
335
|
+
const result = propertyHelper.compareObjectProperty({ prop: "a" }, { prop: "b" }, "prop");
|
|
336
|
+
|
|
337
|
+
expect(result, "to equal", -1);
|
|
338
|
+
});
|
|
339
|
+
|
|
340
|
+
it("Return 1 if obj1 property is bigger than obj2 property (string)", () => {
|
|
341
|
+
const result = propertyHelper.compareObjectProperty({ prop: "b" }, { prop: "a" }, "prop");
|
|
342
|
+
|
|
343
|
+
expect(result, "to equal", 1);
|
|
344
|
+
});
|
|
345
|
+
|
|
346
|
+
it("Return 0 if property has same value (numeric)", () => {
|
|
347
|
+
const result = propertyHelper.compareObjectProperty({ prop: 1 }, { prop: 1 }, "prop");
|
|
348
|
+
|
|
349
|
+
expect(result, "to equal", 0);
|
|
350
|
+
});
|
|
351
|
+
|
|
352
|
+
it("Return -1 if obj1 property is small than obj2 property (numeric)", () => {
|
|
353
|
+
const result = propertyHelper.compareObjectProperty({ prop: 1 }, { prop: 2 }, "prop");
|
|
354
|
+
|
|
355
|
+
expect(result, "to equal", -1);
|
|
356
|
+
});
|
|
357
|
+
|
|
358
|
+
it("Return 1 if obj1 property is bigger than obj2 property (numeric)", () => {
|
|
359
|
+
const result = propertyHelper.compareObjectProperty({ prop: 2 }, { prop: 1 }, "prop");
|
|
360
|
+
|
|
361
|
+
expect(result, "to equal", 1);
|
|
362
|
+
});
|
|
363
|
+
});
|
|
364
|
+
|
|
365
|
+
describe("compareObjectPropertyDescending", () => {
|
|
366
|
+
it("Return 0 if both obj are null", () => {
|
|
367
|
+
const result = propertyHelper.compareObjectPropertyDescending(null, null, "prop");
|
|
368
|
+
|
|
369
|
+
expect(result, "to equal", 0);
|
|
370
|
+
});
|
|
371
|
+
|
|
372
|
+
it("Return 0 if obj1 is null and obj2 does not have property", () => {
|
|
373
|
+
const result = propertyHelper.compareObjectPropertyDescending(null, {}, "prop");
|
|
374
|
+
|
|
375
|
+
expect(result, "to equal", 0);
|
|
376
|
+
});
|
|
377
|
+
|
|
378
|
+
it("Return 0 if obj1 does not have property and obj1 is null", () => {
|
|
379
|
+
const result = propertyHelper.compareObjectPropertyDescending({}, null, "prop");
|
|
380
|
+
|
|
381
|
+
expect(result, "to equal", 0);
|
|
382
|
+
});
|
|
383
|
+
|
|
384
|
+
it("Return 0 if both obj does not have property", () => {
|
|
385
|
+
const result = propertyHelper.compareObjectPropertyDescending({}, null, "prop");
|
|
386
|
+
|
|
387
|
+
expect(result, "to equal", 0);
|
|
388
|
+
});
|
|
389
|
+
|
|
390
|
+
it("Return 0 if both obj have property with null value", () => {
|
|
391
|
+
const result = propertyHelper.compareObjectPropertyDescending({ prop: null }, { prop: null }, "prop");
|
|
392
|
+
|
|
393
|
+
expect(result, "to equal", 0);
|
|
394
|
+
});
|
|
395
|
+
|
|
396
|
+
it("Return 0 if propertyName is null", () => {
|
|
397
|
+
const result = propertyHelper.compareObjectPropertyDescending({}, {}, null);
|
|
398
|
+
|
|
399
|
+
expect(result, "to equal", 0);
|
|
400
|
+
});
|
|
401
|
+
|
|
402
|
+
it("Return 0 if propertyName is empty", () => {
|
|
403
|
+
const result = propertyHelper.compareObjectPropertyDescending({}, {}, "");
|
|
404
|
+
|
|
405
|
+
expect(result, "to equal", 0);
|
|
406
|
+
});
|
|
407
|
+
|
|
408
|
+
it("Return 0 if property has same value (string)", () => {
|
|
409
|
+
const result = propertyHelper.compareObjectPropertyDescending({ prop: "a" }, { prop: "a" }, "prop");
|
|
410
|
+
|
|
411
|
+
expect(result, "to equal", 0);
|
|
412
|
+
});
|
|
413
|
+
|
|
414
|
+
it("Return -1 if obj1 property is small than obj2 property (string)", () => {
|
|
415
|
+
const result = propertyHelper.compareObjectPropertyDescending({ prop: "a" }, { prop: "b" }, "prop");
|
|
416
|
+
|
|
417
|
+
expect(result, "to equal", 1);
|
|
418
|
+
});
|
|
419
|
+
|
|
420
|
+
it("Return 1 if obj1 property is bigger than obj2 property (string)", () => {
|
|
421
|
+
const result = propertyHelper.compareObjectPropertyDescending({ prop: "b" }, { prop: "a" }, "prop");
|
|
422
|
+
|
|
423
|
+
expect(result, "to equal", -1);
|
|
424
|
+
});
|
|
425
|
+
|
|
426
|
+
it("Return 0 if property has same value (numeric)", () => {
|
|
427
|
+
const result = propertyHelper.compareObjectPropertyDescending({ prop: 1 }, { prop: 1 }, "prop");
|
|
428
|
+
|
|
429
|
+
expect(result, "to equal", 0);
|
|
430
|
+
});
|
|
431
|
+
|
|
432
|
+
it("Return -1 if obj1 property is small than obj2 property (numeric)", () => {
|
|
433
|
+
const result = propertyHelper.compareObjectPropertyDescending({ prop: 1 }, { prop: 2 }, "prop");
|
|
434
|
+
|
|
435
|
+
expect(result, "to equal", 1);
|
|
436
|
+
});
|
|
437
|
+
|
|
438
|
+
it("Return 1 if obj1 property is bigger than obj2 property (numeric)", () => {
|
|
439
|
+
const result = propertyHelper.compareObjectPropertyDescending({ prop: 2 }, { prop: 1 }, "prop");
|
|
440
|
+
|
|
441
|
+
expect(result, "to equal", -1);
|
|
442
|
+
});
|
|
443
|
+
});
|
|
@@ -40,14 +40,16 @@ describe("Timezone Helper", () => {
|
|
|
40
40
|
it("Retrieves user local timezone date", () => {
|
|
41
41
|
const timezoneName = "America/New_York";
|
|
42
42
|
const date = "Mon Apr 04 2022 13:00:00.000Z";
|
|
43
|
-
|
|
43
|
+
let expectedDate = new Date("2022-04-04T09:00:00.000Z");
|
|
44
|
+
expectedDate = new Date(expectedDate.getTime() + expectedDate.getTimezoneOffset() * 60000); // try to adapt expected date with current computer timezone
|
|
44
45
|
expect(convertTimeToLocalTimeZone, "called with", [date, timezoneName], "to satisfy", expectedDate);
|
|
45
46
|
});
|
|
46
47
|
|
|
47
48
|
it("Retrieves user other timezone date", () => {
|
|
48
49
|
const timezoneName = "America/New_York";
|
|
49
50
|
const date = "Mon Apr 04 2022 06:00:00.000Z";
|
|
50
|
-
|
|
51
|
+
let expectedDate = new Date("2022-04-04T10:00:00.000Z");
|
|
52
|
+
expectedDate = new Date(expectedDate.getTime() - expectedDate.getTimezoneOffset() * 60000); // try to adapt expected date with current computer timezone
|
|
51
53
|
expect(convertTimeToOtherTimeZone, "called with", [date, timezoneName], "to satisfy", expectedDate);
|
|
52
54
|
});
|
|
53
55
|
});
|