@chat21/chat21-ionic 3.4.27-ar3 → 3.4.27-rc10
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 +23 -0
- package/angular.json +1 -0
- package/package.json +1 -1
- package/src/app/app.component.ts +1 -1
- package/src/app/components/canned-response/canned-response.component.scss +0 -2
- 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 +14 -0
- 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/navbar/navbar.component.html +3 -3
- package/src/app/components/navbar/navbar.component.ts +29 -38
- package/src/app/components/sidebar/sidebar.component.html +65 -45
- package/src/app/components/sidebar/sidebar.component.ts +92 -117
- package/src/app/pages/conversation-detail/conversation-detail.page.html +3 -1
- package/src/app/pages/conversation-detail/conversation-detail.page.ts +44 -2
- package/src/app/pages/conversations-list/conversations-list.page.html +2 -0
- package/src/app/pages/conversations-list/conversations-list.page.ts +36 -3
- package/src/app/services/global-settings/global-settings.service.ts +0 -1
- package/src/app/utils/permissions.constants.ts +14 -11
- 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 +47 -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
|
@@ -15,7 +15,10 @@ import { tranlatedLanguage } from '../../../chat21-core/utils/constants';
|
|
|
15
15
|
// utils
|
|
16
16
|
import { avatarPlaceholder, getColorBck } from 'src/chat21-core/utils/utils-user';
|
|
17
17
|
import { BRAND_BASE_INFO, LOGOS_ITEMS } from 'src/app/utils/utils-resources';
|
|
18
|
-
import { getOSCode } from 'src/app/utils/utils';
|
|
18
|
+
import { getOSCode, hasRole } from 'src/app/utils/utils';
|
|
19
|
+
import { PERMISSIONS } from 'src/app/utils/permissions.constants';
|
|
20
|
+
import { ProjectUser } from 'src/chat21-core/models/projectUsers';
|
|
21
|
+
import { ProjectUsersService } from 'src/app/services/project_users/project-users.service';
|
|
19
22
|
|
|
20
23
|
@Component({
|
|
21
24
|
selector: 'app-sidebar',
|
|
@@ -31,7 +34,7 @@ export class SidebarComponent implements OnInit {
|
|
|
31
34
|
IS_AVAILABLE: boolean = false;
|
|
32
35
|
IS_INACTIVE: boolean = true;
|
|
33
36
|
IS_BUSY: boolean;
|
|
34
|
-
isVisibleAPP: boolean;
|
|
37
|
+
// isVisibleAPP: boolean;
|
|
35
38
|
isVisibleANA: boolean;
|
|
36
39
|
isVisibleACT: boolean;
|
|
37
40
|
isVisibleMON: boolean;
|
|
@@ -41,9 +44,10 @@ export class SidebarComponent implements OnInit {
|
|
|
41
44
|
project_id: string;
|
|
42
45
|
DASHBOARD_URL: string;
|
|
43
46
|
// HAS_CLICKED_OPEN_USER_DETAIL: boolean = false
|
|
44
|
-
public
|
|
47
|
+
public translationsMap: Map<string, string>;
|
|
45
48
|
public_Key: any;
|
|
46
49
|
conversations_lbl: string;
|
|
50
|
+
whatsappbroadcast_lbl: string;
|
|
47
51
|
contacts_lbl: string;
|
|
48
52
|
apps_lbl: string;
|
|
49
53
|
analytics_lbl: string;
|
|
@@ -53,19 +57,14 @@ export class SidebarComponent implements OnInit {
|
|
|
53
57
|
countClickOnOpenUserDetailSidebar: number = 0
|
|
54
58
|
USER_PHOTO_PROFILE_EXIST: boolean;
|
|
55
59
|
currentUser: any;
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
dashboard_app_url: string;
|
|
62
|
-
dashboard_analytics_url: string;
|
|
63
|
-
dashboard_activities_url: string;
|
|
64
|
-
dashboard_history_url: string;
|
|
65
|
-
dashboard_settings_url: string;
|
|
66
|
-
tiledesk_url: string;
|
|
60
|
+
URLS: { [key: string]: string} = {};
|
|
61
|
+
|
|
62
|
+
public projectUser: ProjectUser;
|
|
63
|
+
public roles: { [key: string]: boolean }
|
|
64
|
+
|
|
67
65
|
LOGOS_ITEMS = LOGOS_ITEMS;
|
|
68
66
|
BRAND_BASE_INFO = BRAND_BASE_INFO;
|
|
67
|
+
PERMISSIONS = PERMISSIONS;
|
|
69
68
|
constructor(
|
|
70
69
|
public imageRepoService: ImageRepoService,
|
|
71
70
|
public appStorageService: AppStorageService,
|
|
@@ -75,12 +74,13 @@ export class SidebarComponent implements OnInit {
|
|
|
75
74
|
public wsService: WebsocketService,
|
|
76
75
|
public appConfigProvider: AppConfigProvider,
|
|
77
76
|
private translate: TranslateService,
|
|
77
|
+
public projectUsersService: ProjectUsersService,
|
|
78
78
|
public events: EventsService,
|
|
79
79
|
|
|
80
80
|
) { }
|
|
81
81
|
|
|
82
82
|
ngOnInit() {
|
|
83
|
-
this.
|
|
83
|
+
this.URLS.TILEDESK = BRAND_BASE_INFO['COMPANY_SITE_URL'] as string
|
|
84
84
|
|
|
85
85
|
this.DASHBOARD_URL = this.appConfig.getConfig().dashboardUrl + '#/project/';
|
|
86
86
|
this.getStoredProjectAndUserRole()
|
|
@@ -92,33 +92,36 @@ export class SidebarComponent implements OnInit {
|
|
|
92
92
|
|
|
93
93
|
|
|
94
94
|
getStoredProjectAndUserRole() {
|
|
95
|
-
this.events.subscribe('storage:last_project',project =>{
|
|
95
|
+
this.events.subscribe('storage:last_project',async (project) =>{
|
|
96
96
|
this.logger.log('[SIDEBAR] stored_project ', project)
|
|
97
97
|
if (project && project !== 'undefined') {
|
|
98
98
|
this.project_id = project.id_project.id
|
|
99
99
|
this.USER_ROLE = project.role;
|
|
100
100
|
this.buildURLs(this.USER_ROLE)
|
|
101
|
+
this.projectUser = await this.projectUsersService.getProjectUserByProjectId(project.id_project.id)
|
|
102
|
+
this.roles = this.checkRoles()
|
|
103
|
+
this.logger.log('[SIDEBAR] roles ', this.roles)
|
|
101
104
|
}
|
|
102
105
|
})
|
|
103
106
|
}
|
|
104
107
|
|
|
105
108
|
buildURLs(USER_ROLE) {
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
this.
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
109
|
+
const base = this.DASHBOARD_URL + this.project_id;
|
|
110
|
+
|
|
111
|
+
this.URLS = {
|
|
112
|
+
HOME: `${base}/home`,
|
|
113
|
+
KNOWLEDGEBASE: `${base}/knowledge-bases`,
|
|
114
|
+
BOTS: `${base}/bots`,
|
|
115
|
+
MONITOR: `${base}/wsrequests`,
|
|
116
|
+
WHATSAPP: `${base}/automations`,
|
|
117
|
+
CONTACTS: `${base}/contacts`,
|
|
118
|
+
APPSTORE: `${base}/app-store`,
|
|
119
|
+
ANALYTICS: `${base}/analytics`,
|
|
120
|
+
ACTIVITIES: `${base}/activities`,
|
|
121
|
+
HISTORY: `${base}/history`,
|
|
122
|
+
SETTINGS: USER_ROLE !== 'agent' ? `${base}/widget-set-up` : `${base}/cannedresponses`,
|
|
123
|
+
TILEDESK: 'https://www.tiledesk.com'
|
|
124
|
+
};
|
|
122
125
|
|
|
123
126
|
}
|
|
124
127
|
|
|
@@ -240,6 +243,7 @@ export class SidebarComponent implements OnInit {
|
|
|
240
243
|
this.logger.error('[SIDEBAR] - ngOnInit - currentUser not found in storage ')
|
|
241
244
|
}
|
|
242
245
|
this.translateLabels()
|
|
246
|
+
this.translations()
|
|
243
247
|
}
|
|
244
248
|
|
|
245
249
|
|
|
@@ -256,6 +260,7 @@ export class SidebarComponent implements OnInit {
|
|
|
256
260
|
|
|
257
261
|
this.translate.get(keys).subscribe((text: string) => {
|
|
258
262
|
this.conversations_lbl = text['Conversations'];
|
|
263
|
+
this.whatsappbroadcast_lbl = text['WhatsAppBroadcasts']
|
|
259
264
|
this.contacts_lbl = text['LABEL_CONTACTS']
|
|
260
265
|
this.apps_lbl = text['Apps']
|
|
261
266
|
this.analytics_lbl = text['Analytics']
|
|
@@ -271,13 +276,55 @@ export class SidebarComponent implements OnInit {
|
|
|
271
276
|
|
|
272
277
|
this.isVisibleANA = getOSCode("ANA", this.public_Key);
|
|
273
278
|
this.isVisibleACT = getOSCode("ACT", this.public_Key);
|
|
274
|
-
this.isVisibleAPP = getOSCode("APP", this.public_Key);
|
|
275
279
|
this.isVisibleMON = getOSCode("MON", this.public_Key);
|
|
276
280
|
this.isVisibleCNT = getOSCode("CNT", this.public_Key);
|
|
277
281
|
this.isVisibleKNB = getOSCode("KNB", this.public_Key);
|
|
278
|
-
|
|
282
|
+
|
|
279
283
|
}
|
|
280
284
|
|
|
285
|
+
|
|
286
|
+
checkRoles(): { [key: string]: boolean } {
|
|
287
|
+
const permissionKeys = [
|
|
288
|
+
'HOME_READ',
|
|
289
|
+
'KB_READ',
|
|
290
|
+
'FLOWS_READ',
|
|
291
|
+
'INBOX_READ',
|
|
292
|
+
'AUTOMATIONSLOG_READ',
|
|
293
|
+
'LEADS_READ',
|
|
294
|
+
'ANALYTICS_READ',
|
|
295
|
+
'ACTIVITIES_READ',
|
|
296
|
+
'HISTORY_READ',
|
|
297
|
+
'PROJECTSETTINGS_GENERAL_READ',
|
|
298
|
+
'PROJECTSETTINGS_DEVELOPER_READ',
|
|
299
|
+
'PROJECTSETTINGS_SMARTASSIGNMENT_READ',
|
|
300
|
+
'PROJECTSETTINGS_NOTIFICATION_READ',
|
|
301
|
+
'PROJECTSETTINGS_SECURITY_READ',
|
|
302
|
+
'PROJECTSETTINGS_BANNED_READ',
|
|
303
|
+
'PROJECTSETTINGS_ADVANCED_READ'
|
|
304
|
+
] as const;
|
|
305
|
+
|
|
306
|
+
const roles: { [key: string]: boolean } = {};
|
|
307
|
+
for (const key of permissionKeys) {
|
|
308
|
+
const permission = PERMISSIONS[key];
|
|
309
|
+
roles[permission] = hasRole(this.projectUser, permission);
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
|
|
313
|
+
let settingRoleKEys = [
|
|
314
|
+
'PROJECTSETTINGS_GENERAL_READ',
|
|
315
|
+
'PROJECTSETTINGS_DEVELOPER_READ',
|
|
316
|
+
'PROJECTSETTINGS_SMARTASSIGNMENT_READ',
|
|
317
|
+
'PROJECTSETTINGS_NOTIFICATION_READ',
|
|
318
|
+
'PROJECTSETTINGS_SECURITY_READ',
|
|
319
|
+
'PROJECTSETTINGS_BANNED_READ',
|
|
320
|
+
'PROJECTSETTINGS_ADVANCED_READ'
|
|
321
|
+
] as const;
|
|
322
|
+
roles[PERMISSIONS.SETTINGS_READ] = settingRoleKEys.some(settingKey => roles[PERMISSIONS[settingKey]]);
|
|
323
|
+
|
|
324
|
+
return roles;
|
|
325
|
+
|
|
326
|
+
}
|
|
327
|
+
|
|
281
328
|
listenTocurrentProjectUserUserAvailability$() {
|
|
282
329
|
this.wsService.currentProjectUserAvailability$.subscribe((data) => {
|
|
283
330
|
this.logger.log('[SIDEBAR] - $UBSC TO WS USER AVAILABILITY & BUSY STATUS RES ', data);
|
|
@@ -327,92 +374,20 @@ export class SidebarComponent implements OnInit {
|
|
|
327
374
|
}
|
|
328
375
|
}
|
|
329
376
|
|
|
330
|
-
goToHome() {
|
|
331
|
-
let url = this.DASHBOARD_URL + this.project_id + '/home'
|
|
332
|
-
this.dashboard_home_url = url;
|
|
333
|
-
const myWindow = window.open(url, '_self');
|
|
334
|
-
myWindow.focus();
|
|
335
|
-
}
|
|
336
|
-
|
|
337
|
-
goToBots() {
|
|
338
|
-
let url = this.DASHBOARD_URL + this.project_id + '/bots/my-chatbots/all'
|
|
339
|
-
const myWindow = window.open(url, '_self');
|
|
340
|
-
myWindow.focus();
|
|
341
|
-
}
|
|
342
|
-
|
|
343
|
-
goToConversations() {
|
|
344
|
-
let url = this.DASHBOARD_URL + this.project_id + '/wsrequests'
|
|
345
|
-
const myWindow = window.open(url, '_self');
|
|
346
|
-
myWindow.focus();
|
|
347
|
-
}
|
|
348
|
-
|
|
349
|
-
goToContacts() {
|
|
350
|
-
let url = this.DASHBOARD_URL + this.project_id + '/contacts'
|
|
351
|
-
const myWindow = window.open(url, '_self');
|
|
352
|
-
myWindow.focus();
|
|
353
|
-
}
|
|
354
|
-
|
|
355
|
-
goToAppStore() {
|
|
356
|
-
let url = this.DASHBOARD_URL + this.project_id + '/app-store'
|
|
357
|
-
const myWindow = window.open(url, '_self');
|
|
358
|
-
myWindow.focus();
|
|
359
|
-
}
|
|
360
|
-
|
|
361
|
-
goToAnalytics() {
|
|
362
|
-
let url = this.DASHBOARD_URL + this.project_id + '/analytics'
|
|
363
|
-
const myWindow = window.open(url, '_self');
|
|
364
|
-
myWindow.focus();
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
goToActivities() {
|
|
368
|
-
let url = this.DASHBOARD_URL + this.project_id + '/activities'
|
|
369
|
-
const myWindow = window.open(url, '_self');
|
|
370
|
-
myWindow.focus();
|
|
371
|
-
}
|
|
372
|
-
|
|
373
|
-
goToHistory() {
|
|
374
|
-
let url = this.DASHBOARD_URL + this.project_id + '/history'
|
|
375
|
-
const myWindow = window.open(url, '_self');
|
|
376
|
-
myWindow.focus();
|
|
377
|
-
}
|
|
378
|
-
|
|
379
|
-
goToWidgetSetUpOrToCannedResponses() {
|
|
380
|
-
if (this.USER_ROLE !== 'agent') {
|
|
381
|
-
this.goToWidgetSetUp()
|
|
382
|
-
} else if (this.USER_ROLE === 'agent') {
|
|
383
|
-
this.goToSettings_CannedResponses()
|
|
384
|
-
}
|
|
385
|
-
}
|
|
386
|
-
|
|
387
|
-
goToWidgetSetUp() {
|
|
388
|
-
let url = this.DASHBOARD_URL + this.project_id + '/widget-set-up'
|
|
389
|
-
const myWindow = window.open(url, '_self');
|
|
390
|
-
myWindow.focus();
|
|
391
|
-
}
|
|
392
|
-
|
|
393
|
-
goToSettings_CannedResponses() {
|
|
394
|
-
let url = this.DASHBOARD_URL + this.project_id + '/cannedresponses'
|
|
395
|
-
const myWindow = window.open(url, '_self');
|
|
396
|
-
myWindow.focus();
|
|
397
|
-
}
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
377
|
public translations() {
|
|
402
378
|
const keys = [
|
|
403
|
-
'
|
|
404
|
-
'
|
|
405
|
-
'
|
|
406
|
-
'
|
|
407
|
-
'
|
|
408
|
-
'
|
|
409
|
-
'
|
|
410
|
-
'
|
|
411
|
-
'
|
|
412
|
-
|
|
413
|
-
"CHANGE_TO_YOUR_STATUS_TO_UNAVAILABLE"
|
|
379
|
+
'Monitor',
|
|
380
|
+
'Flows',
|
|
381
|
+
'Knowledgebases',
|
|
382
|
+
'WhatsAppBroadcasts',
|
|
383
|
+
'LABEL_CONTACTS',
|
|
384
|
+
'Apps',
|
|
385
|
+
'Analytics',
|
|
386
|
+
'Activities',
|
|
387
|
+
'History',
|
|
388
|
+
'Settings'
|
|
414
389
|
];
|
|
415
|
-
this.
|
|
390
|
+
this.translationsMap = this.translateService.translateLanguage(keys);
|
|
416
391
|
}
|
|
417
392
|
|
|
418
393
|
|
|
@@ -217,6 +217,7 @@
|
|
|
217
217
|
[cannedSection]="canShowCanned"
|
|
218
218
|
[whatsappTemplatesSection]="isWhatsappTemplatesEnabled"
|
|
219
219
|
[isOpenInfoConversation]="openInfoConversation"
|
|
220
|
+
[ticketSection]="isTicketEnabled"
|
|
220
221
|
[stylesMap]="styleMap"
|
|
221
222
|
[translationMap]="translationsMap"
|
|
222
223
|
[dropEvent]="dropEvent"
|
|
@@ -225,7 +226,8 @@
|
|
|
225
226
|
(onClickOpenCannedResponses)="onClickOpenCannedResponses($event)"
|
|
226
227
|
(eventSendMessage)="returnSendMessage($event)"
|
|
227
228
|
(onPresentModalScrollToBottom)="onPresentModalScrollToBottom($event)"
|
|
228
|
-
(onOpenFooterSection)="onOpenFooterSection($event)"
|
|
229
|
+
(onOpenFooterSection)="onOpenFooterSection($event)"
|
|
230
|
+
(onOpenTicket)="onOpenTicket($event)">
|
|
229
231
|
</app-message-text-area>
|
|
230
232
|
<!-- [events]="eventsReplaceTexareaText.asObservable()" -->
|
|
231
233
|
</ion-row>
|
|
@@ -176,6 +176,10 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
|
|
|
176
176
|
copilotQuestion: string = '';
|
|
177
177
|
/**COPILOT : end */
|
|
178
178
|
|
|
179
|
+
/** TICKET: start */
|
|
180
|
+
isTicketEnabled: boolean = false;
|
|
181
|
+
/** TICKET: end */
|
|
182
|
+
|
|
179
183
|
isMine = isMine
|
|
180
184
|
isInfo = isInfo
|
|
181
185
|
isFirstMessage = isFirstMessage
|
|
@@ -424,6 +428,8 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
|
|
|
424
428
|
ionViewDidEnter() {
|
|
425
429
|
this.logger.log('[CONVS-DETAIL] > ionViewDidEnter')
|
|
426
430
|
// this.info_content_child_enabled = true;
|
|
431
|
+
// Scroll to bottom to show the last message without animation
|
|
432
|
+
this.scrollToLastMessage()
|
|
427
433
|
}
|
|
428
434
|
|
|
429
435
|
// Unsubscibe when new page transition end
|
|
@@ -483,6 +489,7 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
|
|
|
483
489
|
this.messages = [] // list messages of conversation
|
|
484
490
|
this.isFileSelected = false // indicates if a file has been selected (image to upload)
|
|
485
491
|
this.isEmailEnabled = (this.appConfigProvider.getConfig().emailSection === 'true' || this.appConfigProvider.getConfig().emailSection === true) ? true : false;
|
|
492
|
+
this.isTicketEnabled = (this.appConfigProvider.getConfig().ticketSection === 'true' || this.appConfigProvider.getConfig().ticketSection === true) ? true : false;
|
|
486
493
|
this.isWhatsappTemplatesEnabled = (this.appConfigProvider.getConfig().whatsappTemplatesSection === 'true' || this.appConfigProvider.getConfig().whatsappTemplatesSection === true) ? true : false;
|
|
487
494
|
|
|
488
495
|
this.cannedResponsesService.initialize(appconfig.apiUrl)
|
|
@@ -554,7 +561,7 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
|
|
|
554
561
|
this.offlineMsgEmail = this.checkOfflineMsgEmailIsEnabled(project)
|
|
555
562
|
this.isCopilotEnabled = this.projectPlanUtils.checkProjectProfileFeature(project, 'copilot');
|
|
556
563
|
this.fileUploadAccept = this.checkAcceptedUploadFile(project)
|
|
557
|
-
this.rolesCanned = this.checkCannedResponsesRoles(
|
|
564
|
+
this.rolesCanned = this.checkCannedResponsesRoles()
|
|
558
565
|
this.canShowCanned = this.checkCannedResponses(project)
|
|
559
566
|
this.logger.log('[CONVS-DETAIL] this.rolesCanned ', this.canShowCanned)
|
|
560
567
|
}
|
|
@@ -610,7 +617,7 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
|
|
|
610
617
|
return true
|
|
611
618
|
}
|
|
612
619
|
|
|
613
|
-
checkCannedResponsesRoles(
|
|
620
|
+
checkCannedResponsesRoles(): { [key: string]: boolean } {
|
|
614
621
|
const permissionKeys = [
|
|
615
622
|
'CANNED_RESPONSES_CREATE',
|
|
616
623
|
'CANNED_RESPONSES_READ',
|
|
@@ -711,6 +718,11 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
|
|
|
711
718
|
"WHATSAPP.ERROR_WHATSAPP_NOT_INSTALLED",
|
|
712
719
|
"WHATSAPP.ERROR_WHATSAPP_GENERIC_ERROR",
|
|
713
720
|
|
|
721
|
+
"TICKET.OPEN_TICKET",
|
|
722
|
+
"TICKET.DESCRIPTION",
|
|
723
|
+
"TICKET.CONFIRM",
|
|
724
|
+
"TICKET.CLOSE",
|
|
725
|
+
|
|
714
726
|
"COPILOT.ASK_AI",
|
|
715
727
|
"COPILOT.NO_SUGGESTIONS_PRESENT",
|
|
716
728
|
|
|
@@ -1926,6 +1938,13 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
|
|
|
1926
1938
|
}
|
|
1927
1939
|
|
|
1928
1940
|
|
|
1941
|
+
onOpenTicket() {
|
|
1942
|
+
this.logger.debug('[CONVS-DETAIL] openTicketOnExternalService - conversationWith ', this.conversationWith)
|
|
1943
|
+
if(window['openTicketOnHDA']){
|
|
1944
|
+
window['openTicketOnHDA'](this.conversationWith)
|
|
1945
|
+
}
|
|
1946
|
+
|
|
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,6 +108,9 @@ 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;
|
|
@@ -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
|
|
|
@@ -115,7 +115,6 @@ export class GlobalSettingsService {
|
|
|
115
115
|
if (TEMP) {
|
|
116
116
|
globals.supportMode = stringToBoolean(TEMP);
|
|
117
117
|
this.appStorageService.setItem('supportMode', String(globals.supportMode))
|
|
118
|
-
console.log('globals.supportMode', globals.supportMode);
|
|
119
118
|
}
|
|
120
119
|
|
|
121
120
|
TEMP = getParameterByName(windowContext, 'tiledesk_lang');
|
|
@@ -4,6 +4,8 @@ export const PERMISSIONS = {
|
|
|
4
4
|
REQUEST_READ_GROUP: 'request_read_group',
|
|
5
5
|
REQUEST_READ_MY: 'request_read_my',
|
|
6
6
|
|
|
7
|
+
HOME_READ: 'home_read',
|
|
8
|
+
|
|
7
9
|
INBOX_READ: 'inbox_read',
|
|
8
10
|
REQUEST_UPDATE: 'request_update',
|
|
9
11
|
REQUEST_SEND: 'request_send',
|
|
@@ -25,6 +27,8 @@ export const PERMISSIONS = {
|
|
|
25
27
|
|
|
26
28
|
HISTORY_READ: 'history_read',
|
|
27
29
|
|
|
30
|
+
RATING_READ:'rating_read',
|
|
31
|
+
|
|
28
32
|
AUTOMATIONSLOG_READ: "automationslog_read",
|
|
29
33
|
AUTOMATIONSLOG_CREATE: "automationslog_create",
|
|
30
34
|
|
|
@@ -70,18 +74,21 @@ export const PERMISSIONS = {
|
|
|
70
74
|
WIDGETSETUP_READ: 'widgetsetup_read',
|
|
71
75
|
INSTALLATION_READ: 'installation_read',
|
|
72
76
|
TRANSLATIONS_READ: 'translations_read',
|
|
77
|
+
WIDGETSETUP_UPDATE: 'widgetsetup_update',
|
|
78
|
+
|
|
79
|
+
|
|
73
80
|
|
|
74
81
|
DEPARTMENTS_LIST_READ: 'department_list_read',
|
|
75
82
|
DEPARTMENT_DETAIL_READ: 'department_detail_read',
|
|
76
83
|
DEPARTMENT_CREATE_READ: 'department_create_read',
|
|
77
84
|
|
|
78
85
|
TEAMMATES_READ: 'teammates_read',
|
|
79
|
-
|
|
86
|
+
TEAMMATE_UPDATE: 'teammate_update',
|
|
80
87
|
TEAMMATES_CREATE: 'teammates_create',
|
|
81
88
|
ROLES_READ: 'roles_read',
|
|
82
89
|
GROUPS_READ: 'groups_read',
|
|
83
90
|
|
|
84
|
-
|
|
91
|
+
|
|
85
92
|
|
|
86
93
|
EMAIL_TICKETING_READ:'email_ticketing_read',
|
|
87
94
|
EMAIL_TICKETING_UPDATE:'email_ticketing_update',
|
|
@@ -107,29 +114,25 @@ export const PERMISSIONS = {
|
|
|
107
114
|
APPS_READ:'apps_read',
|
|
108
115
|
APPS_UPDATE:'apps_update',
|
|
109
116
|
|
|
117
|
+
SETTINGS_READ: 'settings_read',
|
|
110
118
|
PROJECTSETTINGS_GENERAL_READ: 'projectsettings_general_read',
|
|
111
119
|
PROJECTSETTINGS_GENERAL_UPDATE: 'projectsettings_general_update',
|
|
112
|
-
|
|
113
120
|
PROJECTSETTINGS_SUBSCRIPTION_READ: 'projectsettings_subscription_read',
|
|
114
|
-
|
|
115
121
|
PROJECTSETTINGS_DEVELOPER_READ: 'projectsettings_developer_read',
|
|
116
122
|
PROJECTSETTINGS_DEVELOPER_UPDATE: 'projectsettings_developer_update',
|
|
117
|
-
|
|
118
123
|
PROJECTSETTINGS_SMARTASSIGNMENT_READ: 'projectsettings_smartassignment_read',
|
|
119
124
|
PROJECTSETTINGS_SMARTASSIGNMENT_UPDATE: 'projectsettings_smartassignment_update',
|
|
120
|
-
|
|
121
125
|
PROJECTSETTINGS_NOTIFICATION_READ: 'projectsettings_notification_read',
|
|
122
|
-
|
|
123
126
|
PROJECTSETTINGS_SECURITY_READ: 'projectsettings_security_read',
|
|
124
|
-
|
|
125
127
|
PROJECTSETTINGS_BANNED_READ: 'projectsettings_banned_read',
|
|
126
|
-
|
|
127
128
|
PROJECTSETTINGS_ADVANCED_READ: 'projectsettings_advanced_read',
|
|
128
129
|
|
|
129
|
-
|
|
130
130
|
ACCESS_LISTS: 'accessLists',
|
|
131
131
|
PROFILE_PAGES: 'profilePages',
|
|
132
132
|
LEAD_DATA: 'leadData',
|
|
133
133
|
IMPORT_DATA: 'importData',
|
|
134
|
-
MANAGE_TAGS: 'manageTags'
|
|
134
|
+
MANAGE_TAGS: 'manageTags',
|
|
135
|
+
|
|
136
|
+
CHANGE_PROJECT:'change_project',
|
|
137
|
+
SIMULATE_CONV:'simulate_conv',
|
|
135
138
|
};
|
package/src/assets/i18n/ar.json
CHANGED
|
@@ -225,6 +225,10 @@
|
|
|
225
225
|
"admin": "مدير",
|
|
226
226
|
"agent": "وكيل",
|
|
227
227
|
"Conversations": "المحادثات",
|
|
228
|
+
"Monitor": "شاشة",
|
|
229
|
+
"Flows": "التدفّقات",
|
|
230
|
+
"Knowledgebases": "قواعد المعرفة",
|
|
231
|
+
"Whatsappbroadcasts": "نشرات WhatsApp",
|
|
228
232
|
"Apps": "تطبيقات",
|
|
229
233
|
"Analytics": "تحليلات",
|
|
230
234
|
"Activities": "أنشطة",
|
|
@@ -306,5 +310,11 @@
|
|
|
306
310
|
"SEND_EMAIL_SUCCESS_OFFLINE_MESSAGE":"تم إرسال الرسالة أيضًا عبر البريد الإلكتروني 📩"
|
|
307
311
|
},
|
|
308
312
|
"EMOJI_NOT_ELLOWED": "الرموز التعبيرية غير مسموح بها",
|
|
309
|
-
"DOMAIN_NOT_ALLOWED": "يحتوي الرابط على نطاق غير مسموح"
|
|
313
|
+
"DOMAIN_NOT_ALLOWED": "يحتوي الرابط على نطاق غير مسموح",
|
|
314
|
+
"TICKET": {
|
|
315
|
+
"OPEN_TICKET": "افتح تذكرة",
|
|
316
|
+
"DESCRIPTION": "هل تؤكد أنك تريد فتح تذكرة لهذه المحادثة؟",
|
|
317
|
+
"CONFIRM": "تأكيد",
|
|
318
|
+
"CLOSE": "إغلاق"
|
|
319
|
+
}
|
|
310
320
|
}
|
package/src/assets/i18n/az.json
CHANGED
|
@@ -225,6 +225,10 @@
|
|
|
225
225
|
"admin": "Administrator",
|
|
226
226
|
"agent": "Agent",
|
|
227
227
|
"Conversations": "Söhbətlər",
|
|
228
|
+
"Monitor": "Monitor",
|
|
229
|
+
"Flows": "Axınlar",
|
|
230
|
+
"Knowledgebases": "Bilik bazaları",
|
|
231
|
+
"Whatsappbroadcasts": "WhatsApp Yayınları",
|
|
228
232
|
"Apps": "Proqramlar",
|
|
229
233
|
"Analytics": "Analitika",
|
|
230
234
|
"Activities": "Fəaliyyətlər",
|
|
@@ -306,5 +310,11 @@
|
|
|
306
310
|
"SEND_EMAIL_SUCCESS_OFFLINE_MESSAGE":"Mesaj e-poçt vasitəsilə də göndərilib 📩"
|
|
307
311
|
},
|
|
308
312
|
"EMOJI_NOT_ELLOWED": "Emoji icazə verilmir",
|
|
309
|
-
"DOMAIN_NOT_ALLOWED": "URL icazə verilməyən domeni ehtiva edir"
|
|
313
|
+
"DOMAIN_NOT_ALLOWED": "URL icazə verilməyən domeni ehtiva edir",
|
|
314
|
+
"TICKET": {
|
|
315
|
+
"OPEN_TICKET": "Bilet aç",
|
|
316
|
+
"DESCRIPTION": "Bu söhbət üçün bilet açmaq istədiyinizi təsdiqləyirsinizmi?",
|
|
317
|
+
"CONFIRM": "Təsdiqlə",
|
|
318
|
+
"CLOSE": "Bağla"
|
|
319
|
+
}
|
|
310
320
|
}
|