@chat21/chat21-ionic 3.0.83 → 3.0.86-rc.1

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 (173) hide show
  1. package/CHANGELOG.md +124 -4
  2. package/README.md +2 -2
  3. package/deploy_amazon_beta.sh +29 -0
  4. package/deploy_amazon_prod.sh +30 -0
  5. package/package.json +4 -3
  6. package/src/app/app-routing.module.ts +7 -2
  7. package/src/app/app.component.html +7 -1
  8. package/src/app/app.component.scss +20 -2
  9. package/src/app/app.component.ts +231 -114
  10. package/src/app/app.module.ts +8 -3
  11. package/src/app/chatlib/conversation-detail/conversation-content/conversation-content.component.ts +8 -1
  12. package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.html +86 -23
  13. package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.scss +188 -88
  14. package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.ts +42 -3
  15. package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.html +11 -24
  16. package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.scss +6 -10
  17. package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.spec.ts +2 -2
  18. package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.ts +16 -26
  19. package/src/app/chatlib/conversation-detail/message/buttons/action-button/action-button.component.html +5 -1
  20. package/src/app/chatlib/conversation-detail/message/buttons/action-button/action-button.component.scss +22 -15
  21. package/src/app/chatlib/conversation-detail/message/buttons/action-button/action-button.component.ts +25 -5
  22. package/src/app/chatlib/conversation-detail/message/buttons/link-button/link-button.component.html +2 -1
  23. package/src/app/chatlib/conversation-detail/message/buttons/link-button/link-button.component.scss +14 -15
  24. package/src/app/chatlib/conversation-detail/message/buttons/link-button/link-button.component.ts +24 -5
  25. package/src/app/chatlib/conversation-detail/message/buttons/text-button/text-button.component.html +6 -1
  26. package/src/app/chatlib/conversation-detail/message/buttons/text-button/text-button.component.scss +12 -13
  27. package/src/app/chatlib/conversation-detail/message/buttons/text-button/text-button.component.ts +26 -5
  28. package/src/app/chatlib/conversation-detail/message/frame/frame.component.html +8 -2
  29. package/src/app/chatlib/conversation-detail/message/frame/frame.component.scss +36 -0
  30. package/src/app/chatlib/conversation-detail/message/frame/frame.component.ts +2 -2
  31. package/src/app/chatlib/conversation-detail/message/html/html.component.ts +0 -1
  32. package/src/app/chatlib/conversation-detail/message/image/image.component.html +3 -2
  33. package/src/app/chatlib/conversation-detail/message/image/image.component.scss +17 -5
  34. package/src/app/chatlib/conversation-detail/message/image/image.component.ts +1 -1
  35. package/src/app/chatlib/conversation-detail/message/info-message/info-message.component.scss +3 -2
  36. package/src/app/chatlib/conversation-detail/message/message-attachment/message-attachment.component.html +16 -6
  37. package/src/app/chatlib/conversation-detail/message/message-attachment/message-attachment.component.scss +1 -3
  38. package/src/app/chatlib/conversation-detail/message/message-attachment/message-attachment.component.ts +2 -0
  39. package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.html +78 -52
  40. package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.scss +63 -20
  41. package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.ts +14 -10
  42. package/src/app/components/canned-response/canned-response.component.html +9 -9
  43. package/src/app/components/canned-response/canned-response.component.scss +14 -7
  44. package/src/app/components/canned-response/canned-response.component.ts +5 -4
  45. package/src/app/components/contacts-directory/contacts-directory.component.html +22 -26
  46. package/src/app/components/contacts-directory/contacts-directory.component.scss +8 -6
  47. package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.html +64 -47
  48. package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.scss +98 -61
  49. package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.ts +24 -40
  50. package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component_2.html +116 -0
  51. package/src/app/components/conversation-detail/message-text-area/message-text-area.component.html +39 -42
  52. package/src/app/components/conversation-detail/message-text-area/message-text-area.component.scss +67 -4
  53. package/src/app/components/conversation-detail/message-text-area/message-text-area.component.ts +82 -152
  54. package/src/app/components/conversation-info/info-content/info-content.component.html +23 -2
  55. package/src/app/components/conversation-info/info-content/info-content.component.ts +3 -6
  56. package/src/app/components/conversation-info/info-direct/info-direct.component.html +7 -14
  57. package/src/app/components/conversation-info/info-direct/info-direct.component.scss +23 -0
  58. package/src/app/components/conversation-info/info-direct/info-direct.component.ts +1 -6
  59. package/src/app/components/conversation-info/info-group/info-group.component.html +44 -108
  60. package/src/app/components/conversation-info/info-group/info-group.component.scss +101 -61
  61. package/src/app/components/conversation-info/info-group/info-group.component.ts +1 -0
  62. package/src/app/components/conversation-info/info-support-group/info-support-group.component.html +2 -1
  63. package/src/app/components/conversation-info/info-support-group/info-support-group.component.ts +0 -1
  64. package/src/app/components/{ddp-header/ddp-header.component.html → conversations-list/header-conversations-list/header-conversations-list.component.html} +3 -3
  65. package/src/app/components/{ddp-header/ddp-header.component.scss → conversations-list/header-conversations-list/header-conversations-list.component.scss} +16 -4
  66. package/src/app/components/{conversation-detail/bubble-my-message/bubble-my-message.component.spec.ts → conversations-list/header-conversations-list/header-conversations-list.component.spec.ts} +6 -6
  67. package/src/app/components/{ddp-header/ddp-header.component.ts → conversations-list/header-conversations-list/header-conversations-list.component.ts} +7 -16
  68. package/src/app/components/conversations-list/header-conversations-list-archived/header-conversations-list-archived.component.html +12 -0
  69. package/src/app/components/conversations-list/header-conversations-list-archived/header-conversations-list-archived.component.scss +14 -0
  70. package/src/app/components/{conversation-detail/option-header/option-header.component.spec.ts → conversations-list/header-conversations-list-archived/header-conversations-list-archived.component.spec.ts} +5 -5
  71. package/src/app/components/{conversation-detail/option-header/option-header.component.ts → conversations-list/header-conversations-list-archived/header-conversations-list-archived.component.ts} +5 -4
  72. package/src/app/components/navbar/navbar.component.html +103 -0
  73. package/src/app/components/navbar/navbar.component.scss +249 -0
  74. package/src/app/components/{ddp-header/ddp-header.component.spec.ts → navbar/navbar.component.spec.ts} +6 -6
  75. package/src/app/components/navbar/navbar.component.ts +190 -0
  76. package/src/app/components/project-item/project-item.component.html +98 -149
  77. package/src/app/components/project-item/project-item.component.scss +43 -35
  78. package/src/app/components/project-item/project-item.component.ts +16 -4
  79. package/src/app/components/sidebar-user-details/sidebar-user-details.component.html +5 -5
  80. package/src/app/components/sidebar-user-details/sidebar-user-details.component.ts +24 -13
  81. package/src/app/components/utils/user-presence/user-presence.component.html +7 -2
  82. package/src/app/components/utils/user-presence/user-presence.component.scss +35 -18
  83. package/src/app/components/utils/user-presence/user-presence.component.ts +6 -10
  84. package/src/app/{pages → modals}/create-canned-response/create-canned-response-routing.module.ts +0 -0
  85. package/src/app/{pages → modals}/create-canned-response/create-canned-response.module.ts +0 -0
  86. package/src/app/{pages → modals}/create-canned-response/create-canned-response.page.html +0 -0
  87. package/src/app/{pages → modals}/create-canned-response/create-canned-response.page.scss +0 -0
  88. package/src/app/{pages → modals}/create-canned-response/create-canned-response.page.spec.ts +0 -0
  89. package/src/app/{pages → modals}/create-canned-response/create-canned-response.page.ts +13 -13
  90. package/src/app/{pages → modals}/loader-preview/loader-preview-routing.module.ts +0 -0
  91. package/src/app/{pages → modals}/loader-preview/loader-preview.module.ts +0 -0
  92. package/src/app/{pages → modals}/loader-preview/loader-preview.page.html +1 -1
  93. package/src/app/{pages → modals}/loader-preview/loader-preview.page.scss +4 -0
  94. package/src/app/{pages → modals}/loader-preview/loader-preview.page.spec.ts +0 -0
  95. package/src/app/{pages → modals}/loader-preview/loader-preview.page.ts +1 -2
  96. package/src/app/modals/send-email/send-email-routing.module.ts +17 -0
  97. package/src/app/modals/send-email/send-email.module.ts +31 -0
  98. package/src/app/modals/send-email/send-email.page.html +46 -0
  99. package/src/app/modals/send-email/send-email.page.scss +161 -0
  100. package/src/app/modals/send-email/send-email.page.spec.ts +24 -0
  101. package/src/app/modals/send-email/send-email.page.ts +89 -0
  102. package/src/app/pages/contacts-directory/contacts-directory.page.html +1 -1
  103. package/src/app/pages/contacts-directory/contacts-directory.page.scss +47 -0
  104. package/src/app/pages/contacts-directory/contacts-directory.page.ts +2 -0
  105. package/src/app/pages/conversation-detail/conversation-detail.module.ts +0 -8
  106. package/src/app/pages/conversation-detail/conversation-detail.page.html +48 -27
  107. package/src/app/pages/conversation-detail/conversation-detail.page.scss +45 -254
  108. package/src/app/pages/conversation-detail/conversation-detail.page.ts +361 -173
  109. package/src/app/pages/conversations-list/conversations-list.page.html +11 -8
  110. package/src/app/pages/conversations-list/conversations-list.page.scss +18 -2
  111. package/src/app/pages/conversations-list/conversations-list.page.ts +69 -65
  112. package/src/app/pages/profile-info/profile-info.page.html +2 -4
  113. package/src/app/pages/unassigned-conversations/unassigned-conversations.page.html +1 -1
  114. package/src/app/pages/unassigned-conversations/unassigned-conversations.page.scss +42 -0
  115. package/src/app/pages/unassigned-conversations/unassigned-conversations.page.ts +1 -0
  116. package/src/app/services/canned-responses/canned-responses.service.ts +26 -0
  117. package/src/app/services/projects/projects.service.spec.ts +12 -0
  118. package/src/app/services/projects/projects.service.ts +43 -0
  119. package/src/app/services/tiledesk/tiledesk.service.ts +33 -17
  120. package/src/app/services/websocket/websocket.service.ts +1 -1
  121. package/src/app/shared/shared.module.ts +24 -33
  122. package/src/app/utils/toast.spec.ts +7 -0
  123. package/src/app/utils/toast.ts +48 -0
  124. package/src/assets/i18n/ar.json +288 -265
  125. package/src/assets/i18n/az.json +24 -1
  126. package/src/assets/i18n/de.json +25 -2
  127. package/src/assets/i18n/en.json +25 -2
  128. package/src/assets/i18n/es.json +26 -3
  129. package/src/assets/i18n/fr.json +24 -1
  130. package/src/assets/i18n/it.json +24 -1
  131. package/src/assets/i18n/kk.json +25 -2
  132. package/src/assets/i18n/pt.json +25 -2
  133. package/src/assets/i18n/ru.json +24 -1
  134. package/src/assets/i18n/sr.json +287 -264
  135. package/src/assets/i18n/sv.json +25 -2
  136. package/src/assets/i18n/tr.json +25 -2
  137. package/src/assets/i18n/uk.json +25 -2
  138. package/src/assets/i18n/uz.json +24 -1
  139. package/src/assets/js/chat21client.js +175 -148
  140. package/src/assets/sounds/interface-start.mp3 +0 -0
  141. package/src/assets/sounds/wheep-wheep.mp3 +0 -0
  142. package/src/chat-config-mqtt-localhost.json +2 -2
  143. package/src/chat-config-native-mqtt.json +3 -0
  144. package/src/chat21-core/models/conversation.ts +0 -1
  145. package/src/chat21-core/models/projects.ts +27 -0
  146. package/src/chat21-core/providers/firebase/firebase-typing.service.ts +7 -9
  147. package/src/chat21-core/providers/mqtt/mqtt-auth-service.ts +7 -8
  148. package/src/chat21-core/utils/constants.ts +7 -1
  149. package/src/chat21-core/utils/convertRequestToConversation.ts +41 -0
  150. package/src/chat21-core/utils/user-typing/user-typing.component.html +8 -5
  151. package/src/chat21-core/utils/user-typing/user-typing.component.scss +87 -17
  152. package/src/chat21-core/utils/user-typing/user-typing.component.ts +12 -94
  153. package/src/chat21-core/utils/utils.ts +41 -11
  154. package/src/global.scss +59 -255
  155. package/src/index.html +0 -9
  156. package/src/variables.scss +30 -10
  157. package/src/app/components/conversation-detail/bubble-day-message/bubble-day-message.component.html +0 -3
  158. package/src/app/components/conversation-detail/bubble-day-message/bubble-day-message.component.scss +0 -21
  159. package/src/app/components/conversation-detail/bubble-day-message/bubble-day-message.component.spec.ts +0 -24
  160. package/src/app/components/conversation-detail/bubble-day-message/bubble-day-message.component.ts +0 -14
  161. package/src/app/components/conversation-detail/bubble-my-message/bubble-my-message.component.html +0 -54
  162. package/src/app/components/conversation-detail/bubble-my-message/bubble-my-message.component.scss +0 -98
  163. package/src/app/components/conversation-detail/bubble-my-message/bubble-my-message.component.ts +0 -84
  164. package/src/app/components/conversation-detail/bubble-others-message/bubble-others-message.component.html +0 -30
  165. package/src/app/components/conversation-detail/bubble-others-message/bubble-others-message.component.scss +0 -83
  166. package/src/app/components/conversation-detail/bubble-others-message/bubble-others-message.component.spec.ts +0 -24
  167. package/src/app/components/conversation-detail/bubble-others-message/bubble-others-message.component.ts +0 -68
  168. package/src/app/components/conversation-detail/bubble-system-message/bubble-system-message.component.html +0 -3
  169. package/src/app/components/conversation-detail/bubble-system-message/bubble-system-message.component.scss +0 -10
  170. package/src/app/components/conversation-detail/bubble-system-message/bubble-system-message.component.spec.ts +0 -24
  171. package/src/app/components/conversation-detail/bubble-system-message/bubble-system-message.component.ts +0 -14
  172. package/src/app/components/conversation-detail/option-header/option-header.component.html +0 -13
  173. package/src/app/components/conversation-detail/option-header/option-header.component.scss +0 -0
@@ -1,5 +1,6 @@
1
- import { TYPE_DIRECT, TYPE_SUPPORT_GROUP } from 'src/chat21-core/utils/constants';
2
- import { tranlatedLanguage, URL_SOUND_LIST_CONVERSATION } from './../chat21-core/utils/constants';
1
+
2
+ import { TYPE_DIRECT, TYPE_SUPPORT_GROUP, URL_SOUND_CONVERSATION_UNASSIGNED } from 'src/chat21-core/utils/constants';
3
+ import { tranlatedLanguage, URL_SOUND_CONVERSATION_ADDED, URL_SOUND_LIST_CONVERSATION } from './../chat21-core/utils/constants';
3
4
  import { ArchivedConversationsHandlerService } from 'src/chat21-core/providers/abstract/archivedconversations-handler.service';
4
5
  import { AppStorageService } from 'src/chat21-core/providers/abstract/app-storage.service';
5
6
 
@@ -38,7 +39,7 @@ import { LoginPage } from './pages/authentication/login/login.page';
38
39
  import { ConversationListPage } from './pages/conversations-list/conversations-list.page';
39
40
 
40
41
  // utils
41
- import { checkPlatformIsMobile, isGroup, getParameterByName, searchIndexInArrayForUid, compareValues } from '../chat21-core/utils/utils';
42
+ import { checkPlatformIsMobile, isGroup, getParameterByName, searchIndexInArrayForUid, compareValues, stripTags } from '../chat21-core/utils/utils';
42
43
  import { STORAGE_PREFIX, PLATFORM_MOBILE, PLATFORM_DESKTOP, CHAT_ENGINE_FIREBASE, AUTH_STATE_OFFLINE, AUTH_STATE_ONLINE } from '../chat21-core/utils/constants';
43
44
  import { environment } from '../environments/environment';
44
45
  import { UserModel } from '../chat21-core/models/user';
@@ -87,11 +88,15 @@ export class AppComponent implements OnInit {
87
88
  public authModal: any;
88
89
 
89
90
  private audio: any;
91
+ private audio_NewConv: any;
92
+ private audio_Unassigned: any;
90
93
  private setIntervalTime: any;
91
94
  private setTimeoutSound: any;
92
95
  private isTabVisible: boolean = true;
93
- private isSoundEnabled: boolean;
96
+ public isSoundEnabled: boolean;
94
97
  private hasPlayed: boolean;
98
+ private hasPlayedConversation: boolean;
99
+ private hasPlayedConversationUnassigned: boolean;
95
100
  private tabTitle: string;
96
101
  private setTimeoutConversationsEvent: any;
97
102
  private logger: LoggerService = LoggerInstance.getInstance();
@@ -335,6 +340,7 @@ export class AppComponent implements OnInit {
335
340
 
336
341
 
337
342
  this.initializeApp('oninit');
343
+ this.initSegment()
338
344
  this.listenToPostMsgs();
339
345
  }
340
346
 
@@ -467,6 +473,7 @@ export class AppComponent implements OnInit {
467
473
  this.statusBar.styleDefault();
468
474
  this.navService.init(this.sidebarNav, this.detailNav);
469
475
  // this.persistence = appconfig.authPersistence;
476
+ // this.appStorageService.initialize(environment.storage_prefix, this.persistence, '')
470
477
  this.tiledeskAuthService.initialize(this.appConfigProvider.getConfig().apiUrl);
471
478
  this.messagingAuthService.initialize();
472
479
 
@@ -830,6 +837,14 @@ export class AppComponent implements OnInit {
830
837
  this.audio.src = chatBaseUrl + URL_SOUND_LIST_CONVERSATION;
831
838
  this.audio.load();
832
839
 
840
+ this.audio_NewConv = new Audio();
841
+ this.audio_NewConv.src = chatBaseUrl + URL_SOUND_CONVERSATION_ADDED;
842
+ this.audio_NewConv.load();
843
+
844
+ this.audio_Unassigned = new Audio();
845
+ this.audio_Unassigned.src = chatBaseUrl + URL_SOUND_CONVERSATION_UNASSIGNED;
846
+ this.audio_Unassigned.load();
847
+
833
848
  const sound_status = localStorage.getItem('dshbrd----sound')
834
849
  if(sound_status && sound_status !== 'undefined'){
835
850
  this.isSoundEnabled = sound_status === 'enabled'? true: false
@@ -839,7 +854,14 @@ export class AppComponent implements OnInit {
839
854
 
840
855
  }
841
856
 
842
- private manageTabNotification(badgeNotificationCount?: number) {
857
+ onSoundChange(event){
858
+ if(event && event !== undefined){
859
+ localStorage.setItem('dshbrd----sound', event)
860
+ this.isSoundEnabled = event === 'enabled'? true: false
861
+ }
862
+ }
863
+
864
+ private manageTabNotification(sound_type: string, badgeNotificationCount?: number) {
843
865
  if (!this.isTabVisible) {
844
866
  // TAB IS HIDDEN --> manage title and SOUND
845
867
  let badgeNewConverstionNumber = badgeNotificationCount? badgeNotificationCount : this.conversationsHandlerService.countIsNew()
@@ -863,7 +885,26 @@ export class AppComponent implements OnInit {
863
885
  this.isSoundEnabled = sound_status === 'enabled'? true: false
864
886
  }
865
887
  this.logger.debug('[APP-COMP] manageTabNotification can saund?', this.isInitialized, this.isSoundEnabled)
866
- if(this.isInitialized && this.isSoundEnabled) this.soundMessage()
888
+ if(this.isInitialized && this.isSoundEnabled) {
889
+ switch(sound_type){
890
+ case 'conv_added': {
891
+ this.soundConversationAdded();
892
+ break;
893
+ }
894
+ case 'new_message': {
895
+ this.soundMessage();
896
+ break;
897
+ }
898
+ case 'conv_unassigned': {
899
+ this.soundConversationUnassigned();
900
+ break;
901
+ }
902
+ default:{
903
+ this.soundMessage();
904
+ break;
905
+ }
906
+ }
907
+ }
867
908
  }
868
909
 
869
910
  soundMessage() {
@@ -879,7 +920,7 @@ export class AppComponent implements OnInit {
879
920
  // }, 4000);
880
921
 
881
922
  //play sound every 4s from the fist time you receive a conversation added/changed
882
- if(!this.hasPlayed){
923
+ if(!this.hasPlayed && !this.hasPlayedConversation){
883
924
  that.audio.play().then(() => {
884
925
  that.hasPlayed = true
885
926
  that.logger.debug('[APP-COMP] ****** soundMessage played *****');
@@ -891,6 +932,36 @@ export class AppComponent implements OnInit {
891
932
  });
892
933
  }
893
934
  }
935
+
936
+ soundConversationAdded(){
937
+ const that = this;
938
+ if(!this.hasPlayedConversation ){
939
+ that.audio_NewConv.play().then(() => {
940
+ that.hasPlayedConversation = true
941
+ that.logger.debug('[APP-COMP] ****** soundConversationAdded played *****');
942
+ setTimeout(() => {
943
+ that.hasPlayedConversation = false
944
+ }, 4000);
945
+ }).catch((error: any) => {
946
+ that.logger.error('[APP-COMP] ***soundConversationAdded error*', error);
947
+ });
948
+ }
949
+ }
950
+
951
+ soundConversationUnassigned(){
952
+ const that = this;
953
+ if(!this.hasPlayedConversationUnassigned ){
954
+ that.audio_Unassigned.play().then(() => {
955
+ that.hasPlayedConversationUnassigned = true
956
+ that.logger.debug('[APP-COMP] ****** soundConversationUnassigned played *****');
957
+ setTimeout(() => {
958
+ that.hasPlayedConversationUnassigned = false
959
+ }, 4000);
960
+ }).catch((error: any) => {
961
+ that.logger.error('[APP-COMP] ***soundConversationUnassigned error*', error);
962
+ });
963
+ }
964
+ }
894
965
  /**---------------- SOUND FUNCTIONS --> END <--- +*/
895
966
  /***************************************************+*/
896
967
 
@@ -938,11 +1009,11 @@ export class AppComponent implements OnInit {
938
1009
  this.events.subscribe('uidConvSelected:changed', this.subscribeChangedConversationSelected);
939
1010
  this.events.subscribe('profileInfoButtonClick:logout', this.subscribeProfileInfoButtonLogOut);
940
1011
  this.events.subscribe('unservedRequest:count', this.subscribeUnservedRequestCount)
941
-
1012
+ this.events.subscribe('convList:onConversationSelected', this.subscribeConversationSelected)
942
1013
  this.conversationsHandlerService.conversationAdded.subscribe((conversation: ConversationModel) => {
943
1014
  // this.logger.log('[APP-COMP] ***** subscribeConversationAdded *****', conversation);
944
1015
  if (conversation && conversation.is_new === true) {
945
- this.manageTabNotification()
1016
+ this.manageTabNotification('conv_added')
946
1017
  }
947
1018
  if(conversation) this.updateConversationsOnStorage()
948
1019
  });
@@ -960,7 +1031,7 @@ export class AppComponent implements OnInit {
960
1031
  this.logger.log('[APP-COMP] ***** subscribeConversationChangedDetailed currentUser: ', currentUser);
961
1032
  if (changes.value && changes.value.sender !== currentUser.uid) {
962
1033
  if(changes.value.is_new === changes.previousValue.is_new){
963
- this.manageTabNotification();
1034
+ this.manageTabNotification('new_message');
964
1035
  }
965
1036
  }
966
1037
  }
@@ -972,7 +1043,6 @@ export class AppComponent implements OnInit {
972
1043
  this.updateConversationsOnStorage();
973
1044
  isDevMode()? null: this.segmentResolved(conversation)
974
1045
  }
975
-
976
1046
  });
977
1047
  }
978
1048
 
@@ -1018,7 +1088,6 @@ export class AppComponent implements OnInit {
1018
1088
  this.initConversationsHandler(currentUser.uid);
1019
1089
  this.initArchivedConversationsHandler(currentUser.uid);
1020
1090
  isDevMode()? null: this.segmentSignIn()
1021
-
1022
1091
  }
1023
1092
  this.checkPlatform();
1024
1093
  try {
@@ -1059,7 +1128,7 @@ export class AppComponent implements OnInit {
1059
1128
 
1060
1129
  // this.unsubscribe$.next();
1061
1130
  // this.unsubscribe$.complete();
1062
-
1131
+
1063
1132
  }
1064
1133
 
1065
1134
  goToDashboardLogin(){
@@ -1120,7 +1189,7 @@ export class AppComponent implements OnInit {
1120
1189
  }
1121
1190
 
1122
1191
  subscribeProfileInfoButtonLogOut = (hasClickedLogout) => {
1123
- this.logger.log('[APP-COMP] FIREBASE-NOTIFICATION >>>> subscribeProfileInfoButtonLogOut');
1192
+ this.logger.log('[APP-COMP] FIREBASE-NOTIFICATION >>>> subscribeProfileInfoButtonLogOut ');
1124
1193
  // if (hasClickedLogout === true) {
1125
1194
  // this.removePresenceAndLogout()
1126
1195
  // }
@@ -1141,6 +1210,7 @@ export class AppComponent implements OnInit {
1141
1210
 
1142
1211
  if (res === 'success') {
1143
1212
  that.removePresenceAndLogout();
1213
+
1144
1214
  } else {
1145
1215
  that.removePresenceAndLogout();
1146
1216
  // that.presentToast();
@@ -1154,13 +1224,19 @@ export class AppComponent implements OnInit {
1154
1224
 
1155
1225
  subscribeUnservedRequestCount = (unservedRequestCount) => {
1156
1226
  if(unservedRequestCount && unservedRequestCount > 0){
1157
- this.logger.debug("hasToSoundUnservedRequestCount::::", this.isInitialized)
1227
+ this.logger.debug("subscribeUnservedRequestCount appIsInitialized::::",this.isInitialized)
1158
1228
  if(this.isInitialized){
1159
- this.manageTabNotification(unservedRequestCount) //sound and alternate title
1229
+ this.manageTabNotification('conv_unassigned', unservedRequestCount) //sound and alternate title
1160
1230
  }
1161
1231
  }
1162
1232
  }
1163
1233
 
1234
+ subscribeConversationSelected= (conversation: ConversationModel) => {
1235
+ if(conversation && conversation.is_new){
1236
+ this.audio_NewConv.pause()
1237
+ }
1238
+ }
1239
+
1164
1240
  private async presentModal(calledby): Promise<any> {
1165
1241
  this.logger.log('[APP-COMP] presentModal calledby', calledby, '- hadBeenCalledOpenModal: ', this.hadBeenCalledOpenModal);
1166
1242
  const attributes = { tenant: this.tenant, enableBackdropDismiss: false };
@@ -1268,122 +1344,142 @@ export class AppComponent implements OnInit {
1268
1344
  }
1269
1345
  }
1270
1346
 
1271
- private segmentSignIn(){
1272
- let user = this.tiledeskAuthService.getCurrentUser();
1273
- try {
1274
- window['analytics'].page("Chat Auth Page, Signin", {});
1275
- } catch (err) {
1276
- this.logger.error('Event:Signed In [page] error', err);
1277
- }
1278
-
1279
- try {
1280
- window['analytics'].identify(user.uid, {
1281
- name: user.firstname + ' ' + user.lastname,
1282
- email: user.email,
1283
- logins: 5,
1347
+ private initSegment(){
1348
+ if(!isDevMode()){
1349
+ var head = document.getElementsByTagName('head')[0];
1350
+ var script = document.createElement('script');
1351
+ script.type="text/javascript";
1352
+ script.text =`!function(){var analytics=window.analytics=window.analytics||[];if(!analytics.initialize)if(analytics.invoked)window.console&&console.error&&console.error("Segment snippet included twice.");else{analytics.invoked=!0;analytics.methods=["trackSubmit","trackClick","trackLink","trackForm","pageview","identify","reset","group","track","ready","alias","debug","page","once","off","on","addSourceMiddleware","addIntegrationMiddleware","setAnonymousId","addDestinationMiddleware"];analytics.factory=function(e){return function(){var t=Array.prototype.slice.call(arguments);t.unshift(e);analytics.push(t);return analytics}};for(var e=0;e<analytics.methods.length;e++){var key=analytics.methods[e];analytics[key]=analytics.factory(key)}analytics.load=function(key,e){var t=document.createElement("script");t.type="text/javascript";t.async=!0;t.src="https://cdn.segment.com/analytics.js/v1/" + key + "/analytics.min.js";var n=document.getElementsByTagName("script")[0];n.parentNode.insertBefore(t,n);analytics._loadOptions=e};analytics._writeKey="qaTU0wG6VH6xPAhOzD2kneI70Txg1fTB";;analytics.SNIPPET_VERSION="4.15.3";
1353
+ analytics.load("qaTU0wG6VH6xPAhOzD2kneI70Txg1fTB");
1354
+ analytics.page();
1355
+ }}();`
1356
+ head.appendChild(script);
1357
+ }
1358
+ }
1284
1359
 
1285
- });
1286
- } catch (err) {
1287
- this.logger.error('Event:Signed In [identify] error', err);
1288
- }
1289
- // Segments
1290
- try {
1291
- window['analytics'].track('Signed In', {
1292
- "username": user.firstname + ' ' + user.lastname,
1293
- "userId": user.uid
1294
- });
1295
- } catch (err) {
1296
- this.logger.error('Event:Signed In [track] error', err);
1360
+ private segmentSignIn(){
1361
+ let user = this.tiledeskAuthService.getCurrentUser()
1362
+ if(window['analytics']){
1363
+ try {
1364
+ window['analytics'].page("Chat Auth Page, Signin", {});
1365
+ } catch (err) {
1366
+ this.logger.error('Event:Signed In [page] error', err);
1367
+ }
1368
+
1369
+ try {
1370
+ window['analytics'].identify(user.uid, {
1371
+ name: user.firstname + ' ' + user.lastname,
1372
+ email: user.email,
1373
+ logins: 5,
1374
+
1375
+ });
1376
+ } catch (err) {
1377
+ this.logger.error('Event:Signed In [identify] error', err);
1378
+ }
1379
+ // Segments
1380
+ try {
1381
+ window['analytics'].track('Signed In', {
1382
+ "username": user.firstname + ' ' + user.lastname,
1383
+ "userId": user.uid
1384
+ });
1385
+ } catch (err) {
1386
+ this.logger.error('Event:Signed In [track] error', err);
1387
+ }
1297
1388
  }
1298
1389
  }
1299
1390
 
1300
1391
 
1301
1392
  private segmentSignedOut(){
1302
- let user = this.tiledeskAuthService.getCurrentUser();
1303
- try {
1304
- window['analytics'].page("Chat Auth Page, Signed Out", {});
1305
- } catch (err) {
1306
- this.logger.error('Event:Signed Out [page] error', err);
1307
- }
1308
-
1309
- try {
1310
- window['analytics'].identify(user.uid, {
1311
- name: user.firstname + ' ' + user.lastname,
1312
- email: user.email,
1313
- logins: 5,
1314
-
1315
- });
1316
- } catch (err) {
1317
- this.logger.error('Event:Signed Out [identify] error', err);
1318
- }
1319
-
1320
- try {
1321
- window['analytics'].track('Signed Out', {
1322
- "username": user.firstname + ' ' + user.lastname,
1323
- "userId": user.uid
1324
- });
1325
- } catch (err) {
1326
- this.logger.error('Event:Signed Out [track] error', err);
1327
- }
1328
-
1329
- try {
1330
- // setTimeout(() => {
1331
- window['analytics'].reset()
1332
- // }, 0);
1333
- } catch (err) {
1334
- this.logger.error('Event:reset error', err);
1393
+ let user = this.tiledeskAuthService.getCurrentUser()
1394
+ if(window['analytics']){
1395
+ try {
1396
+ window['analytics'].page("Chat Auth Page, Signed Out", {});
1397
+ } catch (err) {
1398
+ this.logger.error('Event:Signed Out [page] error', err);
1399
+ }
1400
+
1401
+ try {
1402
+ window['analytics'].identify(user.uid, {
1403
+ name: user.firstname + ' ' + user.lastname,
1404
+ email: user.email,
1405
+ logins: 5,
1406
+
1407
+ });
1408
+ } catch (err) {
1409
+ this.logger.error('Event:Signed Out [identify] error', err);
1410
+ }
1411
+
1412
+ try {
1413
+ window['analytics'].track('Signed Out', {
1414
+ "username": user.firstname + ' ' + user.lastname,
1415
+ "userId": user.uid
1416
+ });
1417
+ } catch (err) {
1418
+ this.logger.error('Event:Signed Out [track] error', err);
1419
+ }
1420
+
1421
+ try {
1422
+ // setTimeout(() => {
1423
+ window['analytics'].reset()
1424
+ // }, 0);
1425
+ } catch (err) {
1426
+ this.logger.error('Event:reset error', err);
1427
+ }
1335
1428
  }
1336
1429
  }
1337
1430
 
1338
1431
  private segmentResolved(conversation: ConversationModel){
1339
1432
  let user = this.tiledeskAuthService.getCurrentUser();
1340
- try {
1341
- window['analytics'].page("Chat List Conversations Page, Chat Resolved", {});
1342
- } catch (err) {
1343
- this.logger.error('Event:Chat Resolved [page] error', err);
1344
- }
1345
-
1346
- try {
1347
- window['analytics'].identify(user.uid, {
1348
- name: user.firstname + ' ' + user.lastname,
1349
- email: user.email,
1350
- logins: 5,
1351
-
1352
- });
1353
- } catch (err) {
1354
- this.logger.error('Event:Chat Resolved [identify] error', err);
1355
- }
1356
-
1357
- try {
1358
- window['analytics'].track('Chat Resolved', {
1359
- "username": user.firstname + ' ' + user.lastname,
1360
- "userId": user.uid,
1361
- "conversation_id": conversation.uid,
1362
- "channel_type": conversation.channel_type,
1363
- "conversation_with":(conversation.channel_type !== TYPE_DIRECT)? null: conversation.conversation_with,
1364
- "department_name":(conversation.channel_type !== TYPE_DIRECT)? conversation.attributes.departmentName: null,
1365
- "department_id":(conversation.channel_type !== TYPE_DIRECT)? conversation.attributes.departmentId: null
1366
- },
1367
- { "context": {
1368
- "groupId": (conversation.channel_type !== TYPE_DIRECT)? conversation.attributes.projectId: null
1369
- }
1370
- });
1371
- } catch (err) {
1372
- this.logger.error('Event:Chat Resolved [track] error', err);
1373
- }
1374
-
1375
- if(conversation.channel_type !== TYPE_DIRECT){
1433
+ if(window['analytics']){
1434
+ try {
1435
+ window['analytics'].page("Chat List Conversations Page, Chat Resolved", {});
1436
+ } catch (err) {
1437
+ this.logger.error('Event:Chat Resolved [page] error', err);
1438
+ }
1439
+
1440
+ try {
1441
+ window['analytics'].identify(user.uid, {
1442
+ name: user.firstname + ' ' + user.lastname,
1443
+ email: user.email,
1444
+ logins: 5,
1445
+
1446
+ });
1447
+ } catch (err) {
1448
+ this.logger.error('Event:Chat Resolved [identify] error', err);
1449
+ }
1450
+
1376
1451
  try {
1377
- window['analytics'].group(conversation.attributes.projectId, {
1378
- name: (conversation.attributes.project_name)? conversation.attributes.project_name : null,
1379
- // plan: projectProfileName,
1452
+ window['analytics'].track('Chat Resolved', {
1453
+ "username": user.firstname + ' ' + user.lastname,
1454
+ "userId": user.uid,
1455
+ "conversation_id": conversation.uid,
1456
+ "channel_type": conversation.channel_type,
1457
+ "conversation_with":(conversation.channel_type !== TYPE_DIRECT)? null: conversation.conversation_with,
1458
+ "department_name":(conversation.channel_type !== TYPE_DIRECT)? conversation.attributes.departmentName: null,
1459
+ "department_id":(conversation.channel_type !== TYPE_DIRECT)? conversation.attributes.departmentId: null
1460
+ },
1461
+ { "context": {
1462
+ "groupId": (conversation.channel_type !== TYPE_DIRECT)? conversation.attributes.projectId: null
1463
+ }
1380
1464
  });
1381
1465
  } catch (err) {
1382
- this.logger.error('Event:Chat Resolved [group] error', err);
1466
+ this.logger.error('Event:Chat Resolved [track] error', err);
1467
+ }
1468
+
1469
+ if(conversation.channel_type !== TYPE_DIRECT){
1470
+ try {
1471
+ window['analytics'].group(conversation.attributes.projectId, {
1472
+ name: (conversation.attributes.project_name)? conversation.attributes.project_name : null,
1473
+ // plan: projectProfileName,
1474
+ });
1475
+ } catch (err) {
1476
+ this.logger.error('Event:Chat Resolved [group] error', err);
1477
+ }
1383
1478
  }
1384
1479
  }
1385
1480
  }
1386
1481
 
1482
+
1387
1483
  @HostListener('document:visibilitychange', [])
1388
1484
  visibilitychange() {
1389
1485
  // this.logger.debug("document TITLE", document.hidden, document.title);
@@ -1447,5 +1543,26 @@ export class AppComponent implements OnInit {
1447
1543
  this.isSoundEnabled = event.newValue === 'enabled'? true: false
1448
1544
  }
1449
1545
  }
1546
+
1547
+
1548
+ // @HostListener('mouseenter', ['$event'])
1549
+ // onMouseEnter(event: any) {
1550
+ // console.log('HostListener onMouseEnter-->', event)
1551
+ // }
1552
+
1553
+ // @HostListener('mouseleave', ['$event'])
1554
+ // onMouseLeave(event: any) {
1555
+ // console.log('HostListener onMouseLeave-->', event)
1556
+ // }
1557
+
1558
+ // @HostListener('focus', ['$event'])
1559
+ // onFocus(event: any) {
1560
+ // console.log('HostListener onFocus-->', event)
1561
+ // }
1562
+
1563
+ // @HostListener('blur', ['$event'])
1564
+ // onBlur(event: any) {
1565
+ // console.log('HostListener onBlur-->', event)
1566
+ // }
1450
1567
  }
1451
1568
 
@@ -1,3 +1,5 @@
1
+ import { SendEmailModal } from './modals/send-email/send-email.page';
2
+ import { ConvertRequestToConversation } from './../chat21-core/utils/convertRequestToConversation';
1
3
  import { LogLevel, PUSH_ENGINE_FIREBASE, PUSH_ENGINE_MQTT } from './../chat21-core/utils/constants';
2
4
  import { CustomLogger } from 'src/chat21-core/providers/logger/customLogger';
3
5
  import { NgModule, ErrorHandler, APP_INITIALIZER } from '@angular/core';
@@ -81,10 +83,10 @@ import { AppStorageService } from 'src/chat21-core/providers/abstract/app-storag
81
83
  import { ConversationListPageModule } from './pages/conversations-list/conversations-list.module';
82
84
  import { ConversationDetailPageModule } from './pages/conversation-detail/conversation-detail.module';
83
85
  import { LoginPageModule } from './pages/authentication/login/login.module';
84
- import { LoaderPreviewPageModule } from './pages/loader-preview/loader-preview.module';
86
+ import { LoaderPreviewPageModule } from './modals/loader-preview/loader-preview.module';
85
87
  import { CreateTicketPageModule } from './pages/create-ticket/create-ticket.module';
86
88
  import { CreateRequesterPageModule } from './pages/create-requester/create-requester.module';
87
- import { CreateCannedResponsePageModule } from './pages/create-canned-response/create-canned-response.module';
89
+ import { CreateCannedResponsePageModule } from './modals/create-canned-response/create-canned-response.module';
88
90
  // UTILS
89
91
  import { ScrollbarThemeModule } from './utils/scrollbar-theme.directive';
90
92
  import { SharedModule } from 'src/app/shared/shared.module';
@@ -101,6 +103,7 @@ import { ConnectionService } from 'ng-connection-service';
101
103
  import { WebSocketJs } from './services/websocket/websocket-js';
102
104
  import { UnassignedConversationsPageModule } from './pages/unassigned-conversations/unassigned-conversations.module';
103
105
  import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
106
+ import { SendEmailModalModule } from './modals/send-email/send-email.module';
104
107
 
105
108
  // FACTORIES
106
109
  export function createTranslateLoader(http: HttpClient) {
@@ -287,6 +290,7 @@ const appInitializerFn = (appConfig: AppConfigProvider, logger: NGXLogger) => {
287
290
  ConversationInfoModule,
288
291
  NgxLinkifyjsModule.forRoot(),
289
292
  LoaderPreviewPageModule,
293
+ SendEmailModalModule,
290
294
  CreateTicketPageModule,
291
295
  CreateRequesterPageModule,
292
296
  CreateCannedResponsePageModule
@@ -369,7 +373,8 @@ const appInitializerFn = (appConfig: AppConfigProvider, logger: NGXLogger) => {
369
373
  EventsService,
370
374
  Chooser,
371
375
  Chat21Service,
372
- WebSocketJs
376
+ WebSocketJs,
377
+ ConvertRequestToConversation
373
378
  ]
374
379
  })
375
380
  export class AppModule { }
@@ -17,11 +17,18 @@ export class ConversationContentComponent implements OnInit {
17
17
  @Input() messages: MessageModel[]
18
18
  @Input() senderId: string;
19
19
  @Input() baseLocation: string;
20
+ @Input() isConversationArchived: boolean;
21
+ @Input() isTypings: boolean;
22
+ @Input() idUserTypingNow: string;
23
+ @Input() nameUserTypingNow: string;
24
+ @Input() typingLocation: string;
25
+ @Input() fullscreenMode: boolean;
20
26
  @Input() translationMap: Map<string, string>;
21
27
  @Input() stylesMap: Map<string, string>;
22
28
  @Output() onBeforeMessageRender = new EventEmitter();
23
29
  @Output() onAfterMessageRender = new EventEmitter();
24
- @Output() onMenuOptionShow = new EventEmitter();
30
+ @Output() onMenuOptionShow = new EventEmitter<boolean>();
31
+ @Output() onEmojiiPickerShow = new EventEmitter<boolean>()
25
32
  @Output() onAttachmentButtonClicked = new EventEmitter();
26
33
  @Output() onScrollContent = new EventEmitter();
27
34