@chat21/chat21-ionic 3.4.27-rc10 → 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,15 @@
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
+
14
+ # 3.4.27-rc12
15
+ - **added**: ability to manage logOut option in sidebar-user-detail with tiledesk_logOut url query params
16
+
17
+ # 3.4.27-rc11
18
+ - **bug-fixed**: fixed infinite loading in contact list
19
+
11
20
  # 3.4.27-rc10
12
21
  - **added**: ability to manage header-conversation-list with roles
13
22
  - **bug-fixed**: members in group list not loaded
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-rc10",
4
+ "version": "3.4.27-rc13",
5
5
  "license": "MIT License",
6
6
  "homepage": "https://tiledesk.com/",
7
7
  "repository": {
@@ -21,7 +21,9 @@
21
21
  </div> -->
22
22
 
23
23
  <div class="user-details-sidebar" [ngClass]="{'hide-sidebar': IS_ONLINE === false || IS_ON_MOBILE_DEVICE || SUPPORT_MODE === false}">
24
- <app-sidebar-user-details> </app-sidebar-user-details>
24
+ <app-sidebar-user-details
25
+ [logOut]="g?.logOut">
26
+ </app-sidebar-user-details>
25
27
  </div>
26
28
 
27
29
  <ion-split-pane when="md" contentId="main" [ngClass]="{'mobile': IS_ON_MOBILE_DEVICE, 'sidebar-hidden': IS_ON_MOBILE_DEVICE || SUPPORT_MODE === false}">
@@ -45,6 +45,7 @@ import { ProjectService } from './services/projects/project.service';
45
45
  import { ContactsService } from './services/contacts/contacts.service';
46
46
  import { TiledeskService } from './services/tiledesk/tiledesk.service';
47
47
  import { Project } from 'src/chat21-core/models/projects';
48
+ import { BRAND_BASE_INFO } from './utils/utils-resources';
48
49
  import { ProjectUsersService } from './services/project_users/project-users.service';
49
50
 
50
51
  @Component({
@@ -301,6 +302,9 @@ export class AppComponent implements OnInit {
301
302
 
302
303
  this.SUPPORT_MODE = this.g.supportMode
303
304
  this.logger.info('[APP-COMP] this.SUPPORT_MODE', this.SUPPORT_MODE)
305
+
306
+ BRAND_BASE_INFO['LOGOUT_ENABLED'] = this.g.logOut
307
+ this.logger.info('[APP-COMP] this.logOut', BRAND_BASE_INFO['LOGOUT_ENABLED'])
304
308
  }
305
309
 
306
310
  });
@@ -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)
@@ -25,6 +25,7 @@ export class SidebarUserDetailsComponent implements OnInit, OnChanges {
25
25
  // HAS_CLICKED_OPEN_USER_DETAIL: boolean = false;
26
26
  // @Output() onCloseUserDetailsSidebar = new EventEmitter();
27
27
 
28
+ @Input() logOut: boolean;
28
29
 
29
30
  public browserLang: string;
30
31
  private logger: LoggerService = LoggerInstance.getInstance()
@@ -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
  }
@@ -95,7 +95,7 @@ export class GlobalSettingsService {
95
95
  globals[key] = stringToBoolean(val);
96
96
  }
97
97
  // this.logger.debug('[GLOBAL-SET] setVariableFromStorage SET globals == ---------->', globals);
98
- }
98
+ }
99
99
  }
100
100
 
101
101
  /**
@@ -143,5 +143,11 @@ export class GlobalSettingsService {
143
143
  this.appStorageService.setItem('projectID', TEMP)
144
144
  }
145
145
 
146
+ TEMP = getParameterByName(windowContext, 'tiledesk_logOut');
147
+ if (TEMP) {
148
+ globals.logOut = stringToBoolean(TEMP);
149
+ this.appStorageService.setItem('logOut', TEMP)
150
+ }
151
+
146
152
  }
147
153
  }
@@ -15,6 +15,7 @@ export class Globals {
15
15
  jwt: string;
16
16
  fileUploadAccept: string;
17
17
  projectID: string;
18
+ logOut: boolean
18
19
 
19
20
  constructor(
20
21
  ) { }
@@ -36,6 +37,7 @@ export class Globals {
36
37
  this.lang = 'en'
37
38
  this.fileUploadAccept = 'image/*,.pdf,.txt'
38
39
  this.projectID = null;
40
+ this.logOut = true;
39
41
 
40
42
  }
41
43
 
@@ -765,6 +765,12 @@ export function isOnMobileDevice() {
765
765
  return IS_ON_MOBILE_DEVICE;
766
766
  }
767
767
 
768
+
769
+ export function checkIfIsInIframe(){
770
+ const isInIframe = window.self !== window.top;
771
+ return isInIframe;
772
+ }
773
+
768
774
  export function checkWindowWidthIsLessThan991px() {
769
775
  // console.log('UTILS - checkWindowWidthIsLessThan991px:: ', window.innerWidth);
770
776
  if (window.innerWidth < 991) {