@chat21/chat21-ionic 3.0.65 → 3.0.68-rc.2

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 (66) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/deploy_amazon_prod.sh +6 -2
  3. package/package.json +1 -1
  4. package/src/app/app.component.ts +90 -56
  5. package/src/app/app.module.ts +4 -4
  6. package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.scss +8 -0
  7. package/src/app/chatlib/conversation-detail/message/info-message/info-message.component.ts +0 -2
  8. package/src/app/chatlib/conversation-detail/message/return-receipt/return-receipt.component.html +49 -4
  9. package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.ts +1 -3
  10. package/src/app/components/conversation-info/info-content/info-content.component.ts +22 -25
  11. package/src/app/components/ddp-header/ddp-header.component.html +20 -5
  12. package/src/app/components/ddp-header/ddp-header.component.ts +8 -0
  13. package/src/app/components/project-item/project-item.component.ts +26 -49
  14. package/src/app/components/sidebar/sidebar.component.ts +33 -56
  15. package/src/app/pages/conversation-detail/conversation-detail.page.ts +54 -106
  16. package/src/app/pages/conversations-list/conversations-list.page.html +3 -1
  17. package/src/app/pages/conversations-list/conversations-list.page.ts +48 -30
  18. package/src/app/pages/create-canned-response/create-canned-response.page.ts +22 -29
  19. package/src/app/pages/loader-preview/loader-preview.page.ts +12 -43
  20. package/src/app/services/websocket/websocket.service.ts +1 -1
  21. package/src/assets/i18n/ar.json +1 -1
  22. package/src/assets/i18n/az.json +266 -0
  23. package/src/assets/i18n/de.json +1 -1
  24. package/src/assets/i18n/en.json +1 -1
  25. package/src/assets/i18n/es.json +1 -1
  26. package/src/assets/i18n/fr.json +1 -1
  27. package/src/assets/i18n/it.json +1 -1
  28. package/src/assets/i18n/kk.json +266 -0
  29. package/src/assets/i18n/pt.json +1 -1
  30. package/src/assets/i18n/ru.json +1 -1
  31. package/src/assets/i18n/sr.json +1 -1
  32. package/src/assets/i18n/sv.json +266 -0
  33. package/src/assets/i18n/tr.json +1 -1
  34. package/src/assets/i18n/uk.json +266 -0
  35. package/src/assets/i18n/uz.json +267 -0
  36. package/src/assets/images/language_flag/az.png +0 -0
  37. package/src/assets/images/language_flag/kk.png +0 -0
  38. package/src/assets/images/language_flag/{sv-SE.png → sv.png} +0 -0
  39. package/src/assets/images/language_flag/uz.png +0 -0
  40. package/src/chat-config-mqtt-localhost.json +10 -3
  41. package/src/chat-config-pre.json +3 -1
  42. package/src/chat21-core/providers/abstract/archivedconversations-handler.service.ts +1 -2
  43. package/src/chat21-core/providers/abstract/conversations-handler.service.ts +4 -4
  44. package/src/chat21-core/providers/firebase/firebase-archivedconversations-handler.ts +3 -6
  45. package/src/chat21-core/providers/firebase/firebase-auth-service.ts +2 -8
  46. package/src/chat21-core/providers/firebase/firebase-conversation-handler.ts +4 -4
  47. package/src/chat21-core/providers/firebase/firebase-conversations-handler.ts +49 -10
  48. package/src/chat21-core/providers/firebase/firebase-groups-handler.ts +5 -5
  49. package/src/chat21-core/providers/firebase/firebase-image-repo.ts +2 -1
  50. package/src/chat21-core/providers/firebase/firebase-presence.service.ts +2 -3
  51. package/src/chat21-core/providers/firebase/firebase-typing.service.ts +2 -2
  52. package/src/chat21-core/providers/firebase/firebase-upload.service.ts +1 -1
  53. package/src/chat21-core/providers/mqtt/mqtt-archivedconversations-handler.ts +74 -274
  54. package/src/chat21-core/providers/mqtt/mqtt-auth-service.ts +26 -29
  55. package/src/chat21-core/providers/mqtt/mqtt-conversation-handler.ts +7 -28
  56. package/src/chat21-core/providers/mqtt/mqtt-conversations-handler.ts +24 -52
  57. package/src/chat21-core/providers/mqtt/mqtt-groups-handler.ts +11 -15
  58. package/src/chat21-core/providers/mqtt/mqtt-notifications.ts +88 -93
  59. package/src/chat21-core/providers/mqtt/mqtt-presence.service.ts +3 -2
  60. package/src/chat21-core/providers/mqtt/mqtt-typing.service.ts +5 -0
  61. package/src/chat21-core/providers/native/native-image-repo.ts +9 -2
  62. package/src/chat21-core/providers/native/native-upload-service.ts +3 -11
  63. package/src/chat21-core/providers/tiledesk/tiledesk-auth.service.ts +0 -2
  64. package/src/chat21-core/utils/constants.ts +1 -1
  65. package/src/chat21-core/utils/utils-message.ts +1 -1
  66. package/deploy_pre.sh +0 -44
@@ -2,7 +2,7 @@ import { EventsService } from './../../services/events-service';
2
2
  import { Component, EventEmitter, HostListener, OnInit, Output } from '@angular/core';
3
3
  import { WebsocketService } from 'src/app/services/websocket/websocket.service';
4
4
  import { Subject } from 'rxjs';
5
- import { takeUntil } from 'rxjs/operators';
5
+ import { takeUntil, skip } from 'rxjs/operators';
6
6
  import { AppStorageService } from 'src/chat21-core/providers/abstract/app-storage.service';
7
7
  import { LoggerService } from 'src/chat21-core/providers/abstract/logger.service';
8
8
  import { LoggerInstance } from 'src/chat21-core/providers/logger/loggerInstance';
@@ -66,6 +66,13 @@ export class ProjectItemComponent implements OnInit {
66
66
  this.isOnMobileDevice();
67
67
  }
68
68
 
69
+ ngOnDestroy() {
70
+ this.logger.log('[PROJECT-ITEM] > ngOnDestroy')
71
+ this.unsubscribe$.next()
72
+ this.unsubscribe$.complete()
73
+
74
+ }
75
+
69
76
  isOnMobileDevice() {
70
77
  this.IS_ON_MOBILE_DEVICE = false;
71
78
  if (/Android|iPhone/i.test(window.navigator.userAgent)) {
@@ -237,18 +244,13 @@ export class ProjectItemComponent implements OnInit {
237
244
  this.listenTocurrentProjectUserUserAvailability$(project)
238
245
 
239
246
  this.wsService.subscriptionToWsConversations(project.id_project._id)
240
- // this.updateCurrentUserRequestCount();
241
247
  this.updateUnservedRequestCount();
242
248
 
243
249
  }
244
250
  }
245
251
 
246
252
  listenTocurrentProjectUserUserAvailability$(project) {
247
- this.wsService.currentProjectUserAvailability$
248
- .pipe(
249
- takeUntil(this.unsubscribe$)
250
- )
251
- .subscribe((projectUser) => {
253
+ this.wsService.currentProjectUserAvailability$.pipe(takeUntil(this.unsubscribe$)).subscribe((projectUser) => {
252
254
  this.logger.log('[PROJECT-ITEM] - $UBSC TO WS USER AVAILABILITY & BUSY STATUS RES ', projectUser);
253
255
 
254
256
  if (project.id_project._id === projectUser['id_project']) {
@@ -300,24 +302,24 @@ export class ProjectItemComponent implements OnInit {
300
302
 
301
303
  updateUnservedRequestCount() {
302
304
 
303
- this.wsService.wsRequestsList$
304
- .subscribe((requests) => {
305
- if (requests) {
306
- let count = 0;
307
- requests.forEach(r => {
308
- if (r['status'] === 100) {
309
- if (this.hasmeInAgents(r['agents']) === true) {
310
- count = count + 1;
311
- }
305
+ this.wsService.wsRequestsList$.pipe(takeUntil(this.unsubscribe$)).pipe(skip(1)).subscribe((requests) => {
306
+ if (requests) {
307
+ let count = 0;
308
+ requests.forEach(r => {
309
+ if (r['status'] === 100) {
310
+ if (this.hasmeInAgents(r['agents']) === true) {
311
+ count = count + 1;
312
312
  }
313
- });
314
- this.unservedRequestCount = count;
315
- }
316
- }, error => {
317
- this.logger.error('[PROJECT-ITEM] UNSERVED REQUEST COUNT * error * ', error)
318
- }, () => {
319
- this.logger.log('[PROJECT-ITEM] UNSERVED REQUEST COUNT */* COMPLETE */*')
320
- })
313
+ }
314
+ });
315
+ this.unservedRequestCount = count;
316
+ this.events.publish('unservedRequest:count', this.unservedRequestCount)
317
+ }
318
+ }, error => {
319
+ this.logger.error('[PROJECT-ITEM] UNSERVED REQUEST COUNT * error * ', error)
320
+ }, () => {
321
+ this.logger.log('[PROJECT-ITEM] UNSERVED REQUEST COUNT */* COMPLETE */*')
322
+ })
321
323
  }
322
324
 
323
325
  hasmeInAgents(agents) {
@@ -332,31 +334,6 @@ export class ProjectItemComponent implements OnInit {
332
334
  }
333
335
  }
334
336
 
335
- updateCurrentUserRequestCount() {
336
- this.wsService.wsRequestsList$
337
- .pipe(
338
- takeUntil(this.unsubscribe$)
339
- )
340
- .subscribe((requests) => {
341
- if (requests) {
342
- let count = 0;
343
- requests.forEach(r => {
344
- const participantsArray = r['participants'] // new used with ws
345
-
346
- const currentUserIsInParticipants = participantsArray.includes(this.currentUserId); // new used with ws
347
- if (currentUserIsInParticipants === true) {
348
- count = count + 1;
349
- }
350
- });
351
- this.currentUserRequestCount = count;
352
- this.logger.log('[PROJECT-ITEM] CURRENT USER REQUEST COUNT - RES', this.currentUserRequestCount);
353
- }
354
- }, error => {
355
- this.logger.error('[PROJECT-ITEM] CURRENT USER REQUEST COUNT * error * ', error)
356
- }, () => {
357
- this.logger.log('[PROJECT-ITEM] CURRENT USER REQUEST COUNT */* COMPLETE */*')
358
- })
359
- }
360
337
 
361
338
 
362
339
 
@@ -127,6 +127,7 @@ export class SidebarComponent implements OnInit {
127
127
  this.photo_profile_URL = this.imageRepoService.getImagePhotoUrl(this.currentUser.uid)
128
128
  this.logger.log('[SIDEBAR] photo_profile_URL ', this.photo_profile_URL)
129
129
  this.checkIfExistPhotoProfile(this.photo_profile_URL)
130
+ this.checkAndRemoveDashboardForegroundCount()
130
131
  }
131
132
  } else {
132
133
  this.logger.error('[SIDEBAR] BSAuthStateChanged current user not found in storage')
@@ -149,6 +150,18 @@ export class SidebarComponent implements OnInit {
149
150
  })
150
151
  }
151
152
 
153
+ checkAndRemoveDashboardForegroundCount(){
154
+ try {
155
+ const dashboardForegroundCount = localStorage.getItem('dshbrd----foregroundcount')
156
+ this.logger.log('[SIDEBAR] - THERE IS DASHBOARD FOREGROUND COUNT', dashboardForegroundCount)
157
+ if (dashboardForegroundCount && dashboardForegroundCount !== 'undefined') {
158
+ localStorage.setItem('dshbrd----foregroundcount', '0')
159
+ }
160
+ } catch (err) {
161
+ this.logger.error('Get local storage dshbrd----foregroundcount ', err)
162
+ }
163
+ }
164
+
152
165
  createUserAvatar(currentUser) {
153
166
  this.logger.log('[SIDEBAR] - createProjectUserAvatar ', currentUser)
154
167
  let fullname = ''
@@ -220,62 +233,26 @@ export class SidebarComponent implements OnInit {
220
233
 
221
234
 
222
235
  translateLabels() {
223
- this.getConversationsTranslation();
224
- this.getContactsTranslation();
225
- this.getActivitiesTranslation();
226
- this.getAppsTranslation();
227
- this.getAnalyticsTranslation();
228
- this.getHistoryTranslation();
229
- this.getSettingsTranslation()
230
- }
231
-
232
- getConversationsTranslation() {
233
- this.translate.get('Conversations')
234
- .subscribe((text: string) => {
235
- this.conversations_lbl = text
236
- });
237
- }
238
-
239
- getContactsTranslation() {
240
- this.translate.get('LABEL_CONTACTS')
241
- .subscribe((text: string) => {
242
- this.contacts_lbl = text
243
- });
244
- }
245
-
246
- getAppsTranslation() {
247
- this.translate.get('Apps')
248
- .subscribe((text: string) => {
249
- this.apps_lbl = text
250
- });
251
- }
252
-
253
- getAnalyticsTranslation() {
254
- this.translate.get('Analytics')
255
- .subscribe((text: string) => {
256
- this.analytics_lbl = text
257
- });
258
- }
259
-
260
- getActivitiesTranslation() {
261
- this.translate.get('Activities')
262
- .subscribe((text: string) => {
263
- this.activities_lbl = text
264
- });
265
- }
266
-
267
- getHistoryTranslation() {
268
- this.translate.get('History')
269
- .subscribe((text: string) => {
270
- this.history_lbl = text
271
- });
272
- }
273
-
274
- getSettingsTranslation() {
275
- this.translate.get('Settings')
276
- .subscribe((text: string) => {
277
- this.settings_lbl = text
278
- });
236
+ const keys= [
237
+ 'Conversations',
238
+ 'LABEL_CONTACTS',
239
+ 'Apps',
240
+ 'Analytics',
241
+ 'Activities',
242
+ 'History',
243
+ 'Settings'
244
+ ]
245
+
246
+ this.translate.get(keys).subscribe((text: string) => {
247
+ this.conversations_lbl = text['Conversations'];
248
+ this.contacts_lbl = text['LABEL_CONTACTS']
249
+ this.apps_lbl = text['Apps']
250
+ this.analytics_lbl = text['Analytics']
251
+ this.activities_lbl = text['Activities']
252
+ this.history_lbl = text['History']
253
+ this.settings_lbl = text['Settings']
254
+
255
+ });
279
256
  }
280
257
 
281
258
  getOSCODE() {
@@ -259,7 +259,7 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
259
259
  listenToDsbrdPostMsgs() {
260
260
 
261
261
  window.addEventListener("message", (event) => {
262
- this.logger.log("[CONVS-DETAIL] message event ", event);
262
+ // this.logger.log("[CONVS-DETAIL] message event ", event);
263
263
 
264
264
  // const chat21InfoConversationEle = <HTMLElement>document.querySelector('#chat21-info-conversation');
265
265
  // console.log('[CONVS-DETAIL] HAS CLICKED ENLARGE SIDEBAR WIDE chat21InfoConversationEle ', chat21InfoConversationEle)
@@ -531,55 +531,33 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
531
531
  _getProjectIdByConversationWith(conversationWith: string) {
532
532
  const tiledeskToken = this.tiledeskAuthService.getTiledeskToken()
533
533
 
534
- this.tiledeskService
535
- .getProjectIdByConvRecipient(tiledeskToken, conversationWith)
536
- .subscribe(
537
- (res) => {
538
- this.logger.log('[CONVS-DETAIL] - GET PROJECTID BY CONV RECIPIENT RES', res)
539
- if (res) {
540
- const projectId = res.id_project
541
- this.logger.log('[CONVS-DETAIL] - GET PROJECTID BY CONV RECIPIENT projectId ', projectId)
542
- this.getProjectById(tiledeskToken, projectId)
543
- }
544
- },
545
- (error) => {
546
- this.logger.error('[CONVS-DETAIL] - GET PROJECTID BY CONV RECIPIENT - ERROR ', error)
547
- },
548
- () => {
549
- this.logger.log(
550
- '[CONVS-DETAIL] - GET PROJECTID BY CONV RECIPIENT * COMPLETE *',
551
- )
552
- },
553
- )
534
+ this.tiledeskService.getProjectIdByConvRecipient(tiledeskToken, conversationWith).subscribe((res) => {
535
+ this.logger.log('[CONVS-DETAIL] - GET PROJECTID BY CONV RECIPIENT RES + projectId', res, res.id_project)
536
+ if (res) {
537
+ const projectId = res.id_project
538
+ this.getProjectById(tiledeskToken, projectId)
539
+ }
540
+ },(error) => {
541
+ this.logger.error('[CONVS-DETAIL] - GET PROJECTID BY CONV RECIPIENT - ERROR ', error)
542
+ },() => {
543
+ this.logger.log('[CONVS-DETAIL] - GET PROJECTID BY CONV RECIPIENT * COMPLETE *',)
544
+ })
554
545
  }
555
546
 
556
547
  getProjectById(tiledeskToken, projectId) {
557
- this.tiledeskService.getProjectById(tiledeskToken, projectId).subscribe(
558
- (res) => {
559
- this.logger.log('[CONVS-DETAIL] - GET PROJECTID BY CONV RECIPIENT RES', res)
560
- if (res) {
561
- const projectId = res.id_project
562
- this.logger.log(
563
- '[CONVS-DETAIL] - GET PROJECTID BY CONV RECIPIENT projectId ',
564
- projectId,
565
- )
566
- }
567
- },
568
- (error) => {
569
- this.logger.error(
570
- '[CONVS-DETAIL] - GET PROJECTID BY CONV RECIPIENT - ERROR ',
571
- error,
572
- )
573
- if ((error.error.msg = 'you dont belong to the project.')) {
574
- this.disableTextarea = true
575
- }
576
- },
577
- () => {
578
- this.logger.log(
579
- '[CONVS-DETAIL] - GET PROJECTID BY CONV RECIPIENT * COMPLETE *',
580
- )
581
- },
582
- )
548
+ this.tiledeskService.getProjectById(tiledeskToken, projectId).subscribe((res) => {
549
+ this.logger.log('[CONVS-DETAIL] - GET PROJECTID BY CONV RECIPIENT RES', res)
550
+ if (res) {
551
+ const projectId = res.id_project
552
+ }
553
+ },(error) => {
554
+ this.logger.error('[CONVS-DETAIL] - GET PROJECTID BY CONV RECIPIENT - ERROR ',error)
555
+ if ((error.error.msg = 'you dont belong to the project.')) {
556
+ this.disableTextarea = true
557
+ }
558
+ },() => {
559
+ this.logger.log('[CONVS-DETAIL] - GET PROJECTID BY CONV RECIPIENT * COMPLETE *')
560
+ })
583
561
  }
584
562
 
585
563
  returnOpenCloseInfoConversation(openInfoConversation: boolean) {
@@ -1251,45 +1229,36 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
1251
1229
  conversationWith_segments.pop()
1252
1230
  }
1253
1231
 
1254
- if (conversationWith_segments.length === 4) {
1255
- const lastArrayElement = conversationWith_segments[conversationWith_segments.length - 1]
1256
- this.logger.log('[CONVS-DETAIL] - lastArrayElement ', lastArrayElement)
1257
- this.logger.log('[CONVS-DETAIL] - lastArrayElement length', lastArrayElement.length)
1258
- if (lastArrayElement.length !== 32) {
1259
- conversationWith_segments.pop()
1260
- }
1261
- }
1262
-
1263
1232
  this.logger.log('[CONVS-DETAIL] - loadTagsCanned conversationWith_segments ', conversationWith_segments)
1264
1233
  let projectId = ''
1265
1234
 
1266
- if (conversationWith_segments.length === 4) {
1235
+ // if (conversationWith_segments.length === 4) {
1267
1236
  projectId = conversationWith_segments[2]
1268
1237
  this.logger.log('[CONVS-DETAIL] - loadTagsCanned projectId ', projectId)
1269
1238
  this.getAndShowCannedResponses(strSearch, projectId)
1270
- } else {
1271
- this.getProjectIdByConversationWith(strSearch, this.conversationWith)
1272
- }
1239
+ // } else {
1240
+ // this.getProjectIdByConversationWith(strSearch, this.conversationWith)
1241
+ // }
1273
1242
  }
1274
1243
 
1275
- getProjectIdByConversationWith(strSearch, conversationWith: string) {
1276
- const tiledeskToken = this.tiledeskAuthService.getTiledeskToken()
1277
-
1278
- this.tiledeskService.getProjectIdByConvRecipient(tiledeskToken, conversationWith).subscribe((res) => {
1279
- this.logger.log('[CONVS-DETAIL] - loadTagsCanned - GET PROJECTID BY CONV RECIPIENT RES', res)
1280
- if (res) {
1281
- const projectId = res.id_project
1282
- this.logger.log('[CONVS-DETAIL] - loadTagsCanned - GET PROJECTID BY CONV RECIPIENT projectId ', projectId)
1283
- if (projectId) {
1284
- this.getAndShowCannedResponses(strSearch, projectId)
1285
- }
1286
- }
1287
- }, (error) => {
1288
- this.logger.error('[CONVS-DETAIL] - loadTagsCanned - GET PROJECTID BY CONV RECIPIENT - ERROR ', error)
1289
- }, () => {
1290
- this.logger.log('[CONVS-DETAIL] - loadTagsCanned - GET PROJECTID BY CONV RECIPIENT * COMPLETE *')
1291
- })
1292
- }
1244
+ // getProjectIdByConversationWith(strSearch, conversationWith: string) {
1245
+ // const tiledeskToken = this.tiledeskAuthService.getTiledeskToken()
1246
+
1247
+ // this.tiledeskService.getProjectIdByConvRecipient(tiledeskToken, conversationWith).subscribe((res) => {
1248
+ // this.logger.log('[CONVS-DETAIL] - loadTagsCanned - GET PROJECTID BY CONV RECIPIENT RES', res)
1249
+ // if (res) {
1250
+ // const projectId = res.id_project
1251
+ // this.logger.log('[CONVS-DETAIL] - loadTagsCanned - GET PROJECTID BY CONV RECIPIENT projectId ', projectId)
1252
+ // if (projectId) {
1253
+ // this.getAndShowCannedResponses(strSearch, projectId)
1254
+ // }
1255
+ // }
1256
+ // }, (error) => {
1257
+ // this.logger.error('[CONVS-DETAIL] - loadTagsCanned - GET PROJECTID BY CONV RECIPIENT - ERROR ', error)
1258
+ // }, () => {
1259
+ // this.logger.log('[CONVS-DETAIL] - loadTagsCanned - GET PROJECTID BY CONV RECIPIENT * COMPLETE *')
1260
+ // })
1261
+ // }
1293
1262
 
1294
1263
  getAndShowCannedResponses(strSearch, projectId) {
1295
1264
  const tiledeskToken = this.tiledeskAuthService.getTiledeskToken()
@@ -1786,43 +1755,22 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
1786
1755
  }
1787
1756
  checkAcceptedFile(draggedFileMimeType) {
1788
1757
  let isAcceptFile = false
1789
- this.logger.log(
1790
- '[CONVS-DETAIL] > checkAcceptedFile - fileUploadAccept: ',
1791
- this.appConfigProvider.getConfig().fileUploadAccept,
1792
- )
1758
+ this.logger.log('[CONVS-DETAIL] > checkAcceptedFile - fileUploadAccept: ',this.appConfigProvider.getConfig().fileUploadAccept)
1793
1759
  const accept_files = this.appConfigProvider.getConfig().fileUploadAccept
1794
- this.logger.log(
1795
- '[CONVS-DETAIL] > checkAcceptedFile - mimeType: ',
1796
- draggedFileMimeType,
1797
- )
1760
+ this.logger.log('[CONVS-DETAIL] > checkAcceptedFile - mimeType: ',draggedFileMimeType)
1798
1761
  if (accept_files === '*/*') {
1799
1762
  isAcceptFile = true
1800
1763
  return isAcceptFile
1801
1764
  } else if (accept_files !== '*/*') {
1802
- this.logger.log(
1803
- '[CONVS-DETAIL] > checkAcceptedFile - fileUploadAccept typeof accept_files ',
1804
- typeof accept_files,
1805
- )
1765
+ this.logger.log( '[CONVS-DETAIL] > checkAcceptedFile - fileUploadAccept typeof accept_files ',typeof accept_files)
1806
1766
  const accept_files_array = accept_files.split(',')
1807
- this.logger.log(
1808
- '[CONVS-DETAIL] > checkAcceptedFile - fileUploadAccept accept_files_array ',
1809
- accept_files_array,
1810
- )
1811
- this.logger.log(
1812
- '[CONVS-DETAIL] > checkAcceptedFile - fileUploadAccept accept_files_array typeof: ',
1813
- typeof accept_files_array,
1814
- )
1767
+ this.logger.log('[CONVS-DETAIL] > checkAcceptedFile - fileUploadAccept accept_files_array ',accept_files_array)
1768
+ this.logger.log('[CONVS-DETAIL] > checkAcceptedFile - fileUploadAccept accept_files_array typeof: ',typeof accept_files_array)
1815
1769
 
1816
1770
  accept_files_array.forEach((accept_file) => {
1817
- this.logger.log(
1818
- '[CONVS-DETAIL] > checkAcceptedFile - fileUploadAccept accept_file ',
1819
- accept_file,
1820
- )
1771
+ this.logger.log('[CONVS-DETAIL] > checkAcceptedFile - fileUploadAccept accept_file ',accept_file)
1821
1772
  const accept_file_segment = accept_file.split('/')
1822
- this.logger.log(
1823
- '[CONVS-DETAIL] > checkAcceptedFile - fileUploadAccept accept_file_segment ',
1824
- accept_file_segment,
1825
- )
1773
+ this.logger.log('[CONVS-DETAIL] > checkAcceptedFile - fileUploadAccept accept_file_segment ',accept_file_segment)
1826
1774
  if (accept_file_segment[1] === '*') {
1827
1775
  if (draggedFileMimeType.startsWith(accept_file_segment[0])) {
1828
1776
  isAcceptFile = true
@@ -4,12 +4,14 @@
4
4
  [supportMode]="supportMode"
5
5
  [archived_btn]="archived_btn"
6
6
  [writeto_btn]="writeto_btn"
7
+ [sound_btn]="sound_btn"
8
+ (onSoundChange)="onSoundChange($event)"
7
9
  (openContactsDirectory)=openContactsDirectory($event)
8
10
  (openProfileInfo)=openProfileInfo($event)>
9
11
  </app-ddp-header>
10
12
 
11
13
  <app-option-header *ngIf="conversationType !=='active'"
12
- [headerTitle]=headerTitle
14
+ [headerTitle]=headerTitle
13
15
  (onBackButton)=onBackButtonFN($event)>
14
16
  </app-option-header>
15
17
  </ion-header>
@@ -72,6 +72,7 @@ export class ConversationListPage implements OnInit {
72
72
  public supportMode: boolean
73
73
  public writeto_btn: boolean
74
74
  public archived_btn: boolean
75
+ public sound_btn: string
75
76
  public convertMessage = convertMessage
76
77
  private isShowMenuPage = false
77
78
  private logger: LoggerService = LoggerInstance.getInstance()
@@ -127,6 +128,7 @@ export class ConversationListPage implements OnInit {
127
128
  this.listenToLogoutEvent()
128
129
  this.listenGoOnline()
129
130
  this.listenGoOffline()
131
+ this.listenToStorageChange()
130
132
  this.listenToSwPostMessage()
131
133
  this.listenSupportConvIdHasChanged()
132
134
  // this.listenDirectConvIdHasChanged();
@@ -190,27 +192,31 @@ export class ConversationListPage implements OnInit {
190
192
  this.supportMode = null
191
193
  if (appConfig && appConfig.supportMode === true || appConfig.supportMode === 'true') {
192
194
  this.supportMode = true;
193
- this.logger.log('[CONVS-LIST-PAGE] getAppConfigToHideDiplayBtns supportMode ', this.supportMode)
194
195
  } else if (appConfig && appConfig.supportMode === false || appConfig.supportMode === 'false') {
195
196
  this.supportMode = false
196
- this.logger.log('[CONVS-LIST-PAGE] getAppConfigToHideDiplayBtns supportMode ', this.supportMode)
197
197
  }
198
198
  this.archived_btn = null
199
199
  if (appConfig && appConfig.archivedButton === true || appConfig.archivedButton === 'true') {
200
200
  this.archived_btn = true;
201
- this.logger.log('[CONVS-LIST-PAGE] getAppConfigToHideDiplayBtns archived_btn ', this.archived_btn)
202
201
  } else if (appConfig && appConfig.archivedButton === false || appConfig.archivedButton === 'false') {
203
202
  this.archived_btn = false;
204
- this.logger.log('[CONVS-LIST-PAGE] getAppConfigToHideDiplayBtns archived_btn ', this.archived_btn)
205
203
  }
206
204
  this.writeto_btn = null
207
205
  if (appConfig && appConfig.writeToButton === true || appConfig.writeToButton === 'true') {
208
206
  this.writeto_btn = true;
209
- this.logger.log('[CONVS-LIST-PAGE] getAppConfigToHideDiplayBtns writeto_btn ', this.writeto_btn)
210
207
  } else if (appConfig && appConfig.writeToButton === false || appConfig.writeToButton === 'false') {
211
208
  this.writeto_btn = false;
212
- this.logger.log('[CONVS-LIST-PAGE] getAppConfigToHideDiplayBtns writeto_btn ', this.writeto_btn)
213
209
  }
210
+
211
+
212
+ const sound_status = localStorage.getItem('dshbrd----sound')
213
+ if(sound_status && sound_status !== 'undefined'){
214
+ this.sound_btn = sound_status
215
+ } else {
216
+ this.sound_btn = 'enabled'
217
+ }
218
+
219
+
214
220
  }
215
221
 
216
222
  watchToConnectionStatus() {
@@ -336,6 +342,8 @@ export class ConversationListPage implements OnInit {
336
342
  })
337
343
  }
338
344
 
345
+
346
+
339
347
  // ------------------------------------------------------------------ //
340
348
  // Init convrsation handler
341
349
  // ------------------------------------------------------------------ //
@@ -435,6 +443,10 @@ export class ConversationListPage implements OnInit {
435
443
  })
436
444
  }
437
445
 
446
+ listenToStorageChange(){
447
+ this.events.subscribe('storage:sound', value => this.sound_btn = value)
448
+ }
449
+
438
450
  // ------------------------------------------------------------------
439
451
  // SUBSCRIPTIONS
440
452
  // ------------------------------------------------------------------
@@ -661,7 +673,6 @@ export class ConversationListPage implements OnInit {
661
673
  setUidConvSelected(uidConvSelected: string, conversationType?: string) {
662
674
  this.logger.log('[CONVS-LIST-PAGE] setuidCOnvSelected', uidConvSelected)
663
675
  this.uidConvSelected = uidConvSelected
664
- this.logger.log('uidConvSelected', uidConvSelected)
665
676
  // this.conversationsHandlerService.uidConvSelected = uidConvSelected;
666
677
  if (uidConvSelected) {
667
678
  let conversationSelected
@@ -839,6 +850,13 @@ export class ConversationListPage implements OnInit {
839
850
  }
840
851
  }
841
852
 
853
+ onSoundChange(event: string){
854
+ if(event && event !== undefined){
855
+ localStorage.setItem('dshbrd----sound', event)
856
+ this.sound_btn = event
857
+ }
858
+ }
859
+
842
860
  listenToCloseConvFromHeaderConversation() {
843
861
  this.events.subscribe('conversation:closed', (convId) => {
844
862
  this.logger.log('[CONVS-LIST-PAGE] hasclosedconversation convId', convId)
@@ -884,44 +902,44 @@ export class ConversationListPage implements OnInit {
884
902
  conversationWith_segments[conversationWith_segments.length - 1]
885
903
  this.logger.log('[CONVS-LIST-PAGE] - lastArrayElement ',lastArrayElement)
886
904
  this.logger.log('[CONVS-LIST-PAGE] - lastArrayElement length',lastArrayElement.length)
887
- if (lastArrayElement.length !== 32) {
888
- conversationWith_segments.pop()
889
- }
905
+ // if (lastArrayElement.length !== 32) {
906
+ // conversationWith_segments.pop()
907
+ // }
890
908
  }
891
909
 
892
910
  if (conversationId.startsWith('support-group')) {
893
911
  let project_id = ''
894
- if (conversationWith_segments.length === 4) {
912
+ // if (conversationWith_segments.length === 4) {
895
913
  project_id = conversationWith_segments[2]
896
914
 
897
915
  const tiledeskToken = this.tiledeskAuthService.getTiledeskToken()
898
916
  this.archiveSupportGroupConv(tiledeskToken,project_id,conversationId,)
899
- } else {
900
- this.getProjectIdByConversationWith(conversationId)
901
- }
917
+ // } else {
918
+ // this.getProjectIdByConversationWith(conversationId)
919
+ // }
902
920
  } else {
903
921
  this.conversationsHandlerService.archiveConversation(conversationId)
904
922
  }
905
923
  }
906
924
  }
907
925
 
908
- getProjectIdByConversationWith(conversationId: string) {
909
- const tiledeskToken = this.tiledeskAuthService.getTiledeskToken()
926
+ // getProjectIdByConversationWith(conversationId: string) {
927
+ // const tiledeskToken = this.tiledeskAuthService.getTiledeskToken()
910
928
 
911
- this.tiledeskService.getProjectIdByConvRecipient(tiledeskToken, conversationId).subscribe((res) => {
912
- this.logger.log('[CONVS-LIST-PAGE] - GET PROJECTID BY CONV RECIPIENT RES',res)
929
+ // this.tiledeskService.getProjectIdByConvRecipient(tiledeskToken, conversationId).subscribe((res) => {
930
+ // this.logger.log('[CONVS-LIST-PAGE] - GET PROJECTID BY CONV RECIPIENT RES',res)
913
931
 
914
- if (res) {
915
- const project_id = res.id_project
916
- this.logger.log('[INFO-CONTENT-COMP] - GET PROJECTID BY CONV RECIPIENT project_id',project_id)
917
- this.archiveSupportGroupConv(tiledeskToken,project_id,conversationId)
918
- }
919
- },(error) => {
920
- this.logger.error('[CONVS-LIST-PAGE] - GET PROJECTID BY CONV RECIPIENT - ERROR ',error)
921
- },() => {
922
- this.logger.log('[CONVS-LIST-PAGE] - GET PROJECTID BY CONV RECIPIENT * COMPLETE *')
923
- })
924
- }
932
+ // if (res) {
933
+ // const project_id = res.id_project
934
+ // this.logger.log('[INFO-CONTENT-COMP] - GET PROJECTID BY CONV RECIPIENT project_id',project_id)
935
+ // this.archiveSupportGroupConv(tiledeskToken,project_id,conversationId)
936
+ // }
937
+ // },(error) => {
938
+ // this.logger.error('[CONVS-LIST-PAGE] - GET PROJECTID BY CONV RECIPIENT - ERROR ',error)
939
+ // },() => {
940
+ // this.logger.log('[CONVS-LIST-PAGE] - GET PROJECTID BY CONV RECIPIENT * COMPLETE *')
941
+ // })
942
+ // }
925
943
 
926
944
  archiveSupportGroupConv(tiledeskToken, project_id, conversationId) {
927
945
  this.logger.log('[CONVS-LIST-PAGE] - onCloseConversation projectId: ',project_id)
@@ -937,7 +955,7 @@ export class ConversationListPage implements OnInit {
937
955
  }
938
956
  },() => {
939
957
  this.logger.log('[CONVS-LIST-PAGE] - onCloseConversation closeSupportGroup * COMPLETE *')
940
- this.logger.log('[CONVS-LIST-PAGE] - onCloseConversation (closeSupportGroup) CONVS ',this.conversations)
958
+ this.logger.log('[CONVS-LIST-PAGE] - onCloseConversation (closeSupportGroup) ID ',this.uidConvSelected, conversationId)
941
959
  this.logger.log('[CONVS-LIST-PAGE] - onCloseConversation (closeSupportGroup) CONVS LENGHT ',this.conversations.length)
942
960
  this.events.publish('conversationhasbeenclosed', conversationId)
943
961
  if(conversationId === this.uidConvSelected){