@chat21/chat21-ionic 3.0.6-2.3 → 3.0.6-2.4-rc2
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.
- package/CHANGELOG.md +15 -0
- package/deploy_prod.sh +1 -1
- package/package.json +2 -1
- package/src/app/app.component.ts +103 -31
- package/src/app/chatlib/conversation-detail/conversation-content/conversation-content.component.html +2 -0
- package/src/app/chatlib/conversation-detail/conversation-content/conversation-content.component.ts +2 -1
- package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.html +33 -21
- package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.scss +34 -12
- package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.ts +2 -1
- package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.scss +1 -1
- package/src/app/chatlib/conversation-detail/message/image/image.component.ts +5 -3
- package/src/app/chatlib/conversation-detail/message/return-receipt/return-receipt.component.scss +1 -1
- package/src/app/components/conversation-detail/bubble-my-message/bubble-my-message.component.html +1 -1
- package/src/app/components/conversation-detail/bubble-my-message/bubble-my-message.component.scss +4 -4
- package/src/app/components/conversation-detail/bubble-others-message/bubble-others-message.component.html +1 -1
- package/src/app/components/conversation-detail/bubble-others-message/bubble-others-message.component.scss +3 -3
- package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.html +3 -3
- package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.ts +10 -55
- package/src/app/components/conversation-detail/message-text-area/message-text-area.component.html +8 -2
- package/src/app/components/conversation-detail/message-text-area/message-text-area.component.ts +2 -0
- package/src/app/components/image-viewer/image-viewer.component.ts +28 -10
- package/src/app/components/project-item/project-item.component.ts +6 -30
- package/src/app/components/sidebar/sidebar.component.ts +48 -82
- package/src/app/components/sidebar-user-details/sidebar-user-details.component.ts +58 -116
- package/src/app/pages/authentication/login/login.page.ts +20 -1
- package/src/app/pages/conversation-detail/conversation-detail.page.html +40 -19
- package/src/app/pages/conversation-detail/conversation-detail.page.scss +15 -6
- package/src/app/pages/conversation-detail/conversation-detail.page.ts +169 -232
- package/src/app/services/nav-proxy.service.ts +15 -13
- package/src/assets/js/chat21client.js +1 -1
- package/src/chat-config-pre-test.json +3 -2
- package/src/chat21-core/providers/firebase/firebase-conversation-handler.ts +2 -3
- package/src/chat21-core/providers/logger/customLogger.ts +2 -10
- package/src/chat21-core/providers/tiledesk/tiledesk-auth.service.ts +1 -1
- package/src/chat21-core/utils/utils-message.ts +102 -85
- package/src/variables.scss +4 -1
|
@@ -71,7 +71,7 @@ export class SidebarUserDetailsComponent implements OnInit, OnChanges {
|
|
|
71
71
|
public appConfigProvider: AppConfigProvider,
|
|
72
72
|
public events: EventsService,
|
|
73
73
|
private eRef: ElementRef,
|
|
74
|
-
|
|
74
|
+
|
|
75
75
|
) { }
|
|
76
76
|
|
|
77
77
|
ngOnInit() {
|
|
@@ -90,14 +90,20 @@ export class SidebarUserDetailsComponent implements OnInit, OnChanges {
|
|
|
90
90
|
this.logger.log('[SIDEBAR-USER-DETAILS] BSAuthStateChanged ', state)
|
|
91
91
|
|
|
92
92
|
if (state === 'online') {
|
|
93
|
-
|
|
94
|
-
this.
|
|
95
|
-
if (
|
|
96
|
-
|
|
97
|
-
this.
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
93
|
+
|
|
94
|
+
const storedCurrentUser = this.appStorageService.getItem('currentUser')
|
|
95
|
+
if (storedCurrentUser && storedCurrentUser !== 'undefined') {
|
|
96
|
+
const currentUser = JSON.parse(storedCurrentUser);
|
|
97
|
+
this.logger.log('[SIDEBAR-USER-DETAILS] - subcribeToAuthStateChanged - currentUser ', currentUser)
|
|
98
|
+
if (currentUser) {
|
|
99
|
+
this.user = currentUser;
|
|
100
|
+
this.createUserAvatar(this.user)
|
|
101
|
+
this.photo_profile_URL = this.imageRepoService.getImagePhotoUrl(currentUser.uid)
|
|
102
|
+
this.logger.log('[SIDEBAR-USER-DETAILS] photo_profile_URL ', this.photo_profile_URL);
|
|
103
|
+
this.checkIfExistPhotoProfile(this.photo_profile_URL)
|
|
104
|
+
}
|
|
105
|
+
} else {
|
|
106
|
+
this.logger.error('[SIDEBAR-USER-DETAILS] currentUser not found in storage ')
|
|
101
107
|
}
|
|
102
108
|
}
|
|
103
109
|
})
|
|
@@ -180,43 +186,50 @@ export class SidebarUserDetailsComponent implements OnInit, OnChanges {
|
|
|
180
186
|
|
|
181
187
|
getCurrentChatLangAndTranslateLabels() {
|
|
182
188
|
this.browserLang = this.translate.getBrowserLang();
|
|
183
|
-
const
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
189
|
+
const storedCurrentUser = this.appStorageService.getItem('currentUser')
|
|
190
|
+
|
|
191
|
+
if (storedCurrentUser && storedCurrentUser !== 'undefined') {
|
|
192
|
+
const currentUser = JSON.parse(storedCurrentUser);
|
|
193
|
+
this.logger.log('[SIDEBAR-USER-DETAILS] - ngOnInit - currentUser ', currentUser)
|
|
194
|
+
this.logger.log('[SIDEBAR-USER-DETAILS] - ngOnInit - browserLang ', this.browserLang)
|
|
195
|
+
let currentUserId = ''
|
|
196
|
+
if (currentUser) {
|
|
197
|
+
currentUserId = currentUser.uid
|
|
198
|
+
this.logger.log('[SIDEBAR-USER-DETAILS] - ngOnInit - currentUserId ', currentUserId)
|
|
199
|
+
}
|
|
191
200
|
|
|
192
|
-
|
|
193
|
-
|
|
201
|
+
const stored_preferred_lang = localStorage.getItem(currentUserId + '_lang');
|
|
202
|
+
this.logger.log('[SIDEBAR-USER-DETAILS] stored_preferred_lang: ', stored_preferred_lang);
|
|
194
203
|
|
|
195
204
|
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
205
|
+
this.chat_lang = ''
|
|
206
|
+
if (this.browserLang && !stored_preferred_lang) {
|
|
207
|
+
this.chat_lang = this.browserLang
|
|
208
|
+
// this.flag_url = "assets/images/language_flag/" + this.chat_lang + ".png"
|
|
209
|
+
|
|
210
|
+
this.logger.log('[SIDEBAR-USER-DETAILS] flag_url: ', this.flag_url);
|
|
211
|
+
this.logger.log('[SIDEBAR-USER-DETAILS] chat_lang: ', this.chat_lang);
|
|
212
|
+
} else if (this.browserLang && stored_preferred_lang) {
|
|
213
|
+
this.chat_lang = stored_preferred_lang
|
|
214
|
+
// this.flag_url = "assets/images/language_flag/" + this.chat_lang + ".png"
|
|
215
|
+
this.logger.log('[SIDEBAR-USER-DETAILS] flag_url: ', this.flag_url);
|
|
216
|
+
this.logger.log('[SIDEBAR-USER-DETAILS] chat_lang: ', this.chat_lang);
|
|
217
|
+
}
|
|
200
218
|
|
|
201
|
-
this.logger.log('[SIDEBAR-USER-DETAILS] flag_url: ', this.flag_url);
|
|
202
|
-
this.logger.log('[SIDEBAR-USER-DETAILS] chat_lang: ', this.chat_lang);
|
|
203
|
-
} else if (this.browserLang && stored_preferred_lang) {
|
|
204
|
-
this.chat_lang = stored_preferred_lang
|
|
205
|
-
// this.flag_url = "assets/images/language_flag/" + this.chat_lang + ".png"
|
|
206
|
-
this.logger.log('[SIDEBAR-USER-DETAILS] flag_url: ', this.flag_url);
|
|
207
|
-
this.logger.log('[SIDEBAR-USER-DETAILS] chat_lang: ', this.chat_lang);
|
|
208
|
-
}
|
|
209
219
|
|
|
220
|
+
if (tranlatedLanguage.includes(this.chat_lang)) {
|
|
221
|
+
this.logger.log('[SIDEBAR-USER-DETAILS] tranlatedLanguage includes', this.chat_lang, ': ', tranlatedLanguage.includes(this.chat_lang))
|
|
222
|
+
this.translate.use(this.chat_lang);
|
|
223
|
+
this.flag_url = "assets/images/language_flag/" + this.chat_lang + ".png"
|
|
224
|
+
} else {
|
|
225
|
+
this.logger.log('[SIDEBAR-USER-DETAILS] tranlatedLanguage includes', this.chat_lang, ': ', tranlatedLanguage.includes(this.chat_lang))
|
|
226
|
+
this.translate.use('en');
|
|
227
|
+
this.flag_url = "assets/images/language_flag/en.png"
|
|
228
|
+
this.chat_lang = 'en'
|
|
229
|
+
}
|
|
210
230
|
|
|
211
|
-
if (tranlatedLanguage.includes(this.chat_lang)) {
|
|
212
|
-
this.logger.log('[SIDEBAR-USER-DETAILS] tranlatedLanguage includes', this.chat_lang, ': ', tranlatedLanguage.includes(this.chat_lang))
|
|
213
|
-
this.translate.use(this.chat_lang);
|
|
214
|
-
this.flag_url = "assets/images/language_flag/" + this.chat_lang + ".png"
|
|
215
231
|
} else {
|
|
216
|
-
this.logger.
|
|
217
|
-
this.translate.use('en');
|
|
218
|
-
this.flag_url = "assets/images/language_flag/en.png"
|
|
219
|
-
this.chat_lang = 'en'
|
|
232
|
+
this.logger.error('[SIDEBAR-USER-DETAILS] - ngOnInit - currentUser not found in storage')
|
|
220
233
|
}
|
|
221
234
|
this.translateLabels()
|
|
222
235
|
}
|
|
@@ -264,27 +277,21 @@ export class SidebarUserDetailsComponent implements OnInit, OnChanges {
|
|
|
264
277
|
getEditProfileTranslation() {
|
|
265
278
|
this.translate.get('EditProfile')
|
|
266
279
|
.subscribe((text: string) => {
|
|
267
|
-
|
|
268
|
-
// console.log('[SIDEBAR-USER-DETAILS] - GET GTTTTTN ', text)
|
|
269
280
|
this.EditProfileLabel = text
|
|
270
281
|
});
|
|
271
282
|
}
|
|
272
283
|
|
|
273
|
-
|
|
284
|
+
|
|
274
285
|
|
|
275
286
|
getAvailableTranslation() {
|
|
276
287
|
this.translate.get('Available')
|
|
277
288
|
.subscribe((text: string) => {
|
|
278
|
-
|
|
279
|
-
// console.log('[SIDEBAR-USER-DETAILS] - GET GTTTTTN ', text)
|
|
280
289
|
this.IS_AVAILABLE_msg = text
|
|
281
290
|
});
|
|
282
291
|
}
|
|
283
292
|
getUnavailableTranslation() {
|
|
284
293
|
this.translate.get('Unavailable')
|
|
285
294
|
.subscribe((text: string) => {
|
|
286
|
-
|
|
287
|
-
// console.log('[SIDEBAR-USER-DETAILS] - GET GTTTTTN ', text)
|
|
288
295
|
this.IS_UNAVAILABLE_msg = text
|
|
289
296
|
});
|
|
290
297
|
}
|
|
@@ -292,8 +299,6 @@ export class SidebarUserDetailsComponent implements OnInit, OnChanges {
|
|
|
292
299
|
getIsBusyTranslation() {
|
|
293
300
|
this.translate.get('Busy')
|
|
294
301
|
.subscribe((text: string) => {
|
|
295
|
-
|
|
296
|
-
// console.log('[SIDEBAR-USER-DETAILS] - GET GTTTTTN ', text)
|
|
297
302
|
this.IS_BUSY_msg = text
|
|
298
303
|
});
|
|
299
304
|
}
|
|
@@ -301,8 +306,6 @@ export class SidebarUserDetailsComponent implements OnInit, OnChanges {
|
|
|
301
306
|
getLogoutTranslation() {
|
|
302
307
|
this.translate.get('LABEL_LOGOUT')
|
|
303
308
|
.subscribe((text: string) => {
|
|
304
|
-
// this.deleteContact_msg = text;
|
|
305
|
-
// console.log('[SIDEBAR-USER-DETAILS] - GET Logout label ', text)
|
|
306
309
|
this.LOGOUT_msg = text
|
|
307
310
|
});
|
|
308
311
|
}
|
|
@@ -310,8 +313,6 @@ export class SidebarUserDetailsComponent implements OnInit, OnChanges {
|
|
|
310
313
|
getSubscriptionPaymentProblemTranslation() {
|
|
311
314
|
this.translate.get('SubscriptionPaymentProblem')
|
|
312
315
|
.subscribe((text: string) => {
|
|
313
|
-
|
|
314
|
-
// console.log('[SIDEBAR-USER-DETAILS] - GET GTTTTTN ', text)
|
|
315
316
|
this.SUBSCRIPTION_PAYMENT_PROBLEM_msg = text
|
|
316
317
|
});
|
|
317
318
|
}
|
|
@@ -319,8 +320,6 @@ export class SidebarUserDetailsComponent implements OnInit, OnChanges {
|
|
|
319
320
|
getThePlanHasExpiredTranslation() {
|
|
320
321
|
this.translate.get('ThePlanHasExpired')
|
|
321
322
|
.subscribe((text: string) => {
|
|
322
|
-
|
|
323
|
-
// console.log('[SIDEBAR-USER-DETAILS] - GET GTTTTTN ', text)
|
|
324
323
|
this.THE_PLAN_HAS_EXPIRED_msg = text
|
|
325
324
|
});
|
|
326
325
|
}
|
|
@@ -334,20 +333,15 @@ export class SidebarUserDetailsComponent implements OnInit, OnChanges {
|
|
|
334
333
|
// console.log('[SIDEBAR-USER-DETAILS] - GET STORED PROJECT ', projectObjct)
|
|
335
334
|
|
|
336
335
|
this.projectID = projectObjct['id_project']['_id']
|
|
337
|
-
|
|
338
|
-
|
|
336
|
+
|
|
339
337
|
this.prjct_name = projectObjct['id_project']['name']
|
|
340
|
-
// console.log('[SIDEBAR-USER-DETAILS] - GET STORED PROJECT > PROJECT NAME ', this.prjct_name);
|
|
341
338
|
|
|
342
339
|
this.plan_type = projectObjct['id_project']['profile']['type'];
|
|
343
|
-
|
|
344
|
-
|
|
340
|
+
|
|
345
341
|
const trial_expired = projectObjct['id_project']['trialExpired']
|
|
346
|
-
|
|
347
|
-
|
|
342
|
+
|
|
348
343
|
const profile_name = projectObjct['id_project']['profile']['name'];
|
|
349
|
-
|
|
350
|
-
|
|
344
|
+
|
|
351
345
|
this.plan_name = projectObjct['id_project']['profile']['name'];
|
|
352
346
|
this.plan_subscription_is_active = projectObjct['id_project']['isActiveSubscription'];
|
|
353
347
|
|
|
@@ -363,9 +357,7 @@ export class SidebarUserDetailsComponent implements OnInit, OnChanges {
|
|
|
363
357
|
} else if (this.plan_type === 'payment' && profile_name === 'enterprise') {
|
|
364
358
|
this.getEnterprisePlanTranslation();
|
|
365
359
|
}
|
|
366
|
-
|
|
367
360
|
}
|
|
368
|
-
|
|
369
361
|
} catch (err) {
|
|
370
362
|
this.logger.error('[SIDEBAR-USER-DETAILS] - GET STORED PROJECT ERR ', err)
|
|
371
363
|
}
|
|
@@ -380,48 +372,33 @@ export class SidebarUserDetailsComponent implements OnInit, OnChanges {
|
|
|
380
372
|
|
|
381
373
|
|
|
382
374
|
getProPlanTrialTranslation() {
|
|
383
|
-
// this.profile_name_translated = this.PRO_PLAN_TRIAL_msg;
|
|
384
375
|
this.translate.get('ProPlanTrial')
|
|
385
376
|
.subscribe((text: string) => {
|
|
386
|
-
|
|
387
|
-
// console.log('[SIDEBAR-USER-DETAILS] - GET GTTTTTN ', text)
|
|
388
377
|
this.profile_name_translated = text
|
|
389
378
|
});
|
|
390
379
|
}
|
|
391
380
|
|
|
392
381
|
getFreePlanTranslation() {
|
|
393
|
-
// this.profile_name_translated = this.FREE_PLAN_msg;
|
|
394
382
|
this.translate.get('FreePlan')
|
|
395
383
|
.subscribe((text: string) => {
|
|
396
|
-
|
|
397
|
-
// console.log('[SIDEBAR-USER-DETAILS] - GET GTTTTTN ', text)
|
|
398
384
|
this.profile_name_translated = text
|
|
399
385
|
});
|
|
400
386
|
}
|
|
401
387
|
|
|
402
388
|
getProPlanTranslation() {
|
|
403
|
-
// this.profile_name_translated = this.PAYD_PLAN_NAME_PRO_msg;
|
|
404
389
|
this.translate.get('PaydPlanNamePro')
|
|
405
390
|
.subscribe((text: string) => {
|
|
406
|
-
// this.deleteContact_msg = text;
|
|
407
|
-
// console.log('[SIDEBAR-USER-DETAILS] - GET GTTTTTN ', text)
|
|
408
391
|
this.profile_name_translated = text
|
|
409
392
|
});
|
|
410
393
|
}
|
|
411
394
|
|
|
412
395
|
getEnterprisePlanTranslation() {
|
|
413
|
-
// this.profile_name_translated = this.PAYD_PLAN_NAME_ENTERPRISE_msg;
|
|
414
396
|
this.translate.get('PaydPlanNameEnterprise')
|
|
415
397
|
.subscribe((text: string) => {
|
|
416
|
-
// this.deleteContact_msg = text;
|
|
417
|
-
// console.log('[SIDEBAR-USER-DETAILS] - GET GTTTTTN ', text)
|
|
418
398
|
this.profile_name_translated = text
|
|
419
399
|
});
|
|
420
400
|
}
|
|
421
401
|
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
402
|
listenTocurrentProjectUserUserAvailability$() {
|
|
426
403
|
this.wsService.currentProjectUserAvailability$
|
|
427
404
|
.pipe(skip(1))
|
|
@@ -432,7 +409,6 @@ export class SidebarUserDetailsComponent implements OnInit, OnChanges {
|
|
|
432
409
|
this.IS_AVAILABLE = projectUser['user_available']
|
|
433
410
|
this.IS_BUSY = projectUser['isBusy']
|
|
434
411
|
this.USER_ROLE = projectUser['role']
|
|
435
|
-
// console.log('[SIDEBAR-USER-DETAILS] -translateUserRole 1', this.USER_ROLE)
|
|
436
412
|
this.translateUserRole(this.USER_ROLE)
|
|
437
413
|
}
|
|
438
414
|
|
|
@@ -446,58 +422,27 @@ export class SidebarUserDetailsComponent implements OnInit, OnChanges {
|
|
|
446
422
|
}
|
|
447
423
|
|
|
448
424
|
translateUserRole(role) {
|
|
449
|
-
// console.log('[SIDEBAR-USER-DETAILS] -translateUserRole ', role)
|
|
450
425
|
this.translate.get(role)
|
|
451
426
|
.subscribe((text: string) => {
|
|
452
|
-
|
|
453
|
-
// console.log('[SIDEBAR-USER-DETAILS] - GET GTTTTTN ', text)
|
|
454
427
|
this.USER_ROLE_LABEL = text
|
|
455
428
|
});
|
|
456
|
-
|
|
457
|
-
|
|
458
429
|
}
|
|
459
430
|
|
|
460
431
|
|
|
461
|
-
ngOnChanges() {
|
|
462
|
-
// console.log('[SIDEBAR-USER-DETAILS] HAS_CLICKED_OPEN_USER_DETAIL', this.HAS_CLICKED_OPEN_USER_DETAIL)
|
|
463
|
-
// var element = document.getElementById('user-details');
|
|
464
|
-
// // console.log('[SIDEBAR-USER-DETAILS] element', element)
|
|
465
|
-
// if (this.HAS_CLICKED_OPEN_USER_DETAIL === true) {
|
|
466
|
-
// element.classList.add("active");
|
|
467
|
-
// }
|
|
468
|
-
}
|
|
432
|
+
ngOnChanges() { }
|
|
469
433
|
|
|
470
434
|
|
|
471
435
|
|
|
472
|
-
// closeUserDetailSidePanel() {
|
|
473
|
-
// var element = document.getElementById('user-details');
|
|
474
|
-
// element.classList.remove("active");
|
|
475
|
-
// this.logger.log('[SIDEBAR-USER-DETAILS] element', element);
|
|
476
|
-
// this.HAS_CLICKED_OPEN_USER_DETAIL === true
|
|
477
|
-
// // this.onCloseUserDetailsSidebar.emit(false);
|
|
478
|
-
// }
|
|
479
|
-
|
|
480
436
|
|
|
481
437
|
|
|
482
438
|
changeAvailabilityStateInUserDetailsSidebar(available) {
|
|
483
439
|
this.logger.log('[SIDEBAR-USER-DETAILS] - changeAvailabilityState projectid', this.projectID, ' available 1: ', available);
|
|
484
440
|
|
|
485
|
-
// available = !available
|
|
486
|
-
// console.log('[SIDEBAR-USER-DETAILS] - changeAvailabilityState projectid', this.projectID, ' available 2 : ', available);
|
|
487
|
-
|
|
488
441
|
this.wsService.updateCurrentUserAvailability(this.tiledeskToken, this.projectID, available)
|
|
489
442
|
.subscribe((projectUser: any) => {
|
|
490
443
|
|
|
491
444
|
this.logger.log('[SIDEBAR-USER-DETAILS] - PROJECT-USER UPDATED ', projectUser)
|
|
492
445
|
|
|
493
|
-
// NOTIFY TO THE USER SERVICE WHEN THE AVAILABLE / UNAVAILABLE BUTTON IS CLICKED
|
|
494
|
-
// this.usersService.availability_btn_clicked(true)
|
|
495
|
-
|
|
496
|
-
// if (this.project['id_project']._id === projectUser.id_project) {
|
|
497
|
-
// this.project['ws_projct_user_available'] = projectUser.user_available;
|
|
498
|
-
// // this.project['ws_projct_user_isBusy'] = projectUser['isBusy']
|
|
499
|
-
// }
|
|
500
|
-
|
|
501
446
|
}, (error) => {
|
|
502
447
|
this.logger.error('[SIDEBAR-USER-DETAILS] - PROJECT-USER UPDATED - ERROR ', error);
|
|
503
448
|
|
|
@@ -509,7 +454,6 @@ export class SidebarUserDetailsComponent implements OnInit, OnChanges {
|
|
|
509
454
|
|
|
510
455
|
goToUserProfile() {
|
|
511
456
|
let url = this.DASHBOARD_URL + this.projectID + '/user-profile'
|
|
512
|
-
|
|
513
457
|
const myWindow = window.open(url, '_self');
|
|
514
458
|
myWindow.focus();
|
|
515
459
|
}
|
|
@@ -520,9 +464,7 @@ export class SidebarUserDetailsComponent implements OnInit, OnChanges {
|
|
|
520
464
|
}
|
|
521
465
|
|
|
522
466
|
public onLogout() {
|
|
523
|
-
// this.authService.logout();
|
|
524
467
|
this.closeUserDetailSidePanel()
|
|
525
|
-
// pubblico evento
|
|
526
468
|
this.events.publish('profileInfoButtonClick:logout', true);
|
|
527
469
|
}
|
|
528
470
|
|
|
@@ -16,6 +16,7 @@ import { isInArray } from 'src/chat21-core/utils/utils';
|
|
|
16
16
|
// Logger
|
|
17
17
|
import { LoggerService } from 'src/chat21-core/providers/abstract/logger.service';
|
|
18
18
|
import { LoggerInstance } from 'src/chat21-core/providers/logger/loggerInstance';
|
|
19
|
+
import { AppStorageService } from 'src/chat21-core/providers/abstract/app-storage.service';
|
|
19
20
|
|
|
20
21
|
@Component({
|
|
21
22
|
selector: 'app-login',
|
|
@@ -39,7 +40,8 @@ export class LoginPage implements OnInit {
|
|
|
39
40
|
private translateService: CustomTranslateService,
|
|
40
41
|
private events: EventsService,
|
|
41
42
|
private loginComponent: LoginComponent,
|
|
42
|
-
public toastController: ToastController
|
|
43
|
+
public toastController: ToastController,
|
|
44
|
+
public appStorageService: AppStorageService
|
|
43
45
|
) { }
|
|
44
46
|
|
|
45
47
|
ngOnInit() {
|
|
@@ -123,6 +125,8 @@ export class LoginPage implements OnInit {
|
|
|
123
125
|
this.tiledeskAuthService.signInWithEmailAndPassword(auth.email, auth.password)
|
|
124
126
|
.then(tiledeskToken => {
|
|
125
127
|
this.messagingAuthService.createCustomToken(tiledeskToken)
|
|
128
|
+
// Here edit stored current user
|
|
129
|
+
// this.updateStoredCurrentUser()
|
|
126
130
|
})
|
|
127
131
|
.catch(error => {
|
|
128
132
|
this.showSpinnerInLoginBtn = false;
|
|
@@ -151,6 +155,21 @@ export class LoginPage implements OnInit {
|
|
|
151
155
|
// this.authService.signInWithEmailAndPassword(auth.email, auth.password);
|
|
152
156
|
}
|
|
153
157
|
|
|
158
|
+
updateStoredCurrentUser() {
|
|
159
|
+
const storedCurrentUser = this.appStorageService.getItem('currentUser')
|
|
160
|
+
const storedDshbrdUser = localStorage.getItem('user')
|
|
161
|
+
|
|
162
|
+
if (storedCurrentUser && storedCurrentUser !== 'undefined') {
|
|
163
|
+
const currentUser = JSON.parse(storedCurrentUser);
|
|
164
|
+
// console.log('[LOGIN PAGE] updateStoredCurrentUser - currentUser' , currentUser)
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
if (storedDshbrdUser && storedDshbrdUser !== 'undefined') {
|
|
168
|
+
const dshbrdUser = JSON.parse(localStorage.getItem('user'));
|
|
169
|
+
// console.log('[LOGIN PAGE] updateStoredCurrentUser - dshbrdUser' , dshbrdUser)
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
154
173
|
async presentToast(errormsg: string) {
|
|
155
174
|
const toast = await this.toastController.create({
|
|
156
175
|
message: errormsg,
|
|
@@ -32,16 +32,22 @@
|
|
|
32
32
|
|
|
33
33
|
<ng-template #showConversation>
|
|
34
34
|
|
|
35
|
-
<app-header-conversation-detail
|
|
36
|
-
[
|
|
37
|
-
|
|
38
|
-
[
|
|
35
|
+
<app-header-conversation-detail
|
|
36
|
+
[isMobile]="isMobile"
|
|
37
|
+
[idLoggedUser]="loggedUser.uid"
|
|
38
|
+
[conversationUid]="conversationWith"
|
|
39
|
+
[conversationAvatar]="conversationAvatar"
|
|
40
|
+
[translationMap]="translationMap"
|
|
41
|
+
[isOpenInfoConversation]="isOpenInfoConversation"
|
|
42
|
+
[conv_type]="conv_type"
|
|
43
|
+
(eventOpenCloseInfoConversation)="returnOpenCloseInfoConversation($event)">
|
|
39
44
|
</app-header-conversation-detail>
|
|
40
45
|
|
|
41
46
|
<ion-content id="conv-details">
|
|
42
47
|
<ion-grid class="grid_content">
|
|
43
48
|
<ion-row class="row_content">
|
|
44
|
-
<ion-col id="chatArea" [class.mobile]="isMobile" [class.open]="openInfoConversation"
|
|
49
|
+
<ion-col id="chatArea" [class.mobile]="isMobile" [class.open]="openInfoConversation"
|
|
50
|
+
[ngClass]="{'chat-area-apps-sidebar-wide': appsidebarIsWide === true}">
|
|
45
51
|
|
|
46
52
|
|
|
47
53
|
<ion-row class="row_chat_area" [style.height]="'calc(100% - '+heightMessageTextArea+'px)'">
|
|
@@ -113,12 +119,16 @@
|
|
|
113
119
|
|
|
114
120
|
|
|
115
121
|
<ion-conversation-detail *ngIf="isHovering === false" #conversationContentDetail
|
|
116
|
-
[channelType]="channelType"
|
|
117
|
-
[
|
|
122
|
+
[channelType]="channelType"
|
|
123
|
+
[messages]="messages"
|
|
124
|
+
[senderId]="loggedUser.uid"
|
|
125
|
+
[baseLocation]="window?.location?.origin"
|
|
126
|
+
[stylesMap]="styleMap"
|
|
118
127
|
(onBeforeMessageRender)="returnOnBeforeMessageRender($event)"
|
|
119
128
|
(onAfterMessageRender)="returnOnAfterMessageRender($event)"
|
|
120
129
|
(onAttachmentButtonClicked)="returnOnAttachmentButtonClicked($event)"
|
|
121
|
-
(onScrollContent)="returnOnScrollContent($event)"
|
|
130
|
+
(onScrollContent)="returnOnScrollContent($event)"
|
|
131
|
+
(onMenuOptionShow)="returnOnMenuOption($event)"
|
|
122
132
|
(onImageRendered)="onImageRenderedFN($event)"
|
|
123
133
|
(onAddUploadingBubble)="addUploadingBubbleEvent($event)">
|
|
124
134
|
</ion-conversation-detail>
|
|
@@ -163,25 +173,36 @@
|
|
|
163
173
|
<!-- (eventReplaceMessageWithCanned)="replaceTagInMessage($event)" -->
|
|
164
174
|
<!-- [tagsCannedFilter]="tagsCannedFilter" -->
|
|
165
175
|
<!-- openInfoConversation {{openInfoConversation}} - isMobile {{isMobile}} -->
|
|
166
|
-
<app-message-text-area
|
|
167
|
-
|
|
168
|
-
[
|
|
169
|
-
[
|
|
176
|
+
<app-message-text-area *ngIf="(openInfoConversation === false && isMobile === true) || (openInfoConversation === true && isMobile === false) || (openInfoConversation === false && isMobile === false)"
|
|
177
|
+
[tagsCannedCount]="tagsCannedCount"
|
|
178
|
+
[areVisibleCAR]="areVisibleCAR"
|
|
179
|
+
[support_mode]="support_mode"
|
|
180
|
+
[loggedUser]="loggedUser"
|
|
181
|
+
[conversationWith]="conversationWith"
|
|
182
|
+
[tagsCannedFilter]="tagsCannedFilter"
|
|
183
|
+
[translationMap]="translationMap"
|
|
184
|
+
[fileUploadAccept]="appConfigProvider.getConfig().fileUploadAccept"
|
|
185
|
+
[isOpenInfoConversation]="isOpenInfoConversation"
|
|
186
|
+
[dropEvent]="dropEvent"
|
|
187
|
+
[disableTextarea]="disableTextarea"
|
|
170
188
|
(eventChangeTextArea)="returnChangeTextArea($event)"
|
|
171
189
|
(hasClickedOpenCannedResponses)="hasClickedOpenCannedResponses($event)"
|
|
172
|
-
(eventSendMessage)="returnSendMessage($event)"
|
|
173
|
-
|
|
174
|
-
[isOpenInfoConversation]="isOpenInfoConversation" [dropEvent]="dropEvent"
|
|
175
|
-
(onPresentModalScrollToBottom)="onPresentModalScrollToBottom($event)" [disableTextarea]="disableTextarea">
|
|
190
|
+
(eventSendMessage)="returnSendMessage($event)"
|
|
191
|
+
(onPresentModalScrollToBottom)="onPresentModalScrollToBottom($event)">
|
|
176
192
|
</app-message-text-area>
|
|
177
193
|
<!-- [events]="eventsReplaceTexareaText.asObservable()" -->
|
|
178
194
|
</ion-row>
|
|
179
195
|
|
|
180
196
|
</ion-col>
|
|
181
197
|
|
|
182
|
-
<ion-col id="chat21-info-conversation" [class.mobile]="isMobile" [class.open]="openInfoConversation"
|
|
183
|
-
|
|
184
|
-
|
|
198
|
+
<ion-col id="chat21-info-conversation" [class.mobile]="isMobile" [class.open]="openInfoConversation"
|
|
199
|
+
[ngClass]="{'info-convs-apps-sidebar-wide': appsidebarIsWide === true}">
|
|
200
|
+
<app-info-content
|
|
201
|
+
[openInfoConversation]="openInfoConversation"
|
|
202
|
+
[translationMap]="translationMap"
|
|
203
|
+
[loggedUser]="loggedUser"
|
|
204
|
+
[tenant]="tenant"
|
|
205
|
+
[groupDetail]="groupDetail">
|
|
185
206
|
</app-info-content>
|
|
186
207
|
</ion-col>
|
|
187
208
|
|
|
@@ -197,7 +197,7 @@
|
|
|
197
197
|
// display: inline-block;
|
|
198
198
|
// }
|
|
199
199
|
// .message {
|
|
200
|
-
// .
|
|
200
|
+
// .bubble-message {
|
|
201
201
|
// position: relative;
|
|
202
202
|
// border-radius: 15px;
|
|
203
203
|
// font-size: 15px;
|
|
@@ -222,7 +222,7 @@
|
|
|
222
222
|
// &.message-other {
|
|
223
223
|
// width: 100%;
|
|
224
224
|
// margin-top: 4px;
|
|
225
|
-
// .
|
|
225
|
+
// .bubble-message {
|
|
226
226
|
// background-color: var(--light-gray);
|
|
227
227
|
// color: var(--black);
|
|
228
228
|
// margin-left: 24px;
|
|
@@ -244,7 +244,7 @@
|
|
|
244
244
|
// }
|
|
245
245
|
// &.first-message {
|
|
246
246
|
// margin-top: 10px;
|
|
247
|
-
// .
|
|
247
|
+
// .bubble-message {
|
|
248
248
|
// border-top-left-radius: 12px;
|
|
249
249
|
// border-bottom-left-radius: 0px;
|
|
250
250
|
// }
|
|
@@ -256,8 +256,8 @@
|
|
|
256
256
|
// &.message-mine {
|
|
257
257
|
// width: 100%;
|
|
258
258
|
// margin-top: 4px;
|
|
259
|
-
// .
|
|
260
|
-
// background-color: var(--
|
|
259
|
+
// .bubble-message {
|
|
260
|
+
// background-color: var(--bubble-blue);
|
|
261
261
|
// color: white;
|
|
262
262
|
// margin-right: 24px;
|
|
263
263
|
// float: right;
|
|
@@ -266,7 +266,7 @@
|
|
|
266
266
|
// }
|
|
267
267
|
// &.first-message {
|
|
268
268
|
// margin-top: 10px;
|
|
269
|
-
// .
|
|
269
|
+
// .bubble-message {
|
|
270
270
|
// border-top-right-radius: 12px;
|
|
271
271
|
// border-bottom-right-radius: 0px;
|
|
272
272
|
// }
|
|
@@ -385,6 +385,15 @@ ion-content {
|
|
|
385
385
|
}
|
|
386
386
|
}
|
|
387
387
|
|
|
388
|
+
.chat-area-apps-sidebar-wide {
|
|
389
|
+
min-width: calc(100% - 600px) !important;
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
.info-convs-apps-sidebar-wide {
|
|
393
|
+
max-width: 600px !important;
|
|
394
|
+
min-width: 600px !important;
|
|
395
|
+
}
|
|
396
|
+
|
|
388
397
|
#buttonScrollToBottom {
|
|
389
398
|
position: absolute;
|
|
390
399
|
right: 0;
|