@chat21/chat21-ionic 3.0.97-rc.4 → 3.0.97
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 +11 -0
- package/README.md +6 -0
- package/package.json +1 -1
- package/src/app/app-routing.module.ts +5 -0
- package/src/app/app.component.ts +10 -10
- package/src/app/app.module.ts +2 -0
- package/src/app/components/conversation-detail/message-text-area/message-text-area.component.html +16 -9
- package/src/app/components/conversation-detail/message-text-area/message-text-area.component.ts +43 -2
- package/src/app/modals/send-email/send-email.module.ts +0 -10
- package/src/app/modals/send-email/send-email.page.html +5 -5
- package/src/app/modals/send-email/send-email.page.scss +18 -4
- package/src/app/modals/send-email/send-email.page.ts +15 -2
- package/src/app/modals/send-whatsapp-template/send-whatsapp-template-routing.module.ts +17 -0
- package/src/app/modals/send-whatsapp-template/send-whatsapp-template.module.ts +28 -0
- package/src/app/modals/send-whatsapp-template/send-whatsapp-template.page.html +139 -0
- package/src/app/modals/send-whatsapp-template/send-whatsapp-template.page.scss +366 -0
- package/src/app/modals/send-whatsapp-template/send-whatsapp-template.page.spec.ts +24 -0
- package/src/app/modals/send-whatsapp-template/send-whatsapp-template.page.ts +183 -0
- package/src/app/pages/contacts-directory/contacts-directory.page.html +8 -0
- package/src/app/pages/contacts-directory/contacts-directory.page.scss +80 -0
- package/src/app/pages/contacts-directory/contacts-directory.page.ts +1 -0
- package/src/app/pages/conversation-detail/conversation-detail.page.html +3 -0
- package/src/app/pages/conversation-detail/conversation-detail.page.ts +209 -200
- package/src/app/services/templates/templates.service.spec.ts +12 -0
- package/src/app/services/templates/templates.service.ts +42 -0
- package/src/assets/i18n/ar.json +20 -11
- package/src/assets/i18n/az.json +296 -287
- package/src/assets/i18n/de.json +20 -11
- package/src/assets/i18n/en.json +20 -11
- package/src/assets/i18n/es.json +20 -11
- package/src/assets/i18n/fr.json +20 -11
- package/src/assets/i18n/it.json +20 -11
- package/src/assets/i18n/kk.json +296 -287
- package/src/assets/i18n/pt.json +20 -11
- package/src/assets/i18n/ru.json +20 -11
- package/src/assets/i18n/sr.json +20 -11
- package/src/assets/i18n/sv.json +296 -287
- package/src/assets/i18n/tr.json +27 -18
- package/src/assets/i18n/uk.json +296 -287
- package/src/assets/i18n/uz.json +296 -287
- package/src/assets/images/whatsapp_background.png +0 -0
- package/src/chat-config-template.json +3 -1
- package/src/chat-config.json +3 -1
- package/src/chat21-core/providers/firebase/firebase-conversations-handler.ts +6 -1
- package/src/chat21-core/providers/mqtt/mqtt-conversation-handler.ts +29 -2
- package/src/chat21-core/providers/mqtt/mqtt-conversations-handler.ts +9 -0
- package/src/chat-config-mqtt-localhost.json +0 -35
- package/src/chat-config-mqtt.json +0 -26
- package/src/chat-config-native-mqtt.json +0 -36
- package/src/chat-config-native-prod.json +0 -36
- package/src/chat-config-pre.json +0 -34
|
@@ -22,8 +22,9 @@ import { AppConfigProvider } from 'src/app/services/app-config';
|
|
|
22
22
|
// utils
|
|
23
23
|
import { avatarPlaceholder, getColorBck } from '../../utils/utils-user';
|
|
24
24
|
import { compareValues, conversationsPathForUserId, searchIndexInArrayForUid, isGroup } from '../../utils/utils';
|
|
25
|
-
import { TOUCHING_OPERATOR } from '../../utils/constants';
|
|
25
|
+
import { MESSAGE_TYPE_INFO, TOUCHING_OPERATOR } from '../../utils/constants';
|
|
26
26
|
import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http';
|
|
27
|
+
import { messageType } from 'src/chat21-core/utils/utils-message';
|
|
27
28
|
|
|
28
29
|
|
|
29
30
|
// @Injectable({ providedIn: 'root' })
|
|
@@ -517,6 +518,10 @@ export class FirebaseConversationsHandler extends ConversationsHandlerService {
|
|
|
517
518
|
|
|
518
519
|
private changed(childSnapshot: any) {
|
|
519
520
|
const oldConversation = this.conversations[searchIndexInArrayForUid(this.conversations, childSnapshot.key)]
|
|
521
|
+
//skip info message updates
|
|
522
|
+
if(messageType(MESSAGE_TYPE_INFO, oldConversation) ){
|
|
523
|
+
return;
|
|
524
|
+
}
|
|
520
525
|
if (this.conversationGenerate(childSnapshot)) {
|
|
521
526
|
const index = searchIndexInArrayForUid(this.conversations, childSnapshot.key);
|
|
522
527
|
if (index > -1) {
|
|
@@ -23,6 +23,7 @@ import {
|
|
|
23
23
|
searchIndexInArrayForUid,
|
|
24
24
|
conversationMessagesRef
|
|
25
25
|
} from '../../utils/utils';
|
|
26
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
26
27
|
import { isSender, messageType } from '../../utils/utils-message';
|
|
27
28
|
|
|
28
29
|
|
|
@@ -111,7 +112,13 @@ export class MQTTConversationHandler extends ConversationHandlerService {
|
|
|
111
112
|
this.conversationWith, (message, topic) => {
|
|
112
113
|
this.logger.log('[MQTTConversationHandler] message added:', message, 'on topic:', topic);
|
|
113
114
|
const msg: MessageModel = message;
|
|
114
|
-
|
|
115
|
+
|
|
116
|
+
//allow to replace message in unknown status (pending status: '0')
|
|
117
|
+
if(message.attributes && message.attributes.tempUID){
|
|
118
|
+
msg.uid = message.attributes.tempUID;
|
|
119
|
+
}else{
|
|
120
|
+
msg.uid = message.message_id
|
|
121
|
+
}
|
|
115
122
|
|
|
116
123
|
this.addedMessage(msg);
|
|
117
124
|
});
|
|
@@ -170,6 +177,7 @@ export class MQTTConversationHandler extends ConversationHandlerService {
|
|
|
170
177
|
const recipientFullname = conversationWithFullname;
|
|
171
178
|
const recipientId = conversationWith;
|
|
172
179
|
attributes.lang = language;
|
|
180
|
+
attributes.tempUID = uuidv4(); //allow to show message in a pending status
|
|
173
181
|
this.chat21Service.chatClient.sendMessage(
|
|
174
182
|
msg,
|
|
175
183
|
typeMsg,
|
|
@@ -189,6 +197,25 @@ export class MQTTConversationHandler extends ConversationHandlerService {
|
|
|
189
197
|
}
|
|
190
198
|
}
|
|
191
199
|
);
|
|
200
|
+
|
|
201
|
+
const message = new MessageModel(
|
|
202
|
+
attributes.tempUID, //allow to show message in a pending status
|
|
203
|
+
language,
|
|
204
|
+
conversationWith,
|
|
205
|
+
recipientFullname,
|
|
206
|
+
sender,
|
|
207
|
+
senderFullname,
|
|
208
|
+
0,
|
|
209
|
+
metadataMsg,
|
|
210
|
+
msg,
|
|
211
|
+
Date.now(),
|
|
212
|
+
typeMsg,
|
|
213
|
+
attributes,
|
|
214
|
+
channelType,
|
|
215
|
+
false
|
|
216
|
+
);
|
|
217
|
+
this.addedMessage(message) //allow to show message in a pending status: add pending message in array of messages
|
|
218
|
+
|
|
192
219
|
return new MessageModel(
|
|
193
220
|
'',
|
|
194
221
|
language,
|
|
@@ -402,7 +429,7 @@ export class MQTTConversationHandler extends ConversationHandlerService {
|
|
|
402
429
|
*/
|
|
403
430
|
private updateMessageStatusReceived(msg) {
|
|
404
431
|
this.logger.log('[MQTTConversationHandler] updateMessageStatusReceived', msg);
|
|
405
|
-
if (msg['status'] < MSG_STATUS_RECEIVED) {
|
|
432
|
+
if (msg['status'] < MSG_STATUS_RECEIVED && msg['status'] > 0) {
|
|
406
433
|
this.logger.log('[MQTTConversationHandler] status ', msg['status'], ' < (RECEIVED:200)', MSG_STATUS_RECEIVED);
|
|
407
434
|
if (msg.sender !== this.loggedUser.uid && msg.status < MSG_STATUS_RECEIVED) {
|
|
408
435
|
this.logger.log('[MQTTConversationHandler] updating message with status received');
|
|
@@ -17,6 +17,8 @@ import { compareValues, conversationsPathForUserId, searchIndexInArrayForUid } f
|
|
|
17
17
|
import { LoggerService } from '../abstract/logger.service';
|
|
18
18
|
import { LoggerInstance } from '../logger/loggerInstance';
|
|
19
19
|
import { THIS_EXPR } from '@angular/compiler/src/output/output_ast';
|
|
20
|
+
import { messageType } from 'src/chat21-core/utils/utils-message';
|
|
21
|
+
import { MESSAGE_TYPE_INFO } from 'src/chat21-core/utils/constants';
|
|
20
22
|
// import { ImageRepoService } from '../abstract/image-repo.service';
|
|
21
23
|
// import { ConsoleReporter } from 'jasmine';
|
|
22
24
|
|
|
@@ -251,6 +253,13 @@ export class MQTTConversationsHandler extends ConversationsHandlerService {
|
|
|
251
253
|
if (!conversation.conversation_with) {
|
|
252
254
|
conversation.conversation_with = conversation.conversWith // conversWith comes from remote
|
|
253
255
|
}
|
|
256
|
+
|
|
257
|
+
//skip info message updates
|
|
258
|
+
if(messageType(MESSAGE_TYPE_INFO, conversation) ){
|
|
259
|
+
return;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
|
|
254
263
|
const index = searchIndexInArrayForUid(this.conversations, conversation.conversation_with);
|
|
255
264
|
const oldConversation = this.conversations[index]
|
|
256
265
|
if (index > -1) {
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"t2y12PruGU9wUtEGzBJfolMIgK": "CAR:T-PAY:T-ANA:T-ACT:T-APP:T",
|
|
3
|
-
"chatEngine": "mqtt",
|
|
4
|
-
"uploadEngine": "native",
|
|
5
|
-
"pushEngine": "none",
|
|
6
|
-
"fileUploadAccept": "*/*",
|
|
7
|
-
"firebaseConfig": {
|
|
8
|
-
"apiKey": "AIzaSyCoWXHNvP1-qOllCpTshhC6VjPXeRTK0T4",
|
|
9
|
-
"authDomain": "chat21-pre-01.firebaseapp.com",
|
|
10
|
-
"databaseURL": "https://chat21-pre-01.firebaseio.com",
|
|
11
|
-
"projectId": "chat21-pre-01",
|
|
12
|
-
"storageBucket": "chat21-pre-01.appspot.com",
|
|
13
|
-
"messagingSenderId": "269505353043",
|
|
14
|
-
"appId": "1:269505353043:web:b82af070572669e3707da6",
|
|
15
|
-
"chat21ApiUrl": "https://us-central1-chat21-pre-01.cloudfunctions.net",
|
|
16
|
-
"tenant":"tilechat"
|
|
17
|
-
},
|
|
18
|
-
"chat21Config": {
|
|
19
|
-
"appId": "tilechat",
|
|
20
|
-
"MQTTendpoint": "ws://localhost:15675/ws",
|
|
21
|
-
"APIendpoint": "http://localhost:8004/api",
|
|
22
|
-
"_log": true
|
|
23
|
-
},
|
|
24
|
-
"apiUrl": "http://localhost:3000/",
|
|
25
|
-
"baseImageUrl": "http://localhost:3000/",
|
|
26
|
-
"dashboardUrl": "http://localhost:8081/",
|
|
27
|
-
"testsiteBaseUrl": "http://localhost:8081/widget/assets/twp/index.html",
|
|
28
|
-
"logLevel": "DEBUG",
|
|
29
|
-
"authPersistence": "LOCAL",
|
|
30
|
-
"supportMode": true,
|
|
31
|
-
"archivedButton": true,
|
|
32
|
-
"writeToButton": true,
|
|
33
|
-
"wsUrl": "ws://localhost:8081/ws/",
|
|
34
|
-
"showInfoMessage":"MEMBER_JOINED_GROUP,TOUCHING_OPERATOR"
|
|
35
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"chatEngine": "mqtt",
|
|
3
|
-
"uploadEngine": "native",
|
|
4
|
-
"pushEngine": "mqtt",
|
|
5
|
-
"firebaseConfig": {
|
|
6
|
-
"apiKey": "AIzaSyCoWXHNvP1-qOllCpTshhC6VjPXeRTK0T4",
|
|
7
|
-
"authDomain": "chat21-pre-01.firebaseapp.com",
|
|
8
|
-
"databaseURL": "https://chat21-pre-01.firebaseio.com",
|
|
9
|
-
"projectId": "chat21-pre-01",
|
|
10
|
-
"storageBucket": "chat21-pre-01.appspot.com",
|
|
11
|
-
"messagingSenderId": "269505353043",
|
|
12
|
-
"appId": "1:269505353043:web:b82af070572669e3707da6",
|
|
13
|
-
"chat21ApiUrl": "https://us-central1-chat21-pre-01.cloudfunctions.net",
|
|
14
|
-
"tenant": "tilechat"
|
|
15
|
-
},
|
|
16
|
-
"chat21Config": {
|
|
17
|
-
"appId": "tilechat",
|
|
18
|
-
"MQTTendpoint": "ws://99.80.197.164:15675/ws",
|
|
19
|
-
"APIendpoint": "http://99.80.197.164:8004/api"
|
|
20
|
-
},
|
|
21
|
-
"apiUrl": "http://99.80.197.164:3000/",
|
|
22
|
-
"baseImageUrl": "http://99.80.197.164:3000/",
|
|
23
|
-
"dashboardUrl": "http://tiledesk-dashboard-pre.s3-eu-west-1.amazonaws.com/native-mqtt/dashboard/index.html",
|
|
24
|
-
"logLevel": "DEBUG",
|
|
25
|
-
"authPersistence": "NONE"
|
|
26
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"t2y12PruGU9wUtEGzBJfolMIgK": "CAR:T-PAY:T-ANA:T-ACT:T-APP:T",
|
|
3
|
-
"chatEngine": "mqtt",
|
|
4
|
-
"uploadEngine": "native",
|
|
5
|
-
"pushEngine":"none",
|
|
6
|
-
"fileUploadAccept":"*/*",
|
|
7
|
-
"logLevel": "DEBUG",
|
|
8
|
-
"remoteTranslationsUrl": "https://console.native.tiledesk.com/api/",
|
|
9
|
-
"firebaseConfig": {
|
|
10
|
-
"apiKey": "AIzaSyCoWXHNvP1-qOllCpTshhC6VjPXeRTK0T4",
|
|
11
|
-
"authDomain": "chat21-pre-01.firebaseapp.com",
|
|
12
|
-
"databaseURL": "https://chat21-pre-01.firebaseio.com",
|
|
13
|
-
"projectId": "chat21-pre-01",
|
|
14
|
-
"storageBucket": "chat21-pre-01.appspot.com",
|
|
15
|
-
"messagingSenderId": "269505353043",
|
|
16
|
-
"appId": "1:269505353043:web:b82af070572669e3707da6",
|
|
17
|
-
"chat21ApiUrl": "https://us-central1-chat21-pre-01.cloudfunctions.net",
|
|
18
|
-
"tenant":"tilechat"
|
|
19
|
-
},
|
|
20
|
-
"chat21Config": {
|
|
21
|
-
"appId": "tilechat",
|
|
22
|
-
"MQTTendpoint": "wss://console.native.tiledesk.com/mqws/ws",
|
|
23
|
-
"APIendpoint": "https://console.native.tiledesk.com/chatapi/api",
|
|
24
|
-
"_log": true
|
|
25
|
-
},
|
|
26
|
-
"apiUrl": "https://console.native.tiledesk.com/api/",
|
|
27
|
-
"baseImageUrl": "https://console.native.tiledesk.com/api/",
|
|
28
|
-
"dashboardUrl": "https://console.native.tiledesk.com/dashboard/",
|
|
29
|
-
"testsiteBaseUrl":"https://console.native.tiledesk.com/widget/assets/twp/index.html",
|
|
30
|
-
"authPersistence": "LOCAL",
|
|
31
|
-
"wsUrl":"wss://console.native.tiledesk.com/mqws/ws",
|
|
32
|
-
"supportMode": true,
|
|
33
|
-
"archivedButton": true,
|
|
34
|
-
"writeToButton": true,
|
|
35
|
-
"emailSection":true
|
|
36
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"t2y12PruGU9wUtEGzBJfolMIgK": "CAR:T-PAY:T-ANA:T-ACT:T-APP:T-MTT:T",
|
|
3
|
-
"chatEngine": "mqtt",
|
|
4
|
-
"uploadEngine": "native",
|
|
5
|
-
"pushEngine": "mqtt",
|
|
6
|
-
"fileUploadAccept": "*/*",
|
|
7
|
-
"firebaseConfig": {
|
|
8
|
-
"tenant": "tilechat",
|
|
9
|
-
"apiKey": "AIzaSyBv6ILBL_U6VfUs_y8kqPYn-b2mYRauq1k",
|
|
10
|
-
"authDomain": "tiledesk-v3-prod-cf4ff.firebaseapp.com",
|
|
11
|
-
"databaseURL": "https://tiledesk-v3-prod-cf4ff-default-rtdb.europe-west1.firebasedatabase.app",
|
|
12
|
-
"projectId": "tiledesk-v3-prod-cf4ff",
|
|
13
|
-
"storageBucket": "tiledesk-v3-prod-cf4ff.appspot.com",
|
|
14
|
-
"messagingSenderId": "522823349790",
|
|
15
|
-
"appId": "1:522823349790:web:0d4ba710f38b586e1fa00f",
|
|
16
|
-
"chat21ApiUrl": "https://us-central1-tiledesk-prod-v2.cloudfunctions.net",
|
|
17
|
-
"vapidKey": "BH7R85jN8ovJ36J8BKYmfVZsIRWbUj_WXQMs8U3bDN02upqyqy2TpElVQIGMTUyOE2V7UwE11T_sy5yQHg02bjs"
|
|
18
|
-
},
|
|
19
|
-
"chat21Config": {
|
|
20
|
-
"appId": "tilechat",
|
|
21
|
-
"MQTTendpoint": "wss://eu.rtmv3.tiledesk.com/mqws/ws",
|
|
22
|
-
"APIendpoint": "https://eu.rtmv3.tiledesk.com/chatapi/api/"
|
|
23
|
-
},
|
|
24
|
-
"apiUrl": "https://api.tiledesk.com/v3/",
|
|
25
|
-
"baseImageUrl": "https://eu.rtmv3.tiledesk.com/api/",
|
|
26
|
-
"dashboardUrl": "https://panel.tiledesk.com/v3/dashboard/",
|
|
27
|
-
"testsiteBaseUrl": "https://widget.tiledesk.com/v6/assets/twp/index.html",
|
|
28
|
-
"wsUrl": "wss://eu.rtmv3.tiledesk.com/api/",
|
|
29
|
-
"logLevel": "debug",
|
|
30
|
-
"authPersistence": "LOCAL",
|
|
31
|
-
"storage_prefix": "chat_sv6",
|
|
32
|
-
"supportMode": true,
|
|
33
|
-
"archivedButton": true,
|
|
34
|
-
"writeToButton": true,
|
|
35
|
-
"emailSection":true
|
|
36
|
-
}
|
package/src/chat-config-pre.json
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"t2y12PruGU9wUtEGzBJfolMIgK": "CAR:T-PAY:T-ANA:T-ACT:T-APP:T-MTT:T",
|
|
3
|
-
"chatEngine": "firebase",
|
|
4
|
-
"uploadEngine": "firebase",
|
|
5
|
-
"pushEngine": "firebase",
|
|
6
|
-
"fileUploadAccept": "*/*",
|
|
7
|
-
"firebaseConfig": {
|
|
8
|
-
"apiKey": "AIzaSyCoWXHNvP1-qOllCpTshhC6VjPXeRTK0T4",
|
|
9
|
-
"authDomain": "chat21-pre-01.firebaseapp.com",
|
|
10
|
-
"databaseURL": "https://chat21-pre-01.firebaseio.com",
|
|
11
|
-
"projectId": "chat21-pre-01",
|
|
12
|
-
"storageBucket": "chat21-pre-01.appspot.com",
|
|
13
|
-
"messagingSenderId": "269505353043",
|
|
14
|
-
"appId": "1:269505353043:web:b82af070572669e3707da6",
|
|
15
|
-
"chat21ApiUrl": "https://us-central1-chat21-pre-01.cloudfunctions.net",
|
|
16
|
-
"tenant":"tilechat",
|
|
17
|
-
"vapidKey": "BOsgS2ADwspKdWAmiFDZXEYqY1HSYADVfJT3j67wsySh3NxaViJqoabPJH8WM02wb5r8cQIm5TgM0UK047Z1D1c"
|
|
18
|
-
},
|
|
19
|
-
"chat21Config": {
|
|
20
|
-
"appId": "tilechat",
|
|
21
|
-
"MQTTendpoint": "ws://99.80.197.164:15675/ws",
|
|
22
|
-
"APIendpoint": "http://99.80.197.164:8004/api"
|
|
23
|
-
},
|
|
24
|
-
"apiUrl": "https://tiledesk-server-pre.herokuapp.com/",
|
|
25
|
-
"baseImageUrl": "https://firebasestorage.googleapis.com/v0/b/",
|
|
26
|
-
"dashboardUrl": "https://support-pre.tiledesk.com/dashboard/",
|
|
27
|
-
"testsiteBaseUrl": "https://widget-pre.tiledesk.com/v5/assets/twp/index.html",
|
|
28
|
-
"logLevel": "DEBUG",
|
|
29
|
-
"authPersistence": "LOCAL",
|
|
30
|
-
"supportMode": true,
|
|
31
|
-
"archivedButton": true,
|
|
32
|
-
"writeToButton": true,
|
|
33
|
-
"wsUrl": "wss://tiledesk-server-pre.herokuapp.com/"
|
|
34
|
-
}
|