@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
package/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # chat21-ionic ver 3.0
2
2
 
3
+ ### 3.0.68-rc2
4
+ - bug-fixed: removed lookup API call for old requests
5
+
6
+ ### 3.0.68-rc1
7
+ - bug-fixed: not sound if conversation.is_new changed from true to false in conversationChange BS
8
+ - changed: if message contains only 1 emoji remove bubble message background and increase font-size
9
+ - added: new languages az, sv, kk, uz
10
+ - removed: control in info-content component for old project id with 32 characters
11
+
12
+ ### 3.0.67 in PROD
13
+ - added: control to 'foregroundCount' when tab is hidden/visible
14
+ - added: sound control on/off to new conversations and conversations changed
15
+
16
+ ### 3.0.66 in PROD
17
+ - added: control to 'foregroundCount' locale storage variable from dashboard
18
+ - added: uk translations
19
+
3
20
  ### 3.0.65 in PROD
4
21
  - bug-fixed: icons in sidebar were not alignet correctly on Safari
5
22
  - bug-fixed: missing translations on sidebar-detail component and login-modal page on start when user logged in for the first time
@@ -7,18 +7,22 @@ echo 'URL_VER: ---->'$URL_VER
7
7
 
8
8
  # sed -i -e "s/$start$ver.$build/$start$NEW_VER.$NEW_BUILD/g" src/utils/constants.ts
9
9
  sed -i -e "s/$URL_VER/g" src/utils/constants.ts
10
+
11
+
10
12
  ionic cordova platform add browser --save
11
13
  #ionic cordova build --env=prod browser -- --base-href /www/ --prod
12
14
  ionic cordova build --env=prod browser --prod
15
+
13
16
  cp -p src/firebase-messaging-sw.js platforms/browser/www/
14
17
  cp -p src/manifest.json platforms/browser/www/
15
18
  cp -p src/chat-config.json platforms/browser/www/
16
19
 
17
20
  cd platforms/browser/www
18
- aws s3 sync . s3://tiledesk-console/v2/chat/
21
+ # aws s3 sync . s3://tiledesk-console/v2/chat/
19
22
  # aws s3 sync . s3://tiledesk-console/v2/chat/$version/
20
- # aws s3 sync . s3://tiledesk-console/v2/chat/latest/
23
+ aws s3 sync . s3://tiledesk-console/v2/chat/latest/
21
24
  cd ../../../
25
+
22
26
  # aws cloudfront create-invalidation --distribution-id E36UIP90GOSFPM --paths "/*"
23
27
 
24
28
  # echo new version deployed on s3://tiledesk-dashboard/chat/$NEW_BUILD/
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@chat21/chat21-ionic",
3
3
  "author": "Tiledesk SRL",
4
- "version": "3.0.65",
4
+ "version": "3.0.68-rc.2",
5
5
  "license": "AGPL-3.0",
6
6
  "homepage": "https://tiledesk.com/",
7
7
  "repository": {
@@ -89,6 +89,8 @@ export class AppComponent implements OnInit {
89
89
  private setIntervalTime: any;
90
90
  private setTimeoutSound: any;
91
91
  private isTabVisible: boolean = true;
92
+ private isSoundEnabled: boolean;
93
+ private hasPlayed: boolean;
92
94
  private tabTitle: string;
93
95
  private setTimeoutConversationsEvent: any;
94
96
  private logger: LoggerService = LoggerInstance.getInstance();
@@ -99,6 +101,7 @@ export class AppComponent implements OnInit {
99
101
  private hadBeenCalledOpenModal: boolean = false;
100
102
  public missingConnectionToast: any
101
103
  public executedInitializeAppByWatchConnection: boolean = false;
104
+ private isInitialized: boolean = false;
102
105
  private version: string;
103
106
  IS_ONLINE: boolean;
104
107
  IS_ON_MOBILE_DEVICE: boolean;
@@ -559,15 +562,13 @@ export class AppComponent implements OnInit {
559
562
  chat_lang = stored_preferred_lang
560
563
  }
561
564
 
562
- this.logger.log('[APP-COMP] - chat_lang', chat_lang)
563
-
564
565
  if (tranlatedLanguage.includes(chat_lang)) {
565
566
  this.logger.log('[APP-COMP] tranlatedLanguage includes', chat_lang, ': ', tranlatedLanguage.includes(chat_lang))
566
567
  this.translate.setDefaultLang(chat_lang)
567
568
  this.translate.use(chat_lang);
568
569
  }
569
570
  else {
570
- this.logger.log('[APP-COMP] tranlatedLanguage includes', chat_lang, ': ', tranlatedLanguage.includes(chat_lang))
571
+ this.logger.log('[APP-COMP] tranlatedLanguage not includes', chat_lang, ': ', tranlatedLanguage.includes(chat_lang))
571
572
  this.translate.setDefaultLang('en');
572
573
  this.translate.use('en');
573
574
  }
@@ -829,12 +830,20 @@ export class AppComponent implements OnInit {
829
830
  this.audio = new Audio();
830
831
  this.audio.src = chatBaseUrl + URL_SOUND_LIST_CONVERSATION;
831
832
  this.audio.load();
833
+
834
+ const sound_status = localStorage.getItem('dshbrd----sound')
835
+ if(sound_status && sound_status !== 'undefined'){
836
+ this.isSoundEnabled = sound_status === 'enabled'? true: false
837
+ }else{
838
+ this.isSoundEnabled = true
839
+ }
840
+
832
841
  }
833
842
 
834
- private manageTabNotification() {
843
+ private manageTabNotification(badgeNotificationCount?: number) {
835
844
  if (!this.isTabVisible) {
836
845
  // TAB IS HIDDEN --> manage title and SOUND
837
- let badgeNewConverstionNumber = this.conversationsHandlerService.countIsNew()
846
+ let badgeNewConverstionNumber = badgeNotificationCount? badgeNotificationCount : this.conversationsHandlerService.countIsNew()
838
847
  badgeNewConverstionNumber > 0 ? badgeNewConverstionNumber : badgeNewConverstionNumber = 1
839
848
  document.title = "(" + badgeNewConverstionNumber + ") " + this.tabTitle
840
849
 
@@ -847,25 +856,40 @@ export class AppComponent implements OnInit {
847
856
  document.title = "(" + badgeNewConverstionNumber + ") " + that.tabTitle;
848
857
  }
849
858
  }, 1000);
850
- this.soundMessage()
859
+ // if(this.isSoundEnabled) this.soundMessage()
851
860
  }
861
+
862
+ const sound_status = localStorage.getItem('dshbrd----sound')
863
+ if(sound_status && sound_status !== 'undefined'){
864
+ this.isSoundEnabled = sound_status === 'enabled'? true: false
865
+ }
866
+ if(this.isInitialized && this.isSoundEnabled) this.soundMessage()
852
867
  }
853
868
 
854
869
  soundMessage() {
855
870
  const that = this;
856
- // this.audio = new Audio();
857
- // // this.audio.src = '/assets/sounds/pling.mp3';
858
- // this.audio.src = URL_SOUND_LIST_CONVERSATION;
859
- // this.audio.load();
860
- this.logger.debug('[APP-COMP] conversation play', this.audio);
861
- clearTimeout(this.setTimeoutSound);
862
- this.setTimeoutSound = setTimeout(function () {
871
+ // this.logger.debug('[APP-COMP] conversation play', this.audio);
872
+ // clearTimeout(this.setTimeoutSound);
873
+ // this.setTimeoutSound = setTimeout(function () {
874
+ // that.audio.play().then(() => {
875
+ // that.logger.debug('[APP-COMP] ****** soundMessage played *****');
876
+ // }).catch((error: any) => {
877
+ // that.logger.error('[APP-COMP] ***soundMessage error*', error);
878
+ // });
879
+ // }, 4000);
880
+
881
+ //play sound every 4s from the fist time you receive a conversation added/changed
882
+ if(!this.hasPlayed){
863
883
  that.audio.play().then(() => {
884
+ that.hasPlayed = true
864
885
  that.logger.debug('[APP-COMP] ****** soundMessage played *****');
886
+ setTimeout(() => {
887
+ that.hasPlayed = false
888
+ }, 4000);
865
889
  }).catch((error: any) => {
866
890
  that.logger.error('[APP-COMP] ***soundMessage error*', error);
867
891
  });
868
- }, 4000);
892
+ }
869
893
  }
870
894
  /**---------------- SOUND FUNCTIONS --> END <--- +*/
871
895
  /***************************************************+*/
@@ -913,11 +937,10 @@ export class AppComponent implements OnInit {
913
937
 
914
938
  this.events.subscribe('uidConvSelected:changed', this.subscribeChangedConversationSelected);
915
939
  this.events.subscribe('profileInfoButtonClick:logout', this.subscribeProfileInfoButtonLogOut);
916
-
940
+ this.events.subscribe('unservedRequest:count', this.subscribeUnservedRequestCount)
917
941
 
918
942
  this.conversationsHandlerService.conversationAdded.subscribe((conversation: ConversationModel) => {
919
- this.logger.log('[APP-COMP] ***** conversationsAdded *****', conversation);
920
- // that.conversationsChanged(conversations);
943
+ // this.logger.log('[APP-COMP] ***** subscribeConversationAdded *****', conversation);
921
944
  if (conversation && conversation.is_new === true) {
922
945
  this.manageTabNotification()
923
946
  }
@@ -928,17 +951,23 @@ export class AppComponent implements OnInit {
928
951
  // console.log('[APP-COMP] ***** subscribeConversationChanged conversation: ', conversation);
929
952
  if(conversation) this.updateConversationsOnStorage();
930
953
  const currentUser = this.tiledeskAuthService.getCurrentUser()
954
+ });
955
+
956
+ this.conversationsHandlerService.conversationChangedDetailed.subscribe((changes: {value: ConversationModel, previousValue: ConversationModel}) => {
957
+ // console.log('[APP-COMP] ***** subscribeConversationChangedDetailed conversation: ', changes);
958
+ const currentUser = this.tiledeskAuthService.getCurrentUser()
931
959
  if (currentUser && currentUser !== null) {
932
- this.logger.log('[APP-COMP] ***** subscribeConversationChanged currentUser: ', currentUser);
933
- if (conversation && conversation.sender !== currentUser.uid) {
934
- this.manageTabNotification();
960
+ this.logger.log('[APP-COMP] ***** subscribeConversationChangedDetailed currentUser: ', currentUser);
961
+ if (changes.value && changes.value.sender !== currentUser.uid) {
962
+ if(changes.value.is_new === changes.previousValue.is_new){
963
+ this.manageTabNotification();
964
+ }
935
965
  }
936
966
  }
937
967
  });
938
968
 
939
969
  this.conversationsHandlerService.conversationRemoved.subscribe((conversation: ConversationModel) => {
940
970
  this.logger.log('[APP-COMP] ***** conversationRemoved *****', conversation);
941
- // that.conversationsChanged(conversations);
942
971
  if(conversation) this.updateConversationsOnStorage();
943
972
  });
944
973
  }
@@ -1012,7 +1041,8 @@ export class AppComponent implements OnInit {
1012
1041
  this.chatManager.goOffLine();
1013
1042
 
1014
1043
  this.router.navigateByUrl('conversation-detail/'); //redirect to basePage
1015
-
1044
+ // this.goToDashboardLogin()
1045
+
1016
1046
  // clearTimeout(this.timeModalLogin);
1017
1047
  // this.timeModalLogin = setTimeout(() => {
1018
1048
  if (!this.hadBeenCalledOpenModal) {
@@ -1026,6 +1056,12 @@ export class AppComponent implements OnInit {
1026
1056
 
1027
1057
  }
1028
1058
 
1059
+ goToDashboardLogin(){
1060
+ let DASHBOARD_URL = this.appConfigProvider.getConfig().dashboardUrl + '/index.html'
1061
+ const myWindow = window.open(DASHBOARD_URL, '_self');
1062
+ myWindow.focus();
1063
+ }
1064
+
1029
1065
 
1030
1066
  webSocketClose() {
1031
1067
  this.logger.log('[APP-COMP] - GO-OFFLINE - webSocketClose');
@@ -1106,6 +1142,12 @@ export class AppComponent implements OnInit {
1106
1142
  }
1107
1143
  }
1108
1144
 
1145
+ subscribeUnservedRequestCount = (unservedRequestCount) => {
1146
+ if(unservedRequestCount && unservedRequestCount > 0){
1147
+ this.manageTabNotification(unservedRequestCount) //sound and alternate title
1148
+ }
1149
+ }
1150
+
1109
1151
  private async presentModal(calledby): Promise<any> {
1110
1152
  this.logger.log('[APP-COMP] presentModal calledby', calledby, '- hadBeenCalledOpenModal: ', this.hadBeenCalledOpenModal);
1111
1153
  const attributes = { tenant: this.tenant, enableBackdropDismiss: false };
@@ -1143,33 +1185,6 @@ export class AppComponent implements OnInit {
1143
1185
  }
1144
1186
 
1145
1187
 
1146
- // listenToLogoutEvent() {
1147
- // this.events.subscribe('profileInfoButtonClick:logout', (hasclickedlogout) => {
1148
- // this.logger.debug('[APP-COMP] hasclickedlogout', hasclickedlogout);
1149
- // if (hasclickedlogout === true) {
1150
- // // ----------------------------------------------
1151
- // // PUSH NOTIFICATIONS
1152
- // // ----------------------------------------------
1153
- // const that = this;
1154
- // const pushEngine = this.appConfigProvider.getConfig().pushEngine
1155
- // if( pushEngine && pushEngine !== 'none'){
1156
- // this.notificationsService.removeNotificationsInstance(function (res) {
1157
- // that.logger.debug('[APP-COMP] FIREBASE-NOTIFICATION >>>> removeNotificationsInstance > CALLBACK RES', res);
1158
-
1159
- // if (res === 'success') {
1160
- // that.removePresenceAndLogout();
1161
- // } else {
1162
- // that.removePresenceAndLogout();
1163
- // that.presentToast();
1164
- // }
1165
- // })
1166
- // }
1167
-
1168
- // }
1169
- // });
1170
- // }
1171
-
1172
-
1173
1188
  async presentToast() {
1174
1189
  const toast = await this.toastController.create({
1175
1190
  message: this.toastMsgErrorWhileUnsubscribingFromNotifications,
@@ -1209,12 +1224,13 @@ export class AppComponent implements OnInit {
1209
1224
 
1210
1225
  private updateConversationsOnStorage(){
1211
1226
  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);
1227
+ // reset timer and save conversation on storage after 2s
1228
+ clearTimeout(this.setTimeoutConversationsEvent);
1229
+ this.setTimeoutConversationsEvent = setTimeout(() => {
1230
+ // that.logger.debug('[APP-COMP] updateConversationsOnStorage: reset timer and save conversations -> ', this.conversationsHandlerService.conversations.length)
1231
+ // that.appStorageService.setItem('conversations', JSON.stringify(that.conversationsHandlerService.conversations))
1232
+ that.isInitialized = true;
1233
+ }, 2000);
1218
1234
  }
1219
1235
 
1220
1236
  private initArchivedConversationsHandler(userId: string) {
@@ -1226,6 +1242,18 @@ export class AppComponent implements OnInit {
1226
1242
  this.archivedConversationsHandlerService.initialize(this.tenant, userId, translationMap);
1227
1243
  }
1228
1244
 
1245
+ checkAndRemoveDashboardForegroundCount(){
1246
+ try {
1247
+ const dashboardForegroundCount = localStorage.getItem('dshbrd----foregroundcount')
1248
+ this.logger.log('[SIDEBAR] - THERE IS DASHBOARD FOREGROUND COUNT', dashboardForegroundCount)
1249
+ if (dashboardForegroundCount && dashboardForegroundCount !== 'undefined') {
1250
+ localStorage.setItem('dshbrd----foregroundcount', '0')
1251
+ }
1252
+ } catch (err) {
1253
+ this.logger.error('Get local storage dshbrd----foregroundcount ', err)
1254
+ }
1255
+ }
1256
+
1229
1257
 
1230
1258
  @HostListener('document:visibilitychange', [])
1231
1259
  visibilitychange() {
@@ -1237,6 +1265,7 @@ export class AppComponent implements OnInit {
1237
1265
  clearInterval(this.setIntervalTime)
1238
1266
  this.isTabVisible = true;
1239
1267
  document.title = this.tabTitle;
1268
+ this.checkAndRemoveDashboardForegroundCount()
1240
1269
  }
1241
1270
  }
1242
1271
 
@@ -1246,7 +1275,7 @@ export class AppComponent implements OnInit {
1246
1275
  @HostListener('window:storage', ['$event'])
1247
1276
  onStorageChanged(event: any) {
1248
1277
 
1249
- if (event.key !== 'chat_sv5__tiledeskToken') {
1278
+ if (event.key !== 'chat_sv5__tiledeskToken' && event.key !== 'dshbrd----sound') {
1250
1279
  return;
1251
1280
  }
1252
1281
 
@@ -1283,6 +1312,11 @@ export class AppComponent implements OnInit {
1283
1312
 
1284
1313
  }
1285
1314
  }
1315
+
1316
+ if(event.key === 'dshbrd----sound'){
1317
+ this.events.publish('storage:sound', event.newValue);
1318
+ this.isSoundEnabled = event.newValue === 'enabled'? true: false
1319
+ }
1286
1320
  }
1287
1321
  }
1288
1322
 
@@ -200,15 +200,15 @@ export function presenceFactory(appConfig: AppConfigProvider) {
200
200
  }
201
201
  }
202
202
 
203
- export function imageRepoFactory(appConfig: AppConfigProvider) {
203
+ export function imageRepoFactory(appConfig: AppConfigProvider, http: HttpClient) {
204
204
 
205
205
  const config = appConfig.getConfig()
206
206
  if (config.uploadEngine === UPLOAD_ENGINE_NATIVE) {
207
- const imageService = new NativeImageRepoService()
207
+ const imageService = new NativeImageRepoService(http)
208
208
  imageService.setImageBaseUrl(config.baseImageUrl)
209
209
  return imageService
210
210
  } else {
211
- const imageService = new FirebaseImageRepoService();
211
+ const imageService = new FirebaseImageRepoService(http);
212
212
  FirebaseInitService.initFirebase(config.firebaseConfig)
213
213
  imageService.setImageBaseUrl(config.baseImageUrl)
214
214
  return imageService
@@ -345,7 +345,7 @@ const appInitializerFn = (appConfig: AppConfigProvider, logger: NGXLogger) => {
345
345
  {
346
346
  provide: ImageRepoService,
347
347
  useFactory: imageRepoFactory,
348
- deps: [AppConfigProvider]
348
+ deps: [AppConfigProvider, HttpClient]
349
349
  },
350
350
  {
351
351
  provide: ConversationHandlerBuilderService,
@@ -45,6 +45,14 @@
45
45
  padding-top: 14px;
46
46
  }
47
47
  }
48
+
49
+ // &:hover .message-date{
50
+ // display: flex;
51
+ // }
52
+
53
+ // .message-date {
54
+ // display: none;
55
+ // }
48
56
  }
49
57
  // > .button-native
50
58
  .btn-add-msg-as-canned-response {
@@ -22,13 +22,11 @@ export class InfoMessageComponent implements OnInit, OnChanges {
22
22
  }
23
23
 
24
24
  ngOnChanges() {
25
- this.logger.debug('[INFO-COMP] message ', this.message)
26
25
  // Fixes the bug: if a snippet of code is pasted and sent it is not displayed correctly info message
27
26
  if(this.message && this.message.text) {
28
27
  var regex = /<br\s*[\/]?>/gi;
29
28
  this.message.text = this.message.text.replace(regex, "\n")
30
29
  // this.message.text = replaceEndOfLine(this.message.text);
31
- this.logger.debug('[INFO-COMP] message .text ', this.message.text )
32
30
  }
33
31
  }
34
32
 
@@ -1,18 +1,63 @@
1
1
  <div class="status-message">
2
2
  <!-- c21-ico-schedule -->
3
3
  <div *ngIf="!status" class="icon">
4
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18 18"><defs><style>.cls-1{fill:none;}</style></defs><title>ic_schedule</title><g id="Livello_2" data-name="Livello 2"><g id="Livello_1-2" data-name="Livello 1"><path d="M9,1.5A7.5,7.5,0,1,0,16.5,9,7.5,7.5,0,0,0,9,1.5ZM9,15a6,6,0,1,1,6-6A6,6,0,0,1,9,15Z"/><path class="cls-1" d="M0,0H18V18H0Z"/><path d="M9.38,5.25H8.25v4.5l3.94,2.36.56-.92-3.37-2Z"/></g></g></svg>
4
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18 18">
5
+ <defs>
6
+ <style>.cls-1{fill:none;}</style>
7
+ </defs>
8
+ <!-- <title>ic_schedule</title> -->
9
+ <g id="Livello_2" data-name="Livello 2">
10
+ <g id="Livello_1-2" data-name="Livello 1">
11
+ <path d="M9,1.5A7.5,7.5,0,1,0,16.5,9,7.5,7.5,0,0,0,9,1.5ZM9,15a6,6,0,1,1,6-6A6,6,0,0,1,9,15Z"/>
12
+ <path class="cls-1" d="M0,0H18V18H0Z"/>
13
+ <path d="M9.38,5.25H8.25v4.5l3.94,2.36.56-.92-3.37-2Z"/>
14
+ </g>
15
+ </g>
16
+ </svg>
5
17
  </div>
6
18
  <!-- c21-ico-done -->
7
19
  <div *ngIf="status == MSG_STATUS_SENT" class="icon">
8
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18 18"><defs><style>.cls-1{fill:none;}</style></defs><title>ic_done</title><g id="Livello_2" data-name="Livello 2"><g id="Livello_1-2" data-name="Livello 1"><path class="cls-1" d="M0,0H18V18H0Z"/><path d="M6.75,12.15,3.6,9,2.55,10l4.2,4.2,9-9-1-1.05Z"/></g></g></svg>
20
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18 18">
21
+ <defs>
22
+ <style>.cls-1{fill:none;}</style>
23
+ </defs>
24
+ <!-- <title>ic_done</title> -->
25
+ <g id="Livello_2" data-name="Livello 2">
26
+ <g id="Livello_1-2" data-name="Livello 1">
27
+ <path class="cls-1" d="M0,0H18V18H0Z"/>
28
+ <path d="M6.75,12.15,3.6,9,2.55,10l4.2,4.2,9-9-1-1.05Z"/>
29
+ </g>
30
+ </g>
31
+ </svg>
9
32
  </div>
10
33
  <!-- c21-ico-done -->
11
34
  <div *ngIf="status == MSG_STATUS_SENT_SERVER" class="icon">
12
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18 18"><defs><style>.cls-1{fill:none;}</style></defs><title>ic_done</title><g id="Livello_2" data-name="Livello 2"><g id="Livello_1-2" data-name="Livello 1"><path class="cls-1" d="M0,0H18V18H0Z"/><path d="M6.75,12.15,3.6,9,2.55,10l4.2,4.2,9-9-1-1.05Z"/></g></g></svg>
35
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18 18">
36
+ <defs>
37
+ <style>.cls-1{fill:none;}</style>
38
+ </defs>
39
+ <!-- <title>ic_done</title> -->
40
+ <g id="Livello_2" data-name="Livello 2">
41
+ <g id="Livello_1-2" data-name="Livello 1">
42
+ <path class="cls-1" d="M0,0H18V18H0Z"/>
43
+ <path d="M6.75,12.15,3.6,9,2.55,10l4.2,4.2,9-9-1-1.05Z"/>
44
+ </g>
45
+ </g>
46
+ </svg>
13
47
  </div>
14
48
  <!-- c21-ico-done_all -->
15
49
  <div *ngIf="status == MSG_STATUS_RETURN_RECEIPT" class="icon">
16
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18 18"><defs><style>.cls-1{fill:none;}</style></defs><title>ic_done_all</title><g id="Livello_2" data-name="Livello 2"><g id="Livello_1-2" data-name="Livello 1"><path class="cls-1" d="M0,0H18V18H0Z"/><path d="M13.5,5.25,12.44,4.19,7.69,8.95,8.74,10Zm3.18-1.06L8.74,12.13,5.61,9,4.55,10.06l4.19,4.19,9-9ZM.31,10.06,4.5,14.25l1.06-1.06L1.37,9Z"/></g></g></svg>
50
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18 18">
51
+ <defs>
52
+ <style>.cls-1{fill:none;}</style>
53
+ </defs>
54
+ <!-- <title>ic_done_all</title> -->
55
+ <g id="Livello_2" data-name="Livello 2">
56
+ <g id="Livello_1-2" data-name="Livello 1">
57
+ <path class="cls-1" d="M0,0H18V18H0Z"/>
58
+ <path d="M13.5,5.25,12.44,4.19,7.69,8.95,8.74,10Zm3.18-1.06L8.74,12.13,5.61,9,4.55,10.06l4.19,4.19,9-9ZM.31,10.06,4.5,14.25l1.06-1.06L1.37,9Z"/>
59
+ </g>
60
+ </g>
61
+ </svg>
17
62
  </div>
18
63
  </div>
@@ -88,7 +88,6 @@ export class IonListConversationsComponent extends ListConversationsComponent im
88
88
  // }
89
89
 
90
90
  this.currentYear = moment().format('YYYY');
91
- this.logger.log('[ION-LIST-CONVS-COMP] - currentYear ', this.currentYear)
92
91
 
93
92
  const DASHBOARD_BASE_URL = this.appConfigProvider.getConfig().dashboardUrl;
94
93
 
@@ -99,8 +98,7 @@ export class IonListConversationsComponent extends ListConversationsComponent im
99
98
  }
100
99
  ngOnInit() {
101
100
  this.isApp = this.platform.is('ios') || this.platform.is('android')
102
- this.logger.log('[ION-LIST-CONVS-COMP] - ngOnInit - IS-APP ', this.isApp)
103
- this.logger.log('[ION-LIST-CONVS-COMP] - ngOnInit - Platform', this.platform.platforms());
101
+ this.logger.log('[ION-LIST-CONVS-COMP] - ngOnInit - IS-APP ', this.isApp);
104
102
 
105
103
  }
106
104
 
@@ -91,24 +91,21 @@ export class InfoContentComponent implements OnInit {
91
91
  const lastArrayElement = conversationWith_segments[conversationWith_segments.length - 1]
92
92
  this.logger.log('[INFO-CONTENT-COMP] - paramMap.subscribe lastArrayElement ', lastArrayElement);
93
93
  this.logger.log('[INFO-CONTENT-COMP] - paramMap.subscribe lastArrayElement length', lastArrayElement.length);
94
- if (lastArrayElement.length !== 32) {
95
- conversationWith_segments.pop();
96
- }
94
+ // if (lastArrayElement.length !== 32) {
95
+ // conversationWith_segments.pop();
96
+ // }
97
97
  }
98
98
 
99
99
 
100
100
  this.logger.log('[INFO-CONTENT-COMP] - paramMap.subscribe conversationWith_segments: ', conversationWith_segments);
101
101
 
102
102
  if (this.conversationWith.startsWith("support-group")) {
103
- if (conversationWith_segments.length === 4) {
103
+ // if (conversationWith_segments.length === 4) {
104
104
  this.project_id = conversationWith_segments[2];
105
-
106
105
  this.selectInfoContentTypeInfoSupportGroup();
107
-
108
- } else {
109
-
110
- this.getProjectIdByConversationWith(this.conversationWith)
111
- }
106
+ // } else {
107
+ // this.getProjectIdByConversationWith(this.conversationWith)
108
+ // }
112
109
  } else {
113
110
  this.selectInfoContentTypeDirectAndGroup(this.conversationWith);
114
111
  }
@@ -118,25 +115,25 @@ export class InfoContentComponent implements OnInit {
118
115
 
119
116
  }
120
117
 
121
- getProjectIdByConversationWith(conversationWith: string) {
122
- const tiledeskToken = this.tiledeskAuthService.getTiledeskToken();
118
+ // getProjectIdByConversationWith(conversationWith: string) {
119
+ // const tiledeskToken = this.tiledeskAuthService.getTiledeskToken();
123
120
 
124
- this.tiledeskService.getProjectIdByConvRecipient(tiledeskToken, conversationWith).subscribe(res => {
125
- this.logger.log('[INFO-CONTENT-COMP] - GET PROJECTID BY CONV RECIPIENT RES', res);
121
+ // this.tiledeskService.getProjectIdByConvRecipient(tiledeskToken, conversationWith).subscribe(res => {
122
+ // this.logger.log('[INFO-CONTENT-COMP] - GET PROJECTID BY CONV RECIPIENT RES', res);
126
123
 
127
- if (res) {
128
- this.project_id = res.id_project
129
- this.logger.log('[INFO-CONTENT-COMP] - GET PROJECTID BY CONV RECIPIENT this.project_id', this.project_id);
130
- }
124
+ // if (res) {
125
+ // this.project_id = res.id_project
126
+ // this.logger.log('[INFO-CONTENT-COMP] - GET PROJECTID BY CONV RECIPIENT this.project_id', this.project_id);
127
+ // }
131
128
 
132
- }, (error) => {
133
- this.logger.error('[INFO-CONTENT-COMP] - GET PROJECTID BY CONV RECIPIENT - ERROR ', error);
129
+ // }, (error) => {
130
+ // this.logger.error('[INFO-CONTENT-COMP] - GET PROJECTID BY CONV RECIPIENT - ERROR ', error);
134
131
 
135
- }, () => {
136
- this.logger.log('[INFO-CONTENT-COMP] - GET PROJECTID BY CONV RECIPIENT * COMPLETE *');
137
- this.selectInfoContentTypeInfoSupportGroup();
138
- });
139
- }
132
+ // }, () => {
133
+ // this.logger.log('[INFO-CONTENT-COMP] - GET PROJECTID BY CONV RECIPIENT * COMPLETE *');
134
+ // this.selectInfoContentTypeInfoSupportGroup();
135
+ // });
136
+ // }
140
137
 
141
138
  ngOnInit() {
142
139
  this.logger.log('>>> N INFO-CONTENT-COMP CALLING ngOnInit');
@@ -11,25 +11,40 @@
11
11
  <div *ngIf="numberOpenConv > 0" class="number-open-conv">({{numberOpenConv}})</div>
12
12
  </ion-title>
13
13
 
14
- <ion-buttons slot="end">
14
+ <ion-buttons slot="start">
15
+ <ion-button *ngIf="sound_btn==='enabled'" ion-button fill="clear" (click)="onSoundChangeFN('disabled')">
16
+ <ion-icon slot="icon-only" name="volume-high-outline" ></ion-icon>
17
+ </ion-button>
15
18
 
19
+ <ion-button *ngIf="sound_btn==='disabled'" ion-button fill="clear" (click)="onSoundChangeFN('enabled')">
20
+ <ion-icon slot="icon-only" name="volume-mute-outline" ></ion-icon>
21
+ </ion-button>
22
+ </ion-buttons>
23
+
24
+ <ion-buttons slot="end">
25
+
16
26
  <ion-button ion-button fill="clear" (click)="presentCreateTicketModal()"
17
- tooltip="{{translationMap?.get('CreateTicket')}}" [options]="tooltipOptions" placement="bottom">
27
+ tooltip="{{translationMap?.get('CreateTicket')}}"
28
+ [options]="tooltipOptions"
29
+ placement="bottom">
18
30
  <ion-icon slot="icon-only" name="ticket-outline"></ion-icon>
19
31
  </ion-button>
20
32
 
21
33
  <ion-button *ngIf="archived_btn" ion-button fill="clear" (click)="onClickArchivedConversation()"
22
- tooltip="{{translationMap?.get('ViewArchivedConversations')}}" [options]="tooltipOptions" placement="bottom">
34
+ tooltip="{{translationMap?.get('ViewArchivedConversations')}}"
35
+ [options]="tooltipOptions"
36
+ placement="bottom">
23
37
  <ion-icon slot="icon-only" name="file-tray-full-outline"></ion-icon>
24
38
  <!-- <ion-icon name="file-tray-stacked-outline"></ion-icon> -->
25
39
  <!-- <ion-icon name="file-tray-full-outline"></ion-icon> -->
26
40
  </ion-button>
27
41
 
28
42
  <ion-button *ngIf="writeto_btn" ion-button fill="clear" (click)="onOpenContactsDirectory($event)"
29
- tooltip="{{translationMap?.get('ViewContactsList')}}" [options]="tooltipOptions" placement="bottom">
43
+ tooltip="{{translationMap?.get('ViewContactsList')}}"
44
+ [options]="tooltipOptions"
45
+ placement="bottom">
30
46
  <ion-icon slot="icon-only" name="create-outline"></ion-icon>
31
47
  <!-- <ion-icon slot="icon-only" name="people-outline"></ion-icon> -->
32
-
33
48
  </ion-button>
34
49
 
35
50
  <!-- <button ion-button icon-only (click)="onOpenArchivedConversationsPage()">
@@ -9,12 +9,16 @@ import { CustomTranslateService } from 'src/chat21-core/providers/custom-transla
9
9
  styleUrls: ['./ddp-header.component.scss'],
10
10
  })
11
11
  export class DdpHeaderComponent implements OnInit {
12
+
12
13
  @Input() numberOpenConv: number
13
14
  @Input() supportMode: boolean
14
15
  @Input() archived_btn: boolean
15
16
  @Input() writeto_btn: boolean
17
+ @Input() sound_btn: string
18
+ @Output() onSoundChange = new EventEmitter<string>()
16
19
  @Output() openContactsDirectory = new EventEmitter()
17
20
  @Output() openProfileInfo = new EventEmitter()
21
+
18
22
  IS_ON_MOBILE_DEVICE: boolean
19
23
  createTicketModal = null
20
24
  public translationMap: Map<string, string>;
@@ -87,6 +91,10 @@ export class DdpHeaderComponent implements OnInit {
87
91
  onOpenContactsDirectory(e: any) {
88
92
  this.openContactsDirectory.emit(e)
89
93
  }
94
+
95
+ onSoundChangeFN(e: any){
96
+ this.onSoundChange.emit(e)
97
+ }
90
98
  // END @Output() //
91
99
 
92
100
  onClickArchivedConversation() {