@chat21/chat21-ionic 3.0.63 → 3.0.64-rc1

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 (28) hide show
  1. package/CHANGELOG.md +7 -1
  2. package/deploy_prod.sh +5 -5
  3. package/package.json +6 -1
  4. package/src/app/app.component.ts +45 -59
  5. package/src/app/app.module.ts +1 -0
  6. package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.html +2 -2
  7. package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.scss +0 -1
  8. package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.ts +2 -39
  9. package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.html +18 -6
  10. package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.ts +2 -2
  11. package/src/app/chatlib/conversation-detail/message/html/html.component.html +1 -0
  12. package/src/app/chatlib/conversation-detail/message/html/html.component.scss +79 -0
  13. package/src/app/chatlib/conversation-detail/message/html/html.component.spec.ts +25 -0
  14. package/src/app/chatlib/conversation-detail/message/html/html.component.ts +33 -0
  15. package/src/app/components/conversation-detail/message-text-area/message-text-area.component.html +2 -2
  16. package/src/app/components/conversation-detail/message-text-area/message-text-area.component.ts +2 -2
  17. package/src/app/directives/safe-html.pipe.ts +2 -2
  18. package/src/app/pages/conversation-detail/conversation-detail.page.html +4 -2
  19. package/src/app/pages/conversation-detail/conversation-detail.page.ts +12 -23
  20. package/src/app/pages/conversations-list/conversations-list.page.html +21 -12
  21. package/src/app/pages/conversations-list/conversations-list.page.ts +58 -191
  22. package/src/app/pages/loader-preview/loader-preview.module.ts +1 -2
  23. package/src/app/shared/shared.module.ts +4 -0
  24. package/src/assets/js/chat21client.js +1 -1
  25. package/src/chat21-core/models/conversation.ts +1 -1
  26. package/src/chat21-core/providers/abstract/conversations-handler.service.ts +1 -1
  27. package/src/chat21-core/providers/firebase/firebase-conversations-handler.ts +65 -9
  28. package/src/chat21-core/utils/utils-message.ts +5 -6
@@ -46,7 +46,7 @@ export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChange
46
46
  @Input() tagsCannedFilter: any = [];
47
47
  @Input() tagsCannedCount: number;
48
48
  @Input() areVisibleCAR: boolean;
49
- @Input() support_mode: boolean;
49
+ @Input() supportMode: boolean;
50
50
  @Input() events: Observable<void>;
51
51
  @Input() fileUploadAccept: string
52
52
  @Input() isOpenInfoConversation: boolean;
@@ -157,7 +157,7 @@ export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChange
157
157
  } else {
158
158
  this.IS_SUPPORT_GROUP_CONVERSATION = false
159
159
  }
160
- this.logger.log('[CONVS-DETAIL][MSG-TEXT-AREA] ngOnChanges support_mode ', this.support_mode)
160
+ this.logger.log('[CONVS-DETAIL][MSG-TEXT-AREA] ngOnChanges supportMode ', this.supportMode)
161
161
  this.logger.log('[CONVS-DETAIL][MSG-TEXT-AREA] ngOnChanges disableTextarea ', this.disableTextarea)
162
162
  this.logger.log("[CONVS-DETAIL][MSG-TEXT-AREA] ngOnChanges DROP EVENT ", this.dropEvent);
163
163
  this.logger.log("[CONVS-DETAIL][MSG-TEXT-AREA] ngOnChanges tagsCannedFilter ", this.tagsCannedFilter);
@@ -8,8 +8,8 @@ export class SafeHtmlPipe implements PipeTransform {
8
8
 
9
9
  transform(html) {
10
10
  // console.log('SafeHtmlPipe html ', html)
11
- // return this.sanitizer.bypassSecurityTrustHtml(html);
12
- return this.sanitizer.bypassSecurityTrustResourceUrl(html);
11
+ // return this.sanitizer.bypassSecurityTrustResourceUrl(html);
12
+ return this.sanitizer.bypassSecurityTrustHtml(html);
13
13
 
14
14
  }
15
15
 
@@ -122,7 +122,9 @@
122
122
  [channelType]="channelType"
123
123
  [messages]="messages"
124
124
  [senderId]="loggedUser.uid"
125
- [baseLocation]="window?.location?.origin"
125
+ [baseLocation]="window?.location?.origin"
126
+ [areVisibleCAR]="areVisibleCAR"
127
+ [supportMode]= "supportMode"
126
128
  [stylesMap]="styleMap"
127
129
  (onBeforeMessageRender)="returnOnBeforeMessageRender($event)"
128
130
  (onAfterMessageRender)="returnOnAfterMessageRender($event)"
@@ -176,7 +178,7 @@
176
178
  <app-message-text-area *ngIf="(openInfoConversation === false && isMobile === true) || (openInfoConversation === true && isMobile === false) || (openInfoConversation === false && isMobile === false)"
177
179
  [tagsCannedCount]="tagsCannedCount"
178
180
  [areVisibleCAR]="areVisibleCAR"
179
- [support_mode]="support_mode"
181
+ [supportMode]="supportMode"
180
182
  [loggedUser]="loggedUser"
181
183
  [conversationWith]="conversationWith"
182
184
  [tagsCannedFilter]="tagsCannedFilter"
@@ -143,7 +143,7 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
143
143
  arrowkeyLocation = -1
144
144
  public_Key: any;
145
145
  areVisibleCAR: boolean;
146
- support_mode: boolean;
146
+ supportMode: boolean;
147
147
  //SOUND
148
148
  setTimeoutSound: any;
149
149
  audio: any;
@@ -313,7 +313,6 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
313
313
  const conversations = this.conversationsHandlerService.conversations
314
314
  // console.log('[CONVS-DETAIL] conversations', conversations);
315
315
  this.conversation_count = conversations.length
316
- this.logger.log('[CONVS-DETAIL] conversation_count', this.conversation_count)
317
316
  })
318
317
 
319
318
  this.conversationsHandlerService.conversationChanged.subscribe((conv) => {
@@ -321,7 +320,6 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
321
320
  const conversations = this.conversationsHandlerService.conversations
322
321
  // console.log('[CONVS-DETAIL] conversations', conversations);
323
322
  this.conversation_count = conversations.length
324
- this.logger.log('[CONVS-DETAIL] conversation_count', this.conversation_count)
325
323
  if (conv && conv.sender !== this.loggedUser.uid) {
326
324
  this.logger.log('[CONVS-DETAIL] subscribe to BSConversationsChange data sender ', conv.sender)
327
325
  this.logger.log('[CONVS-DETAIL] subscribe to BSConversationsChange this.loggedUser.uid ', this.loggedUser.uid)
@@ -333,8 +331,8 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
333
331
  // ARE AT THE END
334
332
  this.updateConversationBadge()
335
333
  }
336
- if (conv.uid === this.conversationWith) {
337
- this.conversationAvatar = setConversationAvatar(conv.conversation_with, conv.conversation_with_fullname, conv.channel_type)
334
+ if(conv.uid && conv.uid === this.conversationWith){
335
+ this.conversationAvatar = setConversationAvatar(conv.conversation_with,conv.conversation_with_fullname,conv.channel_type)
338
336
  }
339
337
 
340
338
  }
@@ -354,15 +352,15 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
354
352
  }
355
353
 
356
354
  getOSCODE() {
357
- this.support_mode = null
355
+ this.supportMode = null
358
356
  if (this.appConfigProvider.getConfig().supportMode === true || this.appConfigProvider.getConfig().supportMode === 'true') {
359
- this.support_mode = true
357
+ this.supportMode = true
360
358
  } else if (this.appConfigProvider.getConfig().supportMode === false || this.appConfigProvider.getConfig().supportMode === 'false') {
361
- this.support_mode = false
359
+ this.supportMode = false
362
360
  } else if (!this.appConfigProvider.getConfig().supportMode) {
363
- this.support_mode = false
361
+ this.supportMode = false
364
362
  }
365
- this.logger.log('[CONVS-DETAIL] AppConfigService getAppConfig support_mode', this.support_mode)
363
+ this.logger.log('[CONVS-DETAIL] AppConfigService getAppConfig supportMode', this.supportMode)
366
364
  this.public_Key = this.appConfigProvider.getConfig().t2y12PruGU9wUtEGzBJfolMIgK
367
365
  this.logger.log('[CONVS-DETAIL] AppConfigService getAppConfig public_Key', this.public_Key)
368
366
 
@@ -375,26 +373,17 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
375
373
  let car = key.split(':')
376
374
  if (car[1] === 'F') {
377
375
  this.areVisibleCAR = false
378
- this.logger.log(
379
- '[CONVS-DETAIL] PUBLIC-KEY - areVisibleCAR',
380
- this.areVisibleCAR,
381
- )
376
+ this.logger.log('[CONVS-DETAIL] PUBLIC-KEY - areVisibleCAR',this.areVisibleCAR)
382
377
  } else {
383
378
  this.areVisibleCAR = true
384
- this.logger.log(
385
- '[CONVS-DETAIL] PUBLIC-KEY - areVisibleCAR',
386
- this.areVisibleCAR,
387
- )
379
+ this.logger.log('[CONVS-DETAIL] PUBLIC-KEY - areVisibleCAR',this.areVisibleCAR)
388
380
  }
389
381
  }
390
382
  })
391
383
 
392
384
  if (!this.public_Key.includes('CAR')) {
393
385
  this.areVisibleCAR = false
394
- this.logger.log(
395
- '[CONVS-DETAIL] PUBLIC-KEY - areVisibleCAR',
396
- this.areVisibleCAR,
397
- )
386
+ this.logger.log('[CONVS-DETAIL] PUBLIC-KEY - areVisibleCAR',this.areVisibleCAR)
398
387
  }
399
388
  } else {
400
389
  this.areVisibleCAR = false
@@ -1127,7 +1116,7 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
1127
1116
  // ----------------------------------------------------------
1128
1117
  // DISPLAY CANNED RESPONSES if message.lastIndexOf("/")
1129
1118
  // ----------------------------------------------------------
1130
- if (this.areVisibleCAR && this.support_mode === true) {
1119
+ if (this.areVisibleCAR && this.supportMode === true) {
1131
1120
  setTimeout(() => {
1132
1121
  if (this.conversationWith.startsWith('support-group')) {
1133
1122
  const pos = message.lastIndexOf('/')
@@ -43,16 +43,17 @@
43
43
  <ion-label part="message-text" class="waiting-for-network-msg"> Waiting for network</ion-label>
44
44
  </ion-item>
45
45
  <!-- supportMode && -->
46
- <ion-item *ngIf="displayNewConvsItem && conversationType !=='archived'" class="ion-no-padding open-iframe-item">
46
+ <ion-item *ngIf="displayNewConvsItem && conversationType !=='archived' && supportMode" class="ion-no-padding open-iframe-item">
47
47
  <div tabindex="0"></div>
48
48
  <!-- <ion-note class="pinned-project">
49
49
  {{ 'PINNED_PROJECT' | translate }}
50
50
  </ion-note> -->
51
51
 
52
- <app-project-item style="width: 100%;"
53
- (openUnsevedConvsEvent)="openUnsevedConversationIframe($event)"
54
- (projectIdEvent)="getLastProjectId($event)">
55
- </app-project-item>
52
+ <app-project-item
53
+ style="width: 100%;"
54
+ (openUnsevedConvsEvent)="openUnsevedConversationIframe($event)"
55
+ (projectIdEvent)="getLastProjectId($event)">
56
+ </app-project-item>
56
57
  </ion-item>
57
58
 
58
59
  <span
@@ -66,10 +67,15 @@
66
67
  <!-- ---------------------------------- -->
67
68
  <!-- ACTIVE CONVERSATION LIST -->
68
69
  <!-- ---------------------------------- -->
69
- <ion-list-conversations *ngIf="conversationType ==='active'" [uidConvSelected]="uidConvSelected"
70
- [listConversations]="conversations" [stylesMap]="stylesMap" [translationMap]="translationMapConversation"
71
- (onConversationSelected)=onConversationSelected($event) (onImageLoaded)="onImageLoaded($event)"
72
- (onConversationLoaded)="onConversationLoaded($event)" (onCloseConversation)="onCloseConversation($event)"
70
+ <ion-list-conversations *ngIf="conversationType ==='active'"
71
+ [uidConvSelected]="uidConvSelected"
72
+ [listConversations]="conversations"
73
+ [stylesMap]="stylesMap"
74
+ [translationMap]="translationMapConversation"
75
+ (onConversationSelected)=onConversationSelected($event)
76
+ (onImageLoaded)="onImageLoaded($event)"
77
+ (onConversationLoaded)="onConversationLoaded($event)"
78
+ (onCloseConversation)="onCloseConversation($event)"
73
79
  [archiveActionNotAllowed]="archiveActionNotAllowed"
74
80
  (onCloseAlert)="onCloseAlert($event)">
75
81
  </ion-list-conversations>
@@ -77,9 +83,12 @@
77
83
  <!-- ---------------------------------- -->
78
84
  <!-- ARCHIVED CONVERSATION LIST -->
79
85
  <!-- ---------------------------------- -->
80
- <ion-list-conversations *ngIf="conversationType ==='archived'" [listConversations]="archivedConversations"
81
- [stylesMap]="stylesMap" [translationMap]="translationMapConversation"
82
- (onConversationSelected)=onConversationSelected($event) (onImageLoaded)="onImageLoaded($event)"
86
+ <ion-list-conversations *ngIf="conversationType ==='archived'"
87
+ [listConversations]="archivedConversations"
88
+ [stylesMap]="stylesMap"
89
+ [translationMap]="translationMapConversation"
90
+ (onConversationSelected)=onConversationSelected($event)
91
+ (onImageLoaded)="onImageLoaded($event)"
83
92
  (onConversationLoaded)="onConversationLoaded($event)">
84
93
  </ion-list-conversations>
85
94
  </ng-template>
@@ -230,15 +230,6 @@ export class ConversationListPage implements OnInit {
230
230
  this.logger.log('[CONVS-LIST-PAGE] getConversationListHeight scrollbar2element', scrollbar2element)
231
231
  }
232
232
 
233
- // this.support_mode = null
234
- // if( this.appConfigProvider.getConfig().supportMode === true || this.appConfigProvider.getConfig().supportMode === 'true') {
235
- // this.support_mode = true
236
- // } else if ( this.appConfigProvider.getConfig().supportMode === false || this.appConfigProvider.getConfig().supportMode === 'false') {
237
- // this.support_mode = false
238
- // } else if ( !this.appConfigProvider.getConfig().supportMode ) {
239
- // this.support_mode = false
240
- // }
241
-
242
233
  getAppConfigToHideDiplayBtns() {
243
234
  const appConfig = this.appConfigProvider.getConfig()
244
235
  // console.log('[CONVS-LIST-PAGE] - appConfig ', appConfig)
@@ -266,7 +257,6 @@ export class ConversationListPage implements OnInit {
266
257
  this.writeto_btn = false;
267
258
  this.logger.log('[CONVS-LIST-PAGE] getAppConfigToHideDiplayBtns writeto_btn ', this.writeto_btn)
268
259
  }
269
- // console.log('[ION-LIST-CONVS-COMP] - supportMode ', this.supportMode)
270
260
  }
271
261
 
272
262
  watchToConnectionStatus() {
@@ -285,10 +275,7 @@ export class ConversationListPage implements OnInit {
285
275
 
286
276
  ionViewWillEnter() {
287
277
  this.logger.log('Called ionViewDidEnter')
288
- this.logger.log(
289
- '[CONVS-LIST-PAGE] ionViewWillEnter uidConvSelected',
290
- this.uidConvSelected,
291
- )
278
+ this.logger.log('[CONVS-LIST-PAGE] ionViewWillEnter uidConvSelected',this.uidConvSelected )
292
279
  this.listnerStart()
293
280
 
294
281
  // exit from app with hardware back button
@@ -313,29 +300,18 @@ export class ConversationListPage implements OnInit {
313
300
  openUnsevedConversationIframe(event) {
314
301
  this.logger.log('[CONVS-LIST-PAGE] openUnsevedConversationIframe ', event)
315
302
  this.hasClickedOpenUnservedConvIframe = true
316
- this.logger.log(
317
- '[CONVS-LIST-PAGE] - HAS CLIKED OPEN UNSERVED REQUEST IFRAME',
318
- this.hasClickedOpenUnservedConvIframe,
319
- )
303
+ this.logger.log('[CONVS-LIST-PAGE] - HAS CLIKED OPEN UNSERVED REQUEST IFRAME',this.hasClickedOpenUnservedConvIframe )
320
304
  const DASHBOARD_BASE_URL = this.appConfigProvider.getConfig().dashboardUrl
321
305
  // http://localhost:4204/#/projects-for-panel
322
306
  this.PROJECTS_FOR_PANEL_URL = DASHBOARD_BASE_URL + '#/projects-for-panel'
323
- this.UNASSIGNED_CONVS_URL =
324
- DASHBOARD_BASE_URL +
325
- '#/project/' +
326
- this.lastProjectId +
327
- '/unserved-request-for-panel'
307
+ this.UNASSIGNED_CONVS_URL = DASHBOARD_BASE_URL + '#/project/' + this.lastProjectId + '/unserved-request-for-panel'
328
308
 
329
309
  if (event === 'pinbtn') {
330
310
  this.IFRAME_URL = this.PROJECTS_FOR_PANEL_URL
331
311
  } else {
332
312
  this.IFRAME_URL = this.UNASSIGNED_CONVS_URL
333
313
  }
334
-
335
- this.logger.log(
336
- '[CONVS-LIST-PAGE] - HAS CLIKED OPEN UNSERVED REQUEST IFRAME > UNASSIGNED CONVS URL',
337
- this.UNASSIGNED_CONVS_URL,
338
- )
314
+ this.logger.log('[CONVS-LIST-PAGE] - HAS CLIKED OPEN UNSERVED REQUEST IFRAME > UNASSIGNED CONVS URL',this.UNASSIGNED_CONVS_URL )
339
315
  this.openUnassignedConversations(this.IFRAME_URL, event)
340
316
  }
341
317
 
@@ -360,10 +336,7 @@ export class ConversationListPage implements OnInit {
360
336
  try {
361
337
  closeModal(this.modalController)
362
338
  } catch (err) {
363
- this.logger.error(
364
- '[CONVS-LIST-PAGE] closeContactsDirectory -> error:',
365
- err,
366
- )
339
+ this.logger.error( '[CONVS-LIST-PAGE] closeContactsDirectory -> error:', err)
367
340
  }
368
341
  }
369
342
 
@@ -372,46 +345,23 @@ export class ConversationListPage implements OnInit {
372
345
  const that = this
373
346
  if (navigator && navigator.serviceWorker) {
374
347
  navigator.serviceWorker.addEventListener('message', function (event) {
375
- that.logger.log(
376
- '[CONVS-LIST-PAGE] FIREBASE-NOTIFICATION listenToNotificationCLick - Received a message from service worker event data: ',
377
- event.data,
378
- )
379
- that.logger.log(
380
- '[CONVS-LIST-PAGE] FIREBASE-NOTIFICATION listenToNotificationCLick - Received a message from service worker event data data: ',
381
- event.data['data'],
382
- )
383
- that.logger.log(
384
- '[CONVS-LIST-PAGE] FIREBASE-NOTIFICATION listenToNotificationCLick - Received a message from service worker event data data typeof: ',
385
- typeof event.data['data'],
386
- )
348
+ that.logger.log('[CONVS-LIST-PAGE] FIREBASE-NOTIFICATION listenToNotificationCLick - Received a message from service worker event data: ', event.data)
349
+ that.logger.log('[CONVS-LIST-PAGE] FIREBASE-NOTIFICATION listenToNotificationCLick - Received a message from service worker event data data: ', event.data['data'] )
350
+ that.logger.log('[CONVS-LIST-PAGE] FIREBASE-NOTIFICATION listenToNotificationCLick - Received a message from service worker event data data typeof: ', typeof event.data['data'] )
387
351
  let uidConvSelected = ''
388
352
  if (event.data && event.data['conversWith']) {
389
353
  uidConvSelected = event.data['conversWith']
390
354
  } else {
391
- that.logger.log(
392
- '[CONVS-LIST-PAGE] FIREBASE-NOTIFICATION listenToNotificationCLick - DIFFERENT MSG',
393
- )
355
+ that.logger.log('[CONVS-LIST-PAGE] FIREBASE-NOTIFICATION listenToNotificationCLick - DIFFERENT MSG',)
394
356
  return
395
357
  }
396
358
 
397
- that.logger.log(
398
- '[CONVS-LIST-PAGE] FIREBASE-NOTIFICATION listenToNotificationCLick - Received a message from service worker event dataObjct uidConvSelected: ',
399
- uidConvSelected,
400
- )
401
- that.logger.log(
402
- '[CONVS-LIST-PAGE] FIREBASE-NOTIFICATION listenToNotificationCLick - Received a message from service worker that.conversations: ',
403
- that.conversations,
404
- )
405
- const conversationSelected = that.conversations.find(
406
- (item) => item.uid === uidConvSelected,
407
- )
359
+ that.logger.log('[CONVS-LIST-PAGE] FIREBASE-NOTIFICATION listenToNotificationCLick - Received a message from service worker event dataObjct uidConvSelected: ', uidConvSelected )
360
+ that.logger.log('[CONVS-LIST-PAGE] FIREBASE-NOTIFICATION listenToNotificationCLick - Received a message from service worker that.conversations: ', that.conversations)
361
+ const conversationSelected = that.conversations.find((item) => item.uid === uidConvSelected)
408
362
  if (conversationSelected) {
409
363
  that.conversationSelected = conversationSelected
410
- that.logger.log(
411
- '[CONVS-LIST-PAGE] listenToNotificationCLick- Received a message from service worker event conversationSelected: ',
412
- that.conversationSelected,
413
- )
414
-
364
+ that.logger.log('[CONVS-LIST-PAGE] listenToNotificationCLick- Received a message from service worker event conversationSelected: ', that.conversationSelected )
415
365
  that.navigateByUrl('active', uidConvSelected)
416
366
  }
417
367
  })
@@ -420,23 +370,16 @@ export class ConversationListPage implements OnInit {
420
370
 
421
371
  private listnerStart() {
422
372
  const that = this
423
- this.chatManager.BSStart.pipe(takeUntil(that.unsubscribe$)).subscribe(
424
- (data: any) => {
425
- this.logger.log(
426
- '[CONVS-LIST-PAGE] - BSStart SUBSCR DATA - Current user *****',
427
- data,
428
- )
373
+ this.chatManager.BSStart.pipe(takeUntil(that.unsubscribe$)).subscribe((data: any) => {
374
+ this.logger.log('[CONVS-LIST-PAGE] - BSStart SUBSCR DATA - Current user *****', data)
429
375
  if (data) {
430
376
  that.initialize()
431
377
  }
432
- },
433
- (error) => {
378
+ },(error) => {
434
379
  this.logger.error('[CONVS-LIST-PAGE] - BSStart SUBSCR - ERROR: ', error)
435
- },
436
- () => {
380
+ },() => {
437
381
  this.logger.log('[CONVS-LIST-PAGE] - BSStart SUBSCR * COMPLETE *')
438
- },
439
- )
382
+ })
440
383
  }
441
384
 
442
385
  // ------------------------------------------------------------------ //
@@ -444,7 +387,7 @@ export class ConversationListPage implements OnInit {
444
387
  // ------------------------------------------------------------------ //
445
388
  initConversationsHandler() {
446
389
  this.conversations = this.conversationsHandlerService.conversations
447
- this.logger.log('[CONVS-LIST-PAGE] - CONVERSATIONS ', this.conversations)
390
+ this.logger.log('[CONVS-LIST-PAGE] - CONVERSATIONS ', this.conversations.length, this.conversations)
448
391
  // save conversationHandler in chatManager
449
392
  this.chatManager.setConversationsHandler(this.conversationsHandlerService)
450
393
  this.showPlaceholder = false
@@ -452,36 +395,22 @@ export class ConversationListPage implements OnInit {
452
395
 
453
396
  initArchivedConversationsHandler() {
454
397
  const keysConversation = ['CLOSED', 'Resolve']
455
- this.translationMapConversation = this.translateService.translateLanguage(
456
- keysConversation,
457
- )
398
+ this.translationMapConversation = this.translateService.translateLanguage( keysConversation )
458
399
 
459
400
  this.archivedConversationsHandlerService.subscribeToConversations(() => {
460
- this.logger.log(
461
- '[CONVS-LIST-PAGE]-CONVS - conversations archived length ',
462
- this.archivedConversations.length,
463
- )
401
+ this.logger.log('[CONVS-LIST-PAGE]-CONVS - conversations archived length ',this.archivedConversations.length)
464
402
  })
465
403
 
466
404
  this.archivedConversations = this.archivedConversationsHandlerService.archivedConversations
467
- this.logger.log(
468
- '[CONVS-LIST-PAGE] archived conversation',
469
- this.archivedConversations,
470
- )
405
+ this.logger.log('[CONVS-LIST-PAGE] archived conversation',this.archivedConversations )
471
406
 
472
407
  // save archivedConversationsHandlerService in chatManager
473
408
  this.chatManager.setArchivedConversationsHandler(
474
409
  this.archivedConversationsHandlerService,
475
410
  )
476
411
 
477
- this.logger.log(
478
- '[CONVS-LIST-PAGE]-CONVS SubscribeToConversations - conversations archived length ',
479
- this.archivedConversations.length,
480
- )
481
- if (
482
- !this.archivedConversations ||
483
- this.archivedConversations.length === 0
484
- ) {
412
+ this.logger.log('[CONVS-LIST-PAGE]-CONVS SubscribeToConversations - conversations archived length ', this.archivedConversations.length )
413
+ if (!this.archivedConversations || this.archivedConversations.length === 0 ) {
485
414
  this.loadingIsActive = false
486
415
  }
487
416
  }
@@ -494,26 +423,17 @@ export class ConversationListPage implements OnInit {
494
423
  // - for the direct conversation
495
424
  // ----------------------------------------------------------------------------------------------------
496
425
  listenToAppCompConvsLengthOnInitConvs() {
497
- this.events.subscribe(
498
- 'appcompSubscribeToConvs:loadingIsActive',
499
- (loadingIsActive) => {
500
- this.logger.log(
501
- '[CONVS-LIST-PAGE]-CONVS loadingIsActive',
502
- loadingIsActive,
503
- )
504
- if (loadingIsActive === false) {
505
- this.loadingIsActive = false
506
- }
507
- },
508
- )
426
+ this.events.subscribe( 'appcompSubscribeToConvs:loadingIsActive', (loadingIsActive) => {
427
+ this.logger.log( '[CONVS-LIST-PAGE]-CONVS loadingIsActive', loadingIsActive)
428
+ if (loadingIsActive === false) {
429
+ this.loadingIsActive = false
430
+ }
431
+ })
509
432
  }
510
433
 
511
434
  listenGoOnline() {
512
435
  this.events.subscribe('go:online', (goonline) => {
513
- this.logger.info(
514
- '[CONVS-LIST-PAGE] - listen To go:online - goonline',
515
- goonline,
516
- )
436
+ this.logger.info('[CONVS-LIST-PAGE] - listen To go:online - goonline',goonline)
517
437
  // this.events.unsubscribe('profileInfoButtonClick:logout')
518
438
  if (goonline === true) {
519
439
  this.displayNewConvsItem = true
@@ -523,10 +443,7 @@ export class ConversationListPage implements OnInit {
523
443
 
524
444
  listenGoOffline() {
525
445
  this.events.subscribe('go:offline', (offline) => {
526
- this.logger.info(
527
- '[CONVS-LIST-PAGE] - listen To go:offline - offline',
528
- offline,
529
- )
446
+ this.logger.info('[CONVS-LIST-PAGE] - listen To go:offline - offline',offline)
530
447
  // this.events.unsubscribe('profileInfoButtonClick:logout')
531
448
  if (offline === true) {
532
449
  this.displayNewConvsItem = false
@@ -535,31 +452,19 @@ export class ConversationListPage implements OnInit {
535
452
  }
536
453
 
537
454
  listenToLogoutEvent() {
538
- this.events.subscribe(
539
- 'profileInfoButtonClick:logout',
540
- (hasclickedlogout) => {
541
- this.logger.info(
542
- '[CONVS-LIST-PAGE] - listenToLogoutEvent - hasclickedlogout',
543
- hasclickedlogout,
544
- )
455
+ this.events.subscribe( 'profileInfoButtonClick:logout', (hasclickedlogout) => {
456
+ this.logger.info( '[CONVS-LIST-PAGE] - listenToLogoutEvent - hasclickedlogout',hasclickedlogout)
545
457
 
546
458
  this.conversations = []
547
459
  this.conversationsHandlerService.conversations = []
548
460
  this.uidConvSelected = null
549
461
 
550
- this.logger.log(
551
- '[CONVS-LIST-PAGE] - listenToLogoutEvent - CONVERSATIONS ',
552
- this.conversations,
553
- )
554
- this.logger.log(
555
- '[CONVS-LIST-PAGE] - listenToLogoutEvent - uidConvSelected ',
556
- this.uidConvSelected,
557
- )
462
+ this.logger.log('[CONVS-LIST-PAGE] - listenToLogoutEvent - CONVERSATIONS ', this.conversations )
463
+ this.logger.log('[CONVS-LIST-PAGE] - listenToLogoutEvent - uidConvSelected ', this.uidConvSelected )
558
464
  if (hasclickedlogout === true) {
559
465
  this.loadingIsActive = false
560
466
  }
561
- },
562
- )
467
+ })
563
468
  }
564
469
 
565
470
  // ------------------------------------------------------------------
@@ -644,14 +549,8 @@ export class ConversationListPage implements OnInit {
644
549
  subscribeLoggedUserLogout = () => {
645
550
  this.conversations = []
646
551
  this.uidConvSelected = null
647
- this.logger.log(
648
- '[CONVS-LIST-PAGE] - subscribeLoggedUserLogout conversations ',
649
- this.conversations,
650
- )
651
- this.logger.log(
652
- '[CONVS-LIST-PAGE] - subscribeLoggedUserLogout uidConvSelected ',
653
- this.uidConvSelected,
654
- )
552
+ this.logger.log('[CONVS-LIST-PAGE] - subscribeLoggedUserLogout conversations ',this.conversations)
553
+ this.logger.log('[CONVS-LIST-PAGE] - subscribeLoggedUserLogout uidConvSelected ',this.uidConvSelected)
655
554
  }
656
555
 
657
556
  // ------------------------------------------------------------------------------------
@@ -659,15 +558,10 @@ export class ConversationListPage implements OnInit {
659
558
  // ------------------------------------------------------------------------------------
660
559
  conversationsChanged = (conversations: ConversationModel[]) => {
661
560
  this.numberOpenConv = this.conversationsHandlerService.countIsNew()
662
- this.logger.log(
663
- '[CONVS-LIST-PAGE] - conversationsChanged - NUMB OF CONVERSATIONS: ',
664
- this.numberOpenConv,
665
- )
561
+ this.logger.log('[CONVS-LIST-PAGE] - conversationsChanged - NUMB OF CONVERSATIONS: ',this.numberOpenConv)
666
562
  // console.log('conversationsChanged »»»»»»»»» uidConvSelected', that.conversations[0], that.uidConvSelected);
667
563
  if (this.uidConvSelected && !this.conversationSelected) {
668
- const conversationSelected = this.conversations.find(
669
- (item) => item.uid === this.uidConvSelected,
670
- )
564
+ const conversationSelected = this.conversations.find((item) => item.uid === this.uidConvSelected)
671
565
  if (conversationSelected) {
672
566
  this.conversationSelected = conversationSelected
673
567
  this.setUidConvSelected(this.uidConvSelected)
@@ -684,26 +578,13 @@ export class ConversationListPage implements OnInit {
684
578
  // !!!!!! IS USED? ?????
685
579
  // ------------------------------
686
580
  subscribeChangedConversationSelected = (user: UserModel, type: string) => {
687
- this.logger.log(
688
- '[CONVS-LIST-PAGE] ************** subscribeUidConvSelectedChanged navigateByUrl',
689
- user,
690
- type,
691
- )
581
+ this.logger.log('[CONVS-LIST-PAGE] ************** subscribeUidConvSelectedChanged navigateByUrl',user, type)
692
582
  this.uidConvSelected = user.uid
693
- this.logger.log(
694
- '[CONVS-LIST-PAGE] ************** uidConvSelected ',
695
- this.uidConvSelected,
696
- )
583
+ this.logger.log('[CONVS-LIST-PAGE] ************** uidConvSelected ', this.uidConvSelected)
697
584
  // this.conversationsHandlerService.uidConvSelected = user.uid;
698
- const conversationSelected = this.conversations.find(
699
- (item) => item.uid === this.uidConvSelected,
700
- )
585
+ const conversationSelected = this.conversations.find( (item) => item.uid === this.uidConvSelected)
701
586
  if (conversationSelected) {
702
- this.logger.log(
703
- '[CONVS-LIST-PAGE] --> uidConvSelected: ',
704
- this.conversationSelected,
705
- this.uidConvSelected,
706
- )
587
+ this.logger.log('[CONVS-LIST-PAGE] --> uidConvSelected: ',this.conversationSelected, this.uidConvSelected)
707
588
  this.conversationSelected = conversationSelected
708
589
  }
709
590
  // this.router.navigateByUrl('conversation-detail/' + user.uid + '?conversationWithFullname=' + user.fullname);
@@ -714,10 +595,7 @@ export class ConversationListPage implements OnInit {
714
595
  * evento richiamato quando si seleziona bottone profile-info-modal
715
596
  */
716
597
  subscribeProfileInfoButtonClicked = (event: string) => {
717
- this.logger.log(
718
- '[CONVS-LIST-PAGE] ************** subscribeProfileInfoButtonClicked: ',
719
- event,
720
- )
598
+ this.logger.log('[CONVS-LIST-PAGE] ************** subscribeProfileInfoButtonClicked: ', event)
721
599
  if (event === 'displayArchived') {
722
600
  this.initArchivedConversationsHandler()
723
601
  // this.openArchivedConversationsModal()
@@ -727,15 +605,11 @@ export class ConversationListPage implements OnInit {
727
605
  const keys = ['LABEL_ARCHIVED']
728
606
  // const keys = ['History'];
729
607
 
730
- this.headerTitle = this.translateService
731
- .translateLanguage(keys)
732
- .get(keys[0])
608
+ this.headerTitle = this.translateService.translateLanguage(keys).get(keys[0])
733
609
  } else if (event === 'displayContact') {
734
610
  this.conversationType = 'archived'
735
611
  const keys = ['LABEL_CONTACTS']
736
- this.headerTitle = this.translateService
737
- .translateLanguage(keys)
738
- .get(keys[0])
612
+ this.headerTitle = this.translateService.translateLanguage(keys).get(keys[0])
739
613
  }
740
614
  }
741
615
 
@@ -783,10 +657,7 @@ export class ConversationListPage implements OnInit {
783
657
  initialize() {
784
658
  const appconfig = this.appConfigProvider.getConfig()
785
659
  this.tenant = appconfig.firebaseConfig.tenant
786
- this.logger.log(
787
- '[CONVS-LIST-PAGE] - initialize -> firebaseConfig tenant ',
788
- this.tenant,
789
- )
660
+ this.logger.log('[CONVS-LIST-PAGE] - initialize -> firebaseConfig tenant ',this.tenant)
790
661
 
791
662
  if (this.tiledeskAuthService.getCurrentUser()) {
792
663
  this.loggedUserUid = this.tiledeskAuthService.getCurrentUser().uid
@@ -813,22 +684,18 @@ export class ConversationListPage implements OnInit {
813
684
  // It only works on BSStart.subscribe! it is useful or can be eliminated
814
685
  // --------------------------------------------------------
815
686
  initVariables() {
816
- this.logger.log(
817
- '[CONVS-LIST-PAGE] uidReciverFromUrl:: ' + this.uidReciverFromUrl,
818
- )
687
+ this.logger.log('[CONVS-LIST-PAGE] uidReciverFromUrl:: ' + this.uidReciverFromUrl)
819
688
  this.logger.log('[CONVS-LIST-PAGE] loggedUserUid:: ' + this.loggedUserUid)
820
689
  this.logger.log('[CONVS-LIST-PAGE] tenant:: ' + this.tenant)
821
690
  if (this.route.component['name'] !== 'ConversationListPage') {
822
691
  if (this.route && this.route.snapshot && this.route.snapshot.firstChild) {
823
692
  const IDConv = this.route.snapshot.firstChild.paramMap.get('IDConv')
693
+ const convType = this.route.snapshot.firstChild.paramMap.get('Convtype')
824
694
  this.logger.log('[CONVS-LIST-PAGE] conversationWith 2: ', IDConv)
825
695
  if (IDConv) {
826
- this.setUidConvSelected(IDConv)
696
+ this.setUidConvSelected(IDConv, convType)
827
697
  } else {
828
- this.logger.log(
829
- '[CONVS-LIST-PAGE] conversationWith 2 (else): ',
830
- IDConv,
831
- )
698
+ this.logger.log('[CONVS-LIST-PAGE] conversationWith 2 (else): ',IDConv)
832
699
  }
833
700
  }
834
701
  }
@@ -846,9 +713,11 @@ export class ConversationListPage implements OnInit {
846
713
  let conversationSelected
847
714
  if (conversationType === 'active') {
848
715
  conversationSelected = this.conversations.find((item) => item.uid === this.uidConvSelected)
849
- } else if (conversationType === 'archived') { conversationSelected = this.archivedConversations.find((item) => item.uid === this.uidConvSelected) }
716
+ } else if (conversationType === 'archived') {
717
+ conversationSelected = this.archivedConversations.find((item) => item.uid === this.uidConvSelected)
718
+ }
850
719
  if (conversationSelected) {
851
- this.logger.log('[CONVS-LIST-PAGE] conversationSelected', conversationSelected,)
720
+ this.logger.log('[CONVS-LIST-PAGE] conversationSelected', conversationSelected)
852
721
  this.logger.log('[CONVS-LIST-PAGE] the conversation ', this.conversationSelected, ' has already been loaded')
853
722
  this.conversationSelected = conversationSelected
854
723
  this.logger.log('[CONVS-LIST-PAGE] setUidConvSelected: ', this.conversationSelected)
@@ -882,9 +751,7 @@ export class ConversationListPage implements OnInit {
882
751
  conversation_with_fullname = conversation.recipient_fullname
883
752
  }
884
753
  if (!conversation_with.startsWith('support-group')) {
885
- conversation.image = this.imageRepoService.getImagePhotoUrl(
886
- conversation_with,
887
- )
754
+ conversation.image = this.imageRepoService.getImagePhotoUrl(conversation_with)
888
755
  }
889
756
  }
890
757