@chat21/chat21-ionic 3.0.60-rc2 → 3.0.60
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 +39 -0
- package/LICENSE +661 -21
- package/deploy_pre.sh +45 -6
- package/deploy_prod.sh +34 -9
- package/env.sample +1 -1
- package/package.json +1 -1
- package/src/app/app.component.ts +45 -21
- package/src/app/app.module.ts +2 -2
- package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.ts +62 -36
- package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.ts +42 -13
- package/src/app/components/conversation-detail/message-text-area/message-text-area.component.html +13 -6
- package/src/app/components/conversation-detail/message-text-area/message-text-area.component.scss +38 -3
- package/src/app/components/conversation-detail/message-text-area/message-text-area.component.ts +8 -6
- package/src/app/components/image-viewer/image-viewer.component.scss +2 -2
- package/src/app/components/project-item/project-item.component.html +140 -118
- package/src/app/components/project-item/project-item.component.scss +167 -90
- package/src/app/components/project-item/project-item.component.ts +41 -20
- package/src/app/pages/conversation-detail/conversation-detail.module.ts +2 -1
- package/src/app/pages/conversation-detail/conversation-detail.page.html +36 -43
- package/src/app/pages/conversation-detail/conversation-detail.page.ts +199 -110
- package/src/app/pages/conversations-list/conversations-list.page.html +9 -5
- package/src/app/pages/conversations-list/conversations-list.page.scss +12 -1
- package/src/app/pages/conversations-list/conversations-list.page.ts +24 -6
- package/src/app/pages/unassigned-conversations/unassigned-conversations.page.html +16 -11
- package/src/app/pages/unassigned-conversations/unassigned-conversations.page.scss +157 -63
- package/src/app/pages/unassigned-conversations/unassigned-conversations.page.ts +51 -16
- package/src/app/shared/shared.module.ts +6 -5
- package/src/assets/i18n/de.json +209 -0
- package/src/assets/i18n/en.json +24 -8
- package/src/assets/i18n/es.json +209 -0
- package/src/assets/i18n/fr.json +209 -0
- package/src/assets/i18n/it.json +42 -34
- package/src/assets/i18n/pt.json +209 -0
- package/src/assets/i18n/ru.json +209 -0
- package/src/assets/i18n/tr.json +209 -0
- package/src/assets/js/chat21client.js +16 -3
- package/src/chat-config-mqtt.json +2 -1
- package/src/chat-config-pre-test.json +2 -0
- package/src/chat-config-template.json +1 -0
- package/src/chat-config.json +1 -0
- package/src/chat21-core/providers/firebase/firebase-conversation-handler.ts +54 -43
- package/src/chat21-core/providers/firebase/firebase-conversations-handler.ts +23 -0
- package/src/chat21-core/providers/mqtt/mqtt-archivedconversations-handler.ts +1 -1
- package/src/chat21-core/utils/constants.ts +2 -0
- package/src/chat21-core/utils/utils.ts +12 -1
- package/src/global.scss +4 -0
|
@@ -18,6 +18,7 @@ import { AppConfigProvider } from 'src/app/services/app-config';
|
|
|
18
18
|
})
|
|
19
19
|
export class ProjectItemComponent implements OnInit {
|
|
20
20
|
@Output() projectIdEvent = new EventEmitter<string>()
|
|
21
|
+
@Output() openUnsevedConvsEvent = new EventEmitter<any>()
|
|
21
22
|
|
|
22
23
|
private unsubscribe$: Subject<any> = new Subject<any>();
|
|
23
24
|
project: any;
|
|
@@ -31,6 +32,16 @@ export class ProjectItemComponent implements OnInit {
|
|
|
31
32
|
private logger: LoggerService = LoggerInstance.getInstance();
|
|
32
33
|
window_width_is_60: boolean;
|
|
33
34
|
newInnerWidth: any;
|
|
35
|
+
avaialble_status_for_tooltip: string;
|
|
36
|
+
tooltipOptions = {
|
|
37
|
+
'show-delay': 500,
|
|
38
|
+
'tooltip-class': 'chat-tooltip',
|
|
39
|
+
'theme': 'light',
|
|
40
|
+
'shadow': false,
|
|
41
|
+
'hide-delay-mobile': 0,
|
|
42
|
+
'hideDelayAfterClick': 3000,
|
|
43
|
+
'hide-delay': 200
|
|
44
|
+
};
|
|
34
45
|
|
|
35
46
|
constructor(
|
|
36
47
|
public wsService: WebsocketService,
|
|
@@ -51,15 +62,22 @@ export class ProjectItemComponent implements OnInit {
|
|
|
51
62
|
// console.log('[PROJECT-ITEM] - on INIT')
|
|
52
63
|
}
|
|
53
64
|
|
|
65
|
+
openUnservedConvs() {
|
|
66
|
+
this.openUnsevedConvsEvent.emit('notificationsorprjctbtn')
|
|
67
|
+
}
|
|
68
|
+
openUnservedConvsAndGoToProjectList() {
|
|
69
|
+
this.openUnsevedConvsEvent.emit('pinbtn')
|
|
70
|
+
}
|
|
71
|
+
|
|
54
72
|
getStoredTokenAndConnectWS() {
|
|
55
73
|
this.tiledeskToken = this.appStorageService.getItem('tiledeskToken');
|
|
56
74
|
this.logger.log('[PROJECT-ITEM] - STORED TILEDEK TOKEN ', this.tiledeskToken)
|
|
57
|
-
this.connetWebsocket(
|
|
75
|
+
this.connetWebsocket(this.tiledeskToken)
|
|
58
76
|
}
|
|
59
77
|
|
|
60
78
|
connetWebsocket(tiledeskToken) {
|
|
61
|
-
|
|
62
|
-
this.logger.log('[WEBSOCKET-JS] connetWebsocket called in [PROJECT-ITEM] tiledeskToken ',tiledeskToken)
|
|
79
|
+
|
|
80
|
+
this.logger.log('[WEBSOCKET-JS] connetWebsocket called in [PROJECT-ITEM] tiledeskToken ', tiledeskToken)
|
|
63
81
|
const appconfig = this.appConfigProvider.getConfig();
|
|
64
82
|
this.logger.log('[WEBSOCKET-JS] connetWebsocket called in [PROJECT-ITEM] wsUrl ', appconfig.wsUrl)
|
|
65
83
|
const WS_URL = appconfig.wsUrl + '?token=' + tiledeskToken
|
|
@@ -78,25 +96,33 @@ export class ProjectItemComponent implements OnInit {
|
|
|
78
96
|
window.addEventListener("message", (event) => {
|
|
79
97
|
// console.log("[PROJECT-ITEM] post message event ", event);
|
|
80
98
|
|
|
81
|
-
if (event && event.data
|
|
99
|
+
if (event && event.data) {
|
|
82
100
|
// console.log("[PROJECT-ITEM] message event data ", event.data);
|
|
83
101
|
if (event.data === 'hasChangedProject') {
|
|
84
102
|
this.unservedRequestCount = 0;
|
|
85
103
|
if (this.project) {
|
|
86
|
-
this.webSocketJs.unsubscribe('/' + this.project.id_project._id + '/requests');
|
|
104
|
+
this.webSocketJs.unsubscribe('/' + this.project.id_project._id + '/requests');
|
|
87
105
|
}
|
|
88
106
|
this.getLastProjectStoredAndSubscToWSAvailabilityAndConversations();
|
|
89
|
-
|
|
90
107
|
}
|
|
91
108
|
}
|
|
92
109
|
})
|
|
93
110
|
}
|
|
94
111
|
|
|
112
|
+
|
|
95
113
|
public translations() {
|
|
96
114
|
const keys = [
|
|
97
115
|
'Available',
|
|
98
116
|
'Unavailable',
|
|
99
|
-
'Busy'
|
|
117
|
+
'Busy',
|
|
118
|
+
'VIEW_ALL_CONVERSATIONS',
|
|
119
|
+
'CONVERSATIONS_IN_QUEUE',
|
|
120
|
+
'CONVERSATION_IN_QUEUE',
|
|
121
|
+
'NO_CONVERSATION_IN_QUEUE',
|
|
122
|
+
'PINNED_PROJECT',
|
|
123
|
+
'CHANGE_PINNED_PROJECT',
|
|
124
|
+
"CHANGE_TO_YOUR_STATUS_TO_AVAILABLE",
|
|
125
|
+
"CHANGE_TO_YOUR_STATUS_TO_UNAVAILABLE"
|
|
100
126
|
];
|
|
101
127
|
this.translationMap = this.translateService.translateLanguage(keys);
|
|
102
128
|
}
|
|
@@ -117,19 +143,8 @@ export class ProjectItemComponent implements OnInit {
|
|
|
117
143
|
const actualWidth = window.innerWidth;
|
|
118
144
|
this.logger.log('[PROJECT-ITEM] - ACTUAL Width ', actualWidth);
|
|
119
145
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
// if (actualWidth <= 150) {
|
|
123
|
-
// this.window_width_is_60 = true;
|
|
124
|
-
// } else {
|
|
125
|
-
// this.window_width_is_60 = false;
|
|
126
|
-
// }
|
|
127
146
|
}
|
|
128
147
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
148
|
getStoredCurrenUser() {
|
|
134
149
|
const storedCurrentUser = this.appStorageService.getItem('currentUser');
|
|
135
150
|
this.logger.log('[PROJECT-ITEM] - STORED CURRENT USER ', storedCurrentUser)
|
|
@@ -195,7 +210,6 @@ export class ProjectItemComponent implements OnInit {
|
|
|
195
210
|
this.logger.log('[PROJECT-ITEM] - user_role ', user_role)
|
|
196
211
|
this.projectIdEvent.emit(project.id_project._id)
|
|
197
212
|
|
|
198
|
-
|
|
199
213
|
if (user_role === 'agent') {
|
|
200
214
|
this.ROLE_IS_AGENT = true;
|
|
201
215
|
|
|
@@ -226,6 +240,13 @@ export class ProjectItemComponent implements OnInit {
|
|
|
226
240
|
if (project.id_project._id === projectUser['id_project']) {
|
|
227
241
|
project['ws_projct_user_available'] = projectUser['user_available'];
|
|
228
242
|
project['ws_projct_user_isBusy'] = projectUser['isBusy']
|
|
243
|
+
if (this.translationMap) {
|
|
244
|
+
if (projectUser['user_available'] === true) {
|
|
245
|
+
this.avaialble_status_for_tooltip = this.translationMap.get('CHANGE_TO_YOUR_STATUS_TO_UNAVAILABLE')
|
|
246
|
+
} else {
|
|
247
|
+
this.avaialble_status_for_tooltip = this.translationMap.get('CHANGE_TO_YOUR_STATUS_TO_AVAILABLE')
|
|
248
|
+
}
|
|
249
|
+
}
|
|
229
250
|
}
|
|
230
251
|
|
|
231
252
|
}, (error) => {
|
|
@@ -275,7 +296,7 @@ export class ProjectItemComponent implements OnInit {
|
|
|
275
296
|
// this.logger.log('NAVBAR - UPDATE-UNSERVED-REQUEST-COUNT request agents', r.agents)
|
|
276
297
|
// *bug fix: when the user is an agent also for the unserved we have to consider if he is present in agents
|
|
277
298
|
// && this.ROLE_IS_AGENT === true
|
|
278
|
-
if (r['status'] === 100
|
|
299
|
+
if (r['status'] === 100) {
|
|
279
300
|
if (this.hasmeInAgents(r['agents']) === true) {
|
|
280
301
|
count = count + 1;
|
|
281
302
|
}
|
|
@@ -40,6 +40,7 @@ import { NgxLinkifyjsModule } from 'ngx-linkifyjs';
|
|
|
40
40
|
CommonModule,
|
|
41
41
|
FormsModule,
|
|
42
42
|
IonicModule,
|
|
43
|
+
TooltipModule,
|
|
43
44
|
ConversationDetailPageRoutingModule,
|
|
44
45
|
TranslateModule.forChild({
|
|
45
46
|
loader: {
|
|
@@ -56,7 +57,7 @@ import { NgxLinkifyjsModule } from 'ngx-linkifyjs';
|
|
|
56
57
|
declarations: [
|
|
57
58
|
ConversationDetailPage,
|
|
58
59
|
HeaderConversationDetailComponent,
|
|
59
|
-
|
|
60
|
+
MessageTextAreaComponent,
|
|
60
61
|
// BubbleDayMessageComponent,
|
|
61
62
|
// BubbleSystemMessageComponent,
|
|
62
63
|
// BubbleMyMessageComponent,
|
|
@@ -9,12 +9,21 @@
|
|
|
9
9
|
|
|
10
10
|
<ion-grid style="height: 100%;">
|
|
11
11
|
<ion-row class="ion-justify-content-center ion-align-items-center" style="height: 100%; flex-direction: column">
|
|
12
|
-
<span *ngIf="isOnline === true"
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
<span *ngIf="isOnline === true && !showSpinner" style="color: #92949c; font-size: 16px;line-height: 18px;margin-top: -160px;">
|
|
13
|
+
<span *ngIf="conversation_count > 0 ">
|
|
14
|
+
{{'PleaseSelectChatToStartMessaging' | translate }}
|
|
15
|
+
</span>
|
|
16
|
+
<span *ngIf="conversation_count === 0" style="line-height: 1.2;color: #4b5258;
|
|
17
|
+
font-weight: 500;">
|
|
18
|
+
{{'ALL_CONVS_SERVED' | translate}}
|
|
15
19
|
|
|
16
|
-
|
|
17
|
-
|
|
20
|
+
</span>
|
|
21
|
+
|
|
22
|
+
</span>
|
|
23
|
+
|
|
24
|
+
<span *ngIf="isOnline === false"
|
|
25
|
+
style="color: #92949c; font-size: 16px;line-height: 18px;margin-top: -160px;">Internet is slow or not
|
|
26
|
+
working</span>
|
|
18
27
|
</ion-row>
|
|
19
28
|
</ion-grid>
|
|
20
29
|
</ion-content>
|
|
@@ -22,11 +31,8 @@
|
|
|
22
31
|
|
|
23
32
|
<ng-template #showConversation>
|
|
24
33
|
|
|
25
|
-
<app-header-conversation-detail
|
|
26
|
-
[
|
|
27
|
-
[idLoggedUser]="loggedUser.uid"
|
|
28
|
-
[conversationAvatar]="conversationAvatar"
|
|
29
|
-
[translationMap]="translationMap"
|
|
34
|
+
<app-header-conversation-detail [isMobile]="isMobile" [idLoggedUser]="loggedUser.uid"
|
|
35
|
+
[conversationAvatar]="conversationAvatar" [translationMap]="translationMap"
|
|
30
36
|
(eventOpenCloseInfoConversation)="returnOpenCloseInfoConversation($event)"
|
|
31
37
|
[isOpenInfoConversation]="isOpenInfoConversation">
|
|
32
38
|
</app-header-conversation-detail>
|
|
@@ -48,7 +54,7 @@
|
|
|
48
54
|
<!-- <div class="messageFirst">
|
|
49
55
|
{{ 'LABEL_NO_MSG_HERE' | translate }}
|
|
50
56
|
</div> -->
|
|
51
|
-
|
|
57
|
+
|
|
52
58
|
<ion-grid style="height: 100%" [ngClass]="{'is-in-drop-event': isHovering === true}" (drop)="drop($event)"
|
|
53
59
|
(dragover)="allowDrop($event)" (dragleave)="drag($event)">
|
|
54
60
|
<ion-row class="ion-justify-content-center ion-align-items-center" *ngIf="isHovering === false"
|
|
@@ -85,15 +91,10 @@
|
|
|
85
91
|
</ng-template>
|
|
86
92
|
|
|
87
93
|
<ng-template #content_messages>
|
|
88
|
-
<ion-content #ionContentChatArea class="ionContentChatArea"
|
|
89
|
-
(
|
|
90
|
-
(
|
|
91
|
-
(
|
|
92
|
-
[scrollEvents]="true"
|
|
93
|
-
(ionScrollStart)="logScrollStart($event)"
|
|
94
|
-
(ionScroll)="logScrolling($event)"
|
|
95
|
-
(ionScrollEnd)="logScrollEnd($event)"
|
|
96
|
-
[class.active]="showIonContent">
|
|
94
|
+
<ion-content #ionContentChatArea class="ionContentChatArea" (drop)="drop($event)"
|
|
95
|
+
(dragover)="allowDrop($event)" (dragleave)="drag($event)" [scrollEvents]="true"
|
|
96
|
+
(ionScrollStart)="logScrollStart($event)" (ionScroll)="logScrolling($event)"
|
|
97
|
+
(ionScrollEnd)="logScrollEnd($event)" [class.active]="showIonContent">
|
|
97
98
|
|
|
98
99
|
<!-- ----------------------------------------------------------- -->
|
|
99
100
|
<!-- DROPZONE -->
|
|
@@ -111,16 +112,12 @@
|
|
|
111
112
|
|
|
112
113
|
|
|
113
114
|
<ion-conversation-detail *ngIf="isHovering === false" #conversationContentDetail
|
|
114
|
-
[channelType]="channelType"
|
|
115
|
-
[
|
|
116
|
-
[senderId]="loggedUser.uid"
|
|
117
|
-
[baseLocation]="window?.location?.origin"
|
|
118
|
-
[stylesMap]="styleMap"
|
|
115
|
+
[channelType]="channelType" [messages]="messages" [senderId]="loggedUser.uid"
|
|
116
|
+
[baseLocation]="window?.location?.origin" [stylesMap]="styleMap"
|
|
119
117
|
(onBeforeMessageRender)="returnOnBeforeMessageRender($event)"
|
|
120
118
|
(onAfterMessageRender)="returnOnAfterMessageRender($event)"
|
|
121
119
|
(onAttachmentButtonClicked)="returnOnAttachmentButtonClicked($event)"
|
|
122
|
-
(onScrollContent)="returnOnScrollContent($event)"
|
|
123
|
-
(onMenuOptionShow)="returnOnMenuOption($event)"
|
|
120
|
+
(onScrollContent)="returnOnScrollContent($event)" (onMenuOptionShow)="returnOnMenuOption($event)"
|
|
124
121
|
(onImageRendered)="onImageRenderedFN($event)"
|
|
125
122
|
(onAddUploadingBubble)="addUploadingBubbleEvent($event)">
|
|
126
123
|
</ion-conversation-detail>
|
|
@@ -139,7 +136,7 @@
|
|
|
139
136
|
<!-- ----------------------------------------------------------- -->
|
|
140
137
|
<!-- Canned responses -->
|
|
141
138
|
<!-- ----------------------------------------------------------- -->
|
|
142
|
-
|
|
139
|
+
|
|
143
140
|
<div id="canned" *ngIf="tagsCannedFilter.length > 0 && HIDE_CANNED_RESPONSES === false">
|
|
144
141
|
<ion-list class="canned-list">
|
|
145
142
|
<ion-item button="true" [ngClass]="{'is_active_item': i == arrowkeyLocation}" lines="none"
|
|
@@ -149,22 +146,22 @@
|
|
|
149
146
|
</ion-item>
|
|
150
147
|
</ion-list>
|
|
151
148
|
</div>
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
|
|
152
153
|
<!-- (eventReplaceMessageWithCanned)="replaceTagInMessage($event)" -->
|
|
153
154
|
<!-- [tagsCannedFilter]="tagsCannedFilter" -->
|
|
154
155
|
<!-- openInfoConversation {{openInfoConversation}} - isMobile {{isMobile}} -->
|
|
155
156
|
<app-message-text-area
|
|
156
157
|
*ngIf="(openInfoConversation === false && isMobile === true) || (openInfoConversation === true && isMobile === false) || (openInfoConversation === false && isMobile === false)"
|
|
157
|
-
|
|
158
|
-
[
|
|
159
|
-
|
|
160
|
-
[tagsCannedFilter]="tagsCannedFilter"
|
|
161
|
-
(eventChangeTextArea)="returnChangeTextArea($event)"
|
|
158
|
+
[tagsCannedCount]="tagsCannedCount" [areVisibleCAR]="areVisibleCAR" [loggedUser]="loggedUser"
|
|
159
|
+
[conversationWith]="conversationWith" [tagsCannedFilter]="tagsCannedFilter"
|
|
160
|
+
(eventChangeTextArea)="returnChangeTextArea($event)"
|
|
162
161
|
(hasClickedOpenCannedResponses)="hasClickedOpenCannedResponses($event)"
|
|
163
|
-
(eventSendMessage)="returnSendMessage($event)"
|
|
164
|
-
[translationMap]="translationMap"
|
|
162
|
+
(eventSendMessage)="returnSendMessage($event)" [translationMap]="translationMap"
|
|
165
163
|
[fileUploadAccept]="appConfigProvider.getConfig().fileUploadAccept"
|
|
166
|
-
[isOpenInfoConversation]="isOpenInfoConversation"
|
|
167
|
-
[dropEvent]="dropEvent"
|
|
164
|
+
[isOpenInfoConversation]="isOpenInfoConversation" [dropEvent]="dropEvent"
|
|
168
165
|
(onPresentModalScrollToBottom)="onPresentModalScrollToBottom($event)">
|
|
169
166
|
</app-message-text-area>
|
|
170
167
|
<!-- [events]="eventsReplaceTexareaText.asObservable()" -->
|
|
@@ -173,12 +170,8 @@
|
|
|
173
170
|
</ion-col>
|
|
174
171
|
|
|
175
172
|
<ion-col id="chat21-info-conversation" [class.mobile]="isMobile" [class.open]="openInfoConversation">
|
|
176
|
-
<app-info-content
|
|
177
|
-
[
|
|
178
|
-
[translationMap]="translationMap"
|
|
179
|
-
[loggedUser]="loggedUser"
|
|
180
|
-
[tenant]="tenant"
|
|
181
|
-
[groupDetail]="groupDetail">
|
|
173
|
+
<app-info-content [openInfoConversation]="openInfoConversation" [translationMap]="translationMap"
|
|
174
|
+
[loggedUser]="loggedUser" [tenant]="tenant" [groupDetail]="groupDetail">
|
|
182
175
|
</app-info-content>
|
|
183
176
|
</ion-col>
|
|
184
177
|
|