@chat21/chat21-web-widget 5.0.52-rc.3 → 5.0.52

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 (29) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/dist/assets/twp/chatbot-panel.html +4 -65
  3. package/dist/main.js +1 -1
  4. package/package.json +1 -1
  5. package/src/app/app.component.ts +2 -12
  6. package/src/app/component/conversation-detail/conversation/conversation.component.ts +0 -30
  7. package/src/app/component/conversation-detail/conversation-content/conversation-content.component.ts +0 -1
  8. package/src/app/component/conversation-detail/conversation-footer/conversation-footer.component.ts +0 -2
  9. package/src/app/component/conversation-detail/conversation-preview/conversation-preview.component.ts +0 -1
  10. package/src/app/component/eyeeye-catcher-card/eyeeye-catcher-card.component.ts +1 -2
  11. package/src/app/component/form/prechat-form/prechat-form.component.ts +0 -12
  12. package/src/app/component/home-conversations/home-conversations.component.ts +12 -72
  13. package/src/app/component/list-conversations/list-conversations.component.ts +1 -57
  14. package/src/app/component/message/avatar/avatar.component.ts +0 -1
  15. package/src/app/component/message/bubble-message/bubble-message.component.ts +0 -2
  16. package/src/app/component/message/image/image.component.ts +0 -1
  17. package/src/app/providers/global-settings.service.ts +0 -1
  18. package/src/app/providers/translator.service.ts +0 -2
  19. package/src/app/utils/globals.ts +1 -7
  20. package/src/assets/twp/chatbot-panel.html +4 -65
  21. package/src/chat21-core/providers/firebase/firebase-archivedconversations-handler.ts +0 -41
  22. package/src/chat21-core/providers/firebase/firebase-conversation-handler.ts +0 -4
  23. package/src/chat21-core/providers/firebase/firebase-image-repo.ts +0 -2
  24. package/src/chat21-core/providers/firebase/firebase-notifications.ts +1 -75
  25. package/src/chat21-core/providers/mqtt/chat-service.ts +1 -3
  26. package/src/chat21-core/providers/mqtt/mqtt-archivedconversations-handler.ts +0 -1
  27. package/src/chat21-core/providers/mqtt/mqtt-conversations-handler.ts +2 -1
  28. package/src/chat21-core/providers/mqtt/mqtt-notifications.ts +0 -2
  29. package/src/chat21-core/providers/mqtt/mqtt-presence.service.ts +0 -13
@@ -48,13 +48,7 @@ export class FirebaseNotifications extends NotificationsService {
48
48
  });
49
49
  } else {
50
50
  this.logger.log("[FIREBASE-NOTIFICATIONS] initialize - Service Worker is supported on this browser - !not registered",)
51
- // navigator.serviceWorker.register('http://localhost:8101/firebase-messaging-sw.js')
52
- // .then(function (registration) {
53
- // console.log('Service worker successfully registered.');
54
- // return registration;
55
- // }).catch(function (err) {
56
- // console.error('Unable to register service worker.', err);
57
- // });
51
+
58
52
  }
59
53
  });
60
54
  }
@@ -98,61 +92,6 @@ export class FirebaseNotifications extends NotificationsService {
98
92
  }
99
93
  }
100
94
 
101
- // getNotificationPermissionAndSaveToken(currentUserUid) {
102
- // // this.tenant = this.getTenant();
103
- // this.logger.log('[FIREBASE-NOTIFICATIONS] calling requestPermission - tenant ', this.tenant)
104
- // this.logger.log('[FIREBASE-NOTIFICATIONS] calling requestPermission - currentUserUid ', currentUserUid)
105
- // this.userId = currentUserUid;
106
- // const messaging = firebase.messaging();
107
- // if (firebase.messaging.isSupported()) {
108
- // // messaging.requestPermission()
109
- // Notification.requestPermission().then((permission) => {
110
- // if (permission === 'granted') {
111
- // this.logger.log('[FIREBASE-NOTIFICATIONS] >>>> requestPermission Notification permission granted.');
112
- // messaging.getToken({ vapidKey: 'BOsgS2ADwspKdWAmiFDZXEYqY1HSYADVfJT3j67wsySh3NxaViJqoabPJH8WM02wb5r8cQIm5TgM0UK047Z1D1c'}).then((currentToken) => {
113
- // if (currentToken) {
114
- // this.sendTokenToServer(currentToken);
115
- // // updateUIForPushEnabled(currentToken);
116
-
117
- // } else {
118
- // // Show permission request UI
119
- // console.log('No registration token available. Request permission to generate one.');
120
- // // ...
121
- // }
122
- // }).catch((err) => {
123
- // console.log('An error occurred while retrieving token. ', err);
124
- // // ...
125
- // });
126
-
127
- // resetUI()
128
-
129
- // } else {
130
- // this.logger.error('Unable to get permission to notify.');
131
- // }
132
- // })
133
-
134
- // }
135
- // }
136
-
137
- // sendTokenToServer(currentToken) {
138
- // if (!this.isTokenSentToServer()) {
139
- // console.log('Sending token to server...');
140
- // // TODO(developer): Send the current token to your server.
141
- // this.setTokenSentToServer(true);
142
- // } else {
143
- // console.log('Token already sent to server so won\'t send it again ' +
144
- // 'unless it changes');
145
- // }
146
- // }
147
-
148
- // isTokenSentToServer() {
149
- // return window.localStorage.getItem('sentToServer') === '1';
150
- // }
151
-
152
- // setTokenSentToServer(sent) {
153
- // window.localStorage.setItem('sentToServer', sent ? '1' : '0');
154
- // }
155
-
156
95
  removeNotificationsInstance(callback: (string) => void) {
157
96
  var self = this;
158
97
  firebase.auth().onAuthStateChanged(function (user) {
@@ -190,19 +129,6 @@ export class FirebaseNotifications extends NotificationsService {
190
129
  }
191
130
  }
192
131
 
193
- // removeNotificationsInstance() {
194
- // let promise = new Promise((resolve, reject) => {
195
- // this.appStoreService.getInstallation(this.projectId).then((res) => {
196
- // console.log("Get Installation Response: ", res);
197
- // resolve(res);
198
- // }).catch((err) => {
199
- // console.error("Error getting installation: ", err);
200
- // reject(err);
201
- // })
202
- // })
203
- // return promise;
204
- // }
205
-
206
132
 
207
133
  // ********** PRIVATE METHOD - START ****************//
208
134
  private updateToken(FCMcurrentToken, currentUserUid) {
@@ -34,10 +34,8 @@ export class Chat21Service {
34
34
  }
35
35
  if (!this.chatClient) {
36
36
  this.chatClient = new Chat21Client(this._config);
37
- }
38
- else {
37
+ } else {
39
38
  console.log("Did you try again to create a Chat21Client istance?");
40
39
  }
41
- // console.log("chatClient init. ID:", this.chatClient.client_id)
42
40
  }
43
41
  }
@@ -63,7 +63,6 @@ export class MQTTArchivedConversationsHandler extends ArchivedConversationsHandl
63
63
  const conversation = this.archivedConversations.find(conv => conv.conversation_with === conversationWith);
64
64
  this.logger.log('[MQTTArchivedConversationsHandler] getConversationDetail found locally? *****: ', conversation);
65
65
  if (conversation) {
66
- console.log('found!');
67
66
  callback(conversation);
68
67
  } else {
69
68
  this.logger.log('[MQTTArchivedConversationsHandler] getConversationDetail Not found locally, remote.getConversationDetail *****: ', conversation);
@@ -195,7 +195,8 @@ export class MQTTConversationsHandler extends ConversationsHandlerService {
195
195
  this.logger.debug('[MQTTConversationsHandler] getLastConversation ', conversations, 'err', err);
196
196
  if (!err) {
197
197
  if(conversations && conversations.length > 0){
198
- callback(conversations[0], null)
198
+ let conversation = this.completeConversation(conversations[0]);
199
+ callback(conversation, null)
199
200
  }else {
200
201
  callback(null, null)
201
202
 
@@ -35,10 +35,8 @@ export class MQTTNotifications extends NotificationsService {
35
35
  }
36
36
 
37
37
  getNotificationPermissionAndSaveToken(currentUserUid) {
38
- console.log("[MQTTNotificationService] getNotificationPermissionAndSaveToken()",currentUserUid );
39
38
  this.userId = currentUserUid;
40
39
  if (firebase.messaging.isSupported()) {
41
- console.log("[MQTTNotificationService] firebase.messaging.isSupported -> YES");
42
40
  const messaging = firebase.messaging();
43
41
  // messaging.requestPermission()
44
42
  Notification.requestPermission().then((permission) => {
@@ -43,19 +43,6 @@ export class MQTTPresenceService extends PresenceService {
43
43
  }
44
44
 
45
45
  userIsOnline(userid: string): Observable<any> {
46
- // console.log('userIsOnline', userid);
47
- // const that = this;
48
- // const urlNodeConnections = this.urlNodePresence + userid + '/connections';
49
- // console.log('userIsOnline: ', urlNodeConnections);
50
- // const connectionsRef = firebase.database().ref().child(urlNodeConnections);
51
- // connectionsRef.on('value', (child) => {
52
- // console.log('is-online-' + userid);
53
- // if (child.val()) {
54
- // that.events.publish('is-online-' + userid, userid, true);
55
- // } else {
56
- // that.events.publish('is-online-' + userid, userid, false);
57
- // }
58
- // });
59
46
  return this.BSIsOnline
60
47
  }
61
48