@chat21/chat21-ionic 3.0.79-rc.4 → 3.0.80-rc.1

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 CHANGED
@@ -1,5 +1,14 @@
1
1
  # chat21-ionic ver 3.0
2
2
 
3
+
4
+ ### 3.0.80-rc.1
5
+ - changed: moved sender_fullname inside bubble-message component
6
+ - changed: publish onConversationSelect event to stop audio after agent has clicked on it
7
+ - bug-fixed: /null loading flag_url in sidebar-user-detail
8
+
9
+ ### 3.0.79 in PROD
10
+ - added: segment analytics events
11
+
3
12
  ### 3.0.79-rc.4
4
13
  - bug-fixed: testsiteBaseUrl wrong value env property
5
14
 
@@ -18,7 +18,7 @@ cp -p src/manifest.json platforms/browser/www/
18
18
  cp -p src/chat-config.json platforms/browser/www/
19
19
 
20
20
  cd platforms/browser/www
21
- # aws s3 sync . s3://tiledesk-console/v2/chat/ --cache-control max-age=172800
21
+ aws s3 sync . s3://tiledesk-console/v2/chat/ --cache-control max-age=172800
22
22
  aws s3 sync . s3://tiledesk-console/v2/chat/$version/ --cache-control max-age=172800
23
23
  # aws s3 sync . s3://tiledesk-console/v2/chat/latest/ --cache-control max-age=172800
24
24
  cd ../../../
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@chat21/chat21-ionic",
3
3
  "author": "Tiledesk SRL",
4
- "version": "3.0.79-rc.4",
4
+ "version": "3.0.80-rc.1",
5
5
  "license": "MIT License",
6
6
  "homepage": "https://tiledesk.com/",
7
7
  "repository": {
@@ -1,3 +1,4 @@
1
+
1
2
  import { TYPE_DIRECT, TYPE_SUPPORT_GROUP } from 'src/chat21-core/utils/constants';
2
3
  import { tranlatedLanguage, URL_SOUND_CONVERSATION_ADDED, URL_SOUND_LIST_CONVERSATION } from './../chat21-core/utils/constants';
3
4
  import { ArchivedConversationsHandlerService } from 'src/chat21-core/providers/abstract/archivedconversations-handler.service';
@@ -910,7 +911,6 @@ export class AppComponent implements OnInit {
910
911
 
911
912
  soundConversationAdded(){
912
913
  const that = this;
913
- console.log('soundConversationAdded ENABLEDDDD-->', this.hasPlayed)
914
914
  if(!this.hasPlayedConversation ){
915
915
  that.audio_NewConv.play().then(() => {
916
916
  that.hasPlayedConversation = true
@@ -970,7 +970,7 @@ export class AppComponent implements OnInit {
970
970
  this.events.subscribe('uidConvSelected:changed', this.subscribeChangedConversationSelected);
971
971
  this.events.subscribe('profileInfoButtonClick:logout', this.subscribeProfileInfoButtonLogOut);
972
972
  this.events.subscribe('unservedRequest:count', this.subscribeUnservedRequestCount)
973
-
973
+ this.events.subscribe('convList:onConversationSelected', this.subscribeConversationSelected)
974
974
  this.conversationsHandlerService.conversationAdded.subscribe((conversation: ConversationModel) => {
975
975
  // this.logger.log('[APP-COMP] ***** subscribeConversationAdded *****', conversation);
976
976
  if (conversation && conversation.is_new === true) {
@@ -1048,7 +1048,7 @@ export class AppComponent implements OnInit {
1048
1048
 
1049
1049
  this.initConversationsHandler(currentUser.uid);
1050
1050
  this.initArchivedConversationsHandler(currentUser.uid);
1051
- isDevMode()? null: this.segmentSignIn(currentUser)
1051
+ isDevMode()? null: this.segmentSignIn()
1052
1052
  }
1053
1053
  this.checkPlatform();
1054
1054
  try {
@@ -1070,8 +1070,6 @@ export class AppComponent implements OnInit {
1070
1070
  if (this.SUPPORT_MODE === true) {
1071
1071
  this.webSocketClose()
1072
1072
  }
1073
- const currentUser = this.tiledeskAuthService.getCurrentUser();
1074
- isDevMode()? null: this.segmentSignedOut(currentUser)
1075
1073
  // this.isOnline = false;
1076
1074
  // this.conversationsHandlerService.conversations = [];
1077
1075
  this.chatManager.setTiledeskToken(null);
@@ -1159,6 +1157,7 @@ export class AppComponent implements OnInit {
1159
1157
 
1160
1158
 
1161
1159
  if (hasClickedLogout === true) {
1160
+ isDevMode()? null: this.segmentSignedOut()
1162
1161
  this.appStorageService.removeItem('conversations')
1163
1162
  this.isInitialized = false;
1164
1163
  // ----------------------------------------------
@@ -1172,6 +1171,7 @@ export class AppComponent implements OnInit {
1172
1171
 
1173
1172
  if (res === 'success') {
1174
1173
  that.removePresenceAndLogout();
1174
+
1175
1175
  } else {
1176
1176
  that.removePresenceAndLogout();
1177
1177
  // that.presentToast();
@@ -1192,6 +1192,12 @@ export class AppComponent implements OnInit {
1192
1192
  }
1193
1193
  }
1194
1194
 
1195
+ subscribeConversationSelected= (conversation: ConversationModel) => {
1196
+ if(conversation && conversation.is_new){
1197
+ this.audio_NewConv.pause()
1198
+ }
1199
+ }
1200
+
1195
1201
  private async presentModal(calledby): Promise<any> {
1196
1202
  this.logger.log('[APP-COMP] presentModal calledby', calledby, '- hadBeenCalledOpenModal: ', this.hadBeenCalledOpenModal);
1197
1203
  const attributes = { tenant: this.tenant, enableBackdropDismiss: false };
@@ -1274,6 +1280,7 @@ export class AppComponent implements OnInit {
1274
1280
  that.logger.debug('[APP-COMP] updateConversationsOnStorage: reset timer and save conversations -> ', this.conversationsHandlerService.conversations.length)
1275
1281
  that.appStorageService.setItem('conversations', JSON.stringify(that.conversationsHandlerService.conversations))
1276
1282
  that.isInitialized = true;
1283
+ this.events.publish('appComp:appIsInitialized', true)
1277
1284
  }, 10000);
1278
1285
  }
1279
1286
 
@@ -1298,7 +1305,8 @@ export class AppComponent implements OnInit {
1298
1305
  }
1299
1306
  }
1300
1307
 
1301
- segmentSignIn(user: UserModel){
1308
+ private segmentSignIn(){
1309
+ let user = this.tiledeskAuthService.getCurrentUser()
1302
1310
  try {
1303
1311
  window['analytics'].page("Chat Auth Page, Signin", {});
1304
1312
  } catch (err) {
@@ -1327,7 +1335,8 @@ export class AppComponent implements OnInit {
1327
1335
  }
1328
1336
 
1329
1337
 
1330
- segmentSignedOut(user: UserModel){
1338
+ private segmentSignedOut(){
1339
+ let user = this.tiledeskAuthService.getCurrentUser()
1331
1340
  try {
1332
1341
  window['analytics'].page("Chat Auth Page, Signed Out", {});
1333
1342
  } catch (err) {
@@ -1363,7 +1372,7 @@ export class AppComponent implements OnInit {
1363
1372
  }
1364
1373
  }
1365
1374
 
1366
- segmentResolved(conversation: ConversationModel){
1375
+ private segmentResolved(conversation: ConversationModel){
1367
1376
  let user = this.tiledeskAuthService.getCurrentUser();
1368
1377
  try {
1369
1378
  window['analytics'].page("Chat List Conversations Page, Chat Resolved", {});
@@ -1389,9 +1398,8 @@ export class AppComponent implements OnInit {
1389
1398
  "conversation_id": conversation.uid,
1390
1399
  "channel_type": conversation.channel_type,
1391
1400
  "conversation_with":(conversation.channel_type !== TYPE_DIRECT)? null: conversation.conversation_with,
1392
- "conversation_with_fullname": (conversation.channel_type !== TYPE_DIRECT)? null: conversation.conversation_with_fullname,
1393
1401
  "department_name":(conversation.channel_type !== TYPE_DIRECT)? conversation.attributes.departmentName: null,
1394
- "department_id":(conversation.channel_type !== TYPE_DIRECT)? conversation.attributes.departmentId: null,
1402
+ "department_id":(conversation.channel_type !== TYPE_DIRECT)? conversation.attributes.departmentId: null
1395
1403
  },
1396
1404
  { "context": {
1397
1405
  "groupId": (conversation.channel_type !== TYPE_DIRECT)? conversation.attributes.projectId: null
@@ -1401,13 +1409,15 @@ export class AppComponent implements OnInit {
1401
1409
  this.logger.error('Event:Chat Resolved [track] error', err);
1402
1410
  }
1403
1411
 
1404
- try {
1405
- window['analytics'].group(conversation.attributes.projectId, {
1406
- name: (conversation.attributes.project_name)? conversation.attributes.project_name : null,
1407
- // plan: projectProfileName,
1408
- });
1409
- } catch (err) {
1410
- this.logger.error('Event:Chat Resolved [group] error', err);
1412
+ if(conversation.channel_type !== TYPE_DIRECT){
1413
+ try {
1414
+ window['analytics'].group(conversation.attributes.projectId, {
1415
+ name: (conversation.attributes.project_name)? conversation.attributes.project_name : null,
1416
+ // plan: projectProfileName,
1417
+ });
1418
+ } catch (err) {
1419
+ this.logger.error('Event:Chat Resolved [group] error', err);
1420
+ }
1411
1421
  }
1412
1422
  }
1413
1423
 
@@ -124,12 +124,12 @@
124
124
  </div>
125
125
 
126
126
  <!-- message RECIPIENT + TIME :: -->
127
- <div class="msg_container base_receive" *ngIf="messageType(MESSAGE_TYPE_OTHERS, message) && isChannelTypeGroup(channelType) && !isSameSender(message?.sender, i)">
127
+ <!-- <div class="msg_container base_receive" *ngIf="messageType(MESSAGE_TYPE_OTHERS, message) && isChannelTypeGroup(channelType) && !isSameSender(message?.sender, i)">
128
128
  <div role="messaggio" class="message_sender_fullname">
129
129
  {{message.sender_fullname}}
130
130
  </div>
131
131
  <div class="message-date"> {{message.timestamp | date:'HH:mm' }} </div>
132
- </div>
132
+ </div> -->
133
133
  <!-- message RECIPIENT :: -->
134
134
  <div role="messaggio" *ngIf="messageType(MESSAGE_TYPE_OTHERS, message)" class="msg_container base_receive">
135
135
 
@@ -144,6 +144,7 @@
144
144
  [ngClass]="{'has-metadata': (isImage(message) || isFrame(message)), 'privateMsg': (message?.attributes && message?.attributes?.subtype === 'private')}"
145
145
  [class.emoticon]="isEmojii(message?.text)"
146
146
  [ngStyle]="{'background': stylesMap?.get('bubbleReceivedBackground'), 'color': stylesMap.get('bubbleReceivedTextColor')}"
147
+ [isSameSender]="isSameSender(message?.sender, i)"
147
148
  [message]="message"
148
149
  [fontColor]="stylesMap?.get('bubbleReceivedTextColor')"
149
150
  [fontSize]="stylesMap?.get('fontSize')"
@@ -169,7 +170,7 @@
169
170
  </ion-button>
170
171
  </ng-container> -->
171
172
 
172
- <div class="message-date-hover" *ngIf="(isChannelTypeGroup(channelType) && isSameSender(message?.sender, i)) || !isChannelTypeGroup(channelType)"> {{message.timestamp | date:'HH:mm' }} </div>
173
+ <div class="message-date-hover" *ngIf="isChannelTypeGroup(channelType)"> {{message.timestamp | date:'HH:mm' }} </div>
173
174
  </div>
174
175
 
175
176
  <!-- message type:: button && -->
@@ -7,6 +7,12 @@
7
7
 
8
8
 
9
9
  <div>
10
+
11
+ <div *ngIf="messageType(MESSAGE_TYPE_OTHERS, message) && !isSameSender"
12
+ [style.color]="convertColorToRGBA(fontColor, 65)"
13
+ [ngStyle]="{'margin': (isImage(message) || isFrame(message))? '10px 16px 0px 16px': '10px 8px 0px 8px'}" class="message_sender_fullname">
14
+ {{message?.sender_fullname}}
15
+ </div>
10
16
  <!-- message type:: image -->
11
17
  <!-- <div *ngIf="message.type == 'image' && message.metadata" [ngStyle] = "{ 'max-width': getSizeImg(message).width, 'max-height': getSizeImg(message).height }">
12
18
  <img class="message-contentX message-content-imageX" [src]="message.metadata.src" />
@@ -11,6 +11,11 @@
11
11
  // -webkit-animation: heartbeat 1.5s ease-in-out both;
12
12
  // animation: heartbeat 1.5s ease-in-out both;
13
13
 
14
+ .message_sender_fullname{
15
+ font-size: 12px;
16
+ font-weight: 600;
17
+ }
18
+
14
19
  p {
15
20
  font-size: 1.4em;
16
21
  margin: 0;
@@ -50,7 +50,7 @@ describe('BubbleMessageComponent', () => {
50
50
  isSender: false
51
51
  }
52
52
  component.message = messages
53
- component.textColor = 'black'
53
+ component.fontColor = 'black'
54
54
  fixture.detectChanges()
55
55
  const textChild = fixture.debugElement.query(By.css('chat-text'))
56
56
  textChild.properties.text
@@ -76,7 +76,7 @@ describe('BubbleMessageComponent', () => {
76
76
  isSender: false
77
77
  }
78
78
  component.message = messages
79
- component.textColor = 'black'
79
+ component.fontColor = 'black'
80
80
  fixture.detectChanges()
81
81
  const textChild = fixture.debugElement.query(By.css('chat-text'))
82
82
  expect(textChild.properties.text).toEqual(messages.text)
@@ -1,15 +1,16 @@
1
1
  import { Component, ElementRef, EventEmitter, Input, OnChanges, OnInit, Output } from '@angular/core';
2
2
  import { DomSanitizer } from '@angular/platform-browser';
3
3
  import { MessageModel } from 'src/chat21-core/models/message';
4
- import { MAX_WIDTH_IMAGES, MIN_WIDTH_IMAGES } from 'src/chat21-core/utils/constants';
4
+ import { MAX_WIDTH_IMAGES, MESSAGE_TYPE_MINE, MESSAGE_TYPE_OTHERS, MIN_WIDTH_IMAGES } from 'src/chat21-core/utils/constants';
5
5
  import { LoggerService } from 'src/chat21-core/providers/abstract/logger.service';
6
- import { isFile, isFrame, isImage } from 'src/chat21-core/utils/utils-message';
6
+ import { isFile, isFrame, isImage, messageType } from 'src/chat21-core/utils/utils-message';
7
7
  import { LoggerInstance } from 'src/chat21-core/providers/logger/loggerInstance';
8
8
  import { TranslateService } from '@ngx-translate/core';
9
9
  import { TiledeskAuthService } from 'src/chat21-core/providers/tiledesk/tiledesk-auth.service';
10
10
  import * as moment from 'moment';
11
11
  import { CreateCannedResponsePage } from 'src/app/pages/create-canned-response/create-canned-response.page'
12
12
  import { ModalController } from '@ionic/angular';
13
+ import { convertColorToRGBA } from 'src/chat21-core/utils/utils';
13
14
  @Component({
14
15
  selector: 'chat-bubble-message',
15
16
  templateUrl: './bubble-message.component.html',
@@ -18,16 +19,25 @@ import { ModalController } from '@ionic/angular';
18
19
  export class BubbleMessageComponent implements OnInit, OnChanges {
19
20
 
20
21
  @Input() message: MessageModel;
22
+ @Input() isSameSender: boolean;
21
23
  @Input() fontColor: string;
22
24
  @Input() fontSize: string;
23
25
  @Input() fontFamily: string;
24
26
  @Output() onBeforeMessageRender = new EventEmitter();
25
27
  @Output() onAfterMessageRender = new EventEmitter();
26
28
  @Output() onElementRendered = new EventEmitter<{element: string, status: boolean}>();
27
-
28
29
  isImage = isImage;
29
30
  isFile = isFile;
30
31
  isFrame = isFrame;
32
+ convertColorToRGBA = convertColorToRGBA
33
+
34
+ // ========== begin:: check message type functions ======= //
35
+ messageType = messageType;
36
+
37
+ MESSAGE_TYPE_MINE = MESSAGE_TYPE_MINE;
38
+ MESSAGE_TYPE_OTHERS = MESSAGE_TYPE_OTHERS;
39
+ // ========== end:: check message type functions ======= //
40
+
31
41
  public browserLang: string;
32
42
 
33
43
  tooltipOptions = {
@@ -1,4 +1,3 @@
1
- import { DomSanitizer, SafeHtml } from '@angular/platform-browser';
2
1
  import { Component, ElementRef, Input, OnInit, SimpleChange, SimpleChanges, ViewChild, ViewEncapsulation } from '@angular/core';
3
2
 
4
3
  @Component({
@@ -619,7 +619,7 @@ export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChange
619
619
 
620
620
  @HostListener('document:keydown', ['$event'])
621
621
  handleKeyboardEvent(event: KeyboardEvent) {
622
- this.logger.log("[CONVS-DETAIL][MSG-TEXT-AREA] handleKeyboardEvent event.key ", event);
622
+ // this.logger.log("[CONVS-DETAIL][MSG-TEXT-AREA] handleKeyboardEvent event.key ", event);
623
623
  // Note: on mac keyboard "metakey" matches "cmd"
624
624
 
625
625
  if (event.key === 'Enter' && event.altKey || event.key === 'Enter' && event.ctrlKey || event.key === 'Enter' && event.metaKey) {
@@ -25,7 +25,7 @@
25
25
  <div class="flex-child-right">
26
26
  <div class="project-name-project-for-panel" [tooltip]="conversationsInQueueOnProjectName"
27
27
  [options]="tooltipOptions" placement="top" content-type="template" (click)="openUnservedConvs()">
28
- <div class="project---name"> <a>{{ project?.id_project?.name }}</a> </div>
28
+ <div class="unassigned_label"> <a>{{ translationMap?.get('UnassignedConversations') }}</a> </div>
29
29
  </div>
30
30
 
31
31
  <!-- <div class="availabily-and-busy-wpr">
@@ -303,7 +303,7 @@
303
303
  color: #1e2129;
304
304
  font-weight: 400;
305
305
  margin-left: 10px;
306
- width: 185px ;
306
+ width: 250px;
307
307
  // width: 220px !important;
308
308
  white-space: nowrap !important;
309
309
  overflow: hidden !important;
@@ -325,11 +325,11 @@
325
325
  // width: fit-content;
326
326
  // display: block;
327
327
  // }
328
- .project---name {
328
+ .unassigned_label {
329
329
  width: fit-content;
330
330
 
331
331
  }
332
- .project---name:hover {
332
+ .unassigned_label:hover {
333
333
  color: rgb(100, 131, 158);
334
334
  // font-weight: 600;
335
335
  }
@@ -5,7 +5,7 @@
5
5
  <span class="user-details-dshbrd-lang-code" style="text-transform: uppercase;color: #647491;">
6
6
  {{chat_lang}}
7
7
  </span>
8
- <img [src]="flag_url" style="width: auto;height: 19px; position: relative;top: 1px;">
8
+ <img *ngIf="flag_url" [src]="flag_url" style="width: auto;height: 19px; position: relative;top: 1px;">
9
9
 
10
10
  </div>
11
11
 
@@ -79,11 +79,11 @@
79
79
  [clearable]="false"
80
80
  [searchable]="false">
81
81
  <ng-template ng-label-tmp let-item="item">
82
- <img style="width: 15px;height: 15px;position: relative; top: 1px;" height="15" width="15" [src]="item.avatar" />
82
+ <img style="width: 15px;height: 15px;position: relative; top: 1px;" height="15" width="15" [src]="item?.avatar" />
83
83
  <span id="sidebaravatar_{{item.name}}" style="text-transform: capitalize; margin-left:8px"> {{item.label}} </span>
84
84
  </ng-template>
85
85
  <ng-template ng-option-tmp let-item="item" let-index="index">
86
- <img style="width: 15px;height: 15px;position: relative; top: 1px;" height="15" width="15" [src]="item.avatar" />
86
+ <img style="width: 15px;height: 15px;position: relative; top: 1px;" height="15" width="15" [src]="item?.avatar" />
87
87
  <span id="sidebaravatar_{{item.name}}" style="text-transform: capitalize; margin-left:8px"> {{item.label}} </span>
88
88
  </ng-template>
89
89
  </ng-select>
@@ -78,6 +78,8 @@ export class SidebarUserDetailsComponent implements OnInit, OnChanges {
78
78
  // this.listenOpenUserSidebarEvent();
79
79
  }
80
80
 
81
+ ngOnChanges() { }
82
+
81
83
  subcribeToAuthStateChanged() {
82
84
  this.messagingAuthService.BSAuthStateChanged.subscribe((state) => {
83
85
  this.logger.log('[SIDEBAR-USER-DETAILS] BSAuthStateChanged ', state)
@@ -327,16 +329,16 @@ export class SidebarUserDetailsComponent implements OnInit, OnChanges {
327
329
  if (projectUser['user_available'] === false && projectUser['profileStatus'] === 'inactive') {
328
330
  // console.log('teammateStatus ', this.teammateStatus)
329
331
  this.selectedStatus = this.teammateStatus[2].id;
330
- console.log('[SIDEBAR-USER-DETAILS] - PROFILE_STATUS selected option', this.teammateStatus[2].name);
332
+ this.logger.debug('[SIDEBAR-USER-DETAILS] - PROFILE_STATUS selected option', this.teammateStatus[2].name);
331
333
  this.teammateStatus = this.teammateStatus.slice(0)
332
334
  } else if (projectUser['user_available'] === false && (projectUser['profileStatus'] === '' || !projectUser['profileStatus'])) {
333
335
  this.selectedStatus = this.teammateStatus[1].id;
334
- console.log('[SIDEBAR-USER-DETAILS] - PROFILE_STATUS selected option', this.teammateStatus[1].name);
336
+ this.logger.debug('[SIDEBAR-USER-DETAILS] - PROFILE_STATUS selected option', this.teammateStatus[1].name);
335
337
  this.teammateStatus = this.teammateStatus.slice(0)
336
338
  } else if (projectUser['user_available'] === true && (projectUser['profileStatus'] === '' || !projectUser['profileStatus'])) {
337
339
  this.selectedStatus = this.teammateStatus[0].id
338
340
  this.teammateStatus = this.teammateStatus.slice(0)
339
- console.log('[SIDEBAR-USER-DETAILS] - PROFILE_STATUS selected option', this.teammateStatus[0].name);
341
+ this.logger.debug('[SIDEBAR-USER-DETAILS] - PROFILE_STATUS selected option', this.teammateStatus[0].name);
340
342
  }
341
343
  this.IS_BUSY = projectUser['isBusy']
342
344
  this.USER_ROLE = projectUser['role']
@@ -356,13 +358,6 @@ export class SidebarUserDetailsComponent implements OnInit, OnChanges {
356
358
  });
357
359
  }
358
360
 
359
-
360
- ngOnChanges() { }
361
-
362
-
363
-
364
-
365
-
366
361
  changeAvailabilityStateInUserDetailsSidebar(selectedStatusID) {
367
362
  this.logger.log('[SIDEBAR-USER-DETAILS] - changeAvailabilityState projectid', this.project._id, ' available 1: ', selectedStatusID);
368
363
 
@@ -771,8 +771,8 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
771
771
  conversation.attributes.project_name = project['name']
772
772
  }
773
773
 
774
- return conversation
775
774
  }
775
+ return conversation
776
776
  }
777
777
 
778
778
  setHeaderContent() {
@@ -1701,26 +1701,17 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
1701
1701
  if (accept_file_segment[1] === '*') {
1702
1702
  if (draggedFileMimeType.startsWith(accept_file_segment[0])) {
1703
1703
  isAcceptFile = true
1704
- this.logger.log(
1705
- '[CONVS-DETAIL] > checkAcceptedFile - fileUploadAccept isAcceptFile',
1706
- isAcceptFile,
1707
- )
1704
+ this.logger.log('[CONVS-DETAIL] > checkAcceptedFile - fileUploadAccept isAcceptFile',isAcceptFile)
1708
1705
  return isAcceptFile
1709
1706
  } else {
1710
1707
  isAcceptFile = false
1711
- this.logger.log(
1712
- '[CONVS-DETAIL] > checkAcceptedFile - fileUploadAccept isAcceptFile',
1713
- isAcceptFile,
1714
- )
1708
+ this.logger.log('[CONVS-DETAIL] > checkAcceptedFile - fileUploadAccept isAcceptFile',isAcceptFile)
1715
1709
  return isAcceptFile
1716
1710
  }
1717
1711
  } else if (accept_file_segment[1] !== '*') {
1718
1712
  if (draggedFileMimeType === accept_file) {
1719
1713
  isAcceptFile = true
1720
- this.logger.log(
1721
- '[CONVS-DETAIL] > checkAcceptedFile - fileUploadAccept isAcceptFile',
1722
- isAcceptFile,
1723
- )
1714
+ this.logger.log('[CONVS-DETAIL] > checkAcceptedFile - fileUploadAccept isAcceptFile',isAcceptFile)
1724
1715
  return isAcceptFile
1725
1716
  }
1726
1717
  }
@@ -1733,10 +1724,11 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
1733
1724
 
1734
1725
  initializeTyping() {
1735
1726
  this.logger.debug('[CONVS-DETAIL] membersconversation', this.membersConversation)
1736
- this.membersConversation.push(this.loggedUser.uid)
1737
- //this.setSubscriptions();
1738
- this.typingService.isTyping(this.conversationWith, this.loggedUser.uid, this.isDirect);
1739
-
1727
+ if(this.loggedUser){
1728
+ this.membersConversation.push(this.loggedUser.uid)
1729
+ //this.setSubscriptions();
1730
+ this.typingService.isTyping(this.conversationWith, this.loggedUser.uid, this.isDirect);
1731
+ }
1740
1732
  }
1741
1733
 
1742
1734
  /** */
@@ -1790,9 +1782,9 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
1790
1782
  segmentNewAgentMessage(conversation: ConversationModel){
1791
1783
  let user = this.loggedUser
1792
1784
  try {
1793
- window['analytics'].page("Chat Conversation Detail Page, Message Added", {});
1785
+ window['analytics'].page("Chat Conversation Detail Page, Message Sent", {});
1794
1786
  } catch (err) {
1795
- this.logger.error('Event:Message Added [page] error', err);
1787
+ this.logger.error('Event:Message Sent [page] error', err);
1796
1788
  }
1797
1789
 
1798
1790
  try {
@@ -1802,17 +1794,16 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
1802
1794
  logins: 5,
1803
1795
  });
1804
1796
  } catch (err) {
1805
- this.logger.error('Event:Message Added [identify] error', err);
1797
+ this.logger.error('Event:Message Sent [identify] error', err);
1806
1798
  }
1807
1799
 
1808
1800
  try {
1809
- window['analytics'].track('Message Added', {
1801
+ window['analytics'].track('Message Sent', {
1810
1802
  "username": user.firstname + ' ' + user.lastname,
1811
1803
  "userId": user.uid,
1812
1804
  "conversation_id": conversation.uid,
1813
1805
  "channel_type": conversation.channel_type,
1814
1806
  "conversation_with": conversation.conversation_with,
1815
- "conversation_with_fullname": conversation.conversation_with_fullname,
1816
1807
  "department_name":(conversation.channel_type !== TYPE_DIRECT)? conversation.attributes.departmentName: null,
1817
1808
  "department_id":(conversation.channel_type !== TYPE_DIRECT)? conversation.attributes.departmentId: null,
1818
1809
  },
@@ -1822,7 +1813,7 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
1822
1813
  }
1823
1814
  });
1824
1815
  } catch (err) {
1825
- this.logger.error('Event:Message Added [track] error', err);
1816
+ this.logger.error('Event:Message Sent [track] error', err);
1826
1817
  }
1827
1818
 
1828
1819
  try {
@@ -1831,7 +1822,7 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
1831
1822
  // plan: projectProfileName,
1832
1823
  });
1833
1824
  } catch (err) {
1834
- this.logger.error('Event:Message Added [group] error', err);
1825
+ this.logger.error('Event:Message Sent [group] error', err);
1835
1826
  }
1836
1827
  }
1837
1828
 
@@ -93,14 +93,15 @@ export class ConversationListPage implements OnInit {
93
93
  public archiveActionNotAllowed: boolean = false
94
94
 
95
95
  public isMobile: boolean = false;
96
+ public isInitialized: boolean = false;
96
97
 
97
98
  tooltipOptions = {
98
99
  'show-delay': 1500,
99
100
  'tooltip-class': 'chat-tooltip',
100
- theme: 'light',
101
- shadow: false,
101
+ 'theme': 'light',
102
+ 'shadow': false,
102
103
  'hide-delay-mobile': 0,
103
- hideDelayAfterClick: 3000,
104
+ 'hideDelayAfterClick': 3000,
104
105
  'hide-delay': 200,
105
106
  }
106
107
 
@@ -126,6 +127,7 @@ export class ConversationListPage implements OnInit {
126
127
  ) {
127
128
  this.checkPlatform();
128
129
  this.listenToAppCompConvsLengthOnInitConvs()
130
+ this.listenToAppIsInitialized()
129
131
  this.listenToLogoutEvent()
130
132
  this.listenGoOnline()
131
133
  this.listenGoOffline()
@@ -404,6 +406,13 @@ export class ConversationListPage implements OnInit {
404
406
  })
405
407
  }
406
408
 
409
+ listenToAppIsInitialized(){
410
+ this.events.subscribe( 'appComp:appIsInitialized', (isInitialized) => {
411
+ this.logger.log( '[CONVS-LIST-PAGE]-CONVS isInitialized', isInitialized)
412
+ this.isInitialized = isInitialized
413
+ })
414
+ }
415
+
407
416
  listenGoOnline() {
408
417
  this.events.subscribe('go:online', (goonline) => {
409
418
  this.logger.info('[CONVS-LIST-PAGE] - listen To go:online - goonline',goonline)
@@ -480,7 +489,7 @@ export class ConversationListPage implements OnInit {
480
489
  if (conversation) {
481
490
  this.onImageLoaded(conversation)
482
491
  this.onConversationLoaded(conversation)
483
- !isDevMode() && conversation.is_new? this.segmentNewConversationAdded(conversation) : null;
492
+ !isDevMode() && conversation.is_new && this.isInitialized? this.segmentNewConversationAdded(conversation) : null;
484
493
  }
485
494
  })
486
495
 
@@ -663,6 +672,7 @@ export class ConversationListPage implements OnInit {
663
672
  this.navigateByUrl('active', conversation.uid)
664
673
  this.conversationsHandlerService.uidConvSelected = conversation.uid
665
674
  this.logger.log('[CONVS-LIST-PAGE] onConversationSelected active conversation.uid ', conversation.uid)
675
+ this.events.publish('convList:onConversationSelected', conversation)
666
676
  }
667
677
  }
668
678
 
@@ -730,7 +740,7 @@ export class ConversationListPage implements OnInit {
730
740
  }
731
741
  }
732
742
  }
733
-
743
+
734
744
  if(conversation.attributes && conversation.attributes['projectId']){
735
745
  let project = localStorage.getItem(conversation.attributes['projectId'])
736
746
  if(project){
@@ -974,9 +984,9 @@ export class ConversationListPage implements OnInit {
974
984
  private segmentNewConversationAdded(conversation: ConversationModel){
975
985
  let user = this.tiledeskAuthService.getCurrentUser()
976
986
  try {
977
- window['analytics'].page("Chat List Conversations Page, Conversation Added", {});
987
+ window['analytics'].page("Chat List Conversations Page, Agent added to conversation", {});
978
988
  } catch (err) {
979
- this.logger.error('Event:Conversation Added [page] error', err);
989
+ this.logger.error('Event:Agent added to conversation [page] error', err);
980
990
  }
981
991
 
982
992
  try {
@@ -986,36 +996,37 @@ export class ConversationListPage implements OnInit {
986
996
  logins: 5,
987
997
  });
988
998
  } catch (err) {
989
- this.logger.error('Event:Conversation Added [identify] error', err);
999
+ this.logger.error('Event:Agent added to conversation [identify] error', err);
990
1000
  }
991
1001
 
992
1002
  try {
993
- window['analytics'].track('Conversation Added', {
1003
+ window['analytics'].track('Agent added to conversation', {
994
1004
  "username": user.firstname + ' ' + user.lastname,
995
1005
  "userId": user.uid,
996
1006
  "conversation_id": conversation.uid,
997
1007
  "channel_type": conversation.channel_type,
998
1008
  "conversation_with": conversation.conversation_with,
999
- "conversation_with_fullname": conversation.conversation_with_fullname,
1000
- "department_name":(conversation.channel_type !== TYPE_DIRECT)? conversation.attributes.departmentName: null,
1001
- "department_id":(conversation.channel_type !== TYPE_DIRECT)? conversation.attributes.departmentId: null,
1009
+ "project_id":(conversation.channel_type !== TYPE_DIRECT)? conversation.uid.split('-')[2]: null,
1010
+ "project_name":(conversation.channel_type !== TYPE_DIRECT && conversation.attributes && conversation.attributes.departmentId)? conversation.attributes.departmentId: null,
1002
1011
  },
1003
1012
  {
1004
1013
  "context": {
1005
- "groupId": (conversation.channel_type !== TYPE_DIRECT)? conversation.attributes.projectId: null
1014
+ "groupId": (conversation.channel_type !== TYPE_DIRECT)? conversation.uid.split('-')[2]: null
1006
1015
  }
1007
1016
  });
1008
1017
  } catch (err) {
1009
- this.logger.error('Event:Conversation Added [track] error', err);
1018
+ this.logger.error('Event:Agent added to conversation [track] error', err);
1010
1019
  }
1011
1020
 
1012
- try {
1013
- window['analytics'].group(conversation.attributes.projectId, {
1014
- name: (conversation.attributes.project_name)? conversation.attributes.project_name : null,
1015
- // plan: projectProfileName,
1016
- });
1017
- } catch (err) {
1018
- this.logger.error('Event:Conversation Added [group] error', err);
1021
+ if(conversation.channel_type !== TYPE_DIRECT){
1022
+ try {
1023
+ window['analytics'].group(conversation.uid.split('-')[2], {
1024
+ name: (conversation.attributes && conversation.attributes.project_name)? conversation.attributes.project_name : null,
1025
+ // plan: projectProfileName,
1026
+ });
1027
+ } catch (err) {
1028
+ this.logger.error('Event:Agent added to conversation [group] error', err);
1029
+ }
1019
1030
  }
1020
1031
  }
1021
1032
 
@@ -1,5 +1,4 @@
1
- import {
2
- Component, OnInit, Input, ViewChild, ElementRef, HostListener, AfterViewInit} from '@angular/core'
1
+ import {Component, OnInit, Input, ViewChild, ElementRef, HostListener, AfterViewInit} from '@angular/core'
3
2
  import { TYPE_MSG_IMAGE } from 'src/chat21-core/utils/constants'
4
3
  import { ModalController } from '@ionic/angular'
5
4
  import { DomSanitizer, SafeResourceUrl } from '@angular/platform-browser'
@@ -698,15 +698,35 @@ export function isURL(str: string) {
698
698
  }
699
699
  }
700
700
 
701
- // export function isHostname() {
702
-
703
-
704
- // if (environment.supportMode === true) {
705
-
706
- // return true
707
- // }
708
- // return false
709
- // }
701
+ export function convertColorToRGBA(color, opacity) {
702
+ let result = color;
703
+ // console.log('convertColorToRGBA' + color, opacity);
704
+ if ( color.indexOf('#') > -1 ) {
705
+ color = color.replace('#', '');
706
+ const r = parseInt(color.substring(0, 2), 16);
707
+ const g = parseInt(color.substring(2, 4), 16);
708
+ const b = parseInt(color.substring(4, 6), 16);
709
+ result = 'rgba(' + r + ',' + g + ',' + b + ',' + opacity / 100 + ')';
710
+ } else if ( color.indexOf('rgba') > -1 ) {
711
+ const rgb = color.split(',');
712
+ const r = rgb[0].substring(5);
713
+ const g = rgb[1];
714
+ const b = rgb[2];
715
+ // const b = rgb[2].substring(1, rgb[2].length - 1);
716
+ result = 'rgba(' + r + ',' + g + ',' + b + ',' + opacity / 100 + ')';
717
+ } else if ( color.indexOf('rgb(') > -1 ) {
718
+ const rgb = color.split(',');
719
+ // console.log(rgb);
720
+ const r = rgb[0].substring(4);
721
+ const g = rgb[1];
722
+ const b = rgb[2].substring(0, rgb[2].length - 1);
723
+ // console.log(b);
724
+ // console.log(rgb[2].length);
725
+ result = 'rgba(' + r + ',' + g + ',' + b + ',' + opacity / 100 + ')';
726
+ }
727
+ // console.log('convertColorToRGBA' + color + result);
728
+ return result;
729
+ }
710
730
 
711
731
  export function getParameterByName(name: string) {
712
732
  var url = window.location.href;