@chat21/chat21-ionic 3.4.2 → 3.4.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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # chat21-ionic ver 3.0
2
2
 
3
+ ### 3.4.3 in PROD
4
+
5
+ ### 3.4.3-rc.1
6
+ - added: encodeUri for project name on chatbot share link
7
+ - added: offlineMsgEmail project email to emable/disable automatic offline msg email
8
+
3
9
  ### 3.4.2 in PROD
4
10
  - added: chat21client v0.1.12.8
5
11
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@chat21/chat21-ionic",
3
3
  "author": "Tiledesk SRL",
4
- "version": "3.4.2",
4
+ "version": "3.4.3",
5
5
  "license": "MIT License",
6
6
  "homepage": "https://tiledesk.com/",
7
7
  "repository": {
@@ -22,7 +22,7 @@
22
22
  </ion-button>
23
23
  </div>
24
24
 
25
- <div *ngIf="section==='chat' && channel !== CHANNEL_TYPE.WHATSAPP && messageString && (leadInfo?.presence['status']==='offline' && leadInfo?.hasEmail)" class="section-option offline-lead-tip" >
25
+ <div *ngIf="offlineMsgEmail && section==='chat' && channel !== CHANNEL_TYPE.WHATSAPP && messageString && (leadInfo?.presence['status']==='offline' && leadInfo?.hasEmail)" class="section-option offline-lead-tip" >
26
26
  {{translationMap.get('EMAIL.EMAIL_OFFLINE_TIP')}}
27
27
  </div>
28
28
 
@@ -54,6 +54,7 @@ export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChange
54
54
  @Input() leadInfo: {lead_id: string, hasEmail: boolean, email: string, projectId: string, presence: {}};
55
55
  @Input() fileUploadAccept: string;
56
56
  @Input() emailSection: boolean;
57
+ @Input() offlineMsgEmail: boolean;
57
58
  @Input() whatsappTemplatesSection: boolean;
58
59
  @Input() isOpenInfoConversation: boolean;
59
60
  @Input() stylesMap: Map<string, string>;
@@ -159,7 +159,7 @@ export class NavbarComponent implements OnInit {
159
159
  const simulateVisitorBtnElem = <HTMLElement>document.querySelector('.simulate-visitor-btn');
160
160
  simulateVisitorBtnElem.blur();
161
161
  // + '&isOpen=true'
162
- const url = this.appConfigProvider.getConfig().widgetBaseUrl + 'assets/twp/index.html?tiledesk_projectid=' + this.project.id_project.id + '&project_name=' + this.project.id_project.name + '&role=' + this.USER_ROLE
162
+ const url = this.appConfigProvider.getConfig().widgetBaseUrl + 'assets/twp/index.html?tiledesk_projectid=' + this.project.id_project.id + '&project_name=' + encodeURIComponent(this.project.id_project.name) + '&role=' + this.USER_ROLE
163
163
  window.open(url, '_blank');
164
164
  }
165
165
 
@@ -236,6 +236,7 @@
236
236
  [leadInfo]="leadInfo"
237
237
  [fileUploadAccept]="appConfigProvider.getConfig().fileUploadAccept"
238
238
  [emailSection]="isEmailEnabled"
239
+ [offlineMsgEmail]="offlineMsgEmail"
239
240
  [whatsappTemplatesSection]="isWhatsappTemplatesEnabled"
240
241
  [isOpenInfoConversation]="openInfoConversation"
241
242
  [stylesMap]="styleMap"
@@ -160,6 +160,7 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
160
160
  areVisibleCAR: boolean;
161
161
  supportMode: boolean;
162
162
  isEmailEnabled: boolean;
163
+ offlineMsgEmail: boolean;
163
164
  isWhatsappTemplatesEnabled: boolean;
164
165
  //SOUND
165
166
  setTimeoutSound: any;
@@ -556,6 +557,7 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
556
557
  if (project) {
557
558
  const projectId = project.id_project
558
559
  this.canShowCanned = this.checkPlanIsExpired(project)
560
+ this.offlineMsgEmail = this.checkOfflineMsgEmailIsEnabled(project)
559
561
  }
560
562
  }, (error) => {
561
563
  this.logger.error('[CONVS-DETAIL] - GET PROJECTID BY CONV RECIPIENT - ERROR ', error)
@@ -588,6 +590,23 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
588
590
  return check
589
591
  }
590
592
 
593
+
594
+ checkOfflineMsgEmailIsEnabled(project: Project): boolean {
595
+ let check: boolean = true
596
+
597
+ //case: check emailSection env variable
598
+ if(!this.isEmailEnabled){
599
+ return check= false
600
+ }
601
+
602
+ //case: check offlineMsgEmail project property
603
+ if(project && project.hasOwnProperty('offlineMsgEmail')){
604
+ check = project.offlineMsgEmail
605
+ }
606
+
607
+ return check
608
+ }
609
+
591
610
  // getProjectIdSelectedConversation(conversationWith: string): string{
592
611
  // const conversationWith_segments = conversationWith.split('-')
593
612
  // // Removes the last element of the array if is = to the separator
@@ -1119,8 +1138,7 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
1119
1138
 
1120
1139
  if ((msg && msg.trim() !== '') || type !== TYPE_MSG_TEXT) {
1121
1140
 
1122
-
1123
- if (this.isEmailEnabled &&
1141
+ if (this.offlineMsgEmail &&
1124
1142
  this.leadInfo && this.leadInfo.presence && this.leadInfo.presence['status'] === 'offline' &&
1125
1143
  this.leadInfo.email && !emailSectionMsg && !channelIsNotWeb) {
1126
1144
  this.logger.log('[CONVS-DETAIL] - SEND MESSAGE --> SENDING EMAIL', msg, this.leadInfo.email)
@@ -19,6 +19,7 @@ export interface Project {
19
19
  // profile_type?: string;
20
20
  isActiveSubscription?: boolean;
21
21
  profile?: any;
22
+ offlineMsgEmail?: boolean;
22
23
  // subscription_end_date?: any;
23
24
  // subscription_id?: any;
24
25
  // subscription_creation_date?: any;