@chat21/chat21-ionic 3.4.27-rc2 → 3.4.27-rc21
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 +65 -0
- package/angular.json +1 -0
- package/package.json +1 -1
- package/src/app/app.component.html +3 -1
- package/src/app/app.component.ts +74 -24
- package/src/app/chatlib/conversation-detail/conversation-content/conversation-content.component.scss +3 -3
- package/src/app/chatlib/conversation-detail/conversation-content/conversation-content.component.ts +1 -1
- package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.html +1 -1
- package/src/app/chatlib/conversation-detail/message/avatar/avatar.component.html +1 -1
- package/src/app/chatlib/conversation-detail/message/avatar/avatar.component.ts +4 -4
- package/src/app/chatlib/conversation-detail/message/return-receipt/return-receipt.component.scss +3 -3
- package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.html +9 -9
- package/src/app/components/bubbleMessageInfo-popover/bubbleinfo-popover.component.html +1 -1
- package/src/app/components/canned-response/canned-response.component.html +2 -2
- package/src/app/components/canned-response/canned-response.component.scss +0 -2
- package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.html +8 -8
- package/src/app/components/conversation-detail/message-text-area/message-text-area.component.html +23 -0
- package/src/app/components/conversation-detail/message-text-area/message-text-area.component.scss +30 -0
- package/src/app/components/conversation-detail/message-text-area/message-text-area.component.ts +35 -7
- 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 +23 -21
- 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 +5 -1
- package/src/app/components/copilot-popover/copilot-popover.component.html +1 -1
- package/src/app/components/navbar/navbar.component.html +3 -3
- package/src/app/components/navbar/navbar.component.ts +29 -38
- package/src/app/components/project-item/project-item.component.ts +11 -11
- package/src/app/components/sidebar/sidebar.component.html +67 -47
- package/src/app/components/sidebar/sidebar.component.ts +110 -117
- package/src/app/components/sidebar-user-details/sidebar-user-details.component.html +4 -4
- package/src/app/components/sidebar-user-details/sidebar-user-details.component.ts +17 -14
- package/src/app/modals/create-ticket/create-ticket.page.html +6 -6
- package/src/app/modals/create-ticket/create-ticket.page.ts +4 -4
- package/src/app/modals/loader-preview/loader-preview.page.ts +1 -1
- package/src/app/modals/send-whatsapp-template/send-whatsapp-template.page.scss +1 -1
- package/src/app/pages/conversation-detail/conversation-detail.page.html +3 -1
- package/src/app/pages/conversation-detail/conversation-detail.page.scss +1 -1
- package/src/app/pages/conversation-detail/conversation-detail.page.ts +47 -5
- package/src/app/pages/conversations-list/conversations-list.page.html +2 -0
- package/src/app/pages/conversations-list/conversations-list.page.ts +48 -10
- package/src/app/pages/profile-info/profile-info.page.ts +3 -3
- package/src/app/services/brand/brand.service.ts +5 -5
- package/src/app/services/global-settings/global-settings.service.ts +12 -3
- package/src/app/services/nav-proxy.service.ts +0 -1
- package/src/app/services/triggerEvents/triggerEvents.ts +28 -0
- package/src/app/services/websocket/websocket-js.ts +95 -77
- package/src/app/shared/shared.module.ts +11 -2
- package/src/app/utils/globals.ts +2 -0
- package/src/app/utils/permissions.constants.ts +14 -11
- package/src/app/utils/utils-resources.ts +8 -7
- package/src/assets/i18n/ar.json +11 -1
- package/src/assets/i18n/az.json +11 -1
- package/src/assets/i18n/de.json +11 -1
- package/src/assets/i18n/en.json +11 -1
- package/src/assets/i18n/es.json +11 -1
- package/src/assets/i18n/fr.json +11 -1
- package/src/assets/i18n/it.json +13 -3
- package/src/assets/i18n/kk.json +11 -1
- package/src/assets/i18n/pt.json +11 -1
- package/src/assets/i18n/ru.json +11 -1
- package/src/assets/i18n/sr.json +11 -1
- package/src/assets/i18n/sv.json +11 -1
- package/src/assets/i18n/tr.json +11 -1
- package/src/assets/i18n/uk.json +11 -1
- package/src/assets/i18n/uz.json +12 -1
- package/src/assets/js/agentDesktop-sdk.js +55 -0
- package/src/chat-config-template.json +1 -0
- package/src/chat-config.json +1 -0
- package/src/chat21-core/providers/tiledesk/tiledesk-auth.service.ts +3 -0
- package/src/chat21-core/utils/constants.ts +2 -2
- package/src/chat21-core/utils/utils.ts +16 -2
- /package/src/assets/{images → img}/channel_icons/chat21.svg +0 -0
- /package/src/assets/{images → img}/channel_icons/direct.svg +0 -0
- /package/src/assets/{images → img}/channel_icons/email-logo.svg +0 -0
- /package/src/assets/{images → img}/channel_icons/form-logo_v2.svg +0 -0
- /package/src/assets/{images → img}/channel_icons/group.svg +0 -0
- /package/src/assets/{images → img}/channel_icons/messenger-logo.svg +0 -0
- /package/src/assets/{images → img}/channel_icons/telegram-logo.svg +0 -0
- /package/src/assets/{images → img}/channel_icons/voice.svg +0 -0
- /package/src/assets/{images → img}/channel_icons/whatsapp-logo.svg +0 -0
- /package/src/assets/{images → img}/default-avatar-x-select.png +0 -0
- /package/src/assets/{images → img}/f21ico-done.svg +0 -0
- /package/src/assets/{images → img}/f21ico-done_all.svg +0 -0
- /package/src/assets/{images → img}/f21ico-schedule.svg +0 -0
- /package/src/assets/{images → img}/file-alt-solid.png +0 -0
- /package/src/assets/{images → img}/icons/copilot.svg +0 -0
- /package/src/assets/{images → img}/json-file.svg +0 -0
- /package/src/assets/{images → img}/language_flag/ar.png +0 -0
- /package/src/assets/{images → img}/language_flag/az.png +0 -0
- /package/src/assets/{images → img}/language_flag/bg.png +0 -0
- /package/src/assets/{images → img}/language_flag/ca.png +0 -0
- /package/src/assets/{images → img}/language_flag/cs.png +0 -0
- /package/src/assets/{images → img}/language_flag/da.png +0 -0
- /package/src/assets/{images → img}/language_flag/de.png +0 -0
- /package/src/assets/{images → img}/language_flag/el.png +0 -0
- /package/src/assets/{images → img}/language_flag/en.png +0 -0
- /package/src/assets/{images → img}/language_flag/es.png +0 -0
- /package/src/assets/{images → img}/language_flag/fa.png +0 -0
- /package/src/assets/{images → img}/language_flag/fi.png +0 -0
- /package/src/assets/{images → img}/language_flag/fr.png +0 -0
- /package/src/assets/{images → img}/language_flag/he.png +0 -0
- /package/src/assets/{images → img}/language_flag/hi.png +0 -0
- /package/src/assets/{images → img}/language_flag/hr.png +0 -0
- /package/src/assets/{images → img}/language_flag/hu.png +0 -0
- /package/src/assets/{images → img}/language_flag/id.png +0 -0
- /package/src/assets/{images → img}/language_flag/it.png +0 -0
- /package/src/assets/{images → img}/language_flag/ja.png +0 -0
- /package/src/assets/{images → img}/language_flag/kk.png +0 -0
- /package/src/assets/{images → img}/language_flag/ko.png +0 -0
- /package/src/assets/{images → img}/language_flag/ml-IN.png +0 -0
- /package/src/assets/{images → img}/language_flag/ne-NP.png +0 -0
- /package/src/assets/{images → img}/language_flag/nl.png +0 -0
- /package/src/assets/{images → img}/language_flag/no.png +0 -0
- /package/src/assets/{images → img}/language_flag/pl.png +0 -0
- /package/src/assets/{images → img}/language_flag/pt-BR.png +0 -0
- /package/src/assets/{images → img}/language_flag/pt.png +0 -0
- /package/src/assets/{images → img}/language_flag/ro.png +0 -0
- /package/src/assets/{images → img}/language_flag/ru.png +0 -0
- /package/src/assets/{images → img}/language_flag/sk.png +0 -0
- /package/src/assets/{images → img}/language_flag/sl.png +0 -0
- /package/src/assets/{images → img}/language_flag/sr.png +0 -0
- /package/src/assets/{images → img}/language_flag/sv.png +0 -0
- /package/src/assets/{images → img}/language_flag/ta.png +0 -0
- /package/src/assets/{images → img}/language_flag/th.png +0 -0
- /package/src/assets/{images → img}/language_flag/tr.png +0 -0
- /package/src/assets/{images → img}/language_flag/uk.png +0 -0
- /package/src/assets/{images → img}/language_flag/uz.png +0 -0
- /package/src/assets/{images → img}/language_flag/vi.png +0 -0
- /package/src/assets/{images → img}/language_flag/zh-CN.png +0 -0
- /package/src/assets/{images → img}/language_flag/zh-TW.png +0 -0
- /package/src/assets/{logos → img/logos}/chat21-logo.png +0 -0
- /package/src/assets/{logos → img/logos}/logo.png +0 -0
- /package/src/assets/{logos → img/logos}/tiledesk-logo_new_white.svg +0 -0
- /package/src/assets/{logos → img/logos}/tiledesk-solo-logo.png +0 -0
- /package/src/assets/{logos → img/logos}/tiledesk_logo.svg +0 -0
- /package/src/assets/{logos → img/logos}/tiledesk_logo_no_text.svg +0 -0
- /package/src/assets/{logos → img/logos}/tiledesk_logo_white_small.svg +0 -0
- /package/src/assets/{images → img}/no_conversation.jpg +0 -0
- /package/src/assets/{images → img}/no_image.png +0 -0
- /package/src/assets/{images → img}/no_image_user.png +0 -0
- /package/src/assets/{images → img}/pin.svg +0 -0
- /package/src/assets/{images → img}/pinned.svg +0 -0
- /package/src/assets/{images → img}/priority_icons/high.svg +0 -0
- /package/src/assets/{images → img}/priority_icons/high_v2.svg +0 -0
- /package/src/assets/{images → img}/priority_icons/low.svg +0 -0
- /package/src/assets/{images → img}/priority_icons/low_v2.svg +0 -0
- /package/src/assets/{images → img}/priority_icons/medium.svg +0 -0
- /package/src/assets/{images → img}/priority_icons/medium_v2.svg +0 -0
- /package/src/assets/{images → img}/priority_icons/urgent.svg +0 -0
- /package/src/assets/{images → img}/priority_icons/urgent_v2.svg +0 -0
- /package/src/assets/{images → img}/teammate-status/avaible.svg +0 -0
- /package/src/assets/{images → img}/teammate-status/inactive.svg +0 -0
- /package/src/assets/{images → img}/teammate-status/unavaible.svg +0 -0
- /package/src/assets/{images → img}/whatsapp_background.png +0 -0
|
@@ -87,6 +87,7 @@ import { ProjectUsersService } from 'src/app/services/project_users/project-user
|
|
|
87
87
|
import { ProjectUser } from 'src/chat21-core/models/projectUsers';
|
|
88
88
|
import { getOSCode, hasRole } from 'src/app/utils/utils';
|
|
89
89
|
import { PERMISSIONS } from 'src/app/utils/permissions.constants';
|
|
90
|
+
import { TriggerEvents } from 'src/app/services/triggerEvents/triggerEvents';
|
|
90
91
|
|
|
91
92
|
@Component({
|
|
92
93
|
selector: 'app-conversation-detail',
|
|
@@ -176,6 +177,10 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
|
|
|
176
177
|
copilotQuestion: string = '';
|
|
177
178
|
/**COPILOT : end */
|
|
178
179
|
|
|
180
|
+
/** TICKET: start */
|
|
181
|
+
isTicketEnabled: boolean = false;
|
|
182
|
+
/** TICKET: end */
|
|
183
|
+
|
|
179
184
|
isMine = isMine
|
|
180
185
|
isInfo = isInfo
|
|
181
186
|
isFirstMessage = isFirstMessage
|
|
@@ -250,14 +255,15 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
|
|
|
250
255
|
private events: EventsService,
|
|
251
256
|
private webSocketService: WebsocketService,
|
|
252
257
|
public projectPlanUtils: ProjectPlanUtils,
|
|
258
|
+
public triggerEvents: TriggerEvents,
|
|
253
259
|
private g: Globals,
|
|
254
260
|
) {
|
|
255
261
|
// Change list on date change
|
|
256
262
|
this.route.paramMap.subscribe((params) => {
|
|
257
263
|
this.logger.log('[CONVS-DETAIL] - constructor -> params: ', params)
|
|
258
264
|
this.conversationWith = params.get('IDConv')
|
|
259
|
-
this.conversationWithFullname = params.get('FullNameConv')
|
|
260
|
-
this.conv_type = params.get('Convtype')
|
|
265
|
+
this.conversationWithFullname = decodeURIComponent(params.get('FullNameConv'))
|
|
266
|
+
this.conv_type = decodeURIComponent(params.get('Convtype'))
|
|
261
267
|
|
|
262
268
|
this.events.publish('supportconvid:haschanged', this.conversationWith)
|
|
263
269
|
})
|
|
@@ -424,6 +430,8 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
|
|
|
424
430
|
ionViewDidEnter() {
|
|
425
431
|
this.logger.log('[CONVS-DETAIL] > ionViewDidEnter')
|
|
426
432
|
// this.info_content_child_enabled = true;
|
|
433
|
+
// Scroll to bottom to show the last message without animation
|
|
434
|
+
this.scrollToLastMessage()
|
|
427
435
|
}
|
|
428
436
|
|
|
429
437
|
// Unsubscibe when new page transition end
|
|
@@ -483,6 +491,7 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
|
|
|
483
491
|
this.messages = [] // list messages of conversation
|
|
484
492
|
this.isFileSelected = false // indicates if a file has been selected (image to upload)
|
|
485
493
|
this.isEmailEnabled = (this.appConfigProvider.getConfig().emailSection === 'true' || this.appConfigProvider.getConfig().emailSection === true) ? true : false;
|
|
494
|
+
this.isTicketEnabled = (this.appConfigProvider.getConfig().ticketSection === 'true' || this.appConfigProvider.getConfig().ticketSection === true) ? true : false;
|
|
486
495
|
this.isWhatsappTemplatesEnabled = (this.appConfigProvider.getConfig().whatsappTemplatesSection === 'true' || this.appConfigProvider.getConfig().whatsappTemplatesSection === true) ? true : false;
|
|
487
496
|
|
|
488
497
|
this.cannedResponsesService.initialize(appconfig.apiUrl)
|
|
@@ -554,7 +563,7 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
|
|
|
554
563
|
this.offlineMsgEmail = this.checkOfflineMsgEmailIsEnabled(project)
|
|
555
564
|
this.isCopilotEnabled = this.projectPlanUtils.checkProjectProfileFeature(project, 'copilot');
|
|
556
565
|
this.fileUploadAccept = this.checkAcceptedUploadFile(project)
|
|
557
|
-
this.rolesCanned = this.checkCannedResponsesRoles(
|
|
566
|
+
this.rolesCanned = this.checkCannedResponsesRoles()
|
|
558
567
|
this.canShowCanned = this.checkCannedResponses(project)
|
|
559
568
|
this.logger.log('[CONVS-DETAIL] this.rolesCanned ', this.canShowCanned)
|
|
560
569
|
}
|
|
@@ -610,7 +619,7 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
|
|
|
610
619
|
return true
|
|
611
620
|
}
|
|
612
621
|
|
|
613
|
-
checkCannedResponsesRoles(
|
|
622
|
+
checkCannedResponsesRoles(): { [key: string]: boolean } {
|
|
614
623
|
const permissionKeys = [
|
|
615
624
|
'CANNED_RESPONSES_CREATE',
|
|
616
625
|
'CANNED_RESPONSES_READ',
|
|
@@ -711,6 +720,11 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
|
|
|
711
720
|
"WHATSAPP.ERROR_WHATSAPP_NOT_INSTALLED",
|
|
712
721
|
"WHATSAPP.ERROR_WHATSAPP_GENERIC_ERROR",
|
|
713
722
|
|
|
723
|
+
"TICKET.OPEN_TICKET",
|
|
724
|
+
"TICKET.DESCRIPTION",
|
|
725
|
+
"TICKET.CONFIRM",
|
|
726
|
+
"TICKET.CLOSE",
|
|
727
|
+
|
|
714
728
|
"COPILOT.ASK_AI",
|
|
715
729
|
"COPILOT.NO_SUGGESTIONS_PRESENT",
|
|
716
730
|
|
|
@@ -1146,7 +1160,7 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
|
|
|
1146
1160
|
// ${metadata.name}
|
|
1147
1161
|
// </a>`
|
|
1148
1162
|
|
|
1149
|
-
// msg =  + [${metadata.name}](${metadata.src})
|
|
1150
1164
|
msg = `[${metadata.name}](${metadata.src})`
|
|
1151
1165
|
}
|
|
1152
1166
|
}
|
|
@@ -1926,6 +1940,11 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
|
|
|
1926
1940
|
}
|
|
1927
1941
|
|
|
1928
1942
|
|
|
1943
|
+
onOpenTicket(event) {
|
|
1944
|
+
this.logger.debug('[CONVS-DETAIL] openTicketOnExternalService - conversationWith ', this.conversationWith)
|
|
1945
|
+
const detailOBJ = { event: 'onOpenTicketExternally', request_id: this.conversationWith, conversation: this.conversation }
|
|
1946
|
+
this.triggerEvents.triggerOnOpenTicketExternally(detailOBJ)
|
|
1947
|
+
}
|
|
1929
1948
|
// -------------- START SCROLL/RESIZE -------------- //
|
|
1930
1949
|
/** */
|
|
1931
1950
|
resizeTextArea() {
|
|
@@ -1969,6 +1988,29 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
|
|
|
1969
1988
|
}
|
|
1970
1989
|
}
|
|
1971
1990
|
|
|
1991
|
+
/**
|
|
1992
|
+
* Scroll to last message without animation using requestAnimationFrame
|
|
1993
|
+
* This is a best practice alternative to setTimeout
|
|
1994
|
+
*/
|
|
1995
|
+
private scrollToLastMessage() {
|
|
1996
|
+
this.showIonContent = true
|
|
1997
|
+
if (this.ionContentChatArea) {
|
|
1998
|
+
// Use requestAnimationFrame for better performance
|
|
1999
|
+
requestAnimationFrame(() => {
|
|
2000
|
+
requestAnimationFrame(() => {
|
|
2001
|
+
// Double RAF ensures DOM is fully rendered
|
|
2002
|
+
this.ionContentChatArea.scrollToBottom(0).then(() => {
|
|
2003
|
+
this.logger.log('[CONVS-DETAIL] scroll posizionato all\'ultimo messaggio')
|
|
2004
|
+
}).catch((error) => {
|
|
2005
|
+
this.logger.error('[CONVS-DETAIL] errore durante lo scroll:', error)
|
|
2006
|
+
})
|
|
2007
|
+
})
|
|
2008
|
+
})
|
|
2009
|
+
} else {
|
|
2010
|
+
this.logger.warn('[CONVS-DETAIL] ionContentChatArea non disponibile')
|
|
2011
|
+
}
|
|
2012
|
+
}
|
|
2013
|
+
|
|
1972
2014
|
/**
|
|
1973
2015
|
* detectBottom
|
|
1974
2016
|
*/
|
|
@@ -7,6 +7,8 @@
|
|
|
7
7
|
[sound_btn]="sound_btn"
|
|
8
8
|
[isMobile]="isMobile"
|
|
9
9
|
[isVisibleTKT]="isVisibleTKT"
|
|
10
|
+
[isVisibleCNT]="isVisibleCNT"
|
|
11
|
+
[roles]="rolesHeader"
|
|
10
12
|
(onSoundChange)="onSoundChange($event)"
|
|
11
13
|
(openContactsDirectory)=openContactsDirectory($event)
|
|
12
14
|
(openProfileInfo)=openProfileInfo($event)>
|
|
@@ -53,7 +53,10 @@ 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 } from 'src/app/utils/utils';
|
|
56
|
+
import { getOSCode, hasRole } from 'src/app/utils/utils';
|
|
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';
|
|
57
60
|
|
|
58
61
|
@Component({
|
|
59
62
|
selector: 'app-conversations-list',
|
|
@@ -82,6 +85,7 @@ export class ConversationListPage implements OnInit {
|
|
|
82
85
|
public archived_btn: boolean
|
|
83
86
|
public sound_btn: string
|
|
84
87
|
public isVisibleTKT: boolean = true;
|
|
88
|
+
public isVisibleCNT: boolean = true;;
|
|
85
89
|
public convertMessage = convertMessage
|
|
86
90
|
private isShowMenuPage = false
|
|
87
91
|
private logger: LoggerService = LoggerInstance.getInstance()
|
|
@@ -104,14 +108,17 @@ export class ConversationListPage implements OnInit {
|
|
|
104
108
|
public isMobile: boolean = false;
|
|
105
109
|
public isInitialized: boolean = false;
|
|
106
110
|
|
|
111
|
+
public projectUser: ProjectUser;
|
|
112
|
+
public rolesHeader: { [key: string]: boolean }
|
|
113
|
+
|
|
107
114
|
// PROJECT AVAILABILITY INFO: start
|
|
108
115
|
project: Project
|
|
109
116
|
profile_name_translated: string;
|
|
110
117
|
selectedStatus: any;
|
|
111
118
|
teammateStatus = [
|
|
112
|
-
{ id: 1, name: 'Available', avatar: 'assets/
|
|
113
|
-
{ id: 2, name: 'Unavailable', avatar: 'assets/
|
|
114
|
-
{ id: 3, name: 'Inactive', avatar: 'assets/
|
|
119
|
+
{ id: 1, name: 'Available', avatar: 'assets/img/teammate-status/avaible.svg', label: "LABEL_AVAILABLE" },
|
|
120
|
+
{ id: 2, name: 'Unavailable', avatar: 'assets/img/teammate-status/unavaible.svg', label: "LABEL_NOT_AVAILABLE" },
|
|
121
|
+
{ id: 3, name: 'Inactive', avatar: 'assets/img/teammate-status/inactive.svg', label: "LABEL_INACTIVE" },
|
|
115
122
|
];
|
|
116
123
|
// PROJECT AVAILABILITY INFO: end
|
|
117
124
|
|
|
@@ -130,6 +137,7 @@ export class ConversationListPage implements OnInit {
|
|
|
130
137
|
private translateService: CustomTranslateService,
|
|
131
138
|
public tiledeskService: TiledeskService,
|
|
132
139
|
public tiledeskAuthService: TiledeskAuthService,
|
|
140
|
+
public projectUsersService: ProjectUsersService,
|
|
133
141
|
public appConfigProvider: AppConfigProvider,
|
|
134
142
|
public platform: Platform,
|
|
135
143
|
public wsService: WebsocketService,
|
|
@@ -371,6 +379,11 @@ export class ConversationListPage implements OnInit {
|
|
|
371
379
|
// save conversationHandler in chatManager
|
|
372
380
|
this.chatManager.setConversationsHandler(this.conversationsHandlerService)
|
|
373
381
|
this.showPlaceholder = false
|
|
382
|
+
|
|
383
|
+
// Hide loading spinner if there are no conversations
|
|
384
|
+
if (this.conversations.length === 0) {
|
|
385
|
+
this.loadingIsActive = false
|
|
386
|
+
}
|
|
374
387
|
}
|
|
375
388
|
|
|
376
389
|
// private manageStoredConversations() {
|
|
@@ -471,9 +484,9 @@ export class ConversationListPage implements OnInit {
|
|
|
471
484
|
}
|
|
472
485
|
|
|
473
486
|
listenToCurrentStoredProject() {
|
|
474
|
-
this.events.subscribe('storage:last_project', projectObjct => {
|
|
487
|
+
this.events.subscribe('storage:last_project', async(projectObjct) => {
|
|
475
488
|
if (projectObjct && projectObjct !== 'undefined') {
|
|
476
|
-
|
|
489
|
+
console.log('[CONVS-LIST-PAGE] - GET STORED PROJECT ', projectObjct)
|
|
477
490
|
|
|
478
491
|
//TODO: recuperare info da root e non da id_project
|
|
479
492
|
this.project = {
|
|
@@ -496,6 +509,10 @@ export class ConversationListPage implements OnInit {
|
|
|
496
509
|
} else if (this.project.profile.type === 'payment' && this.project.profile.name === 'enterprise') {
|
|
497
510
|
this.profile_name_translated = this.translationMapHeader.get('PaydPlanNameEnterprise');
|
|
498
511
|
}
|
|
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)
|
|
499
516
|
}
|
|
500
517
|
})
|
|
501
518
|
}
|
|
@@ -631,8 +648,24 @@ export class ConversationListPage implements OnInit {
|
|
|
631
648
|
const public_Key = this.appConfigProvider.getConfig().t2y12PruGU9wUtEGzBJfolMIgK
|
|
632
649
|
this.logger.log('[CONVS-LIST-PAGE] AppConfigService getAppConfig public_Key', public_Key)
|
|
633
650
|
this.isVisibleTKT = getOSCode("TKT", public_Key);
|
|
651
|
+
this.isVisibleCNT = getOSCode("CNT", public_Key);
|
|
634
652
|
}
|
|
635
653
|
|
|
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
|
+
|
|
636
669
|
onBackButtonFN(event) {
|
|
637
670
|
this.conversationType = 'active'
|
|
638
671
|
|
|
@@ -883,26 +916,31 @@ export class ConversationListPage implements OnInit {
|
|
|
883
916
|
|
|
884
917
|
this.logger.log('[CONVS-LIST-PAGE] navigateByUrl this.uidConvSelected ', this.uidConvSelected)
|
|
885
918
|
|
|
919
|
+
const queryParams = this.route.snapshot.queryParams;
|
|
920
|
+
const queryString = new URLSearchParams(queryParams).toString();
|
|
921
|
+
|
|
922
|
+
|
|
886
923
|
this.setUidConvSelected(uidConvSelected, converationType)
|
|
887
924
|
if (checkPlatformIsMobile()) {
|
|
888
925
|
this.logger.log('[CONVS-LIST-PAGE] checkPlatformIsMobile(): ', checkPlatformIsMobile())
|
|
889
926
|
this.logger.log('[CONVS-LIST-PAGE] DESKTOP (window < 768)', this.navService)
|
|
890
927
|
this.logger.log('[CONVS-LIST-PAGE] navigateByUrl this.conversationSelected conversation_with_fullname ', this.conversationSelected)
|
|
891
|
-
let pageUrl = 'conversation-detail/' + this.uidConvSelected + '/' + this.conversationSelected.conversation_with_fullname + '/' + converationType
|
|
928
|
+
let pageUrl = 'conversation-detail/' + this.uidConvSelected + '/' + encodeURIComponent(this.conversationSelected.conversation_with_fullname) + '/' + converationType
|
|
892
929
|
this.logger.log('[CONVS-LIST-PAGE] pageURL', pageUrl)
|
|
893
930
|
// replace(/\(/g, '%28').replace(/\)/g, '%29') -> used for the encoder of any round brackets
|
|
894
|
-
this.router.navigateByUrl(pageUrl.replace(/\(/g, '%28').replace(/\)/g, '%29')
|
|
931
|
+
this.router.navigateByUrl(pageUrl.replace(/\(/g, '%28').replace(/\)/g, '%29'), {replaceUrl: true})
|
|
895
932
|
} else {
|
|
896
933
|
this.logger.log('[CONVS-LIST-PAGE] navigateByUrl this.conversationSelected conversation_with_fullname ', this.conversationSelected)
|
|
897
934
|
this.logger.log('[CONVS-LIST-PAGE] checkPlatformIsMobile(): ', checkPlatformIsMobile())
|
|
898
935
|
this.logger.log('[CONVS-LIST-PAGE] MOBILE (window >= 768) ', this.navService)
|
|
899
936
|
let pageUrl = 'conversation-detail/' + this.uidConvSelected
|
|
900
937
|
if (this.conversationSelected && this.conversationSelected.conversation_with_fullname) {
|
|
901
|
-
pageUrl = 'conversation-detail/' + this.uidConvSelected + '/' + this.conversationSelected.conversation_with_fullname + '/' + converationType
|
|
938
|
+
pageUrl = 'conversation-detail/' + this.uidConvSelected + '/' + encodeURIComponent(this.conversationSelected.conversation_with_fullname) + '/' + converationType
|
|
902
939
|
}
|
|
940
|
+
pageUrl += queryString ? `?${queryString}` : '';
|
|
903
941
|
this.logger.log('[CONVS-LIST-PAGE] setUidConvSelected navigateByUrl--->: ', pageUrl)
|
|
904
942
|
// replace(/\(/g, '%28').replace(/\)/g, '%29') -> used for the encoder of any round brackets
|
|
905
|
-
this.router.navigateByUrl(pageUrl.replace(/\(/g, '%28').replace(/\)/g, '%29')
|
|
943
|
+
this.router.navigateByUrl(pageUrl.replace(/\(/g, '%28').replace(/\)/g, '%29'), {replaceUrl: true})
|
|
906
944
|
}
|
|
907
945
|
}
|
|
908
946
|
|
|
@@ -51,9 +51,9 @@ export class ProfileInfoPage implements OnInit {
|
|
|
51
51
|
|
|
52
52
|
isVisiblePAY: boolean;
|
|
53
53
|
teammateStatus = [
|
|
54
|
-
{ id: 1, name: 'Available', avatar: 'assets/
|
|
55
|
-
{ id: 2, name: 'Unavailable', avatar: 'assets/
|
|
56
|
-
{ id: 3, name: 'Inactive', avatar: 'assets/
|
|
54
|
+
{ id: 1, name: 'Available', avatar: 'assets/img/teammate-status/avaible.svg', label: "LABEL_AVAILABLE" },
|
|
55
|
+
{ id: 2, name: 'Unavailable', avatar: 'assets/img/teammate-status/unavaible.svg', label: "LABEL_NOT_AVAILABLE" },
|
|
56
|
+
{ id: 3, name: 'Inactive', avatar: 'assets/img/teammate-status/inactive.svg', label: "LABEL_INACTIVE" },
|
|
57
57
|
];
|
|
58
58
|
|
|
59
59
|
constructor(
|
|
@@ -67,11 +67,11 @@ export class BrandService {
|
|
|
67
67
|
]
|
|
68
68
|
},
|
|
69
69
|
COMMON: {
|
|
70
|
-
COMPANY_LOGO:"assets/logos/tiledesk_logo.svg",
|
|
71
|
-
COMPANY_LOGO_NO_TEXT:"assets/logos/tiledesk_logo.svg",
|
|
72
|
-
BASE_LOGO: "assets/logos/tiledesk_logo.svg",
|
|
73
|
-
BASE_LOGO_NO_TEXT: "assets/logos/tiledesk_logo.svg",
|
|
74
|
-
BASE_LOGO_WHITE: "assets/logos/tiledesk-logo_new_white.svg",
|
|
70
|
+
COMPANY_LOGO:"assets/img/logos/tiledesk_logo.svg",
|
|
71
|
+
COMPANY_LOGO_NO_TEXT:"assets/img/logos/tiledesk_logo.svg",
|
|
72
|
+
BASE_LOGO: "assets/img/logos/tiledesk_logo.svg",
|
|
73
|
+
BASE_LOGO_NO_TEXT: "assets/img/logos/tiledesk_logo.svg",
|
|
74
|
+
BASE_LOGO_WHITE: "assets/img/logos/tiledesk-logo_new_white.svg",
|
|
75
75
|
BASE_LOGO_WHITE_NO_TEXT:"",
|
|
76
76
|
COMPANY_NAME: "Tiledesk",
|
|
77
77
|
BRAND_NAME: "Tiledesk",
|
|
@@ -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
|
-
|
|
92
|
-
|
|
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
|
/**
|
|
@@ -111,8 +111,10 @@ export class GlobalSettingsService {
|
|
|
111
111
|
}
|
|
112
112
|
|
|
113
113
|
TEMP = getParameterByName(windowContext, 'tiledesk_supportMode');
|
|
114
|
+
console.log('TEMP supportMode', TEMP);
|
|
114
115
|
if (TEMP) {
|
|
115
116
|
globals.supportMode = stringToBoolean(TEMP);
|
|
117
|
+
this.appStorageService.setItem('supportMode', String(globals.supportMode))
|
|
116
118
|
}
|
|
117
119
|
|
|
118
120
|
TEMP = getParameterByName(windowContext, 'tiledesk_lang');
|
|
@@ -138,6 +140,13 @@ export class GlobalSettingsService {
|
|
|
138
140
|
TEMP = getParameterByName(windowContext, 'tiledesk_projectID');
|
|
139
141
|
if (TEMP) {
|
|
140
142
|
globals.projectID = TEMP;
|
|
143
|
+
this.appStorageService.setItem('projectID', TEMP)
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
TEMP = getParameterByName(windowContext, 'tiledesk_logOut');
|
|
147
|
+
if (TEMP) {
|
|
148
|
+
globals.logOut = stringToBoolean(TEMP);
|
|
149
|
+
this.appStorageService.setItem('logOut', TEMP)
|
|
141
150
|
}
|
|
142
151
|
|
|
143
152
|
}
|
|
@@ -4,7 +4,6 @@ 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';
|
|
8
7
|
|
|
9
8
|
import { LoggerService } from 'src/chat21-core/providers/abstract/logger.service';
|
|
10
9
|
import { LoggerInstance } from 'src/chat21-core/providers/logger/loggerInstance';
|
|
@@ -102,5 +102,33 @@ 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
|
+
|
|
105
133
|
|
|
106
134
|
}
|