@chat21/chat21-ionic 3.0.64 → 3.0.65

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 (52) hide show
  1. package/CHANGELOG.md +34 -2
  2. package/deploy_amazon_beta.sh +0 -0
  3. package/deploy_amazon_prod.sh +1 -0
  4. package/deploy_pre.sh +39 -6
  5. package/package.json +8 -3
  6. package/publiccode.yml +110 -0
  7. package/src/app/app.component.ts +40 -66
  8. package/src/app/app.module.ts +1 -0
  9. package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.html +2 -2
  10. package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.scss +0 -1
  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 +18 -6
  13. package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.ts +1 -11
  14. package/src/app/chatlib/conversation-detail/message/html/html.component.html +1 -0
  15. package/src/app/chatlib/conversation-detail/message/html/html.component.scss +79 -0
  16. package/src/app/chatlib/conversation-detail/message/html/html.component.spec.ts +25 -0
  17. package/src/app/chatlib/conversation-detail/message/html/html.component.ts +33 -0
  18. package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.html +1 -1
  19. package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.ts +18 -30
  20. package/src/app/chatlib/list-conversations-component/list-conversations/list-conversations.component.ts +0 -1
  21. package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.html +7 -5
  22. package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.scss +21 -0
  23. package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component_2.html +116 -0
  24. package/src/app/components/conversation-detail/message-text-area/message-text-area.component.html +2 -2
  25. package/src/app/components/conversation-detail/message-text-area/message-text-area.component.ts +2 -2
  26. package/src/app/components/project-item/project-item.component.ts +5 -0
  27. package/src/app/components/sidebar/sidebar.component.ts +8 -15
  28. package/src/app/components/sidebar-user-details/sidebar-user-details.component.html +12 -23
  29. package/src/app/components/sidebar-user-details/sidebar-user-details.component.scss +3 -0
  30. package/src/app/components/sidebar-user-details/sidebar-user-details.component.ts +88 -136
  31. package/src/app/directives/safe-html.pipe.ts +2 -2
  32. package/src/app/directives/truncate.pipe.spec.ts +8 -0
  33. package/src/app/directives/truncate.pipe.ts +15 -0
  34. package/src/app/pages/authentication/login/login.page.ts +0 -1
  35. package/src/app/pages/conversation-detail/conversation-detail.module.ts +3 -2
  36. package/src/app/pages/conversation-detail/conversation-detail.page.html +4 -2
  37. package/src/app/pages/conversation-detail/conversation-detail.page.ts +56 -71
  38. package/src/app/pages/conversations-list/conversations-list.page.html +21 -12
  39. package/src/app/pages/conversations-list/conversations-list.page.ts +129 -367
  40. package/src/app/pages/loader-preview/loader-preview.module.ts +1 -2
  41. package/src/app/shared/shared.module.ts +4 -0
  42. package/src/assets/i18n/ar.json +266 -0
  43. package/src/assets/js/chat21client.js +58 -60
  44. package/src/chat21-core/models/conversation.ts +2 -2
  45. package/src/chat21-core/providers/abstract/conversations-handler.service.ts +1 -1
  46. package/src/chat21-core/providers/firebase/firebase-archivedconversations-handler.ts +26 -21
  47. package/src/chat21-core/providers/firebase/firebase-conversations-handler.ts +78 -23
  48. package/src/chat21-core/providers/mqtt/mqtt-conversations-handler.ts +16 -13
  49. package/src/chat21-core/utils/constants.ts +1 -1
  50. package/src/chat21-core/utils/utils-message.ts +2 -3
  51. package/src/global.scss +2 -2
  52. package/deploy_prod.sh +0 -11
@@ -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,20 +320,19 @@ 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
- if (conv && conv.sender !== this.loggedUser.uid) {
323
+ if (conv && this.loggedUser && 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)
328
326
  this.logger.log('[CONVS-DETAIL] subscribe to BSConversationsChange is_new ', conv.is_new)
329
327
  this.logger.log('[CONVS-DETAIL] subscribe to BSConversationsChange showButtonToBottom ', this.showButtonToBottom)
330
328
  // UPDATE THE CONVERSATION TO 'READ' IF IT IS ME WHO WRITES THE LAST MESSAGE OF THE CONVERSATION
331
329
  // AND IF THE POSITION OF THE SCROLL IS AT THE END
332
- if (!this.showButtonToBottom && conv.is_new) {
333
- // ARE AT THE END
334
- this.updateConversationBadge()
335
- }
336
- if (conv.uid === this.conversationWith) {
337
- this.conversationAvatar = setConversationAvatar(conv.conversation_with, conv.conversation_with_fullname, conv.channel_type)
330
+ // if (!this.showButtonToBottom && conv.is_new) {
331
+ // // ARE AT THE END
332
+ // this.updateConversationBadge()
333
+ // }
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
@@ -772,6 +761,7 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
772
761
  if (this.conversationWith && this.conversationsHandlerService && this.conv_type === 'active') {
773
762
  this.logger.log('[CONVS-DETAIL] - setHeaderContent getConversationDetail CALLING')
774
763
  this.conversationsHandlerService.getConversationDetail(this.conversationWith, (conv) => {
764
+ this.logger.debug('[CONV-COMP] setHeaderContent getConversationDetail: conversationsHandlerService ', this.conversationWith, conv, this.conv_type)
775
765
  if (conv) {
776
766
  this.conversationAvatar = setConversationAvatar(
777
767
  conv.conversation_with,
@@ -779,19 +769,45 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
779
769
  conv.channel_type,
780
770
  )
781
771
  }
772
+ if(!conv){
773
+ this.logger.debug('[CONV-COMP] setHeaderContent getConversationDetail: conv not exist --> search in archived list', this.conversationWith, this.conv_type)
774
+ this.archivedConversationsHandlerService.getConversationDetail(this.conversationWith, (conv) => {
775
+ this.logger.debug('[CONV-COMP] setHeaderContent getConversationDetail: archivedConversationsHandlerService', this.conversationWith, conv)
776
+ if (conv) {
777
+ console.log('[CONVS-DETAIL] - setHeaderContent getConversationDetail (archived)', this.conversationWith, 'CONVS', conv)
778
+ this.conversationAvatar = setConversationAvatar(
779
+ conv.conversation_with,
780
+ conv.conversation_with_fullname,
781
+ conv.channel_type,
782
+ )
783
+ }
784
+ })
785
+ }
782
786
  this.logger.log('[CONVS-DETAIL] - setHeaderContent > conversationAvatar: ', this.conversationAvatar)
783
787
  })
784
788
  } else {
785
- //get conversation from 'conversations' firebase node
789
+ //get conversation from 'archived-conversations' firebase node
790
+ this.logger.debug('[CONV-COMP] setHeaderContent getConversationDetail: archivedConversationsHandlerService', this.conversationWith, this.conv_type)
786
791
  this.archivedConversationsHandlerService.getConversationDetail(this.conversationWith, (conv) => {
787
792
  if (conv) {
788
- // console.log('[CONVS-DETAIL] - setHeaderContent getConversationDetail (archived)', this.conversationWith, 'CONVS', conv)
789
793
  this.conversationAvatar = setConversationAvatar(
790
794
  conv.conversation_with,
791
795
  conv.conversation_with_fullname,
792
796
  conv.channel_type,
793
797
  )
794
798
  }
799
+ if(!conv){
800
+ this.conversationsHandlerService.getConversationDetail(this.conversationWith, (conv) => {
801
+ if (conv) {
802
+ this.conversationAvatar = setConversationAvatar(
803
+ conv.conversation_with,
804
+ conv.conversation_with_fullname,
805
+ conv.channel_type,
806
+ )
807
+ }
808
+ this.logger.log('[CONVS-DETAIL] - setHeaderContent > conversationAvatar: ', this.conversationAvatar)
809
+ })
810
+ }
795
811
  })
796
812
  }
797
813
 
@@ -945,7 +961,6 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
945
961
  subscriptionKey = 'messageAdded'
946
962
  subscription = this.subscriptions.find((item) => item.key === subscriptionKey)
947
963
  if (!subscription) {
948
- this.logger.log('[CONVS-DETAIL] subscribe to messageAdded - conversationHandlerService', this.conversationHandlerService)
949
964
  subscription = this.conversationHandlerService.messageAdded.subscribe((msg: any) => {
950
965
  this.logger.log('[CONVS-DETAIL] subscribe to messageAdded - msg ', msg)
951
966
  if (msg) {
@@ -961,7 +976,6 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
961
976
  subscriptionKey = 'messageChanged'
962
977
  subscription = this.subscriptions.find((item) => item.key === subscriptionKey)
963
978
  if (!subscription) {
964
- this.logger.log('[CONVS-DETAIL] subscribe to messageChanged')
965
979
  subscription = this.conversationHandlerService.messageChanged.subscribe((msg: any) => {
966
980
  this.logger.log('[CONVS-DETAIL] subscribe to messageChanged - msg ', msg)
967
981
  })
@@ -972,7 +986,6 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
972
986
  subscriptionKey = 'messageRemoved'
973
987
  subscription = this.subscriptions.find((item) => item.key === subscriptionKey)
974
988
  if (!subscription) {
975
- this.logger.log('[CONVS-DETAIL] subscribe to messageRemoved')
976
989
  subscription = this.conversationHandlerService.messageRemoved.subscribe((messageId: any) => {
977
990
  this.logger.log('[CONVS-DETAIL] subscribe to messageRemoved - messageId ', messageId)
978
991
  })
@@ -1127,7 +1140,7 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
1127
1140
  // ----------------------------------------------------------
1128
1141
  // DISPLAY CANNED RESPONSES if message.lastIndexOf("/")
1129
1142
  // ----------------------------------------------------------
1130
- if (this.areVisibleCAR && this.support_mode === true) {
1143
+ if (this.areVisibleCAR && this.supportMode === true) {
1131
1144
  setTimeout(() => {
1132
1145
  if (this.conversationWith.startsWith('support-group')) {
1133
1146
  const pos = message.lastIndexOf('/')
@@ -1197,26 +1210,15 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
1197
1210
  this.logger.log('[CONVS-DETAIL] - returnChangeTextArea --> beforeSlash parts', beforeSlashParts)
1198
1211
 
1199
1212
  if (beforeSlashParts.length === 2) {
1200
- if (
1201
- beforeSlashParts[0].indexOf(' ') >= 0 &&
1202
- afterSlashParts[0] === ''
1203
- ) {
1213
+ if (beforeSlashParts[0].indexOf(' ') >= 0 && afterSlashParts[0] === '') {
1204
1214
  this.HIDE_CANNED_RESPONSES = false
1205
- this.logger.log(
1206
- '[CONVS-DETAIL] - returnChangeTextArea --> beforeSlash there is a white space After Not',
1207
- )
1215
+ this.logger.log('[CONVS-DETAIL] - returnChangeTextArea --> beforeSlash there is a white space After Not')
1208
1216
  // if (beforeSlashParts[0].indexOf(' ') >= 0 && afterSlashParts[0].indexOf(' ') >= 0)
1209
- } else if (
1210
- beforeSlashParts[0].indexOf(' ') < 0 &&
1211
- afterSlashParts[0] === ''
1212
- ) {
1217
+ } else if (beforeSlashParts[0].indexOf(' ') < 0 && afterSlashParts[0] === '') {
1213
1218
  this.HIDE_CANNED_RESPONSES = true
1214
1219
  this.tagsCannedFilter = []
1215
1220
  this.logger.log('[CONVS-DETAIL] - returnChangeTextArea --> beforeSlash not thete is a white space After Not')
1216
- } else if (
1217
- beforeSlashParts[0].indexOf(' ') >= 0 &&
1218
- afterSlashParts[0] === ' '
1219
- ) {
1221
+ } else if (beforeSlashParts[0].indexOf(' ') >= 0 && afterSlashParts[0] === ' ') {
1220
1222
  this.logger.log('[CONVS-DETAIL] - returnChangeTextArea --> beforeSlash not thete is a white space After YES')
1221
1223
  this.HIDE_CANNED_RESPONSES = true
1222
1224
  this.tagsCannedFilter = []
@@ -1486,11 +1488,6 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
1486
1488
  this.logger.log('[CONVS-DETAIL] - insertAtCursor - myValue ', myValue)
1487
1489
  this.logger.log('[CONVS-DETAIL] - insertAtCursor - myField ', myField)
1488
1490
 
1489
- // myValue = ' ' + myValue;
1490
-
1491
- // console.log('[CONVS-DETAIL] - GET TEXT AREA - Here yes myValue ', myValue);
1492
- // console.log('[CONVS-DETAIL] - GET TEXT AREA - Here yes textArea value length', myField.value.length);
1493
-
1494
1491
  if (myField.value.length > 0) {
1495
1492
  myValue = ' ' + myValue
1496
1493
  }
@@ -1582,24 +1579,15 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
1582
1579
  // this.audio.src = '/assets/sounds/pling.mp3';
1583
1580
  this.audio.src = URL_SOUND_LIST_CONVERSATION
1584
1581
  this.audio.load()
1585
- this.logger.log(
1586
- '[CONVS-DETAIL] soundMessage conversation this.audio',
1587
- this.audio,
1588
- )
1582
+ this.logger.log('[CONVS-DETAIL] soundMessage conversation this.audio',this.audio)
1589
1583
  clearTimeout(this.setTimeoutSound)
1590
1584
  this.setTimeoutSound = setTimeout(function () {
1591
- that.audio
1592
- .play()
1593
- .then(() => {
1585
+ that.audio.play().then(() => {
1594
1586
  // Audio is playing.
1595
- this.logger.log(
1596
- '[CONVS-DETAIL] soundMessag that.audio.src ',
1597
- that.audio.src,
1598
- )
1599
- })
1600
- .catch((error) => {
1587
+ this.logger.log('[CONVS-DETAIL] soundMessag that.audio.src ',that.audio.src)
1588
+ }).catch((error) => {
1601
1589
  that.logger.error(error)
1602
- })
1590
+ })
1603
1591
  }, 1000)
1604
1592
  }
1605
1593
 
@@ -1761,10 +1749,7 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
1761
1749
  * FIREBY BY: click event ScrollToBottom bottom-right icon button
1762
1750
  */
1763
1751
  public actionScrollBottom() {
1764
- this.logger.log(
1765
- '[CONVS-DETAIL] actionScrollBottom - ionContentChatArea: ',
1766
- this.ionContentChatArea,
1767
- )
1752
+ this.logger.log('[CONVS-DETAIL] actionScrollBottom - ionContentChatArea: ',this.ionContentChatArea)
1768
1753
  // const that = this;
1769
1754
  this.showButtonToBottom = false
1770
1755
  this.updateConversationBadge()
@@ -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>