@chat21/chat21-ionic 3.0.59 → 3.0.60-rc1

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,17 @@
1
1
  # chat21-ionic ver 3.0
2
2
 
3
+ ### 3.0.60-rc1
4
+ - Adds the ability to view canned responses by clicking on the button with the "flash" icon located to the left of the "Enter a message" text area
5
+
6
+ ### 3.0.59.2
7
+ - Fixes the bug: when the agent refreshes the chat page and the chat is in mobile mode, the badge with the number of unassigned conversations does not work
8
+
9
+ ### 3.0.59.1
10
+ - Fixes the bug: "Unable to read uid of undefined" error occurs when agent logs out
11
+ - Fixes the bug: When the agent logs into the chat and the chat is in mobile mode, no conversations are displayed
12
+ - Fixes the bug: the websocket is initialized even if the supportMode property is set to false
13
+ - Fixes the bug: when the agent refreshes the chat page and the chat is in mobile mode, the badge with the number of unassigned conversations does not work
14
+
3
15
  ### 3.0.59
4
16
  - Deploys in production
5
17
 
@@ -7,7 +19,6 @@
7
19
  - Fixes the bug: the badge indicating the number of unassigned conversations does not update correctly when the project is changed
8
20
  - Changes the code that prevent the chat from opening in a new browser tab if the chat tab is already open
9
21
  - Publish conversations returned by subscription to websocket conversations > "on data" callback
10
- - Conditions the opening of websockets to "supportMode" set to true
11
22
 
12
23
  ### 3.0.59-rc22
13
24
  - Minor improvements
@@ -101,6 +112,9 @@
101
112
  - Fixes the bug: in the avatar-profile component the properties 'avatarUrl', 'color' and 'avatar' are private and accessible only within the class
102
113
  - Fixes the bug: on ios platforms the back button in the conversation details header overlaps the avatar
103
114
 
115
+ ### 3.0.58.1
116
+ - Fix the bug: if the "chatEngine" property value is set to "mqtt "the login modal window does not disappear even if the agent is logged in
117
+
104
118
  ### 3.0.58
105
119
  - Changes the logic with which the 'online' / 'offline' event is published (done before by the onAuthStateChanged() method)
106
120
  - Removes the setTimeout set for displaying the login window
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chat21/chat21-ionic",
3
- "version": "3.0.59",
3
+ "version": "3.0.60-rc1",
4
4
  "author": "Tiledesk SRL",
5
5
  "homepage": "https://ionicframework.com/",
6
6
  "scripts": {
@@ -98,7 +98,7 @@ export class AppComponent implements OnInit {
98
98
  public missingConnectionToast: any
99
99
  public executedInitializeAppByWatchConnection: boolean = false;
100
100
  private version: string;
101
-
101
+
102
102
  // private isOnline: boolean = false;
103
103
 
104
104
  wsService: WebSocketJs;
@@ -148,22 +148,9 @@ export class AppComponent implements OnInit {
148
148
 
149
149
  // this.listenToUrlChanges();
150
150
  // this.getPageState();
151
+ }
151
152
 
152
- // location.subscribe((val) => {
153
-
154
- // console.log('location subscribe val', val)
155
- // if (val.type == "hashchange") {
156
- // const convId = getParameterByName('convId')
157
- // console.log('[APP-COMP] ngOnInit convId get with getParameterByName ', convId)
158
- // const requesterFullaname = getParameterByName('requester_fullaname')
159
- // console.log('[APP-COMP] ngOnInit convId get with getParameterByName ', requesterFullaname);
160
-
161
- // this.navigateToDetail(convId, requesterFullaname)
162
153
 
163
- // this.events.publish('convid:haschanged', convId);
164
- // }
165
- // });
166
- }
167
154
 
168
155
  listenChatAlreadyOpenWithoutParamsInMobileMode() {
169
156
  this.events.subscribe('noparams:mobile', (isAlreadyOpenInMobileMode) => {
@@ -349,7 +336,7 @@ export class AppComponent implements OnInit {
349
336
  // const msg = { action: "hasArchived", parameter: event.data.parameter, calledBy: event.data.calledBy }
350
337
  // iframeWin.contentWindow.postMessage(msg, '*');
351
338
  // }
352
-
339
+
353
340
  // }
354
341
  // }
355
342
  if (event && event.data && event.data.action && event.data.text) {
@@ -679,8 +666,8 @@ export class AppComponent implements OnInit {
679
666
  // }
680
667
 
681
668
  if (checkPlatformIsMobile()) {
682
- // this.chatManager.startApp()
683
-
669
+ this.chatManager.startApp();
670
+
684
671
  this.logger.log('[APP-COMP] checkPlatformIsMobile', checkPlatformIsMobile());
685
672
  this.platformIs = PLATFORM_MOBILE;
686
673
  const IDConv = this.route.snapshot.firstChild.paramMap.get('IDConv');
@@ -693,7 +680,7 @@ export class AppComponent implements OnInit {
693
680
  // this.router.navigateByUrl(pageUrl);
694
681
  // this.navService.setRoot(ConversationListPage, {});
695
682
  } else {
696
- // this.chatManager.startApp()
683
+ this.chatManager.startApp();
697
684
  this.logger.log('[APP-COMP] checkPlatformIsMobile', checkPlatformIsMobile());
698
685
  this.platformIs = PLATFORM_DESKTOP;
699
686
  // console.log('[APP-COMP] platformIs', this.platformIs);
@@ -815,7 +802,7 @@ export class AppComponent implements OnInit {
815
802
  .pipe(filter((state) => state !== null))
816
803
  .subscribe((state: any) => {
817
804
  this.logger.log('initialize FROM [APP-COMP] - [APP-COMP] ***** BSAuthStateChanged state', state);
818
- // this.logger.info('initialize FROM [APP-COMP] - [APP-COMP] ***** BSAuthStateChanged isOnline', this.isOnline);
805
+
819
806
  if (state && state === AUTH_STATE_ONLINE) {
820
807
  // const user = this.tiledeskAuthService.getCurrentUser();
821
808
  // if (this.isOnline === false) {
@@ -868,16 +855,16 @@ export class AppComponent implements OnInit {
868
855
  * @param user
869
856
  */
870
857
  goOnLine = () => {
871
- // console.log('[APP-COMP] - GO-ONLINE ');
858
+ this.logger.log('[APP-COMP]- GO-ONLINE ');
872
859
  // this.isOnline = true;
873
860
  // this.logger.info('initialize FROM [APP-COMP] - [APP-COMP] - GO-ONLINE isOnline ', this.isOnline);
874
861
  // clearTimeout(this.timeModalLogin);
875
862
  const tiledeskToken = this.tiledeskAuthService.getTiledeskToken();
876
863
 
877
- const supportmode = this.appConfigProvider.getConfig().supportMode;
878
- this.logger.log('[APP-COMP] - GO-ONLINE - supportmode ', supportmode);
864
+ // const supportmode = this.appConfigProvider.getConfig().supportMode;
865
+ // this.logger.log('[APP-COMP] - GO-ONLINE - supportmode ', supportmode);
879
866
  // if (supportmode === true) {
880
- this.connetWebsocket(tiledeskToken)
867
+ // this.connetWebsocket() // moved in the comp project-item
881
868
  // }
882
869
  this.events.publish('go:online', true);
883
870
  const currentUser = this.tiledeskAuthService.getCurrentUser();
@@ -885,7 +872,7 @@ export class AppComponent implements OnInit {
885
872
  this.logger.log('[APP-COMP] - GO-ONLINE - currentUser ', currentUser);
886
873
  this.chatManager.setTiledeskToken(tiledeskToken);
887
874
  this.chatManager.setCurrentUser(currentUser);
888
- this.chatManager.startApp();
875
+ // this.chatManager.startApp();
889
876
 
890
877
  // ----------------------------------------------
891
878
  // PUSH NOTIFICATIONS
@@ -912,26 +899,16 @@ export class AppComponent implements OnInit {
912
899
  }
913
900
  }
914
901
 
915
- connetWebsocket(tiledeskToken) {
916
- const appconfig = this.appConfigProvider.getConfig();
917
- this.logger.log('connetWebsocket appconfig wsUrl ', appconfig.wsUrl)
918
- const WS_URL = appconfig.wsUrl + '?token=' + tiledeskToken
919
- this.webSocketJs.init(
920
- WS_URL,
921
- undefined,
922
- undefined,
923
- undefined
924
- );
925
- }
902
+
926
903
 
927
904
 
928
905
  goOffLine = () => {
929
- console.log('[APP-COMP] - GO-OFFLINE');
906
+ this.logger.log('[APP-COMP] - GO-OFFLINE');
930
907
  const supportmode = this.appConfigProvider.getConfig().supportMode;
931
908
  this.logger.log('[APP-COMP] - GO-OFFINE - supportmode ', supportmode);
932
- // if (supportmode === true) {
933
- this.webSocketClose()
934
- // }
909
+ if (supportmode === true) {
910
+ this.webSocketClose()
911
+ }
935
912
  // this.isOnline = false;
936
913
  // this.conversationsHandlerService.conversations = [];
937
914
  this.chatManager.setTiledeskToken(null);
@@ -75,7 +75,7 @@
75
75
  </ion-item-sliding> -->
76
76
 
77
77
 
78
- <ion-item button="true" lines="none" class="ion-no-padding" [class.ion-selected]="conversation.uid === uidConvSelected"
78
+ <ion-item button="true" lines="none" class="ion-no-padding" [class.ion-selected]="conversation?.uid === uidConvSelected"
79
79
  *ngFor="let conversation of listConversations" (click)="openConversationByID(conversation)" detail=false>
80
80
  <div tabindex="0"></div>
81
81
 
@@ -1,64 +1,82 @@
1
- <ion-grid>
1
+ <!-- <ion-grid>
2
2
  <ion-row id="message-text-area">
3
-
4
3
  <ion-col col-auto>
5
-
6
4
  <div class="buttons-left">
7
-
8
- <!-- <ion-button class="attach-button" ion-button fill="clear" style="display: none;">
9
- <input type="file" accept="image/*" capture="camera" (change)="onFileSelected($event)" id="fileInput" />
10
- <label for="fileInput" icon-only ion-button>
11
- <ion-icon slot="icon-only" name="attach"></ion-icon>
12
- </label>
13
- </ion-button> -->
14
5
 
15
6
  <ion-button ion-button fill="clear" class="upload-image-btn">
16
-
17
- <ion-icon slot="icon-only" lazy="true" name="attach-outline" style="font-size: 30px;transform: rotate(42deg);"></ion-icon>
18
- <!-- <ion-label slot="end">Upload Image</ion-label> -->
19
- <!-- <input #fileInput type="file" (change)="onFileSelected($event)" capture="camera" id="file-input" accept="image/*, .pdf,.zip"> -->
20
- <!-- https://stackoverflow.com/questions/11832930/html-input-file-accept-attribute-file-type-csv?rq=1 -->
21
- <!-- <input #fileInput type="file" (change)="onFileSelected($event)" capture="camera" id="file-input" accept="image/*, audio/* ,video/*, text/html, text/plain, .csv, .pdf,.doc,.docx,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document, .scss, .css, .json"> -->
7
+ <ion-icon slot="icon-only" lazy="true" name="attach-outline"
8
+ style="font-size: 30px;transform: rotate(42deg);"></ion-icon>
22
9
  <input #fileInput type="file" (change)="onFileSelected($event)" capture="camera" id="file-input"
23
10
  [accept]="fileUploadAccept">
24
-
25
11
  </ion-button>
26
12
  </div>
27
13
 
28
-
29
14
  <div class="text-message">
30
- <!-- [value]="" -->
31
- <!-- placeholder="{{ 'LABEL_ENTER_MSG' | translate }}" -->
32
- <!-- (ionBlur)="txtfocus(0)" -->
33
- <!-- autofocus="true" -->
34
- <!-- autoFocus="true" // directive -->
35
-
36
- <ion-textarea id="ion-textarea" #messageTextArea #message_text_area #textArea rows="1"
37
- [placeholder]="TEXAREA_PLACEHOLDER"
38
- autosize="false"
39
- auto-grow="true"
40
- autofocus="true"
41
- [value]=""
42
- [(ngModel)]="messageString"
43
- (ionChange)="ionChange($event);"
44
- (keydown.enter)="onKeydown($event, messageString)"
45
- (paste)="onPaste($event)">
15
+ <ion-textarea id="ion-textarea" #messageTextArea #message_text_area #textArea rows="1"
16
+ [placeholder]="TEXAREA_PLACEHOLDER" autosize="false" auto-grow="true" autofocus="true" [value]=""
17
+ [(ngModel)]="messageString" (ionChange)="ionChange($event);"
18
+ (keydown.enter)="onKeydown($event, messageString)" (paste)="onPaste($event)">
46
19
  </ion-textarea>
47
- <!-- (ionInput)="onChange($event);" -->
48
20
  </div>
49
21
 
50
22
  <div class="buttons-right">
51
- <!-- [disabled]="conversationEnabled === false" -->
52
- <ion-button [disabled]="conversationEnabled === false" class="send-button right active" ion-button fill="clear"
23
+ <ion-button [disabled]="conversationEnabled === false" class="send-button right active" ion-button fill="clear"
53
24
  (click)="sendMessage(messageString)">
54
- <ion-icon [ngClass]="{'send-msg-disabled': conversationEnabled === false,'send-msg-activated': conversationEnabled === true }" slot="icon-only" name="send"></ion-icon>
25
+ <ion-icon
26
+ [ngClass]="{'send-msg-disabled': conversationEnabled === false,'send-msg-activated': conversationEnabled === true }"
27
+ slot="icon-only" name="send"></ion-icon>
55
28
  </ion-button>
56
29
  </div>
57
30
  </ion-col>
31
+ </ion-row>
32
+ </ion-grid> -->
58
33
 
34
+ <!-- --------------------------------------------------------------------------------------------------------------------- -->
35
+ <!-- ----------new -->
36
+ <ion-grid>
37
+ <ion-row id="message-text-area">
59
38
 
39
+ <ion-col col-auto>
60
40
 
41
+ <div class="start-buttons" style="position: absolute;display: flex;">
61
42
 
62
- </ion-row>
43
+ <div class="canned-responses-btn-wpr" style="margin-left: -5px;" tooltip="{{translationMap?.get('CANNED_RESPONSES')}}" [options]="tooltipOptions" placement="top">
44
+
45
+ <ion-button ion-button fill="clear" class="canned-responses-btn" (click)="openCannedResponses()" [disabled]="!IS_SUPPORT_GROUP_CONVERSATION">
46
+ <ion-icon slot="icon-only" lazy="true" name="flash-outline" style="font-size: 24px;"></ion-icon>
47
+ </ion-button>
48
+
49
+ </div>
63
50
 
51
+ <div class="upload-image-btn-wpr" tooltip="{{translationMap?.get('UPLOAD')}}" [options]="tooltipOptions">
52
+ <ion-button ion-button fill="clear" class="upload-image-btn">
53
+ <ion-icon slot="icon-only" lazy="true" name="attach-outline"
54
+ style="font-size: 30px;transform: rotate(42deg);"></ion-icon>
55
+ <input #fileInput type="file" (change)="onFileSelected($event)" capture="camera" id="file-input"
56
+ [accept]="fileUploadAccept">
57
+
58
+ </ion-button>
59
+
60
+ </div>
61
+ </div>
62
+
63
+ <div class="text-message">
64
+ <ion-textarea id="ion-textarea" #messageTextArea #message_text_area #textArea rows="1"
65
+ [placeholder]="TEXAREA_PLACEHOLDER" autosize="false" auto-grow="true" autofocus="true" [value]=""
66
+ [(ngModel)]="messageString" (ionChange)="ionChange($event);"
67
+ (keydown.enter)="onKeydown($event, messageString)" (paste)="onPaste($event)">
68
+ </ion-textarea>
69
+ </div>
70
+
71
+ <div class="buttons-right">
72
+ <ion-button [disabled]="conversationEnabled === false" class="send-button right active" ion-button fill="clear"
73
+ (click)="sendMessage(messageString)">
74
+ <ion-icon
75
+ [ngClass]="{'send-msg-disabled': conversationEnabled === false,'send-msg-activated': conversationEnabled === true }"
76
+ slot="icon-only" name="send"></ion-icon>
77
+ </ion-button>
78
+ </div>
79
+ </ion-col>
80
+
81
+ </ion-row>
64
82
  </ion-grid>
@@ -42,8 +42,10 @@
42
42
  }
43
43
  .text-message {
44
44
  position: relative;
45
- margin: 0 35px;
46
- width: calc(100% - 70px);
45
+ // margin: 0 35px;
46
+ // width: calc(100% - 70px);
47
+ margin: 0 70px;
48
+ width: calc(100% - 100px);
47
49
  ion-textarea {
48
50
  // border-radius: 4px;
49
51
  border-radius: 20px; // NK edited
@@ -97,10 +99,21 @@
97
99
  --border-radius: 50%;
98
100
  --padding-end: 1px;
99
101
  --padding-start: 1px;
100
-
101
102
  height: 33px !important;
102
103
  }
103
104
 
105
+
106
+ .canned-responses-btn {
107
+ --padding-bottom: 0px;
108
+ --padding-top: 0px;
109
+ --border-radius: 50%;
110
+ --padding-end: 1px;
111
+ --padding-start: 1px;
112
+ height: 33px !important;
113
+ width: 30px;
114
+ }
115
+
116
+
104
117
  .upload-image-btn .button-native {
105
118
  border-radius: 50%;
106
119
  }
@@ -50,6 +50,7 @@ export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChange
50
50
  @Input() translationMap: Map<string, string>;
51
51
  @Input() dropEvent: any;
52
52
  @Output() eventChangeTextArea = new EventEmitter<object>();
53
+ @Output() hasClickedOpenCannedResponses = new EventEmitter<boolean>();
53
54
  @Output() eventSendMessage = new EventEmitter<object>();
54
55
  @Output() onPresentModalScrollToBottom = new EventEmitter<boolean>();
55
56
 
@@ -64,9 +65,21 @@ export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChange
64
65
  public currentWindowWidth: any;
65
66
  private logger: LoggerService = LoggerInstance.getInstance();
66
67
  public countClicks: number = 0;
68
+ public IS_SUPPORT_GROUP_CONVERSATION: boolean;
67
69
 
68
70
  TYPE_MSG_TEXT = TYPE_MSG_TEXT;
69
71
 
72
+ tooltipOptions = {
73
+ 'show-delay': 500,
74
+ 'tooltip-class': 'chat-tooltip',
75
+ 'theme': 'light',
76
+ 'shadow': false,
77
+ 'hide-delay-mobile': 0,
78
+ 'hideDelayAfterClick': 3000,
79
+ 'hide-delay': 200
80
+ };
81
+
82
+
70
83
  /**
71
84
  * Constructor
72
85
  * @param chooser
@@ -103,11 +116,18 @@ export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChange
103
116
 
104
117
 
105
118
  ngOnChanges() {
106
-
107
119
  if (this.translationMap) {
108
- this.LONG_TEXAREA_PLACEHOLDER = this.translationMap.get('LABEL_ENTER_MSG')
109
- this.SHORT_TEXAREA_PLACEHOLDER = this.translationMap.get('LABEL_ENTER_MSG_SHORT')
110
- this.SHORTER_TEXAREA_PLACEHOLDER = this.translationMap.get('LABEL_ENTER_MSG_SHORTER')
120
+ // this.LONG_TEXAREA_PLACEHOLDER = this.translationMap.get('LABEL_ENTER_MSG')
121
+ // this.SHORT_TEXAREA_PLACEHOLDER = this.translationMap.get('LABEL_ENTER_MSG_SHORT')
122
+ // this.SHORTER_TEXAREA_PLACEHOLDER = this.translationMap.get('LABEL_ENTER_MSG_SHORTER')
123
+
124
+ this.TEXAREA_PLACEHOLDER = this.translationMap.get('LABEL_ENTER_MSG_SHORT')
125
+ }
126
+
127
+ if (this.conversationWith.startsWith("support-group")) {
128
+ this.IS_SUPPORT_GROUP_CONVERSATION = true
129
+ } else {
130
+ this.IS_SUPPORT_GROUP_CONVERSATION = false
111
131
  }
112
132
 
113
133
  this.logger.log("[CONVS-DETAIL][MSG-TEXT-AREA] ngOnChanges DROP EVENT ", this.dropEvent);
@@ -120,21 +140,20 @@ export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChange
120
140
  }
121
141
  // if (this.isOpenInfoConversation === true) {
122
142
  // this.getIfTexareaIsEmpty('ngOnChanges')
123
- this.getWindowWidth();
143
+ // this.getWindowWidth();
124
144
  // }
125
145
  }
126
146
 
127
147
  // ngAfterViewInit() {
128
148
  ngAfterViewInit() {
129
149
 
130
- this.logger.log("[CONVS-DETAIL][MSG-TEXT-AREA] ngAfterViewInit message_text_area ", this.message_text_area);
131
- this.logger.log("[CONVS-DETAIL][MSG-TEXT-AREA] ngAfterViewInit messageTextArea ", this.messageTextArea);
150
+ // console.log("[CONVS-DETAIL][MSG-TEXT-AREA] ngAfterViewInit message_text_area ", this.message_text_area);
151
+ // console.log("[CONVS-DETAIL][MSG-TEXT-AREA] ngAfterViewInit messageTextArea ", this.messageTextArea);
132
152
  if (this.messageTextArea) {
133
153
  setTimeout(() => {
134
154
 
135
-
136
155
  const elTextArea = this.message_text_area['el'];
137
- // this.logger.log("[CONVS-DETAIL][MSG-TEXT-AREA] ngAfterViewInit elTextArea ", elTextArea);
156
+ // console.log("[CONVS-DETAIL][MSG-TEXT-AREA] ngAfterViewInit elTextArea ", elTextArea);
138
157
  // this.logger.log("[CONVS-DETAIL][MSG-TEXT-AREA] ngAfterViewInit elTextArea children", elTextArea.children);
139
158
  if (elTextArea.children.length === 1) {
140
159
 
@@ -148,10 +167,8 @@ export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChange
148
167
  }
149
168
  }
150
169
 
151
-
152
170
  // this.logger.log("[CONVS-DETAIL][MSG-TEXT-AREA] set focus on ", this.messageTextArea);
153
171
  // Keyboard.show() // for android
154
-
155
172
  this.messageTextArea.setFocus();
156
173
 
157
174
  }, 1500); //a least 150ms.
@@ -162,46 +179,19 @@ export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChange
162
179
  getWindowWidth(): any {
163
180
  this.currentWindowWidth = window.innerWidth;
164
181
 
165
- // if ((this.currentWindowWidth < 1045 && this.currentWindowWidth > 835) && this.isOpenInfoConversation === true) {
166
- // this.logger.log("[CONVS-DETAIL] [MSG-TEXT-AREA] DISPLAY SHORT_TEXAREA_PLACEHOLDER ");
167
- // // this.TEXAREA_PLACEHOLDER = '';
168
- // this.TEXAREA_PLACEHOLDER = this.SHORT_TEXAREA_PLACEHOLDER;
169
- // } else if (this.currentWindowWidth < 835 && this.isOpenInfoConversation === true) {
170
- // this.logger.log("[CONVS-DETAIL] [MSG-TEXT-AREA] DISPLAY SHORTER_TEXAREA_PLACEHOLDER ");
171
-
172
182
 
183
+ // if (this.currentWindowWidth >= 844 && this.isOpenInfoConversation === false && this.conversationWith.startsWith("support-group")) {
184
+ // this.TEXAREA_PLACEHOLDER = this.LONG_TEXAREA_PLACEHOLDER;
185
+ // this.logger.log('[CONVS-DETAIL][MSG-TEXT-AREA] currentWindowWidth', this.currentWindowWidth, ' - DISPLAY LONG_TEXAREA_PLACEHOLDER ');
186
+ // } else if (this.currentWindowWidth >= 844 && this.isOpenInfoConversation === true && this.conversationWith.startsWith("support-group")) {
187
+ // this.TEXAREA_PLACEHOLDER = this.SHORT_TEXAREA_PLACEHOLDER;
188
+ // } else if (this.currentWindowWidth < 844 && this.isOpenInfoConversation === false && this.conversationWith.startsWith("support-group")) {
189
+ // this.TEXAREA_PLACEHOLDER = this.SHORT_TEXAREA_PLACEHOLDER;
190
+ // } else if (this.currentWindowWidth < 844 && this.isOpenInfoConversation === true && this.conversationWith.startsWith("support-group")) {
173
191
  // this.TEXAREA_PLACEHOLDER = this.SHORTER_TEXAREA_PLACEHOLDER;
174
- // // this.TEXAREA_PLACEHOLDER = '';
175
-
176
- // } else
177
- // this.logger.log("[CONVS-DETAIL][MSG-TEXT-AREA] currentWindowWidth ", this.currentWindowWidth);
178
- // this.logger.log('[CONVS-DETAIL][MSG-TEXT-AREA] isOpenInfoConversation', this.isOpenInfoConversation);
179
- // this.logger.log('[CONVS-DETAIL][MSG-TEXT-AREA] this.conversationWith.startsWith("support-group")', this.conversationWith.startsWith("support-group"));
180
-
181
-
182
- if (this.currentWindowWidth >= 844 && this.isOpenInfoConversation === false && this.conversationWith.startsWith("support-group")) {
183
-
184
- this.TEXAREA_PLACEHOLDER = this.LONG_TEXAREA_PLACEHOLDER;
185
-
186
- this.logger.log('[CONVS-DETAIL][MSG-TEXT-AREA] currentWindowWidth', this.currentWindowWidth, ' - DISPLAY LONG_TEXAREA_PLACEHOLDER ');
187
-
188
-
189
- } else if (this.currentWindowWidth >= 844 && this.isOpenInfoConversation === true && this.conversationWith.startsWith("support-group")) {
190
- this.TEXAREA_PLACEHOLDER = this.SHORT_TEXAREA_PLACEHOLDER;
191
-
192
-
193
- } else if (this.currentWindowWidth < 844 && this.isOpenInfoConversation === false && this.conversationWith.startsWith("support-group")) {
194
-
195
- this.TEXAREA_PLACEHOLDER = this.SHORT_TEXAREA_PLACEHOLDER;
196
-
197
- } else if (this.currentWindowWidth < 844 && this.isOpenInfoConversation === true && this.conversationWith.startsWith("support-group")) {
198
-
199
- this.TEXAREA_PLACEHOLDER = this.SHORTER_TEXAREA_PLACEHOLDER;
200
-
201
- } else if (!this.conversationWith.startsWith("support-group")) {
202
- this.TEXAREA_PLACEHOLDER = this.SHORT_TEXAREA_PLACEHOLDER;
203
-
204
- }
192
+ // } else if (!this.conversationWith.startsWith("support-group")) {
193
+ // this.TEXAREA_PLACEHOLDER = this.SHORT_TEXAREA_PLACEHOLDER;
194
+ // }
205
195
 
206
196
  // this.logger.log("[CONVS-DETAIL][MSG-TEXT-AREA] checkPlatformIsMobile() ", checkPlatformIsMobile());
207
197
  if (checkPlatformIsMobile() === true) {
@@ -214,11 +204,7 @@ export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChange
214
204
  }
215
205
 
216
206
  }
217
- // if (checkPlatformIsMobile && this.currentWindowWidth <= 430) {
218
- // this.TEXAREA_PLACEHOLDER = this.SHORT_TEXAREA_PLACEHOLDER;
219
- // } else if (checkPlatformIsMobile && this.currentWindowWidth > 430) {
220
- // this.TEXAREA_PLACEHOLDER = this.LONG_TEXAREA_PLACEHOLDER;
221
- // }
207
+
222
208
  }
223
209
 
224
210
  // -------------------------------------------------------------------------------------------
@@ -228,36 +214,20 @@ export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChange
228
214
  onResize(event) {
229
215
  // this.getIfTexareaIsEmpty('onResize')
230
216
  this.logger.log("[CONVS-DETAIL][MSG-TEXT-AREA] event.target.innerWidth; ", event.target.innerWidth);
231
- // if ((event.target.innerWidth < 1045 && event.target.innerWidth > 835) && this.isOpenInfoConversation === true) {
232
- // this.logger.log("[CONVS-DETAIL] [MSG-TEXT-AREA] ON RESIZE DISPAY SHORT_TEXAREA_PLACEHOLDER");
233
- // this.TEXAREA_PLACEHOLDER = this.SHORT_TEXAREA_PLACEHOLDER;
234
- // } else if (event.target.innerWidth < 835 && this.isOpenInfoConversation === true) {
235
- // this.TEXAREA_PLACEHOLDER = this.SHORTER_TEXAREA_PLACEHOLDER;
236
- // } else {
237
- // this.TEXAREA_PLACEHOLDER = this.LONG_TEXAREA_PLACEHOLDER;
238
-
239
-
240
- if (event.target.innerWidth >= 844 && this.isOpenInfoConversation === false && this.conversationWith.startsWith("support-group")) {
241
- this.TEXAREA_PLACEHOLDER = this.LONG_TEXAREA_PLACEHOLDER;
242
- // this.logger.log('[CONVS-DETAIL][MSG-TEXT-AREA] - else - DISPLAY LONG_TEXAREA_PLACEHOLDER ');
243
- // this.logger.log('[CONVS-DETAIL][MSG-TEXT-AREA] - else - this.currentWindowWidth ', this.currentWindowWidth);
217
+
244
218
 
245
- } else if (event.target.innerWidth >= 844 && this.isOpenInfoConversation === true && this.conversationWith.startsWith("support-group")) {
246
- this.TEXAREA_PLACEHOLDER = this.SHORT_TEXAREA_PLACEHOLDER;
247
219
 
248
-
249
- } else if (event.target.innerWidth < 844 && this.isOpenInfoConversation === false && this.conversationWith.startsWith("support-group")) {
250
-
251
- this.TEXAREA_PLACEHOLDER = this.SHORT_TEXAREA_PLACEHOLDER;
252
-
253
- } else if (event.target.innerWidth < 844 && this.isOpenInfoConversation === true && this.conversationWith.startsWith("support-group")) {
254
-
255
- this.TEXAREA_PLACEHOLDER = this.SHORTER_TEXAREA_PLACEHOLDER;
256
-
257
- } else if (!this.conversationWith.startsWith("support-group")) {
258
- this.TEXAREA_PLACEHOLDER = this.SHORT_TEXAREA_PLACEHOLDER;
259
-
260
- }
220
+ // if (event.target.innerWidth >= 844 && this.isOpenInfoConversation === false && this.conversationWith.startsWith("support-group")) {
221
+ // this.TEXAREA_PLACEHOLDER = this.LONG_TEXAREA_PLACEHOLDER;
222
+ // } else if (event.target.innerWidth >= 844 && this.isOpenInfoConversation === true && this.conversationWith.startsWith("support-group")) {
223
+ // this.TEXAREA_PLACEHOLDER = this.SHORT_TEXAREA_PLACEHOLDER;
224
+ // } else if (event.target.innerWidth < 844 && this.isOpenInfoConversation === false && this.conversationWith.startsWith("support-group")) {
225
+ // this.TEXAREA_PLACEHOLDER = this.SHORT_TEXAREA_PLACEHOLDER;
226
+ // } else if (event.target.innerWidth < 844 && this.isOpenInfoConversation === true && this.conversationWith.startsWith("support-group")) {
227
+ // this.TEXAREA_PLACEHOLDER = this.SHORTER_TEXAREA_PLACEHOLDER;
228
+ // } else if (!this.conversationWith.startsWith("support-group")) {
229
+ // this.TEXAREA_PLACEHOLDER = this.SHORT_TEXAREA_PLACEHOLDER;
230
+ // }
261
231
 
262
232
  // this.logger.log('[CONVS-DETAIL][MSG-TEXT-AREA] checkPlatformIsMobile() ', checkPlatformIsMobile());
263
233
  if (checkPlatformIsMobile() === true) {
@@ -476,7 +446,6 @@ export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChange
476
446
  this.conversationEnabled = false;
477
447
  }
478
448
 
479
-
480
449
  this.eventChangeTextArea.emit({ msg: message, offsetHeight: height });
481
450
  }
482
451
 
@@ -530,7 +499,7 @@ export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChange
530
499
  this.logger.log("[CONVS-DETAIL] replaceTagInMessage onKeydown in msg-texarea SEND MESSAGE 2 message: ", message);
531
500
  this.logger.log('[CONVS-DETAIL][MSG-TEXT-AREA] onKeydown - SEND MESSAGE 2 message value: ', message.value);
532
501
  this.logger.log('[CONVS-DETAIL][MSG-TEXT-AREA] onKeydown - SEND MESSAGE 2 text: ', text);
533
-
502
+
534
503
  this.logger.log("[CONVS-DETAIL] replaceTagInMessage onKeydown in msg-texarea SEND MESSAGE 2 this.tagsCannedFilter.length: ", this.tagsCannedFilter.length);
535
504
  this.logger.log("[CONVS-DETAIL] replaceTagInMessage onKeydown in msg-texarea SEND MESSAGE 2 this.countClicks: ", this.countClicks);
536
505
  this.logger.log("[CONVS-DETAIL][MSG-TEXT-AREA] onKeydown in msg-texarea SEND MESSAGE 2 this.countClicks: ", this.countClicks);
@@ -539,7 +508,7 @@ export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChange
539
508
 
540
509
  this.sendMessage(text);
541
510
  this.countClicks = 0
542
- } else if (text.includes("/") && pos > 0 && this.countClicks > 1 && this.tagsCannedFilter.length > 0 && text.substr(-1) !== '/' ) {
511
+ } else if (text.includes("/") && pos > 0 && this.countClicks > 1 && this.tagsCannedFilter.length > 0 && text.substr(-1) !== '/') {
543
512
  this.logger.log('[CONVS-DETAIL][MSG-TEXT-AREA] onKeydown - tagsCannedFilter.length 3: ', this.tagsCannedFilter.length);
544
513
  this.logger.log("[CONVS-DETAIL] replaceTagInMessage onKeydown in msg-texarea SEND MESSAGE 3 message: ", message);
545
514
  // this.logger.log('[CONVS-DETAIL][MSG-TEXT-AREA] onKeydown - SEND MESSAGE 3 message value: ', message.value);
@@ -565,6 +534,25 @@ export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChange
565
534
  }
566
535
  }
567
536
  }
537
+ openCannedResponses() {
538
+ // console.log('[MSG-TEXT-AREA] has clicked OPEN-CANNED-RESPONSES messageString ', this.messageString)
539
+ // if (this.messageString) {
540
+ // console.log('[MSG-TEXT-AREA] has clicked OPEN-CANNED-RESPONSES messageString.trim ', this.messageString.trim)
541
+ // }
542
+ // if (this.messageString === undefined) {
543
+ // this.messageString = '/'
544
+ // } else {
545
+
546
+ // }
547
+
548
+ // const elTextArea = this.message_text_area['el'];
549
+ // console.log('[MSG-TEXT-AREA] textArea elTextArea ', elTextArea)
550
+ // const textArea = elTextArea.getElementsByTagName('ion-textarea')[0];
551
+ // console.log("[MSG-TEXT-AREA] textArea textArea ", textArea);
552
+ // this.logger.log("[MSG-TEXT-AREA] textArea value", textArea.value)
553
+
554
+ this.hasClickedOpenCannedResponses.emit(true);
555
+ }
568
556
 
569
557
 
570
558
  sendMessage(text: string) {
@@ -625,11 +613,7 @@ export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChange
625
613
 
626
614
  // Note: on mac keyboard "metakey" matches "cmd"
627
615
  if (event.key === 'Enter' && event.altKey || event.key === 'Enter' && event.ctrlKey || event.key === 'Enter' && event.metaKey) {
628
-
629
-
630
-
631
616
  this.logger.log('[CONVS-DETAIL][MSG-TEXT-AREA] HAS PRESSED COMBO KEYS this.messageString', this.messageString);
632
-
633
617
  if (this.messageString !== undefined && this.messageString.trim() !== '') {
634
618
  this.logger.log('[CONVS-DETAIL][MSG-TEXT-AREA] HAS PRESSED Enter + ALT this.messageString', this.messageString);
635
619
  this.messageString = this.messageString + "\r\n"
@@ -9,6 +9,7 @@ import { CustomTranslateService } from 'src/chat21-core/providers/custom-transla
9
9
  import { TiledeskAuthService } from 'src/chat21-core/providers/tiledesk/tiledesk-auth.service';
10
10
  import { TiledeskService } from 'src/app/services/tiledesk/tiledesk.service';
11
11
  import { WebSocketJs } from 'src/app/services/websocket/websocket-js';
12
+ import { AppConfigProvider } from 'src/app/services/app-config';
12
13
 
13
14
  @Component({
14
15
  selector: 'app-project-item',
@@ -38,16 +39,39 @@ export class ProjectItemComponent implements OnInit {
38
39
  public tiledeskAuthService: TiledeskAuthService,
39
40
  public tiledeskService: TiledeskService,
40
41
  public webSocketJs: WebSocketJs,
42
+ private appConfigProvider: AppConfigProvider,
41
43
  ) { }
42
44
 
43
45
  ngOnInit() {
44
- this.getLastProjectStoredAndSubscToWSAvailabilityAndConversations();
45
- this.getStoredToken();
46
+ this.getStoredTokenAndConnectWS();
46
47
  this.getStoredCurrenUser();
47
48
  this.translations();
48
49
  this.listenToPostMsgs();
49
50
  this.onInitWindowWidth();
51
+ // console.log('[PROJECT-ITEM] - on INIT')
52
+ }
50
53
 
54
+ getStoredTokenAndConnectWS() {
55
+ this.tiledeskToken = this.appStorageService.getItem('tiledeskToken');
56
+ this.logger.log('[PROJECT-ITEM] - STORED TILEDEK TOKEN ', this.tiledeskToken)
57
+ this.connetWebsocket( this.tiledeskToken)
58
+ }
59
+
60
+ connetWebsocket(tiledeskToken) {
61
+
62
+ this.logger.log('[WEBSOCKET-JS] connetWebsocket called in [PROJECT-ITEM] tiledeskToken ',tiledeskToken)
63
+ const appconfig = this.appConfigProvider.getConfig();
64
+ this.logger.log('[WEBSOCKET-JS] connetWebsocket called in [PROJECT-ITEM] wsUrl ', appconfig.wsUrl)
65
+ const WS_URL = appconfig.wsUrl + '?token=' + tiledeskToken
66
+ this.logger.log('[WEBSOCKET-JS] connetWebsocket called in [PROJECT-ITEM] wsUrl ', WS_URL)
67
+ this.webSocketJs.init(
68
+ WS_URL,
69
+ undefined,
70
+ undefined,
71
+ undefined
72
+ );
73
+
74
+ this.getLastProjectStoredAndSubscToWSAvailabilityAndConversations();
51
75
  }
52
76
 
53
77
  listenToPostMsgs() {
@@ -104,11 +128,7 @@ export class ProjectItemComponent implements OnInit {
104
128
 
105
129
 
106
130
 
107
- getStoredToken() {
108
- this.tiledeskToken = this.appStorageService.getItem('tiledeskToken');
109
- this.logger.log('[PROJECT-ITEM] - STORED TILEDEK TOKEN ', this.tiledeskToken)
110
-
111
- }
131
+
112
132
 
113
133
  getStoredCurrenUser() {
114
134
  const storedCurrentUser = this.appStorageService.getItem('currentUser');
@@ -134,9 +154,9 @@ export class ProjectItemComponent implements OnInit {
134
154
  if (!stored_project) {
135
155
  this.logger.log('PROJECT-ITEM - THERE IS NOT STORED LAST PROJECT ', stored_project)
136
156
  const tiledeskToken = this.appStorageService.getItem('tiledeskToken');
137
- this.logger.log('[INFO-CONTENT-COMP] - GET PROJECTS - tiledeskToken', tiledeskToken);
157
+ this.logger.log('[PROJECT-ITEM] - GET PROJECTS - tiledeskToken', tiledeskToken);
138
158
  this.tiledeskService.getProjects(tiledeskToken).subscribe(projects => {
139
- this.logger.log('[INFO-CONTENT-COMP] - GET PROJECTS - RES', projects);
159
+ this.logger.log('[PROJECT-ITEM - GET PROJECTS - RES', projects);
140
160
 
141
161
  this.logger.log('[INFO-CONTENT-COMP] - GET PROJECTS - RES this.project', this.project);
142
162
 
@@ -147,7 +167,7 @@ export class ProjectItemComponent implements OnInit {
147
167
  }
148
168
 
149
169
  }, (error) => {
150
- this.logger.error('[INFO-CONTENT-COMP] - GET PROJECTS - ERROR ', error);
170
+ this.logger.error('[PROJECT-ITEM] - GET PROJECTS - ERROR ', error);
151
171
 
152
172
  }, () => {
153
173
  this.logger.log('[INFO-CONTENT-COMP] - GET PROJECTS * COMPLETE *');
@@ -51,11 +51,12 @@ import { NgxLinkifyjsModule } from 'ngx-linkifyjs';
51
51
  SharedModule,
52
52
  NgxLinkifyjsModule,
53
53
  ],
54
- entryComponents: [MessageTextAreaComponent],
54
+ // entryComponents: [MessageTextAreaComponent],
55
+ entryComponents: [],
55
56
  declarations: [
56
57
  ConversationDetailPage,
57
58
  HeaderConversationDetailComponent,
58
- MessageTextAreaComponent,
59
+ // MessageTextAreaComponent,
59
60
  // BubbleDayMessageComponent,
60
61
  // BubbleSystemMessageComponent,
61
62
  // BubbleMyMessageComponent,
@@ -159,6 +159,7 @@
159
159
  [conversationWith]="conversationWith"
160
160
  [tagsCannedFilter]="tagsCannedFilter"
161
161
  (eventChangeTextArea)="returnChangeTextArea($event)"
162
+ (hasClickedOpenCannedResponses)="hasClickedOpenCannedResponses($event)"
162
163
  (eventSendMessage)="returnSendMessage($event)"
163
164
  [translationMap]="translationMap"
164
165
  [fileUploadAccept]="appConfigProvider.getConfig().fileUploadAccept"
@@ -415,7 +415,9 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
415
415
  'FAILED_TO_UPLOAD_THE_FORMAT_IS NOT_SUPPORTED',
416
416
  'NO_INFORMATION_AVAILABLE',
417
417
  'CONTACT_ID',
418
- 'USER_ID'
418
+ 'USER_ID',
419
+ "UPLOAD",
420
+ "CANNED_RESPONSES"
419
421
  ];
420
422
 
421
423
  this.translationMap = this.customTranslateService.translateLanguage(keys);
@@ -983,6 +985,8 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
983
985
  }
984
986
  }
985
987
 
988
+
989
+
986
990
  // ----------------------------------------------------------
987
991
  // @ CANNED RESPONSES methods
988
992
  // ----------------------------------------------------------
@@ -1153,6 +1157,61 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
1153
1157
  }
1154
1158
 
1155
1159
 
1160
+ hasClickedOpenCannedResponses($event) {
1161
+ this.logger.log('[CONVS-DETAIL] - hasClickedOpenCannedResponses ', $event)
1162
+ const elTextArea = this.rowTextArea['el'];
1163
+ const textArea = elTextArea.getElementsByTagName('ion-textarea')[0];
1164
+
1165
+ this.logger.log("[CONVS-DETAIL] replaceTagInMessage textArea ", textArea);
1166
+ this.logger.log("[CONVS-DETAIL] replaceTagInMessage textArea value", textArea.value)
1167
+ this.insertAtCursor(textArea, '/')
1168
+ }
1169
+
1170
+ insertAtCursor(myField, myValue) {
1171
+ this.logger.log('[CANNED-RES-EDIT-CREATE] - insertAtCursor - myValue ', myValue );
1172
+ this.logger.log('[CANNED-RES-EDIT-CREATE] - insertAtCursor - myField ', myField );
1173
+
1174
+ myValue = ' ' + myValue;
1175
+ this.logger.log('[CANNED-RES-EDIT-CREATE] - GET TEXT AREA - QUI ENTRO myValue ', myValue );
1176
+
1177
+
1178
+ //IE support
1179
+ if (myField.selection) {
1180
+ myField.focus();
1181
+ let sel = myField.selection.createRange();
1182
+ sel.text = myValue;
1183
+ // this.cannedResponseMessage = sel.text;
1184
+ }
1185
+ //MOZILLA and others
1186
+ else if (myField.selectionStart || myField.selectionStart == '0') {
1187
+ var startPos = myField.selectionStart;
1188
+ this.logger.log('[CANNED-RES-EDIT-CREATE] - insertAtCursor - startPos ', startPos);
1189
+
1190
+ var endPos = myField.selectionEnd;
1191
+ this.logger.log('[CANNED-RES-EDIT-CREATE] - insertAtCursor - endPos ', endPos);
1192
+
1193
+ myField.value = myField.value.substring(0, startPos) + myValue + myField.value.substring(endPos, myField.value.length);
1194
+
1195
+ // place cursor at end of text in text input element
1196
+ myField.focus();
1197
+ var val = myField.value; //store the value of the element
1198
+ myField.value = ''; //clear the value of the element
1199
+ myField.value = val + ' '; //set that value back.
1200
+
1201
+ // this.cannedResponseMessage = myField.value;
1202
+
1203
+ // this.texareaIsEmpty = false;
1204
+ // myField.select();
1205
+ } else {
1206
+ myField.value += myValue;
1207
+ // this.cannedResponseMessage = myField.value;
1208
+ }
1209
+ }
1210
+
1211
+
1212
+
1213
+
1214
+
1156
1215
  @HostListener('document:keydown', ['$event'])
1157
1216
  handleKeyboardEvent(event: KeyboardEvent) {
1158
1217
  // this.logger.log("CONVERSATION-DETAIL handleKeyboardEvent event.key ", event.key);
@@ -597,7 +597,9 @@ export class ConversationListPage implements OnInit {
597
597
  this.tenant = appconfig.firebaseConfig.tenant;
598
598
  this.logger.log('[CONVS-LIST-PAGE] - initialize -> firebaseConfig tenant ', this.tenant);
599
599
 
600
- this.loggedUserUid = this.tiledeskAuthService.getCurrentUser().uid;
600
+ if (this.tiledeskAuthService.getCurrentUser()) {
601
+ this.loggedUserUid = this.tiledeskAuthService.getCurrentUser().uid;
602
+ }
601
603
  this.subscriptions = [];
602
604
  this.initConversationsHandler();
603
605
  this.initVariables();
@@ -88,7 +88,7 @@ export class WebSocketJs {
88
88
  // this.ws = new WebSocket("wss://tiledesk-server-pre.herokuapp.com/?token=JWT eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOiI1ZGRkMzBiZmYwMTk1ZjAwMTdmNzJjNmQiLCJlbWFpbCI6InByZWdpbm9AZjIxdGVzdC5pdCIsImZpcnN0bmFtZSI6Ikdpbm8iLCJsYXN0bmFtZSI6IlByZSIsImVtYWlsdmVyaWZpZWQiOnRydWUsImlhdCI6MTYwODgwNjY0MCwiYXVkIjoiaHR0cHM6Ly90aWxlZGVzay5jb20iLCJpc3MiOiJodHRwczovL3RpbGVkZXNrLmNvbSIsInN1YiI6InVzZXIiLCJqdGkiOiI1YmVmMDcxYy00ODBlLTQzYzQtOTRhYS05ZjQxYzMyNDcxMGQifQ.wv6uBn2P6H9wGb5WCYQkpPEScMU9PB1pBUzFouhJk20");
89
89
 
90
90
  this.logger.log('[WEBSOCKET-JS] - REF - READY STATE ≠ 1 > OPEN WS AND THEN SUBSCRIBE TO TOPICS');
91
- // this.logger.log('% »»» WebSocketJs WF *** REF *** WS 2 ', this.ws);
91
+ this.logger.log('% »»» WebSocketJs WF *** REF *** WS 2 ', this.ws);
92
92
 
93
93
  var that = this;
94
94
  if (this.ws) {
@@ -96,6 +96,9 @@ export class WebSocketJs {
96
96
  that.logger.log('[WEBSOCKET-JS] - REF - OPEN EVENT *** ', event);
97
97
  that.subscribe(topic);
98
98
  });
99
+ } else {
100
+
101
+
99
102
  }
100
103
 
101
104
  if (this.topics.indexOf(topic) === -1) {
@@ -277,7 +280,7 @@ export class WebSocketJs {
277
280
  // onmessage Ottieni il battito cardiaco restituito per indicare che la connessione è normale
278
281
  if (this.ws && this.ws.readyState == 1) {
279
282
 
280
- // this.logger.log("[WEBSOCKET-JS] - HEART-START - SEND PING-MSG");
283
+ this.logger.log("[WEBSOCKET-JS] - HEART-START - SEND PING-MSG");
281
284
 
282
285
  this.send(JSON.stringify(this.pingMsg), 'HEART-START')
283
286
 
@@ -289,7 +292,7 @@ export class WebSocketJs {
289
292
 
290
293
  // Se non viene ripristinato dopo un determinato periodo di tempo, il backend viene attivamente disconnesso
291
294
  this.pongTimeoutId = setTimeout(() => {
292
- this.logger.log("[WEBSOCKET-JS] - HEART-START - PONG-TIMEOUT-ID - CLOSE WS ");
295
+ this.logger.log("[WEBSOCKET-JS] - HEART-START - PONG-TIMEOUT-ID - CLOSE WS ");
293
296
  // se onclose Si esibirà reconnect,Eseguiamo ws.close() Bene, se lo esegui direttamente reconnect Si innescherà onclose Causa riconnessione due volte
294
297
  this.ws.close();
295
298
  }, this.pongTimeout);
@@ -326,7 +329,7 @@ export class WebSocketJs {
326
329
  // this.sendingMessages = [];//new Map();
327
330
  // this.data = [];
328
331
  // this.init(this.sendMesagesInSendingArray);
329
-
332
+ this.logger.log("[WEBSOCKET-JS] - CALLING INIT - url ", this.url);
330
333
  this.logger.log("[WEBSOCKET-JS] - CALLING INIT - topics ", this.topics);
331
334
  this.logger.log("[WEBSOCKET-JS] - CALLING INIT - url ", this.url);
332
335
  this.logger.log("[WEBSOCKET-JS] - CALLING INIT - callbacks ", this.callbacks);
@@ -35,7 +35,7 @@ export class WebsocketService {
35
35
  subscriptionToWsCurrentProjectUserAvailability(projectid, prjctuserid) {
36
36
  var self = this;
37
37
  const path = '/' + projectid + '/project_users/' + prjctuserid
38
- this.logger.log('[WS-SERV] - SUBSCR (REF) TO WS CURRENT USERS PATH: ', path);
38
+ // console.log('[WS-SERV] - SUBSCR (REF) TO WS CURRENT USERS PATH: ', path);
39
39
 
40
40
  return new Promise(function (resolve, reject) {
41
41
 
@@ -40,9 +40,11 @@ import { OptionHeaderComponent } from '../components/conversation-detail/option-
40
40
  import { MessageAttachmentComponent } from '../chatlib/conversation-detail/message/message-attachment/message-attachment.component';
41
41
  import { ImageViewerComponent } from '../components/image-viewer/image-viewer.component';
42
42
  import { ProjectItemComponent } from '../components/project-item/project-item.component';
43
+ import { MessageTextAreaComponent } from '../components/conversation-detail/message-text-area/message-text-area.component';
43
44
 
44
45
  @NgModule({
45
46
  declarations: [
47
+ MessageTextAreaComponent,
46
48
  AvatarProfileComponent,
47
49
  DdpHeaderComponent,
48
50
  UserPresenceComponent,
@@ -64,8 +66,7 @@ import { ProjectItemComponent } from '../components/project-item/project-item.co
64
66
  InfoMessageComponent,
65
67
  ReturnReceiptComponent,
66
68
  TextComponent,
67
-
68
- BubbleDayMessageComponent,
69
+ BubbleDayMessageComponent,
69
70
  BubbleSystemMessageComponent,
70
71
  BubbleMyMessageComponent,
71
72
  BubbleOthersMessageComponent,
@@ -80,6 +81,7 @@ import { ProjectItemComponent } from '../components/project-item/project-item.co
80
81
  OptionHeaderComponent
81
82
  ],
82
83
  exports: [
84
+ MessageTextAreaComponent,
83
85
  AutofocusDirective,
84
86
  AvatarProfileComponent,
85
87
  DdpHeaderComponent,
@@ -89,7 +91,6 @@ import { ProjectItemComponent } from '../components/project-item/project-item.co
89
91
  UserTypingComponent,
90
92
  ListConversationsComponent,
91
93
  IonListConversationsComponent,
92
-
93
94
  IonConversationDetailComponent,
94
95
  ConversationContentComponent,
95
96
  AvatarComponent,
@@ -102,7 +103,6 @@ import { ProjectItemComponent } from '../components/project-item/project-item.co
102
103
  InfoMessageComponent,
103
104
  ReturnReceiptComponent,
104
105
  TextComponent,
105
-
106
106
  BubbleDayMessageComponent,
107
107
  BubbleSystemMessageComponent,
108
108
  BubbleMyMessageComponent,
@@ -120,7 +120,7 @@ import { ProjectItemComponent } from '../components/project-item/project-item.co
120
120
  IonicModule,
121
121
  MomentModule,
122
122
  TooltipModule
123
-
123
+
124
124
  ],
125
125
  schemas: [
126
126
  CUSTOM_ELEMENTS_SCHEMA,
@@ -187,5 +187,7 @@
187
187
  "Cancel": "Cancel",
188
188
  "AreYouSure":"Are you sure?",
189
189
  "UnassignedConversations":"Unassigned Conversations",
190
- "NewConversations": "Nuove conversazioni"
190
+ "NewConversations": "New conversations",
191
+ "UPLOAD": "Upload",
192
+ "CANNED_RESPONSES":"Canned responses"
191
193
  }
@@ -195,5 +195,7 @@
195
195
  "Cancel": "Annulla",
196
196
  "AreYouSure":"Sei sicuro?",
197
197
  "UnassignedConversations":"Conversazioni non assegnate",
198
- "NewConversations": "New conversations"
198
+ "NewConversations": "Nuove Conversazioni",
199
+ "UPLOAD": "Carica",
200
+ "CANNED_RESPONSES":"Risposte predefinite"
199
201
  }