@chat21/chat21-ionic 3.0.97-rc.1 → 3.0.97-rc.3

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 (124) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/Dockerfile +1 -1
  3. package/GoogleService-Info.plist +36 -0
  4. package/config.xml +6 -3
  5. package/google-services.json +40 -0
  6. package/package.json +8 -13
  7. package/resources/ios/icon/icon-1024.png +0 -0
  8. package/resources/ios/icon/icon-108@2x.png +0 -0
  9. package/resources/ios/icon/icon-20.png +0 -0
  10. package/resources/ios/icon/icon-20@2x.png +0 -0
  11. package/resources/ios/icon/icon-20@3x.png +0 -0
  12. package/resources/ios/icon/icon-24@2x.png +0 -0
  13. package/resources/ios/icon/icon-27.5@2x.png +0 -0
  14. package/resources/ios/icon/icon-29.png +0 -0
  15. package/resources/ios/icon/icon-29@2x.png +0 -0
  16. package/resources/ios/icon/icon-29@3x.png +0 -0
  17. package/resources/ios/icon/icon-40.png +0 -0
  18. package/resources/ios/icon/icon-40@2x.png +0 -0
  19. package/resources/ios/icon/icon-40@3x.png +0 -0
  20. package/resources/ios/icon/icon-44@2x.png +0 -0
  21. package/resources/ios/icon/icon-50.png +0 -0
  22. package/resources/ios/icon/icon-50@2x.png +0 -0
  23. package/resources/ios/icon/icon-60.png +0 -0
  24. package/resources/ios/icon/icon-60@2x.png +0 -0
  25. package/resources/ios/icon/icon-60@3x.png +0 -0
  26. package/resources/ios/icon/icon-72.png +0 -0
  27. package/resources/ios/icon/icon-72@2x.png +0 -0
  28. package/resources/ios/icon/icon-76.png +0 -0
  29. package/resources/ios/icon/icon-76@2x.png +0 -0
  30. package/resources/ios/icon/icon-83.5@2x.png +0 -0
  31. package/resources/ios/icon/icon-86@2x.png +0 -0
  32. package/resources/ios/icon/icon-98@2x.png +0 -0
  33. package/resources/ios/icon/icon.png +0 -0
  34. package/resources/ios/icon/icon@2x.png +0 -0
  35. package/resources/ios/icon.jpg +0 -0
  36. package/resources/ios/splash/Default-1792h~iphone.png +0 -0
  37. package/resources/ios/splash/Default-2436h.png +0 -0
  38. package/resources/ios/splash/Default-2688h~iphone.png +0 -0
  39. package/resources/ios/splash/Default-568h@2x~iphone.png +0 -0
  40. package/resources/ios/splash/Default-667h.png +0 -0
  41. package/resources/ios/splash/Default-736h.png +0 -0
  42. package/resources/ios/splash/Default-Landscape-1792h~iphone.png +0 -0
  43. package/resources/ios/splash/Default-Landscape-2436h.png +0 -0
  44. package/resources/ios/splash/Default-Landscape-2688h~iphone.png +0 -0
  45. package/resources/ios/splash/Default-Landscape-736h.png +0 -0
  46. package/resources/ios/splash/Default-Landscape@2x~ipad.png +0 -0
  47. package/resources/ios/splash/Default-Landscape@~ipadpro.png +0 -0
  48. package/resources/ios/splash/Default-Landscape~ipad.png +0 -0
  49. package/resources/ios/splash/Default-Portrait@2x~ipad.png +0 -0
  50. package/resources/ios/splash/Default-Portrait@~ipadpro.png +0 -0
  51. package/resources/ios/splash/Default-Portrait~ipad.png +0 -0
  52. package/resources/ios/splash/Default@2x~iphone.png +0 -0
  53. package/resources/ios/splash/Default@2x~universal~anyany.png +0 -0
  54. package/resources/ios/splash/Default~iphone.png +0 -0
  55. package/src/app/app-routing.module.ts +6 -5
  56. package/src/app/app.component.html +0 -1
  57. package/src/app/app.component.ts +58 -26
  58. package/src/app/app.module.ts +3 -7
  59. package/src/app/chatlib/conversation-detail/conversation-content/conversation-content.component.spec.ts +0 -4
  60. package/src/app/chatlib/conversation-detail/conversation-content/conversation-content.component.ts +0 -38
  61. package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.html +10 -11
  62. package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.ts +1 -37
  63. package/src/app/chatlib/conversation-detail/message/image/image.component.html +0 -4
  64. package/src/app/chatlib/conversation-detail/message/image/image.component.ts +0 -21
  65. package/src/app/chatlib/conversation-detail/message/info-message/info-message.component.html +3 -3
  66. package/src/app/chatlib/conversation-detail/message/info-message/info-message.component.ts +0 -10
  67. package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.html +14 -12
  68. package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.scss +4 -0
  69. package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.ts +13 -13
  70. package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.html +14 -9
  71. package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.scss +4 -0
  72. package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.ts +20 -14
  73. package/src/app/components/conversation-detail/message-text-area/message-text-area.component.html +11 -13
  74. package/src/app/components/conversation-detail/message-text-area/message-text-area.component.scss +12 -9
  75. package/src/app/components/conversation-detail/message-text-area/message-text-area.component.ts +3 -24
  76. package/src/app/components/conversation-info/advanced-info-accordion/advanced-info-accordion.component.html +0 -13
  77. package/src/app/components/conversation-info/advanced-info-accordion/advanced-info-accordion.component.ts +0 -9
  78. package/src/app/components/conversation-info/conversation-info.module.ts +0 -2
  79. package/src/app/components/conversation-info/info-content/info-content.component.ts +0 -1
  80. package/src/app/components/conversation-info/info-group/info-group.component.ts +0 -11
  81. package/src/app/components/conversations-list/header-conversations-list/header-conversations-list.component.html +4 -10
  82. package/src/app/components/conversations-list/header-conversations-list/header-conversations-list.component.ts +1 -9
  83. package/src/app/components/project-item/project-item.component.html +2 -4
  84. package/src/app/components/project-item/project-item.component.ts +1 -19
  85. package/src/app/components/sidebar-user-details/sidebar-user-details.component.html +1 -1
  86. package/src/app/directives/tooltip.directive.spec.ts +20 -0
  87. package/src/app/directives/tooltip.directive.ts +134 -0
  88. package/src/app/pages/authentication/login/login.page.ts +1 -1
  89. package/src/app/pages/conversation-detail/conversation-detail.module.ts +0 -4
  90. package/src/app/pages/conversation-detail/conversation-detail.page.html +3 -3
  91. package/src/app/pages/conversation-detail/conversation-detail.page.ts +63 -33
  92. package/src/app/pages/conversations-list/conversations-list.page.scss +0 -1
  93. package/src/app/pages/conversations-list/conversations-list.page.ts +101 -19
  94. package/src/app/pages/profile-info/profile-info.module.ts +4 -2
  95. package/src/app/pages/profile-info/profile-info.page.html +76 -16
  96. package/src/app/pages/profile-info/profile-info.page.scss +71 -0
  97. package/src/app/pages/profile-info/profile-info.page.ts +89 -18
  98. package/src/app/shared/shared.module.ts +4 -4
  99. package/src/assets/chat21-logo.png +0 -0
  100. package/src/assets/images/channel_icons/chat21.svg +3 -0
  101. package/src/assets/images/channel_icons/direct.svg +3 -0
  102. package/src/assets/images/channel_icons/email-logo.svg +9 -0
  103. package/src/assets/images/channel_icons/form-logo_v2.svg +13 -0
  104. package/src/assets/images/channel_icons/group.svg +3 -0
  105. package/src/assets/images/channel_icons/messenger-logo.svg +8 -0
  106. package/src/assets/images/channel_icons/telegram-logo.svg +7 -0
  107. package/src/assets/images/channel_icons/whatsapp-logo.svg +12 -0
  108. package/src/assets/logo.png +0 -0
  109. package/src/assets/tiledesk-solo-logo.png +0 -0
  110. package/src/chat21-core/providers/firebase/firebase-auth-service.ts +1 -16
  111. package/src/chat21-core/providers/mqtt/mqtt-conversation-handler.ts +1 -0
  112. package/src/chat21-core/providers/mqtt/mqtt-notifications.ts +2 -2
  113. package/src/chat21-core/utils/constants.ts +7 -0
  114. package/src/chat21-core/utils/utils.ts +22 -12
  115. package/src/global.scss +134 -22
  116. package/src/index.html +1 -2
  117. package/resources/ios/icon.png +0 -0
  118. package/src/app/pages/details/details-routing.module.ts +0 -17
  119. package/src/app/pages/details/details.module.ts +0 -21
  120. package/src/app/pages/details/details.page.html +0 -28
  121. package/src/app/pages/details/details.page.scss +0 -23
  122. package/src/app/pages/details/details.page.spec.ts +0 -24
  123. package/src/app/pages/details/details.page.ts +0 -65
  124. package/src/assets/chat21-logo.svg +0 -78
@@ -58,7 +58,8 @@ import {
58
58
  MESSAGE_TYPE_OTHERS,
59
59
  URL_SOUND_LIST_CONVERSATION,
60
60
  TYPE_DIRECT,
61
- TYPE_MSG_EMAIL
61
+ TYPE_MSG_EMAIL,
62
+ TYPE_MSG_FORM
62
63
  } from 'src/chat21-core/utils/constants'
63
64
  import {
64
65
  checkPlatformIsMobile,
@@ -125,6 +126,7 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
125
126
  public translationsMap: Map<string, string> = new Map()
126
127
  public translationsHeaderMap: Map<string, string> = new Map()
127
128
  public translationsContentMap: Map<string, string> = new Map()
129
+ public translationsInfoConversationMap: Map<string, string> = new Map()
128
130
  public conversationAvatar: any
129
131
  public leadInfo: {lead_id: string, hasEmail: boolean , email: string, projectId: string, presence: {}};
130
132
  public liveInfo: {sourcePage: string, sourceTitle: string}
@@ -335,7 +337,8 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
335
337
  conv.channel_type,
336
338
  null,
337
339
  conv.attributes['projectId'],
338
- conv.attributes['project_name'])
340
+ conv.attributes['project_name']),
341
+ conv.attributes['channel']
339
342
  }
340
343
 
341
344
  }
@@ -603,7 +606,6 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
603
606
  'LABEL_LAST_ACCESS',
604
607
  'ARRAY_DAYS',
605
608
 
606
- 'LABEL_INFO_ADVANCED',
607
609
  'ID_CONVERSATION',
608
610
  'UPLOAD_FILE_ERROR',
609
611
  'LABEL_ENTER_MSG',
@@ -613,7 +615,7 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
613
615
  'FAILED_TO_UPLOAD_THE_FORMAT_IS NOT_SUPPORTED',
614
616
  'NO_INFORMATION_AVAILABLE',
615
617
  'CONTACT_ID',
616
- 'USER_ID',
618
+
617
619
  'UPLOAD',
618
620
  'CANNED_RESPONSES',
619
621
  'NO_CANNED_RESPONSES',
@@ -665,9 +667,15 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
665
667
  'COPY_MESSAGE_TOAST'
666
668
  ]
667
669
 
670
+ const keysContentInfo = [
671
+ 'LABEL_INFO_ADVANCED',
672
+ 'USER_ID'
673
+ ]
674
+
668
675
  this.translationsMap = this.customTranslateService.translateLanguage(keys)
669
676
  this.translationsHeaderMap = this.customTranslateService.translateLanguage(keysHeader)
670
677
  this.translationsContentMap = this.customTranslateService.translateLanguage(keysContentDetail)
678
+ this.translationsInfoConversationMap = this.customTranslateService.translateLanguage(keysContentInfo)
671
679
  this.logger.log('[CONVS-DETAIL] x this.translationMap ',this.translationsMap)
672
680
  }
673
681
 
@@ -776,7 +784,7 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
776
784
  private setAttributes(): any {
777
785
  const attributes: any = {
778
786
  client: navigator.userAgent,
779
- sourcePage: location.href,
787
+ sourcePage: location.href
780
788
  }
781
789
 
782
790
  //TODO: servono ???
@@ -839,7 +847,8 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
839
847
  conv.channel_type,
840
848
  null,
841
849
  conv.attributes['projectId'],
842
- conv.attributes['project_name']
850
+ conv.attributes['project_name'],
851
+ conv.attributes['channel']
843
852
  )
844
853
 
845
854
  }
@@ -856,7 +865,8 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
856
865
  conv.channel_type,
857
866
  null,
858
867
  conv.attributes['projectId'],
859
- conv.attributes['project_name']
868
+ conv.attributes['project_name'],
869
+ conv.attributes['channel']
860
870
  )
861
871
  let duration = getDateDifference(conv.timestamp, Date.now())
862
872
  duration.days > 10 && conv.channel_type !== TYPE_DIRECT? this.disableTextarea = true: this.disableTextarea = false
@@ -877,7 +887,8 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
877
887
  conv.channel_type,
878
888
  null,
879
889
  conv.attributes['projectId'],
880
- conv.attributes['project_name']
890
+ conv.attributes['project_name'],
891
+ conv.attributes['channel']
881
892
  )
882
893
  let duration = getDateDifference(conv.timestamp, Date.now())
883
894
  duration.days > 10 && conv.channel_type !== TYPE_DIRECT? this.disableTextarea = true: this.disableTextarea = false
@@ -892,7 +903,8 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
892
903
  conv.channel_type,
893
904
  null,
894
905
  conv.attributes['projectId'],
895
- conv.attributes['project_name']
906
+ conv.attributes['project_name'],
907
+ conv.attributes['channel']
896
908
  )
897
909
  }
898
910
  this.logger.log('[CONVS-DETAIL] - setHeaderContent > conversationAvatar: ', this.conversationAvatar)
@@ -1047,23 +1059,27 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
1047
1059
  msg = `[${metadata.name}](${metadata.src})`
1048
1060
  }
1049
1061
  }
1050
-
1062
+ this.conversation.attributes && this.conversation.attributes['channel']? attributes.channel = this.conversation.attributes['channel']: null;
1051
1063
  metadata ? (metadata = metadata) : (metadata = '')
1052
- const emailSectionMsg = (attributes && attributes['channel']===TYPE_MSG_EMAIL)
1064
+ this.logger.log('[CONVS-DETAIL] attributes--->>>> 1111',this.conversation.attributes, attributes)
1053
1065
  this.logger.log('[CONVS-DETAIL] - SEND MESSAGE msg: ', msg, ' - messages: ', this.messages, ' - loggedUser: ', this.loggedUser)
1054
-
1066
+
1067
+
1068
+ const emailSectionMsg = (attributes && attributes['offline_channel']===TYPE_MSG_EMAIL)
1069
+ const channelIsNotEmailOrForm = (attributes && attributes['channel'] && (attributes['channel'] === TYPE_MSG_EMAIL || attributes['channel']===TYPE_MSG_FORM))
1070
+
1055
1071
  if ((msg && msg.trim() !== '') || type !== TYPE_MSG_TEXT) {
1056
1072
 
1057
1073
 
1058
1074
  if(this.isEmailEnabled &&
1059
1075
  this.leadInfo && this.leadInfo.presence && this.leadInfo.presence['status']=== 'offline' &&
1060
- this.leadInfo.email && !emailSectionMsg){
1076
+ this.leadInfo.email && !emailSectionMsg && !channelIsNotEmailOrForm){
1061
1077
  this.logger.log('[CONVS-DETAIL] - SEND MESSAGE --> SENDING EMAIL', msg, this.leadInfo.email)
1062
1078
  let msgText = this.createEmailText(msg)
1063
1079
  this.sendEmail(msgText).subscribe(status => {
1064
1080
  if(status){
1065
1081
  //SEND MESSAGE ALSO AS EMAIL
1066
- attributes['channel']= 'offline_'+TYPE_MSG_EMAIL
1082
+ attributes['offline_channel']= 'offline_'+TYPE_MSG_EMAIL
1067
1083
  }
1068
1084
 
1069
1085
  this.conversationHandlerService.sendMessage(
@@ -1095,6 +1111,9 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
1095
1111
  this.segmentNewAgentMessage(this.conversation)
1096
1112
  }
1097
1113
  }
1114
+
1115
+
1116
+
1098
1117
  // ----------------------------------------------------------
1099
1118
  // InitSubscriptions BS subscriptions
1100
1119
  // ----------------------------------------------------------
@@ -1238,7 +1257,8 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
1238
1257
  this.channelType,
1239
1258
  null,
1240
1259
  this.conversation.attributes['projectId'],
1241
- this.conversation.attributes['project_name']
1260
+ this.conversation.attributes['project_name'],
1261
+ this.conversation.attributes['channel']
1242
1262
  )
1243
1263
  }
1244
1264
  if (msg.attributes && msg.attributes.hasOwnProperty("updateUserEmail")) {
@@ -1250,7 +1270,8 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
1250
1270
  this.channelType,
1251
1271
  userEmail,
1252
1272
  this.conversation.attributes['projectId'],
1253
- this.conversation.attributes['project_name']
1273
+ this.conversation.attributes['project_name'],
1274
+ this.conversation.attributes['channel']
1254
1275
  )
1255
1276
  this.getLeadDetail()
1256
1277
  }
@@ -1622,23 +1643,23 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
1622
1643
  // * if I'm in the conversation at the bottom of the page -> NO SOUND
1623
1644
  // * otherwise -> SOUND
1624
1645
  // ----------------------------------------------------------
1625
- soundMessage() {
1626
- const that = this
1627
- this.audio = new Audio()
1628
- // this.audio.src = '/assets/sounds/pling.mp3';
1629
- this.audio.src = URL_SOUND_LIST_CONVERSATION
1630
- this.audio.load()
1631
- this.logger.log('[CONVS-DETAIL] soundMessage conversation this.audio',this.audio)
1632
- clearTimeout(this.setTimeoutSound)
1633
- this.setTimeoutSound = setTimeout(function () {
1634
- that.audio.play().then(() => {
1635
- // Audio is playing.
1636
- this.logger.log('[CONVS-DETAIL] soundMessag that.audio.src ',that.audio.src)
1637
- }).catch((error) => {
1638
- that.logger.error(error)
1639
- })
1640
- }, 1000)
1641
- }
1646
+ // soundMessage() {
1647
+ // const that = this
1648
+ // this.audio = new Audio()
1649
+ // // this.audio.src = '/assets/sounds/pling.mp3';
1650
+ // this.audio.src = URL_SOUND_LIST_CONVERSATION
1651
+ // this.audio.load()
1652
+ // this.logger.log('[CONVS-DETAIL] soundMessage conversation this.audio',this.audio)
1653
+ // clearTimeout(this.setTimeoutSound)
1654
+ // this.setTimeoutSound = setTimeout(function () {
1655
+ // that.audio.play().then(() => {
1656
+ // // Audio is playing.
1657
+ // this.logger.log('[CONVS-DETAIL] soundMessag that.audio.src ',that.audio.src)
1658
+ // }).catch((error) => {
1659
+ // that.logger.error(error)
1660
+ // })
1661
+ // }, 1000)
1662
+ // }
1642
1663
 
1643
1664
  onBeforeMessageRenderFN(event) {
1644
1665
  //this.onBeforeMessageRender.emit(event)
@@ -1732,6 +1753,7 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
1732
1753
  }
1733
1754
  }
1734
1755
 
1756
+ //DESKTOP HANDLER
1735
1757
  onOpenCloseInfoConversation(event){
1736
1758
  this.logger.debug('[CONVS-DETAIL] onOpenCloseInfoConversation - openInfoConversation ', event)
1737
1759
  this.resizeTextArea()
@@ -1739,6 +1761,14 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
1739
1761
  this.USER_HAS_OPENED_CLOSE_INFO_CONV = true
1740
1762
  }
1741
1763
 
1764
+ //MOBILE HANDLER
1765
+ onOpenInfoConversation(event){
1766
+ this.logger.debug('[CONVS-DETAIL] onOpenCloseInfoConversation - openInfoConversation ', event)
1767
+ this.resizeTextArea()
1768
+ this.openInfoConversation = event
1769
+ this.USER_HAS_OPENED_CLOSE_INFO_CONV = true
1770
+ }
1771
+
1742
1772
  onOpenFooterSection(event: string){
1743
1773
  this.logger.debug('[CONVS-DETAIL] onOpenFooterSection - section ', event)
1744
1774
  if(event === 'email'){
@@ -1,4 +1,3 @@
1
- @import '~perfect-scrollbar/css/perfect-scrollbar.css';
2
1
 
3
2
  ion-header {
4
3
  border-bottom-style: solid;
@@ -23,7 +23,6 @@ import {
23
23
  } from '../../../chat21-core/utils/utils'
24
24
 
25
25
  import { EventsService } from '../../services/events-service'
26
- import PerfectScrollbar from 'perfect-scrollbar' // https://github.com/mdbootstrap/perfect-scrollbar
27
26
 
28
27
  // services
29
28
  import { ConversationsHandlerService } from 'src/chat21-core/providers/abstract/conversations-handler.service'
@@ -46,9 +45,10 @@ import { LoggerService } from 'src/chat21-core/providers/abstract/logger.service
46
45
  import { LoggerInstance } from 'src/chat21-core/providers/logger/loggerInstance'
47
46
  import { NetworkService } from 'src/app/services/network-service/network.service'
48
47
  import { Subject } from 'rxjs'
49
- import { takeUntil } from 'rxjs/operators'
48
+ import { skip, takeUntil } from 'rxjs/operators'
50
49
  import { TYPE_DIRECT } from 'src/chat21-core/utils/constants';
51
50
  import { getProjectIdSelectedConversation } from 'src/chat21-core/utils/utils-message';
51
+ import { WebsocketService } from 'src/app/services/websocket/websocket.service';
52
52
 
53
53
  @Component({
54
54
  selector: 'app-conversations-list',
@@ -80,6 +80,7 @@ export class ConversationListPage implements OnInit {
80
80
  private isShowMenuPage = false
81
81
  private logger: LoggerService = LoggerInstance.getInstance()
82
82
  translationMapConversation: Map<string, string>
83
+ translationMapHeader: Map<string, string>
83
84
  stylesMap: Map<string, string>
84
85
 
85
86
  public conversationType = 'active'
@@ -97,15 +98,16 @@ export class ConversationListPage implements OnInit {
97
98
  public isMobile: boolean = false;
98
99
  public isInitialized: boolean = false;
99
100
 
100
- tooltipOptions = {
101
- 'show-delay': 1500,
102
- 'tooltip-class': 'chat-tooltip',
103
- 'theme': 'light',
104
- 'shadow': false,
105
- 'hide-delay-mobile': 0,
106
- 'hideDelayAfterClick': 3000,
107
- 'hide-delay': 200,
108
- }
101
+ // PROJECT AVAILABILITY INFO: start
102
+ project: { _id: string, name: string, type: string, isActiveSubscription: boolean, plan_name: string}
103
+ profile_name_translated: string;
104
+ selectedStatus: any;
105
+ teammateStatus = [
106
+ { id: 1, name: 'Available', avatar: 'assets/images/teammate-status/avaible.svg', label: "LABEL_AVAILABLE" },
107
+ { id: 2, name: 'Unavailable', avatar: 'assets/images/teammate-status/unavaible.svg', label: "LABEL_NOT_AVAILABLE" },
108
+ { id: 3, name: 'Inactive', avatar: 'assets/images/teammate-status/inactive.svg', label: "LABEL_INACTIVE" },
109
+ ];
110
+ // PROJECT AVAILABILITY INFO: end
109
111
 
110
112
  constructor(
111
113
  private router: Router,
@@ -124,9 +126,10 @@ export class ConversationListPage implements OnInit {
124
126
  public tiledeskAuthService: TiledeskAuthService,
125
127
  public appConfigProvider: AppConfigProvider,
126
128
  public platform: Platform,
127
- private networkService: NetworkService,
129
+ public wsService: WebsocketService,
128
130
  ) {
129
131
  this.checkPlatform();
132
+ this.translations();
130
133
  this.listenToAppCompConvsLengthOnInitConvs()
131
134
  this.listenToAppIsInitialized()
132
135
  this.listenToLogoutEvent()
@@ -136,7 +139,9 @@ export class ConversationListPage implements OnInit {
136
139
  this.listenToSwPostMessage()
137
140
  this.listenSupportConvIdHasChanged()
138
141
  // this.listenDirectConvIdHasChanged();
139
- this.listenToCloseConvFromHeaderConversation()
142
+ this.listenToCloseConvFromHeaderConversation();
143
+ this.listenToCurrentStoredProject()
144
+ this.listenTocurrentProjectUserUserAvailability$()
140
145
  }
141
146
 
142
147
  private checkPlatform(){
@@ -149,6 +154,15 @@ export class ConversationListPage implements OnInit {
149
154
  }
150
155
  }
151
156
 
157
+ private translations(){
158
+ const keysConversation = ['CLOSED', 'Resolve']
159
+ const keysHeader = ['ProPlanTrial', 'FreePlan', 'PaydPlanNamePro', 'PaydPlanNameEnterprise']
160
+
161
+ this.translationMapConversation = this.translateService.translateLanguage( keysConversation )
162
+ this.translationMapHeader = this.translateService.translateLanguage( keysHeader )
163
+
164
+ }
165
+
152
166
  listenSupportConvIdHasChanged() {
153
167
  this.events.subscribe('supportconvid:haschanged', (IDConv) => {
154
168
  // console.log('[CONVS-LIST-PAGE] - listen To convid:haschanged - convId', IDConv);
@@ -381,9 +395,7 @@ export class ConversationListPage implements OnInit {
381
395
  // }
382
396
 
383
397
  initArchivedConversationsHandler() {
384
- const keysConversation = ['CLOSED', 'Resolve']
385
- this.translationMapConversation = this.translateService.translateLanguage( keysConversation )
386
-
398
+
387
399
  this.archivedConversationsHandlerService.subscribeToConversations(() => {
388
400
  this.logger.log('[CONVS-LIST-PAGE]-CONVS - conversations archived length ',this.archivedConversations.length)
389
401
  })
@@ -465,6 +477,76 @@ export class ConversationListPage implements OnInit {
465
477
  this.events.subscribe('storage:sound', value => this.sound_btn = value)
466
478
  }
467
479
 
480
+ listenToCurrentStoredProject() {
481
+ this.events.subscribe('storage:last_project', projectObjct => {
482
+ if (projectObjct && projectObjct !== 'undefined') {
483
+ // console.log('[CONVS-LIST-PAGE] - GET STORED PROJECT ', projectObjct)
484
+
485
+ this.project = {
486
+ _id: projectObjct['id_project']['_id'],
487
+ name: projectObjct['id_project']['name'],
488
+ type: projectObjct['id_project']['profile']['type'],
489
+ isActiveSubscription: projectObjct['id_project']['isActiveSubscription'],
490
+ plan_name: projectObjct['id_project']['profile']['name']
491
+ }
492
+
493
+ const trial_expired = projectObjct['id_project']['trialExpired']
494
+ const profile_name = projectObjct['id_project']['profile']['name'];
495
+
496
+ if (this.project.type === 'free') {
497
+
498
+ if (trial_expired === false) {
499
+ this.profile_name_translated = this.translationMapHeader.get('ProPlanTrial');
500
+ } else if (trial_expired === true) {
501
+ this.profile_name_translated = this.translationMapHeader.get('FreePlan');
502
+ }
503
+ } else if (this.project.type === 'payment' && profile_name === 'pro') {
504
+ this.profile_name_translated = this.translationMapHeader.get('PaydPlanNamePro');
505
+ } else if (this.project.type === 'payment' && profile_name === 'enterprise') {
506
+ this.profile_name_translated = this.translationMapHeader.get('PaydPlanNameEnterprise');
507
+ }
508
+ }
509
+ })
510
+
511
+ try {
512
+ // this.tiledeskToken = this.appStorageService.getItem('tiledeskToken');
513
+ // console.log('[SIDEBAR-USER-DETAILS] - GET STORED TOKEN ', this.tiledeskToken)
514
+ } catch (err) {
515
+ this.logger.error('[CONVS-LIST-PAGE] - GET STORED TOKEN ', err)
516
+ }
517
+ }
518
+
519
+ listenTocurrentProjectUserUserAvailability$() {
520
+ this.wsService.currentProjectUserAvailability$.pipe(skip(1)).subscribe((projectUser) => {
521
+ this.logger.log('[CONVS-LIST-PAGE] - $UBSC TO WS USER AVAILABILITY & BUSY STATUS RES ', projectUser);
522
+
523
+ if (projectUser) {
524
+ if (projectUser['user_available'] === false && projectUser['profileStatus'] === 'inactive') {
525
+ // console.log('teammateStatus ', this.teammateStatus)
526
+ this.selectedStatus = this.teammateStatus[2].id;
527
+ this.logger.debug('[CONVS-LIST-PAGE] - PROFILE_STATUS selected option', this.teammateStatus[2].name);
528
+ this.teammateStatus = this.teammateStatus.slice(0)
529
+ } else if (projectUser['user_available'] === false && (projectUser['profileStatus'] === '' || !projectUser['profileStatus'])) {
530
+ this.selectedStatus = this.teammateStatus[1].id;
531
+ this.logger.debug('[CONVS-LIST-PAGE] - PROFILE_STATUS selected option', this.teammateStatus[1].name);
532
+ this.teammateStatus = this.teammateStatus.slice(0)
533
+ } else if (projectUser['user_available'] === true && (projectUser['profileStatus'] === '' || !projectUser['profileStatus'])) {
534
+ this.selectedStatus = this.teammateStatus[0].id
535
+ this.teammateStatus = this.teammateStatus.slice(0)
536
+ this.logger.debug('[CONVS-LIST-PAGE] - PROFILE_STATUS selected option', this.teammateStatus[0].name);
537
+ }
538
+ // this.IS_BUSY = projectUser['isBusy']
539
+ // this.USER_ROLE = projectUser['role']
540
+ // this.translateUserRole(this.USER_ROLE)
541
+ }
542
+
543
+ }, (error) => {
544
+ this.logger.error('[CONVS-LIST-PAGE] - $UBSC TO WS USER AVAILABILITY & BUSY STATUS error ', error);
545
+ }, () => {
546
+ this.logger.log('[CONVS-LIST-PAGE] - $UBSC TO WS USER AVAILABILITY & BUSY STATUS * COMPLETE *');
547
+ })
548
+ }
549
+
468
550
  // ------------------------------------------------------------------
469
551
  // SUBSCRIPTIONS
470
552
  // ------------------------------------------------------------------
@@ -868,12 +950,12 @@ export class ConversationListPage implements OnInit {
868
950
  // Opens logged user profile modal
869
951
  // ---------------------------------------------------------
870
952
  openProfileInfo(event: any) {
871
- const TOKEN = this.messagingAuthService.getToken()
953
+ const TOKEN = this.tiledeskAuthService.getTiledeskToken()
872
954
  this.logger.log('[CONVS-LIST-PAGE] open ProfileInfoPage TOKEN ', TOKEN)
873
955
  if (checkPlatformIsMobile()) {
874
- presentModal(this.modalController, ProfileInfoPage, { token: TOKEN })
956
+ presentModal(this.modalController, ProfileInfoPage, { token: TOKEN, selectedStatus: this.selectedStatus, project: this.project, profile_name_translated: this.profile_name_translated })
875
957
  } else {
876
- this.navService.push(ProfileInfoPage, { token: TOKEN })
958
+ this.navService.push(ProfileInfoPage, { token: TOKEN, selectedStatus: this.selectedStatus, project: this.project, profile_name_translated: this.profile_name_translated })
877
959
  }
878
960
  }
879
961
 
@@ -1,3 +1,4 @@
1
+ import { MatTooltipModule } from '@angular/material/tooltip';
1
2
  import { NgModule } from '@angular/core';
2
3
  import { CommonModule } from '@angular/common';
3
4
  import { FormsModule } from '@angular/forms';
@@ -14,7 +15,7 @@ import { SharedModule } from 'src/app/shared/shared.module';
14
15
 
15
16
  import { ProfileInfoPageRoutingModule } from './profile-info-routing.module';
16
17
  import { ProfileInfoPage } from './profile-info.page';
17
- import { TooltipModule } from 'ng2-tooltip-directive';
18
+ import { NgSelectModule } from '@ng-select/ng-select';
18
19
 
19
20
  @NgModule({
20
21
  imports: [
@@ -22,9 +23,10 @@ import { TooltipModule } from 'ng2-tooltip-directive';
22
23
  FormsModule,
23
24
  IonicModule,
24
25
  ProfileInfoPageRoutingModule,
25
- TooltipModule,
26
26
  // AvatarModule,
27
27
  SharedModule,
28
+ NgSelectModule,
29
+ MatTooltipModule,
28
30
  TranslateModule.forChild({
29
31
  loader: {
30
32
  provide: TranslateLoader,
@@ -20,20 +20,18 @@
20
20
 
21
21
 
22
22
  <!-- <div class="avatar-container"> -->
23
- <div class="avatar-container" [tooltip]="useruidTooltip" [options]="tooltipOptions" placement="top"
24
- content-type="template" (click)="copyLoggedUserUID()">
23
+ <div class="avatar-container" tooltip="{{loggedUser.uid}}" placement="top"
24
+ contentType="template" (click)="copyLoggedUserUID()">
25
25
  <app-avatar-profile [itemAvatar]=itemAvatar></app-avatar-profile>
26
26
  </div>
27
- <ng-template #useruidTooltip>
28
- <span> {{loggedUser.uid}}</span>
29
- </ng-template>
30
27
 
31
- <div class="user-presence">
28
+
29
+ <!-- <div class="user-presence">
32
30
  <app-user-presence
33
31
  [idUser]=loggedUser.uid
34
32
  [translationMap]=translationMap>
35
33
  </app-user-presence>
36
- </div>
34
+ </div> -->
37
35
 
38
36
 
39
37
  <!--
@@ -52,7 +50,7 @@
52
50
  </div>
53
51
  </div>
54
52
 
55
- <ion-list *ngIf="loggedUser">
53
+ <div *ngIf="loggedUser" style="margin:10px">
56
54
  <!-- <ion-item lines="none" class="sidebar-items" (click)="onClickArchivedConversation()">
57
55
  <div tabindex="0"></div>
58
56
  <ion-icon name="archive-outline" class="sidebar-icons"></ion-icon>
@@ -61,15 +59,77 @@
61
59
  </ion-label>
62
60
  </ion-item> -->
63
61
 
64
- <ion-item lines="none" class="sidebar-items" (click)="onLogout()">
65
- <div tabindex="0"></div>
66
- <ion-icon name="log-out-outline" class="sidebar-icons"></ion-icon>
67
- <ion-label class="sidebar-labels">
68
- <h3>{{ 'LABEL_LOGOUT' | translate }}</h3>
69
- </ion-label>
70
- </ion-item>
62
+ <section class="availability-section">
63
+ <!-- <mat-slide-toggle (change)="changeAvailabilityStateInUserDetailsSidebar(IS_AVAILABLE = !IS_AVAILABLE)"
64
+ class="custom-mat-slide-toggle" [checked]="IS_AVAILABLE" labelPosition="before">
65
+
66
+ <span *ngIf="IS_AVAILABLE"
67
+ style="font-weight: 400 !important; text-transform: capitalize; font-size:14px; color:#a9afbb">
68
+ {{IS_AVAILABLE_msg}}
69
+ </span>
70
+ <span *ngIf="!IS_AVAILABLE"
71
+ style="font-weight: 400 !important;text-transform: capitalize;font-size:14px; color:#a9afbb">
72
+ {{IS_UNAVAILABLE_msg}}
73
+ </span>
74
+ </mat-slide-toggle> -->
75
+ <ng-select style="text-align: left;"
76
+ (change)="changeAvailabilityStateInUserDetailsSidebar(selectedStatus)"
77
+ [(ngModel)]="selectedStatus"
78
+ class="teammate-status-in-drawer profile-info"
79
+ [items]="teammateStatus"
80
+ bindLabel="name" bindValue="id"
81
+ [clearable]="false"
82
+ [searchable]="false">
83
+ <!-- {{teammateStatus.name}} -->
84
+ <ng-template ng-label-tmp let-item="item">
85
+ <img style="width: 15px;height: 15px;position: relative; top: 1px;" height="15" width="15" [src]="item?.avatar" />
86
+ <span id="sidebaravatar_{{item.name}}" style="text-transform: capitalize; margin-left:8px"> {{item.label}} </span>
87
+ </ng-template>
88
+ <ng-template ng-option-tmp let-item="item" let-index="index">
89
+ <img style="width: 15px;height: 15px;position: relative; top: 1px;" height="15" width="15" [src]="item?.avatar" />
90
+ <span id="sidebaravatar_{{item.name}}" style="text-transform: capitalize; margin-left:8px"> {{item.label}} </span>
91
+ </ng-template>
92
+ </ng-select>
93
+ </section>
71
94
 
72
- </ion-list>
95
+ <hr class="first-divider">
96
+
97
+ <section *ngIf="isVisiblePAY" class="user-details-plan-info">
98
+ <span class="material-icons user-details-plan-icon">apps</span>
99
+ <span>
100
+ <div> {{project?.name}} </div>
101
+ <div style="display: inline-block; margin-left: 26px;"> {{ profile_name_translated }} </div>
102
+
103
+ <div *ngIf="project?.type === 'payment' && project?.isActiveSubscription === false"
104
+ style="color:#f44336; position:relative; top: -1px;display: inline-block;">
105
+ <i *ngIf="project?.plan_name !== 'enterprise'" class="material-icons" style="vertical-align: middle; color:#f44336; cursor:pointer;
106
+ font-size: 16px;" matTooltipClass="custom-mat-tooltip"
107
+ matTooltip="{{ translationsMap.get('SubscriptionPaymentProblem') }}" #tooltip="matTooltip" matTooltipPosition='right'
108
+ matTooltipHideDelay="100">
109
+ error_outline
110
+ </i>
111
+ <i *ngIf="project?.plan_name === 'enterprise'" class="material-icons" style="vertical-align: middle; color:#f44336; cursor:pointer;
112
+ font-size: 16px;" matTooltipClass="custom-mat-tooltip" matTooltip="{{ translationsMap.get('ThePlanHasExpired') }}"
113
+ #tooltip="matTooltip" matTooltipPosition='right' matTooltipHideDelay="100">
114
+ error_outline
115
+ </i>
116
+ </div>
117
+ </span>
118
+ </section>
119
+
120
+ <section class="user-details-footer-section"
121
+ [ngClass]="{'footer-margin-top-pricing-no-visible': isVisiblePAY === false }">
122
+ <div role="button" class="logout-btn-wpr" (click)="onLogout()">
123
+ <i class="material-icons user-details-logout-icon" >
124
+ logout
125
+ </i>
126
+ <div class="user-details-logout-text">
127
+ {{translationsMap.get('LABEL_LOGOUT')}}
128
+ </div>
129
+ </div>
130
+ </section>
131
+
132
+ </div>
73
133
 
74
134
  </ion-content>
75
135
 
@@ -68,7 +68,78 @@
68
68
  // }
69
69
  // }
70
70
 
71
+ .availability-section {
72
+ // top: 320px;
73
+ text-align: center;
74
+ background-color: #2d323e;
75
+ padding: 4px 0px;
76
+ width: 192px;
77
+ border-radius: 4px;
78
+ // -webkit-transform: translateX(-50%);
79
+ // transform: translateX(-50%);
80
+ // left: 50%;
81
+ margin: auto;
82
+ // position: absolute;
83
+ }
84
+
85
+ .first-divider {
86
+ // margin-top: 365px;
87
+ border: 0;
88
+ border-top: 1px solid rgba(255, 255, 255, 0.2);
89
+ margin-bottom: 20px;
90
+ }
91
+
92
+ .user-details-plan-info {
93
+ font-size: 13px;
94
+ text-transform: capitalize;
95
+ color: #a9afbb;
96
+ font-weight: 500;
97
+ line-height: 21px;
98
+ }
99
+
100
+ .user-details-plan-icon {
101
+ display: block;
102
+ float: left;
103
+ font-size: 20px;
104
+ margin-right: 6px;
105
+ }
106
+
107
+ .user-details-footer-section {
108
+ -webkit-transform: translateX(-50%);
109
+ transform: translateX(-50%);
110
+ left: 50%;
111
+ margin: auto;
112
+ position: absolute;
113
+ text-align: center;
114
+
115
+ padding-bottom: 15px;
116
+ padding-top: 100px;
117
+ font-size: 16px;
118
+ font-weight: 400;
119
+ z-index: 1;
120
+ // bottom: 50px;
121
+ // bottom: 55px;
122
+
123
+ }
71
124
 
125
+ .logout-btn-wpr {
126
+ cursor: pointer;
127
+ color: #fff;
128
+ }
129
+
130
+ .footer-margin-top-pricing-no-visible {
131
+ padding-top: 240px;
132
+ }
133
+
134
+ .user-details-logout-icon {
135
+ color: #a9afbb;
136
+ font-size: 30px;
137
+ // margin-top: 30px;
138
+ }
139
+
140
+ .user-details-logout-icon:hover {
141
+ color: #fff;
142
+ }
72
143
 
73
144
 
74
145
  .current-user-profile {