@chat21/chat21-ionic 3.0.82-rc.2 → 3.0.82-rc.6
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 +10 -0
- package/package.json +1 -1
- package/src/app/components/navbar/navbar.component.ts +5 -4
- 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 +21 -3
- package/src/app/services/websocket/websocket.service.ts +1 -1
- package/src/assets/js/chat21client.js +2 -2
- package/src/chat-config-mqtt-localhost.json +2 -2
- package/src/chat21-core/providers/mqtt/mqtt-auth-service.ts +7 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,9 +1,19 @@
|
|
|
1
1
|
# chat21-ionic ver 3.0
|
|
2
2
|
|
|
3
|
+
### 3.0.82-rc.6
|
|
4
|
+
- bug-fixed: axios is undefined in chat21Client.js
|
|
5
|
+
- bug-fixed: if userImage not exist in sidebar--user-detail, no info of fillColor exist
|
|
6
|
+
|
|
7
|
+
### 3.0.82-rc.3
|
|
8
|
+
- bug-fixed: incorrect dashboard urls in navbar
|
|
9
|
+
- changed: used logger in mqtt auth service
|
|
10
|
+
|
|
3
11
|
### 3.0.82-rc.2
|
|
4
12
|
- changed: 'force' parameter to /close post as body content
|
|
5
13
|
- changed: enabled MTT
|
|
6
14
|
- changed: position of 'LogOut' button in sidebar-user-detail component
|
|
15
|
+
- bug-fixed: removed scrollbar on firefox browser in conversation-list, contacts-directory pages
|
|
16
|
+
|
|
7
17
|
### 3.0.82-rc.1
|
|
8
18
|
- changed: forceArchive to force while calling /close API URL
|
|
9
19
|
- changed: chat21Client.js from 1.12.1 to 1.12.2
|
package/package.json
CHANGED
|
@@ -161,12 +161,13 @@ export class NavbarComponent implements OnInit {
|
|
|
161
161
|
const baseUrl = this.appConfigProvider.getConfig().dashboardUrl
|
|
162
162
|
let url = baseUrl
|
|
163
163
|
if(event === 'projectSettings'){
|
|
164
|
-
url = baseUrl + 'project/' + this.project.id_project.id + '/project-settings/general'
|
|
164
|
+
url = baseUrl + '#/project/' + this.project.id_project.id + '/project-settings/general' + '?token=' + this.tiledeskToken
|
|
165
165
|
}else if(event ==='allProjects'){
|
|
166
|
-
url = baseUrl + '
|
|
166
|
+
url = baseUrl + '#/projects/' + '?token=' + this.tiledeskToken
|
|
167
167
|
}else if('addProject'){
|
|
168
|
-
url = baseUrl + 'create-new-project/'
|
|
168
|
+
url = baseUrl + '#/create-new-project/' + '?token=' + this.tiledeskToken
|
|
169
169
|
}
|
|
170
|
+
console.log('onClickDropdownOption-->', url)
|
|
170
171
|
window.open(url, '_blank');
|
|
171
172
|
}
|
|
172
173
|
|
|
@@ -180,7 +181,7 @@ export class NavbarComponent implements OnInit {
|
|
|
180
181
|
// this.unsubscribe$.next();
|
|
181
182
|
// this.unsubscribe$.complete();
|
|
182
183
|
|
|
183
|
-
const url = this.appConfigProvider.getConfig().dashboardUrl +
|
|
184
|
+
const url = this.appConfigProvider.getConfig().dashboardUrl + `#/project/${id_project}/home`
|
|
184
185
|
window.open(url, '_blank');
|
|
185
186
|
|
|
186
187
|
}
|
|
@@ -25,9 +25,9 @@
|
|
|
25
25
|
onerror="this.src='assets/images/no_image_user.png'" />
|
|
26
26
|
|
|
27
27
|
<div *ngIf="!USER_PHOTO_PROFILE_EXIST" class="user-img-in-sidebar-user-details"
|
|
28
|
-
[ngStyle]="{'background': 'linear-gradient(rgb(255,255,255) -125%,' + user?.
|
|
28
|
+
[ngStyle]="{'background': 'linear-gradient(rgb(255,255,255) -125%,' + user?.fillColour + ')'}">
|
|
29
29
|
<span id="sidebaravatar-altenative-user-avatar" class="sidebar-user-details-altenative-user-avatar">
|
|
30
|
-
{{ user?.
|
|
30
|
+
{{ user?.fullname_initial }}
|
|
31
31
|
</span>
|
|
32
32
|
</div>
|
|
33
33
|
|
|
@@ -41,7 +41,7 @@ export class SidebarUserDetailsComponent implements OnInit, OnChanges {
|
|
|
41
41
|
|
|
42
42
|
isVisiblePAY: boolean;
|
|
43
43
|
public_Key: any
|
|
44
|
-
USER_PHOTO_PROFILE_EXIST: boolean;
|
|
44
|
+
USER_PHOTO_PROFILE_EXIST: boolean = false;
|
|
45
45
|
version: string
|
|
46
46
|
company_name: string = 'Tiledesk'
|
|
47
47
|
DASHBOARD_URL: string;
|
|
@@ -90,7 +90,8 @@ export class SidebarUserDetailsComponent implements OnInit, OnChanges {
|
|
|
90
90
|
const currentUser = JSON.parse(storedCurrentUser);
|
|
91
91
|
this.logger.log('[SIDEBAR-USER-DETAILS] - subcribeToAuthStateChanged - currentUser ', currentUser)
|
|
92
92
|
if (currentUser) {
|
|
93
|
-
this.user = currentUser
|
|
93
|
+
this.user = currentUser
|
|
94
|
+
this.createUserAvatar(this.user);
|
|
94
95
|
this.getCurrentChatLangAndTranslateLabels(this.user);
|
|
95
96
|
this.photo_profile_URL = this.imageRepoService.getImagePhotoUrl(this.user.uid)
|
|
96
97
|
this.logger.log('[SIDEBAR-USER-DETAILS] photo_profile_URL ', this.photo_profile_URL);
|
|
@@ -105,7 +106,7 @@ export class SidebarUserDetailsComponent implements OnInit, OnChanges {
|
|
|
105
106
|
|
|
106
107
|
checkIfExistPhotoProfile(imageUrl) {
|
|
107
108
|
this.verifyImageURL(imageUrl, (imageExists) => {
|
|
108
|
-
|
|
109
|
+
|
|
109
110
|
if (imageExists === true) {
|
|
110
111
|
this.USER_PHOTO_PROFILE_EXIST = true;
|
|
111
112
|
this.logger.log('[SIDEBAR-USER-DETAILS] photo_profile_URL IMAGE EXIST ', imageExists)
|
|
@@ -129,6 +130,23 @@ export class SidebarUserDetailsComponent implements OnInit, OnChanges {
|
|
|
129
130
|
};
|
|
130
131
|
}
|
|
131
132
|
|
|
133
|
+
createUserAvatar(currentUser) {
|
|
134
|
+
this.logger.log('[SIDEBAR] - createProjectUserAvatar ', currentUser)
|
|
135
|
+
let fullname = ''
|
|
136
|
+
if (currentUser && currentUser.firstname && currentUser.lastname) {
|
|
137
|
+
fullname = currentUser.firstname + ' ' + currentUser.lastname
|
|
138
|
+
currentUser['fullname_initial'] = avatarPlaceholder(fullname)
|
|
139
|
+
currentUser['fillColour'] = getColorBck(fullname)
|
|
140
|
+
} else if (currentUser && currentUser.firstname) {
|
|
141
|
+
fullname = currentUser.firstname
|
|
142
|
+
currentUser['fullname_initial'] = avatarPlaceholder(fullname)
|
|
143
|
+
currentUser['fillColour'] = getColorBck(fullname)
|
|
144
|
+
} else {
|
|
145
|
+
currentUser['fullname_initial'] = 'N/A'
|
|
146
|
+
currentUser['fillColour'] = 'rgb(98, 100, 167)'
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
132
150
|
// listenOpenUserSidebarEvent() {
|
|
133
151
|
// this.events.subscribe('userdetailsidebar:opened', (openUserDetailsSidebar) => {
|
|
134
152
|
// this.logger.log('[SIDEBAR-USER-DETAILS] - listenOpenUserSidebarEvent - openUserDetailsSidebar', openUserDetailsSidebar);
|
|
@@ -41,7 +41,7 @@ export class WebsocketService {
|
|
|
41
41
|
|
|
42
42
|
self.webSocketJs.ref(path, 'subscriptionToWsCurrentUser_allProject',
|
|
43
43
|
function (data, notification) {
|
|
44
|
-
|
|
44
|
+
console.log("[WS-SERV] SUBSCR TO WS CURRENT PROJECT-USER AVAILABILITY - CREATE - data ", data);
|
|
45
45
|
resolve(data)
|
|
46
46
|
// self.currentUserWsAvailability$.next(data.user_available);
|
|
47
47
|
self.currentProjectUserAvailability$.next(data)
|
|
@@ -21,9 +21,9 @@
|
|
|
21
21
|
"APIendpoint": "http://localhost:8004/api",
|
|
22
22
|
"_log": true
|
|
23
23
|
},
|
|
24
|
-
"apiUrl": "http://localhost:
|
|
24
|
+
"apiUrl": "http://localhost:8081/api/",
|
|
25
25
|
"baseImageUrl": "http://localhost:3000/",
|
|
26
|
-
"dashboardUrl": "http://localhost:8081/",
|
|
26
|
+
"dashboardUrl": "http://localhost:8081/dashboard/",
|
|
27
27
|
"testsiteBaseUrl": "http://localhost:8081/widget/assets/twp/index.html",
|
|
28
28
|
"logLevel": "DEBUG",
|
|
29
29
|
"authPersistence": "LOCAL",
|
|
@@ -64,15 +64,14 @@ export class MQTTAuthService extends MessagingAuthService {
|
|
|
64
64
|
|
|
65
65
|
// logout(callback) {
|
|
66
66
|
logout(): Promise<boolean> {
|
|
67
|
-
this.logger.
|
|
67
|
+
this.logger.debug("[MQTTAuthService] logout: closing mqtt connection...");
|
|
68
68
|
return new Promise((resolve, reject) => {
|
|
69
69
|
this.chat21Service.chatClient.close(() => {
|
|
70
|
-
console.log("[MQTTAuthService] logout: mqtt connection closed. OK");
|
|
71
70
|
// remove
|
|
72
71
|
// this.appStorage.removeItem('tiledeskToken');
|
|
73
72
|
// this.appStorage.removeItem('currentUser');
|
|
74
73
|
this.currentUser = null;
|
|
75
|
-
|
|
74
|
+
this.logger.debug("[MQTTAuthService] logout: mqtt connection closed. user removed. OK");
|
|
76
75
|
this.BSSignOut.next(true);
|
|
77
76
|
this.BSAuthStateChanged.next('offline');
|
|
78
77
|
resolve(true)
|
|
@@ -94,7 +93,7 @@ z
|
|
|
94
93
|
|
|
95
94
|
/** */
|
|
96
95
|
getToken(): string {
|
|
97
|
-
this.logger.
|
|
96
|
+
this.logger.debug('[MQTTAuthService]::getToken');
|
|
98
97
|
return this.token;
|
|
99
98
|
}
|
|
100
99
|
|
|
@@ -255,19 +254,19 @@ z
|
|
|
255
254
|
// const that = this;
|
|
256
255
|
this.http.post(this.URL_TILEDESK_CREATE_CUSTOM_TOKEN, postData, { headers, responseType})
|
|
257
256
|
.subscribe(data => {
|
|
258
|
-
this.logger.
|
|
257
|
+
this.logger.debug("[MQTTAuthService] connectWithCustomToken: **** data", data)
|
|
259
258
|
const result = JSON.parse(data);
|
|
260
259
|
this.connectMQTT(result);
|
|
261
260
|
}, error => {
|
|
262
|
-
this.logger.
|
|
261
|
+
this.logger.error(error);
|
|
263
262
|
});
|
|
264
263
|
}
|
|
265
264
|
|
|
266
265
|
connectMQTT(credentials: any): any {
|
|
267
|
-
this.logger.
|
|
266
|
+
this.logger.debug('[MQTTAuthService] connectMQTT: **** credentials:', credentials);
|
|
268
267
|
const userid = credentials.userid;
|
|
269
268
|
this.chat21Service.chatClient.connect(userid, credentials.token, () => {
|
|
270
|
-
this.logger.
|
|
269
|
+
this.logger.debug('[MQTTAuthService] connectMQTT: Chat connected.');
|
|
271
270
|
this.BSAuthStateChanged.next('online');
|
|
272
271
|
});
|
|
273
272
|
}
|