@chat21/chat21-ionic 3.0.86 → 3.0.88-rc.2

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.88-rc.2
4
+ - added: enable email only if active by env parameter
5
+ - added: emailSection env variable
6
+ - added: CHAT_STORAGE_PREFIX, EMAIL_SECTION env parameters
7
+
8
+ ### 3.0.88-rc.1
9
+ - bug-fixed: projectId is undefined
10
+ - bug-fixed: typing subscription block UI on first conversation click
11
+
12
+ ### 3.0.87 in PROD
13
+ - restored version 3.0.85
14
+
3
15
  ### 3.0.86 in PROD
4
16
 
5
17
  ### 3.0.86-rc.6
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@chat21/chat21-ionic",
3
3
  "author": "Tiledesk SRL",
4
- "version": "3.0.86",
4
+ "version": "3.0.88-rc.2",
5
5
  "license": "MIT License",
6
6
  "homepage": "https://tiledesk.com/",
7
7
  "repository": {
@@ -8,7 +8,7 @@
8
8
  </ion-button>
9
9
  </div>
10
10
  <!-- EMAIL-OPTION -->
11
- <div class="section-option" id="email" tooltip="{{translationMap?.get('LABEL_EMAIL')}}" [options]="tooltipOptions" placement="top">
11
+ <div *ngIf="emailSection" class="section-option" id="email" tooltip="{{translationMap?.get('LABEL_EMAIL')}}" [options]="tooltipOptions" placement="top">
12
12
  <ion-button fill="clear" [class.active]="section==='email'" (click)="onOpenSection('email')" [disabled]="channelType === 'direct'">
13
13
  <ion-icon name="mail-open"></ion-icon>
14
14
  {{translationMap.get('LABEL_EMAIL')}}
@@ -49,7 +49,8 @@ export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChange
49
49
  @Input() areVisibleCAR: boolean;
50
50
  @Input() supportMode: boolean;
51
51
  @Input() leadInfo: {lead_id: string, hasEmail: boolean, email: string, projectId: string};
52
- @Input() fileUploadAccept: string
52
+ @Input() fileUploadAccept: string;
53
+ @Input() emailSection: boolean;
53
54
  @Input() isOpenInfoConversation: boolean;
54
55
  @Input() translationMap: Map<string, string>;
55
56
  @Input() dropEvent: any;
@@ -8,7 +8,7 @@
8
8
  <ng-container *ngIf="project">
9
9
  <button class="btn simulate-visitor-btn btn-success-no-boxshadow " (click)="testWidgetPage()">
10
10
  <i class="material-icons" style="padding-top: 0px;font-size: 24px;">play_arrow</i>
11
- {{translationsMap.get('NAVBAR.SIMULATE_VISITOR')}}
11
+ {{translationsMap?.get('NAVBAR.SIMULATE_VISITOR')}}
12
12
  </button>
13
13
  </ng-container>
14
14
 
@@ -42,9 +42,9 @@ export class NavbarComponent implements OnInit {
42
42
  ) { }
43
43
 
44
44
  ngOnInit() {
45
+ this.initTranslations();
45
46
  this.listenToUserGoOnline();
46
47
  this.getStoredProjectAndUserRole();
47
- this.initTranslations();
48
48
  this.getOSCODE();
49
49
  }
50
50
 
@@ -231,6 +231,7 @@
231
231
  [supportMode]="supportMode"
232
232
  [leadInfo]="leadInfo"
233
233
  [fileUploadAccept]="appConfigProvider.getConfig().fileUploadAccept"
234
+ [emailSection]="appConfigProvider.getConfig().emailSection"
234
235
  [isOpenInfoConversation]="openInfoConversation"
235
236
  [translationMap]="translationsMap"
236
237
  [dropEvent]="dropEvent"
@@ -1,3 +1,4 @@
1
+ import { DomSanitizer } from '@angular/platform-browser';
1
2
  import {
2
3
  Component,
3
4
  OnInit,
@@ -225,8 +226,7 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
225
226
  public tiledeskService: TiledeskService,
226
227
  private networkService: NetworkService,
227
228
  private events: EventsService,
228
- private renderer: Renderer2,
229
- private el: ElementRef
229
+ private sanitizer: DomSanitizer
230
230
  ) {
231
231
  // Change list on date change
232
232
  this.route.paramMap.subscribe((params) => {
@@ -251,8 +251,7 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
251
251
  this.watchToConnectionStatus();
252
252
  this.getOSCODE();
253
253
  this.getStoredProjectAndUserRole();
254
- this.listenToDsbrdPostMsgs();
255
-
254
+ this.listenToDsbrdPostMsgs();
256
255
  }
257
256
 
258
257
  listenToDsbrdPostMsgs() {
@@ -517,11 +516,12 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
517
516
  this.initSubscriptions()
518
517
  this.startConversation()
519
518
  this.getLeadDetail()
519
+ this.initializeTyping();
520
520
  }
521
521
  this.addEventsKeyboard()
522
522
  this.updateConversationBadge() // AGGIORNO STATO DELLA CONVERSAZIONE A 'LETTA' (is_new = false)
523
523
 
524
- this.initializeTyping();
524
+
525
525
  }
526
526
 
527
527
  _getProjectIdByConversationWith(conversationWith: string) {
@@ -686,18 +686,27 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
686
686
  ]
687
687
  return this.customTranslateService.translateLanguage(keys)
688
688
  }
689
-
690
689
  private setStyleMap(){
691
- this.styleMap.set('themeColor', 'var(--basic-blue)')
692
- .set('bubbleReceivedBackground','var(--bck-msg-received)')
693
- .set('bubbleReceivedTextColor', 'var(--col-msg-received)')
694
- .set('bubbleSentBackground', 'var(--bck-msg-sent)')
695
- .set('bubbleSentTextColor', 'var(--col-msg-sent)')
696
- .set('buttonFontSize','var(--button-in-msg-font-size)')
697
- .set('buttonBackgroundColor', 'var(--buttonBackgroundColor)')
698
- .set('buttonTextColor', 'var(--buttonTextColor)')
699
- .set('buttonHoverBackgroundColor', 'var(--buttonHoverBackgroundColor)')
700
- .set('buttonHoverTextColor', 'var(--buttonHoverTextColor)')
690
+ // this.styleMap.set('themeColor', 'var(--basic-blue)')
691
+ // .set('bubbleReceivedBackground','var(--bck-msg-received)')
692
+ // .set('bubbleReceivedTextColor', 'var(--col-msg-received)')
693
+ // .set('bubbleSentBackground', 'var(--bck-msg-sent)')
694
+ // .set('bubbleSentTextColor', 'var(--col-msg-sent)')
695
+ // .set('buttonFontSize','var(--button-in-msg-font-size)')
696
+ // .set('buttonBackgroundColor', 'var(--buttonBackgroundColor)')
697
+ // .set('buttonTextColor', 'var(--buttonTextColor)')
698
+ // .set('buttonHoverBackgroundColor', 'var(--buttonHoverBackgroundColor)')
699
+ // .set('buttonHoverTextColor', 'var(--buttonHoverTextColor)')
700
+ this.styleMap.set('themeColor', '#2a69c1')
701
+ .set('bubbleReceivedBackground','#f0f2f7')
702
+ .set('bubbleReceivedTextColor', '#06132b')
703
+ .set('bubbleSentBackground', '#2a6ac1')
704
+ .set('bubbleSentTextColor', '#ffffff')
705
+ .set('buttonFontSize','15px')
706
+ .set('buttonBackgroundColor', '#ffffff')
707
+ .set('buttonTextColor', '#2a6ac1')
708
+ .set('buttonHoverBackgroundColor', '#2a6ac1')
709
+ .set('buttonHoverTextColor', ' #ffffff')
701
710
 
702
711
  }
703
712
  // -------------------------------------------------------------------------------------
@@ -793,6 +802,14 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
793
802
  conversation.attributes.project_name = project['name']
794
803
  }
795
804
 
805
+ }else {
806
+ const projectId = this.getProjectIdSelectedConversation(this.conversationWith)
807
+ let project = localStorage.getItem(projectId)
808
+ if(project){
809
+ project = JSON.parse(project)
810
+ conversation.attributes.projectId = project['_id']
811
+ conversation.attributes.project_name = project['name']
812
+ }
796
813
  }
797
814
  return conversation
798
815
  }
@@ -1003,7 +1020,8 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
1003
1020
  attributes,
1004
1021
  )
1005
1022
 
1006
- if(!this.leadIsOnline && this.leadInfo && this.leadInfo.email){
1023
+ let emailEnabled = this.appConfigProvider.getConfig().emailSection
1024
+ if(emailEnabled && !this.leadIsOnline && this.leadInfo && this.leadInfo.email){
1007
1025
  this.logger.log('[CONVS-DETAIL] - SEND MESSAGE --> SENDING EMAIL', msg, this.leadInfo.email)
1008
1026
  this.sendEmail(msg)
1009
1027
  }
@@ -1059,7 +1077,7 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
1059
1077
  subscription = this.subscriptions.find((item) => item.key === subscriptionKey)
1060
1078
  if (!subscription) {
1061
1079
  subscription = this.conversationHandlerService.messageInfo.pipe(takeUntil(this.unsubscribe$)).subscribe((msg: any) => {
1062
- this.logger.log('[CONVS-DETAIL] subscribe to messageInfo - messageId ', msg)
1080
+ this.logger.log('[CONVS-DETAIL] subscribe to messageInfo - messageId ', msg, this.conversation)
1063
1081
  if (msg) {
1064
1082
  that.updateLeadInfo(msg)
1065
1083
  // this.setHeaderContent()
@@ -30,6 +30,7 @@
30
30
  "supportMode": true,
31
31
  "archivedButton": true,
32
32
  "writeToButton": true,
33
+ "emailSection":true,
33
34
  "wsUrl": "ws://localhost:8081/ws/",
34
35
  "showInfoMessage":"MEMBER_JOINED_GROUP,TOUCHING_OPERATOR"
35
36
  }
@@ -31,5 +31,6 @@
31
31
  "supportMode": true,
32
32
  "archivedButton": true,
33
33
  "writeToButton": true,
34
+ "emailSection":true,
34
35
  "wsUrl":"wss://console.native.tiledesk.com/mqws/ws"
35
36
  }
@@ -30,5 +30,6 @@
30
30
  "supportMode": true,
31
31
  "archivedButton": true,
32
32
  "writeToButton": true,
33
+ "emailSection":true,
33
34
  "wsUrl": "wss://tiledesk-server-pre.herokuapp.com/"
34
35
  }
@@ -31,5 +31,7 @@
31
31
  "dashboardUrl": "${DASHBOARD_URL}",
32
32
  "testsiteBaseUrl":"${WIDGET_TEST_LOCATION}",
33
33
  "wsUrl": "${WS_URL}",
34
- "wsUrlRel": "${WS_URL_RELATIVE}"
34
+ "wsUrlRel": "${WS_URL_RELATIVE}",
35
+ "storage_prefix": "${CHAT_STORAGE_PREFIX}",
36
+ "emailSection": "${EMAIL_SECTION}"
35
37
  }
@@ -29,7 +29,9 @@
29
29
  "testsiteBaseUrl": "https://widget-pre.tiledesk.com/v5/assets/twp/index.html",
30
30
  "wsUrl": "ws://localhost:3000/",
31
31
  "wsUrlRel": "${WS_URL_RELATIVE}",
32
+ "storage_prefix": "chat_sv5",
32
33
  "supportMode": false,
33
34
  "writeToButton": false,
34
- "archivedButton": false
35
+ "archivedButton": false,
36
+ "emailSection": true
35
37
  }
@@ -104,44 +104,6 @@ export class FirebaseAuthService extends MessagingAuthService {
104
104
  });
105
105
 
106
106
 
107
- }
108
-
109
- checkInternetConnection() {
110
- this.logger.log('[FIREBASEAuthSERVICE] - checkInternetConnection');
111
- // let connectSubscription = this.network.onConnect().subscribe(() => {
112
- // this.logger.log('[FIREBASEAuthSERVICE] - network connected!');
113
- // // We just got a connection but we need to wait briefly
114
- // // before we determine the connection type. Might need to wait.
115
- // // prior to doing any api requests as well.
116
- // setTimeout(() => {
117
- // if (this.network.type === 'wifi') {
118
- // this.logger.log('[FIREBASEAuthSERVICE] - we got a wifi connection, woohoo!');
119
- // }
120
- // }, 3000);
121
- // });
122
-
123
-
124
- // this.connectionService.monitor().subscribe(isConnected => {
125
- // this.isConnected = isConnected;
126
- // this.logger.log('[FIREBASEAuthSERVICE] - checkInternetConnection isConnected', isConnected);
127
- // if (this.isConnected) {
128
- // this.status = "ONLINE";
129
-
130
- // // this.onAuthStateChanged();
131
- // firebase.auth().onAuthStateChanged(user => {
132
- // this.logger.log('[FIREBASEAuthSERVICE] checkInternetConnection onAuthStateChanged', user)
133
- // })
134
- // }
135
- // else {
136
- // this.status = "OFFLINE";
137
- // // this.onAuthStateChanged();
138
- // firebase.auth().onAuthStateChanged(user => {
139
- // this.logger.log('[FIREBASEAuthSERVICE] checkInternetConnection onAuthStateChanged', user)
140
- // })
141
- // }
142
- // })
143
-
144
-
145
107
  }
146
108
 
147
109
  // createOnline$() {