@chat21/chat21-ionic 3.0.90-rc.3 → 3.0.90-rc.5
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 +14 -0
- package/package.json +1 -1
- package/src/app/app.component.ts +1 -1
- package/src/app/app.module.ts +2 -2
- package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.scss +4 -2
- package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.ts +4 -3
- package/src/app/chatlib/conversation-detail/message/info-message/info-message.component.html +5 -5
- package/src/app/chatlib/conversation-detail/message/info-message/info-message.component.scss +6 -0
- package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.html +9 -1
- package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.scss +56 -0
- package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.ts +2 -0
- package/src/app/pages/conversation-detail/conversation-detail.page.html +2 -1
- package/src/app/pages/conversation-detail/conversation-detail.page.ts +13 -0
- package/src/assets/i18n/ar.json +3 -1
- package/src/assets/i18n/az.json +3 -1
- package/src/assets/i18n/de.json +3 -1
- package/src/assets/i18n/en.json +3 -1
- package/src/assets/i18n/es.json +3 -1
- package/src/assets/i18n/fr.json +3 -1
- package/src/assets/i18n/it.json +3 -1
- package/src/assets/i18n/kk.json +3 -1
- package/src/assets/i18n/pt.json +3 -1
- package/src/assets/i18n/ru.json +3 -1
- package/src/assets/i18n/sr.json +3 -1
- package/src/assets/i18n/sv.json +3 -1
- package/src/assets/i18n/tr.json +3 -1
- package/src/assets/i18n/uk.json +3 -1
- package/src/assets/i18n/uz.json +3 -1
- package/src/chat21-core/models/message.ts +0 -1
- package/src/chat21-core/providers/firebase/firebase-conversation-handler.ts +97 -18
- package/src/chat21-core/providers/mqtt/mqtt-conversation-handler.ts +25 -17
- package/src/chat21-core/providers/mqtt/mqtt-conversations-handler.ts +3 -1
- package/src/chat21-core/utils/constants.ts +2 -2
- package/src/chat21-core/utils/utils-message.ts +1 -7
- package/src/chat21-core/utils/utils.ts +3 -0
- package/src/global.scss +4 -0
- package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component_2.html +0 -116
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# chat21-ionic ver 3.0
|
|
2
2
|
|
|
3
|
+
### 3.0.90-rc.5
|
|
4
|
+
- added: implementation of conversationChangedDetailed in MQTTConversationsHandler service
|
|
5
|
+
- added: LIVE_PAGE info-message type
|
|
6
|
+
- added: live page info in conversation. header (work in progress)
|
|
7
|
+
- changed: info-message UI
|
|
8
|
+
- bug-fixed: options-container not has transparent background if one emotion is present
|
|
9
|
+
- bug-fixed: modals not closed on ESC keyboard button
|
|
10
|
+
- removed: forward of logs to server
|
|
11
|
+
|
|
12
|
+
### 3.0.90-rc.4
|
|
13
|
+
- added: splitMessage in MQTTConversationHandler service
|
|
14
|
+
- changed: aligned FirebaseConversationHandler service to widget
|
|
15
|
+
- removed: MESSAGE_TYPE_DATE
|
|
16
|
+
|
|
3
17
|
### 3.0.90-rc.3
|
|
4
18
|
- added: options menu and popover on click to show copy, canned and Json response options
|
|
5
19
|
- changed: icon-button moved outside bubble-message only for the first message of each sender
|
package/package.json
CHANGED
package/src/app/app.component.ts
CHANGED
|
@@ -1292,7 +1292,7 @@ export class AppComponent implements OnInit {
|
|
|
1292
1292
|
}
|
|
1293
1293
|
|
|
1294
1294
|
private initConversationsHandler(userId: string) {
|
|
1295
|
-
const keys = ['YOU'
|
|
1295
|
+
const keys = ['YOU'];
|
|
1296
1296
|
const translationMap = this.translateService.translateLanguage(keys);
|
|
1297
1297
|
|
|
1298
1298
|
this.logger.log('[APP-COMP] initConversationsHandler ------------->', userId, this.tenant);
|
package/src/app/app.module.ts
CHANGED
|
@@ -280,12 +280,12 @@ const appInitializerFn = (appConfig: AppConfigProvider, logger: NGXLogger) => {
|
|
|
280
280
|
}),
|
|
281
281
|
LoggerModule.forRoot({
|
|
282
282
|
level: NgxLoggerLevel.DEBUG,
|
|
283
|
-
serverLogLevel: NgxLoggerLevel.ERROR,
|
|
283
|
+
// serverLogLevel: NgxLoggerLevel.ERROR,
|
|
284
284
|
timestampFormat: 'HH:mm:ss.SSS',
|
|
285
285
|
enableSourceMaps: false,
|
|
286
286
|
disableFileDetails: true,
|
|
287
287
|
colorScheme: ['purple', 'yellow', 'gray', 'gray', 'red', 'red', 'red'],
|
|
288
|
-
serverLoggingUrl: 'https://tiledesk-server-pre.herokuapp.com/logs'
|
|
288
|
+
// serverLoggingUrl: 'https://tiledesk-server-pre.herokuapp.com/logs'
|
|
289
289
|
}),
|
|
290
290
|
ScrollbarThemeModule,
|
|
291
291
|
SharedModule,
|
|
@@ -35,7 +35,8 @@
|
|
|
35
35
|
|
|
36
36
|
|
|
37
37
|
//------- MANAGE CHAT-OPTIONS component :: INIT ------- //
|
|
38
|
-
:host .base_sent .msg_sent.no-background ::ng-deep > div
|
|
38
|
+
:host .base_sent .msg_sent.no-background ::ng-deep > div,
|
|
39
|
+
:host .base_sent .msg_sent.emoticon ::ng-deep > div{
|
|
39
40
|
.options-container{
|
|
40
41
|
background: transparent;
|
|
41
42
|
|
|
@@ -46,7 +47,8 @@
|
|
|
46
47
|
|
|
47
48
|
}
|
|
48
49
|
|
|
49
|
-
:host .base_receive .msg_receive.no-background ::ng-deep > div
|
|
50
|
+
:host .base_receive .msg_receive.no-background ::ng-deep > div,
|
|
51
|
+
:host .base_receive .msg_receive.emoticon ::ng-deep > div{
|
|
50
52
|
.options-container{
|
|
51
53
|
background: transparent;
|
|
52
54
|
|
|
@@ -111,6 +111,7 @@ export class IonConversationDetailComponent extends ConversationContentComponent
|
|
|
111
111
|
} else if (this.browserLang && stored_preferred_lang) {
|
|
112
112
|
chat_lang = stored_preferred_lang
|
|
113
113
|
}
|
|
114
|
+
|
|
114
115
|
moment.locale(chat_lang)
|
|
115
116
|
// this.translate.getTranslation(chat_lang).subscribe((labels: string) => {
|
|
116
117
|
// console.log('[CONVS-DETAIL] translations: ', labels);
|
|
@@ -211,7 +212,7 @@ export class IonConversationDetailComponent extends ConversationContentComponent
|
|
|
211
212
|
component: CreateCannedResponsePage,
|
|
212
213
|
componentProps: attributes,
|
|
213
214
|
swipeToClose: false,
|
|
214
|
-
backdropDismiss:
|
|
215
|
+
backdropDismiss: true,
|
|
215
216
|
})
|
|
216
217
|
modal.onDidDismiss().then((dataReturned: any) => {
|
|
217
218
|
//
|
|
@@ -231,8 +232,8 @@ export class IonConversationDetailComponent extends ConversationContentComponent
|
|
|
231
232
|
cssClass: 'json-modal-class',
|
|
232
233
|
componentProps: attributes,
|
|
233
234
|
swipeToClose: false,
|
|
234
|
-
backdropDismiss:
|
|
235
|
-
keyboardClose: true,
|
|
235
|
+
backdropDismiss: true,
|
|
236
|
+
// keyboardClose: true,
|
|
236
237
|
})
|
|
237
238
|
modal.onDidDismiss().then((dataReturned: any) => {
|
|
238
239
|
//
|
package/src/app/chatlib/conversation-detail/message/info-message/info-message.component.html
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
<div class="info-container">
|
|
2
|
-
|
|
2
|
+
<div class="spinner">
|
|
3
3
|
<div class="bounce3"></div>
|
|
4
4
|
<div class="bounce2"></div>
|
|
5
5
|
<div class="bounce1"></div>
|
|
6
|
-
</div>
|
|
6
|
+
</div>
|
|
7
7
|
|
|
8
|
-
<div>
|
|
8
|
+
<div style="max-width: 70%;">
|
|
9
9
|
<span class="base_info" [innerHTML]="message?.text | marked" [options]="tooltipOptions" [tooltip]="timeTooltipLeft" placement="left" content-type="template"></span>
|
|
10
10
|
<ng-template #timeTooltipLeft>
|
|
11
11
|
<span>{{message.timestamp | amTimeAgo}} ({{message.timestamp | amLocal | amDateFormat: 'L HH:mm:ss'}})</span>
|
|
12
12
|
</ng-template>
|
|
13
13
|
</div>
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
<div class="spinner">
|
|
16
16
|
<div class="bounce1"></div>
|
|
17
17
|
<div class="bounce2"></div>
|
|
18
18
|
<div class="bounce3"></div>
|
|
19
|
-
</div>
|
|
19
|
+
</div>
|
|
20
20
|
</div>
|
package/src/app/chatlib/conversation-detail/message/info-message/info-message.component.scss
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
align-content: center;
|
|
4
4
|
justify-content: center;
|
|
5
5
|
padding: 4px 0px 2px 0px;
|
|
6
|
+
width: 100%;
|
|
6
7
|
}
|
|
7
8
|
|
|
8
9
|
.base_info {
|
|
@@ -17,6 +18,11 @@
|
|
|
17
18
|
color: var(--basic-gray);
|
|
18
19
|
margin-left: 5px; //32px;
|
|
19
20
|
margin-right: 5px; //32px;
|
|
21
|
+
|
|
22
|
+
a {
|
|
23
|
+
word-break: break-all;
|
|
24
|
+
}
|
|
25
|
+
|
|
20
26
|
|
|
21
27
|
}
|
|
22
28
|
|
|
@@ -63,10 +63,18 @@
|
|
|
63
63
|
</div>
|
|
64
64
|
</div>
|
|
65
65
|
|
|
66
|
-
|
|
66
|
+
<!-- <div>
|
|
67
|
+
<ion-button class="live" ion-button color="danger">
|
|
68
|
+
<span class="live-icon"></span>
|
|
69
|
+
<span class="live-text">{{translationsMap.get('LIVE')}}</span>
|
|
70
|
+
<span class="live-content">source page</span>
|
|
71
|
+
</ion-button>
|
|
72
|
+
</div> -->
|
|
67
73
|
|
|
68
74
|
|
|
69
75
|
</div>
|
|
76
|
+
|
|
77
|
+
|
|
70
78
|
|
|
71
79
|
|
|
72
80
|
<!-- <div *ngIf="conversationWithFullname" class="tile-info-with" (click)="onOpenCloseInfoConversation()">
|
|
@@ -222,4 +222,60 @@ ion-header {
|
|
|
222
222
|
left: 63px;
|
|
223
223
|
}
|
|
224
224
|
|
|
225
|
+
ion-button.live{
|
|
226
|
+
--padding-end: 0px;
|
|
227
|
+
--padding-start: 5px;
|
|
228
|
+
|
|
229
|
+
span.live-icon{
|
|
230
|
+
display: inline-block;
|
|
231
|
+
position: relative;
|
|
232
|
+
// top: calc(50% - 5px);
|
|
233
|
+
background-color: white;
|
|
234
|
+
width: 10px;
|
|
235
|
+
height: 10px;
|
|
236
|
+
margin-left: 5px;
|
|
237
|
+
margin-right: 5px;
|
|
238
|
+
border: 1px solid rgba(black, .1);
|
|
239
|
+
border-radius: 50%;
|
|
240
|
+
z-index: 1;
|
|
241
|
+
&:before{
|
|
242
|
+
content: '';
|
|
243
|
+
display: block;
|
|
244
|
+
position: absolute;
|
|
245
|
+
background-color: rgba(white,.6);
|
|
246
|
+
width: 100%;
|
|
247
|
+
height: 100%;
|
|
248
|
+
border-radius: 50%;
|
|
249
|
+
animation: live 2s ease-in-out infinite;
|
|
250
|
+
z-index: -1;
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
span.live-text{
|
|
255
|
+
color: white;
|
|
256
|
+
margin-left: 5px;
|
|
257
|
+
margin-right: 5px;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
span.live-content{
|
|
261
|
+
background-color: white;
|
|
262
|
+
color: red;
|
|
263
|
+
margin-left: 5px;
|
|
264
|
+
padding: 0px 5px;
|
|
265
|
+
height: 100%;
|
|
266
|
+
display: flex;
|
|
267
|
+
align-items: center;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
@keyframes live {
|
|
271
|
+
0% {
|
|
272
|
+
transform: scale(1,1);
|
|
273
|
+
}
|
|
274
|
+
100% {
|
|
275
|
+
transform: scale(3.5,3.5);
|
|
276
|
+
background-color: rgba(red,0);
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
|
|
225
281
|
|
|
@@ -27,10 +27,12 @@ import { TYPE_DIRECT, TYPE_SUPPORT_GROUP } from 'src/chat21-core/utils/constants
|
|
|
27
27
|
styleUrls: ['./header-conversation-detail.component.scss'],
|
|
28
28
|
})
|
|
29
29
|
export class HeaderConversationDetailComponent implements OnInit, OnChanges {
|
|
30
|
+
|
|
30
31
|
@Input() conversationAvatar: any
|
|
31
32
|
@Input() idLoggedUser: string
|
|
32
33
|
@Input() conversationUid: string
|
|
33
34
|
@Input() conv_type: string
|
|
35
|
+
@Input() liveInfo: {sourcePage: string, sourceTitle: string}
|
|
34
36
|
@Input() isMobile: boolean
|
|
35
37
|
@Input() translationsMap: Map<string, string>
|
|
36
38
|
conversationWithFullname: string
|
|
@@ -42,7 +42,8 @@
|
|
|
42
42
|
[isMobile]="isMobile"
|
|
43
43
|
[idLoggedUser]="loggedUser.uid"
|
|
44
44
|
[conversationUid]="conversationWith"
|
|
45
|
-
[conversationAvatar]="conversationAvatar"
|
|
45
|
+
[conversationAvatar]="conversationAvatar"
|
|
46
|
+
[liveInfo]="liveInfo"
|
|
46
47
|
[translationsMap]="translationsHeaderMap"
|
|
47
48
|
[conv_type]="conv_type">
|
|
48
49
|
</app-header-conversation-detail>
|
|
@@ -127,6 +127,7 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
|
|
|
127
127
|
public translationsContentMap: Map<string, string> = new Map()
|
|
128
128
|
public conversationAvatar: any
|
|
129
129
|
public leadInfo: {lead_id: string, hasEmail: boolean , email: string, projectId: string};
|
|
130
|
+
public liveInfo: {sourcePage: string, sourceTitle: string}
|
|
130
131
|
public member: UserModel
|
|
131
132
|
public isFileSelected: boolean
|
|
132
133
|
public showIonContent = false
|
|
@@ -650,6 +651,7 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
|
|
|
650
651
|
'LABEL_TO',
|
|
651
652
|
'LABEL_LAST_ACCESS',
|
|
652
653
|
'ARRAY_DAYS',
|
|
654
|
+
'LIVE',
|
|
653
655
|
'Resolve',
|
|
654
656
|
]
|
|
655
657
|
|
|
@@ -682,6 +684,7 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
|
|
|
682
684
|
'INFO_SUPPORT_LEAD_UPDATED',
|
|
683
685
|
'INFO_SUPPORT_MEMBER_LEFT_GROUP',
|
|
684
686
|
'INFO_SUPPORT_MEMBER_ABANDONED_GROUP',
|
|
687
|
+
'INFO_SUPPORT_LIVE_PAGE',
|
|
685
688
|
'LABEL_TODAY',
|
|
686
689
|
'LABEL_TOMORROW',
|
|
687
690
|
'LABEL_LAST_ACCESS',
|
|
@@ -1106,6 +1109,7 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
|
|
|
1106
1109
|
this.logger.log('[CONVS-DETAIL] subscribe to messageInfo - messageId ', msg, this.conversation)
|
|
1107
1110
|
if (msg) {
|
|
1108
1111
|
that.updateLeadInfo(msg)
|
|
1112
|
+
// this.updateLiveInfo(msg)
|
|
1109
1113
|
// this.setHeaderContent()
|
|
1110
1114
|
}
|
|
1111
1115
|
})
|
|
@@ -1214,6 +1218,15 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
|
|
|
1214
1218
|
}
|
|
1215
1219
|
}
|
|
1216
1220
|
|
|
1221
|
+
updateLiveInfo(msg){
|
|
1222
|
+
if(msg.attributes && msg.attributes.hasOwnProperty("sourcePage")){
|
|
1223
|
+
this.liveInfo = { sourcePage: msg.attributes['sourcePage'], sourceTitle: null}
|
|
1224
|
+
}
|
|
1225
|
+
if(msg.attributes && msg.attributes.hasOwnProperty("sourceTitle")){
|
|
1226
|
+
this.liveInfo = { sourcePage: msg.attributes['sourcePage'], sourceTitle: msg.attributes['sourceTitle']}
|
|
1227
|
+
}
|
|
1228
|
+
}
|
|
1229
|
+
|
|
1217
1230
|
// ----------------------------------------------------------------
|
|
1218
1231
|
// @ Unsubscribe all subscribed events (called in ionViewWillLeave)
|
|
1219
1232
|
// ----------------------------------------------------------------
|
package/src/assets/i18n/ar.json
CHANGED
|
@@ -82,6 +82,7 @@
|
|
|
82
82
|
"INFO_SUPPORT_MEMBER_LEFT_GROUP":"تمت إزالته من المجموعة",
|
|
83
83
|
"INFO_SUPPORT_MEMBER_ABANDONED_GROUP":"وقد غادر المحادثة",
|
|
84
84
|
"INFO_A_NEW_SUPPORT_REQUEST_HAS_BEEN_ASSIGNED_TO_YOU": "تم تعيين طلب دعم جديد لك",
|
|
85
|
+
"INFO_SUPPORT_LIVE_PAGE": "انتقل ل",
|
|
85
86
|
"LABEL_PROFILE": "الملف الشخصي",
|
|
86
87
|
"LABEL_CLOSE": "مغلق",
|
|
87
88
|
"LABEL_DISCONNECT": "قطع الاتصال",
|
|
@@ -290,5 +291,6 @@
|
|
|
290
291
|
"RECENT_PROJECTS":"مشاريع حديثه",
|
|
291
292
|
"OTHER_PROJECTS":"مشاريع أخرى"
|
|
292
293
|
},
|
|
293
|
-
"JSON_RESPONSE":"استجابة JSON"
|
|
294
|
+
"JSON_RESPONSE":"استجابة JSON",
|
|
295
|
+
"LIVE":"حاليا"
|
|
294
296
|
}
|
package/src/assets/i18n/az.json
CHANGED
|
@@ -82,6 +82,7 @@
|
|
|
82
82
|
"INFO_SUPPORT_MEMBER_LEFT_GROUP":"qrupdan çıxarıldı",
|
|
83
83
|
"INFO_SUPPORT_MEMBER_ABANDONED_GROUP":"söhbəti tərk etdi",
|
|
84
84
|
"INFO_A_NEW_SUPPORT_REQUEST_HAS_BEEN_ASSIGNED_TO_YOU": "Sizə yeni dəstək sorğusu təyin edilib",
|
|
85
|
+
"INFO_SUPPORT_LIVE_PAGE":"Köçürüldü",
|
|
85
86
|
"LABEL_PROFILE": "Profil",
|
|
86
87
|
"LABEL_CLOSE": "Bağlı",
|
|
87
88
|
"LABEL_DISCONNECT": "Bağlantını kəsin",
|
|
@@ -290,5 +291,6 @@
|
|
|
290
291
|
"RECENT_PROJECTS":"Son layihələr",
|
|
291
292
|
"OTHER_PROJECTS":"Digər layihələr"
|
|
292
293
|
},
|
|
293
|
-
"JSON_RESPONSE":"JSON cavabı"
|
|
294
|
+
"JSON_RESPONSE":"JSON cavabı",
|
|
295
|
+
"LIVE":"Canlı"
|
|
294
296
|
}
|
package/src/assets/i18n/de.json
CHANGED
|
@@ -82,6 +82,7 @@
|
|
|
82
82
|
"INFO_SUPPORT_MEMBER_LEFT_GROUP":"aus der Gruppe entfernt",
|
|
83
83
|
"INFO_SUPPORT_MEMBER_ABANDONED_GROUP":"hat die Unterhaltung verlassen",
|
|
84
84
|
"INFO_A_NEW_SUPPORT_REQUEST_HAS_BEEN_ASSIGNED_TO_YOU": "Ihnen wurde eine neue Support-Anfrage zugewiesen",
|
|
85
|
+
"INFO_SUPPORT_LIVE_PAGE":"Umgezogen nach",
|
|
85
86
|
"LABEL_PROFILE": "Profil",
|
|
86
87
|
"LABEL_CLOSE": "Abgeschlossen",
|
|
87
88
|
"LABEL_DISCONNECT": "Trennen",
|
|
@@ -290,5 +291,6 @@
|
|
|
290
291
|
"RECENT_PROJECTS":"Letzte Projekte",
|
|
291
292
|
"OTHER_PROJECTS":"Weitere Projekte"
|
|
292
293
|
},
|
|
293
|
-
"JSON_RESPONSE":"JSON Response"
|
|
294
|
+
"JSON_RESPONSE":"JSON Response",
|
|
295
|
+
"LIVE":"Live"
|
|
294
296
|
}
|
package/src/assets/i18n/en.json
CHANGED
|
@@ -82,6 +82,7 @@
|
|
|
82
82
|
"INFO_SUPPORT_MEMBER_LEFT_GROUP":"removed from group",
|
|
83
83
|
"INFO_SUPPORT_MEMBER_ABANDONED_GROUP":"has left the conversation",
|
|
84
84
|
"INFO_A_NEW_SUPPORT_REQUEST_HAS_BEEN_ASSIGNED_TO_YOU": "A new support request has been assigned to you",
|
|
85
|
+
"INFO_SUPPORT_LIVE_PAGE":"Moved to",
|
|
85
86
|
"LABEL_PROFILE": "Profile",
|
|
86
87
|
"LABEL_CLOSE": "Closed",
|
|
87
88
|
"LABEL_DISCONNECT": "Disconnect",
|
|
@@ -290,5 +291,6 @@
|
|
|
290
291
|
"RECENT_PROJECTS":"Recent projects",
|
|
291
292
|
"OTHER_PROJECTS":"Other projects"
|
|
292
293
|
},
|
|
293
|
-
"JSON_RESPONSE":"JSON Response"
|
|
294
|
+
"JSON_RESPONSE":"JSON Response",
|
|
295
|
+
"LIVE":"Live"
|
|
294
296
|
}
|
package/src/assets/i18n/es.json
CHANGED
|
@@ -82,6 +82,7 @@
|
|
|
82
82
|
"INFO_SUPPORT_MEMBER_LEFT_GROUP":"eliminado del grupo",
|
|
83
83
|
"INFO_SUPPORT_MEMBER_ABANDONED_GROUP":"ha abandonado la conversación",
|
|
84
84
|
"INFO_A_NEW_SUPPORT_REQUEST_HAS_BEEN_ASSIGNED_TO_YOU":"Se le ha asignado una nueva solicitud de soporte",
|
|
85
|
+
"INFO_SUPPORT_LIVE_PAGE":"Trasladado a",
|
|
85
86
|
"LABEL_PROFILE": "Perfil",
|
|
86
87
|
"LABEL_CLOSE": "Cerrado",
|
|
87
88
|
"LABEL_DISCONNECT": "Desconectar",
|
|
@@ -290,5 +291,6 @@
|
|
|
290
291
|
"RECENT_PROJECTS":"Proyectos recientes",
|
|
291
292
|
"OTHER_PROJECTS":"Otros proyectos"
|
|
292
293
|
},
|
|
293
|
-
"JSON_RESPONSE":"Respuesta JSON"
|
|
294
|
+
"JSON_RESPONSE":"Respuesta JSON",
|
|
295
|
+
"LIVE":"En Vivo"
|
|
294
296
|
}
|
package/src/assets/i18n/fr.json
CHANGED
|
@@ -82,6 +82,7 @@
|
|
|
82
82
|
"INFO_SUPPORT_MEMBER_LEFT_GROUP":"supprimé du groupe",
|
|
83
83
|
"INFO_SUPPORT_MEMBER_ABANDONED_GROUP":"a quitté la conversation",
|
|
84
84
|
"INFO_A_NEW_SUPPORT_REQUEST_HAS_BEEN_ASSIGNED_TO_YOU": "Une nouvelle demande de support vous a été attribuée",
|
|
85
|
+
"INFO_SUPPORT_LIVE_PAGE":"Déplacé vers",
|
|
85
86
|
"LABEL_PROFILE": "Profil",
|
|
86
87
|
"LABEL_CLOSE": "Fermé",
|
|
87
88
|
"LABEL_DISCONNECT": "Déconnecter",
|
|
@@ -290,5 +291,6 @@
|
|
|
290
291
|
"RECENT_PROJECTS":"Les projets récents",
|
|
291
292
|
"OTHER_PROJECTS":"Autres projets"
|
|
292
293
|
},
|
|
293
|
-
"JSON_RESPONSE":"Réponse JSON"
|
|
294
|
+
"JSON_RESPONSE":"Réponse JSON",
|
|
295
|
+
"LIVE":"En direct"
|
|
294
296
|
}
|
package/src/assets/i18n/it.json
CHANGED
|
@@ -82,6 +82,7 @@
|
|
|
82
82
|
"INFO_SUPPORT_MEMBER_LEFT_GROUP":"rimosso dal gruppo",
|
|
83
83
|
"INFO_SUPPORT_MEMBER_ABANDONED_GROUP": "ha abbandonato la conversazione",
|
|
84
84
|
"INFO_A_NEW_SUPPORT_REQUEST_HAS_BEEN_ASSIGNED_TO_YOU":"Una nuova richiesta di supporto è stata assegnata a te",
|
|
85
|
+
"INFO_SUPPORT_LIVE_PAGE":"Spostato in",
|
|
85
86
|
"LABEL_PROFILE": "Profilo",
|
|
86
87
|
"LABEL_CLOSE": "Chiusa",
|
|
87
88
|
"LABEL_DISCONNECT": "Disconnetti",
|
|
@@ -290,5 +291,6 @@
|
|
|
290
291
|
"RECENT_PROJECTS":"Progetti recenti",
|
|
291
292
|
"OTHER_PROJECTS":"Altri progetti"
|
|
292
293
|
},
|
|
293
|
-
"JSON_RESPONSE":"JSON di risposta"
|
|
294
|
+
"JSON_RESPONSE":"JSON di risposta",
|
|
295
|
+
"LIVE":"Live"
|
|
294
296
|
}
|
package/src/assets/i18n/kk.json
CHANGED
|
@@ -82,6 +82,7 @@
|
|
|
82
82
|
"INFO_SUPPORT_MEMBER_LEFT_GROUP":"топтан шығарылды",
|
|
83
83
|
"INFO_SUPPORT_MEMBER_ABANDONED_GROUP":"әңгімеден шығып кетті",
|
|
84
84
|
"INFO_A_NEW_SUPPORT_REQUEST_HAS_BEEN_ASSIGNED_TO_YOU": "Сізге жаңа қолдау сұрауы тағайындалды",
|
|
85
|
+
"INFO_SUPPORT_LIVE_PAGE":"Көшті",
|
|
85
86
|
"LABEL_PROFILE": "Профиль",
|
|
86
87
|
"LABEL_CLOSE": "Жабық",
|
|
87
88
|
"LABEL_DISCONNECT": "Ажырату",
|
|
@@ -290,5 +291,6 @@
|
|
|
290
291
|
"RECENT_PROJECTS":"Соңғы жобалар",
|
|
291
292
|
"OTHER_PROJECTS":"Басқа жобалар"
|
|
292
293
|
},
|
|
293
|
-
"JSON_RESPONSE":"JSON жауабы"
|
|
294
|
+
"JSON_RESPONSE":"JSON жауабы",
|
|
295
|
+
"LIVE": "Тікелей эфир"
|
|
294
296
|
}
|
package/src/assets/i18n/pt.json
CHANGED
|
@@ -82,6 +82,7 @@
|
|
|
82
82
|
"INFO_SUPPORT_MEMBER_LEFT_GROUP":"removido do grupo",
|
|
83
83
|
"INFO_SUPPORT_MEMBER_ABANDONED_GROUP":"deixou a conversa",
|
|
84
84
|
"INFO_A_NEW_SUPPORT_REQUEST_HAS_BEEN_ASSIGNED_TO_YOU": "Uma nova solicitação de suporte foi atribuída a você",
|
|
85
|
+
"INFO_SUPPORT_LIVE_PAGE":"Movido para",
|
|
85
86
|
"LABEL_PROFILE": "Perfil",
|
|
86
87
|
"LABEL_CLOSE": "Fechadas",
|
|
87
88
|
"LABEL_DISCONNECT": "Desconectar",
|
|
@@ -290,5 +291,6 @@
|
|
|
290
291
|
"RECENT_PROJECTS":"Projetos Recentes",
|
|
291
292
|
"OTHER_PROJECTS":"Outros projetos"
|
|
292
293
|
},
|
|
293
|
-
"JSON_RESPONSE":"Resposta JSON"
|
|
294
|
+
"JSON_RESPONSE":"Resposta JSON",
|
|
295
|
+
"LIVE":"Ao vivo"
|
|
294
296
|
}
|
package/src/assets/i18n/ru.json
CHANGED
|
@@ -82,6 +82,7 @@
|
|
|
82
82
|
"INFO_SUPPORT_MEMBER_LEFT_GROUP":"удален из группы",
|
|
83
83
|
"INFO_SUPPORT_MEMBER_ABANDONED_GROUP":"вышел из беседы",
|
|
84
84
|
"INFO_A_NEW_SUPPORT_REQUEST_HAS_BEEN_ASSIGNED_TO_YOU": "Вам назначен новый запрос в службу поддержки",
|
|
85
|
+
"INFO_SUPPORT_LIVE_PAGE":"Переехал в",
|
|
85
86
|
"LABEL_PROFILE": "Профиль",
|
|
86
87
|
"LABEL_CLOSE": "Закрыто",
|
|
87
88
|
"LABEL_DISCONNECT": "Отключить",
|
|
@@ -290,5 +291,6 @@
|
|
|
290
291
|
"RECENT_PROJECTS":"Недавние Проекты",
|
|
291
292
|
"OTHER_PROJECTS":"Другие проекты"
|
|
292
293
|
},
|
|
293
|
-
"JSON_RESPONSE":"JSON-ответ"
|
|
294
|
+
"JSON_RESPONSE":"JSON-ответ",
|
|
295
|
+
"LIVE":"Жить"
|
|
294
296
|
}
|
package/src/assets/i18n/sr.json
CHANGED
|
@@ -82,6 +82,7 @@
|
|
|
82
82
|
"INFO_SUPPORT_MEMBER_LEFT_GROUP":"уклоњен из групе",
|
|
83
83
|
"INFO_SUPPORT_MEMBER_ABANDONED_GROUP":"је напустио разговор",
|
|
84
84
|
"INFO_A_NEW_SUPPORT_REQUEST_HAS_BEEN_ASSIGNED_TO_YOU": "Додељен вам је нови захтев за подршку",
|
|
85
|
+
"INFO_SUPPORT_LIVE_PAGE":"Преселио у",
|
|
85
86
|
"LABEL_PROFILE": "Профил",
|
|
86
87
|
"LABEL_CLOSE": "Затворено",
|
|
87
88
|
"LABEL_DISCONNECT": "Прекини везу",
|
|
@@ -290,5 +291,6 @@
|
|
|
290
291
|
"RECENT_PROJECTS":"Недавни пројекти",
|
|
291
292
|
"OTHER_PROJECTS":"Остали пројекти"
|
|
292
293
|
},
|
|
293
|
-
"JSON_RESPONSE":"ЈСОН одговор"
|
|
294
|
+
"JSON_RESPONSE":"ЈСОН одговор",
|
|
295
|
+
"LIVE":"Уживо"
|
|
294
296
|
}
|
package/src/assets/i18n/sv.json
CHANGED
|
@@ -82,6 +82,7 @@
|
|
|
82
82
|
"INFO_SUPPORT_MEMBER_LEFT_GROUP":"borttagen från gruppen",
|
|
83
83
|
"INFO_SUPPORT_MEMBER_ABANDONED_GROUP":"har lämnat konversationen",
|
|
84
84
|
"INFO_A_NEW_SUPPORT_REQUEST_HAS_BEEN_ASSIGNED_TO_YOU": "En ny supportförfrågan har tilldelats dig",
|
|
85
|
+
"INFO_SUPPORT_LIVE_PAGE":"Flyttade till",
|
|
85
86
|
"LABEL_PROFILE": "Profil",
|
|
86
87
|
"LABEL_CLOSE": "Stängd",
|
|
87
88
|
"LABEL_DISCONNECT": "Koppla ifrån",
|
|
@@ -290,5 +291,6 @@
|
|
|
290
291
|
"RECENT_PROJECTS":"Nyliga projekt",
|
|
291
292
|
"OTHER_PROJECTS":"Andra projekt"
|
|
292
293
|
},
|
|
293
|
-
"JSON_RESPONSE":"JSON-svar"
|
|
294
|
+
"JSON_RESPONSE":"JSON-svar",
|
|
295
|
+
"LIVE":"Lev"
|
|
294
296
|
}
|
package/src/assets/i18n/tr.json
CHANGED
|
@@ -82,6 +82,7 @@
|
|
|
82
82
|
"INFO_SUPPORT_MEMBER_LEFT_GROUP":"gruptan kaldırıldı",
|
|
83
83
|
"INFO_SUPPORT_MEMBER_ABANDONED_GROUP":"görüşmeden ayrıldı",
|
|
84
84
|
"INFO_A_NEW_SUPPORT_REQUEST_HAS_BEEN_ASSIGNED_TO_YOU": "Size yeni bir destek talebi atandı",
|
|
85
|
+
"INFO_SUPPORT_LIVE_PAGE":"Şuraya taşındı:",
|
|
85
86
|
"LABEL_PROFILE": "Profil",
|
|
86
87
|
"LABEL_CLOSE": "Kapalı",
|
|
87
88
|
"LABEL_DISCONNECT": "Bağlantıyı kes",
|
|
@@ -290,5 +291,6 @@
|
|
|
290
291
|
"RECENT_PROJECTS":"Son Projeler",
|
|
291
292
|
"OTHER_PROJECTS":"Diğer projeler"
|
|
292
293
|
},
|
|
293
|
-
"JSON_RESPONSE":"JSON Yanıtı"
|
|
294
|
+
"JSON_RESPONSE":"JSON Yanıtı",
|
|
295
|
+
"LIVE":"Canlı"
|
|
294
296
|
}
|
package/src/assets/i18n/uk.json
CHANGED
|
@@ -82,6 +82,7 @@
|
|
|
82
82
|
"INFO_SUPPORT_MEMBER_LEFT_GROUP":"видалено з групи",
|
|
83
83
|
"INFO_SUPPORT_MEMBER_ABANDONED_GROUP":"залишив бесіду",
|
|
84
84
|
"INFO_A_NEW_SUPPORT_REQUEST_HAS_BEEN_ASSIGNED_TO_YOU": "Вам призначено новий запит на підтримку",
|
|
85
|
+
"INFO_SUPPORT_LIVE_PAGE":"Переїхав до",
|
|
85
86
|
"LABEL_PROFILE": "Профіль",
|
|
86
87
|
"LABEL_CLOSE": "зачинено",
|
|
87
88
|
"LABEL_DISCONNECT": "Від’єднати",
|
|
@@ -290,5 +291,6 @@
|
|
|
290
291
|
"RECENT_PROJECTS":"Останні проекти",
|
|
291
292
|
"OTHER_PROJECTS":"Інші проекти"
|
|
292
293
|
},
|
|
293
|
-
"JSON_RESPONSE":"Відповідь JSON"
|
|
294
|
+
"JSON_RESPONSE":"Відповідь JSON",
|
|
295
|
+
"LIVE":"Жити"
|
|
294
296
|
}
|
package/src/assets/i18n/uz.json
CHANGED
|
@@ -83,6 +83,7 @@
|
|
|
83
83
|
"INFO_SUPPORT_MEMBER_LEFT_GROUP":"guruhdan olib tashlandi",
|
|
84
84
|
"INFO_SUPPORT_MEMBER_ABANDONED_GROUP":"suhbatni tark etdi",
|
|
85
85
|
"INFO_A_NEW_SUPPORT_REQUEST_HAS_BEEN_ASSIGNED_TO_YOU": "Sizga yangi qoʻllab-quvvatlash soʻrovi tayinlandi",
|
|
86
|
+
"INFO_SUPPORT_LIVE_PAGE":"Koʻchirildi",
|
|
86
87
|
"LABEL_PROFILE": "Profil",
|
|
87
88
|
"LABEL_CLOSE": "Yopiq",
|
|
88
89
|
"LABEL_DISCONNECT": "Ulanishni uzing",
|
|
@@ -291,5 +292,6 @@
|
|
|
291
292
|
"RECENT_PROJECTS":"So'nggi loyihalar",
|
|
292
293
|
"OTHER_PROJECTS":"Boshqa loyihalar"
|
|
293
294
|
},
|
|
294
|
-
"JSON_RESPONSE":"JSON javobi"
|
|
295
|
+
"JSON_RESPONSE":"JSON javobi",
|
|
296
|
+
"LIVE":"Jonli"
|
|
295
297
|
}
|
|
@@ -18,7 +18,7 @@ import { ConversationHandlerService } from '../abstract/conversation-handler.ser
|
|
|
18
18
|
import { LoggerService } from '../abstract/logger.service';
|
|
19
19
|
import { LoggerInstance } from '../logger/loggerInstance';
|
|
20
20
|
// utils
|
|
21
|
-
import { MSG_STATUS_RECEIVED, CHAT_REOPENED, CHAT_CLOSED, MEMBER_JOINED_GROUP, TYPE_DIRECT, MESSAGE_TYPE_INFO, TOUCHING_OPERATOR, LEAD_UPDATED, MEMBER_LEFT_GROUP } from '../../utils/constants';
|
|
21
|
+
import { MSG_STATUS_RECEIVED, CHAT_REOPENED, CHAT_CLOSED, MEMBER_JOINED_GROUP, TYPE_DIRECT, MESSAGE_TYPE_INFO, TOUCHING_OPERATOR, LEAD_UPDATED, MEMBER_LEFT_GROUP, LIVE_PAGE } from '../../utils/constants';
|
|
22
22
|
import { compareValues, searchIndexInArrayForUid, conversationMessagesRef } from '../../utils/utils';
|
|
23
23
|
|
|
24
24
|
|
|
@@ -99,7 +99,10 @@ export class FirebaseConversationHandler extends ConversationHandlerService {
|
|
|
99
99
|
this.ref = firebaseMessages.orderByChild('timestamp').limitToLast(100);
|
|
100
100
|
this.ref.on('child_added', (childSnapshot) => {
|
|
101
101
|
that.logger.debug('[FIREBASEConversationHandlerSERVICE] >>>>>>>>>>>>>> child_added: ', childSnapshot.val())
|
|
102
|
-
|
|
102
|
+
const msg: MessageModel = childSnapshot.val();
|
|
103
|
+
msg.uid = childSnapshot.key;
|
|
104
|
+
|
|
105
|
+
that.addedNew(msg);
|
|
103
106
|
});
|
|
104
107
|
this.ref.on('child_changed', (childSnapshot) => {
|
|
105
108
|
that.logger.debug('[FIREBASEConversationHandlerSERVICE] >>>>>>>>>>>>>> child_changed: ', childSnapshot.val())
|
|
@@ -253,6 +256,23 @@ export class FirebaseConversationHandler extends ConversationHandlerService {
|
|
|
253
256
|
this.messageAdded.next(msg);
|
|
254
257
|
}
|
|
255
258
|
|
|
259
|
+
private addedNew(message:MessageModel){
|
|
260
|
+
const msg = this.messageCommandGenerate(message);
|
|
261
|
+
if(this.isValidMessage(msg)){
|
|
262
|
+
if (this.skipMessage && messageType(MESSAGE_TYPE_INFO, msg)) {
|
|
263
|
+
return;
|
|
264
|
+
}
|
|
265
|
+
if(!this.skipMessage && messageType(MESSAGE_TYPE_INFO, msg)) {
|
|
266
|
+
this.messageInfo.next(msg)
|
|
267
|
+
}
|
|
268
|
+
this.addRepalceMessageInArray(msg.uid, msg);
|
|
269
|
+
this.messageAdded.next(msg);
|
|
270
|
+
} else {
|
|
271
|
+
this.logger.error('[FIREBASEConversationHandlerSERVICE] ADDED::message with uid: ', msg.uid, 'is not valid')
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
}
|
|
275
|
+
|
|
256
276
|
/** */
|
|
257
277
|
private changed(childSnapshot: any) {
|
|
258
278
|
const msg = this.messageGenerate(childSnapshot);
|
|
@@ -298,16 +318,34 @@ export class FirebaseConversationHandler extends ConversationHandlerService {
|
|
|
298
318
|
// msg.emoticon = isEmojii(msg.text)
|
|
299
319
|
|
|
300
320
|
// traduco messaggi se sono del server
|
|
301
|
-
if (
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
321
|
+
if (messageType(MESSAGE_TYPE_INFO, msg)) {
|
|
322
|
+
this.translateInfoSupportMessages(msg);
|
|
323
|
+
}
|
|
324
|
+
return msg;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
private messageCommandGenerate(message:MessageModel){
|
|
328
|
+
const msg: MessageModel = message;
|
|
329
|
+
if(msg.text) msg.text = msg.text.trim(); //remove black msg with only spaces
|
|
330
|
+
// controllo fatto per i gruppi da rifattorizzare
|
|
331
|
+
if (!msg.sender_fullname || msg.sender_fullname === 'undefined') {
|
|
332
|
+
msg.sender_fullname = msg.sender;
|
|
305
333
|
}
|
|
306
|
-
|
|
307
|
-
// if (msg.
|
|
308
|
-
//
|
|
309
|
-
//
|
|
334
|
+
// bonifico messaggio da url
|
|
335
|
+
// if (msg.type === 'text') {
|
|
336
|
+
// msg.text = htmlEntities(msg.text)
|
|
337
|
+
// msg.text = replaceEndOfLine(msg.text)
|
|
310
338
|
// }
|
|
339
|
+
|
|
340
|
+
// verifico che il sender è il logged user
|
|
341
|
+
msg.isSender = this.isSender(msg.sender, this.loggedUser.uid);
|
|
342
|
+
//check if message contains only an emojii
|
|
343
|
+
// msg.emoticon = isEmojii(msg.text)
|
|
344
|
+
|
|
345
|
+
// traduco messaggi se sono del server
|
|
346
|
+
if (messageType(MESSAGE_TYPE_INFO, msg)) {
|
|
347
|
+
this.translateInfoSupportMessages(msg);
|
|
348
|
+
}
|
|
311
349
|
return msg;
|
|
312
350
|
}
|
|
313
351
|
|
|
@@ -336,7 +374,8 @@ export class FirebaseConversationHandler extends ConversationHandlerService {
|
|
|
336
374
|
const INFO_SUPPORT_LEAD_UPDATED = this.translationMap.get('INFO_SUPPORT_LEAD_UPDATED');
|
|
337
375
|
const INFO_SUPPORT_MEMBER_LEFT_GROUP = this.translationMap.get('INFO_SUPPORT_MEMBER_LEFT_GROUP');
|
|
338
376
|
const INFO_A_NEW_SUPPORT_REQUEST_HAS_BEEN_ASSIGNED_TO_YOU = this.translationMap.get('INFO_A_NEW_SUPPORT_REQUEST_HAS_BEEN_ASSIGNED_TO_YOU');
|
|
339
|
-
|
|
377
|
+
const INFO_SUPPORT_LIVE_PAGE = this.translationMap.get('INFO_SUPPORT_LIVE_PAGE');
|
|
378
|
+
|
|
340
379
|
if (message.attributes.messagelabel
|
|
341
380
|
&& message.attributes.messagelabel.parameters
|
|
342
381
|
&& message.attributes.messagelabel.key === MEMBER_JOINED_GROUP
|
|
@@ -377,13 +416,22 @@ export class FirebaseConversationHandler extends ConversationHandlerService {
|
|
|
377
416
|
} else if ((message.attributes.messagelabel && message.attributes.messagelabel.key === LEAD_UPDATED)) {
|
|
378
417
|
message.text = INFO_SUPPORT_LEAD_UPDATED;
|
|
379
418
|
} else if ((message.attributes.messagelabel && message.attributes.messagelabel.key === MEMBER_LEFT_GROUP)) {
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
419
|
+
let subject: string;
|
|
420
|
+
if (message.attributes.messagelabel.parameters.fullname) {
|
|
421
|
+
subject = message.attributes.messagelabel.parameters.fullname;
|
|
422
|
+
}else{
|
|
423
|
+
subject = message.attributes.messagelabel.parameters.member_id;
|
|
424
|
+
}
|
|
425
|
+
message.text = subject + ' ' + INFO_SUPPORT_MEMBER_LEFT_GROUP ;
|
|
426
|
+
} else if(message.attributes.messagelabel && message.attributes.messagelabel.key === LIVE_PAGE){
|
|
427
|
+
let sourceUrl: string = '';
|
|
428
|
+
if(message.attributes && message.attributes.sourcePage){
|
|
429
|
+
sourceUrl = message.attributes.sourcePage
|
|
430
|
+
}
|
|
431
|
+
if(message.attributes && message.attributes.sourceTitle){
|
|
432
|
+
sourceUrl = '['+message.attributes.sourceTitle+']('+sourceUrl+')'
|
|
433
|
+
}
|
|
434
|
+
message.text= INFO_SUPPORT_LIVE_PAGE + ': ' + sourceUrl
|
|
387
435
|
}
|
|
388
436
|
}
|
|
389
437
|
|
|
@@ -443,4 +491,35 @@ export class FirebaseConversationHandler extends ConversationHandlerService {
|
|
|
443
491
|
}
|
|
444
492
|
});
|
|
445
493
|
}
|
|
494
|
+
|
|
495
|
+
private isValidMessage(msgToCkeck:MessageModel): boolean{
|
|
496
|
+
// console.log('message to check-->', msgToCkeck)
|
|
497
|
+
// if(!this.isValidField(msgToCkeck.uid)){
|
|
498
|
+
// return false;
|
|
499
|
+
// }
|
|
500
|
+
// if(!this.isValidField(msgToCkeck.sender)){
|
|
501
|
+
// return false;
|
|
502
|
+
// }
|
|
503
|
+
// if(!this.isValidField(msgToCkeck.recipient)){
|
|
504
|
+
// return false;
|
|
505
|
+
// }
|
|
506
|
+
// if(!this.isValidField(msgToCkeck.type)){
|
|
507
|
+
// return false;
|
|
508
|
+
// }else if (msgToCkeck.type === "text" && !this.isValidField(msgToCkeck.text)){
|
|
509
|
+
// return false;
|
|
510
|
+
// } else if ((msgToCkeck.type === "image" || msgToCkeck.type === "file") && !this.isValidField(msgToCkeck.metadata) && !this.isValidField(msgToCkeck.metadata.src)){
|
|
511
|
+
// return false
|
|
512
|
+
// }
|
|
513
|
+
|
|
514
|
+
|
|
515
|
+
return true
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
/**
|
|
519
|
+
*
|
|
520
|
+
* @param field
|
|
521
|
+
*/
|
|
522
|
+
private isValidField(field: any): boolean {
|
|
523
|
+
return (field === null || field === undefined) ? false : true;
|
|
524
|
+
}
|
|
446
525
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TOUCHING_OPERATOR, LEAD_UPDATED, MEMBER_LEFT_GROUP } from './../../utils/constants';
|
|
1
|
+
import { TOUCHING_OPERATOR, LEAD_UPDATED, MEMBER_LEFT_GROUP, LIVE_PAGE } from './../../utils/constants';
|
|
2
2
|
import { Inject, Injectable } from '@angular/core';
|
|
3
3
|
import { BehaviorSubject } from 'rxjs';
|
|
4
4
|
|
|
@@ -99,7 +99,10 @@ export class MQTTConversationHandler extends ConversationHandlerService {
|
|
|
99
99
|
}
|
|
100
100
|
this.chat21Service.chatClient.lastMessages(this.conversationWith, (err, messages) => {
|
|
101
101
|
if (!err) {
|
|
102
|
-
messages.forEach(
|
|
102
|
+
messages.forEach(message => {
|
|
103
|
+
const msg: MessageModel = message;
|
|
104
|
+
msg.uid = message.message_id;
|
|
105
|
+
|
|
103
106
|
this.addedMessage(msg);
|
|
104
107
|
});
|
|
105
108
|
}
|
|
@@ -107,7 +110,10 @@ export class MQTTConversationHandler extends ConversationHandlerService {
|
|
|
107
110
|
const handler_message_added = this.chat21Service.chatClient.onMessageAddedInConversation(
|
|
108
111
|
this.conversationWith, (message, topic) => {
|
|
109
112
|
this.logger.log('[MQTTConversationHandler] message added:', message, 'on topic:', topic);
|
|
110
|
-
|
|
113
|
+
const msg: MessageModel = message;
|
|
114
|
+
msg.uid = message.message_id;
|
|
115
|
+
|
|
116
|
+
this.addedMessage(msg);
|
|
111
117
|
});
|
|
112
118
|
const handler_message_updated = this.chat21Service.chatClient.onMessageUpdatedInConversation(
|
|
113
119
|
this.conversationWith, (message, topic) => {
|
|
@@ -231,20 +237,14 @@ export class MQTTConversationHandler extends ConversationHandlerService {
|
|
|
231
237
|
/** */
|
|
232
238
|
private addedMessage(messageSnapshot: any) {
|
|
233
239
|
const msg = this.messageGenerate(messageSnapshot);
|
|
234
|
-
|
|
240
|
+
|
|
235
241
|
if(this.skipInfoMessage && messageType(MESSAGE_TYPE_INFO, msg)){
|
|
236
242
|
return;
|
|
237
243
|
}
|
|
238
244
|
if(!this.skipInfoMessage && messageType(MESSAGE_TYPE_INFO, msg)){
|
|
239
245
|
this.messageInfo.next(msg)
|
|
240
246
|
}
|
|
241
|
-
|
|
242
|
-
msg.headerDate = null;
|
|
243
|
-
const headerDate = setHeaderDate(this.translationMap, msg.timestamp);
|
|
244
|
-
if (headerDate !== this.lastDate) {
|
|
245
|
-
this.lastDate = headerDate;
|
|
246
|
-
msg.headerDate = headerDate;
|
|
247
|
-
}
|
|
247
|
+
|
|
248
248
|
this.logger.log('[MQTTConversationHandler] adding message:' + JSON.stringify(msg));
|
|
249
249
|
// this.logger.log('childSnapshot.message_id:' + msg.message_id);
|
|
250
250
|
// this.logger.log('childSnapshot.key:' + msg.key);
|
|
@@ -287,7 +287,7 @@ export class MQTTConversationHandler extends ConversationHandlerService {
|
|
|
287
287
|
// const msg: MessageModel = childSnapshot.val();
|
|
288
288
|
this.logger.log("[MQTTConversationHandler] childSnapshot >" + JSON.stringify(childSnapshot));
|
|
289
289
|
const msg = childSnapshot;
|
|
290
|
-
msg.uid = childSnapshot.key;
|
|
290
|
+
// msg.uid = childSnapshot.key;
|
|
291
291
|
msg.text = msg.text.trim() //remove black msg with only spaces
|
|
292
292
|
// controllo fatto per i gruppi da rifattorizzare
|
|
293
293
|
if (!msg.sender_fullname || msg.sender_fullname === 'undefined') {
|
|
@@ -301,10 +301,8 @@ export class MQTTConversationHandler extends ConversationHandlerService {
|
|
|
301
301
|
this.logger.log("[MQTTConversationHandler] ****>msg.sender:" + msg.sender);
|
|
302
302
|
msg.isSender = this.isSender(msg.sender, this.loggedUser.uid);
|
|
303
303
|
// traduco messaggi se sono del server
|
|
304
|
-
if (
|
|
305
|
-
|
|
306
|
-
this.translateInfoSupportMessages(msg);
|
|
307
|
-
}
|
|
304
|
+
if (messageType(MESSAGE_TYPE_INFO, msg)) {
|
|
305
|
+
this.translateInfoSupportMessages(msg);
|
|
308
306
|
}
|
|
309
307
|
return msg;
|
|
310
308
|
}
|
|
@@ -334,7 +332,8 @@ export class MQTTConversationHandler extends ConversationHandlerService {
|
|
|
334
332
|
const INFO_SUPPORT_LEAD_UPDATED = this.translationMap.get('INFO_SUPPORT_LEAD_UPDATED');
|
|
335
333
|
const INFO_SUPPORT_MEMBER_LEFT_GROUP = this.translationMap.get('INFO_SUPPORT_MEMBER_LEFT_GROUP');
|
|
336
334
|
const INFO_A_NEW_SUPPORT_REQUEST_HAS_BEEN_ASSIGNED_TO_YOU = this.translationMap.get('INFO_A_NEW_SUPPORT_REQUEST_HAS_BEEN_ASSIGNED_TO_YOU');
|
|
337
|
-
|
|
335
|
+
const INFO_SUPPORT_LIVE_PAGE = this.translationMap.get('INFO_SUPPORT_LIVE_PAGE');
|
|
336
|
+
|
|
338
337
|
if (message.attributes.messagelabel
|
|
339
338
|
&& message.attributes.messagelabel.parameters
|
|
340
339
|
&& message.attributes.messagelabel.key === MEMBER_JOINED_GROUP
|
|
@@ -381,6 +380,15 @@ export class MQTTConversationHandler extends ConversationHandlerService {
|
|
|
381
380
|
subject = message.attributes.messagelabel.parameters.member_id;
|
|
382
381
|
}
|
|
383
382
|
message.text = subject + ' ' + INFO_SUPPORT_MEMBER_LEFT_GROUP ;
|
|
383
|
+
} else if(message.attributes.messagelabel && message.attributes.messagelabel.key === LIVE_PAGE){
|
|
384
|
+
let sourceUrl: string = '';
|
|
385
|
+
if(message.attributes && message.attributes.sourcePage){
|
|
386
|
+
sourceUrl = message.attributes.sourcePage
|
|
387
|
+
}
|
|
388
|
+
if(message.attributes && message.attributes.sourceTitle){
|
|
389
|
+
sourceUrl = '['+message.attributes.sourceTitle+']('+sourceUrl+')'
|
|
390
|
+
}
|
|
391
|
+
message.text= INFO_SUPPORT_LIVE_PAGE + ': ' + sourceUrl
|
|
384
392
|
}
|
|
385
393
|
}
|
|
386
394
|
|
|
@@ -158,7 +158,7 @@ export class MQTTConversationsHandler extends ConversationsHandlerService {
|
|
|
158
158
|
this.changed(conversation);
|
|
159
159
|
}
|
|
160
160
|
else {
|
|
161
|
-
this.logger.log('[MQTTConversationsHandler]Added conv -> Added!')
|
|
161
|
+
this.logger.log('[MQTTConversationsHandler] Added conv -> Added!')
|
|
162
162
|
this.added(conversation);
|
|
163
163
|
}
|
|
164
164
|
});
|
|
@@ -252,6 +252,7 @@ export class MQTTConversationsHandler extends ConversationsHandlerService {
|
|
|
252
252
|
conversation.conversation_with = conversation.conversWith // conversWith comes from remote
|
|
253
253
|
}
|
|
254
254
|
const index = searchIndexInArrayForUid(this.conversations, conversation.conversation_with);
|
|
255
|
+
const oldConversation = this.conversations[index]
|
|
255
256
|
if (index > -1) {
|
|
256
257
|
// const conv = this.conversations[index];
|
|
257
258
|
this.logger.log("Conversation to update found", this.conversations[index]);
|
|
@@ -259,6 +260,7 @@ export class MQTTConversationsHandler extends ConversationsHandlerService {
|
|
|
259
260
|
this.logger.debug('[MQTTConversationsHandler] conversationchanged.isnew', JSON.stringify(conversation))
|
|
260
261
|
this.logger.log("this.conversations:" + JSON.stringify(this.conversations));
|
|
261
262
|
this.logger.log("Conversation updated --> ", this.conversations[index]);
|
|
263
|
+
this.conversationChangedDetailed.next({value: this.conversations[index], previousValue: oldConversation})
|
|
262
264
|
this.conversationChanged.next(this.conversations[index]);
|
|
263
265
|
this.conversations.sort(compareValues('timestamp', 'desc'));
|
|
264
266
|
}
|
|
@@ -61,14 +61,14 @@ export const TYPE_POPUP_DETAIL_MESSAGE = 'DETAIL_MESSAGE';
|
|
|
61
61
|
export const MESSAGE_TYPE_INFO = 'INFO';
|
|
62
62
|
export const MESSAGE_TYPE_MINE = 'MINE';
|
|
63
63
|
export const MESSAGE_TYPE_OTHERS = 'OTHERS';
|
|
64
|
-
export const MESSAGE_TYPE_DATE = 'DATE';
|
|
65
64
|
|
|
66
65
|
export const CHAT_REOPENED = 'CHAT_REOPENED';
|
|
67
66
|
export const CHAT_CLOSED = 'CHAT_CLOSED';
|
|
68
67
|
export const MEMBER_JOINED_GROUP = 'MEMBER_JOINED_GROUP';
|
|
69
|
-
export const MEMBER_LEFT_GROUP = "MEMBER_LEFT_GROUP"
|
|
68
|
+
export const MEMBER_LEFT_GROUP = "MEMBER_LEFT_GROUP";
|
|
70
69
|
export const LEAD_UPDATED = "LEAD_UPDATED";
|
|
71
70
|
export const TOUCHING_OPERATOR = "TOUCHING_OPERATOR";
|
|
71
|
+
export const LIVE_PAGE = "LIVE_PAGE"
|
|
72
72
|
|
|
73
73
|
|
|
74
74
|
// URLS
|
|
@@ -2,7 +2,6 @@ import {
|
|
|
2
2
|
MESSAGE_TYPE_INFO,
|
|
3
3
|
MESSAGE_TYPE_MINE,
|
|
4
4
|
MESSAGE_TYPE_OTHERS,
|
|
5
|
-
MESSAGE_TYPE_DATE,
|
|
6
5
|
MAX_WIDTH_IMAGES,
|
|
7
6
|
CHANNEL_TYPE_GROUP,
|
|
8
7
|
TYPE_SUPPORT_GROUP
|
|
@@ -65,12 +64,7 @@ export function isMine(message: any) {
|
|
|
65
64
|
|
|
66
65
|
/** */
|
|
67
66
|
export function messageType(msgType: string, message: any) {
|
|
68
|
-
|
|
69
|
-
if (message.headerDate && message.headerDate !== '') {
|
|
70
|
-
return true;
|
|
71
|
-
}
|
|
72
|
-
return false;
|
|
73
|
-
}
|
|
67
|
+
|
|
74
68
|
if (msgType === MESSAGE_TYPE_INFO) {
|
|
75
69
|
return isInfo(message);
|
|
76
70
|
}
|
|
@@ -187,6 +187,9 @@ export function setHeaderDate_old(translate, timestamp, lastDate?): string {
|
|
|
187
187
|
}
|
|
188
188
|
}
|
|
189
189
|
|
|
190
|
+
/**
|
|
191
|
+
* @deprecated
|
|
192
|
+
*/
|
|
190
193
|
export function setHeaderDate(translate, timestamp): string {
|
|
191
194
|
// const LABEL_TODAY = translate.get('LABEL_TODAY');
|
|
192
195
|
// const LABEL_TOMORROW = translate.get('LABEL_TOMORROW');
|
package/src/global.scss
CHANGED
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
<ion-header no-border class="ion-no-border">
|
|
2
|
-
<ion-toolbar style="height:60px">
|
|
3
|
-
<div class="flex-container">
|
|
4
|
-
<div class="back-flex-container">
|
|
5
|
-
<ion-buttons slot="start" style="height:60px">
|
|
6
|
-
<!-- (click)="pushPage('conversations-list')" defaultHref="/conversations-list" -->
|
|
7
|
-
<ion-back-button style="display: block;" text="" *ngIf="isMobile" (click)="goBackToConversationList()">
|
|
8
|
-
</ion-back-button>
|
|
9
|
-
</ion-buttons>
|
|
10
|
-
</div>
|
|
11
|
-
<div class="user-info-flex-container">
|
|
12
|
-
<div style="display: flex;">
|
|
13
|
-
<div>1</div>
|
|
14
|
-
<div>2</div>
|
|
15
|
-
</div>
|
|
16
|
-
</div>
|
|
17
|
-
|
|
18
|
-
<div class="resolve-flex-container">
|
|
19
|
-
<ion-buttons slot="end">
|
|
20
|
-
|
|
21
|
-
<!-- <ion-button ion-button fill="clear" color="primary" size="small" (click)="presentCreateTicketModal()" [ngClass]="{'resolve-conv-margin-right': !isMobile}">
|
|
22
|
-
<ion-icon name="ticket-outline"></ion-icon>
|
|
23
|
-
<span style="text-transform: capitalize; margin-left: 5px;"> {{ 'Crea ticket' | translate}} </span>
|
|
24
|
-
</ion-button> -->
|
|
25
|
-
|
|
26
|
-
<ion-button *ngIf="conversationUid?.startsWith('support-group') && conv_type !== 'archived'" ion-button fill="clear" color="primary" size="small"
|
|
27
|
-
(click)="closeConversation()" [ngClass]="{'resolve-conv-margin-right': !isMobile}" [disabled]="conv_closed === true">
|
|
28
|
-
<!-- <ion-icon slot="icon-only" name="alert-circle-outline"></ion-icon> -->
|
|
29
|
-
<ion-icon name="archive-outline"></ion-icon>
|
|
30
|
-
<!-- <ion-icon slot="icon-only" name="information-outline"></ion-icon> -->
|
|
31
|
-
<span style="text-transform: capitalize; margin-left: 5px;"> {{ 'Resolve' | translate}} </span>
|
|
32
|
-
</ion-button>
|
|
33
|
-
|
|
34
|
-
<ion-button *ngIf="!openInfoConversation" ion-button fill="clear" (click)="onOpenCloseInfoConversation()">
|
|
35
|
-
<!-- <ion-icon slot="icon-only" name="alert-circle-outline"></ion-icon> -->
|
|
36
|
-
<ion-icon slot="icon-only" name="information-circle-outline"></ion-icon>
|
|
37
|
-
<!-- <ion-icon slot="icon-only" name="information-outline"></ion-icon> -->
|
|
38
|
-
|
|
39
|
-
</ion-button>
|
|
40
|
-
<ion-button *ngIf="openInfoConversation" ion-button fill="clear" (click)="onOpenCloseInfoConversation()">
|
|
41
|
-
<ion-icon slot="icon-only" name="close-circle-outline"></ion-icon>
|
|
42
|
-
</ion-button>
|
|
43
|
-
|
|
44
|
-
</ion-buttons>
|
|
45
|
-
</div>
|
|
46
|
-
|
|
47
|
-
</div>
|
|
48
|
-
</ion-toolbar>
|
|
49
|
-
</ion-header>
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
<ion-title>
|
|
55
|
-
|
|
56
|
-
<div *ngIf="conversationAvatar" class="avatar-and-typing-wpr" >
|
|
57
|
-
<!-- [ngStyle] = "{ 'left': platformName === 'ios' ? '55px' : '' }" -->
|
|
58
|
-
<div *ngIf="conversationAvatar" class="avatar-container" (click)="onOpenCloseInfoConversation()" style="cursor: pointer"
|
|
59
|
-
[ngClass]="{ 'avatar-container-ios': platformName === 'ios' }">
|
|
60
|
-
<app-avatar-profile [itemAvatar]=conversationAvatar></app-avatar-profile>
|
|
61
|
-
</div>
|
|
62
|
-
<!-- [ngStyle] = "{ 'left': platformName === 'ios' ? '63px' : '' }" -->
|
|
63
|
-
<div *ngIf="isDirect" class="user-presence" [ngClass]="{ 'user-presence-ios': platformName === 'ios' }">
|
|
64
|
-
<app-user-presence [idUser]=conversationAvatar.conversation_with [translationMap]=translationMap
|
|
65
|
-
[borderColor]=borderColor [fontColor]=fontColor>
|
|
66
|
-
</app-user-presence>
|
|
67
|
-
</div>
|
|
68
|
-
|
|
69
|
-
<div *ngIf="conversationAvatar" class="user-typing">
|
|
70
|
-
<app-user-typing [idConversation]=conversationAvatar.uid [idCurrentUser]=idLoggedUser [isDirect]=isDirect
|
|
71
|
-
[translationMap]=translationMap [color]=fontColor [membersConversation]=membersConversation>
|
|
72
|
-
</app-user-typing>
|
|
73
|
-
</div>
|
|
74
|
-
|
|
75
|
-
</div>
|
|
76
|
-
<!-- [ngClass] = "{ 'tile-info-with-ios': platformName === 'ios' ? '82px' : ''82px'' }" -->
|
|
77
|
-
<!-- (click)="onOpenCloseInfoConversation()" -->
|
|
78
|
-
<div *ngIf="conversationAvatar" class="tile-info-with"
|
|
79
|
-
[ngClass]="{ 'tile-info-with-ios': platformName === 'ios' }">
|
|
80
|
-
<span class="tile-username">{{ conversationAvatar.conversation_with_fullname | truncate:50 }} </span>
|
|
81
|
-
<!-- <span class="tile-username">{{ conversation_with_fullname }} </span> -->
|
|
82
|
-
|
|
83
|
-
</div>
|
|
84
|
-
|
|
85
|
-
<!-- <div *ngIf="conversationWithFullname" class="tile-info-with" (click)="onOpenCloseInfoConversation()">
|
|
86
|
-
<span class="tile-username">{{ conversationWithFullname }} </span>
|
|
87
|
-
</div> -->
|
|
88
|
-
|
|
89
|
-
</ion-title>
|
|
90
|
-
<!-- openInfoConversation {{openInfoConversation}} -->
|
|
91
|
-
<ion-buttons slot="end">
|
|
92
|
-
|
|
93
|
-
<!-- <ion-button ion-button fill="clear" color="primary" size="small" (click)="presentCreateTicketModal()" [ngClass]="{'resolve-conv-margin-right': !isMobile}">
|
|
94
|
-
<ion-icon name="ticket-outline"></ion-icon>
|
|
95
|
-
<span style="text-transform: capitalize; margin-left: 5px;"> {{ 'Crea ticket' | translate}} </span>
|
|
96
|
-
</ion-button> -->
|
|
97
|
-
|
|
98
|
-
<ion-button *ngIf="conversationUid?.startsWith('support-group') && conv_type !== 'archived'" ion-button fill="clear" color="primary" size="small"
|
|
99
|
-
(click)="closeConversation()" [ngClass]="{'resolve-conv-margin-right': !isMobile}" [disabled]="conv_closed === true">
|
|
100
|
-
<!-- <ion-icon slot="icon-only" name="alert-circle-outline"></ion-icon> -->
|
|
101
|
-
<ion-icon name="archive-outline"></ion-icon>
|
|
102
|
-
<!-- <ion-icon slot="icon-only" name="information-outline"></ion-icon> -->
|
|
103
|
-
<span style="text-transform: capitalize; margin-left: 5px;"> {{ 'Resolve' | translate}} </span>
|
|
104
|
-
</ion-button>
|
|
105
|
-
|
|
106
|
-
<ion-button *ngIf="!openInfoConversation" ion-button fill="clear" (click)="onOpenCloseInfoConversation()">
|
|
107
|
-
<!-- <ion-icon slot="icon-only" name="alert-circle-outline"></ion-icon> -->
|
|
108
|
-
<ion-icon slot="icon-only" name="information-circle-outline"></ion-icon>
|
|
109
|
-
<!-- <ion-icon slot="icon-only" name="information-outline"></ion-icon> -->
|
|
110
|
-
|
|
111
|
-
</ion-button>
|
|
112
|
-
<ion-button *ngIf="openInfoConversation" ion-button fill="clear" (click)="onOpenCloseInfoConversation()">
|
|
113
|
-
<ion-icon slot="icon-only" name="close-circle-outline"></ion-icon>
|
|
114
|
-
</ion-button>
|
|
115
|
-
|
|
116
|
-
</ion-buttons>
|