@chat21/chat21-ionic 3.0.61 → 3.0.63
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +39 -0
- package/README.md +6 -2
- package/deploy_prod.sh +1 -1
- package/package.json +2 -1
- package/src/app/app.component.ts +103 -31
- package/src/app/chatlib/conversation-detail/conversation-content/conversation-content.component.html +2 -0
- package/src/app/chatlib/conversation-detail/conversation-content/conversation-content.component.ts +2 -1
- package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.html +33 -21
- package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.scss +34 -12
- package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.ts +2 -1
- package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.scss +1 -1
- package/src/app/chatlib/conversation-detail/message/image/image.component.ts +5 -3
- package/src/app/chatlib/conversation-detail/message/return-receipt/return-receipt.component.scss +1 -1
- package/src/app/components/conversation-detail/bubble-my-message/bubble-my-message.component.html +1 -1
- package/src/app/components/conversation-detail/bubble-my-message/bubble-my-message.component.scss +4 -4
- package/src/app/components/conversation-detail/bubble-others-message/bubble-others-message.component.html +1 -1
- package/src/app/components/conversation-detail/bubble-others-message/bubble-others-message.component.scss +3 -3
- package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.html +3 -3
- package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.ts +10 -55
- package/src/app/components/conversation-detail/message-text-area/message-text-area.component.html +8 -2
- package/src/app/components/conversation-detail/message-text-area/message-text-area.component.ts +2 -0
- package/src/app/components/image-viewer/image-viewer.component.ts +28 -10
- package/src/app/components/project-item/project-item.component.ts +6 -30
- package/src/app/components/sidebar/sidebar.component.html +2 -2
- package/src/app/components/sidebar/sidebar.component.ts +49 -83
- package/src/app/components/sidebar-user-details/sidebar-user-details.component.html +17 -1
- package/src/app/components/sidebar-user-details/sidebar-user-details.component.scss +62 -8
- package/src/app/components/sidebar-user-details/sidebar-user-details.component.ts +81 -111
- package/src/app/pages/authentication/login/login.page.ts +20 -1
- package/src/app/pages/conversation-detail/conversation-detail.page.html +40 -19
- package/src/app/pages/conversation-detail/conversation-detail.page.scss +15 -6
- package/src/app/pages/conversation-detail/conversation-detail.page.ts +179 -244
- package/src/app/services/nav-proxy.service.ts +15 -13
- package/src/assets/i18n/de.json +2 -1
- package/src/assets/i18n/en.json +2 -1
- package/src/assets/i18n/es.json +2 -1
- package/src/assets/i18n/fr.json +2 -1
- package/src/assets/i18n/it.json +2 -1
- package/src/assets/i18n/pt.json +2 -1
- package/src/assets/i18n/ru.json +2 -1
- package/src/assets/i18n/sr.json +2 -1
- package/src/assets/i18n/tr.json +2 -1
- package/src/assets/js/chat21client.js +1 -1
- package/src/chat-config-pre-test.json +3 -2
- package/src/chat-config-pre.json +15 -3
- package/src/chat21-core/providers/firebase/firebase-conversation-handler.ts +2 -3
- package/src/chat21-core/providers/logger/customLogger.ts +2 -10
- package/src/chat21-core/providers/tiledesk/tiledesk-auth.service.ts +1 -1
- package/src/chat21-core/utils/utils-message.ts +102 -85
- package/src/variables.scss +4 -1
|
@@ -22,6 +22,7 @@ import { ModalController } from '@ionic/angular'
|
|
|
22
22
|
import { EventsService } from 'src/app/services/events-service'
|
|
23
23
|
import { CreateTicketPage } from 'src/app/pages/create-ticket/create-ticket.page'
|
|
24
24
|
import { TiledeskService } from 'src/app/services/tiledesk/tiledesk.service'
|
|
25
|
+
import { TYPE_DIRECT } from 'src/chat21-core/utils/constants'
|
|
25
26
|
|
|
26
27
|
@Component({
|
|
27
28
|
selector: 'app-header-conversation-detail',
|
|
@@ -31,57 +32,36 @@ import { TiledeskService } from 'src/app/services/tiledesk/tiledesk.service'
|
|
|
31
32
|
export class HeaderConversationDetailComponent implements OnInit, OnChanges {
|
|
32
33
|
@Input() conversationAvatar: any
|
|
33
34
|
@Input() idLoggedUser: string
|
|
35
|
+
@Input() conversationUid: string
|
|
34
36
|
@Input() conv_type: string
|
|
35
|
-
@Input() isOpenInfoConversation: boolean
|
|
37
|
+
@Input() isOpenInfoConversation: boolean = true
|
|
36
38
|
@Input() isMobile: boolean
|
|
37
39
|
@Input() translationMap: Map<string, string>
|
|
38
40
|
@Output() eventOpenCloseInfoConversation = new EventEmitter<boolean>()
|
|
39
41
|
conversationWithFullname: string
|
|
40
42
|
openInfoConversation = true
|
|
41
43
|
openInfoMessage = true
|
|
42
|
-
DIRECT = 'direct'
|
|
43
44
|
|
|
44
45
|
isDirect = false
|
|
45
46
|
isTyping = false
|
|
46
47
|
borderColor = '#ffffff'
|
|
47
48
|
fontColor = '#949494'
|
|
48
49
|
membersConversation = ['SYSTEM']
|
|
49
|
-
fullNameConv: string
|
|
50
|
-
idConv: string
|
|
51
|
-
conversation_with_fullname: string
|
|
52
50
|
platformName: string
|
|
53
51
|
conv_closed: boolean = false;
|
|
54
52
|
IS_ON_IOS_MOBILE_DEVICE: boolean
|
|
55
53
|
private logger: LoggerService = LoggerInstance.getInstance()
|
|
56
54
|
|
|
57
|
-
/**
|
|
58
|
-
* Constructor
|
|
59
|
-
* @param imageRepoService
|
|
60
|
-
*/
|
|
61
55
|
constructor(
|
|
62
56
|
public imageRepoService: ImageRepoService,
|
|
63
57
|
private route: ActivatedRoute,
|
|
64
58
|
public platform: Platform,
|
|
65
59
|
private router: Router,
|
|
66
|
-
// public tiledeskAuthService: TiledeskAuthService,
|
|
67
60
|
public tiledeskService: TiledeskService,
|
|
68
61
|
public events: EventsService,
|
|
69
62
|
public modalController: ModalController,
|
|
70
63
|
) {
|
|
71
|
-
|
|
72
|
-
// this.conversationWithFullname = params.get('FullNameConv');
|
|
73
|
-
this.logger.log('[CONVS-DETAIL][HEADER] -> params: ', params)
|
|
74
|
-
this.fullNameConv = params.get('FullNameConv')
|
|
75
|
-
this.logger.log(
|
|
76
|
-
'[CONVS-DETAIL][HEADER] -> params > conversation_with_fullname: ',
|
|
77
|
-
this.fullNameConv,
|
|
78
|
-
)
|
|
79
|
-
this.idConv = params.get('IDConv')
|
|
80
|
-
this.logger.log(
|
|
81
|
-
'[CONVS-DETAIL][HEADER] -> params > conversation_with: ',
|
|
82
|
-
this.idConv,
|
|
83
|
-
)
|
|
84
|
-
})
|
|
64
|
+
|
|
85
65
|
}
|
|
86
66
|
|
|
87
67
|
// ----------------------------------------------------
|
|
@@ -91,8 +71,7 @@ export class HeaderConversationDetailComponent implements OnInit, OnChanges {
|
|
|
91
71
|
|
|
92
72
|
this.logger.log('[CONVS-DETAIL][HEADER] - (ngOnInit) - idLoggedUser', this.idLoggedUser,)
|
|
93
73
|
this.logger.log('[CONVS-DETAIL][HEADER] - (ngOnInit) - conversationAvatar', this.conversationAvatar,)
|
|
94
|
-
this.logger.log('[CONVS-DETAIL][HEADER] - (ngOnInit) - conv_type', this.conv_type
|
|
95
|
-
this.conversation_with_fullname = this.conversationAvatar.conversation_with_fullname
|
|
74
|
+
this.logger.log('[CONVS-DETAIL][HEADER] - (ngOnInit) - conv_type', this.conv_type)
|
|
96
75
|
this.listenToConversationHasBeenClosed()
|
|
97
76
|
this.initialize();
|
|
98
77
|
// this.isOniOSMobileDevice()
|
|
@@ -111,29 +90,8 @@ export class HeaderConversationDetailComponent implements OnInit, OnChanges {
|
|
|
111
90
|
ngOnChanges() {
|
|
112
91
|
this.logger.log('[CONVS-DETAIL][HEADER] - (ngOnChanges) - conversationAvatar', this.conversationAvatar)
|
|
113
92
|
if (this.conversationAvatar) {
|
|
114
|
-
this.conversationAvatar.imageurl = this.imageRepoService.getImagePhotoUrl(
|
|
115
|
-
|
|
116
|
-
)
|
|
117
|
-
} else {
|
|
118
|
-
const channelType = setChannelType(this.idConv)
|
|
119
|
-
this.logger.log('[CONVS-DETAIL][HEADER] - (ngOnChanges) - conversationAvatar usecase UNDEFINED channelType ', channelType)
|
|
120
|
-
this.conversationAvatar = setConversationAvatar(
|
|
121
|
-
this.idConv,
|
|
122
|
-
this.fullNameConv,
|
|
123
|
-
channelType,
|
|
124
|
-
)
|
|
125
|
-
if (this.conversationAvatar) {
|
|
126
|
-
this.conversationAvatar.imageurl = this.imageRepoService.getImagePhotoUrl(
|
|
127
|
-
this.conversationAvatar.uid,
|
|
128
|
-
)
|
|
129
|
-
}
|
|
130
|
-
this.logger.log('[CONVS-DETAIL][HEADER] - (ngOnChanges) - conversationAvatar usecase UNDEFINED conversationAvatar', this.conversationAvatar)
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
this.logger.log(
|
|
134
|
-
'[CONVS-DETAIL][HEADER] - (ngOnChanges) - isOpenInfoConversation',
|
|
135
|
-
this.isOpenInfoConversation,
|
|
136
|
-
)
|
|
93
|
+
this.conversationAvatar.imageurl = this.imageRepoService.getImagePhotoUrl(this.conversationAvatar.uid)
|
|
94
|
+
}
|
|
137
95
|
this.openInfoConversation = this.isOpenInfoConversation
|
|
138
96
|
}
|
|
139
97
|
|
|
@@ -142,10 +100,7 @@ export class HeaderConversationDetailComponent implements OnInit, OnChanges {
|
|
|
142
100
|
// ----------------------------------------------------
|
|
143
101
|
initialize() {
|
|
144
102
|
this.getPlatformName()
|
|
145
|
-
if (
|
|
146
|
-
this.conversationAvatar &&
|
|
147
|
-
this.conversationAvatar.channelType === this.DIRECT
|
|
148
|
-
) {
|
|
103
|
+
if ( this.conversationAvatar && this.conversationAvatar.channelType === TYPE_DIRECT ) {
|
|
149
104
|
this.isDirect = true
|
|
150
105
|
} else if (this.idLoggedUser) {
|
|
151
106
|
this.membersConversation.push(this.idLoggedUser)
|
|
@@ -165,13 +120,13 @@ export class HeaderConversationDetailComponent implements OnInit, OnChanges {
|
|
|
165
120
|
|
|
166
121
|
closeConversation() {
|
|
167
122
|
this.logger.log('[CONVS-DETAIL][HEADER] click on RESOLVE this.events', this.events)
|
|
168
|
-
this.events.publish('conversation:closed', this.
|
|
123
|
+
this.events.publish('conversation:closed', this.conversationUid)
|
|
169
124
|
}
|
|
170
125
|
|
|
171
126
|
listenToConversationHasBeenClosed() {
|
|
172
127
|
this.events.subscribe('conversationhasbeenclosed', (convId) => {
|
|
173
128
|
// console.log('[CONVS-DETAIL][HEADER] conversationhasbeenclosed convId', convId)
|
|
174
|
-
if (convId === this.
|
|
129
|
+
if (convId === this.conversationUid) {
|
|
175
130
|
this.logger.log('[CONVS-DETAIL][HEADER] the conversation was closed',)
|
|
176
131
|
this.conv_closed = true;
|
|
177
132
|
}
|
package/src/app/components/conversation-detail/message-text-area/message-text-area.component.html
CHANGED
|
@@ -92,8 +92,14 @@
|
|
|
92
92
|
<!-- https://www.npmjs.com/package/@ctrl/ngx-emoji-mart/v/1.0.6 -->
|
|
93
93
|
<!-- --------------------------------------------------------------------- -->
|
|
94
94
|
<!-- [style]="{ position: 'absolute', bottom: '53px', right: '-246px' }" -->
|
|
95
|
-
<emoji-mart
|
|
96
|
-
|
|
95
|
+
<emoji-mart
|
|
96
|
+
[showPreview]="false"
|
|
97
|
+
[perLine]="emojiPerLine"
|
|
98
|
+
[style.visibility]="showEmojiPicker?'visible':'hidden'"
|
|
99
|
+
[include]="emojiiCategories"
|
|
100
|
+
[color]="emojiColor"
|
|
101
|
+
[ngClass]="{'emoji-mart-desktop': !IS_ON_MOBILE_DEVICE, 'emoji-mart-mobile': IS_ON_MOBILE_DEVICE }"
|
|
102
|
+
(emojiSelect)="addEmoji($event)">
|
|
97
103
|
</emoji-mart>
|
|
98
104
|
<!-- </div> -->
|
|
99
105
|
|
package/src/app/components/conversation-detail/message-text-area/message-text-area.component.ts
CHANGED
|
@@ -87,6 +87,8 @@ export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChange
|
|
|
87
87
|
showEmojiPicker: boolean = false; //To show/hide emoji picker
|
|
88
88
|
addWhiteSpaceBefore: boolean;
|
|
89
89
|
emojiPerLine: number = 9
|
|
90
|
+
emojiColor: string ="#3880ff"
|
|
91
|
+
emojiiCategories = [ 'recent', 'people', 'nature', 'activity']
|
|
90
92
|
/**
|
|
91
93
|
* Constructor
|
|
92
94
|
* @param chooser
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Component, OnInit } from '@angular/core';
|
|
2
|
-
|
|
2
|
+
import { saveAs } from 'file-saver';
|
|
3
3
|
@Component({
|
|
4
4
|
selector: 'app-image-viewer',
|
|
5
5
|
templateUrl: './image-viewer.component.html',
|
|
@@ -7,9 +7,14 @@ import { Component, OnInit } from '@angular/core';
|
|
|
7
7
|
})
|
|
8
8
|
export class ImageViewerComponent implements OnInit {
|
|
9
9
|
|
|
10
|
-
constructor(
|
|
10
|
+
constructor(
|
|
11
|
+
|
|
12
|
+
) { }
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
ngOnInit() { }
|
|
16
|
+
|
|
11
17
|
|
|
12
|
-
ngOnInit() {}
|
|
13
18
|
|
|
14
19
|
closeImageViewerModal() {
|
|
15
20
|
// console.log('HAS CLICKED CLOSE MODAL')
|
|
@@ -18,6 +23,24 @@ export class ImageViewerComponent implements OnInit {
|
|
|
18
23
|
modal.style.display = "none";
|
|
19
24
|
}
|
|
20
25
|
|
|
26
|
+
// __downloadImage() {
|
|
27
|
+
// var modalImg = <HTMLImageElement>document.getElementById("image-viewer-img")
|
|
28
|
+
// console.log('HAS CLICKED CLOSE DWNLD IMG modalImg ', modalImg)
|
|
29
|
+
// var modalImgURL = modalImg.src;
|
|
30
|
+
// console.log('HAS CLICKED CLOSE DWNLD IMG modalImgURL ', modalImgURL)
|
|
31
|
+
// var captionText = document.getElementById("caption").innerHTML;
|
|
32
|
+
// console.log('HAS CLICKED CLOSE DWNLD IMG captionText ', captionText)
|
|
33
|
+
|
|
34
|
+
// const a: any = document.createElement('a');
|
|
35
|
+
// a.href = modalImgURL;
|
|
36
|
+
// a.download = captionText;
|
|
37
|
+
// document.body.appendChild(a);
|
|
38
|
+
// a.style = 'display: none';
|
|
39
|
+
// a.click();
|
|
40
|
+
// a.remove();
|
|
41
|
+
// }
|
|
42
|
+
|
|
43
|
+
|
|
21
44
|
downloadImage() {
|
|
22
45
|
var modalImg = <HTMLImageElement>document.getElementById("image-viewer-img")
|
|
23
46
|
// console.log('HAS CLICKED CLOSE DWNLD IMG modalImg ', modalImg)
|
|
@@ -26,13 +49,8 @@ export class ImageViewerComponent implements OnInit {
|
|
|
26
49
|
var captionText = document.getElementById("caption").innerHTML;
|
|
27
50
|
// console.log('HAS CLICKED CLOSE DWNLD IMG captionText ', captionText)
|
|
28
51
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
a.download = captionText;
|
|
32
|
-
document.body.appendChild(a);
|
|
33
|
-
a.style = 'display: none';
|
|
34
|
-
a.click();
|
|
35
|
-
a.remove();
|
|
52
|
+
saveAs(modalImgURL, captionText);
|
|
53
|
+
this.closeImageViewerModal()
|
|
36
54
|
}
|
|
37
55
|
|
|
38
56
|
}
|
|
@@ -61,9 +61,7 @@ export class ProjectItemComponent implements OnInit {
|
|
|
61
61
|
this.translations();
|
|
62
62
|
this.listenToPostMsgs();
|
|
63
63
|
this.onInitWindowWidth();
|
|
64
|
-
|
|
65
|
-
this.isOnMobileDevice()
|
|
66
|
-
// console.log('[PROJECT-ITEM] - on INIT')
|
|
64
|
+
this.isOnMobileDevice();
|
|
67
65
|
}
|
|
68
66
|
|
|
69
67
|
isOnMobileDevice() {
|
|
@@ -71,7 +69,6 @@ export class ProjectItemComponent implements OnInit {
|
|
|
71
69
|
if (/Android|iPhone/i.test(window.navigator.userAgent)) {
|
|
72
70
|
this.IS_ON_MOBILE_DEVICE = true;
|
|
73
71
|
}
|
|
74
|
-
// console.log('[PROJECT-ITEM] IS_ON_MOBILE_DEVICE', this.IS_ON_MOBILE_DEVICE)
|
|
75
72
|
return this.IS_ON_MOBILE_DEVICE;
|
|
76
73
|
}
|
|
77
74
|
|
|
@@ -107,10 +104,7 @@ export class ProjectItemComponent implements OnInit {
|
|
|
107
104
|
|
|
108
105
|
listenToPostMsgs() {
|
|
109
106
|
window.addEventListener("message", (event) => {
|
|
110
|
-
// console.log("[PROJECT-ITEM] post message event ", event);
|
|
111
|
-
|
|
112
107
|
if (event && event.data) {
|
|
113
|
-
// console.log("[PROJECT-ITEM] message event data ", event.data);
|
|
114
108
|
if (event.data === 'hasChangedProject') {
|
|
115
109
|
this.unservedRequestCount = 0;
|
|
116
110
|
if (this.project) {
|
|
@@ -161,11 +155,13 @@ export class ProjectItemComponent implements OnInit {
|
|
|
161
155
|
getStoredCurrenUser() {
|
|
162
156
|
const storedCurrentUser = this.appStorageService.getItem('currentUser');
|
|
163
157
|
this.logger.log('[PROJECT-ITEM] - STORED CURRENT USER ', storedCurrentUser)
|
|
164
|
-
if (storedCurrentUser) {
|
|
158
|
+
if (storedCurrentUser && storedCurrentUser !== 'undefined') {
|
|
165
159
|
const currentUser = JSON.parse(storedCurrentUser)
|
|
166
160
|
this.logger.log('[PROJECT-ITEM] - STORED CURRENT USER OBJCT', currentUser);
|
|
167
161
|
this.currentUserId = currentUser.uid
|
|
168
162
|
this.logger.log('[PROJECT-ITEM] - CURRENT USER ID', this.currentUserId);
|
|
163
|
+
} else {
|
|
164
|
+
this.logger.error('[PROJECT-ITEM] - STORED CURRENT USER OBJCT NOT FOUND IN STORAGE');
|
|
169
165
|
}
|
|
170
166
|
}
|
|
171
167
|
|
|
@@ -298,28 +294,19 @@ export class ProjectItemComponent implements OnInit {
|
|
|
298
294
|
}
|
|
299
295
|
|
|
300
296
|
updateUnservedRequestCount() {
|
|
301
|
-
|
|
302
|
-
// this.requestsService.requestsList_bs.subscribe((requests) => {
|
|
297
|
+
|
|
303
298
|
this.wsService.wsRequestsList$
|
|
304
299
|
.subscribe((requests) => {
|
|
305
|
-
// console.log('[PROJECT-ITEM] requests ', requests)
|
|
306
300
|
if (requests) {
|
|
307
301
|
let count = 0;
|
|
308
302
|
requests.forEach(r => {
|
|
309
|
-
// this.logger.log('NAVBAR - UPDATE-UNSERVED-REQUEST-COUNT request agents', r.agents)
|
|
310
|
-
// *bug fix: when the user is an agent also for the unserved we have to consider if he is present in agents
|
|
311
|
-
// && this.ROLE_IS_AGENT === true
|
|
312
303
|
if (r['status'] === 100) {
|
|
313
304
|
if (this.hasmeInAgents(r['agents']) === true) {
|
|
314
305
|
count = count + 1;
|
|
315
306
|
}
|
|
316
307
|
}
|
|
317
|
-
// if (r['status'] === 100 && this.ROLE_IS_AGENT === false) {
|
|
318
|
-
// count = count + 1;
|
|
319
|
-
// }
|
|
320
308
|
});
|
|
321
309
|
this.unservedRequestCount = count;
|
|
322
|
-
// console.log('[PROJECT-ITEM] UNSERVED REQUEST COUNT - RES ', this.unservedRequestCount)
|
|
323
310
|
}
|
|
324
311
|
}, error => {
|
|
325
312
|
this.logger.error('[PROJECT-ITEM] UNSERVED REQUEST COUNT * error * ', error)
|
|
@@ -331,10 +318,7 @@ export class ProjectItemComponent implements OnInit {
|
|
|
331
318
|
hasmeInAgents(agents) {
|
|
332
319
|
if (agents) {
|
|
333
320
|
for (let j = 0; j < agents.length; j++) {
|
|
334
|
-
// this.logger.log('[PROJECT-ITEM] hasmeInAgents currentUserId ', this.currentUserId)
|
|
335
|
-
// this.logger.log('[PROJECT-ITEM] hasmeInAgents agent ', agents[j].id_user)
|
|
336
321
|
if (this.currentUserId === agents[j].id_user) {
|
|
337
|
-
// this.logger.log('[PROJECT-ITEM] hasmeInAgents ')
|
|
338
322
|
return true
|
|
339
323
|
}
|
|
340
324
|
}
|
|
@@ -344,7 +328,6 @@ export class ProjectItemComponent implements OnInit {
|
|
|
344
328
|
}
|
|
345
329
|
|
|
346
330
|
updateCurrentUserRequestCount() {
|
|
347
|
-
// this.requestsService.requestsList_bs.subscribe((requests) => {
|
|
348
331
|
this.wsService.wsRequestsList$
|
|
349
332
|
.pipe(
|
|
350
333
|
takeUntil(this.unsubscribe$)
|
|
@@ -353,15 +336,9 @@ export class ProjectItemComponent implements OnInit {
|
|
|
353
336
|
if (requests) {
|
|
354
337
|
let count = 0;
|
|
355
338
|
requests.forEach(r => {
|
|
356
|
-
|
|
357
|
-
// const membersArray = Object.keys(r.members);
|
|
358
339
|
const participantsArray = r['participants'] // new used with ws
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
// const currentUserIsInParticipants = membersArray.includes(this.user._id);
|
|
340
|
+
|
|
362
341
|
const currentUserIsInParticipants = participantsArray.includes(this.currentUserId); // new used with ws
|
|
363
|
-
|
|
364
|
-
// this.logger.log('[NAVBAR] »» WIDGET updateCurrentUserRequestCount REQUEST currentUserRequestCount currentUserIsInParticipants ', currentUserIsInParticipants);
|
|
365
342
|
if (currentUserIsInParticipants === true) {
|
|
366
343
|
count = count + 1;
|
|
367
344
|
}
|
|
@@ -374,7 +351,6 @@ export class ProjectItemComponent implements OnInit {
|
|
|
374
351
|
}, () => {
|
|
375
352
|
this.logger.log('[PROJECT-ITEM] CURRENT USER REQUEST COUNT */* COMPLETE */*')
|
|
376
353
|
})
|
|
377
|
-
|
|
378
354
|
}
|
|
379
355
|
|
|
380
356
|
|
|
@@ -117,7 +117,7 @@
|
|
|
117
117
|
<!-- ------------------------------------------- -->
|
|
118
118
|
<!-- Conversations (MONITOR) (click)="goToConversations()" -->
|
|
119
119
|
<!-- ------------------------------------------- -->
|
|
120
|
-
<ng-container *ngIf="USER_ROLE !== 'agent'">
|
|
120
|
+
<!-- <ng-container *ngIf="USER_ROLE !== 'agent'"> -->
|
|
121
121
|
<li matTooltipClass="custom-mat-tooltip" matTooltip="Monitor"
|
|
122
122
|
#tooltip="matTooltip" matTooltipPosition='right' matTooltipHideDelay="100" style="text-align: center;">
|
|
123
123
|
<a target="_self" href="{{ dashboard_convs_url }}" class="customAncor" style="height: 40px;margin-right: 0px !important;">
|
|
@@ -134,7 +134,7 @@
|
|
|
134
134
|
|
|
135
135
|
</a>
|
|
136
136
|
</li>
|
|
137
|
-
</ng-container>
|
|
137
|
+
<!-- </ng-container> -->
|
|
138
138
|
|
|
139
139
|
<!-- ------------------------------------------- -->
|
|
140
140
|
<!-- CONTACTS (LEADS) (click)="goToContacts()" -->
|
|
@@ -24,7 +24,7 @@ export class SidebarComponent implements OnInit {
|
|
|
24
24
|
|
|
25
25
|
private logger: LoggerService = LoggerInstance.getInstance();
|
|
26
26
|
|
|
27
|
-
USER_ROLE: string
|
|
27
|
+
USER_ROLE: string = 'agent'
|
|
28
28
|
SIDEBAR_IS_SMALL = true
|
|
29
29
|
IS_AVAILABLE: boolean;
|
|
30
30
|
user: any;
|
|
@@ -79,22 +79,6 @@ export class SidebarComponent implements OnInit {
|
|
|
79
79
|
this.listenTocurrentProjectUserUserAvailability$()
|
|
80
80
|
this.getOSCODE();
|
|
81
81
|
this.getCurrentChatLangAndTranslateLabels();
|
|
82
|
-
|
|
83
|
-
// this.loggedUser = this.chatManager.getCurrentUser();
|
|
84
|
-
// if (this.loggedUser) {
|
|
85
|
-
// this.itemAvatar = {
|
|
86
|
-
// imageurl: this.imageRepoService.getImagePhotoUrl(this.loggedUser.uid),
|
|
87
|
-
// avatar: this.loggedUser.avatar,
|
|
88
|
-
// color: this.loggedUser.color,
|
|
89
|
-
// online: this.loggedUser.online,
|
|
90
|
-
// lastConnection: this.loggedUser.lastConnection,
|
|
91
|
-
// status: '',
|
|
92
|
-
// width: '35px',
|
|
93
|
-
// height: '35px'
|
|
94
|
-
// };
|
|
95
|
-
// }
|
|
96
|
-
|
|
97
|
-
|
|
98
82
|
}
|
|
99
83
|
|
|
100
84
|
|
|
@@ -112,7 +96,7 @@ export class SidebarComponent implements OnInit {
|
|
|
112
96
|
this.logger.log('[SIDEBAR] USER_ROLE ', this.USER_ROLE)
|
|
113
97
|
this.buildURLs(this.USER_ROLE)
|
|
114
98
|
} else {
|
|
115
|
-
this.logger.
|
|
99
|
+
this.logger.error('[SIDEBAR] stored_project not found in storage', stored_project)
|
|
116
100
|
}
|
|
117
101
|
}
|
|
118
102
|
|
|
@@ -139,15 +123,21 @@ export class SidebarComponent implements OnInit {
|
|
|
139
123
|
this.logger.log('[SIDEBAR] BSAuthStateChanged ', state)
|
|
140
124
|
|
|
141
125
|
if (state === 'online') {
|
|
142
|
-
|
|
143
|
-
this.logger.log('[SIDEBAR]
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
this.
|
|
147
|
-
this.logger.log('[SIDEBAR]
|
|
148
|
-
|
|
126
|
+
const storedCurrentUser = this.appStorageService.getItem('currentUser');
|
|
127
|
+
this.logger.log('[SIDEBAR] storedCurrentUser ', storedCurrentUser)
|
|
128
|
+
|
|
129
|
+
if (storedCurrentUser && storedCurrentUser !== 'undefined') {
|
|
130
|
+
this.currentUser = JSON.parse(storedCurrentUser);
|
|
131
|
+
this.logger.log('[SIDEBAR] subcribeToAuthStateChanged currentUser ', this.currentUser)
|
|
132
|
+
if (this.currentUser) {
|
|
133
|
+
this.createUserAvatar(this.currentUser)
|
|
134
|
+
this.photo_profile_URL = this.imageRepoService.getImagePhotoUrl(this.currentUser.uid)
|
|
135
|
+
this.logger.log('[SIDEBAR] photo_profile_URL ', this.photo_profile_URL)
|
|
136
|
+
this.checkIfExistPhotoProfile(this.photo_profile_URL)
|
|
137
|
+
}
|
|
138
|
+
} else {
|
|
139
|
+
this.logger.error('[SIDEBAR] BSAuthStateChanged current user not found in storage')
|
|
149
140
|
}
|
|
150
|
-
|
|
151
141
|
}
|
|
152
142
|
})
|
|
153
143
|
}
|
|
@@ -196,32 +186,41 @@ export class SidebarComponent implements OnInit {
|
|
|
196
186
|
|
|
197
187
|
getCurrentChatLangAndTranslateLabels() {
|
|
198
188
|
const browserLang = this.translate.getBrowserLang();
|
|
199
|
-
const currentUser = JSON.parse(this.appStorageService.getItem('currentUser'));
|
|
200
|
-
// console.log('[SIDEBAR] - ngOnInit - currentUser ', currentUser)
|
|
201
|
-
// console.log('[SIDEBAR] - ngOnInit - browserLang ', browserLang)
|
|
202
|
-
let currentUserId = ''
|
|
203
|
-
if (currentUser) {
|
|
204
|
-
currentUserId = currentUser.uid
|
|
205
|
-
// console.log('[SIDEBAR] - ngOnInit - currentUserId ', currentUserId)
|
|
206
|
-
}
|
|
207
189
|
|
|
208
|
-
const
|
|
209
|
-
|
|
190
|
+
const storedCurrentUser = this.appStorageService.getItem('currentUser')
|
|
191
|
+
this.logger.log('[SIDEBAR] - ngOnInit - storedCurrentUser ', storedCurrentUser)
|
|
210
192
|
|
|
211
|
-
|
|
212
|
-
if (
|
|
213
|
-
|
|
214
|
-
this.logger.log('[SIDEBAR]
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
193
|
+
|
|
194
|
+
if (storedCurrentUser && storedCurrentUser !== 'undefined') {
|
|
195
|
+
const currentUser = JSON.parse(storedCurrentUser);
|
|
196
|
+
this.logger.log('[SIDEBAR] - ngOnInit - currentUser ', currentUser)
|
|
197
|
+
this.logger.log('[SIDEBAR] - ngOnInit - browserLang ', browserLang)
|
|
198
|
+
let currentUserId = ''
|
|
199
|
+
if (currentUser) {
|
|
200
|
+
currentUserId = currentUser.uid
|
|
201
|
+
this.logger.log('[SIDEBAR] - ngOnInit - getCurrentChatLangAndTranslateLabels - currentUserId ', currentUserId)
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
const stored_preferred_lang = localStorage.getItem(currentUserId + '_lang');
|
|
205
|
+
this.logger.log('[SIDEBAR] stored_preferred_lang: ', stored_preferred_lang);
|
|
206
|
+
|
|
207
|
+
let chat_lang = '';
|
|
208
|
+
if (browserLang && !stored_preferred_lang) {
|
|
209
|
+
chat_lang = browserLang
|
|
210
|
+
this.logger.log('[SIDEBAR] chat_lang: ', chat_lang);
|
|
211
|
+
} else if (browserLang && stored_preferred_lang) {
|
|
212
|
+
chat_lang = stored_preferred_lang
|
|
213
|
+
this.logger.log('[SIDEBAR] chat_lang: ', chat_lang);
|
|
214
|
+
}
|
|
215
|
+
if (tranlatedLanguage.includes(chat_lang)) {
|
|
216
|
+
this.logger.log('[SIDEBAR] tranlatedLanguage includes', chat_lang, ': ', tranlatedLanguage.includes(chat_lang))
|
|
217
|
+
this.translate.use(chat_lang);
|
|
218
|
+
} else {
|
|
219
|
+
this.logger.log('[SIDEBAR] tranlatedLanguage includes', chat_lang, ': ', tranlatedLanguage.includes(chat_lang))
|
|
220
|
+
this.translate.use('en');
|
|
221
|
+
}
|
|
222
222
|
} else {
|
|
223
|
-
this.logger.
|
|
224
|
-
this.translate.use('en');
|
|
223
|
+
this.logger.error('[SIDEBAR] - ngOnInit - currentUser not found in storage ')
|
|
225
224
|
}
|
|
226
225
|
this.translateLabels()
|
|
227
226
|
}
|
|
@@ -240,7 +239,6 @@ export class SidebarComponent implements OnInit {
|
|
|
240
239
|
getConversationsTranslation() {
|
|
241
240
|
this.translate.get('Conversations')
|
|
242
241
|
.subscribe((text: string) => {
|
|
243
|
-
// console.log('[SIDEBAR] - translate Conversations', text)
|
|
244
242
|
this.conversations_lbl = text
|
|
245
243
|
});
|
|
246
244
|
}
|
|
@@ -248,7 +246,6 @@ export class SidebarComponent implements OnInit {
|
|
|
248
246
|
getContactsTranslation() {
|
|
249
247
|
this.translate.get('LABEL_CONTACTS')
|
|
250
248
|
.subscribe((text: string) => {
|
|
251
|
-
// console.log('[SIDEBAR] - translate Contacts', text)
|
|
252
249
|
this.contacts_lbl = text
|
|
253
250
|
});
|
|
254
251
|
}
|
|
@@ -256,7 +253,6 @@ export class SidebarComponent implements OnInit {
|
|
|
256
253
|
getAppsTranslation() {
|
|
257
254
|
this.translate.get('Apps')
|
|
258
255
|
.subscribe((text: string) => {
|
|
259
|
-
// console.log('[SIDEBAR] - translate Apps', text)
|
|
260
256
|
this.apps_lbl = text
|
|
261
257
|
});
|
|
262
258
|
}
|
|
@@ -264,7 +260,6 @@ export class SidebarComponent implements OnInit {
|
|
|
264
260
|
getAnalyticsTranslation() {
|
|
265
261
|
this.translate.get('Analytics')
|
|
266
262
|
.subscribe((text: string) => {
|
|
267
|
-
// console.log('[SIDEBAR] - translate Analytics', text)
|
|
268
263
|
this.analytics_lbl = text
|
|
269
264
|
});
|
|
270
265
|
}
|
|
@@ -272,7 +267,6 @@ export class SidebarComponent implements OnInit {
|
|
|
272
267
|
getActivitiesTranslation() {
|
|
273
268
|
this.translate.get('Activities')
|
|
274
269
|
.subscribe((text: string) => {
|
|
275
|
-
// console.log('[SIDEBAR] - translate Activities', text)
|
|
276
270
|
this.activities_lbl = text
|
|
277
271
|
});
|
|
278
272
|
}
|
|
@@ -280,7 +274,6 @@ export class SidebarComponent implements OnInit {
|
|
|
280
274
|
getHistoryTranslation() {
|
|
281
275
|
this.translate.get('History')
|
|
282
276
|
.subscribe((text: string) => {
|
|
283
|
-
// console.log('[SIDEBAR] - translate History', text)
|
|
284
277
|
this.history_lbl = text
|
|
285
278
|
});
|
|
286
279
|
}
|
|
@@ -288,7 +281,6 @@ export class SidebarComponent implements OnInit {
|
|
|
288
281
|
getSettingsTranslation() {
|
|
289
282
|
this.translate.get('Settings')
|
|
290
283
|
.subscribe((text: string) => {
|
|
291
|
-
// console.log('[SIDEBAR] - translate Settings', text)
|
|
292
284
|
this.settings_lbl = text
|
|
293
285
|
});
|
|
294
286
|
}
|
|
@@ -385,20 +377,14 @@ export class SidebarComponent implements OnInit {
|
|
|
385
377
|
this.countClickOnOpenUserDetailSidebar++
|
|
386
378
|
this.logger.log('[SIDEBAR-CHAT] countClickOnOpenUserDetailSidebar', this.countClickOnOpenUserDetailSidebar)
|
|
387
379
|
this.logger.log('[SIDEBAR-CHAT] OPEN UESER DTLS SIDE PANEL')
|
|
388
|
-
// this.HAS_CLICKED_OPEN_USER_DETAIL = true
|
|
389
|
-
// console.log('[SIDEBAR-CHAT] OPEN USER DTLS SIDE PANEL ', this.HAS_CLICKED_OPEN_USER_DETAIL)
|
|
390
380
|
const elSidebarUserDtls = <HTMLElement>document.querySelector('#user-details');
|
|
391
381
|
this.logger.log('[SIDEBAR] OPEN USER DTLS SIDE PANEL elSidebarUserDtls ', elSidebarUserDtls)
|
|
392
382
|
|
|
393
|
-
|
|
394
|
-
// elSidebarUserDtls.classList.add("active");
|
|
395
|
-
// this.events.publish('userdetailsidebar:opened', true);
|
|
396
|
-
// }
|
|
383
|
+
|
|
397
384
|
if (elSidebarUserDtls && this.countClickOnOpenUserDetailSidebar === 1) {
|
|
398
385
|
elSidebarUserDtls.classList.add("active");
|
|
399
386
|
}
|
|
400
387
|
if (elSidebarUserDtls && this.countClickOnOpenUserDetailSidebar > 1) {
|
|
401
|
-
// console.log('[SIDEBAR] this.countClickOnOpenUserDetailSidebar HERE', this.countClickOnOpenUserDetailSidebar)
|
|
402
388
|
if (elSidebarUserDtls.classList.contains('active')) {
|
|
403
389
|
this.logger.log('[SIDEBAR-CHAT] elSidebarUserDtls contains class ACTIVE', elSidebarUserDtls)
|
|
404
390
|
elSidebarUserDtls.classList.remove("active");
|
|
@@ -409,24 +395,6 @@ export class SidebarComponent implements OnInit {
|
|
|
409
395
|
}
|
|
410
396
|
}
|
|
411
397
|
|
|
412
|
-
// onCloseUserDetailsSidebar($event) {
|
|
413
|
-
// this.logger.log('[SIDEBAR-CHAT] HAS_CLICKED_CLOSE_USER_DETAIL ', $event)
|
|
414
|
-
// this.HAS_CLICKED_OPEN_USER_DETAIL = $event
|
|
415
|
-
// const elemNavbar = <HTMLElement>document.querySelector('.navbar-absolute');
|
|
416
|
-
// this.logger.log('[SIDEBAR] elemNavBar ', elemNavbar)
|
|
417
|
-
// if (elemNavbar) {
|
|
418
|
-
// elemNavbar.classList.remove("navbar-absolute-custom-class")
|
|
419
|
-
// }
|
|
420
|
-
|
|
421
|
-
// const elemNavbarBrand = <HTMLElement>document.querySelector('.navbar-brand');
|
|
422
|
-
// this.logger.log('[SIDEBAR] elemNavbarBrand ', elemNavbarBrand)
|
|
423
|
-
// if (elemNavbarBrand) {
|
|
424
|
-
// elemNavbarBrand.classList.remove("navbar-brand-z-index-zero")
|
|
425
|
-
// }
|
|
426
|
-
// }
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
398
|
goToHome() {
|
|
431
399
|
let url = this.DASHBOARD_URL + this.project_id + '/home'
|
|
432
400
|
this.dashboard_home_url = url;
|
|
@@ -458,14 +426,12 @@ export class SidebarComponent implements OnInit {
|
|
|
458
426
|
myWindow.focus();
|
|
459
427
|
}
|
|
460
428
|
|
|
461
|
-
|
|
462
429
|
goToAnalytics() {
|
|
463
430
|
let url = this.DASHBOARD_URL + this.project_id + '/analytics'
|
|
464
431
|
const myWindow = window.open(url, '_self');
|
|
465
432
|
myWindow.focus();
|
|
466
433
|
}
|
|
467
434
|
|
|
468
|
-
|
|
469
435
|
goToActivities() {
|
|
470
436
|
let url = this.DASHBOARD_URL + this.project_id + '/activities'
|
|
471
437
|
const myWindow = window.open(url, '_self');
|
|
@@ -52,6 +52,10 @@
|
|
|
52
52
|
|
|
53
53
|
<div class="user-details-role">
|
|
54
54
|
<h3>{{ USER_ROLE_LABEL }} </h3>
|
|
55
|
+
|
|
56
|
+
<div class="user-details-view-profile" (click)="goToUserProfile()">
|
|
57
|
+
{{EditProfileLabel}}
|
|
58
|
+
</div>
|
|
55
59
|
</div>
|
|
56
60
|
|
|
57
61
|
<section class="availability-section">
|
|
@@ -74,9 +78,12 @@
|
|
|
74
78
|
<hr class="first-divider">
|
|
75
79
|
|
|
76
80
|
<section *ngIf="isVisiblePAY" class="user-details-plan-info">
|
|
81
|
+
<span class="material-icons user-details-plan-icon">
|
|
82
|
+
apps
|
|
83
|
+
</span>
|
|
77
84
|
<span>
|
|
78
85
|
<div> {{prjct_name}} </div>
|
|
79
|
-
<div style="display: inline-block;"> {{ profile_name_translated }} </div>
|
|
86
|
+
<div style="display: inline-block; margin-left: 26px;"> {{ profile_name_translated }} </div>
|
|
80
87
|
|
|
81
88
|
<div *ngIf="plan_type === 'payment' && plan_subscription_is_active === false"
|
|
82
89
|
style="color:#f44336; position:relative; top: -1px;;display: inline-block;">
|
|
@@ -95,6 +102,15 @@
|
|
|
95
102
|
</span>
|
|
96
103
|
</section>
|
|
97
104
|
|
|
105
|
+
<section class="user-details-help-center">
|
|
106
|
+
<span class="material-icons user-details-help-center-icon">
|
|
107
|
+
support
|
|
108
|
+
</span>
|
|
109
|
+
<span class="user-details-help-center" (click)="goToHelpCenter()">
|
|
110
|
+
Help center
|
|
111
|
+
</span>
|
|
112
|
+
</section>
|
|
113
|
+
|
|
98
114
|
<!-- <hr class="second-divider" style="margin-top: 20px;border: 0;
|
|
99
115
|
border-top: 1px solid rgba(255, 255,255, 0.2);"> -->
|
|
100
116
|
|