@chat21/chat21-ionic 3.0.60 → 3.0.61-rc14
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 +93 -0
- package/README.md +2 -0
- package/angular.json +4 -0
- package/config.xml +5 -5
- package/deploy_pre.sh +10 -10
- package/deploy_prod.sh +5 -1
- package/env.sample +3 -1
- package/package.json +13 -7
- package/resources/{Android → android}/icon/drawable-hdpi-icon.png +0 -0
- package/resources/{Android → android}/icon/drawable-ldpi-icon.png +0 -0
- package/resources/{Android → android}/icon/drawable-mdpi-icon.png +0 -0
- package/resources/{Android → android}/icon/drawable-xhdpi-icon.png +0 -0
- package/resources/{Android → android}/icon/drawable-xxhdpi-icon.png +0 -0
- package/resources/{Android → android}/icon/drawable-xxxhdpi-icon.png +0 -0
- package/resources/{Android → android}/icon.png +0 -0
- package/resources/{Android → android}/splash/drawable-land-hdpi-screen.png +0 -0
- package/resources/{Android → android}/splash/drawable-land-ldpi-screen.png +0 -0
- package/resources/{Android → android}/splash/drawable-land-mdpi-screen.png +0 -0
- package/resources/{Android → android}/splash/drawable-land-xhdpi-screen.png +0 -0
- package/resources/{Android → android}/splash/drawable-land-xxhdpi-screen.png +0 -0
- package/resources/{Android → android}/splash/drawable-land-xxxhdpi-screen.png +0 -0
- package/resources/{Android → android}/splash/drawable-port-hdpi-screen.png +0 -0
- package/resources/{Android → android}/splash/drawable-port-ldpi-screen.png +0 -0
- package/resources/{Android → android}/splash/drawable-port-mdpi-screen.png +0 -0
- package/resources/{Android → android}/splash/drawable-port-xhdpi-screen.png +0 -0
- package/resources/{Android → android}/splash/drawable-port-xxhdpi-screen.png +0 -0
- package/resources/{Android → android}/splash/drawable-port-xxxhdpi-screen.png +0 -0
- package/resources/{Android → android}/splash.png +0 -0
- package/src/app/app-routing.module.ts +15 -0
- package/src/app/app.component.html +14 -4
- package/src/app/app.component.scss +18 -1
- package/src/app/app.component.ts +50 -16
- package/src/app/app.module.ts +12 -3
- package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.html +23 -5
- package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.scss +142 -49
- package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.ts +101 -18
- package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.html +20 -36
- package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.scss +10 -0
- package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.ts +35 -40
- package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.html +7 -2
- package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.ts +103 -12
- package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.html +39 -36
- package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.scss +7 -1
- package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.ts +148 -63
- package/src/app/components/conversation-detail/message-text-area/message-text-area.component.html +59 -22
- 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 +102 -23
- package/src/app/components/ddp-header/ddp-header.component.html +20 -6
- package/src/app/components/ddp-header/ddp-header.component.scss +4 -0
- package/src/app/components/ddp-header/ddp-header.component.ts +104 -10
- package/src/app/components/project-item/project-item.component.html +8 -7
- package/src/app/components/project-item/project-item.component.scss +7 -2
- package/src/app/components/project-item/project-item.component.ts +15 -2
- package/src/app/components/sidebar/sidebar.component.html +275 -0
- package/src/app/components/sidebar/sidebar.component.scss +79 -0
- package/src/app/components/sidebar/sidebar.component.spec.ts +24 -0
- package/src/app/components/sidebar/sidebar.component.ts +539 -0
- package/src/app/components/sidebar-user-details/sidebar-user-details.component.html +117 -0
- package/src/app/components/sidebar-user-details/sidebar-user-details.component.scss +330 -0
- package/src/app/components/sidebar-user-details/sidebar-user-details.component.spec.ts +24 -0
- package/src/app/components/sidebar-user-details/sidebar-user-details.component.ts +490 -0
- package/src/app/pages/conversation-detail/conversation-detail.module.ts +6 -1
- package/src/app/pages/conversation-detail/conversation-detail.page.html +20 -10
- package/src/app/pages/conversation-detail/conversation-detail.page.scss +28 -0
- package/src/app/pages/conversation-detail/conversation-detail.page.ts +1132 -784
- package/src/app/pages/conversations-list/conversations-list.module.ts +2 -1
- package/src/app/pages/conversations-list/conversations-list.page.html +18 -9
- package/src/app/pages/conversations-list/conversations-list.page.scss +9 -1
- package/src/app/pages/conversations-list/conversations-list.page.ts +738 -425
- 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 +226 -166
- package/src/app/pages/profile-info/profile-info.page.html +4 -4
- package/src/app/pages/profile-info/profile-info.page.scss +13 -2
- package/src/app/pages/profile-info/profile-info.page.ts +23 -21
- package/src/app/services/tiledesk/tiledesk.service.ts +209 -0
- package/src/app/shared/shared.module.ts +14 -1
- package/src/app/utils/scrollbar-theme.directive.ts +58 -24
- package/src/assets/i18n/de.json +69 -13
- package/src/assets/i18n/en.json +62 -6
- package/src/assets/i18n/es.json +61 -5
- package/src/assets/i18n/fr.json +64 -8
- package/src/assets/i18n/it.json +61 -5
- package/src/assets/i18n/pt.json +61 -5
- package/src/assets/i18n/ru.json +62 -6
- package/src/assets/i18n/sr.json +265 -0
- package/src/assets/i18n/tr.json +61 -5
- package/src/assets/images/default-avatar-x-select.png +0 -0
- package/src/assets/images/language_flag/ar.png +0 -0
- package/src/assets/images/language_flag/bg.png +0 -0
- package/src/assets/images/language_flag/ca.png +0 -0
- package/src/assets/images/language_flag/cs.png +0 -0
- package/src/assets/images/language_flag/da.png +0 -0
- package/src/assets/images/language_flag/de.png +0 -0
- package/src/assets/images/language_flag/el.png +0 -0
- package/src/assets/images/language_flag/en.png +0 -0
- package/src/assets/images/language_flag/es.png +0 -0
- package/src/assets/images/language_flag/fa.png +0 -0
- package/src/assets/images/language_flag/fi.png +0 -0
- package/src/assets/images/language_flag/fr.png +0 -0
- package/src/assets/images/language_flag/he.png +0 -0
- package/src/assets/images/language_flag/hi.png +0 -0
- package/src/assets/images/language_flag/hr.png +0 -0
- package/src/assets/images/language_flag/hu.png +0 -0
- package/src/assets/images/language_flag/id.png +0 -0
- package/src/assets/images/language_flag/it.png +0 -0
- package/src/assets/images/language_flag/ja.png +0 -0
- package/src/assets/images/language_flag/ko.png +0 -0
- package/src/assets/images/language_flag/ml-IN.png +0 -0
- package/src/assets/images/language_flag/ne-NP.png +0 -0
- package/src/assets/images/language_flag/nl.png +0 -0
- package/src/assets/images/language_flag/no.png +0 -0
- package/src/assets/images/language_flag/pl.png +0 -0
- package/src/assets/images/language_flag/pt-BR.png +0 -0
- package/src/assets/images/language_flag/pt.png +0 -0
- package/src/assets/images/language_flag/ro.png +0 -0
- package/src/assets/images/language_flag/ru.png +0 -0
- package/src/assets/images/language_flag/sk.png +0 -0
- package/src/assets/images/language_flag/sl.png +0 -0
- package/src/assets/images/language_flag/sr.png +0 -0
- package/src/assets/images/language_flag/sv-SE.png +0 -0
- package/src/assets/images/language_flag/ta.png +0 -0
- package/src/assets/images/language_flag/th.png +0 -0
- package/src/assets/images/language_flag/tr.png +0 -0
- package/src/assets/images/language_flag/uk.png +0 -0
- package/src/assets/images/language_flag/vi.png +0 -0
- package/src/assets/images/language_flag/zh-CN.png +0 -0
- package/src/assets/images/language_flag/zh-TW.png +0 -0
- package/src/assets/images/no_image_user.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/assets/tiledesk-solo-logo.png +0 -0
- package/src/chat-config-pre-test.json +3 -1
- package/src/chat-config-template.json +3 -1
- package/src/chat-config.json +4 -2
- package/src/chat21-core/utils/constants.ts +6 -1
- package/src/global.scss +405 -3
- package/src/index.html +7 -0
- package/publish_pre.sh +0 -33
- package/publish_prod.sh +0 -33
|
@@ -1,41 +1,48 @@
|
|
|
1
|
-
import { ArchivedConversationsHandlerService } from 'src/chat21-core/providers/abstract/archivedconversations-handler.service'
|
|
2
|
-
import { Component, OnInit, ViewChild } from '@angular/core'
|
|
3
|
-
import { IonContent, ModalController } from '@ionic/angular'
|
|
4
|
-
import { ActivatedRoute, Router, NavigationExtras } from '@angular/router'
|
|
1
|
+
import { ArchivedConversationsHandlerService } from 'src/chat21-core/providers/abstract/archivedconversations-handler.service'
|
|
2
|
+
import { Component, OnInit, ViewChild } from '@angular/core'
|
|
3
|
+
import { IonContent, ModalController } from '@ionic/angular'
|
|
4
|
+
import { ActivatedRoute, Router, NavigationExtras } from '@angular/router'
|
|
5
5
|
// config
|
|
6
|
-
import { environment } from '../../../environments/environment'
|
|
6
|
+
import { environment } from '../../../environments/environment'
|
|
7
7
|
|
|
8
8
|
// models
|
|
9
|
-
import { ConversationModel } from 'src/chat21-core/models/conversation'
|
|
10
|
-
import { UserModel } from 'src/chat21-core/models/user'
|
|
9
|
+
import { ConversationModel } from 'src/chat21-core/models/conversation'
|
|
10
|
+
import { UserModel } from 'src/chat21-core/models/user'
|
|
11
11
|
|
|
12
12
|
// utils
|
|
13
|
-
import {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
import {
|
|
14
|
+
isInArray,
|
|
15
|
+
checkPlatformIsMobile,
|
|
16
|
+
presentModal,
|
|
17
|
+
closeModal,
|
|
18
|
+
convertMessage,
|
|
19
|
+
isGroup,
|
|
20
|
+
} from '../../../chat21-core/utils/utils'
|
|
21
|
+
|
|
22
|
+
import { EventsService } from '../../services/events-service'
|
|
23
|
+
import PerfectScrollbar from 'perfect-scrollbar' // https://github.com/mdbootstrap/perfect-scrollbar
|
|
17
24
|
|
|
18
25
|
// services
|
|
19
|
-
import { ConversationsHandlerService } from 'src/chat21-core/providers/abstract/conversations-handler.service'
|
|
20
|
-
import { ChatManager } from 'src/chat21-core/providers/chat-manager'
|
|
21
|
-
import { NavProxyService } from '../../services/nav-proxy.service'
|
|
22
|
-
import { TiledeskService } from '../../services/tiledesk/tiledesk.service'
|
|
23
|
-
import { ConversationDetailPage } from '../conversation-detail/conversation-detail.page'
|
|
24
|
-
import { ContactsDirectoryPage } from '../contacts-directory/contacts-directory.page'
|
|
25
|
-
import { UnassignedConversationsPage } from '../unassigned-conversations/unassigned-conversations.page'
|
|
26
|
-
import { ProfileInfoPage } from '../profile-info/profile-info.page'
|
|
27
|
-
import { MessagingAuthService } from 'src/chat21-core/providers/abstract/messagingAuth.service'
|
|
28
|
-
import { CustomTranslateService } from 'src/chat21-core/providers/custom-translate.service'
|
|
29
|
-
import { ImageRepoService } from 'src/chat21-core/providers/abstract/image-repo.service'
|
|
30
|
-
import { TiledeskAuthService } from 'src/chat21-core/providers/tiledesk/tiledesk-auth.service'
|
|
31
|
-
import { AppConfigProvider } from '../../services/app-config'
|
|
32
|
-
import { Subscription } from 'rxjs'
|
|
33
|
-
import { Platform } from '@ionic/angular'
|
|
26
|
+
import { ConversationsHandlerService } from 'src/chat21-core/providers/abstract/conversations-handler.service'
|
|
27
|
+
import { ChatManager } from 'src/chat21-core/providers/chat-manager'
|
|
28
|
+
import { NavProxyService } from '../../services/nav-proxy.service'
|
|
29
|
+
import { TiledeskService } from '../../services/tiledesk/tiledesk.service'
|
|
30
|
+
import { ConversationDetailPage } from '../conversation-detail/conversation-detail.page'
|
|
31
|
+
import { ContactsDirectoryPage } from '../contacts-directory/contacts-directory.page'
|
|
32
|
+
import { UnassignedConversationsPage } from '../unassigned-conversations/unassigned-conversations.page'
|
|
33
|
+
import { ProfileInfoPage } from '../profile-info/profile-info.page'
|
|
34
|
+
import { MessagingAuthService } from 'src/chat21-core/providers/abstract/messagingAuth.service'
|
|
35
|
+
import { CustomTranslateService } from 'src/chat21-core/providers/custom-translate.service'
|
|
36
|
+
import { ImageRepoService } from 'src/chat21-core/providers/abstract/image-repo.service'
|
|
37
|
+
import { TiledeskAuthService } from 'src/chat21-core/providers/tiledesk/tiledesk-auth.service'
|
|
38
|
+
import { AppConfigProvider } from '../../services/app-config'
|
|
39
|
+
import { Subscription } from 'rxjs'
|
|
40
|
+
import { Platform } from '@ionic/angular'
|
|
34
41
|
// Logger
|
|
35
|
-
import { LoggerService } from 'src/chat21-core/providers/abstract/logger.service'
|
|
36
|
-
import { LoggerInstance } from 'src/chat21-core/providers/logger/loggerInstance'
|
|
37
|
-
import { NetworkService } from 'src/app/services/network-service/network.service'
|
|
38
|
-
import { Subject } from 'rxjs'
|
|
42
|
+
import { LoggerService } from 'src/chat21-core/providers/abstract/logger.service'
|
|
43
|
+
import { LoggerInstance } from 'src/chat21-core/providers/logger/loggerInstance'
|
|
44
|
+
import { NetworkService } from 'src/app/services/network-service/network.service'
|
|
45
|
+
import { Subject } from 'rxjs'
|
|
39
46
|
import { takeUntil } from 'rxjs/operators'
|
|
40
47
|
|
|
41
48
|
@Component({
|
|
@@ -44,44 +51,54 @@ import { takeUntil } from 'rxjs/operators'
|
|
|
44
51
|
styleUrls: ['./conversations-list.page.scss'],
|
|
45
52
|
})
|
|
46
53
|
export class ConversationListPage implements OnInit {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
private unsubscribe$: Subject<any> = new Subject<any>()
|
|
51
|
-
private subscriptions: Array<string
|
|
52
|
-
public tenant: string
|
|
53
|
-
public loggedUserUid: string
|
|
54
|
-
public conversations: Array<ConversationModel> = []
|
|
55
|
-
public archivedConversations: Array<ConversationModel> = []
|
|
56
|
-
public uidConvSelected: string
|
|
57
|
-
public conversationSelected: ConversationModel
|
|
58
|
-
public uidReciverFromUrl: string
|
|
59
|
-
public showPlaceholder = true
|
|
60
|
-
public numberOpenConv = 0
|
|
61
|
-
public loadingIsActive = true
|
|
62
|
-
public supportMode: boolean
|
|
63
|
-
|
|
64
|
-
public
|
|
65
|
-
|
|
66
|
-
private
|
|
67
|
-
|
|
68
|
-
|
|
54
|
+
@ViewChild('ioncontentconvlist', { static: false })
|
|
55
|
+
ionContentConvList: IonContent
|
|
56
|
+
|
|
57
|
+
private unsubscribe$: Subject<any> = new Subject<any>()
|
|
58
|
+
private subscriptions: Array<string>
|
|
59
|
+
public tenant: string
|
|
60
|
+
public loggedUserUid: string
|
|
61
|
+
public conversations: Array<ConversationModel> = []
|
|
62
|
+
public archivedConversations: Array<ConversationModel> = []
|
|
63
|
+
public uidConvSelected: string
|
|
64
|
+
public conversationSelected: ConversationModel
|
|
65
|
+
public uidReciverFromUrl: string
|
|
66
|
+
public showPlaceholder = true
|
|
67
|
+
public numberOpenConv = 0
|
|
68
|
+
public loadingIsActive = true
|
|
69
|
+
public supportMode: boolean
|
|
70
|
+
public writeto_btn: boolean
|
|
71
|
+
public archived_btn: boolean
|
|
72
|
+
public convertMessage = convertMessage
|
|
73
|
+
private isShowMenuPage = false
|
|
74
|
+
private logger: LoggerService = LoggerInstance.getInstance()
|
|
75
|
+
translationMapConversation: Map<string, string>
|
|
76
|
+
stylesMap: Map<string, string>
|
|
69
77
|
|
|
70
78
|
public conversationType = 'active'
|
|
71
|
-
headerTitle: string
|
|
72
|
-
subscription: Subscription
|
|
79
|
+
headerTitle: string
|
|
80
|
+
subscription: Subscription
|
|
73
81
|
|
|
74
|
-
public UNASSIGNED_CONVS_URL: any
|
|
75
|
-
public PROJECTS_FOR_PANEL_URL: any
|
|
76
|
-
public IFRAME_URL: any
|
|
77
|
-
public hasClickedOpenUnservedConvIframe: boolean = false
|
|
78
|
-
public lastProjectId: string
|
|
79
|
-
public isOnline: boolean = true
|
|
80
|
-
public checkInternet: boolean
|
|
82
|
+
public UNASSIGNED_CONVS_URL: any
|
|
83
|
+
public PROJECTS_FOR_PANEL_URL: any
|
|
84
|
+
public IFRAME_URL: any
|
|
85
|
+
public hasClickedOpenUnservedConvIframe: boolean = false
|
|
86
|
+
public lastProjectId: string
|
|
87
|
+
public isOnline: boolean = true
|
|
88
|
+
public checkInternet: boolean
|
|
81
89
|
|
|
82
90
|
public displayNewConvsItem: boolean = true
|
|
83
|
-
|
|
84
|
-
|
|
91
|
+
public archiveActionNotAllowed: boolean = false
|
|
92
|
+
|
|
93
|
+
tooltipOptions = {
|
|
94
|
+
'show-delay': 1500,
|
|
95
|
+
'tooltip-class': 'chat-tooltip',
|
|
96
|
+
theme: 'light',
|
|
97
|
+
shadow: false,
|
|
98
|
+
'hide-delay-mobile': 0,
|
|
99
|
+
hideDelayAfterClick: 3000,
|
|
100
|
+
'hide-delay': 200,
|
|
101
|
+
}
|
|
85
102
|
|
|
86
103
|
constructor(
|
|
87
104
|
private router: Router,
|
|
@@ -101,39 +118,50 @@ export class ConversationListPage implements OnInit {
|
|
|
101
118
|
public appConfigProvider: AppConfigProvider,
|
|
102
119
|
public platform: Platform,
|
|
103
120
|
private networkService: NetworkService,
|
|
104
|
-
|
|
105
121
|
) {
|
|
106
|
-
this.listenToAppCompConvsLengthOnInitConvs()
|
|
107
|
-
this.listenToLogoutEvent()
|
|
108
|
-
this.listenGoOnline()
|
|
109
|
-
this.listenGoOffline()
|
|
110
|
-
this.listenToSwPostMessage()
|
|
111
|
-
this.listenSupportConvIdHasChanged()
|
|
122
|
+
this.listenToAppCompConvsLengthOnInitConvs()
|
|
123
|
+
this.listenToLogoutEvent()
|
|
124
|
+
this.listenGoOnline()
|
|
125
|
+
this.listenGoOffline()
|
|
126
|
+
this.listenToSwPostMessage()
|
|
127
|
+
this.listenSupportConvIdHasChanged()
|
|
112
128
|
// this.listenDirectConvIdHasChanged();
|
|
129
|
+
this.listenToCloseConvFromHeaderConversation()
|
|
113
130
|
}
|
|
114
131
|
|
|
115
132
|
listenSupportConvIdHasChanged() {
|
|
116
133
|
this.events.subscribe('supportconvid:haschanged', (IDConv) => {
|
|
117
|
-
|
|
134
|
+
// console.log('[CONVS-LIST-PAGE] - listen To convid:haschanged - convId', IDConv);
|
|
118
135
|
if (IDConv) {
|
|
119
136
|
// const conversationSelected = this.conversations.find(item => item.uid === convId);
|
|
120
137
|
// this.onConversationSelected(conversationSelected)
|
|
121
|
-
this.setUidConvSelected(IDConv, 'active')
|
|
138
|
+
this.setUidConvSelected(IDConv, 'active')
|
|
122
139
|
}
|
|
123
140
|
if (!IDConv) {
|
|
124
|
-
this.logger.log(
|
|
141
|
+
this.logger.log(
|
|
142
|
+
'[CONVS-LIST-PAGE] - listen To convid:haschanged - is the page without conv select',
|
|
143
|
+
)
|
|
125
144
|
|
|
126
145
|
const chatTabCount = +localStorage.getItem('tabCount')
|
|
127
|
-
this.logger.log(
|
|
146
|
+
this.logger.log(
|
|
147
|
+
'[CONVS-LIST-PAGE] - listen To convid:haschanged - chatTabCount ',
|
|
148
|
+
chatTabCount,
|
|
149
|
+
)
|
|
128
150
|
if (chatTabCount && chatTabCount > 0) {
|
|
129
|
-
this.logger.log(
|
|
151
|
+
this.logger.log(
|
|
152
|
+
'[CONVS-LIST-PAGE] - listen To convid:haschanged - the chat is already open ',
|
|
153
|
+
chatTabCount,
|
|
154
|
+
)
|
|
130
155
|
if (checkPlatformIsMobile()) {
|
|
131
|
-
this.logger.log(
|
|
132
|
-
|
|
156
|
+
this.logger.log(
|
|
157
|
+
'[CONVS-LIST-PAGE] - the chat is in mobile mode ',
|
|
158
|
+
checkPlatformIsMobile(),
|
|
159
|
+
)
|
|
160
|
+
this.events.publish('noparams:mobile', true)
|
|
133
161
|
}
|
|
134
162
|
}
|
|
135
163
|
}
|
|
136
|
-
})
|
|
164
|
+
})
|
|
137
165
|
}
|
|
138
166
|
|
|
139
167
|
// listenDirectConvIdHasChanged() {
|
|
@@ -145,13 +173,12 @@ export class ConversationListPage implements OnInit {
|
|
|
145
173
|
// });
|
|
146
174
|
// }
|
|
147
175
|
|
|
148
|
-
|
|
149
176
|
// -----------------------------------------------
|
|
150
177
|
// @ Lifehooks
|
|
151
178
|
// -----------------------------------------------
|
|
152
179
|
ngOnInit() {
|
|
153
|
-
this.watchToConnectionStatus()
|
|
154
|
-
this.
|
|
180
|
+
this.watchToConnectionStatus()
|
|
181
|
+
this.getAppConfigToHideDiplayBtns()
|
|
155
182
|
|
|
156
183
|
// const currentUrl = this.router.url;
|
|
157
184
|
// this.logger.log('[CONVS-LIST-PAGE] current_url ngOnInit ', currentUrl);
|
|
@@ -194,61 +221,98 @@ export class ConversationListPage implements OnInit {
|
|
|
194
221
|
// });
|
|
195
222
|
}
|
|
196
223
|
|
|
224
|
+
ngOnChanges() {
|
|
225
|
+
this.getConversationListHeight()
|
|
226
|
+
}
|
|
197
227
|
|
|
228
|
+
getConversationListHeight() {
|
|
229
|
+
var scrollbar2element = document.getElementById('scrollbar2')
|
|
230
|
+
this.logger.log(
|
|
231
|
+
'[CONVS-LIST-PAGE] getConversationListHeight scrollbar2element',
|
|
232
|
+
scrollbar2element,
|
|
233
|
+
)
|
|
234
|
+
}
|
|
198
235
|
|
|
199
|
-
|
|
200
|
-
|
|
236
|
+
getAppConfigToHideDiplayBtns() {
|
|
237
|
+
const appConfig = this.appConfigProvider.getConfig()
|
|
238
|
+
// console.log('[ION-LIST-CONVS-COMP] - appConfig ', appConfig)
|
|
239
|
+
if (appConfig && appConfig.supportMode) {
|
|
240
|
+
this.supportMode = appConfig.supportMode
|
|
241
|
+
} else {
|
|
242
|
+
this.supportMode = false
|
|
243
|
+
}
|
|
244
|
+
if (appConfig && appConfig.archivedButton) {
|
|
245
|
+
this.archived_btn = appConfig.archivedButton
|
|
246
|
+
} else {
|
|
247
|
+
this.archived_btn = false
|
|
248
|
+
}
|
|
249
|
+
if (appConfig && appConfig.writeToButton) {
|
|
250
|
+
this.writeto_btn = appConfig.writeToButton
|
|
251
|
+
} else {
|
|
252
|
+
this.writeto_btn = false
|
|
253
|
+
}
|
|
201
254
|
// console.log('[ION-LIST-CONVS-COMP] - supportMode ', this.supportMode)
|
|
202
255
|
}
|
|
203
256
|
|
|
204
257
|
watchToConnectionStatus() {
|
|
205
|
-
this.networkService.checkInternetFunc().subscribe(isOnline => {
|
|
258
|
+
this.networkService.checkInternetFunc().subscribe((isOnline) => {
|
|
206
259
|
this.checkInternet = isOnline
|
|
207
|
-
this.logger.log(
|
|
260
|
+
this.logger.log(
|
|
261
|
+
'[ION-LIST-CONVS-COMP] - watchToConnectionStatus - isOnline',
|
|
262
|
+
this.checkInternet,
|
|
263
|
+
)
|
|
208
264
|
|
|
209
265
|
// checking internet connection
|
|
210
266
|
if (this.checkInternet == true) {
|
|
211
|
-
|
|
212
|
-
this.isOnline = true;
|
|
267
|
+
this.isOnline = true
|
|
213
268
|
} else {
|
|
214
|
-
this.isOnline = false
|
|
269
|
+
this.isOnline = false
|
|
215
270
|
}
|
|
216
|
-
})
|
|
271
|
+
})
|
|
217
272
|
}
|
|
218
273
|
|
|
219
|
-
|
|
220
274
|
ionViewWillEnter() {
|
|
221
275
|
this.logger.log('Called ionViewDidEnter')
|
|
222
|
-
this.logger.log(
|
|
223
|
-
|
|
276
|
+
this.logger.log(
|
|
277
|
+
'[CONVS-LIST-PAGE] ionViewWillEnter uidConvSelected',
|
|
278
|
+
this.uidConvSelected,
|
|
279
|
+
)
|
|
280
|
+
this.listnerStart()
|
|
224
281
|
|
|
225
282
|
// exit from app with hardware back button
|
|
226
283
|
this.subscription = this.platform.backButton.subscribe(() => {
|
|
227
|
-
navigator['app'].exitApp()
|
|
228
|
-
})
|
|
284
|
+
navigator['app'].exitApp()
|
|
285
|
+
})
|
|
229
286
|
}
|
|
230
287
|
|
|
231
288
|
// unsubscribe backButton.subscribe method to not use from other page
|
|
232
289
|
ionViewWillLeave() {
|
|
233
290
|
this.logger.log('Called ionViewWillLeave')
|
|
234
|
-
this.subscription.unsubscribe()
|
|
291
|
+
this.subscription.unsubscribe()
|
|
235
292
|
}
|
|
236
293
|
|
|
237
294
|
ionViewDidEnter() { }
|
|
238
295
|
|
|
239
296
|
getLastProjectId(projectid: string) {
|
|
240
|
-
this.logger.log('[CONVS-LIST-PAGE] - GET LAST PROJECT ID', projectid)
|
|
241
|
-
this.lastProjectId = projectid
|
|
297
|
+
this.logger.log('[CONVS-LIST-PAGE] - GET LAST PROJECT ID', projectid)
|
|
298
|
+
this.lastProjectId = projectid
|
|
242
299
|
}
|
|
243
300
|
|
|
244
301
|
openUnsevedConversationIframe(event) {
|
|
245
302
|
this.logger.log('[CONVS-LIST-PAGE] openUnsevedConversationIframe ', event)
|
|
246
303
|
this.hasClickedOpenUnservedConvIframe = true
|
|
247
|
-
this.logger.log(
|
|
248
|
-
|
|
304
|
+
this.logger.log(
|
|
305
|
+
'[CONVS-LIST-PAGE] - HAS CLIKED OPEN UNSERVED REQUEST IFRAME',
|
|
306
|
+
this.hasClickedOpenUnservedConvIframe,
|
|
307
|
+
)
|
|
308
|
+
const DASHBOARD_BASE_URL = this.appConfigProvider.getConfig().dashboardUrl
|
|
249
309
|
// http://localhost:4204/#/projects-for-panel
|
|
250
|
-
this.PROJECTS_FOR_PANEL_URL = DASHBOARD_BASE_URL + '#/projects-for-panel'
|
|
251
|
-
this.UNASSIGNED_CONVS_URL =
|
|
310
|
+
this.PROJECTS_FOR_PANEL_URL = DASHBOARD_BASE_URL + '#/projects-for-panel'
|
|
311
|
+
this.UNASSIGNED_CONVS_URL =
|
|
312
|
+
DASHBOARD_BASE_URL +
|
|
313
|
+
'#/project/' +
|
|
314
|
+
this.lastProjectId +
|
|
315
|
+
'/unserved-request-for-panel'
|
|
252
316
|
|
|
253
317
|
if (event === 'pinbtn') {
|
|
254
318
|
this.IFRAME_URL = this.PROJECTS_FOR_PANEL_URL
|
|
@@ -256,7 +320,10 @@ export class ConversationListPage implements OnInit {
|
|
|
256
320
|
this.IFRAME_URL = this.UNASSIGNED_CONVS_URL
|
|
257
321
|
}
|
|
258
322
|
|
|
259
|
-
this.logger.log(
|
|
323
|
+
this.logger.log(
|
|
324
|
+
'[CONVS-LIST-PAGE] - HAS CLIKED OPEN UNSERVED REQUEST IFRAME > UNASSIGNED CONVS URL',
|
|
325
|
+
this.UNASSIGNED_CONVS_URL,
|
|
326
|
+
)
|
|
260
327
|
this.openUnassignedConversations(this.IFRAME_URL, event)
|
|
261
328
|
}
|
|
262
329
|
|
|
@@ -267,181 +334,233 @@ export class ConversationListPage implements OnInit {
|
|
|
267
334
|
if (checkPlatformIsMobile()) {
|
|
268
335
|
presentModal(this.modalController, UnassignedConversationsPage, {
|
|
269
336
|
iframe_URL: IFRAME_URL,
|
|
270
|
-
callerBtn: event
|
|
271
|
-
})
|
|
337
|
+
callerBtn: event,
|
|
338
|
+
})
|
|
272
339
|
} else {
|
|
273
340
|
this.navService.push(UnassignedConversationsPage, {
|
|
274
341
|
iframe_URL: IFRAME_URL,
|
|
275
|
-
callerBtn: event
|
|
276
|
-
|
|
277
|
-
});
|
|
342
|
+
callerBtn: event,
|
|
343
|
+
})
|
|
278
344
|
}
|
|
279
345
|
}
|
|
280
346
|
|
|
281
347
|
_closeContactsDirectory() {
|
|
282
348
|
try {
|
|
283
|
-
closeModal(this.modalController)
|
|
349
|
+
closeModal(this.modalController)
|
|
284
350
|
} catch (err) {
|
|
285
|
-
this.logger.error(
|
|
351
|
+
this.logger.error(
|
|
352
|
+
'[CONVS-LIST-PAGE] closeContactsDirectory -> error:',
|
|
353
|
+
err,
|
|
354
|
+
)
|
|
286
355
|
}
|
|
287
356
|
}
|
|
288
357
|
|
|
289
|
-
|
|
290
358
|
listenToSwPostMessage() {
|
|
291
|
-
this.logger.log('[CONVS-LIST-PAGE] listenToNotificationCLick - CALLED: ')
|
|
292
|
-
const that = this
|
|
359
|
+
this.logger.log('[CONVS-LIST-PAGE] listenToNotificationCLick - CALLED: ')
|
|
360
|
+
const that = this
|
|
293
361
|
if (navigator && navigator.serviceWorker) {
|
|
294
|
-
|
|
295
362
|
navigator.serviceWorker.addEventListener('message', function (event) {
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
363
|
+
that.logger.log(
|
|
364
|
+
'[CONVS-LIST-PAGE] FIREBASE-NOTIFICATION listenToNotificationCLick - Received a message from service worker event data: ',
|
|
365
|
+
event.data,
|
|
366
|
+
)
|
|
367
|
+
that.logger.log(
|
|
368
|
+
'[CONVS-LIST-PAGE] FIREBASE-NOTIFICATION listenToNotificationCLick - Received a message from service worker event data data: ',
|
|
369
|
+
event.data['data'],
|
|
370
|
+
)
|
|
371
|
+
that.logger.log(
|
|
372
|
+
'[CONVS-LIST-PAGE] FIREBASE-NOTIFICATION listenToNotificationCLick - Received a message from service worker event data data typeof: ',
|
|
373
|
+
typeof event.data['data'],
|
|
374
|
+
)
|
|
300
375
|
let uidConvSelected = ''
|
|
301
376
|
if (event.data && event.data['conversWith']) {
|
|
302
|
-
uidConvSelected = event.data['conversWith']
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
377
|
+
uidConvSelected = event.data['conversWith']
|
|
378
|
+
} else {
|
|
379
|
+
that.logger.log(
|
|
380
|
+
'[CONVS-LIST-PAGE] FIREBASE-NOTIFICATION listenToNotificationCLick - DIFFERENT MSG',
|
|
381
|
+
)
|
|
382
|
+
return
|
|
307
383
|
}
|
|
308
384
|
|
|
309
|
-
that.logger.log(
|
|
310
|
-
|
|
311
|
-
|
|
385
|
+
that.logger.log(
|
|
386
|
+
'[CONVS-LIST-PAGE] FIREBASE-NOTIFICATION listenToNotificationCLick - Received a message from service worker event dataObjct uidConvSelected: ',
|
|
387
|
+
uidConvSelected,
|
|
388
|
+
)
|
|
389
|
+
that.logger.log(
|
|
390
|
+
'[CONVS-LIST-PAGE] FIREBASE-NOTIFICATION listenToNotificationCLick - Received a message from service worker that.conversations: ',
|
|
391
|
+
that.conversations,
|
|
392
|
+
)
|
|
393
|
+
const conversationSelected = that.conversations.find(
|
|
394
|
+
(item) => item.uid === uidConvSelected,
|
|
395
|
+
)
|
|
312
396
|
if (conversationSelected) {
|
|
313
|
-
|
|
314
|
-
that.
|
|
315
|
-
|
|
397
|
+
that.conversationSelected = conversationSelected
|
|
398
|
+
that.logger.log(
|
|
399
|
+
'[CONVS-LIST-PAGE] listenToNotificationCLick- Received a message from service worker event conversationSelected: ',
|
|
400
|
+
that.conversationSelected,
|
|
401
|
+
)
|
|
316
402
|
|
|
317
403
|
that.navigateByUrl('active', uidConvSelected)
|
|
318
404
|
}
|
|
319
|
-
})
|
|
405
|
+
})
|
|
320
406
|
}
|
|
321
407
|
}
|
|
322
408
|
|
|
323
|
-
|
|
324
409
|
private listnerStart() {
|
|
325
|
-
const that = this
|
|
326
|
-
this.chatManager.BSStart
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
410
|
+
const that = this
|
|
411
|
+
this.chatManager.BSStart.pipe(takeUntil(that.unsubscribe$)).subscribe(
|
|
412
|
+
(data: any) => {
|
|
413
|
+
this.logger.log(
|
|
414
|
+
'[CONVS-LIST-PAGE] - BSStart SUBSCR DATA - Current user *****',
|
|
415
|
+
data,
|
|
416
|
+
)
|
|
332
417
|
if (data) {
|
|
333
|
-
that.initialize()
|
|
418
|
+
that.initialize()
|
|
334
419
|
}
|
|
335
|
-
},
|
|
336
|
-
|
|
337
|
-
|
|
420
|
+
},
|
|
421
|
+
(error) => {
|
|
422
|
+
this.logger.error('[CONVS-LIST-PAGE] - BSStart SUBSCR - ERROR: ', error)
|
|
423
|
+
},
|
|
424
|
+
() => {
|
|
338
425
|
this.logger.log('[CONVS-LIST-PAGE] - BSStart SUBSCR * COMPLETE *')
|
|
339
|
-
}
|
|
426
|
+
},
|
|
427
|
+
)
|
|
340
428
|
}
|
|
341
429
|
|
|
342
|
-
|
|
343
430
|
// ------------------------------------------------------------------ //
|
|
344
431
|
// Init convrsation handler
|
|
345
432
|
// ------------------------------------------------------------------ //
|
|
346
433
|
initConversationsHandler() {
|
|
347
|
-
this.conversations = this.conversationsHandlerService.conversations
|
|
434
|
+
this.conversations = this.conversationsHandlerService.conversations
|
|
348
435
|
this.logger.log('[CONVS-LIST-PAGE] - CONVERSATIONS ', this.conversations)
|
|
349
436
|
// save conversationHandler in chatManager
|
|
350
|
-
this.chatManager.setConversationsHandler(this.conversationsHandlerService)
|
|
351
|
-
this.showPlaceholder = false
|
|
437
|
+
this.chatManager.setConversationsHandler(this.conversationsHandlerService)
|
|
438
|
+
this.showPlaceholder = false
|
|
352
439
|
}
|
|
353
440
|
|
|
354
|
-
|
|
355
|
-
|
|
356
441
|
initArchivedConversationsHandler() {
|
|
357
|
-
const keysConversation = ['CLOSED']
|
|
358
|
-
this.translationMapConversation = this.translateService.translateLanguage(
|
|
442
|
+
const keysConversation = ['CLOSED', 'Resolve']
|
|
443
|
+
this.translationMapConversation = this.translateService.translateLanguage(
|
|
444
|
+
keysConversation,
|
|
445
|
+
)
|
|
359
446
|
|
|
360
447
|
this.archivedConversationsHandlerService.subscribeToConversations(() => {
|
|
361
|
-
this.logger.log(
|
|
362
|
-
|
|
363
|
-
|
|
448
|
+
this.logger.log(
|
|
449
|
+
'[CONVS-LIST-PAGE]-CONVS - conversations archived length ',
|
|
450
|
+
this.archivedConversations.length,
|
|
451
|
+
)
|
|
452
|
+
})
|
|
364
453
|
|
|
365
|
-
this.archivedConversations = this.archivedConversationsHandlerService.archivedConversations
|
|
366
|
-
this.logger.log(
|
|
454
|
+
this.archivedConversations = this.archivedConversationsHandlerService.archivedConversations
|
|
455
|
+
this.logger.log(
|
|
456
|
+
'[CONVS-LIST-PAGE] archived conversation',
|
|
457
|
+
this.archivedConversations,
|
|
458
|
+
)
|
|
367
459
|
|
|
368
460
|
// save archivedConversationsHandlerService in chatManager
|
|
369
|
-
this.chatManager.setArchivedConversationsHandler(
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
461
|
+
this.chatManager.setArchivedConversationsHandler(
|
|
462
|
+
this.archivedConversationsHandlerService,
|
|
463
|
+
)
|
|
464
|
+
|
|
465
|
+
this.logger.log(
|
|
466
|
+
'[CONVS-LIST-PAGE]-CONVS SubscribeToConversations - conversations archived length ',
|
|
467
|
+
this.archivedConversations.length,
|
|
468
|
+
)
|
|
469
|
+
if (
|
|
470
|
+
!this.archivedConversations ||
|
|
471
|
+
this.archivedConversations.length === 0
|
|
472
|
+
) {
|
|
473
|
+
this.loadingIsActive = false
|
|
374
474
|
}
|
|
375
475
|
}
|
|
376
476
|
|
|
377
|
-
|
|
378
477
|
// ----------------------------------------------------------------------------------------------------
|
|
379
|
-
// To display "No conversation yet" MESSAGE in conversazion list
|
|
478
|
+
// To display "No conversation yet" MESSAGE in conversazion list
|
|
380
479
|
// this.loadingIsActive is set to false only if on init there are not conversation
|
|
381
480
|
// otherwise loadingIsActive remains set to true and the message "No conversation yet" is not displayed
|
|
382
481
|
// to fix this
|
|
383
|
-
// - for the direct conversation
|
|
384
|
-
// ----------------------------------------------------------------------------------------------------
|
|
482
|
+
// - for the direct conversation
|
|
483
|
+
// ----------------------------------------------------------------------------------------------------
|
|
385
484
|
listenToAppCompConvsLengthOnInitConvs() {
|
|
386
|
-
this.events.subscribe(
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
this.
|
|
390
|
-
|
|
391
|
-
|
|
485
|
+
this.events.subscribe(
|
|
486
|
+
'appcompSubscribeToConvs:loadingIsActive',
|
|
487
|
+
(loadingIsActive) => {
|
|
488
|
+
this.logger.log(
|
|
489
|
+
'[CONVS-LIST-PAGE]-CONVS loadingIsActive',
|
|
490
|
+
loadingIsActive,
|
|
491
|
+
)
|
|
492
|
+
if (loadingIsActive === false) {
|
|
493
|
+
this.loadingIsActive = false
|
|
494
|
+
}
|
|
495
|
+
},
|
|
496
|
+
)
|
|
392
497
|
}
|
|
393
498
|
|
|
394
499
|
listenGoOnline() {
|
|
395
500
|
this.events.subscribe('go:online', (goonline) => {
|
|
396
|
-
this.logger.info(
|
|
501
|
+
this.logger.info(
|
|
502
|
+
'[CONVS-LIST-PAGE] - listen To go:online - goonline',
|
|
503
|
+
goonline,
|
|
504
|
+
)
|
|
397
505
|
// this.events.unsubscribe('profileInfoButtonClick:logout')
|
|
398
506
|
if (goonline === true) {
|
|
399
507
|
this.displayNewConvsItem = true
|
|
400
508
|
}
|
|
401
|
-
})
|
|
509
|
+
})
|
|
402
510
|
}
|
|
403
511
|
|
|
404
512
|
listenGoOffline() {
|
|
405
|
-
|
|
406
513
|
this.events.subscribe('go:offline', (offline) => {
|
|
407
|
-
this.logger.info(
|
|
514
|
+
this.logger.info(
|
|
515
|
+
'[CONVS-LIST-PAGE] - listen To go:offline - offline',
|
|
516
|
+
offline,
|
|
517
|
+
)
|
|
408
518
|
// this.events.unsubscribe('profileInfoButtonClick:logout')
|
|
409
519
|
if (offline === true) {
|
|
410
520
|
this.displayNewConvsItem = false
|
|
411
521
|
}
|
|
412
|
-
})
|
|
522
|
+
})
|
|
413
523
|
}
|
|
414
524
|
|
|
415
525
|
listenToLogoutEvent() {
|
|
416
|
-
this.events.subscribe(
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
526
|
+
this.events.subscribe(
|
|
527
|
+
'profileInfoButtonClick:logout',
|
|
528
|
+
(hasclickedlogout) => {
|
|
529
|
+
this.logger.info(
|
|
530
|
+
'[CONVS-LIST-PAGE] - listenToLogoutEvent - hasclickedlogout',
|
|
531
|
+
hasclickedlogout,
|
|
532
|
+
)
|
|
533
|
+
|
|
534
|
+
this.conversations = []
|
|
535
|
+
this.conversationsHandlerService.conversations = []
|
|
536
|
+
this.uidConvSelected = null
|
|
537
|
+
|
|
538
|
+
this.logger.log(
|
|
539
|
+
'[CONVS-LIST-PAGE] - listenToLogoutEvent - CONVERSATIONS ',
|
|
540
|
+
this.conversations,
|
|
541
|
+
)
|
|
542
|
+
this.logger.log(
|
|
543
|
+
'[CONVS-LIST-PAGE] - listenToLogoutEvent - uidConvSelected ',
|
|
544
|
+
this.uidConvSelected,
|
|
545
|
+
)
|
|
546
|
+
if (hasclickedlogout === true) {
|
|
547
|
+
this.loadingIsActive = false
|
|
548
|
+
}
|
|
549
|
+
},
|
|
550
|
+
)
|
|
430
551
|
}
|
|
431
552
|
|
|
432
|
-
|
|
433
|
-
// ------------------------------------------------------------------
|
|
553
|
+
// ------------------------------------------------------------------
|
|
434
554
|
// SUBSCRIPTIONS
|
|
435
555
|
// ------------------------------------------------------------------
|
|
436
556
|
initSubscriptions() {
|
|
437
557
|
this.logger.log('[CONVS-LIST-PAGE] - CALLING - initSubscriptions ')
|
|
438
|
-
let key = ''
|
|
439
|
-
|
|
558
|
+
let key = ''
|
|
440
559
|
|
|
441
|
-
key = 'loggedUser:logout'
|
|
560
|
+
key = 'loggedUser:logout'
|
|
442
561
|
if (!isInArray(key, this.subscriptions)) {
|
|
443
|
-
this.subscriptions.push(key)
|
|
444
|
-
this.events.subscribe(key, this.subscribeLoggedUserLogout)
|
|
562
|
+
this.subscriptions.push(key)
|
|
563
|
+
this.events.subscribe(key, this.subscribeLoggedUserLogout)
|
|
445
564
|
}
|
|
446
565
|
|
|
447
566
|
// key = 'readAllMessages';
|
|
@@ -450,10 +569,10 @@ export class ConversationListPage implements OnInit {
|
|
|
450
569
|
// this.events.subscribe(key, this.readAllMessages);
|
|
451
570
|
// }
|
|
452
571
|
|
|
453
|
-
key = 'profileInfoButtonClick:changed'
|
|
572
|
+
key = 'profileInfoButtonClick:changed'
|
|
454
573
|
if (!isInArray(key, this.subscriptions)) {
|
|
455
|
-
this.subscriptions.push(key)
|
|
456
|
-
this.events.subscribe(key, this.subscribeProfileInfoButtonClicked)
|
|
574
|
+
this.subscriptions.push(key)
|
|
575
|
+
this.events.subscribe(key, this.subscribeProfileInfoButtonClicked)
|
|
457
576
|
}
|
|
458
577
|
|
|
459
578
|
// this.conversationsHandlerService.readAllMessages.subscribe((conversationId: string) => {
|
|
@@ -461,67 +580,89 @@ export class ConversationListPage implements OnInit {
|
|
|
461
580
|
// this.readAllMessages(conversationId);
|
|
462
581
|
// });
|
|
463
582
|
|
|
464
|
-
this.conversationsHandlerService.conversationAdded.subscribe(
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
this.
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
this.
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
}
|
|
493
|
-
|
|
583
|
+
this.conversationsHandlerService.conversationAdded.subscribe(
|
|
584
|
+
(conversation: ConversationModel) => {
|
|
585
|
+
// this.logger.log('[CONVS-LIST-PAGE] ***** conversationsAdded *****', conversation);
|
|
586
|
+
// that.conversationsChanged(conversations);
|
|
587
|
+
if (conversation) {
|
|
588
|
+
this.onImageLoaded(conversation)
|
|
589
|
+
this.onConversationLoaded(conversation)
|
|
590
|
+
}
|
|
591
|
+
},
|
|
592
|
+
)
|
|
593
|
+
|
|
594
|
+
this.conversationsHandlerService.conversationChanged.subscribe(
|
|
595
|
+
(conversation: ConversationModel) => {
|
|
596
|
+
// this.logger.log('[CONVS-LIST-PAGE] ***** subscribeConversationChanged *****', conversation);
|
|
597
|
+
// that.conversationsChanged(conversations)
|
|
598
|
+
if (conversation) {
|
|
599
|
+
this.onImageLoaded(conversation)
|
|
600
|
+
this.onConversationLoaded(conversation)
|
|
601
|
+
}
|
|
602
|
+
},
|
|
603
|
+
)
|
|
604
|
+
|
|
605
|
+
this.conversationsHandlerService.conversationRemoved.subscribe(
|
|
606
|
+
(conversation: ConversationModel) => {
|
|
607
|
+
this.logger.log(
|
|
608
|
+
'[CONVS-LIST-PAGE] ***** conversationsRemoved *****',
|
|
609
|
+
conversation,
|
|
610
|
+
)
|
|
611
|
+
},
|
|
612
|
+
)
|
|
613
|
+
|
|
614
|
+
this.archivedConversationsHandlerService.archivedConversationAdded.subscribe(
|
|
615
|
+
(conversation: ConversationModel) => {
|
|
616
|
+
this.logger.log(
|
|
617
|
+
'[CONVS-LIST-PAGE] ***** archivedConversationAdded *****',
|
|
618
|
+
conversation,
|
|
619
|
+
)
|
|
620
|
+
// that.conversationsChanged(conversations);
|
|
621
|
+
if (conversation) {
|
|
622
|
+
this.onImageLoaded(conversation)
|
|
623
|
+
this.onConversationLoaded(conversation)
|
|
624
|
+
}
|
|
625
|
+
},
|
|
626
|
+
)
|
|
494
627
|
}
|
|
495
628
|
|
|
496
629
|
// ------------------------------------------------------------------------------------
|
|
497
630
|
// @ SUBSCRIBE TO LOGGED USER LOGOUT ??????????? SEEMS NOT USED ?????????????????
|
|
498
631
|
// ------------------------------------------------------------------------------------
|
|
499
632
|
subscribeLoggedUserLogout = () => {
|
|
500
|
-
this.conversations = []
|
|
501
|
-
this.uidConvSelected = null
|
|
502
|
-
this.logger.log(
|
|
503
|
-
|
|
633
|
+
this.conversations = []
|
|
634
|
+
this.uidConvSelected = null
|
|
635
|
+
this.logger.log(
|
|
636
|
+
'[CONVS-LIST-PAGE] - subscribeLoggedUserLogout conversations ',
|
|
637
|
+
this.conversations,
|
|
638
|
+
)
|
|
639
|
+
this.logger.log(
|
|
640
|
+
'[CONVS-LIST-PAGE] - subscribeLoggedUserLogout uidConvSelected ',
|
|
641
|
+
this.uidConvSelected,
|
|
642
|
+
)
|
|
504
643
|
}
|
|
505
644
|
|
|
506
|
-
|
|
507
|
-
|
|
508
645
|
// ------------------------------------------------------------------------------------
|
|
509
646
|
// @ SUBSCRIBE TO CONVERSATION CHANGED ??????????? SEEMS NOT USED ?????????????????
|
|
510
647
|
// ------------------------------------------------------------------------------------
|
|
511
648
|
conversationsChanged = (conversations: ConversationModel[]) => {
|
|
512
|
-
this.numberOpenConv = this.conversationsHandlerService.countIsNew()
|
|
513
|
-
this.logger.log(
|
|
649
|
+
this.numberOpenConv = this.conversationsHandlerService.countIsNew()
|
|
650
|
+
this.logger.log(
|
|
651
|
+
'[CONVS-LIST-PAGE] - conversationsChanged - NUMB OF CONVERSATIONS: ',
|
|
652
|
+
this.numberOpenConv,
|
|
653
|
+
)
|
|
514
654
|
// console.log('conversationsChanged »»»»»»»»» uidConvSelected', that.conversations[0], that.uidConvSelected);
|
|
515
655
|
if (this.uidConvSelected && !this.conversationSelected) {
|
|
516
|
-
const conversationSelected = this.conversations.find(
|
|
656
|
+
const conversationSelected = this.conversations.find(
|
|
657
|
+
(item) => item.uid === this.uidConvSelected,
|
|
658
|
+
)
|
|
517
659
|
if (conversationSelected) {
|
|
518
|
-
this.conversationSelected = conversationSelected
|
|
519
|
-
this.setUidConvSelected(this.uidConvSelected)
|
|
660
|
+
this.conversationSelected = conversationSelected
|
|
661
|
+
this.setUidConvSelected(this.uidConvSelected)
|
|
520
662
|
}
|
|
521
663
|
}
|
|
522
664
|
}
|
|
523
665
|
|
|
524
|
-
|
|
525
666
|
/**
|
|
526
667
|
* ::: subscribeChangedConversationSelected :::
|
|
527
668
|
* evento richiamato quando si seleziona un utente nell'elenco degli user
|
|
@@ -531,14 +672,27 @@ export class ConversationListPage implements OnInit {
|
|
|
531
672
|
// !!!!!! IS USED? ?????
|
|
532
673
|
// ------------------------------
|
|
533
674
|
subscribeChangedConversationSelected = (user: UserModel, type: string) => {
|
|
534
|
-
this.logger.log(
|
|
535
|
-
|
|
536
|
-
|
|
675
|
+
this.logger.log(
|
|
676
|
+
'[CONVS-LIST-PAGE] ************** subscribeUidConvSelectedChanged navigateByUrl',
|
|
677
|
+
user,
|
|
678
|
+
type,
|
|
679
|
+
)
|
|
680
|
+
this.uidConvSelected = user.uid
|
|
681
|
+
this.logger.log(
|
|
682
|
+
'[CONVS-LIST-PAGE] ************** uidConvSelected ',
|
|
683
|
+
this.uidConvSelected,
|
|
684
|
+
)
|
|
537
685
|
// this.conversationsHandlerService.uidConvSelected = user.uid;
|
|
538
|
-
const conversationSelected = this.conversations.find(
|
|
686
|
+
const conversationSelected = this.conversations.find(
|
|
687
|
+
(item) => item.uid === this.uidConvSelected,
|
|
688
|
+
)
|
|
539
689
|
if (conversationSelected) {
|
|
540
|
-
this.logger.log(
|
|
541
|
-
|
|
690
|
+
this.logger.log(
|
|
691
|
+
'[CONVS-LIST-PAGE] --> uidConvSelected: ',
|
|
692
|
+
this.conversationSelected,
|
|
693
|
+
this.uidConvSelected,
|
|
694
|
+
)
|
|
695
|
+
this.conversationSelected = conversationSelected
|
|
542
696
|
}
|
|
543
697
|
// this.router.navigateByUrl('conversation-detail/' + user.uid + '?conversationWithFullname=' + user.fullname);
|
|
544
698
|
}
|
|
@@ -548,20 +702,28 @@ export class ConversationListPage implements OnInit {
|
|
|
548
702
|
* evento richiamato quando si seleziona bottone profile-info-modal
|
|
549
703
|
*/
|
|
550
704
|
subscribeProfileInfoButtonClicked = (event: string) => {
|
|
551
|
-
this.logger.log(
|
|
705
|
+
this.logger.log(
|
|
706
|
+
'[CONVS-LIST-PAGE] ************** subscribeProfileInfoButtonClicked: ',
|
|
707
|
+
event,
|
|
708
|
+
)
|
|
552
709
|
if (event === 'displayArchived') {
|
|
553
|
-
this.initArchivedConversationsHandler()
|
|
710
|
+
this.initArchivedConversationsHandler()
|
|
554
711
|
// this.openArchivedConversationsModal()
|
|
555
712
|
this.conversationType = 'archived'
|
|
556
713
|
|
|
557
714
|
// let storedArchivedConv = localStorage.getItem('activeConversationSelected');
|
|
558
|
-
const keys = ['LABEL_ARCHIVED']
|
|
559
|
-
|
|
715
|
+
const keys = ['LABEL_ARCHIVED']
|
|
716
|
+
// const keys = ['History'];
|
|
560
717
|
|
|
718
|
+
this.headerTitle = this.translateService
|
|
719
|
+
.translateLanguage(keys)
|
|
720
|
+
.get(keys[0])
|
|
561
721
|
} else if (event === 'displayContact') {
|
|
562
722
|
this.conversationType = 'archived'
|
|
563
|
-
const keys = ['LABEL_CONTACTS']
|
|
564
|
-
this.headerTitle = this.translateService
|
|
723
|
+
const keys = ['LABEL_CONTACTS']
|
|
724
|
+
this.headerTitle = this.translateService
|
|
725
|
+
.translateLanguage(keys)
|
|
726
|
+
.get(keys[0])
|
|
565
727
|
}
|
|
566
728
|
}
|
|
567
729
|
|
|
@@ -575,12 +737,10 @@ export class ConversationListPage implements OnInit {
|
|
|
575
737
|
// console.log('ConversationListPage - storedActiveConv Objct: ', storedActiveConvObjct);
|
|
576
738
|
// this.navigateByUrl('active', storedActiveConvObjct.uid)
|
|
577
739
|
// } else {
|
|
578
|
-
// // da implementare se nn c'è stata nessuna conv attive selezionata
|
|
740
|
+
// // da implementare se nn c'è stata nessuna conv attive selezionata
|
|
579
741
|
// }
|
|
580
|
-
|
|
581
742
|
}
|
|
582
743
|
|
|
583
|
-
|
|
584
744
|
// ------------------------------------------------------------------//
|
|
585
745
|
// END SUBSCRIPTIONS
|
|
586
746
|
// ------------------------------------------------------------------//
|
|
@@ -602,8 +762,6 @@ export class ConversationListPage implements OnInit {
|
|
|
602
762
|
// })
|
|
603
763
|
// }
|
|
604
764
|
|
|
605
|
-
|
|
606
|
-
|
|
607
765
|
// ------------------------------------------------------------------//
|
|
608
766
|
// BEGIN FUNCTIONS
|
|
609
767
|
// ------------------------------------------------------------------//
|
|
@@ -611,22 +769,24 @@ export class ConversationListPage implements OnInit {
|
|
|
611
769
|
* ::: initialize :::
|
|
612
770
|
*/
|
|
613
771
|
initialize() {
|
|
614
|
-
const appconfig = this.appConfigProvider.getConfig()
|
|
615
|
-
this.tenant = appconfig.firebaseConfig.tenant
|
|
616
|
-
this.logger.log(
|
|
772
|
+
const appconfig = this.appConfigProvider.getConfig()
|
|
773
|
+
this.tenant = appconfig.firebaseConfig.tenant
|
|
774
|
+
this.logger.log(
|
|
775
|
+
'[CONVS-LIST-PAGE] - initialize -> firebaseConfig tenant ',
|
|
776
|
+
this.tenant,
|
|
777
|
+
)
|
|
617
778
|
|
|
618
779
|
if (this.tiledeskAuthService.getCurrentUser()) {
|
|
619
|
-
this.loggedUserUid = this.tiledeskAuthService.getCurrentUser().uid
|
|
780
|
+
this.loggedUserUid = this.tiledeskAuthService.getCurrentUser().uid
|
|
620
781
|
}
|
|
621
|
-
this.subscriptions = []
|
|
622
|
-
this.initConversationsHandler()
|
|
623
|
-
this.initVariables()
|
|
624
|
-
this.initSubscriptions()
|
|
782
|
+
this.subscriptions = []
|
|
783
|
+
this.initConversationsHandler()
|
|
784
|
+
this.initVariables()
|
|
785
|
+
this.initSubscriptions()
|
|
625
786
|
|
|
626
787
|
// this.initHandlerEventEmitter();
|
|
627
788
|
}
|
|
628
789
|
|
|
629
|
-
|
|
630
790
|
/**
|
|
631
791
|
* ::: initVariables :::
|
|
632
792
|
* al caricamento della pagina:
|
|
@@ -641,46 +801,61 @@ export class ConversationListPage implements OnInit {
|
|
|
641
801
|
// It only works on BSStart.subscribe! it is useful or can be eliminated
|
|
642
802
|
// --------------------------------------------------------
|
|
643
803
|
initVariables() {
|
|
644
|
-
this.logger.log(
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
804
|
+
this.logger.log(
|
|
805
|
+
'[CONVS-LIST-PAGE] uidReciverFromUrl:: ' + this.uidReciverFromUrl,
|
|
806
|
+
)
|
|
807
|
+
this.logger.log('[CONVS-LIST-PAGE] loggedUserUid:: ' + this.loggedUserUid)
|
|
808
|
+
this.logger.log('[CONVS-LIST-PAGE] tenant:: ' + this.tenant)
|
|
809
|
+
if (this.route.component['name'] !== 'ConversationListPage') {
|
|
649
810
|
if (this.route && this.route.snapshot && this.route.snapshot.firstChild) {
|
|
650
|
-
const IDConv = this.route.snapshot.firstChild.paramMap.get('IDConv')
|
|
651
|
-
this.logger.log('[CONVS-LIST-PAGE] conversationWith 2: ', IDConv)
|
|
811
|
+
const IDConv = this.route.snapshot.firstChild.paramMap.get('IDConv')
|
|
812
|
+
this.logger.log('[CONVS-LIST-PAGE] conversationWith 2: ', IDConv)
|
|
652
813
|
if (IDConv) {
|
|
653
|
-
this.setUidConvSelected(IDConv)
|
|
814
|
+
this.setUidConvSelected(IDConv)
|
|
654
815
|
} else {
|
|
655
|
-
|
|
656
|
-
|
|
816
|
+
this.logger.log(
|
|
817
|
+
'[CONVS-LIST-PAGE] conversationWith 2 (else): ',
|
|
818
|
+
IDConv,
|
|
819
|
+
)
|
|
657
820
|
}
|
|
658
821
|
}
|
|
659
822
|
}
|
|
660
823
|
}
|
|
661
824
|
|
|
662
|
-
|
|
663
|
-
|
|
664
825
|
/**
|
|
665
826
|
* ::: setUidConvSelected :::
|
|
666
827
|
*/
|
|
667
|
-
setUidConvSelected(uidConvSelected: string, conversationType?: string
|
|
828
|
+
setUidConvSelected(uidConvSelected: string, conversationType?: string) {
|
|
668
829
|
this.logger.log('[CONVS-LIST-PAGE] setuidCOnvSelected', uidConvSelected)
|
|
669
|
-
this.uidConvSelected = uidConvSelected
|
|
830
|
+
this.uidConvSelected = uidConvSelected
|
|
670
831
|
this.logger.log('uidConvSelected', uidConvSelected)
|
|
671
832
|
// this.conversationsHandlerService.uidConvSelected = uidConvSelected;
|
|
672
833
|
if (uidConvSelected) {
|
|
673
|
-
let conversationSelected
|
|
834
|
+
let conversationSelected
|
|
674
835
|
if (conversationType === 'active') {
|
|
675
|
-
conversationSelected = this.conversations.find(
|
|
836
|
+
conversationSelected = this.conversations.find(
|
|
837
|
+
(item) => item.uid === this.uidConvSelected,
|
|
838
|
+
)
|
|
676
839
|
} else if (conversationType === 'archived') {
|
|
677
|
-
conversationSelected = this.archivedConversations.find(
|
|
840
|
+
conversationSelected = this.archivedConversations.find(
|
|
841
|
+
(item) => item.uid === this.uidConvSelected,
|
|
842
|
+
)
|
|
678
843
|
}
|
|
679
844
|
if (conversationSelected) {
|
|
680
|
-
this.logger.log(
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
845
|
+
this.logger.log(
|
|
846
|
+
'[CONVS-LIST-PAGE] conversationSelected',
|
|
847
|
+
conversationSelected,
|
|
848
|
+
)
|
|
849
|
+
this.logger.log(
|
|
850
|
+
'[CONVS-LIST-PAGE] the conversation ',
|
|
851
|
+
this.conversationSelected,
|
|
852
|
+
' has already been loaded',
|
|
853
|
+
)
|
|
854
|
+
this.conversationSelected = conversationSelected
|
|
855
|
+
this.logger.log(
|
|
856
|
+
'[CONVS-LIST-PAGE] setUidConvSelected: ',
|
|
857
|
+
this.conversationSelected,
|
|
858
|
+
)
|
|
684
859
|
}
|
|
685
860
|
}
|
|
686
861
|
}
|
|
@@ -689,29 +864,36 @@ export class ConversationListPage implements OnInit {
|
|
|
689
864
|
this.logger.log('onConversationSelected conversation', conversation)
|
|
690
865
|
if (conversation.archived) {
|
|
691
866
|
this.navigateByUrl('archived', conversation.uid)
|
|
692
|
-
this.logger.log(
|
|
867
|
+
this.logger.log(
|
|
868
|
+
'[CONVS-LIST-PAGE] onConversationSelected archived conversation.uid ',
|
|
869
|
+
conversation.uid,
|
|
870
|
+
)
|
|
693
871
|
} else {
|
|
694
872
|
this.navigateByUrl('active', conversation.uid)
|
|
695
|
-
this.logger.log(
|
|
873
|
+
this.logger.log(
|
|
874
|
+
'[CONVS-LIST-PAGE] onConversationSelected active conversation.uid ',
|
|
875
|
+
conversation.uid,
|
|
876
|
+
)
|
|
696
877
|
}
|
|
697
|
-
|
|
698
878
|
}
|
|
699
879
|
|
|
700
880
|
onImageLoaded(conversation: any) {
|
|
701
881
|
// this.logger.log('[CONVS-LIST-PAGE] onImageLoaded', conversation)
|
|
702
|
-
let conversation_with_fullname = conversation.sender_fullname
|
|
703
|
-
let conversation_with = conversation.sender
|
|
882
|
+
let conversation_with_fullname = conversation.sender_fullname
|
|
883
|
+
let conversation_with = conversation.sender
|
|
704
884
|
if (conversation.sender === this.loggedUserUid) {
|
|
705
|
-
conversation_with = conversation.recipient
|
|
706
|
-
conversation_with_fullname = conversation.recipient_fullname
|
|
885
|
+
conversation_with = conversation.recipient
|
|
886
|
+
conversation_with_fullname = conversation.recipient_fullname
|
|
707
887
|
} else if (isGroup(conversation)) {
|
|
708
888
|
// conversation_with_fullname = conv.sender_fullname;
|
|
709
889
|
// conv.last_message_text = conv.last_message_text;
|
|
710
|
-
conversation_with = conversation.recipient
|
|
711
|
-
conversation_with_fullname = conversation.recipient_fullname
|
|
890
|
+
conversation_with = conversation.recipient
|
|
891
|
+
conversation_with_fullname = conversation.recipient_fullname
|
|
712
892
|
}
|
|
713
|
-
if (!conversation_with.startsWith(
|
|
714
|
-
conversation.image = this.imageRepoService.getImagePhotoUrl(
|
|
893
|
+
if (!conversation_with.startsWith('support-group')) {
|
|
894
|
+
conversation.image = this.imageRepoService.getImagePhotoUrl(
|
|
895
|
+
conversation_with,
|
|
896
|
+
)
|
|
715
897
|
}
|
|
716
898
|
}
|
|
717
899
|
|
|
@@ -722,49 +904,59 @@ export class ConversationListPage implements OnInit {
|
|
|
722
904
|
// this.ionContentConvList.scrollToTop(0);
|
|
723
905
|
// }
|
|
724
906
|
|
|
725
|
-
const keys = ['YOU', 'SENT_AN_IMAGE', 'SENT_AN_ATTACHMENT']
|
|
726
|
-
const translationMap = this.translateService.translateLanguage(keys)
|
|
907
|
+
const keys = ['YOU', 'SENT_AN_IMAGE', 'SENT_AN_ATTACHMENT']
|
|
908
|
+
const translationMap = this.translateService.translateLanguage(keys)
|
|
727
909
|
// Fixes the bug: if a snippet of code is pasted and sent it is not displayed correctly in the convesations list
|
|
728
910
|
|
|
729
|
-
var regex = /<br\s*[\/]?>/gi
|
|
911
|
+
var regex = /<br\s*[\/]?>/gi
|
|
730
912
|
if (conversation && conversation.last_message_text) {
|
|
731
|
-
conversation.last_message_text = conversation.last_message_text.replace(
|
|
913
|
+
conversation.last_message_text = conversation.last_message_text.replace(
|
|
914
|
+
regex,
|
|
915
|
+
'',
|
|
916
|
+
)
|
|
732
917
|
|
|
733
918
|
//FIX-BUG: 'YOU: YOU: YOU: text' on last-message-text in conversation-list
|
|
734
|
-
if (
|
|
919
|
+
if (
|
|
920
|
+
conversation.sender === this.loggedUserUid &&
|
|
921
|
+
!conversation.last_message_text.includes(': ')
|
|
922
|
+
) {
|
|
735
923
|
// this.logger.log('[CONVS-LIST-PAGE] onConversationLoaded', conversation)
|
|
736
924
|
|
|
737
|
-
if (conversation.type !==
|
|
738
|
-
conversation.last_message_text =
|
|
739
|
-
|
|
740
|
-
} else if (conversation.type ===
|
|
741
|
-
|
|
925
|
+
if (conversation.type !== 'image' && conversation.type !== 'file') {
|
|
926
|
+
conversation.last_message_text =
|
|
927
|
+
translationMap.get('YOU') + ': ' + conversation.last_message_text
|
|
928
|
+
} else if (conversation.type === 'image') {
|
|
742
929
|
// this.logger.log('[CONVS-LIST-PAGE] HAS SENT AN IMAGE');
|
|
743
930
|
// this.logger.log("[CONVS-LIST-PAGE] translationMap.get('YOU')")
|
|
744
|
-
const SENT_AN_IMAGE = conversation[
|
|
931
|
+
const SENT_AN_IMAGE = (conversation[
|
|
932
|
+
'last_message_text'
|
|
933
|
+
] = translationMap.get('SENT_AN_IMAGE'))
|
|
745
934
|
|
|
746
|
-
conversation.last_message_text =
|
|
747
|
-
|
|
748
|
-
} else if (conversation.type ===
|
|
935
|
+
conversation.last_message_text =
|
|
936
|
+
translationMap.get('YOU') + ': ' + SENT_AN_IMAGE
|
|
937
|
+
} else if (conversation.type === 'file') {
|
|
749
938
|
// this.logger.log('[CONVS-LIST-PAGE] HAS SENT FILE')
|
|
750
|
-
const SENT_AN_ATTACHMENT = conversation[
|
|
751
|
-
|
|
939
|
+
const SENT_AN_ATTACHMENT = (conversation[
|
|
940
|
+
'last_message_text'
|
|
941
|
+
] = translationMap.get('SENT_AN_ATTACHMENT'))
|
|
942
|
+
conversation.last_message_text =
|
|
943
|
+
translationMap.get('YOU') + ': ' + SENT_AN_ATTACHMENT
|
|
752
944
|
}
|
|
753
945
|
} else {
|
|
754
|
-
if (conversation.type ===
|
|
755
|
-
|
|
946
|
+
if (conversation.type === 'image') {
|
|
756
947
|
// this.logger.log('[CONVS-LIST-PAGE] HAS SENT AN IMAGE');
|
|
757
948
|
// this.logger.log("[CONVS-LIST-PAGE] translationMap.get('YOU')")
|
|
758
|
-
const SENT_AN_IMAGE = conversation[
|
|
949
|
+
const SENT_AN_IMAGE = (conversation[
|
|
950
|
+
'last_message_text'
|
|
951
|
+
] = translationMap.get('SENT_AN_IMAGE'))
|
|
759
952
|
|
|
760
|
-
conversation.last_message_text = SENT_AN_IMAGE
|
|
761
|
-
|
|
762
|
-
}
|
|
763
|
-
else if (conversation.type === "file") {
|
|
953
|
+
conversation.last_message_text = SENT_AN_IMAGE
|
|
954
|
+
} else if (conversation.type === 'file') {
|
|
764
955
|
// this.logger.log('[CONVS-LIST-PAGE] HAS SENT FILE')
|
|
765
|
-
const SENT_AN_ATTACHMENT = conversation[
|
|
766
|
-
|
|
767
|
-
|
|
956
|
+
const SENT_AN_ATTACHMENT = (conversation[
|
|
957
|
+
'last_message_text'
|
|
958
|
+
] = translationMap.get('SENT_AN_ATTACHMENT'))
|
|
959
|
+
conversation.last_message_text = SENT_AN_ATTACHMENT
|
|
768
960
|
}
|
|
769
961
|
}
|
|
770
962
|
}
|
|
@@ -774,59 +966,103 @@ export class ConversationListPage implements OnInit {
|
|
|
774
966
|
// this.logger.log('[CONVS-LIST-PAGE] isMarkdownLink 1')
|
|
775
967
|
// var regex = /^(^|[\n\r])\s*1\.\s.*\s+1\.\s$/
|
|
776
968
|
// let matchRegex = false
|
|
777
|
-
// if (regex.test(last_message_text)) {
|
|
969
|
+
// if (regex.test(last_message_text)) {
|
|
778
970
|
// this.logger.log('[CONVS-LIST-PAGE] isMarkdownLink 2')
|
|
779
971
|
// matchRegex = true
|
|
780
972
|
// return matchRegex
|
|
781
973
|
// }
|
|
782
974
|
// }
|
|
783
975
|
|
|
784
|
-
|
|
785
976
|
navigateByUrl(converationType: string, uidConvSelected: string) {
|
|
786
|
-
this.logger.log('[CONVS-LIST-PAGE] calling navigateByUrl: ')
|
|
787
|
-
this.logger.log(
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
977
|
+
this.logger.log('[CONVS-LIST-PAGE] calling navigateByUrl: ')
|
|
978
|
+
this.logger.log(
|
|
979
|
+
'[CONVS-LIST-PAGE] navigateByUrl uidConvSelected: ',
|
|
980
|
+
uidConvSelected,
|
|
981
|
+
)
|
|
982
|
+
this.logger.log(
|
|
983
|
+
'[CONVS-LIST-PAGE] navigateByUrl run this.setUidConvSelected',
|
|
984
|
+
)
|
|
985
|
+
this.logger.log(
|
|
986
|
+
'[CONVS-LIST-PAGE] navigateByUrl this.uidConvSelected ',
|
|
987
|
+
this.uidConvSelected,
|
|
988
|
+
)
|
|
989
|
+
this.logger.log(
|
|
990
|
+
'[CONVS-LIST-PAGE] navigateByUrl this.conversationSelected ',
|
|
991
|
+
this.conversationSelected,
|
|
992
|
+
)
|
|
993
|
+
|
|
994
|
+
this.setUidConvSelected(uidConvSelected, converationType)
|
|
793
995
|
if (checkPlatformIsMobile()) {
|
|
794
|
-
this.logger.log(
|
|
795
|
-
|
|
796
|
-
|
|
996
|
+
this.logger.log(
|
|
997
|
+
'[CONVS-LIST-PAGE] checkPlatformIsMobile(): ',
|
|
998
|
+
checkPlatformIsMobile(),
|
|
999
|
+
)
|
|
1000
|
+
this.logger.log(
|
|
1001
|
+
'[CONVS-LIST-PAGE] DESKTOP (window >= 768)',
|
|
1002
|
+
this.navService,
|
|
1003
|
+
)
|
|
1004
|
+
let pageUrl =
|
|
1005
|
+
'conversation-detail/' +
|
|
1006
|
+
this.uidConvSelected +
|
|
1007
|
+
'/' +
|
|
1008
|
+
this.conversationSelected.conversation_with_fullname +
|
|
1009
|
+
'/' +
|
|
1010
|
+
converationType
|
|
797
1011
|
this.logger.log('[CONVS-LIST-PAGE] pageURL', pageUrl)
|
|
798
|
-
this.router.navigateByUrl(pageUrl)
|
|
1012
|
+
this.router.navigateByUrl(pageUrl)
|
|
799
1013
|
} else {
|
|
800
|
-
this.logger.log(
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
1014
|
+
this.logger.log(
|
|
1015
|
+
'[CONVS-LIST-PAGE] checkPlatformIsMobile(): ',
|
|
1016
|
+
checkPlatformIsMobile(),
|
|
1017
|
+
)
|
|
1018
|
+
this.logger.log(
|
|
1019
|
+
'[CONVS-LIST-PAGE] MOBILE (window < 768) ',
|
|
1020
|
+
this.navService,
|
|
1021
|
+
)
|
|
1022
|
+
let pageUrl = 'conversation-detail/' + this.uidConvSelected
|
|
1023
|
+
if (
|
|
1024
|
+
this.conversationSelected &&
|
|
1025
|
+
this.conversationSelected.conversation_with_fullname
|
|
1026
|
+
) {
|
|
1027
|
+
pageUrl =
|
|
1028
|
+
'conversation-detail/' +
|
|
1029
|
+
this.uidConvSelected +
|
|
1030
|
+
'/' +
|
|
1031
|
+
this.conversationSelected.conversation_with_fullname +
|
|
1032
|
+
'/' +
|
|
1033
|
+
converationType
|
|
805
1034
|
}
|
|
806
|
-
this.logger.log(
|
|
807
|
-
|
|
1035
|
+
this.logger.log(
|
|
1036
|
+
'[CONVS-LIST-PAGE] setUidConvSelected navigateByUrl--->: ',
|
|
1037
|
+
pageUrl,
|
|
1038
|
+
)
|
|
1039
|
+
this.router.navigateByUrl(pageUrl)
|
|
808
1040
|
}
|
|
809
1041
|
}
|
|
810
1042
|
|
|
811
|
-
|
|
812
1043
|
// ---------------------------------------------------------
|
|
813
1044
|
// Opens the list of contacts for direct convs
|
|
814
1045
|
// ---------------------------------------------------------
|
|
815
1046
|
openContactsDirectory(event: any) {
|
|
816
|
-
const TOKEN = this.tiledeskAuthService.getTiledeskToken()
|
|
817
|
-
this.logger.log('[CONVS-LIST-PAGE] openContactsDirectory', TOKEN)
|
|
1047
|
+
const TOKEN = this.tiledeskAuthService.getTiledeskToken()
|
|
1048
|
+
this.logger.log('[CONVS-LIST-PAGE] openContactsDirectory', TOKEN)
|
|
818
1049
|
if (checkPlatformIsMobile()) {
|
|
819
|
-
presentModal(this.modalController, ContactsDirectoryPage, {
|
|
1050
|
+
presentModal(this.modalController, ContactsDirectoryPage, {
|
|
1051
|
+
token: TOKEN,
|
|
1052
|
+
})
|
|
820
1053
|
} else {
|
|
821
|
-
this.navService.push(ContactsDirectoryPage, { token: TOKEN })
|
|
1054
|
+
this.navService.push(ContactsDirectoryPage, { token: TOKEN })
|
|
822
1055
|
}
|
|
823
1056
|
}
|
|
824
1057
|
|
|
825
1058
|
closeContactsDirectory() {
|
|
826
1059
|
try {
|
|
827
|
-
closeModal(this.modalController)
|
|
1060
|
+
closeModal(this.modalController)
|
|
828
1061
|
} catch (err) {
|
|
829
|
-
this.logger.error(
|
|
1062
|
+
this.logger.error(
|
|
1063
|
+
'[CONVS-LIST-PAGE] closeContactsDirectory -> error:',
|
|
1064
|
+
err,
|
|
1065
|
+
)
|
|
830
1066
|
}
|
|
831
1067
|
}
|
|
832
1068
|
|
|
@@ -834,8 +1070,8 @@ export class ConversationListPage implements OnInit {
|
|
|
834
1070
|
// Opens logged user profile modal
|
|
835
1071
|
// ---------------------------------------------------------
|
|
836
1072
|
openProfileInfo(event: any) {
|
|
837
|
-
const TOKEN = this.messagingAuthService.getToken()
|
|
838
|
-
this.logger.log('[CONVS-LIST-PAGE] open ProfileInfoPage TOKEN ', TOKEN)
|
|
1073
|
+
const TOKEN = this.messagingAuthService.getToken()
|
|
1074
|
+
this.logger.log('[CONVS-LIST-PAGE] open ProfileInfoPage TOKEN ', TOKEN)
|
|
839
1075
|
if (checkPlatformIsMobile()) {
|
|
840
1076
|
presentModal(this.modalController, ProfileInfoPage, { token: TOKEN })
|
|
841
1077
|
} else {
|
|
@@ -843,102 +1079,186 @@ export class ConversationListPage implements OnInit {
|
|
|
843
1079
|
}
|
|
844
1080
|
}
|
|
845
1081
|
|
|
1082
|
+
listenToCloseConvFromHeaderConversation() {
|
|
1083
|
+
this.events.subscribe('conversation:closed', (convId) => {
|
|
1084
|
+
this.logger.log('[CONVS-LIST-PAGE] hasclosedconversation convId', convId)
|
|
846
1085
|
|
|
1086
|
+
const conversation = this.conversations.find(
|
|
1087
|
+
(conv) => conv.uid === convId,
|
|
1088
|
+
)
|
|
1089
|
+
this.logger.log('[CONVS-LIST-PAGE] hasclosedconversation conversation', conversation)
|
|
1090
|
+
this.onCloseConversation(conversation)
|
|
1091
|
+
})
|
|
1092
|
+
}
|
|
847
1093
|
|
|
848
1094
|
// ----------------------------------------------------------------------------------------------
|
|
849
1095
|
// onCloseConversation
|
|
850
1096
|
// https://github.com/chat21/chat21-cloud-functions/blob/master/docs/api.md#delete-a-conversation
|
|
851
1097
|
// ----------------------------------------------------------------------------------------------
|
|
852
1098
|
onCloseConversation(conversation: ConversationModel) {
|
|
1099
|
+
this.logger.log('[CONVS-LIST-PAGE] onCloseConversation conversation', conversation)
|
|
1100
|
+
|
|
853
1101
|
// -------------------------------------------------------------------------------------
|
|
854
|
-
// Fix the display of the message "No conversation yet" when a conversation is archived
|
|
855
|
-
// but there are others in the list (happens when loadingIsActive is set to false because
|
|
1102
|
+
// Fix the display of the message "No conversation yet" when a conversation is archived
|
|
1103
|
+
// but there are others in the list (happens when loadingIsActive is set to false because
|
|
856
1104
|
// when is called the initConversationsHandler method there is not conversations)
|
|
857
1105
|
// -------------------------------------------------------------------------------------
|
|
858
|
-
this.loadingIsActive = false
|
|
1106
|
+
this.loadingIsActive = false
|
|
859
1107
|
// console.log('CONVS - CONV-LIST-PAGE onCloseConversation CONVS: ', conversation)
|
|
860
1108
|
this.logger.log('[CONVS-LIST-PAGE] onCloseConversation loadingIsActive: ', this.loadingIsActive)
|
|
1109
|
+
if (conversation) {
|
|
1110
|
+
const conversationId = conversation.uid
|
|
861
1111
|
|
|
862
|
-
|
|
1112
|
+
this.logger.log( '[CONVS-LIST-PAGE] onCloseConversation conversationId: ', conversationId )
|
|
863
1113
|
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
// Removes the last element of the array if is = to the separator
|
|
870
|
-
if (conversationWith_segments[conversationWith_segments.length - 1] === '') {
|
|
871
|
-
conversationWith_segments.pop();
|
|
872
|
-
}
|
|
1114
|
+
const conversationWith_segments = conversationId.split('-')
|
|
1115
|
+
this.logger.log(
|
|
1116
|
+
'[CONVS-LIST-PAGE] - conversationId_segments: ',
|
|
1117
|
+
conversationWith_segments,
|
|
1118
|
+
)
|
|
873
1119
|
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
conversationWith_segments.pop();
|
|
1120
|
+
// Removes the last element of the array if is = to the separator
|
|
1121
|
+
if (
|
|
1122
|
+
conversationWith_segments[conversationWith_segments.length - 1] === ''
|
|
1123
|
+
) {
|
|
1124
|
+
conversationWith_segments.pop()
|
|
880
1125
|
}
|
|
881
|
-
}
|
|
882
1126
|
|
|
883
|
-
if (conversationId.startsWith("support-group")) {
|
|
884
|
-
let project_id = ''
|
|
885
1127
|
if (conversationWith_segments.length === 4) {
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
1128
|
+
const lastArrayElement =
|
|
1129
|
+
conversationWith_segments[conversationWith_segments.length - 1]
|
|
1130
|
+
this.logger.log(
|
|
1131
|
+
'[CONVS-LIST-PAGE] - lastArrayElement ',
|
|
1132
|
+
lastArrayElement,
|
|
1133
|
+
)
|
|
1134
|
+
this.logger.log(
|
|
1135
|
+
'[CONVS-LIST-PAGE] - lastArrayElement length',
|
|
1136
|
+
lastArrayElement.length,
|
|
1137
|
+
)
|
|
1138
|
+
if (lastArrayElement.length !== 32) {
|
|
1139
|
+
conversationWith_segments.pop()
|
|
1140
|
+
}
|
|
1141
|
+
}
|
|
890
1142
|
|
|
1143
|
+
if (conversationId.startsWith('support-group')) {
|
|
1144
|
+
let project_id = ''
|
|
1145
|
+
if (conversationWith_segments.length === 4) {
|
|
1146
|
+
project_id = conversationWith_segments[2]
|
|
1147
|
+
|
|
1148
|
+
const tiledeskToken = this.tiledeskAuthService.getTiledeskToken()
|
|
1149
|
+
this.archiveSupportGroupConv(
|
|
1150
|
+
tiledeskToken,
|
|
1151
|
+
project_id,
|
|
1152
|
+
conversationId,
|
|
1153
|
+
)
|
|
1154
|
+
} else {
|
|
1155
|
+
this.getProjectIdByConversationWith(conversationId)
|
|
1156
|
+
}
|
|
891
1157
|
} else {
|
|
892
|
-
this.
|
|
1158
|
+
this.conversationsHandlerService.archiveConversation(conversationId)
|
|
893
1159
|
}
|
|
894
|
-
} else {
|
|
895
|
-
this.conversationsHandlerService.archiveConversation(conversationId)
|
|
896
1160
|
}
|
|
897
1161
|
}
|
|
898
1162
|
|
|
899
1163
|
getProjectIdByConversationWith(conversationId: string) {
|
|
900
|
-
const tiledeskToken = this.tiledeskAuthService.getTiledeskToken()
|
|
901
|
-
|
|
902
|
-
this.tiledeskService
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
1164
|
+
const tiledeskToken = this.tiledeskAuthService.getTiledeskToken()
|
|
1165
|
+
|
|
1166
|
+
this.tiledeskService
|
|
1167
|
+
.getProjectIdByConvRecipient(tiledeskToken, conversationId)
|
|
1168
|
+
.subscribe(
|
|
1169
|
+
(res) => {
|
|
1170
|
+
this.logger.log(
|
|
1171
|
+
'[CONVS-LIST-PAGE] - GET PROJECTID BY CONV RECIPIENT RES',
|
|
1172
|
+
res,
|
|
1173
|
+
)
|
|
1174
|
+
|
|
1175
|
+
if (res) {
|
|
1176
|
+
const project_id = res.id_project
|
|
1177
|
+
this.logger.log(
|
|
1178
|
+
'[INFO-CONTENT-COMP] - GET PROJECTID BY CONV RECIPIENT project_id',
|
|
1179
|
+
project_id,
|
|
1180
|
+
)
|
|
1181
|
+
this.archiveSupportGroupConv(
|
|
1182
|
+
tiledeskToken,
|
|
1183
|
+
project_id,
|
|
1184
|
+
conversationId,
|
|
1185
|
+
)
|
|
1186
|
+
}
|
|
1187
|
+
},
|
|
1188
|
+
(error) => {
|
|
1189
|
+
this.logger.error(
|
|
1190
|
+
'[CONVS-LIST-PAGE] - GET PROJECTID BY CONV RECIPIENT - ERROR ',
|
|
1191
|
+
error,
|
|
1192
|
+
)
|
|
1193
|
+
},
|
|
1194
|
+
() => {
|
|
1195
|
+
this.logger.log(
|
|
1196
|
+
'[CONVS-LIST-PAGE] - GET PROJECTID BY CONV RECIPIENT * COMPLETE *',
|
|
1197
|
+
)
|
|
1198
|
+
},
|
|
1199
|
+
)
|
|
918
1200
|
}
|
|
919
1201
|
|
|
920
1202
|
archiveSupportGroupConv(tiledeskToken, project_id, conversationId) {
|
|
921
|
-
this.logger.log(
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
1203
|
+
this.logger.log(
|
|
1204
|
+
'[CONVS-LIST-PAGE] - onCloseConversation projectId: ',
|
|
1205
|
+
project_id,
|
|
1206
|
+
)
|
|
1207
|
+
this.tiledeskService
|
|
1208
|
+
.closeSupportGroup(tiledeskToken, project_id, conversationId)
|
|
1209
|
+
.subscribe(
|
|
1210
|
+
(res) => {
|
|
1211
|
+
this.archiveActionNotAllowed = false
|
|
1212
|
+
this.logger.log(
|
|
1213
|
+
'[CONVS-LIST-PAGE] - onCloseConversation closeSupportGroup RES',
|
|
1214
|
+
res,
|
|
1215
|
+
)
|
|
1216
|
+
},
|
|
1217
|
+
(error) => {
|
|
1218
|
+
this.logger.error(
|
|
1219
|
+
'[CONVS-LIST-PAGE] - onCloseConversation closeSupportGroup - ERROR ',
|
|
1220
|
+
error,
|
|
1221
|
+
)
|
|
1222
|
+
this.logger.error(
|
|
1223
|
+
'[CONVS-LIST-PAGE] - onCloseConversation closeSupportGroup - ERROR error.error.msg ',
|
|
1224
|
+
error.error.msg,
|
|
1225
|
+
)
|
|
1226
|
+
this.logger.error(
|
|
1227
|
+
'[CONVS-LIST-PAGE] - onCloseConversation closeSupportGroup - ERROR error.status ',
|
|
1228
|
+
error.status,
|
|
1229
|
+
)
|
|
1230
|
+
if (error.error.msg === 'you dont belong to the project.') {
|
|
1231
|
+
this.archiveActionNotAllowed = true
|
|
1232
|
+
}
|
|
1233
|
+
},
|
|
1234
|
+
() => {
|
|
1235
|
+
this.logger.log(
|
|
1236
|
+
'[CONVS-LIST-PAGE] - onCloseConversation closeSupportGroup * COMPLETE *',
|
|
1237
|
+
)
|
|
1238
|
+
this.logger.log(
|
|
1239
|
+
'[CONVS-LIST-PAGE] - onCloseConversation (closeSupportGroup) CONVS ',
|
|
1240
|
+
this.conversations,
|
|
1241
|
+
)
|
|
1242
|
+
this.logger.log(
|
|
1243
|
+
'[CONVS-LIST-PAGE] - onCloseConversation (closeSupportGroup) CONVS LENGHT ',
|
|
1244
|
+
this.conversations.length,
|
|
1245
|
+
)
|
|
1246
|
+
this.events.publish('conversationhasbeenclosed', conversationId)
|
|
1247
|
+
},
|
|
1248
|
+
)
|
|
933
1249
|
}
|
|
934
1250
|
|
|
1251
|
+
onCloseAlert($event) {
|
|
1252
|
+
this.logger.log('[CONVS-LIST-PAGE] - onCloseAlert ', $event)
|
|
1253
|
+
this.archiveActionNotAllowed = false
|
|
1254
|
+
}
|
|
935
1255
|
|
|
936
1256
|
public generateFake(count: number): Array<number> {
|
|
937
|
-
const indexes = []
|
|
1257
|
+
const indexes = []
|
|
938
1258
|
for (let i = 0; i < count; i++) {
|
|
939
|
-
indexes.push(i)
|
|
1259
|
+
indexes.push(i)
|
|
940
1260
|
}
|
|
941
|
-
return indexes
|
|
1261
|
+
return indexes
|
|
942
1262
|
}
|
|
943
1263
|
|
|
944
1264
|
// ------------------------------------------------------------------
|
|
@@ -954,7 +1274,6 @@ export class ConversationListPage implements OnInit {
|
|
|
954
1274
|
// this.logger.log('[CONVS-LIST-PAGE] openArchivedConversationsPage');
|
|
955
1275
|
// }
|
|
956
1276
|
|
|
957
|
-
|
|
958
1277
|
// // info page
|
|
959
1278
|
// returnCloseInfoPage() {
|
|
960
1279
|
// this.logger.log('[CONVS-LIST-PAGE] returnCloseInfoPage');
|
|
@@ -963,7 +1282,6 @@ export class ConversationListPage implements OnInit {
|
|
|
963
1282
|
|
|
964
1283
|
// }
|
|
965
1284
|
|
|
966
|
-
|
|
967
1285
|
// private navigatePage() {
|
|
968
1286
|
// this.logger.log('[CONVS-LIST-PAGE] navigatePage:: >>>> conversationSelected ', this.conversationSelected);
|
|
969
1287
|
// let urlPage = 'detail/';
|
|
@@ -984,7 +1302,6 @@ export class ConversationListPage implements OnInit {
|
|
|
984
1302
|
// this.navService.openPage(urlPage, ConversationDetailPage, navigationExtras);
|
|
985
1303
|
// }
|
|
986
1304
|
|
|
987
|
-
|
|
988
1305
|
// openDetailsWithState(conversationSelected) {
|
|
989
1306
|
// console.log('openDetailsWithState:: >>>> conversationSelected ', conversationSelected);
|
|
990
1307
|
// let navigationExtras: NavigationExtras = {
|
|
@@ -1013,8 +1330,6 @@ export class ConversationListPage implements OnInit {
|
|
|
1013
1330
|
// this.initialize();
|
|
1014
1331
|
// }
|
|
1015
1332
|
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
1333
|
/**
|
|
1019
1334
|
* ::: conversationsChanged :::
|
|
1020
1335
|
* evento richiamato su add, change, remove dell'elenco delle conversazioni
|
|
@@ -1022,15 +1337,13 @@ export class ConversationListPage implements OnInit {
|
|
|
1022
1337
|
* 2 - aggiorno il conto delle nuove conversazioni
|
|
1023
1338
|
* 4 - se esiste un uidReciverFromUrl (passato nell'url)
|
|
1024
1339
|
* e se esiste una conversazione con lo stesso id di uidReciverFromUrl
|
|
1025
|
-
* imposto questa come conversazione attiva (operazione da fare una sola volta al caricamento delle conversazioni)
|
|
1340
|
+
* imposto questa come conversazione attiva (operazione da fare una sola volta al caricamento delle conversazioni)
|
|
1026
1341
|
* e la carico nella pagina di dettaglio e azzero la variabile uidReciverFromUrl!!!
|
|
1027
1342
|
* 5 - altrimenti se esiste una conversazione con lo stesso id della conversazione attiva
|
|
1028
|
-
* e la pagina di dettaglio è vuota (placeholder), carico la conversazione attiva (uidConvSelected) nella pagina di dettaglio
|
|
1343
|
+
* e la pagina di dettaglio è vuota (placeholder), carico la conversazione attiva (uidConvSelected) nella pagina di dettaglio
|
|
1029
1344
|
* (operazione da fare una sola volta al caricamento delle conversazioni)
|
|
1030
1345
|
*/
|
|
1031
1346
|
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
1347
|
// ------------------------------------------------------------------------------------
|
|
1035
1348
|
// ::: readAllMessages ::: ??????????? SEEMS NOT USED ?????????????????
|
|
1036
1349
|
// when all chat messages are displayed,
|