@chat21/chat21-ionic 3.0.61-rc2 → 3.0.61-rc21

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 (120) hide show
  1. package/CHANGELOG.md +90 -0
  2. package/angular.json +2 -0
  3. package/config.xml +4 -5
  4. package/deploy_pre.sh +27 -27
  5. package/deploy_prod.sh +5 -1
  6. package/env.sample +1 -1
  7. package/package.json +8 -8
  8. package/resources/{Android → android}/icon/drawable-hdpi-icon.png +0 -0
  9. package/resources/{Android → android}/icon/drawable-ldpi-icon.png +0 -0
  10. package/resources/{Android → android}/icon/drawable-mdpi-icon.png +0 -0
  11. package/resources/{Android → android}/icon/drawable-xhdpi-icon.png +0 -0
  12. package/resources/{Android → android}/icon/drawable-xxhdpi-icon.png +0 -0
  13. package/resources/{Android → android}/icon/drawable-xxxhdpi-icon.png +0 -0
  14. package/resources/{Android → android}/icon.png +0 -0
  15. package/resources/{Android → android}/splash/drawable-land-hdpi-screen.png +0 -0
  16. package/resources/{Android → android}/splash/drawable-land-ldpi-screen.png +0 -0
  17. package/resources/{Android → android}/splash/drawable-land-mdpi-screen.png +0 -0
  18. package/resources/{Android → android}/splash/drawable-land-xhdpi-screen.png +0 -0
  19. package/resources/{Android → android}/splash/drawable-land-xxhdpi-screen.png +0 -0
  20. package/resources/{Android → android}/splash/drawable-land-xxxhdpi-screen.png +0 -0
  21. package/resources/{Android → android}/splash/drawable-port-hdpi-screen.png +0 -0
  22. package/resources/{Android → android}/splash/drawable-port-ldpi-screen.png +0 -0
  23. package/resources/{Android → android}/splash/drawable-port-mdpi-screen.png +0 -0
  24. package/resources/{Android → android}/splash/drawable-port-xhdpi-screen.png +0 -0
  25. package/resources/{Android → android}/splash/drawable-port-xxhdpi-screen.png +0 -0
  26. package/resources/{Android → android}/splash/drawable-port-xxxhdpi-screen.png +0 -0
  27. package/resources/{Android → android}/splash.png +0 -0
  28. package/src/app/app-routing.module.ts +15 -0
  29. package/src/app/app.component.html +4 -3
  30. package/src/app/app.component.scss +6 -1
  31. package/src/app/app.component.ts +29 -18
  32. package/src/app/app.module.ts +11 -3
  33. package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.html +36 -25
  34. package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.scss +160 -50
  35. package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.ts +101 -18
  36. package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.html +21 -36
  37. package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.scss +19 -7
  38. package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.ts +35 -40
  39. package/src/app/chatlib/conversation-detail/message/message-attachment/message-attachment.component.scss +1 -1
  40. package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.html +6 -1
  41. package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.ts +89 -21
  42. package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.html +37 -33
  43. package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.scss +7 -1
  44. package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.ts +148 -63
  45. package/src/app/components/conversation-detail/message-text-area/message-text-area.component.html +59 -22
  46. package/src/app/components/conversation-detail/message-text-area/message-text-area.component.scss +32 -9
  47. package/src/app/components/conversation-detail/message-text-area/message-text-area.component.ts +102 -23
  48. package/src/app/components/conversation-info/info-content/info-content.component.html +2 -2
  49. package/src/app/components/ddp-header/ddp-header.component.html +11 -4
  50. package/src/app/components/ddp-header/ddp-header.component.ts +94 -19
  51. package/src/app/components/project-item/project-item.component.html +2 -2
  52. package/src/app/components/project-item/project-item.component.scss +1 -1
  53. package/src/app/components/project-item/project-item.component.ts +1 -1
  54. package/src/app/components/sidebar/sidebar.component.html +151 -86
  55. package/src/app/components/sidebar/sidebar.component.scss +72 -4
  56. package/src/app/components/sidebar/sidebar.component.ts +211 -72
  57. package/src/app/components/sidebar-user-details/sidebar-user-details.component.html +29 -10
  58. package/src/app/components/sidebar-user-details/sidebar-user-details.component.scss +53 -29
  59. package/src/app/components/sidebar-user-details/sidebar-user-details.component.ts +176 -97
  60. package/src/app/pages/conversation-detail/conversation-detail.module.ts +6 -1
  61. package/src/app/pages/conversation-detail/conversation-detail.page.html +20 -10
  62. package/src/app/pages/conversation-detail/conversation-detail.page.scss +28 -0
  63. package/src/app/pages/conversation-detail/conversation-detail.page.ts +1124 -777
  64. package/src/app/pages/conversations-list/conversations-list.module.ts +2 -1
  65. package/src/app/pages/conversations-list/conversations-list.page.html +9 -6
  66. package/src/app/pages/conversations-list/conversations-list.page.scss +9 -1
  67. package/src/app/pages/conversations-list/conversations-list.page.ts +724 -436
  68. package/src/app/pages/create-canned-response/create-canned-response-routing.module.ts +17 -0
  69. package/src/app/pages/create-canned-response/create-canned-response.module.ts +30 -0
  70. package/src/app/pages/create-canned-response/create-canned-response.page.html +150 -0
  71. package/src/app/pages/create-canned-response/create-canned-response.page.scss +55 -0
  72. package/src/app/pages/create-canned-response/create-canned-response.page.spec.ts +24 -0
  73. package/src/app/pages/create-canned-response/create-canned-response.page.ts +319 -0
  74. package/src/app/pages/create-requester/create-requester-routing.module.ts +17 -0
  75. package/src/app/pages/create-requester/create-requester.module.ts +28 -0
  76. package/src/app/pages/create-requester/create-requester.page.html +67 -0
  77. package/src/app/pages/create-requester/create-requester.page.scss +30 -0
  78. package/src/app/pages/create-requester/create-requester.page.spec.ts +24 -0
  79. package/src/app/pages/create-requester/create-requester.page.ts +138 -0
  80. package/src/app/pages/create-ticket/create-ticket-routing.module.ts +17 -0
  81. package/src/app/pages/create-ticket/create-ticket.module.ts +28 -0
  82. package/src/app/pages/create-ticket/create-ticket.page.html +171 -0
  83. package/src/app/pages/create-ticket/create-ticket.page.scss +52 -0
  84. package/src/app/pages/create-ticket/create-ticket.page.spec.ts +24 -0
  85. package/src/app/pages/create-ticket/create-ticket.page.ts +432 -0
  86. package/src/app/pages/loader-preview/loader-preview.page.ts +226 -166
  87. package/src/app/pages/profile-info/profile-info.page.html +2 -2
  88. package/src/app/pages/profile-info/profile-info.page.scss +13 -2
  89. package/src/app/services/tiledesk/tiledesk.service.ts +209 -0
  90. package/src/app/shared/shared.module.ts +1 -1
  91. package/src/app/utils/scrollbar-theme.directive.ts +58 -24
  92. package/src/assets/i18n/de.json +46 -7
  93. package/src/assets/i18n/en.json +42 -3
  94. package/src/assets/i18n/es.json +42 -3
  95. package/src/assets/i18n/fr.json +45 -6
  96. package/src/assets/i18n/it.json +42 -3
  97. package/src/assets/i18n/pt.json +42 -3
  98. package/src/assets/i18n/ru.json +43 -4
  99. package/src/assets/i18n/sr.json +265 -0
  100. package/src/assets/i18n/tr.json +42 -4
  101. package/src/assets/images/default-avatar-x-select.png +0 -0
  102. package/src/assets/images/language_flag/hr.png +0 -0
  103. package/src/assets/images/language_flag/sr.png +0 -0
  104. package/src/assets/images/priority_icons/high.svg +3 -0
  105. package/src/assets/images/priority_icons/high_v2.svg +14 -0
  106. package/src/assets/images/priority_icons/low.svg +10 -0
  107. package/src/assets/images/priority_icons/low_v2.svg +14 -0
  108. package/src/assets/images/priority_icons/medium.svg +16 -0
  109. package/src/assets/images/priority_icons/medium_v2.svg +11 -0
  110. package/src/assets/images/priority_icons/urgent.svg +4 -0
  111. package/src/assets/images/priority_icons/urgent_v2.svg +16 -0
  112. package/src/chat-config-pre-test.json +1 -1
  113. package/src/chat-config-template.json +1 -1
  114. package/src/chat-config.json +1 -1
  115. package/src/chat21-core/providers/firebase/firebase-conversation-handler.ts +8 -3
  116. package/src/chat21-core/utils/constants.ts +6 -1
  117. package/src/chat21-core/utils/utils-message.ts +19 -0
  118. package/src/global.scss +65 -111
  119. package/publish_pre.sh +0 -33
  120. package/publish_prod.sh +0 -33
@@ -10,15 +10,16 @@ import { WebsocketService } from 'src/app/services/websocket/websocket.service';
10
10
  import { skip } from 'rxjs/operators';
11
11
  import { AppConfigProvider } from 'src/app/services/app-config';
12
12
  import { EventsService } from 'src/app/services/events-service';
13
-
14
-
13
+ import { tranlatedLanguage } from '../../../chat21-core/utils/constants';
14
+ import { avatarPlaceholder, getColorBck } from 'src/chat21-core/utils/utils-user';
15
+ import * as PACKAGE from 'package.json';
15
16
  @Component({
16
17
  selector: 'app-sidebar-user-details',
17
18
  templateUrl: './sidebar-user-details.component.html',
18
19
  styleUrls: ['./sidebar-user-details.component.scss'],
19
20
  })
20
21
  export class SidebarUserDetailsComponent implements OnInit, OnChanges {
21
- HAS_CLICKED_OPEN_USER_DETAIL: boolean = false;
22
+ // HAS_CLICKED_OPEN_USER_DETAIL: boolean = false;
22
23
  // @Output() onCloseUserDetailsSidebar = new EventEmitter();
23
24
 
24
25
 
@@ -40,6 +41,7 @@ export class SidebarUserDetailsComponent implements OnInit, OnChanges {
40
41
  PAYD_PLAN_NAME_ENTERPRISE_msg: string;
41
42
  PRO_PLAN_TRIAL_msg: string;
42
43
  FREE_PLAN_msg: string;
44
+ LOGOUT_msg: string;
43
45
  profile_name_translated: string;
44
46
  SubscriptionPaymentProblem: string;
45
47
  user: any
@@ -53,6 +55,10 @@ export class SidebarUserDetailsComponent implements OnInit, OnChanges {
53
55
  public_Key: any
54
56
  plan_name: string;
55
57
  plan_subscription_is_active: boolean;
58
+ USER_PHOTO_PROFILE_EXIST: boolean;
59
+ version: string
60
+ test: Date = new Date();
61
+ company_name: string = 'Tiledesk'
56
62
  constructor(
57
63
  private translate: TranslateService,
58
64
  public tiledeskAuthService: TiledeskAuthService,
@@ -66,69 +72,148 @@ export class SidebarUserDetailsComponent implements OnInit, OnChanges {
66
72
  ) { }
67
73
 
68
74
  ngOnInit() {
75
+ this.version = PACKAGE.version;
69
76
  this.getCurrentChatLangAndTranslateLabels();
70
77
  this.subcribeToAuthStateChanged();
71
78
  this.listenTocurrentProjectUserUserAvailability$();
72
79
  this.getCurrentStoredProject();
73
80
  this.getOSCODE();
74
- this.listenOpenUserSidebarEvent();
81
+ // this.listenOpenUserSidebarEvent();
82
+ }
83
+
84
+ subcribeToAuthStateChanged() {
85
+ this.messagingAuthService.BSAuthStateChanged.subscribe((state) => {
86
+ this.logger.log('[SIDEBAR-USER-DETAILS] BSAuthStateChanged ', state)
87
+
88
+ if (state === 'online') {
89
+ const currentUser = JSON.parse(this.appStorageService.getItem('currentUser'));
90
+ this.logger.log('[SIDEBAR-USER-DETAILS] currentUser ', currentUser)
91
+ if (currentUser) {
92
+ this.user = currentUser;
93
+ this.createUserAvatar(this.user)
94
+ this.photo_profile_URL = this.imageRepoService.getImagePhotoUrl(currentUser.uid)
95
+ this.logger.log('[SIDEBAR-USER-DETAILS] photo_profile_URL ', this.photo_profile_URL);
96
+ this.checkIfExistPhotoProfile(this.photo_profile_URL)
97
+ }
98
+ }
99
+ })
75
100
  }
76
101
 
77
- listenOpenUserSidebarEvent() {
78
- this.events.subscribe('userdetailsidebar:opened', (openUserDetailsSidebar) => {
79
- console.log('[SIDEBAR-USER-DETAILS] - listenOpenUserSidebarEvent - openUserDetailsSidebar', openUserDetailsSidebar);
80
- this.HAS_CLICKED_OPEN_USER_DETAIL = true;
81
- });
102
+ checkIfExistPhotoProfile(imageUrl) {
103
+ this.verifyImageURL(imageUrl, (imageExists) => {
104
+
105
+ if (imageExists === true) {
106
+ this.USER_PHOTO_PROFILE_EXIST = true;
107
+ this.logger.log('[SIDEBAR-USER-DETAILS] photo_profile_URL IMAGE EXIST ', imageExists)
108
+
109
+ } else {
110
+ this.USER_PHOTO_PROFILE_EXIST = false;
111
+ this.logger.log('[SIDEBAR-USER-DETAILS] photo_profile_URL IMAGE EXIST ', imageExists)
112
+ }
113
+ })
82
114
  }
83
115
 
116
+
117
+ createUserAvatar(currentUser) {
118
+ this.logger.log('[SIDEBAR-USER-DETAILS] - createProjectUserAvatar ', currentUser)
119
+ let fullname = ''
120
+ if (currentUser && currentUser.firstname && currentUser.lastname) {
121
+ fullname = currentUser.firstname + ' ' + currentUser.lastname
122
+ currentUser['fullname_initial'] = avatarPlaceholder(fullname)
123
+ currentUser['fillColour'] = getColorBck(fullname)
124
+ } else if (currentUser && currentUser.firstname) {
125
+ fullname = currentUser.firstname
126
+ currentUser['fullname_initial'] = avatarPlaceholder(fullname)
127
+ currentUser['fillColour'] = getColorBck(fullname)
128
+ } else {
129
+ currentUser['fullname_initial'] = 'N/A'
130
+ currentUser['fillColour'] = 'rgb(98, 100, 167)'
131
+ }
132
+ }
133
+
134
+ verifyImageURL(image_url, callBack) {
135
+ const img = new Image();
136
+ img.src = image_url;
137
+ img.onload = function () {
138
+ callBack(true);
139
+ };
140
+ img.onerror = function () {
141
+ callBack(false);
142
+ };
143
+ }
144
+
145
+ // listenOpenUserSidebarEvent() {
146
+ // this.events.subscribe('userdetailsidebar:opened', (openUserDetailsSidebar) => {
147
+ // this.logger.log('[SIDEBAR-USER-DETAILS] - listenOpenUserSidebarEvent - openUserDetailsSidebar', openUserDetailsSidebar);
148
+ // this.HAS_CLICKED_OPEN_USER_DETAIL = true;
149
+ // });
150
+ // }
151
+
84
152
  @HostListener('document:click', ['$event'])
85
153
  clickout(event) {
86
- console.log('[SIDEBAR-USER-DETAILS] clickout event.target)', event.target)
87
- console.log('[SIDEBAR-USER-DETAILS] clickout event.target)', event.target.id)
154
+ this.logger.log('[SIDEBAR-USER-DETAILSS-CHAT] clickout event.target)', event.target)
155
+ this.logger.log('[SIDEBAR-USER-DETAILSS-CHAT] clickout event.target)', event.target.id)
88
156
  const clicked_element_id = event.target.id
89
157
  if (this.eRef.nativeElement.contains(event.target)) {
90
- console.log('[SIDEBAR-USER-DETAILS] clicked inside')
158
+ // this.logger.log('[SIDEBAR-USER-DETAILS] clicked inside')
91
159
  } else {
92
- console.log('[SIDEBAR-USER-DETAILS] HAS_CLICKED_OPEN_USER_DETAIL ', this.HAS_CLICKED_OPEN_USER_DETAIL)
93
- if (this.HAS_CLICKED_OPEN_USER_DETAIL === true) {
94
- if (!clicked_element_id.startsWith("sidebaravatar")) {
95
- this.closeUserDetailSidePanel();
96
- }
97
- console.log('[SIDEBAR-USER-DETAILS] clicked outside')
160
+ if (!clicked_element_id.startsWith("sidebaravatar")) {
161
+ this.closeUserDetailSidePanel();
98
162
  }
163
+ // this.logger.log('[SIDEBAR-USER-DETAILS] clicked outside')
164
+
99
165
  }
100
166
  }
101
167
 
168
+ closeUserDetailSidePanel() {
169
+ var element = document.getElementById('user-details');
170
+ element.classList.remove("active");
171
+ this.logger.log('[SIDEBAR-USER-DETAILS] element', element);
172
+ // this.HAS_CLICKED_OPEN_USER_DETAIL === true
173
+ // this.onCloseUserDetailsSidebar.emit(false);
174
+ }
175
+
176
+
102
177
  getCurrentChatLangAndTranslateLabels() {
103
178
  this.browserLang = this.translate.getBrowserLang();
104
179
  const currentUser = JSON.parse(this.appStorageService.getItem('currentUser'));
105
- console.log('[SIDEBAR-USER-DETAILS] - ngOnInit - currentUser ', currentUser)
106
- console.log('[SIDEBAR-USER-DETAILS] - ngOnInit - browserLang ', this.browserLang)
180
+ this.logger.log('[SIDEBAR-USER-DETAILS] - ngOnInit - currentUser ', currentUser)
181
+ this.logger.log('[SIDEBAR-USER-DETAILS] - ngOnInit - browserLang ', this.browserLang)
107
182
  let currentUserId = ''
108
183
  if (currentUser) {
109
184
  currentUserId = currentUser.uid
110
- console.log('[SIDEBAR-USER-DETAILS] - ngOnInit - currentUserId ', currentUserId)
185
+ this.logger.log('[SIDEBAR-USER-DETAILS] - ngOnInit - currentUserId ', currentUserId)
111
186
  }
112
187
 
113
188
  const stored_preferred_lang = localStorage.getItem(currentUserId + '_lang');
114
- console.log('[SIDEBAR-USER-DETAILS] stored_preferred_lang: ', stored_preferred_lang);
189
+ this.logger.log('[SIDEBAR-USER-DETAILS] stored_preferred_lang: ', stored_preferred_lang);
115
190
 
116
191
 
117
192
  this.chat_lang = ''
118
193
  if (this.browserLang && !stored_preferred_lang) {
119
194
  this.chat_lang = this.browserLang
120
- this.flag_url = "assets/images/language_flag/" + this.chat_lang + ".png"
195
+ // this.flag_url = "assets/images/language_flag/" + this.chat_lang + ".png"
121
196
 
122
- console.log('[SIDEBAR-USER-DETAILS] flag_url: ', this.flag_url);
123
- console.log('[SIDEBAR-USER-DETAILS] chat_lang: ', this.chat_lang);
197
+ this.logger.log('[SIDEBAR-USER-DETAILS] flag_url: ', this.flag_url);
198
+ this.logger.log('[SIDEBAR-USER-DETAILS] chat_lang: ', this.chat_lang);
124
199
  } else if (this.browserLang && stored_preferred_lang) {
125
200
  this.chat_lang = stored_preferred_lang
126
- this.flag_url = "assets/images/language_flag/" + this.chat_lang + ".png"
127
- console.log('[SIDEBAR-USER-DETAILS] flag_url: ', this.flag_url);
128
- console.log('[SIDEBAR-USER-DETAILS] chat_lang: ', this.chat_lang);
201
+ // this.flag_url = "assets/images/language_flag/" + this.chat_lang + ".png"
202
+ this.logger.log('[SIDEBAR-USER-DETAILS] flag_url: ', this.flag_url);
203
+ this.logger.log('[SIDEBAR-USER-DETAILS] chat_lang: ', this.chat_lang);
129
204
  }
130
205
 
131
- this.translate.use(this.chat_lang);
206
+
207
+ if (tranlatedLanguage.includes(this.chat_lang)) {
208
+ this.logger.log('[SIDEBAR-USER-DETAILS] tranlatedLanguage includes', this.chat_lang, ': ', tranlatedLanguage.includes(this.chat_lang))
209
+ this.translate.use(this.chat_lang);
210
+ this.flag_url = "assets/images/language_flag/" + this.chat_lang + ".png"
211
+ } else {
212
+ this.logger.log('[SIDEBAR-USER-DETAILS] tranlatedLanguage includes', this.chat_lang, ': ', tranlatedLanguage.includes(this.chat_lang))
213
+ this.translate.use('en');
214
+ this.flag_url = "assets/images/language_flag/en.png"
215
+ this.chat_lang = 'en'
216
+ }
132
217
  this.translateLabels()
133
218
  }
134
219
 
@@ -138,13 +223,14 @@ export class SidebarUserDetailsComponent implements OnInit, OnChanges {
138
223
  this.getIsBusyTranslation();
139
224
  this.getSubscriptionPaymentProblemTranslation();
140
225
  this.getThePlanHasExpiredTranslation();
226
+ this.getLogoutTranslation();
141
227
  }
142
228
 
143
229
 
144
230
  getOSCODE() {
145
231
  this.public_Key = this.appConfigProvider.getConfig().t2y12PruGU9wUtEGzBJfolMIgK;
146
- console.log('[SIDEBAR-USER-DETAILS] AppConfigService getAppConfig public_Key', this.public_Key);
147
- console.log('[SIDEBAR-USER-DETAILS] AppConfigService getAppConfig', this.appConfigProvider.getConfig());
232
+ this.logger.log('[SIDEBAR-USER-DETAILS] AppConfigService getAppConfig public_Key', this.public_Key);
233
+ this.logger.log('[SIDEBAR-USER-DETAILS] AppConfigService getAppConfig', this.appConfigProvider.getConfig());
148
234
  if (this.public_Key) {
149
235
  let keys = this.public_Key.split("-");
150
236
  this.logger.log('[SIDEBAR-USER-DETAILS] PUBLIC-KEY - public_Key keys', keys)
@@ -173,16 +259,16 @@ export class SidebarUserDetailsComponent implements OnInit, OnChanges {
173
259
  getAvailableTranslation() {
174
260
  this.translate.get('Available')
175
261
  .subscribe((text: string) => {
176
- // this.deleteContact_msg = text;
177
- console.log('[SIDEBAR-USER-DETAILS] - GET GTTTTTN ', text)
262
+
263
+ // console.log('[SIDEBAR-USER-DETAILS] - GET GTTTTTN ', text)
178
264
  this.IS_AVAILABLE_msg = text
179
265
  });
180
266
  }
181
267
  getUnavailableTranslation() {
182
268
  this.translate.get('Unavailable')
183
269
  .subscribe((text: string) => {
184
- // this.deleteContact_msg = text;
185
- console.log('[SIDEBAR-USER-DETAILS] - GET GTTTTTN ', text)
270
+
271
+ // console.log('[SIDEBAR-USER-DETAILS] - GET GTTTTTN ', text)
186
272
  this.IS_UNAVAILABLE_msg = text
187
273
  });
188
274
  }
@@ -190,17 +276,26 @@ export class SidebarUserDetailsComponent implements OnInit, OnChanges {
190
276
  getIsBusyTranslation() {
191
277
  this.translate.get('Busy')
192
278
  .subscribe((text: string) => {
193
- // this.deleteContact_msg = text;
194
- console.log('[SIDEBAR-USER-DETAILS] - GET GTTTTTN ', text)
279
+
280
+ // console.log('[SIDEBAR-USER-DETAILS] - GET GTTTTTN ', text)
195
281
  this.IS_BUSY_msg = text
196
282
  });
197
283
  }
198
284
 
285
+ getLogoutTranslation() {
286
+ this.translate.get('LABEL_LOGOUT')
287
+ .subscribe((text: string) => {
288
+ // this.deleteContact_msg = text;
289
+ // console.log('[SIDEBAR-USER-DETAILS] - GET Logout label ', text)
290
+ this.LOGOUT_msg = text
291
+ });
292
+ }
293
+
199
294
  getSubscriptionPaymentProblemTranslation() {
200
295
  this.translate.get('SubscriptionPaymentProblem')
201
296
  .subscribe((text: string) => {
202
- // this.deleteContact_msg = text;
203
- console.log('[SIDEBAR-USER-DETAILS] - GET GTTTTTN ', text)
297
+
298
+ // console.log('[SIDEBAR-USER-DETAILS] - GET GTTTTTN ', text)
204
299
  this.SUBSCRIPTION_PAYMENT_PROBLEM_msg = text
205
300
  });
206
301
  }
@@ -208,8 +303,8 @@ export class SidebarUserDetailsComponent implements OnInit, OnChanges {
208
303
  getThePlanHasExpiredTranslation() {
209
304
  this.translate.get('ThePlanHasExpired')
210
305
  .subscribe((text: string) => {
211
- // this.deleteContact_msg = text;
212
- console.log('[SIDEBAR-USER-DETAILS] - GET GTTTTTN ', text)
306
+
307
+ // console.log('[SIDEBAR-USER-DETAILS] - GET GTTTTTN ', text)
213
308
  this.THE_PLAN_HAS_EXPIRED_msg = text
214
309
  });
215
310
  }
@@ -218,30 +313,28 @@ export class SidebarUserDetailsComponent implements OnInit, OnChanges {
218
313
  getCurrentStoredProject() {
219
314
  try {
220
315
  const project = localStorage.getItem('last_project')
221
-
222
-
223
316
  if (project) {
224
317
  const projectObjct = JSON.parse(localStorage.getItem('last_project'))
225
- console.log('[SIDEBAR-USER-DETAILS] - GET STORED PROJECT ', projectObjct)
318
+ // console.log('[SIDEBAR-USER-DETAILS] - GET STORED PROJECT ', projectObjct)
226
319
 
227
320
  this.projectID = projectObjct['id_project']['_id']
228
- console.log('[SIDEBAR-USER-DETAILS] - GET STORED PROJECT > PROJECT ID ', this.projectID);
321
+ // console.log('[SIDEBAR-USER-DETAILS] - GET STORED PROJECT > PROJECT ID ', this.projectID);
229
322
 
230
323
  this.prjct_name = projectObjct['id_project']['name']
231
- console.log('[SIDEBAR-USER-DETAILS] - GET STORED PROJECT > PROJECT NAME ', this.prjct_name);
324
+ // console.log('[SIDEBAR-USER-DETAILS] - GET STORED PROJECT > PROJECT NAME ', this.prjct_name);
232
325
 
233
326
  this.plan_type = projectObjct['id_project']['profile']['type'];
234
- console.log('[SIDEBAR-USER-DETAILS] - GET STORED PROJECT > PLAN TYPE ', this.plan_type);
327
+ // console.log('[SIDEBAR-USER-DETAILS] - GET STORED PROJECT > PLAN TYPE ', this.plan_type);
235
328
 
236
329
  const trial_expired = projectObjct['id_project']['trialExpired']
237
- console.log('[SIDEBAR-USER-DETAILS] - GET STORED PROJECT > TRIAL EXPIRED ', trial_expired);
330
+ // console.log('[SIDEBAR-USER-DETAILS] - GET STORED PROJECT > TRIAL EXPIRED ', trial_expired);
238
331
 
239
332
  const profile_name = projectObjct['id_project']['profile']['name'];
240
- console.log('[SIDEBAR-USER-DETAILS] - GET STORED PROJECT > PROFILE NAME ', profile_name);
333
+ // console.log('[SIDEBAR-USER-DETAILS] - GET STORED PROJECT > PROFILE NAME ', profile_name);
241
334
 
242
335
  this.plan_name = projectObjct['id_project']['profile']['name'];
243
336
  this.plan_subscription_is_active = projectObjct['id_project']['isActiveSubscription'];
244
-
337
+
245
338
  if (this.plan_type === 'free') {
246
339
 
247
340
  if (trial_expired === false) {
@@ -258,14 +351,14 @@ export class SidebarUserDetailsComponent implements OnInit, OnChanges {
258
351
  }
259
352
 
260
353
  } catch (err) {
261
- console.error('[SIDEBAR-USER-DETAILS] - GET STORED PROJECT ERR ', err)
354
+ this.logger.error('[SIDEBAR-USER-DETAILS] - GET STORED PROJECT ERR ', err)
262
355
  }
263
356
 
264
357
  try {
265
358
  this.tiledeskToken = this.appStorageService.getItem('tiledeskToken');
266
- console.log('[SIDEBAR-USER-DETAILS] - GET STORED TOKEN ', this.tiledeskToken)
359
+ // console.log('[SIDEBAR-USER-DETAILS] - GET STORED TOKEN ', this.tiledeskToken)
267
360
  } catch (err) {
268
- console.error('[SIDEBAR-USER-DETAILS] - GET STORED TOKEN ', err)
361
+ this.logger.error('[SIDEBAR-USER-DETAILS] - GET STORED TOKEN ', err)
269
362
  }
270
363
  }
271
364
 
@@ -274,8 +367,8 @@ export class SidebarUserDetailsComponent implements OnInit, OnChanges {
274
367
  // this.profile_name_translated = this.PRO_PLAN_TRIAL_msg;
275
368
  this.translate.get('ProPlanTrial')
276
369
  .subscribe((text: string) => {
277
- // this.deleteContact_msg = text;
278
- console.log('[SIDEBAR-USER-DETAILS] - GET GTTTTTN ', text)
370
+
371
+ // console.log('[SIDEBAR-USER-DETAILS] - GET GTTTTTN ', text)
279
372
  this.profile_name_translated = text
280
373
  });
281
374
  }
@@ -284,8 +377,8 @@ export class SidebarUserDetailsComponent implements OnInit, OnChanges {
284
377
  // this.profile_name_translated = this.FREE_PLAN_msg;
285
378
  this.translate.get('FreePlan')
286
379
  .subscribe((text: string) => {
287
- // this.deleteContact_msg = text;
288
- console.log('[SIDEBAR-USER-DETAILS] - GET GTTTTTN ', text)
380
+
381
+ // console.log('[SIDEBAR-USER-DETAILS] - GET GTTTTTN ', text)
289
382
  this.profile_name_translated = text
290
383
  });
291
384
  }
@@ -295,7 +388,7 @@ export class SidebarUserDetailsComponent implements OnInit, OnChanges {
295
388
  this.translate.get('PaydPlanNamePro')
296
389
  .subscribe((text: string) => {
297
390
  // this.deleteContact_msg = text;
298
- console.log('[SIDEBAR-USER-DETAILS] - GET GTTTTTN ', text)
391
+ // console.log('[SIDEBAR-USER-DETAILS] - GET GTTTTTN ', text)
299
392
  this.profile_name_translated = text
300
393
  });
301
394
  }
@@ -305,28 +398,29 @@ export class SidebarUserDetailsComponent implements OnInit, OnChanges {
305
398
  this.translate.get('PaydPlanNameEnterprise')
306
399
  .subscribe((text: string) => {
307
400
  // this.deleteContact_msg = text;
308
- console.log('[SIDEBAR-USER-DETAILS] - GET GTTTTTN ', text)
401
+ // console.log('[SIDEBAR-USER-DETAILS] - GET GTTTTTN ', text)
309
402
  this.profile_name_translated = text
310
403
  });
311
404
  }
312
405
 
406
+
313
407
 
314
408
 
315
409
  listenTocurrentProjectUserUserAvailability$() {
316
410
  this.wsService.currentProjectUserAvailability$
317
411
  .pipe(skip(1))
318
412
  .subscribe((projectUser) => {
319
- console.log('[SIDEBAR-USER-DETAILS] - $UBSC TO WS USER AVAILABILITY & BUSY STATUS RES ', projectUser);
413
+ this.logger.log('[SIDEBAR-USER-DETAILS] - $UBSC TO WS USER AVAILABILITY & BUSY STATUS RES ', projectUser);
320
414
 
321
415
  if (projectUser) {
322
416
  this.IS_AVAILABLE = projectUser['user_available']
323
417
  this.IS_BUSY = projectUser['isBusy']
324
418
  this.USER_ROLE = projectUser['role']
325
- console.log('[SIDEBAR-USER-DETAILS] -translateUserRole 1', this.USER_ROLE)
419
+ // console.log('[SIDEBAR-USER-DETAILS] -translateUserRole 1', this.USER_ROLE)
326
420
  this.translateUserRole(this.USER_ROLE)
327
421
  }
328
422
 
329
-
423
+
330
424
 
331
425
  }, (error) => {
332
426
  this.logger.error('[SIDEBAR-USER-DETAILS] - $UBSC TO WS USER AVAILABILITY & BUSY STATUS error ', error);
@@ -336,11 +430,11 @@ export class SidebarUserDetailsComponent implements OnInit, OnChanges {
336
430
  }
337
431
 
338
432
  translateUserRole(role) {
339
- console.log('[SIDEBAR-USER-DETAILS] -translateUserRole ', role)
433
+ // console.log('[SIDEBAR-USER-DETAILS] -translateUserRole ', role)
340
434
  this.translate.get(role)
341
435
  .subscribe((text: string) => {
342
- // this.deleteContact_msg = text;
343
- console.log('[SIDEBAR-USER-DETAILS] - GET GTTTTTN ', text)
436
+
437
+ // console.log('[SIDEBAR-USER-DETAILS] - GET GTTTTTN ', text)
344
438
  this.USER_ROLE_LABEL = text
345
439
  });
346
440
 
@@ -349,43 +443,28 @@ export class SidebarUserDetailsComponent implements OnInit, OnChanges {
349
443
 
350
444
 
351
445
  ngOnChanges() {
352
- console.log('[SIDEBAR-USER-DETAILS] HAS_CLICKED_OPEN_USER_DETAIL', this.HAS_CLICKED_OPEN_USER_DETAIL)
353
- var element = document.getElementById('user-details');
354
- console.log('[SIDEBAR-USER-DETAILS] element', element)
355
- if (this.HAS_CLICKED_OPEN_USER_DETAIL === true) {
356
- element.classList.add("active");
357
- }
446
+ // console.log('[SIDEBAR-USER-DETAILS] HAS_CLICKED_OPEN_USER_DETAIL', this.HAS_CLICKED_OPEN_USER_DETAIL)
447
+ // var element = document.getElementById('user-details');
448
+ // // console.log('[SIDEBAR-USER-DETAILS] element', element)
449
+ // if (this.HAS_CLICKED_OPEN_USER_DETAIL === true) {
450
+ // element.classList.add("active");
451
+ // }
358
452
  }
359
453
 
360
- subcribeToAuthStateChanged() {
361
- this.messagingAuthService.BSAuthStateChanged.subscribe((state) => {
362
- console.log('[SIDEBAR] BSAuthStateChanged ', state)
363
454
 
364
- if (state === 'online') {
365
- const currentUser = JSON.parse(this.appStorageService.getItem('currentUser'));
366
- console.log('[SIDEBAR-USER-DETAILS] currentUser ', currentUser)
367
- if (currentUser) {
368
- this.user = currentUser;
369
- this.photo_profile_URL = this.imageRepoService.getImagePhotoUrl(currentUser.uid)
370
- console.log('[SIDEBAR-USER-DETAILS] photo_profile_URL ', this.photo_profile_URL)
371
- }
372
-
373
- }
374
- })
375
- }
376
455
 
377
- closeUserDetailSidePanel() {
378
- var element = document.getElementById('user-details');
379
- element.classList.remove("active");
380
- console.log('[SIDEBAR-USER-DETAILS] element', element);
381
- this.HAS_CLICKED_OPEN_USER_DETAIL === true
382
- // this.onCloseUserDetailsSidebar.emit(false);
383
- }
456
+ // closeUserDetailSidePanel() {
457
+ // var element = document.getElementById('user-details');
458
+ // element.classList.remove("active");
459
+ // this.logger.log('[SIDEBAR-USER-DETAILS] element', element);
460
+ // this.HAS_CLICKED_OPEN_USER_DETAIL === true
461
+ // // this.onCloseUserDetailsSidebar.emit(false);
462
+ // }
384
463
 
385
464
 
386
465
 
387
466
  changeAvailabilityStateInUserDetailsSidebar(available) {
388
- console.log('[SIDEBAR-USER-DETAILS] - changeAvailabilityState projectid', this.projectID, ' available 1: ', available);
467
+ this.logger.log('[SIDEBAR-USER-DETAILS] - changeAvailabilityState projectid', this.projectID, ' available 1: ', available);
389
468
 
390
469
  // available = !available
391
470
  // console.log('[SIDEBAR-USER-DETAILS] - changeAvailabilityState projectid', this.projectID, ' available 2 : ', available);
@@ -393,7 +472,7 @@ export class SidebarUserDetailsComponent implements OnInit, OnChanges {
393
472
  this.wsService.updateCurrentUserAvailability(this.tiledeskToken, this.projectID, available)
394
473
  .subscribe((projectUser: any) => {
395
474
 
396
- console.log('[SIDEBAR-USER-DETAILS] - PROJECT-USER UPDATED ', projectUser)
475
+ this.logger.log('[SIDEBAR-USER-DETAILS] - PROJECT-USER UPDATED ', projectUser)
397
476
 
398
477
  // NOTIFY TO THE USER SERVICE WHEN THE AVAILABLE / UNAVAILABLE BUTTON IS CLICKED
399
478
  // this.usersService.availability_btn_clicked(true)
@@ -404,10 +483,10 @@ export class SidebarUserDetailsComponent implements OnInit, OnChanges {
404
483
  // }
405
484
 
406
485
  }, (error) => {
407
- console.error('[SIDEBAR-USER-DETAILS] - PROJECT-USER UPDATED - ERROR ', error);
486
+ this.logger.error('[SIDEBAR-USER-DETAILS] - PROJECT-USER UPDATED - ERROR ', error);
408
487
 
409
488
  }, () => {
410
- console.log('[SIDEBAR-USER-DETAILS] - PROJECT-USER UPDATED * COMPLETE *');
489
+ this.logger.log('[SIDEBAR-USER-DETAILS] - PROJECT-USER UPDATED * COMPLETE *');
411
490
 
412
491
  });
413
492
  }
@@ -34,6 +34,9 @@ import { InfoGroupComponent } from 'src/app/components/conversation-info/info-gr
34
34
  import { SharedModule } from 'src/app/shared/shared.module';
35
35
  // import { SharedConversationInfoModule } from 'src/app/shared/shared-conversation-info.module';
36
36
  import { NgxLinkifyjsModule } from 'ngx-linkifyjs';
37
+ import { ScrollbarThemeModule } from '../../utils/scrollbar-theme.directive';
38
+ import { PickerModule } from '@ctrl/ngx-emoji-mart';
39
+
37
40
 
38
41
  @NgModule({
39
42
  imports: [
@@ -42,6 +45,8 @@ import { NgxLinkifyjsModule } from 'ngx-linkifyjs';
42
45
  IonicModule,
43
46
  TooltipModule,
44
47
  ConversationDetailPageRoutingModule,
48
+ ScrollbarThemeModule,
49
+ PickerModule,
45
50
  TranslateModule.forChild({
46
51
  loader: {
47
52
  provide: TranslateLoader,
@@ -57,7 +62,7 @@ import { NgxLinkifyjsModule } from 'ngx-linkifyjs';
57
62
  declarations: [
58
63
  ConversationDetailPage,
59
64
  HeaderConversationDetailComponent,
60
- MessageTextAreaComponent,
65
+ MessageTextAreaComponent
61
66
  // BubbleDayMessageComponent,
62
67
  // BubbleSystemMessageComponent,
63
68
  // BubbleMyMessageComponent,
@@ -9,7 +9,8 @@
9
9
 
10
10
  <ion-grid style="height: 100%;">
11
11
  <ion-row class="ion-justify-content-center ion-align-items-center" style="height: 100%; flex-direction: column">
12
- <span *ngIf="isOnline === true && !showSpinner" style="color: #92949c; font-size: 16px;line-height: 18px;margin-top: -160px;">
12
+ <span *ngIf="isOnline === true && !showSpinner"
13
+ style="color: #92949c; font-size: 16px;line-height: 18px;margin-top: -160px;">
13
14
  <span *ngIf="conversation_count > 0 ">
14
15
  {{'PleaseSelectChatToStartMessaging' | translate }}
15
16
  </span>
@@ -34,10 +35,10 @@
34
35
  <app-header-conversation-detail [isMobile]="isMobile" [idLoggedUser]="loggedUser.uid"
35
36
  [conversationAvatar]="conversationAvatar" [translationMap]="translationMap"
36
37
  (eventOpenCloseInfoConversation)="returnOpenCloseInfoConversation($event)"
37
- [isOpenInfoConversation]="isOpenInfoConversation">
38
+ [isOpenInfoConversation]="isOpenInfoConversation" [conv_type]="conv_type">
38
39
  </app-header-conversation-detail>
39
40
 
40
- <ion-content>
41
+ <ion-content id="conv-details">
41
42
  <ion-grid class="grid_content">
42
43
  <ion-row class="row_content">
43
44
  <ion-col id="chatArea" [class.mobile]="isMobile" [class.open]="openInfoConversation">
@@ -91,7 +92,7 @@
91
92
  </ng-template>
92
93
 
93
94
  <ng-template #content_messages>
94
- <ion-content #ionContentChatArea class="ionContentChatArea" (drop)="drop($event)"
95
+ <ion-content #ionContentChatArea appScrollbarTheme class="ionContentChatArea" (drop)="drop($event)"
95
96
  (dragover)="allowDrop($event)" (dragleave)="drag($event)" [scrollEvents]="true"
96
97
  (ionScrollStart)="logScrollStart($event)" (ionScroll)="logScrolling($event)"
97
98
  (ionScrollEnd)="logScrollEnd($event)" [class.active]="showIonContent">
@@ -136,15 +137,24 @@
136
137
  <!-- ----------------------------------------------------------- -->
137
138
  <!-- Canned responses -->
138
139
  <!-- ----------------------------------------------------------- -->
139
-
140
- <div id="canned" *ngIf="tagsCannedFilter.length > 0 && HIDE_CANNED_RESPONSES === false">
141
- <ion-list class="canned-list">
140
+ <div id="canned">
141
+ <ion-list class="canned-list" *ngIf="tagsCannedFilter.length > 0 && HIDE_CANNED_RESPONSES === false">
142
142
  <ion-item button="true" [ngClass]="{'is_active_item': i == arrowkeyLocation}" lines="none"
143
143
  class="canned-item" id="{{'canned-item_'+ i }}"
144
144
  *ngFor="let canned of tagsCannedFilter; let i = index;" [innerHtml]="canned.title"
145
145
  (click)="replaceTagInMessage(canned, $event)">
146
146
  </ion-item>
147
+ <ion-item class="canned-item add-canned-response-wpr" button="true" lines="none" (click)="presentCreateCannedResponseModal()">
148
+ <ion-icon class="add-canned-response-icon" name="flash-outline"></ion-icon>
149
+ <span class="add-canned-response-add-icon">+</span>
150
+ <label class="add-canned-response-label" >{{translationMap?.get('AddNewCannedResponse')}}</label>
151
+ </ion-item>
147
152
  </ion-list>
153
+ <!-- <ion-list class="canned-list" *ngIf="tagsCannedFilter.length === 0 && HIDE_CANNED_RESPONSES === false">
154
+ <ion-item button="true" >
155
+ There are no canned responses available
156
+ </ion-item>
157
+ </ion-list> -->
148
158
  </div>
149
159
 
150
160
 
@@ -155,14 +165,14 @@
155
165
  <!-- openInfoConversation {{openInfoConversation}} - isMobile {{isMobile}} -->
156
166
  <app-message-text-area
157
167
  *ngIf="(openInfoConversation === false && isMobile === true) || (openInfoConversation === true && isMobile === false) || (openInfoConversation === false && isMobile === false)"
158
- [tagsCannedCount]="tagsCannedCount" [areVisibleCAR]="areVisibleCAR" [loggedUser]="loggedUser"
159
- [conversationWith]="conversationWith" [tagsCannedFilter]="tagsCannedFilter"
168
+ [tagsCannedCount]="tagsCannedCount" [areVisibleCAR]="areVisibleCAR" [support_mode]="support_mode"
169
+ [loggedUser]="loggedUser" [conversationWith]="conversationWith" [tagsCannedFilter]="tagsCannedFilter"
160
170
  (eventChangeTextArea)="returnChangeTextArea($event)"
161
171
  (hasClickedOpenCannedResponses)="hasClickedOpenCannedResponses($event)"
162
172
  (eventSendMessage)="returnSendMessage($event)" [translationMap]="translationMap"
163
173
  [fileUploadAccept]="appConfigProvider.getConfig().fileUploadAccept"
164
174
  [isOpenInfoConversation]="isOpenInfoConversation" [dropEvent]="dropEvent"
165
- (onPresentModalScrollToBottom)="onPresentModalScrollToBottom($event)">
175
+ (onPresentModalScrollToBottom)="onPresentModalScrollToBottom($event)" [disableTextarea]="disableTextarea">
166
176
  </app-message-text-area>
167
177
  <!-- [events]="eventsReplaceTexareaText.asObservable()" -->
168
178
  </ion-row>
@@ -25,6 +25,34 @@
25
25
  font-size: 24px;
26
26
  }
27
27
 
28
+ .add-canned-response-icon {
29
+ color: #b3bfd0;
30
+ cursor: pointer;
31
+ font-size: 18px;
32
+ }
33
+ .add-canned-response-label {
34
+ color: #b3bfd0;
35
+ cursor: pointer;
36
+ }
37
+ .add-canned-response-add-icon {
38
+ color: #b3bfd0;
39
+ cursor: pointer;
40
+ position: relative;
41
+ top: 4px;
42
+ left: -6px;
43
+ }
44
+
45
+ #canned > ion-list > ion-item.canned-item.add-canned-response-wpr:hover > span {
46
+ color: #1877f2;
47
+ }
48
+
49
+ #canned > ion-list > ion-item.canned-item.add-canned-response-wpr:hover > ion-icon {
50
+ color: #1877f2;
51
+ }
52
+ #canned > ion-list > ion-item.canned-item.add-canned-response-wpr:hover > label {
53
+ color: #1877f2;
54
+ }
55
+
28
56
  // ion-back-button{
29
57
  // display: none!important;
30
58
  // }