@chat21/chat21-ionic 3.0.78 → 3.0.79-rc.2
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 +41 -1
- package/package.json +1 -1
- package/src/app/app.component.scss +2 -1
- package/src/app/app.component.ts +52 -7
- package/src/app/chatlib/conversation-detail/conversation-content/conversation-content.component.ts +8 -1
- package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.html +36 -10
- package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.scss +110 -38
- package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.ts +15 -2
- package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.html +1 -1
- package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.ts +3 -1
- package/src/app/chatlib/conversation-detail/message/buttons/action-button/action-button.component.html +5 -1
- package/src/app/chatlib/conversation-detail/message/buttons/action-button/action-button.component.scss +22 -15
- package/src/app/chatlib/conversation-detail/message/buttons/action-button/action-button.component.ts +25 -5
- package/src/app/chatlib/conversation-detail/message/buttons/link-button/link-button.component.html +2 -1
- package/src/app/chatlib/conversation-detail/message/buttons/link-button/link-button.component.scss +14 -15
- package/src/app/chatlib/conversation-detail/message/buttons/link-button/link-button.component.ts +24 -5
- package/src/app/chatlib/conversation-detail/message/buttons/text-button/text-button.component.html +6 -1
- package/src/app/chatlib/conversation-detail/message/buttons/text-button/text-button.component.scss +12 -13
- package/src/app/chatlib/conversation-detail/message/buttons/text-button/text-button.component.ts +26 -5
- package/src/app/chatlib/conversation-detail/message/info-message/info-message.component.scss +2 -2
- package/src/app/chatlib/conversation-detail/message/message-attachment/message-attachment.component.html +16 -6
- package/src/app/chatlib/conversation-detail/message/message-attachment/message-attachment.component.ts +2 -0
- package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.html +78 -52
- package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.scss +62 -20
- package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.ts +14 -10
- package/src/app/components/canned-response/canned-response.component.html +4 -4
- package/src/app/components/canned-response/canned-response.component.scss +1 -1
- package/src/app/components/canned-response/canned-response.component.ts +1 -0
- package/src/app/components/contacts-directory/contacts-directory.component.html +22 -26
- package/src/app/components/contacts-directory/contacts-directory.component.scss +8 -6
- package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.html +61 -42
- package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.scss +98 -61
- package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.ts +9 -25
- package/src/app/components/conversation-detail/message-text-area/message-text-area.component.scss +4 -4
- package/src/app/components/conversation-info/info-content/info-content.component.html +2 -1
- package/src/app/components/conversation-info/info-content/info-content.component.ts +3 -2
- package/src/app/components/conversation-info/info-direct/info-direct.component.html +1 -9
- package/src/app/components/conversation-info/info-direct/info-direct.component.ts +0 -2
- package/src/app/components/conversation-info/info-group/info-group.component.html +44 -108
- package/src/app/components/conversation-info/info-group/info-group.component.scss +101 -61
- package/src/app/components/conversation-info/info-group/info-group.component.ts +1 -0
- package/src/app/components/{ddp-header/ddp-header.component.html → conversations-list/header-conversations-list/header-conversations-list.component.html} +2 -2
- package/src/app/components/{ddp-header/ddp-header.component.scss → conversations-list/header-conversations-list/header-conversations-list.component.scss} +16 -4
- package/src/app/components/{ddp-header/ddp-header.component.spec.ts → conversations-list/header-conversations-list/header-conversations-list.component.spec.ts} +6 -6
- package/src/app/components/{ddp-header/ddp-header.component.ts → conversations-list/header-conversations-list/header-conversations-list.component.ts} +7 -16
- package/src/app/components/conversations-list/header-conversations-list-archived/header-conversations-list-archived.component.html +12 -0
- package/src/app/components/conversations-list/header-conversations-list-archived/header-conversations-list-archived.component.scss +14 -0
- package/src/app/components/{conversation-detail/option-header/option-header.component.spec.ts → conversations-list/header-conversations-list-archived/header-conversations-list-archived.component.spec.ts} +5 -5
- package/src/app/components/{conversation-detail/option-header/option-header.component.ts → conversations-list/header-conversations-list-archived/header-conversations-list-archived.component.ts} +5 -4
- package/src/app/components/project-item/project-item.component.html +98 -149
- package/src/app/components/project-item/project-item.component.scss +39 -32
- package/src/app/components/project-item/project-item.component.ts +5 -3
- package/src/app/components/utils/user-presence/user-presence.component.html +7 -2
- package/src/app/components/utils/user-presence/user-presence.component.scss +35 -18
- package/src/app/components/utils/user-presence/user-presence.component.ts +6 -10
- package/src/app/pages/contacts-directory/contacts-directory.page.html +1 -1
- package/src/app/pages/contacts-directory/contacts-directory.page.scss +41 -0
- package/src/app/pages/contacts-directory/contacts-directory.page.ts +2 -0
- package/src/app/pages/conversation-detail/conversation-detail.page.html +40 -23
- package/src/app/pages/conversation-detail/conversation-detail.page.scss +40 -250
- package/src/app/pages/conversation-detail/conversation-detail.page.ts +165 -46
- package/src/app/pages/conversations-list/conversations-list.page.html +11 -8
- package/src/app/pages/conversations-list/conversations-list.page.scss +10 -2
- package/src/app/pages/conversations-list/conversations-list.page.ts +22 -17
- package/src/app/pages/loader-preview/loader-preview.page.html +1 -1
- package/src/app/pages/loader-preview/loader-preview.page.scss +4 -0
- package/src/app/pages/profile-info/profile-info.page.html +2 -4
- package/src/app/pages/unassigned-conversations/unassigned-conversations.page.html +1 -1
- package/src/app/pages/unassigned-conversations/unassigned-conversations.page.scss +42 -0
- package/src/app/pages/unassigned-conversations/unassigned-conversations.page.ts +1 -0
- package/src/app/shared/shared.module.ts +24 -24
- package/src/assets/i18n/ar.json +270 -265
- package/src/assets/i18n/az.json +5 -0
- package/src/assets/i18n/de.json +5 -0
- package/src/assets/i18n/en.json +5 -0
- package/src/assets/i18n/es.json +5 -0
- package/src/assets/i18n/fr.json +5 -0
- package/src/assets/i18n/it.json +5 -0
- package/src/assets/i18n/kk.json +5 -0
- package/src/assets/i18n/pt.json +5 -0
- package/src/assets/i18n/ru.json +5 -0
- package/src/assets/i18n/sr.json +5 -0
- package/src/assets/i18n/sv.json +5 -0
- package/src/assets/i18n/tr.json +5 -0
- package/src/assets/i18n/uk.json +5 -0
- package/src/assets/i18n/uz.json +5 -0
- package/src/assets/sounds/wheep-wheep.mp3 +0 -0
- package/src/chat21-core/providers/firebase/firebase-typing.service.ts +7 -9
- package/src/chat21-core/utils/constants.ts +5 -1
- package/src/chat21-core/utils/user-typing/user-typing.component.html +8 -5
- package/src/chat21-core/utils/user-typing/user-typing.component.scss +87 -17
- package/src/chat21-core/utils/user-typing/user-typing.component.ts +12 -94
- package/src/chat21-core/utils/utils.ts +9 -1
- package/src/global.scss +47 -43
- package/src/variables.scss +26 -9
- package/src/app/components/conversation-detail/option-header/option-header.component.html +0 -13
- package/src/app/components/conversation-detail/option-header/option-header.component.scss +0 -0
|
@@ -113,16 +113,14 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
|
|
|
113
113
|
public lastConnectionDate: string
|
|
114
114
|
public showMessageWelcome: boolean
|
|
115
115
|
public openInfoConversation = false
|
|
116
|
-
public openInfoMessage: boolean // check is open info message
|
|
117
116
|
public isMobile = false
|
|
118
117
|
public isLessThan991px = false // nk added
|
|
119
|
-
public isTyping = false
|
|
120
|
-
public nameUserTypingNow: string
|
|
121
118
|
|
|
122
119
|
public heightMessageTextArea = ''
|
|
123
|
-
public
|
|
120
|
+
public translationsMap: Map<string, string> = new Map()
|
|
121
|
+
public translationsHeaderMap: Map<string, string> = new Map()
|
|
122
|
+
public translationsContentMap: Map<string, string> = new Map()
|
|
124
123
|
public conversationAvatar: any
|
|
125
|
-
public membersConversation: any
|
|
126
124
|
public member: UserModel
|
|
127
125
|
public urlConversationSupportGroup: any
|
|
128
126
|
public isFileSelected: boolean
|
|
@@ -148,7 +146,6 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
|
|
|
148
146
|
//SOUND
|
|
149
147
|
setTimeoutSound: any;
|
|
150
148
|
audio: any;
|
|
151
|
-
isOpenInfoConversation: boolean;
|
|
152
149
|
USER_HAS_OPENED_CLOSE_INFO_CONV: boolean = false;
|
|
153
150
|
isHovering: boolean = false;
|
|
154
151
|
conversation_count: number;
|
|
@@ -169,6 +166,15 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
|
|
|
169
166
|
public disableTextarea: boolean;
|
|
170
167
|
appsidebarIsWide: boolean;
|
|
171
168
|
|
|
169
|
+
// ========== begin:: typying =======
|
|
170
|
+
public isTypings = false;
|
|
171
|
+
public isDirect = false;
|
|
172
|
+
public idUserTypingNow: string;
|
|
173
|
+
public nameUserTypingNow: string;
|
|
174
|
+
private setTimeoutWritingMessages;
|
|
175
|
+
membersConversation = ['SYSTEM'];
|
|
176
|
+
// ========== end:: typying =======
|
|
177
|
+
|
|
172
178
|
/**
|
|
173
179
|
* Constructor
|
|
174
180
|
* @param route
|
|
@@ -237,21 +243,7 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
|
|
|
237
243
|
// -----------------------------------------------------------
|
|
238
244
|
ngOnInit() {
|
|
239
245
|
this.logger.log('[CONVS-DETAIL] > ngOnInit - window.location: ', window.location);
|
|
240
|
-
|
|
241
|
-
// const accept_files = this.appConfigProvider.getConfig().fileUploadAccept;
|
|
242
|
-
// this.logger.log('[CONVS-DETAIL] > ngOnInit - fileUploadAccept typeof accept_files ', typeof accept_files);
|
|
243
|
-
// const accept_files_array = accept_files.split(',')
|
|
244
|
-
// this.logger.log('[CONVS-DETAIL] > ngOnInit - fileUploadAccept accept_files_array ', accept_files_array);
|
|
245
|
-
// this.logger.log('[CONVS-DETAIL] > ngOnInit - fileUploadAccept accept_files_array typeof: ', typeof accept_files_array);
|
|
246
|
-
|
|
247
|
-
// accept_files_array.forEach(accept_file => {
|
|
248
|
-
// this.logger.log('[CONVS-DETAIL] > ngOnInit - fileUploadAccept accept_file ', accept_file);
|
|
249
|
-
// const accept_file_segment = accept_file.split('/')
|
|
250
|
-
// this.logger.log('[CONVS-DETAIL] > ngOnInit - fileUploadAccept accept_file_segment ', accept_file_segment);
|
|
251
|
-
// if (accept_file_segment[1] === '*') {
|
|
252
|
-
|
|
253
|
-
// }
|
|
254
|
-
// });
|
|
246
|
+
|
|
255
247
|
this.getConversations();
|
|
256
248
|
this.watchToConnectionStatus();
|
|
257
249
|
this.getOSCODE();
|
|
@@ -272,21 +264,21 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
|
|
|
272
264
|
// console.log('[CONVS-DETAIL] HAS CLICKED ENLARGE SIDEBAR WIDE chatAreaEle ', chatAreaEle)
|
|
273
265
|
|
|
274
266
|
if (event && event.data && event.data.action && event.data.action === 'openAppsSidebarWideMode' && event.data.parameter === true) {
|
|
275
|
-
this.logger.log('[CONVS-DETAIL]
|
|
267
|
+
this.logger.log('[CONVS-DETAIL] openAppsSidebarWideMode EVENT-> open' )
|
|
276
268
|
this.appsidebarIsWide = true
|
|
277
269
|
// chat21InfoConversationEle.classList.add("info-convs-apps-sidebar-wide");
|
|
278
270
|
// chatAreaEle.classList.add("chat-area-apps-sidebar-wide");
|
|
279
271
|
}
|
|
280
272
|
|
|
281
273
|
if (event && event.data && event.data.action && event.data.action === 'openAppsSidebarWideMode' && event.data.parameter === false) {
|
|
282
|
-
this.logger.log('[CONVS-DETAIL]
|
|
274
|
+
this.logger.log('[CONVS-DETAIL] openAppsSidebarWideMode EVENT-> close')
|
|
283
275
|
this.appsidebarIsWide = false
|
|
284
276
|
// chat21InfoConversationEle.classList.remove("info-convs-apps-sidebar-wide");
|
|
285
277
|
// chatAreaEle.classList.remove("chat-area-apps-sidebar-wide");
|
|
286
278
|
}
|
|
287
279
|
|
|
288
280
|
if (event && event.data && event.data.action && event.data.action === 'closeAppsSidebarWideMode' && event.data.parameter === true) {
|
|
289
|
-
this.logger.log('[CONVS-DETAIL]
|
|
281
|
+
this.logger.log('[CONVS-DETAIL] closeAppsSidebarWideMode EVENT-> close')
|
|
290
282
|
this.appsidebarIsWide = false
|
|
291
283
|
// chat21InfoConversationEle.classList.remove("info-convs-apps-sidebar-wide");
|
|
292
284
|
// chatAreaEle.classList.remove("chat-area-apps-sidebar-wide");
|
|
@@ -336,7 +328,12 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
|
|
|
336
328
|
// this.updateConversationBadge()
|
|
337
329
|
// }
|
|
338
330
|
if(conv.uid && conv.uid === this.conversationWith){
|
|
339
|
-
this.conversationAvatar = setConversationAvatar(
|
|
331
|
+
this.conversationAvatar = setConversationAvatar(
|
|
332
|
+
conv.conversation_with,
|
|
333
|
+
conv.conversation_with_fullname,
|
|
334
|
+
conv.channel_type,
|
|
335
|
+
conv.attributes['projectId'],
|
|
336
|
+
conv.attributes['project_name'])
|
|
340
337
|
}
|
|
341
338
|
|
|
342
339
|
}
|
|
@@ -474,6 +471,7 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
|
|
|
474
471
|
this.loggedUser = this.tiledeskAuthService.getCurrentUser()
|
|
475
472
|
this.logger.log('[CONVS-DETAIL] - initialize -> loggedUser: ', this.loggedUser)
|
|
476
473
|
this.translations()
|
|
474
|
+
this.setStyleMap()
|
|
477
475
|
// this.conversationSelected = localStorage.getItem('conversationSelected');
|
|
478
476
|
this.showButtonToBottom = false
|
|
479
477
|
this.showMessageWelcome = false
|
|
@@ -488,7 +486,6 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
|
|
|
488
486
|
|
|
489
487
|
this.messages = [] // list messages of conversation
|
|
490
488
|
this.isFileSelected = false // indicates if a file has been selected (image to upload)
|
|
491
|
-
this.openInfoMessage = false // indicates whether the info message panel is open
|
|
492
489
|
|
|
493
490
|
if (checkPlatformIsMobile()) {
|
|
494
491
|
this.isMobile = true
|
|
@@ -504,13 +501,11 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
|
|
|
504
501
|
if (checkWindowWidthIsLessThan991px()) {
|
|
505
502
|
this.logger.log('[CONVS-DETAIL] - initialize -> checkWindowWidthIsLessThan991px ', checkWindowWidthIsLessThan991px())
|
|
506
503
|
this.openInfoConversation = false // indica se è aperto il box info conversazione
|
|
507
|
-
this.
|
|
508
|
-
this.logger.log('[CONVS-DETAIL] - initialize -> openInfoConversation ', this.openInfoConversation, ' -> isOpenInfoConversation ', this.isOpenInfoConversation)
|
|
504
|
+
this.logger.log('[CONVS-DETAIL] - initialize -> openInfoConversation ', this.openInfoConversation)
|
|
509
505
|
} else {
|
|
510
506
|
this.logger.log('[CONVS-DETAIL] - initialize -> checkWindowWidthIsLessThan991px ', checkWindowWidthIsLessThan991px())
|
|
511
507
|
this.openInfoConversation = true
|
|
512
|
-
this.
|
|
513
|
-
this.logger.log('[CONVS-DETAIL] - initialize -> openInfoConversation ', this.openInfoConversation, ' -> isOpenInfoConversation ', this.isOpenInfoConversation)
|
|
508
|
+
this.logger.log('[CONVS-DETAIL] - initialize -> openInfoConversation ', this.openInfoConversation)
|
|
514
509
|
}
|
|
515
510
|
}
|
|
516
511
|
|
|
@@ -529,6 +524,8 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
|
|
|
529
524
|
this.addEventsKeyboard()
|
|
530
525
|
this.startConversation()
|
|
531
526
|
this.updateConversationBadge() // AGGIORNO STATO DELLA CONVERSAZIONE A 'LETTA' (is_new = false)
|
|
527
|
+
|
|
528
|
+
this.initializeTyping();
|
|
532
529
|
}
|
|
533
530
|
|
|
534
531
|
_getProjectIdByConversationWith(conversationWith: string) {
|
|
@@ -563,22 +560,12 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
|
|
|
563
560
|
})
|
|
564
561
|
}
|
|
565
562
|
|
|
566
|
-
returnOpenCloseInfoConversation(openInfoConversation: boolean) {
|
|
567
|
-
this.logger.log('[CONVS-DETAIL] returnOpenCloseInfoConversation - openInfoConversation ', openInfoConversation)
|
|
568
|
-
this.resizeTextArea()
|
|
569
|
-
this.openInfoMessage = false
|
|
570
|
-
this.openInfoConversation = openInfoConversation
|
|
571
|
-
this.isOpenInfoConversation = openInfoConversation
|
|
572
|
-
this.USER_HAS_OPENED_CLOSE_INFO_CONV = true
|
|
573
|
-
}
|
|
574
|
-
|
|
575
563
|
@HostListener('window:resize', ['$event'])
|
|
576
564
|
onResize(event: any) {
|
|
577
565
|
const newInnerWidth = event.target.innerWidth
|
|
578
566
|
if (newInnerWidth < 991) {
|
|
579
567
|
if (this.USER_HAS_OPENED_CLOSE_INFO_CONV === false) {
|
|
580
568
|
this.openInfoConversation = false
|
|
581
|
-
this.isOpenInfoConversation = false
|
|
582
569
|
}
|
|
583
570
|
}
|
|
584
571
|
}
|
|
@@ -597,7 +584,7 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
|
|
|
597
584
|
'LABEL_TO',
|
|
598
585
|
'LABEL_LAST_ACCESS',
|
|
599
586
|
'ARRAY_DAYS',
|
|
600
|
-
|
|
587
|
+
|
|
601
588
|
'LABEL_INFO_ADVANCED',
|
|
602
589
|
'ID_CONVERSATION',
|
|
603
590
|
'UPLOAD_FILE_ERROR',
|
|
@@ -616,11 +603,35 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
|
|
|
616
603
|
'THERE_ARE_NO_CANNED_RESPONSES_AVAILABLE',
|
|
617
604
|
'TO_CREATE_THEM_GO_TO_THE_PROJECT',
|
|
618
605
|
"AddNewCannedResponse",
|
|
619
|
-
"LABEL_LOADING"
|
|
606
|
+
"LABEL_LOADING",
|
|
607
|
+
"DIRECT_CHAT",
|
|
608
|
+
"GROUP_CHAT",
|
|
609
|
+
]
|
|
610
|
+
|
|
611
|
+
const keysHeader = [
|
|
612
|
+
'DIRECT_CHAT',
|
|
613
|
+
'GROUP_CHAT',
|
|
614
|
+
'LABEL_IS_WRITING',
|
|
615
|
+
'LABEL_ONLINE',
|
|
616
|
+
'LABEL_OFFLINE',
|
|
617
|
+
'LABEL_TODAY',
|
|
618
|
+
'LABEL_TOMORROW',
|
|
619
|
+
'LABEL_TO',
|
|
620
|
+
'LABEL_LAST_ACCESS',
|
|
621
|
+
'ARRAY_DAYS',
|
|
622
|
+
'Resolve',
|
|
620
623
|
]
|
|
621
624
|
|
|
622
|
-
|
|
623
|
-
|
|
625
|
+
const keysContentDetail = [
|
|
626
|
+
'LABEL_OPEN_INFO_CONVERSATION',
|
|
627
|
+
'LABEL_CLOSE_GROUP',
|
|
628
|
+
'LABEL_IS_WRITING',
|
|
629
|
+
]
|
|
630
|
+
|
|
631
|
+
this.translationsMap = this.customTranslateService.translateLanguage(keys)
|
|
632
|
+
this.translationsHeaderMap = this.customTranslateService.translateLanguage(keysHeader)
|
|
633
|
+
this.translationsContentMap = this.customTranslateService.translateLanguage(keysContentDetail)
|
|
634
|
+
this.logger.log('[CONVS-DETAIL] x this.translationMap ',this.translationsMap)
|
|
624
635
|
}
|
|
625
636
|
|
|
626
637
|
// --------------------------------------------------------
|
|
@@ -647,6 +658,19 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
|
|
|
647
658
|
return this.customTranslateService.translateLanguage(keys)
|
|
648
659
|
}
|
|
649
660
|
|
|
661
|
+
private setStyleMap(){
|
|
662
|
+
this.styleMap.set('themeColor', 'var(--basic-blue)')
|
|
663
|
+
.set('bubbleReceivedBackground','var(--bck-msg-received)')
|
|
664
|
+
.set('bubbleReceivedTextColor', 'var(--col-msg-received)')
|
|
665
|
+
.set('bubbleSentBackground', 'var(--bck-msg-sent)')
|
|
666
|
+
.set('bubbleSentTextColor', 'var(--col-msg-sent)')
|
|
667
|
+
.set('buttonFontSize','var(--button-in-msg-font-size)')
|
|
668
|
+
.set('buttonBackgroundColor', 'var(--buttonBackgroundColor)')
|
|
669
|
+
.set('buttonTextColor', 'var(--buttonTextColor)')
|
|
670
|
+
.set('buttonHoverBackgroundColor', 'var(--buttonHoverBackgroundColor)')
|
|
671
|
+
.set('buttonHoverTextColor', 'var(--buttonHoverTextColor)')
|
|
672
|
+
|
|
673
|
+
}
|
|
650
674
|
// -------------------------------------------------------------------------------------
|
|
651
675
|
// * retrieving the handler from chatManager
|
|
652
676
|
// * if it DOESN'T EXIST I create a handler and connect and store it in the chatmanager
|
|
@@ -749,6 +773,8 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
|
|
|
749
773
|
conv.conversation_with,
|
|
750
774
|
conv.conversation_with_fullname,
|
|
751
775
|
conv.channel_type,
|
|
776
|
+
conv.attributes['projectId'],
|
|
777
|
+
conv.attributes['project_name']
|
|
752
778
|
)
|
|
753
779
|
}
|
|
754
780
|
if(!conv){
|
|
@@ -761,6 +787,8 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
|
|
|
761
787
|
conv.conversation_with,
|
|
762
788
|
conv.conversation_with_fullname,
|
|
763
789
|
conv.channel_type,
|
|
790
|
+
conv.attributes['projectId'],
|
|
791
|
+
conv.attributes['project_name']
|
|
764
792
|
)
|
|
765
793
|
let duration = getDateDifference(conv.timestamp, Date.now())
|
|
766
794
|
duration.days > 10? this.disableTextarea = true: this.disableTextarea = false
|
|
@@ -779,6 +807,8 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
|
|
|
779
807
|
conv.conversation_with,
|
|
780
808
|
conv.conversation_with_fullname,
|
|
781
809
|
conv.channel_type,
|
|
810
|
+
conv.attributes['projectId'],
|
|
811
|
+
conv.attributes['project_name']
|
|
782
812
|
)
|
|
783
813
|
let duration = getDateDifference(conv.timestamp, Date.now())
|
|
784
814
|
duration.days > 10? this.disableTextarea = true: this.disableTextarea = false
|
|
@@ -790,6 +820,8 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
|
|
|
790
820
|
conv.conversation_with,
|
|
791
821
|
conv.conversation_with_fullname,
|
|
792
822
|
conv.channel_type,
|
|
823
|
+
conv.attributes['projectId'],
|
|
824
|
+
conv.attributes['project_name']
|
|
793
825
|
)
|
|
794
826
|
}
|
|
795
827
|
this.logger.log('[CONVS-DETAIL] - setHeaderContent > conversationAvatar: ', this.conversationAvatar)
|
|
@@ -977,6 +1009,22 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
|
|
|
977
1009
|
this.subscriptions.push(subscribe)
|
|
978
1010
|
}
|
|
979
1011
|
|
|
1012
|
+
subscriptionKey = 'conversationTyping';
|
|
1013
|
+
subscription = this.subscriptions.find(item => item.key === subscriptionKey);
|
|
1014
|
+
if (!subscription) {
|
|
1015
|
+
subscription = this.typingService.BSIsTyping.pipe(takeUntil(this.unsubscribe$)).subscribe((data: any) => {
|
|
1016
|
+
this.logger.debug('[CONVS-DETAIL] ***** BSIsTyping *****', data);
|
|
1017
|
+
if (data) {
|
|
1018
|
+
const isTypingUid = data.uid; //support-group-...
|
|
1019
|
+
if (this.conversationWith === isTypingUid) {
|
|
1020
|
+
that.subscribeTypings(data);
|
|
1021
|
+
}
|
|
1022
|
+
}
|
|
1023
|
+
});
|
|
1024
|
+
const subscribe = {key: subscriptionKey, value: subscription };
|
|
1025
|
+
this.subscriptions.push(subscribe);
|
|
1026
|
+
}
|
|
1027
|
+
|
|
980
1028
|
// subscriptionKey = 'onGroupChange';
|
|
981
1029
|
// subscription = this.subscriptions.find(item => item.key === subscriptionKey);
|
|
982
1030
|
// if (!subscription) {
|
|
@@ -1024,7 +1072,9 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
|
|
|
1024
1072
|
this.conversationAvatar = setConversationAvatar(
|
|
1025
1073
|
this.conversationWith,
|
|
1026
1074
|
this.conversationWithFullname,
|
|
1027
|
-
this.channelType
|
|
1075
|
+
this.channelType,
|
|
1076
|
+
this.conversation.attributes['projectId'],
|
|
1077
|
+
this.conversation.attributes['project_name']
|
|
1028
1078
|
)
|
|
1029
1079
|
|
|
1030
1080
|
}
|
|
@@ -1201,13 +1251,17 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
|
|
|
1201
1251
|
this.logger.log('[CONVS-DETAIL] - returnChangeTextArea --> beforeSlash', beforeSlash)
|
|
1202
1252
|
this.logger.log('[CONVS-DETAIL] - returnChangeTextArea --> afterSlash', afterSlash)
|
|
1203
1253
|
|
|
1254
|
+
console.log('bbbbbbb', beforeSlash[beforeSlash.length-1].indexOf(' '), afterSlash === '', this.HIDE_CANNED_RESPONSES)
|
|
1204
1255
|
|
|
1205
1256
|
if(beforeSlash[beforeSlash.length-1].indexOf(' ') >= 0 && afterSlash === ''){
|
|
1206
1257
|
this.HIDE_CANNED_RESPONSES = false
|
|
1258
|
+
console.log('bbbbbbb 1111', beforeSlash[beforeSlash.length-1])
|
|
1207
1259
|
} else if(beforeSlash[beforeSlash.length-1].indexOf(' ') < 0 && afterSlash === '' ){
|
|
1208
1260
|
this.HIDE_CANNED_RESPONSES = true
|
|
1261
|
+
console.log('bbbbbbb 22222', beforeSlash[beforeSlash.length-1])
|
|
1209
1262
|
} else if(beforeSlash[beforeSlash.length-1].indexOf(' ') >= 0 && afterSlash === ' '){
|
|
1210
1263
|
this.HIDE_CANNED_RESPONSES = true
|
|
1264
|
+
console.log('bbbbbbb 33333', beforeSlash[beforeSlash.length-1])
|
|
1211
1265
|
// this.tagsCannedFilter = []
|
|
1212
1266
|
}
|
|
1213
1267
|
}
|
|
@@ -1497,6 +1551,13 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
|
|
|
1497
1551
|
}
|
|
1498
1552
|
}
|
|
1499
1553
|
|
|
1554
|
+
onOpenCloseInfoConversation(event){
|
|
1555
|
+
this.logger.log('[CONVS-DETAIL] onOpenCloseInfoConversation - openInfoConversation ', event)
|
|
1556
|
+
this.resizeTextArea()
|
|
1557
|
+
this.openInfoConversation = event
|
|
1558
|
+
this.USER_HAS_OPENED_CLOSE_INFO_CONV = true
|
|
1559
|
+
}
|
|
1560
|
+
|
|
1500
1561
|
// -------------- START SCROLL/RESIZE -------------- //
|
|
1501
1562
|
/** */
|
|
1502
1563
|
resizeTextArea() {
|
|
@@ -1598,6 +1659,7 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
|
|
|
1598
1659
|
this.heightMessageTextArea = '57' // NK edited
|
|
1599
1660
|
}
|
|
1600
1661
|
}
|
|
1662
|
+
|
|
1601
1663
|
checkAcceptedFile(draggedFileMimeType) {
|
|
1602
1664
|
let isAcceptFile = false
|
|
1603
1665
|
this.logger.log('[CONVS-DETAIL] > checkAcceptedFile - fileUploadAccept: ',this.appConfigProvider.getConfig().fileUploadAccept)
|
|
@@ -1647,6 +1709,63 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
|
|
|
1647
1709
|
return isAcceptFile
|
|
1648
1710
|
}
|
|
1649
1711
|
}
|
|
1712
|
+
|
|
1713
|
+
|
|
1714
|
+
initializeTyping() {
|
|
1715
|
+
this.logger.debug('[CONVS-DETAIL] membersconversation', this.membersConversation)
|
|
1716
|
+
this.membersConversation.push(this.loggedUser.uid)
|
|
1717
|
+
//this.setSubscriptions();
|
|
1718
|
+
this.typingService.isTyping(this.conversationWith, this.loggedUser.uid, this.isDirect);
|
|
1719
|
+
|
|
1720
|
+
}
|
|
1721
|
+
|
|
1722
|
+
/** */
|
|
1723
|
+
subscribeTypings(data: any) {
|
|
1724
|
+
const that = this;
|
|
1725
|
+
try {
|
|
1726
|
+
const key = data.uidUserTypingNow;
|
|
1727
|
+
const waitTime = data.waitTime
|
|
1728
|
+
this.nameUserTypingNow = null;
|
|
1729
|
+
this.idUserTypingNow = null;
|
|
1730
|
+
|
|
1731
|
+
if (data.nameUserTypingNow) {
|
|
1732
|
+
this.nameUserTypingNow = data.nameUserTypingNow;
|
|
1733
|
+
}
|
|
1734
|
+
if (data.uidUserTypingNow){
|
|
1735
|
+
this.idUserTypingNow = data.uidUserTypingNow
|
|
1736
|
+
}
|
|
1737
|
+
this.logger.debug('[CONV-COMP] subscribeTypings data:', data);
|
|
1738
|
+
const userTyping = this.membersConversation.includes(key);
|
|
1739
|
+
if ( !userTyping && key) {
|
|
1740
|
+
this.isTypings = true;
|
|
1741
|
+
setTimeout(function () {
|
|
1742
|
+
that.scrollBottom(0)
|
|
1743
|
+
}, 0);
|
|
1744
|
+
// clearTimeout(this.setTimeoutWritingMessages);
|
|
1745
|
+
this.setTimeoutWritingMessages = setTimeout(() => {
|
|
1746
|
+
that.isTypings = false;
|
|
1747
|
+
}, waitTime);
|
|
1748
|
+
// this.initiTimeout(waitTime)
|
|
1749
|
+
}
|
|
1750
|
+
} catch (error) {
|
|
1751
|
+
this.logger.error('[CONV-COMP] error: ', error);
|
|
1752
|
+
}
|
|
1753
|
+
|
|
1754
|
+
}
|
|
1755
|
+
|
|
1756
|
+
initiTimeout(waitTime){
|
|
1757
|
+
const that = this;
|
|
1758
|
+
this.setTimeoutWritingMessages = setTimeout(() => {
|
|
1759
|
+
that.isTypings = false;
|
|
1760
|
+
}, waitTime);
|
|
1761
|
+
}
|
|
1762
|
+
|
|
1763
|
+
resetTimeout(){
|
|
1764
|
+
this.isTypings = false
|
|
1765
|
+
this.setTimeoutWritingMessages = null;
|
|
1766
|
+
clearTimeout(this.setTimeoutWritingMessages)
|
|
1767
|
+
}
|
|
1768
|
+
|
|
1650
1769
|
// -------------------------------------------------------------
|
|
1651
1770
|
// DRAG FILE
|
|
1652
1771
|
// -------------------------------------------------------------
|
|
@@ -1706,7 +1825,7 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
|
|
|
1706
1825
|
|
|
1707
1826
|
async presentToastOnlyImageFilesAreAllowedToDrag() {
|
|
1708
1827
|
const toast = await this.toastController.create({
|
|
1709
|
-
message: this.
|
|
1828
|
+
message: this.translationsMap.get('FAILED_TO_UPLOAD_THE_FORMAT_IS_NOT_SUPPORTED'),
|
|
1710
1829
|
duration: 5000,
|
|
1711
1830
|
color: 'danger',
|
|
1712
1831
|
cssClass: 'toast-custom-class',
|
|
@@ -1,35 +1,38 @@
|
|
|
1
|
-
<ion-header no-border class="ion-no-border">
|
|
2
|
-
<
|
|
1
|
+
<ion-header no-border class="ion-no-border" [class.mobile]="isMobile">
|
|
2
|
+
<header-conversations-list *ngIf="conversationType ==='active'"
|
|
3
3
|
[numberOpenConv]="numberOpenConv"
|
|
4
4
|
[supportMode]="supportMode"
|
|
5
5
|
[archived_btn]="archived_btn"
|
|
6
6
|
[writeto_btn]="writeto_btn"
|
|
7
7
|
[sound_btn]="sound_btn"
|
|
8
|
+
[isMobile]="isMobile"
|
|
8
9
|
(onSoundChange)="onSoundChange($event)"
|
|
9
10
|
(openContactsDirectory)=openContactsDirectory($event)
|
|
10
11
|
(openProfileInfo)=openProfileInfo($event)>
|
|
11
|
-
</
|
|
12
|
+
</header-conversations-list>
|
|
12
13
|
|
|
13
|
-
<
|
|
14
|
+
<header-conversations-list-archived *ngIf="conversationType !=='active'"
|
|
14
15
|
[headerTitle]=headerTitle
|
|
16
|
+
[isMobile]="isMobile"
|
|
15
17
|
(onBackButton)=onBackButtonFN($event)>
|
|
16
|
-
</
|
|
18
|
+
</header-conversations-list-archived>
|
|
17
19
|
</ion-header>
|
|
20
|
+
|
|
18
21
|
<!-- appScrollbarTheme -->
|
|
19
|
-
<ion-content id="convs-list" #ioncontentconvlist class="list-avatar-page" >
|
|
22
|
+
<ion-content id="convs-list" #ioncontentconvlist class="list-avatar-page" [class.mobile]="isMobile">
|
|
20
23
|
<!-- class="ps" style="position: relative; max-width: 600px; max-height: 100%;" [perfectScrollbar]="config" -->
|
|
21
24
|
<div id="scrollbar2">
|
|
22
25
|
<ion-list>
|
|
23
26
|
|
|
24
27
|
<!-- supportMode && -->
|
|
25
|
-
<ion-item *ngIf="displayNewConvsItem && conversationType !=='archived' && supportMode" class="ion-no-padding open-iframe-item">
|
|
28
|
+
<ion-item *ngIf="displayNewConvsItem && conversationType !=='archived' && supportMode" class="ion-no-padding open-iframe-item" lines="none">
|
|
26
29
|
<div tabindex="0"></div>
|
|
27
30
|
<!-- <ion-note class="pinned-project">
|
|
28
31
|
{{ 'PINNED_PROJECT' | translate }}
|
|
29
32
|
</ion-note> -->
|
|
30
33
|
|
|
31
34
|
<app-project-item
|
|
32
|
-
style="width: 100%;"
|
|
35
|
+
style="width: 100%; margin: 0px 8px; border-bottom: 1px dashed #d3dbe5;"
|
|
33
36
|
(openUnsevedConvsEvent)="openUnsevedConversationIframe($event)"
|
|
34
37
|
(projectIdEvent)="getLastProjectId($event)">
|
|
35
38
|
</app-project-item>
|
|
@@ -4,6 +4,9 @@ ion-header {
|
|
|
4
4
|
border-bottom-style: solid;
|
|
5
5
|
border-color: var(--light-gray);
|
|
6
6
|
border-bottom-width: thin;
|
|
7
|
+
&:not(.mobile){
|
|
8
|
+
border: none;
|
|
9
|
+
}
|
|
7
10
|
}
|
|
8
11
|
|
|
9
12
|
ion-content {
|
|
@@ -11,6 +14,9 @@ ion-content {
|
|
|
11
14
|
--offset-bottom: auto!important;
|
|
12
15
|
--overflow: hidden;
|
|
13
16
|
overflow: scroll;
|
|
17
|
+
&:not(.mobile){
|
|
18
|
+
background: var(--list-bkg-color);
|
|
19
|
+
}
|
|
14
20
|
|
|
15
21
|
&::-webkit-scrollbar {
|
|
16
22
|
width: 6px;
|
|
@@ -40,10 +46,11 @@ ion-list {
|
|
|
40
46
|
list-style-type: none;
|
|
41
47
|
margin: 0;
|
|
42
48
|
padding: 0;
|
|
49
|
+
background: transparent;
|
|
43
50
|
|
|
44
51
|
ion-item {
|
|
45
52
|
cursor: pointer;
|
|
46
|
-
height: 64px;
|
|
53
|
+
// height: 64px;
|
|
47
54
|
position: relative;
|
|
48
55
|
display: flex;
|
|
49
56
|
text-decoration: none;
|
|
@@ -51,6 +58,7 @@ ion-list {
|
|
|
51
58
|
padding-right: 8px;
|
|
52
59
|
--padding-start: 0;
|
|
53
60
|
--inner-padding-end: 0;
|
|
61
|
+
--background: transparent;
|
|
54
62
|
.selected {
|
|
55
63
|
border-radius: 10px;
|
|
56
64
|
padding-left: 8px;
|
|
@@ -324,7 +332,7 @@ ion-list {
|
|
|
324
332
|
padding-left: 0px !important ;
|
|
325
333
|
padding-right: 0px !important;
|
|
326
334
|
// height: 55px !important;
|
|
327
|
-
border-bottom: 1px solid rgba(0, 0, 0, 0.05);
|
|
335
|
+
// border-bottom: 1px solid rgba(0, 0, 0, 0.05);
|
|
328
336
|
--background-hover: #ffffff;
|
|
329
337
|
cursor:default !important;
|
|
330
338
|
}
|
|
@@ -91,6 +91,8 @@ export class ConversationListPage implements OnInit {
|
|
|
91
91
|
public displayNewConvsItem: boolean = true
|
|
92
92
|
public archiveActionNotAllowed: boolean = false
|
|
93
93
|
|
|
94
|
+
public isMobile: boolean = false;
|
|
95
|
+
|
|
94
96
|
tooltipOptions = {
|
|
95
97
|
'show-delay': 1500,
|
|
96
98
|
'tooltip-class': 'chat-tooltip',
|
|
@@ -121,6 +123,7 @@ export class ConversationListPage implements OnInit {
|
|
|
121
123
|
private networkService: NetworkService,
|
|
122
124
|
private appStorageService: AppStorageService
|
|
123
125
|
) {
|
|
126
|
+
this.checkPlatform();
|
|
124
127
|
this.listenToAppCompConvsLengthOnInitConvs()
|
|
125
128
|
this.listenToLogoutEvent()
|
|
126
129
|
this.listenGoOnline()
|
|
@@ -132,6 +135,16 @@ export class ConversationListPage implements OnInit {
|
|
|
132
135
|
this.listenToCloseConvFromHeaderConversation()
|
|
133
136
|
}
|
|
134
137
|
|
|
138
|
+
private checkPlatform(){
|
|
139
|
+
if (checkPlatformIsMobile()) {
|
|
140
|
+
this.isMobile = true
|
|
141
|
+
this.logger.log('[CONVS-LIST-PAGE] - initialize -> checkPlatformIsMobile isMobile? ', this.isMobile)
|
|
142
|
+
} else {
|
|
143
|
+
this.isMobile = false
|
|
144
|
+
this.logger.log('[CONVS-LIST-PAGE] - initialize -> checkPlatformIsMobile isMobile? ', this.isMobile)
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
135
148
|
listenSupportConvIdHasChanged() {
|
|
136
149
|
this.events.subscribe('supportconvid:haschanged', (IDConv) => {
|
|
137
150
|
// console.log('[CONVS-LIST-PAGE] - listen To convid:haschanged - convId', IDConv);
|
|
@@ -502,22 +515,6 @@ export class ConversationListPage implements OnInit {
|
|
|
502
515
|
this.logger.log('[CONVS-LIST-PAGE] - subscribeLoggedUserLogout uidConvSelected ',this.uidConvSelected)
|
|
503
516
|
}
|
|
504
517
|
|
|
505
|
-
// ------------------------------------------------------------------------------------
|
|
506
|
-
// @ SUBSCRIBE TO CONVERSATION CHANGED ??????????? SEEMS NOT USED ?????????????????
|
|
507
|
-
// ------------------------------------------------------------------------------------
|
|
508
|
-
conversationsChanged = (conversations: ConversationModel[]) => {
|
|
509
|
-
this.numberOpenConv = this.conversationsHandlerService.countIsNew()
|
|
510
|
-
this.logger.log('[CONVS-LIST-PAGE] - conversationsChanged - NUMB OF CONVERSATIONS: ',this.numberOpenConv)
|
|
511
|
-
// console.log('conversationsChanged »»»»»»»»» uidConvSelected', that.conversations[0], that.uidConvSelected);
|
|
512
|
-
if (this.uidConvSelected && !this.conversationSelected) {
|
|
513
|
-
const conversationSelected = this.conversations.find((item) => item.uid === this.uidConvSelected)
|
|
514
|
-
if (conversationSelected) {
|
|
515
|
-
this.conversationSelected = conversationSelected
|
|
516
|
-
this.setUidConvSelected(this.uidConvSelected)
|
|
517
|
-
}
|
|
518
|
-
}
|
|
519
|
-
}
|
|
520
|
-
|
|
521
518
|
/**
|
|
522
519
|
* ::: subscribeChangedConversationSelected :::
|
|
523
520
|
* evento richiamato quando si seleziona un utente nell'elenco degli user
|
|
@@ -654,7 +651,7 @@ export class ConversationListPage implements OnInit {
|
|
|
654
651
|
* ::: setUidConvSelected :::
|
|
655
652
|
*/
|
|
656
653
|
setUidConvSelected(uidConvSelected: string, conversationType?: string) {
|
|
657
|
-
this.logger.log('[CONVS-LIST-PAGE] setuidCOnvSelected', uidConvSelected)
|
|
654
|
+
this.logger.log('[CONVS-LIST-PAGE] setuidCOnvSelected', uidConvSelected, conversationType)
|
|
658
655
|
this.uidConvSelected = uidConvSelected
|
|
659
656
|
// this.conversationsHandlerService.uidConvSelected = uidConvSelected;
|
|
660
657
|
if (uidConvSelected) {
|
|
@@ -753,6 +750,13 @@ export class ConversationListPage implements OnInit {
|
|
|
753
750
|
}
|
|
754
751
|
}
|
|
755
752
|
|
|
753
|
+
if(conversation.attributes && conversation.attributes['projectId']){
|
|
754
|
+
let project = localStorage.getItem(conversation.attributes['projectId'])
|
|
755
|
+
if(project){
|
|
756
|
+
project = JSON.parse(project)
|
|
757
|
+
conversation.attributes.project_name = project['name']
|
|
758
|
+
}
|
|
759
|
+
}
|
|
756
760
|
// if(conversation.conversation_with_fullname === 'Guest '){
|
|
757
761
|
// conversation.conversation_with_fullname = 'guest' + '#' + this.getUUidConversation(conversation.uid)
|
|
758
762
|
// }
|
|
@@ -829,6 +833,7 @@ export class ConversationListPage implements OnInit {
|
|
|
829
833
|
if (checkPlatformIsMobile()) {
|
|
830
834
|
presentModal(this.modalController, ContactsDirectoryPage, {
|
|
831
835
|
token: TOKEN,
|
|
836
|
+
isMobile: this.isMobile
|
|
832
837
|
})
|
|
833
838
|
} else {
|
|
834
839
|
this.navService.push(ContactsDirectoryPage, { token: TOKEN })
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
|
|
56
56
|
<!-- fab placed to the (vertical) center and end -->
|
|
57
57
|
<ion-fab vertical="end" horizontal="end" slot="fixed" class="sendButton">
|
|
58
|
-
<ion-fab-button
|
|
58
|
+
<ion-fab-button (click)="onSendMessage()">
|
|
59
59
|
<ion-icon name="send"></ion-icon>
|
|
60
60
|
</ion-fab-button>
|
|
61
61
|
</ion-fab>
|
|
@@ -30,10 +30,8 @@
|
|
|
30
30
|
|
|
31
31
|
<div class="user-presence">
|
|
32
32
|
<app-user-presence
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
[borderColor]=borderColor
|
|
36
|
-
[fontColor]=fontColor>
|
|
33
|
+
[idUser]=loggedUser.uid
|
|
34
|
+
[translationMap]=translationMap>
|
|
37
35
|
</app-user-presence>
|
|
38
36
|
</div>
|
|
39
37
|
|