@chat21/chat21-ionic 3.0.80 → 3.0.81-rc.2

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 (151) hide show
  1. package/CHANGELOG.md +75 -3
  2. package/README.md +2 -2
  3. package/angular.json +1 -0
  4. package/deploy_amazon_beta.sh +29 -0
  5. package/deploy_amazon_prod.sh +30 -0
  6. package/package.json +2 -2
  7. package/src/app/app.component.html +7 -1
  8. package/src/app/app.component.scss +18 -2
  9. package/src/app/app.component.ts +113 -17
  10. package/src/app/app.module.ts +3 -1
  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 +77 -23
  13. package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.scss +168 -86
  14. package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.ts +39 -2
  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 -25
  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 +1 -1
  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 +62 -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 -8
  43. package/src/app/components/canned-response/canned-response.component.scss +24 -2
  44. package/src/app/components/canned-response/canned-response.component.ts +5 -5
  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 +61 -42
  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 +9 -25
  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 +8 -6
  52. package/src/app/components/conversation-detail/message-text-area/message-text-area.component.scss +4 -4
  53. package/src/app/components/conversation-detail/message-text-area/message-text-area.component.ts +25 -87
  54. package/src/app/components/conversation-info/info-content/info-content.component.html +2 -1
  55. package/src/app/components/conversation-info/info-content/info-content.component.ts +3 -2
  56. package/src/app/components/conversation-info/info-direct/info-direct.component.html +1 -9
  57. package/src/app/components/conversation-info/info-direct/info-direct.component.ts +0 -2
  58. package/src/app/components/conversation-info/info-group/info-group.component.html +44 -108
  59. package/src/app/components/conversation-info/info-group/info-group.component.scss +101 -61
  60. package/src/app/components/conversation-info/info-group/info-group.component.ts +1 -0
  61. package/src/app/components/{ddp-header/ddp-header.component.html → conversations-list/header-conversations-list/header-conversations-list.component.html} +3 -3
  62. package/src/app/components/{ddp-header/ddp-header.component.scss → conversations-list/header-conversations-list/header-conversations-list.component.scss} +16 -4
  63. 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
  64. package/src/app/components/{ddp-header/ddp-header.component.ts → conversations-list/header-conversations-list/header-conversations-list.component.ts} +7 -16
  65. package/src/app/components/conversations-list/header-conversations-list-archived/header-conversations-list-archived.component.html +12 -0
  66. package/src/app/components/conversations-list/header-conversations-list-archived/header-conversations-list-archived.component.scss +14 -0
  67. 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
  68. 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
  69. package/src/app/components/navbar/navbar.component.html +103 -0
  70. package/src/app/components/navbar/navbar.component.scss +249 -0
  71. package/src/app/components/{ddp-header/ddp-header.component.spec.ts → navbar/navbar.component.spec.ts} +6 -6
  72. package/src/app/components/navbar/navbar.component.ts +189 -0
  73. package/src/app/components/project-item/project-item.component.html +98 -149
  74. package/src/app/components/project-item/project-item.component.scss +42 -35
  75. package/src/app/components/project-item/project-item.component.ts +16 -4
  76. package/src/app/components/sidebar-user-details/sidebar-user-details.component.html +3 -3
  77. package/src/app/components/sidebar-user-details/sidebar-user-details.component.ts +2 -7
  78. package/src/app/components/utils/user-presence/user-presence.component.html +7 -2
  79. package/src/app/components/utils/user-presence/user-presence.component.scss +35 -18
  80. package/src/app/components/utils/user-presence/user-presence.component.ts +6 -10
  81. package/src/app/pages/contacts-directory/contacts-directory.page.html +1 -1
  82. package/src/app/pages/contacts-directory/contacts-directory.page.scss +41 -0
  83. package/src/app/pages/contacts-directory/contacts-directory.page.ts +2 -0
  84. package/src/app/pages/conversation-detail/conversation-detail.module.ts +0 -8
  85. package/src/app/pages/conversation-detail/conversation-detail.page.html +40 -23
  86. package/src/app/pages/conversation-detail/conversation-detail.page.scss +40 -250
  87. package/src/app/pages/conversation-detail/conversation-detail.page.ts +184 -117
  88. package/src/app/pages/conversations-list/conversations-list.page.html +11 -8
  89. package/src/app/pages/conversations-list/conversations-list.page.scss +11 -2
  90. package/src/app/pages/conversations-list/conversations-list.page.ts +25 -22
  91. package/src/app/pages/create-canned-response/create-canned-response.page.ts +13 -13
  92. package/src/app/pages/loader-preview/loader-preview.page.html +1 -1
  93. package/src/app/pages/loader-preview/loader-preview.page.scss +4 -0
  94. package/src/app/pages/loader-preview/loader-preview.page.ts +1 -2
  95. package/src/app/pages/profile-info/profile-info.page.html +2 -4
  96. package/src/app/pages/unassigned-conversations/unassigned-conversations.page.html +1 -1
  97. package/src/app/pages/unassigned-conversations/unassigned-conversations.page.scss +42 -0
  98. package/src/app/pages/unassigned-conversations/unassigned-conversations.page.ts +1 -0
  99. package/src/app/services/canned-responses/canned-responses.service.ts +26 -0
  100. package/src/app/services/projects/projects.service.spec.ts +12 -0
  101. package/src/app/services/projects/projects.service.ts +43 -0
  102. package/src/app/services/tiledesk/tiledesk.service.ts +2 -26
  103. package/src/app/shared/shared.module.ts +24 -33
  104. package/src/assets/i18n/ar.json +278 -265
  105. package/src/assets/i18n/az.json +14 -1
  106. package/src/assets/i18n/de.json +15 -2
  107. package/src/assets/i18n/en.json +15 -2
  108. package/src/assets/i18n/es.json +15 -2
  109. package/src/assets/i18n/fr.json +14 -1
  110. package/src/assets/i18n/it.json +14 -1
  111. package/src/assets/i18n/kk.json +15 -2
  112. package/src/assets/i18n/pt.json +15 -2
  113. package/src/assets/i18n/ru.json +14 -1
  114. package/src/assets/i18n/sr.json +277 -264
  115. package/src/assets/i18n/sv.json +15 -2
  116. package/src/assets/i18n/tr.json +15 -2
  117. package/src/assets/i18n/uk.json +15 -2
  118. package/src/assets/i18n/uz.json +14 -1
  119. package/src/assets/js/chat21client.js +177 -149
  120. package/src/assets/sounds/interface-start.mp3 +0 -0
  121. package/src/assets/sounds/wheep-wheep.mp3 +0 -0
  122. package/src/chat-config-native-mqtt.json +5 -1
  123. package/src/chat21-core/models/conversation.ts +0 -1
  124. package/src/chat21-core/models/projects.ts +27 -0
  125. package/src/chat21-core/providers/firebase/firebase-typing.service.ts +7 -9
  126. package/src/chat21-core/utils/constants.ts +6 -1
  127. package/src/chat21-core/utils/convertRequestToConversation.ts +41 -0
  128. package/src/chat21-core/utils/user-typing/user-typing.component.html +8 -5
  129. package/src/chat21-core/utils/user-typing/user-typing.component.scss +87 -17
  130. package/src/chat21-core/utils/user-typing/user-typing.component.ts +12 -94
  131. package/src/chat21-core/utils/utils.ts +38 -10
  132. package/src/global.scss +52 -56
  133. package/src/index.html +2 -2
  134. package/src/variables.scss +30 -10
  135. package/src/app/components/conversation-detail/bubble-day-message/bubble-day-message.component.html +0 -3
  136. package/src/app/components/conversation-detail/bubble-day-message/bubble-day-message.component.scss +0 -21
  137. package/src/app/components/conversation-detail/bubble-day-message/bubble-day-message.component.spec.ts +0 -24
  138. package/src/app/components/conversation-detail/bubble-day-message/bubble-day-message.component.ts +0 -14
  139. package/src/app/components/conversation-detail/bubble-my-message/bubble-my-message.component.html +0 -54
  140. package/src/app/components/conversation-detail/bubble-my-message/bubble-my-message.component.scss +0 -98
  141. package/src/app/components/conversation-detail/bubble-my-message/bubble-my-message.component.ts +0 -84
  142. package/src/app/components/conversation-detail/bubble-others-message/bubble-others-message.component.html +0 -30
  143. package/src/app/components/conversation-detail/bubble-others-message/bubble-others-message.component.scss +0 -83
  144. package/src/app/components/conversation-detail/bubble-others-message/bubble-others-message.component.spec.ts +0 -24
  145. package/src/app/components/conversation-detail/bubble-others-message/bubble-others-message.component.ts +0 -68
  146. package/src/app/components/conversation-detail/bubble-system-message/bubble-system-message.component.html +0 -3
  147. package/src/app/components/conversation-detail/bubble-system-message/bubble-system-message.component.scss +0 -10
  148. package/src/app/components/conversation-detail/bubble-system-message/bubble-system-message.component.spec.ts +0 -24
  149. package/src/app/components/conversation-detail/bubble-system-message/bubble-system-message.component.ts +0 -14
  150. package/src/app/components/conversation-detail/option-header/option-header.component.html +0 -13
  151. package/src/app/components/conversation-detail/option-header/option-header.component.scss +0 -0
@@ -1,5 +1,5 @@
1
1
  import { TYPE_DIRECT } from 'src/chat21-core/utils/constants';
2
- import { TYPE_SUPPORT_GROUP, URL_SOUND_LIST_CONVERSATION } from './../../../chat21-core/utils/constants'
2
+ import { URL_SOUND_LIST_CONVERSATION } from './../../../chat21-core/utils/constants'
3
3
  import {
4
4
  Component,
5
5
  OnInit,
@@ -115,16 +115,14 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
115
115
  public lastConnectionDate: string
116
116
  public showMessageWelcome: boolean
117
117
  public openInfoConversation = false
118
- public openInfoMessage: boolean // check is open info message
119
118
  public isMobile = false
120
119
  public isLessThan991px = false // nk added
121
- public isTyping = false
122
- public nameUserTypingNow: string
123
120
 
124
121
  public heightMessageTextArea = ''
125
- public translationMap: Map<string, string>
122
+ public translationsMap: Map<string, string> = new Map()
123
+ public translationsHeaderMap: Map<string, string> = new Map()
124
+ public translationsContentMap: Map<string, string> = new Map()
126
125
  public conversationAvatar: any
127
- public membersConversation: any
128
126
  public member: UserModel
129
127
  public urlConversationSupportGroup: any
130
128
  public isFileSelected: boolean
@@ -150,7 +148,6 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
150
148
  //SOUND
151
149
  setTimeoutSound: any;
152
150
  audio: any;
153
- isOpenInfoConversation: boolean;
154
151
  USER_HAS_OPENED_CLOSE_INFO_CONV: boolean = false;
155
152
  isHovering: boolean = false;
156
153
  conversation_count: number;
@@ -172,6 +169,15 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
172
169
  public disableTextarea: boolean;
173
170
  appsidebarIsWide: boolean;
174
171
 
172
+ // ========== begin:: typying =======
173
+ public isTypings = false;
174
+ public isDirect = false;
175
+ public idUserTypingNow: string;
176
+ public nameUserTypingNow: string;
177
+ private setTimeoutWritingMessages;
178
+ membersConversation = ['SYSTEM'];
179
+ // ========== end:: typying =======
180
+
175
181
  /**
176
182
  * Constructor
177
183
  * @param route
@@ -240,21 +246,7 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
240
246
  // -----------------------------------------------------------
241
247
  ngOnInit() {
242
248
  this.logger.log('[CONVS-DETAIL] > ngOnInit - window.location: ', window.location);
243
- // this.logger.log('[CONVS-DETAIL] > ngOnInit - fileUploadAccept: ', this.appConfigProvider.getConfig().fileUploadAccept);
244
- // const accept_files = this.appConfigProvider.getConfig().fileUploadAccept;
245
- // this.logger.log('[CONVS-DETAIL] > ngOnInit - fileUploadAccept typeof accept_files ', typeof accept_files);
246
- // const accept_files_array = accept_files.split(',')
247
- // this.logger.log('[CONVS-DETAIL] > ngOnInit - fileUploadAccept accept_files_array ', accept_files_array);
248
- // this.logger.log('[CONVS-DETAIL] > ngOnInit - fileUploadAccept accept_files_array typeof: ', typeof accept_files_array);
249
-
250
- // accept_files_array.forEach(accept_file => {
251
- // this.logger.log('[CONVS-DETAIL] > ngOnInit - fileUploadAccept accept_file ', accept_file);
252
- // const accept_file_segment = accept_file.split('/')
253
- // this.logger.log('[CONVS-DETAIL] > ngOnInit - fileUploadAccept accept_file_segment ', accept_file_segment);
254
- // if (accept_file_segment[1] === '*') {
255
-
256
- // }
257
- // });
249
+
258
250
  this.getConversations();
259
251
  this.watchToConnectionStatus();
260
252
  this.getOSCODE();
@@ -275,21 +267,21 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
275
267
  // console.log('[CONVS-DETAIL] HAS CLICKED ENLARGE SIDEBAR WIDE chatAreaEle ', chatAreaEle)
276
268
 
277
269
  if (event && event.data && event.data.action && event.data.action === 'openAppsSidebarWideMode' && event.data.parameter === true) {
278
- this.logger.log('[CONVS-DETAIL] HERE YES 1')
270
+ this.logger.log('[CONVS-DETAIL] openAppsSidebarWideMode EVENT-> open' )
279
271
  this.appsidebarIsWide = true
280
272
  // chat21InfoConversationEle.classList.add("info-convs-apps-sidebar-wide");
281
273
  // chatAreaEle.classList.add("chat-area-apps-sidebar-wide");
282
274
  }
283
275
 
284
276
  if (event && event.data && event.data.action && event.data.action === 'openAppsSidebarWideMode' && event.data.parameter === false) {
285
- this.logger.log('[CONVS-DETAIL] HERE YES 2')
277
+ this.logger.log('[CONVS-DETAIL] openAppsSidebarWideMode EVENT-> close')
286
278
  this.appsidebarIsWide = false
287
279
  // chat21InfoConversationEle.classList.remove("info-convs-apps-sidebar-wide");
288
280
  // chatAreaEle.classList.remove("chat-area-apps-sidebar-wide");
289
281
  }
290
282
 
291
283
  if (event && event.data && event.data.action && event.data.action === 'closeAppsSidebarWideMode' && event.data.parameter === true) {
292
- this.logger.log('[CONVS-DETAIL] HERE YES 3')
284
+ this.logger.log('[CONVS-DETAIL] closeAppsSidebarWideMode EVENT-> close')
293
285
  this.appsidebarIsWide = false
294
286
  // chat21InfoConversationEle.classList.remove("info-convs-apps-sidebar-wide");
295
287
  // chatAreaEle.classList.remove("chat-area-apps-sidebar-wide");
@@ -339,7 +331,12 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
339
331
  // this.updateConversationBadge()
340
332
  // }
341
333
  if(conv.uid && conv.uid === this.conversationWith){
342
- this.conversationAvatar = setConversationAvatar(conv.conversation_with,conv.conversation_with_fullname,conv.channel_type)
334
+ this.conversationAvatar = setConversationAvatar(
335
+ conv.conversation_with,
336
+ conv.conversation_with_fullname,
337
+ conv.channel_type,
338
+ conv.attributes['projectId'],
339
+ conv.attributes['project_name'])
343
340
  }
344
341
 
345
342
  }
@@ -477,6 +474,7 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
477
474
  this.loggedUser = this.tiledeskAuthService.getCurrentUser()
478
475
  this.logger.log('[CONVS-DETAIL] - initialize -> loggedUser: ', this.loggedUser)
479
476
  this.translations()
477
+ this.setStyleMap()
480
478
  // this.conversationSelected = localStorage.getItem('conversationSelected');
481
479
  this.showButtonToBottom = false
482
480
  this.showMessageWelcome = false
@@ -491,7 +489,6 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
491
489
 
492
490
  this.messages = [] // list messages of conversation
493
491
  this.isFileSelected = false // indicates if a file has been selected (image to upload)
494
- this.openInfoMessage = false // indicates whether the info message panel is open
495
492
 
496
493
  if (checkPlatformIsMobile()) {
497
494
  this.isMobile = true
@@ -507,13 +504,11 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
507
504
  if (checkWindowWidthIsLessThan991px()) {
508
505
  this.logger.log('[CONVS-DETAIL] - initialize -> checkWindowWidthIsLessThan991px ', checkWindowWidthIsLessThan991px())
509
506
  this.openInfoConversation = false // indica se è aperto il box info conversazione
510
- this.isOpenInfoConversation = false
511
- this.logger.log('[CONVS-DETAIL] - initialize -> openInfoConversation ', this.openInfoConversation, ' -> isOpenInfoConversation ', this.isOpenInfoConversation)
507
+ this.logger.log('[CONVS-DETAIL] - initialize -> openInfoConversation ', this.openInfoConversation)
512
508
  } else {
513
509
  this.logger.log('[CONVS-DETAIL] - initialize -> checkWindowWidthIsLessThan991px ', checkWindowWidthIsLessThan991px())
514
510
  this.openInfoConversation = true
515
- this.isOpenInfoConversation = true
516
- this.logger.log('[CONVS-DETAIL] - initialize -> openInfoConversation ', this.openInfoConversation, ' -> isOpenInfoConversation ', this.isOpenInfoConversation)
511
+ this.logger.log('[CONVS-DETAIL] - initialize -> openInfoConversation ', this.openInfoConversation)
517
512
  }
518
513
  }
519
514
 
@@ -532,6 +527,8 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
532
527
  this.addEventsKeyboard()
533
528
  this.startConversation()
534
529
  this.updateConversationBadge() // AGGIORNO STATO DELLA CONVERSAZIONE A 'LETTA' (is_new = false)
530
+
531
+ this.initializeTyping();
535
532
  }
536
533
 
537
534
  _getProjectIdByConversationWith(conversationWith: string) {
@@ -566,22 +563,12 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
566
563
  })
567
564
  }
568
565
 
569
- returnOpenCloseInfoConversation(openInfoConversation: boolean) {
570
- this.logger.log('[CONVS-DETAIL] returnOpenCloseInfoConversation - openInfoConversation ', openInfoConversation)
571
- this.resizeTextArea()
572
- this.openInfoMessage = false
573
- this.openInfoConversation = openInfoConversation
574
- this.isOpenInfoConversation = openInfoConversation
575
- this.USER_HAS_OPENED_CLOSE_INFO_CONV = true
576
- }
577
-
578
566
  @HostListener('window:resize', ['$event'])
579
567
  onResize(event: any) {
580
568
  const newInnerWidth = event.target.innerWidth
581
569
  if (newInnerWidth < 991) {
582
570
  if (this.USER_HAS_OPENED_CLOSE_INFO_CONV === false) {
583
571
  this.openInfoConversation = false
584
- this.isOpenInfoConversation = false
585
572
  }
586
573
  }
587
574
  }
@@ -600,7 +587,7 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
600
587
  'LABEL_TO',
601
588
  'LABEL_LAST_ACCESS',
602
589
  'ARRAY_DAYS',
603
- 'LABEL_IS_WRITING',
590
+
604
591
  'LABEL_INFO_ADVANCED',
605
592
  'ID_CONVERSATION',
606
593
  'UPLOAD_FILE_ERROR',
@@ -619,11 +606,35 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
619
606
  'THERE_ARE_NO_CANNED_RESPONSES_AVAILABLE',
620
607
  'TO_CREATE_THEM_GO_TO_THE_PROJECT',
621
608
  "AddNewCannedResponse",
622
- "LABEL_LOADING"
609
+ "LABEL_LOADING",
610
+ "DIRECT_CHAT",
611
+ "GROUP_CHAT",
623
612
  ]
624
613
 
625
- this.translationMap = this.customTranslateService.translateLanguage(keys)
626
- this.logger.log('[CONVS-DETAIL] x this.translationMap ',this.translationMap)
614
+ const keysHeader = [
615
+ 'DIRECT_CHAT',
616
+ 'GROUP_CHAT',
617
+ 'LABEL_IS_WRITING',
618
+ 'LABEL_ONLINE',
619
+ 'LABEL_OFFLINE',
620
+ 'LABEL_TODAY',
621
+ 'LABEL_TOMORROW',
622
+ 'LABEL_TO',
623
+ 'LABEL_LAST_ACCESS',
624
+ 'ARRAY_DAYS',
625
+ 'Resolve',
626
+ ]
627
+
628
+ const keysContentDetail = [
629
+ 'LABEL_OPEN_INFO_CONVERSATION',
630
+ 'LABEL_CLOSE_GROUP',
631
+ 'LABEL_IS_WRITING',
632
+ ]
633
+
634
+ this.translationsMap = this.customTranslateService.translateLanguage(keys)
635
+ this.translationsHeaderMap = this.customTranslateService.translateLanguage(keysHeader)
636
+ this.translationsContentMap = this.customTranslateService.translateLanguage(keysContentDetail)
637
+ this.logger.log('[CONVS-DETAIL] x this.translationMap ',this.translationsMap)
627
638
  }
628
639
 
629
640
  // --------------------------------------------------------
@@ -650,6 +661,19 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
650
661
  return this.customTranslateService.translateLanguage(keys)
651
662
  }
652
663
 
664
+ private setStyleMap(){
665
+ this.styleMap.set('themeColor', 'var(--basic-blue)')
666
+ .set('bubbleReceivedBackground','var(--bck-msg-received)')
667
+ .set('bubbleReceivedTextColor', 'var(--col-msg-received)')
668
+ .set('bubbleSentBackground', 'var(--bck-msg-sent)')
669
+ .set('bubbleSentTextColor', 'var(--col-msg-sent)')
670
+ .set('buttonFontSize','var(--button-in-msg-font-size)')
671
+ .set('buttonBackgroundColor', 'var(--buttonBackgroundColor)')
672
+ .set('buttonTextColor', 'var(--buttonTextColor)')
673
+ .set('buttonHoverBackgroundColor', 'var(--buttonHoverBackgroundColor)')
674
+ .set('buttonHoverTextColor', 'var(--buttonHoverTextColor)')
675
+
676
+ }
653
677
  // -------------------------------------------------------------------------------------
654
678
  // * retrieving the handler from chatManager
655
679
  // * if it DOESN'T EXIST I create a handler and connect and store it in the chatmanager
@@ -696,14 +720,10 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
696
720
  this.logger.log('[CONVS-DETAIL] - initConversationHandler (else) - this.messages: ', this.messages)
697
721
  this.logger.log('[CONVS-DETAIL] - initConversationHandler (else) - this.showMessageWelcome: ', this.showMessageWelcome)
698
722
  }
699
- this.logger.log('[CONVS-DETAIL] - initConversationHandler (else) - message ', this.messages, ' showIonContent', this.showIonContent)
700
723
  }
701
724
 
702
725
  initGroupsHandler() {
703
- if (
704
- this.conversationWith.startsWith('support-group') ||
705
- this.conversationWith.startsWith('group-')
706
- ) {
726
+ if (this.conversationWith.startsWith('support-group') || this.conversationWith.startsWith('group-')) {
707
727
  this.groupService.initialize(this.tenant, this.loggedUser.uid)
708
728
  this.logger.log('[CONVS-DETAIL] - initGroupsHandler - tenant', this.tenant, ' loggedUser UID', this.loggedUser.uid)
709
729
  }
@@ -739,6 +759,18 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
739
759
  }
740
760
  }
741
761
 
762
+ onConversationLoaded(conversation): ConversationModel{
763
+ if(conversation.attributes && conversation.attributes['projectId']){
764
+ let project = localStorage.getItem(conversation.attributes['projectId'])
765
+ if(project){
766
+ project = JSON.parse(project)
767
+ conversation.attributes.project_name = project['name']
768
+ }
769
+
770
+ }
771
+ return conversation
772
+ }
773
+
742
774
  setHeaderContent() {
743
775
  // this.logger.log('[CONVS-DETAIL] - setHeaderContent conversationWith', this.conversationWith)
744
776
  // this.logger.log('[CONVS-DETAIL] - setHeaderContent conversationsHandlerService', this.conversationsHandlerService)
@@ -753,6 +785,8 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
753
785
  conv.conversation_with,
754
786
  conv.conversation_with_fullname,
755
787
  conv.channel_type,
788
+ conv.attributes['projectId'],
789
+ conv.attributes['project_name']
756
790
  )
757
791
  }
758
792
  if(!conv){
@@ -766,6 +800,8 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
766
800
  conv.conversation_with,
767
801
  conv.conversation_with_fullname,
768
802
  conv.channel_type,
803
+ conv.attributes['projectId'],
804
+ conv.attributes['project_name']
769
805
  )
770
806
  let duration = getDateDifference(conv.timestamp, Date.now())
771
807
  duration.days > 10? this.disableTextarea = true: this.disableTextarea = false
@@ -784,6 +820,8 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
784
820
  conv.conversation_with,
785
821
  conv.conversation_with_fullname,
786
822
  conv.channel_type,
823
+ conv.attributes['projectId'],
824
+ conv.attributes['project_name']
787
825
  )
788
826
  let duration = getDateDifference(conv.timestamp, Date.now())
789
827
  duration.days > 10? this.disableTextarea = true: this.disableTextarea = false
@@ -796,6 +834,8 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
796
834
  conv.conversation_with,
797
835
  conv.conversation_with_fullname,
798
836
  conv.channel_type,
837
+ conv.attributes['projectId'],
838
+ conv.attributes['project_name']
799
839
  )
800
840
  }
801
841
  this.logger.log('[CONVS-DETAIL] - setHeaderContent > conversationAvatar: ', this.conversationAvatar)
@@ -905,37 +945,6 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
905
945
  let subscription: any
906
946
  let subscriptionKey: string
907
947
 
908
- // subscriptionKey = 'BSConversationsChanged'
909
- // subscription = this.subscriptions.find((item) => item.key === subscriptionKey)
910
- // if (!subscription) {
911
- // subscription = this.conversationsHandlerService.conversationChanged.subscribe((data: ConversationModel) => {
912
- // this.logger.log('[CONVS-DETAIL] subscribe BSConversationsChanged data ', data, ' this.loggedUser.uid:', this.loggedUser.uid)
913
-
914
- // if (data && data.sender !== this.loggedUser.uid) {
915
- // this.logger.log('[CONVS-DETAIL] subscribe to BSConversationsChange data sender ', data.sender)
916
- // this.logger.log('[CONVS-DETAIL] subscribe to BSConversationsChange this.loggedUser.uid ', this.loggedUser.uid)
917
- // this.logger.log('[CONVS-DETAIL] subscribe to BSConversationsChange is_new ', data.is_new)
918
- // this.logger.log('[CONVS-DETAIL] subscribe to BSConversationsChange showButtonToBottom ', this.showButtonToBottom)
919
- // // UPDATE THE CONVERSATION TO 'READ' IF IT IS ME WHO WRITES THE LAST MESSAGE OF THE CONVERSATION
920
- // // AND IF THE POSITION OF THE SCROLL IS AT THE END
921
- // if (!this.showButtonToBottom && data.is_new) {
922
- // // ARE AT THE END
923
- // this.updateConversationBadge()
924
- // }
925
- // if(data.uid === this.conversationWith){
926
- // this.conversationAvatar = setConversationAvatar(
927
- // data.conversation_with,
928
- // data.conversation_with_fullname,
929
- // data.channel_type,
930
- // )
931
- // }
932
-
933
- // }
934
- // })
935
- // const subscribe = { key: subscriptionKey, value: subscription }
936
- // this.subscriptions.push(subscribe)
937
- // }
938
-
939
948
  subscriptionKey = 'messageAdded'
940
949
  subscription = this.subscriptions.find((item) => item.key === subscriptionKey)
941
950
  if (!subscription) {
@@ -985,6 +994,22 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
985
994
  this.subscriptions.push(subscribe)
986
995
  }
987
996
 
997
+ subscriptionKey = 'conversationTyping';
998
+ subscription = this.subscriptions.find(item => item.key === subscriptionKey);
999
+ if (!subscription) {
1000
+ subscription = this.typingService.BSIsTyping.pipe(takeUntil(this.unsubscribe$)).subscribe((data: any) => {
1001
+ this.logger.debug('[CONVS-DETAIL] ***** BSIsTyping *****', data);
1002
+ if (data) {
1003
+ const isTypingUid = data.uid; //support-group-...
1004
+ if (this.conversationWith === isTypingUid) {
1005
+ that.subscribeTypings(data);
1006
+ }
1007
+ }
1008
+ });
1009
+ const subscribe = {key: subscriptionKey, value: subscription };
1010
+ this.subscriptions.push(subscribe);
1011
+ }
1012
+
988
1013
  // subscriptionKey = 'onGroupChange';
989
1014
  // subscription = this.subscriptions.find(item => item.key === subscriptionKey);
990
1015
  // if (!subscription) {
@@ -1005,18 +1030,6 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
1005
1030
  // }
1006
1031
  }
1007
1032
 
1008
- onConversationLoaded(conversation): ConversationModel{
1009
- if(conversation.attributes && conversation.attributes['projectId']){
1010
- let project = localStorage.getItem(conversation.attributes['projectId'])
1011
- if(project){
1012
- project = JSON.parse(project)
1013
- conversation.attributes.project_name = project['name']
1014
- }
1015
- }
1016
- return conversation
1017
- }
1018
-
1019
-
1020
1033
  // -------------------------------------------------
1021
1034
  // addEventsKeyboard
1022
1035
  // -------------------------------------------------
@@ -1044,7 +1057,9 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
1044
1057
  this.conversationAvatar = setConversationAvatar(
1045
1058
  this.conversationWith,
1046
1059
  this.conversationWithFullname,
1047
- this.channelType
1060
+ this.channelType,
1061
+ this.conversation.attributes['projectId'],
1062
+ this.conversation.attributes['project_name']
1048
1063
  )
1049
1064
 
1050
1065
  }
@@ -1221,7 +1236,6 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
1221
1236
  this.logger.log('[CONVS-DETAIL] - returnChangeTextArea --> beforeSlash', beforeSlash)
1222
1237
  this.logger.log('[CONVS-DETAIL] - returnChangeTextArea --> afterSlash', afterSlash)
1223
1238
 
1224
-
1225
1239
  if(beforeSlash[beforeSlash.length-1].indexOf(' ') >= 0 && afterSlash === ''){
1226
1240
  this.HIDE_CANNED_RESPONSES = false
1227
1241
  } else if(beforeSlash[beforeSlash.length-1].indexOf(' ') < 0 && afterSlash === '' ){
@@ -1269,7 +1283,7 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
1269
1283
 
1270
1284
  replaceTagInMessage(canned, event?) {
1271
1285
  const elTextArea = this.rowTextArea['el']
1272
- const textArea = elTextArea.getElementsByTagName('ion-textarea')[0]
1286
+ const textArea = elTextArea.getElementsByTagName('ion-textarea')[0] as HTMLInputElement;
1273
1287
  // console.log('[CONVS-DETAIL] replaceTagInMessage textArea ', textArea)
1274
1288
  // console.log('[CONVS-DETAIL] replaceTagInMessage textArea value', textArea.value,)
1275
1289
 
@@ -1284,20 +1298,17 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
1284
1298
  // replace text
1285
1299
  var strTEMP = textArea.value.replace(/\/.*/ig, canned.text)
1286
1300
  strTEMP = this.replacePlaceholderInCanned(strTEMP)
1287
- this.logger.log('[CONVS-DETAIL] replaceTagInMessage strSearch before', strTEMP, textArea)
1301
+ this.logger.log('[CONVS-DETAIL] replaceTagInMessage strSearch ', strTEMP)
1288
1302
  // strTEMP = this.replacePlaceholderInCanned(strTEMP);
1289
1303
  // textArea.value = '';
1290
1304
  // that.messageString = strTEMP;
1291
1305
  textArea.value = strTEMP
1292
- this.logger.log('[CONVS-DETAIL] replaceTagInMessage strSearch after', strTEMP, textArea)
1293
1306
  this.insertAtCursor(textArea, '')
1294
1307
  this.setCaretPosition(textArea)
1295
1308
  // setTimeout(() => {
1296
1309
  // // textArea.focus();
1297
- // textArea.selectionEnd = textArea.value.length;
1298
1310
  // textArea.setFocus()
1299
1311
  // // this.resizeTextArea()
1300
- // // this.setCaretPosition(textArea)
1301
1312
  // }, 200)
1302
1313
 
1303
1314
  }
@@ -1338,11 +1349,10 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
1338
1349
  if(!this.HIDE_CANNED_RESPONSES){
1339
1350
  const elTextArea = this.rowTextArea['el']
1340
1351
  const textArea = elTextArea.getElementsByTagName('ion-textarea')[0]
1341
- if($event && elTextArea){
1342
- this.logger.log('[CONVS-DETAIL] onClickOpenCannedResponses textArea ', textArea)
1352
+ if(elTextArea){
1343
1353
  // console.log("[CONVS-DETAIL] onClickOpenCannedResponses textArea value", textArea.value)
1344
1354
  var lastChar = textArea.value[textArea.value.length - 1]
1345
- // console.log('[CONVS-DETAIL] onClickOpenCannedResponses lastChar', lastChar)
1355
+ this.logger.log('[CONVS-DETAIL] onClickOpenCannedResponses lastChar --- textArea ', lastChar, textArea)
1346
1356
  if (lastChar !== '/') {
1347
1357
  this.insertAtCursor(textArea, '/')
1348
1358
  }
@@ -1522,6 +1532,13 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
1522
1532
  }
1523
1533
  }
1524
1534
 
1535
+ onOpenCloseInfoConversation(event){
1536
+ this.logger.log('[CONVS-DETAIL] onOpenCloseInfoConversation - openInfoConversation ', event)
1537
+ this.resizeTextArea()
1538
+ this.openInfoConversation = event
1539
+ this.USER_HAS_OPENED_CLOSE_INFO_CONV = true
1540
+ }
1541
+
1525
1542
  // -------------- START SCROLL/RESIZE -------------- //
1526
1543
  /** */
1527
1544
  resizeTextArea() {
@@ -1623,6 +1640,7 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
1623
1640
  this.heightMessageTextArea = '57' // NK edited
1624
1641
  }
1625
1642
  }
1643
+
1626
1644
  checkAcceptedFile(draggedFileMimeType) {
1627
1645
  let isAcceptFile = false
1628
1646
  this.logger.log('[CONVS-DETAIL] > checkAcceptedFile - fileUploadAccept: ',this.appConfigProvider.getConfig().fileUploadAccept)
@@ -1644,26 +1662,17 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
1644
1662
  if (accept_file_segment[1] === '*') {
1645
1663
  if (draggedFileMimeType.startsWith(accept_file_segment[0])) {
1646
1664
  isAcceptFile = true
1647
- this.logger.log(
1648
- '[CONVS-DETAIL] > checkAcceptedFile - fileUploadAccept isAcceptFile',
1649
- isAcceptFile,
1650
- )
1665
+ this.logger.log('[CONVS-DETAIL] > checkAcceptedFile - fileUploadAccept isAcceptFile',isAcceptFile)
1651
1666
  return isAcceptFile
1652
1667
  } else {
1653
1668
  isAcceptFile = false
1654
- this.logger.log(
1655
- '[CONVS-DETAIL] > checkAcceptedFile - fileUploadAccept isAcceptFile',
1656
- isAcceptFile,
1657
- )
1669
+ this.logger.log('[CONVS-DETAIL] > checkAcceptedFile - fileUploadAccept isAcceptFile',isAcceptFile)
1658
1670
  return isAcceptFile
1659
1671
  }
1660
1672
  } else if (accept_file_segment[1] !== '*') {
1661
1673
  if (draggedFileMimeType === accept_file) {
1662
1674
  isAcceptFile = true
1663
- this.logger.log(
1664
- '[CONVS-DETAIL] > checkAcceptedFile - fileUploadAccept isAcceptFile',
1665
- isAcceptFile,
1666
- )
1675
+ this.logger.log('[CONVS-DETAIL] > checkAcceptedFile - fileUploadAccept isAcceptFile',isAcceptFile)
1667
1676
  return isAcceptFile
1668
1677
  }
1669
1678
  }
@@ -1673,6 +1682,64 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
1673
1682
  }
1674
1683
  }
1675
1684
 
1685
+
1686
+ initializeTyping() {
1687
+ this.logger.debug('[CONVS-DETAIL] membersconversation', this.membersConversation)
1688
+ if(this.loggedUser){
1689
+ this.membersConversation.push(this.loggedUser.uid)
1690
+ //this.setSubscriptions();
1691
+ this.typingService.isTyping(this.conversationWith, this.loggedUser.uid, this.isDirect);
1692
+ }
1693
+ }
1694
+
1695
+ /** */
1696
+ subscribeTypings(data: any) {
1697
+ const that = this;
1698
+ try {
1699
+ const key = data.uidUserTypingNow;
1700
+ const waitTime = data.waitTime
1701
+ this.nameUserTypingNow = null;
1702
+ this.idUserTypingNow = null;
1703
+
1704
+ if (data.nameUserTypingNow) {
1705
+ this.nameUserTypingNow = data.nameUserTypingNow;
1706
+ }
1707
+ if (data.uidUserTypingNow){
1708
+ this.idUserTypingNow = data.uidUserTypingNow
1709
+ }
1710
+ this.logger.debug('[CONV-COMP] subscribeTypings data:', data);
1711
+ const userTyping = this.membersConversation.includes(key);
1712
+ if ( !userTyping && key) {
1713
+ this.isTypings = true;
1714
+ setTimeout(function () {
1715
+ that.scrollBottom(0)
1716
+ }, 0);
1717
+ // clearTimeout(this.setTimeoutWritingMessages);
1718
+ this.setTimeoutWritingMessages = setTimeout(() => {
1719
+ that.isTypings = false;
1720
+ }, waitTime);
1721
+ // this.initiTimeout(waitTime)
1722
+ }
1723
+ } catch (error) {
1724
+ this.logger.error('[CONV-COMP] error: ', error);
1725
+ }
1726
+
1727
+ }
1728
+
1729
+ initiTimeout(waitTime){
1730
+ const that = this;
1731
+ this.setTimeoutWritingMessages = setTimeout(() => {
1732
+ that.isTypings = false;
1733
+ }, waitTime);
1734
+ }
1735
+
1736
+ resetTimeout(){
1737
+ this.isTypings = false
1738
+ this.setTimeoutWritingMessages = null;
1739
+ clearTimeout(this.setTimeoutWritingMessages)
1740
+ }
1741
+
1742
+
1676
1743
  segmentNewAgentMessage(conversation: ConversationModel){
1677
1744
  let user = this.loggedUser
1678
1745
  try {
@@ -1719,7 +1786,7 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
1719
1786
  this.logger.error('Event:Message Sent [group] error', err);
1720
1787
  }
1721
1788
  }
1722
-
1789
+
1723
1790
  // -------------------------------------------------------------
1724
1791
  // DRAG FILE
1725
1792
  // -------------------------------------------------------------
@@ -1779,7 +1846,7 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
1779
1846
 
1780
1847
  async presentToastOnlyImageFilesAreAllowedToDrag() {
1781
1848
  const toast = await this.toastController.create({
1782
- message: this.translationMap.get('FAILED_TO_UPLOAD_THE_FORMAT_IS_NOT_SUPPORTED'),
1849
+ message: this.translationsMap.get('FAILED_TO_UPLOAD_THE_FORMAT_IS_NOT_SUPPORTED'),
1783
1850
  duration: 5000,
1784
1851
  color: 'danger',
1785
1852
  cssClass: 'toast-custom-class',
@@ -1,35 +1,38 @@
1
- <ion-header no-border class="ion-no-border">
2
- <app-ddp-header *ngIf="conversationType ==='active'"
1
+ <ion-header no-border class="ion-no-border" [class.mobile]="isMobile">
2
+ <header-conversations-list *ngIf="conversationType ==='active'"
3
3
  [numberOpenConv]="numberOpenConv"
4
4
  [supportMode]="supportMode"
5
5
  [archived_btn]="archived_btn"
6
6
  [writeto_btn]="writeto_btn"
7
7
  [sound_btn]="sound_btn"
8
+ [isMobile]="isMobile"
8
9
  (onSoundChange)="onSoundChange($event)"
9
10
  (openContactsDirectory)=openContactsDirectory($event)
10
11
  (openProfileInfo)=openProfileInfo($event)>
11
- </app-ddp-header>
12
+ </header-conversations-list>
12
13
 
13
- <app-option-header *ngIf="conversationType !=='active'"
14
+ <header-conversations-list-archived *ngIf="conversationType !=='active'"
14
15
  [headerTitle]=headerTitle
16
+ [isMobile]="isMobile"
15
17
  (onBackButton)=onBackButtonFN($event)>
16
- </app-option-header>
18
+ </header-conversations-list-archived>
17
19
  </ion-header>
20
+
18
21
  <!-- appScrollbarTheme -->
19
- <ion-content id="convs-list" #ioncontentconvlist class="list-avatar-page" >
22
+ <ion-content id="convs-list" #ioncontentconvlist class="list-avatar-page" [class.mobile]="isMobile">
20
23
  <!-- class="ps" style="position: relative; max-width: 600px; max-height: 100%;" [perfectScrollbar]="config" -->
21
24
  <div id="scrollbar2">
22
25
  <ion-list>
23
26
 
24
27
  <!-- supportMode && -->
25
- <ion-item *ngIf="displayNewConvsItem && conversationType !=='archived' && supportMode" class="ion-no-padding open-iframe-item">
28
+ <ion-item *ngIf="displayNewConvsItem && conversationType !=='archived' && supportMode" class="ion-no-padding open-iframe-item" lines="none">
26
29
  <div tabindex="0"></div>
27
30
  <!-- <ion-note class="pinned-project">
28
31
  {{ 'PINNED_PROJECT' | translate }}
29
32
  </ion-note> -->
30
33
 
31
34
  <app-project-item
32
- style="width: 100%;"
35
+ style="width: 100%; margin: 0px 8px; border-bottom: 1px dashed #d3dbe5;"
33
36
  (openUnsevedConvsEvent)="openUnsevedConversationIframe($event)"
34
37
  (projectIdEvent)="getLastProjectId($event)">
35
38
  </app-project-item>