@chat21/chat21-ionic 3.0.65-rc2 → 3.0.67

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 (48) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/deploy_amazon_prod.sh +3 -3
  3. package/package.json +3 -3
  4. package/src/app/app.component.ts +65 -67
  5. package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.ts +0 -10
  6. package/src/app/chatlib/conversation-detail/message/return-receipt/return-receipt.component.html +49 -4
  7. package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.html +1 -1
  8. package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.ts +18 -30
  9. package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.html +1 -1
  10. package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.scss +2 -0
  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 +5 -0
  14. package/src/app/components/sidebar/sidebar.component.ts +41 -71
  15. package/src/app/components/sidebar-user-details/sidebar-user-details.component.html +12 -23
  16. package/src/app/components/sidebar-user-details/sidebar-user-details.component.scss +3 -0
  17. package/src/app/components/sidebar-user-details/sidebar-user-details.component.ts +88 -136
  18. package/src/app/directives/truncate.pipe.ts +0 -1
  19. package/src/app/pages/authentication/login/login.page.ts +0 -1
  20. package/src/app/pages/conversation-detail/conversation-detail.page.ts +47 -72
  21. package/src/app/pages/conversations-list/conversations-list.page.html +3 -1
  22. package/src/app/pages/conversations-list/conversations-list.page.ts +50 -5
  23. package/src/app/pages/loader-preview/loader-preview.page.ts +12 -43
  24. package/src/assets/i18n/ar.json +266 -0
  25. package/src/assets/i18n/uk.json +266 -0
  26. package/src/chat-config-pre.json +1 -0
  27. package/src/chat21-core/providers/abstract/archivedconversations-handler.service.ts +1 -2
  28. package/src/chat21-core/providers/abstract/conversations-handler.service.ts +2 -4
  29. package/src/chat21-core/providers/firebase/firebase-archivedconversations-handler.ts +29 -25
  30. package/src/chat21-core/providers/firebase/firebase-auth-service.ts +2 -3
  31. package/src/chat21-core/providers/firebase/firebase-conversation-handler.ts +4 -4
  32. package/src/chat21-core/providers/firebase/firebase-conversations-handler.ts +66 -60
  33. package/src/chat21-core/providers/firebase/firebase-groups-handler.ts +5 -5
  34. package/src/chat21-core/providers/firebase/firebase-presence.service.ts +2 -3
  35. package/src/chat21-core/providers/firebase/firebase-typing.service.ts +2 -2
  36. package/src/chat21-core/providers/firebase/firebase-upload.service.ts +1 -1
  37. package/src/chat21-core/providers/mqtt/mqtt-archivedconversations-handler.ts +3 -6
  38. package/src/chat21-core/providers/mqtt/mqtt-auth-service.ts +3 -3
  39. package/src/chat21-core/providers/mqtt/mqtt-conversation-handler.ts +4 -4
  40. package/src/chat21-core/providers/mqtt/mqtt-conversations-handler.ts +10 -5
  41. package/src/chat21-core/providers/mqtt/mqtt-groups-handler.ts +5 -5
  42. package/src/chat21-core/providers/mqtt/mqtt-presence.service.ts +3 -2
  43. package/src/chat21-core/providers/mqtt/mqtt-typing.service.ts +5 -0
  44. package/src/chat21-core/providers/native/native-upload-service.ts +2 -9
  45. package/src/chat21-core/providers/tiledesk/tiledesk-auth.service.ts +0 -1
  46. package/src/chat21-core/utils/constants.ts +1 -1
  47. package/src/global.scss +2 -2
  48. package/deploy_prod.sh +0 -14
package/CHANGELOG.md CHANGED
@@ -1,5 +1,27 @@
1
1
  # chat21-ionic ver 3.0
2
2
 
3
+ ### 3.0.67 in PROD
4
+ - added: control to 'foregroundCount' when tab is hidden/visible
5
+ - added: sound control on/off to new conversations and conversations changed
6
+
7
+ ### 3.0.66 in PROD
8
+ - added: control to 'foregroundCount' locale storage variable from dashboard
9
+ - added: uk translations
10
+
11
+ ### 3.0.65 in PROD
12
+ - bug-fixed: icons in sidebar were not alignet correctly on Safari
13
+ - bug-fixed: missing translations on sidebar-detail component and login-modal page on start when user logged in for the first time
14
+ - bug-fixed: some icons not showed in side-bar user detail component: replaced material-design-icons with material-icons
15
+ - bug-fixed: if removed conversation.uid is the selected ones, change url from /active to /archived with navigateByUrl after archivedConversation is completed
16
+ - bug-fixed: truncate sender_fullname in conversation-list and conversation-detail header components
17
+ - added: arabic translations language
18
+ - 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)
19
+
20
+ ### 3.0.65-rc3 - LATEST
21
+ - changed: retrive conversations with 'onces' firebase event and remove lastTimestamp from added, changed and removed fireabase subscriptions event
22
+ - bug-fixed: conversation not archived due to conversation_removed unhandled event
23
+ - bug-fixed: if removed conversation.uid is the selected ones, change url from /active to /archived with navigateByUrl after archivedConversation is completed
24
+
3
25
 
4
26
  ### 3.0.65-rc2 - LATEST
5
27
  - 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)
@@ -15,9 +15,9 @@ cp -p src/manifest.json platforms/browser/www/
15
15
  cp -p src/chat-config.json platforms/browser/www/
16
16
 
17
17
  cd platforms/browser/www
18
- # aws s3 sync . s3://tiledesk-console/v2/chat/
19
- # aws s3 sync . s3://tiledesk-console/v2/chat/$version/
20
- aws s3 sync . s3://tiledesk-console/v2/chat/latest/
18
+ aws s3 sync . s3://tiledesk-console/v2/chat/
19
+ aws s3 sync . s3://tiledesk-console/v2/chat/$version/
20
+ # aws s3 sync . s3://tiledesk-console/v2/chat/latest/
21
21
  cd ../../../
22
22
  # aws cloudfront create-invalidation --distribution-id E36UIP90GOSFPM --paths "/*"
23
23
 
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-rc2",
4
+ "version": "3.0.67",
5
5
  "license": "AGPL-3.0",
6
6
  "homepage": "https://tiledesk.com/",
7
7
  "repository": {
@@ -60,7 +60,7 @@
60
60
  "file-saver": "^2.0.5",
61
61
  "firebase": "^8.6.7",
62
62
  "marked": "^2.0.1",
63
- "material-design-icons": "^3.0.1",
63
+ "material-icons": "^1.11.2",
64
64
  "moment": "^2.24.0",
65
65
  "moment-timezone": "^0.5.28",
66
66
  "ng-connection-service": "^1.0.4",
@@ -119,4 +119,4 @@
119
119
  "ios"
120
120
  ]
121
121
  }
122
- }
122
+ }
@@ -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';
@@ -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;
@@ -481,6 +484,7 @@ export class AppComponent implements OnInit {
481
484
  }
482
485
  this.uploadService.initialize();
483
486
 
487
+ this.setLanguage(null)
484
488
  this.initAuthentication();
485
489
  this.initSubscriptions();
486
490
  this.initAudio();
@@ -627,16 +631,13 @@ export class AppComponent implements OnInit {
627
631
 
628
632
 
629
633
  translateToastMsgs() {
630
- this.translate.get('AnErrorOccurredWhileUnsubscribingFromNotifications')
631
- .subscribe((text: string) => {
634
+ this.translate.get('AnErrorOccurredWhileUnsubscribingFromNotifications').subscribe((text: string) => {
632
635
  this.toastMsgErrorWhileUnsubscribingFromNotifications = text;
633
636
  });
634
- this.translate.get('CLOSE_TOAST')
635
- .subscribe((text: string) => {
637
+ this.translate.get('CLOSE_TOAST').subscribe((text: string) => {
636
638
  this.toastMsgCloseToast = text;
637
639
  });
638
- this.translate.get('WAITING_FOR_NETWORK')
639
- .subscribe((text: string) => {
640
+ this.translate.get('WAITING_FOR_NETWORK').subscribe((text: string) => {
640
641
  this.toastMsgWaitingForNetwork = text;
641
642
  });
642
643
  }
@@ -831,6 +832,12 @@ export class AppComponent implements OnInit {
831
832
  this.audio = new Audio();
832
833
  this.audio.src = chatBaseUrl + URL_SOUND_LIST_CONVERSATION;
833
834
  this.audio.load();
835
+
836
+ const sound_status = localStorage.getItem('dshbrd----sound')
837
+ if(sound_status && sound_status !== 'undefined'){
838
+ this.isSoundEnabled = sound_status === 'enabled'? true: false
839
+ }
840
+
834
841
  }
835
842
 
836
843
  private manageTabNotification() {
@@ -849,25 +856,41 @@ export class AppComponent implements OnInit {
849
856
  document.title = "(" + badgeNewConverstionNumber + ") " + that.tabTitle;
850
857
  }
851
858
  }, 1000);
852
- this.soundMessage()
859
+ // if(this.isSoundEnabled) this.soundMessage()
853
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
+
867
+ if(this.isInitialized && this.isSoundEnabled) this.soundMessage()
854
868
  }
855
869
 
856
870
  soundMessage() {
857
871
  const that = this;
858
- // this.audio = new Audio();
859
- // // this.audio.src = '/assets/sounds/pling.mp3';
860
- // this.audio.src = URL_SOUND_LIST_CONVERSATION;
861
- // this.audio.load();
862
872
  this.logger.debug('[APP-COMP] conversation play', this.audio);
863
- clearTimeout(this.setTimeoutSound);
864
- this.setTimeoutSound = setTimeout(function () {
873
+ // clearTimeout(this.setTimeoutSound);
874
+ // this.setTimeoutSound = setTimeout(function () {
875
+ // that.audio.play().then(() => {
876
+ // that.logger.debug('[APP-COMP] ****** soundMessage played *****');
877
+ // }).catch((error: any) => {
878
+ // that.logger.error('[APP-COMP] ***soundMessage error*', error);
879
+ // });
880
+ // }, 4000);
881
+
882
+ //play sound every 4s from the fist time you receive a conversation added/changed
883
+ if(!this.hasPlayed){
865
884
  that.audio.play().then(() => {
885
+ that.hasPlayed = true
866
886
  that.logger.debug('[APP-COMP] ****** soundMessage played *****');
887
+ setTimeout(() => {
888
+ that.hasPlayed = false
889
+ }, 4000);
867
890
  }).catch((error: any) => {
868
891
  that.logger.error('[APP-COMP] ***soundMessage error*', error);
869
892
  });
870
- }, 1000);
893
+ }
871
894
  }
872
895
  /**---------------- SOUND FUNCTIONS --> END <--- +*/
873
896
  /***************************************************+*/
@@ -922,8 +945,8 @@ export class AppComponent implements OnInit {
922
945
  // that.conversationsChanged(conversations);
923
946
  if (conversation && conversation.is_new === true) {
924
947
  this.manageTabNotification()
925
- this.updateConversationsOnStorage()
926
948
  }
949
+ if(conversation) this.updateConversationsOnStorage()
927
950
  });
928
951
 
929
952
  this.conversationsHandlerService.conversationChanged.subscribe((conversation: ConversationModel) => {
@@ -1145,33 +1168,6 @@ export class AppComponent implements OnInit {
1145
1168
  }
1146
1169
 
1147
1170
 
1148
- // listenToLogoutEvent() {
1149
- // this.events.subscribe('profileInfoButtonClick:logout', (hasclickedlogout) => {
1150
- // this.logger.debug('[APP-COMP] hasclickedlogout', hasclickedlogout);
1151
- // if (hasclickedlogout === true) {
1152
- // // ----------------------------------------------
1153
- // // PUSH NOTIFICATIONS
1154
- // // ----------------------------------------------
1155
- // const that = this;
1156
- // const pushEngine = this.appConfigProvider.getConfig().pushEngine
1157
- // if( pushEngine && pushEngine !== 'none'){
1158
- // this.notificationsService.removeNotificationsInstance(function (res) {
1159
- // that.logger.debug('[APP-COMP] FIREBASE-NOTIFICATION >>>> removeNotificationsInstance > CALLBACK RES', res);
1160
-
1161
- // if (res === 'success') {
1162
- // that.removePresenceAndLogout();
1163
- // } else {
1164
- // that.removePresenceAndLogout();
1165
- // that.presentToast();
1166
- // }
1167
- // })
1168
- // }
1169
-
1170
- // }
1171
- // });
1172
- // }
1173
-
1174
-
1175
1171
  async presentToast() {
1176
1172
  const toast = await this.toastController.create({
1177
1173
  message: this.toastMsgErrorWhileUnsubscribingFromNotifications,
@@ -1195,9 +1191,7 @@ export class AppComponent implements OnInit {
1195
1191
  // 1 - init chatConversationsHandler and archviedConversationsHandler
1196
1192
  this.conversationsHandlerService.initialize(this.tenant, userId, translationMap);
1197
1193
  // this.subscribeToConvs()
1198
- const lastTimestamp = this.manageStoredConversations()
1199
- this.logger.log('[APP-COMP] initConversationsHandler: get lastTimestamp', lastTimestamp)
1200
- this.conversationsHandlerService.subscribeToConversations(lastTimestamp, () => {
1194
+ this.conversationsHandlerService.subscribeToConversations(null, () => {
1201
1195
  // this.logger.log('[APP-COMP] - CONVS - INIT CONV')
1202
1196
  const conversations = this.conversationsHandlerService.conversations;
1203
1197
  this.logger.info('initialize FROM [APP-COMP] - [APP-COMP]-CONVS - INIT CONV CONVS', conversations)
@@ -1211,34 +1205,19 @@ export class AppComponent implements OnInit {
1211
1205
 
1212
1206
  }
1213
1207
 
1214
- // START: manage conversations on firebase upon last timestamp from stored conversations
1215
- private manageStoredConversations(): number {
1216
- let timestamp = 0
1217
- if(this.appStorageService.getItem('conversations')){
1218
- const conversationsStored = JSON.parse(this.appStorageService.getItem('conversations'))
1219
- if(conversationsStored && conversationsStored.length > 0) {
1220
- this.conversationsHandlerService.conversations = conversationsStored
1221
- timestamp = conversationsStored[0].timestamp
1222
- this.events.publish('appcompSubscribeToConvs:loadingIsActive', false);
1223
- }
1224
- }
1225
- return timestamp
1226
- }
1227
-
1228
1208
  private updateConversationsOnStorage(){
1229
1209
  const that = this
1230
- //reset timer and save conversation on storage after 2s
1210
+ // reset timer and save conversation on storage after 2s
1231
1211
  clearTimeout(this.setTimeoutConversationsEvent);
1232
1212
  this.setTimeoutConversationsEvent = setTimeout(() => {
1233
- this.logger.debug('[APP-COMP] updateConversationsOnStorage: reset timer and save conversations -> ', this.conversationsHandlerService.conversations.length)
1234
- that.appStorageService.setItem('conversations', JSON.stringify(this.conversationsHandlerService.conversations))
1213
+ // that.logger.debug('[APP-COMP] updateConversationsOnStorage: reset timer and save conversations -> ', this.conversationsHandlerService.conversations.length)
1214
+ // that.appStorageService.setItem('conversations', JSON.stringify(that.conversationsHandlerService.conversations))
1215
+ that.isInitialized = true;
1235
1216
  }, 2000);
1236
1217
  }
1237
- // END: manage conversations on firebase upon last timestamp from stored conversations
1238
1218
 
1239
1219
  private initArchivedConversationsHandler(userId: string) {
1240
1220
  const keys = ['YOU'];
1241
-
1242
1221
  const translationMap = this.translateService.translateLanguage(keys);
1243
1222
 
1244
1223
  this.logger.debug('[APP-COMP] initArchivedConversationsHandler ------------->', userId, this.tenant);
@@ -1246,10 +1225,22 @@ export class AppComponent implements OnInit {
1246
1225
  this.archivedConversationsHandlerService.initialize(this.tenant, userId, translationMap);
1247
1226
  }
1248
1227
 
1228
+ checkAndRemoveDashboardForegroundCount(){
1229
+ try {
1230
+ const dashboardForegroundCount = localStorage.getItem('dshbrd----foregroundcount')
1231
+ this.logger.log('[SIDEBAR] - THERE IS DASHBOARD FOREGROUND COUNT', dashboardForegroundCount)
1232
+ if (dashboardForegroundCount && dashboardForegroundCount !== 'undefined') {
1233
+ localStorage.setItem('dshbrd----foregroundcount', '0')
1234
+ }
1235
+ } catch (err) {
1236
+ this.logger.error('Get local storage dshbrd----foregroundcount ', err)
1237
+ }
1238
+ }
1239
+
1249
1240
 
1250
1241
  @HostListener('document:visibilitychange', [])
1251
1242
  visibilitychange() {
1252
- // this.logger.debug("document TITLE", document.hidden, document.title);
1243
+ this.logger.debug("document TITLE", document.hidden, document.title);
1253
1244
  if (document.hidden) {
1254
1245
  this.isTabVisible = false
1255
1246
  } else {
@@ -1257,6 +1248,7 @@ export class AppComponent implements OnInit {
1257
1248
  clearInterval(this.setIntervalTime)
1258
1249
  this.isTabVisible = true;
1259
1250
  document.title = this.tabTitle;
1251
+ this.checkAndRemoveDashboardForegroundCount()
1260
1252
  }
1261
1253
  }
1262
1254
 
@@ -1266,7 +1258,7 @@ export class AppComponent implements OnInit {
1266
1258
  @HostListener('window:storage', ['$event'])
1267
1259
  onStorageChanged(event: any) {
1268
1260
 
1269
- if (event.key !== 'chat_sv5__tiledeskToken') {
1261
+ if (event.key !== 'chat_sv5__tiledeskToken' && event.key !== 'dshbrd----sound') {
1270
1262
  return;
1271
1263
  }
1272
1264
 
@@ -1303,5 +1295,11 @@ export class AppComponent implements OnInit {
1303
1295
 
1304
1296
  }
1305
1297
  }
1298
+
1299
+ if(event.key === 'dshbrd----sound'){
1300
+ this.events.publish('storage:sound', event.newValue);
1301
+ this.isSoundEnabled = event.newValue === 'enabled'? true: false
1302
+ }
1306
1303
  }
1307
1304
  }
1305
+
@@ -59,16 +59,12 @@ export class BubbleMessageComponent implements OnInit, OnChanges {
59
59
  setMomentLocale() {
60
60
  this.browserLang = this.translate.getBrowserLang();
61
61
  const currentUser = this.tiledeskAuthService.getCurrentUser();
62
- this.logger.log('[BUBBLE-MESSAGE] - ngOnInit - currentUser ', currentUser)
63
62
  let currentUserId = ''
64
63
  if (currentUser) {
65
64
  currentUserId = currentUser.uid
66
- this.logger.log('[BUBBLE-MESSAGE] - ngOnInit - currentUserId ', currentUserId)
67
65
  }
68
66
 
69
67
  const stored_preferred_lang = localStorage.getItem(currentUserId + '_lang');
70
- this.logger.log('[BUBBLE-MESSAGE] stored_preferred_lang: ', stored_preferred_lang);
71
-
72
68
 
73
69
  let chat_lang = ''
74
70
  if (this.browserLang && !stored_preferred_lang) {
@@ -81,15 +77,9 @@ export class BubbleMessageComponent implements OnInit, OnChanges {
81
77
  sameElse: 'LLLL'
82
78
  }
83
79
  });
84
- // this.translate.getTranslation(chat_lang).subscribe((labels: string) => {
85
- // console.log('[BUBBLE-MESSAGE] translations: ', labels);
86
- // });
87
80
  }
88
81
 
89
82
  ngOnChanges() {
90
- this.logger.log('BUBBLE-MSG Hello !!!! this.message ', this.message)
91
- this.logger.log('BUBBLE-MSG ngOnChanges areVisibleCAR', this.areVisibleCAR)
92
- this.logger.log('BUBBLE-MSG ngOnChanges supportMode', this.supportMode)
93
83
  if (this.message && this.message.metadata && typeof this.message.metadata === 'object') {
94
84
  this.getMetadataSize(this.message.metadata)
95
85
  }
@@ -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>
@@ -76,7 +76,7 @@
76
76
 
77
77
 
78
78
  <ion-item button="true" lines="none" class="ion-no-padding" [class.ion-selected]="conversation?.uid === uidConvSelected"
79
- *ngFor="let conversation of listConversations" (click)="openConversationByID(conversation)" detail=false>
79
+ *ngFor="let conversation of listConversations; let index= index" (click)="openConversationByID(conversation)" detail=false>
80
80
  <div tabindex="0"></div>
81
81
 
82
82
  <!-- <div [class.selected]="conversation.uid === uidConvSelected"></div> -->
@@ -41,7 +41,7 @@ export class IonListConversationsComponent extends ListConversationsComponent im
41
41
  public alert_lbl: string;
42
42
  public actionNotAllowed_lbl: string;
43
43
  public youAreNoLongerAmongTheTeammatesManagingThisConversation_lbl: string;
44
- public ok_lbl: string;
44
+ public ok_lbl: string;
45
45
 
46
46
  tooltip_options = {
47
47
  'show-delay': 0,
@@ -119,35 +119,22 @@ public ok_lbl: string;
119
119
 
120
120
 
121
121
  translateLbls() {
122
- this.translate.get('Resolve')
123
- .subscribe((text: string) => {
124
- this.resolve_btn_tooltip = text;
125
- });
126
-
127
- this.translate.get('Archive')
128
- .subscribe((text: string) => {
129
- this.archive_btn_tooltip = text;
130
- });
131
-
132
- this.translate.get('ALERT_TITLE')
133
- .subscribe((text: string) => {
134
- this.alert_lbl = text;
135
- });
136
-
137
- this.translate.get('ActionNotAllowed')
138
- .subscribe((text: string) => {
139
- this.actionNotAllowed_lbl = text;
140
- });
141
-
142
- this.translate.get('YouAreNoLongerAmongTheTeammatesManagingThisConversation')
143
- .subscribe((text: string) => {
144
- this.youAreNoLongerAmongTheTeammatesManagingThisConversation_lbl = text;
145
- });
146
-
147
- this.translate.get('CLOSE_ALERT_CONFIRM_LABEL')
148
- .subscribe((text: string) => {
149
- this.ok_lbl = text;
150
- });
122
+ const translationKeys = [
123
+ 'Resolve',
124
+ 'Archive',
125
+ 'ALERT_TITLE',
126
+ 'ActionNotAllowed',
127
+ 'CLOSE_ALERT_CONFIRM_LABEL',
128
+ 'YouAreNoLongerAmongTheTeammatesManagingThisConversation'
129
+ ]
130
+ this.translate.get(['Resolve', 'Archive', 'ALERT_TITLE']).subscribe((translations: string) => {
131
+ this.resolve_btn_tooltip = translations['Resolve'];
132
+ this.archive_btn_tooltip = translations['Archive'];
133
+ this.alert_lbl = translations['ALERT_TITLE']
134
+ this.actionNotAllowed_lbl = translations['ActionNotAllowed']
135
+ this.ok_lbl = translations['CLOSE_ALERT_CONFIRM_LABEL']
136
+ this.youAreNoLongerAmongTheTeammatesManagingThisConversation_lbl = translations['YouAreNoLongerAmongTheTeammatesManagingThisConversation']
137
+ });
151
138
  }
152
139
 
153
140
  setMomentLocale() {
@@ -227,6 +214,7 @@ public ok_lbl: string;
227
214
  var conversationId = conversation.uid;
228
215
  this.logger.log('[ION-LIST-CONVS-COMP] - closeConversation - conversationId ', conversationId)
229
216
  this.onCloseConversation.emit(conversation)
217
+ let currentIndex = this.listConversations.findIndex(conv => conv.uid === conversation.uid)
230
218
  }
231
219
 
232
220
 
@@ -1,5 +1,5 @@
1
1
  <ion-header no-border class="ion-no-border">
2
- <ion-toolbar style="height:60px">
2
+ <ion-toolbar>
3
3
  <ion-buttons slot="start" style="height:60px" *ngIf="isMobile">
4
4
  <!-- (click)="pushPage('conversations-list')" defaultHref="/conversations-list" -->
5
5
  <ion-back-button style="display: block;" text="" (click)="goBackToConversationList()">
@@ -25,6 +25,8 @@ ion-header {
25
25
  }
26
26
  ion-title {
27
27
  text-align: left;
28
+ padding-inline: unset;
29
+ margin: 0px 10px;
28
30
  height: 40px;
29
31
  width: 100%;
30
32
  }
@@ -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() {
@@ -1,3 +1,4 @@
1
+ import { EventsService } from './../../services/events-service';
1
2
  import { Component, EventEmitter, HostListener, OnInit, Output } from '@angular/core';
2
3
  import { WebsocketService } from 'src/app/services/websocket/websocket.service';
3
4
  import { Subject } from 'rxjs';
@@ -53,6 +54,7 @@ export class ProjectItemComponent implements OnInit {
53
54
  public tiledeskService: TiledeskService,
54
55
  public webSocketJs: WebSocketJs,
55
56
  private appConfigProvider: AppConfigProvider,
57
+ public events: EventsService
56
58
  ) { }
57
59
 
58
60
  ngOnInit() {
@@ -209,10 +211,13 @@ export class ProjectItemComponent implements OnInit {
209
211
  this.logger.log('[PROJECT-ITEM] - LAST PROJECT PARSED ', this.project)
210
212
  }
211
213
 
214
+
215
+
212
216
 
213
217
  }
214
218
 
215
219
  doProjectSubscriptions(project) {
220
+ this.events.publish('storage:last_project', project)
216
221
  this.logger.log('[PROJECT-ITEM] doProjectSubscriptions project ', project)
217
222
  if (project) {
218
223
  const user_role = this.project.role