@chat21/chat21-ionic 3.0.61-rc25 → 3.0.61-rc26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # chat21-ionic ver 3.0
2
2
 
3
+ ### 3.0.61-rc26
4
+ - Fixes the bug: the conversation detail is not opened if the URL contains round brackets
5
+
3
6
  ### 3.0.61-rc25
4
7
  - Handles the case that in the storage the value of the "last_project" key is undefined
5
8
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chat21/chat21-ionic",
3
- "version": "3.0.61-rc25",
3
+ "version": "3.0.61-rc26",
4
4
  "author": "Tiledesk SRL",
5
5
  "homepage": "https://tiledesk.com/",
6
6
  "scripts": {
@@ -754,8 +754,8 @@ export class AppComponent implements OnInit {
754
754
  if (IDConv && FullNameConv) {
755
755
  pageUrl += IDConv + '/' + FullNameConv + '/' + Convtype
756
756
  }
757
-
758
- this.router.navigateByUrl(pageUrl);
757
+ // replace(/\(/g, '%28').replace(/\)/g, '%29') -> used for the encoder of any round brackets
758
+ this.router.navigateByUrl(pageUrl.replace(/\(/g, '%28').replace(/\)/g, '%29'));
759
759
 
760
760
 
761
761
  // const DASHBOARD_URL = this.appConfigProvider.getConfig().DASHBOARD_URL;
@@ -99,7 +99,7 @@ export class IonConversationDetailComponent extends ConversationContentComponent
99
99
 
100
100
  if (!this.public_Key.includes('CAR')) {
101
101
  this.areVisibleCAR = false
102
- console.log('[CONVS-DETAIL][ION-CONVS-DETAIL] PUBLIC-KEY - areVisibleCAR', this.areVisibleCAR)
102
+ // console.log('[CONVS-DETAIL][ION-CONVS-DETAIL] PUBLIC-KEY - areVisibleCAR', this.areVisibleCAR)
103
103
  }
104
104
  } else {
105
105
  this.areVisibleCAR = false
@@ -15,7 +15,7 @@ export class ListConversationsComponent implements OnInit {
15
15
  @Input() listConversations: ConversationModel[];
16
16
  @Input() limit?: number
17
17
  @Input() stylesMap: Map<string, string>;
18
- @Input() translationMap: Map< string, string>;
18
+ @Input() translationMap: Map<string, string>;
19
19
  @Output() onConversationSelected = new EventEmitter<ConversationModel>();
20
20
  @Output() onImageLoaded = new EventEmitter<ConversationModel>();
21
21
  @Output() onConversationLoaded = new EventEmitter<ConversationModel>();
@@ -29,9 +29,11 @@ export class ListConversationsComponent implements OnInit {
29
29
  arrayDiffer: any;
30
30
 
31
31
  uidConvSelected: string;
32
- constructor(public iterableDiffers: IterableDiffers,
33
- public kvDiffers: KeyValueDiffers) {
34
- this.iterableDifferListConv = this.iterableDiffers.find([]).create(null);
32
+ constructor(
33
+ public iterableDiffers: IterableDiffers,
34
+ public kvDiffers: KeyValueDiffers
35
+ ) {
36
+ this.iterableDifferListConv = this.iterableDiffers.find([]).create(null);
35
37
  }
36
38
 
37
39
  ngOnInit() {
@@ -44,7 +46,7 @@ export class ListConversationsComponent implements OnInit {
44
46
  // })
45
47
  }
46
48
 
47
- ngOnChanges(changes: SimpleChanges){
49
+ ngOnChanges(changes: SimpleChanges) {
48
50
  // console.log('empDifferMap:: 1111' + JSON.stringify(this.listConversations[1]))
49
51
  // console.log('empDifferMap:: 1111', this.listConversations)
50
52
  // this.listConversations.forEach(emp => {
@@ -56,7 +58,8 @@ export class ListConversationsComponent implements OnInit {
56
58
 
57
59
  public openConversationByID(conversation) {
58
60
  this.logger.log('[LISTCONVERSATIONS-W] openConversationByID: ', conversation);
59
- if ( conversation ) {
61
+ if (conversation) {
62
+ this.logger.log(conversation.recipient_fullname)
60
63
  // this.conversationsService.updateIsNew(conversation);
61
64
  // this.conversationsService.updateConversationBadge();
62
65
  this.uidConvSelected = conversation.uid
@@ -67,10 +70,10 @@ export class ListConversationsComponent implements OnInit {
67
70
  ngAfterViewInit() {
68
71
  this.logger.log('[LISTCONVERSATIONS-W] ---ngAfterViewInit---: listConversations ', this.listConversations);
69
72
  }
70
-
73
+
71
74
  ngDoCheck() {
72
75
  let changesListConversation = this.iterableDifferListConv.diff(this.listConversations);
73
- if(changesListConversation){
76
+ if (changesListConversation) {
74
77
  // changesListConversation.forEachAddedItem(element => {
75
78
  // console.log('itemmmm 1111 added ', element)
76
79
  // let conv = element.item
@@ -104,7 +107,7 @@ export class ListConversationsComponent implements OnInit {
104
107
  // console.log('... Array changes ...', empArrayChanges);
105
108
  // empArrayChanges.forEachAddedItem((record) => {
106
109
  // console.log('1111 Added ', record.currentValue);
107
-
110
+
108
111
  // });
109
112
  // empArrayChanges.forEachRemovedItem((record) => {
110
113
  // console.log('1111 Removed ' + record.previousValue);
@@ -128,7 +131,7 @@ export class ListConversationsComponent implements OnInit {
128
131
  // });
129
132
  // }
130
133
  // }
131
-
134
+
132
135
  }
133
136
 
134
137
 
@@ -227,7 +227,7 @@ export class ConversationListPage implements OnInit {
227
227
 
228
228
  getConversationListHeight() {
229
229
  var scrollbar2element = document.getElementById('scrollbar2')
230
- this.logger.log('[CONVS-LIST-PAGE] getConversationListHeight scrollbar2element',scrollbar2element)
230
+ this.logger.log('[CONVS-LIST-PAGE] getConversationListHeight scrollbar2element', scrollbar2element)
231
231
  }
232
232
 
233
233
  // this.support_mode = null
@@ -245,26 +245,26 @@ export class ConversationListPage implements OnInit {
245
245
  this.supportMode = null
246
246
  if (appConfig && appConfig.supportMode === true || appConfig.supportMode === 'true') {
247
247
  this.supportMode = true;
248
- this.logger.log('[CONVS-LIST-PAGE] getAppConfigToHideDiplayBtns supportMode ', this.supportMode)
249
- } else if (appConfig && appConfig.supportMode === false || appConfig.supportMode === 'false') {
248
+ this.logger.log('[CONVS-LIST-PAGE] getAppConfigToHideDiplayBtns supportMode ', this.supportMode)
249
+ } else if (appConfig && appConfig.supportMode === false || appConfig.supportMode === 'false') {
250
250
  this.supportMode = false
251
- this.logger.log('[CONVS-LIST-PAGE] getAppConfigToHideDiplayBtns supportMode ', this.supportMode)
251
+ this.logger.log('[CONVS-LIST-PAGE] getAppConfigToHideDiplayBtns supportMode ', this.supportMode)
252
252
  }
253
253
  this.archived_btn = null
254
- if (appConfig && appConfig.archivedButton === true || appConfig.archivedButton === 'true') {
254
+ if (appConfig && appConfig.archivedButton === true || appConfig.archivedButton === 'true') {
255
255
  this.archived_btn = true;
256
- this.logger.log('[CONVS-LIST-PAGE] getAppConfigToHideDiplayBtns archived_btn ', this.archived_btn)
257
- } else if (appConfig && appConfig.archivedButton === false || appConfig.archivedButton === 'false') {
256
+ this.logger.log('[CONVS-LIST-PAGE] getAppConfigToHideDiplayBtns archived_btn ', this.archived_btn)
257
+ } else if (appConfig && appConfig.archivedButton === false || appConfig.archivedButton === 'false') {
258
258
  this.archived_btn = false;
259
- this.logger.log('[CONVS-LIST-PAGE] getAppConfigToHideDiplayBtns archived_btn ', this.archived_btn)
259
+ this.logger.log('[CONVS-LIST-PAGE] getAppConfigToHideDiplayBtns archived_btn ', this.archived_btn)
260
260
  }
261
261
  this.writeto_btn = null
262
262
  if (appConfig && appConfig.writeToButton === true || appConfig.writeToButton === 'true') {
263
263
  this.writeto_btn = true;
264
- this.logger.log('[CONVS-LIST-PAGE] getAppConfigToHideDiplayBtns writeto_btn ', this.writeto_btn)
265
- } else if (appConfig && appConfig.writeToButton === false || appConfig.writeToButton === 'false') {
264
+ this.logger.log('[CONVS-LIST-PAGE] getAppConfigToHideDiplayBtns writeto_btn ', this.writeto_btn)
265
+ } else if (appConfig && appConfig.writeToButton === false || appConfig.writeToButton === 'false') {
266
266
  this.writeto_btn = false;
267
- this.logger.log('[CONVS-LIST-PAGE] getAppConfigToHideDiplayBtns writeto_btn ', this.writeto_btn)
267
+ this.logger.log('[CONVS-LIST-PAGE] getAppConfigToHideDiplayBtns writeto_btn ', this.writeto_btn)
268
268
  }
269
269
  // console.log('[ION-LIST-CONVS-COMP] - supportMode ', this.supportMode)
270
270
  }
@@ -272,7 +272,7 @@ export class ConversationListPage implements OnInit {
272
272
  watchToConnectionStatus() {
273
273
  this.networkService.checkInternetFunc().subscribe((isOnline) => {
274
274
  this.checkInternet = isOnline
275
- this.logger.log('[ION-LIST-CONVS-COMP] - watchToConnectionStatus - isOnline', this.checkInternet)
275
+ this.logger.log('[ION-LIST-CONVS-COMP] - watchToConnectionStatus - isOnline', this.checkInternet)
276
276
 
277
277
  // checking internet connection
278
278
  if (this.checkInternet == true) {
@@ -845,29 +845,13 @@ export class ConversationListPage implements OnInit {
845
845
  if (uidConvSelected) {
846
846
  let conversationSelected
847
847
  if (conversationType === 'active') {
848
- conversationSelected = this.conversations.find(
849
- (item) => item.uid === this.uidConvSelected,
850
- )
851
- } else if (conversationType === 'archived') {
852
- conversationSelected = this.archivedConversations.find(
853
- (item) => item.uid === this.uidConvSelected,
854
- )
855
- }
848
+ conversationSelected = this.conversations.find((item) => item.uid === this.uidConvSelected)
849
+ } else if (conversationType === 'archived') { conversationSelected = this.archivedConversations.find((item) => item.uid === this.uidConvSelected) }
856
850
  if (conversationSelected) {
857
- this.logger.log(
858
- '[CONVS-LIST-PAGE] conversationSelected',
859
- conversationSelected,
860
- )
861
- this.logger.log(
862
- '[CONVS-LIST-PAGE] the conversation ',
863
- this.conversationSelected,
864
- ' has already been loaded',
865
- )
851
+ this.logger.log('[CONVS-LIST-PAGE] conversationSelected', conversationSelected,)
852
+ this.logger.log('[CONVS-LIST-PAGE] the conversation ', this.conversationSelected, ' has already been loaded')
866
853
  this.conversationSelected = conversationSelected
867
- this.logger.log(
868
- '[CONVS-LIST-PAGE] setUidConvSelected: ',
869
- this.conversationSelected,
870
- )
854
+ this.logger.log('[CONVS-LIST-PAGE] setUidConvSelected: ', this.conversationSelected)
871
855
  }
872
856
  }
873
857
  }
@@ -876,16 +860,11 @@ export class ConversationListPage implements OnInit {
876
860
  this.logger.log('onConversationSelected conversation', conversation)
877
861
  if (conversation.archived) {
878
862
  this.navigateByUrl('archived', conversation.uid)
879
- this.logger.log(
880
- '[CONVS-LIST-PAGE] onConversationSelected archived conversation.uid ',
881
- conversation.uid,
863
+ this.logger.log('[CONVS-LIST-PAGE] onConversationSelected archived conversation.uid ', conversation.uid,
882
864
  )
883
865
  } else {
884
866
  this.navigateByUrl('active', conversation.uid)
885
- this.logger.log(
886
- '[CONVS-LIST-PAGE] onConversationSelected active conversation.uid ',
887
- conversation.uid,
888
- )
867
+ this.logger.log('[CONVS-LIST-PAGE] onConversationSelected active conversation.uid ', conversation.uid)
889
868
  }
890
869
  }
891
870
 
@@ -922,52 +901,35 @@ export class ConversationListPage implements OnInit {
922
901
 
923
902
  var regex = /<br\s*[\/]?>/gi
924
903
  if (conversation && conversation.last_message_text) {
925
- conversation.last_message_text = conversation.last_message_text.replace(
926
- regex,
927
- '',
928
- )
904
+ conversation.last_message_text = conversation.last_message_text.replace(regex, '',)
929
905
 
930
906
  //FIX-BUG: 'YOU: YOU: YOU: text' on last-message-text in conversation-list
931
- if (
932
- conversation.sender === this.loggedUserUid &&
933
- !conversation.last_message_text.includes(': ')
934
- ) {
907
+ if (conversation.sender === this.loggedUserUid && !conversation.last_message_text.includes(': ')) {
935
908
  // this.logger.log('[CONVS-LIST-PAGE] onConversationLoaded', conversation)
936
909
 
937
910
  if (conversation.type !== 'image' && conversation.type !== 'file') {
938
- conversation.last_message_text =
939
- translationMap.get('YOU') + ': ' + conversation.last_message_text
911
+ conversation.last_message_text = translationMap.get('YOU') + ': ' + conversation.last_message_text
940
912
  } else if (conversation.type === 'image') {
941
913
  // this.logger.log('[CONVS-LIST-PAGE] HAS SENT AN IMAGE');
942
914
  // this.logger.log("[CONVS-LIST-PAGE] translationMap.get('YOU')")
943
- const SENT_AN_IMAGE = (conversation[
944
- 'last_message_text'
945
- ] = translationMap.get('SENT_AN_IMAGE'))
915
+ const SENT_AN_IMAGE = (conversation['last_message_text'] = translationMap.get('SENT_AN_IMAGE'))
946
916
 
947
- conversation.last_message_text =
948
- translationMap.get('YOU') + ': ' + SENT_AN_IMAGE
917
+ conversation.last_message_text = translationMap.get('YOU') + ': ' + SENT_AN_IMAGE
949
918
  } else if (conversation.type === 'file') {
950
919
  // this.logger.log('[CONVS-LIST-PAGE] HAS SENT FILE')
951
- const SENT_AN_ATTACHMENT = (conversation[
952
- 'last_message_text'
953
- ] = translationMap.get('SENT_AN_ATTACHMENT'))
954
- conversation.last_message_text =
955
- translationMap.get('YOU') + ': ' + SENT_AN_ATTACHMENT
920
+ const SENT_AN_ATTACHMENT = (conversation['last_message_text'] = translationMap.get('SENT_AN_ATTACHMENT'))
921
+ conversation.last_message_text = translationMap.get('YOU') + ': ' + SENT_AN_ATTACHMENT
956
922
  }
957
923
  } else {
958
924
  if (conversation.type === 'image') {
959
925
  // this.logger.log('[CONVS-LIST-PAGE] HAS SENT AN IMAGE');
960
926
  // this.logger.log("[CONVS-LIST-PAGE] translationMap.get('YOU')")
961
- const SENT_AN_IMAGE = (conversation[
962
- 'last_message_text'
963
- ] = translationMap.get('SENT_AN_IMAGE'))
927
+ const SENT_AN_IMAGE = (conversation['last_message_text'] = translationMap.get('SENT_AN_IMAGE'))
964
928
 
965
929
  conversation.last_message_text = SENT_AN_IMAGE
966
930
  } else if (conversation.type === 'file') {
967
931
  // this.logger.log('[CONVS-LIST-PAGE] HAS SENT FILE')
968
- const SENT_AN_ATTACHMENT = (conversation[
969
- 'last_message_text'
970
- ] = translationMap.get('SENT_AN_ATTACHMENT'))
932
+ const SENT_AN_ATTACHMENT = (conversation['last_message_text'] = translationMap.get('SENT_AN_ATTACHMENT'))
971
933
  conversation.last_message_text = SENT_AN_ATTACHMENT
972
934
  }
973
935
  }
@@ -986,69 +948,31 @@ export class ConversationListPage implements OnInit {
986
948
  // }
987
949
 
988
950
  navigateByUrl(converationType: string, uidConvSelected: string) {
989
- this.logger.log('[CONVS-LIST-PAGE] calling navigateByUrl: ')
990
- this.logger.log(
991
- '[CONVS-LIST-PAGE] navigateByUrl uidConvSelected: ',
992
- uidConvSelected,
993
- )
994
- this.logger.log(
995
- '[CONVS-LIST-PAGE] navigateByUrl run this.setUidConvSelected',
996
- )
997
- this.logger.log(
998
- '[CONVS-LIST-PAGE] navigateByUrl this.uidConvSelected ',
999
- this.uidConvSelected,
1000
- )
1001
- this.logger.log(
1002
- '[CONVS-LIST-PAGE] navigateByUrl this.conversationSelected ',
1003
- this.conversationSelected,
1004
- )
951
+
952
+ this.logger.log('[CONVS-LIST-PAGE] navigateByUrl uidConvSelected: ', uidConvSelected)
953
+
954
+ this.logger.log('[CONVS-LIST-PAGE] navigateByUrl this.uidConvSelected ', this.uidConvSelected)
1005
955
 
1006
956
  this.setUidConvSelected(uidConvSelected, converationType)
1007
957
  if (checkPlatformIsMobile()) {
1008
- this.logger.log(
1009
- '[CONVS-LIST-PAGE] checkPlatformIsMobile(): ',
1010
- checkPlatformIsMobile(),
1011
- )
1012
- this.logger.log(
1013
- '[CONVS-LIST-PAGE] DESKTOP (window >= 768)',
1014
- this.navService,
1015
- )
1016
- let pageUrl =
1017
- 'conversation-detail/' +
1018
- this.uidConvSelected +
1019
- '/' +
1020
- this.conversationSelected.conversation_with_fullname +
1021
- '/' +
1022
- converationType
958
+ this.logger.log('[CONVS-LIST-PAGE] checkPlatformIsMobile(): ', checkPlatformIsMobile())
959
+ this.logger.log('[CONVS-LIST-PAGE] DESKTOP (window < 768)', this.navService)
960
+ this.logger.log('[CONVS-LIST-PAGE] navigateByUrl this.conversationSelected conversation_with_fullname ', this.conversationSelected.conversation_with_fullname)
961
+ let pageUrl = 'conversation-detail/' + this.uidConvSelected + '/' + this.conversationSelected.conversation_with_fullname + '/' + converationType
1023
962
  this.logger.log('[CONVS-LIST-PAGE] pageURL', pageUrl)
1024
- this.router.navigateByUrl(pageUrl)
963
+ // replace(/\(/g, '%28').replace(/\)/g, '%29') -> used for the encoder of any round brackets
964
+ this.router.navigateByUrl(pageUrl.replace(/\(/g, '%28').replace(/\)/g, '%29'))
1025
965
  } else {
1026
- this.logger.log(
1027
- '[CONVS-LIST-PAGE] checkPlatformIsMobile(): ',
1028
- checkPlatformIsMobile(),
1029
- )
1030
- this.logger.log(
1031
- '[CONVS-LIST-PAGE] MOBILE (window < 768) ',
1032
- this.navService,
1033
- )
966
+ this.logger.log('[CONVS-LIST-PAGE] navigateByUrl this.conversationSelected conversation_with_fullname ', this.conversationSelected.conversation_with_fullname)
967
+ this.logger.log('[CONVS-LIST-PAGE] checkPlatformIsMobile(): ', checkPlatformIsMobile())
968
+ this.logger.log('[CONVS-LIST-PAGE] MOBILE (window >= 768) ', this.navService)
1034
969
  let pageUrl = 'conversation-detail/' + this.uidConvSelected
1035
- if (
1036
- this.conversationSelected &&
1037
- this.conversationSelected.conversation_with_fullname
1038
- ) {
1039
- pageUrl =
1040
- 'conversation-detail/' +
1041
- this.uidConvSelected +
1042
- '/' +
1043
- this.conversationSelected.conversation_with_fullname +
1044
- '/' +
1045
- converationType
970
+ if (this.conversationSelected && this.conversationSelected.conversation_with_fullname) {
971
+ pageUrl = 'conversation-detail/' + this.uidConvSelected + '/' + this.conversationSelected.conversation_with_fullname + '/' + converationType
1046
972
  }
1047
- this.logger.log(
1048
- '[CONVS-LIST-PAGE] setUidConvSelected navigateByUrl--->: ',
1049
- pageUrl,
1050
- )
1051
- this.router.navigateByUrl(pageUrl)
973
+ this.logger.log('[CONVS-LIST-PAGE] setUidConvSelected navigateByUrl--->: ', pageUrl)
974
+ // replace(/\(/g, '%28').replace(/\)/g, '%29') -> used for the encoder of any round brackets
975
+ this.router.navigateByUrl(pageUrl.replace(/\(/g, '%28').replace(/\)/g, '%29'))
1052
976
  }
1053
977
  }
1054
978
 
@@ -1121,7 +1045,7 @@ export class ConversationListPage implements OnInit {
1121
1045
  if (conversation) {
1122
1046
  const conversationId = conversation.uid
1123
1047
 
1124
- this.logger.log( '[CONVS-LIST-PAGE] onCloseConversation conversationId: ', conversationId )
1048
+ this.logger.log('[CONVS-LIST-PAGE] onCloseConversation conversationId: ', conversationId)
1125
1049
 
1126
1050
  const conversationWith_segments = conversationId.split('-')
1127
1051
  this.logger.log(