@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,6 +10,10 @@ import { LoggerService } from 'src/chat21-core/providers/abstract/logger.service
10
10
  import { LoggerInstance } from 'src/chat21-core/providers/logger/loggerInstance';
11
11
  import { TranslateService } from '@ngx-translate/core';
12
12
  import { EventsService } from 'src/app/services/events-service';
13
+ import { tranlatedLanguage } from '../../../chat21-core/utils/constants';
14
+
15
+ // utils
16
+ import { avatarPlaceholder, getColorBck } from 'src/chat21-core/utils/utils-user';
13
17
 
14
18
  @Component({
15
19
  selector: 'app-sidebar',
@@ -32,7 +36,7 @@ export class SidebarComponent implements OnInit {
32
36
  photo_profile_URL: string;
33
37
  project_id: string;
34
38
  DASHBOARD_URL: string;
35
- HAS_CLICKED_OPEN_USER_DETAIL: boolean = false
39
+ // HAS_CLICKED_OPEN_USER_DETAIL: boolean = false
36
40
  public translationMap: Map<string, string>;
37
41
  public_Key: any;
38
42
  conversations_lbl: string;
@@ -42,7 +46,18 @@ export class SidebarComponent implements OnInit {
42
46
  activities_lbl: string;
43
47
  history_lbl: string;
44
48
  settings_lbl: string;
45
-
49
+ countClickOnOpenUserDetailSidebar: number = 0
50
+ USER_PHOTO_PROFILE_EXIST: boolean;
51
+ currentUser: any;
52
+ dashboard_home_url: string;
53
+ dashboard_bots_url: string;
54
+ dashboard_convs_url: string;
55
+ dashboard_contacts_url: string;
56
+ dashboard_app_url: string;
57
+ dashboard_analytics_url: string;
58
+ dashboard_activities_url: string;
59
+ dashboard_history_url: string;
60
+ dashboard_settings_url: string;
46
61
  constructor(
47
62
  public imageRepoService: ImageRepoService,
48
63
  public appStorageService: AppStorageService,
@@ -52,44 +67,160 @@ export class SidebarComponent implements OnInit {
52
67
  public wsService: WebsocketService,
53
68
  public appConfigProvider: AppConfigProvider,
54
69
  private translate: TranslateService,
55
- public events: EventsService
70
+ public events: EventsService,
71
+
56
72
  ) { }
57
73
 
58
74
  ngOnInit() {
59
75
  this.DASHBOARD_URL = this.appConfig.getConfig().dashboardUrl + '#/project/';
60
- console.log('[SIDEBAR] DASHBOARD_URL ', this.DASHBOARD_URL)
61
- this.getStoredProjectAndDashboardBaseUrl()
76
+ // console.log('[SIDEBAR] DASHBOARD_URL ', this.DASHBOARD_URL)
77
+ this.getStoredProjectAndUserRole()
62
78
  this.subcribeToAuthStateChanged()
63
79
  this.listenTocurrentProjectUserUserAvailability$()
64
80
  this.getOSCODE();
65
81
  this.getCurrentChatLangAndTranslateLabels();
82
+
83
+ // this.loggedUser = this.chatManager.getCurrentUser();
84
+ // if (this.loggedUser) {
85
+ // this.itemAvatar = {
86
+ // imageurl: this.imageRepoService.getImagePhotoUrl(this.loggedUser.uid),
87
+ // avatar: this.loggedUser.avatar,
88
+ // color: this.loggedUser.color,
89
+ // online: this.loggedUser.online,
90
+ // lastConnection: this.loggedUser.lastConnection,
91
+ // status: '',
92
+ // width: '35px',
93
+ // height: '35px'
94
+ // };
95
+ // }
96
+
97
+
98
+ }
99
+
100
+
101
+ getStoredProjectAndUserRole() {
102
+ const stored_project = localStorage.getItem('last_project')
103
+ // console.log('[SIDEBAR] stored_project ', stored_project)
104
+ if (stored_project) {
105
+ const project = JSON.parse(stored_project)
106
+ this.logger.log('[SIDEBAR] project ', project)
107
+
108
+ this.project_id = project.id_project.id
109
+ this.logger.log('[SIDEBAR] project_id ', this.project_id)
110
+
111
+ this.USER_ROLE = project.role;
112
+ this.logger.log('[SIDEBAR] USER_ROLE ', this.USER_ROLE)
113
+ this.buildURLs(this.USER_ROLE)
114
+ }
115
+ }
116
+
117
+ buildURLs(USER_ROLE) {
118
+ this.dashboard_home_url = this.DASHBOARD_URL + this.project_id + '/home'
119
+ this.dashboard_bots_url = this.DASHBOARD_URL + this.project_id + '/bots'
120
+ this.dashboard_convs_url = this.DASHBOARD_URL + this.project_id + '/wsrequests'
121
+ this.dashboard_contacts_url = this.DASHBOARD_URL + this.project_id + '/contacts'
122
+ this.dashboard_app_url = this.DASHBOARD_URL + this.project_id + '/app-store'
123
+ this.dashboard_analytics_url = this.DASHBOARD_URL + this.project_id + '/analytics'
124
+ this.dashboard_activities_url = this.DASHBOARD_URL + this.project_id + '/activities'
125
+ this.dashboard_history_url = this.DASHBOARD_URL + this.project_id + '/history'
126
+ this.dashboard_settings_url = ''
127
+ if (USER_ROLE !== 'agent') {
128
+ this.dashboard_settings_url = this.DASHBOARD_URL + this.project_id + '/widget-set-up'
129
+ } else if (USER_ROLE === 'agent') {
130
+ this.dashboard_settings_url = this.DASHBOARD_URL + this.project_id + '/cannedresponses'
131
+ }
132
+
133
+ }
134
+
135
+ subcribeToAuthStateChanged() {
136
+ this.messagingAuthService.BSAuthStateChanged.subscribe((state) => {
137
+ this.logger.log('[SIDEBAR] BSAuthStateChanged ', state)
138
+
139
+ if (state === 'online') {
140
+ this.currentUser = JSON.parse(this.appStorageService.getItem('currentUser'));
141
+ this.logger.log('[SIDEBAR] currentUser ', this.currentUser)
142
+ if (this.currentUser) {
143
+ this.createUserAvatar(this.currentUser)
144
+ this.photo_profile_URL = this.imageRepoService.getImagePhotoUrl(this.currentUser.uid)
145
+ this.logger.log('[SIDEBAR] photo_profile_URL ', this.photo_profile_URL)
146
+ this.checkIfExistPhotoProfile(this.photo_profile_URL)
147
+ }
148
+
149
+ }
150
+ })
151
+ }
152
+
153
+ checkIfExistPhotoProfile(imageUrl) {
154
+ this.verifyImageURL(imageUrl, (imageExists) => {
155
+
156
+ if (imageExists === true) {
157
+ this.USER_PHOTO_PROFILE_EXIST = true;
158
+ this.logger.log('[SIDEBAR] photo_profile_URL IMAGE EXIST ', imageExists)
159
+
160
+ } else {
161
+ this.USER_PHOTO_PROFILE_EXIST = false;
162
+ this.logger.log('[SIDEBAR] photo_profile_URL IMAGE EXIST ', imageExists)
163
+ }
164
+ })
165
+ }
166
+
167
+ createUserAvatar(currentUser) {
168
+ this.logger.log('[SIDEBAR] - createProjectUserAvatar ', currentUser)
169
+ let fullname = ''
170
+ if (currentUser && currentUser.firstname && currentUser.lastname) {
171
+ fullname = currentUser.firstname + ' ' + currentUser.lastname
172
+ currentUser['fullname_initial'] = avatarPlaceholder(fullname)
173
+ currentUser['fillColour'] = getColorBck(fullname)
174
+ } else if (currentUser && currentUser.firstname) {
175
+ fullname = currentUser.firstname
176
+ currentUser['fullname_initial'] = avatarPlaceholder(fullname)
177
+ currentUser['fillColour'] = getColorBck(fullname)
178
+ } else {
179
+ currentUser['fullname_initial'] = 'N/A'
180
+ currentUser['fillColour'] = 'rgb(98, 100, 167)'
181
+ }
182
+ }
183
+
184
+ verifyImageURL(image_url, callBack) {
185
+ const img = new Image();
186
+ img.src = image_url;
187
+ img.onload = function () {
188
+ callBack(true);
189
+ };
190
+ img.onerror = function () {
191
+ callBack(false);
192
+ };
66
193
  }
67
194
 
68
195
  getCurrentChatLangAndTranslateLabels() {
69
196
  const browserLang = this.translate.getBrowserLang();
70
197
  const currentUser = JSON.parse(this.appStorageService.getItem('currentUser'));
71
- console.log('[SIDEBAR] - ngOnInit - currentUser ', currentUser)
72
- console.log('[SIDEBAR] - ngOnInit - browserLang ', browserLang)
198
+ // console.log('[SIDEBAR] - ngOnInit - currentUser ', currentUser)
199
+ // console.log('[SIDEBAR] - ngOnInit - browserLang ', browserLang)
73
200
  let currentUserId = ''
74
201
  if (currentUser) {
75
202
  currentUserId = currentUser.uid
76
- console.log('[SIDEBAR] - ngOnInit - currentUserId ', currentUserId)
203
+ // console.log('[SIDEBAR] - ngOnInit - currentUserId ', currentUserId)
77
204
  }
78
205
 
79
206
  const stored_preferred_lang = localStorage.getItem(currentUserId + '_lang');
80
- console.log('[SIDEBAR] stored_preferred_lang: ', stored_preferred_lang);
207
+ // console.log('[SIDEBAR] stored_preferred_lang: ', stored_preferred_lang);
81
208
 
82
209
  let chat_lang = '';
83
210
  if (browserLang && !stored_preferred_lang) {
84
211
  chat_lang = browserLang
85
- console.log('[SIDEBAR] chat_lang: ', chat_lang);
212
+ this.logger.log('[SIDEBAR] chat_lang: ', chat_lang);
86
213
  } else if (browserLang && stored_preferred_lang) {
87
214
  chat_lang = stored_preferred_lang
88
-
89
- console.log('[SIDEBAR] chat_lang: ', chat_lang);
215
+ this.logger.log('[SIDEBAR] chat_lang: ', chat_lang);
216
+ }
217
+ if (tranlatedLanguage.includes(chat_lang)) {
218
+ this.logger.log('[SIDEBAR] tranlatedLanguage includes', chat_lang, ': ', tranlatedLanguage.includes(chat_lang))
219
+ this.translate.use(chat_lang);
220
+ } else {
221
+ this.logger.log('[SIDEBAR] tranlatedLanguage includes', chat_lang, ': ', tranlatedLanguage.includes(chat_lang))
222
+ this.translate.use('en');
90
223
  }
91
-
92
- this.translate.use(chat_lang);
93
224
  this.translateLabels()
94
225
  }
95
226
 
@@ -107,7 +238,7 @@ export class SidebarComponent implements OnInit {
107
238
  getConversationsTranslation() {
108
239
  this.translate.get('Conversations')
109
240
  .subscribe((text: string) => {
110
- console.log('[SIDEBAR] - translate Conversations', text)
241
+ // console.log('[SIDEBAR] - translate Conversations', text)
111
242
  this.conversations_lbl = text
112
243
  });
113
244
  }
@@ -115,7 +246,7 @@ export class SidebarComponent implements OnInit {
115
246
  getContactsTranslation() {
116
247
  this.translate.get('LABEL_CONTACTS')
117
248
  .subscribe((text: string) => {
118
- console.log('[SIDEBAR] - translate Contacts', text)
249
+ // console.log('[SIDEBAR] - translate Contacts', text)
119
250
  this.contacts_lbl = text
120
251
  });
121
252
  }
@@ -123,7 +254,7 @@ export class SidebarComponent implements OnInit {
123
254
  getAppsTranslation() {
124
255
  this.translate.get('Apps')
125
256
  .subscribe((text: string) => {
126
- console.log('[SIDEBAR] - translate Apps', text)
257
+ // console.log('[SIDEBAR] - translate Apps', text)
127
258
  this.apps_lbl = text
128
259
  });
129
260
  }
@@ -131,7 +262,7 @@ export class SidebarComponent implements OnInit {
131
262
  getAnalyticsTranslation() {
132
263
  this.translate.get('Analytics')
133
264
  .subscribe((text: string) => {
134
- console.log('[SIDEBAR] - translate Analytics', text)
265
+ // console.log('[SIDEBAR] - translate Analytics', text)
135
266
  this.analytics_lbl = text
136
267
  });
137
268
  }
@@ -139,7 +270,7 @@ export class SidebarComponent implements OnInit {
139
270
  getActivitiesTranslation() {
140
271
  this.translate.get('Activities')
141
272
  .subscribe((text: string) => {
142
- console.log('[SIDEBAR] - translate Activities', text)
273
+ // console.log('[SIDEBAR] - translate Activities', text)
143
274
  this.activities_lbl = text
144
275
  });
145
276
  }
@@ -147,7 +278,7 @@ export class SidebarComponent implements OnInit {
147
278
  getHistoryTranslation() {
148
279
  this.translate.get('History')
149
280
  .subscribe((text: string) => {
150
- console.log('[SIDEBAR] - translate History', text)
281
+ // console.log('[SIDEBAR] - translate History', text)
151
282
  this.history_lbl = text
152
283
  });
153
284
  }
@@ -155,7 +286,7 @@ export class SidebarComponent implements OnInit {
155
286
  getSettingsTranslation() {
156
287
  this.translate.get('Settings')
157
288
  .subscribe((text: string) => {
158
- console.log('[SIDEBAR] - translate Settings', text)
289
+ // console.log('[SIDEBAR] - translate Settings', text)
159
290
  this.settings_lbl = text
160
291
  });
161
292
  }
@@ -225,7 +356,7 @@ export class SidebarComponent implements OnInit {
225
356
 
226
357
  listenTocurrentProjectUserUserAvailability$() {
227
358
  this.wsService.currentProjectUserAvailability$.subscribe((projectUser) => {
228
- console.log('[SIDEBAR] - $UBSC TO WS USER AVAILABILITY & BUSY STATUS RES ', projectUser);
359
+ this.logger.log('[SIDEBAR] - $UBSC TO WS USER AVAILABILITY & BUSY STATUS RES ', projectUser);
229
360
 
230
361
  this.IS_AVAILABLE = projectUser['user_available']
231
362
  this.IS_BUSY = projectUser['isBusy']
@@ -249,68 +380,60 @@ export class SidebarComponent implements OnInit {
249
380
  }
250
381
 
251
382
  openUserDetailSidePanel() {
252
- console.log('[SIDEBAR] OPEN UESER DTLS SIDE PANEL')
253
- this.HAS_CLICKED_OPEN_USER_DETAIL = true
254
- console.log('[SIDEBAR] OPEN USER DTLS SIDE PANEL ', this.HAS_CLICKED_OPEN_USER_DETAIL)
383
+ this.countClickOnOpenUserDetailSidebar++
384
+ this.logger.log('[SIDEBAR-CHAT] countClickOnOpenUserDetailSidebar', this.countClickOnOpenUserDetailSidebar)
385
+ this.logger.log('[SIDEBAR-CHAT] OPEN UESER DTLS SIDE PANEL')
386
+ // this.HAS_CLICKED_OPEN_USER_DETAIL = true
387
+ // console.log('[SIDEBAR-CHAT] OPEN USER DTLS SIDE PANEL ', this.HAS_CLICKED_OPEN_USER_DETAIL)
255
388
  const elSidebarUserDtls = <HTMLElement>document.querySelector('#user-details');
256
- console.log('[SIDEBAR] OPEN USER DTLS SIDE PANEL elSidebarUserDtls ', elSidebarUserDtls)
257
- if (elSidebarUserDtls) {
258
- elSidebarUserDtls.classList.add("active");
259
- this.events.publish('userdetailsidebar:opened', true);
260
- }
261
-
262
- }
389
+ this.logger.log('[SIDEBAR] OPEN USER DTLS SIDE PANEL elSidebarUserDtls ', elSidebarUserDtls)
263
390
 
264
- onCloseUserDetailsSidebar($event) {
265
- console.log('[SIDEBAR] HAS_CLICKED_CLOSE_USER_DETAIL ', $event)
266
- this.HAS_CLICKED_OPEN_USER_DETAIL = $event
267
- const elemNavbar = <HTMLElement>document.querySelector('.navbar-absolute');
268
- console.log('[SIDEBAR] elemNavBar ', elemNavbar)
269
- if (elemNavbar) {
270
- elemNavbar.classList.remove("navbar-absolute-custom-class")
391
+ // if (elSidebarUserDtls) {
392
+ // elSidebarUserDtls.classList.add("active");
393
+ // this.events.publish('userdetailsidebar:opened', true);
394
+ // }
395
+ if (elSidebarUserDtls && this.countClickOnOpenUserDetailSidebar === 1) {
396
+ elSidebarUserDtls.classList.add("active");
271
397
  }
272
-
273
- const elemNavbarBrand = <HTMLElement>document.querySelector('.navbar-brand');
274
- console.log('[SIDEBAR] elemNavbarBrand ', elemNavbarBrand)
275
- if (elemNavbarBrand) {
276
- elemNavbarBrand.classList.remove("navbar-brand-z-index-zero")
398
+ if (elSidebarUserDtls && this.countClickOnOpenUserDetailSidebar > 1) {
399
+ // console.log('[SIDEBAR] this.countClickOnOpenUserDetailSidebar HERE', this.countClickOnOpenUserDetailSidebar)
400
+ if (elSidebarUserDtls.classList.contains('active')) {
401
+ this.logger.log('[SIDEBAR-CHAT] elSidebarUserDtls contains class ACTIVE', elSidebarUserDtls)
402
+ elSidebarUserDtls.classList.remove("active");
403
+ } else if (!elSidebarUserDtls.classList.contains('active')) {
404
+ this.logger.log('[SIDEBAR-CHAT] elSidebarUserDtls NOT contains class ACTIVE', elSidebarUserDtls)
405
+ elSidebarUserDtls.classList.add("active");
406
+ }
277
407
  }
278
408
  }
279
409
 
280
- subcribeToAuthStateChanged() {
281
- this.messagingAuthService.BSAuthStateChanged.subscribe((state) => {
282
- console.log('[SIDEBAR] BSAuthStateChanged ', state)
410
+ // onCloseUserDetailsSidebar($event) {
411
+ // this.logger.log('[SIDEBAR-CHAT] HAS_CLICKED_CLOSE_USER_DETAIL ', $event)
412
+ // this.HAS_CLICKED_OPEN_USER_DETAIL = $event
413
+ // const elemNavbar = <HTMLElement>document.querySelector('.navbar-absolute');
414
+ // this.logger.log('[SIDEBAR] elemNavBar ', elemNavbar)
415
+ // if (elemNavbar) {
416
+ // elemNavbar.classList.remove("navbar-absolute-custom-class")
417
+ // }
283
418
 
284
- if (state === 'online') {
285
- const currentUser = JSON.parse(this.appStorageService.getItem('currentUser'));
286
- console.log('[SIDEBAR] currentUser ', currentUser)
287
- if (currentUser) {
288
- this.photo_profile_URL = this.imageRepoService.getImagePhotoUrl(currentUser.uid)
289
- console.log('[SIDEBAR] photo_profile_URL ', this.photo_profile_URL)
290
- }
419
+ // const elemNavbarBrand = <HTMLElement>document.querySelector('.navbar-brand');
420
+ // this.logger.log('[SIDEBAR] elemNavbarBrand ', elemNavbarBrand)
421
+ // if (elemNavbarBrand) {
422
+ // elemNavbarBrand.classList.remove("navbar-brand-z-index-zero")
423
+ // }
424
+ // }
291
425
 
292
- }
293
- })
294
- }
295
426
 
296
427
 
297
- getStoredProjectAndDashboardBaseUrl() {
298
- const stored_project = localStorage.getItem('last_project')
299
- // console.log('[SIDEBAR] stored_project ', stored_project)
300
- if (stored_project) {
301
- const project = JSON.parse(stored_project)
302
- console.log('[SIDEBAR] project ', project)
303
-
304
- this.project_id = project.id_project.id
305
- console.log('[SIDEBAR] project_id ', this.project_id)
306
-
307
- this.USER_ROLE = project.role;
308
- console.log('[SIDEBAR] USER_ROLE ', this.USER_ROLE)
309
- }
310
- }
311
-
312
428
  goToHome() {
313
429
  let url = this.DASHBOARD_URL + this.project_id + '/home'
430
+ this.dashboard_home_url = url;
431
+ const myWindow = window.open(url, '_self');
432
+ myWindow.focus();
433
+ }
434
+
435
+ goToBots() {
436
+ let url = this.DASHBOARD_URL + this.project_id + '/bots'
314
437
  const myWindow = window.open(url, '_self');
315
438
  myWindow.focus();
316
439
  }
@@ -353,12 +476,28 @@ export class SidebarComponent implements OnInit {
353
476
  myWindow.focus();
354
477
  }
355
478
 
479
+ goToWidgetSetUpOrToCannedResponses() {
480
+ if (this.USER_ROLE !== 'agent') {
481
+ this.goToWidgetSetUp()
482
+ } else if (this.USER_ROLE === 'agent') {
483
+ this.goToSettings_CannedResponses()
484
+ }
485
+ }
486
+
487
+ goToWidgetSetUp() {
488
+ let url = this.DASHBOARD_URL + this.project_id + '/widget-set-up'
489
+ const myWindow = window.open(url, '_self');
490
+ myWindow.focus();
491
+ }
492
+
356
493
  goToSettings_CannedResponses() {
357
494
  let url = this.DASHBOARD_URL + this.project_id + '/cannedresponses'
358
495
  const myWindow = window.open(url, '_self');
359
496
  myWindow.focus();
360
497
  }
361
498
 
499
+
500
+
362
501
  public translations() {
363
502
  const keys = [
364
503
  'Available',
@@ -21,8 +21,16 @@
21
21
 
22
22
  <!-- (click)="goToUserProfile()" -->
23
23
  <div role="button" class="user-details-avatar">
24
- <img class="user-img-in-sidebar-user-details" [src]="photo_profile_URL"
24
+ <img *ngIf="USER_PHOTO_PROFILE_EXIST" class="user-img-in-sidebar-user-details" [src]="photo_profile_URL"
25
25
  onerror="this.src='assets/images/no_image_user.png'" />
26
+
27
+ <div *ngIf="!USER_PHOTO_PROFILE_EXIST" class="user-img-in-sidebar-user-details"
28
+ [ngStyle]="{'background': 'linear-gradient(rgb(255,255,255) -125%,' + user?.fillColour + ')'}">
29
+ <span id="sidebaravatar-altenative-user-avatar" class="sidebar-user-details-altenative-user-avatar">
30
+ {{ user?.fullname_initial }}
31
+ </span>
32
+ </div>
33
+
26
34
  </div>
27
35
 
28
36
  <div class="user-details-user-isbusy" *ngIf="IS_BUSY === true" style="cursor:pointer"
@@ -68,10 +76,10 @@
68
76
  <section *ngIf="isVisiblePAY" class="user-details-plan-info">
69
77
  <span>
70
78
  <div> {{prjct_name}} </div>
71
- <div> {{ profile_name_translated }} </div>
79
+ <div style="display: inline-block;"> {{ profile_name_translated }} </div>
72
80
 
73
- <span *ngIf="plan_type === 'payment' && plan_subscription_is_active === false"
74
- style="color:#f44336; position:relative; top: -1px;">
81
+ <div *ngIf="plan_type === 'payment' && plan_subscription_is_active === false"
82
+ style="color:#f44336; position:relative; top: -1px;;display: inline-block;">
75
83
  <i *ngIf="plan_name !== 'enterprise'" class="material-icons" style="vertical-align: middle; color:#f44336; cursor:pointer;
76
84
  font-size: 16px;" matTooltipClass="custom-mat-tooltip"
77
85
  matTooltip="{{ SUBSCRIPTION_PAYMENT_PROBLEM_msg }}" #tooltip="matTooltip" matTooltipPosition='right'
@@ -83,7 +91,7 @@
83
91
  #tooltip="matTooltip" matTooltipPosition='right' matTooltipHideDelay="100">
84
92
  error_outline
85
93
  </i>
86
- </span>
94
+ </div>
87
95
  </span>
88
96
  </section>
89
97
 
@@ -91,12 +99,23 @@
91
99
  border-top: 1px solid rgba(255, 255,255, 0.2);"> -->
92
100
 
93
101
 
94
- <section class="user-details-footer-section" (click)=onLogout()
102
+ <section class="user-details-footer-section"
95
103
  [ngClass]="{'footer-margin-top-pricing-no-visible': isVisiblePAY === false }">
96
- <i class="material-icons user-details-logout-icon">
97
- logout
98
- </i>
99
- <div> Logout</div>
104
+ <div role="button" class="logout-btn-wpr" (click)=onLogout()>
105
+ <i class="material-icons user-details-logout-icon" >
106
+ logout
107
+ </i>
108
+ <div class="user-details-logout-text">
109
+ {{LOGOUT_msg}}
110
+ </div>
111
+ </div>
112
+ </section>
113
+
114
+ <section class="user-details-footer-chat-version">
115
+ <div class="chat-version">
116
+ <!-- &copy; {{test | date: 'yyyy'}} {{company_name}} ver {{version}} -->
117
+ ver {{version}}
118
+ </div>
100
119
  </section>
101
120
 
102
121
  </div>
@@ -14,23 +14,23 @@
14
14
  // transform: translate(60px);
15
15
  transition: transform 0.5s;
16
16
  width: 305px;
17
- left: -245px
17
+ left: -245px;
18
18
  // z-index: 1029;
19
19
  // transform: translateX(-100%);
20
20
  // -webkit-transform: translateX(-100%);
21
21
  // display: none;
22
22
  }
23
23
 
24
- #user-details::-webkit-scrollbar {
25
- width: 6px;
26
- }
27
- #user-details::-webkit-scrollbar-track {
28
- background-color: #1c2b45;
29
- }
30
- #user-details::-webkit-scrollbar-thumb {
31
- background-color: #3c485b;
32
- border-radius: 3px;
33
- }
24
+ // #user-details::-webkit-scrollbar {
25
+ // width: 6px;
26
+ // }
27
+ // #user-details::-webkit-scrollbar-track {
28
+ // background-color: #1c2b45;
29
+ // }
30
+ // #user-details::-webkit-scrollbar-thumb {
31
+ // background-color: #3c485b;
32
+ // border-radius: 3px;
33
+ // }
34
34
 
35
35
  #user-details.active {
36
36
  // transform: translate(0);
@@ -90,14 +90,15 @@ button.user-details-btn-close {
90
90
  }
91
91
 
92
92
  .user-details-dshbrd-lang-code {
93
- text-transform: uppercase;color: #647491;
93
+ text-transform: uppercase;
94
+ color: #647491;
94
95
  font-family: "Roboto", sans-serif !important;
95
96
  font-size: 14px;
96
97
  }
97
98
 
98
99
  .user-details-avatar {
99
100
  text-align: center;
100
- cursor: pointer;
101
+ // cursor: pointer;
101
102
  position: absolute;
102
103
  top: 82px;
103
104
  border-radius: 50%;
@@ -139,10 +140,9 @@ button.user-details-btn-close {
139
140
  text-align: center;
140
141
  margin-bottom: 5px;
141
142
  font-size: 16px;
142
- font-family: 'Poppins';
143
+ font-family: "Poppins";
143
144
  font-weight: 500;
144
145
  line-height: 24px;
145
-
146
146
  }
147
147
 
148
148
  .user-details-email {
@@ -157,10 +157,10 @@ button.user-details-btn-close {
157
157
  font-size: 14px;
158
158
  text-align: center;
159
159
  margin-top: 5px;
160
- font-family: 'Poppins';
160
+ font-family: "Poppins";
161
161
  font-weight: 400;
162
162
  line-height: 1px;
163
-
163
+ white-space: nowrap;
164
164
  }
165
165
 
166
166
  .user-details-role {
@@ -178,8 +178,7 @@ button.user-details-btn-close {
178
178
  text-transform: uppercase;
179
179
  color: #a9afbb;
180
180
  font-weight: 500;
181
- font-family: 'Roboto', sans-serif !important;
182
-
181
+ font-family: "Roboto", sans-serif !important;
183
182
  }
184
183
 
185
184
  .availability-section {
@@ -199,7 +198,7 @@ button.user-details-btn-close {
199
198
  .first-divider {
200
199
  margin-top: 355px;
201
200
  border: 0;
202
- border-top: 1px solid rgba(255, 255,255, 0.2);
201
+ border-top: 1px solid rgba(255, 255, 255, 0.2);
203
202
  margin-bottom: 20px;
204
203
  }
205
204
 
@@ -226,17 +225,17 @@ button.user-details-btn-close {
226
225
  background-color: #2d323e;
227
226
  border-radius: 50%;
228
227
  position: absolute;
229
- top: 92px;
230
- width: 24px;
231
- height: 24px;
228
+ top: 96px;
229
+ width: 21px;
230
+ height: 21px;
232
231
  left: 101px;
233
232
  }
234
233
 
235
234
  .user-details-user-isbusy-icon {
236
235
  font-size: 18px !important;
237
236
  position: relative;
238
- top: 3px;
239
- left: 3px;
237
+ top: 2px;
238
+ left: 2px;
240
239
  }
241
240
 
242
241
  .user-details-plan-info {
@@ -254,7 +253,7 @@ button.user-details-btn-close {
254
253
  margin: auto;
255
254
  position: absolute;
256
255
  text-align: center;
257
- cursor: pointer;
256
+
258
257
  padding-bottom: 15px;
259
258
  padding-top: 200px;
260
259
  font-size: 16px;
@@ -263,19 +262,35 @@ button.user-details-btn-close {
263
262
  // top:355px
264
263
  }
265
264
 
265
+ .logout-btn-wpr {
266
+ cursor: pointer;
267
+ }
268
+
266
269
  .footer-margin-top-pricing-no-visible {
267
270
  padding-top: 240px;
268
271
  }
269
272
  .user-details-logout-icon {
270
273
  color: #a9afbb;
271
274
  font-size: 30px;
272
- margin-top: 30px;
275
+ // margin-top: 30px;
273
276
  }
274
277
 
275
278
  .user-details-logout-icon:hover {
276
279
  color: #fff;
277
280
  }
278
281
 
282
+ .user-details-footer-chat-version {
283
+ position: absolute;
284
+ bottom: 11px;
285
+ text-align: center;
286
+ margin: auto;
287
+ transform: translateX(-50%);
288
+ left: 50%;
289
+ margin: auto;
290
+ font-size: 12px;
291
+ font-weight: 400;
292
+ }
293
+
279
294
  :host ::ng-deep .mat-slide-toggle.mat-checked:not(.mat-disabled) .mat-slide-toggle-bar {
280
295
  background-color: #a9afbb;
281
296
  margin-left: 30px;
@@ -305,6 +320,15 @@ button.user-details-btn-close {
305
320
  }
306
321
 
307
322
  ::ng-deep .custom-mat-tooltip {
308
- background-color: #2d323e;
309
- font-size: 12px;
323
+ background-color: #2d323e !important;
324
+ font-size: 12px !important;
325
+ border-radius: 2px !important;
326
+ font-family: "Poppins" !important;
327
+ }
328
+
329
+ .sidebar-user-details-altenative-user-avatar {
330
+ line-height: 3.2;
331
+ font-weight: 400;
332
+ font-family: "Poppins";
333
+ font-size: 32px;
310
334
  }