@chat21/chat21-ionic 3.0.83 → 3.0.86-rc.1

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 (173) hide show
  1. package/CHANGELOG.md +124 -4
  2. package/README.md +2 -2
  3. package/deploy_amazon_beta.sh +29 -0
  4. package/deploy_amazon_prod.sh +30 -0
  5. package/package.json +4 -3
  6. package/src/app/app-routing.module.ts +7 -2
  7. package/src/app/app.component.html +7 -1
  8. package/src/app/app.component.scss +20 -2
  9. package/src/app/app.component.ts +231 -114
  10. package/src/app/app.module.ts +8 -3
  11. package/src/app/chatlib/conversation-detail/conversation-content/conversation-content.component.ts +8 -1
  12. package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.html +86 -23
  13. package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.scss +188 -88
  14. package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.ts +42 -3
  15. package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.html +11 -24
  16. package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.scss +6 -10
  17. package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.spec.ts +2 -2
  18. package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.ts +16 -26
  19. package/src/app/chatlib/conversation-detail/message/buttons/action-button/action-button.component.html +5 -1
  20. package/src/app/chatlib/conversation-detail/message/buttons/action-button/action-button.component.scss +22 -15
  21. package/src/app/chatlib/conversation-detail/message/buttons/action-button/action-button.component.ts +25 -5
  22. package/src/app/chatlib/conversation-detail/message/buttons/link-button/link-button.component.html +2 -1
  23. package/src/app/chatlib/conversation-detail/message/buttons/link-button/link-button.component.scss +14 -15
  24. package/src/app/chatlib/conversation-detail/message/buttons/link-button/link-button.component.ts +24 -5
  25. package/src/app/chatlib/conversation-detail/message/buttons/text-button/text-button.component.html +6 -1
  26. package/src/app/chatlib/conversation-detail/message/buttons/text-button/text-button.component.scss +12 -13
  27. package/src/app/chatlib/conversation-detail/message/buttons/text-button/text-button.component.ts +26 -5
  28. package/src/app/chatlib/conversation-detail/message/frame/frame.component.html +8 -2
  29. package/src/app/chatlib/conversation-detail/message/frame/frame.component.scss +36 -0
  30. package/src/app/chatlib/conversation-detail/message/frame/frame.component.ts +2 -2
  31. package/src/app/chatlib/conversation-detail/message/html/html.component.ts +0 -1
  32. package/src/app/chatlib/conversation-detail/message/image/image.component.html +3 -2
  33. package/src/app/chatlib/conversation-detail/message/image/image.component.scss +17 -5
  34. package/src/app/chatlib/conversation-detail/message/image/image.component.ts +1 -1
  35. package/src/app/chatlib/conversation-detail/message/info-message/info-message.component.scss +3 -2
  36. package/src/app/chatlib/conversation-detail/message/message-attachment/message-attachment.component.html +16 -6
  37. package/src/app/chatlib/conversation-detail/message/message-attachment/message-attachment.component.scss +1 -3
  38. package/src/app/chatlib/conversation-detail/message/message-attachment/message-attachment.component.ts +2 -0
  39. package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.html +78 -52
  40. package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.scss +63 -20
  41. package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.ts +14 -10
  42. package/src/app/components/canned-response/canned-response.component.html +9 -9
  43. package/src/app/components/canned-response/canned-response.component.scss +14 -7
  44. package/src/app/components/canned-response/canned-response.component.ts +5 -4
  45. package/src/app/components/contacts-directory/contacts-directory.component.html +22 -26
  46. package/src/app/components/contacts-directory/contacts-directory.component.scss +8 -6
  47. package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.html +64 -47
  48. package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.scss +98 -61
  49. package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.ts +24 -40
  50. package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component_2.html +116 -0
  51. package/src/app/components/conversation-detail/message-text-area/message-text-area.component.html +39 -42
  52. package/src/app/components/conversation-detail/message-text-area/message-text-area.component.scss +67 -4
  53. package/src/app/components/conversation-detail/message-text-area/message-text-area.component.ts +82 -152
  54. package/src/app/components/conversation-info/info-content/info-content.component.html +23 -2
  55. package/src/app/components/conversation-info/info-content/info-content.component.ts +3 -6
  56. package/src/app/components/conversation-info/info-direct/info-direct.component.html +7 -14
  57. package/src/app/components/conversation-info/info-direct/info-direct.component.scss +23 -0
  58. package/src/app/components/conversation-info/info-direct/info-direct.component.ts +1 -6
  59. package/src/app/components/conversation-info/info-group/info-group.component.html +44 -108
  60. package/src/app/components/conversation-info/info-group/info-group.component.scss +101 -61
  61. package/src/app/components/conversation-info/info-group/info-group.component.ts +1 -0
  62. package/src/app/components/conversation-info/info-support-group/info-support-group.component.html +2 -1
  63. package/src/app/components/conversation-info/info-support-group/info-support-group.component.ts +0 -1
  64. package/src/app/components/{ddp-header/ddp-header.component.html → conversations-list/header-conversations-list/header-conversations-list.component.html} +3 -3
  65. package/src/app/components/{ddp-header/ddp-header.component.scss → conversations-list/header-conversations-list/header-conversations-list.component.scss} +16 -4
  66. package/src/app/components/{conversation-detail/bubble-my-message/bubble-my-message.component.spec.ts → conversations-list/header-conversations-list/header-conversations-list.component.spec.ts} +6 -6
  67. package/src/app/components/{ddp-header/ddp-header.component.ts → conversations-list/header-conversations-list/header-conversations-list.component.ts} +7 -16
  68. package/src/app/components/conversations-list/header-conversations-list-archived/header-conversations-list-archived.component.html +12 -0
  69. package/src/app/components/conversations-list/header-conversations-list-archived/header-conversations-list-archived.component.scss +14 -0
  70. package/src/app/components/{conversation-detail/option-header/option-header.component.spec.ts → conversations-list/header-conversations-list-archived/header-conversations-list-archived.component.spec.ts} +5 -5
  71. package/src/app/components/{conversation-detail/option-header/option-header.component.ts → conversations-list/header-conversations-list-archived/header-conversations-list-archived.component.ts} +5 -4
  72. package/src/app/components/navbar/navbar.component.html +103 -0
  73. package/src/app/components/navbar/navbar.component.scss +249 -0
  74. package/src/app/components/{ddp-header/ddp-header.component.spec.ts → navbar/navbar.component.spec.ts} +6 -6
  75. package/src/app/components/navbar/navbar.component.ts +190 -0
  76. package/src/app/components/project-item/project-item.component.html +98 -149
  77. package/src/app/components/project-item/project-item.component.scss +43 -35
  78. package/src/app/components/project-item/project-item.component.ts +16 -4
  79. package/src/app/components/sidebar-user-details/sidebar-user-details.component.html +5 -5
  80. package/src/app/components/sidebar-user-details/sidebar-user-details.component.ts +24 -13
  81. package/src/app/components/utils/user-presence/user-presence.component.html +7 -2
  82. package/src/app/components/utils/user-presence/user-presence.component.scss +35 -18
  83. package/src/app/components/utils/user-presence/user-presence.component.ts +6 -10
  84. package/src/app/{pages → modals}/create-canned-response/create-canned-response-routing.module.ts +0 -0
  85. package/src/app/{pages → modals}/create-canned-response/create-canned-response.module.ts +0 -0
  86. package/src/app/{pages → modals}/create-canned-response/create-canned-response.page.html +0 -0
  87. package/src/app/{pages → modals}/create-canned-response/create-canned-response.page.scss +0 -0
  88. package/src/app/{pages → modals}/create-canned-response/create-canned-response.page.spec.ts +0 -0
  89. package/src/app/{pages → modals}/create-canned-response/create-canned-response.page.ts +13 -13
  90. package/src/app/{pages → modals}/loader-preview/loader-preview-routing.module.ts +0 -0
  91. package/src/app/{pages → modals}/loader-preview/loader-preview.module.ts +0 -0
  92. package/src/app/{pages → modals}/loader-preview/loader-preview.page.html +1 -1
  93. package/src/app/{pages → modals}/loader-preview/loader-preview.page.scss +4 -0
  94. package/src/app/{pages → modals}/loader-preview/loader-preview.page.spec.ts +0 -0
  95. package/src/app/{pages → modals}/loader-preview/loader-preview.page.ts +1 -2
  96. package/src/app/modals/send-email/send-email-routing.module.ts +17 -0
  97. package/src/app/modals/send-email/send-email.module.ts +31 -0
  98. package/src/app/modals/send-email/send-email.page.html +46 -0
  99. package/src/app/modals/send-email/send-email.page.scss +161 -0
  100. package/src/app/modals/send-email/send-email.page.spec.ts +24 -0
  101. package/src/app/modals/send-email/send-email.page.ts +89 -0
  102. package/src/app/pages/contacts-directory/contacts-directory.page.html +1 -1
  103. package/src/app/pages/contacts-directory/contacts-directory.page.scss +47 -0
  104. package/src/app/pages/contacts-directory/contacts-directory.page.ts +2 -0
  105. package/src/app/pages/conversation-detail/conversation-detail.module.ts +0 -8
  106. package/src/app/pages/conversation-detail/conversation-detail.page.html +48 -27
  107. package/src/app/pages/conversation-detail/conversation-detail.page.scss +45 -254
  108. package/src/app/pages/conversation-detail/conversation-detail.page.ts +361 -173
  109. package/src/app/pages/conversations-list/conversations-list.page.html +11 -8
  110. package/src/app/pages/conversations-list/conversations-list.page.scss +18 -2
  111. package/src/app/pages/conversations-list/conversations-list.page.ts +69 -65
  112. package/src/app/pages/profile-info/profile-info.page.html +2 -4
  113. package/src/app/pages/unassigned-conversations/unassigned-conversations.page.html +1 -1
  114. package/src/app/pages/unassigned-conversations/unassigned-conversations.page.scss +42 -0
  115. package/src/app/pages/unassigned-conversations/unassigned-conversations.page.ts +1 -0
  116. package/src/app/services/canned-responses/canned-responses.service.ts +26 -0
  117. package/src/app/services/projects/projects.service.spec.ts +12 -0
  118. package/src/app/services/projects/projects.service.ts +43 -0
  119. package/src/app/services/tiledesk/tiledesk.service.ts +33 -17
  120. package/src/app/services/websocket/websocket.service.ts +1 -1
  121. package/src/app/shared/shared.module.ts +24 -33
  122. package/src/app/utils/toast.spec.ts +7 -0
  123. package/src/app/utils/toast.ts +48 -0
  124. package/src/assets/i18n/ar.json +288 -265
  125. package/src/assets/i18n/az.json +24 -1
  126. package/src/assets/i18n/de.json +25 -2
  127. package/src/assets/i18n/en.json +25 -2
  128. package/src/assets/i18n/es.json +26 -3
  129. package/src/assets/i18n/fr.json +24 -1
  130. package/src/assets/i18n/it.json +24 -1
  131. package/src/assets/i18n/kk.json +25 -2
  132. package/src/assets/i18n/pt.json +25 -2
  133. package/src/assets/i18n/ru.json +24 -1
  134. package/src/assets/i18n/sr.json +287 -264
  135. package/src/assets/i18n/sv.json +25 -2
  136. package/src/assets/i18n/tr.json +25 -2
  137. package/src/assets/i18n/uk.json +25 -2
  138. package/src/assets/i18n/uz.json +24 -1
  139. package/src/assets/js/chat21client.js +175 -148
  140. package/src/assets/sounds/interface-start.mp3 +0 -0
  141. package/src/assets/sounds/wheep-wheep.mp3 +0 -0
  142. package/src/chat-config-mqtt-localhost.json +2 -2
  143. package/src/chat-config-native-mqtt.json +3 -0
  144. package/src/chat21-core/models/conversation.ts +0 -1
  145. package/src/chat21-core/models/projects.ts +27 -0
  146. package/src/chat21-core/providers/firebase/firebase-typing.service.ts +7 -9
  147. package/src/chat21-core/providers/mqtt/mqtt-auth-service.ts +7 -8
  148. package/src/chat21-core/utils/constants.ts +7 -1
  149. package/src/chat21-core/utils/convertRequestToConversation.ts +41 -0
  150. package/src/chat21-core/utils/user-typing/user-typing.component.html +8 -5
  151. package/src/chat21-core/utils/user-typing/user-typing.component.scss +87 -17
  152. package/src/chat21-core/utils/user-typing/user-typing.component.ts +12 -94
  153. package/src/chat21-core/utils/utils.ts +41 -11
  154. package/src/global.scss +59 -255
  155. package/src/index.html +0 -9
  156. package/src/variables.scss +30 -10
  157. package/src/app/components/conversation-detail/bubble-day-message/bubble-day-message.component.html +0 -3
  158. package/src/app/components/conversation-detail/bubble-day-message/bubble-day-message.component.scss +0 -21
  159. package/src/app/components/conversation-detail/bubble-day-message/bubble-day-message.component.spec.ts +0 -24
  160. package/src/app/components/conversation-detail/bubble-day-message/bubble-day-message.component.ts +0 -14
  161. package/src/app/components/conversation-detail/bubble-my-message/bubble-my-message.component.html +0 -54
  162. package/src/app/components/conversation-detail/bubble-my-message/bubble-my-message.component.scss +0 -98
  163. package/src/app/components/conversation-detail/bubble-my-message/bubble-my-message.component.ts +0 -84
  164. package/src/app/components/conversation-detail/bubble-others-message/bubble-others-message.component.html +0 -30
  165. package/src/app/components/conversation-detail/bubble-others-message/bubble-others-message.component.scss +0 -83
  166. package/src/app/components/conversation-detail/bubble-others-message/bubble-others-message.component.spec.ts +0 -24
  167. package/src/app/components/conversation-detail/bubble-others-message/bubble-others-message.component.ts +0 -68
  168. package/src/app/components/conversation-detail/bubble-system-message/bubble-system-message.component.html +0 -3
  169. package/src/app/components/conversation-detail/bubble-system-message/bubble-system-message.component.scss +0 -10
  170. package/src/app/components/conversation-detail/bubble-system-message/bubble-system-message.component.spec.ts +0 -24
  171. package/src/app/components/conversation-detail/bubble-system-message/bubble-system-message.component.ts +0 -14
  172. package/src/app/components/conversation-detail/option-header/option-header.component.html +0 -13
  173. package/src/app/components/conversation-detail/option-header/option-header.component.scss +0 -0
@@ -1,35 +1,38 @@
1
- <ion-header no-border class="ion-no-border">
2
- <app-ddp-header *ngIf="conversationType ==='active'"
1
+ <ion-header no-border class="ion-no-border" [class.mobile]="isMobile">
2
+ <header-conversations-list *ngIf="conversationType ==='active'"
3
3
  [numberOpenConv]="numberOpenConv"
4
4
  [supportMode]="supportMode"
5
5
  [archived_btn]="archived_btn"
6
6
  [writeto_btn]="writeto_btn"
7
7
  [sound_btn]="sound_btn"
8
+ [isMobile]="isMobile"
8
9
  (onSoundChange)="onSoundChange($event)"
9
10
  (openContactsDirectory)=openContactsDirectory($event)
10
11
  (openProfileInfo)=openProfileInfo($event)>
11
- </app-ddp-header>
12
+ </header-conversations-list>
12
13
 
13
- <app-option-header *ngIf="conversationType !=='active'"
14
+ <header-conversations-list-archived *ngIf="conversationType !=='active'"
14
15
  [headerTitle]=headerTitle
16
+ [isMobile]="isMobile"
15
17
  (onBackButton)=onBackButtonFN($event)>
16
- </app-option-header>
18
+ </header-conversations-list-archived>
17
19
  </ion-header>
20
+
18
21
  <!-- appScrollbarTheme -->
19
- <ion-content id="convs-list" #ioncontentconvlist class="list-avatar-page" >
22
+ <ion-content id="convs-list" #ioncontentconvlist class="list-avatar-page" [class.mobile]="isMobile">
20
23
  <!-- class="ps" style="position: relative; max-width: 600px; max-height: 100%;" [perfectScrollbar]="config" -->
21
24
  <div id="scrollbar2">
22
25
  <ion-list>
23
26
 
24
27
  <!-- supportMode && -->
25
- <ion-item *ngIf="displayNewConvsItem && conversationType !=='archived' && supportMode" class="ion-no-padding open-iframe-item">
28
+ <ion-item *ngIf="displayNewConvsItem && conversationType !=='archived' && supportMode" class="ion-no-padding open-iframe-item" lines="none">
26
29
  <div tabindex="0"></div>
27
30
  <!-- <ion-note class="pinned-project">
28
31
  {{ 'PINNED_PROJECT' | translate }}
29
32
  </ion-note> -->
30
33
 
31
34
  <app-project-item
32
- style="width: 100%;"
35
+ style="width: 100%; margin: 0px 8px; border-bottom: 1px dashed #d3dbe5;"
33
36
  (openUnsevedConvsEvent)="openUnsevedConversationIframe($event)"
34
37
  (projectIdEvent)="getLastProjectId($event)">
35
38
  </app-project-item>
@@ -4,6 +4,10 @@ ion-header {
4
4
  border-bottom-style: solid;
5
5
  border-color: var(--light-gray);
6
6
  border-bottom-width: thin;
7
+ &:not(.mobile){
8
+ border: none;
9
+ background: var(--list-bkg-color);
10
+ }
7
11
  }
8
12
 
9
13
  ion-content {
@@ -12,6 +16,16 @@ ion-content {
12
16
  --overflow: hidden;
13
17
  overflow: scroll;
14
18
 
19
+ /* For Firefox */
20
+ @-moz-document url-prefix() {
21
+ scrollbar-width: none;
22
+ }
23
+
24
+
25
+ &:not(.mobile){
26
+ background: var(--list-bkg-color);
27
+ }
28
+
15
29
  &::-webkit-scrollbar {
16
30
  width: 6px;
17
31
  height: 8px;
@@ -40,10 +54,11 @@ ion-list {
40
54
  list-style-type: none;
41
55
  margin: 0;
42
56
  padding: 0;
57
+ background: transparent;
43
58
 
44
59
  ion-item {
45
60
  cursor: pointer;
46
- height: 64px;
61
+ // height: 64px;
47
62
  position: relative;
48
63
  display: flex;
49
64
  text-decoration: none;
@@ -51,6 +66,7 @@ ion-list {
51
66
  padding-right: 8px;
52
67
  --padding-start: 0;
53
68
  --inner-padding-end: 0;
69
+ --background: transparent;
54
70
  .selected {
55
71
  border-radius: 10px;
56
72
  padding-left: 8px;
@@ -324,7 +340,7 @@ ion-list {
324
340
  padding-left: 0px !important ;
325
341
  padding-right: 0px !important;
326
342
  // height: 55px !important;
327
- border-bottom: 1px solid rgba(0, 0, 0, 0.05);
343
+ // border-bottom: 1px solid rgba(0, 0, 0, 0.05);
328
344
  --background-hover: #ffffff;
329
345
  cursor:default !important;
330
346
  }
@@ -92,6 +92,7 @@ export class ConversationListPage implements OnInit {
92
92
  public displayNewConvsItem: boolean = true
93
93
  public archiveActionNotAllowed: boolean = false
94
94
 
95
+ public isMobile: boolean = false;
95
96
  public isInitialized: boolean = false;
96
97
 
97
98
  tooltipOptions = {
@@ -122,8 +123,8 @@ export class ConversationListPage implements OnInit {
122
123
  public appConfigProvider: AppConfigProvider,
123
124
  public platform: Platform,
124
125
  private networkService: NetworkService,
125
- private appStorageService: AppStorageService
126
126
  ) {
127
+ this.checkPlatform();
127
128
  this.listenToAppCompConvsLengthOnInitConvs()
128
129
  this.listenToAppIsInitialized()
129
130
  this.listenToLogoutEvent()
@@ -136,6 +137,16 @@ export class ConversationListPage implements OnInit {
136
137
  this.listenToCloseConvFromHeaderConversation()
137
138
  }
138
139
 
140
+ private checkPlatform(){
141
+ if (checkPlatformIsMobile()) {
142
+ this.isMobile = true
143
+ this.logger.log('[CONVS-LIST-PAGE] - initialize -> checkPlatformIsMobile isMobile? ', this.isMobile)
144
+ } else {
145
+ this.isMobile = false
146
+ this.logger.log('[CONVS-LIST-PAGE] - initialize -> checkPlatformIsMobile isMobile? ', this.isMobile)
147
+ }
148
+ }
149
+
139
150
  listenSupportConvIdHasChanged() {
140
151
  this.events.subscribe('supportconvid:haschanged', (IDConv) => {
141
152
  // console.log('[CONVS-LIST-PAGE] - listen To convid:haschanged - convId', IDConv);
@@ -401,7 +412,6 @@ export class ConversationListPage implements OnInit {
401
412
  })
402
413
  }
403
414
 
404
-
405
415
  listenGoOnline() {
406
416
  this.events.subscribe('go:online', (goonline) => {
407
417
  this.logger.info('[CONVS-LIST-PAGE] - listen To go:online - goonline',goonline)
@@ -492,11 +502,11 @@ export class ConversationListPage implements OnInit {
492
502
  })
493
503
 
494
504
  this.conversationsHandlerService.conversationRemoved.subscribe((conversation: ConversationModel) => {
495
- // this.logger.log('[CONVS-LIST-PAGE] ***** conversationsRemoved *****',conversation)
505
+ this.logger.log('[CONVS-LIST-PAGE] ***** conversationsRemoved *****',conversation)
496
506
  })
497
507
 
498
508
  this.archivedConversationsHandlerService.archivedConversationAdded.subscribe((conversation: ConversationModel) => {
499
- // this.logger.log('[CONVS-LIST-PAGE] ***** archivedConversationAdded *****',conversation)
509
+ this.logger.log('[CONVS-LIST-PAGE] ***** archivedConversationAdded *****',conversation)
500
510
  // that.conversationsChanged(conversations);
501
511
  if (conversation) {
502
512
  this.onImageLoaded(conversation)
@@ -515,22 +525,6 @@ export class ConversationListPage implements OnInit {
515
525
  this.logger.log('[CONVS-LIST-PAGE] - subscribeLoggedUserLogout uidConvSelected ',this.uidConvSelected)
516
526
  }
517
527
 
518
- // ------------------------------------------------------------------------------------
519
- // @ SUBSCRIBE TO CONVERSATION CHANGED ??????????? SEEMS NOT USED ?????????????????
520
- // ------------------------------------------------------------------------------------
521
- conversationsChanged = (conversations: ConversationModel[]) => {
522
- this.numberOpenConv = this.conversationsHandlerService.countIsNew()
523
- this.logger.log('[CONVS-LIST-PAGE] - conversationsChanged - NUMB OF CONVERSATIONS: ',this.numberOpenConv)
524
- // console.log('conversationsChanged »»»»»»»»» uidConvSelected', that.conversations[0], that.uidConvSelected);
525
- if (this.uidConvSelected && !this.conversationSelected) {
526
- const conversationSelected = this.conversations.find((item) => item.uid === this.uidConvSelected)
527
- if (conversationSelected) {
528
- this.conversationSelected = conversationSelected
529
- this.setUidConvSelected(this.uidConvSelected)
530
- }
531
- }
532
- }
533
-
534
528
  /**
535
529
  * ::: subscribeProfileInfoButtonClicked :::
536
530
  * evento richiamato quando si seleziona bottone profile-info-modal
@@ -646,7 +640,7 @@ export class ConversationListPage implements OnInit {
646
640
  * ::: setUidConvSelected :::
647
641
  */
648
642
  setUidConvSelected(uidConvSelected: string, conversationType?: string) {
649
- this.logger.log('[CONVS-LIST-PAGE] setuidCOnvSelected', uidConvSelected)
643
+ this.logger.log('[CONVS-LIST-PAGE] setuidCOnvSelected', uidConvSelected, conversationType)
650
644
  this.uidConvSelected = uidConvSelected
651
645
  // this.conversationsHandlerService.uidConvSelected = uidConvSelected;
652
646
  if (uidConvSelected) {
@@ -677,6 +671,7 @@ export class ConversationListPage implements OnInit {
677
671
  this.navigateByUrl('active', conversation.uid)
678
672
  this.conversationsHandlerService.uidConvSelected = conversation.uid
679
673
  this.logger.log('[CONVS-LIST-PAGE] onConversationSelected active conversation.uid ', conversation.uid)
674
+ this.events.publish('convList:onConversationSelected', conversation)
680
675
  }
681
676
  }
682
677
 
@@ -744,7 +739,14 @@ export class ConversationListPage implements OnInit {
744
739
  }
745
740
  }
746
741
  }
747
-
742
+
743
+ if(conversation.attributes && conversation.attributes['projectId']){
744
+ let project = localStorage.getItem(conversation.attributes['projectId'])
745
+ if(project){
746
+ project = JSON.parse(project)
747
+ conversation.attributes.project_name = project['name']
748
+ }
749
+ }
748
750
  // if(conversation.conversation_with_fullname === 'Guest '){
749
751
  // conversation.conversation_with_fullname = 'guest' + '#' + this.getUUidConversation(conversation.uid)
750
752
  // }
@@ -797,7 +799,7 @@ export class ConversationListPage implements OnInit {
797
799
  let pageUrl = 'conversation-detail/' + this.uidConvSelected + '/' + this.conversationSelected.conversation_with_fullname + '/' + converationType
798
800
  this.logger.log('[CONVS-LIST-PAGE] pageURL', pageUrl)
799
801
  // replace(/\(/g, '%28').replace(/\)/g, '%29') -> used for the encoder of any round brackets
800
- this.router.navigateByUrl(pageUrl.replace(/\(/g, '%28').replace(/\)/g, '%29').replace( /#/g, "%23" ))
802
+ this.router.navigateByUrl(pageUrl.replace(/\(/g, '%28').replace(/\)/g, '%29').replace( /#/g, "%23" ), {replaceUrl: true})
801
803
  } else {
802
804
  this.logger.log('[CONVS-LIST-PAGE] navigateByUrl this.conversationSelected conversation_with_fullname ', this.conversationSelected.conversation_with_fullname)
803
805
  this.logger.log('[CONVS-LIST-PAGE] checkPlatformIsMobile(): ', checkPlatformIsMobile())
@@ -808,7 +810,7 @@ export class ConversationListPage implements OnInit {
808
810
  }
809
811
  this.logger.log('[CONVS-LIST-PAGE] setUidConvSelected navigateByUrl--->: ', pageUrl)
810
812
  // replace(/\(/g, '%28').replace(/\)/g, '%29') -> used for the encoder of any round brackets
811
- this.router.navigateByUrl(pageUrl.replace(/\(/g, '%28').replace(/\)/g, '%29').replace( /#/g, "%23" ))
813
+ this.router.navigateByUrl(pageUrl.replace(/\(/g, '%28').replace(/\)/g, '%29').replace( /#/g, "%23" ), {replaceUrl: true})
812
814
  }
813
815
  }
814
816
 
@@ -821,6 +823,7 @@ export class ConversationListPage implements OnInit {
821
823
  if (checkPlatformIsMobile()) {
822
824
  presentModal(this.modalController, ContactsDirectoryPage, {
823
825
  token: TOKEN,
826
+ isMobile: this.isMobile
824
827
  })
825
828
  } else {
826
829
  this.navService.push(ContactsDirectoryPage, { token: TOKEN })
@@ -979,51 +982,52 @@ export class ConversationListPage implements OnInit {
979
982
 
980
983
  private segmentNewConversationAdded(conversation: ConversationModel){
981
984
  let user = this.tiledeskAuthService.getCurrentUser()
982
- try {
983
- window['analytics'].page("Chat List Conversations Page, Agent added to conversation", {});
984
- } catch (err) {
985
- this.logger.error('Event:Agent added to conversation [page] error', err);
986
- }
987
-
988
- try {
989
- window['analytics'].identify(user.uid, {
990
- name: user.firstname + ' ' + user.lastname,
991
- email: user.email,
992
- logins: 5,
993
- });
994
- } catch (err) {
995
- this.logger.error('Event:Agent added to conversation [identify] error', err);
996
- }
997
-
998
- try {
999
- window['analytics'].track('Agent added to conversation', {
1000
- "username": user.firstname + ' ' + user.lastname,
1001
- "userId": user.uid,
1002
- "conversation_id": conversation.uid,
1003
- "channel_type": conversation.channel_type,
1004
- "conversation_with": conversation.conversation_with,
1005
- "project_id":(conversation.channel_type !== TYPE_DIRECT)? conversation.uid.split('-')[2]: null,
1006
- "project_name":(conversation.channel_type !== TYPE_DIRECT && conversation.attributes && conversation.attributes.departmentId)? conversation.attributes.departmentId: null,
1007
- },
1008
- {
1009
- "context": {
1010
- "groupId": (conversation.channel_type !== TYPE_DIRECT)? conversation.uid.split('-')[2]: null
1011
- }
1012
- });
1013
- } catch (err) {
1014
- this.logger.error('Event:Agent added to conversation [track] error', err);
1015
- }
1016
-
1017
- if(conversation.channel_type !== TYPE_DIRECT){
985
+ if(window['analytics']){
986
+ try {
987
+ window['analytics'].page("Chat List Conversations Page, Agent added to conversation", {});
988
+ } catch (err) {
989
+ this.logger.error('Event:Agent added to conversation [page] error', err);
990
+ }
991
+
1018
992
  try {
1019
- window['analytics'].group(conversation.uid.split('-')[2], {
1020
- name: (conversation.attributes && conversation.attributes.project_name)? conversation.attributes.project_name : null,
1021
- // plan: projectProfileName,
993
+ window['analytics'].identify(user.uid, {
994
+ name: user.firstname + ' ' + user.lastname,
995
+ email: user.email,
996
+ logins: 5,
1022
997
  });
1023
998
  } catch (err) {
1024
- this.logger.error('Event:Agent added to conversation [group] error', err);
999
+ this.logger.error('Event:Agent added to conversation [identify] error', err);
1000
+ }
1001
+
1002
+ try {
1003
+ window['analytics'].track('Agent added to conversation', {
1004
+ "username": user.firstname + ' ' + user.lastname,
1005
+ "userId": user.uid,
1006
+ "conversation_id": conversation.uid,
1007
+ "channel_type": conversation.channel_type,
1008
+ "conversation_with": conversation.conversation_with,
1009
+ "project_id":(conversation.channel_type !== TYPE_DIRECT)? conversation.uid.split('-')[2]: null,
1010
+ "project_name":(conversation.channel_type !== TYPE_DIRECT && conversation.attributes && conversation.attributes.departmentId)? conversation.attributes.departmentId: null,
1011
+ },
1012
+ {
1013
+ "context": {
1014
+ "groupId": (conversation.channel_type !== TYPE_DIRECT)? conversation.uid.split('-')[2]: null
1015
+ }
1016
+ });
1017
+ } catch (err) {
1018
+ this.logger.error('Event:Agent added to conversation [track] error', err);
1019
+ }
1020
+
1021
+ if(conversation.channel_type !== TYPE_DIRECT){
1022
+ try {
1023
+ window['analytics'].group(conversation.uid.split('-')[2], {
1024
+ name: (conversation.attributes && conversation.attributes.project_name)? conversation.attributes.project_name : null,
1025
+ // plan: projectProfileName,
1026
+ });
1027
+ } catch (err) {
1028
+ this.logger.error('Event:Agent added to conversation [group] error', err);
1029
+ }
1025
1030
  }
1026
-
1027
1031
  }
1028
1032
  }
1029
1033
 
@@ -30,10 +30,8 @@
30
30
 
31
31
  <div class="user-presence">
32
32
  <app-user-presence
33
- [idUser]=loggedUser.uid
34
- [translationMap]=translationMap
35
- [borderColor]=borderColor
36
- [fontColor]=fontColor>
33
+ [idUser]=loggedUser.uid
34
+ [translationMap]=translationMap>
37
35
  </app-user-presence>
38
36
  </div>
39
37
 
@@ -1,5 +1,5 @@
1
1
  <ion-header>
2
- <ion-toolbar>
2
+ <ion-toolbar [class.mobile]="isMobile">
3
3
  <ion-title *ngIf="callerBtn !== 'pinbtn'" style="font-size: 16px;">
4
4
  {{translationMap?.get('UnassignedConversations') }}
5
5
  </ion-title>
@@ -1,3 +1,45 @@
1
+ ion-toolbar {
2
+ height: var(--header-height);
3
+ &:not(.mobile){
4
+ --background: var(--list-bkg-color);
5
+ border: none;
6
+ }
7
+ &.mobile{
8
+ border-bottom: 1px solid rgba(0, 0, 0, 0.05);
9
+ }
10
+
11
+ ion-button{
12
+ --color: var(--basic-blue);
13
+ }
14
+ }
15
+
16
+ ion-content {
17
+ // overwrite inline styles
18
+ --overflow: hidden;
19
+ overflow: scroll;
20
+ &:not(.mobile){
21
+ background: var(--list-bkg-color);
22
+ }
23
+
24
+ &::-webkit-scrollbar {
25
+ width: 6px;
26
+ height: 8px;
27
+ display: none;
28
+ }
29
+
30
+ &::-webkit-scrollbar-track {
31
+ background: #f9f9f9;
32
+ }
33
+ &::-webkit-scrollbar-thumb {
34
+ background-color: #b9b9b9;
35
+ border-radius: 0px;
36
+ }
37
+ &::-webkit-scrollbar-thumb:hover {
38
+ background-color: #727272;
39
+ }
40
+ }
41
+
42
+
1
43
  .ion-content-black-background {
2
44
  --background: #2d323e;
3
45
  }
@@ -16,6 +16,7 @@ export class UnassignedConversationsPage implements OnInit {
16
16
 
17
17
  @Input() iframe_URL: any;
18
18
  @Input() callerBtn: string;
19
+ @Input() isMobile: boolean;
19
20
  // @Input() prjctsxpanel_url: any;
20
21
  // @Input() unassigned_convs_url: any;
21
22
 
@@ -43,6 +43,32 @@ export class CannedResponsesService {
43
43
  }))
44
44
  }
45
45
 
46
+ // -------------------------------------------------------------------------------------
47
+ // @ Create - Save (POST) new canned response
48
+ // -------------------------------------------------------------------------------------
49
+ public add(token: string, projectid: string, title: string, message: string) {
50
+ const url = this.apiUrl + projectid + '/canned/'
51
+ this.logger.log('[TILEDESK-SERVICE] - CREATE CANNED-RES - URL', url);
52
+
53
+ const httpOptions = {
54
+ headers: new HttpHeaders({
55
+ 'Content-Type': 'application/json',
56
+ Authorization: token
57
+ })
58
+ };
59
+
60
+ const body = {
61
+ title: title,
62
+ text: message
63
+ }
64
+
65
+ return this.http.post(url, JSON.stringify(body), httpOptions).pipe(map((res: any) => {
66
+ this.logger.log('[TILEDESK-SERVICE] - CREATE CANNED-RES - RES ', res);
67
+ return res
68
+ }))
69
+
70
+ }
71
+
46
72
  public edit(token: string, projectid: string, canned: any){
47
73
  const cannedResponsesURL = this.apiUrl + projectid + "/canned/"+ canned._id;
48
74
  this.logger.log('[CANNED-RESPONSES-SERVICE] editCannedResponses - URL ', cannedResponsesURL);
@@ -0,0 +1,12 @@
1
+ import { TestBed } from '@angular/core/testing';
2
+
3
+ import { ProjectsService } from './projects.service';
4
+
5
+ describe('ProjectsService', () => {
6
+ beforeEach(() => TestBed.configureTestingModule({}));
7
+
8
+ it('should be created', () => {
9
+ const service: ProjectsService = TestBed.get(ProjectsService);
10
+ expect(service).toBeTruthy();
11
+ });
12
+ });
@@ -0,0 +1,43 @@
1
+ import { HttpClient, HttpHeaders } from '@angular/common/http';
2
+ import { Injectable } from '@angular/core';
3
+ import { map } from 'rxjs/operators';
4
+ import { Project } from 'src/chat21-core/models/projects';
5
+ import { LoggerService } from 'src/chat21-core/providers/abstract/logger.service';
6
+ import { LoggerInstance } from 'src/chat21-core/providers/logger/loggerInstance';
7
+ import { AppConfigProvider } from '../app-config';
8
+
9
+ @Injectable({
10
+ providedIn: 'root'
11
+ })
12
+ export class ProjectsService {
13
+
14
+ private apiUrl: string;
15
+ private logger: LoggerService = LoggerInstance.getInstance();
16
+
17
+ constructor(
18
+ public http: HttpClient,
19
+ public appConfigProvider: AppConfigProvider
20
+ ) {
21
+
22
+ this.logger.log('[PROJECTS-SERVICE] HELLO !');
23
+ this.apiUrl = appConfigProvider.getConfig().apiUrl;
24
+ this.logger.log('[PROJECTS-SERVICE] apiUrl ', this.apiUrl);
25
+ }
26
+
27
+ public getProjects(token: string) {
28
+ const url = this.apiUrl + "projects/";
29
+ this.logger.log('[PROJECTS-SERVICE] getProjects - URL ', url);
30
+
31
+ const httpOptions = {
32
+ headers: new HttpHeaders({
33
+ 'Content-Type': 'application/json',
34
+ Authorization: token
35
+ })
36
+ };
37
+
38
+ return this.http.get(url, httpOptions).pipe(map((res: Project[]) => {
39
+ this.logger.log('[PROJECTS-SERVICE] getProjects - RES ', res);
40
+ return res
41
+ }))
42
+ }
43
+ }
@@ -51,7 +51,26 @@ export class TiledeskService {
51
51
  }))
52
52
  }
53
53
 
54
- // http://tiledesk-server-pre.herokuapp.com/requests_util/lookup/id_project/support-group-60ffe291f725db00347661ef-b4cb6875785c4a23b27244fe498eecf44
54
+ // ---------------------------------------------
55
+ // @ GET request by id
56
+ // ---------------------------------------------
57
+ public getRequest(request_id: string, project_id: string, token: string) {
58
+ const url = this.apiUrl + project_id + '/requests/'+request_id
59
+ this.logger.log('[TILEDESK-SERVICE] - CREATE NEW LEAD url ', url);
60
+
61
+ const httpOptions = {
62
+ headers: new HttpHeaders({
63
+ 'Content-Type': 'application/json',
64
+ Authorization: token
65
+ })
66
+ };
67
+
68
+ return this.http.get(url, httpOptions).pipe(map((res: any) => {
69
+ this.logger.log('[TILEDESK-SERVICE] - CREATE NEW LEAD RES ', res);
70
+ return res
71
+ }))
72
+ }
73
+
55
74
  public getProjectIdByConvRecipient(token: string ,conversationWith: string ) {
56
75
  const lookupUrl = this.apiUrl + 'requests_util/lookup/id_project/' + conversationWith;
57
76
 
@@ -225,7 +244,7 @@ export class TiledeskService {
225
244
  // -----------------------------------------------------------------------------------------
226
245
  // @ Create ticket
227
246
  // -----------------------------------------------------------------------------------------
228
- createInternalRequest(requester_id: string, request_id: string, subject: string, message: string, departmentid: string, participantid: string, ticketpriority: string, project_id: string, token: string) {
247
+ public createInternalRequest(requester_id: string, request_id: string, subject: string, message: string, departmentid: string, participantid: string, ticketpriority: string, project_id: string, token: string) {
229
248
 
230
249
  const url = this.apiUrl + project_id + '/requests/' + request_id + '/messages'
231
250
  this.logger.log('[WS-REQUESTS-SERV] - CREATE INTERNAL REQUEST URL ', url)
@@ -252,33 +271,30 @@ export class TiledeskService {
252
271
  return res
253
272
  }))
254
273
  }
255
-
256
274
 
257
- // -------------------------------------------------------------------------------------
258
- // @ Create - Save (POST) new canned response
259
- // -------------------------------------------------------------------------------------
260
- public createCannedResponse(message: string, title: string, project_id: string, token: string) {
261
- this.logger.log('[TILEDESK-SERVICE] - CREATE CANNED-RES - token', token);
262
- const url = this.apiUrl + project_id + '/canned/'
263
- this.logger.log('[TILEDESK-SERVICE] - CREATE CANNED-RES - URL', url);
275
+ public sendEmail(token: string, projectid: string, form: { to: string, subject: string, text: string, request_id: string}) {
264
276
 
265
277
  const httpOptions = {
266
278
  headers: new HttpHeaders({
279
+ 'Accept': 'application/json',
267
280
  'Content-Type': 'application/json',
268
281
  Authorization: token
269
282
  })
270
283
  };
271
284
 
272
- const body = { 'text': message, 'title': title };
273
-
274
- this.logger.log('[TILEDESK-SERVICE] CREATE CANNED-RES - BODY ', body);
285
+ const body = form;
275
286
 
276
- return this.http.post(url, JSON.stringify(body), httpOptions).pipe(map((res: any) => {
277
- this.logger.log('[TILEDESK-SERVICE] - CREATE CANNED-RES - RES ', res);
278
- return res
287
+ const url = this.apiUrl + projectid + '/emails/send';
288
+ this.logger.log('[TILEDESK-SERVICE] - sendEmail URL ', url);
289
+ return this.http.post(url, body, httpOptions).pipe(map((res: any) => {
290
+ this.logger.log('[TILEDESK-SERVICE] - sendEmail - RES ', res);
291
+ return res
279
292
  }))
280
-
281
293
  }
294
+
295
+
296
+
297
+
282
298
 
283
299
  // .post(url, JSON.stringify(body), options)
284
300
  // .map((res) => res.json());
@@ -41,7 +41,7 @@ export class WebsocketService {
41
41
 
42
42
  self.webSocketJs.ref(path, 'subscriptionToWsCurrentUser_allProject',
43
43
  function (data, notification) {
44
- // console.log("[WS-SERV] SUBSCR TO WS CURRENT PROJECT-USER AVAILABILITY - CREATE - data ", data);
44
+ console.log("[WS-SERV] SUBSCR TO WS CURRENT PROJECT-USER AVAILABILITY - CREATE - data ", data);
45
45
  resolve(data)
46
46
  // self.currentUserWsAvailability$.next(data.user_available);
47
47
  self.currentProjectUserAvailability$.next(data)