@chat21/chat21-ionic 3.4.31 → 3.4.32-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 +167 -2
- package/angular.json +1 -0
- package/package.json +1 -1
- package/src/app/app.component.html +3 -1
- package/src/app/app.component.ts +72 -11
- package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.html +14 -2
- package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.scss +39 -2
- package/src/app/chatlib/list-conversations-component/list-conversations.module.ts +14 -0
- package/src/app/components/canned-response/canned-response.component.html +26 -23
- package/src/app/components/canned-response/canned-response.component.scss +0 -2
- package/src/app/components/canned-response/canned-response.component.ts +3 -1
- package/src/app/components/conversation-detail/message-text-area/message-text-area.component.html +24 -1
- 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 +29 -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/navbar/navbar.component.html +35 -9
- package/src/app/components/navbar/navbar.component.scss +71 -1
- package/src/app/components/navbar/navbar.component.ts +100 -42
- package/src/app/components/project-item/project-item.component.ts +79 -52
- package/src/app/components/sidebar/sidebar.component.html +65 -45
- package/src/app/components/sidebar/sidebar.component.ts +110 -117
- package/src/app/components/sidebar-user-details/sidebar-user-details.component.html +52 -11
- package/src/app/components/sidebar-user-details/sidebar-user-details.component.scss +304 -17
- package/src/app/components/sidebar-user-details/sidebar-user-details.component.ts +217 -27
- package/src/app/modals/create-ticket/create-ticket.page.ts +4 -2
- package/src/app/pages/conversation-detail/conversation-detail.page.html +7 -3
- package/src/app/pages/conversation-detail/conversation-detail.page.ts +89 -5
- package/src/app/pages/conversations-list/conversations-list.module.ts +3 -5
- package/src/app/pages/conversations-list/conversations-list.page.html +2 -0
- package/src/app/pages/conversations-list/conversations-list.page.ts +120 -26
- package/src/app/pages/unassigned-conversations/unassigned-conversations.module.ts +16 -4
- package/src/app/pages/unassigned-conversations/unassigned-conversations.page.html +43 -17
- package/src/app/pages/unassigned-conversations/unassigned-conversations.page.scss +25 -1
- package/src/app/pages/unassigned-conversations/unassigned-conversations.page.ts +279 -13
- package/src/app/pipe/filter.pipe.spec.ts +8 -0
- package/src/app/pipe/filter.pipe.ts +15 -0
- package/src/app/pipe/find.pipe.spec.ts +8 -0
- package/src/app/pipe/find.pipe.ts +15 -0
- package/src/app/services/global-settings/global-settings.service.ts +11 -3
- package/src/app/services/nav-proxy.service.ts +0 -1
- package/src/app/services/project_users/project-users.service.spec.ts +16 -0
- package/src/app/services/project_users/project-users.service.ts +63 -0
- package/src/app/services/projects/project.service.ts +2 -1
- package/src/app/services/tiledesk/tiledesk.service.ts +24 -0
- package/src/app/services/triggerEvents/triggerEvents.ts +40 -0
- package/src/app/services/websocket/websocket-js.ts +59 -534
- package/src/app/services/websocket/websocket-js_old.ts +578 -0
- package/src/app/services/websocket/websocket.service.ts +67 -14
- package/src/app/services/websocket/websocket.worker.ts +242 -0
- package/src/app/shared/shared.module.ts +26 -10
- package/src/app/utils/globals.ts +2 -0
- package/src/app/utils/permissions.constants.ts +138 -0
- package/src/app/utils/project-utils.ts +2 -2
- package/src/app/utils/utils.ts +18 -1
- 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/assets/js/chat21client.js +36 -0
- package/src/assets/js/mqtt-keepalive-worker.js +53 -0
- package/src/assets/test.html +5 -2
- package/src/chat-config-template.json +1 -0
- package/src/chat-config.json +1 -0
- package/src/chat21-core/models/projectUsers.ts +19 -0
- package/src/chat21-core/models/project_user.ts +2 -1
- package/src/chat21-core/models/projects.ts +1 -0
- package/src/chat21-core/providers/firebase/firebase-conversation-handler.ts +1 -1
- package/src/chat21-core/providers/mqtt/mqtt-conversation-handler.ts +1 -1
- package/src/chat21-core/providers/tiledesk/tiledesk-auth.service.ts +3 -0
- package/src/chat21-core/utils/constants.ts +6 -0
- package/src/chat21-core/utils/convertRequestToConversation.ts +2 -2
- package/src/chat21-core/utils/utils.ts +53 -3
- package/src/variables.scss +3 -0
|
@@ -116,6 +116,7 @@ export const PLATFORM_DESKTOP = 'desktop';
|
|
|
116
116
|
|
|
117
117
|
// STORAGE
|
|
118
118
|
export const STORAGE_PREFIX = 'tiledesk_widget_';
|
|
119
|
+
export const PROJECTS_STORAGE_KEY = 'all_projects';
|
|
119
120
|
|
|
120
121
|
// links
|
|
121
122
|
export const FIREBASESTORAGE_BASE_URL_IMAGE = 'https://firebasestorage.googleapis.com/v0/b/' //+ 'chat-v2-dev.appspot.com/o/';
|
|
@@ -148,5 +149,10 @@ export enum PLAN_NAME {
|
|
|
148
149
|
|
|
149
150
|
export const tranlatedLanguage = ['it', 'en', 'de', 'es', 'pt', 'fr', 'ru', 'tr', 'sr', 'ar', 'uk', 'sv', 'az', 'kk', 'uz']
|
|
150
151
|
|
|
152
|
+
export const TEAMMATE_STATUS = [
|
|
153
|
+
{ id: 1, name: 'Available', avatar: 'assets/img/teammate-status/avaible.svg', label: "LABEL_AVAILABLE" },
|
|
154
|
+
{ id: 2, name: 'Unavailable', avatar: 'assets/img/teammate-status/unavaible.svg', label: "LABEL_NOT_AVAILABLE" },
|
|
155
|
+
{ id: 3, name: 'Inactive', avatar: 'assets/img/teammate-status/inactive.svg', label: "LABEL_INACTIVE" },
|
|
156
|
+
];
|
|
151
157
|
|
|
152
158
|
|
|
@@ -29,8 +29,8 @@ export class ConvertRequestToConversation {
|
|
|
29
29
|
request.requester_id,
|
|
30
30
|
'',
|
|
31
31
|
request.lead && request.lead.fullname ? request.lead.fullname: null,
|
|
32
|
-
'0',
|
|
33
|
-
moment(request.createdAt).
|
|
32
|
+
request.status || '0',
|
|
33
|
+
moment(request.createdAt).valueOf(),
|
|
34
34
|
getColorBck(request.lead.fullname),
|
|
35
35
|
avatarPlaceholder(request.lead.fullname),
|
|
36
36
|
false,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import * as moment from 'moment/moment';
|
|
3
3
|
// import * as moment from 'moment-timezone';
|
|
4
4
|
import 'moment/locale/it.js';
|
|
5
|
-
import { CHANNEL_TYPE } from './constants';
|
|
5
|
+
import { CHANNEL_TYPE, TEAMMATE_STATUS } from './constants';
|
|
6
6
|
|
|
7
7
|
import { HttpClient } from '@angular/common/http';
|
|
8
8
|
import { TranslateHttpLoader } from '@ngx-translate/http-loader';
|
|
@@ -765,6 +765,12 @@ export function isOnMobileDevice() {
|
|
|
765
765
|
return IS_ON_MOBILE_DEVICE;
|
|
766
766
|
}
|
|
767
767
|
|
|
768
|
+
|
|
769
|
+
export function checkIfIsInIframe(){
|
|
770
|
+
const isInIframe = window.self !== window.top;
|
|
771
|
+
return isInIframe;
|
|
772
|
+
}
|
|
773
|
+
|
|
768
774
|
export function checkWindowWidthIsLessThan991px() {
|
|
769
775
|
// console.log('UTILS - checkWindowWidthIsLessThan991px:: ', window.innerWidth);
|
|
770
776
|
if (window.innerWidth < 991) {
|
|
@@ -1018,6 +1024,50 @@ export function isAllowedUrlInText(text: string, allowedUrls: string[]) {
|
|
|
1018
1024
|
}
|
|
1019
1025
|
|
|
1020
1026
|
function extractUrls(text: string): string[] {
|
|
1021
|
-
|
|
1022
|
-
|
|
1027
|
+
// Rileva URL con o senza protocollo (http/https)
|
|
1028
|
+
const urlRegex = /\b((https?:\/\/)?(www\.)?[a-z0-9.-]+\.[a-z]{2,})(\/[^\s]*)?/gi;
|
|
1029
|
+
const matches = text.match(urlRegex) || [];
|
|
1030
|
+
// Normalizza: aggiunge https:// se manca, così il parsing con new URL() funziona
|
|
1031
|
+
return matches.map((url) => {
|
|
1032
|
+
if (!/^https?:\/\//i.test(url)) {
|
|
1033
|
+
return 'https://' + url;
|
|
1034
|
+
}
|
|
1035
|
+
return url;
|
|
1036
|
+
});
|
|
1037
|
+
}
|
|
1038
|
+
|
|
1039
|
+
/**
|
|
1040
|
+
* Restituisce lo status dell'utente nel contesto di un project.
|
|
1041
|
+
* Basato su user_available e profileStatus dell'oggetto projectUser.
|
|
1042
|
+
*
|
|
1043
|
+
* @param projectUser - Oggetto con user_available e profileStatus (es. ProjectUser dal websocket)
|
|
1044
|
+
* @returns Oggetto da TEAMMATE_STATUS (Available, Unavailable, Inactive) o null se i dati non sono sufficienti
|
|
1045
|
+
*/
|
|
1046
|
+
export function getUserStatusFromProjectUser(projectUser: {
|
|
1047
|
+
user_available?: boolean;
|
|
1048
|
+
profileStatus?: string;
|
|
1049
|
+
}): typeof TEAMMATE_STATUS[number] | null {
|
|
1050
|
+
if (!projectUser) {
|
|
1051
|
+
return null;
|
|
1052
|
+
}
|
|
1053
|
+
|
|
1054
|
+
if (projectUser.user_available === false && projectUser.profileStatus === 'inactive') {
|
|
1055
|
+
return TEAMMATE_STATUS[2]; // Inactive
|
|
1056
|
+
}
|
|
1057
|
+
if (projectUser.user_available === false && (!projectUser.profileStatus || projectUser.profileStatus === '')) {
|
|
1058
|
+
return TEAMMATE_STATUS[1]; // Unavailable
|
|
1059
|
+
}
|
|
1060
|
+
if (projectUser.user_available === true && (!projectUser.profileStatus || projectUser.profileStatus === '')) {
|
|
1061
|
+
return TEAMMATE_STATUS[0]; // Available
|
|
1062
|
+
}
|
|
1063
|
+
|
|
1064
|
+
// Fallback per casi non esplicitamente gestiti
|
|
1065
|
+
if (projectUser.user_available === true) {
|
|
1066
|
+
return TEAMMATE_STATUS[0];
|
|
1067
|
+
}
|
|
1068
|
+
if (projectUser.user_available === false) {
|
|
1069
|
+
return TEAMMATE_STATUS[1];
|
|
1070
|
+
}
|
|
1071
|
+
|
|
1072
|
+
return null;
|
|
1023
1073
|
}
|
package/src/variables.scss
CHANGED
|
@@ -44,6 +44,9 @@ body {
|
|
|
44
44
|
--last-message-color: rgb(60, 72, 88);
|
|
45
45
|
|
|
46
46
|
--contact-directory-searchbar-background: rgba(0, 0, 0, 0.05);
|
|
47
|
+
|
|
48
|
+
--join-button-background: var(--basic-blue);
|
|
49
|
+
--resolve-button-background: #e4e6eb;
|
|
47
50
|
// ***** Conversation-list: end ***** //
|
|
48
51
|
|
|
49
52
|
// ***** Conversation-detail: start ***** //
|