@chat21/chat21-ionic 3.0.80 → 3.0.81-rc.2

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 (151) hide show
  1. package/CHANGELOG.md +75 -3
  2. package/README.md +2 -2
  3. package/angular.json +1 -0
  4. package/deploy_amazon_beta.sh +29 -0
  5. package/deploy_amazon_prod.sh +30 -0
  6. package/package.json +2 -2
  7. package/src/app/app.component.html +7 -1
  8. package/src/app/app.component.scss +18 -2
  9. package/src/app/app.component.ts +113 -17
  10. package/src/app/app.module.ts +3 -1
  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 +77 -23
  13. package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.scss +168 -86
  14. package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.ts +39 -2
  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 -25
  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 +1 -1
  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 +62 -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 -8
  43. package/src/app/components/canned-response/canned-response.component.scss +24 -2
  44. package/src/app/components/canned-response/canned-response.component.ts +5 -5
  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 +61 -42
  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 +9 -25
  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 +8 -6
  52. package/src/app/components/conversation-detail/message-text-area/message-text-area.component.scss +4 -4
  53. package/src/app/components/conversation-detail/message-text-area/message-text-area.component.ts +25 -87
  54. package/src/app/components/conversation-info/info-content/info-content.component.html +2 -1
  55. package/src/app/components/conversation-info/info-content/info-content.component.ts +3 -2
  56. package/src/app/components/conversation-info/info-direct/info-direct.component.html +1 -9
  57. package/src/app/components/conversation-info/info-direct/info-direct.component.ts +0 -2
  58. package/src/app/components/conversation-info/info-group/info-group.component.html +44 -108
  59. package/src/app/components/conversation-info/info-group/info-group.component.scss +101 -61
  60. package/src/app/components/conversation-info/info-group/info-group.component.ts +1 -0
  61. package/src/app/components/{ddp-header/ddp-header.component.html → conversations-list/header-conversations-list/header-conversations-list.component.html} +3 -3
  62. package/src/app/components/{ddp-header/ddp-header.component.scss → conversations-list/header-conversations-list/header-conversations-list.component.scss} +16 -4
  63. 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
  64. package/src/app/components/{ddp-header/ddp-header.component.ts → conversations-list/header-conversations-list/header-conversations-list.component.ts} +7 -16
  65. package/src/app/components/conversations-list/header-conversations-list-archived/header-conversations-list-archived.component.html +12 -0
  66. package/src/app/components/conversations-list/header-conversations-list-archived/header-conversations-list-archived.component.scss +14 -0
  67. 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
  68. 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
  69. package/src/app/components/navbar/navbar.component.html +103 -0
  70. package/src/app/components/navbar/navbar.component.scss +249 -0
  71. package/src/app/components/{ddp-header/ddp-header.component.spec.ts → navbar/navbar.component.spec.ts} +6 -6
  72. package/src/app/components/navbar/navbar.component.ts +189 -0
  73. package/src/app/components/project-item/project-item.component.html +98 -149
  74. package/src/app/components/project-item/project-item.component.scss +42 -35
  75. package/src/app/components/project-item/project-item.component.ts +16 -4
  76. package/src/app/components/sidebar-user-details/sidebar-user-details.component.html +3 -3
  77. package/src/app/components/sidebar-user-details/sidebar-user-details.component.ts +2 -7
  78. package/src/app/components/utils/user-presence/user-presence.component.html +7 -2
  79. package/src/app/components/utils/user-presence/user-presence.component.scss +35 -18
  80. package/src/app/components/utils/user-presence/user-presence.component.ts +6 -10
  81. package/src/app/pages/contacts-directory/contacts-directory.page.html +1 -1
  82. package/src/app/pages/contacts-directory/contacts-directory.page.scss +41 -0
  83. package/src/app/pages/contacts-directory/contacts-directory.page.ts +2 -0
  84. package/src/app/pages/conversation-detail/conversation-detail.module.ts +0 -8
  85. package/src/app/pages/conversation-detail/conversation-detail.page.html +40 -23
  86. package/src/app/pages/conversation-detail/conversation-detail.page.scss +40 -250
  87. package/src/app/pages/conversation-detail/conversation-detail.page.ts +184 -117
  88. package/src/app/pages/conversations-list/conversations-list.page.html +11 -8
  89. package/src/app/pages/conversations-list/conversations-list.page.scss +11 -2
  90. package/src/app/pages/conversations-list/conversations-list.page.ts +25 -22
  91. package/src/app/pages/create-canned-response/create-canned-response.page.ts +13 -13
  92. package/src/app/pages/loader-preview/loader-preview.page.html +1 -1
  93. package/src/app/pages/loader-preview/loader-preview.page.scss +4 -0
  94. package/src/app/pages/loader-preview/loader-preview.page.ts +1 -2
  95. package/src/app/pages/profile-info/profile-info.page.html +2 -4
  96. package/src/app/pages/unassigned-conversations/unassigned-conversations.page.html +1 -1
  97. package/src/app/pages/unassigned-conversations/unassigned-conversations.page.scss +42 -0
  98. package/src/app/pages/unassigned-conversations/unassigned-conversations.page.ts +1 -0
  99. package/src/app/services/canned-responses/canned-responses.service.ts +26 -0
  100. package/src/app/services/projects/projects.service.spec.ts +12 -0
  101. package/src/app/services/projects/projects.service.ts +43 -0
  102. package/src/app/services/tiledesk/tiledesk.service.ts +2 -26
  103. package/src/app/shared/shared.module.ts +24 -33
  104. package/src/assets/i18n/ar.json +278 -265
  105. package/src/assets/i18n/az.json +14 -1
  106. package/src/assets/i18n/de.json +15 -2
  107. package/src/assets/i18n/en.json +15 -2
  108. package/src/assets/i18n/es.json +15 -2
  109. package/src/assets/i18n/fr.json +14 -1
  110. package/src/assets/i18n/it.json +14 -1
  111. package/src/assets/i18n/kk.json +15 -2
  112. package/src/assets/i18n/pt.json +15 -2
  113. package/src/assets/i18n/ru.json +14 -1
  114. package/src/assets/i18n/sr.json +277 -264
  115. package/src/assets/i18n/sv.json +15 -2
  116. package/src/assets/i18n/tr.json +15 -2
  117. package/src/assets/i18n/uk.json +15 -2
  118. package/src/assets/i18n/uz.json +14 -1
  119. package/src/assets/js/chat21client.js +177 -149
  120. package/src/assets/sounds/interface-start.mp3 +0 -0
  121. package/src/assets/sounds/wheep-wheep.mp3 +0 -0
  122. package/src/chat-config-native-mqtt.json +5 -1
  123. package/src/chat21-core/models/conversation.ts +0 -1
  124. package/src/chat21-core/models/projects.ts +27 -0
  125. package/src/chat21-core/providers/firebase/firebase-typing.service.ts +7 -9
  126. package/src/chat21-core/utils/constants.ts +6 -1
  127. package/src/chat21-core/utils/convertRequestToConversation.ts +41 -0
  128. package/src/chat21-core/utils/user-typing/user-typing.component.html +8 -5
  129. package/src/chat21-core/utils/user-typing/user-typing.component.scss +87 -17
  130. package/src/chat21-core/utils/user-typing/user-typing.component.ts +12 -94
  131. package/src/chat21-core/utils/utils.ts +38 -10
  132. package/src/global.scss +52 -56
  133. package/src/index.html +2 -2
  134. package/src/variables.scss +30 -10
  135. package/src/app/components/conversation-detail/bubble-day-message/bubble-day-message.component.html +0 -3
  136. package/src/app/components/conversation-detail/bubble-day-message/bubble-day-message.component.scss +0 -21
  137. package/src/app/components/conversation-detail/bubble-day-message/bubble-day-message.component.spec.ts +0 -24
  138. package/src/app/components/conversation-detail/bubble-day-message/bubble-day-message.component.ts +0 -14
  139. package/src/app/components/conversation-detail/bubble-my-message/bubble-my-message.component.html +0 -54
  140. package/src/app/components/conversation-detail/bubble-my-message/bubble-my-message.component.scss +0 -98
  141. package/src/app/components/conversation-detail/bubble-my-message/bubble-my-message.component.ts +0 -84
  142. package/src/app/components/conversation-detail/bubble-others-message/bubble-others-message.component.html +0 -30
  143. package/src/app/components/conversation-detail/bubble-others-message/bubble-others-message.component.scss +0 -83
  144. package/src/app/components/conversation-detail/bubble-others-message/bubble-others-message.component.spec.ts +0 -24
  145. package/src/app/components/conversation-detail/bubble-others-message/bubble-others-message.component.ts +0 -68
  146. package/src/app/components/conversation-detail/bubble-system-message/bubble-system-message.component.html +0 -3
  147. package/src/app/components/conversation-detail/bubble-system-message/bubble-system-message.component.scss +0 -10
  148. package/src/app/components/conversation-detail/bubble-system-message/bubble-system-message.component.spec.ts +0 -24
  149. package/src/app/components/conversation-detail/bubble-system-message/bubble-system-message.component.ts +0 -14
  150. package/src/app/components/conversation-detail/option-header/option-header.component.html +0 -13
  151. package/src/app/components/conversation-detail/option-header/option-header.component.scss +0 -0
@@ -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 {
@@ -11,6 +15,9 @@ ion-content {
11
15
  --offset-bottom: auto!important;
12
16
  --overflow: hidden;
13
17
  overflow: scroll;
18
+ &:not(.mobile){
19
+ background: var(--list-bkg-color);
20
+ }
14
21
 
15
22
  &::-webkit-scrollbar {
16
23
  width: 6px;
@@ -40,10 +47,11 @@ ion-list {
40
47
  list-style-type: none;
41
48
  margin: 0;
42
49
  padding: 0;
50
+ background: transparent;
43
51
 
44
52
  ion-item {
45
53
  cursor: pointer;
46
- height: 64px;
54
+ // height: 64px;
47
55
  position: relative;
48
56
  display: flex;
49
57
  text-decoration: none;
@@ -51,6 +59,7 @@ ion-list {
51
59
  padding-right: 8px;
52
60
  --padding-start: 0;
53
61
  --inner-padding-end: 0;
62
+ --background: transparent;
54
63
  .selected {
55
64
  border-radius: 10px;
56
65
  padding-left: 8px;
@@ -324,7 +333,7 @@ ion-list {
324
333
  padding-left: 0px !important ;
325
334
  padding-right: 0px !important;
326
335
  // height: 55px !important;
327
- border-bottom: 1px solid rgba(0, 0, 0, 0.05);
336
+ // border-bottom: 1px solid rgba(0, 0, 0, 0.05);
328
337
  --background-hover: #ffffff;
329
338
  cursor:default !important;
330
339
  }
@@ -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 = {
@@ -124,6 +125,7 @@ export class ConversationListPage implements OnInit {
124
125
  private networkService: NetworkService,
125
126
  private appStorageService: AppStorageService
126
127
  ) {
128
+ this.checkPlatform();
127
129
  this.listenToAppCompConvsLengthOnInitConvs()
128
130
  this.listenToAppIsInitialized()
129
131
  this.listenToLogoutEvent()
@@ -136,6 +138,16 @@ export class ConversationListPage implements OnInit {
136
138
  this.listenToCloseConvFromHeaderConversation()
137
139
  }
138
140
 
141
+ private checkPlatform(){
142
+ if (checkPlatformIsMobile()) {
143
+ this.isMobile = true
144
+ this.logger.log('[CONVS-LIST-PAGE] - initialize -> checkPlatformIsMobile isMobile? ', this.isMobile)
145
+ } else {
146
+ this.isMobile = false
147
+ this.logger.log('[CONVS-LIST-PAGE] - initialize -> checkPlatformIsMobile isMobile? ', this.isMobile)
148
+ }
149
+ }
150
+
139
151
  listenSupportConvIdHasChanged() {
140
152
  this.events.subscribe('supportconvid:haschanged', (IDConv) => {
141
153
  // console.log('[CONVS-LIST-PAGE] - listen To convid:haschanged - convId', IDConv);
@@ -401,7 +413,6 @@ export class ConversationListPage implements OnInit {
401
413
  })
402
414
  }
403
415
 
404
-
405
416
  listenGoOnline() {
406
417
  this.events.subscribe('go:online', (goonline) => {
407
418
  this.logger.info('[CONVS-LIST-PAGE] - listen To go:online - goonline',goonline)
@@ -492,11 +503,11 @@ export class ConversationListPage implements OnInit {
492
503
  })
493
504
 
494
505
  this.conversationsHandlerService.conversationRemoved.subscribe((conversation: ConversationModel) => {
495
- // this.logger.log('[CONVS-LIST-PAGE] ***** conversationsRemoved *****',conversation)
506
+ this.logger.log('[CONVS-LIST-PAGE] ***** conversationsRemoved *****',conversation)
496
507
  })
497
508
 
498
509
  this.archivedConversationsHandlerService.archivedConversationAdded.subscribe((conversation: ConversationModel) => {
499
- // this.logger.log('[CONVS-LIST-PAGE] ***** archivedConversationAdded *****',conversation)
510
+ this.logger.log('[CONVS-LIST-PAGE] ***** archivedConversationAdded *****',conversation)
500
511
  // that.conversationsChanged(conversations);
501
512
  if (conversation) {
502
513
  this.onImageLoaded(conversation)
@@ -515,22 +526,6 @@ export class ConversationListPage implements OnInit {
515
526
  this.logger.log('[CONVS-LIST-PAGE] - subscribeLoggedUserLogout uidConvSelected ',this.uidConvSelected)
516
527
  }
517
528
 
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
529
  /**
535
530
  * ::: subscribeProfileInfoButtonClicked :::
536
531
  * evento richiamato quando si seleziona bottone profile-info-modal
@@ -646,7 +641,7 @@ export class ConversationListPage implements OnInit {
646
641
  * ::: setUidConvSelected :::
647
642
  */
648
643
  setUidConvSelected(uidConvSelected: string, conversationType?: string) {
649
- this.logger.log('[CONVS-LIST-PAGE] setuidCOnvSelected', uidConvSelected)
644
+ this.logger.log('[CONVS-LIST-PAGE] setuidCOnvSelected', uidConvSelected, conversationType)
650
645
  this.uidConvSelected = uidConvSelected
651
646
  // this.conversationsHandlerService.uidConvSelected = uidConvSelected;
652
647
  if (uidConvSelected) {
@@ -677,6 +672,7 @@ export class ConversationListPage implements OnInit {
677
672
  this.navigateByUrl('active', conversation.uid)
678
673
  this.conversationsHandlerService.uidConvSelected = conversation.uid
679
674
  this.logger.log('[CONVS-LIST-PAGE] onConversationSelected active conversation.uid ', conversation.uid)
675
+ this.events.publish('convList:onConversationSelected', conversation)
680
676
  }
681
677
  }
682
678
 
@@ -744,7 +740,14 @@ export class ConversationListPage implements OnInit {
744
740
  }
745
741
  }
746
742
  }
747
-
743
+
744
+ if(conversation.attributes && conversation.attributes['projectId']){
745
+ let project = localStorage.getItem(conversation.attributes['projectId'])
746
+ if(project){
747
+ project = JSON.parse(project)
748
+ conversation.attributes.project_name = project['name']
749
+ }
750
+ }
748
751
  // if(conversation.conversation_with_fullname === 'Guest '){
749
752
  // conversation.conversation_with_fullname = 'guest' + '#' + this.getUUidConversation(conversation.uid)
750
753
  // }
@@ -821,6 +824,7 @@ export class ConversationListPage implements OnInit {
821
824
  if (checkPlatformIsMobile()) {
822
825
  presentModal(this.modalController, ContactsDirectoryPage, {
823
826
  token: TOKEN,
827
+ isMobile: this.isMobile
824
828
  })
825
829
  } else {
826
830
  this.navService.push(ContactsDirectoryPage, { token: TOKEN })
@@ -1023,7 +1027,6 @@ export class ConversationListPage implements OnInit {
1023
1027
  } catch (err) {
1024
1028
  this.logger.error('Event:Agent added to conversation [group] error', err);
1025
1029
  }
1026
-
1027
1030
  }
1028
1031
  }
1029
1032
 
@@ -1,3 +1,4 @@
1
+ import { CannedResponsesService } from 'src/app/services/canned-responses/canned-responses.service';
1
2
  import { Component, Input, OnInit } from '@angular/core';
2
3
  import { ModalController } from '@ionic/angular';
3
4
  import { Validators, FormBuilder, FormGroup, FormControl } from '@angular/forms';
@@ -38,6 +39,7 @@ export class CreateCannedResponsePage implements OnInit {
38
39
  private translate: TranslateService,
39
40
  public tiledeskAuthService: TiledeskAuthService,
40
41
  public tiledeskService: TiledeskService,
42
+ public cannedResponsesService: CannedResponsesService,
41
43
  private menu: MenuController,
42
44
  public events: EventsService,
43
45
  private route: ActivatedRoute,
@@ -181,19 +183,17 @@ export class CreateCannedResponsePage implements OnInit {
181
183
  this.logger.log('[CREATE-CANNED-RES] - CREATE CANNED RESP - MSG ', canned_response_message);
182
184
  this.logger.log('[CREATE-CANNED-RES] - CREATE CANNED RESP - TITLE ', canned_response_title);
183
185
 
184
- this.tiledeskService.createCannedResponse(canned_response_message.trim(), canned_response_title.trim(), this.prjctID, this.tiledeskToken)
185
- .subscribe((responses: any) => {
186
- this.logger.log('[CREATE-CANNED-RES] - CREATE CANNED RESP - RES ', responses);
187
-
188
- }, (error) => {
189
- this.logger.error('[CREATE-CANNED-RES]- CREATE CANNED RESP - ERROR ', error);
190
- this.showSpinnerCreateCannedResponse = false;
191
- }, () => {
192
- this.logger.log('[CREATE-CANNED-RES] - CREATE CANNED RESP * COMPLETE *');
193
- this.showSpinnerCreateCannedResponse = false;
194
- this.closeModalCreateCannedResponseModal()
195
- this.events.publish('newcannedresponse:created', true);
196
- });
186
+ this.cannedResponsesService.add(this.tiledeskToken, this.prjctID, canned_response_title.trim(), canned_response_message.trim()).subscribe((responses: any) => {
187
+ this.logger.log('[CREATE-CANNED-RES] - CREATE CANNED RESP - RES ', responses);
188
+ }, (error) => {
189
+ this.logger.error('[CREATE-CANNED-RES]- CREATE CANNED RESP - ERROR ', error);
190
+ this.showSpinnerCreateCannedResponse = false;
191
+ }, () => {
192
+ this.logger.log('[CREATE-CANNED-RES] - CREATE CANNED RESP * COMPLETE *');
193
+ this.showSpinnerCreateCannedResponse = false;
194
+ this.closeModalCreateCannedResponseModal()
195
+ this.events.publish('newcannedresponse:created', true);
196
+ });
197
197
  }
198
198
 
199
199
  openAddPersonalisationMenu() {
@@ -55,7 +55,7 @@
55
55
 
56
56
  <!-- fab placed to the (vertical) center and end -->
57
57
  <ion-fab vertical="end" horizontal="end" slot="fixed" class="sendButton">
58
- <ion-fab-button color="primary" (click)="onSendMessage()">
58
+ <ion-fab-button (click)="onSendMessage()">
59
59
  <ion-icon name="send"></ion-icon>
60
60
  </ion-fab-button>
61
61
  </ion-fab>
@@ -11,6 +11,10 @@
11
11
  transform: translateX(-50%);
12
12
  }
13
13
 
14
+ ion-fab-button{
15
+ --background: var(--basic-blue);
16
+ }
17
+
14
18
  .previewSelected {
15
19
  width: 100%;
16
20
  height: auto;
@@ -1,5 +1,4 @@
1
- import {
2
- Component, OnInit, Input, ViewChild, ElementRef, HostListener, AfterViewInit} from '@angular/core'
1
+ import {Component, OnInit, Input, ViewChild, ElementRef, HostListener, AfterViewInit} from '@angular/core'
3
2
  import { TYPE_MSG_IMAGE } from 'src/chat21-core/utils/constants'
4
3
  import { ModalController } from '@ionic/angular'
5
4
  import { DomSanitizer, SafeResourceUrl } from '@angular/platform-browser'
@@ -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
+ }
@@ -40,7 +40,7 @@ export class TiledeskService {
40
40
  // console.log('CLOUD FUNCT CLOSE SUPPORT GROUP REQUEST BODY ', body);
41
41
  // https://tiledesk-server-pre.herokuapp.com/
42
42
  // const url = 'https://tiledesk-server-pre.herokuapp.com/' + this.project_id + '/requests/' + group_id + '/close';
43
- const url = this.apiUrl + projectid + '/requests/' + supportgroupid + '/close';
43
+ const url = this.apiUrl + projectid + '/requests/' + supportgroupid + '/close'+'?forceArchive=true';
44
44
 
45
45
  this.logger.log('[TILEDESK-SERVICE] - closeSupportGroup URL ', url);
46
46
  return this.http.put(url, body, httpOptions).pipe(map((res: any) => {
@@ -252,31 +252,7 @@ export class TiledeskService {
252
252
  }
253
253
 
254
254
 
255
- // -------------------------------------------------------------------------------------
256
- // @ Create - Save (POST) new canned response
257
- // -------------------------------------------------------------------------------------
258
- public createCannedResponse(message: string, title: string, project_id: string, token: string) {
259
- this.logger.log('[TILEDESK-SERVICE] - CREATE CANNED-RES - token', token);
260
- const url = this.apiUrl + project_id + '/canned/'
261
- this.logger.log('[TILEDESK-SERVICE] - CREATE CANNED-RES - URL', url);
262
-
263
- const httpOptions = {
264
- headers: new HttpHeaders({
265
- 'Content-Type': 'application/json',
266
- Authorization: token
267
- })
268
- };
269
-
270
- const body = { 'text': message, 'title': title };
271
-
272
- this.logger.log('[TILEDESK-SERVICE] CREATE CANNED-RES - BODY ', body);
273
-
274
- return this.http.post(url, JSON.stringify(body), httpOptions).pipe(map((res: any) => {
275
- this.logger.log('[TILEDESK-SERVICE] - CREATE CANNED-RES - RES ', res);
276
- return res
277
- }))
278
-
279
- }
255
+
280
256
 
281
257
  // .post(url, JSON.stringify(body), options)
282
258
  // .map((res) => res.json());
@@ -1,9 +1,9 @@
1
+ import { NavbarComponent } from './../components/navbar/navbar.component';
1
2
  import { FormsModule } from '@angular/forms';
2
3
  import { NgSelectModule } from '@ng-select/ng-select';
3
4
  import { NetworkOfflineComponent } from './../components/network-offline/network-offline.component';
4
5
  import { ContactsDirectoryComponent } from './../components/contacts-directory/contacts-directory.component';
5
6
  import { HtmlComponent } from './../chatlib/conversation-detail/message/html/html.component';
6
- import { BubbleOthersMessageComponent } from './../components/conversation-detail/bubble-others-message/bubble-others-message.component';
7
7
 
8
8
  import { TextComponent } from '../chatlib/conversation-detail/message/text/text.component';
9
9
  import { ReturnReceiptComponent } from '../chatlib/conversation-detail/message/return-receipt/return-receipt.component';
@@ -21,32 +21,29 @@ import { CommonModule } from '@angular/common';
21
21
  import { IonicModule } from '@ionic/angular';
22
22
 
23
23
  import { AvatarProfileComponent } from 'src/app/components/utils/avatar-profile/avatar-profile.component';
24
- import { DdpHeaderComponent } from 'src/app/components/ddp-header/ddp-header.component';
24
+ import { HeaderConversationsList } from 'src/app/components/conversations-list/header-conversations-list/header-conversations-list.component';
25
+ import { HeaderConversationsListArchived } from 'src/app/components/conversations-list/header-conversations-list-archived/header-conversations-list-archived.component';
25
26
 
26
27
  import { UserPresenceComponent } from 'src/app/components/utils/user-presence/user-presence.component';
27
28
  import { UserTypingComponent } from 'src/chat21-core/utils/user-typing/user-typing.component';
28
29
  import { ListConversationsComponent } from '../chatlib/list-conversations-component/list-conversations/list-conversations.component';
29
30
  import { MomentModule } from 'angular2-moment';
30
- import { AvatarComponent } from '../chatlib/conversation-detail/message/avatar/avatar.component';
31
- import { MarkedPipe } from '../directives/marked.pipe';
32
- import { AutofocusDirective } from '../directives/autofocus.directive';
33
- import { HtmlEntitiesEncodePipe } from '../directives/html-entities-encode.pipe';
34
- import { IonConversationDetailComponent } from '../chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component';
35
- import { BubbleMyMessageComponent } from '../components/conversation-detail/bubble-my-message/bubble-my-message.component';
36
- import { BubbleDayMessageComponent } from '../components/conversation-detail/bubble-day-message/bubble-day-message.component';
37
- import { BubbleSystemMessageComponent } from '../components/conversation-detail/bubble-system-message/bubble-system-message.component';
38
- import { InfoContentComponent } from '../components/conversation-info/info-content/info-content.component';
39
- import { InfoSupportGroupComponent } from '../components/conversation-info/info-support-group/info-support-group.component';
40
- import { InfoDirectComponent } from '../components/conversation-info/info-direct/info-direct.component';
41
- import { AdvancedInfoAccordionComponent } from '../components/conversation-info/advanced-info-accordion/advanced-info-accordion.component';
42
- import { InfoGroupComponent } from '../components/conversation-info/info-group/info-group.component';
31
+ import { AvatarComponent } from 'src/app/chatlib/conversation-detail/message/avatar/avatar.component';
32
+ import { MarkedPipe } from 'src/app/directives/marked.pipe';
33
+ import { AutofocusDirective } from 'src/app/directives/autofocus.directive';
34
+ import { HtmlEntitiesEncodePipe } from 'src/app/directives/html-entities-encode.pipe';
35
+ import { IonConversationDetailComponent } from 'src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component';
36
+ import { InfoContentComponent } from 'src/app/components/conversation-info/info-content/info-content.component';
37
+ import { InfoSupportGroupComponent } from 'src/app/components/conversation-info/info-support-group/info-support-group.component';
38
+ import { InfoDirectComponent } from 'src/app/components/conversation-info/info-direct/info-direct.component';
39
+ import { AdvancedInfoAccordionComponent } from 'src/app/components/conversation-info/advanced-info-accordion/advanced-info-accordion.component';
40
+ import { InfoGroupComponent } from 'src/app/components/conversation-info/info-group/info-group.component';
43
41
  import { TooltipModule, TooltipOptions } from 'ng2-tooltip-directive';
44
- import { OptionHeaderComponent } from '../components/conversation-detail/option-header/option-header.component';
45
- import { MessageAttachmentComponent } from '../chatlib/conversation-detail/message/message-attachment/message-attachment.component';
46
- import { ImageViewerComponent } from '../components/image-viewer/image-viewer.component';
47
- import { SidebarComponent } from '../components/sidebar/sidebar.component';
48
- import { SidebarUserDetailsComponent } from '../components/sidebar-user-details/sidebar-user-details.component';
49
- import { ProjectItemComponent } from '../components/project-item/project-item.component';
42
+ import { MessageAttachmentComponent } from 'src/app/chatlib/conversation-detail/message/message-attachment/message-attachment.component';
43
+ import { ImageViewerComponent } from 'src/app/components/image-viewer/image-viewer.component';
44
+ import { SidebarComponent } from 'src/app/components/sidebar/sidebar.component';
45
+ import { SidebarUserDetailsComponent } from 'src/app/components/sidebar-user-details/sidebar-user-details.component';
46
+ import { ProjectItemComponent } from 'src/app/components/project-item/project-item.component';
50
47
  import { DefaultTooltipOptions } from 'src/chat21-core/utils/utils';
51
48
  import { MatTooltipModule } from '@angular/material/tooltip';
52
49
  import { MatSnackBarModule } from '@angular/material/snack-bar';
@@ -59,12 +56,13 @@ import { SafeHtmlPipe } from '../directives/safe-html.pipe';
59
56
  declarations: [
60
57
  // MessageTextAreaComponent,
61
58
  AvatarProfileComponent,
62
- DdpHeaderComponent,
59
+ HeaderConversationsList,
63
60
  UserPresenceComponent,
64
61
  UserTypingComponent,
65
62
  ListConversationsComponent,
66
63
  IonListConversationsComponent,
67
64
  ImageViewerComponent,
65
+ NavbarComponent,
68
66
  SidebarComponent,
69
67
  SidebarUserDetailsComponent,
70
68
  ProjectItemComponent,
@@ -82,10 +80,6 @@ import { SafeHtmlPipe } from '../directives/safe-html.pipe';
82
80
  ReturnReceiptComponent,
83
81
  TextComponent,
84
82
  HtmlComponent,
85
- BubbleDayMessageComponent,
86
- BubbleSystemMessageComponent,
87
- BubbleMyMessageComponent,
88
- BubbleOthersMessageComponent,
89
83
  InfoContentComponent,
90
84
  InfoSupportGroupComponent,
91
85
  InfoDirectComponent,
@@ -95,15 +89,16 @@ import { SafeHtmlPipe } from '../directives/safe-html.pipe';
95
89
  AutofocusDirective,
96
90
  HtmlEntitiesEncodePipe,
97
91
  SafeHtmlPipe,
98
- OptionHeaderComponent,
92
+ HeaderConversationsListArchived,
99
93
  NetworkOfflineComponent
100
94
  ],
101
95
  exports: [
102
96
  // MessageTextAreaComponent,
103
97
  AutofocusDirective,
104
98
  AvatarProfileComponent,
105
- DdpHeaderComponent,
99
+ HeaderConversationsList,
106
100
  ImageViewerComponent,
101
+ NavbarComponent,
107
102
  SidebarComponent,
108
103
  SidebarUserDetailsComponent,
109
104
  ProjectItemComponent,
@@ -123,15 +118,11 @@ import { SafeHtmlPipe } from '../directives/safe-html.pipe';
123
118
  InfoMessageComponent,
124
119
  ReturnReceiptComponent,
125
120
  TextComponent,
126
- BubbleDayMessageComponent,
127
- BubbleSystemMessageComponent,
128
- BubbleMyMessageComponent,
129
- BubbleOthersMessageComponent,
130
121
  InfoContentComponent,
131
122
  InfoSupportGroupComponent,
132
123
  InfoDirectComponent,
133
124
  InfoGroupComponent,
134
- OptionHeaderComponent,
125
+ HeaderConversationsListArchived,
135
126
  NetworkOfflineComponent
136
127
 
137
128
  ],