@chat21/chat21-ionic 3.4.30-rc3 → 3.4.31
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 +7 -122
- package/angular.json +0 -1
- package/package.json +1 -1
- package/src/app/app.component.html +1 -3
- package/src/app/app.component.ts +10 -71
- package/src/app/components/canned-response/canned-response.component.html +23 -26
- package/src/app/components/canned-response/canned-response.component.scss +2 -0
- package/src/app/components/canned-response/canned-response.component.ts +1 -3
- package/src/app/components/conversation-detail/message-text-area/message-text-area.component.html +1 -24
- package/src/app/components/conversation-detail/message-text-area/message-text-area.component.scss +0 -30
- package/src/app/components/conversation-detail/message-text-area/message-text-area.component.ts +7 -29
- package/src/app/components/conversation-info/info-content/info-content.component.ts +2 -2
- package/src/app/components/conversation-info/info-group/info-group.component.ts +21 -23
- package/src/app/components/conversations-list/header-conversations-list/header-conversations-list.component.html +1 -1
- package/src/app/components/conversations-list/header-conversations-list/header-conversations-list.component.ts +1 -5
- package/src/app/components/navbar/navbar.component.html +3 -3
- package/src/app/components/navbar/navbar.component.ts +38 -29
- package/src/app/components/project-item/project-item.component.ts +11 -11
- package/src/app/components/sidebar/sidebar.component.html +45 -65
- package/src/app/components/sidebar/sidebar.component.ts +117 -110
- 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 +7 -10
- package/src/app/directives/html-entities-encode.pipe.ts +20 -5
- package/src/app/modals/create-ticket/create-ticket.page.ts +2 -4
- package/src/app/pages/conversation-detail/conversation-detail.page.html +3 -7
- package/src/app/pages/conversation-detail/conversation-detail.page.ts +5 -89
- package/src/app/pages/conversations-list/conversations-list.page.html +0 -2
- package/src/app/pages/conversations-list/conversations-list.page.ts +2 -40
- package/src/app/services/global-settings/global-settings.service.ts +3 -11
- package/src/app/services/nav-proxy.service.ts +1 -0
- package/src/app/services/tiledesk/tiledesk.service.ts +16 -0
- package/src/app/services/triggerEvents/triggerEvents.ts +0 -28
- package/src/app/services/websocket/websocket-js.ts +534 -59
- package/src/app/services/websocket/websocket.service.ts +10 -9
- package/src/app/shared/shared.module.ts +2 -11
- package/src/app/utils/globals.ts +0 -2
- package/src/app/utils/project-utils.ts +2 -2
- package/src/app/utils/utils.ts +1 -18
- package/src/assets/i18n/ar.json +1 -11
- package/src/assets/i18n/az.json +1 -11
- package/src/assets/i18n/de.json +1 -11
- package/src/assets/i18n/en.json +1 -11
- package/src/assets/i18n/es.json +1 -11
- package/src/assets/i18n/fr.json +1 -11
- package/src/assets/i18n/it.json +3 -13
- package/src/assets/i18n/kk.json +1 -11
- package/src/assets/i18n/pt.json +1 -11
- package/src/assets/i18n/ru.json +1 -11
- package/src/assets/i18n/sr.json +1 -11
- package/src/assets/i18n/sv.json +1 -11
- package/src/assets/i18n/tr.json +1 -11
- package/src/assets/i18n/uk.json +1 -11
- package/src/assets/i18n/uz.json +1 -12
- package/src/assets/js/chat21client.js +0 -36
- package/src/assets/test.html +2 -5
- package/src/chat-config-template.json +0 -1
- package/src/chat-config.json +0 -1
- package/src/chat21-core/providers/firebase/firebase-conversation-handler.ts +1 -1
- package/src/chat21-core/providers/mqtt/mqtt-conversation-handler.ts +1 -1
- package/src/chat21-core/providers/tiledesk/tiledesk-auth.service.ts +0 -3
- package/src/chat21-core/utils/utils.ts +2 -16
- package/src/app/services/project_users/project-users.service.spec.ts +0 -16
- package/src/app/services/project_users/project-users.service.ts +0 -63
- package/src/app/services/websocket/websocket-js_old.ts +0 -578
- package/src/app/services/websocket/websocket.worker.ts +0 -242
- package/src/app/utils/permissions.constants.ts +0 -138
- package/src/assets/js/agentDesktop-sdk.js +0 -55
- package/src/assets/js/mqtt-keepalive-worker.js +0 -53
- package/src/chat21-core/models/projectUsers.ts +0 -19
|
@@ -83,12 +83,8 @@ import { WebsocketService } from 'src/app/services/websocket/websocket.service';
|
|
|
83
83
|
import { Project } from 'src/chat21-core/models/projects';
|
|
84
84
|
import { Globals } from 'src/app/utils/globals';
|
|
85
85
|
import { ProjectService } from 'src/app/services/projects/project.service';
|
|
86
|
+
import { getOSCode } from 'src/app/utils/utils';
|
|
86
87
|
import { UploadService } from 'src/chat21-core/providers/abstract/upload.service';
|
|
87
|
-
import { ProjectUsersService } from 'src/app/services/project_users/project-users.service';
|
|
88
|
-
import { ProjectUser } from 'src/chat21-core/models/projectUsers';
|
|
89
|
-
import { getOSCode, hasRole } from 'src/app/utils/utils';
|
|
90
|
-
import { PERMISSIONS } from 'src/app/utils/permissions.constants';
|
|
91
|
-
import { TriggerEvents } from 'src/app/services/triggerEvents/triggerEvents';
|
|
92
88
|
|
|
93
89
|
@Component({
|
|
94
90
|
selector: 'app-conversation-detail',
|
|
@@ -113,7 +109,6 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
|
|
|
113
109
|
private subscriptions: Array<any>
|
|
114
110
|
public tenant: string;
|
|
115
111
|
public loggedUser: UserModel
|
|
116
|
-
public projectUser: ProjectUser;
|
|
117
112
|
public conversationWith: string
|
|
118
113
|
public conversationWithFullname: string
|
|
119
114
|
public messages: Array<MessageModel> = []
|
|
@@ -143,7 +138,6 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
|
|
|
143
138
|
public tagsCannedFilter: Array<any> = [];
|
|
144
139
|
public SHOW_CANNED_RESPONSES: boolean = false
|
|
145
140
|
public canShowCanned: boolean = true
|
|
146
|
-
public rolesCanned: { [key: string]: boolean }
|
|
147
141
|
|
|
148
142
|
public SHOW_COPILOT_SUGGESTIONS: boolean = false;
|
|
149
143
|
|
|
@@ -178,10 +172,6 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
|
|
|
178
172
|
copilotQuestion: string = '';
|
|
179
173
|
/**COPILOT : end */
|
|
180
174
|
|
|
181
|
-
/** TICKET: start */
|
|
182
|
-
isTicketEnabled: boolean = false;
|
|
183
|
-
/** TICKET: end */
|
|
184
|
-
|
|
185
175
|
isMine = isMine
|
|
186
176
|
isInfo = isInfo
|
|
187
177
|
isFirstMessage = isFirstMessage
|
|
@@ -252,20 +242,18 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
|
|
|
252
242
|
public toastController: ToastController,
|
|
253
243
|
public tiledeskService: TiledeskService,
|
|
254
244
|
public projectService: ProjectService,
|
|
255
|
-
public projectUsersService: ProjectUsersService,
|
|
256
245
|
private networkService: NetworkService,
|
|
257
246
|
private events: EventsService,
|
|
258
247
|
private webSocketService: WebsocketService,
|
|
259
248
|
public projectPlanUtils: ProjectPlanUtils,
|
|
260
|
-
public triggerEvents: TriggerEvents,
|
|
261
249
|
private g: Globals,
|
|
262
250
|
) {
|
|
263
251
|
// Change list on date change
|
|
264
252
|
this.route.paramMap.subscribe((params) => {
|
|
265
253
|
this.logger.log('[CONVS-DETAIL] - constructor -> params: ', params)
|
|
266
254
|
this.conversationWith = params.get('IDConv')
|
|
267
|
-
this.conversationWithFullname =
|
|
268
|
-
this.conv_type =
|
|
255
|
+
this.conversationWithFullname = params.get('FullNameConv')
|
|
256
|
+
this.conv_type = params.get('Convtype')
|
|
269
257
|
|
|
270
258
|
this.events.publish('supportconvid:haschanged', this.conversationWith)
|
|
271
259
|
})
|
|
@@ -432,8 +420,6 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
|
|
|
432
420
|
ionViewDidEnter() {
|
|
433
421
|
this.logger.log('[CONVS-DETAIL] > ionViewDidEnter')
|
|
434
422
|
// this.info_content_child_enabled = true;
|
|
435
|
-
// Scroll to bottom to show the last message without animation
|
|
436
|
-
this.scrollToLastMessage()
|
|
437
423
|
}
|
|
438
424
|
|
|
439
425
|
// Unsubscibe when new page transition end
|
|
@@ -493,7 +479,6 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
|
|
|
493
479
|
this.messages = [] // list messages of conversation
|
|
494
480
|
this.isFileSelected = false // indicates if a file has been selected (image to upload)
|
|
495
481
|
this.isEmailEnabled = (this.appConfigProvider.getConfig().emailSection === 'true' || this.appConfigProvider.getConfig().emailSection === true) ? true : false;
|
|
496
|
-
this.isTicketEnabled = (this.appConfigProvider.getConfig().ticketSection === 'true' || this.appConfigProvider.getConfig().ticketSection === true) ? true : false;
|
|
497
482
|
this.isWhatsappTemplatesEnabled = (this.appConfigProvider.getConfig().whatsappTemplatesSection === 'true' || this.appConfigProvider.getConfig().whatsappTemplatesSection === true) ? true : false;
|
|
498
483
|
this.fileUploadAccept = this.appConfigProvider.getConfig().fileUploadAccept
|
|
499
484
|
|
|
@@ -553,6 +538,7 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
|
|
|
553
538
|
this.logger.log('[CONVS-DETAIL] - GET PROJECTID BY CONV RECIPIENT * COMPLETE *',)
|
|
554
539
|
})
|
|
555
540
|
}else {
|
|
541
|
+
this.canShowCanned = false;
|
|
556
542
|
this.offlineMsgEmail = false;
|
|
557
543
|
}
|
|
558
544
|
|
|
@@ -563,13 +549,10 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
|
|
|
563
549
|
this.logger.log('[CONVS-DETAIL] - GET PROJECTID BY CONV RECIPIENT RES', project)
|
|
564
550
|
if (project) {
|
|
565
551
|
const projectId = project.id_project
|
|
566
|
-
this.
|
|
552
|
+
this.canShowCanned = this.projectPlanUtils.checkPlanIsExpired(project)
|
|
567
553
|
this.offlineMsgEmail = this.checkOfflineMsgEmailIsEnabled(project)
|
|
568
554
|
this.isCopilotEnabled = this.projectPlanUtils.checkProjectProfileFeature(project, 'copilot');
|
|
569
555
|
this.fileUploadAccept = this.checkAcceptedUploadFile(project)
|
|
570
|
-
this.rolesCanned = this.checkCannedResponsesRoles()
|
|
571
|
-
this.canShowCanned = this.checkCannedResponses(project)
|
|
572
|
-
this.logger.log('[CONVS-DETAIL] this.rolesCanned ', this.canShowCanned)
|
|
573
556
|
}
|
|
574
557
|
}, (error) => {
|
|
575
558
|
this.logger.error('[CONVS-DETAIL] - GET PROJECTID BY CONV RECIPIENT - ERROR ', error)
|
|
@@ -607,40 +590,6 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
|
|
|
607
590
|
return this.appConfigProvider.getConfig().fileUploadAccept
|
|
608
591
|
}
|
|
609
592
|
|
|
610
|
-
checkCannedResponses(project: Project): boolean {
|
|
611
|
-
let expires = this.projectPlanUtils.checkPlanIsExpired(project)
|
|
612
|
-
this.logger.log('[CONVS-DETAIL] checkCannedResponses expires ', expires)
|
|
613
|
-
if(expires){
|
|
614
|
-
return false
|
|
615
|
-
}
|
|
616
|
-
|
|
617
|
-
let hasRoleToShowCanned = this.rolesCanned[PERMISSIONS.CANNED_RESPONSES_READ]
|
|
618
|
-
this.logger.log('[CONVS-DETAIL] checkCannedResponses hasRoleToShowCanned ', hasRoleToShowCanned)
|
|
619
|
-
if(!hasRoleToShowCanned){
|
|
620
|
-
return false
|
|
621
|
-
}
|
|
622
|
-
|
|
623
|
-
return true
|
|
624
|
-
}
|
|
625
|
-
|
|
626
|
-
checkCannedResponsesRoles(): { [key: string]: boolean } {
|
|
627
|
-
const permissionKeys = [
|
|
628
|
-
'CANNED_RESPONSES_CREATE',
|
|
629
|
-
'CANNED_RESPONSES_READ',
|
|
630
|
-
'CANNED_RESPONSES_UPDATE',
|
|
631
|
-
'CANNED_RESPONSES_DELETE',
|
|
632
|
-
] as const;
|
|
633
|
-
|
|
634
|
-
const roles: { [key: string]: boolean } = {};
|
|
635
|
-
for (const key of permissionKeys) {
|
|
636
|
-
const permission = PERMISSIONS[key];
|
|
637
|
-
roles[permission] = hasRole(this.projectUser, permission);
|
|
638
|
-
}
|
|
639
|
-
|
|
640
|
-
return roles;
|
|
641
|
-
|
|
642
|
-
}
|
|
643
|
-
|
|
644
593
|
// getProjectIdSelectedConversation(conversationWith: string): string{
|
|
645
594
|
// const conversationWith_segments = conversationWith.split('-')
|
|
646
595
|
// // Removes the last element of the array if is = to the separator
|
|
@@ -724,11 +673,6 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
|
|
|
724
673
|
"WHATSAPP.ERROR_WHATSAPP_NOT_INSTALLED",
|
|
725
674
|
"WHATSAPP.ERROR_WHATSAPP_GENERIC_ERROR",
|
|
726
675
|
|
|
727
|
-
"TICKET.OPEN_TICKET",
|
|
728
|
-
"TICKET.DESCRIPTION",
|
|
729
|
-
"TICKET.CONFIRM",
|
|
730
|
-
"TICKET.CLOSE",
|
|
731
|
-
|
|
732
676
|
"COPILOT.ASK_AI",
|
|
733
677
|
"COPILOT.NO_SUGGESTIONS_PRESENT",
|
|
734
678
|
|
|
@@ -1944,11 +1888,6 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
|
|
|
1944
1888
|
}
|
|
1945
1889
|
|
|
1946
1890
|
|
|
1947
|
-
onOpenTicket(event) {
|
|
1948
|
-
this.logger.debug('[CONVS-DETAIL] openTicketOnExternalService - conversationWith ', this.conversationWith)
|
|
1949
|
-
const detailOBJ = { event: 'onOpenTicketExternally', request_id: this.conversationWith, conversation: this.conversation }
|
|
1950
|
-
this.triggerEvents.triggerOnOpenTicketExternally(detailOBJ)
|
|
1951
|
-
}
|
|
1952
1891
|
// -------------- START SCROLL/RESIZE -------------- //
|
|
1953
1892
|
/** */
|
|
1954
1893
|
resizeTextArea() {
|
|
@@ -1992,29 +1931,6 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
|
|
|
1992
1931
|
}
|
|
1993
1932
|
}
|
|
1994
1933
|
|
|
1995
|
-
/**
|
|
1996
|
-
* Scroll to last message without animation using requestAnimationFrame
|
|
1997
|
-
* This is a best practice alternative to setTimeout
|
|
1998
|
-
*/
|
|
1999
|
-
private scrollToLastMessage() {
|
|
2000
|
-
this.showIonContent = true
|
|
2001
|
-
if (this.ionContentChatArea) {
|
|
2002
|
-
// Use requestAnimationFrame for better performance
|
|
2003
|
-
requestAnimationFrame(() => {
|
|
2004
|
-
requestAnimationFrame(() => {
|
|
2005
|
-
// Double RAF ensures DOM is fully rendered
|
|
2006
|
-
this.ionContentChatArea.scrollToBottom(0).then(() => {
|
|
2007
|
-
this.logger.log('[CONVS-DETAIL] scroll posizionato all\'ultimo messaggio')
|
|
2008
|
-
}).catch((error) => {
|
|
2009
|
-
this.logger.error('[CONVS-DETAIL] errore durante lo scroll:', error)
|
|
2010
|
-
})
|
|
2011
|
-
})
|
|
2012
|
-
})
|
|
2013
|
-
} else {
|
|
2014
|
-
this.logger.warn('[CONVS-DETAIL] ionContentChatArea non disponibile')
|
|
2015
|
-
}
|
|
2016
|
-
}
|
|
2017
|
-
|
|
2018
1934
|
/**
|
|
2019
1935
|
* detectBottom
|
|
2020
1936
|
*/
|
|
@@ -7,8 +7,6 @@
|
|
|
7
7
|
[sound_btn]="sound_btn"
|
|
8
8
|
[isMobile]="isMobile"
|
|
9
9
|
[isVisibleTKT]="isVisibleTKT"
|
|
10
|
-
[isVisibleCNT]="isVisibleCNT"
|
|
11
|
-
[roles]="rolesHeader"
|
|
12
10
|
(onSoundChange)="onSoundChange($event)"
|
|
13
11
|
(openContactsDirectory)=openContactsDirectory($event)
|
|
14
12
|
(openProfileInfo)=openProfileInfo($event)>
|
|
@@ -53,10 +53,7 @@ import { Globals } from 'src/app/utils/globals';
|
|
|
53
53
|
import { TriggerEvents } from 'src/app/services/triggerEvents/triggerEvents';
|
|
54
54
|
import { MessageModel } from 'src/chat21-core/models/message';
|
|
55
55
|
import { Project } from 'src/chat21-core/models/projects';
|
|
56
|
-
import { getOSCode
|
|
57
|
-
import { PERMISSIONS } from 'src/app/utils/permissions.constants';
|
|
58
|
-
import { ProjectUser } from 'src/chat21-core/models/projectUsers';
|
|
59
|
-
import { ProjectUsersService } from 'src/app/services/project_users/project-users.service';
|
|
56
|
+
import { getOSCode } from 'src/app/utils/utils';
|
|
60
57
|
|
|
61
58
|
@Component({
|
|
62
59
|
selector: 'app-conversations-list',
|
|
@@ -85,7 +82,6 @@ export class ConversationListPage implements OnInit {
|
|
|
85
82
|
public archived_btn: boolean
|
|
86
83
|
public sound_btn: string
|
|
87
84
|
public isVisibleTKT: boolean = true;
|
|
88
|
-
public isVisibleCNT: boolean = true;;
|
|
89
85
|
public convertMessage = convertMessage
|
|
90
86
|
private isShowMenuPage = false
|
|
91
87
|
private logger: LoggerService = LoggerInstance.getInstance()
|
|
@@ -108,9 +104,6 @@ export class ConversationListPage implements OnInit {
|
|
|
108
104
|
public isMobile: boolean = false;
|
|
109
105
|
public isInitialized: boolean = false;
|
|
110
106
|
|
|
111
|
-
public projectUser: ProjectUser;
|
|
112
|
-
public rolesHeader: { [key: string]: boolean }
|
|
113
|
-
|
|
114
107
|
// PROJECT AVAILABILITY INFO: start
|
|
115
108
|
project: Project
|
|
116
109
|
profile_name_translated: string;
|
|
@@ -137,7 +130,6 @@ export class ConversationListPage implements OnInit {
|
|
|
137
130
|
private translateService: CustomTranslateService,
|
|
138
131
|
public tiledeskService: TiledeskService,
|
|
139
132
|
public tiledeskAuthService: TiledeskAuthService,
|
|
140
|
-
public projectUsersService: ProjectUsersService,
|
|
141
133
|
public appConfigProvider: AppConfigProvider,
|
|
142
134
|
public platform: Platform,
|
|
143
135
|
public wsService: WebsocketService,
|
|
@@ -379,11 +371,6 @@ export class ConversationListPage implements OnInit {
|
|
|
379
371
|
// save conversationHandler in chatManager
|
|
380
372
|
this.chatManager.setConversationsHandler(this.conversationsHandlerService)
|
|
381
373
|
this.showPlaceholder = false
|
|
382
|
-
|
|
383
|
-
// Hide loading spinner if there are no conversations
|
|
384
|
-
if (this.conversations.length === 0) {
|
|
385
|
-
this.loadingIsActive = false
|
|
386
|
-
}
|
|
387
374
|
}
|
|
388
375
|
|
|
389
376
|
// private manageStoredConversations() {
|
|
@@ -484,7 +471,7 @@ export class ConversationListPage implements OnInit {
|
|
|
484
471
|
}
|
|
485
472
|
|
|
486
473
|
listenToCurrentStoredProject() {
|
|
487
|
-
this.events.subscribe('storage:last_project',
|
|
474
|
+
this.events.subscribe('storage:last_project', projectObjct => {
|
|
488
475
|
if (projectObjct && projectObjct !== 'undefined') {
|
|
489
476
|
this.logger.log('[CONVS-LIST-PAGE] - GET STORED PROJECT ', projectObjct)
|
|
490
477
|
|
|
@@ -509,10 +496,6 @@ export class ConversationListPage implements OnInit {
|
|
|
509
496
|
} else if (this.project.profile.type === 'payment' && this.project.profile.name === 'enterprise') {
|
|
510
497
|
this.profile_name_translated = this.translationMapHeader.get('PaydPlanNameEnterprise');
|
|
511
498
|
}
|
|
512
|
-
|
|
513
|
-
this.projectUser = await this.projectUsersService.getProjectUserByProjectId(this.project._id)
|
|
514
|
-
this.rolesHeader = this.checkCannedResponsesRoles();
|
|
515
|
-
this.logger.log('[CONVS-LIST-PAGE] - GET PROJECT USER ROLES ', this.rolesHeader)
|
|
516
499
|
}
|
|
517
500
|
})
|
|
518
501
|
}
|
|
@@ -648,24 +631,8 @@ export class ConversationListPage implements OnInit {
|
|
|
648
631
|
const public_Key = this.appConfigProvider.getConfig().t2y12PruGU9wUtEGzBJfolMIgK
|
|
649
632
|
this.logger.log('[CONVS-LIST-PAGE] AppConfigService getAppConfig public_Key', public_Key)
|
|
650
633
|
this.isVisibleTKT = getOSCode("TKT", public_Key);
|
|
651
|
-
this.isVisibleCNT = getOSCode("CNT", public_Key);
|
|
652
634
|
}
|
|
653
635
|
|
|
654
|
-
checkCannedResponsesRoles(): { [key: string]: boolean } {
|
|
655
|
-
const permissionKeys = [
|
|
656
|
-
'LEADS_READ',
|
|
657
|
-
] as const;
|
|
658
|
-
|
|
659
|
-
const roles: { [key: string]: boolean } = {};
|
|
660
|
-
for (const key of permissionKeys) {
|
|
661
|
-
const permission = PERMISSIONS[key];
|
|
662
|
-
roles[permission] = hasRole(this.projectUser, permission);
|
|
663
|
-
}
|
|
664
|
-
|
|
665
|
-
return roles;
|
|
666
|
-
|
|
667
|
-
}
|
|
668
|
-
|
|
669
636
|
onBackButtonFN(event) {
|
|
670
637
|
this.conversationType = 'active'
|
|
671
638
|
|
|
@@ -916,10 +883,6 @@ export class ConversationListPage implements OnInit {
|
|
|
916
883
|
|
|
917
884
|
this.logger.log('[CONVS-LIST-PAGE] navigateByUrl this.uidConvSelected ', this.uidConvSelected)
|
|
918
885
|
|
|
919
|
-
const queryParams = this.route.snapshot.queryParams;
|
|
920
|
-
const queryString = new URLSearchParams(queryParams).toString();
|
|
921
|
-
|
|
922
|
-
|
|
923
886
|
this.setUidConvSelected(uidConvSelected, converationType)
|
|
924
887
|
if (checkPlatformIsMobile()) {
|
|
925
888
|
this.logger.log('[CONVS-LIST-PAGE] checkPlatformIsMobile(): ', checkPlatformIsMobile())
|
|
@@ -937,7 +900,6 @@ export class ConversationListPage implements OnInit {
|
|
|
937
900
|
if (this.conversationSelected && this.conversationSelected.conversation_with_fullname) {
|
|
938
901
|
pageUrl = 'conversation-detail/' + this.uidConvSelected + '/' + encodeURIComponent(this.conversationSelected.conversation_with_fullname) + '/' + converationType
|
|
939
902
|
}
|
|
940
|
-
pageUrl += queryString ? `?${queryString}` : '';
|
|
941
903
|
this.logger.log('[CONVS-LIST-PAGE] setUidConvSelected navigateByUrl--->: ', pageUrl)
|
|
942
904
|
// replace(/\(/g, '%28').replace(/\)/g, '%29') -> used for the encoder of any round brackets
|
|
943
905
|
this.router.navigateByUrl(pageUrl.replace(/\(/g, '%28').replace(/\)/g, '%29'), {replaceUrl: true})
|
|
@@ -88,14 +88,14 @@ export class GlobalSettingsService {
|
|
|
88
88
|
this.logger.debug('[GLOBAL-SET] setVariableFromStorage :::::::: SET VARIABLE ---------->', Object.keys(globals));
|
|
89
89
|
for (const key of Object.keys(globals)) {
|
|
90
90
|
const val = this.appStorageService.getItem(key);
|
|
91
|
-
this.logger.debug('[GLOBAL-SET] setVariableFromStorage SET globals KEY ---------->', key);
|
|
92
|
-
this.logger.debug('[GLOBAL-SET] setVariableFromStorage SET globals VAL ---------->', val);
|
|
91
|
+
// this.logger.debug('[GLOBAL-SET] setVariableFromStorage SET globals KEY ---------->', key);
|
|
92
|
+
// this.logger.debug('[GLOBAL-SET] setVariableFromStorage SET globals VAL ---------->', val);
|
|
93
93
|
if (val && val !== null) {
|
|
94
94
|
// globals.setParameter(key, val);
|
|
95
95
|
globals[key] = stringToBoolean(val);
|
|
96
96
|
}
|
|
97
97
|
// this.logger.debug('[GLOBAL-SET] setVariableFromStorage SET globals == ---------->', globals);
|
|
98
|
-
}
|
|
98
|
+
}
|
|
99
99
|
}
|
|
100
100
|
|
|
101
101
|
/**
|
|
@@ -113,7 +113,6 @@ export class GlobalSettingsService {
|
|
|
113
113
|
TEMP = getParameterByName(windowContext, 'tiledesk_supportMode');
|
|
114
114
|
if (TEMP) {
|
|
115
115
|
globals.supportMode = stringToBoolean(TEMP);
|
|
116
|
-
this.appStorageService.setItem('supportMode', String(globals.supportMode))
|
|
117
116
|
}
|
|
118
117
|
|
|
119
118
|
TEMP = getParameterByName(windowContext, 'tiledesk_lang');
|
|
@@ -139,13 +138,6 @@ export class GlobalSettingsService {
|
|
|
139
138
|
TEMP = getParameterByName(windowContext, 'tiledesk_projectID');
|
|
140
139
|
if (TEMP) {
|
|
141
140
|
globals.projectID = TEMP;
|
|
142
|
-
this.appStorageService.setItem('projectID', TEMP)
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
TEMP = getParameterByName(windowContext, 'tiledesk_logOut');
|
|
146
|
-
if (TEMP) {
|
|
147
|
-
globals.logOut = stringToBoolean(TEMP);
|
|
148
|
-
this.appStorageService.setItem('logOut', TEMP)
|
|
149
141
|
}
|
|
150
142
|
|
|
151
143
|
}
|
|
@@ -4,6 +4,7 @@ import { Router, NavigationExtras } from '@angular/router';
|
|
|
4
4
|
|
|
5
5
|
// utils
|
|
6
6
|
import { checkPlatformIsMobile } from '../../chat21-core/utils/utils';
|
|
7
|
+
// import { ConversationDetailPage } from '../pages/conversation-detail/conversation-detail.page';
|
|
7
8
|
|
|
8
9
|
import { LoggerService } from 'src/chat21-core/providers/abstract/logger.service';
|
|
9
10
|
import { LoggerInstance } from 'src/chat21-core/providers/logger/loggerInstance';
|
|
@@ -93,6 +93,22 @@ export class TiledeskService {
|
|
|
93
93
|
}))
|
|
94
94
|
}
|
|
95
95
|
|
|
96
|
+
public getProjectUsersByProjectId(project_id: string) {
|
|
97
|
+
const url = this.SERVER_BASE_URL + project_id + '/project_users/';
|
|
98
|
+
this.logger.log('[TILEDESK-SERVICE] - GET PROJECT-USER URL', url);
|
|
99
|
+
|
|
100
|
+
const httpOptions = {
|
|
101
|
+
headers: new HttpHeaders({
|
|
102
|
+
'Content-Type': 'application/json',
|
|
103
|
+
Authorization: this.tiledeskToken
|
|
104
|
+
})
|
|
105
|
+
};
|
|
106
|
+
return this.http.get(url, httpOptions).pipe(map((res: any) => {
|
|
107
|
+
this.logger.log('[TILEDESK-SERVICE] - GET PROJECT-USER RES ', res);
|
|
108
|
+
return res
|
|
109
|
+
}))
|
|
110
|
+
}
|
|
111
|
+
|
|
96
112
|
public getAllLeadsActiveWithLimit(project_id: string, limit: number) {
|
|
97
113
|
const url = this.SERVER_BASE_URL + project_id + '/leads?limit=' + limit + '&with_fullname=true';
|
|
98
114
|
this.logger.log('[TILEDESK-SERVICE] - GET ALL ACTIVE LEADS (LIMIT 10000) - URL', url);
|
|
@@ -102,33 +102,5 @@ export class TriggerEvents {
|
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
104
|
|
|
105
|
-
public triggerOnUpdateNewConversationBadge(detailObj: {}) {
|
|
106
|
-
this.logger.debug(' ---------------- triggerOnUpdateNewConversationBadge ---------------- ', detailObj);
|
|
107
|
-
try {
|
|
108
|
-
const onBeforeInit = new CustomEvent('onUpdateNewConversationBadge', { detail: detailObj });
|
|
109
|
-
const windowContext = this.windowContext;
|
|
110
|
-
if (windowContext){
|
|
111
|
-
// windowContext.document.dispatchEvent(onNewConversation);
|
|
112
|
-
windowContext.postMessage({type: "onUpdateNewConversationBadge", detail: detailObj }, '*')
|
|
113
|
-
}
|
|
114
|
-
} catch (e) {
|
|
115
|
-
this.logger.error('[TRIGGER-HANDLER] > Error:' + e);
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
public triggerOnOpenTicketExternally(detailObj: {}) {
|
|
120
|
-
this.logger.debug(' ---------------- triggerOnOpenTicketExternally ---------------- ', detailObj);
|
|
121
|
-
try {
|
|
122
|
-
const onBeforeInit = new CustomEvent('onOpenTicketExternally', { detail: detailObj });
|
|
123
|
-
const windowContext = this.windowContext;
|
|
124
|
-
if (windowContext){
|
|
125
|
-
// windowContext.document.dispatchEvent(onNewConversation);
|
|
126
|
-
windowContext.postMessage({type: "onOpenTicketExternally", detail: detailObj }, '*')
|
|
127
|
-
}
|
|
128
|
-
} catch (e) {
|
|
129
|
-
this.logger.error('[TRIGGER-HANDLER] > Error:' + e);
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
|
|
133
105
|
|
|
134
106
|
}
|