@chat21/chat21-ionic 3.0.80-rc.1 → 3.0.80

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 (141) hide show
  1. package/CHANGELOG.md +4 -61
  2. package/README.md +2 -2
  3. package/package.json +2 -2
  4. package/src/app/app.component.html +1 -7
  5. package/src/app/app.component.scss +2 -18
  6. package/src/app/app.component.ts +15 -73
  7. package/src/app/app.module.ts +1 -3
  8. package/src/app/chatlib/conversation-detail/conversation-content/conversation-content.component.ts +1 -8
  9. package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.html +23 -75
  10. package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.scss +85 -162
  11. package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.ts +2 -39
  12. package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.html +19 -7
  13. package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.scss +10 -6
  14. package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.spec.ts +2 -2
  15. package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.ts +25 -16
  16. package/src/app/chatlib/conversation-detail/message/buttons/action-button/action-button.component.html +1 -5
  17. package/src/app/chatlib/conversation-detail/message/buttons/action-button/action-button.component.scss +15 -22
  18. package/src/app/chatlib/conversation-detail/message/buttons/action-button/action-button.component.ts +5 -25
  19. package/src/app/chatlib/conversation-detail/message/buttons/link-button/link-button.component.html +1 -2
  20. package/src/app/chatlib/conversation-detail/message/buttons/link-button/link-button.component.scss +15 -14
  21. package/src/app/chatlib/conversation-detail/message/buttons/link-button/link-button.component.ts +5 -24
  22. package/src/app/chatlib/conversation-detail/message/buttons/text-button/text-button.component.html +1 -6
  23. package/src/app/chatlib/conversation-detail/message/buttons/text-button/text-button.component.scss +13 -12
  24. package/src/app/chatlib/conversation-detail/message/buttons/text-button/text-button.component.ts +5 -26
  25. package/src/app/chatlib/conversation-detail/message/html/html.component.ts +1 -0
  26. package/src/app/chatlib/conversation-detail/message/info-message/info-message.component.scss +2 -2
  27. package/src/app/chatlib/conversation-detail/message/message-attachment/message-attachment.component.html +6 -16
  28. package/src/app/chatlib/conversation-detail/message/message-attachment/message-attachment.component.scss +3 -1
  29. package/src/app/chatlib/conversation-detail/message/message-attachment/message-attachment.component.ts +0 -2
  30. package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.html +52 -78
  31. package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.scss +20 -62
  32. package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.ts +10 -14
  33. package/src/app/components/canned-response/canned-response.component.html +5 -5
  34. package/src/app/components/canned-response/canned-response.component.scss +1 -1
  35. package/src/app/components/canned-response/canned-response.component.ts +0 -1
  36. package/src/app/components/contacts-directory/contacts-directory.component.html +26 -22
  37. package/src/app/components/contacts-directory/contacts-directory.component.scss +6 -8
  38. package/src/app/components/conversation-detail/bubble-day-message/bubble-day-message.component.html +3 -0
  39. package/src/app/components/conversation-detail/bubble-day-message/bubble-day-message.component.scss +21 -0
  40. package/src/app/components/conversation-detail/bubble-day-message/bubble-day-message.component.spec.ts +24 -0
  41. package/src/app/components/conversation-detail/bubble-day-message/bubble-day-message.component.ts +14 -0
  42. package/src/app/components/conversation-detail/bubble-my-message/bubble-my-message.component.html +54 -0
  43. package/src/app/components/conversation-detail/bubble-my-message/bubble-my-message.component.scss +98 -0
  44. package/src/app/components/{conversations-list/header-conversations-list/header-conversations-list.component.spec.ts → conversation-detail/bubble-my-message/bubble-my-message.component.spec.ts} +6 -6
  45. package/src/app/components/conversation-detail/bubble-my-message/bubble-my-message.component.ts +84 -0
  46. package/src/app/components/conversation-detail/bubble-others-message/bubble-others-message.component.html +30 -0
  47. package/src/app/components/conversation-detail/bubble-others-message/bubble-others-message.component.scss +83 -0
  48. package/src/app/components/conversation-detail/bubble-others-message/bubble-others-message.component.spec.ts +24 -0
  49. package/src/app/components/conversation-detail/bubble-others-message/bubble-others-message.component.ts +68 -0
  50. package/src/app/components/conversation-detail/bubble-system-message/bubble-system-message.component.html +3 -0
  51. package/src/app/components/conversation-detail/bubble-system-message/bubble-system-message.component.scss +10 -0
  52. package/src/app/components/conversation-detail/bubble-system-message/bubble-system-message.component.spec.ts +24 -0
  53. package/src/app/components/conversation-detail/bubble-system-message/bubble-system-message.component.ts +14 -0
  54. package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.html +42 -61
  55. package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.scss +61 -98
  56. package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.ts +25 -9
  57. package/src/app/components/conversation-detail/message-text-area/message-text-area.component.html +5 -6
  58. package/src/app/components/conversation-detail/message-text-area/message-text-area.component.scss +4 -4
  59. package/src/app/components/conversation-detail/message-text-area/message-text-area.component.ts +83 -4
  60. package/src/app/components/conversation-detail/option-header/option-header.component.html +13 -0
  61. package/src/app/components/conversation-detail/option-header/option-header.component.scss +0 -0
  62. package/src/app/components/{conversations-list/header-conversations-list-archived/header-conversations-list-archived.component.spec.ts → conversation-detail/option-header/option-header.component.spec.ts} +5 -5
  63. package/src/app/components/{conversations-list/header-conversations-list-archived/header-conversations-list-archived.component.ts → conversation-detail/option-header/option-header.component.ts} +4 -5
  64. package/src/app/components/conversation-info/info-content/info-content.component.html +1 -2
  65. package/src/app/components/conversation-info/info-content/info-content.component.ts +2 -3
  66. package/src/app/components/conversation-info/info-direct/info-direct.component.html +9 -1
  67. package/src/app/components/conversation-info/info-direct/info-direct.component.ts +2 -0
  68. package/src/app/components/conversation-info/info-group/info-group.component.html +108 -44
  69. package/src/app/components/conversation-info/info-group/info-group.component.scss +61 -101
  70. package/src/app/components/conversation-info/info-group/info-group.component.ts +0 -1
  71. package/src/app/components/{conversations-list/header-conversations-list/header-conversations-list.component.html → ddp-header/ddp-header.component.html} +3 -3
  72. package/src/app/components/{conversations-list/header-conversations-list/header-conversations-list.component.scss → ddp-header/ddp-header.component.scss} +4 -16
  73. package/src/app/components/{navbar/navbar.component.spec.ts → ddp-header/ddp-header.component.spec.ts} +6 -6
  74. package/src/app/components/{conversations-list/header-conversations-list/header-conversations-list.component.ts → ddp-header/ddp-header.component.ts} +16 -7
  75. package/src/app/components/project-item/project-item.component.html +149 -98
  76. package/src/app/components/project-item/project-item.component.scss +35 -42
  77. package/src/app/components/project-item/project-item.component.ts +4 -16
  78. package/src/app/components/sidebar-user-details/sidebar-user-details.component.html +3 -3
  79. package/src/app/components/sidebar-user-details/sidebar-user-details.component.ts +7 -2
  80. package/src/app/components/utils/user-presence/user-presence.component.html +2 -7
  81. package/src/app/components/utils/user-presence/user-presence.component.scss +18 -35
  82. package/src/app/components/utils/user-presence/user-presence.component.ts +10 -6
  83. package/src/app/pages/contacts-directory/contacts-directory.page.html +1 -1
  84. package/src/app/pages/contacts-directory/contacts-directory.page.scss +0 -41
  85. package/src/app/pages/contacts-directory/contacts-directory.page.ts +0 -2
  86. package/src/app/pages/conversation-detail/conversation-detail.module.ts +8 -0
  87. package/src/app/pages/conversation-detail/conversation-detail.page.html +23 -40
  88. package/src/app/pages/conversation-detail/conversation-detail.page.scss +250 -40
  89. package/src/app/pages/conversation-detail/conversation-detail.page.ts +84 -190
  90. package/src/app/pages/conversations-list/conversations-list.page.html +8 -11
  91. package/src/app/pages/conversations-list/conversations-list.page.scss +2 -11
  92. package/src/app/pages/conversations-list/conversations-list.page.ts +22 -25
  93. package/src/app/pages/create-canned-response/create-canned-response.page.ts +13 -13
  94. package/src/app/pages/loader-preview/loader-preview.page.html +1 -1
  95. package/src/app/pages/loader-preview/loader-preview.page.scss +0 -4
  96. package/src/app/pages/loader-preview/loader-preview.page.ts +2 -1
  97. package/src/app/pages/profile-info/profile-info.page.html +4 -2
  98. package/src/app/pages/unassigned-conversations/unassigned-conversations.page.html +1 -1
  99. package/src/app/pages/unassigned-conversations/unassigned-conversations.page.scss +0 -42
  100. package/src/app/pages/unassigned-conversations/unassigned-conversations.page.ts +0 -1
  101. package/src/app/services/canned-responses/canned-responses.service.ts +0 -26
  102. package/src/app/services/tiledesk/tiledesk.service.ts +25 -1
  103. package/src/app/shared/shared.module.ts +33 -24
  104. package/src/assets/i18n/ar.json +265 -278
  105. package/src/assets/i18n/az.json +1 -14
  106. package/src/assets/i18n/de.json +2 -15
  107. package/src/assets/i18n/en.json +2 -15
  108. package/src/assets/i18n/es.json +2 -15
  109. package/src/assets/i18n/fr.json +1 -14
  110. package/src/assets/i18n/it.json +1 -14
  111. package/src/assets/i18n/kk.json +2 -15
  112. package/src/assets/i18n/pt.json +2 -15
  113. package/src/assets/i18n/ru.json +1 -14
  114. package/src/assets/i18n/sr.json +264 -277
  115. package/src/assets/i18n/sv.json +2 -15
  116. package/src/assets/i18n/tr.json +2 -15
  117. package/src/assets/i18n/uk.json +2 -15
  118. package/src/assets/i18n/uz.json +1 -14
  119. package/src/chat21-core/models/conversation.ts +1 -0
  120. package/src/chat21-core/providers/firebase/firebase-typing.service.ts +9 -7
  121. package/src/chat21-core/utils/constants.ts +1 -5
  122. package/src/chat21-core/utils/user-typing/user-typing.component.html +5 -8
  123. package/src/chat21-core/utils/user-typing/user-typing.component.scss +17 -87
  124. package/src/chat21-core/utils/user-typing/user-typing.component.ts +94 -12
  125. package/src/chat21-core/utils/utils.ts +10 -38
  126. package/src/global.scss +57 -48
  127. package/src/index.html +2 -2
  128. package/src/variables.scss +10 -30
  129. package/deploy_amazon_beta.sh +0 -29
  130. package/deploy_amazon_prod.sh +0 -30
  131. package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component_2.html +0 -116
  132. package/src/app/components/conversations-list/header-conversations-list-archived/header-conversations-list-archived.component.html +0 -12
  133. package/src/app/components/conversations-list/header-conversations-list-archived/header-conversations-list-archived.component.scss +0 -14
  134. package/src/app/components/navbar/navbar.component.html +0 -103
  135. package/src/app/components/navbar/navbar.component.scss +0 -249
  136. package/src/app/components/navbar/navbar.component.ts +0 -189
  137. package/src/app/services/projects/projects.service.spec.ts +0 -12
  138. package/src/app/services/projects/projects.service.ts +0 -43
  139. package/src/assets/sounds/wheep-wheep.mp3 +0 -0
  140. package/src/chat21-core/models/projects.ts +0 -27
  141. package/src/chat21-core/utils/convertRequestToConversation.ts +0 -41
@@ -1,5 +1,5 @@
1
1
  import { TYPE_DIRECT } from 'src/chat21-core/utils/constants';
2
- import { URL_SOUND_LIST_CONVERSATION } from './../../../chat21-core/utils/constants'
2
+ import { TYPE_SUPPORT_GROUP, URL_SOUND_LIST_CONVERSATION } from './../../../chat21-core/utils/constants'
3
3
  import {
4
4
  Component,
5
5
  OnInit,
@@ -115,14 +115,16 @@ 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
118
119
  public isMobile = false
119
120
  public isLessThan991px = false // nk added
121
+ public isTyping = false
122
+ public nameUserTypingNow: string
120
123
 
121
124
  public heightMessageTextArea = ''
122
- public translationsMap: Map<string, string> = new Map()
123
- public translationsHeaderMap: Map<string, string> = new Map()
124
- public translationsContentMap: Map<string, string> = new Map()
125
+ public translationMap: Map<string, string>
125
126
  public conversationAvatar: any
127
+ public membersConversation: any
126
128
  public member: UserModel
127
129
  public urlConversationSupportGroup: any
128
130
  public isFileSelected: boolean
@@ -148,6 +150,7 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
148
150
  //SOUND
149
151
  setTimeoutSound: any;
150
152
  audio: any;
153
+ isOpenInfoConversation: boolean;
151
154
  USER_HAS_OPENED_CLOSE_INFO_CONV: boolean = false;
152
155
  isHovering: boolean = false;
153
156
  conversation_count: number;
@@ -169,15 +172,6 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
169
172
  public disableTextarea: boolean;
170
173
  appsidebarIsWide: boolean;
171
174
 
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
-
181
175
  /**
182
176
  * Constructor
183
177
  * @param route
@@ -246,7 +240,21 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
246
240
  // -----------------------------------------------------------
247
241
  ngOnInit() {
248
242
  this.logger.log('[CONVS-DETAIL] > ngOnInit - window.location: ', window.location);
249
-
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
+ // });
250
258
  this.getConversations();
251
259
  this.watchToConnectionStatus();
252
260
  this.getOSCODE();
@@ -267,21 +275,21 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
267
275
  // console.log('[CONVS-DETAIL] HAS CLICKED ENLARGE SIDEBAR WIDE chatAreaEle ', chatAreaEle)
268
276
 
269
277
  if (event && event.data && event.data.action && event.data.action === 'openAppsSidebarWideMode' && event.data.parameter === true) {
270
- this.logger.log('[CONVS-DETAIL] openAppsSidebarWideMode EVENT-> open' )
278
+ this.logger.log('[CONVS-DETAIL] HERE YES 1')
271
279
  this.appsidebarIsWide = true
272
280
  // chat21InfoConversationEle.classList.add("info-convs-apps-sidebar-wide");
273
281
  // chatAreaEle.classList.add("chat-area-apps-sidebar-wide");
274
282
  }
275
283
 
276
284
  if (event && event.data && event.data.action && event.data.action === 'openAppsSidebarWideMode' && event.data.parameter === false) {
277
- this.logger.log('[CONVS-DETAIL] openAppsSidebarWideMode EVENT-> close')
285
+ this.logger.log('[CONVS-DETAIL] HERE YES 2')
278
286
  this.appsidebarIsWide = false
279
287
  // chat21InfoConversationEle.classList.remove("info-convs-apps-sidebar-wide");
280
288
  // chatAreaEle.classList.remove("chat-area-apps-sidebar-wide");
281
289
  }
282
290
 
283
291
  if (event && event.data && event.data.action && event.data.action === 'closeAppsSidebarWideMode' && event.data.parameter === true) {
284
- this.logger.log('[CONVS-DETAIL] closeAppsSidebarWideMode EVENT-> close')
292
+ this.logger.log('[CONVS-DETAIL] HERE YES 3')
285
293
  this.appsidebarIsWide = false
286
294
  // chat21InfoConversationEle.classList.remove("info-convs-apps-sidebar-wide");
287
295
  // chatAreaEle.classList.remove("chat-area-apps-sidebar-wide");
@@ -331,12 +339,7 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
331
339
  // this.updateConversationBadge()
332
340
  // }
333
341
  if(conv.uid && conv.uid === this.conversationWith){
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'])
342
+ this.conversationAvatar = setConversationAvatar(conv.conversation_with,conv.conversation_with_fullname,conv.channel_type)
340
343
  }
341
344
 
342
345
  }
@@ -474,7 +477,6 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
474
477
  this.loggedUser = this.tiledeskAuthService.getCurrentUser()
475
478
  this.logger.log('[CONVS-DETAIL] - initialize -> loggedUser: ', this.loggedUser)
476
479
  this.translations()
477
- this.setStyleMap()
478
480
  // this.conversationSelected = localStorage.getItem('conversationSelected');
479
481
  this.showButtonToBottom = false
480
482
  this.showMessageWelcome = false
@@ -489,6 +491,7 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
489
491
 
490
492
  this.messages = [] // list messages of conversation
491
493
  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
492
495
 
493
496
  if (checkPlatformIsMobile()) {
494
497
  this.isMobile = true
@@ -504,11 +507,13 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
504
507
  if (checkWindowWidthIsLessThan991px()) {
505
508
  this.logger.log('[CONVS-DETAIL] - initialize -> checkWindowWidthIsLessThan991px ', checkWindowWidthIsLessThan991px())
506
509
  this.openInfoConversation = false // indica se è aperto il box info conversazione
507
- this.logger.log('[CONVS-DETAIL] - initialize -> openInfoConversation ', this.openInfoConversation)
510
+ this.isOpenInfoConversation = false
511
+ this.logger.log('[CONVS-DETAIL] - initialize -> openInfoConversation ', this.openInfoConversation, ' -> isOpenInfoConversation ', this.isOpenInfoConversation)
508
512
  } else {
509
513
  this.logger.log('[CONVS-DETAIL] - initialize -> checkWindowWidthIsLessThan991px ', checkWindowWidthIsLessThan991px())
510
514
  this.openInfoConversation = true
511
- this.logger.log('[CONVS-DETAIL] - initialize -> openInfoConversation ', this.openInfoConversation)
515
+ this.isOpenInfoConversation = true
516
+ this.logger.log('[CONVS-DETAIL] - initialize -> openInfoConversation ', this.openInfoConversation, ' -> isOpenInfoConversation ', this.isOpenInfoConversation)
512
517
  }
513
518
  }
514
519
 
@@ -527,8 +532,6 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
527
532
  this.addEventsKeyboard()
528
533
  this.startConversation()
529
534
  this.updateConversationBadge() // AGGIORNO STATO DELLA CONVERSAZIONE A 'LETTA' (is_new = false)
530
-
531
- this.initializeTyping();
532
535
  }
533
536
 
534
537
  _getProjectIdByConversationWith(conversationWith: string) {
@@ -563,12 +566,22 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
563
566
  })
564
567
  }
565
568
 
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
+
566
578
  @HostListener('window:resize', ['$event'])
567
579
  onResize(event: any) {
568
580
  const newInnerWidth = event.target.innerWidth
569
581
  if (newInnerWidth < 991) {
570
582
  if (this.USER_HAS_OPENED_CLOSE_INFO_CONV === false) {
571
583
  this.openInfoConversation = false
584
+ this.isOpenInfoConversation = false
572
585
  }
573
586
  }
574
587
  }
@@ -587,7 +600,7 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
587
600
  'LABEL_TO',
588
601
  'LABEL_LAST_ACCESS',
589
602
  'ARRAY_DAYS',
590
-
603
+ 'LABEL_IS_WRITING',
591
604
  'LABEL_INFO_ADVANCED',
592
605
  'ID_CONVERSATION',
593
606
  'UPLOAD_FILE_ERROR',
@@ -606,35 +619,11 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
606
619
  'THERE_ARE_NO_CANNED_RESPONSES_AVAILABLE',
607
620
  'TO_CREATE_THEM_GO_TO_THE_PROJECT',
608
621
  "AddNewCannedResponse",
609
- "LABEL_LOADING",
610
- "DIRECT_CHAT",
611
- "GROUP_CHAT",
612
- ]
613
-
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',
622
+ "LABEL_LOADING"
626
623
  ]
627
624
 
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)
625
+ this.translationMap = this.customTranslateService.translateLanguage(keys)
626
+ this.logger.log('[CONVS-DETAIL] x this.translationMap ',this.translationMap)
638
627
  }
639
628
 
640
629
  // --------------------------------------------------------
@@ -661,19 +650,6 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
661
650
  return this.customTranslateService.translateLanguage(keys)
662
651
  }
663
652
 
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
- }
677
653
  // -------------------------------------------------------------------------------------
678
654
  // * retrieving the handler from chatManager
679
655
  // * if it DOESN'T EXIST I create a handler and connect and store it in the chatmanager
@@ -763,18 +739,6 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
763
739
  }
764
740
  }
765
741
 
766
- onConversationLoaded(conversation): ConversationModel{
767
- if(conversation.attributes && conversation.attributes['projectId']){
768
- let project = localStorage.getItem(conversation.attributes['projectId'])
769
- if(project){
770
- project = JSON.parse(project)
771
- conversation.attributes.project_name = project['name']
772
- }
773
-
774
- }
775
- return conversation
776
- }
777
-
778
742
  setHeaderContent() {
779
743
  // this.logger.log('[CONVS-DETAIL] - setHeaderContent conversationWith', this.conversationWith)
780
744
  // this.logger.log('[CONVS-DETAIL] - setHeaderContent conversationsHandlerService', this.conversationsHandlerService)
@@ -789,8 +753,6 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
789
753
  conv.conversation_with,
790
754
  conv.conversation_with_fullname,
791
755
  conv.channel_type,
792
- conv.attributes['projectId'],
793
- conv.attributes['project_name']
794
756
  )
795
757
  }
796
758
  if(!conv){
@@ -804,8 +766,6 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
804
766
  conv.conversation_with,
805
767
  conv.conversation_with_fullname,
806
768
  conv.channel_type,
807
- conv.attributes['projectId'],
808
- conv.attributes['project_name']
809
769
  )
810
770
  let duration = getDateDifference(conv.timestamp, Date.now())
811
771
  duration.days > 10? this.disableTextarea = true: this.disableTextarea = false
@@ -824,8 +784,6 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
824
784
  conv.conversation_with,
825
785
  conv.conversation_with_fullname,
826
786
  conv.channel_type,
827
- conv.attributes['projectId'],
828
- conv.attributes['project_name']
829
787
  )
830
788
  let duration = getDateDifference(conv.timestamp, Date.now())
831
789
  duration.days > 10? this.disableTextarea = true: this.disableTextarea = false
@@ -838,8 +796,6 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
838
796
  conv.conversation_with,
839
797
  conv.conversation_with_fullname,
840
798
  conv.channel_type,
841
- conv.attributes['projectId'],
842
- conv.attributes['project_name']
843
799
  )
844
800
  }
845
801
  this.logger.log('[CONVS-DETAIL] - setHeaderContent > conversationAvatar: ', this.conversationAvatar)
@@ -1029,22 +985,6 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
1029
985
  this.subscriptions.push(subscribe)
1030
986
  }
1031
987
 
1032
- subscriptionKey = 'conversationTyping';
1033
- subscription = this.subscriptions.find(item => item.key === subscriptionKey);
1034
- if (!subscription) {
1035
- subscription = this.typingService.BSIsTyping.pipe(takeUntil(this.unsubscribe$)).subscribe((data: any) => {
1036
- this.logger.debug('[CONVS-DETAIL] ***** BSIsTyping *****', data);
1037
- if (data) {
1038
- const isTypingUid = data.uid; //support-group-...
1039
- if (this.conversationWith === isTypingUid) {
1040
- that.subscribeTypings(data);
1041
- }
1042
- }
1043
- });
1044
- const subscribe = {key: subscriptionKey, value: subscription };
1045
- this.subscriptions.push(subscribe);
1046
- }
1047
-
1048
988
  // subscriptionKey = 'onGroupChange';
1049
989
  // subscription = this.subscriptions.find(item => item.key === subscriptionKey);
1050
990
  // if (!subscription) {
@@ -1065,6 +1005,18 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
1065
1005
  // }
1066
1006
  }
1067
1007
 
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
+
1068
1020
  // -------------------------------------------------
1069
1021
  // addEventsKeyboard
1070
1022
  // -------------------------------------------------
@@ -1092,9 +1044,7 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
1092
1044
  this.conversationAvatar = setConversationAvatar(
1093
1045
  this.conversationWith,
1094
1046
  this.conversationWithFullname,
1095
- this.channelType,
1096
- this.conversation.attributes['projectId'],
1097
- this.conversation.attributes['project_name']
1047
+ this.channelType
1098
1048
  )
1099
1049
 
1100
1050
  }
@@ -1271,17 +1221,13 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
1271
1221
  this.logger.log('[CONVS-DETAIL] - returnChangeTextArea --> beforeSlash', beforeSlash)
1272
1222
  this.logger.log('[CONVS-DETAIL] - returnChangeTextArea --> afterSlash', afterSlash)
1273
1223
 
1274
- console.log('bbbbbbb', beforeSlash[beforeSlash.length-1].indexOf(' '), afterSlash === '', this.HIDE_CANNED_RESPONSES)
1275
1224
 
1276
1225
  if(beforeSlash[beforeSlash.length-1].indexOf(' ') >= 0 && afterSlash === ''){
1277
1226
  this.HIDE_CANNED_RESPONSES = false
1278
- console.log('bbbbbbb 1111', beforeSlash[beforeSlash.length-1])
1279
1227
  } else if(beforeSlash[beforeSlash.length-1].indexOf(' ') < 0 && afterSlash === '' ){
1280
1228
  this.HIDE_CANNED_RESPONSES = true
1281
- console.log('bbbbbbb 22222', beforeSlash[beforeSlash.length-1])
1282
1229
  } else if(beforeSlash[beforeSlash.length-1].indexOf(' ') >= 0 && afterSlash === ' '){
1283
1230
  this.HIDE_CANNED_RESPONSES = true
1284
- console.log('bbbbbbb 33333', beforeSlash[beforeSlash.length-1])
1285
1231
  // this.tagsCannedFilter = []
1286
1232
  }
1287
1233
  }
@@ -1336,18 +1282,23 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
1336
1282
  this.logger.log('[CONVS-DETAIL] replaceTagInMessage canned text ', canned.text)
1337
1283
 
1338
1284
  // replace text
1339
- var strTEMP = textArea.value.replace(/\/$/ig, canned.text)
1285
+ var strTEMP = textArea.value.replace(/\/.*/ig, canned.text)
1340
1286
  strTEMP = this.replacePlaceholderInCanned(strTEMP)
1341
- this.logger.log('[CONVS-DETAIL] replaceTagInMessage strSearch ', strTEMP)
1287
+ this.logger.log('[CONVS-DETAIL] replaceTagInMessage strSearch before', strTEMP, textArea)
1342
1288
  // strTEMP = this.replacePlaceholderInCanned(strTEMP);
1343
1289
  // textArea.value = '';
1344
1290
  // that.messageString = strTEMP;
1345
1291
  textArea.value = strTEMP
1346
- setTimeout(() => {
1347
- // textArea.focus();
1348
- textArea.setFocus()
1349
- // this.resizeTextArea()
1350
- }, 200)
1292
+ this.logger.log('[CONVS-DETAIL] replaceTagInMessage strSearch after', strTEMP, textArea)
1293
+ this.insertAtCursor(textArea, '')
1294
+ this.setCaretPosition(textArea)
1295
+ // setTimeout(() => {
1296
+ // // textArea.focus();
1297
+ // textArea.selectionEnd = textArea.value.length;
1298
+ // textArea.setFocus()
1299
+ // // this.resizeTextArea()
1300
+ // // this.setCaretPosition(textArea)
1301
+ // }, 200)
1351
1302
 
1352
1303
  }
1353
1304
 
@@ -1571,13 +1522,6 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
1571
1522
  }
1572
1523
  }
1573
1524
 
1574
- onOpenCloseInfoConversation(event){
1575
- this.logger.log('[CONVS-DETAIL] onOpenCloseInfoConversation - openInfoConversation ', event)
1576
- this.resizeTextArea()
1577
- this.openInfoConversation = event
1578
- this.USER_HAS_OPENED_CLOSE_INFO_CONV = true
1579
- }
1580
-
1581
1525
  // -------------- START SCROLL/RESIZE -------------- //
1582
1526
  /** */
1583
1527
  resizeTextArea() {
@@ -1679,7 +1623,6 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
1679
1623
  this.heightMessageTextArea = '57' // NK edited
1680
1624
  }
1681
1625
  }
1682
-
1683
1626
  checkAcceptedFile(draggedFileMimeType) {
1684
1627
  let isAcceptFile = false
1685
1628
  this.logger.log('[CONVS-DETAIL] > checkAcceptedFile - fileUploadAccept: ',this.appConfigProvider.getConfig().fileUploadAccept)
@@ -1701,17 +1644,26 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
1701
1644
  if (accept_file_segment[1] === '*') {
1702
1645
  if (draggedFileMimeType.startsWith(accept_file_segment[0])) {
1703
1646
  isAcceptFile = true
1704
- this.logger.log('[CONVS-DETAIL] > checkAcceptedFile - fileUploadAccept isAcceptFile',isAcceptFile)
1647
+ this.logger.log(
1648
+ '[CONVS-DETAIL] > checkAcceptedFile - fileUploadAccept isAcceptFile',
1649
+ isAcceptFile,
1650
+ )
1705
1651
  return isAcceptFile
1706
1652
  } else {
1707
1653
  isAcceptFile = false
1708
- this.logger.log('[CONVS-DETAIL] > checkAcceptedFile - fileUploadAccept isAcceptFile',isAcceptFile)
1654
+ this.logger.log(
1655
+ '[CONVS-DETAIL] > checkAcceptedFile - fileUploadAccept isAcceptFile',
1656
+ isAcceptFile,
1657
+ )
1709
1658
  return isAcceptFile
1710
1659
  }
1711
1660
  } else if (accept_file_segment[1] !== '*') {
1712
1661
  if (draggedFileMimeType === accept_file) {
1713
1662
  isAcceptFile = true
1714
- this.logger.log('[CONVS-DETAIL] > checkAcceptedFile - fileUploadAccept isAcceptFile',isAcceptFile)
1663
+ this.logger.log(
1664
+ '[CONVS-DETAIL] > checkAcceptedFile - fileUploadAccept isAcceptFile',
1665
+ isAcceptFile,
1666
+ )
1715
1667
  return isAcceptFile
1716
1668
  }
1717
1669
  }
@@ -1721,64 +1673,6 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
1721
1673
  }
1722
1674
  }
1723
1675
 
1724
-
1725
- initializeTyping() {
1726
- this.logger.debug('[CONVS-DETAIL] membersconversation', this.membersConversation)
1727
- if(this.loggedUser){
1728
- this.membersConversation.push(this.loggedUser.uid)
1729
- //this.setSubscriptions();
1730
- this.typingService.isTyping(this.conversationWith, this.loggedUser.uid, this.isDirect);
1731
- }
1732
- }
1733
-
1734
- /** */
1735
- subscribeTypings(data: any) {
1736
- const that = this;
1737
- try {
1738
- const key = data.uidUserTypingNow;
1739
- const waitTime = data.waitTime
1740
- this.nameUserTypingNow = null;
1741
- this.idUserTypingNow = null;
1742
-
1743
- if (data.nameUserTypingNow) {
1744
- this.nameUserTypingNow = data.nameUserTypingNow;
1745
- }
1746
- if (data.uidUserTypingNow){
1747
- this.idUserTypingNow = data.uidUserTypingNow
1748
- }
1749
- this.logger.debug('[CONV-COMP] subscribeTypings data:', data);
1750
- const userTyping = this.membersConversation.includes(key);
1751
- if ( !userTyping && key) {
1752
- this.isTypings = true;
1753
- setTimeout(function () {
1754
- that.scrollBottom(0)
1755
- }, 0);
1756
- // clearTimeout(this.setTimeoutWritingMessages);
1757
- this.setTimeoutWritingMessages = setTimeout(() => {
1758
- that.isTypings = false;
1759
- }, waitTime);
1760
- // this.initiTimeout(waitTime)
1761
- }
1762
- } catch (error) {
1763
- this.logger.error('[CONV-COMP] error: ', error);
1764
- }
1765
-
1766
- }
1767
-
1768
- initiTimeout(waitTime){
1769
- const that = this;
1770
- this.setTimeoutWritingMessages = setTimeout(() => {
1771
- that.isTypings = false;
1772
- }, waitTime);
1773
- }
1774
-
1775
- resetTimeout(){
1776
- this.isTypings = false
1777
- this.setTimeoutWritingMessages = null;
1778
- clearTimeout(this.setTimeoutWritingMessages)
1779
- }
1780
-
1781
-
1782
1676
  segmentNewAgentMessage(conversation: ConversationModel){
1783
1677
  let user = this.loggedUser
1784
1678
  try {
@@ -1825,7 +1719,7 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
1825
1719
  this.logger.error('Event:Message Sent [group] error', err);
1826
1720
  }
1827
1721
  }
1828
-
1722
+
1829
1723
  // -------------------------------------------------------------
1830
1724
  // DRAG FILE
1831
1725
  // -------------------------------------------------------------
@@ -1885,7 +1779,7 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
1885
1779
 
1886
1780
  async presentToastOnlyImageFilesAreAllowedToDrag() {
1887
1781
  const toast = await this.toastController.create({
1888
- message: this.translationsMap.get('FAILED_TO_UPLOAD_THE_FORMAT_IS_NOT_SUPPORTED'),
1782
+ message: this.translationMap.get('FAILED_TO_UPLOAD_THE_FORMAT_IS_NOT_SUPPORTED'),
1889
1783
  duration: 5000,
1890
1784
  color: 'danger',
1891
1785
  cssClass: 'toast-custom-class',
@@ -1,38 +1,35 @@
1
- <ion-header no-border class="ion-no-border" [class.mobile]="isMobile">
2
- <header-conversations-list *ngIf="conversationType ==='active'"
1
+ <ion-header no-border class="ion-no-border">
2
+ <app-ddp-header *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"
9
8
  (onSoundChange)="onSoundChange($event)"
10
9
  (openContactsDirectory)=openContactsDirectory($event)
11
10
  (openProfileInfo)=openProfileInfo($event)>
12
- </header-conversations-list>
11
+ </app-ddp-header>
13
12
 
14
- <header-conversations-list-archived *ngIf="conversationType !=='active'"
13
+ <app-option-header *ngIf="conversationType !=='active'"
15
14
  [headerTitle]=headerTitle
16
- [isMobile]="isMobile"
17
15
  (onBackButton)=onBackButtonFN($event)>
18
- </header-conversations-list-archived>
16
+ </app-option-header>
19
17
  </ion-header>
20
-
21
18
  <!-- appScrollbarTheme -->
22
- <ion-content id="convs-list" #ioncontentconvlist class="list-avatar-page" [class.mobile]="isMobile">
19
+ <ion-content id="convs-list" #ioncontentconvlist class="list-avatar-page" >
23
20
  <!-- class="ps" style="position: relative; max-width: 600px; max-height: 100%;" [perfectScrollbar]="config" -->
24
21
  <div id="scrollbar2">
25
22
  <ion-list>
26
23
 
27
24
  <!-- supportMode && -->
28
- <ion-item *ngIf="displayNewConvsItem && conversationType !=='archived' && supportMode" class="ion-no-padding open-iframe-item" lines="none">
25
+ <ion-item *ngIf="displayNewConvsItem && conversationType !=='archived' && supportMode" class="ion-no-padding open-iframe-item">
29
26
  <div tabindex="0"></div>
30
27
  <!-- <ion-note class="pinned-project">
31
28
  {{ 'PINNED_PROJECT' | translate }}
32
29
  </ion-note> -->
33
30
 
34
31
  <app-project-item
35
- style="width: 100%; margin: 0px 8px; border-bottom: 1px dashed #d3dbe5;"
32
+ style="width: 100%;"
36
33
  (openUnsevedConvsEvent)="openUnsevedConversationIframe($event)"
37
34
  (projectIdEvent)="getLastProjectId($event)">
38
35
  </app-project-item>
@@ -4,10 +4,6 @@ ion-header {
4
4
  border-bottom-style: solid;
5
5
  border-color: var(--light-gray);
6
6
  border-bottom-width: thin;
7
- &:not(.mobile){
8
- border: none;
9
- background: var(--list-bkg-color);
10
- }
11
7
  }
12
8
 
13
9
  ion-content {
@@ -15,9 +11,6 @@ ion-content {
15
11
  --offset-bottom: auto!important;
16
12
  --overflow: hidden;
17
13
  overflow: scroll;
18
- &:not(.mobile){
19
- background: var(--list-bkg-color);
20
- }
21
14
 
22
15
  &::-webkit-scrollbar {
23
16
  width: 6px;
@@ -47,11 +40,10 @@ ion-list {
47
40
  list-style-type: none;
48
41
  margin: 0;
49
42
  padding: 0;
50
- background: transparent;
51
43
 
52
44
  ion-item {
53
45
  cursor: pointer;
54
- // height: 64px;
46
+ height: 64px;
55
47
  position: relative;
56
48
  display: flex;
57
49
  text-decoration: none;
@@ -59,7 +51,6 @@ ion-list {
59
51
  padding-right: 8px;
60
52
  --padding-start: 0;
61
53
  --inner-padding-end: 0;
62
- --background: transparent;
63
54
  .selected {
64
55
  border-radius: 10px;
65
56
  padding-left: 8px;
@@ -333,7 +324,7 @@ ion-list {
333
324
  padding-left: 0px !important ;
334
325
  padding-right: 0px !important;
335
326
  // height: 55px !important;
336
- // border-bottom: 1px solid rgba(0, 0, 0, 0.05);
327
+ border-bottom: 1px solid rgba(0, 0, 0, 0.05);
337
328
  --background-hover: #ffffff;
338
329
  cursor:default !important;
339
330
  }