@chat21/chat21-web-widget 5.0.71 → 5.0.72-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # chat21-web-widget ver 5.0
2
2
 
3
+ ### 5.0.72-rc.1
4
+ - changed: set retain option in mqtt connection as FALSE
5
+
6
+ ### 5.0.71.2 in PROD
7
+ - bug-fixing: widget do not restart conversation in chatbot-panel.html file
8
+
9
+ ### 5.0.71.1 in PROD
10
+ - bug-fixed: WELCOME_TITLE and WELCOME_TITLE not showed if user change them on dashboard widget settings
11
+
3
12
  ### 5.0.71 in PROD
4
13
 
5
14
  ### 5.0.71-rc.13
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.71",
4
+ "version": "5.0.72-rc.1",
5
5
  "license": "MIT",
6
6
  "homepage": "https://www.tiledesk.com",
7
7
  "repository": {
@@ -1,5 +1,4 @@
1
1
  import { ScriptService } from './../chat21-core/providers/scripts/script.service';
2
- import { TYPE_DIRECT } from './../chat21-core/utils/constants';
3
2
  /** ANGULAR MODULES */
4
3
  import { AfterViewInit, Component, ElementRef, HostListener, NgZone, OnDestroy, OnInit, ViewChild, ViewEncapsulation } from '@angular/core';
5
4
  import { environment } from 'src/environments/environment';
@@ -38,7 +37,7 @@ import { TranslatorService } from './providers/translator.service';
38
37
  // UTILS
39
38
  import * as dayjs from 'dayjs';
40
39
  import { MessageModel } from 'src/chat21-core/models/message';
41
- import { AUTH_STATE_OFFLINE, AUTH_STATE_ONLINE, TYPE_MSG_FILE, TYPE_MSG_IMAGE, URL_SOUND_LIST_CONVERSATION } from 'src/chat21-core/utils/constants';
40
+ import { AUTH_STATE_OFFLINE, AUTH_STATE_ONLINE, CHANNEL_TYPE, TYPE_MSG_FILE, TYPE_MSG_IMAGE, URL_SOUND_LIST_CONVERSATION } from 'src/chat21-core/utils/constants';
42
41
  import { supports_html5_storage } from 'src/chat21-core/utils/utils';
43
42
  import { UID_SUPPORT_GROUP_MESSAGES } from './utils/constants';
44
43
  import { Globals } from './utils/globals';
@@ -1696,7 +1695,7 @@ export class AppComponent implements OnInit, AfterViewInit, OnDestroy {
1696
1695
  this._f21_open()
1697
1696
  }
1698
1697
  // this.conversationSelected = $event;
1699
- if($event.channel_type === TYPE_DIRECT){
1698
+ if($event.channel_type === CHANNEL_TYPE.DIRECT){
1700
1699
  this.g.setParameter('recipientId', $event.sender);
1701
1700
  this.appStorageService.setItem('recipientId', $event.sender)
1702
1701
  }else {
@@ -6,18 +6,18 @@ import { ConversationFooterComponent } from './../conversation-footer/conversati
6
6
  // tslint:disable-next-line:max-line-length
7
7
  import { AfterViewInit, ChangeDetectorRef, Component, ElementRef, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges, ViewChild } from '@angular/core';
8
8
 
9
- import {
10
- CHANNEL_TYPE_DIRECT, CHANNEL_TYPE_GROUP, TYPE_MSG_TEXT,
11
- UID_SUPPORT_GROUP_MESSAGES
12
- } from 'src/app/utils/constants';
13
9
 
14
- // models
15
10
 
11
+ // models
16
12
  import { MessageModel } from 'src/chat21-core/models/message';
13
+ import { ConversationModel } from 'src/chat21-core/models/conversation';
17
14
 
18
15
  // utils
19
16
  import { v4 as uuidv4 } from 'uuid';
20
-
17
+ import { UID_SUPPORT_GROUP_MESSAGES } from 'src/app/utils/constants';
18
+ import { CHANNEL_TYPE, INFO_MESSAGE_TYPE, TYPE_MSG_TEXT } from 'src/chat21-core/utils/constants';
19
+ import { getDateDifference } from 'src/chat21-core/utils/utils';
20
+ import { isJustRecived, isUserBanned } from 'src/chat21-core/utils/utils-message';
21
21
 
22
22
  // Import the resized event model
23
23
 
@@ -28,7 +28,6 @@ import { takeUntil } from 'rxjs/operators';
28
28
  import { AppConfigService } from 'src/app/providers/app-config.service';
29
29
  import { StarRatingWidgetService } from 'src/app/providers/star-rating-widget.service';
30
30
  import { Globals } from 'src/app/utils/globals';
31
- import { ConversationModel } from 'src/chat21-core/models/conversation';
32
31
  import { AppStorageService } from 'src/chat21-core/providers/abstract/app-storage.service';
33
32
  import { ArchivedConversationsHandlerService } from 'src/chat21-core/providers/abstract/archivedconversations-handler.service';
34
33
  import { ConversationHandlerBuilderService } from 'src/chat21-core/providers/abstract/conversation-handler-builder.service';
@@ -39,9 +38,6 @@ import { TypingService } from 'src/chat21-core/providers/abstract/typing.service
39
38
  import { CustomTranslateService } from 'src/chat21-core/providers/custom-translate.service';
40
39
  import { LoggerInstance } from 'src/chat21-core/providers/logger/loggerInstance';
41
40
  import { TiledeskRequestsService } from 'src/chat21-core/providers/tiledesk/tiledesk-requests.service';
42
- import { INFO_MESSAGE_TYPE } from 'src/chat21-core/utils/constants';
43
- import { getDateDifference } from 'src/chat21-core/utils/utils';
44
- import { isJustRecived, isUserBanned } from 'src/chat21-core/utils/utils-message';
45
41
  import { ConversationContentComponent } from '../conversation-content/conversation-content.component';
46
42
  // import { TranslateService } from '@ngx-translate/core';
47
43
 
@@ -524,12 +520,12 @@ export class ConversationComponent implements OnInit, AfterViewInit, OnChanges {
524
520
  *
525
521
  */
526
522
  private setChannelType() {
527
- let channelTypeTEMP = CHANNEL_TYPE_GROUP;
523
+ let channelTypeTEMP = CHANNEL_TYPE.GROUP;
528
524
  const projectid = this.g.projectid;
529
525
  if (this.g.recipientId && this.g.recipientId.indexOf('group') !== -1) {
530
- channelTypeTEMP = CHANNEL_TYPE_GROUP;
526
+ channelTypeTEMP = CHANNEL_TYPE.GROUP;
531
527
  } else if (!projectid) {
532
- channelTypeTEMP = CHANNEL_TYPE_DIRECT;
528
+ channelTypeTEMP = CHANNEL_TYPE.DIRECT;
533
529
  }
534
530
  return channelTypeTEMP;
535
531
  }
@@ -1,7 +1,7 @@
1
1
  import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
2
2
 
3
3
  // models
4
- import { MessageModel } from '../../../models/message';
4
+ import { MessageModel } from 'src/chat21-core/models/message';
5
5
 
6
6
  @Component({
7
7
  selector: 'chat-message-attachment',
@@ -234,6 +234,10 @@ export class TranslatorService {
234
234
  'BUTTON_EDIT_PROFILE',
235
235
  'DOWNLOAD_TRANSCRIPT',
236
236
  'RATE_CHAT',
237
+ 'WELLCOME',
238
+ 'WELLCOME_TITLE',
239
+ 'WELLCOME_MSG',
240
+ 'WELCOME',
237
241
  'WELCOME_TITLE',
238
242
  'WELCOME_MSG',
239
243
  'OPTIONS',
@@ -286,8 +290,9 @@ export class TranslatorService {
286
290
  globals.BUTTON_EDIT_PROFILE = res['BUTTON_EDIT_PROFILE']; // is used ??
287
291
  globals.DOWNLOAD_TRANSCRIPT = res['DOWNLOAD_TRANSCRIPT'];
288
292
  globals.RATE_CHAT = res['RATE_CHAT']; // is used ??
289
- globals.WELCOME_TITLE = res['WELCOME_TITLE'];
290
- globals.WELCOME_MSG = res['WELCOME_MSG'];
293
+ globals.WELCOME = res['WELLCOME'];
294
+ globals.WELCOME_TITLE = res['WELLCOME_TITLE'];
295
+ globals.WELCOME_MSG = res['WELLCOME_MSG'];
291
296
  globals.OPTIONS = res['OPTIONS'];
292
297
  globals.SOUND_ON = res['SOUND_ON'];
293
298
  globals.SOUND_OFF = res['SOUND_OFF'];
@@ -29,10 +29,6 @@ export const TYPE_MSG_IMAGE = 'image';
29
29
  export const TYPE_MSG_FILE = 'file';
30
30
  export const TYPE_MSG_BUTTON = 'button';
31
31
 
32
- // CHANNEL TYPE
33
- export const CHANNEL_TYPE_GROUP = 'group';
34
- export const CHANNEL_TYPE_DIRECT = 'direct';
35
-
36
32
  // NODE MESSAGES
37
33
  export const UID_SUPPORT_GROUP_MESSAGES = 'support-group-';
38
34
 
@@ -4,7 +4,7 @@ import { BehaviorSubject } from 'rxjs';
4
4
  import { environment } from '../../environments/environment';
5
5
 
6
6
  /** CONSTANTS */
7
- import { CHANNEL_TYPE_GROUP } from 'src/chat21-core/utils/constants';
7
+ import { CHANNEL_TYPE } from 'src/chat21-core/utils/constants';
8
8
 
9
9
  /** MODELS */
10
10
  import { DepartmentModel } from 'src/models/department';
@@ -427,9 +427,9 @@ export class Globals {
427
427
  /** Set the widget title label shown in the widget header. Value type : string.
428
428
  The default value is Tiledesk. */
429
429
  /** name tenant ex: tilechat */
430
- this.channelType = CHANNEL_TYPE_GROUP;
431
- // this.parameters['channelType'] = CHANNEL_TYPE_GROUP;
432
- // this.parameters.push({'channelType': CHANNEL_TYPE_GROUP});
430
+ this.channelType = CHANNEL_TYPE.GROUP;
431
+ // this.parameters['channelType'] = CHANNEL_TYPE.GROUP;
432
+ // this.parameters.push({'channelType': CHANNEL_TYPE.GROUP});
433
433
  /** channelType: group/direct */
434
434
  this.default_settings = {};
435
435
  // this.parameters.push({'default_settings': '' });
@@ -986,7 +986,7 @@ class Chat21Client {
986
986
  topic: this.presence_topic,
987
987
  payload: '{"disconnected":true}',
988
988
  qos: 1,
989
- retain: true
989
+ retain: false
990
990
  },
991
991
  clientId: this.client_id,
992
992
  username: 'JWT',
@@ -462,10 +462,11 @@
462
462
  marginY: "50px",
463
463
  // calloutTimer: 1,
464
464
  singleConversation: true,
465
- restartConversation: false,
465
+ restartConversation: true,
466
466
  hideHeaderCloseButton: true,
467
467
  hideCloseConversationOptionMenu: true,
468
- isLogEnabled:true
468
+ isLogEnabled:true,
469
+ customAttributes: { sound: false }
469
470
  // autostart: false
470
471
 
471
472
  };
@@ -336,7 +336,7 @@ export class FirebaseArchivedConversationsHandler extends ArchivedConversationsH
336
336
  conversation_with_fullname = conv.recipient_fullname;
337
337
  conv.sender_fullname = this.translationMap.get('YOU')
338
338
  // conv.last_message_text = YOU + conv.last_message_text;
339
- // } else if (conv.channel_type === TYPE_GROUP) {
339
+ // } else if (conv.channel_type === CHANNEL_TYPE.GROUP) {
340
340
  } else if (isGroup(conv)) {
341
341
  // conversation_with_fullname = conv.sender_fullname;
342
342
  // conv.last_message_text = conv.last_message_text;
@@ -36,14 +36,17 @@ export const PARENT_PAGE_DETAIL_CONVERSATION = 'dettaglio-conversazione ';
36
36
  export const BCK_COLOR_CONVERSATION_SELECTED = '#EEEEEE ';
37
37
  export const BCK_COLOR_CONVERSATION_UNSELECTED = '#FFFFFF ';
38
38
 
39
- export const TYPE_SUPPORT_GROUP = 'support-group';
40
- export const CHANNEL_TYPE_GROUP = 'group';
41
- export const CHANNEL_TYPE_CHAT21 = 'chat21';
42
- export const CHANNEL_TYPE_EMAIL = 'email';
43
- export const CHANNEL_TYPE_FORM = 'form';
44
- export const CHANNEL_TYPE_MESSANGER = 'messanger';
45
- export const CHANNEL_TYPE_WHATSAPP = 'whatsapp';
46
- export const CHANNEL_TYPE_TELEGRAM = 'telegram';
39
+ export enum CHANNEL_TYPE {
40
+ SUPPORT_GROUP = 'support-group',
41
+ GROUP = 'group',
42
+ DIRECT = 'direct',
43
+ CHAT21 = 'chat21',
44
+ EMAIL = 'email',
45
+ FORM = 'form',
46
+ MESSENGER = 'messenger',
47
+ WHATSAPP = 'whatsapp',
48
+ TELEGRAM = 'telegram'
49
+ }
47
50
 
48
51
  // TYPES MESSAGES
49
52
  export const TYPE_MSG_TEXT = 'text';
@@ -75,7 +78,8 @@ export enum INFO_MESSAGE_TYPE {
75
78
  MEMBER_LEFT_GROUP = "MEMBER_LEFT_GROUP",
76
79
  LEAD_UPDATED = "LEAD_UPDATED",
77
80
  TOUCHING_OPERATOR = "TOUCHING_OPERATOR",
78
- LIVE_PAGE = "LIVE_PAGE"
81
+ LIVE_PAGE = "LIVE_PAGE",
82
+ PLAN_EXPIRED = "PLAN_EXPIRED"
79
83
  }
80
84
 
81
85
  // URLS
@@ -2,15 +2,13 @@ import { MessageModel } from './../models/message';
2
2
  import { ConversationModel } from './../models/conversation';
3
3
  import { v4 as uuidv4 } from 'uuid';
4
4
  import {
5
- MESSAGE_TYPE_INFO,
6
- MESSAGE_TYPE_MINE,
7
- MESSAGE_TYPE_OTHERS,
8
- MAX_WIDTH_IMAGES,
9
- CHANNEL_TYPE_GROUP,
10
- TYPE_SUPPORT_GROUP,
11
- INFO_MESSAGE_TYPE
12
- } from './constants';
13
-
5
+ MESSAGE_TYPE_INFO,
6
+ MESSAGE_TYPE_MINE,
7
+ MESSAGE_TYPE_OTHERS,
8
+ MAX_WIDTH_IMAGES,
9
+ INFO_MESSAGE_TYPE,
10
+ CHANNEL_TYPE
11
+ } from '../../chat21-core/utils/constants';
14
12
  /** */
15
13
  export function isCarousel(message: any) {
16
14
  if (message && message.type && message.type === 'gallery' && message?.attributes && message?.attributes?.attachment && message?.attributes?.attachment?.gallery ) {
@@ -169,9 +167,9 @@ export function getSizeImg(message: any, maxWidthImage?: number): any {
169
167
 
170
168
  /** */
171
169
  export function isChannelTypeGroup(channelType: string) {
172
- if (channelType === CHANNEL_TYPE_GROUP || channelType === TYPE_SUPPORT_GROUP) {
173
- return true;
174
- }
170
+ if (channelType === CHANNEL_TYPE.GROUP || channelType === CHANNEL_TYPE.SUPPORT_GROUP) {
171
+ return true;
172
+ }
175
173
  return false;
176
174
  }
177
175
 
@@ -1,21 +0,0 @@
1
- // firebase
2
- export class MessageModel {
3
- public sender_urlImage: string;
4
- constructor(
5
- public uid: string,
6
- public language: string,
7
- public recipient: string,
8
- public recipient_fullname: string,
9
- public sender: string,
10
- public sender_fullname: string,
11
- public status: string,
12
- public metadata: any,
13
- public text: any,
14
- public timestamp: any,
15
- public type: string,
16
- public attributes: any,
17
- public channel_type: string,
18
- public projectid: string,
19
- public emoticon?: boolean
20
- ) { }
21
- }