@chat21/chat21-web-widget 5.0.43-rc.2 → 5.0.44-rc.1
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 +6 -0
- package/dist/assets/twp/index-dev.html +7 -1
- package/dist/assets/twp/index.html +7 -0
- package/dist/main.js +1 -1
- package/package.json +1 -1
- package/src/app/component/conversation-detail/conversation-preview/conversation-preview.component.ts +1 -1
- package/src/app/providers/global-settings.service.ts +6 -0
- package/src/assets/twp/index-dev.html +7 -1
- package/src/assets/twp/index.html +7 -0
- package/src/chat21-core/providers/mqtt/mqtt-auth-service.ts +8 -9
- package/src/environments/environment.pre.ts +15 -15
- package/src/environments/environment.prod.ts +14 -14
- package/src/environments/environment.ts +2 -3
package/package.json
CHANGED
package/src/app/component/conversation-detail/conversation-preview/conversation-preview.component.ts
CHANGED
|
@@ -158,7 +158,7 @@ export class ConversationPreviewComponent implements OnInit {
|
|
|
158
158
|
that.logger.debug('[LOADER-PREVIEW-PAGE] OK: ', metadata);
|
|
159
159
|
that.arrayFiles.push({metadata});
|
|
160
160
|
if (!that.fileSelected) {
|
|
161
|
-
that.fileSelected = {metadata
|
|
161
|
+
that.fileSelected = Object.assign({}, metadata)
|
|
162
162
|
}
|
|
163
163
|
};
|
|
164
164
|
}
|
|
@@ -502,6 +502,12 @@ export class GlobalSettingsService {
|
|
|
502
502
|
globals.showInfoMessage.push('CHAT_CLOSED')
|
|
503
503
|
}
|
|
504
504
|
}
|
|
505
|
+
if (variables.hasOwnProperty('singleConversation')) {
|
|
506
|
+
globals['singleConversation'] = variables['singleConversation'];
|
|
507
|
+
}
|
|
508
|
+
if (variables.hasOwnProperty('themeColorOpacity')) {
|
|
509
|
+
globals['themeColorOpacity'] = variables['themeColorOpacity'];
|
|
510
|
+
}
|
|
505
511
|
|
|
506
512
|
}
|
|
507
513
|
}
|
|
@@ -393,7 +393,7 @@
|
|
|
393
393
|
window.tiledeskSettings = {
|
|
394
394
|
marginX: "100px",
|
|
395
395
|
marginY: "50px",
|
|
396
|
-
calloutTimer:
|
|
396
|
+
calloutTimer: 1,
|
|
397
397
|
};
|
|
398
398
|
|
|
399
399
|
(function(d, s, id) {
|
|
@@ -455,6 +455,12 @@
|
|
|
455
455
|
document.getElementById('events').value += 'onInit --> FIRED!' + '\n'
|
|
456
456
|
document.getElementById('events').scrollTop = document.getElementById('events').scrollHeight
|
|
457
457
|
}, 1000);
|
|
458
|
+
//open widget after 3s if is closed
|
|
459
|
+
setTimeout(() => {
|
|
460
|
+
if(event_data && event_data.detail && event_data.detail.global && !event_data.detail.global.isOpen){
|
|
461
|
+
window.Tiledesk('open')
|
|
462
|
+
}
|
|
463
|
+
}, 3000);
|
|
458
464
|
});
|
|
459
465
|
|
|
460
466
|
window.Tiledesk('onAuthStateChanged', function(event_data) {
|
|
@@ -241,6 +241,7 @@
|
|
|
241
241
|
window.tiledeskSettings = {
|
|
242
242
|
marginX: "100px",
|
|
243
243
|
marginY: "50px",
|
|
244
|
+
calloutTimer: 1
|
|
244
245
|
// autostart: false
|
|
245
246
|
|
|
246
247
|
};
|
|
@@ -290,6 +291,12 @@
|
|
|
290
291
|
setTimeout(() => {
|
|
291
292
|
document.getElementById("preloader").style.display = "none";
|
|
292
293
|
}, 1000);
|
|
294
|
+
//open widget after 3s if is closed
|
|
295
|
+
setTimeout(() => {
|
|
296
|
+
if(event_data && event_data.detail && event_data.detail.global && !event_data.detail.global.isOpen){
|
|
297
|
+
window.Tiledesk('open')
|
|
298
|
+
}
|
|
299
|
+
}, 3000);
|
|
293
300
|
});
|
|
294
301
|
|
|
295
302
|
window.Tiledesk('onAuthStateChanged', function(event_data) {
|
|
@@ -66,12 +66,11 @@ export class MQTTAuthService extends MessagingAuthService {
|
|
|
66
66
|
this.logger.log("[MQTTAuthService] logout: closing mqtt connection...");
|
|
67
67
|
return new Promise((resolve, reject) => {
|
|
68
68
|
this.chat21Service.chatClient.close(() => {
|
|
69
|
-
console.log("[MQTTAuthService] logout: mqtt connection closed. OK");
|
|
70
69
|
// remove
|
|
71
70
|
// this.appStorage.removeItem('tiledeskToken');
|
|
72
71
|
// this.appStorage.removeItem('currentUser');
|
|
73
72
|
this.currentUser = null;
|
|
74
|
-
|
|
73
|
+
this.logger.debug("[MQTTAuthService] logout: mqtt connection closed. user removed. OK");
|
|
75
74
|
this.BSSignOut.next(true);
|
|
76
75
|
this.BSAuthStateChanged.next('offline');
|
|
77
76
|
resolve(true)
|
|
@@ -93,20 +92,20 @@ z
|
|
|
93
92
|
|
|
94
93
|
/** */
|
|
95
94
|
getToken(): string {
|
|
96
|
-
|
|
95
|
+
this.logger.debug('[MQTTAuthService]::getToken');
|
|
97
96
|
return this.token;
|
|
98
97
|
}
|
|
99
98
|
|
|
100
99
|
/**
|
|
101
100
|
*/
|
|
102
101
|
onAuthStateChanged() {
|
|
103
|
-
|
|
102
|
+
this.logger.debug('UserService::onAuthStateChanged');
|
|
104
103
|
// if (this.appStorage.getItem('tiledeskToken') == null) {
|
|
105
104
|
// this.currentUser = null;
|
|
106
105
|
this.BSAuthStateChanged.next('offline');
|
|
107
106
|
// }
|
|
108
107
|
// const that = this;
|
|
109
|
-
|
|
108
|
+
this.logger.debug("STORAGE CHANGED: added listner")
|
|
110
109
|
// window.addEventListener('storage', (e) => {
|
|
111
110
|
// console.log('STORAGE CHANGED:', e.key);
|
|
112
111
|
// if (this.appStorage.getItem('tiledeskToken') == null && this.appStorage.getItem('currentUser') == null) {
|
|
@@ -254,19 +253,19 @@ z
|
|
|
254
253
|
// const that = this;
|
|
255
254
|
this.http.post(this.URL_TILEDESK_CREATE_CUSTOM_TOKEN, postData, { headers, responseType})
|
|
256
255
|
.subscribe(data => {
|
|
257
|
-
|
|
256
|
+
this.logger.debug("[MQTTAuthService] connectWithCustomToken: **** data", data)
|
|
258
257
|
const result = JSON.parse(data);
|
|
259
258
|
this.connectMQTT(result);
|
|
260
259
|
}, error => {
|
|
261
|
-
|
|
260
|
+
this.logger.error(error);
|
|
262
261
|
});
|
|
263
262
|
}
|
|
264
263
|
|
|
265
264
|
connectMQTT(credentials: any): any {
|
|
266
|
-
|
|
265
|
+
this.logger.debug('[MQTTAuthService] connectMQTT: **** credentials:', credentials);
|
|
267
266
|
const userid = credentials.userid;
|
|
268
267
|
this.chat21Service.chatClient.connect(userid, credentials.token, () => {
|
|
269
|
-
|
|
268
|
+
this.logger.debug('[MQTTAuthService] connectMQTT: Chat connected.');
|
|
270
269
|
this.BSAuthStateChanged.next('online');
|
|
271
270
|
});
|
|
272
271
|
}
|
|
@@ -5,23 +5,23 @@
|
|
|
5
5
|
|
|
6
6
|
export const environment = {
|
|
7
7
|
production: true,
|
|
8
|
-
version: require('../../package.json').version,
|
|
9
|
-
remoteConfig:
|
|
8
|
+
version: require('../../package.json').version, // https://stackoverflow.com/questions/34907682/how-to-display-app-version-in-angular2
|
|
9
|
+
remoteConfig: true,
|
|
10
10
|
remoteConfigUrl: '/widget-config.json',
|
|
11
|
-
remoteTranslationsUrl: '
|
|
11
|
+
remoteTranslationsUrl: 'http://localhost:3000/',
|
|
12
12
|
loadRemoteTranslations: true,
|
|
13
|
-
chatEngine: '
|
|
14
|
-
uploadEngine: '
|
|
13
|
+
chatEngine: 'mqtt',
|
|
14
|
+
uploadEngine: 'native',
|
|
15
15
|
fileUploadAccept:"*/*",
|
|
16
|
-
logLevel: '
|
|
16
|
+
logLevel: 'INFO',
|
|
17
17
|
firebaseConfig: {
|
|
18
|
-
apiKey: '
|
|
19
|
-
authDomain: '
|
|
20
|
-
databaseURL: '
|
|
21
|
-
projectId: '
|
|
22
|
-
storageBucket: '
|
|
23
|
-
messagingSenderId: '
|
|
24
|
-
appId: '
|
|
18
|
+
apiKey: 'CHANGEIT',
|
|
19
|
+
authDomain: 'CHANGEIT',
|
|
20
|
+
databaseURL: 'CHANGEIT',
|
|
21
|
+
projectId: 'CHANGEIT',
|
|
22
|
+
storageBucket: 'CHANGEIT',
|
|
23
|
+
messagingSenderId: 'CHANGEIT',
|
|
24
|
+
appId: 'CHANGEIT',
|
|
25
25
|
tenant: 'tilechat',
|
|
26
26
|
},
|
|
27
27
|
chat21Config: {
|
|
@@ -29,14 +29,14 @@ export const environment = {
|
|
|
29
29
|
MQTTendpoint: 'mqtt://localhost:15675/ws', // MQTT endpoint
|
|
30
30
|
APIendpoint: 'http://localhost:8004/api'
|
|
31
31
|
},
|
|
32
|
-
apiUrl: '
|
|
32
|
+
apiUrl: 'http://localhost:3000/',
|
|
33
33
|
baseImageUrl: 'https://firebasestorage.googleapis.com/v0/b/',
|
|
34
34
|
dashboardUrl: "https://support-pre.tiledesk.com/dashboard/",
|
|
35
35
|
defaultLang : 'en',
|
|
36
36
|
storage_prefix : 'widget_sv5',
|
|
37
37
|
authPersistence: 'LOCAL',
|
|
38
38
|
supportMode: true,
|
|
39
|
-
enbedJs: true
|
|
39
|
+
enbedJs: true
|
|
40
40
|
};
|
|
41
41
|
|
|
42
42
|
|
|
@@ -6,30 +6,30 @@
|
|
|
6
6
|
export const environment = {
|
|
7
7
|
production: true,
|
|
8
8
|
version: require('../../package.json').version, // https://stackoverflow.com/questions/34907682/how-to-display-app-version-in-angular2
|
|
9
|
-
remoteConfig:
|
|
9
|
+
remoteConfig: true,
|
|
10
10
|
remoteConfigUrl: '/widget-config.json',
|
|
11
11
|
loadRemoteTranslations: true,
|
|
12
|
-
remoteTranslationsUrl: '
|
|
13
|
-
chatEngine: '
|
|
14
|
-
uploadEngine: '
|
|
12
|
+
remoteTranslationsUrl: 'http://localhost:3000/',
|
|
13
|
+
chatEngine: 'CHANGEIT',
|
|
14
|
+
uploadEngine: 'CHANGEIT',
|
|
15
15
|
fileUploadAccept:"*/*",
|
|
16
|
-
logLevel: '
|
|
16
|
+
logLevel: 'INFO',
|
|
17
17
|
firebaseConfig: {
|
|
18
|
-
apiKey: '
|
|
19
|
-
authDomain: '
|
|
20
|
-
databaseURL: '
|
|
21
|
-
projectId: '
|
|
22
|
-
storageBucket: '
|
|
23
|
-
messagingSenderId: '
|
|
24
|
-
appId: '
|
|
25
|
-
tenant: '
|
|
18
|
+
apiKey: 'CHANGEIT',
|
|
19
|
+
authDomain: 'CHANGEIT',
|
|
20
|
+
databaseURL: 'CHANGEIT',
|
|
21
|
+
projectId: 'CHANGEIT',
|
|
22
|
+
storageBucket: 'CHANGEIT',
|
|
23
|
+
messagingSenderId: 'CHANGEIT',
|
|
24
|
+
appId: 'CHANGEIT',
|
|
25
|
+
tenant: 'CHANGEIT',
|
|
26
26
|
},
|
|
27
27
|
chat21Config: {
|
|
28
28
|
appId: 'tilechat',
|
|
29
29
|
MQTTendpoint: 'mqtt://localhost:15675/ws', // MQTT endpoint
|
|
30
30
|
APIendpoint: 'http://localhost:8004/api'
|
|
31
31
|
},
|
|
32
|
-
apiUrl: '
|
|
32
|
+
apiUrl: 'http://localhost:3000/',
|
|
33
33
|
baseImageUrl: 'https://firebasestorage.googleapis.com/v0/b/',
|
|
34
34
|
dashboardUrl: 'https://console.tiledesk.com/v2/dashboard/',
|
|
35
35
|
defaultLang : 'en',
|
|
@@ -7,8 +7,7 @@ export const environment = {
|
|
|
7
7
|
production: false,
|
|
8
8
|
version: require('../../package.json').version, // https://stackoverflow.com/questions/34907682/how-to-display-app-version-in-angular2
|
|
9
9
|
remoteConfig: true,
|
|
10
|
-
|
|
11
|
-
remoteConfigUrl: '/environments/real_data/widget-config-firebase.json',
|
|
10
|
+
remoteConfigUrl: '/widget-config.json',
|
|
12
11
|
loadRemoteTranslations: true,
|
|
13
12
|
remoteTranslationsUrl: 'http://localhost:3000/',
|
|
14
13
|
chatEngine: 'mqtt',
|
|
@@ -33,7 +32,7 @@ export const environment = {
|
|
|
33
32
|
},
|
|
34
33
|
apiUrl: 'http://localhost:3000/',
|
|
35
34
|
baseImageUrl: 'https://firebasestorage.googleapis.com/v0/b/',
|
|
36
|
-
dashboardUrl:
|
|
35
|
+
dashboardUrl: 'http://localhost:4500/',
|
|
37
36
|
defaultLang : 'en',
|
|
38
37
|
storage_prefix : 'widget_sv5',
|
|
39
38
|
authPersistence: 'LOCAL',
|