@chat21/chat21-ionic 3.0.59-rc2 → 3.0.59-rc21

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.
Files changed (76) hide show
  1. package/CHANGELOG.md +72 -1
  2. package/README.md +5 -0
  3. package/config.xml +2 -2
  4. package/env.sample +3 -1
  5. package/package.json +1 -1
  6. package/resources/Android/splash/drawable-land-hdpi-screen.png +0 -0
  7. package/resources/Android/splash/drawable-land-ldpi-screen.png +0 -0
  8. package/resources/Android/splash/drawable-land-mdpi-screen.png +0 -0
  9. package/resources/Android/splash/drawable-land-xhdpi-screen.png +0 -0
  10. package/resources/Android/splash/drawable-land-xxhdpi-screen.png +0 -0
  11. package/resources/Android/splash/drawable-land-xxxhdpi-screen.png +0 -0
  12. package/resources/Android/splash/drawable-port-hdpi-screen.png +0 -0
  13. package/resources/Android/splash/drawable-port-ldpi-screen.png +0 -0
  14. package/resources/Android/splash/drawable-port-mdpi-screen.png +0 -0
  15. package/resources/Android/splash/drawable-port-xhdpi-screen.png +0 -0
  16. package/resources/Android/splash/drawable-port-xxhdpi-screen.png +0 -0
  17. package/resources/Android/splash/drawable-port-xxxhdpi-screen.png +0 -0
  18. package/resources/Android/splash.png +0 -0
  19. package/src/app/app-routing.module.ts +21 -17
  20. package/src/app/app.component.scss +10 -5
  21. package/src/app/app.component.ts +339 -65
  22. package/src/app/app.module.ts +16 -8
  23. package/src/app/chatlib/conversation-detail/conversation-content/conversation-content.component.html +1 -1
  24. package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.html +20 -8
  25. package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.scss +0 -144
  26. package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.ts +14 -17
  27. package/src/app/chatlib/list-conversations-component/list-conversations/list-conversations.component.html +1 -1
  28. package/src/app/components/authentication/login/login.component.html +10 -10
  29. package/src/app/components/authentication/login/login.component.ts +2 -1
  30. package/src/app/components/conversation-detail/bubble-my-message/bubble-my-message.component.ts +1 -1
  31. package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.html +2 -4
  32. package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.ts +7 -2
  33. package/src/app/components/conversation-detail/message-text-area/message-text-area.component.ts +20 -15
  34. package/src/app/components/ddp-header/ddp-header.component.html +1 -1
  35. package/src/app/components/ddp-header/ddp-header.component.ts +4 -2
  36. package/src/app/components/project-item/project-item.component.html +147 -0
  37. package/src/app/components/project-item/project-item.component.scss +669 -0
  38. package/src/app/components/project-item/project-item.component.spec.ts +24 -0
  39. package/src/app/components/project-item/project-item.component.ts +317 -0
  40. package/src/app/components/utils/avatar-profile/avatar-profile.component.html +9 -3
  41. package/src/app/pages/authentication/login/login.page.html +1 -2
  42. package/src/app/pages/authentication/login/login.page.ts +1 -1
  43. package/src/app/pages/conversation-detail/conversation-detail.page.ts +26 -22
  44. package/src/app/pages/conversations-list/conversations-list.page.html +45 -23
  45. package/src/app/pages/conversations-list/conversations-list.page.scss +290 -127
  46. package/src/app/pages/conversations-list/conversations-list.page.ts +189 -17
  47. package/src/app/pages/unassigned-conversations/unassigned-conversations-routing.module.ts +17 -0
  48. package/src/app/pages/unassigned-conversations/unassigned-conversations.module.ts +22 -0
  49. package/src/app/pages/unassigned-conversations/unassigned-conversations.page.html +22 -0
  50. package/src/app/pages/unassigned-conversations/unassigned-conversations.page.scss +79 -0
  51. package/src/app/pages/unassigned-conversations/unassigned-conversations.page.spec.ts +24 -0
  52. package/src/app/pages/unassigned-conversations/unassigned-conversations.page.ts +108 -0
  53. package/src/app/services/app-config.ts +77 -5
  54. package/src/app/services/tiledesk/tiledesk.service.ts +22 -1
  55. package/src/app/services/websocket/websocket-js.ts +557 -0
  56. package/src/app/services/websocket/websocket.service.spec.ts +12 -0
  57. package/src/app/services/websocket/websocket.service.ts +274 -0
  58. package/src/app/shared/shared.module.ts +3 -0
  59. package/src/assets/i18n/en.json +9 -1
  60. package/src/assets/i18n/it.json +9 -1
  61. package/src/assets/js/chat21client.js +144 -82
  62. package/src/assets/logo.png +0 -0
  63. package/src/assets/transparent.png +0 -0
  64. package/src/chat-config-pre-test.json +3 -1
  65. package/src/chat-config-template.json +4 -1
  66. package/src/chat-config.json +4 -1
  67. package/src/chat21-core/providers/firebase/firebase-auth-service.ts +2 -2
  68. package/src/chat21-core/providers/firebase/firebase-notifications.ts +31 -23
  69. package/src/chat21-core/providers/mqtt/mqtt-auth-service.ts +27 -27
  70. package/src/chat21-core/providers/mqtt/mqtt-conversation-handler.ts +3 -5
  71. package/src/chat21-core/providers/mqtt/mqtt-conversations-handler.ts +13 -5
  72. package/src/chat21-core/providers/mqtt/mqtt-notifications.ts +101 -11
  73. package/src/chat21-core/providers/tiledesk/tiledesk-auth.service.ts +13 -4
  74. package/src/chat21-core/utils/utils-message.ts +2 -2
  75. package/src/firebase-messaging-sw-template.js +1 -1
  76. package/src/assets/images/tiledesk_logo_50x50.png +0 -0
@@ -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,6 +1,12 @@
1
- <div *ngIf="itemAvatar" class="avatar-circle" [style.width]="itemAvatar.width" [style.height]="itemAvatar.height">
2
- <!-- [style.background-color]="itemAvatar.color" -->
1
+ <!-- <div *ngIf="itemAvatar" class="avatar-circle" [style.width]="itemAvatar.width" [style.height]="itemAvatar.height">
2
+
3
3
  <div class="avatar avatar-placeholder" [ngStyle]="{'background': 'linear-gradient(rgb(255,255,255) -125%,' + color + ')'}" [innerHTML]="avatar" ></div>
4
- <!-- <div class="avatar avatar-image" [style.background-image]="'url(' + itemAvatar.imageurl + ')'" ></div> -->
4
+
5
5
  <div *ngIf="avatarUrl" class="avatar avatar-image" [style.background-image]="'url(' + avatarUrl + ')'" ></div>
6
+ </div> -->
7
+
8
+ <div *ngIf="itemAvatar" class="avatar-circle" [style.width]="itemAvatar.width" [style.height]="itemAvatar.height">
9
+ <!-- [style.background-color]="itemAvatar.color" -->
10
+ <div class="avatar avatar-placeholder" [ngStyle]="{'background': 'linear-gradient(rgb(255,255,255) -125%,' + itemAvatar.color + ')'}" [innerHTML]="itemAvatar.avatar" ></div>
11
+ <div class="avatar avatar-image" [style.background-image]="'url(' + itemAvatar.imageurl + ')'" ></div>
6
12
  </div>
@@ -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
 
@@ -539,23 +539,27 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
539
539
  if (this.conversationWith && this.conversationsHandlerService && this.conv_type === 'active') {
540
540
  this.logger.log('[CONVS-DETAIL] - setHeaderContent getConversationDetail CALLING')
541
541
  this.conversationsHandlerService.getConversationDetail(this.conversationWith, (conv) => {
542
- this.logger.log('[CONVS-DETAIL] - setHeaderContent getConversationDetail (active)', this.conversationWith, conv)
543
- this.conversationAvatar = setConversationAvatar(
544
- conv.conversation_with,
545
- conv.conversation_with_fullname,
546
- conv.channel_type
547
- );
542
+ if (conv) {
543
+ this.logger.log('[CONVS-DETAIL] - setHeaderContent getConversationDetail (active)', this.conversationWith, conv)
544
+ this.conversationAvatar = setConversationAvatar(
545
+ conv.conversation_with,
546
+ conv.conversation_with_fullname,
547
+ conv.channel_type
548
+ );
549
+ }
548
550
  this.logger.log('[CONVS-DETAIL] - setHeaderContent > conversationAvatar: ', this.conversationAvatar);
549
551
  })
550
552
  }
551
553
  else { //get conversation from 'conversations' firebase node
552
554
  this.archivedConversationsHandlerService.getConversationDetail(this.conversationWith, (conv) => {
553
- this.logger.log('[CONVS-DETAIL] - setHeaderContent getConversationDetail (archived)', this.conversationWith, conv)
554
- this.conversationAvatar = setConversationAvatar(
555
- conv.conversation_with,
556
- conv.conversation_with_fullname,
557
- conv.channel_type
558
- );
555
+ if (conv) {
556
+ this.logger.log('[CONVS-DETAIL] - setHeaderContent getConversationDetail (archived)', this.conversationWith, conv)
557
+ this.conversationAvatar = setConversationAvatar(
558
+ conv.conversation_with,
559
+ conv.conversation_with_fullname,
560
+ conv.channel_type
561
+ );
562
+ }
559
563
  })
560
564
  }
561
565
 
@@ -890,8 +894,8 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
890
894
  if (this.conversationWith.startsWith("support-group")) {
891
895
 
892
896
  const pos = message.lastIndexOf("/");
893
- console.log("[CONVS-DETAIL] - returnChangeTextArea - canned responses pos of / (using lastIndexOf) ", pos);
894
-
897
+ // console.log("[CONVS-DETAIL] - returnChangeTextArea - canned responses pos of / (using lastIndexOf) ", pos);
898
+
895
899
  // test
896
900
  // var rest = message.substring(0, message.lastIndexOf("/") + 1);
897
901
  // var last = message.substring(message.lastIndexOf("/") + 1, message.length);
@@ -917,7 +921,7 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
917
921
  // ------------------------------------------------------------------------------------------------------------------------------------------
918
922
  // Hide / display Canned when the SLASH has POSITION POS 0 and checking if there is a space after the SLASH (in this case it will be hidden)
919
923
  // ------------------------------------------------------------------------------------------------------------------------------------------
920
-
924
+
921
925
  var after_slash = message.substring(message.lastIndexOf("/") + 1, message.length);
922
926
  if (pos === 0 && after_slash.length === 1 && after_slash.trim() === '') {
923
927
  this.logger.log('[CONVS-DETAIL] - returnChangeTextArea after_slash --> there is a white space after ');
@@ -928,14 +932,14 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
928
932
  this.HIDE_CANNED_RESPONSES = false
929
933
  }
930
934
 
931
-
935
+
932
936
  if (pos > 0) {
933
-
934
- // ------------------------------------------------------------------------------------------------------------------------------------------
935
- // Hide / display Canned when the SLASH has POSITION POS > and checking if there is a space after the SLASH (in this case they it be hidden)
936
- // and if there is not a space before the SLASH (in this it will be hidden)
937
- // ------------------------------------------------------------------------------------------------------------------------------------------
938
-
937
+
938
+ // ------------------------------------------------------------------------------------------------------------------------------------------
939
+ // Hide / display Canned when the SLASH has POSITION POS > and checking if there is a space after the SLASH (in this case they it be hidden)
940
+ // and if there is not a space before the SLASH (in this it will be hidden)
941
+ // ------------------------------------------------------------------------------------------------------------------------------------------
942
+
939
943
  let beforeSlash = message.substr(pos - 1)
940
944
  let afterSlash = message.substr(pos + 1)
941
945
  this.logger.log('[CONVS-DETAIL] - returnChangeTextArea * POS ', pos);
@@ -1,10 +1,6 @@
1
-
2
1
  <ion-header no-border class="ion-no-border">
3
- <app-ddp-header *ngIf="conversationType ==='active'"
4
- [numberOpenConv]="numberOpenConv"
5
- [supportMode]="supportMode"
6
- (openContactsDirectory)=openContactsDirectory($event)
7
- (openProfileInfo)=openProfileInfo($event)>
2
+ <app-ddp-header *ngIf="conversationType ==='active'" [numberOpenConv]="numberOpenConv" [supportMode]="supportMode"
3
+ (openContactsDirectory)=openContactsDirectory($event) (openProfileInfo)=openProfileInfo($event)>
8
4
  </app-ddp-header>
9
5
 
10
6
  <app-option-header *ngIf="conversationType !=='active'" [headerTitle]=headerTitle
@@ -16,35 +12,61 @@
16
12
 
17
13
  <div id="scrollbar2">
18
14
  <ion-list>
15
+
16
+ <!-- -------------------------------------------------------------------------- -->
17
+ <!-- New <ion-spinner class="spinner-middle" style="margin-left: 19px;"></ion-spinner> -->
18
+ <!-- -------------------------------------------------------------------------- -->
19
+ <ion-item *ngIf="isOnline === false" style="padding-left:0px!important ;padding-right:0px!important" button="true" lines="none" class="ion-no-padding waiting-for-connection">
20
+ <div tabindex="0"></div>
21
+ <ion-avatar item-start>
22
+ <div class="sk-fading-circle">
23
+ <div class="sk-circle1 sk-circle"></div>
24
+ <div class="sk-circle2 sk-circle"></div>
25
+ <div class="sk-circle3 sk-circle"></div>
26
+ <div class="sk-circle4 sk-circle"></div>
27
+ <div class="sk-circle5 sk-circle"></div>
28
+ <div class="sk-circle6 sk-circle"></div>
29
+ <div class="sk-circle7 sk-circle"></div>
30
+ <div class="sk-circle8 sk-circle"></div>
31
+ <div class="sk-circle9 sk-circle"></div>
32
+ <div class="sk-circle10 sk-circle"></div>
33
+ <div class="sk-circle11 sk-circle"></div>
34
+ <div class="sk-circle12 sk-circle"></div>
35
+ </div>
36
+ </ion-avatar>
37
+ <ion-label part="message-text" class="waiting-for-network-msg"> Waiting for network</ion-label>
38
+ </ion-item>
39
+
40
+ <ion-item *ngIf="supportMode && displayNewConvsItem" class="ion-no-padding open-iframe-item"
41
+ button="true"
42
+ (click)="openUnsevedConversationIframe()">
43
+ <div tabindex="0"></div>
44
+ <app-project-item (projectIdEvent)="getLastProjectId($event)"></app-project-item>
45
+ </ion-item>
46
+
19
47
  <span
20
48
  *ngIf="(conversations.length > 0 && conversationType ==='active') || (archivedConversations.length > 0 && conversationType ==='archived');then contentConversations else contentMessageWelcome">
21
49
  here is ignored
22
50
  </span>
23
51
 
52
+
53
+
24
54
  <ng-template #contentConversations>
25
55
  <!-- ---------------------------------- -->
26
56
  <!-- ACTIVE CONVERSATION LIST -->
27
57
  <!-- ---------------------------------- -->
28
- <ion-list-conversations *ngIf="conversationType ==='active'"
29
- [uidConvSelected]="uidConvSelected"
30
- [listConversations]="conversations"
31
- [stylesMap]="stylesMap"
32
- [translationMap]="translationMapConversation"
33
- (onConversationSelected)=onConversationSelected($event)
34
- (onImageLoaded)="onImageLoaded($event)"
35
- (onConversationLoaded)="onConversationLoaded($event)"
36
- (onCloseConversation)="onCloseConversation($event)">
58
+ <ion-list-conversations *ngIf="conversationType ==='active'" [uidConvSelected]="uidConvSelected"
59
+ [listConversations]="conversations" [stylesMap]="stylesMap" [translationMap]="translationMapConversation"
60
+ (onConversationSelected)=onConversationSelected($event) (onImageLoaded)="onImageLoaded($event)"
61
+ (onConversationLoaded)="onConversationLoaded($event)" (onCloseConversation)="onCloseConversation($event)">
37
62
  </ion-list-conversations>
38
63
 
39
64
  <!-- ---------------------------------- -->
40
65
  <!-- ARCHIVED CONVERSATION LIST -->
41
66
  <!-- ---------------------------------- -->
42
- <ion-list-conversations *ngIf="conversationType ==='archived'"
43
- [listConversations]="archivedConversations"
44
- [stylesMap]="stylesMap"
45
- [translationMap]="translationMapConversation"
46
- (onConversationSelected)=onConversationSelected($event)
47
- (onImageLoaded)="onImageLoaded($event)"
67
+ <ion-list-conversations *ngIf="conversationType ==='archived'" [listConversations]="archivedConversations"
68
+ [stylesMap]="stylesMap" [translationMap]="translationMapConversation"
69
+ (onConversationSelected)=onConversationSelected($event) (onImageLoaded)="onImageLoaded($event)"
48
70
  (onConversationLoaded)="onConversationLoaded($event)">
49
71
  </ion-list-conversations>
50
72
  </ng-template>
@@ -83,8 +105,8 @@
83
105
  </ion-label>
84
106
  </ion-item>
85
107
  </div>
86
-
108
+
87
109
  </ng-template>
88
110
  </ion-list>
89
111
  </div>
90
- </ion-content>
112
+ </ion-content>