@chat21/chat21-ionic 3.0.55 → 3.0.59-rc10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. package/CHANGELOG.md +65 -0
  2. package/README.md +4 -0
  3. package/config.xml +11 -2
  4. package/env.sample +2 -0
  5. package/package.json +1 -1
  6. package/resources/Android/splash/drawable-land-hdpi-screen.png +0 -0
  7. package/resources/Android/splash/drawable-land-ldpi-screen.png +0 -0
  8. package/resources/Android/splash/drawable-land-mdpi-screen.png +0 -0
  9. package/resources/Android/splash/drawable-land-xhdpi-screen.png +0 -0
  10. package/resources/Android/splash/drawable-land-xxhdpi-screen.png +0 -0
  11. package/resources/Android/splash/drawable-land-xxxhdpi-screen.png +0 -0
  12. package/resources/Android/splash/drawable-port-hdpi-screen.png +0 -0
  13. package/resources/Android/splash/drawable-port-ldpi-screen.png +0 -0
  14. package/resources/Android/splash/drawable-port-mdpi-screen.png +0 -0
  15. package/resources/Android/splash/drawable-port-xhdpi-screen.png +0 -0
  16. package/resources/Android/splash/drawable-port-xxhdpi-screen.png +0 -0
  17. package/resources/Android/splash/drawable-port-xxxhdpi-screen.png +0 -0
  18. package/resources/Android/splash.png +0 -0
  19. package/src/app/app-routing.module.ts +21 -17
  20. package/src/app/app.component.html +6 -3
  21. package/src/app/app.component.ts +323 -185
  22. package/src/app/app.module.ts +16 -8
  23. package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.html +4 -4
  24. package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.scss +8 -2
  25. package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.ts +6 -1
  26. package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.html +7 -2
  27. package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.ts +48 -3
  28. package/src/app/chatlib/conversation-detail/message/image/image.component.html +7 -6
  29. package/src/app/chatlib/conversation-detail/message/image/image.component.ts +20 -1
  30. package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.html +39 -9
  31. package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.scss +8 -144
  32. package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.ts +14 -17
  33. package/src/app/components/authentication/login/login.component.html +2 -2
  34. package/src/app/components/authentication/login/login.component.ts +2 -1
  35. package/src/app/components/conversation-detail/bubble-my-message/bubble-my-message.component.ts +1 -1
  36. package/src/app/components/conversation-detail/bubble-others-message/bubble-others-message.component.ts +1 -1
  37. package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.html +17 -12
  38. package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.scss +12 -0
  39. package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.ts +21 -5
  40. package/src/app/components/conversation-detail/message-text-area/message-text-area.component.html +3 -2
  41. package/src/app/components/conversation-detail/message-text-area/message-text-area.component.scss +22 -17
  42. package/src/app/components/conversation-detail/message-text-area/message-text-area.component.ts +46 -5
  43. package/src/app/components/ddp-header/ddp-header.component.html +1 -1
  44. package/src/app/components/ddp-header/ddp-header.component.ts +4 -2
  45. package/src/app/components/image-viewer/image-viewer.component.html +23 -0
  46. package/src/app/components/image-viewer/image-viewer.component.scss +107 -0
  47. package/src/app/components/image-viewer/image-viewer.component.spec.ts +24 -0
  48. package/src/app/components/image-viewer/image-viewer.component.ts +38 -0
  49. package/src/app/components/project-item/project-item.component.html +147 -0
  50. package/src/app/components/project-item/project-item.component.scss +669 -0
  51. package/src/app/components/project-item/project-item.component.spec.ts +24 -0
  52. package/src/app/components/project-item/project-item.component.ts +316 -0
  53. package/src/app/components/utils/avatar-profile/avatar-profile.component.html +7 -0
  54. package/src/app/components/utils/avatar-profile/avatar-profile.component.ts +22 -5
  55. package/src/app/pages/authentication/login/login.page.ts +2 -2
  56. package/src/app/pages/conversation-detail/conversation-detail.page.html +5 -3
  57. package/src/app/pages/conversation-detail/conversation-detail.page.ts +122 -30
  58. package/src/app/pages/conversations-list/conversations-list.page.html +40 -24
  59. package/src/app/pages/conversations-list/conversations-list.page.scss +146 -1
  60. package/src/app/pages/conversations-list/conversations-list.page.ts +87 -6
  61. package/src/app/pages/unassigned-conversations/unassigned-conversations-routing.module.ts +17 -0
  62. package/src/app/pages/unassigned-conversations/unassigned-conversations.module.ts +22 -0
  63. package/src/app/pages/unassigned-conversations/unassigned-conversations.page.html +22 -0
  64. package/src/app/pages/unassigned-conversations/unassigned-conversations.page.scss +79 -0
  65. package/src/app/pages/unassigned-conversations/unassigned-conversations.page.spec.ts +24 -0
  66. package/src/app/pages/unassigned-conversations/unassigned-conversations.page.ts +108 -0
  67. package/src/app/services/nav-proxy.service.ts +1 -1
  68. package/src/app/services/tiledesk/tiledesk.service.ts +22 -1
  69. package/src/app/services/websocket/websocket-js.ts +559 -0
  70. package/src/app/services/websocket/websocket.service.spec.ts +12 -0
  71. package/src/app/services/websocket/websocket.service.ts +274 -0
  72. package/src/app/shared/shared.module.ts +7 -1
  73. package/src/assets/i18n/en.json +9 -1
  74. package/src/assets/i18n/it.json +10 -2
  75. package/src/assets/js/chat21client.js +141 -67
  76. package/src/assets/transparent.png +0 -0
  77. package/src/chat-config-pre-test.json +4 -2
  78. package/src/chat-config-template.json +3 -1
  79. package/src/chat-config.json +3 -1
  80. package/src/chat21-core/providers/abstract/app-storage.service.ts +2 -2
  81. package/src/chat21-core/providers/chat-manager.ts +3 -3
  82. package/src/chat21-core/providers/firebase/firebase-archivedconversations-handler.ts +1 -1
  83. package/src/chat21-core/providers/firebase/firebase-auth-service.ts +125 -79
  84. package/src/chat21-core/providers/firebase/firebase-conversation-handler.ts +1 -1
  85. package/src/chat21-core/providers/firebase/firebase-notifications.ts +11 -17
  86. package/src/chat21-core/providers/firebase/firebase-presence.service.ts +2 -2
  87. package/src/chat21-core/providers/firebase/firebase-typing.service.ts +1 -1
  88. package/src/chat21-core/providers/firebase/firebase-upload.service.ts +1 -1
  89. package/src/chat21-core/providers/localSessionStorage.ts +155 -154
  90. package/src/chat21-core/providers/mqtt/mqtt-auth-service.ts +27 -27
  91. package/src/chat21-core/providers/mqtt/mqtt-conversations-handler.ts +13 -5
  92. package/src/chat21-core/providers/mqtt/mqtt-notifications.ts +101 -11
  93. package/src/chat21-core/providers/tiledesk/tiledesk-auth.service.ts +1 -1
  94. package/src/chat21-core/utils/utils.ts +1 -1
  95. package/src/global.scss +2 -7
  96. package/src/index.html +1 -1
@@ -40,6 +40,7 @@ import { Subject } from 'rxjs';
40
40
  import { takeUntil } from 'rxjs/operators';
41
41
  import { TiledeskService } from '../../services/tiledesk/tiledesk.service';
42
42
  import { NetworkService } from '../../services/network-service/network.service';
43
+ import { EventsService } from '../../services/events-service';
43
44
 
44
45
  @Component({
45
46
  selector: 'app-conversation-detail',
@@ -51,6 +52,8 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
51
52
  @ViewChild('ionContentChatArea', { static: false }) ionContentChatArea: IonContent;
52
53
  @ViewChild('rowMessageTextArea', { static: false }) rowTextArea: ElementRef;
53
54
 
55
+
56
+
54
57
  // @ViewChild('info_content', { static: false }) info_content_child : InfoContentComponent;
55
58
 
56
59
  showButtonToBottom = false; // indica lo stato del pulsante per scrollare la chat (showed/hidden)
@@ -90,6 +93,8 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
90
93
 
91
94
  public tagsCanned: any = [];
92
95
  public tagsCannedFilter: any = [];
96
+ public HIDE_CANNED_RESPONSES: boolean = false;
97
+
93
98
 
94
99
  public window: any = window;
95
100
  public styleMap: Map<string, string> = new Map();
@@ -164,7 +169,8 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
164
169
  public presenceService: PresenceService,
165
170
  public toastController: ToastController,
166
171
  public tiledeskService: TiledeskService,
167
- private networkService: NetworkService
172
+ private networkService: NetworkService,
173
+ private events: EventsService
168
174
  ) {
169
175
 
170
176
  // Change list on date change
@@ -533,23 +539,27 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
533
539
  if (this.conversationWith && this.conversationsHandlerService && this.conv_type === 'active') {
534
540
  this.logger.log('[CONVS-DETAIL] - setHeaderContent getConversationDetail CALLING')
535
541
  this.conversationsHandlerService.getConversationDetail(this.conversationWith, (conv) => {
536
- this.logger.log('[CONVS-DETAIL] - setHeaderContent getConversationDetail (active)', this.conversationWith, conv)
537
- this.conversationAvatar = setConversationAvatar(
538
- conv.conversation_with,
539
- conv.conversation_with_fullname,
540
- conv.channel_type
541
- );
542
+ if (conv) {
543
+ this.logger.log('[CONVS-DETAIL] - setHeaderContent getConversationDetail (active)', this.conversationWith, conv)
544
+ this.conversationAvatar = setConversationAvatar(
545
+ conv.conversation_with,
546
+ conv.conversation_with_fullname,
547
+ conv.channel_type
548
+ );
549
+ }
542
550
  this.logger.log('[CONVS-DETAIL] - setHeaderContent > conversationAvatar: ', this.conversationAvatar);
543
551
  })
544
552
  }
545
553
  else { //get conversation from 'conversations' firebase node
546
554
  this.archivedConversationsHandlerService.getConversationDetail(this.conversationWith, (conv) => {
547
- this.logger.log('[CONVS-DETAIL] - setHeaderContent getConversationDetail (archived)', this.conversationWith, conv)
548
- this.conversationAvatar = setConversationAvatar(
549
- conv.conversation_with,
550
- conv.conversation_with_fullname,
551
- conv.channel_type
552
- );
555
+ if (conv) {
556
+ this.logger.log('[CONVS-DETAIL] - setHeaderContent getConversationDetail (archived)', this.conversationWith, conv)
557
+ this.conversationAvatar = setConversationAvatar(
558
+ conv.conversation_with,
559
+ conv.conversation_with_fullname,
560
+ conv.channel_type
561
+ );
562
+ }
553
563
  })
554
564
  }
555
565
 
@@ -628,23 +638,23 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
628
638
  msg = `[${metadata.name}](${metadata.src})`
629
639
  }
630
640
  }
631
-
641
+
632
642
  // else if (type === 'image') {
633
643
  // if (msg) {
634
644
  // // msg = msg + '<br>' + 'File: ' + metadata.src;
635
645
  // msg = metadata.name + '\n' + msg
636
646
 
637
647
  // } else {
638
-
648
+
639
649
  // msg = metadata.name
640
650
  // }
641
-
651
+
642
652
  // }
643
-
653
+
644
654
 
645
655
  (metadata) ? metadata = metadata : metadata = '';
646
656
  this.logger.log('[CONVS-DETAIL] - SEND MESSAGE msg: ', msg, ' - messages: ', this.messages, ' - loggedUser: ', this.loggedUser);
647
-
657
+
648
658
  if (msg && msg.trim() !== '' || type !== TYPE_MSG_TEXT) {
649
659
  this.conversationHandlerService.sendMessage(
650
660
  msg,
@@ -835,12 +845,12 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
835
845
 
836
846
  logScrolling(event: any) {
837
847
  // EVENTO IONIC-NATIVE: SCATTA SEMPRE, QUINDI DECIDO SE MOSTRARE O MENO IL BADGE
838
- this.logger.log('[CONVS-DETAIL] logScrolling: ', event);
848
+ // this.logger.log('[CONVS-DETAIL] logScrolling: ', event);
839
849
  this.detectBottom()
840
850
  }
841
851
 
842
852
  logScrollEnd(event: any) {
843
- this.logger.log('[CONVS-DETAIL] logScrollEnd: ', event);
853
+ // this.logger.log('[CONVS-DETAIL] logScrollEnd: ', event);
844
854
  }
845
855
 
846
856
 
@@ -882,17 +892,83 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
882
892
  // ----------------------------------------------------------
883
893
  setTimeout(() => {
884
894
  if (this.conversationWith.startsWith("support-group")) {
885
- var pos = message.lastIndexOf("/");
886
- this.logger.log("[CONVS-DETAIL] - returnChangeTextArea - canned responses pos of / ", pos);
887
- this.logger.log("[CONVS-DETAIL] - returnChangeTextArea - pos:: ", pos);
895
+
896
+ const pos = message.lastIndexOf("/");
897
+ // console.log("[CONVS-DETAIL] - returnChangeTextArea - canned responses pos of / (using lastIndexOf) ", pos);
898
+
899
+ // test
900
+ // var rest = message.substring(0, message.lastIndexOf("/") + 1);
901
+ // var last = message.substring(message.lastIndexOf("/") + 1, message.length);
902
+ // console.log('[CONVS-DETAIL] - returnChangeTextArea rest', rest);
903
+ // console.log('[CONVS-DETAIL] - returnChangeTextArea last', last);
904
+ // console.log('[CONVS-DETAIL] - returnChangeTextArea last', last.length);
905
+ // if (last.length === 1 && last.trim() === '') {
906
+ // console.log('[CONVS-DETAIL] - returnChangeTextArea last is a white space ');
907
+ // } else if (last.length === 1 && last.trim() !== '') {
908
+ // console.log('[CONVS-DETAIL] - returnChangeTextArea last is NOT space ');
909
+ // }
910
+
888
911
 
889
912
  if (pos >= 0) {
890
- // if (pos === 0) {
891
- // && that.tagsCanned.length > 0
892
913
  var strSearch = message.substr(pos + 1);
893
914
  this.logger.log("[CONVS-DETAIL] - returnChangeTextArea - canned responses strSearch ", strSearch);
915
+
916
+ // --------------------------------------------
917
+ // Load canned responses
918
+ // --------------------------------------------
894
919
  this.loadTagsCanned(strSearch, this.conversationWith);
895
920
 
921
+ // ------------------------------------------------------------------------------------------------------------------------------------------
922
+ // Hide / display Canned when the SLASH has POSITION POS 0 and checking if there is a space after the SLASH (in this case it will be hidden)
923
+ // ------------------------------------------------------------------------------------------------------------------------------------------
924
+
925
+ var after_slash = message.substring(message.lastIndexOf("/") + 1, message.length);
926
+ if (pos === 0 && after_slash.length === 1 && after_slash.trim() === '') {
927
+ this.logger.log('[CONVS-DETAIL] - returnChangeTextArea after_slash --> there is a white space after ');
928
+ this.HIDE_CANNED_RESPONSES = true
929
+ this.tagsCannedFilter = []
930
+ } else if (pos === 0 && after_slash.length === 0) {
931
+ this.logger.log('[CONVS-DETAIL] - returnChangeTextArea after_slash --> there is NOT a white space after');
932
+ this.HIDE_CANNED_RESPONSES = false
933
+ }
934
+
935
+
936
+ if (pos > 0) {
937
+
938
+ // ------------------------------------------------------------------------------------------------------------------------------------------
939
+ // Hide / display Canned when the SLASH has POSITION POS > and checking if there is a space after the SLASH (in this case they it be hidden)
940
+ // and if there is not a space before the SLASH (in this it will be hidden)
941
+ // ------------------------------------------------------------------------------------------------------------------------------------------
942
+
943
+ let beforeSlash = message.substr(pos - 1)
944
+ let afterSlash = message.substr(pos + 1)
945
+ this.logger.log('[CONVS-DETAIL] - returnChangeTextArea * POS ', pos);
946
+
947
+ this.logger.log('[CONVS-DETAIL] - returnChangeTextArea --> beforeSlash', beforeSlash);
948
+ this.logger.log('[CONVS-DETAIL] - returnChangeTextArea --> afterSlash', afterSlash);
949
+ var afterSlashParts = afterSlash.split("/")
950
+ var beforeSlashParts = beforeSlash.split("/")
951
+ this.logger.log('[CONVS-DETAIL] - returnChangeTextArea --> afterSlash parts', afterSlashParts);
952
+ this.logger.log('[CONVS-DETAIL] - returnChangeTextArea --> beforeSlash parts', beforeSlashParts);
953
+
954
+ if (beforeSlashParts.length === 2) {
955
+ if (beforeSlashParts[0].indexOf(' ') >= 0 && afterSlashParts[0] === '') {
956
+ this.HIDE_CANNED_RESPONSES = false
957
+ this.logger.log('[CONVS-DETAIL] - returnChangeTextArea --> beforeSlash there is a white space After Not');
958
+ // if (beforeSlashParts[0].indexOf(' ') >= 0 && afterSlashParts[0].indexOf(' ') >= 0)
959
+ } else if (beforeSlashParts[0].indexOf(' ') < 0 && afterSlashParts[0] === '') {
960
+ this.HIDE_CANNED_RESPONSES = true;
961
+ this.tagsCannedFilter = []
962
+ this.logger.log('[CONVS-DETAIL] - returnChangeTextArea --> beforeSlash not thete is a white space After Not');
963
+ } else if (beforeSlashParts[0].indexOf(' ') >= 0 && afterSlashParts[0] === ' ') {
964
+ this.logger.log('[CONVS-DETAIL] - returnChangeTextArea --> beforeSlash not thete is a white space After YES');
965
+ this.HIDE_CANNED_RESPONSES = true;
966
+ this.tagsCannedFilter = []
967
+ }
968
+ }
969
+ }
970
+
971
+
896
972
  } else {
897
973
  this.tagsCannedFilter = [];
898
974
  }
@@ -974,7 +1050,10 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
974
1050
  this.logger.log('[CONVS-DETAIL] - loadTagsCanned getCannedResponses RES', res);
975
1051
 
976
1052
  this.tagsCanned = res
977
- this.showTagsCanned(strSearch);
1053
+
1054
+ if (this.HIDE_CANNED_RESPONSES === false) {
1055
+ this.showTagsCanned(strSearch);
1056
+ }
978
1057
 
979
1058
  }, (error) => {
980
1059
  this.logger.error('[CONVS-DETAIL] - loadTagsCanned getCannedResponses - ERROR ', error);
@@ -1030,12 +1109,20 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
1030
1109
  return str;
1031
1110
  }
1032
1111
 
1033
- replaceTagInMessage(canned) {
1112
+ replaceTagInMessage(canned, event) {
1113
+ this.logger.log("[CONVS-DETAIL] replaceTagInMessage event ", event);
1034
1114
  const elTextArea = this.rowTextArea['el'];
1035
1115
  const textArea = elTextArea.getElementsByTagName('ion-textarea')[0];
1116
+
1036
1117
  this.logger.log("[CONVS-DETAIL] replaceTagInMessage textArea ", textArea);
1037
1118
  this.logger.log("[CONVS-DETAIL] replaceTagInMessage textArea value", textArea.value)
1038
1119
 
1120
+ // var lastChar = textArea.value.substr(-1); // Selects the last character
1121
+ // if (lastChar === '/') {
1122
+ // textArea.value = textArea.value.substring(0, textArea.value.length() - 1);
1123
+ // }
1124
+ // this.insertAtCursor(this.textArea, textArea.value)
1125
+
1039
1126
 
1040
1127
  this.arrowkeyLocation = -1
1041
1128
  this.tagsCannedFilter = [];
@@ -1051,12 +1138,14 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
1051
1138
 
1052
1139
  var strTEMP = textArea.value.replace(strSearch, canned.text);
1053
1140
  strTEMP = this.replacePlaceholderInCanned(strTEMP);
1141
+ this.logger.log("[CONVS-DETAIL] replaceTagInMessage strSearch ", strTEMP);
1054
1142
  // strTEMP = this.replacePlaceholderInCanned(strTEMP);
1055
1143
  // textArea.value = '';
1056
1144
  // that.messageString = strTEMP;
1057
1145
  textArea.value = strTEMP;
1058
1146
  setTimeout(() => {
1059
- textArea.focus();
1147
+ // textArea.focus();
1148
+ textArea.setFocus();
1060
1149
  this.resizeTextArea();
1061
1150
  }, 200);
1062
1151
  }
@@ -1088,9 +1177,12 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
1088
1177
 
1089
1178
  if (event.key === 'Enter') {
1090
1179
  const canned_selected = this.tagsCannedFilter[this.arrowkeyLocation]
1091
-
1180
+ this.logger.log('[CONVS-DETAIL] replaceTagInMessage canned_selected ', canned_selected)
1092
1181
  if (canned_selected) {
1093
- this.replaceTagInMessage(canned_selected)
1182
+
1183
+ this.replaceTagInMessage(canned_selected, 'enter')
1184
+ // event.preventDefault();
1185
+ // return false;
1094
1186
  }
1095
1187
  }
1096
1188
  }
@@ -1,10 +1,6 @@
1
-
2
1
  <ion-header no-border class="ion-no-border">
3
- <app-ddp-header *ngIf="conversationType ==='active'"
4
- [numberOpenConv]="numberOpenConv"
5
- [supportMode]="supportMode"
6
- (openContactsDirectory)=openContactsDirectory($event)
7
- (openProfileInfo)=openProfileInfo($event)>
2
+ <app-ddp-header *ngIf="conversationType ==='active'" [numberOpenConv]="numberOpenConv" [supportMode]="supportMode"
3
+ (openContactsDirectory)=openContactsDirectory($event) (openProfileInfo)=openProfileInfo($event)>
8
4
  </app-ddp-header>
9
5
 
10
6
  <app-option-header *ngIf="conversationType !=='active'" [headerTitle]=headerTitle
@@ -16,36 +12,56 @@
16
12
 
17
13
  <div id="scrollbar2">
18
14
  <ion-list>
19
-
20
15
  <span
21
16
  *ngIf="(conversations.length > 0 && conversationType ==='active') || (archivedConversations.length > 0 && conversationType ==='archived');then contentConversations else contentMessageWelcome">
22
17
  here is ignored
23
18
  </span>
24
19
 
25
20
  <ng-template #contentConversations>
21
+ <!-- -------------------------------------------------------------------------- -->
22
+ <!-- New <ion-spinner class="spinner-middle" style="margin-left: 19px;"></ion-spinner> -->
23
+ <!-- -------------------------------------------------------------------------- -->
24
+ <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">
25
+ <div tabindex="0"></div>
26
+ <ion-avatar item-start>
27
+ <div class="sk-fading-circle">
28
+ <div class="sk-circle1 sk-circle"></div>
29
+ <div class="sk-circle2 sk-circle"></div>
30
+ <div class="sk-circle3 sk-circle"></div>
31
+ <div class="sk-circle4 sk-circle"></div>
32
+ <div class="sk-circle5 sk-circle"></div>
33
+ <div class="sk-circle6 sk-circle"></div>
34
+ <div class="sk-circle7 sk-circle"></div>
35
+ <div class="sk-circle8 sk-circle"></div>
36
+ <div class="sk-circle9 sk-circle"></div>
37
+ <div class="sk-circle10 sk-circle"></div>
38
+ <div class="sk-circle11 sk-circle"></div>
39
+ <div class="sk-circle12 sk-circle"></div>
40
+ </div>
41
+ </ion-avatar>
42
+ <ion-label part="message-text" class="waiting-for-network-msg"> Waiting for network</ion-label>
43
+ </ion-item>
44
+
45
+ <ion-item *ngIf="supportMode" class="ion-no-padding open-iframe-item" style="padding-left:0px!important ;padding-right:0px!important; height:55px" button="true"
46
+ (click)="openUnsevedConversationIframe()">
47
+ <div tabindex="0"></div>
48
+ <app-project-item (projectIdEvent)="getLastProjectId($event)"></app-project-item>
49
+ </ion-item>
26
50
  <!-- ---------------------------------- -->
27
51
  <!-- ACTIVE CONVERSATION LIST -->
28
52
  <!-- ---------------------------------- -->
29
- <ion-list-conversations *ngIf="conversationType ==='active'"
30
- [uidConvSelected]="uidConvSelected"
31
- [listConversations]="conversations"
32
- [stylesMap]="stylesMap"
33
- [translationMap]="translationMapConversation"
34
- (onConversationSelected)=onConversationSelected($event)
35
- (onImageLoaded)="onImageLoaded($event)"
36
- (onConversationLoaded)="onConversationLoaded($event)"
37
- (onCloseConversation)="onCloseConversation($event)">
53
+ <ion-list-conversations *ngIf="conversationType ==='active'" [uidConvSelected]="uidConvSelected"
54
+ [listConversations]="conversations" [stylesMap]="stylesMap" [translationMap]="translationMapConversation"
55
+ (onConversationSelected)=onConversationSelected($event) (onImageLoaded)="onImageLoaded($event)"
56
+ (onConversationLoaded)="onConversationLoaded($event)" (onCloseConversation)="onCloseConversation($event)">
38
57
  </ion-list-conversations>
39
58
 
40
59
  <!-- ---------------------------------- -->
41
60
  <!-- ARCHIVED CONVERSATION LIST -->
42
61
  <!-- ---------------------------------- -->
43
- <ion-list-conversations *ngIf="conversationType ==='archived'"
44
- [listConversations]="archivedConversations"
45
- [stylesMap]="stylesMap"
46
- [translationMap]="translationMapConversation"
47
- (onConversationSelected)=onConversationSelected($event)
48
- (onImageLoaded)="onImageLoaded($event)"
62
+ <ion-list-conversations *ngIf="conversationType ==='archived'" [listConversations]="archivedConversations"
63
+ [stylesMap]="stylesMap" [translationMap]="translationMapConversation"
64
+ (onConversationSelected)=onConversationSelected($event) (onImageLoaded)="onImageLoaded($event)"
49
65
  (onConversationLoaded)="onConversationLoaded($event)">
50
66
  </ion-list-conversations>
51
67
  </ng-template>
@@ -84,8 +100,8 @@
84
100
  </ion-label>
85
101
  </ion-item>
86
102
  </div>
87
-
103
+
88
104
  </ng-template>
89
105
  </ion-list>
90
106
  </div>
91
- </ion-content>
107
+ </ion-content>
@@ -135,5 +135,150 @@ ion-list {
135
135
  }
136
136
  }
137
137
 
138
-
139
138
  }
139
+
140
+ .waiting-for-connection {
141
+ --background: #fdd764;
142
+ --min-height: 70px
143
+ }
144
+
145
+ // -------------------------------
146
+ // Spinner
147
+ // -------------------------------
148
+ .sk-fading-circle {
149
+ // margin: 100px auto;
150
+ width: 25px;
151
+ height: 25px;
152
+ position: relative;
153
+ margin-left: 10px;
154
+ margin-top: 13px;
155
+ }
156
+
157
+ .sk-fading-circle .sk-circle {
158
+ width: 100%;
159
+ height: 100%;
160
+ position: absolute;
161
+ left: 0;
162
+ top: 0;
163
+ }
164
+
165
+ .sk-fading-circle .sk-circle:before {
166
+ content: '';
167
+ display: block;
168
+ margin: 0 auto;
169
+ width: 15%;
170
+ height: 15%;
171
+ background-color: #333;
172
+ border-radius: 100%;
173
+ -webkit-animation: sk-circleFadeDelay 1.2s infinite ease-in-out both;
174
+ animation: sk-circleFadeDelay 1.2s infinite ease-in-out both;
175
+ }
176
+ .sk-fading-circle .sk-circle2 {
177
+ -webkit-transform: rotate(30deg);
178
+ -ms-transform: rotate(30deg);
179
+ transform: rotate(30deg);
180
+ }
181
+ .sk-fading-circle .sk-circle3 {
182
+ -webkit-transform: rotate(60deg);
183
+ -ms-transform: rotate(60deg);
184
+ transform: rotate(60deg);
185
+ }
186
+ .sk-fading-circle .sk-circle4 {
187
+ -webkit-transform: rotate(90deg);
188
+ -ms-transform: rotate(90deg);
189
+ transform: rotate(90deg);
190
+ }
191
+ .sk-fading-circle .sk-circle5 {
192
+ -webkit-transform: rotate(120deg);
193
+ -ms-transform: rotate(120deg);
194
+ transform: rotate(120deg);
195
+ }
196
+ .sk-fading-circle .sk-circle6 {
197
+ -webkit-transform: rotate(150deg);
198
+ -ms-transform: rotate(150deg);
199
+ transform: rotate(150deg);
200
+ }
201
+ .sk-fading-circle .sk-circle7 {
202
+ -webkit-transform: rotate(180deg);
203
+ -ms-transform: rotate(180deg);
204
+ transform: rotate(180deg);
205
+ }
206
+ .sk-fading-circle .sk-circle8 {
207
+ -webkit-transform: rotate(210deg);
208
+ -ms-transform: rotate(210deg);
209
+ transform: rotate(210deg);
210
+ }
211
+ .sk-fading-circle .sk-circle9 {
212
+ -webkit-transform: rotate(240deg);
213
+ -ms-transform: rotate(240deg);
214
+ transform: rotate(240deg);
215
+ }
216
+ .sk-fading-circle .sk-circle10 {
217
+ -webkit-transform: rotate(270deg);
218
+ -ms-transform: rotate(270deg);
219
+ transform: rotate(270deg);
220
+ }
221
+ .sk-fading-circle .sk-circle11 {
222
+ -webkit-transform: rotate(300deg);
223
+ -ms-transform: rotate(300deg);
224
+ transform: rotate(300deg);
225
+ }
226
+ .sk-fading-circle .sk-circle12 {
227
+ -webkit-transform: rotate(330deg);
228
+ -ms-transform: rotate(330deg);
229
+ transform: rotate(330deg);
230
+ }
231
+ .sk-fading-circle .sk-circle2:before {
232
+ -webkit-animation-delay: -1.1s;
233
+ animation-delay: -1.1s;
234
+ }
235
+ .sk-fading-circle .sk-circle3:before {
236
+ -webkit-animation-delay: -1s;
237
+ animation-delay: -1s;
238
+ }
239
+ .sk-fading-circle .sk-circle4:before {
240
+ -webkit-animation-delay: -0.9s;
241
+ animation-delay: -0.9s;
242
+ }
243
+ .sk-fading-circle .sk-circle5:before {
244
+ -webkit-animation-delay: -0.8s;
245
+ animation-delay: -0.8s;
246
+ }
247
+ .sk-fading-circle .sk-circle6:before {
248
+ -webkit-animation-delay: -0.7s;
249
+ animation-delay: -0.7s;
250
+ }
251
+ .sk-fading-circle .sk-circle7:before {
252
+ -webkit-animation-delay: -0.6s;
253
+ animation-delay: -0.6s;
254
+ }
255
+ .sk-fading-circle .sk-circle8:before {
256
+ -webkit-animation-delay: -0.5s;
257
+ animation-delay: -0.5s;
258
+ }
259
+ .sk-fading-circle .sk-circle9:before {
260
+ -webkit-animation-delay: -0.4s;
261
+ animation-delay: -0.4s;
262
+ }
263
+ .sk-fading-circle .sk-circle10:before {
264
+ -webkit-animation-delay: -0.3s;
265
+ animation-delay: -0.3s;
266
+ }
267
+ .sk-fading-circle .sk-circle11:before {
268
+ -webkit-animation-delay: -0.2s;
269
+ animation-delay: -0.2s;
270
+ }
271
+ .sk-fading-circle .sk-circle12:before {
272
+ -webkit-animation-delay: -0.1s;
273
+ animation-delay: -0.1s;
274
+ }
275
+
276
+ @-webkit-keyframes sk-circleFadeDelay {
277
+ 0%, 39%, 100% { opacity: 0; }
278
+ 40% { opacity: 1; }
279
+ }
280
+
281
+ @keyframes sk-circleFadeDelay {
282
+ 0%, 39%, 100% { opacity: 0; }
283
+ 40% { opacity: 1; }
284
+ }
@@ -22,16 +22,20 @@ import { NavProxyService } from '../../services/nav-proxy.service';
22
22
  import { TiledeskService } from '../../services/tiledesk/tiledesk.service';
23
23
  import { ConversationDetailPage } from '../conversation-detail/conversation-detail.page';
24
24
  import { ContactsDirectoryPage } from '../contacts-directory/contacts-directory.page';
25
+ import { UnassignedConversationsPage } from '../unassigned-conversations/unassigned-conversations.page';
25
26
  import { ProfileInfoPage } from '../profile-info/profile-info.page';
26
27
  import { MessagingAuthService } from 'src/chat21-core/providers/abstract/messagingAuth.service';
27
28
  import { CustomTranslateService } from 'src/chat21-core/providers/custom-translate.service';
28
29
  import { ImageRepoService } from 'src/chat21-core/providers/abstract/image-repo.service';
29
30
  import { TiledeskAuthService } from 'src/chat21-core/providers/tiledesk/tiledesk-auth.service';
30
31
  import { AppConfigProvider } from '../../services/app-config';
31
-
32
+ import { Subscription } from 'rxjs';
33
+ import { Platform } from '@ionic/angular';
32
34
  // Logger
33
35
  import { LoggerService } from 'src/chat21-core/providers/abstract/logger.service';
34
36
  import { LoggerInstance } from 'src/chat21-core/providers/logger/loggerInstance';
37
+ import { NetworkService } from 'src/app/services/network-service/network.service';
38
+
35
39
 
36
40
  @Component({
37
41
  selector: 'app-conversations-list',
@@ -51,7 +55,7 @@ export class ConversationListPage implements OnInit {
51
55
  public showPlaceholder = true;
52
56
  public numberOpenConv = 0;
53
57
  public loadingIsActive = true;
54
- public supportMode = environment.supportMode;
58
+ public supportMode: boolean;
55
59
 
56
60
  public convertMessage = convertMessage;
57
61
  private isShowMenuPage = false;
@@ -61,8 +65,13 @@ export class ConversationListPage implements OnInit {
61
65
 
62
66
  public conversationType = 'active'
63
67
  headerTitle: string;
68
+ subscription: Subscription;
64
69
 
65
-
70
+ public UNASSIGNED_CONVS_URL: any;
71
+ public hasClickedOpenUnservedConvIframe: boolean = false;
72
+ public lastProjectId: string;
73
+ public isOnline: boolean = true;
74
+ public checkInternet: boolean;
66
75
  constructor(
67
76
  private router: Router,
68
77
  private route: ActivatedRoute,
@@ -78,7 +87,10 @@ export class ConversationListPage implements OnInit {
78
87
  private translateService: CustomTranslateService,
79
88
  public tiledeskService: TiledeskService,
80
89
  public tiledeskAuthService: TiledeskAuthService,
81
- public appConfigProvider: AppConfigProvider
90
+ public appConfigProvider: AppConfigProvider,
91
+ public platform: Platform,
92
+ private networkService: NetworkService,
93
+
82
94
  ) {
83
95
  this.listenToAppCompConvsLengthOnInitConvs();
84
96
  this.listenToLogoutEvent();
@@ -91,16 +103,85 @@ export class ConversationListPage implements OnInit {
91
103
  // @ Lifehooks
92
104
  // -----------------------------------------------
93
105
  ngOnInit() {
106
+ this.watchToConnectionStatus();
107
+ this.getSupportMode();
108
+ }
94
109
 
110
+ getSupportMode() {
111
+ this.supportMode = this.appConfigProvider.getConfig().supportMode;
112
+ // console.log('[ION-LIST-CONVS-COMP] - supportMode ', this.supportMode)
113
+ }
114
+
115
+ watchToConnectionStatus() {
116
+ this.networkService.checkInternetFunc().subscribe(isOnline => {
117
+ this.checkInternet = isOnline
118
+ this.logger.log('[ION-LIST-CONVS-COMP] - watchToConnectionStatus - isOnline', this.checkInternet)
119
+
120
+ // checking internet connection
121
+ if (this.checkInternet == true) {
122
+
123
+ this.isOnline = true;
124
+ } else {
125
+ this.isOnline = false;
126
+ }
127
+ });
95
128
  }
96
129
 
130
+
97
131
  ionViewWillEnter() {
132
+ this.logger.log('Called ionViewDidEnter')
98
133
  this.logger.log('[CONVS-LIST-PAGE] ionViewWillEnter uidConvSelected', this.uidConvSelected);
99
134
  this.listnerStart();
135
+
136
+ // exit from app with hardware back button
137
+ this.subscription = this.platform.backButton.subscribe(() => {
138
+ navigator['app'].exitApp();
139
+ });
140
+ }
141
+
142
+ // unsubscribe backButton.subscribe method to not use from other page
143
+ ionViewWillLeave() {
144
+ this.logger.log('Called ionViewWillLeave')
145
+ this.subscription.unsubscribe();
100
146
  }
101
147
 
102
148
  ionViewDidEnter() { }
103
149
 
150
+ getLastProjectId(projectid: string) {
151
+ this.logger.log('[CONVS-LIST-PAGE] - GET LAST PROJECT ID', projectid);
152
+ this.lastProjectId = projectid;
153
+ }
154
+
155
+ openUnsevedConversationIframe() {
156
+ this.hasClickedOpenUnservedConvIframe = true
157
+ this.logger.log('[CONVS-LIST-PAGE] - HAS CLIKED OPEN UNSERVED REQUEST IFRAME', this.hasClickedOpenUnservedConvIframe);
158
+ const DASHBOARD_BASE_URL = this.appConfigProvider.getConfig().dashboardUrl;
159
+ this.UNASSIGNED_CONVS_URL = DASHBOARD_BASE_URL + '#/project/' + this.lastProjectId + '/unserved-request-for-panel';
160
+ this.logger.log('[CONVS-LIST-PAGE] - HAS CLIKED OPEN UNSERVED REQUEST IFRAME > UNASSIGNED CONVS URL', this.UNASSIGNED_CONVS_URL);
161
+ this.openUnassignedConversations(this.UNASSIGNED_CONVS_URL)
162
+ }
163
+
164
+ // ---------------------------------------------------------
165
+ // Opens the Unassigned Conversations iframe
166
+ // ---------------------------------------------------------
167
+ openUnassignedConversations(UNASSIGNED_CONVS_URL) {
168
+
169
+ if (checkPlatformIsMobile()) {
170
+ presentModal(this.modalController, UnassignedConversationsPage, { unassigned_convs_url: UNASSIGNED_CONVS_URL });
171
+ } else {
172
+ this.navService.push(UnassignedConversationsPage, { unassigned_convs_url: UNASSIGNED_CONVS_URL });
173
+ }
174
+ }
175
+
176
+ _closeContactsDirectory() {
177
+ try {
178
+ closeModal(this.modalController);
179
+ } catch (err) {
180
+ this.logger.error('[CONVS-LIST-PAGE] closeContactsDirectory -> error:', err);
181
+ }
182
+ }
183
+
184
+
104
185
  listenToSwPostMessage() {
105
186
  this.logger.log('[CONVS-LIST-PAGE] listenToNotificationCLick - CALLED: ');
106
187
  const that = this;
@@ -493,8 +574,8 @@ export class ConversationListPage implements OnInit {
493
574
  }
494
575
 
495
576
  onConversationLoaded(conversation: ConversationModel) {
496
- this.logger.log('[CONVS-LIST-PAGE] onConversationLoaded ', conversation)
497
- this.logger.log('[CONVS-LIST-PAGE] onConversationLoaded is new? ', conversation.is_new)
577
+ // this.logger.log('[CONVS-LIST-PAGE] onConversationLoaded ', conversation)
578
+ // this.logger.log('[CONVS-LIST-PAGE] onConversationLoaded is new? ', conversation.is_new)
498
579
  // if (conversation.is_new === false) {
499
580
  // this.ionContentConvList.scrollToTop(0);
500
581
  // }