@chat21/chat21-ionic 3.4.27-rc12 → 3.4.27-rc13

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
@@ -8,6 +8,9 @@
8
8
  ### **Copyrigth**:
9
9
  *Tiledesk SRL*
10
10
 
11
+ # 3.4.27-rc13
12
+ - **added**: ability to mantain logout parameter when redirect to dashboard urls from sidebar component
13
+
11
14
  # 3.4.27-rc12
12
15
  - **added**: ability to manage logOut option in sidebar-user-detail with tiledesk_logOut url query params
13
16
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@chat21/chat21-ionic",
3
3
  "author": "Tiledesk SRL",
4
- "version": "3.4.27-rc12",
4
+ "version": "3.4.27-rc13",
5
5
  "license": "MIT License",
6
6
  "homepage": "https://tiledesk.com/",
7
7
  "repository": {
@@ -123,8 +123,26 @@ export class SidebarComponent implements OnInit {
123
123
  TILEDESK: 'https://www.tiledesk.com'
124
124
  };
125
125
 
126
+ this.setQueryParamsForAll({ tiledesk_logOut: BRAND_BASE_INFO['LOGOUT_ENABLED'] });
127
+
126
128
  }
127
129
 
130
+ // Funzione helper per aggiungere query params a tutte le URL
131
+ setQueryParamsForAll(queryParams: any) {
132
+ if (!queryParams) return;
133
+
134
+ const queryString = new URLSearchParams(queryParams).toString();
135
+
136
+ // Cicla tutte le chiavi di URLS
137
+ Object.keys(this.URLS).forEach(key => {
138
+ if (this.URLS[key]) {
139
+ // Controlla se già ci sono query params
140
+ const separator = this.URLS[key].includes('?') ? '&' : '?';
141
+ this.URLS[key] = `${this.URLS[key]}${queryString ? separator + queryString : ''}`;
142
+ }
143
+ });
144
+ }
145
+
128
146
  subcribeToAuthStateChanged() {
129
147
  this.messagingAuthService.BSAuthStateChanged.subscribe((state) => {
130
148
  this.logger.log('[SIDEBAR] BSAuthStateChanged ', state)
@@ -916,12 +916,17 @@ export class ConversationListPage implements OnInit {
916
916
 
917
917
  this.logger.log('[CONVS-LIST-PAGE] navigateByUrl this.uidConvSelected ', this.uidConvSelected)
918
918
 
919
+ const queryParams = this.route.snapshot.queryParams;
920
+ const queryString = new URLSearchParams(queryParams).toString();
921
+
922
+
919
923
  this.setUidConvSelected(uidConvSelected, converationType)
920
924
  if (checkPlatformIsMobile()) {
921
925
  this.logger.log('[CONVS-LIST-PAGE] checkPlatformIsMobile(): ', checkPlatformIsMobile())
922
926
  this.logger.log('[CONVS-LIST-PAGE] DESKTOP (window < 768)', this.navService)
923
927
  this.logger.log('[CONVS-LIST-PAGE] navigateByUrl this.conversationSelected conversation_with_fullname ', this.conversationSelected)
924
928
  let pageUrl = 'conversation-detail/' + this.uidConvSelected + '/' + this.conversationSelected.conversation_with_fullname + '/' + converationType
929
+ pageUrl += queryString ? `?${queryString}` : '';
925
930
  this.logger.log('[CONVS-LIST-PAGE] pageURL', pageUrl)
926
931
  // replace(/\(/g, '%28').replace(/\)/g, '%29') -> used for the encoder of any round brackets
927
932
  this.router.navigateByUrl(pageUrl.replace(/\(/g, '%28').replace(/\)/g, '%29').replace( /#/g, "%23" ), {replaceUrl: true})
@@ -933,8 +938,10 @@ export class ConversationListPage implements OnInit {
933
938
  if (this.conversationSelected && this.conversationSelected.conversation_with_fullname) {
934
939
  pageUrl = 'conversation-detail/' + this.uidConvSelected + '/' + this.conversationSelected.conversation_with_fullname + '/' + converationType
935
940
  }
941
+ pageUrl += queryString ? `?${queryString}` : '';
936
942
  this.logger.log('[CONVS-LIST-PAGE] setUidConvSelected navigateByUrl--->: ', pageUrl)
937
943
  // replace(/\(/g, '%28').replace(/\)/g, '%29') -> used for the encoder of any round brackets
944
+
938
945
  this.router.navigateByUrl(pageUrl.replace(/\(/g, '%28').replace(/\)/g, '%29').replace( /#/g, "%23" ), {replaceUrl: true})
939
946
  }
940
947
  }