@chat21/chat21-ionic 3.0.61-rc8 → 3.0.62
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 +81 -0
- package/README.md +6 -0
- package/angular.json +2 -0
- package/config.xml +0 -1
- package/deploy_pre.sh +1 -1
- package/deploy_prod.sh +1 -1
- package/env.sample +1 -1
- package/package.json +4 -4
- package/src/app/app-routing.module.ts +15 -0
- package/src/app/app.component.ts +12 -9
- package/src/app/app.module.ts +11 -3
- package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.html +36 -25
- package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.scss +160 -50
- package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.ts +108 -18
- package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.html +21 -36
- package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.scss +19 -7
- package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.ts +35 -40
- package/src/app/chatlib/conversation-detail/message/message-attachment/message-attachment.component.scss +1 -1
- package/src/app/chatlib/list-conversations-component/list-conversations/list-conversations.component.ts +13 -10
- package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.html +3 -2
- package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.scss +2 -0
- package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.ts +142 -71
- package/src/app/components/conversation-detail/message-text-area/message-text-area.component.html +57 -20
- package/src/app/components/conversation-detail/message-text-area/message-text-area.component.scss +32 -9
- package/src/app/components/conversation-detail/message-text-area/message-text-area.component.ts +98 -24
- package/src/app/components/ddp-header/ddp-header.component.html +9 -2
- package/src/app/components/ddp-header/ddp-header.component.ts +93 -18
- package/src/app/components/project-item/project-item.component.html +1 -1
- package/src/app/components/project-item/project-item.component.scss +1 -1
- package/src/app/components/project-item/project-item.component.ts +3 -3
- package/src/app/components/sidebar/sidebar.component.html +65 -52
- package/src/app/components/sidebar/sidebar.component.scss +23 -0
- package/src/app/components/sidebar/sidebar.component.ts +74 -26
- package/src/app/components/sidebar-user-details/sidebar-user-details.component.html +20 -9
- package/src/app/components/sidebar-user-details/sidebar-user-details.component.scss +30 -5
- package/src/app/components/sidebar-user-details/sidebar-user-details.component.ts +24 -8
- package/src/app/pages/conversation-detail/conversation-detail.module.ts +5 -1
- package/src/app/pages/conversation-detail/conversation-detail.page.html +19 -10
- package/src/app/pages/conversation-detail/conversation-detail.page.scss +28 -0
- package/src/app/pages/conversation-detail/conversation-detail.page.ts +229 -389
- package/src/app/pages/conversations-list/conversations-list.page.ts +646 -454
- package/src/app/pages/create-canned-response/create-canned-response-routing.module.ts +17 -0
- package/src/app/pages/create-canned-response/create-canned-response.module.ts +30 -0
- package/src/app/pages/create-canned-response/create-canned-response.page.html +150 -0
- package/src/app/pages/create-canned-response/create-canned-response.page.scss +55 -0
- package/src/app/pages/create-canned-response/create-canned-response.page.spec.ts +24 -0
- package/src/app/pages/create-canned-response/create-canned-response.page.ts +319 -0
- package/src/app/pages/create-requester/create-requester-routing.module.ts +17 -0
- package/src/app/pages/create-requester/create-requester.module.ts +28 -0
- package/src/app/pages/create-requester/create-requester.page.html +67 -0
- package/src/app/pages/create-requester/create-requester.page.scss +30 -0
- package/src/app/pages/create-requester/create-requester.page.spec.ts +24 -0
- package/src/app/pages/create-requester/create-requester.page.ts +138 -0
- package/src/app/pages/create-ticket/create-ticket-routing.module.ts +17 -0
- package/src/app/pages/create-ticket/create-ticket.module.ts +28 -0
- package/src/app/pages/create-ticket/create-ticket.page.html +171 -0
- package/src/app/pages/create-ticket/create-ticket.page.scss +52 -0
- package/src/app/pages/create-ticket/create-ticket.page.spec.ts +24 -0
- package/src/app/pages/create-ticket/create-ticket.page.ts +432 -0
- package/src/app/pages/loader-preview/loader-preview.page.ts +2 -11
- package/src/app/pages/profile-info/profile-info.page.html +2 -2
- package/src/app/pages/profile-info/profile-info.page.scss +12 -1
- package/src/app/services/tiledesk/tiledesk.service.ts +190 -0
- package/src/app/shared/shared.module.ts +1 -1
- package/src/assets/i18n/de.json +37 -1
- package/src/assets/i18n/en.json +37 -1
- package/src/assets/i18n/es.json +38 -2
- package/src/assets/i18n/fr.json +38 -2
- package/src/assets/i18n/it.json +38 -2
- package/src/assets/i18n/pt.json +38 -2
- package/src/assets/i18n/ru.json +38 -2
- package/src/assets/i18n/sr.json +38 -2
- package/src/assets/i18n/tr.json +37 -1
- package/src/assets/images/default-avatar-x-select.png +0 -0
- package/src/assets/images/priority_icons/high.svg +3 -0
- package/src/assets/images/priority_icons/high_v2.svg +14 -0
- package/src/assets/images/priority_icons/low.svg +10 -0
- package/src/assets/images/priority_icons/low_v2.svg +14 -0
- package/src/assets/images/priority_icons/medium.svg +16 -0
- package/src/assets/images/priority_icons/medium_v2.svg +11 -0
- package/src/assets/images/priority_icons/urgent.svg +4 -0
- package/src/assets/images/priority_icons/urgent_v2.svg +16 -0
- package/src/chat-config-mqtt.json +25 -16
- package/src/chat-config-pre-test.json +1 -1
- package/src/chat-config-template.json +5 -4
- package/src/chat-config.json +1 -0
- package/src/chat21-core/providers/firebase/firebase-conversation-handler.ts +8 -3
- package/src/chat21-core/utils/constants.ts +2 -0
- package/src/chat21-core/utils/utils-message.ts +19 -0
- package/src/global.scss +33 -9
|
@@ -2,29 +2,30 @@
|
|
|
2
2
|
color: lightblue;
|
|
3
3
|
}
|
|
4
4
|
|
|
5
|
-
:host .base_sent .msg_sent ::ng-deep div > div > div > chat-text > p > p
|
|
6
|
-
margin-top:12px !important;
|
|
5
|
+
:host .base_sent .msg_sent ::ng-deep div > div > div > chat-text > p > p {
|
|
6
|
+
margin-top: 12px !important;
|
|
7
7
|
// white-space: nowrap;
|
|
8
8
|
// overflow: hidden;
|
|
9
9
|
// text-overflow: ellipsis;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
:host .base_sent .msg_sent ::ng-deep > div > div > chat-image > div
|
|
12
|
+
:host .base_sent .msg_sent ::ng-deep > div > div > chat-image > div {
|
|
13
13
|
// display: none !important;
|
|
14
14
|
// border-radius: unset !important;
|
|
15
|
-
img,
|
|
15
|
+
img,
|
|
16
|
+
.loader {
|
|
16
17
|
border-top-right-radius: 6px !important;
|
|
17
18
|
border-top-left-radius: 16px !important;
|
|
18
19
|
border-bottom-left-radius: 16px !important;
|
|
19
20
|
border-bottom-right-radius: 0px;
|
|
20
21
|
}
|
|
21
|
-
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
:host .base_receive .msg_receive ::ng-deep > div > div > chat-image > div > img {
|
|
25
25
|
// display: none !important;
|
|
26
26
|
// border-radius: unset !important;
|
|
27
|
-
img,
|
|
27
|
+
img,
|
|
28
|
+
.loader {
|
|
28
29
|
border-top-left-radius: 6px !important;
|
|
29
30
|
border-top-right-radius: 16px !important;
|
|
30
31
|
border-bottom-right-radius: 16px !important;
|
|
@@ -38,9 +39,8 @@ ion-item {
|
|
|
38
39
|
--min-height: 20px;
|
|
39
40
|
--border-style: none;
|
|
40
41
|
|
|
41
|
-
.input-wrapper{
|
|
42
|
-
|
|
43
|
-
.align-center{
|
|
42
|
+
.input-wrapper {
|
|
43
|
+
.align-center {
|
|
44
44
|
display: block;
|
|
45
45
|
}
|
|
46
46
|
}
|
|
@@ -53,12 +53,12 @@ ion-item {
|
|
|
53
53
|
//opacity: 0px;
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
.msg_info_container{
|
|
56
|
+
.msg_info_container {
|
|
57
57
|
text-align: center;
|
|
58
58
|
padding: 2px 0px 2px 0px;
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
-
.message_sender_fullname{
|
|
61
|
+
.message_sender_fullname {
|
|
62
62
|
font-size: 0.7em;
|
|
63
63
|
margin: 0 0 1px 10px;
|
|
64
64
|
color: var(--gray);
|
|
@@ -72,15 +72,15 @@ ion-item {
|
|
|
72
72
|
// padding: 6px 6px 6px 6px;
|
|
73
73
|
// box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
|
|
74
74
|
// -webkit-animation: heartbeat 1.5s ease-in-out both;
|
|
75
|
-
// animation: heartbeat 1.5s ease-in-out both;
|
|
75
|
+
// animation: heartbeat 1.5s ease-in-out both;
|
|
76
76
|
}
|
|
77
|
-
|
|
77
|
+
|
|
78
78
|
/* send message */
|
|
79
79
|
.base_sent {
|
|
80
80
|
align-items: flex-end;
|
|
81
81
|
justify-content: flex-end;
|
|
82
|
-
padding: 2px 0px 4px 40px;
|
|
83
|
-
|
|
82
|
+
// padding: 2px 0px 4px 40px;
|
|
83
|
+
padding: 2px 0px 14px 40px; // edited to display the date at the bottom of the "message bubble"
|
|
84
84
|
.msg_sent {
|
|
85
85
|
background-color: var(--bobble-blue);
|
|
86
86
|
color: var(--col-msg-sent);
|
|
@@ -89,18 +89,23 @@ ion-item {
|
|
|
89
89
|
max-width: calc(100% - 70px);
|
|
90
90
|
min-width: 14px;
|
|
91
91
|
border-top-right-radius: 8px;
|
|
92
|
-
border-bottom-right-radius: 0px;
|
|
93
|
-
|
|
92
|
+
border-bottom-right-radius: 0px;
|
|
93
|
+
}
|
|
94
|
+
.emoticon {
|
|
95
|
+
background: unset !important;
|
|
96
|
+
font-size: 4em;
|
|
97
|
+
padding-bottom: 21px;
|
|
98
|
+
padding-top: 30px;
|
|
94
99
|
}
|
|
95
|
-
|
|
96
100
|
.has-metadata {
|
|
97
101
|
max-width: 100% !important;
|
|
98
102
|
}
|
|
99
103
|
}
|
|
100
|
-
|
|
104
|
+
|
|
101
105
|
/** recive message **/
|
|
102
106
|
.base_receive {
|
|
103
|
-
padding: 0px 0px 6px 0px;
|
|
107
|
+
// padding: 0px 0px 6px 0px;
|
|
108
|
+
padding: 0px 0px 15px 0px; // edited to display the date at the bottom of the "message bubble"
|
|
104
109
|
/* avatar */
|
|
105
110
|
.content-avatar {
|
|
106
111
|
position: relative;
|
|
@@ -109,7 +114,7 @@ ion-item {
|
|
|
109
114
|
height: 28px;
|
|
110
115
|
margin-right: 6px;
|
|
111
116
|
|
|
112
|
-
.profile_image{
|
|
117
|
+
.profile_image {
|
|
113
118
|
position: relative;
|
|
114
119
|
width: 25px;
|
|
115
120
|
height: 25px;
|
|
@@ -118,7 +123,7 @@ ion-item {
|
|
|
118
123
|
background-color: #ffffff;
|
|
119
124
|
border: 1px solid #e2e2e2;
|
|
120
125
|
}
|
|
121
|
-
.profile_image img{
|
|
126
|
+
.profile_image img {
|
|
122
127
|
max-width: 100%;
|
|
123
128
|
width: 100%;
|
|
124
129
|
height: 100%;
|
|
@@ -139,15 +144,19 @@ ion-item {
|
|
|
139
144
|
width: auto;
|
|
140
145
|
border-top-left-radius: 8px;
|
|
141
146
|
border-bottom-left-radius: 0px;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.emoticon {
|
|
150
|
+
background: unset !important;
|
|
151
|
+
font-size: 4em;
|
|
152
|
+
}
|
|
142
153
|
|
|
143
|
-
}
|
|
144
|
-
|
|
145
154
|
.has-metadata {
|
|
146
155
|
max-width: 100% !important;
|
|
147
156
|
}
|
|
148
157
|
}
|
|
149
158
|
|
|
150
|
-
.time{
|
|
159
|
+
.time {
|
|
151
160
|
margin-bottom: 20px;
|
|
152
161
|
}
|
|
153
162
|
|
|
@@ -158,42 +167,143 @@ ion-item {
|
|
|
158
167
|
min-height: 20px;
|
|
159
168
|
padding: 7px;
|
|
160
169
|
text-align: center;
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
.spinner > div {
|
|
164
173
|
width: 10px;
|
|
165
174
|
height: 10px;
|
|
166
175
|
background-color: rgb(255, 255, 255);
|
|
167
|
-
|
|
176
|
+
|
|
168
177
|
border-radius: 100%;
|
|
169
178
|
display: inline-block;
|
|
170
179
|
-webkit-animation: sk-bouncedelay 1.4s infinite ease-in-out both;
|
|
171
180
|
animation: sk-bouncedelay 1.4s infinite ease-in-out both;
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
.spinner .bounce1 {
|
|
175
184
|
-webkit-animation-delay: -0.32s;
|
|
176
185
|
animation-delay: -0.32s;
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
.spinner .bounce2 {
|
|
180
189
|
-webkit-animation-delay: -0.16s;
|
|
181
190
|
animation-delay: -0.16s;
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
0%,
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
transform: scale(0);
|
|
193
|
-
} 40% {
|
|
194
|
-
-webkit-transform: scale(1.0);
|
|
195
|
-
transform: scale(1.0);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
@-webkit-keyframes sk-bouncedelay {
|
|
194
|
+
0%,
|
|
195
|
+
80%,
|
|
196
|
+
100% {
|
|
197
|
+
-webkit-transform: scale(0);
|
|
198
|
+
}
|
|
199
|
+
40% {
|
|
200
|
+
-webkit-transform: scale(1);
|
|
196
201
|
}
|
|
197
|
-
|
|
202
|
+
}
|
|
198
203
|
|
|
204
|
+
@keyframes sk-bouncedelay {
|
|
205
|
+
0%,
|
|
206
|
+
80%,
|
|
207
|
+
100% {
|
|
208
|
+
-webkit-transform: scale(0);
|
|
209
|
+
transform: scale(0);
|
|
210
|
+
}
|
|
211
|
+
40% {
|
|
212
|
+
-webkit-transform: scale(1);
|
|
213
|
+
transform: scale(1);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
// ---------------------------------------------------------
|
|
218
|
+
// Button add canned on the fly
|
|
219
|
+
// ---------------------------------------------------------
|
|
220
|
+
:host .base_sent .msg_sent ::ng-deep div > div > div > ion-button {
|
|
221
|
+
display: none;
|
|
222
|
+
position: absolute;
|
|
223
|
+
top: -3px;
|
|
224
|
+
left: -31px;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
// :host .base_sent .msg_sent:hover ::ng-deep div > div > div > ion-button {
|
|
228
|
+
:host .base_sent:hover .msg_sent ::ng-deep div > div > div > ion-button {
|
|
229
|
+
display: block;
|
|
230
|
+
// position: absolute;
|
|
231
|
+
// top: -11px;
|
|
232
|
+
// left: -26px;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
:host .base_receive .msg_receive ::ng-deep div > div > ion-button {
|
|
236
|
+
display: none;
|
|
237
|
+
position: absolute;
|
|
238
|
+
top: -3px;
|
|
239
|
+
right: -31px;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
// :host .base_receive .msg_receive:hover ::ng-deep div > div > ion-button {
|
|
243
|
+
:host .base_receive:hover .msg_receive ::ng-deep div > div > ion-button {
|
|
244
|
+
display: block;
|
|
245
|
+
// position: absolute;
|
|
246
|
+
// top: -11px;
|
|
247
|
+
// left: 91px;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
// ---------------------------------------------------------
|
|
251
|
+
// Long date divider
|
|
252
|
+
// ---------------------------------------------------------
|
|
253
|
+
.long-date-divider-wpr {
|
|
254
|
+
justify-content: center !important;
|
|
255
|
+
align-items: center !important;
|
|
256
|
+
display: flex !important;
|
|
257
|
+
margin-top: 0.75rem !important;
|
|
258
|
+
margin-bottom: 0.75rem !important;
|
|
259
|
+
}
|
|
199
260
|
|
|
261
|
+
.long-date-divider-border-b {
|
|
262
|
+
border-bottom: 1px solid #dee5ee !important;
|
|
263
|
+
flex: 1 1 auto !important;
|
|
264
|
+
margin-left: 1.1rem !important;
|
|
265
|
+
margin-right: 1.1rem !important;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
.long-date-divider {
|
|
269
|
+
flex: 0 0 auto !important;
|
|
270
|
+
font-size: 0.75rem !important;
|
|
271
|
+
font-weight: 500 !important;
|
|
272
|
+
line-height: 1.25rem !important;
|
|
273
|
+
margin-left: 1rem !important;
|
|
274
|
+
margin-right: 1rem !important;
|
|
275
|
+
color: #64748b;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
// ---------------------------------------------------------
|
|
279
|
+
// message date
|
|
280
|
+
// ---------------------------------------------------------
|
|
281
|
+
:host .base_sent .msg_sent ::ng-deep div > div > div > .message-date {
|
|
282
|
+
position: absolute;
|
|
283
|
+
bottom: -11px;
|
|
284
|
+
color: #64748b;
|
|
285
|
+
font-size: 10px;
|
|
286
|
+
right: 0px;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
:host .base_receive .msg_receive ::ng-deep div > div > .message-date {
|
|
290
|
+
position: absolute;
|
|
291
|
+
bottom: -11px;
|
|
292
|
+
color: #64748b;
|
|
293
|
+
font-size: 10px;
|
|
294
|
+
left: 0px;
|
|
295
|
+
}
|
|
296
|
+
// ---------------------------------------------------------
|
|
297
|
+
// emoticon
|
|
298
|
+
// ---------------------------------------------------------
|
|
299
|
+
|
|
300
|
+
:host .base_sent .msg_sent ::ng-deep div > div > div > .chat-text-emoticon > p > p {
|
|
301
|
+
margin-bottom: 6px !important;
|
|
302
|
+
margin-right: -7px !important;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
:host .base_receive .msg_receive ::ng-deep div > div > div > .chat-text-emoticon > p > p {
|
|
306
|
+
margin-bottom: 41px !important;
|
|
307
|
+
margin-left: -8px !important;
|
|
308
|
+
margin-top: 49px !important;
|
|
309
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ConversationContentComponent } from '../conversation-content/conversation-content.component';
|
|
2
|
-
import { ChangeDetectorRef, Component, Input, OnInit, Output, EventEmitter} from '@angular/core';
|
|
2
|
+
import { ChangeDetectorRef, Component, Input, OnInit, Output, EventEmitter } from '@angular/core';
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
import { MESSAGE_TYPE_INFO, MESSAGE_TYPE_MINE, MESSAGE_TYPE_OTHERS } from 'src/chat21-core/utils/constants';
|
|
@@ -9,23 +9,29 @@ import { isFile, isFrame, isImage } from 'src/chat21-core/utils/utils-message';
|
|
|
9
9
|
|
|
10
10
|
import { LoggerService } from 'src/chat21-core/providers/abstract/logger.service';
|
|
11
11
|
import { LoggerInstance } from 'src/chat21-core/providers/logger/loggerInstance';
|
|
12
|
-
|
|
12
|
+
import { TiledeskAuthService } from 'src/chat21-core/providers/tiledesk/tiledesk-auth.service';
|
|
13
|
+
import { TranslateService } from '@ngx-translate/core';
|
|
14
|
+
import * as moment from 'moment';
|
|
15
|
+
import { AppConfigProvider } from 'src/app/services/app-config';
|
|
13
16
|
@Component({
|
|
14
17
|
selector: 'ion-conversation-detail',
|
|
15
18
|
templateUrl: './ion-conversation-detail.component.html',
|
|
16
19
|
styleUrls: ['./ion-conversation-detail.component.scss'],
|
|
17
20
|
})
|
|
18
21
|
export class IonConversationDetailComponent extends ConversationContentComponent implements OnInit {
|
|
19
|
-
|
|
22
|
+
|
|
20
23
|
@Input() senderId: string;
|
|
21
24
|
@Input() channelType: string;
|
|
22
|
-
@Output() onImageRendered = new EventEmitter<boolean>()
|
|
25
|
+
@Output() onImageRendered = new EventEmitter<boolean>()
|
|
23
26
|
@Output() onAddUploadingBubble = new EventEmitter<boolean>();
|
|
24
|
-
|
|
25
27
|
|
|
28
|
+
public public_Key: any
|
|
29
|
+
public areVisibleCAR: boolean
|
|
30
|
+
public support_mode: boolean
|
|
26
31
|
public uploadProgress: number = 100
|
|
27
32
|
public fileType: any
|
|
28
|
-
|
|
33
|
+
public browserLang: string;
|
|
34
|
+
public addAsCannedResponseTooltipText: string;
|
|
29
35
|
isImage = isImage;
|
|
30
36
|
isFile = isFile;
|
|
31
37
|
isFrame = isFrame;
|
|
@@ -47,38 +53,112 @@ export class IonConversationDetailComponent extends ConversationContentComponent
|
|
|
47
53
|
*/
|
|
48
54
|
constructor(
|
|
49
55
|
public cdref: ChangeDetectorRef,
|
|
50
|
-
public uploadService: UploadService
|
|
56
|
+
public uploadService: UploadService,
|
|
57
|
+
public tiledeskAuthService: TiledeskAuthService,
|
|
58
|
+
private translate: TranslateService,
|
|
59
|
+
public appConfigProvider: AppConfigProvider,
|
|
51
60
|
) {
|
|
52
61
|
super(cdref, uploadService)
|
|
53
|
-
|
|
62
|
+
|
|
54
63
|
}
|
|
55
64
|
|
|
56
|
-
ngOnInit() {
|
|
57
|
-
|
|
65
|
+
ngOnInit() {
|
|
66
|
+
this.getOSCODE()
|
|
67
|
+
this.listenToUploadFileProgress();
|
|
68
|
+
this.setMomentLocaleAndGetTranslation();
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
getOSCODE() {
|
|
72
|
+
this.support_mode = null
|
|
73
|
+
if( this.appConfigProvider.getConfig().supportMode === true || this.appConfigProvider.getConfig().supportMode === 'true') {
|
|
74
|
+
this.support_mode = true
|
|
75
|
+
} else if ( this.appConfigProvider.getConfig().supportMode === false || this.appConfigProvider.getConfig().supportMode === 'false') {
|
|
76
|
+
this.support_mode = false
|
|
77
|
+
} else if ( !this.appConfigProvider.getConfig().supportMode ) {
|
|
78
|
+
this.support_mode = false
|
|
79
|
+
}
|
|
80
|
+
this.public_Key = this.appConfigProvider.getConfig().t2y12PruGU9wUtEGzBJfolMIgK
|
|
81
|
+
this.logger.log('[CONVS-DETAIL][ION-CONVS-DETAIL] AppConfigService getAppConfig public_Key', this.public_Key)
|
|
82
|
+
|
|
83
|
+
if (this.public_Key) {
|
|
84
|
+
let keys = this.public_Key.split('-')
|
|
85
|
+
this.logger.log('[CONVS-DETAIL][ION-CONVS-DETAIL] PUBLIC-KEY - public_Key keys', keys)
|
|
86
|
+
|
|
87
|
+
keys.forEach((key) => {
|
|
88
|
+
if (key.includes('CAR')) {
|
|
89
|
+
let car = key.split(':')
|
|
90
|
+
if (car[1] === 'F') {
|
|
91
|
+
this.areVisibleCAR = false
|
|
92
|
+
this.logger.log('[CONVS-DETAIL][ION-CONVS-DETAIL] PUBLIC-KEY - areVisibleCAR', this.areVisibleCAR)
|
|
93
|
+
} else {
|
|
94
|
+
this.areVisibleCAR = true
|
|
95
|
+
this.logger.log('[CONVS-DETAIL][ION-CONVS-DETAIL] PUBLIC-KEY - areVisibleCAR', this.areVisibleCAR)
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
})
|
|
99
|
+
|
|
100
|
+
if (!this.public_Key.includes('CAR')) {
|
|
101
|
+
this.areVisibleCAR = false
|
|
102
|
+
// console.log('[CONVS-DETAIL][ION-CONVS-DETAIL] PUBLIC-KEY - areVisibleCAR', this.areVisibleCAR)
|
|
103
|
+
}
|
|
104
|
+
} else {
|
|
105
|
+
this.areVisibleCAR = false
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
setMomentLocaleAndGetTranslation() {
|
|
110
|
+
this.browserLang = this.translate.getBrowserLang();
|
|
111
|
+
const currentUser = this.tiledeskAuthService.getCurrentUser();
|
|
112
|
+
this.logger.log('[CONVS-DETAIL][ION-CONVS-DETAIL] - ngOnInit - currentUser ', currentUser)
|
|
113
|
+
let currentUserId = ''
|
|
114
|
+
if (currentUser) {
|
|
115
|
+
currentUserId = currentUser.uid
|
|
116
|
+
this.logger.log('[CONVS-DETAIL][ION-CONVS-DETAIL]] - ngOnInit - currentUserId ', currentUserId)
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
const stored_preferred_lang = localStorage.getItem(currentUserId + '_lang');
|
|
120
|
+
this.logger.log('[CONVS-DETAIL][ION-CONVS-DETAIL] stored_preferred_lang: ', stored_preferred_lang);
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
let chat_lang = ''
|
|
124
|
+
if (this.browserLang && !stored_preferred_lang) {
|
|
125
|
+
chat_lang = this.browserLang
|
|
126
|
+
} else if (this.browserLang && stored_preferred_lang) {
|
|
127
|
+
chat_lang = stored_preferred_lang
|
|
128
|
+
}
|
|
129
|
+
moment.locale(chat_lang)
|
|
130
|
+
// this.translate.getTranslation(chat_lang).subscribe((labels: string) => {
|
|
131
|
+
// console.log('[CONVS-DETAIL] translations: ', labels);
|
|
132
|
+
// });
|
|
133
|
+
this.translate.get('AddAsCannedResponse')
|
|
134
|
+
.subscribe((text: string) => {
|
|
135
|
+
// console.log('[CONVS-DETAIL] AddAsCannedResponse translated: ', text);
|
|
136
|
+
this.addAsCannedResponseTooltipText = text
|
|
137
|
+
})
|
|
58
138
|
}
|
|
59
139
|
|
|
60
140
|
listenToUploadFileProgress() {
|
|
61
141
|
this.logger.log('[CONVS-DETAIL][ION-CONVS-DETAIL] FIREBASE-UPLOAD - calling BSStateUpload ');
|
|
62
142
|
this.uploadService.BSStateUpload.subscribe((data: any) => {
|
|
63
143
|
this.logger.log('[CONVS-DETAIL][ION-CONVS-DETAIL] FIREBASE-UPLOAD - BSStateUpload data', data);
|
|
64
|
-
|
|
144
|
+
|
|
65
145
|
if (data) {
|
|
66
146
|
this.logger.log('[CONVS-DETAIL][ION-CONVS-DETAIL] FIREBASE-UPLOAD - BSStateUpload data.upload', data.upload);
|
|
67
147
|
this.logger.log('[CONVS-DETAIL][ION-CONVS-DETAIL] FIREBASE-UPLOAD - BSStateUpload data.upload typeof', typeof data.upload);
|
|
68
148
|
this.uploadProgress = data.upload
|
|
69
149
|
|
|
70
|
-
if (isNaN(data.upload))
|
|
150
|
+
if (isNaN(data.upload)) {
|
|
71
151
|
this.logger.log('[CONVS-DETAIL][ION-CONVS-DETAIL] FIREBASE-UPLOAD - BSStateUpload data.upload IS NaN (e.g. file size is 0)');
|
|
72
152
|
this.uploadProgress = 100
|
|
73
153
|
}
|
|
74
154
|
// if (data.type.startsWith("application")) {
|
|
75
155
|
// if (!data.type.startsWith("image")) {
|
|
76
|
-
|
|
77
|
-
// this.fileType = 'file'
|
|
78
156
|
|
|
79
|
-
|
|
157
|
+
// this.fileType = 'file'
|
|
158
|
+
|
|
159
|
+
this.addUploadingBubblePlaceholder(true)
|
|
80
160
|
|
|
81
|
-
|
|
161
|
+
// this.logger.log('[CONVS-DETAIL][ION-CONVS-DETAIL] FIREBASE-UPLOAD - BSStateUpload this.fileType', this.fileType);
|
|
82
162
|
// }
|
|
83
163
|
}
|
|
84
164
|
});
|
|
@@ -88,10 +168,20 @@ export class IonConversationDetailComponent extends ConversationContentComponent
|
|
|
88
168
|
this.onAddUploadingBubble.emit(value);
|
|
89
169
|
}
|
|
90
170
|
|
|
91
|
-
onImageRenderedFN(event){
|
|
171
|
+
onImageRenderedFN(event) {
|
|
92
172
|
this.logger.log('[CONVS-DETAIL][ION-CONVS-DETAIL] - onImageRenderedFN:::ionic', event)
|
|
93
173
|
this.onImageRendered.emit(event)
|
|
94
174
|
}
|
|
95
175
|
|
|
96
|
-
|
|
176
|
+
/**
|
|
177
|
+
* Track by function for ngFor loops
|
|
178
|
+
*
|
|
179
|
+
* @param index
|
|
180
|
+
* @param item
|
|
181
|
+
*/
|
|
182
|
+
trackByFn(index: number, item: any): any {
|
|
183
|
+
// console.log('[CONVS-DETAIL][ION-CONVS-DETAIL] - trackByFn index', index)
|
|
184
|
+
// console.log('[CONVS-DETAIL][ION-CONVS-DETAIL] - trackByFn item', item)
|
|
185
|
+
return item.uid || index;
|
|
186
|
+
}
|
|
97
187
|
}
|
package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.html
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<!-- [ngClass]="{'button-in-msg' : message.metadata && message.metadata.button}" -->
|
|
2
2
|
<!-- [ngStyle]="{'padding': (isImage(message) || isFrame(message))?'0px':'0 8px'}" -->
|
|
3
3
|
<!-- isImage >{{isImage(message) }} message.metadata.width {{message?.metadata?.width }} -->
|
|
4
|
-
<div id="bubble-message"
|
|
5
|
-
|
|
6
|
-
[class.emoticon]="message?.emoticon">
|
|
4
|
+
<div id="bubble-message"
|
|
5
|
+
[ngStyle]="{'padding': (isImage(message) || isFrame(message))?'0px':'0 8px', 'width': (isImage(message) || isFrame(message))? message?.metadata?.width + 'px' : null }"
|
|
6
|
+
class="messages primary-color" [class.emoticon]="message?.emoticon">
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
<div>
|
|
@@ -18,19 +18,13 @@
|
|
|
18
18
|
|
|
19
19
|
<!-- [width]="getMetadataSize(message.metadata).width"
|
|
20
20
|
[height]="getMetadataSize(message.metadata).height" -->
|
|
21
|
-
<chat-image *ngIf="isImage(message)"
|
|
22
|
-
[
|
|
23
|
-
|
|
24
|
-
[width]="message.metadata.width"
|
|
25
|
-
[height]="message.metadata.height"
|
|
26
|
-
(onImageRendered)="onImageRenderedFN($event)">
|
|
21
|
+
<chat-image *ngIf="isImage(message)" [metadata]="message.metadata" [width]="message.metadata.width"
|
|
22
|
+
[height]="message.metadata.height" (onImageRendered)="onImageRenderedFN($event)">
|
|
27
23
|
</chat-image>
|
|
28
24
|
|
|
29
25
|
<!-- [width]="getMetadataSize(message.metadata).width" -->
|
|
30
26
|
<!-- [height]="getMetadataSize(message.metadata).height"> -->
|
|
31
|
-
<chat-frame *ngIf="isFrame(message)"
|
|
32
|
-
[metadata]="message.metadata"
|
|
33
|
-
[width]="message.metadata.width"
|
|
27
|
+
<chat-frame *ngIf="isFrame(message)" [metadata]="message.metadata" [width]="message.metadata.width"
|
|
34
28
|
[height]="message.metadata.height">
|
|
35
29
|
</chat-frame>
|
|
36
30
|
|
|
@@ -40,36 +34,27 @@
|
|
|
40
34
|
[height]="message.metadata.height">
|
|
41
35
|
</chat-frame> -->
|
|
42
36
|
|
|
43
|
-
<!-- message type:: text -->
|
|
44
|
-
<!-- <div *ngIf="message.type == 'text'"> -->
|
|
45
|
-
|
|
46
|
-
<div *ngIf="message?.text" [tooltip]="timeTooltipLeft" [options]="tooltipOptions" placement="left"
|
|
47
|
-
content-type="template" (click)="handleTooltipEvents($event)">
|
|
48
|
-
<ng-template #timeTooltipLeft>
|
|
49
|
-
<!-- <span>{{message.timestamp | amTimeAgo}}</span> -->
|
|
50
|
-
<!-- <span> {{browserLang === 'it' ? (message.timestamp| amDateFormat:'DD MMM') : (message.timestamp |
|
|
51
|
-
amDateFormat:'MMM DD')}} </span> amCalendar -->
|
|
52
37
|
|
|
38
|
+
<!-- [tooltip]="timeTooltipLeft" [options]="tooltipOptions" placement="left" content-type="template" (click)="handleTooltipEvents($event)" -->
|
|
39
|
+
<div *ngIf="message?.text">
|
|
40
|
+
<span class="message-date"> {{message.timestamp | date:'HH:mm' }} </span>
|
|
41
|
+
<!-- <ng-template #timeTooltipLeft>
|
|
53
42
|
<span> {{message.timestamp | amCalendar }} </span>
|
|
54
|
-
</ng-template>
|
|
43
|
+
</ng-template> -->
|
|
55
44
|
|
|
56
|
-
<chat-text
|
|
57
|
-
|
|
58
|
-
[color]="textColor"
|
|
59
|
-
[message]="message"
|
|
45
|
+
<chat-text [text]="message?.text" [color]="textColor" [message]="message"
|
|
46
|
+
[class.chat-text-emoticon]="message?.emoticon"
|
|
60
47
|
(onBeforeMessageRender)="returnOnBeforeMessageRender($event)"
|
|
61
48
|
(onAfterMessageRender)="returnOnAfterMessageRender($event)">
|
|
62
49
|
</chat-text>
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
</
|
|
70
|
-
|
|
71
|
-
<p #messageEl [innerHTML]="printMessage(message, messageEl, this) | linky"></p>
|
|
72
|
-
</ng-template> -->
|
|
50
|
+
|
|
51
|
+
<ng-container *ngIf="areVisibleCAR && support_mode === true">
|
|
52
|
+
<ion-button shape="round" size="small" class="btn-add-msg-as-canned-response" ion-button fill="clear"
|
|
53
|
+
(click)="presentCreateCannedResponseModal()" tooltip="{{addAsCannedResponseTooltipText}}"
|
|
54
|
+
[options]="tooltipOptions" placement="bottom">
|
|
55
|
+
<ion-icon slot="icon-only" name="flash-outline" style="font-size: 1em;"> </ion-icon>
|
|
56
|
+
</ion-button>
|
|
57
|
+
</ng-container>
|
|
73
58
|
</div>
|
|
74
59
|
</div>
|
|
75
60
|
|
package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.scss
CHANGED
|
@@ -21,7 +21,6 @@
|
|
|
21
21
|
font-variant: normal;
|
|
22
22
|
font-weight: 300;
|
|
23
23
|
overflow: hidden;
|
|
24
|
-
|
|
25
24
|
}
|
|
26
25
|
img {
|
|
27
26
|
border-radius: 8px;
|
|
@@ -32,20 +31,33 @@
|
|
|
32
31
|
height: auto;
|
|
33
32
|
object-fit: cover;
|
|
34
33
|
}
|
|
34
|
+
|
|
35
35
|
.message_innerhtml {
|
|
36
36
|
margin: 0px;
|
|
37
37
|
// padding: 0px 14px;
|
|
38
|
-
&.marked{
|
|
39
|
-
padding:8px;
|
|
40
|
-
margin-block-start: -1em!important;
|
|
41
|
-
margin-block-end: -1em!important;
|
|
38
|
+
&.marked {
|
|
39
|
+
padding: 8px;
|
|
40
|
+
margin-block-start: -1em !important;
|
|
41
|
+
margin-block-end: -1em !important;
|
|
42
42
|
}
|
|
43
|
-
|
|
43
|
+
|
|
44
44
|
.text-message {
|
|
45
45
|
padding-top: 14px;
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
|
-
|
|
49
48
|
}
|
|
49
|
+
// > .button-native
|
|
50
|
+
.btn-add-msg-as-canned-response {
|
|
51
|
+
// padding-left: 5px ;
|
|
52
|
+
// padding-right: 5px ;
|
|
53
|
+
border-radius: 50%;
|
|
54
|
+
--padding-end: 7px;
|
|
55
|
+
--padding-start: 7px;
|
|
56
|
+
box-shadow: 0 1px 2px 0 rgb(0 0 0 / 6%);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// .emoticon {
|
|
60
|
+
// padding: 35px 0px !important;
|
|
61
|
+
// }
|
|
50
62
|
|
|
51
63
|
|