@chat21/chat21-ionic 3.0.90 → 3.0.91-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-ionic ver 3.0
2
2
 
3
+ ### 3.0.91-rc.1
4
+ - added: pin-unpin canned (starting)
5
+ - bug-fixed: undefined in conversationsHandlerService firebase env with TOUCHING_OPERATOR info message
6
+ - bug-fixed: a html tag is outsite its container
7
+
3
8
  ### 3.0.90 in PROD
4
9
 
5
10
  ### 3.0.90-rc.7
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.90",
4
+ "version": "3.0.91-rc.1",
5
5
  "license": "MIT License",
6
6
  "homepage": "https://tiledesk.com/",
7
7
  "repository": {
@@ -1294,7 +1294,7 @@ export class AppComponent implements OnInit {
1294
1294
  }
1295
1295
 
1296
1296
  private initConversationsHandler(userId: string) {
1297
- const keys = ['YOU'];
1297
+ const keys = ['YOU', 'INFO_A_NEW_SUPPORT_REQUEST_HAS_BEEN_ASSIGNED_TO_YOU'];
1298
1298
  const translationMap = this.translateService.translateLanguage(keys);
1299
1299
 
1300
1300
  this.logger.log('[APP-COMP] initConversationsHandler ------------->', userId, this.tenant);
@@ -226,7 +226,7 @@ export function uploadFactory(http: HttpClient, appConfig: AppConfigProvider, ap
226
226
  const config = appConfig.getConfig()
227
227
  if (config.uploadEngine === UPLOAD_ENGINE_NATIVE) {
228
228
  const nativeUploadService = new NativeUploadService(http, appStorage)
229
- nativeUploadService.setBaseUrl(config.apiUrl)
229
+ nativeUploadService.setBaseUrl(config.baseImageUrl)
230
230
  return nativeUploadService
231
231
  } else {
232
232
  return new FirebaseUploadService();
@@ -57,7 +57,7 @@
57
57
 
58
58
 
59
59
  <!-- [tooltip]="timeTooltipLeft" [options]="tooltipOptions" placement="left" content-type="template" (click)="handleTooltipEvents($event)" -->
60
- <div *ngIf="message?.text" style="display: flex; margin: 0px 0px 0px 0px;">
60
+ <div *ngIf="message?.text">
61
61
 
62
62
  <!-- <ng-template #timeTooltipLeft>
63
63
  <span>{{message.timestamp | amTimeAgo}} ({{message.timestamp | amLocal | amDateFormat: 'L HH:mm:ss'}})</span>
@@ -8,6 +8,8 @@
8
8
  <ion-input [class.readonly]="canned?.disabled" [readonly]="canned?.disabled" type="text" [(ngModel)]="canned.title" class="title" id="{{'titleCanned_'+canned._id}}" #title></ion-input>
9
9
  <ion-input [class.readonly]="canned?.disabled" [readonly]="canned?.disabled" type="text" [(ngModel)]="canned.text" class="text truncate"></ion-input>
10
10
  </div>
11
+ <!-- <ion-icon class="canned-item-icon" name="pin" src="assets/images/pin.svg" slot=end *ngIf="canned.pinned" (click)="onPinCanned(canned, $event)"></ion-icon>
12
+ <ion-icon class="canned-item-icon" name="pin" src="assets/images/pinned.svg" slot=end (click)="onUnPinCanned(canned, $event)"></ion-icon> -->
11
13
  <ion-icon class="canned-item-icon" name="checkmark-sharp" slot=end *ngIf="canned.createdBy === loggedUser.uid && !canned.disabled" (click)="onConfirmEditCanned(canned, $event)"></ion-icon>
12
14
  <ion-icon class="canned-item-icon" name="pencil-sharp" slot=end *ngIf="canned.createdBy === loggedUser.uid && canned.disabled" (click)="onEditCanned(canned, $event)"></ion-icon>
13
15
  <ion-icon class="canned-item-icon" name="trash-bin-outline" slot=end *ngIf="canned.createdBy === loggedUser.uid" (click)="onDeleteCanned(canned, $event)"></ion-icon>
@@ -250,6 +250,18 @@ export class CannedResponseComponent implements OnInit {
250
250
  })
251
251
  }
252
252
 
253
+ onPinCanned(canned, ev){
254
+ ev.preventDefault()
255
+ ev.stopPropagation()
256
+ this.logger.log('[CANNED] onPinCanned ', canned)
257
+ }
258
+
259
+ onUnPinCanned(canned, ev){
260
+ ev.preventDefault()
261
+ ev.stopPropagation()
262
+ this.logger.log('[CANNED] onUnPinCanned ', canned)
263
+ }
264
+
253
265
  onClickCannedFN(canned, event){
254
266
  if(!canned.disabled){
255
267
  event.preventDefault();
@@ -1,12 +1,13 @@
1
1
  /* Style the buttons that are used to open and close the accordion panel */
2
2
  .advanced-info-accordion {
3
3
  transition: 0.4s;
4
+ --background-hover: #f5f7f9;
5
+ --ripple-color: transparent;
4
6
  }
5
7
 
6
8
  /* Style the accordion panel. Note: hidden by default */
7
9
  .advanced-info-panel {
8
10
  padding: 0 18px;
9
- background-color: white;
10
11
  max-height: 0;
11
12
  overflow: hidden;
12
13
  transition: max-height 0.2s ease-out;
@@ -33,6 +34,8 @@
33
34
  position: absolute;
34
35
  right: 0px !important;
35
36
  transition: all 0.3s linear;
37
+ color: var(--basic-blue);
38
+
36
39
  }
37
40
  .absolute-icon.active {
38
41
  -ms-transform: rotate(180deg);
@@ -1,3 +1,7 @@
1
+ ion-content{
2
+ --background: var(--list-bkg-color);
3
+ }
4
+
1
5
  .member-profile {
2
6
 
3
7
  .status-profile{
@@ -76,6 +80,7 @@
76
80
  cursor: pointer;
77
81
  position: relative;
78
82
  transition: all 0.2s ease-in-out 0s;
83
+ width: 100%;
79
84
 
80
85
  &:hover{
81
86
  background-color: #f5f7f9;
@@ -51,6 +51,9 @@ export class InfoDirectComponent implements OnInit, AfterViewInit, OnChanges {
51
51
  /** */
52
52
  initialize() {
53
53
  this.logger.log('InfoDirectComponent - initialize');
54
+ if(this.advancedAttributes.filter(el => el.value === this.conversationWith).length > 0){
55
+ return;
56
+ }
54
57
  this.advancedAttributes.push({key: "USER_ID", value: this.conversationWith, icon: 'code'})
55
58
  this.logger.log('InfoDirectComponent - advancedAttributes' , this.advancedAttributes);
56
59
  }
@@ -0,0 +1 @@
1
+ <svg id="pin" data-name="pin" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15.46 17"><path class="cls-1" d="M10.88,13.65l.37,2.59-.87,1.05L6.72,14.22,3.2,18.42l-1,.08-.09-1,3.52-4.2L2,10.27l.87-1,2.52-.17,4.85-5.78-.87-.74.88-1,7.21,6.05-.88,1-.87-.73ZM4.3,10.41,9.74,15l-.23-1.82L14.69,7,11.31,4.15,6.13,10.32Z" transform="translate(-2.02 -1.5)"/></svg>
@@ -0,0 +1,3 @@
1
+ <svg id="pinned" data-name="pinned" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15.46 17">
2
+ <path d="M10.88,13.65l.37,2.59-.87,1.05L6.72,14.22,3.2,18.42l-1,.08-.09-1,3.52-4.2L2,10.27l.87-1,2.52-.17,4.85-5.78-.87-.74.88-1,7.21,6.05-.88,1-.87-.73Z" transform="translate(-2.02 -1.5)"/>
3
+ </svg>
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  Chat21Client
3
3
 
4
- v0.1.12.3
4
+ v0.1.12.4
5
5
 
6
6
  @Author Andrea Sponziello
7
7
  (c) Tiledesk 2020
@@ -965,7 +965,7 @@ class Chat21Client {
965
965
  if (this.client) {
966
966
  this.client.end()
967
967
  }
968
- const presence_topic = 'apps/tilechat/users/' + this.user_id + '/presence/' + this.client_id
968
+ this.presence_topic = 'apps/tilechat/users/' + this.user_id + '/presence/' + this.client_id
969
969
  let options = {
970
970
  keepalive: 10,
971
971
  // protocolId: 'MQTT',
@@ -974,7 +974,7 @@ class Chat21Client {
974
974
  reconnectPeriod: 1000,
975
975
  // connectTimeout: 30 * 1000,
976
976
  will: {
977
- topic: presence_topic,
977
+ topic: this.presence_topic,
978
978
  payload: '{"disconnected":true}',
979
979
  qos: 1,
980
980
  retain: true
@@ -984,7 +984,7 @@ class Chat21Client {
984
984
  password: jwt,
985
985
  rejectUnauthorized: false
986
986
  }
987
- if (this.log) {console.log("starting mqtt connection with LWT on:", presence_topic, this.endpoint)}
987
+ if (this.log) {console.log("starting mqtt connection with LWT on:", this.presence_topic, this.endpoint)}
988
988
  // client = mqtt.connect('mqtt://127.0.0.1:15675/ws',options)
989
989
  this.client = mqtt.connect(this.endpoint,options)
990
990
 
@@ -998,6 +998,15 @@ class Chat21Client {
998
998
  callback();
999
999
  });
1000
1000
  }
1001
+ this.client.publish(
1002
+ this.presence_topic,
1003
+ JSON.stringify({connected: true}),
1004
+ null, (err) => {
1005
+ if (err) {
1006
+ console.error("Error con presence publish:", err);
1007
+ }
1008
+ }
1009
+ );
1001
1010
  }
1002
1011
  );
1003
1012
  this.client.on('reconnect',
@@ -1022,6 +1031,20 @@ class Chat21Client {
1022
1031
  );
1023
1032
  }
1024
1033
 
1034
+ ImHere() {
1035
+ if (this.client) {
1036
+ this.client.publish(
1037
+ this.presence_topic,
1038
+ JSON.stringify({connected: true}),
1039
+ null, (err) => {
1040
+ if (err) {
1041
+ console.error("Error on presence publish:", err);
1042
+ }
1043
+ }
1044
+ );
1045
+ }
1046
+ }
1047
+
1025
1048
  close(callback) {
1026
1049
  if (this.topic_inbox) {
1027
1050
  this.client.unsubscribe(this.topic_inbox, (err) => {
@@ -26,7 +26,7 @@
26
26
  "baseImageUrl": "https://firebasestorage.googleapis.com/v0/b/",
27
27
  "dashboardUrl": "https://support-pre.tiledesk.com/dashboard/",
28
28
  "testsiteBaseUrl": "https://widget-pre.tiledesk.com/v5/assets/twp/index.html",
29
- "logLevel": "error",
29
+ "logLevel": "DEBUG",
30
30
  "authPersistence": "LOCAL",
31
31
  "supportMode": true,
32
32
  "archivedButton": true,
@@ -629,12 +629,8 @@ export class FirebaseConversationsHandler extends ConversationsHandlerService {
629
629
 
630
630
  translateInfoSupportMessages(conv) {
631
631
  const INFO_A_NEW_SUPPORT_REQUEST_HAS_BEEN_ASSIGNED_TO_YOU = this.translationMap.get('INFO_A_NEW_SUPPORT_REQUEST_HAS_BEEN_ASSIGNED_TO_YOU');
632
- // console.log('[FIREBASEConversationsHandlerSERVICE] INFO_A_NEW_SUPPORT_REQUEST_HAS_BEEN_ASSIGNED_TO_YOU', INFO_A_NEW_SUPPORT_REQUEST_HAS_BEEN_ASSIGNED_TO_YOU)
633
632
  if ((conv.attributes && conv.attributes.messagelabel && conv.attributes.messagelabel.key === TOUCHING_OPERATOR) && conv.sender === "system") {
634
- // console.log('FIREBASEConversationsHandlerSERVICE last_message_text', conv.last_message_text)
635
633
  const textAfterColon = conv.last_message_text.split(":")[1]
636
- // console.log('FIREBASEConversationsHandlerSERVICE last_message_text - textAfterColon', textAfterColon)
637
- // message.text = INFO_A_NEW_SUPPORT_REQUEST_HAS_BEEN_ASSIGNED_TO_YOU + ' ' + textAfterColon;
638
634
  if (textAfterColon !== undefined) {
639
635
  conv.last_message_text = INFO_A_NEW_SUPPORT_REQUEST_HAS_BEEN_ASSIGNED_TO_YOU + ': ' + textAfterColon;
640
636
  }
@@ -13,7 +13,6 @@ import 'firebase/auth';
13
13
 
14
14
  export class FirebaseNotifications extends NotificationsService {
15
15
 
16
- // public BUILD_VERSION: string;
17
16
  private FCMcurrentToken: string;
18
17
  private userId: string;
19
18
  private tenant: string;
@@ -16,7 +16,7 @@ import { Chat21Service } from './chat-service';
16
16
  })
17
17
  export class MQTTNotifications extends NotificationsService {
18
18
 
19
- public BUILD_VERSION: string;
19
+ // public BUILD_VERSION: string;
20
20
  private FCMcurrentToken: string;
21
21
  private userId: string;
22
22
  private tenant: string;