Compare commits

..

163 Commits

Author SHA1 Message Date
Lorenz Hilpert
3b466f7d65 css tag hinzugefügt für e2e 2023-01-19 13:04:46 +01:00
Nino Righi
62d93d1122 #3632 Updated Unit Test 2023-01-09 14:17:26 +01:00
Nino Righi
ed83fedd61 #3632 Fix Footer Active Styling 2023-01-09 14:02:23 +01:00
Lorenz Hilpert
2691a217db Lizenz Scandit Update 2023-01-03 14:40:45 +01:00
Lorenz Hilpert
b421f74d1a Merge branch 'feature/scanner-ipad' into develop 2023-01-02 09:43:57 +01:00
Lorenz Hilpert
e3bd33ffc3 Scanner Styling and Login Dialog 2022-12-27 18:52:08 +01:00
Lorenz Hilpert
38c2fd07ae Ipad fix test 2022-12-20 17:05:55 +01:00
Lorenz Hilpert
77ebafd018 Added WWS API - Generated with ng-swagger-gen 2022-12-20 13:13:56 +01:00
Nino Righi
dfab7e3540 Merged PR 1457: #3524 #3599 #3598 Responsive Design History
#3524 #3599 #3598 Responsive Design History
2022-12-19 17:07:43 +00:00
Lorenz Hilpert
e4410fe2c7 Added Scandit Scanner to Application 2022-12-19 14:52:17 +01:00
Lorenz Hilpert
1dbd3fd274 Merged PR 1456: Breite für Desktop angepasst
Related work items: #3700
2022-12-16 11:08:08 +00:00
Michael Auer
abdbab807d Merge branch 'feature/docker-multi-label' into develop 2022-12-15 16:46:00 +01:00
Michael Auer
718077025d ~ helmvalues: removed debug-/prod- prefix from docker image tag 2022-12-15 16:45:59 +01:00
Michael Auer
08161c29d3 ~ back to one tag, added extra label BuildType=(Debug/Production) 2022-12-15 16:45:59 +01:00
Michael Auer
942f84dfcf ! removed single quoutes from docker tags 2022-12-15 16:45:59 +01:00
Michael Auer
41defdc291 ~ added second label (Debug/Production) to docker image 2022-12-15 16:45:59 +01:00
Lorenz Hilpert
045b8e162a Merged PR 1452: Update to Angular 15 2022-11-28 15:13:44 +00:00
Michael Auer
e3d7813edb Merge tag '2.1' into develop 2022-11-21 11:35:18 +01:00
Michael Auer
189dc64a0f Merge branch 'release/2.1' 2022-11-21 11:35:17 +01:00
Lorenz Hilpert
2f0ede7170 Merge branch 'develop' into release/2.1 2022-11-11 14:49:43 +01:00
Lorenz Hilpert
c7e444d446 #3617 CompartmentLabel für Kunden zwischenhspeichern 2022-11-11 10:56:18 +01:00
Lorenz Hilpert
f5ac916663 #3617 QR-Code Reservierungen 2022-11-10 15:02:27 +01:00
Lorenz Hilpert
b3b9f0223e #3629 - Scpeichern doppelclick abfangen 2022-11-10 14:08:50 +01:00
Lorenz Hilpert
70455df6d3 Merge branch 'develop' into release/2.1 2022-11-08 17:19:29 +01:00
Andreas Schickinger
b89889a3e9 Merged PR 1440: #3602 TK Kalenderansicht lädt nur noch die angezeigten Tage
#3602 TK Kalenderansicht lädt nur noch die angezeigten Tage

Related work items: #3602
2022-11-08 15:50:29 +00:00
Lorenz Hilpert
7ec00925ed Merged PR 1441: #3626 Fehlerbehebung bei der Dummy Anlage Änderung
#3626 Fehlerbehebung bei der Dummy Anlage Änderung
2022-11-08 15:40:07 +00:00
Andreas Schickinger
d3e3d127b3 Merged PR 1439: #3602 TK Performance
- Kein Reload mehr bei Wechsel zwischen Trefferliste/Kalenderansicht
- Suche startet ca. 150ms früher bei Page Load
- In der Wochenansicht wird nur noch die aktuelle Woche und 7 Tage in die Vergangenheit geladen (zuvor: aktuelle Woche + 7 Tage Vergangenheit/ 7 Tage Zukunft)
- In der Monatsansicht werden nur noch die Tage des Monats geladen (zuvor: aktueller Monat + 7 Tage Vergangenheit/ 7 Tage Zukunft
- Bugfix: doppelte Suche wurde ausgelöst, wenn man sucht -> zurück zur Übersicht klickt -> nochmal das gleiche sucht

Related work items: #3602
2022-11-08 09:13:21 +00:00
Nino Righi
11c4d8fb72 Merged PR 1438: #3608 Fix typo
#3608 Fix typo
2022-11-07 16:23:23 +00:00
Andreas Schickinger
9b02a19b9c Merged PR 1437: #3609 Remission Schriftfarbe bei Auswahl weiß
#3609 Remission Schriftfarbe bei Auswahl weiß

Related work items: #3609
2022-11-07 15:44:11 +00:00
Michael Auer
57262919b8 Merge tag '2.1.10' into develop 2022-11-07 15:07:34 +01:00
Michael Auer
f787a15347 Merge branch 'release/2.1' 2022-11-07 15:06:31 +01:00
Michael Auer
bc74eac86d Merge tag '2.1.2' into develop 2022-11-07 14:58:16 +01:00
Michael Auer
0a1df250cb Merge commit '9e58e8aad9ae6a6928235dca55b30a0925c668f6' 2022-11-07 14:55:46 +01:00
Lorenz Hilpert
8a7b9de29d Merged PR 1436: #3615 Übernahme der Suchfeld eingabe in die Kundenanlage
#3615 Übernahme der Suchfeld eingabe in die Kundenanlage
2022-11-07 13:31:14 +00:00
Nino Righi
8efb87a1f7 Merged PR 1434: #3610 Fix Added Async Validator Function to p4m number form block
#3610 Fix Added Async Validator Function to p4m number form block
2022-11-03 18:21:07 +00:00
Andreas Schickinger
27ee667bfb Merged PR 1435: #3604 Kubi Checkmarks bei Kundentypanlage angepasst
#3604 Kubi Checkmarks bei Kundentypanlage angepasst

Related work items: #3604
2022-11-03 14:34:30 +00:00
Lorenz Hilpert
c64ff772e7 Merged PR 1433: Kundenanlage: Scanbutton für das scannen der Kundenkarte
Kundenanlage: Scanbutton für das scannen der Kundenkarte
2022-11-03 14:13:58 +00:00
Lorenz Hilpert
313efebb8b #3611 Dialog Anpassung handleAction 2022-11-02 16:47:58 +01:00
Lorenz Hilpert
9eee4fff6c Merged PR 1432: #3613 Wannennummer Scannen - Dialog erweitert
#3613 Wannennummer Scannen - Dialog erweitert
2022-11-02 15:15:48 +00:00
Lorenz Hilpert
b5a7c96181 Merge branch 'develop' into release/2.1 2022-11-02 15:00:54 +01:00
Lorenz Hilpert
5bea71e19e Merged PR 1431: #3611 Dummy Command angelegt
#3611 Dummy Command angelegt
2022-11-02 13:55:01 +00:00
Lorenz Hilpert
751e533dce Merge branch 'release/2.1' into develop 2022-10-28 11:20:42 +02:00
Lorenz Hilpert
9e58e8aad9 Merge branch 'develop' into release/2.1 2022-10-26 18:52:17 +02:00
Lorenz Hilpert
d62a7d704a #3587 Fix rueckgaenging gemacht, da fix im BE 2022-10-26 18:21:16 +02:00
Andreas Schickinger
f8d7d12d61 Merged PR 1430: #3586 WK Hindernis Popup Text angepasst
#3586 WK Hindernis Popup Text angepasst

Related work items: #3586
2022-10-26 16:07:07 +00:00
Lorenz Hilpert
2ad71cad78 #3587 Filter wurde nicht richtig übernommen 2022-10-26 18:04:38 +02:00
Andreas Schickinger
689d8ead24 Merged PR 1427: #3592 TK Tasks Wochenansicht reload wenn sich das DisplayedDate ändert
#3592 TK Tasks Wochenansicht reload wenn sich das DisplayedDate ändert

Related work items: #3592
2022-10-26 14:33:52 +00:00
Andreas Schickinger
b6a7df76f6 Merged PR 1428: #3593 TK Footer Menü Klick setzt den Filter zurück
#3593 TK Footer Menü Klick setzt den Filter zurück

Related work items: #3593
2022-10-26 14:30:27 +00:00
Andreas Schickinger
41e8145858 Merged PR 1429: #3594 TK Zurück zur Übersicht Button
#3594 TK Zurück zur Übersicht Button

Related work items: #3594
2022-10-26 14:29:27 +00:00
Lorenz Hilpert
3a5b80657c Merge branch 'develop' of https://dev.azure.com/hugendubel/ISA/_git/ISA-Frontend into develop 2022-10-26 15:06:23 +02:00
Lorenz Hilpert
41c6897224 uiDateInput - datum mit momentjs parsen 2022-10-26 15:06:16 +02:00
Lorenz Hilpert
8d644cdd65 Merged PR 1426: 3581 Handlungsanweisung
Related work items: #3581
2022-10-25 12:34:39 +00:00
Lorenz Hilpert
7a68229432 Merged PR 1424: #3580 Text in der Kundensuche angepasst
#3580 Text in der Kundensuche angepasst
2022-10-25 11:57:35 +00:00
Lorenz Hilpert
4dab0ef6f6 Merged PR 1425: #3581 Textanpassung für Kundenanlage
#3581 Textanpassung für Kundenanlage
2022-10-25 11:50:22 +00:00
Andreas Schickinger
75cad811bc Merged PR 1423: #3419 TK Suche / Wochenansicht Heute
#3419 TK Suche / Wochenansicht Heute

Related work items: #3419
2022-10-25 08:43:59 +00:00
Lorenz Hilpert
0709f1dd6a Merged PR 1422: #3576 Dialog angepasst und Weiterleitung auf Kundendetails
#3576 Dialog angepasst und Weiterleitung auf Kundendetails

Related work items: #3576
2022-10-24 16:06:00 +00:00
Lorenz Hilpert
478950c446 Merged PR 1421: #3577 Fallback walls Preis undefined ist
#3577 Fallback walls Preis undefined ist
2022-10-24 15:10:13 +00:00
Andreas Schickinger
b5e5601671 Merged PR 1420: #3420 TK Routing
#3420 TK Routing

Related work items: #3420
2022-10-24 14:50:15 +00:00
Lorenz Hilpert
0ee86faa00 Merged PR 1418: Suchbutton werden nicht immer angezeigt
Related work items: #3546
2022-10-24 14:10:30 +00:00
Andreas Schickinger
fa7b204f89 Merged PR 1419: #3547 TK iPad Drucken Button
#3547 TK iPad Drucken Button

Related work items: #3547
2022-10-24 14:06:55 +00:00
Lorenz Hilpert
22f9ba80fe removed unused icons 2022-10-21 16:15:11 +02:00
Michael Auer
065878a6e9 ~ Version Bump: 2.1 2022-10-21 15:35:52 +02:00
Lorenz Hilpert
5df433d603 #3559 PDP falsche Farbe von Reiter-Hintergrund 2022-10-21 14:41:14 +02:00
Lorenz Hilpert
21375855dd #3556 HFI Gutschein Kaufoption im Nachhinein ändern 2022-10-21 14:36:48 +02:00
Lorenz Hilpert
b847ca6b3e #3554 AGB ist Akzeptiert wenn Dialog mit Ja beantwortet wird 2022-10-21 14:26:53 +02:00
Andreas Schickinger
50caf9811d Merged PR 1416: #3520 HFI Geschenkkarte Mengenänderung übergibt Preis
#3520 HFI Geschenkkarte Mengenänderung übergibt Preis

Related work items: #3520
2022-10-21 10:58:21 +00:00
Andreas Schickinger
f0df9e1157 Merged PR 1417: #3571 TK Kalender Klicks navigieren wieder zur Liste
#3571 TK Kalender Klicks navigieren wieder zur Liste

Related work items: #3571
2022-10-21 10:57:53 +00:00
Lorenz Hilpert
3e1347f17e #3573 Breadcrumb Fix 2022-10-20 16:06:10 +02:00
Lorenz Hilpert
86082bbfda #3572 Chckbox Plazierung 2022-10-20 15:21:10 +02:00
Lorenz Hilpert
6e6551ceae #3567 B2B Meldenummer auf der Artikeldetailseite 2022-10-20 14:13:11 +02:00
Lorenz Hilpert
08ef5f0853 #3568 Typo Rechnungsadresse 2022-10-20 13:53:48 +02:00
Lorenz Hilpert
92131453e8 #3422 Focus Searchbar nach Seitenwechsel TK 2022-10-20 13:33:44 +02:00
Lorenz Hilpert
888a95d2a0 #3233 CRM API Anpassung für Kundenkartencheck 2022-10-20 13:12:52 +02:00
Lorenz Hilpert
ab745cba18 #2748 Icons Kundentrefferliste und Details 2022-10-20 11:44:12 +02:00
Lorenz Hilpert
dfe6b3977f #3554 Dialog angepasst 2022-10-19 16:51:06 +02:00
Lorenz Hilpert
e7e8b71a70 Merge branch 'develop' of https://dev.azure.com/hugendubel/ISA/_git/ISA-Frontend into develop 2022-10-19 13:45:12 +02:00
Lorenz Hilpert
c158e16bd3 #3553 Plattierung AGB akzeptieren 2022-10-19 13:45:04 +02:00
Andreas Schickinger
464fac660b Merged PR 1415: #3543 TK iPad Scrolling
#3543 TK iPad Scrolling

Related work items: #3543
2022-10-19 11:21:18 +00:00
Lorenz Hilpert
79b1920b15 #3542 WA Keine Suchanfrage wenn Daten bereits vorhanden sind 2022-10-18 11:33:52 +02:00
Andreas Schickinger
f071e7b2d5 Merged PR 1411: #3527 Kundenkarten Validator
#3527 Kundenkarten Validator

Related work items: #3527
2022-10-17 15:30:52 +00:00
Andreas Schickinger
3afb8d6ed1 Merged PR 1412: #3422 TK Suchfeld Autofocus directive und Laufende Aufgaben auch ausblenden,...
#3422 TK Suchfeld Autofocus directive und Laufende Aufgaben auch ausblenden, wenn keine vorhanden

Related work items: #3422
2022-10-17 15:03:52 +00:00
Andreas Schickinger
87a2e94dd6 Merged PR 1406: #3496 HFI Geschenkkarte max Preis fix
#3496 HFI Geschenkkarte max Preis fix

Related work items: #3496
2022-10-17 14:01:42 +00:00
Andreas Schickinger
d711d4a816 Merged PR 1409: #3419 TK Überfällige Aufgaben nur anzeigen, wenn vorhanden
#3419 TK Überfällige Aufgaben nur anzeigen, wenn vorhanden

Related work items: #3419
2022-10-17 13:55:47 +00:00
Lorenz Hilpert
a4b4aeed64 #3471 Email entfernen bei klick auf nein 2022-10-17 15:51:08 +02:00
Lorenz Hilpert
3707572bd8 Merge branch 'develop' of https://dev.azure.com/hugendubel/ISA/_git/ISA-Frontend into develop 2022-10-17 15:48:37 +02:00
Lorenz Hilpert
aef5c06f0a #3531 CSS Kundenanlage Speichern Button Position 2022-10-17 15:48:26 +02:00
Lorenz Hilpert
a021ac0da3 Merged PR 1410: #3503 IPad Sortierung im TK falsh
#3503 IPad Sortierung im TK falsh
2022-10-17 13:40:33 +00:00
Lorenz Hilpert
1e4e6da44e Merged PR 1408: #3545 Fix Icon Positions IPad mini 2
#3545 Fix Icon Positions IPad mini 2
2022-10-17 12:46:45 +00:00
Andreas Schickinger
6b0d9774c5 Merged PR 1407: #3423 TK Kalendar klicks navigieren nicht mehr zur Listenansicht
#3423 TK Kalendar klicks navigieren nicht mehr zur Listenansicht

Related work items: #3423
2022-10-17 11:55:20 +00:00
Lorenz Hilpert
e1720e6023 Merged PR 1405: icon scss 2022-10-14 14:24:12 +00:00
Lorenz Hilpert
3078724ced #3540 Text Änderung Interessen 2022-10-14 15:20:51 +02:00
Lorenz Hilpert
f3eb0a67f6 #3539 Typo Interessen 2022-10-14 15:19:53 +02:00
Lorenz Hilpert
65d7a6f5a4 Merged PR 1404: #3471 Zusätzliche addressen werden nun gespeichert
#3471 Zusätzliche addressen werden nun gespeichert

Related work items: #3471
2022-10-14 11:36:44 +00:00
Lorenz Hilpert
b2b5456400 Merged PR 1403: #3518 Checkbox ist nicht abwählbar bei einer checkbox
#3518 Checkbox ist nicht abwählbar bei einer checkbox
2022-10-14 10:08:29 +00:00
Lorenz Hilpert
a598be069d Merge branch 'develop' of https://dev.azure.com/hugendubel/ISA/_git/ISA-Frontend into develop 2022-10-14 10:55:59 +02:00
Andreas Schickinger
bf61f2c982 Merged PR 1402: #3507 Listenbestellung getPickUpAvailability hack
#3507 Listenbestellung getPickUpAvailability hack

Related work items: #3507
2022-10-14 08:49:41 +00:00
Lorenz Hilpert
63225491f1 FIX CUSTOMER CREATE NAVIGATION 2022-10-13 18:37:18 +02:00
Andreas Schickinger
0dbc773775 Merged PR 1400: #3496 HFI Geschenkkarte max Preis
#3496 HFI Geschenkkarte max Preis

Related work items: #3496
2022-10-13 13:10:34 +00:00
Lorenz Hilpert
47b7d42dd3 Merged PR 1399: #3227 Anpassung der Handlungsanweisung
#3227 Anpassung der Handlungsanweisung
2022-10-13 13:06:36 +00:00
Lorenz Hilpert
d713c787e6 Merged PR 1398: #3515 Added Newsletter Text to webshop and fix navigation
#3515 Added Newsletter Text to webshop and fix navigation
2022-10-13 13:05:56 +00:00
Lorenz Hilpert
68a2eab425 Merged PR 1396: #3502 Guard bei navigation auf P4M Anlage angepasst
#3502 Guard bei navigation auf P4M Anlage angepasst
2022-10-12 15:02:17 +00:00
Andreas Schickinger
886f063d1b Fix für Anzeigefehler im SectionToggle 2022-10-12 16:40:29 +02:00
Andreas Schickinger
ed6ee36509 Merged PR 1395: #3481 Remission Filter zwischenspeichern bei Wechsel zwischen Pflicht- und Ab...
#3481 Remission Filter zwischenspeichern bei Wechsel zwischen Pflicht- und Abteilungsremission

Related work items: #3481
2022-10-12 13:57:28 +00:00
Andreas Schickinger
ab345dae0d Merged PR 1393: #3514 TK Fehlermeldung fix
#3514 TK Fehlermeldung fix

Related work items: #3514
2022-10-12 13:39:29 +00:00
Lorenz Hilpert
fbb1e6c4a2 Merged PR 1394: #3511 Addressvalidierung für Onlinekonto aktiviert
#3511 Addressvalidierung für Onlinekonto aktiviert
2022-10-12 10:38:35 +00:00
Lorenz Hilpert
4ede9226b4 Merged PR 1392: #3484 Keep Userstates on Tab Changes
#3484 Keep Userstates on Tab Changes
2022-10-11 15:05:04 +00:00
Andreas Schickinger
fbfecbd8ae Merged PR 1391: TK Suche Timespan Fallback angepasst
TK Suche Timespan von 6 Monate Vergangenheit/Zukunft auf 6 Wochen Vergangenheit, 2 Wochen Zukunft geändert. Wird verwendet, wenn kein Timespan Filter gesetzt ist

Related work items: #3422
2022-10-11 14:32:30 +00:00
Lorenz Hilpert
3c4612d15c Merged PR 1389: #3307 Filter Wird Nicht Gerendert
#3307 Filter Wird Nicht Gerendert
2022-10-11 13:33:10 +00:00
Andreas Schickinger
7fa2e7862d Merged PR 1388: #3508 Bestellbestätigung "zur Warenausgabe": Prüfung auf enabled bei CustomerFeature B2B entfernt
#3508 Prüfung auf enabled bei CustomerFeature B2B entfernt

Related work items: #3508
2022-10-11 12:16:07 +00:00
Andreas Schickinger
114267362c Merged PR 1384: #3503 TK Sortierung umgedreht, #3504 Scroll Fix
#3503 TK Sortierung umgedreht, #3504 Scroll Fix

Related work items: #3503, #3504
2022-10-11 11:06:01 +00:00
Lorenz Hilpert
4050e9605d FIX Routing Kundenalage 2022-10-11 10:41:25 +02:00
Andreas Schickinger
fdd5373aaf Merged PR 1385: #3493 TK Modal Header Abstand erhöht
#3493 TK Modal Header Abstand erhöht

Related work items: #3493
2022-10-10 15:59:04 +00:00
Andreas Schickinger
2dfe7ec05b Merged PR 1386: #3492 TK Drucken in der Trefferliste fix
#3492 TK Drucken in der Trefferliste fix

Related work items: #3492
2022-10-10 15:58:42 +00:00
Lorenz Hilpert
82513b5dde Merged PR 1387: Kubi Kundenanlage und Kundenkarte
Related work items: #3230, #3233
2022-10-10 15:57:50 +00:00
Lorenz Hilpert
14d1bb6ac8 Merged PR 1383: HFI Geschnakkarte
Related work items: #3496
2022-10-07 14:20:05 +00:00
Lorenz Hilpert
d589c94681 Fix Kundendatenerfassen - added modifier add-loyality-card 2022-10-06 12:42:45 +02:00
Lorenz Hilpert
eca19bb507 Updateing Customer for P4M 2022-10-06 10:47:10 +02:00
Lorenz Hilpert
282ff30b3e #3494 Upgrade Ava API auf v6 2022-10-05 13:58:02 +02:00
Lorenz Hilpert
5d0b810674 Upgrade catsearch API auf V6 2022-10-05 13:54:12 +02:00
Lorenz Hilpert
e32482c634 Type Kundendaten erfassen speichern aufruf 2022-10-05 13:25:43 +02:00
Lorenz Hilpert
650026b0c0 Es existiert bereits ein Onlinekonto 2022-10-04 17:48:15 +02:00
Lorenz Hilpert
cd25d6da38 #3489 fonts 2022-10-04 12:10:17 +02:00
Andreas Schickinger
9dd0954967 Merged PR 1381: #3326 Tätigkeitskalender Suchfunktion und neues Design
Tätigkeitskalender Suchfunktion und neues Design

Zusätzliche Änderungen im PR:
- Anpassungen für GitHub package Zugriff
- UiModalRef um ein afterChanged$ erweitert, um nach dem schließen zu erkennen ob ein reload notwendig ist
- ui-loader funktionierte nicht bei verwendung von ui-scroll-container mit useLoadAnimation false
- ui-skeleton-loader um Template für TK Listenitem erweitert

Related work items: #3419, #3420, #3421, #3422, #3423
2022-10-04 09:42:49 +00:00
Lorenz Hilpert
fdaceb9bf8 Merged PR 1382: Kubi
Related work items: #3228, #3230, #3289, #3467, #3471, #3478
2022-09-30 13:48:19 +00:00
Lorenz Hilpert
4ab3a3b3cf #3307 Fixed With Filter 2022-09-30 11:19:17 +02:00
Lorenz Hilpert
eb8b54dc63 Fix Unit Test 2022-09-29 18:05:43 +02:00
Lorenz Hilpert
4703aee60c Interveptor Unit Test Fix 2022-09-29 16:26:43 +02:00
Lorenz Hilpert
93b0d43bd7 #3307 Anzeige des backdrops bei Filtern 2022-09-29 14:20:41 +02:00
Lorenz Hilpert
1029310e0d #3483 Neuanmeldung bei 401 Antworten 2022-09-29 14:11:59 +02:00
Michael Auer
c083684db2 Merge tag '3452-Autocomplete-Abbrechen-Bei-Suche' into develop 2022-09-28 22:19:03 +02:00
Michael Auer
d6775aad69 Merge branch 'hotfix/3452-Autocomplete-Abbrechen-Bei-Suche' 2022-09-28 22:19:02 +02:00
Lorenz Hilpert
3eff10bbb4 Merged PR 1380: Upgrade der API auf V6
Upgrade der API auf V6

Related work items: #3466
2022-09-20 16:14:50 +00:00
Lorenz Hilpert
e4cbab8365 Merged PR 1379: #3428 Aktivierung der Buttons ohne Raio button aktivieren wenn nur ein artikel
#3428 Aktivierung der Buttons ohne Raio button aktivieren wenn nur ein artikel
2022-09-15 16:05:12 +00:00
Lorenz Hilpert
18212e7a4c Merged PR 1378: Update CRM API V6
Update CRM API V6
2022-09-14 15:13:14 +00:00
Lorenz Hilpert
0cd0b1abfd Merged PR 1377: Update CRM API
Related work items: #3464
2022-09-14 13:48:25 +00:00
Lorenz Hilpert
a66137873c Merged PR 1376: #3448 Anzeige Sonderinfo
#3448 Anzeige Sonderinfo
2022-09-14 08:26:29 +00:00
Andreas Schickinger
469110eabf Merged PR 1375: #3455 AHF Frist immer für gesamten Warenkorb festlegen
#3455 AHF Frist immer für gesamten Warenkorb festlegen

Related work items: #3455
2022-09-13 13:08:59 +00:00
Lorenz Hilpert
55474fa4e3 Merged PR 1374: #3451 nach löschen des Browser-Verlauf kommt Fehler
#3451 nach löschen des Browser-Verlauf kommt Fehler
2022-09-13 12:56:17 +00:00
Lorenz Hilpert
3bdcdee031 #3452 Autocomplete wird nicht abgebrochen, wenn Suche ausgelöst wurde 2022-09-12 14:34:24 +02:00
Lorenz Hilpert
246c5a61dd Merged PR 1373: #3428 bei Teilabholung ohne ausgewählten Radio-Button wirf Fehler
#3428 bei Teilabholung ohne ausgewählten Radio-Button wirf Fehler
2022-09-08 13:20:45 +00:00
Andreas Schickinger
0c8bfba515 Merged PR 1372: #3340 Quantity Dropdown um Suffix erweitert
#3340 Quantity Dropdown um Suffix erweitert

Related work items: #3340
2022-09-01 08:23:20 +00:00
Michael Auer
3c8d9bb1e5 Merge tag '2.0' into develop 2022-08-24 10:33:19 +02:00
Michael Auer
da2c1c8316 Merge branch 'release/2.0' 2022-08-24 10:33:18 +02:00
Lorenz Hilpert
0334b2dd33 Merge branch 'release/2.0' into develop 2022-08-23 14:24:21 +02:00
Lorenz Hilpert
96356042af Remission - Anpassung HTML fuer E2E Tests 2022-08-23 14:02:50 +02:00
Lorenz Hilpert
21adff8d0c #3140 Button "Nicht-Clickbar"-Icon nur wenn disabled 2022-08-22 16:11:51 +02:00
Lorenz Hilpert
35def2a7c7 #3405 Kalender -Speichern-Button verschwindet 2022-08-19 17:07:30 +02:00
Lorenz Hilpert
e3d82794a3 Merge branch 'develop' of https://dev.azure.com/hugendubel/ISA/_git/ISA-Frontend into develop 2022-08-19 15:55:10 +02:00
Lorenz Hilpert
20cbac8f17 #3140 Ausgrauen des Auswaehlen Buttons fur
Zuruecklegen bis
2022-08-19 15:55:01 +02:00
Lorenz Hilpert
6067e02729 #3400 Uebergabe 0 Eur wenn kein Preis existiert 2022-08-18 16:57:06 +02:00
Lorenz Hilpert
eb77664ea1 #3387 - Auswertung der Kapazitaeten angepasst 2022-08-18 15:38:24 +02:00
Michael Auer
8b1baf9ebd Merge tag '2.0.531' into develop 2022-08-18 13:47:13 +02:00
Lorenz Hilpert
d79dbb11fe #2162 - Warnung eingebaut und Anzeigefehler behoben 2022-08-17 17:08:09 +02:00
Lorenz Hilpert
19ccb29248 #2162 - WA - Auf der Details Seite werden nur items mit dem gleichen Kunden angezeigt. 2022-08-16 15:29:33 +02:00
Lorenz Hilpert
199c4f30e7 #3139 Loder angepasst 2022-08-11 17:23:20 +02:00
Lorenz Hilpert
732c0d4e35 #3139 Load Spinner für Abholfrist 2022-08-10 16:50:29 +02:00
Lorenz Hilpert
fa1769da9f 2022-08-08 12:10:19 +02:00
Lorenz Hilpert
029997d624 #3338 - Uebergabe Filter angepasst 2022-08-08 11:56:46 +02:00
Andreas Schickinger
d2546409cb Merged PR 1370: #3139 Abholfachfrist: Für alle festlegen Button in Bestellbestätigung
#3139 Abholfachfrist: Für alle festlegen Button in Bestellbestätigung

Related work items: #3139
2022-08-08 08:46:00 +00:00
Andreas Schickinger
cb2bc8d65b Merged PR 1369: #3332 AHFFrist DisplayOrderItemSubsetDTO verwendet
#3332 AHFFrist DisplayOrderItemSubsetDTO verwendet

Related work items: #3332
2022-08-04 13:38:39 +00:00
Andreas Schickinger
57bd8d4dd4 Merged PR 1368: #3337 Hotfix E-Mail Adresse wird nur noch angehakt, wenn auch eine hinterlegt ist
#3337 E-Mail Adresse wird nur noch angehakt, wenn auch eine hinterlegt ist

Related work items: #3337
2022-08-04 09:45:59 +00:00
Andreas Schickinger
cc1e210799 Merged PR 1367: #3139, #3140, #3328 AHFFrist auf Bestellbestätigung- und Bestellpostenseite
Related work items: #3139, #3140, #3328
2022-08-03 13:51:25 +00:00
Lorenz Hilpert
4bee08d483 Merged PR 1366: Merge release => develop
Related work items: #3180, #3203, #3245, #3293, #3299, #3312, #3320, #3322
2022-08-02 12:30:08 +00:00
1306 changed files with 20736 additions and 19510 deletions

7
.browserslistrc Normal file
View File

@@ -0,0 +1,7 @@
last 1 Chrome version
last 1 Firefox version
last 2 Edge major versions
last 2 iOS major versions
safari > 11
Firefox ESR
not IE 11 # Angular supports IE 11 only as an opt-in. To opt-in, remove the 'not' prefix on this line.

1
.gitignore vendored
View File

@@ -31,6 +31,7 @@ speed-measure-plugin.json
.history/*
# misc
/.angular/cache
/.sass-cache
/connect.lock
/coverage

4
.npmrc
View File

@@ -1,3 +1 @@
@isa:registry=https://pkgs.dev.azure.com/hugendubel/_packaging/hugendubel%40Local/npm/registry/
@cmf:registry=https://pkgs.dev.azure.com/hugendubel/_packaging/hugendubel%40Local/npm/registry/
always-auth=true
@paragondata:registry=https://npm.pkg.github.com

View File

File diff suppressed because it is too large Load Diff

View File

@@ -1,22 +1,18 @@
import { Injectable } from '@angular/core';
import { Injectable, isDevMode } from '@angular/core';
import { PromptModalData, UiModalService, UiPromptModalComponent } from '@ui/modal';
import { Observable } from 'rxjs';
import { ScanAdapter } from './scan-adapter';
@Injectable()
export class DevScanAdapter implements ScanAdapter {
readonly name = 'Dev';
constructor(private _modal: UiModalService) {}
getName(): string {
return 'Dev Scanner';
}
isPrimary(): boolean {
return true;
}
isReady(): boolean {
return true;
init(): Promise<boolean> {
return new Promise((resolve, reject) => {
resolve(isDevMode());
});
}
scan(): Observable<string> {

View File

@@ -6,20 +6,14 @@ import { ScanAdapter } from './scan-adapter';
@Injectable()
export class NativeScanAdapter implements ScanAdapter {
readonly name = 'Native';
constructor(private readonly nativeContainerService: NativeContainerService) {}
getName(): string {
return 'Native Scanner';
}
isPrimary(): boolean {
return true;
}
isReady(): boolean {
// TODO: Fix Login Keycard Dauerschleife
return this.nativeContainerService.isUiWebview().isNative || this.nativeContainerService.isIpadMini6();
// return false;
init(): Promise<boolean> {
return new Promise((resolve, reject) => {
resolve(this.nativeContainerService.isUiWebview().isNative);
});
}
scan(): Observable<string> {

View File

@@ -1,11 +1,18 @@
import { Observable } from 'rxjs';
export interface ScanAdapter {
getName(): string;
/**
* Name to identify the adapter
*/
readonly name: string;
isPrimary(): boolean;
isReady(): boolean;
/**
* @returns true if this adapter can be used
*/
init(): Promise<boolean>;
/**
* scan for a barcode
*/
scan(): Observable<string>;
}

View File

@@ -5,10 +5,13 @@ import { SCAN_ADAPTER } from './tokens';
@NgModule({})
export class ScanAdapterModule {
static forRoot(dev?: boolean) {
static forRoot() {
return {
ngModule: ScanAdapterModule,
providers: [{ provide: SCAN_ADAPTER, useClass: NativeScanAdapter, multi: true }],
providers: [
{ provide: SCAN_ADAPTER, useClass: NativeScanAdapter, multi: true },
{ provide: SCAN_ADAPTER, useClass: DevScanAdapter, multi: true },
],
// Use for testing:
// providers: [{ provide: SCAN_ADAPTER, useClass: dev ? DevScanAdapter : NativeScanAdapter, multi: true }],
};

View File

@@ -1,4 +1,5 @@
import { Inject, Injectable } from '@angular/core';
import { Observable, throwError } from 'rxjs';
import { ScanAdapter } from './scan-adapter';
import { SCAN_ADAPTER } from './tokens';
@@ -6,25 +7,59 @@ import { SCAN_ADAPTER } from './tokens';
providedIn: 'root',
})
export class ScanAdapterService {
private _readyAdapters: Record<string, boolean> = {};
constructor(@Inject(SCAN_ADAPTER) private readonly scanAdapters: ScanAdapter[]) {}
scanners() {
return this.scanAdapters.filter((adapter) => adapter.isReady());
}
scanner() {
return this.scanners().find((scanner) => scanner.isPrimary()) || this.scanners().find(() => true);
}
isReady() {
return this.scanAdapters.some((adapter) => adapter.isReady());
}
scan() {
const primaryScanner = this.scanner();
if (primaryScanner) {
return primaryScanner.scan();
async init(): Promise<void> {
for (const adapter of this.scanAdapters) {
const isReady = await adapter.init();
console.log('ScanAdapterService.init', adapter.name, isReady);
this._readyAdapters[adapter.name] = isReady;
}
return null;
}
adapters(): ScanAdapter[] {
return [...this.scanAdapters];
}
getAdapter(name: string): ScanAdapter | undefined {
return this.scanAdapters.find((adapter) => adapter.name === name);
}
// return true if at least one adapter is ready
isReady(): boolean {
return Object.values(this._readyAdapters).some((ready) => ready);
}
scan(ops: { use?: string; include?: string[]; exclude?: string[] } = { exclude: ['Dev'] }): Observable<string> {
let adapter: ScanAdapter;
if (ops.use == undefined) {
// get the first adapter that is ready to use
adapter = this.scanAdapters
.filter((adapter) => {
if (ops.include?.length) {
return ops.include.includes(adapter.name);
} else if (ops.exclude?.length) {
return !ops.exclude.includes(adapter.name);
} else {
return true;
}
})
.find((adapter) => this._readyAdapters[adapter.name]);
} else {
adapter = this.getAdapter(ops.use);
}
if (!adapter) {
return throwError('No adapter found');
}
if (this._readyAdapters[adapter.name] == false) {
return throwError('Adapter is not ready');
}
return adapter.scan();
}
}

View File

@@ -0,0 +1,3 @@
export * from './scandit-overlay.component';
export * from './scandit-scan-adapter.module';
export * from './scandit.scan-adapter';

View File

@@ -0,0 +1,20 @@
:host {
@apply block relative;
}
.scanner-container {
width: 100vw;
max-width: 95vw;
max-height: calc(95vh - 120px);
}
.close-scanner {
@apply block px-6 py-4 bg-white text-brand border-2 border-solid border-brand rounded-full text-lg font-bold mx-auto mt-4;
}
@screen desktop {
.scanner-container {
max-width: 900px;
max-height: 900px;
}
}

View File

@@ -0,0 +1,4 @@
<div class="scanner-container" #scanContainer></div>
<button class="close-scanner" type="button" (click)="close()">
Scan abbrechen
</button>

View File

@@ -0,0 +1,100 @@
import { Component, ChangeDetectionStrategy, ElementRef, ViewChild, NgZone, AfterViewInit, OnDestroy } from '@angular/core';
import { UiMessageModalComponent, UiModalService } from '@ui/modal';
import { Barcode, BarcodePicker, ScanResult, ScanSettings } from 'scandit-sdk';
@Component({
selector: 'app-scandit-overlay',
templateUrl: 'scandit-overlay.component.html',
styleUrls: ['scandit-overlay.component.css'],
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class ScanditOverlayComponent implements AfterViewInit, OnDestroy {
private _barcodePicker: BarcodePicker;
private _onScan?: (code: string) => void;
private _onClose?: () => void;
@ViewChild('scanContainer', { read: ElementRef, static: true }) scanContainer: ElementRef;
constructor(private _zone: NgZone, private _modal: UiModalService) {}
ngAfterViewInit(): void {
this.createBarcodePicker()
.then(() => {
this._barcodePicker.on('scan', (scanResult) => {
this._zone.run(() => this.handleScanrResult(scanResult));
});
})
.catch((err: Error) => {
this._modal
.open({
content: UiMessageModalComponent,
title: 'Zugriff auf Kamera verweigert',
data: { message: 'Falls Sie den Zugriff erlauben möchten, können Sie das über die Webseiteinstellung Ihres Browsers.' },
})
.afterClosed$.subscribe(() => {
this._onClose?.();
});
});
}
async createBarcodePicker() {
this._barcodePicker = await BarcodePicker.create(this.scanContainer.nativeElement, {
playSoundOnScan: true,
vibrateOnScan: true,
});
this._barcodePicker.applyScanSettings(this.getScanSettings());
}
getScanSettings(): ScanSettings {
return new ScanSettings({
blurryRecognition: false,
enabledSymbologies: [
Barcode.Symbology.EAN8,
Barcode.Symbology.EAN13,
Barcode.Symbology.UPCA,
Barcode.Symbology.UPCE,
Barcode.Symbology.CODE128,
Barcode.Symbology.CODE39,
Barcode.Symbology.CODE93,
Barcode.Symbology.INTERLEAVED_2_OF_5,
Barcode.Symbology.QR,
],
codeDuplicateFilter: 1000,
});
}
onScan(fn: (code: string) => void) {
this._onScan = fn;
}
onClose(fn: () => void) {
this._onClose = fn;
}
handleScanrResult(scanRestul: ScanResult) {
let result: string | undefined;
if (scanRestul.barcodes.length) {
result = scanRestul.barcodes[0].data;
} else if (scanRestul.texts.length) {
result = scanRestul.texts[0].value;
}
if (result) {
this._onScan?.(result);
}
}
close() {
this._onClose?.();
}
ngOnDestroy(): void {
this._zone.runOutsideAngular(() => {
this._barcodePicker?.destroy(true);
});
}
}

View File

@@ -0,0 +1,20 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { ScanditOverlayComponent } from './scandit-overlay.component';
import { ScanditScanAdapter } from './scandit.scan-adapter';
import { SCAN_ADAPTER } from '../tokens';
@NgModule({
imports: [CommonModule],
exports: [ScanditOverlayComponent],
declarations: [ScanditOverlayComponent],
})
export class ScanditScanAdapterModule {
static forRoot() {
return {
ngModule: ScanditScanAdapterModule,
providers: [{ provide: SCAN_ADAPTER, useClass: ScanditScanAdapter, multi: true }],
};
}
}

View File

@@ -0,0 +1,77 @@
import { Injectable } from '@angular/core';
import { Observable, Subscriber } from 'rxjs';
import { ScanAdapter } from '../scan-adapter';
import { Overlay } from '@angular/cdk/overlay';
import { configure } from 'scandit-sdk';
// import { ScanditModalComponent } from './scandit-modal';
import { Config } from '@core/config';
import { ComponentPortal } from '@angular/cdk/portal';
import { ScanditOverlayComponent } from './scandit-overlay.component';
@Injectable()
export class ScanditScanAdapter implements ScanAdapter {
readonly name = 'Scandit';
constructor(private readonly _config: Config, private _overlay: Overlay) {}
async init(): Promise<boolean> {
await configure(this._config.get('licence.scandit'), {
engineLocation: '/scandit/',
});
return true;
}
scan(): Observable<string> {
return new Observable((observer) => {
const overlay = this.createOverlay();
const portal = this.createPortal();
const ref = overlay.attach(portal);
const sub = new Subscriber();
const complete = () => {
overlay.detach();
ref.destroy();
sub.unsubscribe();
sub.complete();
observer.complete();
};
sub.add(
overlay.backdropClick().subscribe(() => {
complete();
})
);
ref.instance.onScan((code) => {
observer.next(code);
complete();
});
ref.instance.onClose(() => {
complete();
});
return complete;
});
}
createOverlay() {
const overlay = this._overlay.create({
positionStrategy: this._overlay.position().global().centerHorizontally().centerVertically(),
hasBackdrop: true,
});
return overlay;
}
createPortal() {
const portal = new ComponentPortal(ScanditOverlayComponent);
return portal;
}
}

View File

@@ -2,5 +2,10 @@
* Public API Surface of scan
*/
export * from './lib/scan.service';
export * from './lib/scandit';
export * from './lib/dev.scan-adapter';
export * from './lib/native.scan-adapter';
export * from './lib/scan-adapter';
export * from './lib/scan.module';
export * from './lib/scan.service';
export * from './lib/tokens';

View File

@@ -5,21 +5,5 @@ import 'zone.js/testing';
import { getTestBed } from '@angular/core/testing';
import { BrowserDynamicTestingModule, platformBrowserDynamicTesting } from '@angular/platform-browser-dynamic/testing';
declare const require: {
context(
path: string,
deep?: boolean,
filter?: RegExp
): {
keys(): string[];
<T>(id: string): T;
};
};
// First, initialize the Angular testing environment.
getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting(), { teardown: { destroyAfterEach: true } });
// Then we find all the tests.
const context = require.context('./', true, /\.spec\.ts$/);
// And load the modules.
context.keys().map(context);

View File

@@ -3,7 +3,6 @@
"extends": "../../../tsconfig.json",
"compilerOptions": {
"outDir": "../../../out-tsc/lib",
"target": "es2015",
"declaration": true,
"declarationMap": true,
"inlineSources": true,

View File

@@ -5,20 +5,7 @@ import 'zone.js/testing';
import { getTestBed } from '@angular/core/testing';
import { BrowserDynamicTestingModule, platformBrowserDynamicTesting } from '@angular/platform-browser-dynamic/testing';
declare const require: {
context(
path: string,
deep?: boolean,
filter?: RegExp
): {
keys(): string[];
<T>(id: string): T;
};
};
// First, initialize the Angular testing environment.
getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting());
// Then we find all the tests.
const context = require.context('./', true, /\.spec\.ts$/);
// And load the modules.
context.keys().map(context);
getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting(), {
teardown: { destroyAfterEach: false },
});

View File

@@ -3,7 +3,6 @@
"extends": "../../../tsconfig.json",
"compilerOptions": {
"outDir": "../../../out-tsc/lib",
"target": "es2015",
"declaration": true,
"declarationMap": true,
"inlineSources": true,

View File

@@ -5,6 +5,6 @@
"declarationMap": false
},
"angularCompilerOptions": {
"enableIvy": false
"compilationMode": "partial"
}
}

View File

@@ -5,20 +5,7 @@ import 'zone.js/testing';
import { getTestBed } from '@angular/core/testing';
import { BrowserDynamicTestingModule, platformBrowserDynamicTesting } from '@angular/platform-browser-dynamic/testing';
declare const require: {
context(
path: string,
deep?: boolean,
filter?: RegExp
): {
keys(): string[];
<T>(id: string): T;
};
};
// First, initialize the Angular testing environment.
getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting());
// Then we find all the tests.
const context = require.context('./', true, /\.spec\.ts$/);
// And load the modules.
context.keys().map(context);
getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting(), {
teardown: { destroyAfterEach: false },
});

View File

@@ -3,7 +3,6 @@
"extends": "../../../tsconfig.json",
"compilerOptions": {
"outDir": "../../../out-tsc/lib",
"target": "es2015",
"declaration": true,
"declarationMap": true,
"inlineSources": true,

View File

@@ -5,6 +5,6 @@
"declarationMap": false
},
"angularCompilerOptions": {
"enableIvy": false
"compilationMode": "partial"
}
}

View File

@@ -31,7 +31,11 @@ export class AuthService {
this._oAuthService.tokenValidationHandler = new JwksValidationHandler();
this._oAuthService.setupAutomaticSilentRefresh();
await this._oAuthService.loadDiscoveryDocumentAndTryLogin();
try {
await this._oAuthService.loadDiscoveryDocumentAndTryLogin();
} catch (error) {
this.login();
}
this._initialized.next(true);
}

View File

@@ -5,21 +5,5 @@ import 'zone.js/testing';
import { getTestBed } from '@angular/core/testing';
import { BrowserDynamicTestingModule, platformBrowserDynamicTesting } from '@angular/platform-browser-dynamic/testing';
declare const require: {
context(
path: string,
deep?: boolean,
filter?: RegExp
): {
keys(): string[];
<T>(id: string): T;
};
};
// First, initialize the Angular testing environment.
getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting(), { teardown: { destroyAfterEach: true } });
// Then we find all the tests.
const context = require.context('./', true, /\.spec\.ts$/);
// And load the modules.
context.keys().map(context);

View File

@@ -3,7 +3,6 @@
"extends": "../../../tsconfig.json",
"compilerOptions": {
"outDir": "../../../out-tsc/lib",
"target": "es2015",
"declaration": true,
"declarationMap": true,
"inlineSources": true,

View File

@@ -20,7 +20,7 @@ export const selectBreadcrumbById = createSelector(selectEntities, (entities, id
/**
* Gibt alle Breadcrumb Entities als Array zurück die den key enthalten
*/
export const selectBreadcrumbsByKey = createSelector(selectAll, (entities, key: string) => entities.filter((crumb) => crumb.key === key));
export const selectBreadcrumbsByKey = createSelector(selectAll, (entities, key: string) => entities.filter((crumb) => crumb.key == key));
/**
* Gibt alle Breadcrumb Entities als Array zurück die den key und tag enthalten
@@ -28,7 +28,7 @@ export const selectBreadcrumbsByKey = createSelector(selectAll, (entities, key:
export const selectBreadcrumbsByKeyAndTag = createSelector(
selectAll,
(entities: Breadcrumb[], { key, tag }: { key: string; tag: string }) =>
entities.filter((crumb) => crumb.key === key && isArray(crumb.tags) && crumb.tags.includes(tag))
entities.filter((crumb) => crumb.key == key && isArray(crumb.tags) && crumb.tags.includes(tag))
);
/**
@@ -37,7 +37,7 @@ export const selectBreadcrumbsByKeyAndTag = createSelector(
export const selectBreadcrumbsByKeyAndTags = createSelector(
selectAll,
(entities: Breadcrumb[], { key, tags }: { key: string; tags: string[] }) =>
entities.filter((crumb) => crumb.key === key && isArray(crumb.tags) && tags.every((tag) => crumb.tags.includes(tag)))
entities.filter((crumb) => crumb.key == key && isArray(crumb.tags) && tags.every((tag) => crumb.tags.includes(tag)))
);
/**

View File

@@ -5,20 +5,7 @@ import 'zone.js/testing';
import { getTestBed } from '@angular/core/testing';
import { BrowserDynamicTestingModule, platformBrowserDynamicTesting } from '@angular/platform-browser-dynamic/testing';
declare const require: {
context(
path: string,
deep?: boolean,
filter?: RegExp
): {
keys(): string[];
<T>(id: string): T;
};
};
// First, initialize the Angular testing environment.
getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting());
// Then we find all the tests.
const context = require.context('./', true, /\.spec\.ts$/);
// And load the modules.
context.keys().map(context);
getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting(), {
teardown: { destroyAfterEach: false },
});

View File

@@ -3,7 +3,6 @@
"extends": "../../../tsconfig.json",
"compilerOptions": {
"outDir": "../../../out-tsc/lib",
"target": "es2015",
"declaration": true,
"declarationMap": true,
"inlineSources": true,

View File

@@ -5,6 +5,6 @@
"declarationMap": false
},
"angularCompilerOptions": {
"enableIvy": false
"compilationMode": "partial"
}
}

View File

@@ -5,20 +5,7 @@ import 'zone.js/testing';
import { getTestBed } from '@angular/core/testing';
import { BrowserDynamicTestingModule, platformBrowserDynamicTesting } from '@angular/platform-browser-dynamic/testing';
declare const require: {
context(
path: string,
deep?: boolean,
filter?: RegExp
): {
keys(): string[];
<T>(id: string): T;
};
};
// First, initialize the Angular testing environment.
getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting());
// Then we find all the tests.
const context = require.context('./', true, /\.spec\.ts$/);
// And load the modules.
context.keys().map(context);
getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting(), {
teardown: { destroyAfterEach: false },
});

View File

@@ -3,7 +3,6 @@
"extends": "../../../tsconfig.json",
"compilerOptions": {
"outDir": "../../../out-tsc/lib",
"target": "es2015",
"declaration": true,
"declarationMap": true,
"inlineSources": true,

View File

@@ -5,6 +5,6 @@
"declarationMap": false
},
"angularCompilerOptions": {
"enableIvy": false
"compilationMode": "partial"
}
}

View File

@@ -1,10 +1,10 @@
import { Injectable, Injector } from '@angular/core';
import { Injectable, Injector, Optional, SkipSelf } from '@angular/core';
import { ActionHandler } from './action-handler.interface';
import { FEATURE_ACTION_HANDLERS, ROOT_ACTION_HANDLERS } from './tokens';
@Injectable()
export class CommandService {
constructor(private injector: Injector) {}
constructor(private injector: Injector, @Optional() @SkipSelf() private _parent: CommandService) {}
async handleCommand<T>(command: string, data?: T): Promise<T> {
const actions = this.getActions(command);
@@ -15,7 +15,7 @@ export class CommandService {
console.error('CommandService.handleCommand', 'Action Handler does not exist', { action });
throw new Error('Action Handler does not exist');
}
console.log('handle command', handler, data);
data = await handler.handler(data);
}
return data;
@@ -25,10 +25,16 @@ export class CommandService {
return command?.split('|') || [];
}
getActionHandler(action: string): ActionHandler {
getActionHandler(action: string): ActionHandler | undefined {
const featureActionHandlers: ActionHandler[] = this.injector.get(FEATURE_ACTION_HANDLERS, []);
const rootActionHandlers: ActionHandler[] = this.injector.get(ROOT_ACTION_HANDLERS, []);
return [...featureActionHandlers, ...rootActionHandlers].find((handler) => handler.action === action);
let handler = [...featureActionHandlers, ...rootActionHandlers].find((handler) => handler.action === action);
if (this._parent && !handler) {
handler = this._parent.getActionHandler(action);
}
return handler;
}
}

View File

@@ -5,20 +5,7 @@ import 'zone.js/testing';
import { getTestBed } from '@angular/core/testing';
import { BrowserDynamicTestingModule, platformBrowserDynamicTesting } from '@angular/platform-browser-dynamic/testing';
declare const require: {
context(
path: string,
deep?: boolean,
filter?: RegExp
): {
keys(): string[];
<T>(id: string): T;
};
};
// First, initialize the Angular testing environment.
getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting());
// Then we find all the tests.
const context = require.context('./', true, /\.spec\.ts$/);
// And load the modules.
context.keys().map(context);
getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting(), {
teardown: { destroyAfterEach: false },
});

View File

@@ -3,7 +3,6 @@
"extends": "../../../tsconfig.json",
"compilerOptions": {
"outDir": "../../../out-tsc/lib",
"target": "es2015",
"declaration": true,
"declarationMap": true,
"inlineSources": true,

View File

@@ -5,6 +5,6 @@
"declarationMap": false
},
"angularCompilerOptions": {
"enableIvy": false
"compilationMode": "partial"
}
}

View File

@@ -5,21 +5,5 @@ import 'zone.js/testing';
import { getTestBed } from '@angular/core/testing';
import { BrowserDynamicTestingModule, platformBrowserDynamicTesting } from '@angular/platform-browser-dynamic/testing';
declare const require: {
context(
path: string,
deep?: boolean,
filter?: RegExp
): {
keys(): string[];
<T>(id: string): T;
};
};
// First, initialize the Angular testing environment.
getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting(), { teardown: { destroyAfterEach: true } });
// Then we find all the tests.
const context = require.context('./', true, /\.spec\.ts$/);
// And load the modules.
context.keys().map(context);

View File

@@ -3,7 +3,6 @@
"extends": "../../../tsconfig.json",
"compilerOptions": {
"outDir": "../../../out-tsc/lib",
"target": "es2015",
"declaration": true,
"declarationMap": true,
"inlineSources": true,

View File

@@ -5,20 +5,7 @@ import 'zone.js/testing';
import { getTestBed } from '@angular/core/testing';
import { BrowserDynamicTestingModule, platformBrowserDynamicTesting } from '@angular/platform-browser-dynamic/testing';
declare const require: {
context(
path: string,
deep?: boolean,
filter?: RegExp
): {
keys(): string[];
<T>(id: string): T;
};
};
// First, initialize the Angular testing environment.
getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting());
// Then we find all the tests.
const context = require.context('./', true, /\.spec\.ts$/);
// And load the modules.
context.keys().map(context);
getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting(), {
teardown: { destroyAfterEach: false },
});

View File

@@ -3,7 +3,6 @@
"extends": "../../../tsconfig.json",
"compilerOptions": {
"outDir": "../../../out-tsc/lib",
"target": "es2015",
"declaration": true,
"declarationMap": true,
"inlineSources": true,

View File

@@ -5,6 +5,6 @@
"declarationMap": false
},
"angularCompilerOptions": {
"enableIvy": false
"compilationMode": "partial"
}
}

View File

@@ -5,21 +5,5 @@ import 'zone.js/testing';
import { getTestBed } from '@angular/core/testing';
import { BrowserDynamicTestingModule, platformBrowserDynamicTesting } from '@angular/platform-browser-dynamic/testing';
declare const require: {
context(
path: string,
deep?: boolean,
filter?: RegExp
): {
keys(): string[];
<T>(id: string): T;
};
};
// First, initialize the Angular testing environment.
getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting(), { teardown: { destroyAfterEach: true } });
// Then we find all the tests.
const context = require.context('./', true, /\.spec\.ts$/);
// And load the modules.
context.keys().map(context);

View File

@@ -3,7 +3,6 @@
"extends": "../../../tsconfig.json",
"compilerOptions": {
"outDir": "../../../out-tsc/lib",
"target": "es2015",
"declaration": true,
"declarationMap": true,
"inlineSources": true,

View File

@@ -5,20 +5,7 @@ import 'zone.js/testing';
import { getTestBed } from '@angular/core/testing';
import { BrowserDynamicTestingModule, platformBrowserDynamicTesting } from '@angular/platform-browser-dynamic/testing';
declare const require: {
context(
path: string,
deep?: boolean,
filter?: RegExp
): {
keys(): string[];
<T>(id: string): T;
};
};
// First, initialize the Angular testing environment.
getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting());
// Then we find all the tests.
const context = require.context('./', true, /\.spec\.ts$/);
// And load the modules.
context.keys().map(context);
getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting(), {
teardown: { destroyAfterEach: false },
});

View File

@@ -3,7 +3,6 @@
"extends": "../../../tsconfig.json",
"compilerOptions": {
"outDir": "../../../out-tsc/lib",
"target": "es2015",
"declaration": true,
"declarationMap": true,
"inlineSources": true,

View File

@@ -5,6 +5,6 @@
"declarationMap": false
},
"angularCompilerOptions": {
"enableIvy": false
"compilationMode": "partial"
}
}

View File

@@ -5,21 +5,5 @@ import 'zone.js/testing';
import { getTestBed } from '@angular/core/testing';
import { BrowserDynamicTestingModule, platformBrowserDynamicTesting } from '@angular/platform-browser-dynamic/testing';
declare const require: {
context(
path: string,
deep?: boolean,
filter?: RegExp
): {
keys(): string[];
<T>(id: string): T;
};
};
// First, initialize the Angular testing environment.
getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting(), { teardown: { destroyAfterEach: true } });
// Then we find all the tests.
const context = require.context('./', true, /\.spec\.ts$/);
// And load the modules.
context.keys().map(context);

View File

@@ -3,7 +3,6 @@
"extends": "../../../tsconfig.json",
"compilerOptions": {
"outDir": "../../../out-tsc/lib",
"target": "es2015",
"declaration": true,
"declarationMap": true,
"inlineSources": true,

View File

@@ -1,34 +1,42 @@
import { Injectable } from '@angular/core';
import { ItemDTO } from '@swagger/cat';
import { AvailabilityDTO, BranchDTO, OLAAvailabilityDTO, StoreCheckoutService, SupplierDTO } from '@swagger/checkout';
import {
AvailabilityDTO,
BranchDTO,
OLAAvailabilityDTO,
StoreCheckoutBranchService,
StoreCheckoutSupplierService,
SupplierDTO,
} from '@swagger/checkout';
import { combineLatest, Observable, of } from 'rxjs';
import {
AvailabilityRequestDTO,
AvailabilityService as SwaggerAvailabilityService,
AvailabilityService,
AvailabilityDTO as SwaggerAvailabilityDTO,
AvailabilityType,
} from '@swagger/availability';
import { AvailabilityDTO as CatAvailabilityDTO } from '@swagger/cat';
import { map, shareReplay, switchMap, withLatestFrom, mergeMap, timeout } from 'rxjs/operators';
import { isArray, memorize } from '@utils/common';
import { OrderService } from '@swagger/oms';
import { LogisticianDTO, LogisticianService } from '@swagger/oms';
import { ResponseArgsOfIEnumerableOfStockInfoDTO, StockDTO, StockInfoDTO, StockService } from '@swagger/remi';
import { ItemData } from './defs/item-data.model';
import { PriceDTO } from '@swagger/availability';
import { AvailabilityByBranchDTO } from './defs/availability-by-branch-dto.model';
import { AvailabilityByBranchDTO, ItemData } from './defs';
import { Availability } from './defs/availability';
@Injectable()
export class DomainAvailabilityService {
constructor(
private swaggerAvailabilityService: SwaggerAvailabilityService,
private storeCheckoutService: StoreCheckoutService,
private orderService: OrderService,
private _stock: StockService
private _availabilityService: AvailabilityService,
private _logisticanService: LogisticianService,
private _stockService: StockService,
private _supplierService: StoreCheckoutSupplierService,
private _branchService: StoreCheckoutBranchService
) {}
@memorize()
getSuppliers(): Observable<SupplierDTO[]> {
return this.storeCheckoutService.StoreCheckoutGetSuppliers({}).pipe(
return this._supplierService.StoreCheckoutSupplierGetSuppliers({}).pipe(
map((response) => response.result),
shareReplay()
);
@@ -36,7 +44,7 @@ export class DomainAvailabilityService {
@memorize()
getTakeAwaySupplier(): Observable<SupplierDTO> {
return this.storeCheckoutService.StoreCheckoutGetSuppliers({}).pipe(
return this._supplierService.StoreCheckoutSupplierGetSuppliers({}).pipe(
map(({ result }) => result?.find((supplier) => supplier?.supplierNumber === 'F')),
shareReplay()
);
@@ -44,7 +52,7 @@ export class DomainAvailabilityService {
@memorize()
getBranches(): Observable<BranchDTO[]> {
return this.storeCheckoutService.StoreCheckoutGetBranches({}).pipe(
return this._branchService.StoreCheckoutBranchGetBranches({}).pipe(
map((response) => response.result),
shareReplay()
);
@@ -52,7 +60,7 @@ export class DomainAvailabilityService {
@memorize()
getCurrentStock(): Observable<StockDTO> {
return this._stock.StockCurrentStock().pipe(
return this._stockService.StockCurrentStock().pipe(
map((response) => response.result),
shareReplay()
);
@@ -60,7 +68,7 @@ export class DomainAvailabilityService {
@memorize()
getCurrentBranch(): Observable<BranchDTO> {
return this._stock.StockCurrentBranch().pipe(
return this._stockService.StockCurrentBranch().pipe(
map((response) => ({
id: response.result.id,
name: response.result.name,
@@ -83,8 +91,8 @@ export class DomainAvailabilityService {
}
@memorize({})
getLogisticians() {
return this.orderService.OrderGetLogisticians({}).pipe(
getLogisticians(): Observable<LogisticianDTO> {
return this._logisticanService.LogisticianGetLogisticians({}).pipe(
map((response) => response.result?.find((l) => l.logisticianNumber === '2470')),
shareReplay()
);
@@ -101,7 +109,7 @@ export class DomainAvailabilityService {
price: PriceDTO;
quantity: number;
}): Observable<AvailabilityByBranchDTO[]> {
return this._stock.StockStockRequest({ stockRequest: { branchIds, itemId } }).pipe(
return this._stockService.StockStockRequest({ stockRequest: { branchIds, itemId } }).pipe(
map((response) => response.result),
withLatestFrom(this.getTakeAwaySupplier()),
map(([result, supplier]) => {
@@ -127,7 +135,7 @@ export class DomainAvailabilityService {
return this.getCurrentStock().pipe(
switchMap((s) =>
combineLatest([
this._stock.StockInStock({ articleIds: [item.itemId], stockId: s.id }),
this._stockService.StockInStock({ articleIds: [item.itemId], stockId: s.id }),
this.getTakeAwaySupplier(),
this.getCurrentBranch(),
])
@@ -153,7 +161,7 @@ export class DomainAvailabilityService {
quantity: number;
}): Observable<AvailabilityDTO> {
return combineLatest([
this._stock.StockStockRequest({ stockRequest: { branchIds: [branch.id], itemId } }),
this._stockService.StockStockRequest({ stockRequest: { branchIds: [branch.id], itemId } }),
this.getTakeAwaySupplier(),
]).pipe(
map(([response, supplier]) => {
@@ -173,7 +181,7 @@ export class DomainAvailabilityService {
quantity: number;
}): Observable<AvailabilityDTO> {
return this.getCurrentStock().pipe(
switchMap((s) => this._stock.StockInStockByEAN({ eans, stockId: s.id })),
switchMap((s) => this._stockService.StockInStockByEAN({ eans, stockId: s.id })),
withLatestFrom(this.getTakeAwaySupplier(), this.getCurrentBranch()),
map(([response, supplier, branch]) => {
return this._mapToTakeAwayAvailability({ response, supplier, branch, quantity, price });
@@ -185,7 +193,7 @@ export class DomainAvailabilityService {
getTakeAwayAvailabilitiesByEans({ eans }: { eans: string[] }): Observable<StockInfoDTO[]> {
const eansFiltered = Array.from(new Set(eans));
return this.getCurrentStock().pipe(
switchMap((s) => this._stock.StockInStockByEAN({ eans: eansFiltered, stockId: s.id })),
switchMap((s) => this._stockService.StockInStockByEAN({ eans: eansFiltered, stockId: s.id })),
withLatestFrom(this.getTakeAwaySupplier(), this.getCurrentBranch()),
map((response) => response[0].result),
shareReplay()
@@ -193,8 +201,16 @@ export class DomainAvailabilityService {
}
@memorize({ ttl: 10000 })
getPickUpAvailability({ item, branch, quantity }: { item: ItemData; quantity: number; branch: BranchDTO }): Observable<AvailabilityDTO> {
return this.swaggerAvailabilityService
getPickUpAvailability({
item,
branch,
quantity,
}: {
item: ItemData;
quantity: number;
branch: BranchDTO;
}): Observable<Availability<AvailabilityDTO, SwaggerAvailabilityDTO>> {
return this._availabilityService
.AvailabilityStoreAvailability([
{
qty: quantity,
@@ -212,7 +228,7 @@ export class DomainAvailabilityService {
@memorize({ ttl: 10000 })
getDeliveryAvailability({ item, quantity }: { item: ItemData; quantity: number }): Observable<AvailabilityDTO> {
return this.swaggerAvailabilityService
return this._availabilityService
.AvailabilityShippingAvailability([
{
ean: item?.ean,
@@ -230,7 +246,7 @@ export class DomainAvailabilityService {
@memorize({ ttl: 10000 })
getDigDeliveryAvailability({ item, quantity }: { item: ItemData; quantity: number }): Observable<AvailabilityDTO> {
return this.swaggerAvailabilityService
return this._availabilityService
.AvailabilityShippingAvailability([
{
qty: quantity,
@@ -275,7 +291,11 @@ export class DomainAvailabilityService {
timeout(5000),
mergeMap((branch) =>
this.getPickUpAvailability({ item, quantity, branch }).pipe(
mergeMap((availability) => logistician$.pipe(map((logistician) => ({ ...availability, logistician: { id: logistician.id } })))),
mergeMap((availability) =>
logistician$.pipe(
map((logistician) => ({ ...(availability?.length > 0 ? availability[0] : []), logistician: { id: logistician.id } }))
)
),
shareReplay()
)
)
@@ -284,7 +304,7 @@ export class DomainAvailabilityService {
@memorize({ ttl: 10000 })
getDownloadAvailability({ item }: { item: ItemData }): Observable<AvailabilityDTO> {
return this.swaggerAvailabilityService
return this._availabilityService
.AvailabilityShippingAvailability([
{
ean: item?.ean,
@@ -319,11 +339,11 @@ export class DomainAvailabilityService {
@memorize({ ttl: 10000 })
getTakeAwayAvailabilities(items: { id: number; price: PriceDTO }[], branchId: number) {
return this._stock.StockGetStocksByBranch({ branchId }).pipe(
return this._stockService.StockGetStocksByBranch({ branchId }).pipe(
map((req) => req.result?.find((_) => true)?.id),
switchMap((stockId) =>
stockId
? this._stock.StockInStock({ articleIds: items.map((i) => i.id), stockId })
? this._stockService.StockInStock({ articleIds: items.map((i) => i.id), stockId })
: of({ result: [] } as ResponseArgsOfIEnumerableOfStockInfoDTO)
),
timeout(20000),
@@ -344,7 +364,7 @@ export class DomainAvailabilityService {
@memorize({ ttl: 10000 })
getPickUpAvailabilities(payload: AvailabilityRequestDTO[], preferred?: boolean) {
return this.swaggerAvailabilityService.AvailabilityStoreAvailability(payload).pipe(
return this._availabilityService.AvailabilityStoreAvailability(payload).pipe(
timeout(20000),
map((response) => (preferred ? this._mapToPickUpAvailability(response.result) : response.result))
);
@@ -352,7 +372,7 @@ export class DomainAvailabilityService {
@memorize({ ttl: 10000 })
getDeliveryAvailabilities(payload: AvailabilityRequestDTO[]) {
return this.swaggerAvailabilityService.AvailabilityShippingAvailability(payload).pipe(
return this._availabilityService.AvailabilityShippingAvailability(payload).pipe(
timeout(20000),
map((response) => this._mapToShippingAvailability(response.result))
);
@@ -360,7 +380,7 @@ export class DomainAvailabilityService {
@memorize({ ttl: 10000 })
getDigDeliveryAvailabilities(payload: AvailabilityRequestDTO[]) {
return this.swaggerAvailabilityService.AvailabilityShippingAvailability(payload).pipe(
return this._availabilityService.AvailabilityShippingAvailability(payload).pipe(
timeout(20000),
map((response) => this._mapToShippingAvailability(response.result))
);
@@ -386,7 +406,7 @@ export class DomainAvailabilityService {
): PriceDTO {
switch (purchasingOption) {
case 'take-away':
return availability?.price || availability?.retailPrice;
return availability?.price || catalogAvailability?.price;
case 'delivery':
case 'dig-delivery':
if (catalogAvailability?.price?.value?.value < availability?.price?.value?.value) {
@@ -447,9 +467,11 @@ export class DomainAvailabilityService {
inStock: inStock,
supplierSSC: quantity <= inStock ? '999' : '',
supplierSSCText: quantity <= inStock ? 'Filialentnahme' : '',
price,
price: price ?? stockInfo?.retailPrice,
supplier: { id: supplier?.id },
retailPrice: (stockInfo as any)?.retailPrice, // TODO: Change after API Update
// TODO: Change after API Update
// LH: 2021-03-09 preis Property hat nun ein Fallback auf retailPrice
// retailPrice: (stockInfo as any)?.retailPrice,
};
return availability;
}
@@ -479,26 +501,29 @@ export class DomainAvailabilityService {
return availability;
}
private _mapToPickUpAvailability(availabilities: SwaggerAvailabilityDTO[]) {
private _mapToPickUpAvailability(availabilities: SwaggerAvailabilityDTO[]): Availability<AvailabilityDTO, SwaggerAvailabilityDTO>[] {
if (isArray(availabilities)) {
const preferred = availabilities.filter((f) => f.preferred === 1);
const totalAvailable = availabilities.reduce((sum, av) => sum + (av?.qty || 0), 0);
return preferred.map((p) => {
return {
availabilityType: p?.status,
ssc: p?.ssc,
sscText: p?.sscText,
supplier: { id: p?.supplierId },
isPrebooked: p?.isPrebooked,
estimatedShippingDate: p?.requestStatusCode === '32' ? p?.altAt : p?.at,
price: p?.price,
inStock: totalAvailable,
supplierProductNumber: p?.supplierProductNumber,
supplierInfo: p?.requestStatusCode,
lastRequest: p?.requested,
itemId: p.itemId,
};
return [
{
availabilityType: p?.status,
ssc: p?.ssc,
sscText: p?.sscText,
supplier: { id: p?.supplierId },
isPrebooked: p?.isPrebooked,
estimatedShippingDate: p?.requestStatusCode === '32' ? p?.altAt : p?.at,
price: p?.price,
inStock: totalAvailable,
supplierProductNumber: p?.supplierProductNumber,
supplierInfo: p?.requestStatusCode,
lastRequest: p?.requested,
itemId: p.itemId,
},
p,
];
});
}
}

View File

@@ -0,0 +1 @@
export type Availability<T, S> = [T, S];

View File

@@ -1,3 +1,3 @@
// start:ng42.barrel
export * from './item-data.model';
// end:ng42.barrel
export * from './availability-by-branch-dto';
export * from './availability';
export * from './item-data';

View File

@@ -5,20 +5,7 @@ import 'zone.js/testing';
import { getTestBed } from '@angular/core/testing';
import { BrowserDynamicTestingModule, platformBrowserDynamicTesting } from '@angular/platform-browser-dynamic/testing';
declare const require: {
context(
path: string,
deep?: boolean,
filter?: RegExp
): {
keys(): string[];
<T>(id: string): T;
};
};
// First, initialize the Angular testing environment.
getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting());
// Then we find all the tests.
const context = require.context('./', true, /\.spec\.ts$/);
// And load the modules.
context.keys().map(context);
getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting(), {
teardown: { destroyAfterEach: false },
});

View File

@@ -3,7 +3,6 @@
"extends": "../../../tsconfig.json",
"compilerOptions": {
"outDir": "../../../out-tsc/lib",
"target": "es2015",
"declaration": true,
"declarationMap": true,
"inlineSources": true,

View File

@@ -5,6 +5,6 @@
"declarationMap": false
},
"angularCompilerOptions": {
"enableIvy": false
"compilationMode": "partial"
}
}

View File

@@ -5,20 +5,7 @@ import 'zone.js/testing';
import { getTestBed } from '@angular/core/testing';
import { BrowserDynamicTestingModule, platformBrowserDynamicTesting } from '@angular/platform-browser-dynamic/testing';
declare const require: {
context(
path: string,
deep?: boolean,
filter?: RegExp
): {
keys(): string[];
<T>(id: string): T;
};
};
// First, initialize the Angular testing environment.
getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting());
// Then we find all the tests.
const context = require.context('./', true, /\.spec\.ts$/);
// And load the modules.
context.keys().map(context);
getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting(), {
teardown: { destroyAfterEach: false },
});

View File

@@ -3,7 +3,6 @@
"extends": "../../../tsconfig.json",
"compilerOptions": {
"outDir": "../../../out-tsc/lib",
"target": "es2015",
"declaration": true,
"declarationMap": true,
"inlineSources": true,

View File

@@ -5,6 +5,6 @@
"declarationMap": false
},
"angularCompilerOptions": {
"enableIvy": false
"compilationMode": "partial"
}
}

View File

@@ -21,7 +21,7 @@ export class ThumbnailUrlPipe implements PipeTransform, OnDestroy {
this.input$.complete();
}
transform(ean: string, width: number, height: number): any {
transform(ean: string, width?: number, height?: number): any {
this.input$.next({ ean, width, height });
this.input$

View File

@@ -5,20 +5,7 @@ import 'zone.js/testing';
import { getTestBed } from '@angular/core/testing';
import { BrowserDynamicTestingModule, platformBrowserDynamicTesting } from '@angular/platform-browser-dynamic/testing';
declare const require: {
context(
path: string,
deep?: boolean,
filter?: RegExp
): {
keys(): string[];
<T>(id: string): T;
};
};
// First, initialize the Angular testing environment.
getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting());
// Then we find all the tests.
const context = require.context('./', true, /\.spec\.ts$/);
// And load the modules.
context.keys().map(context);
getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting(), {
teardown: { destroyAfterEach: false },
});

View File

@@ -3,7 +3,6 @@
"extends": "../../../tsconfig.json",
"compilerOptions": {
"outDir": "../../../out-tsc/lib",
"target": "es2015",
"declaration": true,
"declarationMap": true,
"inlineSources": true,

View File

@@ -5,6 +5,6 @@
"declarationMap": false
},
"angularCompilerOptions": {
"enableIvy": false
"compilationMode": "partial"
}
}

View File

@@ -21,8 +21,13 @@ import {
UpdateShoppingCartItemDTO,
InputDTO,
ItemPayload,
StoreCheckoutShoppingCartService,
StoreCheckoutPaymentService,
StoreCheckoutBuyerService,
StoreCheckoutPayerService,
StoreCheckoutBranchService,
} from '@swagger/checkout';
import { DisplayOrderDTO, OrderCheckoutService, ReorderValues } from '@swagger/oms';
import { DisplayOrderDTO, DisplayOrderItemDTO, OrderCheckoutService, ReorderValues } from '@swagger/oms';
import { isNullOrUndefined, memorize } from '@utils/common';
import { combineLatest, Observable, of, concat, isObservable, throwError } from 'rxjs';
import { bufferCount, catchError, filter, first, map, mergeMap, shareReplay, switchMap, tap, withLatestFrom } from 'rxjs/operators';
@@ -32,6 +37,7 @@ import * as DomainCheckoutActions from './store/domain-checkout.actions';
import { DomainAvailabilityService } from '@domain/availability';
import { HttpErrorResponse } from '@angular/common/http';
import { ApplicationService } from '@core/application';
import { CustomerDTO, EntityDTOContainerOfAttributeDTO } from '@swagger/crm';
@Injectable()
export class DomainCheckoutService {
@@ -40,7 +46,12 @@ export class DomainCheckoutService {
private applicationService: ApplicationService,
private storeCheckoutService: StoreCheckoutService,
private orderCheckoutService: OrderCheckoutService,
private availabilityService: DomainAvailabilityService
private availabilityService: DomainAvailabilityService,
private _shoppingCartService: StoreCheckoutShoppingCartService,
private _paymentService: StoreCheckoutPaymentService,
private _buyerService: StoreCheckoutBuyerService,
private _payerService: StoreCheckoutPayerService,
private _branchService: StoreCheckoutBranchService
) {}
//#region shoppingcart
@@ -53,8 +64,8 @@ export class DomainCheckoutService {
return false;
} else if (cart && _latest) {
_latest = false;
this.storeCheckoutService
.StoreCheckoutGetShoppingCart({
this._shoppingCartService
.StoreCheckoutShoppingCartGetShoppingCart({
shoppingCartId: cart.id,
})
.pipe(
@@ -77,7 +88,7 @@ export class DomainCheckoutService {
}
createShoppingCart({ processId }: { processId: number }): Observable<ShoppingCartDTO> {
return this.storeCheckoutService.StoreCheckoutCreateShoppingCart().pipe(
return this._shoppingCartService.StoreCheckoutShoppingCartCreateShoppingCart().pipe(
map((response) => response.result),
tap((shoppingCart) =>
this.store.dispatch(
@@ -94,8 +105,8 @@ export class DomainCheckoutService {
return this.getShoppingCart({ processId }).pipe(
first(),
mergeMap((cart) =>
this.storeCheckoutService
.StoreCheckoutAddItemToShoppingCart({
this._shoppingCartService
.StoreCheckoutShoppingCartAddItemToShoppingCart({
items,
shoppingCartId: cart.id,
})
@@ -125,8 +136,8 @@ export class DomainCheckoutService {
return this.getShoppingCart({ processId }).pipe(
first(),
mergeMap((shoppingCart) =>
this.storeCheckoutService
.StoreCheckoutSetLogisticianOnDestinationsByBuyer({
this._shoppingCartService
.StoreCheckoutShoppingCartSetLogisticianOnDestinationsByBuyer({
shoppingCartId: shoppingCart?.id,
payload: { customerFeatures },
})
@@ -139,7 +150,7 @@ export class DomainCheckoutService {
return this.getShoppingCart({ processId }).pipe(
first(),
mergeMap((cart) =>
this.storeCheckoutService.StoreCheckoutCanAddDestination({
this._shoppingCartService.StoreCheckoutShoppingCartCanAddDestination({
shoppingCartId: cart.id,
payload: destinationDTO,
})
@@ -166,8 +177,8 @@ export class DomainCheckoutService {
first(),
withLatestFrom(this.store.select(DomainCheckoutSelectors.selectCustomerFeaturesByProcessId, { processId })),
mergeMap(([shoppingCart, customerFeatures]) =>
this.storeCheckoutService
.StoreCheckoutCanAddItem({
this._shoppingCartService
.StoreCheckoutShoppingCartCanAddItem({
shoppingCartId: shoppingCart?.id,
payload: {
customerFeatures,
@@ -199,8 +210,8 @@ export class DomainCheckoutService {
orderType,
};
});
return this.storeCheckoutService
.StoreCheckoutCanAddItems({
return this._shoppingCartService
.StoreCheckoutShoppingCartCanAddItems({
shoppingCartId: shoppingCart.id,
payload,
})
@@ -222,7 +233,7 @@ export class DomainCheckoutService {
shoppingCartItemId: number;
availability: AvailabilityDTO;
}) {
return this.storeCheckoutService.StoreCheckoutUpdateShoppingCartItemAvailability({
return this._shoppingCartService.StoreCheckoutShoppingCartUpdateShoppingCartItemAvailability({
shoppingCartId,
shoppingCartItemId,
availability,
@@ -241,8 +252,8 @@ export class DomainCheckoutService {
return this.getShoppingCart({ processId }).pipe(
first(),
mergeMap((shoppingCart) =>
this.storeCheckoutService
.StoreCheckoutUpdateShoppingCartItem({
this._shoppingCartService
.StoreCheckoutShoppingCartUpdateShoppingCartItem({
shoppingCartId: shoppingCart.id,
shoppingCartItemId,
values: update,
@@ -318,8 +329,8 @@ export class DomainCheckoutService {
return this.getCheckout({ processId }).pipe(
first(),
mergeMap((checkout) =>
this.storeCheckoutService
.StoreCheckoutGetCheckoutPayment({
this._paymentService
.StoreCheckoutPaymentGetCheckoutPayment({
checkoutId: checkout.id,
})
.pipe(map((response) => response.result))
@@ -335,8 +346,8 @@ export class DomainCheckoutService {
return this.getCheckout({ processId }).pipe(
first(),
mergeMap((checkout) =>
this.storeCheckoutService
.StoreCheckoutSetPaymentType({
this._paymentService
.StoreCheckoutPaymentSetPaymentType({
checkoutId: checkout?.id,
paymentType,
})
@@ -352,8 +363,8 @@ export class DomainCheckoutService {
return this.getCheckout({ processId }).pipe(
first(),
mergeMap((checkout) =>
this.storeCheckoutService
.StoreCheckoutSetBuyer({
this._buyerService
.StoreCheckoutBuyerSetBuyerPOST({
checkoutId: checkout?.id,
buyerDTO: buyer,
})
@@ -369,8 +380,8 @@ export class DomainCheckoutService {
return this.getCheckout({ processId }).pipe(
first(),
mergeMap((checkout) =>
this.storeCheckoutService
.StoreCheckoutSetPayer({
this._payerService
.StoreCheckoutPayerSetPayerPOST({
checkoutId: checkout?.id,
payerDTO: payer,
})
@@ -389,7 +400,7 @@ export class DomainCheckoutService {
mergeMap((cart) =>
concat(
...cart.items.map((item) =>
this.storeCheckoutService.StoreCheckoutUpdateShoppingCartItem({
this._shoppingCartService.StoreCheckoutShoppingCartUpdateShoppingCartItem({
shoppingCartId: cart.id,
shoppingCartItemId: item.id,
values: { specialComment },
@@ -650,7 +661,7 @@ export class DomainCheckoutService {
first(),
mergeMap((checkout) =>
this.orderCheckoutService
.OrderCheckoutCreateOrder({
.OrderCheckoutCreateOrderPOST({
checkoutId: checkout.id,
})
.pipe(
@@ -734,8 +745,8 @@ export class DomainCheckoutService {
return this.getShoppingCart({ processId }).pipe(
first(),
mergeMap((shoppingCart) =>
this.storeCheckoutService
.StoreCheckoutCanAddBuyer({
this._shoppingCartService
.StoreCheckoutShoppingCartCanAddBuyer({
shoppingCartId: shoppingCart.id,
payload: { customerFeatures },
})
@@ -771,35 +782,39 @@ export class DomainCheckoutService {
return this.canSetCustomer({ processId, customerFeatures: undefined }).pipe(
map((res) => {
let setableTypes: { [key: string]: boolean } = {
store: true,
guest: true,
webshop: true,
b2b: true,
store: false,
guest: false,
webshop: false,
b2b: false,
};
if (Object.keys(res.filter).length === 0) {
return setableTypes;
}
res.create?.options?.values?.forEach((option) => {
setableTypes[option.value] = option.enabled !== false;
});
const customerTypes = res.filter?.customertype?.split(';') || [];
const customerAttributes = res.filter?.customerattributes?.split(';') || [];
// if (Object.keys(res.filter).length === 0) {
// return setableTypes;
// }
const typesAndAttributes = [...customerTypes, ...customerAttributes];
if (typesAndAttributes.includes('webshop') && !typesAndAttributes.includes('!guest')) {
typesAndAttributes.push('guest');
}
// const customerTypes = res.filter?.customertype?.split(';') || [];
// const customerAttributes = res.filter?.customerattributes?.split(';') || [];
for (const key in setableTypes) {
if (Object.prototype.hasOwnProperty.call(setableTypes, key)) {
if (typesAndAttributes.includes(key)) {
setableTypes[key] = true;
} else if (typesAndAttributes.includes(`!${key}`)) {
setableTypes[key] = false;
} else {
setableTypes[key] = false;
}
}
}
// const typesAndAttributes = [...customerTypes, ...customerAttributes];
// if (typesAndAttributes.includes('webshop') && !typesAndAttributes.includes('!guest')) {
// typesAndAttributes.push('guest');
// }
// for (const key in setableTypes) {
// if (Object.prototype.hasOwnProperty.call(setableTypes, key)) {
// if (typesAndAttributes.includes(key)) {
// setableTypes[key] = true;
// } else if (typesAndAttributes.includes(`!${key}`)) {
// setableTypes[key] = false;
// } else {
// setableTypes[key] = false;
// }
// }
// }
return setableTypes;
})
@@ -808,8 +823,8 @@ export class DomainCheckoutService {
@memorize()
getBranches(): Observable<BranchDTO[]> {
return this.storeCheckoutService
.StoreCheckoutGetBranches({
return this._branchService
.StoreCheckoutBranchGetBranches({
take: 999,
})
.pipe(
@@ -828,10 +843,6 @@ export class DomainCheckoutService {
.pipe(map((response) => response.result));
}
setCustomerFeatures({ processId, customerFeatures }: { processId: number; customerFeatures: { [key: string]: string } }) {
this.store.dispatch(DomainCheckoutActions.setCustomerFeatures({ processId, customerFeatures }));
}
setOlaErrors({ processId, errorIds }: { processId: number; errorIds: number[] }) {
this.store.dispatch(
DomainCheckoutActions.setOlaError({
@@ -857,6 +868,14 @@ export class DomainCheckoutService {
this.store.dispatch(DomainCheckoutActions.removeProcess({ processId }));
}
setCustomer({ processId, customerDto }: { processId: number; customerDto: CustomerDTO }) {
this.store.dispatch(DomainCheckoutActions.setCustomer({ processId, customer: customerDto }));
}
getCustomer({ processId }: { processId: number }): Observable<CustomerDTO> {
return this.store.select(DomainCheckoutSelectors.selectCustomerByProcessId, { processId });
}
setPayer({ processId, payer }: { processId: number; payer: PayerDTO }) {
this.store.dispatch(DomainCheckoutActions.setPayer({ processId, payer }));
}
@@ -877,6 +896,10 @@ export class DomainCheckoutService {
return this.store.select(DomainCheckoutSelectors.selectOrders);
}
updateOrderItem(item: DisplayOrderItemDTO) {
this.store.dispatch(DomainCheckoutActions.updateOrderItem({ item }));
}
removeAllOrders() {
this.store.dispatch(DomainCheckoutActions.removeAllOrders());
}

View File

@@ -1,11 +1,12 @@
import { BuyerDTO, CheckoutDTO, NotificationChannel, PayerDTO, ShippingAddressDTO, ShoppingCartDTO } from '@swagger/checkout';
import { CustomerDTO } from '@swagger/crm';
import { DisplayOrderDTO } from '@swagger/oms';
export interface CheckoutEntity {
processId: number;
checkout: CheckoutDTO;
shoppingCart: ShoppingCartDTO;
customerFeatures: { [key: string]: string };
customer: CustomerDTO;
payer: PayerDTO;
buyer: BuyerDTO;
shippingAddress: ShippingAddressDTO;

View File

@@ -8,7 +8,8 @@ import {
BuyerDTO,
PayerDTO,
} from '@swagger/checkout';
import { DisplayOrderDTO } from '@swagger/oms';
import { CustomerDTO } from '@swagger/crm';
import { DisplayOrderDTO, DisplayOrderItemDTO } from '@swagger/oms';
const prefix = '[DOMAIN-CHECKOUT]';
@@ -38,11 +39,6 @@ export const setCheckoutDestination = createAction(
props<{ processId: number; destination: DestinationDTO }>()
);
export const setCustomerFeatures = createAction(
`${prefix} Set Customer Features`,
props<{ processId: number; customerFeatures: { [key: string]: string } }>()
);
export const setShippingAddress = createAction(
`${prefix} Set Shipping Address`,
props<{ processId: number; shippingAddress: ShippingAddressDTO }>()
@@ -52,6 +48,8 @@ export const removeProcess = createAction(`${prefix} Remove Process`, props<{ pr
export const setOrders = createAction(`${prefix} Add Orders`, props<{ orders: DisplayOrderDTO[] }>());
export const updateOrderItem = createAction(`${prefix} Update Orders`, props<{ item: DisplayOrderItemDTO }>());
export const removeAllOrders = createAction(`${prefix} Remove All Orders`);
export const setBuyer = createAction(`${prefix} Set Buyer`, props<{ processId: number; buyer: BuyerDTO }>());
@@ -61,3 +59,5 @@ export const setPayer = createAction(`${prefix} Set Payer`, props<{ processId: n
export const setSpecialComment = createAction(`${prefix} Set Agent Comment`, props<{ processId: number; agentComment: string }>());
export const setOlaError = createAction(`${prefix} Set Ola Error`, props<{ processId: number; olaErrorIds: number[] }>());
export const setCustomer = createAction(`${prefix} Set Customer`, props<{ processId: number; customer: CustomerDTO }>());

View File

@@ -46,11 +46,6 @@ const _domainCheckoutReducer = createReducer(
};
return storeCheckoutAdapter.setOne(entity, s);
}),
on(DomainCheckoutActions.setCustomerFeatures, (s, { processId, customerFeatures }) => {
const entity = getOrCreateCheckoutEntity({ processId, entities: s.entities });
entity.customerFeatures = customerFeatures;
return storeCheckoutAdapter.setOne(entity, s);
}),
on(DomainCheckoutActions.setShippingAddress, (s, { processId, shippingAddress }) => {
const entity = getOrCreateCheckoutEntity({ processId, entities: s.entities });
entity.shippingAddress = shippingAddress;
@@ -73,6 +68,25 @@ const _domainCheckoutReducer = createReducer(
}),
on(DomainCheckoutActions.removeProcess, (s, { processId }) => storeCheckoutAdapter.removeOne(processId, s)),
on(DomainCheckoutActions.setOrders, (s, { orders }) => ({ ...s, orders: [...s.orders, ...orders] })),
on(DomainCheckoutActions.updateOrderItem, (s, { item }) => {
const orders = [...s.orders];
const orderToUpdate = orders?.find((order) => order.items?.find((i) => i.id === item?.id));
const orderToUpdateIndex = orders?.indexOf(orderToUpdate);
const orderItemToUpdate = orderToUpdate?.items?.find((i) => i.id === item?.id);
const orderItemToUpdateIndex = orderToUpdate?.items?.indexOf(orderItemToUpdate);
const items = [...orderToUpdate?.items];
items[orderItemToUpdateIndex] = item;
orders[orderToUpdateIndex] = {
...orderToUpdate,
items: [...items],
};
return { ...s, orders: [...orders] };
}),
on(DomainCheckoutActions.removeAllOrders, (s) => ({
...s,
orders: [],
@@ -81,6 +95,11 @@ const _domainCheckoutReducer = createReducer(
const entity = getOrCreateCheckoutEntity({ processId, entities: s.entities });
entity.olaErrorIds = olaErrorIds;
return storeCheckoutAdapter.setOne(entity, s);
}),
on(DomainCheckoutActions.setCustomer, (s, { processId, customer }) => {
const entity = getOrCreateCheckoutEntity({ processId, entities: s.entities });
entity.customer = customer;
return storeCheckoutAdapter.setOne(entity, s);
})
);
@@ -96,7 +115,6 @@ function getOrCreateCheckoutEntity({ entities, processId }: { entities: Dictiona
processId,
checkout: undefined,
shoppingCart: undefined,
customerFeatures: undefined,
shippingAddress: undefined,
orders: [],
payer: undefined,
@@ -104,6 +122,7 @@ function getOrCreateCheckoutEntity({ entities, processId }: { entities: Dictiona
specialComment: '',
notificationChannels: 0,
olaErrorIds: [],
customer: undefined,
};
}

View File

@@ -1,5 +1,6 @@
import { Dictionary } from '@ngrx/entity';
import { createSelector } from '@ngrx/store';
import { CustomerDTO } from '@swagger/crm';
import { CheckoutEntity } from './defs/checkout.entity';
import { storeCheckoutAdapter, storeFeatureSelector } from './domain-checkout.state';
@@ -22,7 +23,7 @@ export const selectCheckoutByProcessId = createSelector(
export const selectCustomerFeaturesByProcessId = createSelector(
selectEntities,
(entities: Dictionary<CheckoutEntity>, { processId }: { processId: number }) => entities[processId]?.customerFeatures
(entities: Dictionary<CheckoutEntity>, { processId }: { processId: number }) => getCusomterFeatures(entities[processId]?.customer)
);
export const selectShippingAddressByProcessId = createSelector(
@@ -61,3 +62,19 @@ export const selectOlaErrorsByProcessId = createSelector(
selectEntities,
(entities: Dictionary<CheckoutEntity>, { processId }: { processId: number }) => entities[processId]?.olaErrorIds
);
export const selectCustomerByProcessId = createSelector(
selectEntities,
(entities: Dictionary<CheckoutEntity>, { processId }: { processId: number }) => entities[processId]?.customer
);
function getCusomterFeatures(custoemr: CustomerDTO): { [key: string]: string } {
const customerFeatures = custoemr?.features ?? [];
const features: { [key: string]: string } = {};
for (const feature of customerFeatures) {
features[feature.key] = feature.key;
}
return features;
}

View File

@@ -5,11 +5,7 @@ import 'zone.js/testing';
import { getTestBed } from '@angular/core/testing';
import { BrowserDynamicTestingModule, platformBrowserDynamicTesting } from '@angular/platform-browser-dynamic/testing';
declare const require: any;
// First, initialize the Angular testing environment.
getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting());
// Then we find all the tests.
const context = require.context('./', true, /\.spec\.ts$/);
// And load the modules.
context.keys().map(context);
getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting(), {
teardown: { destroyAfterEach: false },
});

View File

@@ -3,7 +3,6 @@
"compilerOptions": {
"outDir": "../../../out-tsc/lib",
"declarationMap": true,
"target": "es2015",
"declaration": true,
"inlineSources": true,
"types": [],

View File

@@ -4,6 +4,6 @@
"declarationMap": false
},
"angularCompilerOptions": {
"enableIvy": false
"compilationMode": "partial"
}
}

View File

@@ -1,21 +1,26 @@
import { Injectable } from '@angular/core';
import {
AddressDTO,
AddressService,
AssignedPayerDTO,
AutocompleteDTO,
CommunicationDetailsDTO,
CountryDTO,
CountryService,
CustomerDTO,
CustomerInfoDTO,
CustomerService,
HistoryDTO,
InputDTO,
KeyValueDTOOfStringAndString,
ListResponseArgsOfCustomerInfoDTO,
LoyaltyCardService,
NotificationChannel,
PayerDTO,
PayerService,
ResponseArgsOfHistoryDTO,
ResponseArgsOfIEnumerableOfBonusCardInfoDTO,
ShippingAddressDTO,
ShippingAddressService,
} from '@swagger/crm';
import { isArray } from '@utils/common';
import { PagedResult, Result } from 'apps/domain/defs/src/public-api';
@@ -24,7 +29,14 @@ import { catchError, map, mergeMap, retry } from 'rxjs/operators';
@Injectable({ providedIn: 'root' })
export class CrmCustomerService {
constructor(private customerService: CustomerService, private payerService: PayerService) {}
constructor(
private customerService: CustomerService,
private payerService: PayerService,
private addressService: AddressService,
private countryService: CountryService,
private shippingAddressService: ShippingAddressService,
private loyaltyCardService: LoyaltyCardService
) {}
complete(queryString: string, filter?: { [key: string]: string }): Observable<Result<AutocompleteDTO[]>> {
return this.customerService.CustomerCustomerAutocomplete({
@@ -66,10 +78,6 @@ export class CrmCustomerService {
return this.customerService.CustomerGetAssignedPayersByCustomerId(params);
}
getFilters(): Observable<Result<InputDTO[]>> {
return this.customerService.CustomerQueryCustomerFilter();
}
/* @internal */
getNotificationChannelForCommunicationDetails({
communicationDetails,
@@ -96,12 +104,23 @@ export class CrmCustomerService {
return this.customerService.CustomerPatchCustomer({ customerId, customer: { ...customer, notificationChannels } });
}
createB2BCustomer(customer: CustomerDTO) {
createB2BCustomer(customer: CustomerDTO): Promise<Result<CustomerDTO>> {
const notificationChannels = this.getNotificationChannelForCommunicationDetails({
communicationDetails: customer?.communicationDetails,
});
return this.customerService.CustomerCreateCustomer({ ...customer, customerType: 16, notificationChannels });
const payload: CustomerDTO = { ...customer, customerType: 16, notificationChannels };
payload.shippingAddresses = payload.shippingAddresses ?? [];
payload.payers = payload.payers ?? [];
return this.customerService
.CustomerCreateCustomer({
customer: payload,
modifiers: [{ key: 'b2b', group: 'customertype' }],
})
.toPromise();
}
createOnlineCustomer(customer: CustomerDTO): Observable<Result<CustomerDTO>> {
@@ -148,63 +167,253 @@ export class CrmCustomerService {
];
}
return this.customerService.CustomerCreateOnlineCustomer({ ...payload, notificationChannels });
const p4mUser = customer.features.find((f) => f.key === 'p4mUser')?.value;
const modifiers: KeyValueDTOOfStringAndString[] = [{ key: 'webshop', group: 'customertype' }];
if (p4mUser) {
modifiers.push({ key: 'add-loyalty-card', value: p4mUser });
}
return this.customerService.CustomerCreateCustomer({
customer: { ...payload, notificationChannels },
modifiers,
});
}
createGuestCustomer(customer: CustomerDTO): Observable<Result<CustomerDTO>> {
mapCustomerToPayer(customer: CustomerDTO): PayerDTO {
return {
address: customer.address,
communicationDetails: customer.communicationDetails,
firstName: customer.firstName,
lastName: customer.lastName,
organisation: customer.organisation,
title: customer.title,
payerType: 1,
gender: customer.gender,
};
}
mapCustomerToShippingAddress(customer: CustomerDTO): ShippingAddressDTO {
return {
address: customer.address,
communicationDetails: customer.communicationDetails,
firstName: customer.firstName,
gender: customer.gender,
lastName: customer.lastName,
organisation: customer.organisation,
title: customer.title,
type: 1,
};
}
async updateToOnlineCustomer(customer: CustomerDTO): Promise<Result<CustomerDTO>> {
const payload: CustomerDTO = { shippingAddresses: [], payers: [], ...customer, customerType: 8, hasOnlineAccount: true };
const notificationChannels = this.getNotificationChannelForCommunicationDetails({
communicationDetails: payload?.communicationDetails,
});
const shippingAddressesToAdd = payload.shippingAddresses?.filter((sa) => !sa.id)?.map((m) => m.data) ?? [];
payload.shippingAddresses = payload.shippingAddresses?.filter((sa) => !!sa.id) ?? [];
if (payload.shippingAddresses.length === 0) {
shippingAddressesToAdd.unshift(this.mapCustomerToShippingAddress(payload));
}
const payersToAdd = payload.payers?.filter((p) => !p.assignedToCustomer)?.map((p) => p.payer?.data) ?? [];
payload.payers = payload.payers?.filter((p) => !!p.assignedToCustomer) ?? [];
if (payload.payers.length === 0) {
payersToAdd.unshift({
...this.mapCustomerToPayer(payload),
payerType: payload.customerType,
});
}
const modifiers: KeyValueDTOOfStringAndString[] = [{ key: 'webshop', group: 'customertype' }];
const res = await this.customerService
.CustomerUpdateCustomer({
customerId: customer.id,
payload: {
modifiers,
customer: { ...payload, notificationChannels },
},
})
.toPromise();
for (let shippingAddress of shippingAddressesToAdd) {
await this.createShippingAddress(res.result.id, shippingAddress, true);
}
for (let payer of payersToAdd) {
await this.createPayer(res.result.id, payer, true);
}
return res;
}
async updateToP4MOnlineCustomer(customer: CustomerDTO): Promise<Result<CustomerDTO>> {
const shippingAddressesToAdd = customer.shippingAddresses?.filter((sa) => !sa.id)?.map((m) => m.data) ?? [];
customer.shippingAddresses = customer.shippingAddresses?.filter((sa) => !!sa.id) ?? [];
if (customer.shippingAddresses.length === 0) {
shippingAddressesToAdd.unshift(this.mapCustomerToShippingAddress(customer));
}
const payersToAdd = customer.payers?.filter((p) => !p.assignedToCustomer)?.map((p) => p.payer?.data) ?? [];
customer.payers = customer.payers?.filter((p) => !!p.assignedToCustomer) ?? [];
if (customer.payers.length === 0) {
payersToAdd.unshift({
...this.mapCustomerToPayer(customer),
payerType: customer.customerType,
});
}
const p4mUser = customer.features.find((f) => f.key === 'p4mUser')?.value;
const modifiers: KeyValueDTOOfStringAndString[] = [{ key: 'webshop', group: 'customertype' }];
if (p4mUser) {
modifiers.push({ key: 'add-loyalty-card', value: p4mUser });
}
const res = await this.customerService
.CustomerUpdateCustomer({
customerId: customer.id,
payload: {
customer,
modifiers,
},
})
.toPromise();
for (let shippingAddress of shippingAddressesToAdd) {
await this.createShippingAddress(res.result.id, shippingAddress, true);
}
for (let payer of payersToAdd) {
await this.createPayer(res.result.id, payer, true);
}
return res;
}
async updateStoreP4MToWebshopP4M(customer: CustomerDTO): Promise<Result<CustomerDTO>> {
const shippingAddressesToAdd = customer.shippingAddresses?.filter((sa) => !sa.id)?.map((m) => m.data) ?? [];
customer.shippingAddresses = customer.shippingAddresses?.filter((sa) => !!sa.id) ?? [];
if (customer.shippingAddresses.length === 0) {
shippingAddressesToAdd.unshift(this.mapCustomerToShippingAddress(customer));
}
const payersToAdd = customer.payers?.filter((p) => !p.assignedToCustomer)?.map((p) => p.payer?.data) ?? [];
customer.payers = customer.payers?.filter((p) => !!p.assignedToCustomer) ?? [];
if (customer.payers.length === 0) {
payersToAdd.unshift({
...this.mapCustomerToPayer(customer),
payerType: customer.customerType,
});
}
const modifiers: KeyValueDTOOfStringAndString[] = [{ key: 'webshop', group: 'customertype' }];
const res = await this.customerService
.CustomerUpdateCustomer({
customerId: customer.id,
payload: {
customer,
modifiers,
},
})
.toPromise();
for (let shippingAddress of shippingAddressesToAdd) {
await this.createShippingAddress(res.result.id, shippingAddress, true);
}
for (let payer of payersToAdd) {
await this.createPayer(res.result.id, payer, true);
}
return res;
}
async createGuestCustomer(customer: CustomerDTO): Promise<Result<CustomerDTO>> {
const notificationChannels = this.getNotificationChannelForCommunicationDetails({
communicationDetails: customer?.communicationDetails,
});
const payload: CustomerDTO = { ...customer, customerType: 8, isGuestAccount: true, notificationChannels };
if (!(isArray(payload.shippingAddresses) && payload.shippingAddresses.length > 0)) {
payload.shippingAddresses = [
{
data: {
address: payload.address,
communicationDetails: payload.communicationDetails,
firstName: payload.firstName,
gender: payload.gender,
lastName: payload.lastName,
organisation: payload.organisation,
title: payload.title,
type: 1,
},
},
];
}
payload.shippingAddresses = customer.shippingAddresses ?? [];
if (!(isArray(payload.payers) && payload.payers.length > 0)) {
payload.payers = [
{
payer: {
data: {
address: payload.address,
communicationDetails: payload.communicationDetails,
firstName: payload.firstName,
gender: payload.gender,
lastName: payload.lastName,
organisation: payload.organisation,
title: payload.title,
payerType: payload.customerType,
},
},
},
];
}
payload.shippingAddresses.push({
data: this.mapCustomerToShippingAddress(customer),
});
return this.customerService.CustomerCreateOnlineCustomer(payload);
payload.payers = customer.payers ?? [];
payload.payers.push({
payer: {
data: {
...this.mapCustomerToPayer(customer),
payerType: payload.customerType,
},
},
});
const res = await this.customerService
.CustomerCreateCustomer({
customer: payload,
modifiers: [{ key: 'webshop', group: 'customertype' }],
})
.toPromise();
return res;
}
createBranchCustomer(customer: CustomerDTO): Observable<Result<CustomerDTO>> {
createStoreCustomer(customer: CustomerDTO): Observable<Result<CustomerDTO>> {
const notificationChannels = this.getNotificationChannelForCommunicationDetails({
communicationDetails: customer?.communicationDetails,
});
return this.customerService.CustomerCreateCustomer({ ...customer, customerType: 8, notificationChannels });
const p4mUser = customer.features.find((f) => f.key === 'p4mUser')?.value;
const modifiers: KeyValueDTOOfStringAndString[] = [{ key: 'store', group: 'customertype' }];
if (p4mUser) {
modifiers.push({ key: 'add-loyalty-card', value: p4mUser });
}
return this.customerService.CustomerCreateCustomer({
customer: { ...customer, customerType: 8, notificationChannels },
modifiers,
});
}
validateAddress(address: AddressDTO): Observable<Result<AddressDTO[]>> {
return this.customerService.CustomerValidateAddress(address);
return this.addressService.AddressValidateAddress(address);
}
getOnlineCustomerByEmail(email: string): Observable<CustomerInfoDTO | null> {
return this.getCustomers(email, {
take: 1,
filter: {
customertype: 'webshop',
},
}).pipe(
map((r) => {
if (r.hits === 1) {
return r.result[0];
} else {
return null;
}
}),
catchError((err) => [null])
);
}
private cachedCountriesFailed = false;
@@ -213,8 +422,8 @@ export class CrmCustomerService {
if (!this.cachedCountries || this.cachedCountriesFailed) {
this.cachedCountriesFailed = false;
this.cachedCountries = new ReplaySubject();
this.customerService
.CustomerGetCountries({})
this.countryService
.CountryGetCountries({})
.pipe(
retry(3),
catchError((err) => {
@@ -235,22 +444,28 @@ export class CrmCustomerService {
return this.customerService.CustomerEmailExists(email);
}
createPayer(customerId: number, payer: PayerDTO, isDefault?: boolean): Observable<[Result<PayerDTO>, Result<AssignedPayerDTO>]> {
return this.getCustomer(customerId).pipe(
mergeMap((customerResponse) =>
this.payerService
.PayerCreatePayer({ ...payer, payerType: customerResponse.result.customerType })
.pipe(
mergeMap((payerResponse) =>
this.customerService
.CustomerAddPayerReference({ customerId: customerId, payerId: payerResponse.result.id, isDefault: isDefault })
.pipe(
map((assigendPayerResponse) => [payerResponse, assigendPayerResponse] as [Result<PayerDTO>, Result<AssignedPayerDTO>])
)
checkLoyaltyCard({ loyaltyCardNumber, customerId }: { loyaltyCardNumber: string; customerId?: number }) {
return this.loyaltyCardService.LoyaltyCardCheckLoyaltyCard({ loyaltyCardNumber, customerId });
}
createPayer(customerId: number, payer: PayerDTO, isDefault?: boolean): Promise<[Result<PayerDTO>, Result<AssignedPayerDTO>]> {
return this.getCustomer(customerId)
.pipe(
mergeMap((customerResponse) =>
this.payerService
.PayerCreatePayer({ ...payer, payerType: customerResponse.result.customerType })
.pipe(
mergeMap((payerResponse) =>
this.customerService
.CustomerAddPayerReference({ customerId: customerId, payerId: payerResponse.result.id, isDefault: isDefault })
.pipe(
map((assigendPayerResponse) => [payerResponse, assigendPayerResponse] as [Result<PayerDTO>, Result<AssignedPayerDTO>])
)
)
)
)
)
)
);
.toPromise();
}
updatePayer(customerId: number, payerId: number, payer: PayerDTO, isDefault?: boolean): Observable<Result<PayerDTO>> {
@@ -263,11 +478,7 @@ export class CrmCustomerService {
return this.customerService.CustomerModifyPayerReference({ payerId, customerId, isDefault });
}
createShippingAddress(
customerId: number,
shippingAddress: ShippingAddressDTO,
isDefault?: boolean
): Observable<Result<ShippingAddressDTO>> {
createShippingAddress(customerId: number, shippingAddress: ShippingAddressDTO, isDefault?: boolean): Promise<Result<ShippingAddressDTO>> {
const data: ShippingAddressDTO = { ...shippingAddress };
if (isDefault) {
data.isDefault = new Date().toJSON();
@@ -275,7 +486,7 @@ export class CrmCustomerService {
delete data.isDefault;
}
return this.customerService.CustomerCreateShippingAddress({ customerId, shippingAddress: data });
return this.shippingAddressService.ShippingAddressCreateShippingAddress({ customerId, shippingAddress: data }).toPromise();
}
updateShippingAddress(
@@ -283,7 +494,7 @@ export class CrmCustomerService {
shippingAddressId: number,
shippingAddress: ShippingAddressDTO,
isDefault?: boolean
): Observable<Result<ShippingAddressDTO>> {
): Promise<Result<ShippingAddressDTO>> {
const data: ShippingAddressDTO = { ...shippingAddress };
if (isDefault) {
@@ -292,15 +503,17 @@ export class CrmCustomerService {
delete data.isDefault;
}
return this.customerService.CustomerUpdateShippingAddress({ shippingAddressId, shippingAddress: data, customerId });
return this.shippingAddressService
.ShippingAddressUpdateShippingAddress({ shippingAddressId, shippingAddress: data, customerId })
.toPromise();
}
getShippingAddress(shippingAddressId: number): Observable<Result<ShippingAddressDTO>> {
return this.customerService.CustomerGetShippingaddress(shippingAddressId);
return this.shippingAddressService.ShippingAddressGetShippingaddress(shippingAddressId);
}
getShippingAddresses(params: CustomerService.CustomerGetShippingAddressesParams): Observable<Result<ShippingAddressDTO[]>> {
return this.customerService.CustomerGetShippingAddresses(params);
getShippingAddresses(params: ShippingAddressService.ShippingAddressGetShippingAddressesParams): Observable<Result<ShippingAddressDTO[]>> {
return this.shippingAddressService.ShippingAddressGetShippingAddresses(params);
}
getPayer(payerId: number): Observable<Result<PayerDTO>> {
@@ -311,7 +524,7 @@ export class CrmCustomerService {
return this.customerService.CustomerGetBonuscards(customerId);
}
getCustomerHistory(customerId: number): Observable<ResponseArgsOfHistoryDTO> {
return this.customerService.CustomerGetCustomerHistory({ customerId });
getCustomerHistory(customerId: number): Observable<HistoryDTO[]> {
return this.customerService.CustomerGetCustomerHistory({ customerId }).pipe(map((response) => response?.result));
}
}

View File

@@ -5,11 +5,7 @@ import 'zone.js/testing';
import { getTestBed } from '@angular/core/testing';
import { BrowserDynamicTestingModule, platformBrowserDynamicTesting } from '@angular/platform-browser-dynamic/testing';
declare const require: any;
// First, initialize the Angular testing environment.
getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting());
// Then we find all the tests.
const context = require.context('./', true, /\.spec\.ts$/);
// And load the modules.
context.keys().map(context);
getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting(), {
teardown: { destroyAfterEach: false },
});

View File

@@ -3,7 +3,6 @@
"compilerOptions": {
"outDir": "../../../out-tsc/lib",
"declarationMap": true,
"target": "es2015",
"declaration": true,
"inlineSources": true,
"types": [],

View File

@@ -4,6 +4,6 @@
"declarationMap": false
},
"angularCompilerOptions": {
"enableIvy": false
"compilationMode": "partial"
}
}

View File

@@ -1,3 +1,5 @@
import { DialogOfString } from '@swagger/crm';
export interface Result<T> {
/** Ergebnis */
result?: T;
@@ -13,4 +15,6 @@ export interface Result<T> {
/** Fehlerhafte Daten */
invalidProperties?: { [key: string]: string };
dialog?: DialogOfString;
}

View File

@@ -5,20 +5,7 @@ import 'zone.js/testing';
import { getTestBed } from '@angular/core/testing';
import { BrowserDynamicTestingModule, platformBrowserDynamicTesting } from '@angular/platform-browser-dynamic/testing';
declare const require: {
context(
path: string,
deep?: boolean,
filter?: RegExp
): {
keys(): string[];
<T>(id: string): T;
};
};
// First, initialize the Angular testing environment.
getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting());
// Then we find all the tests.
const context = require.context('./', true, /\.spec\.ts$/);
// And load the modules.
context.keys().map(context);
getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting(), {
teardown: { destroyAfterEach: false },
});

View File

@@ -3,7 +3,6 @@
"extends": "../../../tsconfig.json",
"compilerOptions": {
"outDir": "../../../out-tsc/lib",
"target": "es2015",
"declaration": true,
"declarationMap": true,
"inlineSources": true,

View File

@@ -5,6 +5,6 @@
"declarationMap": false
},
"angularCompilerOptions": {
"enableIvy": false
"compilationMode": "partial"
}
}

View File

@@ -5,21 +5,5 @@ import 'zone.js/testing';
import { getTestBed } from '@angular/core/testing';
import { BrowserDynamicTestingModule, platformBrowserDynamicTesting } from '@angular/platform-browser-dynamic/testing';
declare const require: {
context(
path: string,
deep?: boolean,
filter?: RegExp
): {
keys(): string[];
<T>(id: string): T;
};
};
// First, initialize the Angular testing environment.
getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting(), { teardown: { destroyAfterEach: true } });
// Then we find all the tests.
const context = require.context('./', true, /\.spec\.ts$/);
// And load the modules.
context.keys().map(context);

View File

@@ -3,7 +3,6 @@
"extends": "../../../tsconfig.json",
"compilerOptions": {
"outDir": "../../../out-tsc/lib",
"target": "es2015",
"declaration": true,
"declarationMap": true,
"inlineSources": true,

View File

@@ -1,5 +1,6 @@
import { Injectable } from '@angular/core';
import {
BranchService,
ChangeStockStatusCodeValues,
HistoryDTO,
NotificationChannel,
@@ -10,9 +11,12 @@ import {
OrderListItemDTO,
OrderService,
ReceiptService,
ResponseArgsOfIEnumerableOfHistoryDTO,
StatusValues,
StockStatusCodeService,
ValueTupleOfLongAndReceiptTypeAndEntityDTOContainerOfReceiptDTO,
ValueTupleOfOrderItemSubsetDTOAndOrderItemSubsetDTO,
VATService,
} from '@swagger/oms';
import { memorize } from '@utils/common';
import { Observable } from 'rxjs';
@@ -23,6 +27,9 @@ export class DomainOmsService {
constructor(
private orderService: OrderService,
private receiptService: ReceiptService,
private branchService: BranchService,
private vatService: VATService,
private stockStatusCodeService: StockStatusCodeService,
private _orderCheckoutService: OrderCheckoutService
) {}
@@ -37,10 +44,10 @@ export class DomainOmsService {
}
getBranches() {
return this.orderService.OrderGetBranches({});
return this.branchService.BranchGetBranches({});
}
getHistory(orderItemSubsetId: number): Observable<HistoryDTO> {
getHistory(orderItemSubsetId: number): Observable<HistoryDTO[]> {
return this.orderService.OrderGetOrderItemStatusHistory({ orderItemSubsetId }).pipe(map((response) => response.result));
}
@@ -62,13 +69,13 @@ export class DomainOmsService {
@memorize()
getVATs() {
return this.orderService.OrderGetVATs({}).pipe(map((response) => response.result));
return this.vatService.VATGetVATs({}).pipe(map((response) => response.result));
}
// ttl 4 Stunden
@memorize({ ttl: 14400000 })
getStockStatusCodes({ supplierId, eagerLoading = 0 }: { supplierId: number; eagerLoading?: number }) {
return this.orderService.OrderGetStockStatusCodes({ supplierId, eagerLoading }).pipe(
return this.stockStatusCodeService.StockStatusCodeGetStockStatusCodes({ supplierId, eagerLoading }).pipe(
map((response) => response.result),
shareReplay()
);
@@ -152,6 +159,10 @@ export class DomainOmsService {
.pipe(map((response) => response.result));
}
setPreferredPickUpDate({ data }: { data: { [key: string]: string } }) {
return this.orderService.OrderSetPreferredPickUpDate({ data });
}
changeOrderItemStatus(data: OrderService.OrderChangeStatusParams) {
return this.orderService.OrderChangeStatus(data);
}

View File

@@ -5,20 +5,7 @@ import 'zone.js/testing';
import { getTestBed } from '@angular/core/testing';
import { BrowserDynamicTestingModule, platformBrowserDynamicTesting } from '@angular/platform-browser-dynamic/testing';
declare const require: {
context(
path: string,
deep?: boolean,
filter?: RegExp
): {
keys(): string[];
<T>(id: string): T;
};
};
// First, initialize the Angular testing environment.
getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting());
// Then we find all the tests.
const context = require.context('./', true, /\.spec\.ts$/);
// And load the modules.
context.keys().map(context);
getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting(), {
teardown: { destroyAfterEach: false },
});

View File

@@ -3,7 +3,6 @@
"extends": "../../../tsconfig.json",
"compilerOptions": {
"outDir": "../../../out-tsc/lib",
"target": "es2015",
"declaration": true,
"declarationMap": true,
"inlineSources": true,

View File

@@ -5,6 +5,6 @@
"declarationMap": false
},
"angularCompilerOptions": {
"enableIvy": false
"compilationMode": "partial"
}
}

View File

@@ -11,6 +11,7 @@ import {
PrintRequestOfIEnumerableOfPriceQRCodeDTO,
PrintService,
ResponseArgs,
LoyaltyCardPrintService,
} from '@swagger/print';
import { Observable, of } from 'rxjs';
import { catchError, filter, map, switchMap, timeout } from 'rxjs/operators';
@@ -25,7 +26,8 @@ export class DomainPrinterService {
private oMSPrintService: OMSPrintService,
private catalogPrintService: CatalogPrintService,
private checkoutPrintService: CheckoutPrintService,
private eisPublicDocumentService: EISPublicDocumentService
private eisPublicDocumentService: EISPublicDocumentService,
private _loyaltyCardPrintService: LoyaltyCardPrintService
) {}
getAvailablePrinters(): Observable<Printer[] | { error: string }> {
@@ -143,6 +145,13 @@ export class DomainPrinterService {
});
}
printKubiAgb({ p4mCode, printer }: { p4mCode: string; printer: string }) {
return this._loyaltyCardPrintService.LoyaltyCardPrintPrintLoyaltyCardAGB({
printer,
data: p4mCode,
});
}
printProduct({ item, printer }: { item: ItemDTO; printer: string }): Observable<ResponseArgs> {
const params = <PrintRequestOfIEnumerableOfItemDTO>{
printer: printer,

View File

@@ -5,20 +5,7 @@ import 'zone.js/testing';
import { getTestBed } from '@angular/core/testing';
import { BrowserDynamicTestingModule, platformBrowserDynamicTesting } from '@angular/platform-browser-dynamic/testing';
declare const require: {
context(
path: string,
deep?: boolean,
filter?: RegExp
): {
keys(): string[];
<T>(id: string): T;
};
};
// First, initialize the Angular testing environment.
getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting());
// Then we find all the tests.
const context = require.context('./', true, /\.spec\.ts$/);
// And load the modules.
context.keys().map(context);
getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting(), {
teardown: { destroyAfterEach: false },
});

View File

@@ -3,7 +3,6 @@
"extends": "../../../tsconfig.json",
"compilerOptions": {
"outDir": "../../../out-tsc/lib",
"target": "es2015",
"declaration": true,
"declarationMap": true,
"inlineSources": true,

View File

@@ -5,6 +5,6 @@
"declarationMap": false
},
"angularCompilerOptions": {
"enableIvy": false
"compilationMode": "partial"
}
}

View File

@@ -5,21 +5,5 @@ import 'zone.js/testing';
import { getTestBed } from '@angular/core/testing';
import { BrowserDynamicTestingModule, platformBrowserDynamicTesting } from '@angular/platform-browser-dynamic/testing';
declare const require: {
context(
path: string,
deep?: boolean,
filter?: RegExp
): {
keys(): string[];
<T>(id: string): T;
};
};
// First, initialize the Angular testing environment.
getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting(), { teardown: { destroyAfterEach: true } });
// Then we find all the tests.
const context = require.context('./', true, /\.spec\.ts$/);
// And load the modules.
context.keys().map(context);

View File

@@ -3,7 +3,6 @@
"extends": "../../../tsconfig.json",
"compilerOptions": {
"outDir": "../../../out-tsc/lib",
"target": "es2015",
"declaration": true,
"declarationMap": true,
"inlineSources": true,

View File

@@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { EISPublicService, FileDTO, ProcessingStatus, QueryTokenDTO } from '@swagger/eis';
import { DisplayInfoDTO, EISPublicService, FileDTO, ProcessingStatus, QueryTokenDTO } from '@swagger/eis';
import { DateAdapter } from '@ui/common';
import { memorize } from '@utils/common';
import { map, shareReplay, switchMap } from 'rxjs/operators';
@@ -279,4 +279,80 @@ export class DomainTaskCalendarService {
)
);
}
moveRemovedToEnd(a: DisplayInfoDTO, b: DisplayInfoDTO) {
const statusA = this.getProcessingStatusList(a)?.includes('Removed');
const statusB = this.getProcessingStatusList(b)?.includes('Removed');
if (statusA && statusB) {
return 0;
} else if (statusA && !statusB) {
return 1;
} else if (!statusA && statusB) {
return -1;
}
return 0;
}
/**
* Returns an Array of DisplayInfoDTO, sorted by ProcessingStatus
* Ignores Overdue if Task is already Completed
* Compared DisploayInfoDTO is of Type Task and Info Or PreInfo then sort by Type
* @param items DisplayInfoDTO Array to sort
* @param order Processing Status Order
* @returns DisplayInfoDTO Array ordered by Processing Status anf Type
*/
sort(items: DisplayInfoDTO[], order: ProcessingStatusList) {
let result = [...items];
const reversedOrder = [...order].reverse();
for (const status of reversedOrder) {
result = result?.sort((a, b) => {
const statusA = this.getProcessingStatusList(a);
const statusB = this.getProcessingStatusList(b);
// Ignore Overdue when it is already Completed
if (status === 'Overdue' && statusA.includes('Completed')) {
return 0;
}
const aHasStatus = statusA.includes(status);
const bHasStatus = statusB.includes(status);
if (aHasStatus && bHasStatus) {
// If it has the same ProcessingStatus then Sort by Type
const aType = this.getInfoType(a);
const bType = this.getInfoType(b);
if (aType !== bType) {
if (aType === 'Info' || aType === 'PreInfo') {
return -1;
} else {
return 1;
}
}
if (statusB.includes('Completed')) {
return -1;
}
return 0;
} else if (aHasStatus && !bHasStatus) {
return -1;
} else if (!aHasStatus && bHasStatus) {
return 1;
}
return 0;
});
}
return result;
}
getDateGroupKey(d: string) {
// Get Date as string key to ignore time for grouping
const date = new Date(d);
return date.toISOString().split('T')[0];
}
}

View File

@@ -5,20 +5,7 @@ import 'zone.js/testing';
import { getTestBed } from '@angular/core/testing';
import { BrowserDynamicTestingModule, platformBrowserDynamicTesting } from '@angular/platform-browser-dynamic/testing';
declare const require: {
context(
path: string,
deep?: boolean,
filter?: RegExp
): {
keys(): string[];
<T>(id: string): T;
};
};
// First, initialize the Angular testing environment.
getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting());
// Then we find all the tests.
const context = require.context('./', true, /\.spec\.ts$/);
// And load the modules.
context.keys().map(context);
getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting(), {
teardown: { destroyAfterEach: false },
});

View File

@@ -3,7 +3,6 @@
"extends": "../../../tsconfig.json",
"compilerOptions": {
"outDir": "../../../out-tsc/lib",
"target": "es2015",
"declaration": true,
"declarationMap": true,
"inlineSources": true,

View File

@@ -5,6 +5,6 @@
"declarationMap": false
},
"angularCompilerOptions": {
"enableIvy": false
"compilationMode": "partial"
}
}

View File

@@ -5,20 +5,7 @@ import 'zone.js/testing';
import { getTestBed } from '@angular/core/testing';
import { BrowserDynamicTestingModule, platformBrowserDynamicTesting } from '@angular/platform-browser-dynamic/testing';
declare const require: {
context(
path: string,
deep?: boolean,
filter?: RegExp
): {
keys(): string[];
<T>(id: string): T;
};
};
// First, initialize the Angular testing environment.
getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting());
// Then we find all the tests.
const context = require.context('./', true, /\.spec\.ts$/);
// And load the modules.
context.keys().map(context);
getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting(), {
teardown: { destroyAfterEach: false },
});

View File

@@ -3,7 +3,6 @@
"extends": "../../../tsconfig.json",
"compilerOptions": {
"outDir": "../../../out-tsc/lib",
"target": "es2015",
"declaration": true,
"declarationMap": true,
"inlineSources": true,

View File

@@ -5,6 +5,6 @@
"declarationMap": false
},
"angularCompilerOptions": {
"enableIvy": false
"compilationMode": "partial"
}
}

Some files were not shown because too many files have changed in this diff Show More