@chat21/chat21-ionic 3.0.61 → 3.0.63
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 +39 -0
- package/README.md +6 -2
- 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.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 +62 -8
- 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-pre-test.json +3 -2
- package/src/chat-config-pre.json +15 -3
- 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
|
@@ -143,6 +143,10 @@ button.user-details-btn-close {
|
|
|
143
143
|
font-family: "Poppins";
|
|
144
144
|
font-weight: 500;
|
|
145
145
|
line-height: 24px;
|
|
146
|
+
white-space: nowrap;
|
|
147
|
+
overflow: hidden;
|
|
148
|
+
text-overflow: ellipsis;
|
|
149
|
+
width: 260px;
|
|
146
150
|
}
|
|
147
151
|
|
|
148
152
|
.user-details-email {
|
|
@@ -156,11 +160,15 @@ button.user-details-btn-close {
|
|
|
156
160
|
.user-details-email > h3 {
|
|
157
161
|
font-size: 14px;
|
|
158
162
|
text-align: center;
|
|
159
|
-
margin-top:
|
|
163
|
+
margin-top: 1px;
|
|
160
164
|
font-family: "Poppins";
|
|
161
165
|
font-weight: 400;
|
|
162
|
-
line-height:
|
|
166
|
+
line-height: 19px;
|
|
163
167
|
white-space: nowrap;
|
|
168
|
+
white-space: nowrap;
|
|
169
|
+
overflow: hidden;
|
|
170
|
+
text-overflow: ellipsis;
|
|
171
|
+
width: 260px;
|
|
164
172
|
}
|
|
165
173
|
|
|
166
174
|
.user-details-role {
|
|
@@ -169,6 +177,7 @@ button.user-details-btn-close {
|
|
|
169
177
|
-webkit-transform: translateX(-50%);
|
|
170
178
|
transform: translateX(-50%);
|
|
171
179
|
left: 50%;
|
|
180
|
+
text-align: center;
|
|
172
181
|
}
|
|
173
182
|
|
|
174
183
|
.user-details-role > h3 {
|
|
@@ -179,10 +188,21 @@ button.user-details-btn-close {
|
|
|
179
188
|
color: #a9afbb;
|
|
180
189
|
font-weight: 500;
|
|
181
190
|
font-family: "Roboto", sans-serif !important;
|
|
191
|
+
margin-bottom: 8px !important;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
.user-details-view-profile {
|
|
195
|
+
font-size: 14px;
|
|
196
|
+
color: #00d5ff;
|
|
197
|
+
cursor: pointer;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
.user-details-view-profile:hover {
|
|
201
|
+
text-decoration: underline;
|
|
182
202
|
}
|
|
183
203
|
|
|
184
204
|
.availability-section {
|
|
185
|
-
top:
|
|
205
|
+
top: 320px;
|
|
186
206
|
text-align: center;
|
|
187
207
|
background-color: #2d323e;
|
|
188
208
|
padding: 9px;
|
|
@@ -196,7 +216,7 @@ button.user-details-btn-close {
|
|
|
196
216
|
}
|
|
197
217
|
|
|
198
218
|
.first-divider {
|
|
199
|
-
margin-top:
|
|
219
|
+
margin-top: 365px;
|
|
200
220
|
border: 0;
|
|
201
221
|
border-top: 1px solid rgba(255, 255, 255, 0.2);
|
|
202
222
|
margin-bottom: 20px;
|
|
@@ -246,6 +266,37 @@ button.user-details-btn-close {
|
|
|
246
266
|
line-height: 21px;
|
|
247
267
|
}
|
|
248
268
|
|
|
269
|
+
.user-details-plan-icon {
|
|
270
|
+
display: block;
|
|
271
|
+
float: left;
|
|
272
|
+
font-size: 20px;
|
|
273
|
+
margin-right: 6px;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
|
|
277
|
+
|
|
278
|
+
.user-details-help-center-icon {
|
|
279
|
+
color: #a9afbb;
|
|
280
|
+
font-size: 20px;
|
|
281
|
+
vertical-align: middle;
|
|
282
|
+
margin-right: 3px;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
.user-details-help-center {
|
|
286
|
+
margin-top: 6px;
|
|
287
|
+
font-size: 13px;
|
|
288
|
+
font-weight: 500;
|
|
289
|
+
color: #a9afbb;
|
|
290
|
+
-webkit-font-smoothing: antialiased;
|
|
291
|
+
vertical-align: middle;
|
|
292
|
+
cursor: pointer;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
.user-details-help-center:hover {
|
|
296
|
+
color: #fff;
|
|
297
|
+
text-decoration: underline;
|
|
298
|
+
}
|
|
299
|
+
|
|
249
300
|
.user-details-footer-section {
|
|
250
301
|
-webkit-transform: translateX(-50%);
|
|
251
302
|
transform: translateX(-50%);
|
|
@@ -255,12 +306,13 @@ button.user-details-btn-close {
|
|
|
255
306
|
text-align: center;
|
|
256
307
|
|
|
257
308
|
padding-bottom: 15px;
|
|
258
|
-
padding-top:
|
|
309
|
+
padding-top: 186px;
|
|
259
310
|
font-size: 16px;
|
|
260
311
|
font-weight: 400;
|
|
312
|
+
z-index: 1;
|
|
261
313
|
// bottom: 50px;
|
|
262
|
-
bottom: 55px;
|
|
263
|
-
|
|
314
|
+
// bottom: 55px;
|
|
315
|
+
|
|
264
316
|
}
|
|
265
317
|
|
|
266
318
|
.logout-btn-wpr {
|
|
@@ -282,7 +334,7 @@ button.user-details-btn-close {
|
|
|
282
334
|
|
|
283
335
|
.user-details-footer-chat-version {
|
|
284
336
|
position: absolute;
|
|
285
|
-
bottom: 11px;
|
|
337
|
+
// bottom: 11px;
|
|
286
338
|
text-align: center;
|
|
287
339
|
margin: auto;
|
|
288
340
|
transform: translateX(-50%);
|
|
@@ -290,6 +342,8 @@ button.user-details-btn-close {
|
|
|
290
342
|
margin: auto;
|
|
291
343
|
font-size: 12px;
|
|
292
344
|
font-weight: 400;
|
|
345
|
+
padding-top: 300px;
|
|
346
|
+
padding-bottom: 6px;
|
|
293
347
|
}
|
|
294
348
|
|
|
295
349
|
:host ::ng-deep .mat-slide-toggle.mat-checked:not(.mat-disabled) .mat-slide-toggle-bar {
|
|
@@ -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
|
|