@chat21/chat21-ionic 3.4.30-rc3 → 3.4.31
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 +7 -122
- package/angular.json +0 -1
- package/package.json +1 -1
- package/src/app/app.component.html +1 -3
- package/src/app/app.component.ts +10 -71
- package/src/app/components/canned-response/canned-response.component.html +23 -26
- package/src/app/components/canned-response/canned-response.component.scss +2 -0
- package/src/app/components/canned-response/canned-response.component.ts +1 -3
- package/src/app/components/conversation-detail/message-text-area/message-text-area.component.html +1 -24
- package/src/app/components/conversation-detail/message-text-area/message-text-area.component.scss +0 -30
- package/src/app/components/conversation-detail/message-text-area/message-text-area.component.ts +7 -29
- package/src/app/components/conversation-info/info-content/info-content.component.ts +2 -2
- package/src/app/components/conversation-info/info-group/info-group.component.ts +21 -23
- package/src/app/components/conversations-list/header-conversations-list/header-conversations-list.component.html +1 -1
- package/src/app/components/conversations-list/header-conversations-list/header-conversations-list.component.ts +1 -5
- package/src/app/components/navbar/navbar.component.html +3 -3
- package/src/app/components/navbar/navbar.component.ts +38 -29
- package/src/app/components/project-item/project-item.component.ts +11 -11
- package/src/app/components/sidebar/sidebar.component.html +45 -65
- package/src/app/components/sidebar/sidebar.component.ts +117 -110
- package/src/app/components/sidebar-user-details/sidebar-user-details.component.html +2 -2
- package/src/app/components/sidebar-user-details/sidebar-user-details.component.ts +7 -10
- package/src/app/directives/html-entities-encode.pipe.ts +20 -5
- package/src/app/modals/create-ticket/create-ticket.page.ts +2 -4
- package/src/app/pages/conversation-detail/conversation-detail.page.html +3 -7
- package/src/app/pages/conversation-detail/conversation-detail.page.ts +5 -89
- package/src/app/pages/conversations-list/conversations-list.page.html +0 -2
- package/src/app/pages/conversations-list/conversations-list.page.ts +2 -40
- package/src/app/services/global-settings/global-settings.service.ts +3 -11
- package/src/app/services/nav-proxy.service.ts +1 -0
- package/src/app/services/tiledesk/tiledesk.service.ts +16 -0
- package/src/app/services/triggerEvents/triggerEvents.ts +0 -28
- package/src/app/services/websocket/websocket-js.ts +534 -59
- package/src/app/services/websocket/websocket.service.ts +10 -9
- package/src/app/shared/shared.module.ts +2 -11
- package/src/app/utils/globals.ts +0 -2
- package/src/app/utils/project-utils.ts +2 -2
- package/src/app/utils/utils.ts +1 -18
- package/src/assets/i18n/ar.json +1 -11
- package/src/assets/i18n/az.json +1 -11
- package/src/assets/i18n/de.json +1 -11
- package/src/assets/i18n/en.json +1 -11
- package/src/assets/i18n/es.json +1 -11
- package/src/assets/i18n/fr.json +1 -11
- package/src/assets/i18n/it.json +3 -13
- package/src/assets/i18n/kk.json +1 -11
- package/src/assets/i18n/pt.json +1 -11
- package/src/assets/i18n/ru.json +1 -11
- package/src/assets/i18n/sr.json +1 -11
- package/src/assets/i18n/sv.json +1 -11
- package/src/assets/i18n/tr.json +1 -11
- package/src/assets/i18n/uk.json +1 -11
- package/src/assets/i18n/uz.json +1 -12
- package/src/assets/js/chat21client.js +0 -36
- package/src/assets/test.html +2 -5
- package/src/chat-config-template.json +0 -1
- package/src/chat-config.json +0 -1
- package/src/chat21-core/providers/firebase/firebase-conversation-handler.ts +1 -1
- package/src/chat21-core/providers/mqtt/mqtt-conversation-handler.ts +1 -1
- package/src/chat21-core/providers/tiledesk/tiledesk-auth.service.ts +0 -3
- package/src/chat21-core/utils/utils.ts +2 -16
- package/src/app/services/project_users/project-users.service.spec.ts +0 -16
- package/src/app/services/project_users/project-users.service.ts +0 -63
- package/src/app/services/websocket/websocket-js_old.ts +0 -578
- package/src/app/services/websocket/websocket.worker.ts +0 -242
- package/src/app/utils/permissions.constants.ts +0 -138
- package/src/assets/js/agentDesktop-sdk.js +0 -55
- package/src/assets/js/mqtt-keepalive-worker.js +0 -53
- package/src/chat21-core/models/projectUsers.ts +0 -19
|
@@ -121,7 +121,6 @@ export class TiledeskAuthService {
|
|
|
121
121
|
this.http.post(this.URL_TILEDESK_SIGNIN_WITH_CUSTOM_TOKEN, null, requestOptions).subscribe((data) => {
|
|
122
122
|
if (data['success'] && data['token']) {
|
|
123
123
|
that.tiledeskToken = data['token'];
|
|
124
|
-
data['user'].token = tiledeskToken; // mantengo il token custom nell'oggetto user
|
|
125
124
|
that.createCompleteUser(data['user']);
|
|
126
125
|
this.checkAndSetInStorageTiledeskToken(that.tiledeskToken)
|
|
127
126
|
this.BS_IsONLINE.next(true)
|
|
@@ -178,8 +177,6 @@ export class TiledeskAuthService {
|
|
|
178
177
|
this.currentUser = member;
|
|
179
178
|
this.logger.log('[TILEDESK-AUTH] - createCompleteUser member ', member);
|
|
180
179
|
this.appStorage.setItem('currentUser', JSON.stringify(this.currentUser));
|
|
181
|
-
const { iat, aud, iss, jti, ...cleanUser } = user; //destructuring and rest user object
|
|
182
|
-
localStorage.setItem('user', JSON.stringify(cleanUser));
|
|
183
180
|
|
|
184
181
|
} catch (err) {
|
|
185
182
|
this.logger.error('[TILEDESK-AUTH]- createCompleteUser ERR ', err)
|
|
@@ -765,12 +765,6 @@ 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
|
-
|
|
774
768
|
export function checkWindowWidthIsLessThan991px() {
|
|
775
769
|
// console.log('UTILS - checkWindowWidthIsLessThan991px:: ', window.innerWidth);
|
|
776
770
|
if (window.innerWidth < 991) {
|
|
@@ -1024,14 +1018,6 @@ export function isAllowedUrlInText(text: string, allowedUrls: string[]) {
|
|
|
1024
1018
|
}
|
|
1025
1019
|
|
|
1026
1020
|
function extractUrls(text: string): string[] {
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
const matches = text.match(urlRegex) || [];
|
|
1030
|
-
// Normalizza: aggiunge https:// se manca, così il parsing con new URL() funziona
|
|
1031
|
-
return matches.map((url) => {
|
|
1032
|
-
if (!/^https?:\/\//i.test(url)) {
|
|
1033
|
-
return 'https://' + url;
|
|
1034
|
-
}
|
|
1035
|
-
return url;
|
|
1036
|
-
});
|
|
1021
|
+
const urlRegex = /https?:\/\/[^\s]+/g;
|
|
1022
|
+
return text.match(urlRegex) || [];
|
|
1037
1023
|
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { TestBed } from '@angular/core/testing';
|
|
2
|
-
|
|
3
|
-
import { ProjectUsersService } from './project-users.service';
|
|
4
|
-
|
|
5
|
-
describe('ProjectUsersService', () => {
|
|
6
|
-
let service: ProjectUsersService;
|
|
7
|
-
|
|
8
|
-
beforeEach(() => {
|
|
9
|
-
TestBed.configureTestingModule({});
|
|
10
|
-
service = TestBed.inject(ProjectUsersService);
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
it('should be created', () => {
|
|
14
|
-
expect(service).toBeTruthy();
|
|
15
|
-
});
|
|
16
|
-
});
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { HttpClient, HttpHeaders } from '@angular/common/http';
|
|
2
|
-
import { Injectable } from '@angular/core';
|
|
3
|
-
import { Observable } from 'rxjs';
|
|
4
|
-
import { map } from 'rxjs/operators';
|
|
5
|
-
import { ProjectUser } from 'src/chat21-core/models/projectUsers';
|
|
6
|
-
import { AppStorageService } from 'src/chat21-core/providers/abstract/app-storage.service';
|
|
7
|
-
import { LoggerService } from 'src/chat21-core/providers/abstract/logger.service';
|
|
8
|
-
import { LoggerInstance } from 'src/chat21-core/providers/logger/loggerInstance';
|
|
9
|
-
|
|
10
|
-
@Injectable({
|
|
11
|
-
providedIn: 'root'
|
|
12
|
-
})
|
|
13
|
-
export class ProjectUsersService {
|
|
14
|
-
|
|
15
|
-
private SERVER_BASE_URL: string;
|
|
16
|
-
private tiledeskToken: string;
|
|
17
|
-
|
|
18
|
-
private logger: LoggerService = LoggerInstance.getInstance();
|
|
19
|
-
constructor(
|
|
20
|
-
public http: HttpClient,
|
|
21
|
-
public appStorageService: AppStorageService
|
|
22
|
-
) {}
|
|
23
|
-
|
|
24
|
-
initialize(serverBaseUrl: string) {
|
|
25
|
-
this.logger.log('[TILEDESK-PROJECT_USERS-SERV] - initialize serverBaseUrl', serverBaseUrl);
|
|
26
|
-
this.SERVER_BASE_URL = serverBaseUrl;
|
|
27
|
-
this.tiledeskToken = this.appStorageService.getItem('tiledeskToken')
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
public getProjectUsersByProjectId(project_id: string): Observable<ProjectUser[]> {
|
|
31
|
-
const url = this.SERVER_BASE_URL + project_id + '/project_users/';
|
|
32
|
-
this.logger.log('[TILEDESK-SERVICE] - GET PROJECT-USER URL', url);
|
|
33
|
-
|
|
34
|
-
const httpOptions = {
|
|
35
|
-
headers: new HttpHeaders({
|
|
36
|
-
'Content-Type': 'application/json',
|
|
37
|
-
Authorization: this.tiledeskToken
|
|
38
|
-
})
|
|
39
|
-
};
|
|
40
|
-
return this.http.get(url, httpOptions).pipe(map((res: any) => {
|
|
41
|
-
this.logger.log('[TILEDESK-SERVICE] - GET PROJECT-USER RES ', res);
|
|
42
|
-
return res
|
|
43
|
-
}))
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
public getProjectUserByProjectId(project_id: string): Promise<ProjectUser> {
|
|
47
|
-
const url = this.SERVER_BASE_URL + project_id + '/project_users/me';
|
|
48
|
-
this.logger.log('[TILEDESK-SERVICE]- GET PROJECT-USER BY USER-ID - URL', url);
|
|
49
|
-
|
|
50
|
-
const httpOptions = {
|
|
51
|
-
headers: new HttpHeaders({
|
|
52
|
-
'Content-Type': 'application/json',
|
|
53
|
-
Authorization: this.tiledeskToken
|
|
54
|
-
})
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
return this.http.get(url, httpOptions).pipe(map((res: any) => {
|
|
58
|
-
this.logger.log('[TILEDESK-SERVICE] - GET PROJECT-USER RES ', res);
|
|
59
|
-
return res[0]
|
|
60
|
-
})).toPromise();
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
}
|