@chat21/chat21-ionic 3.0.80-rc.1 → 3.0.81-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.
Files changed (24) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/package.json +1 -1
  3. package/src/app/app.component.ts +42 -4
  4. package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.html +2 -0
  5. package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.scss +6 -1
  6. package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.html +5 -6
  7. package/src/app/chatlib/conversation-detail/message/frame/frame.component.html +8 -2
  8. package/src/app/chatlib/conversation-detail/message/frame/frame.component.scss +36 -0
  9. package/src/app/chatlib/conversation-detail/message/frame/frame.component.ts +2 -2
  10. package/src/app/chatlib/conversation-detail/message/image/image.component.html +1 -1
  11. package/src/app/chatlib/conversation-detail/message/image/image.component.scss +17 -5
  12. package/src/app/chatlib/conversation-detail/message/image/image.component.ts +1 -1
  13. package/src/app/chatlib/conversation-detail/message/info-message/info-message.component.scss +1 -0
  14. package/src/app/components/canned-response/canned-response.component.html +1 -1
  15. package/src/app/components/canned-response/canned-response.component.scss +7 -1
  16. package/src/app/components/canned-response/canned-response.component.ts +3 -4
  17. package/src/app/components/conversation-detail/message-text-area/message-text-area.component.html +2 -1
  18. package/src/app/components/conversation-detail/message-text-area/message-text-area.component.ts +21 -4
  19. package/src/app/pages/conversation-detail/conversation-detail.page.ts +11 -15
  20. package/src/app/services/tiledesk/tiledesk.service.ts +1 -1
  21. package/src/assets/js/chat21client.js +177 -149
  22. package/src/assets/sounds/interface-start.mp3 +0 -0
  23. package/src/chat21-core/utils/constants.ts +1 -0
  24. package/src/global.scss +5 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # chat21-ionic ver 3.0
2
2
 
3
+ ### 3.0.81-rc.1
4
+ - added: remove bubble-message background if is image or iframe and no text is in message
5
+ - added: new sound if unassigned request arrive
6
+ - added: animation on hover an image
7
+ - added: parameter to /close to forse the closing of a conversation
8
+ - added: v.0.1.12.1 chatclient.js
9
+ - changed: info-message UI, image UI, frame UI
10
+ - bug-fixed: if click on canned icon, then close and clear '/' char, if click again on canned icon, '/' was not added to message text-area
11
+
12
+ ### 3.0.80 in PROD
13
+ - bug-fixed: if search a canned response, after clicked it does not replaced into text-area
3
14
 
4
15
  ### 3.0.80-rc.1
5
16
  - changed: moved sender_fullname inside bubble-message component
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.80-rc.1",
4
+ "version": "3.0.81-rc.1",
5
5
  "license": "MIT License",
6
6
  "homepage": "https://tiledesk.com/",
7
7
  "repository": {
@@ -1,5 +1,5 @@
1
1
 
2
- import { TYPE_DIRECT, TYPE_SUPPORT_GROUP } from 'src/chat21-core/utils/constants';
2
+ import { TYPE_DIRECT, TYPE_SUPPORT_GROUP, URL_SOUND_CONVERSATION_UNASSIGNED } from 'src/chat21-core/utils/constants';
3
3
  import { tranlatedLanguage, URL_SOUND_CONVERSATION_ADDED, URL_SOUND_LIST_CONVERSATION } from './../chat21-core/utils/constants';
4
4
  import { ArchivedConversationsHandlerService } from 'src/chat21-core/providers/abstract/archivedconversations-handler.service';
5
5
  import { AppStorageService } from 'src/chat21-core/providers/abstract/app-storage.service';
@@ -89,12 +89,14 @@ export class AppComponent implements OnInit {
89
89
 
90
90
  private audio: any;
91
91
  private audio_NewConv: any;
92
+ private audio_Unassigned: any;
92
93
  private setIntervalTime: any;
93
94
  private setTimeoutSound: any;
94
95
  private isTabVisible: boolean = true;
95
96
  public isSoundEnabled: boolean;
96
97
  private hasPlayed: boolean;
97
98
  private hasPlayedConversation: boolean;
99
+ private hasPlayedConversationUnassigned: boolean;
98
100
  private tabTitle: string;
99
101
  private setTimeoutConversationsEvent: any;
100
102
  private logger: LoggerService = LoggerInstance.getInstance();
@@ -838,6 +840,10 @@ export class AppComponent implements OnInit {
838
840
  this.audio_NewConv.src = chatBaseUrl + URL_SOUND_CONVERSATION_ADDED;
839
841
  this.audio_NewConv.load();
840
842
 
843
+ this.audio_Unassigned = new Audio();
844
+ this.audio_Unassigned.src = chatBaseUrl + URL_SOUND_CONVERSATION_UNASSIGNED;
845
+ this.audio_Unassigned.load();
846
+
841
847
  const sound_status = localStorage.getItem('dshbrd----sound')
842
848
  if(sound_status && sound_status !== 'undefined'){
843
849
  this.isSoundEnabled = sound_status === 'enabled'? true: false
@@ -879,7 +885,24 @@ export class AppComponent implements OnInit {
879
885
  }
880
886
  this.logger.debug('[APP-COMP] manageTabNotification can saund?', this.isInitialized, this.isSoundEnabled)
881
887
  if(this.isInitialized && this.isSoundEnabled) {
882
- sound_type === 'conv_added'? this.soundConversationAdded(): this.soundMessage();
888
+ switch(sound_type){
889
+ case 'conv_added': {
890
+ this.soundConversationAdded();
891
+ break;
892
+ }
893
+ case 'new_message': {
894
+ this.soundMessage();
895
+ break;
896
+ }
897
+ case 'conv_unassigned': {
898
+ this.soundConversationUnassigned();
899
+ break;
900
+ }
901
+ default:{
902
+ this.soundMessage();
903
+ break;
904
+ }
905
+ }
883
906
  }
884
907
  }
885
908
 
@@ -923,6 +946,21 @@ export class AppComponent implements OnInit {
923
946
  });
924
947
  }
925
948
  }
949
+
950
+ soundConversationUnassigned(){
951
+ const that = this;
952
+ if(!this.hasPlayedConversationUnassigned ){
953
+ that.audio_Unassigned.play().then(() => {
954
+ that.hasPlayedConversationUnassigned = true
955
+ that.logger.debug('[APP-COMP] ****** soundConversationUnassigned played *****');
956
+ setTimeout(() => {
957
+ that.hasPlayedConversationUnassigned = false
958
+ }, 4000);
959
+ }).catch((error: any) => {
960
+ that.logger.error('[APP-COMP] ***soundConversationUnassigned error*', error);
961
+ });
962
+ }
963
+ }
926
964
  /**---------------- SOUND FUNCTIONS --> END <--- +*/
927
965
  /***************************************************+*/
928
966
 
@@ -1185,9 +1223,9 @@ export class AppComponent implements OnInit {
1185
1223
 
1186
1224
  subscribeUnservedRequestCount = (unservedRequestCount) => {
1187
1225
  if(unservedRequestCount && unservedRequestCount > 0){
1188
- this.logger.debug("appIsInitialized::::",this.isInitialized)
1226
+ this.logger.debug("subscribeUnservedRequestCount appIsInitialized::::",this.isInitialized)
1189
1227
  if(this.isInitialized){
1190
- this.manageTabNotification(unservedRequestCount) //sound and alternate title
1228
+ this.manageTabNotification('conv_unassigned', unservedRequestCount) //sound and alternate title
1191
1229
  }
1192
1230
  }
1193
1231
  }
@@ -102,6 +102,7 @@
102
102
  <!--backgroundColor non viene ancora usato -->
103
103
  <chat-bubble-message class="messages msg_sent" id="message_msg_sent" style="position: relative;"
104
104
  [ngClass]="{'has-metadata': (isImage(message) || isFrame(message)), 'privateMsg': (message?.attributes && message?.attributes?.subtype === 'private')}"
105
+ [class.no-background]="(isImage(message) || isFrame(message)) && message?.text.trim() === '' "
105
106
  [class.emoticon]="isEmojii(message?.text)"
106
107
  [ngStyle]="{'background': stylesMap.get('bubbleSentBackground'), 'color': stylesMap.get('bubbleSentTextColor')}"
107
108
  [ngClass]="{'button-in-msg' : message.metadata && message.metadata.button}"
@@ -142,6 +143,7 @@
142
143
  <!--backgroundColor non viene ancora usato -->
143
144
  <chat-bubble-message class="messages msg_receive" id="message_msg_receive"
144
145
  [ngClass]="{'has-metadata': (isImage(message) || isFrame(message)), 'privateMsg': (message?.attributes && message?.attributes?.subtype === 'private')}"
146
+ [class.no-background]="(isImage(message) || isFrame(message)) && message?.text.trim() === '' "
145
147
  [class.emoticon]="isEmojii(message?.text)"
146
148
  [ngStyle]="{'background': stylesMap?.get('bubbleReceivedBackground'), 'color': stylesMap.get('bubbleReceivedTextColor')}"
147
149
  [isSameSender]="isSameSender(message?.sender, i)"
@@ -176,6 +176,9 @@ ion-item {
176
176
  color: var(--bubble-privateMsgColor)
177
177
  }
178
178
  }
179
+ .no-background{
180
+ background: transparent!important;
181
+ }
179
182
  .emoticon {
180
183
  background: unset !important;
181
184
  font-size: 4em;
@@ -245,7 +248,9 @@ ion-item {
245
248
  color: var(--bubble-privateMsgColor)
246
249
  }
247
250
  }
248
-
251
+ .no-background{
252
+ background: transparent!important;
253
+ }
249
254
  .emoticon {
250
255
  background: unset !important;
251
256
  font-size: 4em;
@@ -1,16 +1,15 @@
1
1
  <!-- [ngClass]="{'button-in-msg' : message.metadata && message.metadata.button}" -->
2
2
  <!-- [ngStyle]="{'padding': (isImage(message) || isFrame(message))?'0px':'0 8px'}" -->
3
3
  <!-- isImage >{{isImage(message) }} message.metadata.width {{message?.metadata?.width }} -->
4
- <div id="bubble-message"
5
- [ngStyle]="{'padding': (isImage(message) || isFrame(message))?'0px':'0 8px', 'width': (isImage(message) || isFrame(message))? sizeImage?.width + 'px' : null }"
6
- class="messages primary-color">
4
+ <!-- 'width': (isImage(message) || isFrame(message))? sizeImage?.width : null -->
5
+ <div id="bubble-message" [ngStyle]="{'padding': (isImage(message) || isFrame(message))?'0px':'0 8px' }" class="messages primary-color">
7
6
 
8
7
 
9
8
  <div>
10
9
 
11
10
  <div *ngIf="messageType(MESSAGE_TYPE_OTHERS, message) && !isSameSender"
12
11
  [style.color]="convertColorToRGBA(fontColor, 65)"
13
- [ngStyle]="{'margin': (isImage(message) || isFrame(message))? '10px 16px 0px 16px': '10px 8px 0px 8px'}" class="message_sender_fullname">
12
+ [ngStyle]="{'margin': (isImage(message) || isFrame(message))? '10px 16px 8px 16px': '10px 8px 0px 8px'}" class="message_sender_fullname">
14
13
  {{message?.sender_fullname}}
15
14
  </div>
16
15
  <!-- message type:: image -->
@@ -35,8 +34,8 @@
35
34
  <!-- [height]="getMetadataSize(message.metadata).height"> -->
36
35
  <chat-frame *ngIf="isFrame(message)"
37
36
  [metadata]="message.metadata"
38
- [width]="message.metadata.width"
39
- [height]="message.metadata.height"
37
+ [width]="sizeImage?.width"
38
+ [height]="sizeImage?.width"
40
39
  (onElementRendered)="onElementRenderedFN($event)">
41
40
  </chat-frame>
42
41
 
@@ -1,3 +1,9 @@
1
- <div [ngStyle] = "{ 'max-width': '100%', 'width': width, 'height': height + 'px' }">
2
- <iframe allowfullscreen width = "100%" height = "100%" style= "border:none; border-radius: 8px 8px 0 0 " [src]="url" ></iframe>
1
+ <div [ngStyle] = "{ 'max-width': '100%', 'width': width, 'height': height }">
2
+ <div *ngIf="loading" class="loader" [ngStyle] = "{ 'width': width , 'height': height }"></div>
3
+ <iframe allowfullscreen
4
+ [ngClass]="{'isLoadingImage': loading}"
5
+ width = "100%" height = "100%"
6
+ [src]="url"
7
+ (load)="onLoaded($event)">
8
+ </iframe>
3
9
  </div>
@@ -0,0 +1,36 @@
1
+
2
+ :host{
3
+ // --borderRadius: #{$border-radius-bubble-message};
4
+ --borderRadius: 8px 8px 0px 0px;
5
+ }
6
+
7
+ .loader {
8
+ float: left;
9
+ // position: absolute;
10
+ z-index: 1000;
11
+ // background-color: #ccc;
12
+ border-radius: var(--borderRadius);
13
+ background-image: linear-gradient(90deg, transparent 0px, #e8e8e8 40px, transparent 80px);
14
+ background-size: 600px;
15
+ animation: shine-loader 1.6s infinite linear;
16
+ }
17
+
18
+ .isLoadingImage {
19
+ // position: relative;
20
+ // top: 6px;
21
+ display: none;
22
+ }
23
+
24
+ iframe {
25
+ border:none;
26
+ border-radius: var(--borderRadius)
27
+ }
28
+
29
+ @keyframes shine-loader {
30
+ 0% {
31
+ background-position: -32px;
32
+ }
33
+ 40%, 100% {
34
+ background-position: 208px;
35
+ }
36
+ }
@@ -9,8 +9,8 @@ import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
9
9
  export class FrameComponent implements OnInit {
10
10
 
11
11
  @Input() metadata: any;
12
- @Input() width: string;
13
- @Input() height: string;
12
+ @Input() width: number;
13
+ @Input() height: number;
14
14
  @Output() onElementRendered = new EventEmitter<{element: string, status: boolean}>();
15
15
 
16
16
  url: any;
@@ -1,5 +1,5 @@
1
1
  <!-- [ngStyle]="{ 'max-width': width +'px', 'max-height': height +'px' }" style="position: relative; " -->
2
- <div [ngStyle]="{ 'max-width': width +'px', 'max-height': height +'px' }" class="c21-img-container">
2
+ <div [ngStyle]="{'max-height': height +'px' }" class="c21-img-container">
3
3
  <div *ngIf="loading" class="loader" [ngStyle]="{ 'width': width , 'height': height }"></div>
4
4
  <!-- [tooltip]="timeTooltipRight" [options]="tooltipOptions" placement="bottom" content-type="template" -->
5
5
  <img id="myImg"
@@ -1,26 +1,37 @@
1
+
2
+ :host{
3
+ // --borderRadius: #{$border-radius-bubble-message};
4
+ --borderRadius: 8px;
5
+ }
6
+
1
7
  img {
2
- border-radius: 8px;
8
+ border-radius: var(--borderRadius);
3
9
  //padding: 3px;
4
10
  margin-bottom: 0px;
5
11
  max-width: calc(100% - 6px);
6
12
  width: auto;
7
13
  height: auto;
8
14
  object-fit: cover;
15
+
16
+ transition: transform 0.3s ease-in-out 0s;
9
17
  }
10
18
 
11
- img:hover{
19
+ .c21-img-container img:hover{
12
20
  cursor: pointer;
21
+ transform: scale(1.05);
13
22
  }
14
23
 
15
24
  .c21-img-container {
16
25
  text-align: center;
17
26
  width: 100%;
27
+ overflow: hidden;
18
28
  // background-image: linear-gradient(rgba(255,255,255,.5), rgba(255,255,255,.5)), url("https://firebasestorage.googleapis.com/v0/b/chat21-pre-01.appspot.com/o/public%2Fimages%2Fb4361ea5-5e37-433c-b727-9034eb5586fe%2F6d74f795-5873-49a8-9165-38f48642df51%2Ffacebook_like%20(3).png?alt=media&token=79afcfe5-ba0c-4573-9263-0877e0225c84");
19
29
  // background-repeat: no-repeat;
20
30
  // background-position: 50% 0;
21
31
  // background-size: cover;
22
32
  // border-top-left-radius: $border-radius-bubble-message;
23
33
  // border-top-right-radius: $border-radius-bubble-message;
34
+ border-radius: var(--borderRadius);
24
35
  }
25
36
 
26
37
  .isLoadingImage {
@@ -32,9 +43,10 @@ img:hover{
32
43
  .loader {
33
44
  float: left;
34
45
  // position: absolute;
35
- background-color: #ccc;
36
- border-radius: 8px;
37
- background-image: linear-gradient(90deg, #f7f4f4 0px, #e8e8e8 40px, #f7f4f4 80px);
46
+ z-index: 1000;
47
+ // background-color: #ccc;
48
+ border-radius: var(--borderRadius);
49
+ background-image: linear-gradient(90deg, transparent 0px, #e8e8e8 40px, transparent 80px);
38
50
  background-size: 600px;
39
51
  animation: shine-loader 1.6s infinite linear;
40
52
  }
@@ -8,7 +8,7 @@ import { Component, EventEmitter, Input, OnInit, Output, SimpleChanges } from '@
8
8
  export class ImageComponent implements OnInit {
9
9
 
10
10
  @Input() metadata: any;
11
- @Input() width: string;
11
+ @Input() width: number;
12
12
  @Input() height: number;
13
13
  @Output() onElementRendered = new EventEmitter<{element: string, status: boolean}>();
14
14
 
@@ -2,6 +2,7 @@
2
2
  display: flex;
3
3
  align-content: center;
4
4
  justify-content: center;
5
+ padding: 4px 0px 2px 0px;
5
6
  }
6
7
 
7
8
  .base_info {
@@ -6,7 +6,7 @@
6
6
  (click)="onClickCannedFN(canned, $event)">
7
7
  <div class="cannedContent">
8
8
  <ion-input [(ngModel)]="canned.title" class="title" id="{{'titleCanned_'+canned._id}}" [disabled]="canned.disabled"></ion-input>
9
- <ion-input [(ngModel)]="canned.text" *ngIf="canned.text" class="text" [disabled]="canned.disabled"></ion-input>
9
+ <ion-input [(ngModel)]="canned.text" *ngIf="canned.text" class="text truncate" [disabled]="canned.disabled"></ion-input>
10
10
  </div>
11
11
  <ion-icon class="canned-item-icon" name="checkmark-sharp" slot=end *ngIf="canned.createdBy === loggedUser.uid && !canned.disabled" (click)="onConfirmEditCanned(canned, $event)"></ion-icon>
12
12
  <ion-icon class="canned-item-icon" name="pencil-sharp" slot=end *ngIf="canned.createdBy === loggedUser.uid && canned.disabled" (click)="onEditCanned(canned, $event)"></ion-icon>
@@ -94,11 +94,12 @@
94
94
  width: 100%;
95
95
  }
96
96
 
97
- ion-input {
97
+ ion-input, ion-textarea {
98
98
  --padding-bottom: 0px;
99
99
  --padding-top: 0px;
100
100
  &.text{
101
101
  font-style: italic;
102
+ margin-top: 2px;
102
103
  }
103
104
  &.title {
104
105
  font-weight: 500;
@@ -106,6 +107,11 @@
106
107
  }
107
108
  .native-input[disabled] {
108
109
  opacity: 10 !important;
110
+ cursor: pointer;
111
+ }
112
+ .native-textarea[disabled] {
113
+ opacity: 10 !important;
114
+ cursor: pointer;
109
115
  }
110
116
  ion-icon {
111
117
  zoom: 0.7;
@@ -192,17 +192,16 @@ export class CannedResponseComponent implements OnInit {
192
192
  }
193
193
 
194
194
  filterItems(items, searchTerm) {
195
- this.logger.log('[CANNED] filterItems tagsCannedClone ', items, ' searchTerm: ', searchTerm)
195
+ // this.logger.log('[CANNED] filterItems tagsCannedClone ', items, ' searchTerm: ', searchTerm)
196
196
  //this.logger.log("filterItems::: ",searchTerm);
197
197
  return items.filter((item) => {
198
- //this.logger.log("filterItems::: ", item.title.toString().toLowerCase());
199
- this.logger.log('[CANNED] filtered tagsCannedClone item ', item)
198
+ // this.logger.log('[CANNED] filtered tagsCannedClone item ', item)
200
199
  return item.title.toString().toLowerCase().indexOf(searchTerm.toString().toLowerCase()) > -1
201
200
  })
202
201
  }
203
202
 
204
203
  replacePlaceholderInCanned(str) {
205
- this.logger.log('[CANNED] - replacePlaceholderInCanned str ', str)
204
+ // this.logger.log('[CANNED] - replacePlaceholderInCanned str ', str)
206
205
  str = str.replace('$recipient_name', this.conversationWithFullname)
207
206
  if (this.loggedUser && this.loggedUser.fullname) {
208
207
  str = str.replace('$agent_name', this.loggedUser.fullname)
@@ -96,7 +96,8 @@
96
96
  [perLine]="emojiPerLine"
97
97
  [style.visibility]="showEmojiPicker?'visible':'hidden'"
98
98
  [include]="emojiiCategories"
99
- [color]="emojiColor"
99
+ [color]="emojiColor"
100
+ [custom]="customEmojis"
100
101
  [ngClass]="{'emoji-mart-desktop': !IS_ON_MOBILE_DEVICE, 'emoji-mart-mobile': IS_ON_MOBILE_DEVICE }"
101
102
  (emojiSelect)="addEmoji($event)">
102
103
  </emoji-mart>
@@ -64,7 +64,6 @@ export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChange
64
64
  public toastMsg: string;
65
65
  private logger: LoggerService = LoggerInstance.getInstance();
66
66
  public countClicks: number = 0;
67
- public openCanned: boolean = false;
68
67
  public IS_ON_MOBILE_DEVICE: boolean;
69
68
 
70
69
  TYPE_SUPPORT_GROUP = TYPE_SUPPORT_GROUP;
@@ -85,7 +84,26 @@ export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChange
85
84
  addWhiteSpaceBefore: boolean;
86
85
  emojiPerLine: number = 9
87
86
  emojiColor: string ="#3880ff"
88
- emojiiCategories = [ 'recent', 'people', 'nature', 'activity']
87
+ emojiiCategories = [ 'recent', 'people', 'nature', 'activity'] //, 'custom']
88
+
89
+ customEmojis = [
90
+ {
91
+ name: 'Customer-Service',
92
+ shortNames: ['customer'],
93
+ text: 'ee',
94
+ emoticons: [],
95
+ keywords: ['github'],
96
+ imageUrl: 'https://tiledesk.com/wp-content/uploads/2022/11/Customer-Service.png',
97
+ },
98
+ {
99
+ name: 'Octocat',
100
+ shortNames: ['octocat'],
101
+ text: 'rr',
102
+ emoticons: [],
103
+ keywords: ['github'],
104
+ imageUrl: 'https://tiledesk.com/wp-content/uploads/2022/11/FAQ-Chatbot.png',
105
+ }
106
+ ];
89
107
  /**
90
108
  * Constructor
91
109
  * @param chooser
@@ -500,8 +518,7 @@ export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChange
500
518
  }
501
519
 
502
520
  openCannedResponses() {
503
- this.openCanned = !this.openCanned
504
- this.onClickOpenCannedResponses.emit(this.openCanned);
521
+ this.onClickOpenCannedResponses.emit();
505
522
  }
506
523
 
507
524
 
@@ -1271,17 +1271,12 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
1271
1271
  this.logger.log('[CONVS-DETAIL] - returnChangeTextArea --> beforeSlash', beforeSlash)
1272
1272
  this.logger.log('[CONVS-DETAIL] - returnChangeTextArea --> afterSlash', afterSlash)
1273
1273
 
1274
- console.log('bbbbbbb', beforeSlash[beforeSlash.length-1].indexOf(' '), afterSlash === '', this.HIDE_CANNED_RESPONSES)
1275
-
1276
1274
  if(beforeSlash[beforeSlash.length-1].indexOf(' ') >= 0 && afterSlash === ''){
1277
1275
  this.HIDE_CANNED_RESPONSES = false
1278
- console.log('bbbbbbb 1111', beforeSlash[beforeSlash.length-1])
1279
1276
  } else if(beforeSlash[beforeSlash.length-1].indexOf(' ') < 0 && afterSlash === '' ){
1280
1277
  this.HIDE_CANNED_RESPONSES = true
1281
- console.log('bbbbbbb 22222', beforeSlash[beforeSlash.length-1])
1282
1278
  } else if(beforeSlash[beforeSlash.length-1].indexOf(' ') >= 0 && afterSlash === ' '){
1283
1279
  this.HIDE_CANNED_RESPONSES = true
1284
- console.log('bbbbbbb 33333', beforeSlash[beforeSlash.length-1])
1285
1280
  // this.tagsCannedFilter = []
1286
1281
  }
1287
1282
  }
@@ -1323,7 +1318,7 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
1323
1318
 
1324
1319
  replaceTagInMessage(canned, event?) {
1325
1320
  const elTextArea = this.rowTextArea['el']
1326
- const textArea = elTextArea.getElementsByTagName('ion-textarea')[0]
1321
+ const textArea = elTextArea.getElementsByTagName('ion-textarea')[0] as HTMLInputElement;
1327
1322
  // console.log('[CONVS-DETAIL] replaceTagInMessage textArea ', textArea)
1328
1323
  // console.log('[CONVS-DETAIL] replaceTagInMessage textArea value', textArea.value,)
1329
1324
 
@@ -1336,18 +1331,20 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
1336
1331
  this.logger.log('[CONVS-DETAIL] replaceTagInMessage canned text ', canned.text)
1337
1332
 
1338
1333
  // replace text
1339
- var strTEMP = textArea.value.replace(/\/$/ig, canned.text)
1334
+ var strTEMP = textArea.value.replace(/\/.*/ig, canned.text)
1340
1335
  strTEMP = this.replacePlaceholderInCanned(strTEMP)
1341
1336
  this.logger.log('[CONVS-DETAIL] replaceTagInMessage strSearch ', strTEMP)
1342
1337
  // strTEMP = this.replacePlaceholderInCanned(strTEMP);
1343
1338
  // textArea.value = '';
1344
1339
  // that.messageString = strTEMP;
1345
1340
  textArea.value = strTEMP
1346
- setTimeout(() => {
1347
- // textArea.focus();
1348
- textArea.setFocus()
1349
- // this.resizeTextArea()
1350
- }, 200)
1341
+ this.insertAtCursor(textArea, '')
1342
+ this.setCaretPosition(textArea)
1343
+ // setTimeout(() => {
1344
+ // // textArea.focus();
1345
+ // textArea.setFocus()
1346
+ // // this.resizeTextArea()
1347
+ // }, 200)
1351
1348
 
1352
1349
  }
1353
1350
 
@@ -1387,11 +1384,10 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
1387
1384
  if(!this.HIDE_CANNED_RESPONSES){
1388
1385
  const elTextArea = this.rowTextArea['el']
1389
1386
  const textArea = elTextArea.getElementsByTagName('ion-textarea')[0]
1390
- if($event && elTextArea){
1391
- this.logger.log('[CONVS-DETAIL] onClickOpenCannedResponses textArea ', textArea)
1387
+ if(elTextArea){
1392
1388
  // console.log("[CONVS-DETAIL] onClickOpenCannedResponses textArea value", textArea.value)
1393
1389
  var lastChar = textArea.value[textArea.value.length - 1]
1394
- // console.log('[CONVS-DETAIL] onClickOpenCannedResponses lastChar', lastChar)
1390
+ this.logger.log('[CONVS-DETAIL] onClickOpenCannedResponses lastChar --- textArea ', lastChar, textArea)
1395
1391
  if (lastChar !== '/') {
1396
1392
  this.insertAtCursor(textArea, '/')
1397
1393
  }
@@ -40,7 +40,7 @@ export class TiledeskService {
40
40
  // console.log('CLOUD FUNCT CLOSE SUPPORT GROUP REQUEST BODY ', body);
41
41
  // https://tiledesk-server-pre.herokuapp.com/
42
42
  // const url = 'https://tiledesk-server-pre.herokuapp.com/' + this.project_id + '/requests/' + group_id + '/close';
43
- const url = this.apiUrl + projectid + '/requests/' + supportgroupid + '/close';
43
+ const url = this.apiUrl + projectid + '/requests/' + supportgroupid + '/close'+'?forceArchive=true';
44
44
 
45
45
  this.logger.log('[TILEDESK-SERVICE] - closeSupportGroup URL ', url);
46
46
  return this.http.put(url, body, httpOptions).pipe(map((res: any) => {
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  Chat21Client
3
3
 
4
- v0.1.11
4
+ v0.1.12.1
5
5
 
6
6
  @Author Andrea Sponziello
7
7
  (c) Tiledesk 2020
@@ -22,7 +22,7 @@ class Chat21Client {
22
22
  this.client = null;
23
23
  this.reconnections = 0 // just to check how many reconnections
24
24
  this.client_id = this.uuidv4();
25
- this.log = options._log ? true : false;
25
+ this.log = options.log ? true : false;
26
26
  if (options && options.MQTTendpoint) {
27
27
  if (options.MQTTendpoint.startsWith('/')) {
28
28
  if (this.log) {
@@ -75,7 +75,7 @@ class Chat21Client {
75
75
  this.connected = false
76
76
  }
77
77
 
78
- subscribeToMyConversations() { // MESSAGES ETC.
78
+ subscribeToMyConversations(subscribedCallback) { // MESSAGES ETC.
79
79
  // WILDCARS:
80
80
  // MQTT: https://www.hivemq.com/blog/mqtt-essentials-part-5-mqtt-topics-best-practices/
81
81
  // RABBITMQ: https://www.cloudamqp.com/blog/2015-09-03-part4-rabbitmq-for-beginners-exchanges-routing-keys-bindings.html#topic-exchange
@@ -84,9 +84,13 @@ class Chat21Client {
84
84
  console.log("subscribing to:", this.user_id, "topic", this.topic_inbox);
85
85
  }
86
86
  this.client.subscribe(this.topic_inbox, (err) => {
87
+ if (err) {
88
+ console.error("An error occurred while subscribing user", this.user_id, "on topic:", this.topic_inbox, "Error:", err);
89
+ }
87
90
  if (this.log) {
88
91
  console.log("subscribed to:", this.topic_inbox, " with err", err)
89
92
  }
93
+ subscribedCallback();
90
94
  });
91
95
  }
92
96
 
@@ -127,7 +131,9 @@ class Chat21Client {
127
131
  // callback - function (err)
128
132
  // console.log("recipient_id:", recipient_id)
129
133
  let dest_topic = `apps/${this.appid}/outgoing/users/${this.user_id}/messages/${recipient_id}/outgoing`
130
- // console.log("dest_topic:", dest_topic)
134
+ if (this.log) {
135
+ console.log("dest_topic:", dest_topic)
136
+ }
131
137
  // let outgoing_message = {
132
138
  // text: text,
133
139
  // type: type,
@@ -529,172 +535,180 @@ class Chat21Client {
529
535
  this.onGroupUpdatedCallbacks.delete(handler);
530
536
  }
531
537
 
532
- start() {
538
+ start(subscribedCallback) {
533
539
  if (this.on_message_handler) {
534
- console.log("this.on_message_handler already subscribed. Reconnected num", this.reconnections)
540
+ if (this.log) {
541
+ console.log("this.on_message_handler already subscribed. Reconnected num", this.reconnections)
542
+ }
543
+ callbsubscribedCallbackack();
535
544
  return
536
545
  }
537
- this.subscribeToMyConversations()
538
- // no more then one "on_message" handler, thanks.
539
- this.on_message_handler = this.client.on('message', (topic, message) => {
540
- // console.log("topic:" + topic + "\nmessage payload:" + message)
541
- const _topic = this.parseTopic(topic)
542
- if (!_topic) {
546
+ this.subscribeToMyConversations(() => {
547
+ // no more than one "on_message" handler, thanks.
548
+ this.on_message_handler = this.client.on('message', (topic, message) => {
543
549
  if (this.log) {
544
- console.log("Invalid message topic:", topic);
550
+ console.log("topic:" + topic + "\nmessage payload:" + message)
545
551
  }
546
- return;
547
- }
548
- const conversWith = _topic.conversWith
549
- try {
550
- const message_json = JSON.parse(message.toString())
551
-
552
+ const _topic = this.parseTopic(topic)
553
+ if (!_topic) {
554
+ if (this.log) {
555
+ console.log("Invalid message topic:", topic);
556
+ }
557
+ return;
558
+ }
559
+ const conversWith = _topic.conversWith
560
+ try {
561
+ const message_json = JSON.parse(message.toString())
562
+
552
563
 
553
- // TEMPORARILY DISABLED, ADDED-CONVERSATIONS ARE OBSERVED BY NEW MESSAGES.
554
- // MOVED TO: this.onMessageAddedCallbacks
555
- // if (this.onConversationAddedCallbacks) {
556
- // if (topic.includes("/conversations/") && topic.endsWith(_CLIENTADDED)) {
557
- // // map.forEach((value, key, map) =>)
558
- // this.onConversationAddedCallbacks.forEach((callback, handler, map) => {
559
- // callback(message_json, _topic)
560
- // });
561
- // }
562
- // }
564
+ // TEMPORARILY DISABLED, ADDED-CONVERSATIONS ARE OBSERVED BY NEW MESSAGES.
565
+ // MOVED TO: this.onMessageAddedCallbacks
566
+ // if (this.onConversationAddedCallbacks) {
567
+ // if (topic.includes("/conversations/") && topic.endsWith(_CLIENTADDED)) {
568
+ // // map.forEach((value, key, map) =>)
569
+ // this.onConversationAddedCallbacks.forEach((callback, handler, map) => {
570
+ // callback(message_json, _topic)
571
+ // });
572
+ // }
573
+ // }
563
574
 
564
- if (this.onConversationUpdatedCallbacks) {
565
- // example topic: apps.tilechat.users.ME.conversations.CONVERS-WITH.clientdeleted
566
- if (topic.includes("/conversations/") && topic.endsWith(_CLIENTUPDATED)) {
567
- if (this.log) {
568
- console.log("conversation updated! /conversations/, topic:", topic)
575
+ if (this.onConversationUpdatedCallbacks) {
576
+ // example topic: apps.tilechat.users.ME.conversations.CONVERS-WITH.clientdeleted
577
+ if (topic.includes("/conversations/") && topic.endsWith(_CLIENTUPDATED)) {
578
+ if (this.log) {
579
+ console.log("conversation updated! /conversations/, topic:", topic)
580
+ }
581
+ // map.forEach((value, key, map) =>)
582
+ this.onConversationUpdatedCallbacks.forEach((callback, handler, map) => {
583
+ callback(JSON.parse(message.toString()), _topic)
584
+ });
569
585
  }
570
- // map.forEach((value, key, map) =>)
571
- this.onConversationUpdatedCallbacks.forEach((callback, handler, map) => {
572
- callback(JSON.parse(message.toString()), _topic)
573
- });
574
586
  }
575
- }
576
587
 
577
- if (this.onConversationDeletedCallbacks) {
578
- if (topic.includes("/conversations/") && topic.endsWith(_CLIENTDELETED)) {
579
- // map.forEach((value, key, map) =>)
580
- if (this.log) {
581
- console.log("conversation deleted! /conversations/, topic:", topic, message.toString() );
588
+ if (this.onConversationDeletedCallbacks) {
589
+ if (topic.includes("/conversations/") && topic.endsWith(_CLIENTDELETED)) {
590
+ // map.forEach((value, key, map) =>)
591
+ if (this.log) {
592
+ console.log("conversation deleted! /conversations/, topic:", topic, message.toString() );
593
+ }
594
+ this.onConversationDeletedCallbacks.forEach((callback, handler, map) => {
595
+ callback(JSON.parse(message.toString()), _topic)
596
+ });
582
597
  }
583
- this.onConversationDeletedCallbacks.forEach((callback, handler, map) => {
584
- callback(JSON.parse(message.toString()), _topic)
585
- });
586
598
  }
587
- }
588
599
 
589
- if (this.onArchivedConversationAddedCallbacks) {
590
- if (topic.includes("/archived_conversations/") && topic.endsWith(_CLIENTADDED)) {
591
- // map.forEach((value, key, map) =>)
592
- this.onArchivedConversationAddedCallbacks.forEach((callback, handler, map) => {
593
- callback(JSON.parse(message.toString()), _topic)
594
- });
600
+ if (this.onArchivedConversationAddedCallbacks) {
601
+ if (topic.includes("/archived_conversations/") && topic.endsWith(_CLIENTADDED)) {
602
+ // map.forEach((value, key, map) =>)
603
+ this.onArchivedConversationAddedCallbacks.forEach((callback, handler, map) => {
604
+ callback(JSON.parse(message.toString()), _topic)
605
+ });
606
+ }
595
607
  }
596
- }
597
608
 
598
- if (this.onArchivedConversationDeletedCallbacks) {
599
- if (topic.includes("/archived_conversations/") && topic.endsWith(_CLIENTDELETED)) {
600
- // map.forEach((value, key, map) =>)
601
- this.onArchivedConversationDeletedCallbacks.forEach((callback, handler, map) => {
602
- callback(JSON.parse(message.toString()), _topic)
603
- });
609
+ if (this.onArchivedConversationDeletedCallbacks) {
610
+ if (topic.includes("/archived_conversations/") && topic.endsWith(_CLIENTDELETED)) {
611
+ // map.forEach((value, key, map) =>)
612
+ this.onArchivedConversationDeletedCallbacks.forEach((callback, handler, map) => {
613
+ callback(JSON.parse(message.toString()), _topic)
614
+ });
615
+ }
604
616
  }
605
- }
606
617
 
607
- // *********************************************************
608
- // This snippet is important to get all messages and notify
609
- // conversation > added (to create a conversation entry)
610
- // *********************************************************
611
- // if (this.onMessageAddedCallbacks) {
612
- // console.log("ttttttttt")
613
- if (topic.includes("/messages/") && topic.endsWith(_CLIENTADDED)) {
614
- if (this.onMessageAddedCallbacks) {
615
- this.onMessageAddedCallbacks.forEach((callback, handler, map) => {
616
- callback(JSON.parse(message.toString()), _topic)
617
- });
618
- }
619
- // Observing conversations added from messages
620
- // console.log("Observing conversations added from messages", message_json);
621
- // if (this.onConversationAddedCallbacks) {
622
- // console.log("callbacks ok........");
623
- let update_conversation = true;
624
- if (message_json.attributes && message_json.attributes.updateconversation == false) {
625
- update_conversation = false
626
- }
627
- // console.log("update_conversation........", update_conversation);
628
- if (update_conversation && this.onConversationAddedCallbacks) {
629
- this.onConversationAddedCallbacks.forEach((callback, handler, map) => {
630
- message_json.is_new = true;
631
- const message_for_conv_string = JSON.stringify(message_json);
632
- callback(JSON.parse(message_for_conv_string), _topic)
633
- });
618
+ // *********************************************************
619
+ // This snippet is important to get all messages and notify
620
+ // conversation > added (to create a conversation entry)
621
+ // *********************************************************
622
+ // if (this.onMessageAddedCallbacks) {
623
+ // console.log("ttttttttt")
624
+ if (topic.includes("/messages/") && topic.endsWith(_CLIENTADDED)) {
625
+ if (this.onMessageAddedCallbacks) {
626
+ this.onMessageAddedCallbacks.forEach((callback, handler, map) => {
627
+ callback(JSON.parse(message.toString()), _topic)
628
+ });
629
+ }
630
+ // Observing conversations added from messages
631
+ // console.log("Observing conversations added from messages", message_json);
632
+ // if (this.onConversationAddedCallbacks) {
633
+ // console.log("callbacks ok........");
634
+ let update_conversation = true;
635
+ if (message_json.attributes && message_json.attributes.updateconversation == false) {
636
+ update_conversation = false
637
+ }
638
+ // console.log("update_conversation........", update_conversation);
639
+ if (update_conversation && this.onConversationAddedCallbacks) {
640
+ this.onConversationAddedCallbacks.forEach((callback, handler, map) => {
641
+ message_json.is_new = true;
642
+ const message_for_conv_string = JSON.stringify(message_json);
643
+ callback(JSON.parse(message_for_conv_string), _topic)
644
+ });
645
+ }
646
+ // }
634
647
  }
635
648
  // }
636
- }
637
- // }
638
649
 
639
- if (this.onMessageUpdatedCallbacks) {
640
- if (topic.includes("/messages/") && topic.endsWith(_CLIENTUPDATED)) {
641
- this.onMessageUpdatedCallbacks.forEach((callback, handler, map) => {
642
- callback(JSON.parse(message.toString()), _topic)
643
- });
650
+ if (this.onMessageUpdatedCallbacks) {
651
+ if (topic.includes("/messages/") && topic.endsWith(_CLIENTUPDATED)) {
652
+ this.onMessageUpdatedCallbacks.forEach((callback, handler, map) => {
653
+ callback(JSON.parse(message.toString()), _topic)
654
+ });
655
+ }
644
656
  }
645
- }
646
657
 
647
- if (this.onGroupUpdatedCallbacks) {
648
- if (topic.includes("/groups/") && topic.endsWith(_CLIENTUPDATED)) {
649
- this.onGroupUpdatedCallbacks.forEach((callback, handler, map) => {
650
- callback(JSON.parse(message.toString()), _topic)
651
- });
658
+ if (this.onGroupUpdatedCallbacks) {
659
+ if (topic.includes("/groups/") && topic.endsWith(_CLIENTUPDATED)) {
660
+ this.onGroupUpdatedCallbacks.forEach((callback, handler, map) => {
661
+ callback(JSON.parse(message.toString()), _topic)
662
+ });
663
+ }
652
664
  }
653
- }
654
665
 
655
- // // ******* NEW!!
656
- this.callbackHandlers.forEach((value, key, map) => {
657
- const callback_obj = value
658
- // callback_obj = {
659
- // "type": "onMessageUpdatedForConversation",
660
- // "conversWith": conversWith,
661
- // "callback": callback
662
- // }
663
- const type = callback_obj.type
664
- if (topic.includes("/messages/") && topic.endsWith(_CLIENTADDED)) {
665
- if (this.log) { console.log("/messages/_CLIENTADDED") }
666
- if (type === CALLBACK_TYPE_ON_MESSAGE_ADDED_FOR_CONVERSATION) {
667
- if (conversWith === callback_obj.conversWith) {
668
- if (this.log) { console.log("/messages/_CLIENTADDED on: ", conversWith)}
669
- callback_obj.callback(JSON.parse(message.toString()), _topic)
666
+ // // ******* NEW!!
667
+ this.callbackHandlers.forEach((value, key, map) => {
668
+ const callback_obj = value
669
+ // callback_obj = {
670
+ // "type": "onMessageUpdatedForConversation",
671
+ // "conversWith": conversWith,
672
+ // "callback": callback
673
+ // }
674
+ const type = callback_obj.type
675
+ if (topic.includes("/messages/") && topic.endsWith(_CLIENTADDED)) {
676
+ if (this.log) { console.log("/messages/_CLIENTADDED") }
677
+ if (type === CALLBACK_TYPE_ON_MESSAGE_ADDED_FOR_CONVERSATION) {
678
+ if (conversWith === callback_obj.conversWith) {
679
+ if (this.log) { console.log("/messages/_CLIENTADDED on: ", conversWith)}
680
+ callback_obj.callback(JSON.parse(message.toString()), _topic)
681
+ }
670
682
  }
671
683
  }
672
- }
673
- if (topic.includes("/messages/") && topic.endsWith(_CLIENTUPDATED)) {
674
- if (this.log) {console.log("/messages/_CLIENTUPDATED")}
675
- if (type === CALLBACK_TYPE_ON_MESSAGE_UPDATED_FOR_CONVERSATION) {
676
- if (conversWith === callback_obj.conversWith) {
677
- console.log("/messages/_CLIENTUPDATED on: ", conversWith)
678
- callback_obj.callback(JSON.parse(message.toString()), _topic)
684
+ if (topic.includes("/messages/") && topic.endsWith(_CLIENTUPDATED)) {
685
+ if (this.log) {console.log("/messages/_CLIENTUPDATED")}
686
+ if (type === CALLBACK_TYPE_ON_MESSAGE_UPDATED_FOR_CONVERSATION) {
687
+ if (conversWith === callback_obj.conversWith) {
688
+ if (this.log) {console.log("/messages/_CLIENTUPDATED on: ", conversWith);}
689
+ callback_obj.callback(JSON.parse(message.toString()), _topic)
690
+ }
679
691
  }
680
692
  }
681
- }
682
- })
683
-
684
- // if (topic.includes("/messages/") && topic.endsWith(_CLIENTUPDATED)) {
685
- // this.onMessageUpdatedInConversationCallbacks.forEach((obj, handler, map) => {
686
- // if (conversWith === obj.conversWith) {
687
- // callback(message_json, _topic)
688
- // }
689
- // });
690
- // }
691
-
693
+ })
694
+
695
+ // if (topic.includes("/messages/") && topic.endsWith(_CLIENTUPDATED)) {
696
+ // this.onMessageUpdatedInConversationCallbacks.forEach((obj, handler, map) => {
697
+ // if (conversWith === obj.conversWith) {
698
+ // callback(message_json, _topic)
699
+ // }
700
+ // });
701
+ // }
702
+
692
703
 
693
- }
694
- catch (err) {
695
- console.error("ERROR:", err)
696
- }
704
+ }
705
+ catch (err) {
706
+ console.error("ERROR:", err)
707
+ }
708
+ })
709
+ subscribedCallback();
697
710
  })
711
+
698
712
  // console.log("HANDLER_:", this.on_message_handler)
699
713
  }
700
714
 
@@ -763,14 +777,23 @@ class Chat21Client {
763
777
  }
764
778
 
765
779
  conversationDetail(conversWith, callback) {
780
+ if (this.log) {
781
+ console.log("conversationDetail(). searching on user:", this.user_id, " - conversWith:", conversWith)
782
+ }
766
783
  this.crossConversationDetail(conversWith, false, callback);
767
784
  }
768
785
 
769
786
  archivedConversationDetail(conversWith, callback) {
787
+ if (this.log) {
788
+ console.log("archivedConversationDetail(). searching on user:", this.user_id, " - conversWith:", conversWith)
789
+ }
770
790
  this.crossConversationDetail(conversWith, true, callback);
771
791
  }
772
792
 
773
793
  crossConversationDetail(conversWith, archived, callback) {
794
+ if (this.log) {
795
+ console.log("searching on user:", this.user_id, " - conv of conversWith:", conversWith, " - archived:", archived)
796
+ }
774
797
  let path = "conversations";
775
798
  if (archived) {
776
799
  path = "archived_conversations"
@@ -778,8 +801,10 @@ class Chat21Client {
778
801
  // ex.: http://localhost:8004/tilechat/04-ANDREASPONZIELLO/conversations/CONVERS_WITH
779
802
  //const URL = `${this.APIendpoint}/${this.appid}/${this.user_id}/conversations/${conversWith}`
780
803
  const URL = `${this.APIendpoint}/${this.appid}/${this.user_id}/${path}/${conversWith}`
781
- console.log("getting conversation detail:", URL)
782
- console.log("conversWith:", conversWith)
804
+ if (this.log) {
805
+ console.log("getting conversation detail:", URL);
806
+ console.log("conversWith:", conversWith);
807
+ }
783
808
 
784
809
  let options = {
785
810
  url: URL,
@@ -790,7 +815,9 @@ class Chat21Client {
790
815
  method: 'GET'
791
816
  }
792
817
  Chat21Client.myrequest(options, (err, response, json) => {
793
- console.log("JSON...", json)
818
+ if (this.log) {
819
+ console.log("JSON...", json);
820
+ }
794
821
  if (json && json.result && Array.isArray(json.result) && json.result.length ==1) {
795
822
  callback(null, json.result[0]);
796
823
  }
@@ -964,12 +991,13 @@ class Chat21Client {
964
991
 
965
992
  this.client.on('connect', // TODO if token is wrong it must reply with an error!
966
993
  () => {
967
- if (this.log) {console.log("chat client connected...")}
994
+ if (this.log) {console.log("Chat client connected. User:" + user_id)}
968
995
  if (!this.connected) {
969
- if (this.log) {console.log("Chat client first connection.")}
996
+ if (this.log) {console.log("Chat client first connection for:" + user_id)}
970
997
  this.connected = true
971
- this.start()
972
- callback()
998
+ this.start( () => {
999
+ callback();
1000
+ });
973
1001
  }
974
1002
  }
975
1003
  );
@@ -1030,8 +1058,8 @@ class Chat21Client {
1030
1058
  }
1031
1059
 
1032
1060
  function isBrowser() {
1033
- return true;
1034
- //return false;
1061
+ // return true;
1062
+ return false;
1035
1063
  }
1036
1064
 
1037
1065
  export { Chat21Client }; // Browser
@@ -74,6 +74,7 @@ export const TOUCHING_OPERATOR = "TOUCHING_OPERATOR";
74
74
  // export const URL_SOUND = 'assets/sounds/pling.mp3';
75
75
  export const URL_SOUND_LIST_CONVERSATION = '/assets/sounds/pling.mp3';
76
76
  export const URL_SOUND_CONVERSATION_ADDED = '/assets/sounds/wheep-wheep.mp3';
77
+ export const URL_SOUND_CONVERSATION_UNASSIGNED = '/assets/sounds/interface-start.mp3'
77
78
  // export const CHAT_SEND_BY_EMAIL_LINK =
78
79
  // 'mailto:?subject=Transcript Chat Conversation&body=Salve,%0D%0A%0D%0Adi
79
80
  // seguito potrà scaricare il transcript della conversazione intercorsa con il nostro servizio di
package/src/global.scss CHANGED
@@ -422,6 +422,11 @@ select:-webkit-autofill:focus {
422
422
  .canned-list {
423
423
  .native-input[disabled] {
424
424
  opacity: 10 !important;
425
+ cursor: pointer;
426
+ }
427
+ .native-textarea[disabled] {
428
+ opacity: 10 !important;
429
+ cursor: pointer;
425
430
  }
426
431
  }
427
432