@chat21/chat21-ionic 3.0.64-rc1 → 3.0.64

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.
Files changed (37) hide show
  1. package/CHANGELOG.md +2 -5
  2. package/deploy_amazon_beta.sh +29 -0
  3. package/deploy_amazon_prod.sh +25 -0
  4. package/deploy_pre.sh +6 -78
  5. package/deploy_prod.sh +6 -57
  6. package/package.json +1 -6
  7. package/src/app/app.component.ts +57 -45
  8. package/src/app/app.module.ts +0 -1
  9. package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.html +2 -2
  10. package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.scss +1 -0
  11. package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.ts +39 -2
  12. package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.html +6 -18
  13. package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.ts +2 -2
  14. package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.html +1 -1
  15. package/src/app/components/conversation-detail/message-text-area/message-text-area.component.html +2 -2
  16. package/src/app/components/conversation-detail/message-text-area/message-text-area.component.ts +2 -2
  17. package/src/app/directives/safe-html.pipe.ts +2 -2
  18. package/src/app/pages/conversation-detail/conversation-detail.page.html +2 -4
  19. package/src/app/pages/conversation-detail/conversation-detail.page.ts +23 -12
  20. package/src/app/pages/conversations-list/conversations-list.page.html +12 -21
  21. package/src/app/pages/conversations-list/conversations-list.page.ts +191 -58
  22. package/src/app/pages/loader-preview/loader-preview.module.ts +2 -1
  23. package/src/app/shared/shared.module.ts +0 -4
  24. package/src/assets/js/chat21client.js +1 -1
  25. package/src/{chat-config-mqtt-ver-uploaded.json → chat-config-mqtt-localhost.json} +10 -6
  26. package/src/chat-config-mqtt.json +18 -28
  27. package/src/chat-config-native-mqtt.json +30 -0
  28. package/src/chat-config-pre.json +9 -13
  29. package/src/chat21-core/models/conversation.ts +1 -1
  30. package/src/chat21-core/providers/abstract/conversations-handler.service.ts +1 -1
  31. package/src/chat21-core/providers/firebase/firebase-conversations-handler.ts +8 -47
  32. package/src/chat21-core/utils/utils-message.ts +3 -2
  33. package/src/app/chatlib/conversation-detail/message/html/html.component.html +0 -1
  34. package/src/app/chatlib/conversation-detail/message/html/html.component.scss +0 -79
  35. package/src/app/chatlib/conversation-detail/message/html/html.component.spec.ts +0 -25
  36. package/src/app/chatlib/conversation-detail/message/html/html.component.ts +0 -33
  37. package/src/chat-config-pre-test.json +0 -37
@@ -3,14 +3,7 @@
3
3
  "chatEngine": "firebase",
4
4
  "uploadEngine": "firebase",
5
5
  "pushEngine": "firebase",
6
- "logLevel": "info",
7
- "fileUploadAccept":"*/*",
8
- "authPersistence": "LOCAL",
9
- "supportMode": true,
10
- "writeToButton": true,
11
- "archivedButton": true,
12
6
  "firebaseConfig": {
13
- "tenant": "tilechat",
14
7
  "apiKey": "AIzaSyCoWXHNvP1-qOllCpTshhC6VjPXeRTK0T4",
15
8
  "authDomain": "chat21-pre-01.firebaseapp.com",
16
9
  "databaseURL": "https://chat21-pre-01.firebaseio.com",
@@ -19,17 +12,20 @@
19
12
  "messagingSenderId": "269505353043",
20
13
  "appId": "1:269505353043:web:b82af070572669e3707da6",
21
14
  "chat21ApiUrl": "https://us-central1-chat21-pre-01.cloudfunctions.net",
22
- "vapidKey": "BOsgS2ADwspKdWAmiFDZXEYqY1HSYADVfJT3j67wsySh3NxaViJqoabPJH8WM02wb5r8cQIm5TgM0UK047Z1D1c"
15
+ "tenant":"tilechat"
23
16
  },
24
17
  "chat21Config": {
25
18
  "appId": "tilechat",
26
19
  "MQTTendpoint": "ws://99.80.197.164:15675/ws",
27
- "APIendpoint": "http://99.80.197.164:8004/api",
28
- "loginServiceEndpoint": "http://99.80.197.164:/tilechat/signin"
20
+ "APIendpoint": "http://99.80.197.164:8004/api"
29
21
  },
30
22
  "apiUrl": "https://tiledesk-server-pre.herokuapp.com/",
31
23
  "baseImageUrl": "https://firebasestorage.googleapis.com/v0/b/",
32
- "dashboardUrl": "/dashboard/",
24
+ "dashboardUrl": "https://support-pre.tiledesk.com/dashboard/",
25
+ "logLevel": "DEBUG",
26
+ "authPersistence": "LOCAL",
27
+ "supportMode": true,
28
+ "archivedButton": true,
29
+ "writeToButton": true,
33
30
  "wsUrl": "wss://tiledesk-server-pre.herokuapp.com/"
34
- }
35
-
31
+ }
@@ -15,7 +15,7 @@ export class ConversationModel {
15
15
  public senderAuthInfo: any,
16
16
  public sender_fullname: string,
17
17
  public status: string,
18
- public timestamp: number,
18
+ public timestamp: string,
19
19
  public time_last_message: string,
20
20
  public selected: boolean,
21
21
  public color: string,
@@ -29,7 +29,7 @@ export abstract class ConversationsHandlerService {
29
29
  // functions
30
30
  abstract initialize(tenant: string, userId: string, translationMap: Map<string, string>): void;
31
31
  // abstract connect(): void;
32
- abstract subscribeToConversations(lastConversatioTimestamp: number, callback: any): void;
32
+ abstract subscribeToConversations(callback: any): void;
33
33
  abstract countIsNew(): number;
34
34
  abstract setConversationRead(conversationId: string): void;
35
35
  abstract dispose(): void;
@@ -114,62 +114,21 @@ export class FirebaseConversationsHandler extends ConversationsHandlerService {
114
114
  // ---------------------------------------------------------------------------------
115
115
  // New connect - renamed subscribeToConversation
116
116
  //----------------------------------------------------------------------------------
117
- subscribeToConversations(lastConversationTimestamp: number, callback) {
117
+ subscribeToConversations(callback) {
118
118
  const that = this;
119
119
  const urlNodeFirebase = conversationsPathForUserId(this.tenant, this.loggedUserId);
120
120
  this.logger.debug('[FIREBASEConversationsHandlerSERVICE] SubscribeToConversations conversations::ACTIVE urlNodeFirebase', urlNodeFirebase)
121
121
  this.ref = firebase.database().ref(urlNodeFirebase).orderByChild('timestamp').limitToLast(200);
122
-
123
- // this.ref.once('value').then(snapshot => {
124
- // snapshot.forEach(childSnapshot => {
125
- // const childData: ConversationModel = childSnapshot.val();
126
- // childData.uid = childSnapshot.key
127
- // that.added(childData)
128
- // lastConversationTimestamp = childData.timestamp
129
- // });
130
-
131
- // callback(that.conversations)
132
- // return lastConversationTimestamp
133
- // }).then((timestamp)=> {
134
- // console.log('timestampppppp',timestamp)
135
- // this.ref.startAt(timestamp).on('child_changed', (childSnapshot) => {
136
- // const conv: ConversationModel = childSnapshot.val();
137
- // conv.uid = childSnapshot.key
138
- // that.changed(conv);
139
- // });
140
- // this.ref.startAt(timestamp).on('child_removed', (childSnapshot) => {
141
- // const conv: ConversationModel = childSnapshot.val();
142
- // conv.uid = childSnapshot.key
143
- // that.removed(conv);
144
- // });
145
- // this.ref.startAt(timestamp).on('child_added', (childSnapshot) => {
146
- // const conv: ConversationModel = childSnapshot.val();
147
- // console.log('addedddd', conv)
148
- // conv.uid = childSnapshot.key
149
- // that.added(conv);
150
- // });
151
- // });
152
- // this.ref.on('value', (snaps) => {
153
- // if(snaps){
154
- // console.log('convvvvvv', snaps.val(), snaps.val().length)
155
- // for(let item=0; item<snaps.val().length; item++){
156
- // that.added(snaps.val()[item])
157
- // }
158
- // callback(this.conversations)
159
- // }
160
- // })
161
- this.ref.startAt(lastConversationTimestamp).on('child_changed', (childSnapshot) => {
122
+ this.ref.on('child_changed', (childSnapshot) => {
162
123
  that.changed(childSnapshot);
163
124
  });
164
- this.ref.startAt(lastConversationTimestamp).on('child_removed', (childSnapshot) => {
125
+ this.ref.on('child_removed', (childSnapshot) => {
165
126
  that.removed(childSnapshot);
166
127
  });
167
- this.ref.startAt(lastConversationTimestamp).on('child_added', (childSnapshot) => {
128
+ this.ref.on('child_added', (childSnapshot) => {
168
129
  that.added(childSnapshot);
169
130
  });
170
131
 
171
-
172
-
173
132
  setTimeout(() => {
174
133
  callback()
175
134
  }, 2000);
@@ -380,7 +339,7 @@ export class FirebaseConversationsHandler extends ConversationsHandlerService {
380
339
  childData.uid = childSnapshot.key;
381
340
  const conversation = this.completeConversation(childData);
382
341
  if (this.isValidConversation(conversation)) {
383
- this.setClosingConversation(conversation.uid, false);
342
+ this.setClosingConversation(childSnapshot.key, false);
384
343
  const index = searchIndexInArrayForUid(this.conversations, conversation.uid);
385
344
  if (index > -1) {
386
345
  this.conversations.splice(index, 1, conversation);
@@ -532,6 +491,7 @@ export class FirebaseConversationsHandler extends ConversationsHandlerService {
532
491
  this.translateInfoSupportMessages(conv);
533
492
  }
534
493
  }
494
+
535
495
  // Fixes the bug: if a snippet of code is pasted and sent it is not displayed correctly in the convesations list
536
496
  // conv.time_last_message = this.getTimeLastMessage(conv.timestamp);
537
497
  conv.conversation_with = conversation_with;
@@ -543,7 +503,7 @@ export class FirebaseConversationsHandler extends ConversationsHandlerService {
543
503
  // getImageUrlThumbFromFirebasestorage(conversation_with, this.FIREBASESTORAGE_BASE_URL_IMAGE, this.urlStorageBucket);
544
504
  return conv;
545
505
  }
546
-
506
+
547
507
 
548
508
  /**BUG-FIX: on Conversation-list, when conversation start, it continuosly change the sender_fullname info from Guest to others name */
549
509
  private changeSenderFullName(conversation: ConversationModel): string {
@@ -560,6 +520,7 @@ export class FirebaseConversationsHandler extends ConversationsHandlerService {
560
520
  return conversation_with_fullname
561
521
  }
562
522
 
523
+
563
524
  translateInfoSupportMessages(conv) {
564
525
  const INFO_A_NEW_SUPPORT_REQUEST_HAS_BEEN_ASSIGNED_TO_YOU = this.translationMap.get('INFO_A_NEW_SUPPORT_REQUEST_HAS_BEEN_ASSIGNED_TO_YOU');
565
526
  // console.log('[FIREBASEConversationsHandlerSERVICE] INFO_A_NEW_SUPPORT_REQUEST_HAS_BEEN_ASSIGNED_TO_YOU', INFO_A_NEW_SUPPORT_REQUEST_HAS_BEEN_ASSIGNED_TO_YOU)
@@ -85,8 +85,9 @@ export function messageType(msgType: string, message: any) {
85
85
  }
86
86
  }
87
87
 
88
- export function isEmojii(message: any){
89
-
88
+ export function isEmojii(message: any) {
89
+ // https://localcoder.org/javascript-detect-if-a-string-contains-only-unicode-emojis
90
+
90
91
  // let emoji = '';
91
92
  // try {
92
93
  // emoji = message.trim(); // .charAt(0);
@@ -1 +0,0 @@
1
- <div id="htmlCode" #htmlCode [innerHTML]="htmlText | safeHtml"></div>
@@ -1,79 +0,0 @@
1
- // @import '../../../../sass/variables';
2
-
3
- :root {
4
- --themeColor: #62a8ea;
5
- --foregroundColor: #ffffff;
6
- --buttonFontSize: 12px;
7
- }
8
-
9
-
10
- ::ng-deep {
11
-
12
- .button-html {
13
- padding: 8px 16px!important;
14
- position: relative;
15
- max-width: 300px;
16
- min-width: inherit;
17
- cursor: pointer !important;
18
- border: 1px solid #62a8ea;
19
- border-radius: 20px;
20
- margin: 3px;
21
- background: transparent;
22
- overflow: hidden;
23
- font-family: 'Muli', sans-serif !important;
24
- font-size: 12px !important;
25
- -o-text-overflow: ellipsis;
26
- text-overflow: ellipsis;
27
- white-space: nowrap;
28
- letter-spacing: -0.24px;
29
- -webkit-font-smoothing: antialiased;
30
- color: #62a8ea;
31
- line-height: 16px;
32
-
33
- }
34
-
35
- .url {
36
- transition: background-color .6s ease;
37
- .icon-button-action {
38
- position: absolute;
39
- top: -1px;
40
- right: 1px;
41
- svg {
42
- fill: #62a8ea;
43
- }
44
- }
45
- .icon-button-action-self{
46
- position: absolute;
47
- right: 1px;
48
- svg {
49
- fill: #62a8ea;
50
- }
51
- }
52
- &:focus,
53
- &:hover {
54
- color: white;
55
- background: #62a8ea;
56
- .icon-button-action, .icon-button-action-self {
57
- svg {
58
- fill: white;
59
- }
60
- }
61
- }
62
- &:active{
63
- font-size: 20px;
64
- }
65
- }
66
-
67
- .text-html{
68
- font-size: 1.4em;
69
- margin: 0;
70
- padding: 8px;
71
- font-style: normal;
72
- letter-spacing: normal;
73
- font-stretch: normal;
74
- font-variant: normal;
75
- font-weight: 300;
76
- overflow: hidden;
77
- }
78
-
79
- }
@@ -1,25 +0,0 @@
1
- import { async, ComponentFixture, TestBed } from '@angular/core/testing';
2
-
3
- import { HtmlComponent } from './html.component';
4
-
5
- describe('HtmlComponent', () => {
6
- let component: HtmlComponent;
7
- let fixture: ComponentFixture<HtmlComponent>;
8
-
9
- beforeEach(async(() => {
10
- TestBed.configureTestingModule({
11
- declarations: [ HtmlComponent ]
12
- })
13
- .compileComponents();
14
- }));
15
-
16
- beforeEach(() => {
17
- fixture = TestBed.createComponent(HtmlComponent);
18
- component = fixture.componentInstance;
19
- fixture.detectChanges();
20
- });
21
-
22
- it('should create', () => {
23
- expect(component).toBeTruthy();
24
- });
25
- });
@@ -1,33 +0,0 @@
1
- import { DomSanitizer, SafeHtml } from '@angular/platform-browser';
2
- import { Component, ElementRef, Input, OnInit, SimpleChange, SimpleChanges, ViewChild, ViewEncapsulation } from '@angular/core';
3
-
4
- @Component({
5
- selector: 'chat-html',
6
- templateUrl: './html.component.html',
7
- styleUrls: ['./html.component.scss']
8
- })
9
- export class HtmlComponent implements OnInit {
10
-
11
- @Input() htmlText: string;
12
- @Input() fontSize: string;
13
- @Input() themeColor: string;
14
- @Input() foregroundColor: string;
15
-
16
- @ViewChild('htmlCode', {static: true}) container;
17
-
18
- constructor(private elementRef: ElementRef) { }
19
-
20
- ngOnInit(){
21
-
22
- }
23
-
24
- ngOnChanges(changes: SimpleChanges){
25
- //decomment if element should have same color of themeColor and fregroundColor
26
- if(this.fontSize) this.elementRef.nativeElement.style.setProperty('--buttonFontSize', this.fontSize);
27
- if(this.themeColor) this.elementRef.nativeElement.style.setProperty('--themeColor', this.themeColor);
28
- if(this.foregroundColor) this.elementRef.nativeElement.style.setProperty('--foregroundColor', this.foregroundColor);
29
- }
30
-
31
-
32
-
33
- }
@@ -1,37 +0,0 @@
1
- {
2
- "t2y12PruGU9wUtEGzBJfolMIgK": "CAR:T-PAY:T-ANA:T-ACT:T-APP:T",
3
- "chatEngine": "firebase",
4
- "uploadEngine": "firebase",
5
- "pushEngine": "firebase",
6
- "logLevel": "info",
7
- "fileUploadAccept":"*/*",
8
- "authPersistence": "LOCAL",
9
- "supportMode": true,
10
- "writeToButton": true,
11
- "archivedButton": true,
12
- "firebaseConfig": {
13
- "tenant": "tilechat",
14
- "apiKey": "AIzaSyCoWXHNvP1-qOllCpTshhC6VjPXeRTK0T4",
15
- "authDomain": "chat21-pre-01.firebaseapp.com",
16
- "databaseURL": "https://chat21-pre-01.firebaseio.com",
17
- "projectId": "chat21-pre-01",
18
- "storageBucket": "chat21-pre-01.appspot.com",
19
- "messagingSenderId": "269505353043",
20
- "appId": "1:269505353043:web:b82af070572669e3707da6",
21
- "chat21ApiUrl": "https://us-central1-chat21-pre-01.cloudfunctions.net",
22
- "vapidKey": "BOsgS2ADwspKdWAmiFDZXEYqY1HSYADVfJT3j67wsySh3NxaViJqoabPJH8WM02wb5r8cQIm5TgM0UK047Z1D1c"
23
- },
24
- "chat21Config": {
25
- "appId": "tilechat",
26
- "MQTTendpoint": "ws://99.80.197.164:15675/ws",
27
- "APIendpoint": "http://99.80.197.164:8004/api",
28
- "loginServiceEndpoint": "http://99.80.197.164:/tilechat/signin"
29
- },
30
- "apiUrl": "https://tiledesk-server-pre.herokuapp.com/",
31
- "baseImageUrl": "https://firebasestorage.googleapis.com/v0/b/",
32
- "dashboardUrl": "/dashboard/",
33
- "wsUrl": "wss://tiledesk-server-pre.herokuapp.com/",
34
- "storage_prefix": "chat_sv5"
35
- }
36
-
37
-