@chat21/chat21-ionic 3.0.58 → 3.0.59-rc15
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 +69 -0
- package/README.md +9 -0
- package/config.xml +11 -2
- package/env.sample +2 -0
- package/package.json +1 -1
- package/resources/Android/splash/drawable-land-hdpi-screen.png +0 -0
- package/resources/Android/splash/drawable-land-ldpi-screen.png +0 -0
- package/resources/Android/splash/drawable-land-mdpi-screen.png +0 -0
- package/resources/Android/splash/drawable-land-xhdpi-screen.png +0 -0
- package/resources/Android/splash/drawable-land-xxhdpi-screen.png +0 -0
- package/resources/Android/splash/drawable-land-xxxhdpi-screen.png +0 -0
- package/resources/Android/splash/drawable-port-hdpi-screen.png +0 -0
- package/resources/Android/splash/drawable-port-ldpi-screen.png +0 -0
- package/resources/Android/splash/drawable-port-mdpi-screen.png +0 -0
- package/resources/Android/splash/drawable-port-xhdpi-screen.png +0 -0
- package/resources/Android/splash/drawable-port-xxhdpi-screen.png +0 -0
- package/resources/Android/splash/drawable-port-xxxhdpi-screen.png +0 -0
- package/resources/Android/splash.png +0 -0
- package/src/app/app-routing.module.ts +21 -17
- package/src/app/app.component.html +6 -3
- package/src/app/app.component.ts +259 -55
- package/src/app/app.module.ts +16 -8
- package/src/app/chatlib/conversation-detail/conversation-content/conversation-content.component.html +1 -1
- package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.html +4 -4
- package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.scss +8 -2
- package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.ts +6 -1
- package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.html +7 -2
- package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.ts +47 -2
- package/src/app/chatlib/conversation-detail/message/image/image.component.html +7 -6
- package/src/app/chatlib/conversation-detail/message/image/image.component.ts +20 -1
- package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.html +39 -9
- package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.scss +8 -144
- package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.ts +14 -17
- package/src/app/chatlib/list-conversations-component/list-conversations/list-conversations.component.html +1 -1
- package/src/app/components/authentication/login/login.component.html +10 -10
- package/src/app/components/authentication/login/login.component.ts +2 -1
- package/src/app/components/conversation-detail/bubble-my-message/bubble-my-message.component.ts +1 -1
- package/src/app/components/conversation-detail/bubble-others-message/bubble-others-message.component.ts +1 -1
- package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.html +17 -12
- package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.scss +12 -0
- package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.ts +21 -5
- package/src/app/components/conversation-detail/message-text-area/message-text-area.component.html +3 -2
- package/src/app/components/conversation-detail/message-text-area/message-text-area.component.scss +22 -17
- package/src/app/components/conversation-detail/message-text-area/message-text-area.component.ts +46 -5
- package/src/app/components/ddp-header/ddp-header.component.html +1 -1
- package/src/app/components/ddp-header/ddp-header.component.ts +4 -2
- package/src/app/components/image-viewer/image-viewer.component.html +23 -0
- package/src/app/components/image-viewer/image-viewer.component.scss +107 -0
- package/src/app/components/image-viewer/image-viewer.component.spec.ts +24 -0
- package/src/app/components/image-viewer/image-viewer.component.ts +38 -0
- package/src/app/components/project-item/project-item.component.html +147 -0
- package/src/app/components/project-item/project-item.component.scss +669 -0
- package/src/app/components/project-item/project-item.component.spec.ts +24 -0
- package/src/app/components/project-item/project-item.component.ts +317 -0
- package/src/app/components/utils/avatar-profile/avatar-profile.component.html +7 -0
- package/src/app/components/utils/avatar-profile/avatar-profile.component.ts +22 -5
- package/src/app/pages/authentication/login/login.page.html +1 -2
- package/src/app/pages/authentication/login/login.page.ts +1 -1
- package/src/app/pages/conversation-detail/conversation-detail.page.html +5 -3
- package/src/app/pages/conversation-detail/conversation-detail.page.ts +122 -30
- package/src/app/pages/conversations-list/conversations-list.page.html +44 -23
- package/src/app/pages/conversations-list/conversations-list.page.scss +290 -127
- package/src/app/pages/conversations-list/conversations-list.page.ts +172 -12
- package/src/app/pages/unassigned-conversations/unassigned-conversations-routing.module.ts +17 -0
- package/src/app/pages/unassigned-conversations/unassigned-conversations.module.ts +22 -0
- package/src/app/pages/unassigned-conversations/unassigned-conversations.page.html +22 -0
- package/src/app/pages/unassigned-conversations/unassigned-conversations.page.scss +79 -0
- package/src/app/pages/unassigned-conversations/unassigned-conversations.page.spec.ts +24 -0
- package/src/app/pages/unassigned-conversations/unassigned-conversations.page.ts +108 -0
- package/src/app/services/nav-proxy.service.ts +1 -1
- package/src/app/services/tiledesk/tiledesk.service.ts +22 -1
- package/src/app/services/websocket/websocket-js.ts +557 -0
- package/src/app/services/websocket/websocket.service.spec.ts +12 -0
- package/src/app/services/websocket/websocket.service.ts +274 -0
- package/src/app/shared/shared.module.ts +7 -1
- package/src/assets/i18n/en.json +9 -1
- package/src/assets/i18n/it.json +9 -1
- package/src/assets/js/chat21client.js +141 -67
- package/src/assets/transparent.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 +3 -1
- package/src/chat21-core/providers/chat-manager.ts +3 -3
- package/src/chat21-core/providers/firebase/firebase-archivedconversations-handler.ts +1 -1
- package/src/chat21-core/providers/firebase/firebase-auth-service.ts +6 -6
- package/src/chat21-core/providers/firebase/firebase-conversation-handler.ts +1 -1
- package/src/chat21-core/providers/firebase/firebase-notifications.ts +1 -1
- package/src/chat21-core/providers/firebase/firebase-presence.service.ts +2 -2
- package/src/chat21-core/providers/firebase/firebase-typing.service.ts +1 -1
- package/src/chat21-core/providers/firebase/firebase-upload.service.ts +1 -1
- package/src/chat21-core/providers/mqtt/mqtt-auth-service.ts +27 -27
- package/src/chat21-core/providers/mqtt/mqtt-conversations-handler.ts +13 -5
- package/src/chat21-core/providers/mqtt/mqtt-notifications.ts +101 -11
- package/src/chat21-core/providers/tiledesk/tiledesk-auth.service.ts +13 -4
- package/src/chat21-core/utils/utils.ts +1 -1
- package/src/firebase-messaging-sw-template.js +1 -1
|
@@ -0,0 +1,317 @@
|
|
|
1
|
+
import { Component, EventEmitter, HostListener, OnInit, Output } from '@angular/core';
|
|
2
|
+
import { WebsocketService } from 'src/app/services/websocket/websocket.service';
|
|
3
|
+
import { Subject } from 'rxjs';
|
|
4
|
+
import { takeUntil } from 'rxjs/operators';
|
|
5
|
+
import { AppStorageService } from 'src/chat21-core/providers/abstract/app-storage.service';
|
|
6
|
+
import { LoggerService } from 'src/chat21-core/providers/abstract/logger.service';
|
|
7
|
+
import { LoggerInstance } from 'src/chat21-core/providers/logger/loggerInstance';
|
|
8
|
+
import { CustomTranslateService } from 'src/chat21-core/providers/custom-translate.service';
|
|
9
|
+
import { TiledeskAuthService } from 'src/chat21-core/providers/tiledesk/tiledesk-auth.service';
|
|
10
|
+
import { TiledeskService } from 'src/app/services/tiledesk/tiledesk.service';
|
|
11
|
+
|
|
12
|
+
@Component({
|
|
13
|
+
selector: 'app-project-item',
|
|
14
|
+
templateUrl: './project-item.component.html',
|
|
15
|
+
styleUrls: ['./project-item.component.scss'],
|
|
16
|
+
})
|
|
17
|
+
export class ProjectItemComponent implements OnInit {
|
|
18
|
+
@Output() projectIdEvent = new EventEmitter<string>()
|
|
19
|
+
|
|
20
|
+
private unsubscribe$: Subject<any> = new Subject<any>();
|
|
21
|
+
project: any;
|
|
22
|
+
tiledeskToken: string;
|
|
23
|
+
|
|
24
|
+
unservedRequestCount: number = 0;
|
|
25
|
+
currentUserRequestCount: number;
|
|
26
|
+
ROLE_IS_AGENT: boolean;
|
|
27
|
+
currentUserId: string;
|
|
28
|
+
public translationMap: Map<string, string>;
|
|
29
|
+
private logger: LoggerService = LoggerInstance.getInstance();
|
|
30
|
+
window_width_is_60: boolean;
|
|
31
|
+
newInnerWidth: any;
|
|
32
|
+
|
|
33
|
+
constructor(
|
|
34
|
+
public wsService: WebsocketService,
|
|
35
|
+
public appStorageService: AppStorageService,
|
|
36
|
+
private translateService: CustomTranslateService,
|
|
37
|
+
public tiledeskAuthService: TiledeskAuthService,
|
|
38
|
+
public tiledeskService: TiledeskService
|
|
39
|
+
) { }
|
|
40
|
+
|
|
41
|
+
ngOnInit() {
|
|
42
|
+
this.getLastProjectStoredAndSubscToWSAvailabilityAndConversations();
|
|
43
|
+
this.getStoredToken();
|
|
44
|
+
this.getStoredCurrenUser();
|
|
45
|
+
this.translations();
|
|
46
|
+
this.listenToPostMsgs();
|
|
47
|
+
this.onInitWindowWidth();
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
listenToPostMsgs() {
|
|
51
|
+
window.addEventListener("message", (event) => {
|
|
52
|
+
// console.log("[PROJECT-ITEM] post message event ", event);
|
|
53
|
+
|
|
54
|
+
if (event && event.data && event.data) {
|
|
55
|
+
// console.log("[APP-COMP] message event data ", event.data);
|
|
56
|
+
if (event.data === 'hasChangedProject') {
|
|
57
|
+
this.getLastProjectStoredAndSubscToWSAvailabilityAndConversations();
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
})
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
public translations() {
|
|
64
|
+
const keys = [
|
|
65
|
+
'Available',
|
|
66
|
+
'Unavailable',
|
|
67
|
+
'Busy'
|
|
68
|
+
];
|
|
69
|
+
this.translationMap = this.translateService.translateLanguage(keys);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
@HostListener('window:resize', ['$event'])
|
|
73
|
+
onResize(event: any) {
|
|
74
|
+
this.newInnerWidth = event.target.innerWidth;
|
|
75
|
+
this.logger.log('[PROJECTS-X-PANEL] - INNER WIDTH ', this.newInnerWidth)
|
|
76
|
+
|
|
77
|
+
if (this.newInnerWidth <= 150) {
|
|
78
|
+
this.window_width_is_60 = true;
|
|
79
|
+
} else {
|
|
80
|
+
this.window_width_is_60 = false;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
onInitWindowWidth(): any {
|
|
85
|
+
const actualWidth = window.innerWidth;
|
|
86
|
+
this.logger.log('[PROJECTS-X-PANEL] - ACTUAL Width ', actualWidth);
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
// if (actualWidth <= 60) {
|
|
90
|
+
if (actualWidth <= 150) {
|
|
91
|
+
this.window_width_is_60 = true;
|
|
92
|
+
} else {
|
|
93
|
+
this.window_width_is_60 = false;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
getStoredToken() {
|
|
100
|
+
this.tiledeskToken = this.appStorageService.getItem('tiledeskToken');
|
|
101
|
+
this.logger.log('[PROJECT-ITEM] - STORED TILEDEK TOKEN ', this.tiledeskToken)
|
|
102
|
+
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
getStoredCurrenUser() {
|
|
106
|
+
const storedCurrentUser = this.appStorageService.getItem('currentUser');
|
|
107
|
+
this.logger.log('[PROJECT-ITEM] - STORED CURRENT USER ', storedCurrentUser)
|
|
108
|
+
if (storedCurrentUser) {
|
|
109
|
+
const currentUser = JSON.parse(storedCurrentUser)
|
|
110
|
+
this.logger.log('[PROJECT-ITEM] - STORED CURRENT USER OBJCT', currentUser);
|
|
111
|
+
this.currentUserId = currentUser.uid
|
|
112
|
+
this.logger.log('[PROJECT-ITEM] - CURRENT USER ID', this.currentUserId);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
getLastProjectStoredAndSubscToWSAvailabilityAndConversations() {
|
|
117
|
+
let stored_project = ''
|
|
118
|
+
try {
|
|
119
|
+
stored_project = localStorage.getItem('last_project')
|
|
120
|
+
this.logger.log('PROJECT-ITEM - THERE IS A STORED PROJECT ', stored_project)
|
|
121
|
+
} catch (err) {
|
|
122
|
+
this.logger.log('Get local storage LAST PROJECT ', err)
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
if (!stored_project) {
|
|
127
|
+
this.logger.log('PROJECT-ITEM - THERE IS NOT STORED LAST PROJECT ', stored_project)
|
|
128
|
+
const tiledeskToken = this.appStorageService.getItem('tiledeskToken');
|
|
129
|
+
this.logger.log('[INFO-CONTENT-COMP] - GET PROJECTS - tiledeskToken', tiledeskToken);
|
|
130
|
+
this.tiledeskService.getProjects(tiledeskToken).subscribe(projects => {
|
|
131
|
+
this.logger.log('[INFO-CONTENT-COMP] - GET PROJECTS - RES', projects);
|
|
132
|
+
this.project = projects[0];
|
|
133
|
+
this.logger.log('[INFO-CONTENT-COMP] - GET PROJECTS - RES this.project', this.project);
|
|
134
|
+
|
|
135
|
+
localStorage.setItem('last_project', JSON.stringify(projects[0]))
|
|
136
|
+
this.doProjectSubscriptions(this.project)
|
|
137
|
+
|
|
138
|
+
}, (error) => {
|
|
139
|
+
this.logger.error('[INFO-CONTENT-COMP] - GET PROJECTS - ERROR ', error);
|
|
140
|
+
|
|
141
|
+
}, () => {
|
|
142
|
+
this.logger.log('[INFO-CONTENT-COMP] - GET PROJECTS * COMPLETE *');
|
|
143
|
+
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
if (stored_project) {
|
|
149
|
+
this.logger.log('PROJECT-ITEM - THERE IS STORED LAST PROJECT ', stored_project)
|
|
150
|
+
this.project = JSON.parse(stored_project)
|
|
151
|
+
this.doProjectSubscriptions(this.project)
|
|
152
|
+
this.logger.log('[PROJECT-ITEM] - LAST PROJECT PARSED ', this.project)
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
doProjectSubscriptions(project) {
|
|
159
|
+
if (project) {
|
|
160
|
+
const user_role = this.project.role
|
|
161
|
+
this.logger.log('[PROJECT-ITEM] - user_role ', user_role)
|
|
162
|
+
this.projectIdEvent.emit(project.id_project._id)
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
if (user_role === 'agent') {
|
|
166
|
+
this.ROLE_IS_AGENT = true;
|
|
167
|
+
|
|
168
|
+
} else {
|
|
169
|
+
this.ROLE_IS_AGENT = false;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
this.logger.log('[PROJECT-ITEM] - LAST PROJECT PARSED > user_role ', user_role)
|
|
174
|
+
this.wsService.subscriptionToWsCurrentProjectUserAvailability(project.id_project._id, this.project._id);
|
|
175
|
+
this.listenTocurrentProjectUserUserAvailability$(project)
|
|
176
|
+
|
|
177
|
+
this.wsService.subscriptionToWsConversations(project.id_project._id)
|
|
178
|
+
// this.updateCurrentUserRequestCount();
|
|
179
|
+
this.updateUnservedRequestCount();
|
|
180
|
+
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
listenTocurrentProjectUserUserAvailability$(project) {
|
|
185
|
+
this.wsService.currentProjectUserAvailability$
|
|
186
|
+
.pipe(
|
|
187
|
+
takeUntil(this.unsubscribe$)
|
|
188
|
+
)
|
|
189
|
+
.subscribe((projectUser) => {
|
|
190
|
+
this.logger.log('[PROJECT-ITEM] - $UBSC TO WS USER AVAILABILITY & BUSY STATUS RES ', projectUser);
|
|
191
|
+
|
|
192
|
+
if (project.id_project._id === projectUser['id_project']) {
|
|
193
|
+
project['ws_projct_user_available'] = projectUser['user_available'];
|
|
194
|
+
project['ws_projct_user_isBusy'] = projectUser['isBusy']
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
}, (error) => {
|
|
198
|
+
this.logger.error('[PROJECT-ITEM] - $UBSC TO WS USER AVAILABILITY & BUSY STATUS error ', error);
|
|
199
|
+
}, () => {
|
|
200
|
+
this.logger.log('[PROJECT-ITEM] - $UBSC TO WS USER AVAILABILITY & BUSY STATUS * COMPLETE *');
|
|
201
|
+
})
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
changeAvailabilityState(projectid, available) {
|
|
205
|
+
this.logger.log('[PROJECT-ITEM] - changeAvailabilityState projectid', projectid, ' available: ', available);
|
|
206
|
+
|
|
207
|
+
available = !available
|
|
208
|
+
this.logger.log('[PROJECT-ITEM] - changeAvailabilityState projectid', projectid, ' available: ', available);
|
|
209
|
+
|
|
210
|
+
this.wsService.updateCurrentUserAvailability(this.tiledeskToken, projectid, available)
|
|
211
|
+
.subscribe((projectUser: any) => {
|
|
212
|
+
|
|
213
|
+
this.logger.log('[PROJECT-ITEM] - PROJECT-USER UPDATED ', projectUser)
|
|
214
|
+
|
|
215
|
+
// NOTIFY TO THE USER SERVICE WHEN THE AVAILABLE / UNAVAILABLE BUTTON IS CLICKED
|
|
216
|
+
// this.usersService.availability_btn_clicked(true)
|
|
217
|
+
|
|
218
|
+
if (this.project['id_project']._id === projectUser.id_project) {
|
|
219
|
+
this.project['ws_projct_user_available'] = projectUser.user_available;
|
|
220
|
+
// this.project['ws_projct_user_isBusy'] = projectUser['isBusy']
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
}, (error) => {
|
|
224
|
+
this.logger.error('[PROJECT-ITEM] - PROJECT-USER UPDATED - ERROR ', error);
|
|
225
|
+
|
|
226
|
+
}, () => {
|
|
227
|
+
this.logger.log('[PROJECT-ITEM] - PROJECT-USER UPDATED * COMPLETE *');
|
|
228
|
+
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
updateUnservedRequestCount() {
|
|
233
|
+
// this.requestsService.requestsList_bs.subscribe((requests) => {
|
|
234
|
+
this.wsService.wsRequestsList$
|
|
235
|
+
.pipe(
|
|
236
|
+
takeUntil(this.unsubscribe$)
|
|
237
|
+
)
|
|
238
|
+
.subscribe((requests) => {
|
|
239
|
+
|
|
240
|
+
if (requests) {
|
|
241
|
+
let count = 0;
|
|
242
|
+
requests.forEach(r => {
|
|
243
|
+
// this.logger.log('NAVBAR - UPDATE-UNSERVED-REQUEST-COUNT request agents', r.agents)
|
|
244
|
+
// *bug fix: when the user is an agent also for the unserved we have to consider if he is present in agents
|
|
245
|
+
if (r['status'] === 100 && this.ROLE_IS_AGENT === true) {
|
|
246
|
+
if (this.hasmeInAgents(r['agents']) === true) {
|
|
247
|
+
count = count + 1;
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
if (r['status'] === 100 && this.ROLE_IS_AGENT === false) {
|
|
251
|
+
count = count + 1;
|
|
252
|
+
}
|
|
253
|
+
});
|
|
254
|
+
this.unservedRequestCount = count;
|
|
255
|
+
this.logger.log('[PROJECT-ITEM] UNSERVED REQUEST COUNT - RES ', this.unservedRequestCount)
|
|
256
|
+
}
|
|
257
|
+
}, error => {
|
|
258
|
+
this.logger.error('[PROJECT-ITEM] UNSERVED REQUEST COUNT * error * ', error)
|
|
259
|
+
}, () => {
|
|
260
|
+
this.logger.log('[PROJECT-ITEM] UNSERVED REQUEST COUNT */* COMPLETE */*')
|
|
261
|
+
})
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
hasmeInAgents(agents) {
|
|
265
|
+
if (agents) {
|
|
266
|
+
for (let j = 0; j < agents.length; j++) {
|
|
267
|
+
this.logger.log('[PROJECT-ITEM] hasmeInAgents currentUserId ', this.currentUserId)
|
|
268
|
+
this.logger.log('[PROJECT-ITEM] hasmeInAgents agent ', agents[j].id_user)
|
|
269
|
+
if (this.currentUserId === agents[j].id_user) {
|
|
270
|
+
this.logger.log('[PROJECT-ITEM] hasmeInAgents ')
|
|
271
|
+
return true
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
} else {
|
|
275
|
+
this.logger.log('[PROJECT-ITEM] hasmeInAgents OOPS!!! AGENTS THERE ARE NOT ')
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
updateCurrentUserRequestCount() {
|
|
280
|
+
// this.requestsService.requestsList_bs.subscribe((requests) => {
|
|
281
|
+
this.wsService.wsRequestsList$
|
|
282
|
+
.pipe(
|
|
283
|
+
takeUntil(this.unsubscribe$)
|
|
284
|
+
)
|
|
285
|
+
.subscribe((requests) => {
|
|
286
|
+
if (requests) {
|
|
287
|
+
let count = 0;
|
|
288
|
+
requests.forEach(r => {
|
|
289
|
+
|
|
290
|
+
// const membersArray = Object.keys(r.members);
|
|
291
|
+
const participantsArray = r['participants'] // new used with ws
|
|
292
|
+
// this.logger.log('[NAVBAR] »» WIDGET updateCurrentUserRequestCount REQUEST currentUserRequestCount membersArray ', membersArray);
|
|
293
|
+
|
|
294
|
+
// const currentUserIsInParticipants = membersArray.includes(this.user._id);
|
|
295
|
+
const currentUserIsInParticipants = participantsArray.includes(this.currentUserId); // new used with ws
|
|
296
|
+
|
|
297
|
+
// this.logger.log('[NAVBAR] »» WIDGET updateCurrentUserRequestCount REQUEST currentUserRequestCount currentUserIsInParticipants ', currentUserIsInParticipants);
|
|
298
|
+
if (currentUserIsInParticipants === true) {
|
|
299
|
+
count = count + 1;
|
|
300
|
+
}
|
|
301
|
+
});
|
|
302
|
+
this.currentUserRequestCount = count;
|
|
303
|
+
this.logger.log('[PROJECT-ITEM] CURRENT USER REQUEST COUNT - RES', this.currentUserRequestCount);
|
|
304
|
+
}
|
|
305
|
+
}, error => {
|
|
306
|
+
this.logger.error('[PROJECT-ITEM] CURRENT USER REQUEST COUNT * error * ', error)
|
|
307
|
+
}, () => {
|
|
308
|
+
this.logger.log('[PROJECT-ITEM] CURRENT USER REQUEST COUNT */* COMPLETE */*')
|
|
309
|
+
})
|
|
310
|
+
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
|
|
314
|
+
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
<!-- <div *ngIf="itemAvatar" class="avatar-circle" [style.width]="itemAvatar.width" [style.height]="itemAvatar.height">
|
|
2
|
+
|
|
3
|
+
<div class="avatar avatar-placeholder" [ngStyle]="{'background': 'linear-gradient(rgb(255,255,255) -125%,' + color + ')'}" [innerHTML]="avatar" ></div>
|
|
4
|
+
|
|
5
|
+
<div *ngIf="avatarUrl" class="avatar avatar-image" [style.background-image]="'url(' + avatarUrl + ')'" ></div>
|
|
6
|
+
</div> -->
|
|
7
|
+
|
|
1
8
|
<div *ngIf="itemAvatar" class="avatar-circle" [style.width]="itemAvatar.width" [style.height]="itemAvatar.height">
|
|
2
9
|
<!-- [style.background-color]="itemAvatar.color" -->
|
|
3
10
|
<div class="avatar avatar-placeholder" [ngStyle]="{'background': 'linear-gradient(rgb(255,255,255) -125%,' + itemAvatar.color + ')'}" [innerHTML]="itemAvatar.avatar" ></div>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component, OnInit, Input } from '@angular/core';
|
|
1
|
+
import { Component, OnInit, Input, OnChanges } from '@angular/core';
|
|
2
2
|
// Logger
|
|
3
3
|
import { LoggerService } from 'src/chat21-core/providers/abstract/logger.service';
|
|
4
4
|
import { LoggerInstance } from 'src/chat21-core/providers/logger/loggerInstance';
|
|
@@ -8,17 +8,34 @@ import { LoggerInstance } from 'src/chat21-core/providers/logger/loggerInstance'
|
|
|
8
8
|
templateUrl: './avatar-profile.component.html',
|
|
9
9
|
styleUrls: ['./avatar-profile.component.scss'],
|
|
10
10
|
})
|
|
11
|
-
export class AvatarProfileComponent implements OnInit {
|
|
11
|
+
export class AvatarProfileComponent implements OnInit, OnChanges {
|
|
12
12
|
@Input() itemAvatar: any;
|
|
13
|
-
|
|
13
|
+
public avatarUrl: string
|
|
14
|
+
public avatar: string
|
|
15
|
+
public color: string
|
|
14
16
|
private logger: LoggerService = LoggerInstance.getInstance();
|
|
15
17
|
constructor() {
|
|
16
18
|
this.logger.log('AvatarProfileComponent:::: constructor');
|
|
17
|
-
|
|
19
|
+
}
|
|
18
20
|
|
|
19
21
|
ngOnInit() {
|
|
20
22
|
this.logger.log('AvatarProfileComponent:::: ngOnInit');
|
|
21
|
-
|
|
23
|
+
// console.log('AvatarProfileComponent itemAvatar ',this.itemAvatar);
|
|
24
|
+
if (this.itemAvatar) {
|
|
25
|
+
this.avatarUrl = this.itemAvatar.imageurl
|
|
26
|
+
this.avatar = this.itemAvatar.avatar
|
|
27
|
+
this.color = this.itemAvatar.color
|
|
28
|
+
}
|
|
29
|
+
// console.log('AvatarProfileComponent avatarUrl ',this.avatarUrl);
|
|
30
|
+
// console.log('AvatarProfileComponent avatar ',this.avatar);
|
|
31
|
+
// console.log('AvatarProfileComponent color ',this.color);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
ngOnChanges() {
|
|
35
|
+
// console.log('AvatarProfileComponent itemAvatar ',this.itemAvatar);
|
|
36
|
+
// console.log('AvatarProfileComponent avatarUrl ',this.avatarUrl);
|
|
37
|
+
// console.log('AvatarProfileComponent avatar ',this.avatar);
|
|
38
|
+
// console.log('AvatarProfileComponent color ',this.color);
|
|
22
39
|
}
|
|
23
40
|
|
|
24
41
|
}
|
|
@@ -3,6 +3,5 @@
|
|
|
3
3
|
[translationMap] = translationMap
|
|
4
4
|
[companyLogoBlackUrl]= companyLogoBlackUrl
|
|
5
5
|
[companyName]= companyName
|
|
6
|
-
(eventSignInWithEmailAndPassword)="returnSignInWithEmailAndPassword($event)"
|
|
7
|
-
>
|
|
6
|
+
(eventSignInWithEmailAndPassword)="returnSignInWithEmailAndPassword($event)">
|
|
8
7
|
</component-login>
|
|
@@ -144,7 +144,7 @@ export class LoginPage implements OnInit {
|
|
|
144
144
|
this.presentToast(error_msg)
|
|
145
145
|
})
|
|
146
146
|
.finally(() => {
|
|
147
|
-
this.showSpinnerInLoginBtn = false;
|
|
147
|
+
// this.showSpinnerInLoginBtn = false;
|
|
148
148
|
this.logger.log('[LOGIN PAGE] signInWithEmailAndPassword ');
|
|
149
149
|
});
|
|
150
150
|
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
here is ignored
|
|
43
43
|
</span>
|
|
44
44
|
|
|
45
|
-
<div class="overlay" *ngIf="tagsCannedFilter.length > 0
|
|
45
|
+
<div class="overlay" *ngIf="tagsCannedFilter.length > 0 && HIDE_CANNED_RESPONSES === false"></div>
|
|
46
46
|
|
|
47
47
|
<ng-template #content_welcome>
|
|
48
48
|
<!-- <div class="messageFirst">
|
|
@@ -139,12 +139,13 @@
|
|
|
139
139
|
<!-- ----------------------------------------------------------- -->
|
|
140
140
|
<!-- Canned responses -->
|
|
141
141
|
<!-- ----------------------------------------------------------- -->
|
|
142
|
-
|
|
142
|
+
|
|
143
|
+
<div id="canned" *ngIf="tagsCannedFilter.length > 0 && HIDE_CANNED_RESPONSES === false">
|
|
143
144
|
<ion-list class="canned-list">
|
|
144
145
|
<ion-item button="true" [ngClass]="{'is_active_item': i == arrowkeyLocation}" lines="none"
|
|
145
146
|
class="canned-item" id="{{'canned-item_'+ i }}"
|
|
146
147
|
*ngFor="let canned of tagsCannedFilter; let i = index;" [innerHtml]="canned.title"
|
|
147
|
-
(click)="replaceTagInMessage(canned)">
|
|
148
|
+
(click)="replaceTagInMessage(canned, $event)">
|
|
148
149
|
</ion-item>
|
|
149
150
|
</ion-list>
|
|
150
151
|
</div>
|
|
@@ -153,6 +154,7 @@
|
|
|
153
154
|
<!-- openInfoConversation {{openInfoConversation}} - isMobile {{isMobile}} -->
|
|
154
155
|
<app-message-text-area
|
|
155
156
|
*ngIf="(openInfoConversation === false && isMobile === true) || (openInfoConversation === true && isMobile === false) || (openInfoConversation === false && isMobile === false)"
|
|
157
|
+
|
|
156
158
|
[loggedUser]="loggedUser"
|
|
157
159
|
[conversationWith]="conversationWith"
|
|
158
160
|
[tagsCannedFilter]="tagsCannedFilter"
|