@chat21/chat21-ionic 3.0.62 → 3.0.64
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 +32 -0
- package/README.md +6 -2
- package/deploy_amazon_beta.sh +29 -0
- package/deploy_amazon_prod.sh +25 -0
- package/deploy_pre.sh +6 -78
- package/deploy_prod.sh +6 -57
- package/package.json +2 -1
- package/src/app/app.component.ts +104 -34
- 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/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.html +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.html +2 -2
- package/src/app/components/sidebar/sidebar.component.ts +49 -83
- package/src/app/components/sidebar-user-details/sidebar-user-details.component.html +17 -1
- package/src/app/components/sidebar-user-details/sidebar-user-details.component.scss +52 -6
- package/src/app/components/sidebar-user-details/sidebar-user-details.component.ts +81 -111
- 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 +179 -244
- package/src/app/services/nav-proxy.service.ts +15 -13
- package/src/assets/i18n/de.json +2 -1
- package/src/assets/i18n/en.json +2 -1
- package/src/assets/i18n/es.json +2 -1
- package/src/assets/i18n/fr.json +2 -1
- package/src/assets/i18n/it.json +2 -1
- package/src/assets/i18n/pt.json +2 -1
- package/src/assets/i18n/ru.json +2 -1
- package/src/assets/i18n/sr.json +2 -1
- package/src/assets/i18n/tr.json +2 -1
- package/src/assets/js/chat21client.js +1 -1
- package/src/{chat-config-mqtt-ver-uploaded.json → chat-config-mqtt-localhost.json} +10 -6
- package/src/chat-config-mqtt.json +18 -28
- package/src/chat-config-native-mqtt.json +30 -0
- package/src/chat-config-pre.json +15 -7
- package/src/chat21-core/providers/firebase/firebase-conversation-handler.ts +2 -3
- package/src/chat21-core/providers/firebase/firebase-conversations-handler.ts +20 -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
- package/src/chat-config-pre-test.json +0 -36
|
@@ -32,6 +32,7 @@ export class SidebarUserDetailsComponent implements OnInit, OnChanges {
|
|
|
32
32
|
IS_AVAILABLE: boolean;
|
|
33
33
|
USER_ROLE: boolean;
|
|
34
34
|
USER_ROLE_LABEL: string;
|
|
35
|
+
EditProfileLabel: string;
|
|
35
36
|
IS_BUSY_msg: string;
|
|
36
37
|
IS_AVAILABLE_msg: string;
|
|
37
38
|
IS_UNAVAILABLE_msg: string;
|
|
@@ -59,6 +60,7 @@ export class SidebarUserDetailsComponent implements OnInit, OnChanges {
|
|
|
59
60
|
version: string
|
|
60
61
|
test: Date = new Date();
|
|
61
62
|
company_name: string = 'Tiledesk'
|
|
63
|
+
DASHBOARD_URL: string;
|
|
62
64
|
constructor(
|
|
63
65
|
private translate: TranslateService,
|
|
64
66
|
public tiledeskAuthService: TiledeskAuthService,
|
|
@@ -69,9 +71,11 @@ export class SidebarUserDetailsComponent implements OnInit, OnChanges {
|
|
|
69
71
|
public appConfigProvider: AppConfigProvider,
|
|
70
72
|
public events: EventsService,
|
|
71
73
|
private eRef: ElementRef,
|
|
74
|
+
|
|
72
75
|
) { }
|
|
73
76
|
|
|
74
77
|
ngOnInit() {
|
|
78
|
+
this.DASHBOARD_URL = this.appConfigProvider.getConfig().dashboardUrl + '#/project/';
|
|
75
79
|
this.version = PACKAGE.version;
|
|
76
80
|
this.getCurrentChatLangAndTranslateLabels();
|
|
77
81
|
this.subcribeToAuthStateChanged();
|
|
@@ -86,14 +90,20 @@ export class SidebarUserDetailsComponent implements OnInit, OnChanges {
|
|
|
86
90
|
this.logger.log('[SIDEBAR-USER-DETAILS] BSAuthStateChanged ', state)
|
|
87
91
|
|
|
88
92
|
if (state === 'online') {
|
|
89
|
-
|
|
90
|
-
this.
|
|
91
|
-
if (
|
|
92
|
-
|
|
93
|
-
this.
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
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 ')
|
|
97
107
|
}
|
|
98
108
|
}
|
|
99
109
|
})
|
|
@@ -176,48 +186,56 @@ export class SidebarUserDetailsComponent implements OnInit, OnChanges {
|
|
|
176
186
|
|
|
177
187
|
getCurrentChatLangAndTranslateLabels() {
|
|
178
188
|
this.browserLang = this.translate.getBrowserLang();
|
|
179
|
-
const
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
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
|
+
}
|
|
187
200
|
|
|
188
|
-
|
|
189
|
-
|
|
201
|
+
const stored_preferred_lang = localStorage.getItem(currentUserId + '_lang');
|
|
202
|
+
this.logger.log('[SIDEBAR-USER-DETAILS] stored_preferred_lang: ', stored_preferred_lang);
|
|
190
203
|
|
|
191
204
|
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
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"
|
|
196
209
|
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
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
|
+
}
|
|
205
218
|
|
|
206
219
|
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
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
|
+
}
|
|
230
|
+
|
|
211
231
|
} else {
|
|
212
|
-
this.logger.
|
|
213
|
-
this.translate.use('en');
|
|
214
|
-
this.flag_url = "assets/images/language_flag/en.png"
|
|
215
|
-
this.chat_lang = 'en'
|
|
232
|
+
this.logger.error('[SIDEBAR-USER-DETAILS] - ngOnInit - currentUser not found in storage')
|
|
216
233
|
}
|
|
217
234
|
this.translateLabels()
|
|
218
235
|
}
|
|
219
236
|
|
|
220
237
|
translateLabels() {
|
|
238
|
+
this.getEditProfileTranslation();
|
|
221
239
|
this.getAvailableTranslation();
|
|
222
240
|
this.getUnavailableTranslation();
|
|
223
241
|
this.getIsBusyTranslation();
|
|
@@ -256,19 +274,24 @@ export class SidebarUserDetailsComponent implements OnInit, OnChanges {
|
|
|
256
274
|
}
|
|
257
275
|
}
|
|
258
276
|
|
|
277
|
+
getEditProfileTranslation() {
|
|
278
|
+
this.translate.get('EditProfile')
|
|
279
|
+
.subscribe((text: string) => {
|
|
280
|
+
this.EditProfileLabel = text
|
|
281
|
+
});
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
|
|
285
|
+
|
|
259
286
|
getAvailableTranslation() {
|
|
260
287
|
this.translate.get('Available')
|
|
261
288
|
.subscribe((text: string) => {
|
|
262
|
-
|
|
263
|
-
// console.log('[SIDEBAR-USER-DETAILS] - GET GTTTTTN ', text)
|
|
264
289
|
this.IS_AVAILABLE_msg = text
|
|
265
290
|
});
|
|
266
291
|
}
|
|
267
292
|
getUnavailableTranslation() {
|
|
268
293
|
this.translate.get('Unavailable')
|
|
269
294
|
.subscribe((text: string) => {
|
|
270
|
-
|
|
271
|
-
// console.log('[SIDEBAR-USER-DETAILS] - GET GTTTTTN ', text)
|
|
272
295
|
this.IS_UNAVAILABLE_msg = text
|
|
273
296
|
});
|
|
274
297
|
}
|
|
@@ -276,8 +299,6 @@ export class SidebarUserDetailsComponent implements OnInit, OnChanges {
|
|
|
276
299
|
getIsBusyTranslation() {
|
|
277
300
|
this.translate.get('Busy')
|
|
278
301
|
.subscribe((text: string) => {
|
|
279
|
-
|
|
280
|
-
// console.log('[SIDEBAR-USER-DETAILS] - GET GTTTTTN ', text)
|
|
281
302
|
this.IS_BUSY_msg = text
|
|
282
303
|
});
|
|
283
304
|
}
|
|
@@ -285,8 +306,6 @@ export class SidebarUserDetailsComponent implements OnInit, OnChanges {
|
|
|
285
306
|
getLogoutTranslation() {
|
|
286
307
|
this.translate.get('LABEL_LOGOUT')
|
|
287
308
|
.subscribe((text: string) => {
|
|
288
|
-
// this.deleteContact_msg = text;
|
|
289
|
-
// console.log('[SIDEBAR-USER-DETAILS] - GET Logout label ', text)
|
|
290
309
|
this.LOGOUT_msg = text
|
|
291
310
|
});
|
|
292
311
|
}
|
|
@@ -294,8 +313,6 @@ export class SidebarUserDetailsComponent implements OnInit, OnChanges {
|
|
|
294
313
|
getSubscriptionPaymentProblemTranslation() {
|
|
295
314
|
this.translate.get('SubscriptionPaymentProblem')
|
|
296
315
|
.subscribe((text: string) => {
|
|
297
|
-
|
|
298
|
-
// console.log('[SIDEBAR-USER-DETAILS] - GET GTTTTTN ', text)
|
|
299
316
|
this.SUBSCRIPTION_PAYMENT_PROBLEM_msg = text
|
|
300
317
|
});
|
|
301
318
|
}
|
|
@@ -303,8 +320,6 @@ export class SidebarUserDetailsComponent implements OnInit, OnChanges {
|
|
|
303
320
|
getThePlanHasExpiredTranslation() {
|
|
304
321
|
this.translate.get('ThePlanHasExpired')
|
|
305
322
|
.subscribe((text: string) => {
|
|
306
|
-
|
|
307
|
-
// console.log('[SIDEBAR-USER-DETAILS] - GET GTTTTTN ', text)
|
|
308
323
|
this.THE_PLAN_HAS_EXPIRED_msg = text
|
|
309
324
|
});
|
|
310
325
|
}
|
|
@@ -318,20 +333,15 @@ export class SidebarUserDetailsComponent implements OnInit, OnChanges {
|
|
|
318
333
|
// console.log('[SIDEBAR-USER-DETAILS] - GET STORED PROJECT ', projectObjct)
|
|
319
334
|
|
|
320
335
|
this.projectID = projectObjct['id_project']['_id']
|
|
321
|
-
|
|
322
|
-
|
|
336
|
+
|
|
323
337
|
this.prjct_name = projectObjct['id_project']['name']
|
|
324
|
-
// console.log('[SIDEBAR-USER-DETAILS] - GET STORED PROJECT > PROJECT NAME ', this.prjct_name);
|
|
325
338
|
|
|
326
339
|
this.plan_type = projectObjct['id_project']['profile']['type'];
|
|
327
|
-
|
|
328
|
-
|
|
340
|
+
|
|
329
341
|
const trial_expired = projectObjct['id_project']['trialExpired']
|
|
330
|
-
|
|
331
|
-
|
|
342
|
+
|
|
332
343
|
const profile_name = projectObjct['id_project']['profile']['name'];
|
|
333
|
-
|
|
334
|
-
|
|
344
|
+
|
|
335
345
|
this.plan_name = projectObjct['id_project']['profile']['name'];
|
|
336
346
|
this.plan_subscription_is_active = projectObjct['id_project']['isActiveSubscription'];
|
|
337
347
|
|
|
@@ -347,9 +357,7 @@ export class SidebarUserDetailsComponent implements OnInit, OnChanges {
|
|
|
347
357
|
} else if (this.plan_type === 'payment' && profile_name === 'enterprise') {
|
|
348
358
|
this.getEnterprisePlanTranslation();
|
|
349
359
|
}
|
|
350
|
-
|
|
351
360
|
}
|
|
352
|
-
|
|
353
361
|
} catch (err) {
|
|
354
362
|
this.logger.error('[SIDEBAR-USER-DETAILS] - GET STORED PROJECT ERR ', err)
|
|
355
363
|
}
|
|
@@ -364,48 +372,33 @@ export class SidebarUserDetailsComponent implements OnInit, OnChanges {
|
|
|
364
372
|
|
|
365
373
|
|
|
366
374
|
getProPlanTrialTranslation() {
|
|
367
|
-
// this.profile_name_translated = this.PRO_PLAN_TRIAL_msg;
|
|
368
375
|
this.translate.get('ProPlanTrial')
|
|
369
376
|
.subscribe((text: string) => {
|
|
370
|
-
|
|
371
|
-
// console.log('[SIDEBAR-USER-DETAILS] - GET GTTTTTN ', text)
|
|
372
377
|
this.profile_name_translated = text
|
|
373
378
|
});
|
|
374
379
|
}
|
|
375
380
|
|
|
376
381
|
getFreePlanTranslation() {
|
|
377
|
-
// this.profile_name_translated = this.FREE_PLAN_msg;
|
|
378
382
|
this.translate.get('FreePlan')
|
|
379
383
|
.subscribe((text: string) => {
|
|
380
|
-
|
|
381
|
-
// console.log('[SIDEBAR-USER-DETAILS] - GET GTTTTTN ', text)
|
|
382
384
|
this.profile_name_translated = text
|
|
383
385
|
});
|
|
384
386
|
}
|
|
385
387
|
|
|
386
388
|
getProPlanTranslation() {
|
|
387
|
-
// this.profile_name_translated = this.PAYD_PLAN_NAME_PRO_msg;
|
|
388
389
|
this.translate.get('PaydPlanNamePro')
|
|
389
390
|
.subscribe((text: string) => {
|
|
390
|
-
// this.deleteContact_msg = text;
|
|
391
|
-
// console.log('[SIDEBAR-USER-DETAILS] - GET GTTTTTN ', text)
|
|
392
391
|
this.profile_name_translated = text
|
|
393
392
|
});
|
|
394
393
|
}
|
|
395
394
|
|
|
396
395
|
getEnterprisePlanTranslation() {
|
|
397
|
-
// this.profile_name_translated = this.PAYD_PLAN_NAME_ENTERPRISE_msg;
|
|
398
396
|
this.translate.get('PaydPlanNameEnterprise')
|
|
399
397
|
.subscribe((text: string) => {
|
|
400
|
-
// this.deleteContact_msg = text;
|
|
401
|
-
// console.log('[SIDEBAR-USER-DETAILS] - GET GTTTTTN ', text)
|
|
402
398
|
this.profile_name_translated = text
|
|
403
399
|
});
|
|
404
400
|
}
|
|
405
401
|
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
402
|
listenTocurrentProjectUserUserAvailability$() {
|
|
410
403
|
this.wsService.currentProjectUserAvailability$
|
|
411
404
|
.pipe(skip(1))
|
|
@@ -416,7 +409,6 @@ export class SidebarUserDetailsComponent implements OnInit, OnChanges {
|
|
|
416
409
|
this.IS_AVAILABLE = projectUser['user_available']
|
|
417
410
|
this.IS_BUSY = projectUser['isBusy']
|
|
418
411
|
this.USER_ROLE = projectUser['role']
|
|
419
|
-
// console.log('[SIDEBAR-USER-DETAILS] -translateUserRole 1', this.USER_ROLE)
|
|
420
412
|
this.translateUserRole(this.USER_ROLE)
|
|
421
413
|
}
|
|
422
414
|
|
|
@@ -430,58 +422,27 @@ export class SidebarUserDetailsComponent implements OnInit, OnChanges {
|
|
|
430
422
|
}
|
|
431
423
|
|
|
432
424
|
translateUserRole(role) {
|
|
433
|
-
// console.log('[SIDEBAR-USER-DETAILS] -translateUserRole ', role)
|
|
434
425
|
this.translate.get(role)
|
|
435
426
|
.subscribe((text: string) => {
|
|
436
|
-
|
|
437
|
-
// console.log('[SIDEBAR-USER-DETAILS] - GET GTTTTTN ', text)
|
|
438
427
|
this.USER_ROLE_LABEL = text
|
|
439
428
|
});
|
|
440
|
-
|
|
441
|
-
|
|
442
429
|
}
|
|
443
430
|
|
|
444
431
|
|
|
445
|
-
ngOnChanges() {
|
|
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
|
-
// }
|
|
452
|
-
}
|
|
453
|
-
|
|
432
|
+
ngOnChanges() { }
|
|
454
433
|
|
|
455
434
|
|
|
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
|
-
// }
|
|
463
435
|
|
|
464
436
|
|
|
465
437
|
|
|
466
438
|
changeAvailabilityStateInUserDetailsSidebar(available) {
|
|
467
439
|
this.logger.log('[SIDEBAR-USER-DETAILS] - changeAvailabilityState projectid', this.projectID, ' available 1: ', available);
|
|
468
440
|
|
|
469
|
-
// available = !available
|
|
470
|
-
// console.log('[SIDEBAR-USER-DETAILS] - changeAvailabilityState projectid', this.projectID, ' available 2 : ', available);
|
|
471
|
-
|
|
472
441
|
this.wsService.updateCurrentUserAvailability(this.tiledeskToken, this.projectID, available)
|
|
473
442
|
.subscribe((projectUser: any) => {
|
|
474
443
|
|
|
475
444
|
this.logger.log('[SIDEBAR-USER-DETAILS] - PROJECT-USER UPDATED ', projectUser)
|
|
476
445
|
|
|
477
|
-
// NOTIFY TO THE USER SERVICE WHEN THE AVAILABLE / UNAVAILABLE BUTTON IS CLICKED
|
|
478
|
-
// this.usersService.availability_btn_clicked(true)
|
|
479
|
-
|
|
480
|
-
// if (this.project['id_project']._id === projectUser.id_project) {
|
|
481
|
-
// this.project['ws_projct_user_available'] = projectUser.user_available;
|
|
482
|
-
// // this.project['ws_projct_user_isBusy'] = projectUser['isBusy']
|
|
483
|
-
// }
|
|
484
|
-
|
|
485
446
|
}, (error) => {
|
|
486
447
|
this.logger.error('[SIDEBAR-USER-DETAILS] - PROJECT-USER UPDATED - ERROR ', error);
|
|
487
448
|
|
|
@@ -491,10 +452,19 @@ export class SidebarUserDetailsComponent implements OnInit, OnChanges {
|
|
|
491
452
|
});
|
|
492
453
|
}
|
|
493
454
|
|
|
455
|
+
goToUserProfile() {
|
|
456
|
+
let url = this.DASHBOARD_URL + this.projectID + '/user-profile'
|
|
457
|
+
const myWindow = window.open(url, '_self');
|
|
458
|
+
myWindow.focus();
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
goToHelpCenter() {
|
|
462
|
+
const url = "https://gethelp.tiledesk.com/"
|
|
463
|
+
window.open(url, '_blank');
|
|
464
|
+
}
|
|
465
|
+
|
|
494
466
|
public onLogout() {
|
|
495
|
-
// this.authService.logout();
|
|
496
467
|
this.closeUserDetailSidePanel()
|
|
497
|
-
// pubblico evento
|
|
498
468
|
this.events.publish('profileInfoButtonClick:logout', true);
|
|
499
469
|
}
|
|
500
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;
|