@chat21/chat21-ionic 3.0.75 → 3.0.76-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 +9 -1
- package/deploy_amazon_beta.sh +1 -1
- package/package.json +1 -1
- package/src/app/app.component.ts +1 -1
- package/src/app/chatlib/conversation-detail/conversation-content/conversation-content.component.ts +7 -7
- package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.html +8 -8
- package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.ts +5 -6
- package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.html +4 -4
- package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.scss +0 -10
- package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.ts +4 -9
- package/src/app/chatlib/conversation-detail/message/frame/frame.component.ts +8 -3
- package/src/app/chatlib/conversation-detail/message/image/image.component.ts +2 -2
- package/src/app/chatlib/conversation-detail/message/message-attachment/message-attachment.component.ts +6 -1
- package/src/app/components/conversation-detail/message-text-area/message-text-area.component.html +0 -2
- package/src/app/components/conversation-detail/message-text-area/message-text-area.component.ts +1 -1
- package/src/app/pages/conversation-detail/conversation-detail.page.html +22 -6
- package/src/app/pages/conversation-detail/conversation-detail.page.scss +10 -0
- package/src/app/pages/conversation-detail/conversation-detail.page.ts +126 -67
- package/src/app/pages/conversations-list/conversations-list.page.ts +28 -2
- package/src/app/pages/loader-preview/loader-preview.page.ts +8 -27
- package/src/app/services/canned-responses/canned-responses.service.ts +43 -7
- package/src/app/utils/scrollbar-theme.directive.ts +2 -1
- package/src/assets/i18n/ar.json +2 -0
- package/src/assets/i18n/az.json +2 -0
- package/src/assets/i18n/de.json +2 -0
- package/src/assets/i18n/en.json +2 -0
- package/src/assets/i18n/es.json +2 -0
- package/src/assets/i18n/fr.json +2 -0
- package/src/assets/i18n/it.json +2 -0
- package/src/assets/i18n/kk.json +2 -0
- package/src/assets/i18n/pt.json +2 -0
- package/src/assets/i18n/ru.json +2 -0
- package/src/assets/i18n/sr.json +2 -0
- package/src/assets/i18n/sv.json +2 -0
- package/src/assets/i18n/tr.json +2 -0
- package/src/assets/i18n/uk.json +2 -0
- package/src/assets/i18n/uz.json +2 -0
- package/src/chat-config-pre.json +1 -1
- package/src/chat21-core/providers/firebase/firebase-conversation-handler.ts +14 -4
- package/src/chat21-core/providers/firebase/firebase-conversations-handler.ts +1 -1
- package/src/chat21-core/providers/mqtt/mqtt-conversation-handler.ts +22 -0
- package/src/chat21-core/utils/constants.ts +3 -1
- package/src/chat21-core/utils/utils.ts +14 -0
- package/src/global.scss +27 -0
|
@@ -22,6 +22,7 @@ import {
|
|
|
22
22
|
IonContent,
|
|
23
23
|
IonTextarea,
|
|
24
24
|
IonButton,
|
|
25
|
+
IonInput,
|
|
25
26
|
} from '@ionic/angular'
|
|
26
27
|
|
|
27
28
|
// models
|
|
@@ -44,7 +45,7 @@ import { ArchivedConversationsHandlerService } from 'src/chat21-core/providers/a
|
|
|
44
45
|
import { ConversationHandlerService } from 'src/chat21-core/providers/abstract/conversation-handler.service'
|
|
45
46
|
import { ContactsService } from 'src/app/services/contacts/contacts.service'
|
|
46
47
|
import { CannedResponsesService } from '../../services/canned-responses/canned-responses.service'
|
|
47
|
-
import { compareValues, htmlEntities } from '../../../chat21-core/utils/utils'
|
|
48
|
+
import { compareValues, getDateDifference, htmlEntities } from '../../../chat21-core/utils/utils'
|
|
48
49
|
import { ImageRepoService } from 'src/chat21-core/providers/abstract/image-repo.service'
|
|
49
50
|
import { PresenceService } from 'src/chat21-core/providers/abstract/presence.service'
|
|
50
51
|
import { CreateCannedResponsePage } from 'src/app/pages/create-canned-response/create-canned-response.page'
|
|
@@ -100,7 +101,7 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
|
|
|
100
101
|
|
|
101
102
|
private unsubscribe$: Subject<any> = new Subject<any>()
|
|
102
103
|
private subscriptions: Array<any>
|
|
103
|
-
public tenant: string
|
|
104
|
+
public tenant: string;
|
|
104
105
|
public loggedUser: UserModel
|
|
105
106
|
public conversationWith: string
|
|
106
107
|
public conversationWithFullname: string
|
|
@@ -128,9 +129,10 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
|
|
|
128
129
|
public showIonContent = false
|
|
129
130
|
public conv_type: string
|
|
130
131
|
|
|
132
|
+
public messageStr: string;
|
|
131
133
|
public tagsCanned: any = []
|
|
132
134
|
public tagsCannedCount: number
|
|
133
|
-
public tagsCannedFilter: any = []
|
|
135
|
+
public tagsCannedFilter: Array<any> = []
|
|
134
136
|
public HIDE_CANNED_RESPONSES: boolean = false
|
|
135
137
|
|
|
136
138
|
public window: any = window
|
|
@@ -227,6 +229,8 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
|
|
|
227
229
|
|
|
228
230
|
this.events.publish('supportconvid:haschanged', this.conversationWith)
|
|
229
231
|
})
|
|
232
|
+
|
|
233
|
+
|
|
230
234
|
}
|
|
231
235
|
|
|
232
236
|
// -----------------------------------------------------------
|
|
@@ -634,6 +638,8 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
|
|
|
634
638
|
'INFO_SUPPORT_CHAT_REOPENED',
|
|
635
639
|
'INFO_SUPPORT_CHAT_CLOSED',
|
|
636
640
|
'INFO_A_NEW_SUPPORT_REQUEST_HAS_BEEN_ASSIGNED_TO_YOU',
|
|
641
|
+
'INFO_SUPPORT_LEAD_UPDATED',
|
|
642
|
+
'INFO_SUPPORT_MEMBER_LEFT_GROUP',
|
|
637
643
|
'LABEL_TODAY',
|
|
638
644
|
'LABEL_TOMORROW',
|
|
639
645
|
'LABEL_LAST_ACCESS',
|
|
@@ -758,6 +764,8 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
|
|
|
758
764
|
conv.conversation_with_fullname,
|
|
759
765
|
conv.channel_type,
|
|
760
766
|
)
|
|
767
|
+
let duration = getDateDifference(conv.timestamp, Date.now())
|
|
768
|
+
duration.days > 10? this.disableTextarea = true: this.disableTextarea = false
|
|
761
769
|
}
|
|
762
770
|
})
|
|
763
771
|
}
|
|
@@ -768,11 +776,14 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
|
|
|
768
776
|
this.logger.debug('[CONV-COMP] setHeaderContent getConversationDetail: archivedConversationsHandlerService', this.conversationWith, this.conv_type)
|
|
769
777
|
this.archivedConversationsHandlerService.getConversationDetail(this.conversationWith, (conv) => {
|
|
770
778
|
if (conv) {
|
|
779
|
+
|
|
771
780
|
this.conversationAvatar = setConversationAvatar(
|
|
772
781
|
conv.conversation_with,
|
|
773
782
|
conv.conversation_with_fullname,
|
|
774
783
|
conv.channel_type,
|
|
775
784
|
)
|
|
785
|
+
let duration = getDateDifference(conv.timestamp, Date.now())
|
|
786
|
+
duration.days > 10? this.disableTextarea = true: this.disableTextarea = false
|
|
776
787
|
}
|
|
777
788
|
if(!conv){
|
|
778
789
|
this.conversationsHandlerService.getConversationDetail(this.conversationWith, (conv) => {
|
|
@@ -797,6 +808,8 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
|
|
|
797
808
|
// this.logger.log('[CONVS-DETAIL] - setHeaderContent > conversationAvatar: ', this.conversationAvatar);
|
|
798
809
|
}
|
|
799
810
|
|
|
811
|
+
|
|
812
|
+
|
|
800
813
|
returnSendMessage(e: any) {
|
|
801
814
|
this.logger.log('[CONVS-DETAIL] - returnSendMessage event', e, ' - conversationWith', this.conversationWith)
|
|
802
815
|
|
|
@@ -1032,7 +1045,7 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
|
|
|
1032
1045
|
this.conversationAvatar = setConversationAvatar(
|
|
1033
1046
|
this.conversationWith,
|
|
1034
1047
|
this.conversationWithFullname,
|
|
1035
|
-
this.
|
|
1048
|
+
this.channelType
|
|
1036
1049
|
)
|
|
1037
1050
|
|
|
1038
1051
|
}
|
|
@@ -1181,20 +1194,14 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
|
|
|
1181
1194
|
// Load canned responses
|
|
1182
1195
|
// --------------------------------------------
|
|
1183
1196
|
this.loadTagsCanned(strSearch, this.conversationWith)
|
|
1184
|
-
|
|
1197
|
+
this.HIDE_CANNED_RESPONSES = false
|
|
1198
|
+
this.messageStr = strSearch
|
|
1185
1199
|
// ------------------------------------------------------------------------------------------------------------------------------------------
|
|
1186
1200
|
// Hide / display Canned when the SLASH has POSITION POS 0 and checking if there is a space after the SLASH (in this case it will be hidden)
|
|
1187
1201
|
// ------------------------------------------------------------------------------------------------------------------------------------------
|
|
1188
1202
|
|
|
1189
|
-
var after_slash = message.substring(
|
|
1190
|
-
|
|
1191
|
-
message.length,
|
|
1192
|
-
)
|
|
1193
|
-
if (
|
|
1194
|
-
pos === 0 &&
|
|
1195
|
-
after_slash.length === 1 &&
|
|
1196
|
-
after_slash.trim() === ''
|
|
1197
|
-
) {
|
|
1203
|
+
var after_slash = message.substring( message.lastIndexOf('/') + 1, message.length)
|
|
1204
|
+
if (pos === 0 && after_slash.length === 1 && after_slash.trim() === '' ) {
|
|
1198
1205
|
this.logger.log('[CONVS-DETAIL] - returnChangeTextArea after_slash --> there is a white space after ')
|
|
1199
1206
|
this.HIDE_CANNED_RESPONSES = true
|
|
1200
1207
|
this.tagsCannedFilter = []
|
|
@@ -1203,39 +1210,39 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
|
|
|
1203
1210
|
this.HIDE_CANNED_RESPONSES = false
|
|
1204
1211
|
}
|
|
1205
1212
|
|
|
1206
|
-
if (pos > 0) {
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
}
|
|
1213
|
+
// if (pos > 0) {
|
|
1214
|
+
// // ------------------------------------------------------------------------------------------------------------------------------------------
|
|
1215
|
+
// // Hide / display Canned when the SLASH has POSITION POS > and checking if there is a space after the SLASH (in this case they it be hidden)
|
|
1216
|
+
// // and if there is not a space before the SLASH (in this it will be hidden)
|
|
1217
|
+
// // ------------------------------------------------------------------------------------------------------------------------------------------
|
|
1218
|
+
|
|
1219
|
+
// let beforeSlash = message.substr(pos - 1)
|
|
1220
|
+
// let afterSlash = message.substr(pos + 1)
|
|
1221
|
+
// this.logger.log('[CONVS-DETAIL] - returnChangeTextArea * POS ', pos)
|
|
1222
|
+
|
|
1223
|
+
// this.logger.log('[CONVS-DETAIL] - returnChangeTextArea --> beforeSlash', beforeSlash)
|
|
1224
|
+
// this.logger.log('[CONVS-DETAIL] - returnChangeTextArea --> afterSlash', afterSlash)
|
|
1225
|
+
// var afterSlashParts = afterSlash.split('/')
|
|
1226
|
+
// var beforeSlashParts = beforeSlash.split('/')
|
|
1227
|
+
// this.logger.log('[CONVS-DETAIL] - returnChangeTextArea --> afterSlash parts', afterSlashParts)
|
|
1228
|
+
// this.logger.log('[CONVS-DETAIL] - returnChangeTextArea --> beforeSlash parts', beforeSlashParts)
|
|
1229
|
+
|
|
1230
|
+
// if (beforeSlashParts.length === 2) {
|
|
1231
|
+
// if (beforeSlashParts[0].indexOf(' ') >= 0 && afterSlashParts[0] === '') {
|
|
1232
|
+
// this.HIDE_CANNED_RESPONSES = false
|
|
1233
|
+
// this.logger.log('[CONVS-DETAIL] - returnChangeTextArea --> beforeSlash there is a white space After Not')
|
|
1234
|
+
// // if (beforeSlashParts[0].indexOf(' ') >= 0 && afterSlashParts[0].indexOf(' ') >= 0)
|
|
1235
|
+
// } else if (beforeSlashParts[0].indexOf(' ') < 0 && afterSlashParts[0] === '') {
|
|
1236
|
+
// this.HIDE_CANNED_RESPONSES = true
|
|
1237
|
+
// this.tagsCannedFilter = []
|
|
1238
|
+
// this.logger.log('[CONVS-DETAIL] - returnChangeTextArea --> beforeSlash not thete is a white space After Not')
|
|
1239
|
+
// } else if (beforeSlashParts[0].indexOf(' ') >= 0 && afterSlashParts[0] === ' ') {
|
|
1240
|
+
// this.logger.log('[CONVS-DETAIL] - returnChangeTextArea --> beforeSlash not thete is a white space After YES')
|
|
1241
|
+
// this.HIDE_CANNED_RESPONSES = true
|
|
1242
|
+
// this.tagsCannedFilter = []
|
|
1243
|
+
// }
|
|
1244
|
+
// }
|
|
1245
|
+
// }
|
|
1239
1246
|
} else {
|
|
1240
1247
|
this.tagsCannedFilter = []
|
|
1241
1248
|
}
|
|
@@ -1263,12 +1270,12 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
|
|
|
1263
1270
|
}
|
|
1264
1271
|
|
|
1265
1272
|
this.logger.log('[CONVS-DETAIL] - loadTagsCanned conversationWith_segments ', conversationWith_segments)
|
|
1266
|
-
let
|
|
1273
|
+
let project = ''
|
|
1267
1274
|
|
|
1268
1275
|
if (conversationWith_segments.length === 4) {
|
|
1269
|
-
|
|
1270
|
-
this.logger.log('[CONVS-DETAIL] - loadTagsCanned projectId ',
|
|
1271
|
-
this.getAndShowCannedResponses(strSearch,
|
|
1276
|
+
project = conversationWith_segments[2]
|
|
1277
|
+
this.logger.log('[CONVS-DETAIL] - loadTagsCanned projectId ', project)
|
|
1278
|
+
this.getAndShowCannedResponses(strSearch, project)
|
|
1272
1279
|
} else {
|
|
1273
1280
|
this.getProjectIdByConversationWith(strSearch, this.conversationWith)
|
|
1274
1281
|
}
|
|
@@ -1298,7 +1305,7 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
|
|
|
1298
1305
|
this.logger.log('[CONVS-DETAIL] - loadTagsCanned tagsCanned.length', this.tagsCanned.length)
|
|
1299
1306
|
//if(this.tagsCanned.length <= 0 ){
|
|
1300
1307
|
this.tagsCanned = []
|
|
1301
|
-
this.cannedResponsesService.
|
|
1308
|
+
this.cannedResponsesService.getAll(tiledeskToken, projectId).subscribe((res) => {
|
|
1302
1309
|
this.logger.log('[CONVS-DETAIL] - loadTagsCanned getCannedResponses RES', res)
|
|
1303
1310
|
|
|
1304
1311
|
this.tagsCanned = res
|
|
@@ -1328,15 +1335,18 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
|
|
|
1328
1335
|
if (strSearch.length > 0) {
|
|
1329
1336
|
strReplace = "<b class='highlight-search-string'>" + strSearch + '</b>'
|
|
1330
1337
|
}
|
|
1331
|
-
for (var i = 0; i < this.tagsCannedFilter.length; i++) {
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1338
|
+
// for (var i = 0; i < this.tagsCannedFilter.length; i++) {
|
|
1339
|
+
// let text = htmlEntities(this.tagsCannedFilter[i].text);
|
|
1340
|
+
// // const textCanned = "<div class='cannedText'>" + this.replacePlaceholderInCanned(this.tagsCannedFilter[i].text) + '</div>'
|
|
1341
|
+
// const textCanned = "<div class='cannedText'>" + this.replacePlaceholderInCanned(text) + '</div>'
|
|
1342
|
+
// let title = htmlEntities(this.tagsCannedFilter[i].title)
|
|
1343
|
+
// // this.tagsCannedFilter[i].title = "<div class='cannedContent'><div class='cannedTitle'>" + this.tagsCannedFilter[i].title.toString().replace(strSearch, strReplace.trim()) + '</div>' + textCanned + '</div>'
|
|
1344
|
+
// this.tagsCannedFilter[i].title = "<div class='cannedContent'><div class='cannedTitle'>" + title.toString().replace(strSearch, strReplace.trim()) + '</div>' + textCanned + '</div>'
|
|
1345
|
+
// }
|
|
1346
|
+
this.tagsCannedFilter.forEach(canned => {
|
|
1347
|
+
canned.text = this.replacePlaceholderInCanned(canned.text);
|
|
1348
|
+
canned.disabled = true
|
|
1349
|
+
});
|
|
1340
1350
|
if (this.tagsCannedCount === 0) {
|
|
1341
1351
|
// const button = this.renderer.createElement('button');
|
|
1342
1352
|
// const buttonText = this.renderer.createText('Click me');
|
|
@@ -1393,7 +1403,10 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
|
|
|
1393
1403
|
}
|
|
1394
1404
|
|
|
1395
1405
|
replaceTagInMessage(canned, event) {
|
|
1396
|
-
if
|
|
1406
|
+
if(!canned.disabled){
|
|
1407
|
+
event.preventDefault();
|
|
1408
|
+
event.stopPropagation();
|
|
1409
|
+
}else if (this.tagsCannedCount > 0) {
|
|
1397
1410
|
// console.log('[CONVS-DETAIL] replaceTagInMessage event ', event)
|
|
1398
1411
|
// console.log('[CONVS-DETAIL] replaceTagInMessage canned ', canned)
|
|
1399
1412
|
// console.log('[CONVS-DETAIL] replaceTagInMessage canned title', canned.title)
|
|
@@ -1438,6 +1451,52 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
|
|
|
1438
1451
|
}
|
|
1439
1452
|
}
|
|
1440
1453
|
|
|
1454
|
+
onEditCanned(canned, ev){
|
|
1455
|
+
ev.preventDefault()
|
|
1456
|
+
ev.stopPropagation()
|
|
1457
|
+
canned.disabled = false
|
|
1458
|
+
this.logger.log('[CONVS-DETAIL] onEditCanned ', canned)
|
|
1459
|
+
setTimeout(() => {
|
|
1460
|
+
this.el.nativeElement.querySelector('#titleCanned_'+canned._id).setFocus()
|
|
1461
|
+
}, 500);
|
|
1462
|
+
}
|
|
1463
|
+
|
|
1464
|
+
onConfirmEditCanned(canned, ev){
|
|
1465
|
+
ev.preventDefault()
|
|
1466
|
+
ev.stopPropagation()
|
|
1467
|
+
const tiledeskToken = this.tiledeskAuthService.getTiledeskToken()
|
|
1468
|
+
this.logger.log('[CONVS-DETAIL] onConfirmEditCanned ', canned, ev)
|
|
1469
|
+
this.cannedResponsesService.edit(tiledeskToken, canned.id_project, canned).subscribe(cannedRes=> {
|
|
1470
|
+
canned.disabled = true
|
|
1471
|
+
}, (error) => {
|
|
1472
|
+
this.logger.error('[CONVS-DETAIL] - onConfirmEditCanned - ERROR ', error)
|
|
1473
|
+
}, () => {
|
|
1474
|
+
this.logger.log('[CONVS-DETAIL] - onConfirmEditCanned * COMPLETE *')
|
|
1475
|
+
})
|
|
1476
|
+
}
|
|
1477
|
+
|
|
1478
|
+
onDeleteCanned(canned, ev){
|
|
1479
|
+
ev.preventDefault()
|
|
1480
|
+
ev.stopPropagation()
|
|
1481
|
+
const tiledeskToken = this.tiledeskAuthService.getTiledeskToken()
|
|
1482
|
+
this.logger.log('[CONVS-DETAIL] onDeleteCanned ', canned)
|
|
1483
|
+
this.cannedResponsesService.delete(tiledeskToken, canned.id_project, canned._id).subscribe(cannedRes=> {
|
|
1484
|
+
if(cannedRes.status === 1000){
|
|
1485
|
+
this.tagsCannedFilter.splice(this.tagsCannedFilter.findIndex(el => el._id === canned._id), 1)
|
|
1486
|
+
}
|
|
1487
|
+
}, (error) => {
|
|
1488
|
+
this.logger.error('[CONVS-DETAIL] - onConfirmEditCanned - ERROR ', error)
|
|
1489
|
+
}, () => {
|
|
1490
|
+
this.logger.log('[CONVS-DETAIL] - onConfirmEditCanned * COMPLETE *')
|
|
1491
|
+
})
|
|
1492
|
+
}
|
|
1493
|
+
|
|
1494
|
+
closeListCannedResponse(){
|
|
1495
|
+
this.logger.log('[CONVS-DETAIL] close list canned . . . ')
|
|
1496
|
+
this.HIDE_CANNED_RESPONSES = true
|
|
1497
|
+
this.tagsCannedFilter = []
|
|
1498
|
+
}
|
|
1499
|
+
|
|
1441
1500
|
async presentCreateCannedResponseModal(): Promise<any> {
|
|
1442
1501
|
const elTextArea = this.rowTextArea['el']
|
|
1443
1502
|
const textArea = elTextArea.getElementsByTagName('ion-textarea')[0]
|
|
@@ -1593,11 +1652,11 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
|
|
|
1593
1652
|
}, 1000)
|
|
1594
1653
|
}
|
|
1595
1654
|
|
|
1596
|
-
|
|
1655
|
+
onBeforeMessageRenderFN(event) {
|
|
1597
1656
|
//this.onBeforeMessageRender.emit(event)
|
|
1598
1657
|
}
|
|
1599
1658
|
|
|
1600
|
-
|
|
1659
|
+
onAfterMessageRenderFN(event) {
|
|
1601
1660
|
// this.onAfterMessageRender.emit(event)
|
|
1602
1661
|
}
|
|
1603
1662
|
|
|
@@ -1607,7 +1666,7 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
|
|
|
1607
1666
|
|
|
1608
1667
|
returnOnScrollContent(event: boolean) { }
|
|
1609
1668
|
|
|
1610
|
-
|
|
1669
|
+
onAttachmentButtonClickedFN(event: any) {
|
|
1611
1670
|
this.logger.debug('[CONV-COMP] eventbutton', event)
|
|
1612
1671
|
if (!event || !event.target.type) {
|
|
1613
1672
|
return
|
|
@@ -1640,9 +1699,9 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
|
|
|
1640
1699
|
}
|
|
1641
1700
|
}
|
|
1642
1701
|
|
|
1643
|
-
|
|
1702
|
+
onElementRenderedFN(event) {
|
|
1644
1703
|
const imageRendered = event
|
|
1645
|
-
if (this.
|
|
1704
|
+
if (event.status && this.ionContentChatArea) {
|
|
1646
1705
|
this.scrollBottom(0)
|
|
1647
1706
|
}
|
|
1648
1707
|
}
|
|
@@ -770,6 +770,11 @@ export class ConversationListPage implements OnInit {
|
|
|
770
770
|
}
|
|
771
771
|
}
|
|
772
772
|
}
|
|
773
|
+
|
|
774
|
+
if(conversation.conversation_with_fullname === 'Guest '){
|
|
775
|
+
conversation.conversation_with_fullname = 'guest' + '#' + this.getUUidConversation(conversation.uid)
|
|
776
|
+
}
|
|
777
|
+
|
|
773
778
|
}
|
|
774
779
|
|
|
775
780
|
// isMarkdownLink(last_message_text) {
|
|
@@ -783,6 +788,27 @@ export class ConversationListPage implements OnInit {
|
|
|
783
788
|
// }
|
|
784
789
|
// }
|
|
785
790
|
|
|
791
|
+
private getUUidConversation(uid): string{
|
|
792
|
+
const conversationWith_segments = uid.split('-')
|
|
793
|
+
// Removes the last element of the array if is = to the separator
|
|
794
|
+
if (conversationWith_segments[conversationWith_segments.length - 1] === '') {
|
|
795
|
+
conversationWith_segments.pop()
|
|
796
|
+
}
|
|
797
|
+
|
|
798
|
+
this.logger.log('[CONVS-LIST] - getUUidConversation conversationWith_segments ', conversationWith_segments, conversationWith_segments.length)
|
|
799
|
+
let mini_uid = ''
|
|
800
|
+
|
|
801
|
+
if (conversationWith_segments.length === 4) {
|
|
802
|
+
mini_uid = conversationWith_segments[conversationWith_segments.length -1].substr(0,5)
|
|
803
|
+
this.logger.log('[CONVS-LIST] - getUUidConversation mini_uid segment===4', mini_uid)
|
|
804
|
+
} else {
|
|
805
|
+
this.logger.log('[CONVS-LIST] - else getUUidConversation segment<4 ', mini_uid)
|
|
806
|
+
mini_uid = conversationWith_segments[conversationWith_segments.length -1].substr(-5)
|
|
807
|
+
}
|
|
808
|
+
|
|
809
|
+
return mini_uid
|
|
810
|
+
}
|
|
811
|
+
|
|
786
812
|
navigateByUrl(converationType: string, uidConvSelected: string) {
|
|
787
813
|
|
|
788
814
|
this.logger.log('[CONVS-LIST-PAGE] navigateByUrl uidConvSelected: ', uidConvSelected)
|
|
@@ -797,7 +823,7 @@ export class ConversationListPage implements OnInit {
|
|
|
797
823
|
let pageUrl = 'conversation-detail/' + this.uidConvSelected + '/' + this.conversationSelected.conversation_with_fullname + '/' + converationType
|
|
798
824
|
this.logger.log('[CONVS-LIST-PAGE] pageURL', pageUrl)
|
|
799
825
|
// replace(/\(/g, '%28').replace(/\)/g, '%29') -> used for the encoder of any round brackets
|
|
800
|
-
this.router.navigateByUrl(pageUrl.replace(/\(/g, '%28').replace(/\)/g, '%29'))
|
|
826
|
+
this.router.navigateByUrl(pageUrl.replace(/\(/g, '%28').replace(/\)/g, '%29').replace( /#/g, "%23" ))
|
|
801
827
|
} else {
|
|
802
828
|
this.logger.log('[CONVS-LIST-PAGE] navigateByUrl this.conversationSelected conversation_with_fullname ', this.conversationSelected.conversation_with_fullname)
|
|
803
829
|
this.logger.log('[CONVS-LIST-PAGE] checkPlatformIsMobile(): ', checkPlatformIsMobile())
|
|
@@ -808,7 +834,7 @@ export class ConversationListPage implements OnInit {
|
|
|
808
834
|
}
|
|
809
835
|
this.logger.log('[CONVS-LIST-PAGE] setUidConvSelected navigateByUrl--->: ', pageUrl)
|
|
810
836
|
// replace(/\(/g, '%28').replace(/\)/g, '%29') -> used for the encoder of any round brackets
|
|
811
|
-
this.router.navigateByUrl(pageUrl.replace(/\(/g, '%28').replace(/\)/g, '%29'))
|
|
837
|
+
this.router.navigateByUrl(pageUrl.replace(/\(/g, '%28').replace(/\)/g, '%29').replace( /#/g, "%23" ))
|
|
812
838
|
}
|
|
813
839
|
}
|
|
814
840
|
|
|
@@ -73,10 +73,7 @@ export class LoaderPreviewPage implements OnInit, AfterViewInit {
|
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
ionViewDidEnter() {
|
|
76
|
-
this.logger.log(
|
|
77
|
-
'[LOADER-PREVIEW-PAGE] ionViewDidEnter thumbnailsPreview.nativeElement.offsetHeight',
|
|
78
|
-
this.thumbnailsPreview.nativeElement.offsetHeight,
|
|
79
|
-
)
|
|
76
|
+
this.logger.log('[LOADER-PREVIEW-PAGE] ionViewDidEnter thumbnailsPreview.nativeElement.offsetHeight',this.thumbnailsPreview.nativeElement.offsetHeight)
|
|
80
77
|
this.calculateHeightPreviewArea()
|
|
81
78
|
}
|
|
82
79
|
|
|
@@ -86,17 +83,11 @@ export class LoaderPreviewPage implements OnInit, AfterViewInit {
|
|
|
86
83
|
// USE CASE IMAGE
|
|
87
84
|
// ---------------------------------------------------------------------
|
|
88
85
|
if (file.type.startsWith('image') && !file.type.includes('svg')) {
|
|
89
|
-
this.logger.log(
|
|
90
|
-
'[LOADER-PREVIEW-PAGE] - readAsDataURL - USE CASE IMAGE file TYPE',
|
|
91
|
-
file.type,
|
|
92
|
-
)
|
|
86
|
+
this.logger.log('[LOADER-PREVIEW-PAGE] - readAsDataURL - USE CASE IMAGE file TYPE',file.type)
|
|
93
87
|
const reader = new FileReader()
|
|
94
88
|
reader.onloadend = (evt) => {
|
|
95
89
|
const img = reader.result.toString()
|
|
96
|
-
this.logger.log(
|
|
97
|
-
'[LOADER-PREVIEW-PAGE] - readAsDataURL - FileReader success ',
|
|
98
|
-
img,
|
|
99
|
-
)
|
|
90
|
+
this.logger.log('[LOADER-PREVIEW-PAGE] - readAsDataURL - FileReader success ',img)
|
|
100
91
|
this.arrayFiles.push(img)
|
|
101
92
|
if (!this.fileSelected) {
|
|
102
93
|
this.fileSelected = img
|
|
@@ -232,9 +223,7 @@ export class LoaderPreviewPage implements OnInit, AfterViewInit {
|
|
|
232
223
|
this.logger.log('typeFile: ', typeFile)
|
|
233
224
|
|
|
234
225
|
const reader = new FileReader()
|
|
235
|
-
reader.addEventListener(
|
|
236
|
-
'load',
|
|
237
|
-
function () {
|
|
226
|
+
reader.addEventListener('load',function () {
|
|
238
227
|
const img = reader.result.toString()
|
|
239
228
|
that.logger.log('FileReader success')
|
|
240
229
|
that.arrayFiles.push(img)
|
|
@@ -292,13 +281,9 @@ export class LoaderPreviewPage implements OnInit, AfterViewInit {
|
|
|
292
281
|
}
|
|
293
282
|
|
|
294
283
|
calculateHeightPreviewArea() {
|
|
295
|
-
const heightThumbnailsPreview = this.thumbnailsPreview.nativeElement
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
.offsetHeight
|
|
299
|
-
this.heightPreviewArea = (
|
|
300
|
-
heightMessageTextArea + heightThumbnailsPreview
|
|
301
|
-
).toString()
|
|
284
|
+
const heightThumbnailsPreview = this.thumbnailsPreview.nativeElement.offsetHeight
|
|
285
|
+
const heightMessageTextArea = this.messageTextArea.nativeElement.offsetHeight
|
|
286
|
+
this.heightPreviewArea = (heightMessageTextArea + heightThumbnailsPreview).toString()
|
|
302
287
|
// this.logger.log('heightThumbnailsPreview', heightThumbnailsPreview);
|
|
303
288
|
// this.logger.log('heightMessageTextArea', this.messageTextArea);
|
|
304
289
|
// this.logger.log('heightPreviewArea', this.heightPreviewArea);
|
|
@@ -349,10 +334,7 @@ export class LoaderPreviewPage implements OnInit, AfterViewInit {
|
|
|
349
334
|
|
|
350
335
|
/** */
|
|
351
336
|
onSendMessage() {
|
|
352
|
-
this.logger.log(
|
|
353
|
-
'[LOADER-PREVIEW-PAGE] onSendMessage messageString:',
|
|
354
|
-
this.messageString,
|
|
355
|
-
)
|
|
337
|
+
this.logger.log('[LOADER-PREVIEW-PAGE] onSendMessage messageString:',this.messageString)
|
|
356
338
|
let file = this.selectedFiles.item(0)
|
|
357
339
|
const file4Load = new Image()
|
|
358
340
|
const nameImg = file.name
|
|
@@ -373,7 +355,6 @@ export class LoaderPreviewPage implements OnInit, AfterViewInit {
|
|
|
373
355
|
fileSelected: file,
|
|
374
356
|
messageString: this.messageString,
|
|
375
357
|
metadata: metadata,
|
|
376
|
-
type: TYPE_MSG_IMAGE,
|
|
377
358
|
})
|
|
378
359
|
}
|
|
379
360
|
|
|
@@ -26,8 +26,7 @@ export class CannedResponsesService {
|
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
|
|
29
|
-
public
|
|
30
|
-
|
|
29
|
+
public getAll(token: string, projectid: string) {
|
|
31
30
|
const cannedResponsesURL = this.apiUrl + projectid + "/canned/";
|
|
32
31
|
this.logger.log('[CANNED-RESPONSES-SERVICE] getCannedResponses - URL ', cannedResponsesURL);
|
|
33
32
|
|
|
@@ -37,13 +36,50 @@ export class CannedResponsesService {
|
|
|
37
36
|
Authorization: token
|
|
38
37
|
})
|
|
39
38
|
};
|
|
40
|
-
|
|
41
|
-
return this.http
|
|
42
|
-
.get(cannedResponsesURL, httpOptions)
|
|
43
|
-
.pipe(map((res: any) => {
|
|
39
|
+
|
|
40
|
+
return this.http.get(cannedResponsesURL, httpOptions).pipe(map((res: any) => {
|
|
44
41
|
this.logger.log('[CANNED-RESPONSES-SERVICE] getCannedResponses - RES ', res);
|
|
45
42
|
return res
|
|
46
|
-
|
|
43
|
+
}))
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
public edit(token: string, projectid: string, canned: any){
|
|
47
|
+
const cannedResponsesURL = this.apiUrl + projectid + "/canned/"+ canned._id;
|
|
48
|
+
this.logger.log('[CANNED-RESPONSES-SERVICE] editCannedResponses - URL ', cannedResponsesURL);
|
|
49
|
+
|
|
50
|
+
const httpOptions = {
|
|
51
|
+
headers: new HttpHeaders({
|
|
52
|
+
'Content-Type': 'application/json',
|
|
53
|
+
Authorization: token
|
|
54
|
+
})
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
const body = {
|
|
58
|
+
title: canned.title,
|
|
59
|
+
text: canned.text
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
return this.http.put(cannedResponsesURL, body, httpOptions).pipe(map((res: any) => {
|
|
63
|
+
this.logger.log('[CANNED-RESPONSES-SERVICE] editCannedResponses - RES ', res);
|
|
64
|
+
return res
|
|
65
|
+
}))
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
public delete(token: string, projectid: string, cannedID: string){
|
|
69
|
+
const cannedResponsesURL = this.apiUrl + projectid + "/canned/"+cannedID;
|
|
70
|
+
this.logger.log('[CANNED-RESPONSES-SERVICE] deleteCannedResponses - URL ', cannedResponsesURL);
|
|
71
|
+
|
|
72
|
+
const httpOptions = {
|
|
73
|
+
headers: new HttpHeaders({
|
|
74
|
+
'Content-Type': 'application/json',
|
|
75
|
+
Authorization: token
|
|
76
|
+
})
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
return this.http.delete(cannedResponsesURL, httpOptions).pipe(map((res: any) => {
|
|
80
|
+
this.logger.log('[CANNED-RESPONSES-SERVICE] deleteCannedResponses - RES ', res);
|
|
81
|
+
return res
|
|
82
|
+
}))
|
|
47
83
|
}
|
|
48
84
|
|
|
49
85
|
}
|
|
@@ -24,9 +24,10 @@ export class ScrollbarThemeDirective {
|
|
|
24
24
|
::-webkit-scrollbar {
|
|
25
25
|
width: 6px;
|
|
26
26
|
height: 8px;
|
|
27
|
+
display: none;
|
|
27
28
|
}
|
|
28
29
|
::-webkit-scrollbar-track {
|
|
29
|
-
|
|
30
|
+
background: #f9f9f9;
|
|
30
31
|
}
|
|
31
32
|
::-webkit-scrollbar-thumb {
|
|
32
33
|
background-color: #b9b9b9;
|
package/src/assets/i18n/ar.json
CHANGED
|
@@ -65,6 +65,8 @@
|
|
|
65
65
|
"INFO_SUPPORT_USER_ADDED_MESSAGE": "{{ subject }} {{ verb }} {{ complement }}",
|
|
66
66
|
"INFO_SUPPORT_CHAT_REOPENED": "تمت إعادة فتح الدردشة",
|
|
67
67
|
"INFO_SUPPORT_CHAT_CLOSED": "الدردشة مغلقة",
|
|
68
|
+
"INFO_SUPPORT_LEAD_UPDATED":"تحديث الرصاص",
|
|
69
|
+
"INFO_SUPPORT_MEMBER_LEFT_GROUP":"تمت إزالته من المجموعة",
|
|
68
70
|
"INFO_A_NEW_SUPPORT_REQUEST_HAS_BEEN_ASSIGNED_TO_YOU": "تم تعيين طلب دعم جديد لك",
|
|
69
71
|
"LABEL_PROFILE": "الملف الشخصي",
|
|
70
72
|
"LABEL_CLOSE": "مغلق",
|
package/src/assets/i18n/az.json
CHANGED
|
@@ -65,6 +65,8 @@
|
|
|
65
65
|
"INFO_SUPPORT_USER_ADDED_MESSAGE": "{{ subject }} {{ verb }} {{ complement }}",
|
|
66
66
|
"INFO_SUPPORT_CHAT_REOPENED": "Çat yenidən açıldı",
|
|
67
67
|
"INFO_SUPPORT_CHAT_CLOSED": "Çat bağlandı",
|
|
68
|
+
"INFO_SUPPORT_LEAD_UPDATED":"Rəqəm yeniləndi",
|
|
69
|
+
"INFO_SUPPORT_MEMBER_LEFT_GROUP":"qrupdan çıxarıldı",
|
|
68
70
|
"INFO_A_NEW_SUPPORT_REQUEST_HAS_BEEN_ASSIGNED_TO_YOU": "Sizə yeni dəstək sorğusu təyin edilib",
|
|
69
71
|
"LABEL_PROFILE": "Profil",
|
|
70
72
|
"LABEL_CLOSE": "Bağlı",
|
package/src/assets/i18n/de.json
CHANGED
|
@@ -65,6 +65,8 @@
|
|
|
65
65
|
"INFO_SUPPORT_USER_ADDED_MESSAGE": "{{ subject }} {{ verb }} {{ complement }}",
|
|
66
66
|
"INFO_SUPPORT_CHAT_REOPENED": "Chat wieder geöffnet",
|
|
67
67
|
"INFO_SUPPORT_CHAT_CLOSED": "Chat geschlossen",
|
|
68
|
+
"INFO_SUPPORT_LEAD_UPDATED":"Leitung aktualisiert",
|
|
69
|
+
"INFO_SUPPORT_MEMBER_LEFT_GROUP":"aus der Gruppe entfernt",
|
|
68
70
|
"INFO_A_NEW_SUPPORT_REQUEST_HAS_BEEN_ASSIGNED_TO_YOU": "Ihnen wurde eine neue Support-Anfrage zugewiesen",
|
|
69
71
|
"LABEL_PROFILE": "Profil",
|
|
70
72
|
"LABEL_CLOSE": "Abgeschlossen",
|
package/src/assets/i18n/en.json
CHANGED
|
@@ -65,6 +65,8 @@
|
|
|
65
65
|
"INFO_SUPPORT_USER_ADDED_MESSAGE": "{{ subject }} {{ verb }} {{ complement }}",
|
|
66
66
|
"INFO_SUPPORT_CHAT_REOPENED": "Chat reopened",
|
|
67
67
|
"INFO_SUPPORT_CHAT_CLOSED": "Chat closed",
|
|
68
|
+
"INFO_SUPPORT_LEAD_UPDATED":"Lead updated",
|
|
69
|
+
"INFO_SUPPORT_MEMBER_LEFT_GROUP":"removed from group",
|
|
68
70
|
"INFO_A_NEW_SUPPORT_REQUEST_HAS_BEEN_ASSIGNED_TO_YOU": "A new support request has been assigned to you",
|
|
69
71
|
"LABEL_PROFILE": "Profile",
|
|
70
72
|
"LABEL_CLOSE": "Closed",
|
package/src/assets/i18n/es.json
CHANGED
|
@@ -65,6 +65,8 @@
|
|
|
65
65
|
"INFO_SUPPORT_USER_ADDED_MESSAGE": "{{ subject }} {{ verb }} {{ complement }}",
|
|
66
66
|
"INFO_SUPPORT_CHAT_REOPENED": "Chat reabierto",
|
|
67
67
|
"INFO_SUPPORT_CHAT_CLOSED": "Chat cerrado",
|
|
68
|
+
"INFO_SUPPORT_LEAD_UPDATED":"Cliente potencial actualizado",
|
|
69
|
+
"INFO_SUPPORT_MEMBER_LEFT_GROUP":"eliminado del grupo",
|
|
68
70
|
"INFO_A_NEW_SUPPORT_REQUEST_HAS_BEEN_ASSIGNED_TO_YOU":"Se le ha asignado una nueva solicitud de soporte",
|
|
69
71
|
"LABEL_PROFILE": "Perfil",
|
|
70
72
|
"LABEL_CLOSE": "Cerrado",
|
package/src/assets/i18n/fr.json
CHANGED
|
@@ -65,6 +65,8 @@
|
|
|
65
65
|
"INFO_SUPPORT_USER_ADDED_MESSAGE": "{{ subject }} {{ verb }} {{ complement }}",
|
|
66
66
|
"INFO_SUPPORT_CHAT_REOPENED": "Chat rouvert",
|
|
67
67
|
"INFO_SUPPORT_CHAT_CLOSED": "Chat fermé",
|
|
68
|
+
"INFO_SUPPORT_LEAD_UPDATED":"Prospect mis à jour",
|
|
69
|
+
"INFO_SUPPORT_MEMBER_LEFT_GROUP":"supprimé du groupe",
|
|
68
70
|
"INFO_A_NEW_SUPPORT_REQUEST_HAS_BEEN_ASSIGNED_TO_YOU": "Une nouvelle demande de support vous a été attribuée",
|
|
69
71
|
"LABEL_PROFILE": "Profil",
|
|
70
72
|
"LABEL_CLOSE": "Fermé",
|
package/src/assets/i18n/it.json
CHANGED
|
@@ -65,6 +65,8 @@
|
|
|
65
65
|
"INFO_SUPPORT_USER_ADDED_MESSAGE": "{{ subject }} {{ verb }} {{ complement }}",
|
|
66
66
|
"INFO_SUPPORT_CHAT_REOPENED": "Chat riaperta",
|
|
67
67
|
"INFO_SUPPORT_CHAT_CLOSED": "Chat chiusa",
|
|
68
|
+
"INFO_SUPPORT_LEAD_UPDATED":"Contatto aggiornato",
|
|
69
|
+
"INFO_SUPPORT_MEMBER_LEFT_GROUP":"rimosso dal gruppo",
|
|
68
70
|
"INFO_A_NEW_SUPPORT_REQUEST_HAS_BEEN_ASSIGNED_TO_YOU":"Una nuova richiesta di supporto è stata assegnata a te",
|
|
69
71
|
"LABEL_PROFILE": "Profilo",
|
|
70
72
|
"LABEL_CLOSE": "Chiusa",
|
package/src/assets/i18n/kk.json
CHANGED
|
@@ -65,6 +65,8 @@
|
|
|
65
65
|
"INFO_SUPPORT_USER_ADDED_MESSAGE": "{{ subject }} {{ verb }} {{ complement }}",
|
|
66
66
|
"INFO_SUPPORT_CHAT_REOPENED": "Чат қайта ашылды",
|
|
67
67
|
"INFO_SUPPORT_CHAT_CLOSED": "Чат жабылды",
|
|
68
|
+
"INFO_SUPPORT_LEAD_UPDATED":"Жетекші жаңартылды",
|
|
69
|
+
"INFO_SUPPORT_MEMBER_LEFT_GROUP":"топтан шығарылды",
|
|
68
70
|
"INFO_A_NEW_SUPPORT_REQUEST_HAS_BEEN_ASSIGNED_TO_YOU": "Сізге жаңа қолдау сұрауы тағайындалды",
|
|
69
71
|
"LABEL_PROFILE": "Профиль",
|
|
70
72
|
"LABEL_CLOSE": "Жабық",
|