@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
|
@@ -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,36 +92,57 @@ 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
|
+
};
|
|
125
|
+
|
|
126
|
+
this.setQueryParamsForAll({ tiledesk_logOut: BRAND_BASE_INFO['LOGOUT_ENABLED'] });
|
|
122
127
|
|
|
123
128
|
}
|
|
124
129
|
|
|
130
|
+
// Funzione helper per aggiungere query params a tutte le URL
|
|
131
|
+
setQueryParamsForAll(queryParams: any) {
|
|
132
|
+
if (!queryParams) return;
|
|
133
|
+
|
|
134
|
+
const queryString = new URLSearchParams(queryParams).toString();
|
|
135
|
+
|
|
136
|
+
// Cicla tutte le chiavi di URLS
|
|
137
|
+
Object.keys(this.URLS).forEach(key => {
|
|
138
|
+
if (this.URLS[key]) {
|
|
139
|
+
// Controlla se già ci sono query params
|
|
140
|
+
const separator = this.URLS[key].includes('?') ? '&' : '?';
|
|
141
|
+
this.URLS[key] = `${this.URLS[key]}${queryString ? separator + queryString : ''}`;
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
|
|
125
146
|
subcribeToAuthStateChanged() {
|
|
126
147
|
this.messagingAuthService.BSAuthStateChanged.subscribe((state) => {
|
|
127
148
|
this.logger.log('[SIDEBAR] BSAuthStateChanged ', state)
|
|
@@ -240,6 +261,7 @@ export class SidebarComponent implements OnInit {
|
|
|
240
261
|
this.logger.error('[SIDEBAR] - ngOnInit - currentUser not found in storage ')
|
|
241
262
|
}
|
|
242
263
|
this.translateLabels()
|
|
264
|
+
this.translations()
|
|
243
265
|
}
|
|
244
266
|
|
|
245
267
|
|
|
@@ -256,6 +278,7 @@ export class SidebarComponent implements OnInit {
|
|
|
256
278
|
|
|
257
279
|
this.translate.get(keys).subscribe((text: string) => {
|
|
258
280
|
this.conversations_lbl = text['Conversations'];
|
|
281
|
+
this.whatsappbroadcast_lbl = text['WhatsAppBroadcasts']
|
|
259
282
|
this.contacts_lbl = text['LABEL_CONTACTS']
|
|
260
283
|
this.apps_lbl = text['Apps']
|
|
261
284
|
this.analytics_lbl = text['Analytics']
|
|
@@ -271,13 +294,55 @@ export class SidebarComponent implements OnInit {
|
|
|
271
294
|
|
|
272
295
|
this.isVisibleANA = getOSCode("ANA", this.public_Key);
|
|
273
296
|
this.isVisibleACT = getOSCode("ACT", this.public_Key);
|
|
274
|
-
this.isVisibleAPP = getOSCode("APP", this.public_Key);
|
|
275
297
|
this.isVisibleMON = getOSCode("MON", this.public_Key);
|
|
276
298
|
this.isVisibleCNT = getOSCode("CNT", this.public_Key);
|
|
277
299
|
this.isVisibleKNB = getOSCode("KNB", this.public_Key);
|
|
278
|
-
|
|
300
|
+
|
|
279
301
|
}
|
|
280
302
|
|
|
303
|
+
|
|
304
|
+
checkRoles(): { [key: string]: boolean } {
|
|
305
|
+
const permissionKeys = [
|
|
306
|
+
'HOME_READ',
|
|
307
|
+
'KB_READ',
|
|
308
|
+
'FLOWS_READ',
|
|
309
|
+
'INBOX_READ',
|
|
310
|
+
'AUTOMATIONSLOG_READ',
|
|
311
|
+
'LEADS_READ',
|
|
312
|
+
'ANALYTICS_READ',
|
|
313
|
+
'ACTIVITIES_READ',
|
|
314
|
+
'HISTORY_READ',
|
|
315
|
+
'PROJECTSETTINGS_GENERAL_READ',
|
|
316
|
+
'PROJECTSETTINGS_DEVELOPER_READ',
|
|
317
|
+
'PROJECTSETTINGS_SMARTASSIGNMENT_READ',
|
|
318
|
+
'PROJECTSETTINGS_NOTIFICATION_READ',
|
|
319
|
+
'PROJECTSETTINGS_SECURITY_READ',
|
|
320
|
+
'PROJECTSETTINGS_BANNED_READ',
|
|
321
|
+
'PROJECTSETTINGS_ADVANCED_READ'
|
|
322
|
+
] as const;
|
|
323
|
+
|
|
324
|
+
const roles: { [key: string]: boolean } = {};
|
|
325
|
+
for (const key of permissionKeys) {
|
|
326
|
+
const permission = PERMISSIONS[key];
|
|
327
|
+
roles[permission] = hasRole(this.projectUser, permission);
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
|
|
331
|
+
let settingRoleKEys = [
|
|
332
|
+
'PROJECTSETTINGS_GENERAL_READ',
|
|
333
|
+
'PROJECTSETTINGS_DEVELOPER_READ',
|
|
334
|
+
'PROJECTSETTINGS_SMARTASSIGNMENT_READ',
|
|
335
|
+
'PROJECTSETTINGS_NOTIFICATION_READ',
|
|
336
|
+
'PROJECTSETTINGS_SECURITY_READ',
|
|
337
|
+
'PROJECTSETTINGS_BANNED_READ',
|
|
338
|
+
'PROJECTSETTINGS_ADVANCED_READ'
|
|
339
|
+
] as const;
|
|
340
|
+
roles[PERMISSIONS.SETTINGS_READ] = settingRoleKEys.some(settingKey => roles[PERMISSIONS[settingKey]]);
|
|
341
|
+
|
|
342
|
+
return roles;
|
|
343
|
+
|
|
344
|
+
}
|
|
345
|
+
|
|
281
346
|
listenTocurrentProjectUserUserAvailability$() {
|
|
282
347
|
this.wsService.currentProjectUserAvailability$.subscribe((data) => {
|
|
283
348
|
this.logger.log('[SIDEBAR] - $UBSC TO WS USER AVAILABILITY & BUSY STATUS RES ', data);
|
|
@@ -327,92 +392,20 @@ export class SidebarComponent implements OnInit {
|
|
|
327
392
|
}
|
|
328
393
|
}
|
|
329
394
|
|
|
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
395
|
public translations() {
|
|
402
396
|
const keys = [
|
|
403
|
-
'
|
|
404
|
-
'
|
|
405
|
-
'
|
|
406
|
-
'
|
|
407
|
-
'
|
|
408
|
-
'
|
|
409
|
-
'
|
|
410
|
-
'
|
|
411
|
-
'
|
|
412
|
-
|
|
413
|
-
"CHANGE_TO_YOUR_STATUS_TO_UNAVAILABLE"
|
|
397
|
+
'Monitor',
|
|
398
|
+
'Flows',
|
|
399
|
+
'Knowledgebases',
|
|
400
|
+
'WhatsAppBroadcasts',
|
|
401
|
+
'LABEL_CONTACTS',
|
|
402
|
+
'Apps',
|
|
403
|
+
'Analytics',
|
|
404
|
+
'Activities',
|
|
405
|
+
'History',
|
|
406
|
+
'Settings'
|
|
414
407
|
];
|
|
415
|
-
this.
|
|
408
|
+
this.translationsMap = this.translateService.translateLanguage(keys);
|
|
416
409
|
}
|
|
417
410
|
|
|
418
411
|
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
<!-- (click)="goToUserProfile()" -->
|
|
23
23
|
<div role="button" class="user-details-avatar">
|
|
24
24
|
<img *ngIf="USER_PHOTO_PROFILE_EXIST" class="user-img-in-sidebar-user-details" [src]="photo_profile_URL"
|
|
25
|
-
onerror="this.src='assets/
|
|
25
|
+
onerror="this.src='assets/img/no_image_user.png'" />
|
|
26
26
|
|
|
27
27
|
<div *ngIf="!USER_PHOTO_PROFILE_EXIST" class="user-img-in-sidebar-user-details"
|
|
28
28
|
[ngStyle]="{'background': 'linear-gradient(rgb(255,255,255) -125%,' + user?.fillColour + ')'}">
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
<div class="user-details-role">
|
|
52
52
|
<h3>{{ USER_ROLE_LABEL }} </h3>
|
|
53
53
|
|
|
54
|
-
<div class="user-details-view-profile" (click)="goToUserProfile()">
|
|
54
|
+
<div *ngIf="BRAND_BASE_INFO['DISPLAY_EDIT_PROFILE']" class="user-details-view-profile" (click)="goToUserProfile()">
|
|
55
55
|
{{translationsMap.get('EditProfile')}}
|
|
56
56
|
</div>
|
|
57
57
|
|
|
@@ -81,11 +81,11 @@
|
|
|
81
81
|
[searchable]="false">
|
|
82
82
|
<ng-template ng-label-tmp let-item="item">
|
|
83
83
|
<img style="width: 15px;height: 15px;position: relative; top: 1px;" height="15" width="15" [src]="item?.avatar" />
|
|
84
|
-
<span id="sidebaravatar_{{item.name}}" style="text-transform: capitalize; margin-left:8px"> {{item.label}} </span>
|
|
84
|
+
<span id="sidebaravatar_{{item.name}}" style="text-transform: capitalize; margin-left:8px"> {{item.label | translate}} </span>
|
|
85
85
|
</ng-template>
|
|
86
86
|
<ng-template ng-option-tmp let-item="item" let-index="index">
|
|
87
87
|
<img style="width: 15px;height: 15px;position: relative; top: 1px;" height="15" width="15" [src]="item?.avatar" />
|
|
88
|
-
<span id="sidebaravatar_{{item.name}}" style="text-transform: capitalize; margin-left:8px"> {{item.label}} </span>
|
|
88
|
+
<span id="sidebaravatar_{{item.name}}" style="text-transform: capitalize; margin-left:8px"> {{item.label | translate}} </span>
|
|
89
89
|
</ng-template>
|
|
90
90
|
</ng-select>
|
|
91
91
|
</section>
|
|
@@ -25,6 +25,7 @@ export class SidebarUserDetailsComponent implements OnInit, OnChanges {
|
|
|
25
25
|
// HAS_CLICKED_OPEN_USER_DETAIL: boolean = false;
|
|
26
26
|
// @Output() onCloseUserDetailsSidebar = new EventEmitter();
|
|
27
27
|
|
|
28
|
+
@Input() logOut: boolean;
|
|
28
29
|
|
|
29
30
|
public browserLang: string;
|
|
30
31
|
private logger: LoggerService = LoggerInstance.getInstance()
|
|
@@ -52,9 +53,9 @@ export class SidebarUserDetailsComponent implements OnInit, OnChanges {
|
|
|
52
53
|
|
|
53
54
|
selectedStatus: any;
|
|
54
55
|
teammateStatus = [
|
|
55
|
-
{ id: 1, name: 'Available', avatar: 'assets/
|
|
56
|
-
{ id: 2, name: 'Unavailable', avatar: 'assets/
|
|
57
|
-
{ id: 3, name: 'Inactive', avatar: 'assets/
|
|
56
|
+
{ id: 1, name: 'Available', avatar: 'assets/img/teammate-status/avaible.svg', label: "LABEL_AVAILABLE" },
|
|
57
|
+
{ id: 2, name: 'Unavailable', avatar: 'assets/img/teammate-status/unavaible.svg', label: "LABEL_NOT_AVAILABLE" },
|
|
58
|
+
{ id: 3, name: 'Inactive', avatar: 'assets/img/teammate-status/inactive.svg', label: "LABEL_INACTIVE" },
|
|
58
59
|
];
|
|
59
60
|
|
|
60
61
|
translationsMap: Map<string, string> = new Map();
|
|
@@ -194,13 +195,13 @@ export class SidebarUserDetailsComponent implements OnInit, OnChanges {
|
|
|
194
195
|
this.chat_lang = ''
|
|
195
196
|
if (this.browserLang && !stored_preferred_lang) {
|
|
196
197
|
this.chat_lang = this.browserLang
|
|
197
|
-
// this.flag_url = "assets/
|
|
198
|
+
// this.flag_url = "assets/img/language_flag/" + this.chat_lang + ".png"
|
|
198
199
|
|
|
199
200
|
this.logger.log('[SIDEBAR-USER-DETAILS] flag_url: ', this.flag_url);
|
|
200
201
|
this.logger.log('[SIDEBAR-USER-DETAILS] chat_lang: ', this.chat_lang);
|
|
201
202
|
} else if (this.browserLang && stored_preferred_lang) {
|
|
202
203
|
this.chat_lang = stored_preferred_lang
|
|
203
|
-
// this.flag_url = "assets/
|
|
204
|
+
// this.flag_url = "assets/img/language_flag/" + this.chat_lang + ".png"
|
|
204
205
|
this.logger.log('[SIDEBAR-USER-DETAILS] flag_url: ', this.flag_url);
|
|
205
206
|
this.logger.log('[SIDEBAR-USER-DETAILS] chat_lang: ', this.chat_lang);
|
|
206
207
|
}
|
|
@@ -208,11 +209,11 @@ export class SidebarUserDetailsComponent implements OnInit, OnChanges {
|
|
|
208
209
|
if (tranlatedLanguage.includes(this.chat_lang)) {
|
|
209
210
|
this.logger.log('[SIDEBAR-USER-DETAILS] tranlatedLanguage includes', this.chat_lang, ': ', tranlatedLanguage.includes(this.chat_lang))
|
|
210
211
|
this.translate.use(this.chat_lang);
|
|
211
|
-
this.flag_url = "assets/
|
|
212
|
+
this.flag_url = "assets/img/language_flag/" + this.chat_lang + ".png"
|
|
212
213
|
} else {
|
|
213
214
|
this.logger.log('[SIDEBAR-USER-DETAILS] tranlatedLanguage includes', this.chat_lang, ': ', tranlatedLanguage.includes(this.chat_lang))
|
|
214
215
|
this.translate.use('en');
|
|
215
|
-
this.flag_url = "assets/
|
|
216
|
+
this.flag_url = "assets/img/language_flag/en.png"
|
|
216
217
|
this.chat_lang = 'en'
|
|
217
218
|
}
|
|
218
219
|
|
|
@@ -242,9 +243,9 @@ export class SidebarUserDetailsComponent implements OnInit, OnChanges {
|
|
|
242
243
|
.set('SubscriptionPaymentProblem', text['SubscriptionPaymentProblem'])
|
|
243
244
|
.set('ThePlanHasExpired', text['ThePlanHasExpired'])
|
|
244
245
|
|
|
245
|
-
this.teammateStatus.forEach(element => {
|
|
246
|
-
|
|
247
|
-
});
|
|
246
|
+
// this.teammateStatus.forEach(element => {
|
|
247
|
+
// element.label = this.translationsMap.get(element.label)
|
|
248
|
+
// });
|
|
248
249
|
|
|
249
250
|
});
|
|
250
251
|
}
|
|
@@ -261,7 +262,7 @@ export class SidebarUserDetailsComponent implements OnInit, OnChanges {
|
|
|
261
262
|
listenToCurrentStoredProject() {
|
|
262
263
|
this.events.subscribe('storage:last_project', projectObjct => {
|
|
263
264
|
if (projectObjct && projectObjct !== 'undefined') {
|
|
264
|
-
|
|
265
|
+
this.logger.log('[SIDEBAR-USER-DETAILS] - GET STORED PROJECT ', projectObjct)
|
|
265
266
|
|
|
266
267
|
//TODO: recuperare info da root e non da id_project
|
|
267
268
|
this.project = {
|
|
@@ -284,6 +285,8 @@ export class SidebarUserDetailsComponent implements OnInit, OnChanges {
|
|
|
284
285
|
} else if (this.project.profile.type === 'payment' && this.project.profile.name === 'enterprise') {
|
|
285
286
|
this.getEnterprisePlanTranslation();
|
|
286
287
|
}
|
|
288
|
+
|
|
289
|
+
this.wsService.subscriptionToWsCurrentProjectUserAvailability(this.project._id, projectObjct._id);
|
|
287
290
|
}
|
|
288
291
|
})
|
|
289
292
|
|
|
@@ -329,14 +332,14 @@ export class SidebarUserDetailsComponent implements OnInit, OnChanges {
|
|
|
329
332
|
// this.logger.log('teammateStatus ', this.teammateStatus)
|
|
330
333
|
this.selectedStatus = this.teammateStatus[2].id;
|
|
331
334
|
this.logger.debug('[SIDEBAR-USER-DETAILS] - PROFILE_STATUS selected option', this.teammateStatus[2].name);
|
|
332
|
-
this.teammateStatus = this.teammateStatus.slice(0)
|
|
335
|
+
// this.teammateStatus = this.teammateStatus.slice(0)
|
|
333
336
|
} else if (projectUser['user_available'] === false && (projectUser['profileStatus'] === '' || !projectUser['profileStatus'])) {
|
|
334
337
|
this.selectedStatus = this.teammateStatus[1].id;
|
|
335
338
|
this.logger.debug('[SIDEBAR-USER-DETAILS] - PROFILE_STATUS selected option', this.teammateStatus[1].name);
|
|
336
|
-
this.teammateStatus = this.teammateStatus.slice(0)
|
|
339
|
+
// this.teammateStatus = this.teammateStatus.slice(0)
|
|
337
340
|
} else if (projectUser['user_available'] === true && (projectUser['profileStatus'] === '' || !projectUser['profileStatus'])) {
|
|
338
341
|
this.selectedStatus = this.teammateStatus[0].id
|
|
339
|
-
this.teammateStatus = this.teammateStatus.slice(0)
|
|
342
|
+
// this.teammateStatus = this.teammateStatus.slice(0)
|
|
340
343
|
this.logger.debug('[SIDEBAR-USER-DETAILS] - PROFILE_STATUS selected option', this.teammateStatus[0].name);
|
|
341
344
|
}
|
|
342
345
|
this.IS_BUSY = projectUser['isBusy']
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
<img *ngIf="item.requestertype === 'agent' && UPLOAD_ENGINE_IS_FIREBASE" height="24" width="24"
|
|
37
37
|
style="border-radius:50%; object-fit: cover; vertical-align: middle;"
|
|
38
38
|
src="https://firebasestorage.googleapis.com/v0/b/{{storageBucket}}/o/profiles%2F{{item.id}}%2Fphoto.jpg?alt=media"
|
|
39
|
-
alt="" onerror="this.src='assets/
|
|
39
|
+
alt="" onerror="this.src='assets/img/default-avatar-x-select.png'">
|
|
40
40
|
|
|
41
41
|
<!-- ---------------------------------------- -->
|
|
42
42
|
<!-- Usecase Native -->
|
|
@@ -44,11 +44,11 @@
|
|
|
44
44
|
<img *ngIf="item.requestertype === 'agent' && !UPLOAD_ENGINE_IS_FIREBASE" height="24" width="24"
|
|
45
45
|
style="border-radius:50%;object-fit: cover;vertical-align: middle;"
|
|
46
46
|
src="{{baseUrl}}images?path=uploads%2Fusers%2F{{item.id}}%2Fimages%2Fthumbnails_200_200-photo.jpg" alt=""
|
|
47
|
-
onerror="this.src='assets/
|
|
47
|
+
onerror="this.src='assets/img/default-avatar-x-select.png'">
|
|
48
48
|
|
|
49
49
|
<img *ngIf="item.requestertype === 'lead'" height="24" width="24"
|
|
50
50
|
style="border-radius:50%;object-fit: cover;vertical-align: middle;"
|
|
51
|
-
src="assets/
|
|
51
|
+
src="assets/img/default-avatar-x-select.png" alt="">
|
|
52
52
|
<span style="font-weight: 400;">
|
|
53
53
|
{{ item.name }}
|
|
54
54
|
</span>
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
<img *ngIf="item.requestertype === 'agent' && UPLOAD_ENGINE_IS_FIREBASE" height="24" width="24"
|
|
65
65
|
style="border-radius:50%;object-fit: cover;vertical-align: middle;"
|
|
66
66
|
src="https://firebasestorage.googleapis.com/v0/b/{{storageBucket}}/o/profiles%2F{{item.id}}%2Fphoto.jpg?alt=media"
|
|
67
|
-
alt="" onerror="this.src='assets/
|
|
67
|
+
alt="" onerror="this.src='assets/img/default-avatar-x-select.png'">
|
|
68
68
|
|
|
69
69
|
<!-- ---------------------------------------- -->
|
|
70
70
|
<!-- Usecase Native -->
|
|
@@ -72,11 +72,11 @@
|
|
|
72
72
|
<img *ngIf="item.requestertype === 'agent' && !UPLOAD_ENGINE_IS_FIREBASE" height="24" width="24"
|
|
73
73
|
style="border-radius:50%;object-fit: cover;vertical-align: middle;"
|
|
74
74
|
src="{{baseUrl}}images?path=uploads%2Fusers%2F{{item.id}}%2Fimages%2Fthumbnails_200_200-photo.jpg" alt=""
|
|
75
|
-
onerror="this.src='assets/
|
|
75
|
+
onerror="this.src='assets/img/default-avatar-x-select.png'">
|
|
76
76
|
|
|
77
77
|
<img *ngIf="item.requestertype === 'lead'" height="24" width="24"
|
|
78
78
|
style="border-radius:50%; object-fit: cover;vertical-align: middle;"
|
|
79
|
-
src="assets/
|
|
79
|
+
src="assets/img/default-avatar-x-select.png" alt="">
|
|
80
80
|
<span style="font-weight: 400;">
|
|
81
81
|
{{ item.name }}
|
|
82
82
|
</span>
|
|
@@ -43,22 +43,22 @@ export class CreateTicketPage implements OnInit {
|
|
|
43
43
|
{
|
|
44
44
|
id: 1,
|
|
45
45
|
name: 'urgent',
|
|
46
|
-
avatar: 'assets/
|
|
46
|
+
avatar: 'assets/img/priority_icons/urgent_v2.svg'
|
|
47
47
|
},
|
|
48
48
|
{
|
|
49
49
|
id: 2,
|
|
50
50
|
name: 'high',
|
|
51
|
-
avatar: 'assets/
|
|
51
|
+
avatar: 'assets/img/priority_icons/high_v2.svg '
|
|
52
52
|
},
|
|
53
53
|
{
|
|
54
54
|
id: 3,
|
|
55
55
|
name: 'medium',
|
|
56
|
-
avatar: 'assets/
|
|
56
|
+
avatar: 'assets/img/priority_icons/medium_v2.svg'
|
|
57
57
|
},
|
|
58
58
|
{
|
|
59
59
|
id: 4,
|
|
60
60
|
name: 'low',
|
|
61
|
-
avatar: 'assets/
|
|
61
|
+
avatar: 'assets/img/priority_icons/low_v2.svg'
|
|
62
62
|
},
|
|
63
63
|
];
|
|
64
64
|
|
|
@@ -156,7 +156,7 @@ export class LoaderPreviewPage implements OnInit, AfterViewInit {
|
|
|
156
156
|
}
|
|
157
157
|
// file-alt-solid.png
|
|
158
158
|
async createFile() {
|
|
159
|
-
let response = await fetch('./assets/
|
|
159
|
+
let response = await fetch('./assets/img/file-alt-solid.png')
|
|
160
160
|
let data = await response.blob()
|
|
161
161
|
let metadata = {
|
|
162
162
|
type: 'image/png',
|
|
@@ -106,7 +106,7 @@ ion-footer {
|
|
|
106
106
|
width: 100%;
|
|
107
107
|
min-height: 200px;
|
|
108
108
|
//background-image: url(https://user-images.githubusercontent.com/15075759/28719144-86dc0f70-73b1-11e7-911d-60d70fcded21.png);
|
|
109
|
-
background-image: url(../../../assets/
|
|
109
|
+
background-image: url(../../../assets/img/whatsapp_background.png);
|
|
110
110
|
border-radius: 8px;
|
|
111
111
|
background-size: cover;
|
|
112
112
|
display: flex;
|
|
@@ -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>
|