@chat21/chat21-ionic 3.0.59-rc4 → 3.0.59
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +77 -0
- package/README.md +5 -0
- package/config.xml +2 -2
- package/env.sample +3 -1
- package/package.json +1 -1
- package/resources/Android/splash/drawable-land-hdpi-screen.png +0 -0
- package/resources/Android/splash/drawable-land-ldpi-screen.png +0 -0
- package/resources/Android/splash/drawable-land-mdpi-screen.png +0 -0
- package/resources/Android/splash/drawable-land-xhdpi-screen.png +0 -0
- package/resources/Android/splash/drawable-land-xxhdpi-screen.png +0 -0
- package/resources/Android/splash/drawable-land-xxxhdpi-screen.png +0 -0
- package/resources/Android/splash/drawable-port-hdpi-screen.png +0 -0
- package/resources/Android/splash/drawable-port-ldpi-screen.png +0 -0
- package/resources/Android/splash/drawable-port-mdpi-screen.png +0 -0
- package/resources/Android/splash/drawable-port-xhdpi-screen.png +0 -0
- package/resources/Android/splash/drawable-port-xxhdpi-screen.png +0 -0
- package/resources/Android/splash/drawable-port-xxxhdpi-screen.png +0 -0
- package/resources/Android/splash.png +0 -0
- package/src/app/app.component.scss +10 -5
- package/src/app/app.component.ts +393 -234
- package/src/app/app.module.ts +12 -7
- package/src/app/chatlib/conversation-detail/conversation-content/conversation-content.component.html +1 -1
- package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.html +7 -6
- package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.ts +2 -1
- package/src/app/chatlib/list-conversations-component/list-conversations/list-conversations.component.html +1 -1
- package/src/app/components/authentication/login/login.component.html +8 -8
- package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.html +2 -4
- package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.ts +7 -2
- package/src/app/components/ddp-header/ddp-header.component.html +1 -1
- package/src/app/components/ddp-header/ddp-header.component.ts +4 -2
- package/src/app/components/project-item/project-item.component.html +61 -16
- package/src/app/components/project-item/project-item.component.scss +165 -38
- package/src/app/components/project-item/project-item.component.ts +58 -36
- package/src/app/pages/authentication/login/login.page.html +1 -2
- package/src/app/pages/conversation-detail/conversation-detail.page.ts +2 -0
- package/src/app/pages/conversations-list/conversations-list.page.html +12 -7
- package/src/app/pages/conversations-list/conversations-list.page.scss +279 -261
- package/src/app/pages/conversations-list/conversations-list.page.ts +149 -17
- package/src/app/pages/unassigned-conversations/unassigned-conversations.page.html +10 -2
- package/src/app/pages/unassigned-conversations/unassigned-conversations.page.scss +79 -0
- package/src/app/pages/unassigned-conversations/unassigned-conversations.page.ts +47 -36
- package/src/app/services/app-config.ts +77 -5
- package/src/app/services/websocket/websocket-js.ts +12 -14
- package/src/app/services/websocket/websocket.service.ts +26 -8
- package/src/assets/i18n/en.json +2 -1
- package/src/assets/i18n/it.json +2 -1
- package/src/assets/js/chat21client.js +144 -82
- package/src/assets/logo.png +0 -0
- package/src/assets/transparent.png +0 -0
- package/src/chat-config-pre-test.json +3 -1
- package/src/chat-config-template.json +4 -1
- package/src/chat-config.json +4 -1
- package/src/chat21-core/providers/firebase/firebase-archivedconversations-handler.ts +1 -1
- package/src/chat21-core/providers/firebase/firebase-conversations-handler.ts +1 -1
- package/src/chat21-core/providers/firebase/firebase-notifications.ts +31 -23
- package/src/chat21-core/providers/mqtt/mqtt-auth-service.ts +27 -27
- package/src/chat21-core/providers/mqtt/mqtt-conversation-handler.ts +3 -5
- package/src/chat21-core/providers/mqtt/mqtt-conversations-handler.ts +13 -5
- package/src/chat21-core/providers/mqtt/mqtt-notifications.ts +101 -11
- package/src/chat21-core/providers/tiledesk/tiledesk-auth.service.ts +12 -3
- package/src/chat21-core/utils/utils-message.ts +2 -2
- package/src/firebase-messaging-sw-template.js +1 -1
- package/src/assets/images/tiledesk_logo_50x50.png +0 -0
|
@@ -4,16 +4,20 @@
|
|
|
4
4
|
padding-top: 0px;
|
|
5
5
|
margin-top: 0px !important;
|
|
6
6
|
padding-bottom: 0px !important;
|
|
7
|
-
background: #fff;
|
|
7
|
+
// background: #fff;
|
|
8
8
|
padding-left: 0px;
|
|
9
|
-
min-height: 70px;
|
|
10
|
-
height: 70px;
|
|
11
9
|
width: 100%;
|
|
10
|
+
// min-height: 70px;
|
|
11
|
+
// height: 70px;
|
|
12
|
+
min-height: 55px;
|
|
13
|
+
height: 55px;
|
|
14
|
+
position: relative;
|
|
15
|
+
top: -5px;
|
|
12
16
|
}
|
|
13
17
|
|
|
14
|
-
.main-content-project-for-panel:hover {
|
|
15
|
-
|
|
16
|
-
}
|
|
18
|
+
// .main-content-project-for-panel:hover {
|
|
19
|
+
// background-color: rgb(244, 243, 244);
|
|
20
|
+
// }
|
|
17
21
|
.container-project-for-panel {
|
|
18
22
|
padding: 0px !important;
|
|
19
23
|
width: 296px;
|
|
@@ -283,6 +287,9 @@
|
|
|
283
287
|
overflow: hidden !important;
|
|
284
288
|
text-overflow: ellipsis !important;
|
|
285
289
|
font-family: Helvetica, Helvetica, Arial, sans-serif;
|
|
290
|
+
font-size: 14px;
|
|
291
|
+
position: relative;
|
|
292
|
+
top: -1px;
|
|
286
293
|
}
|
|
287
294
|
|
|
288
295
|
// .im-available-project-for-panel {
|
|
@@ -290,18 +297,26 @@
|
|
|
290
297
|
// }
|
|
291
298
|
|
|
292
299
|
.availabily-and-busy-wpr {
|
|
293
|
-
margin-top: 6px;
|
|
300
|
+
// margin-top: 6px;
|
|
301
|
+
margin-top: 7px;
|
|
294
302
|
margin-left: 11px;
|
|
295
303
|
}
|
|
296
304
|
|
|
305
|
+
.availabily---wpr {
|
|
306
|
+
display: inline-block;
|
|
307
|
+
position: relative;
|
|
308
|
+
top: -4px;
|
|
309
|
+
margin-right: 6px;
|
|
310
|
+
}
|
|
311
|
+
|
|
297
312
|
.availibility-status-text {
|
|
298
313
|
font-family: Helvetica, Helvetica, Arial, sans-serif;
|
|
299
|
-
font-size:
|
|
314
|
+
font-size: 11px;
|
|
300
315
|
margin-left: 3px;
|
|
301
|
-
position: relative;
|
|
302
|
-
top: -4px;
|
|
303
316
|
display: inline-block;
|
|
304
|
-
min-width:
|
|
317
|
+
min-width: 85px;
|
|
318
|
+
position: relative;
|
|
319
|
+
top: -5px;
|
|
305
320
|
}
|
|
306
321
|
|
|
307
322
|
.online-text-color {
|
|
@@ -321,15 +336,18 @@
|
|
|
321
336
|
|
|
322
337
|
.project-item--isBusy-icon {
|
|
323
338
|
border-radius: 50%;
|
|
324
|
-
background-color
|
|
325
|
-
font-size:
|
|
339
|
+
background-color:#FEB92C;
|
|
340
|
+
font-size: 14px;
|
|
326
341
|
color: #fff;
|
|
342
|
+
position: relative;
|
|
343
|
+
top: -1px;
|
|
344
|
+
// margin-left: 8px;
|
|
327
345
|
}
|
|
328
346
|
|
|
329
347
|
.project-item--isBusy-busy-text {
|
|
330
348
|
font-family: Helvetica, Helvetica, Arial, sans-serif;
|
|
331
|
-
font-size:
|
|
332
|
-
margin-left: 3px;
|
|
349
|
+
font-size: 11px;
|
|
350
|
+
// margin-left: 3px;
|
|
333
351
|
position: relative;
|
|
334
352
|
top: -4px;
|
|
335
353
|
}
|
|
@@ -342,37 +360,37 @@
|
|
|
342
360
|
|
|
343
361
|
@keyframes pulse {
|
|
344
362
|
0% {
|
|
345
|
-
color:
|
|
363
|
+
color: #999999;
|
|
346
364
|
}
|
|
347
365
|
50% {
|
|
348
|
-
color: #
|
|
366
|
+
color: #FEB92C;
|
|
349
367
|
}
|
|
350
368
|
100% {
|
|
351
|
-
color:
|
|
369
|
+
color: #999999;
|
|
352
370
|
}
|
|
353
371
|
}
|
|
354
372
|
/* Firefox */
|
|
355
373
|
@-moz-keyframes pulse {
|
|
356
374
|
0% {
|
|
357
|
-
color:
|
|
375
|
+
color: #999999;
|
|
358
376
|
}
|
|
359
377
|
50% {
|
|
360
|
-
color: #
|
|
378
|
+
color: #FEB92C;
|
|
361
379
|
}
|
|
362
380
|
100% {
|
|
363
|
-
color:
|
|
381
|
+
color: #999999;
|
|
364
382
|
}
|
|
365
383
|
}
|
|
366
384
|
/* Safari and Chrome */
|
|
367
385
|
@-webkit-keyframes pulse {
|
|
368
386
|
0% {
|
|
369
|
-
color:
|
|
387
|
+
color: #999999;
|
|
370
388
|
}
|
|
371
389
|
50% {
|
|
372
|
-
color: #
|
|
390
|
+
color: #FEB92C;
|
|
373
391
|
}
|
|
374
392
|
100% {
|
|
375
|
-
color:
|
|
393
|
+
color: #999999;
|
|
376
394
|
}
|
|
377
395
|
}
|
|
378
396
|
|
|
@@ -384,14 +402,18 @@
|
|
|
384
402
|
|
|
385
403
|
.unassigned-notifications-badge {
|
|
386
404
|
position: absolute;
|
|
387
|
-
top: 12px;
|
|
405
|
+
// top: 12px;
|
|
406
|
+
top: 14px;
|
|
388
407
|
border-radius: 50%;
|
|
389
408
|
background: #e41e3f;
|
|
390
|
-
width: 24px;
|
|
391
|
-
height: 24px;
|
|
409
|
+
// width: 24px;
|
|
410
|
+
// height: 24px;
|
|
411
|
+
width: 22px;
|
|
412
|
+
height: 22px;
|
|
392
413
|
color: #fff;
|
|
393
|
-
left: 28px;
|
|
394
|
-
|
|
414
|
+
// left: 28px;
|
|
415
|
+
left: 32px;
|
|
416
|
+
border: 1px solid #fff;
|
|
395
417
|
}
|
|
396
418
|
.notification-count {
|
|
397
419
|
font-size: 12px;
|
|
@@ -488,10 +510,62 @@
|
|
|
488
510
|
// ------------------------------------------------------------------
|
|
489
511
|
// on-off availability switch btn // https://proto.io/freebies/onoff/
|
|
490
512
|
// ------------------------------------------------------------------
|
|
513
|
+
// .onoffswitch {
|
|
514
|
+
// display: inline-block;
|
|
515
|
+
// position: relative;
|
|
516
|
+
// width: 36px;
|
|
517
|
+
// -webkit-user-select: none;
|
|
518
|
+
// -moz-user-select: none;
|
|
519
|
+
// -ms-user-select: none;
|
|
520
|
+
// }
|
|
521
|
+
// .onoffswitch-checkbox {
|
|
522
|
+
// position: absolute;
|
|
523
|
+
// opacity: 0;
|
|
524
|
+
// pointer-events: none;
|
|
525
|
+
// }
|
|
526
|
+
// .onoffswitch-label {
|
|
527
|
+
// display: block;
|
|
528
|
+
// overflow: hidden;
|
|
529
|
+
// cursor: pointer;
|
|
530
|
+
// height: 18px;
|
|
531
|
+
// padding: 0;
|
|
532
|
+
// line-height: 18px;
|
|
533
|
+
// border: 0px solid #ffffff;
|
|
534
|
+
// border-radius: 20px;
|
|
535
|
+
// background-color: #eeeeee;
|
|
536
|
+
// }
|
|
537
|
+
// .onoffswitch-label:before {
|
|
538
|
+
// content: "";
|
|
539
|
+
// display: block;
|
|
540
|
+
// width: 20px;
|
|
541
|
+
// margin: -1px;
|
|
542
|
+
// background: #f44336;
|
|
543
|
+
// position: absolute;
|
|
544
|
+
// top: 0;
|
|
545
|
+
// bottom: 0;
|
|
546
|
+
// // right: 14px;
|
|
547
|
+
// border-radius: 20px;
|
|
548
|
+
// // box-shadow: 0 6px 12px 0px #757575;
|
|
549
|
+
// }
|
|
550
|
+
// .onoffswitch-checkbox:checked + .onoffswitch-label {
|
|
551
|
+
// background-color: #eeeeee;
|
|
552
|
+
// }
|
|
553
|
+
// .onoffswitch-checkbox:checked + .onoffswitch-label,
|
|
554
|
+
// .onoffswitch-checkbox:checked + .onoffswitch-label:before {
|
|
555
|
+
// border-color: #eeeeee;
|
|
556
|
+
// }
|
|
557
|
+
// .onoffswitch-checkbox:checked + .onoffswitch-label .onoffswitch-inner {
|
|
558
|
+
// margin-left: 0;
|
|
559
|
+
// }
|
|
560
|
+
// .onoffswitch-checkbox:checked + .onoffswitch-label:before {
|
|
561
|
+
// right: 0px;
|
|
562
|
+
// background-color: #4caf50;
|
|
563
|
+
// // box-shadow: 3px 6px 18px 0px rgba(0, 0, 0, 0.2);
|
|
564
|
+
// }
|
|
565
|
+
|
|
491
566
|
.onoffswitch {
|
|
492
|
-
display: inline-block;
|
|
493
567
|
position: relative;
|
|
494
|
-
width:
|
|
568
|
+
width: 30px;
|
|
495
569
|
-webkit-user-select: none;
|
|
496
570
|
-moz-user-select: none;
|
|
497
571
|
-ms-user-select: none;
|
|
@@ -505,24 +579,24 @@
|
|
|
505
579
|
display: block;
|
|
506
580
|
overflow: hidden;
|
|
507
581
|
cursor: pointer;
|
|
508
|
-
height:
|
|
582
|
+
height: 8px;
|
|
509
583
|
padding: 0;
|
|
510
|
-
line-height:
|
|
584
|
+
line-height: 8px;
|
|
511
585
|
border: 0px solid #ffffff;
|
|
512
|
-
border-radius:
|
|
586
|
+
border-radius: 16px;
|
|
513
587
|
background-color: #eeeeee;
|
|
514
588
|
}
|
|
515
589
|
.onoffswitch-label:before {
|
|
516
590
|
content: "";
|
|
517
591
|
display: block;
|
|
518
|
-
width:
|
|
519
|
-
margin: -
|
|
592
|
+
width: 16px;
|
|
593
|
+
margin: -4px;
|
|
520
594
|
background: #f44336;
|
|
521
595
|
position: absolute;
|
|
522
596
|
top: 0;
|
|
523
597
|
bottom: 0;
|
|
524
|
-
|
|
525
|
-
border-radius:
|
|
598
|
+
right: 18px;
|
|
599
|
+
border-radius: 16px;
|
|
526
600
|
// box-shadow: 0 6px 12px 0px #757575;
|
|
527
601
|
}
|
|
528
602
|
.onoffswitch-checkbox:checked + .onoffswitch-label {
|
|
@@ -540,3 +614,56 @@
|
|
|
540
614
|
background-color: #4caf50;
|
|
541
615
|
// box-shadow: 3px 6px 18px 0px rgba(0, 0, 0, 0.2);
|
|
542
616
|
}
|
|
617
|
+
|
|
618
|
+
// -----------------------
|
|
619
|
+
// i on-off switch
|
|
620
|
+
// -----------------------
|
|
621
|
+
.i_onoffswitch {
|
|
622
|
+
position: relative;
|
|
623
|
+
width: 33px;
|
|
624
|
+
-webkit-user-select: none;
|
|
625
|
+
-moz-user-select: none;
|
|
626
|
+
-ms-user-select: none;
|
|
627
|
+
}
|
|
628
|
+
.i_onoffswitch-checkbox {
|
|
629
|
+
position: absolute;
|
|
630
|
+
opacity: 0;
|
|
631
|
+
pointer-events: none;
|
|
632
|
+
}
|
|
633
|
+
.i_onoffswitch-label {
|
|
634
|
+
display: block;
|
|
635
|
+
overflow: hidden;
|
|
636
|
+
cursor: pointer;
|
|
637
|
+
height: 18px;
|
|
638
|
+
padding: 0;
|
|
639
|
+
line-height: 18px;
|
|
640
|
+
// border: 1px solid #e3e3e3;
|
|
641
|
+
border-radius: 18px;
|
|
642
|
+
background-color: #f44336;
|
|
643
|
+
transition: background-color 0.3s ease-in;
|
|
644
|
+
}
|
|
645
|
+
.i_onoffswitch-label:before {
|
|
646
|
+
content: "";
|
|
647
|
+
display: block;
|
|
648
|
+
// width: 18px;
|
|
649
|
+
width: 16px;
|
|
650
|
+
margin: 0px;
|
|
651
|
+
background: #ffffff;
|
|
652
|
+
position: absolute;
|
|
653
|
+
top: 0;
|
|
654
|
+
bottom: 0;
|
|
655
|
+
right: 15px;
|
|
656
|
+
border: 1px solid #e3e3e3;
|
|
657
|
+
border-radius: 18px;
|
|
658
|
+
transition: all 0.3s ease-in 0s;
|
|
659
|
+
}
|
|
660
|
+
.i_onoffswitch-checkbox:checked + .i_onoffswitch-label {
|
|
661
|
+
background-color: #4caf50;
|
|
662
|
+
}
|
|
663
|
+
.i_onoffswitch-checkbox:checked + .i_onoffswitch-label,
|
|
664
|
+
.i_onoffswitch-checkbox:checked + .i_onoffswitch-label:before {
|
|
665
|
+
border-color: #4caf50;
|
|
666
|
+
}
|
|
667
|
+
.i_onoffswitch-checkbox:checked + .i_onoffswitch-label:before {
|
|
668
|
+
right: 0px;
|
|
669
|
+
}
|
|
@@ -8,6 +8,7 @@ import { LoggerInstance } from 'src/chat21-core/providers/logger/loggerInstance'
|
|
|
8
8
|
import { CustomTranslateService } from 'src/chat21-core/providers/custom-translate.service';
|
|
9
9
|
import { TiledeskAuthService } from 'src/chat21-core/providers/tiledesk/tiledesk-auth.service';
|
|
10
10
|
import { TiledeskService } from 'src/app/services/tiledesk/tiledesk.service';
|
|
11
|
+
import { WebSocketJs } from 'src/app/services/websocket/websocket-js';
|
|
11
12
|
|
|
12
13
|
@Component({
|
|
13
14
|
selector: 'app-project-item',
|
|
@@ -35,7 +36,8 @@ export class ProjectItemComponent implements OnInit {
|
|
|
35
36
|
public appStorageService: AppStorageService,
|
|
36
37
|
private translateService: CustomTranslateService,
|
|
37
38
|
public tiledeskAuthService: TiledeskAuthService,
|
|
38
|
-
public tiledeskService: TiledeskService
|
|
39
|
+
public tiledeskService: TiledeskService,
|
|
40
|
+
public webSocketJs: WebSocketJs,
|
|
39
41
|
) { }
|
|
40
42
|
|
|
41
43
|
ngOnInit() {
|
|
@@ -45,16 +47,22 @@ export class ProjectItemComponent implements OnInit {
|
|
|
45
47
|
this.translations();
|
|
46
48
|
this.listenToPostMsgs();
|
|
47
49
|
this.onInitWindowWidth();
|
|
50
|
+
|
|
48
51
|
}
|
|
49
52
|
|
|
50
53
|
listenToPostMsgs() {
|
|
51
54
|
window.addEventListener("message", (event) => {
|
|
52
55
|
// console.log("[PROJECT-ITEM] post message event ", event);
|
|
53
|
-
|
|
56
|
+
|
|
54
57
|
if (event && event.data && event.data) {
|
|
55
|
-
// console.log("[
|
|
58
|
+
// console.log("[PROJECT-ITEM] message event data ", event.data);
|
|
56
59
|
if (event.data === 'hasChangedProject') {
|
|
60
|
+
this.unservedRequestCount = 0;
|
|
61
|
+
if (this.project) {
|
|
62
|
+
this.webSocketJs.unsubscribe('/' + this.project.id_project._id + '/requests');
|
|
63
|
+
}
|
|
57
64
|
this.getLastProjectStoredAndSubscToWSAvailabilityAndConversations();
|
|
65
|
+
|
|
58
66
|
}
|
|
59
67
|
}
|
|
60
68
|
})
|
|
@@ -72,26 +80,26 @@ export class ProjectItemComponent implements OnInit {
|
|
|
72
80
|
@HostListener('window:resize', ['$event'])
|
|
73
81
|
onResize(event: any) {
|
|
74
82
|
this.newInnerWidth = event.target.innerWidth;
|
|
75
|
-
this.logger.log('[
|
|
83
|
+
this.logger.log('[PROJECT-ITEM] - INNER WIDTH ', this.newInnerWidth)
|
|
76
84
|
|
|
77
|
-
if (this.newInnerWidth <= 150) {
|
|
78
|
-
|
|
79
|
-
} else {
|
|
80
|
-
|
|
81
|
-
}
|
|
85
|
+
// if (this.newInnerWidth <= 150) {
|
|
86
|
+
// this.window_width_is_60 = true;
|
|
87
|
+
// } else {
|
|
88
|
+
// this.window_width_is_60 = false;
|
|
89
|
+
// }
|
|
82
90
|
}
|
|
83
91
|
|
|
84
92
|
onInitWindowWidth(): any {
|
|
85
93
|
const actualWidth = window.innerWidth;
|
|
86
|
-
this.logger.log('[
|
|
94
|
+
this.logger.log('[PROJECT-ITEM] - ACTUAL Width ', actualWidth);
|
|
87
95
|
|
|
88
96
|
|
|
89
|
-
|
|
90
|
-
if (actualWidth <= 150) {
|
|
91
|
-
|
|
92
|
-
} else {
|
|
93
|
-
|
|
94
|
-
}
|
|
97
|
+
|
|
98
|
+
// if (actualWidth <= 150) {
|
|
99
|
+
// this.window_width_is_60 = true;
|
|
100
|
+
// } else {
|
|
101
|
+
// this.window_width_is_60 = false;
|
|
102
|
+
// }
|
|
95
103
|
}
|
|
96
104
|
|
|
97
105
|
|
|
@@ -114,17 +122,29 @@ export class ProjectItemComponent implements OnInit {
|
|
|
114
122
|
}
|
|
115
123
|
|
|
116
124
|
getLastProjectStoredAndSubscToWSAvailabilityAndConversations() {
|
|
117
|
-
|
|
125
|
+
let stored_project = ''
|
|
126
|
+
try {
|
|
127
|
+
stored_project = localStorage.getItem('last_project')
|
|
128
|
+
this.logger.log('PROJECT-ITEM - THERE IS A STORED PROJECT ', stored_project)
|
|
129
|
+
} catch (err) {
|
|
130
|
+
this.logger.error('Get local storage LAST PROJECT ', err)
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
|
|
118
134
|
if (!stored_project) {
|
|
135
|
+
this.logger.log('PROJECT-ITEM - THERE IS NOT STORED LAST PROJECT ', stored_project)
|
|
119
136
|
const tiledeskToken = this.appStorageService.getItem('tiledeskToken');
|
|
120
137
|
this.logger.log('[INFO-CONTENT-COMP] - GET PROJECTS - tiledeskToken', tiledeskToken);
|
|
121
138
|
this.tiledeskService.getProjects(tiledeskToken).subscribe(projects => {
|
|
122
139
|
this.logger.log('[INFO-CONTENT-COMP] - GET PROJECTS - RES', projects);
|
|
123
|
-
|
|
140
|
+
|
|
124
141
|
this.logger.log('[INFO-CONTENT-COMP] - GET PROJECTS - RES this.project', this.project);
|
|
125
|
-
|
|
142
|
+
|
|
126
143
|
localStorage.setItem('last_project', JSON.stringify(projects[0]))
|
|
127
|
-
|
|
144
|
+
if (projects[0]) {
|
|
145
|
+
this.project = projects[0];
|
|
146
|
+
this.doProjectSubscriptions(this.project)
|
|
147
|
+
}
|
|
128
148
|
|
|
129
149
|
}, (error) => {
|
|
130
150
|
this.logger.error('[INFO-CONTENT-COMP] - GET PROJECTS - ERROR ', error);
|
|
@@ -137,16 +157,19 @@ export class ProjectItemComponent implements OnInit {
|
|
|
137
157
|
|
|
138
158
|
|
|
139
159
|
if (stored_project) {
|
|
140
|
-
|
|
141
|
-
|
|
160
|
+
this.logger.log('PROJECT-ITEM - THERE IS STORED LAST PROJECT ', stored_project)
|
|
161
|
+
if (stored_project) {
|
|
162
|
+
this.project = JSON.parse(stored_project)
|
|
163
|
+
}
|
|
142
164
|
this.doProjectSubscriptions(this.project)
|
|
143
165
|
this.logger.log('[PROJECT-ITEM] - LAST PROJECT PARSED ', this.project)
|
|
144
166
|
}
|
|
145
167
|
|
|
146
|
-
|
|
168
|
+
|
|
147
169
|
}
|
|
148
170
|
|
|
149
171
|
doProjectSubscriptions(project) {
|
|
172
|
+
this.logger.log('[PROJECT-ITEM] doProjectSubscriptions project ', project)
|
|
150
173
|
if (project) {
|
|
151
174
|
const user_role = this.project.role
|
|
152
175
|
this.logger.log('[PROJECT-ITEM] - user_role ', user_role)
|
|
@@ -208,7 +231,7 @@ export class ProjectItemComponent implements OnInit {
|
|
|
208
231
|
|
|
209
232
|
if (this.project['id_project']._id === projectUser.id_project) {
|
|
210
233
|
this.project['ws_projct_user_available'] = projectUser.user_available;
|
|
211
|
-
this.project['ws_projct_user_isBusy'] = projectUser['isBusy']
|
|
234
|
+
// this.project['ws_projct_user_isBusy'] = projectUser['isBusy']
|
|
212
235
|
}
|
|
213
236
|
|
|
214
237
|
}, (error) => {
|
|
@@ -221,29 +244,28 @@ export class ProjectItemComponent implements OnInit {
|
|
|
221
244
|
}
|
|
222
245
|
|
|
223
246
|
updateUnservedRequestCount() {
|
|
247
|
+
// console.log('[PROJECT-ITEM] updateUnservedRequestCount ')
|
|
224
248
|
// this.requestsService.requestsList_bs.subscribe((requests) => {
|
|
225
249
|
this.wsService.wsRequestsList$
|
|
226
|
-
.pipe(
|
|
227
|
-
takeUntil(this.unsubscribe$)
|
|
228
|
-
)
|
|
229
250
|
.subscribe((requests) => {
|
|
230
|
-
|
|
251
|
+
// console.log('[PROJECT-ITEM] requests ', requests)
|
|
231
252
|
if (requests) {
|
|
232
253
|
let count = 0;
|
|
233
254
|
requests.forEach(r => {
|
|
234
255
|
// this.logger.log('NAVBAR - UPDATE-UNSERVED-REQUEST-COUNT request agents', r.agents)
|
|
235
256
|
// *bug fix: when the user is an agent also for the unserved we have to consider if he is present in agents
|
|
236
|
-
|
|
257
|
+
// && this.ROLE_IS_AGENT === true
|
|
258
|
+
if (r['status'] === 100 ) {
|
|
237
259
|
if (this.hasmeInAgents(r['agents']) === true) {
|
|
238
260
|
count = count + 1;
|
|
239
261
|
}
|
|
240
262
|
}
|
|
241
|
-
if (r['status'] === 100 && this.ROLE_IS_AGENT === false) {
|
|
242
|
-
|
|
243
|
-
}
|
|
263
|
+
// if (r['status'] === 100 && this.ROLE_IS_AGENT === false) {
|
|
264
|
+
// count = count + 1;
|
|
265
|
+
// }
|
|
244
266
|
});
|
|
245
267
|
this.unservedRequestCount = count;
|
|
246
|
-
|
|
268
|
+
// console.log('[PROJECT-ITEM] UNSERVED REQUEST COUNT - RES ', this.unservedRequestCount)
|
|
247
269
|
}
|
|
248
270
|
}, error => {
|
|
249
271
|
this.logger.error('[PROJECT-ITEM] UNSERVED REQUEST COUNT * error * ', error)
|
|
@@ -255,10 +277,10 @@ export class ProjectItemComponent implements OnInit {
|
|
|
255
277
|
hasmeInAgents(agents) {
|
|
256
278
|
if (agents) {
|
|
257
279
|
for (let j = 0; j < agents.length; j++) {
|
|
258
|
-
this.logger.log('[PROJECT-ITEM] hasmeInAgents currentUserId ', this.currentUserId)
|
|
259
|
-
this.logger.log('[PROJECT-ITEM] hasmeInAgents agent ', agents[j].id_user)
|
|
280
|
+
// this.logger.log('[PROJECT-ITEM] hasmeInAgents currentUserId ', this.currentUserId)
|
|
281
|
+
// this.logger.log('[PROJECT-ITEM] hasmeInAgents agent ', agents[j].id_user)
|
|
260
282
|
if (this.currentUserId === agents[j].id_user) {
|
|
261
|
-
this.logger.log('[PROJECT-ITEM] hasmeInAgents ')
|
|
283
|
+
// this.logger.log('[PROJECT-ITEM] hasmeInAgents ')
|
|
262
284
|
return true
|
|
263
285
|
}
|
|
264
286
|
}
|
|
@@ -3,6 +3,5 @@
|
|
|
3
3
|
[translationMap] = translationMap
|
|
4
4
|
[companyLogoBlackUrl]= companyLogoBlackUrl
|
|
5
5
|
[companyName]= companyName
|
|
6
|
-
(eventSignInWithEmailAndPassword)="returnSignInWithEmailAndPassword($event)"
|
|
7
|
-
>
|
|
6
|
+
(eventSignInWithEmailAndPassword)="returnSignInWithEmailAndPassword($event)">
|
|
8
7
|
</component-login>
|
|
@@ -179,6 +179,8 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
|
|
|
179
179
|
this.conversationWith = params.get('IDConv');
|
|
180
180
|
this.conversationWithFullname = params.get('FullNameConv');
|
|
181
181
|
this.conv_type = params.get('Convtype');
|
|
182
|
+
|
|
183
|
+
this.events.publish('supportconvid:haschanged', this.conversationWith);
|
|
182
184
|
});
|
|
183
185
|
|
|
184
186
|
}
|
|
@@ -12,13 +12,8 @@
|
|
|
12
12
|
|
|
13
13
|
<div id="scrollbar2">
|
|
14
14
|
<ion-list>
|
|
15
|
-
<span
|
|
16
|
-
*ngIf="(conversations.length > 0 && conversationType ==='active') || (archivedConversations.length > 0 && conversationType ==='archived');then contentConversations else contentMessageWelcome">
|
|
17
|
-
here is ignored
|
|
18
|
-
</span>
|
|
19
15
|
|
|
20
|
-
|
|
21
|
-
<!-- -------------------------------------------------------------------------- -->
|
|
16
|
+
<!-- -------------------------------------------------------------------------- -->
|
|
22
17
|
<!-- New <ion-spinner class="spinner-middle" style="margin-left: 19px;"></ion-spinner> -->
|
|
23
18
|
<!-- -------------------------------------------------------------------------- -->
|
|
24
19
|
<ion-item *ngIf="isOnline === false" style="padding-left:0px!important ;padding-right:0px!important" button="true" lines="none" class="ion-no-padding waiting-for-connection">
|
|
@@ -42,11 +37,21 @@
|
|
|
42
37
|
<ion-label part="message-text" class="waiting-for-network-msg"> Waiting for network</ion-label>
|
|
43
38
|
</ion-item>
|
|
44
39
|
|
|
45
|
-
<ion-item class="ion-no-padding
|
|
40
|
+
<ion-item *ngIf="supportMode && displayNewConvsItem" class="ion-no-padding open-iframe-item"
|
|
41
|
+
button="true"
|
|
46
42
|
(click)="openUnsevedConversationIframe()">
|
|
47
43
|
<div tabindex="0"></div>
|
|
48
44
|
<app-project-item (projectIdEvent)="getLastProjectId($event)"></app-project-item>
|
|
49
45
|
</ion-item>
|
|
46
|
+
|
|
47
|
+
<span
|
|
48
|
+
*ngIf="(conversations.length > 0 && conversationType ==='active') || (archivedConversations.length > 0 && conversationType ==='archived');then contentConversations else contentMessageWelcome">
|
|
49
|
+
here is ignored
|
|
50
|
+
</span>
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
<ng-template #contentConversations>
|
|
50
55
|
<!-- ---------------------------------- -->
|
|
51
56
|
<!-- ACTIVE CONVERSATION LIST -->
|
|
52
57
|
<!-- ---------------------------------- -->
|