@chat21/chat21-ionic 3.0.82-rc.3 → 3.0.82-rc.6

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,9 @@
1
1
  # chat21-ionic ver 3.0
2
2
 
3
+ ### 3.0.82-rc.6
4
+ - bug-fixed: axios is undefined in chat21Client.js
5
+ - bug-fixed: if userImage not exist in sidebar--user-detail, no info of fillColor exist
6
+
3
7
  ### 3.0.82-rc.3
4
8
  - bug-fixed: incorrect dashboard urls in navbar
5
9
  - changed: used logger in mqtt auth service
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.82-rc.3",
4
+ "version": "3.0.82-rc.6",
5
5
  "license": "MIT License",
6
6
  "homepage": "https://tiledesk.com/",
7
7
  "repository": {
@@ -25,9 +25,9 @@
25
25
  onerror="this.src='assets/images/no_image_user.png'" />
26
26
 
27
27
  <div *ngIf="!USER_PHOTO_PROFILE_EXIST" class="user-img-in-sidebar-user-details"
28
- [ngStyle]="{'background': 'linear-gradient(rgb(255,255,255) -125%,' + user?.color + ')'}">
28
+ [ngStyle]="{'background': 'linear-gradient(rgb(255,255,255) -125%,' + user?.fillColour + ')'}">
29
29
  <span id="sidebaravatar-altenative-user-avatar" class="sidebar-user-details-altenative-user-avatar">
30
- {{ user?.avatar }}
30
+ {{ user?.fullname_initial }}
31
31
  </span>
32
32
  </div>
33
33
 
@@ -41,7 +41,7 @@ export class SidebarUserDetailsComponent implements OnInit, OnChanges {
41
41
 
42
42
  isVisiblePAY: boolean;
43
43
  public_Key: any
44
- USER_PHOTO_PROFILE_EXIST: boolean;
44
+ USER_PHOTO_PROFILE_EXIST: boolean = false;
45
45
  version: string
46
46
  company_name: string = 'Tiledesk'
47
47
  DASHBOARD_URL: string;
@@ -90,7 +90,8 @@ export class SidebarUserDetailsComponent implements OnInit, OnChanges {
90
90
  const currentUser = JSON.parse(storedCurrentUser);
91
91
  this.logger.log('[SIDEBAR-USER-DETAILS] - subcribeToAuthStateChanged - currentUser ', currentUser)
92
92
  if (currentUser) {
93
- this.user = currentUser;
93
+ this.user = currentUser
94
+ this.createUserAvatar(this.user);
94
95
  this.getCurrentChatLangAndTranslateLabels(this.user);
95
96
  this.photo_profile_URL = this.imageRepoService.getImagePhotoUrl(this.user.uid)
96
97
  this.logger.log('[SIDEBAR-USER-DETAILS] photo_profile_URL ', this.photo_profile_URL);
@@ -105,7 +106,7 @@ export class SidebarUserDetailsComponent implements OnInit, OnChanges {
105
106
 
106
107
  checkIfExistPhotoProfile(imageUrl) {
107
108
  this.verifyImageURL(imageUrl, (imageExists) => {
108
-
109
+
109
110
  if (imageExists === true) {
110
111
  this.USER_PHOTO_PROFILE_EXIST = true;
111
112
  this.logger.log('[SIDEBAR-USER-DETAILS] photo_profile_URL IMAGE EXIST ', imageExists)
@@ -129,6 +130,23 @@ export class SidebarUserDetailsComponent implements OnInit, OnChanges {
129
130
  };
130
131
  }
131
132
 
133
+ createUserAvatar(currentUser) {
134
+ this.logger.log('[SIDEBAR] - createProjectUserAvatar ', currentUser)
135
+ let fullname = ''
136
+ if (currentUser && currentUser.firstname && currentUser.lastname) {
137
+ fullname = currentUser.firstname + ' ' + currentUser.lastname
138
+ currentUser['fullname_initial'] = avatarPlaceholder(fullname)
139
+ currentUser['fillColour'] = getColorBck(fullname)
140
+ } else if (currentUser && currentUser.firstname) {
141
+ fullname = currentUser.firstname
142
+ currentUser['fullname_initial'] = avatarPlaceholder(fullname)
143
+ currentUser['fillColour'] = getColorBck(fullname)
144
+ } else {
145
+ currentUser['fullname_initial'] = 'N/A'
146
+ currentUser['fillColour'] = 'rgb(98, 100, 167)'
147
+ }
148
+ }
149
+
132
150
  // listenOpenUserSidebarEvent() {
133
151
  // this.events.subscribe('userdetailsidebar:opened', (openUserDetailsSidebar) => {
134
152
  // this.logger.log('[SIDEBAR-USER-DETAILS] - listenOpenUserSidebarEvent - openUserDetailsSidebar', openUserDetailsSidebar);
@@ -41,7 +41,7 @@ export class WebsocketService {
41
41
 
42
42
  self.webSocketJs.ref(path, 'subscriptionToWsCurrentUser_allProject',
43
43
  function (data, notification) {
44
- // console.log("[WS-SERV] SUBSCR TO WS CURRENT PROJECT-USER AVAILABILITY - CREATE - data ", data);
44
+ console.log("[WS-SERV] SUBSCR TO WS CURRENT PROJECT-USER AVAILABILITY - CREATE - data ", data);
45
45
  resolve(data)
46
46
  // self.currentUserWsAvailability$.next(data.user_available);
47
47
  self.currentProjectUserAvailability$.next(data)
@@ -1057,8 +1057,8 @@ class Chat21Client {
1057
1057
  }
1058
1058
 
1059
1059
  function isBrowser() {
1060
- // return true;
1061
- return false;
1060
+ return true;
1061
+ // return false;
1062
1062
  }
1063
1063
 
1064
1064
  export { Chat21Client }; // Browser
@@ -21,9 +21,9 @@
21
21
  "APIendpoint": "http://localhost:8004/api",
22
22
  "_log": true
23
23
  },
24
- "apiUrl": "http://localhost:3000/",
24
+ "apiUrl": "http://localhost:8081/api/",
25
25
  "baseImageUrl": "http://localhost:3000/",
26
- "dashboardUrl": "http://localhost:8081/",
26
+ "dashboardUrl": "http://localhost:8081/dashboard/",
27
27
  "testsiteBaseUrl": "http://localhost:8081/widget/assets/twp/index.html",
28
28
  "logLevel": "DEBUG",
29
29
  "authPersistence": "LOCAL",