@chat21/chat21-ionic 3.0.59-rc4 → 3.0.59
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 +77 -0
- package/README.md +5 -0
- package/config.xml +2 -2
- package/env.sample +3 -1
- package/package.json +1 -1
- package/resources/Android/splash/drawable-land-hdpi-screen.png +0 -0
- package/resources/Android/splash/drawable-land-ldpi-screen.png +0 -0
- package/resources/Android/splash/drawable-land-mdpi-screen.png +0 -0
- package/resources/Android/splash/drawable-land-xhdpi-screen.png +0 -0
- package/resources/Android/splash/drawable-land-xxhdpi-screen.png +0 -0
- package/resources/Android/splash/drawable-land-xxxhdpi-screen.png +0 -0
- package/resources/Android/splash/drawable-port-hdpi-screen.png +0 -0
- package/resources/Android/splash/drawable-port-ldpi-screen.png +0 -0
- package/resources/Android/splash/drawable-port-mdpi-screen.png +0 -0
- package/resources/Android/splash/drawable-port-xhdpi-screen.png +0 -0
- package/resources/Android/splash/drawable-port-xxhdpi-screen.png +0 -0
- package/resources/Android/splash/drawable-port-xxxhdpi-screen.png +0 -0
- package/resources/Android/splash.png +0 -0
- package/src/app/app.component.scss +10 -5
- package/src/app/app.component.ts +393 -234
- package/src/app/app.module.ts +12 -7
- package/src/app/chatlib/conversation-detail/conversation-content/conversation-content.component.html +1 -1
- package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.html +7 -6
- package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.ts +2 -1
- package/src/app/chatlib/list-conversations-component/list-conversations/list-conversations.component.html +1 -1
- package/src/app/components/authentication/login/login.component.html +8 -8
- package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.html +2 -4
- package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.ts +7 -2
- package/src/app/components/ddp-header/ddp-header.component.html +1 -1
- package/src/app/components/ddp-header/ddp-header.component.ts +4 -2
- package/src/app/components/project-item/project-item.component.html +61 -16
- package/src/app/components/project-item/project-item.component.scss +165 -38
- package/src/app/components/project-item/project-item.component.ts +58 -36
- package/src/app/pages/authentication/login/login.page.html +1 -2
- package/src/app/pages/conversation-detail/conversation-detail.page.ts +2 -0
- package/src/app/pages/conversations-list/conversations-list.page.html +12 -7
- package/src/app/pages/conversations-list/conversations-list.page.scss +279 -261
- package/src/app/pages/conversations-list/conversations-list.page.ts +149 -17
- package/src/app/pages/unassigned-conversations/unassigned-conversations.page.html +10 -2
- package/src/app/pages/unassigned-conversations/unassigned-conversations.page.scss +79 -0
- package/src/app/pages/unassigned-conversations/unassigned-conversations.page.ts +47 -36
- package/src/app/services/app-config.ts +77 -5
- package/src/app/services/websocket/websocket-js.ts +12 -14
- package/src/app/services/websocket/websocket.service.ts +26 -8
- package/src/assets/i18n/en.json +2 -1
- package/src/assets/i18n/it.json +2 -1
- package/src/assets/js/chat21client.js +144 -82
- package/src/assets/logo.png +0 -0
- package/src/assets/transparent.png +0 -0
- package/src/chat-config-pre-test.json +3 -1
- package/src/chat-config-template.json +4 -1
- package/src/chat-config.json +4 -1
- package/src/chat21-core/providers/firebase/firebase-archivedconversations-handler.ts +1 -1
- package/src/chat21-core/providers/firebase/firebase-conversations-handler.ts +1 -1
- package/src/chat21-core/providers/firebase/firebase-notifications.ts +31 -23
- package/src/chat21-core/providers/mqtt/mqtt-auth-service.ts +27 -27
- package/src/chat21-core/providers/mqtt/mqtt-conversation-handler.ts +3 -5
- package/src/chat21-core/providers/mqtt/mqtt-conversations-handler.ts +13 -5
- package/src/chat21-core/providers/mqtt/mqtt-notifications.ts +101 -11
- package/src/chat21-core/providers/tiledesk/tiledesk-auth.service.ts +12 -3
- package/src/chat21-core/utils/utils-message.ts +2 -2
- package/src/firebase-messaging-sw-template.js +1 -1
- package/src/assets/images/tiledesk_logo_50x50.png +0 -0
|
@@ -78,10 +78,8 @@ export class WebSocketJs {
|
|
|
78
78
|
this.callbacks.set(topic, { onCreate: onCreate, onUpdate: onUpdate, onData: onData });
|
|
79
79
|
this.logger.log('[WEBSOCKET-JS] - CALLBACK-SET - callbacks', this.callbacks);
|
|
80
80
|
|
|
81
|
-
this.logger.log('[WEBSOCKET-JS] - REF - READY STATE ', this.ws.readyState);
|
|
82
|
-
|
|
83
81
|
if (this.ws && this.ws.readyState == 1) {
|
|
84
|
-
|
|
82
|
+
this.logger.log('[WEBSOCKET-JS] - REF - READY STATE ', this.ws.readyState);
|
|
85
83
|
this.logger.log('[WEBSOCKET-JS] - REF - READY STATE = 1 > SUBSCRIBE TO TOPICS ');
|
|
86
84
|
|
|
87
85
|
this.subscribe(topic);
|
|
@@ -172,11 +170,11 @@ export class WebSocketJs {
|
|
|
172
170
|
var str = JSON.stringify(message);
|
|
173
171
|
this.logger.log("[WEBSOCKET-JS] - UN-SUBSCRIBE str " + str);
|
|
174
172
|
|
|
175
|
-
if (this.ws.readyState == 1) {
|
|
173
|
+
if (this.ws && this.ws.readyState == 1) {
|
|
176
174
|
this.logger.log("[WEBSOCKET-JS] - UN-SUBSCRIBE TO TOPIC - STRING TO SEND " + str, " FOR UNSUBSCRIBE TO TOPIC: ", topic);
|
|
177
175
|
this.send(str, `UNSUSCRIBE from ${topic}`);
|
|
178
176
|
|
|
179
|
-
} else {
|
|
177
|
+
} else if (this.ws) {
|
|
180
178
|
this.logger.log("[WEBSOCKET-JS] - UN-SUBSCRIBE TRY 'SEND' BUT READY STASTE IS : ", this.ws.readyState);
|
|
181
179
|
}
|
|
182
180
|
}
|
|
@@ -196,7 +194,7 @@ export class WebSocketJs {
|
|
|
196
194
|
// -----------------------------------------------------------------------------------------------------
|
|
197
195
|
close() {
|
|
198
196
|
this.topics = [];
|
|
199
|
-
this.callbacks = [];
|
|
197
|
+
this.callbacks = [];
|
|
200
198
|
this.logger.log("[WEBSOCKET-JS] - CALLED CLOSE - TOPICS ", this.topics, ' - CALLLBACKS ', this.callbacks);
|
|
201
199
|
|
|
202
200
|
if (this.ws) {
|
|
@@ -277,13 +275,13 @@ export class WebSocketJs {
|
|
|
277
275
|
|
|
278
276
|
// Qui viene inviato un battito cardiaco Dopo averlo ricevuto, viene restituito un messaggio di battito cardiaco.
|
|
279
277
|
// onmessage Ottieni il battito cardiaco restituito per indicare che la connessione è normale
|
|
280
|
-
if (this.ws.readyState == 1) {
|
|
278
|
+
if (this.ws && this.ws.readyState == 1) {
|
|
281
279
|
|
|
282
280
|
// this.logger.log("[WEBSOCKET-JS] - HEART-START - SEND PING-MSG");
|
|
283
281
|
|
|
284
282
|
this.send(JSON.stringify(this.pingMsg), 'HEART-START')
|
|
285
283
|
|
|
286
|
-
} else {
|
|
284
|
+
} else if (this.ws) {
|
|
287
285
|
|
|
288
286
|
this.logger.log("[WEBSOCKET-JS] - HEART-START - TRY TO SEND PING-MSG BUT READY STATE IS ", this.ws.readyState);
|
|
289
287
|
|
|
@@ -442,7 +440,7 @@ export class WebSocketJs {
|
|
|
442
440
|
// @ send PONG
|
|
443
441
|
// -------------------
|
|
444
442
|
// that.logger.log('[WEBSOCKET-JS] - RECEIVED PING -> SEND PONG MSG');
|
|
445
|
-
|
|
443
|
+
|
|
446
444
|
that.send(JSON.stringify(that.pongMsg), 'ON-MESSAGE')
|
|
447
445
|
|
|
448
446
|
} else {
|
|
@@ -465,15 +463,15 @@ export class WebSocketJs {
|
|
|
465
463
|
if (json && json.payload && json.payload.message && that.isArray(json.payload.message)) {
|
|
466
464
|
|
|
467
465
|
json.payload.message.forEach(element => {
|
|
468
|
-
|
|
466
|
+
|
|
469
467
|
//let insUp = that.insertOrUpdate(element);
|
|
470
468
|
let insUp = json.payload.method;
|
|
471
|
-
|
|
469
|
+
|
|
472
470
|
var object = { event: json.payload, data: element };
|
|
473
471
|
|
|
474
472
|
var callbackObj = that.callbacks.get(object.event.topic);
|
|
475
473
|
|
|
476
|
-
|
|
474
|
+
|
|
477
475
|
if (insUp == "CREATE") {
|
|
478
476
|
if (that.onCreate) {
|
|
479
477
|
that.onCreate(element, object);
|
|
@@ -499,10 +497,10 @@ export class WebSocketJs {
|
|
|
499
497
|
} else {
|
|
500
498
|
//let insUp = that.insertOrUpdate(json.payload.message);
|
|
501
499
|
let insUp = json.payload.method;
|
|
502
|
-
|
|
500
|
+
|
|
503
501
|
var object = { event: json.payload, data: json };
|
|
504
502
|
var callbackObj = that.callbacks.get(object.event.topic);
|
|
505
|
-
|
|
503
|
+
|
|
506
504
|
|
|
507
505
|
if (insUp == "CREATE") {
|
|
508
506
|
if (that.onCreate) {
|
|
@@ -84,14 +84,14 @@ export class WebsocketService {
|
|
|
84
84
|
}
|
|
85
85
|
|
|
86
86
|
subscriptionToWsConversations(project_id) {
|
|
87
|
-
|
|
87
|
+
// console.log("[WS-SERV] - CALLED SUBSC TO WS CONVS - PROJECT ID ", project_id);
|
|
88
88
|
var self = this;
|
|
89
89
|
this.wsRequestsList = [];
|
|
90
90
|
|
|
91
91
|
this.webSocketJs.ref('/' + project_id + '/requests', 'getCurrentProjectAndSubscribeTo_WsRequests',
|
|
92
92
|
|
|
93
93
|
function (data, notification) {
|
|
94
|
-
//
|
|
94
|
+
// console.log("[WS-SERV] - CONVS - CREATE DATA ", data);
|
|
95
95
|
if (data) {
|
|
96
96
|
// ------------------------------------------------
|
|
97
97
|
// @ Agents - pass in data agents get from snapshot
|
|
@@ -167,14 +167,21 @@ export class WebsocketService {
|
|
|
167
167
|
|
|
168
168
|
if (index === -1) {
|
|
169
169
|
self.addWsRequests(data)
|
|
170
|
-
//
|
|
170
|
+
// console.log("[WS-REQUESTS-SERV] - CREATE - ADD REQUESTS");
|
|
171
171
|
} else {
|
|
172
|
-
//
|
|
172
|
+
// console.log("[WS-REQUESTS-SERV] - CREATE - REQUEST ALREADY EXIST - NOT ADD AND NOT PUBLISH");
|
|
173
|
+
// if (data !== null && data !== undefined) {
|
|
174
|
+
// self.wsRequestsList.push(data);
|
|
175
|
+
// }
|
|
176
|
+
// if (self.wsRequestsList) {
|
|
177
|
+
// self.wsRequestsList$.next(self.wsRequestsList);
|
|
178
|
+
// console.log("[WS-SERV] - NOT ADD - BUT PUBLIC ANYWAY ", self.wsRequestsList);
|
|
179
|
+
// }
|
|
173
180
|
}
|
|
174
181
|
|
|
175
182
|
}, function (data, notification) {
|
|
176
183
|
|
|
177
|
-
//
|
|
184
|
+
// console.log("[WS-SERV] - CONVS - UPDATE DATA ", data);
|
|
178
185
|
|
|
179
186
|
// -------------------------------------------------------
|
|
180
187
|
// @ Agents (UPDATE) pass in data agents get from snapshot
|
|
@@ -191,8 +198,18 @@ export class WebsocketService {
|
|
|
191
198
|
|
|
192
199
|
|
|
193
200
|
}, function (data, notification) {
|
|
194
|
-
|
|
195
|
-
|
|
201
|
+
self.logger.log("[WS-SERV] CHAT - CONVS - ON-DATA - DATA ", data);
|
|
202
|
+
self.logger.log("[WS-SERV] CHAT - CONVS - ON-DATA - notification ", notification);
|
|
203
|
+
|
|
204
|
+
// console.log("[WS-SERV] CHAT - CONVS - ON-DATA - DATA notification > event > method ", notification.event.method);
|
|
205
|
+
if (notification.event.method === 'CREATE') {
|
|
206
|
+
self.wsRequestsList = [];
|
|
207
|
+
self.wsRequestsList.push(data)
|
|
208
|
+
self.logger.log("[WS-SERV] CHAT - CONVS - ON-DATA - DATA wsRequestsList ", self.wsRequestsList);
|
|
209
|
+
if (self.wsRequestsList) {
|
|
210
|
+
self.wsRequestsList$.next(self.wsRequestsList);
|
|
211
|
+
}
|
|
212
|
+
}
|
|
196
213
|
}
|
|
197
214
|
);
|
|
198
215
|
}
|
|
@@ -211,7 +228,8 @@ export class WebsocketService {
|
|
|
211
228
|
// -----------------------------------------------------------------------------------------------------
|
|
212
229
|
// publish all REQUESTS
|
|
213
230
|
// -----------------------------------------------------------------------------------------------------
|
|
214
|
-
|
|
231
|
+
this.wsRequestsList$.next(this.wsRequestsList);
|
|
232
|
+
// this.logger.log("[WS-SERV] - ADD REQUESTS CONVS LIST ", this.wsRequestsList);
|
|
215
233
|
}
|
|
216
234
|
}
|
|
217
235
|
|
package/src/assets/i18n/en.json
CHANGED
|
@@ -186,5 +186,6 @@
|
|
|
186
186
|
"YouAreAboutToJoinThisChat":"You are about to join this chat",
|
|
187
187
|
"Cancel": "Cancel",
|
|
188
188
|
"AreYouSure":"Are you sure?",
|
|
189
|
-
"UnassignedConversations":"Unassigned Conversations"
|
|
189
|
+
"UnassignedConversations":"Unassigned Conversations",
|
|
190
|
+
"NewConversations": "Nuove conversazioni"
|
|
190
191
|
}
|
package/src/assets/i18n/it.json
CHANGED
|
@@ -194,5 +194,6 @@
|
|
|
194
194
|
"YouAreAboutToJoinThisChat":"Stai per entrare in questa chat",
|
|
195
195
|
"Cancel": "Annulla",
|
|
196
196
|
"AreYouSure":"Sei sicuro?",
|
|
197
|
-
"UnassignedConversations":"Conversazioni non assegnate"
|
|
197
|
+
"UnassignedConversations":"Conversazioni non assegnate",
|
|
198
|
+
"NewConversations": "New conversations"
|
|
198
199
|
}
|