@chat21/chat21-ionic 3.0.64 → 3.0.65

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 (52) hide show
  1. package/CHANGELOG.md +34 -2
  2. package/deploy_amazon_beta.sh +0 -0
  3. package/deploy_amazon_prod.sh +1 -0
  4. package/deploy_pre.sh +39 -6
  5. package/package.json +8 -3
  6. package/publiccode.yml +110 -0
  7. package/src/app/app.component.ts +40 -66
  8. package/src/app/app.module.ts +1 -0
  9. package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.html +2 -2
  10. package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.scss +0 -1
  11. package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.ts +2 -39
  12. package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.html +18 -6
  13. package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.ts +1 -11
  14. package/src/app/chatlib/conversation-detail/message/html/html.component.html +1 -0
  15. package/src/app/chatlib/conversation-detail/message/html/html.component.scss +79 -0
  16. package/src/app/chatlib/conversation-detail/message/html/html.component.spec.ts +25 -0
  17. package/src/app/chatlib/conversation-detail/message/html/html.component.ts +33 -0
  18. package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.html +1 -1
  19. package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.ts +18 -30
  20. package/src/app/chatlib/list-conversations-component/list-conversations/list-conversations.component.ts +0 -1
  21. package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.html +7 -5
  22. package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.scss +21 -0
  23. package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component_2.html +116 -0
  24. package/src/app/components/conversation-detail/message-text-area/message-text-area.component.html +2 -2
  25. package/src/app/components/conversation-detail/message-text-area/message-text-area.component.ts +2 -2
  26. package/src/app/components/project-item/project-item.component.ts +5 -0
  27. package/src/app/components/sidebar/sidebar.component.ts +8 -15
  28. package/src/app/components/sidebar-user-details/sidebar-user-details.component.html +12 -23
  29. package/src/app/components/sidebar-user-details/sidebar-user-details.component.scss +3 -0
  30. package/src/app/components/sidebar-user-details/sidebar-user-details.component.ts +88 -136
  31. package/src/app/directives/safe-html.pipe.ts +2 -2
  32. package/src/app/directives/truncate.pipe.spec.ts +8 -0
  33. package/src/app/directives/truncate.pipe.ts +15 -0
  34. package/src/app/pages/authentication/login/login.page.ts +0 -1
  35. package/src/app/pages/conversation-detail/conversation-detail.module.ts +3 -2
  36. package/src/app/pages/conversation-detail/conversation-detail.page.html +4 -2
  37. package/src/app/pages/conversation-detail/conversation-detail.page.ts +56 -71
  38. package/src/app/pages/conversations-list/conversations-list.page.html +21 -12
  39. package/src/app/pages/conversations-list/conversations-list.page.ts +129 -367
  40. package/src/app/pages/loader-preview/loader-preview.module.ts +1 -2
  41. package/src/app/shared/shared.module.ts +4 -0
  42. package/src/assets/i18n/ar.json +266 -0
  43. package/src/assets/js/chat21client.js +58 -60
  44. package/src/chat21-core/models/conversation.ts +2 -2
  45. package/src/chat21-core/providers/abstract/conversations-handler.service.ts +1 -1
  46. package/src/chat21-core/providers/firebase/firebase-archivedconversations-handler.ts +26 -21
  47. package/src/chat21-core/providers/firebase/firebase-conversations-handler.ts +78 -23
  48. package/src/chat21-core/providers/mqtt/mqtt-conversations-handler.ts +16 -13
  49. package/src/chat21-core/utils/constants.ts +1 -1
  50. package/src/chat21-core/utils/utils-message.ts +2 -3
  51. package/src/global.scss +2 -2
  52. package/deploy_prod.sh +0 -11
package/CHANGELOG.md CHANGED
@@ -1,8 +1,40 @@
1
1
  # chat21-ionic ver 3.0
2
2
 
3
- ### 3.0.64
3
+ ### 3.0.65 in PROD
4
+ - bug-fixed: icons in sidebar were not alignet correctly on Safari
5
+ - bug-fixed: missing translations on sidebar-detail component and login-modal page on start when user logged in for the first time
6
+ - bug-fixed: some icons not showed in side-bar user detail component: replaced material-design-icons with material-icons
7
+ - bug-fixed: if removed conversation.uid is the selected ones, change url from /active to /archived with navigateByUrl after archivedConversation is completed
8
+ - bug-fixed: truncate sender_fullname in conversation-list and conversation-detail header components
9
+ - added: arabic translations language
10
+ - changed: behaviour of is_new of a conversation (not update 'is_new' conversation property if conv is the selected one or if sender is me)
11
+
12
+ ### 3.0.65-rc3 - LATEST
13
+ - changed: retrive conversations with 'onces' firebase event and remove lastTimestamp from added, changed and removed fireabase subscriptions event
14
+ - bug-fixed: conversation not archived due to conversation_removed unhandled event
15
+ - bug-fixed: if removed conversation.uid is the selected ones, change url from /active to /archived with navigateByUrl after archivedConversation is completed
16
+
17
+
18
+ ### 3.0.65-rc2 - LATEST
19
+ - changed: behaviour of is_new of a conversation (not update 'is_new' conversation property if conv is the selected one or if sender is me)
20
+
21
+ ### 3.0.65-rc1 - LATEST
22
+ - added: improves chat performance by caching conversations
23
+ - added: Displays balloon messages with a light orange background for "internal notes" type message
24
+ - added: the html component
25
+ - bug-fixed: if archive conversation and do a refresh, url not change from active to archived
26
+ - bug-fixed: truncate sender_fullname in conversation-list and conversation-detail header components
27
+ - bug-fixed: on conversation removed, update local conversations on storage
28
+
29
+ ### 3.0.64 IN PROD
4
30
  - Fixes the bug: in the conversation list, for the direct convesations, the name of the requester changes according to the order of arrival of the conversations
5
31
 
32
+ ### 3.0.64-rc1
33
+ - Fixes the bug: in the conversation list, for the direct convesations, the name of the requester changes according to the order of arrival of the conversations
34
+ - Displays balloon messages with a light orange background for "internal notes" type message
35
+ - Adds the html component
36
+ - Improves chat performance by caching conversations
37
+
6
38
  ### 3.0.63
7
39
  - Deploys in production
8
40
 
@@ -19,7 +51,7 @@
19
51
  - Fixes the bug: images that are not in the database cannot be downloaded
20
52
  - Adds default chat color to emojis picker tabs
21
53
  - Fixes the bug: the selected conversation is undefined
22
- - Fixes the bug: in the conversation list, the name of the requester changes according to the order of arrival of the conversations
54
+ - Fixes the bug: in the conversation list, for the support convesations, the name of the requester changes according to the order of arrival of the conversations
23
55
 
24
56
  ### 3.0.62.3
25
57
  - Fixes the bug: the method setTyping fired twice after that a message is sent
File without changes
@@ -17,6 +17,7 @@ cp -p src/chat-config.json platforms/browser/www/
17
17
  cd platforms/browser/www
18
18
  aws s3 sync . s3://tiledesk-console/v2/chat/
19
19
  # aws s3 sync . s3://tiledesk-console/v2/chat/$version/
20
+ # aws s3 sync . s3://tiledesk-console/v2/chat/latest/
20
21
  cd ../../../
21
22
  # aws cloudfront create-invalidation --distribution-id E36UIP90GOSFPM --paths "/*"
22
23
 
package/deploy_pre.sh CHANGED
@@ -1,11 +1,44 @@
1
+ # environment=$(< src/utils/constants.ts)
2
+ # start="CURR_VER_PROD = '0."
3
+ # end="'"
4
+ # one=${environment#*$start}
5
+ # build=${one%%$end*} #two=${one%,*} -> %% prendo la prima istanza; % prendo la seconda
6
+ # NEW_BUILD=$(($build + 1))
7
+ # sed -i -e "s/$start$build/$start$NEW_BUILD/g" src/utils/constants.ts
8
+
1
9
  #npm version prerelease --preid=beta
2
10
  version=`node -e 'console.log(require("./package.json").version)'`
3
11
  echo "version $version"
4
12
 
5
- if [ "$version" != "" ]; then
6
- git tag -a "v$version" -m "`git log -1 --format=%s`"
7
- echo "Created a new tag, v$version"
8
- git push --tags
9
- npm publish
10
- fi
13
+ URL_VER=${version//[.]//}
14
+ echo 'URL_VER: ---->'$URL_VER
15
+
16
+ # if [ "$version" != "" ]; then
17
+ # git tag -a "v$version" -m "`git log -1 --format=%s`"
18
+ # echo "Created a new tag, v$version"
19
+ # git push --tags
20
+ # npm publish
21
+ # fi
22
+
23
+ sed -i -e "s/$URL_VER/g" src/utils/constants.ts
24
+
25
+ # ng build --prod --base-href /$NEW_BUILD/
26
+ #ionic cordova build browser --prod
27
+
28
+ ionic cordova platform add browser --save
29
+ #ionic cordova build browser --prod --release
30
+ ionic cordova build --env=pre browser #--prod --verbose
31
+
32
+ cp -p src/firebase-messaging-sw.js platforms/browser/www/
33
+ cp -p src/manifest.json platforms/browser/www/
34
+ cp -p src/chat-config.json platforms/browser/www/
35
+
36
+ cd platforms/browser/www
37
+ aws s3 sync . s3://tiledesk-dashboard-pre/chat-ionic5/$version/
38
+ aws s3 sync . s3://tiledesk-dashboard-pre/chat-ionic5/
39
+ cd ../../../
40
+
41
+ #aws cloudfront create-invalidation --distribution-id E2DTAKWHWQ7C3J --paths "/*"
11
42
 
43
+ echo new version deployed on s3://tiledesk-dashboard-pre/chat-ionic5/$version/
44
+ echo available on https://s3.eu-west-1.amazonaws.com/tiledesk-dashboard-pre/chat-ionic5/$version/index.html
package/package.json CHANGED
@@ -1,8 +1,13 @@
1
1
  {
2
2
  "name": "@chat21/chat21-ionic",
3
- "version": "3.0.64",
4
3
  "author": "Tiledesk SRL",
4
+ "version": "3.0.65",
5
+ "license": "AGPL-3.0",
5
6
  "homepage": "https://tiledesk.com/",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "https://github.com/Tiledesk/chat21-ionic"
10
+ },
6
11
  "scripts": {
7
12
  "ng": "ng",
8
13
  "start": "ng serve",
@@ -55,7 +60,7 @@
55
60
  "file-saver": "^2.0.5",
56
61
  "firebase": "^8.6.7",
57
62
  "marked": "^2.0.1",
58
- "material-design-icons": "^3.0.1",
63
+ "material-icons": "^1.11.2",
59
64
  "moment": "^2.24.0",
60
65
  "moment-timezone": "^0.5.28",
61
66
  "ng-connection-service": "^1.0.4",
@@ -114,4 +119,4 @@
114
119
  "ios"
115
120
  ]
116
121
  }
117
- }
122
+ }
package/publiccode.yml ADDED
@@ -0,0 +1,110 @@
1
+ # This repository adheres to the publiccode.yml standard by including this
2
+ # metadata file that makes public software easily discoverable.
3
+ # More info at https://github.com/italia/publiccode.yml
4
+
5
+ publiccodeYmlVersion: '0.2'
6
+ categories:
7
+ - customer-service-and-support
8
+ - communications
9
+ - marketing
10
+ - mobile-marketing
11
+ description:
12
+ it:
13
+ apiDocumentation: 'https://developer.tiledesk.com/apis/rest-api'
14
+ documentation: 'https://gethelp.tiledesk.com'
15
+ features:
16
+ - live chat widget
17
+ - chatbot
18
+ - 'integration with DialogFlow, Rasa and all major AI solutions'
19
+ - ticketing
20
+ - multi-project management
21
+ - SLAs setting
22
+ - 'smart assignment of the queues '
23
+ - seamless conversation
24
+ - dashboard
25
+ - knowledge base
26
+ - mobile apps
27
+ genericName: Live chat with integrated chatbots
28
+ longDescription: |
29
+ To have fully satisfied customers is complex. Conversation’s actors
30
+ (chatbots and humans) should handoff to each other many times during a
31
+ chat to address customers needs.
32
+
33
+
34
+ Tiledesk provides a solution **orchestrating instant, asynchronous and
35
+ multichannel communication among all stakeholders of a typical
36
+ conversational architecture**: chatbots, support operators, end users,
37
+ colleagues, applications, etc.
38
+
39
+
40
+ **Main Features**:
41
+
42
+
43
+ - Live Chat Widget with full multichannel experience on Web and Mobile;
44
+
45
+ - Resolution Bot to automate customer support;
46
+
47
+ - Easy Integration with all major AI-platforms, cloud and Open source,
48
+ from DialogFlow to RASA;
49
+
50
+ - Ticketing Management system fully integrated into the platform and
51
+ instant conversation flow;
52
+
53
+ - Team Organization with multi-project management, SLAs setting, smart
54
+ assignment of the
55
+ queues, departments organization and much more;
56
+ - Seamless conversation to “jump” between different channels in a
57
+ transparent way for end
58
+ customers and agents;
59
+ - Chat Tools like typing indicator, off-line access, delivery receipts,
60
+ contact list and much more;
61
+
62
+ - Dashboard with real time analytics;
63
+
64
+ - Knowledge base.
65
+
66
+
67
+
68
+ Tiledesk is an **open source **project, made with passion in Salento
69
+ (Southern Italy).
70
+ shortDescription: |-
71
+ Tiledesk delivers scalable customer service to your mobile apps and your
72
+ website. It is a conversational platform that connects chatbots and
73
+ humans
74
+ developmentStatus: stable
75
+ it:
76
+ conforme:
77
+ gdpr: false
78
+ lineeGuidaDesign: false
79
+ misureMinimeSicurezza: false
80
+ modelloInteroperabilita: false
81
+ countryExtensionVersion: '0.2'
82
+ piattaforme:
83
+ anpr: false
84
+ cie: false
85
+ pagopa: false
86
+ spid: false
87
+ landingURL: 'https://tiledesk.com/install'
88
+ legal:
89
+ license: AGPL-3.0-only
90
+ localisation:
91
+ availableLanguages:
92
+ - it
93
+ - en
94
+ - es
95
+ - fr
96
+ - pt
97
+ - de
98
+ - ru
99
+ - tr
100
+ localisationReady: true
101
+ maintenance:
102
+ contacts:
103
+ - name: Andrea Sponziello
104
+ type: internal
105
+ name: Tiledesk
106
+ platforms:
107
+ - web
108
+ releaseDate: '2022-06-15'
109
+ softwareType: standalone/web
110
+ url: 'https://github.com/Tiledesk/tiledesk-deployment'
@@ -37,7 +37,7 @@ import { LoginPage } from './pages/authentication/login/login.page';
37
37
  import { ConversationListPage } from './pages/conversations-list/conversations-list.page';
38
38
 
39
39
  // utils
40
- import { createExternalSidebar, checkPlatformIsMobile, isGroup, getParameterByName } from '../chat21-core/utils/utils';
40
+ import { checkPlatformIsMobile, isGroup, getParameterByName, searchIndexInArrayForUid, compareValues } from '../chat21-core/utils/utils';
41
41
  import { STORAGE_PREFIX, PLATFORM_MOBILE, PLATFORM_DESKTOP, CHAT_ENGINE_FIREBASE, AUTH_STATE_OFFLINE, AUTH_STATE_ONLINE } from '../chat21-core/utils/constants';
42
42
  import { environment } from '../environments/environment';
43
43
  import { UserModel } from '../chat21-core/models/user';
@@ -90,6 +90,7 @@ export class AppComponent implements OnInit {
90
90
  private setTimeoutSound: any;
91
91
  private isTabVisible: boolean = true;
92
92
  private tabTitle: string;
93
+ private setTimeoutConversationsEvent: any;
93
94
  private logger: LoggerService = LoggerInstance.getInstance();
94
95
  public toastMsgErrorWhileUnsubscribingFromNotifications: string;
95
96
  public toastMsgCloseToast: string;
@@ -341,8 +342,6 @@ export class AppComponent implements OnInit {
341
342
 
342
343
  if (event && event.data && event.data.action && event.data.parameter) {
343
344
  if (event.data.action === 'openJoinConversationModal') {
344
- // console.log("[APP-COMP] message event action ", event.data.action);
345
- // console.log("[APP-COMP] message event parameter ", event.data.parameter);
346
345
  this.presentAlertConfirmJoinRequest(event.data.parameter, event.data.calledBy)
347
346
  }
348
347
  }
@@ -377,7 +376,6 @@ export class AppComponent implements OnInit {
377
376
 
378
377
  async presentAlertConfirmJoinRequest(requestid, calledby) {
379
378
  var iframeWin = <HTMLIFrameElement>document.getElementById("unassigned-convs-iframe")
380
- // console.log("[APP-COMP] message event iframeWin ", iframeWin);
381
379
 
382
380
  const isIFrame = (input: HTMLElement | null): input is HTMLIFrameElement =>
383
381
  input !== null && input.tagName === 'IFRAME';
@@ -395,12 +393,10 @@ export class AppComponent implements OnInit {
395
393
  role: 'cancel',
396
394
  cssClass: 'secondary',
397
395
  handler: (blah) => {
398
- // console.log('Confirm Cancel: blah', blah);
399
396
  }
400
397
  }, {
401
398
  text: 'Ok',
402
399
  handler: () => {
403
- // console.log('Confirm Okay');
404
400
 
405
401
  if (isIFrame(iframeWin) && iframeWin.contentWindow) {
406
402
  const msg = { action: "joinConversation", parameter: requestid, calledBy: calledby }
@@ -420,14 +416,12 @@ export class AppComponent implements OnInit {
420
416
  signInWithCustomToken(token) {
421
417
  // this.isOnline = false;
422
418
  this.logger.log('[APP-COMP] SIGNINWITHCUSTOMTOKEN token', token)
423
- this.tiledeskAuthService.signInWithCustomToken(token)
424
- .then((user: any) => {
419
+ this.tiledeskAuthService.signInWithCustomToken(token).then((user: any) => {
425
420
  this.logger.log('[APP-COMP] SIGNINWITHCUSTOMTOKEN AUTLOGIN user', user)
426
421
  this.messagingAuthService.createCustomToken(token)
427
- })
428
- .catch(error => {
422
+ }).catch(error => {
429
423
  this.logger.error('[APP-COMP] SIGNINWITHCUSTOMTOKEN error::', error)
430
- })
424
+ })
431
425
  }
432
426
 
433
427
  /** */
@@ -487,6 +481,7 @@ export class AppComponent implements OnInit {
487
481
  }
488
482
  this.uploadService.initialize();
489
483
 
484
+ this.setLanguage(null)
490
485
  this.initAuthentication();
491
486
  this.initSubscriptions();
492
487
  this.initAudio();
@@ -577,16 +572,6 @@ export class AppComponent implements OnInit {
577
572
  this.translate.use('en');
578
573
  }
579
574
 
580
- // this.logger.debug('[APP-COMP] navigator.language: ', navigator.language);
581
- // let language;
582
- // if (navigator.language.indexOf('-') !== -1) {
583
- // language = navigator.language.substring(0, navigator.language.indexOf('-'));
584
- // } else if (navigator.language.indexOf('_') !== -1) {
585
- // language = navigator.language.substring(0, navigator.language.indexOf('_'));
586
- // } else {
587
- // language = navigator.language;
588
- // }
589
- // this.translate.use(language);
590
575
  }
591
576
 
592
577
 
@@ -643,16 +628,13 @@ export class AppComponent implements OnInit {
643
628
 
644
629
 
645
630
  translateToastMsgs() {
646
- this.translate.get('AnErrorOccurredWhileUnsubscribingFromNotifications')
647
- .subscribe((text: string) => {
631
+ this.translate.get('AnErrorOccurredWhileUnsubscribingFromNotifications').subscribe((text: string) => {
648
632
  this.toastMsgErrorWhileUnsubscribingFromNotifications = text;
649
633
  });
650
- this.translate.get('CLOSE_TOAST')
651
- .subscribe((text: string) => {
634
+ this.translate.get('CLOSE_TOAST').subscribe((text: string) => {
652
635
  this.toastMsgCloseToast = text;
653
636
  });
654
- this.translate.get('WAITING_FOR_NETWORK')
655
- .subscribe((text: string) => {
637
+ this.translate.get('WAITING_FOR_NETWORK').subscribe((text: string) => {
656
638
  this.toastMsgWaitingForNetwork = text;
657
639
  });
658
640
  }
@@ -661,7 +643,6 @@ export class AppComponent implements OnInit {
661
643
  updateStoredCurrentUser() {
662
644
  const storedCurrentUser = this.appStorageService.getItem('currentUser')
663
645
  const storedDshbrdUser = localStorage.getItem('user')
664
-
665
646
  this.logger.log('[APP-COMP] updateStoredCurrentUser - stored currentUser', storedCurrentUser)
666
647
  this.logger.log('[APP-COMP] updateStoredCurrentUser - stored dshbrdUser', storedDshbrdUser)
667
648
  if ((storedCurrentUser && storedCurrentUser !== 'undefined') && (storedDshbrdUser && storedDshbrdUser !== 'undefined')) {
@@ -678,7 +659,6 @@ export class AppComponent implements OnInit {
678
659
  this.logger.log('[APP-COMP] updateStoredCurrentUser - currentUser.color ', currentUser.color)
679
660
  this.logger.log('[APP-COMP] updateStoredCurrentUser - dshbrdUser.fillColour ', dshbrdUser.fillColour)
680
661
  }
681
-
682
662
  if (currentUser.firstname !== dshbrdUser.firstname) {
683
663
  this.logger.log('[APP-COMP] updateStoredCurrentUser - currentUser.firstname !== dshbrdUser.firstname')
684
664
  this.logger.log('[APP-COMP] updateStoredCurrentUser - currentUser.firstname ', currentUser.firstname)
@@ -689,7 +669,6 @@ export class AppComponent implements OnInit {
689
669
  this.logger.log('[APP-COMP] updateStoredCurrentUser - currentUser.firstname ', currentUser.firstname)
690
670
  this.logger.log('[APP-COMP] updateStoredCurrentUser - dshbrdUser.firstname ', dshbrdUser.firstname)
691
671
  }
692
-
693
672
  if (currentUser.lastname !== dshbrdUser.lastname) {
694
673
  this.logger.log('[APP-COMP] updateStoredCurrentUser - currentUser.lastname !== dshbrdUser.lastname')
695
674
  this.logger.log('[APP-COMP] updateStoredCurrentUser - currentUser.lastname ', currentUser.lastname)
@@ -700,7 +679,6 @@ export class AppComponent implements OnInit {
700
679
  this.logger.log('[APP-COMP] updateStoredCurrentUser - currentUser.lastname ', currentUser.lastname)
701
680
  this.logger.log('[APP-COMP] updateStoredCurrentUser - dshbrdUser.lastname ', dshbrdUser.lastname)
702
681
  }
703
-
704
682
  if (currentUser.avatar !== dshbrdUser.fullname_initial) {
705
683
  this.logger.log('[APP-COMP] updateStoredCurrentUser - currentUser.avatar !== dshbrdUser.fullname_initial')
706
684
  this.logger.log('[APP-COMP] updateStoredCurrentUser - currentUser.avatar ', currentUser.avatar)
@@ -711,7 +689,6 @@ export class AppComponent implements OnInit {
711
689
  this.logger.log('[APP-COMP] updateStoredCurrentUser - currentUser.avatar ', currentUser.avatar)
712
690
  this.logger.log('[APP-COMP] updateStoredCurrentUser - dshbrdUser.fullname_initial ', dshbrdUser.fullname_initial)
713
691
  }
714
-
715
692
  let fullname = ""
716
693
  if (dshbrdUser.firstname && !dshbrdUser.lastname) {
717
694
  fullname = dshbrdUser.firstname
@@ -719,7 +696,6 @@ export class AppComponent implements OnInit {
719
696
  fullname = dshbrdUser.firstname + ' ' + dshbrdUser.lastname
720
697
  this.logger.log('[APP-COMP] updateStoredCurrentUser - fullname ', fullname)
721
698
  }
722
-
723
699
  if (fullname !== currentUser.fullname) {
724
700
  this.logger.log('[APP-COMP] updateStoredCurrentUser - currentUser.fullname !== dshbrdUser.fullname ')
725
701
  this.logger.log('[APP-COMP] updateStoredCurrentUser - currentUser.fullname ', fullname)
@@ -730,7 +706,6 @@ export class AppComponent implements OnInit {
730
706
  this.logger.log('[APP-COMP] updateStoredCurrentUser - currentUser.fullname ', fullname)
731
707
  this.logger.log('[APP-COMP] updateStoredCurrentUser - dshbrdUser.fullname ', currentUser.fullname)
732
708
  }
733
-
734
709
  this.appStorageService.setItem('currentUser', JSON.stringify(currentUser));
735
710
  this.tiledeskAuthService.setCurrentUser(currentUser);
736
711
  }
@@ -846,13 +821,10 @@ export class AppComponent implements OnInit {
846
821
  }
847
822
 
848
823
  private initAudio() {
849
- // console.log('HERE IS initAudio ')
850
824
  // SET AUDIO
851
825
  const href = window.location.href;
852
826
  const hrefArray = href.split('/#/');
853
827
  const chatBaseUrl = hrefArray[0]
854
- // console.log('initAudio href', href)
855
- // console.log('initAudio chatBaseUrl', chatBaseUrl)
856
828
 
857
829
  this.audio = new Audio();
858
830
  this.audio.src = chatBaseUrl + URL_SOUND_LIST_CONVERSATION;
@@ -862,7 +834,6 @@ export class AppComponent implements OnInit {
862
834
  private manageTabNotification() {
863
835
  if (!this.isTabVisible) {
864
836
  // TAB IS HIDDEN --> manage title and SOUND
865
- // console.log('HERE IS manageTabNotification ')
866
837
  let badgeNewConverstionNumber = this.conversationsHandlerService.countIsNew()
867
838
  badgeNewConverstionNumber > 0 ? badgeNewConverstionNumber : badgeNewConverstionNumber = 1
868
839
  document.title = "(" + badgeNewConverstionNumber + ") " + this.tabTitle
@@ -881,7 +852,6 @@ export class AppComponent implements OnInit {
881
852
  }
882
853
 
883
854
  soundMessage() {
884
- // console.log('HERE IS soundMessage ')
885
855
  const that = this;
886
856
  // this.audio = new Audio();
887
857
  // // this.audio.src = '/assets/sounds/pling.mp3';
@@ -895,7 +865,7 @@ export class AppComponent implements OnInit {
895
865
  }).catch((error: any) => {
896
866
  that.logger.error('[APP-COMP] ***soundMessage error*', error);
897
867
  });
898
- }, 1000);
868
+ }, 4000);
899
869
  }
900
870
  /**---------------- SOUND FUNCTIONS --> END <--- +*/
901
871
  /***************************************************+*/
@@ -917,9 +887,7 @@ export class AppComponent implements OnInit {
917
887
  return;
918
888
  }
919
889
 
920
- this.BSAuthStateChangedSubscriptionRef = this.messagingAuthService.BSAuthStateChanged
921
- // .pipe(takeUntil(this.unsubscribe$))
922
- .pipe(filter((state) => state !== null)).subscribe((state: any) => {
890
+ this.BSAuthStateChangedSubscriptionRef = this.messagingAuthService.BSAuthStateChanged.pipe(filter((state) => state !== null)).subscribe((state: any) => {
923
891
  this.logger.log('initialize FROM [APP-COMP] - [APP-COMP] ***** BSAuthStateChanged state', state);
924
892
 
925
893
  if (state && state === AUTH_STATE_ONLINE) {
@@ -948,32 +916,31 @@ export class AppComponent implements OnInit {
948
916
 
949
917
 
950
918
  this.conversationsHandlerService.conversationAdded.subscribe((conversation: ConversationModel) => {
951
- // this.logger.log('[APP-COMP] ***** conversationsAdded *****', conversation);
919
+ this.logger.log('[APP-COMP] ***** conversationsAdded *****', conversation);
952
920
  // that.conversationsChanged(conversations);
953
921
  if (conversation && conversation.is_new === true) {
954
922
  this.manageTabNotification()
955
923
  }
924
+ if(conversation) this.updateConversationsOnStorage()
956
925
  });
957
926
 
958
927
  this.conversationsHandlerService.conversationChanged.subscribe((conversation: ConversationModel) => {
959
-
960
928
  // console.log('[APP-COMP] ***** subscribeConversationChanged conversation: ', conversation);
961
- let currentUser = null
962
- const storedCurrentUser = this.appStorageService.getItem('currentUser')
963
- if (storedCurrentUser && storedCurrentUser !== 'undefined') {
964
- currentUser = JSON.parse(storedCurrentUser);
929
+ if(conversation) this.updateConversationsOnStorage();
930
+ const currentUser = this.tiledeskAuthService.getCurrentUser()
931
+ if (currentUser && currentUser !== null) {
965
932
  this.logger.log('[APP-COMP] ***** subscribeConversationChanged currentUser: ', currentUser);
966
-
967
- if (currentUser) {
968
- this.logger.log('[APP-COMP] ***** subscribeConversationChanged current_user uid: ', currentUser.uid);
969
- if (conversation && conversation.sender !== currentUser.uid) {
970
- this.manageTabNotification();
971
- }
933
+ if (conversation && conversation.sender !== currentUser.uid) {
934
+ this.manageTabNotification();
972
935
  }
973
- } else {
974
- this.logger.error('[APP-COMP] ***** subscribeConversationChanged currentUser nor found in storage ');
975
936
  }
976
937
  });
938
+
939
+ this.conversationsHandlerService.conversationRemoved.subscribe((conversation: ConversationModel) => {
940
+ this.logger.log('[APP-COMP] ***** conversationRemoved *****', conversation);
941
+ // that.conversationsChanged(conversations);
942
+ if(conversation) this.updateConversationsOnStorage();
943
+ });
977
944
  }
978
945
 
979
946
  /**
@@ -1034,9 +1001,8 @@ export class AppComponent implements OnInit {
1034
1001
 
1035
1002
  goOffLine = () => {
1036
1003
  this.logger.log('[APP-COMP] - GO-OFFLINE');
1037
- const supportmode = this.appConfigProvider.getConfig().supportMode;
1038
- this.logger.log('[APP-COMP] - GO-OFFINE - supportmode ', supportmode);
1039
- if (supportmode === true) {
1004
+ this.logger.log('[APP-COMP] - GO-OFFINE - supportmode ', this.SUPPORT_MODE);
1005
+ if (this.SUPPORT_MODE === true) {
1040
1006
  this.webSocketClose()
1041
1007
  }
1042
1008
  // this.isOnline = false;
@@ -1119,6 +1085,7 @@ export class AppComponent implements OnInit {
1119
1085
 
1120
1086
 
1121
1087
  if (hasClickedLogout === true) {
1088
+ this.appStorageService.removeItem('conversations')
1122
1089
  // ----------------------------------------------
1123
1090
  // PUSH NOTIFICATIONS
1124
1091
  // ----------------------------------------------
@@ -1225,14 +1192,11 @@ export class AppComponent implements OnInit {
1225
1192
  this.logger.log('[APP-COMP] initConversationsHandler ------------->', userId, this.tenant);
1226
1193
  // 1 - init chatConversationsHandler and archviedConversationsHandler
1227
1194
  this.conversationsHandlerService.initialize(this.tenant, userId, translationMap);
1228
-
1229
1195
  // this.subscribeToConvs()
1230
- this.conversationsHandlerService.subscribeToConversations(() => {
1231
- this.logger.log('[APP-COMP] - CONVS - INIT CONV')
1232
-
1196
+ this.conversationsHandlerService.subscribeToConversations(null, () => {
1197
+ // this.logger.log('[APP-COMP] - CONVS - INIT CONV')
1233
1198
  const conversations = this.conversationsHandlerService.conversations;
1234
1199
  this.logger.info('initialize FROM [APP-COMP] - [APP-COMP]-CONVS - INIT CONV CONVS', conversations)
1235
-
1236
1200
  // this.logger.printDebug('SubscribeToConversations (convs-list-page) - conversations')
1237
1201
  if (!conversations || conversations.length === 0) {
1238
1202
  // that.showPlaceholder = true;
@@ -1243,9 +1207,18 @@ export class AppComponent implements OnInit {
1243
1207
 
1244
1208
  }
1245
1209
 
1210
+ private updateConversationsOnStorage(){
1211
+ const that = this
1212
+ //reset timer and save conversation on storage after 2s
1213
+ // clearTimeout(this.setTimeoutConversationsEvent);
1214
+ // this.setTimeoutConversationsEvent = setTimeout(() => {
1215
+ // this.logger.debug('[APP-COMP] updateConversationsOnStorage: reset timer and save conversations -> ', this.conversationsHandlerService.conversations.length)
1216
+ // that.appStorageService.setItem('conversations', JSON.stringify(this.conversationsHandlerService.conversations))
1217
+ // }, 2000);
1218
+ }
1219
+
1246
1220
  private initArchivedConversationsHandler(userId: string) {
1247
1221
  const keys = ['YOU'];
1248
-
1249
1222
  const translationMap = this.translateService.translateLanguage(keys);
1250
1223
 
1251
1224
  this.logger.debug('[APP-COMP] initArchivedConversationsHandler ------------->', userId, this.tenant);
@@ -1312,3 +1285,4 @@ export class AppComponent implements OnInit {
1312
1285
  }
1313
1286
  }
1314
1287
  }
1288
+
@@ -278,6 +278,7 @@ const appInitializerFn = (appConfig: AppConfigProvider, logger: NGXLogger) => {
278
278
  serverLogLevel: NgxLoggerLevel.ERROR,
279
279
  timestampFormat: 'HH:mm:ss.SSS',
280
280
  enableSourceMaps: false,
281
+ disableFileDetails: true,
281
282
  colorScheme: ['purple', 'yellow', 'gray', 'gray', 'red', 'red', 'red'],
282
283
  serverLoggingUrl: 'https://tiledesk-server-pre.herokuapp.com/logs'
283
284
  }),
@@ -86,7 +86,7 @@
86
86
  [textColor]="'col-msg-sent'"
87
87
  [addAsCannedResponseTooltipText]="addAsCannedResponseTooltipText"
88
88
  [areVisibleCAR]="areVisibleCAR"
89
- [support_mode]="support_mode"
89
+ [supportMode]="supportMode"
90
90
  (onBeforeMessageRender)="returnOnBeforeMessageRender($event)"
91
91
  (onAfterMessageRender)="returnOnAfterMessageRender($event)"
92
92
  (onImageRendered)="onImageRenderedFN($event)">
@@ -125,7 +125,7 @@
125
125
  [textColor]="'black'"
126
126
  [addAsCannedResponseTooltipText]="addAsCannedResponseTooltipText"
127
127
  [areVisibleCAR]="areVisibleCAR"
128
- [support_mode]="support_mode"
128
+ [supportMode]="supportMode"
129
129
  (onBeforeMessageRender)="returnOnBeforeMessageRender($event)"
130
130
  (onAfterMessageRender)="returnOnAfterMessageRender($event)"
131
131
  (onImageRendered)="onImageRenderedFN($event)"
@@ -97,7 +97,6 @@ ion-item {
97
97
  background-color: var(--bubble-privateMsg);
98
98
  color: var(--bubble-privateMsgColor)
99
99
  }
100
-
101
100
  }
102
101
  .emoticon {
103
102
  background: unset !important;
@@ -22,12 +22,12 @@ export class IonConversationDetailComponent extends ConversationContentComponent
22
22
 
23
23
  @Input() senderId: string;
24
24
  @Input() channelType: string;
25
+ @Input() areVisibleCAR: boolean;
26
+ @Input() supportMode: boolean;
25
27
  @Output() onImageRendered = new EventEmitter<boolean>()
26
28
  @Output() onAddUploadingBubble = new EventEmitter<boolean>();
27
29
 
28
30
  public public_Key: any
29
- public areVisibleCAR: boolean
30
- public support_mode: boolean
31
31
  public uploadProgress: number = 100
32
32
  public fileType: any
33
33
  public browserLang: string;
@@ -64,48 +64,11 @@ export class IonConversationDetailComponent extends ConversationContentComponent
64
64
  }
65
65
 
66
66
  ngOnInit() {
67
- this.getOSCODE()
68
67
  this.listenToUploadFileProgress();
69
68
  this.setMomentLocaleAndGetTranslation();
70
69
  }
71
70
 
72
- getOSCODE() {
73
- this.support_mode = null
74
- if( this.appConfigProvider.getConfig().supportMode === true || this.appConfigProvider.getConfig().supportMode === 'true') {
75
- this.support_mode = true
76
- } else if ( this.appConfigProvider.getConfig().supportMode === false || this.appConfigProvider.getConfig().supportMode === 'false') {
77
- this.support_mode = false
78
- } else if ( !this.appConfigProvider.getConfig().supportMode ) {
79
- this.support_mode = false
80
- }
81
- this.public_Key = this.appConfigProvider.getConfig().t2y12PruGU9wUtEGzBJfolMIgK
82
- this.logger.log('[CONVS-DETAIL][ION-CONVS-DETAIL] AppConfigService getAppConfig public_Key', this.public_Key)
83
-
84
- if (this.public_Key) {
85
- let keys = this.public_Key.split('-')
86
- this.logger.log('[CONVS-DETAIL][ION-CONVS-DETAIL] PUBLIC-KEY - public_Key keys', keys)
87
-
88
- keys.forEach((key) => {
89
- if (key.includes('CAR')) {
90
- let car = key.split(':')
91
- if (car[1] === 'F') {
92
- this.areVisibleCAR = false
93
- this.logger.log('[CONVS-DETAIL][ION-CONVS-DETAIL] PUBLIC-KEY - areVisibleCAR', this.areVisibleCAR)
94
- } else {
95
- this.areVisibleCAR = true
96
- this.logger.log('[CONVS-DETAIL][ION-CONVS-DETAIL] PUBLIC-KEY - areVisibleCAR', this.areVisibleCAR)
97
- }
98
- }
99
- })
100
71
 
101
- if (!this.public_Key.includes('CAR')) {
102
- this.areVisibleCAR = false
103
- // console.log('[CONVS-DETAIL][ION-CONVS-DETAIL] PUBLIC-KEY - areVisibleCAR', this.areVisibleCAR)
104
- }
105
- } else {
106
- this.areVisibleCAR = false
107
- }
108
- }
109
72
 
110
73
  setMomentLocaleAndGetTranslation() {
111
74
  this.browserLang = this.translate.getBrowserLang();