@chat21/chat21-web-widget 5.0.52-rc.1 → 5.0.52-rc.3

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/dist/test.html CHANGED
@@ -5,7 +5,7 @@
5
5
  <meta charset="UTF-8">
6
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
7
  <title>Widget Test Page</title>
8
- <script type="application/javascript">
8
+ <script type="application/javascript" async>
9
9
  // Handler for .ready() called.
10
10
  window.tiledeskSettings =
11
11
  {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@chat21/chat21-web-widget",
3
3
  "author": "Tiledesk SRL",
4
- "version": "5.0.52-rc.1",
4
+ "version": "5.0.52-rc.3",
5
5
  "license": "MIT License",
6
6
  "homepage": "https://www.tiledesk.com",
7
7
  "repository": {
@@ -21,6 +21,7 @@
21
21
  [stylesMap]="stylesMap"
22
22
  [translationMap]="translationMapHeader"
23
23
  [widgetTitle]="g?.project?.widgetTitle"
24
+ [build_version]="g?.singleConversation? g?.BUILD_VERSION: null"
24
25
  [windowContext]="g?.windowContext"
25
26
  [isMenuShow]="isMenuShow"
26
27
  [isTypings]="isTypings"
@@ -139,6 +139,18 @@
139
139
  <span class="label-menu-item">{{ translationMap?.get('LOGOUT') }}</span>
140
140
  </div>
141
141
 
142
+ <!-- BUILD VERSION -->
143
+ <div class="c21-button build_version_menu" *ngIf="build_version">
144
+ <!-- <svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" class="icon-menu">
145
+ <path d="M0 0h24v24H0z" fill="none"/>
146
+ <path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"/>
147
+ <title id="altIconTitle">{{g.LOGOUT}}</title>
148
+ </svg> -->
149
+ <span class="label-menu-item">{{build_version}}</span>
150
+ </div>
151
+
152
+
153
+
142
154
  <!-- ICON EDIT PROFILE -->
143
155
  <!-- <div class="c21-header-button c21-right" *ngIf="messages && messages.length > 1">
144
156
  <svg role="img" aria-labelledby="altIconTitle" [ngStyle]="{'fill': g.themeForegroundColor }" xmlns="http://www.w3.org/2000/svg" width="24px" height="24px" viewBox="0 0 24 24">
@@ -130,5 +130,16 @@
130
130
  stroke: $icon-fill-color;
131
131
  }
132
132
 
133
+ .build_version_menu {
134
+ color: $gray;
135
+ justify-content: center;
136
+ font-size: 0.8em;
137
+ }
138
+
139
+ .build_version_menu:hover {
140
+ cursor: default;
141
+ background-color: unset;
142
+ }
143
+
133
144
 
134
145
  }
@@ -31,6 +31,7 @@ export class ConversationHeaderComponent implements OnInit, OnChanges {
31
31
  @Input() stylesMap: Map<string, string>
32
32
  @Input() translationMap: Map< string, string>;
33
33
  @Input() widgetTitle: string;
34
+ @Input() build_version: string;
34
35
  @Output() onBack = new EventEmitter();
35
36
  @Output() onCloseWidget = new EventEmitter();
36
37
  @Output() onSoundChange = new EventEmitter();
@@ -262,6 +262,7 @@
262
262
  calloutTimer: 1,
263
263
  singleConversation: true,
264
264
  restartConversation: true,
265
+ isLogEnabled: true,
265
266
  hideCloseConversationOptionMenu: true
266
267
  // autostart: false
267
268
 
@@ -419,29 +420,6 @@
419
420
  // console.log('tiledesk_projectid: ', tiledesk_projectid);
420
421
  // console.log('project_name: ', project_name);
421
422
 
422
- window.onload = function() {
423
- document.getElementById("project_id").innerHTML = '"' + tiledesk_projectid + '"';
424
- // document.getElementById("project_name").innerHTML = project_name;
425
-
426
- if(role !== 'agent'){
427
- document.getElementById("testPageButton").style.display = 'block'
428
- }
429
- }
430
-
431
- // window.tileDeskAsyncInit = function() {
432
- // window.tiledesk.on('onLoadParams', function(event_data) {
433
- // // console.log('onLoadParams: ')
434
- // window.tiledesk.open();
435
- // });
436
-
437
- // window.tiledesk.on('onInit', function(event_data) {
438
- // setTimeout(() => {
439
- // document.getElementById("preloader").style.display = "none";
440
- // }, 1000);
441
-
442
- // });
443
- // };
444
-
445
423
  function getQueryVariable(variable) {
446
424
  var query = window.location.search.substring(1);
447
425
  var vars = query.split("&");
@@ -460,11 +460,11 @@
460
460
  document.getElementById('events').scrollTop = document.getElementById('events').scrollHeight
461
461
  }, 1000);
462
462
  //open widget after 3s if is closed
463
- setTimeout(() => {
464
- if(event_data && event_data.detail && event_data.detail.global && !event_data.detail.global.isOpen){
465
- window.Tiledesk('open')
466
- }
467
- }, 3000);
463
+ // setTimeout(() => {
464
+ // if(event_data && event_data.detail && event_data.detail.global && !event_data.detail.global.isOpen){
465
+ // window.Tiledesk('open')
466
+ // }
467
+ // }, 3000);
468
468
  });
469
469
 
470
470
  window.Tiledesk('onAuthStateChanged', function(event_data) {
@@ -186,7 +186,6 @@ export class MQTTArchivedConversationsHandler extends ArchivedConversationsHandl
186
186
  this.setClosingConversation(conversation.conversation_with, false);
187
187
  this.logger.debug('[MQTTArchivedConversationsHandler] conversations:', conversation.uid, this.archivedConversations);
188
188
  const index = this.searchIndexInArrayForConversationWith(this.archivedConversations, conversation.conversation_with);
189
- console.log("NUOVA CONVER;.uid2" + conversation.uid)
190
189
  if (index > -1) {
191
190
  this.logger.debug('[MQTTArchivedConversationsHandler] TROVATO')
192
191
  this.archivedConversations.splice(index, 1, conversation);
@@ -106,6 +106,12 @@ export class MQTTConversationHandler extends ConversationHandlerService {
106
106
  // this.addedMessage(msg);
107
107
  const msg: MessageModel = message;
108
108
  msg.uid = message.message_id;
109
+
110
+ //escape command message is already is in list checking by parendUid
111
+ if(this.messages.filter(message => message.attributes['parentUid'] === msg.uid).length > 0){
112
+ return;
113
+ }
114
+
109
115
  if (msg.attributes && msg.attributes.commands ) {
110
116
  this.logger.debug('[MQTTConversationHandlerSERVICE] splitted message::::', this.messages)
111
117
  this.addCommandMessage(msg)
@@ -124,7 +130,7 @@ export class MQTTConversationHandler extends ConversationHandlerService {
124
130
  msg.uid = message.message_id;
125
131
 
126
132
  //escape command message is already is in list checking by parendUid
127
- if(this.messages.filter(message=> message.attributes['parentUid'] === msg.uid).length > 0){
133
+ if(this.messages.filter(message => message.attributes['parentUid'] === msg.uid).length > 0){
128
134
  return;
129
135
  }
130
136
 
@@ -231,7 +237,6 @@ export class MQTTConversationHandler extends ConversationHandlerService {
231
237
  /** */
232
238
  private addedMessage(messageSnapshot: MessageModel) {
233
239
  const msg = this.messageGenerate(messageSnapshot);
234
- console.log('messageeee', msg)
235
240
  let isInfoMessage = messageType(MESSAGE_TYPE_INFO, msg)
236
241
  if(isInfoMessage){
237
242
  this.messageInfo.next(msg)
@@ -192,7 +192,7 @@ export class MQTTConversationsHandler extends ConversationsHandlerService {
192
192
 
193
193
  getLastConversation(callback: (conv: ConversationModel, error: string) => void): void {
194
194
  this.chat21Service.chatClient.lastConversations( false, (err, conversations) => {
195
- console.log('Last conversations', conversations, 'err', err);
195
+ this.logger.debug('[MQTTConversationsHandler] getLastConversation ', conversations, 'err', err);
196
196
  if (!err) {
197
197
  if(conversations && conversations.length > 0){
198
198
  callback(conversations[0], null)
@@ -224,7 +224,6 @@ export class MQTTConversationsHandler extends ConversationsHandlerService {
224
224
  this.setClosingConversation(conversation.conversation_with, false);
225
225
  this.logger.debug('[MQTTConversationsHandler] conversations:', conversation.uid, this.conversations);
226
226
  const index = this.searchIndexInArrayForConversationWith(this.conversations, conversation.conversation_with);
227
- console.log("NUOVA CONVER;.uid2" + conversation.uid)
228
227
  if (index > -1) {
229
228
  this.logger.debug('[MQTTConversationsHandler] TROVATO')
230
229
  this.conversations.splice(index, 1, conversation);
package/src/test.html CHANGED
@@ -5,7 +5,7 @@
5
5
  <meta charset="UTF-8">
6
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
7
  <title>Widget Test Page</title>
8
- <script type="application/javascript">
8
+ <script type="application/javascript" async>
9
9
  // Handler for .ready() called.
10
10
  window.tiledeskSettings =
11
11
  {