@chat21/chat21-web-widget 5.0.64 → 5.0.65-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # chat21-web-widget ver 5.0
2
2
 
3
+ ### 5.0.65-rc.1
4
+ - added: disconnectTime tiledesk property to manage the time before disconnecting from messaging system if no interaction is fired while the widget is in closed status
5
+ - bug-fixed: numbered list reduce the font-size of the bubble-message
6
+ - bug-fixed: init() method of conversationHandler.service is not called after a refresh page
7
+
3
8
  ### 5.0.64 in PROD
4
9
  - removed: LWT e imHere() for presence management
5
10
  - removed: tooltip lib
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.64",
4
+ "version": "5.0.65-rc.1",
5
5
  "license": "MIT",
6
6
  "homepage": "https://www.tiledesk.com",
7
7
  "repository": {
@@ -409,7 +409,7 @@ export class AppComponent implements OnInit, AfterViewInit, OnDestroy {
409
409
  }
410
410
 
411
411
  //if widget is closed subscribe to 'click' event and set a 60sec timer to disconnect if handler isn't fired
412
- if(!this.g.isOpen){
412
+ if(!this.g.isOpen && this.g.disconnetTime > 0){
413
413
  that.listenToWidgetClick()
414
414
  }
415
415
 
@@ -2100,7 +2100,7 @@ export class AppComponent implements OnInit, AfterViewInit, OnDestroy {
2100
2100
  //disconnect
2101
2101
  this.forceDisconnect = true
2102
2102
  this.messagingAuthService.logout()
2103
- }, 60*1000);
2103
+ }, this.g.disconnetTime * 1000);
2104
2104
  window.addEventListener("click", function(){
2105
2105
  console.log('[FORCE] <<INTERACTION>> within 1 minute')
2106
2106
  clearTimeout(clickTimeout)
@@ -35,4 +35,16 @@ p ::ng-deep a {
35
35
  p ::ng-deep p{
36
36
  margin-block-end: 0em;
37
37
  margin-block-start: 0em
38
+ }
39
+
40
+ p ::ng-deep ol{
41
+ margin-block-end: 0em;
42
+ margin-block-start: 0em;
43
+ padding-inline-start: 15px;
44
+
45
+ li:before {
46
+ content:"";
47
+ font-size: 1.4em;
48
+ vertical-align:middle;
49
+ }
38
50
  }
@@ -1018,7 +1018,12 @@ export class GlobalSettingsService {
1018
1018
  // this.logger.debug('[GLOBAL-SET] setVariablesFromSettings > telegramUsername:: ', TEMP]);
1019
1019
  if (TEMP !== undefined) {
1020
1020
  globals.fileUploadAccept = TEMP;
1021
- }
1021
+ }
1022
+ TEMP = tiledeskSettings['disconnetTime'];
1023
+ // this.logger.debug('[GLOBAL-SET] setVariablesFromSettings > disconnetTime:: ', TEMP]);
1024
+ if (TEMP !== undefined) {
1025
+ globals.disconnetTime = +TEMP;
1026
+ }
1022
1027
  }
1023
1028
 
1024
1029
  /**
@@ -1285,6 +1290,11 @@ export class GlobalSettingsService {
1285
1290
  if (TEMP !== null) {
1286
1291
  this.globals.fileUploadAccept = TEMP;
1287
1292
  }
1293
+ TEMP = el.nativeElement.getAttribute('disconnetTime');
1294
+ if (TEMP !== null) {
1295
+ this.globals.disconnetTime = +TEMP;
1296
+ }
1297
+
1288
1298
 
1289
1299
  }
1290
1300
 
@@ -1727,6 +1737,12 @@ export class GlobalSettingsService {
1727
1737
  if (TEMP) {
1728
1738
  globals.fileUploadAccept = TEMP;
1729
1739
  }
1740
+
1741
+ TEMP = getParameterByName(windowContext, 'tiledesk_disconnetTime');
1742
+ if (TEMP) {
1743
+ globals.disconnetTime = +TEMP;
1744
+ }
1745
+
1730
1746
  }
1731
1747
 
1732
1748
  /**
@@ -212,6 +212,7 @@ export class Globals {
212
212
  messangerPageTitle: string; // ******* new ********
213
213
  telegramUsername: string; // ******* new ********
214
214
  fileUploadAccept: string; // ******* new ********
215
+ disconnetTime: number; // ******* new ********
215
216
  constructor(
216
217
  ) { }
217
218
 
@@ -387,6 +388,8 @@ export class Globals {
387
388
  this.telegramUsername = ''
388
389
  /**enable user to set a telegram number to chat with */
389
390
  this.fileUploadAccept = "image/*,.pdf,.txt"
391
+ /**enable auto disconnect from messaging after a defined amount of time (s)*/
392
+ this.disconnetTime = 10
390
393
 
391
394
  this.showWaitTime = true;
392
395
 
@@ -708,6 +708,19 @@
708
708
  }
709
709
  return true;
710
710
  }
711
+
712
+ function onClickDisconnectTime(){
713
+ let status = document.querySelector('input[name="disconnetTime"]:checked');
714
+ let value;
715
+ status? value = status.value : '';
716
+ if(!value){
717
+ value = document.getElementById('disconnetTimeText').value;
718
+ }
719
+ !value? value = -1 : '';
720
+ window.tiledeskSettings['disconnetTime'] = +value
721
+ console.log('onClickDisconnectTime: status-->',window.tiledeskSettings);
722
+ window.Tiledesk('restart')
723
+ }
711
724
 
712
725
  function onClickStartFromHome(){
713
726
  let status = document.querySelector('input[name="startFromHome"]:checked').value
@@ -1627,6 +1640,19 @@
1627
1640
  <div class="row section c21-parameters">
1628
1641
  <div><h3 style="line-height: 0.3;">MANAGE <em><strong>widget settings</strong></em></h3></div>
1629
1642
  <div>Select an option for Tiledesk settings parameter</div>
1643
+ <div class="row">
1644
+ <div class="col-md-5 formElement"><span><em><strong>disconnectTime</strong></em></span></div>
1645
+ <div class="col-md-5">
1646
+ <input class="form-check-input" type="radio" name="disconnectTime" value="-1"><label class="form-check-label" for="preChatForm">-1(disabled)</label>
1647
+ <div class="formElement" >
1648
+ <div class="col-form-label" style="width: 90px">Time (s):</div>
1649
+ <input class="form-control col-sm-2" type="text" id="disconnectTimeText" name="disconnectTime" placeholder="Ex. 10">
1650
+ </div>
1651
+ </div>
1652
+ <div class="col-md-2">
1653
+ <button class="btn btn-light" onclick="onClickDisconnectTime()">Test this setting <i class="fa fa-magic" aria-hidden="true"></i></button>
1654
+ </div>
1655
+ </div>
1630
1656
  <div class="row">
1631
1657
  <div class="col-md-5 formElement"><span><em><strong>startFromHome</strong></em></span></div>
1632
1658
  <div class="col-md-5">
@@ -1,3 +1,4 @@
1
+ import { async } from '@angular/core/testing';
1
2
  import { LIVE_PAGE, TOUCHING_OPERATOR } from './../../utils/constants';
2
3
  import { Inject, Injectable } from '@angular/core';
3
4
  import { BehaviorSubject } from 'rxjs';
@@ -85,6 +86,7 @@ export class MQTTConversationHandler extends ConversationHandlerService {
85
86
  this.messages = [];
86
87
  this.showInfoMessage = showInfoMessage;
87
88
  // this.attributes = this.setAttributes();
89
+ return;
88
90
  }
89
91
 
90
92
  /**
@@ -103,9 +105,9 @@ export class MQTTConversationHandler extends ConversationHandlerService {
103
105
  if (!err) {
104
106
  this.logger.log('[MQTTConversationHandlerSERVICE] message lastMessages:', messages);
105
107
  messages.sort(compareValues('timestamp', 'asc'));
106
- messages.forEach((message) => {
108
+ messages.forEach(async (message) => {
107
109
  // this.addedMessage(msg);
108
- const msg: MessageModel = message;
110
+ const msg: MessageModel = message;
109
111
  msg.uid = message.message_id;
110
112
 
111
113
  //escape command message is already in list checking by parendUid
@@ -113,7 +115,7 @@ export class MQTTConversationHandler extends ConversationHandlerService {
113
115
  return;
114
116
  }
115
117
 
116
- if (msg.attributes && msg.attributes.commands ) {
118
+ if (msg.attributes && msg.attributes.commands && msg.attributes.commands.lenght > 0 ) {
117
119
  this.logger.debug('[MQTTConversationHandlerSERVICE] splitted message::::', this.messages, msg)
118
120
  this.addCommandMessage(msg)
119
121
  } else {
@@ -141,7 +143,7 @@ export class MQTTConversationHandler extends ConversationHandlerService {
141
143
  // return;
142
144
  // }
143
145
 
144
- if (msg.attributes && msg.attributes.commands) {
146
+ if (msg.attributes && msg.attributes.commands && msg.attributes.commands.lenght > 0) {
145
147
  this.logger.debug('[MQTTConversationHandlerSERVICE] splitted message::::', msg)
146
148
  this.addCommandMessage(msg)
147
149
  } else {