@chat21/chat21-ionic 3.0.59-rc10 → 3.0.59-rc19

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 (27) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/README.md +5 -0
  3. package/config.xml +1 -10
  4. package/env.sample +1 -1
  5. package/package.json +1 -1
  6. package/src/app/app.component.ts +123 -45
  7. package/src/app/chatlib/conversation-detail/conversation-content/conversation-content.component.html +1 -1
  8. package/src/app/chatlib/list-conversations-component/list-conversations/list-conversations.component.html +1 -1
  9. package/src/app/components/authentication/login/login.component.html +8 -8
  10. package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.html +2 -4
  11. package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.ts +7 -2
  12. package/src/app/components/project-item/project-item.component.html +1 -1
  13. package/src/app/components/project-item/project-item.component.scss +6 -6
  14. package/src/app/components/project-item/project-item.component.ts +3 -2
  15. package/src/app/pages/authentication/login/login.page.html +1 -2
  16. package/src/app/pages/conversations-list/conversations-list.page.html +12 -7
  17. package/src/app/pages/conversations-list/conversations-list.page.scss +279 -261
  18. package/src/app/pages/conversations-list/conversations-list.page.ts +120 -14
  19. package/src/app/services/app-config.ts +77 -5
  20. package/src/app/services/websocket/websocket-js.ts +12 -14
  21. package/src/assets/logo.png +0 -0
  22. package/src/chat-config-template.json +1 -0
  23. package/src/chat-config.json +1 -0
  24. package/src/chat21-core/providers/tiledesk/tiledesk-auth.service.ts +12 -3
  25. package/src/chat21-core/utils/utils-message.ts +2 -2
  26. package/src/firebase-messaging-sw-template.js +1 -1
  27. package/src/assets/images/tiledesk_logo_50x50.png +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,34 @@
1
1
  # chat21-ionic ver 3.0
2
2
 
3
+ ### 3.0.59-rc19
4
+ - Fixes the bug: when the chat is in "mobile" mode and from the dashboard the agent clicks on "Open chat" for a specific conversation the "back" button of the chat does not return to the list of conversations
5
+ - Fixes the bug: when the chat is in "mobile" mode and from the dashboard the agent clicks on "Open chat" for a specific conversation the chat does not display the details of the conversation
6
+
7
+ ### 3.0.59-rc18
8
+ - Improves the "app-config" service
9
+
10
+ ### 3.0.59-rc16
11
+ - Changes in config.xml the value of the "SplashScreen"
12
+ - Improves the method to avoid page reloading when an agent clicks the "Open Chat" button of the dashboard on the realtime and non-real time conversation list page and on the conversation detail page
13
+ - Modifies the "app-config" service by adding the ability to pass relative URLs to the websocket
14
+ - Adds "wsUrlRel" property to env.sample, chat-config-template.json and chat-config.json
15
+ - Adds a check in the "websocket-js.ts" service on the existence of the "ws" property of the "WebSocketJs" class before accessing the property "readyState"
16
+
17
+ ### 3.0.59-rc15
18
+ - Implements a method in app.components that counts and stores the number of open Chat tabs
19
+ - Implements a method on the conversation list page that prevents a new chat tab from opening when the agent clicks "Open Chat" from the dashboard
20
+
21
+ ### 3.0.59-rc14
22
+ - Fixes the bug: the sound that warns that a new conversation has been received does not work
23
+
24
+ ### 3.0.59-rc12
25
+ - Fixes the bug: Cannot read properties of undefined (reading 'get') when "translationMap" in not yet defined
26
+ - Fixes the bug: when the log out is performed, the item with the number of new conversations remains visible in the left side panel of the conversations list
27
+
28
+ ### 3.0.59-rc11
29
+ - Fixed bug: the item in the left side panel showing the number of new conversations is not displayed if there are no conversations
30
+ - Removes the "last_project" object and the "contacts" object on logout from local storage
31
+
3
32
  ### 3.0.59-rc10
4
33
  - Changes in config.xml the site URL of the author
5
34
  - Changes the splash screen images
package/README.md CHANGED
@@ -60,6 +60,7 @@ In progress git
60
60
  pushEngine:"none", // OR YOUR CUSTOM PUSH ENGINE
61
61
  fileUploadAccept:"*/*",
62
62
  logLevel":"<YOUR-PREFERRED-LOG-LEVEL>",
63
+ supportMode: false,
63
64
  firebaseConfig: {
64
65
  tenant:"tilechat",
65
66
  apiKey: '123ABC..',
@@ -79,6 +80,7 @@ In progress git
79
80
  "apiUrl": "https://<YOUR-TILEDESK-API-URL>",
80
81
  "baseImageUrl": "https://<YOUR-BASE-IMAGE-URL>",
81
82
  "dashboardUrl": "https://<YOUR-DASHBOARD-URL>"
83
+ "wsUrl": 'ws://' + window.location.hostname + '/ws/',
82
84
  }
83
85
  };
84
86
  ```
@@ -88,6 +90,9 @@ In progress git
88
90
 
89
91
  * `fileUploadAccept`: The Chat21-ionic allows you to manage the type of files that can be uploaded. By default, all file types are accepted.
90
92
 
93
+ * `wsUrl`: allows you to know in real time the agent's availability status, the agent's busy status and the number of unassigned conversations for a selected project
94
+
95
+ * `supportMode`: if set to true it allows you to view the list of contacts from which you can make direct conversations and the item at the top of the list of conversations that shows the number of unassigned conversations of a selected project and that the agent can view and take over by clicking on it
91
96
 
92
97
  ### Push notification
93
98
  * open `/src/firebase-messaging-sw.js` and replace messagingSenderId: with < your messagingSenderId >
package/config.xml CHANGED
@@ -18,17 +18,8 @@
18
18
  <preference name="SplashMaintainAspectRatio" value="true" />
19
19
  <preference name="FadeSplashScreenDuration" value="300" />
20
20
  <preference name="SplashShowOnlyFirstTime" value="false" />
21
- <preference name="SplashScreen" value="assets/splash_white.jpg" />
21
+ <preference name="SplashScreen" value="assets/logo.png" />
22
22
  <preference name="SplashScreenDelay" value="3000" />
23
- <platform name="browser">
24
- <preference name="SplashScreen" value="assets/transparent.png" />
25
- <preference name="AutoHideSplashScreen" value="true" />
26
- <preference name="SplashScreenDelay" value="3000" />
27
- <preference name="SplashScreenBackgroundColor" value="white" />
28
- <preference name="ShowSplashScreen" value="false" />
29
- <preference name="SplashScreenWidth" value="600" />
30
- <preference name="SplashScreenHeight" value="300" />
31
- </platform>
32
23
  <platform name="android">
33
24
  <edit-config file="AndroidManifest.xml" mode="merge" target="/manifest/application" xmlns:android="http://schemas.android.com/apk/res/android">
34
25
  <application android:networkSecurityConfig="@xml/network_security_config" />
package/env.sample CHANGED
@@ -1,7 +1,7 @@
1
1
  API_BASEIMAGE_URL=CHANGEIT
2
2
  DASHBOARD_URL=https://YOUR_DASHBOARD_URL
3
3
  WS_URL=wss://YOUR_TILEDESK_SERVER_URL?token=
4
-
4
+ WS_URL_RELATIVE=********
5
5
  SERVER_BASE_URL=http://localhost:3000/
6
6
 
7
7
  CHAT21_ENGINE=mqtt
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chat21/chat21-ionic",
3
- "version": "3.0.59-rc10",
3
+ "version": "3.0.59-rc19",
4
4
  "author": "Tiledesk SRL",
5
5
  "homepage": "https://ionicframework.com/",
6
6
  "scripts": {
@@ -2,7 +2,7 @@ import { URL_SOUND_LIST_CONVERSATION } from './../chat21-core/utils/constants';
2
2
  import { ArchivedConversationsHandlerService } from 'src/chat21-core/providers/abstract/archivedconversations-handler.service';
3
3
  import { AppStorageService } from 'src/chat21-core/providers/abstract/app-storage.service';
4
4
 
5
- import { Component, ViewChild, NgZone, OnInit, HostListener, ElementRef, Renderer2, } from '@angular/core';
5
+ import { Component, ViewChild, NgZone, OnInit, HostListener, ElementRef, Renderer2, AfterViewInit, } from '@angular/core';
6
6
  import { Config, Platform, IonRouterOutlet, IonSplitPane, NavController, MenuController, AlertController, IonNav, ToastController } from '@ionic/angular';
7
7
  import { ActivatedRoute, NavigationStart, Router } from '@angular/router';
8
8
  import { Subscription, VirtualTimeScheduler } from 'rxjs';
@@ -57,7 +57,7 @@ import { NetworkService } from './services/network-service/network.service';
57
57
  import * as PACKAGE from 'package.json';
58
58
  import { filter } from 'rxjs/operators'
59
59
  import { WebSocketJs } from './services/websocket/websocket-js';
60
-
60
+ import { Location } from '@angular/common'
61
61
  // import { filter } from 'rxjs/operators';
62
62
 
63
63
  @Component({
@@ -108,7 +108,7 @@ export class AppComponent implements OnInit {
108
108
  private splashScreen: SplashScreen,
109
109
  private statusBar: StatusBar,
110
110
  private appConfigProvider: AppConfigProvider,
111
- private events: EventsService,
111
+ public events: EventsService,
112
112
  public config: Config,
113
113
  public chatManager: ChatManager,
114
114
  public translate: TranslateService,
@@ -139,35 +139,93 @@ export class AppComponent implements OnInit {
139
139
  // private tiledeskService: TiledeskService,
140
140
  private networkService: NetworkService,
141
141
  public webSocketJs: WebSocketJs,
142
+ public location: Location
142
143
  ) {
143
144
 
144
- // this.saveInStorageChatOpenedTab();
145
- // FOR TEST
146
- // const last_project = { "user_available": true, "number_assigned_requests": 59, "last_login_at": "2021-08-09T17:30:55.234Z", "status": "active", "_id": "6112bc8f58c958003495a2cb", "id_project": { "status": 100, "_id": "60ffe291f725db00347661ef", "name": "27-LUGLIO-21-STRIPE-TEST", "activeOperatingHours": false, "createdBy": "608ad02d3a4dc000344ade17", "profile": { "name": "pro", "trialDays": 30, "agents": 5, "type": "payment", "subStart": "2021-11-18T10:42:41.000Z", "subEnd": "2021-11-19T10:42:41.000Z", "subscriptionId": "sub_Jvf4kABe9t8JvX", "last_stripe_event": "invoice.payment_succeeded" }, "versions": 20115, "channels": [{ "name": "chat21" }], "createdAt": "2021-07-27T10:40:17.752Z", "updatedAt": "2021-11-18T11:55:01.346Z", "__v": 0, "widget": { "preChatForm": true, "preChatFormJson": [{ "name": "userFullname", "type": "text", "mandatory": true, "label": { "en": "Your name", "it": "Il tuo nome" } }, { "name": "userEmail", "type": "text", "mandatory": true, "regex": "/^(?=.{1,254}$)(?=.{1,64}@)[-!#$%&'*+/0-9=?A-Z^_`a-z{|}~]+(.[-!#$%&'*+/0-9=?A-Z^_`a-z{|}~]+)*@[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?(.[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?)+$/", "label": { "en": "Your email", "it": "La tua email" }, "errorLabel": { "en": "Invalid email address", "it": "Indirizzo email non valido" } }, { "name": "tel", "mandatory": true, "label": { "en": "Your phone number", "it": "Il tuo numero di telefono" } }], "preChatFormCustomFieldsEnabled": true }, "trialExpired": true, "trialDaysLeft": 84, "isActiveSubscription": true, "id": "60ffe291f725db00347661ef" }, "id_user": "60aa0fef1482fe00346854a7", "role": "admin", "createdBy": "608ad02d3a4dc000344ade17", "createdAt": "2021-08-10T17:51:11.318Z", "updatedAt": "2021-11-19T08:08:21.437Z", "__v": 0, "presence": { "status": "online", "changedAt": "2021-11-19T08:08:21.432Z" }, "isAuthenticated": true, "id": "6112bc8f58c958003495a2cb" }
147
- // localStorage.setItem('last_project', JSON.stringify(last_project))
148
- }
149
- saveInStorageChatOpenedTab() {
150
- // if (+localStorage.tabCount > 0) {
151
- // alert('Already open!');
152
- // } else {
153
- // localStorage.tabCount = 0;
154
- // }
145
+ this.saveInStorageNumberOfOpenedChatTab();
146
+
147
+ this.listenToUrlChanges();
148
+ // this.getPageState();
149
+
150
+ // location.subscribe((val) => {
151
+
152
+ // console.log('location subscribe val', val)
153
+ // if (val.type == "hashchange") {
154
+ // const convId = getParameterByName('convId')
155
+ // console.log('[APP-COMP] ngOnInit convId get with getParameterByName ', convId)
156
+ // const requesterFullaname = getParameterByName('requester_fullaname')
157
+ // console.log('[APP-COMP] ngOnInit convId get with getParameterByName ', requesterFullaname);
155
158
 
156
- // window.addEventListener('load', (event) => {
157
- // console.log('[CONVS-LIST-PAGE] page is fully loaded', event);
158
- // // let tab = + localStorage.getItem('tab')
159
- // // console.log('[CONVS-LIST-PAGE] page is fully loaded getItem tab', + tab);
160
- // // localStorage.setItem('tab', "1" )
161
- // localStorage.tabCount = +localStorage.tabCount + 1;
159
+ // this.navigateToDetail(convId, requesterFullaname)
160
+
161
+ // this.events.publish('convid:haschanged', convId);
162
+ // }
162
163
  // });
163
164
 
164
- // // https://developers.google.com/web/updates/2018/07/page-lifecycle-api#the-beforeunload-event
165
- // const terminationEvent = 'onpagehide' in self ? 'pagehide' : 'unload';
166
- // window.addEventListener(terminationEvent, (event) => {
167
- // console.log('[CONVS-LIST-PAGE] page is terminationEvent', event);
168
- // localStorage.tabCount = +localStorage.tabCount - 1;
169
- // }, { capture: true });
165
+
166
+
167
+
168
+ }
169
+
170
+ listenToUrlChanges() {
171
+ const self = this;
172
+ window.addEventListener('hashchange', function () {
173
+ // console.log('location changed!');
174
+
175
+ const convId = getParameterByName('convId')
176
+ // console.log('[APP-COMP] getParameterByName convId ', convId)
177
+ if (convId) {
178
+ setTimeout(() => {
179
+ self.events.publish('supportconvid:haschanged', convId);
180
+ }, 0);
181
+ }
182
+
183
+ const contact_id = getParameterByName('contact_id')
184
+ // console.log('[APP-COMP] getParameterByName contact_id ', contact_id)
185
+ const contact_fullname = getParameterByName('contact_fullname')
186
+ // console.log('[APP-COMP] getParameterByName contact_fullname ', contact_fullname)
187
+ if (contact_id && contact_fullname) {
188
+ setTimeout(() => {
189
+ self.router.navigateByUrl('conversation-detail/' + contact_id + '/' + contact_fullname + '/new');
190
+ self.events.publish('directconvid:haschanged', contact_id);
191
+ }, 0);
192
+
193
+ } else {
194
+ // console.log('[APP-COMP] contact_id and contact_fullname are null')
195
+ }
196
+
197
+ const conversation_detail = getParameterByName('conversation_detail')
198
+ // console.log('[APP-COMP] getParameterByName conversation_detail ', conversation_detail)
199
+ if (conversation_detail) {
200
+ setTimeout(() => {
201
+ self.router.navigate(['conversation-detail/'])
202
+ }, 0);
203
+ }
204
+ });
205
+ }
206
+
207
+ saveInStorageNumberOfOpenedChatTab() {
208
+ this.logger.log('Calling saveInStorageChatOpenedTab!');
209
+
210
+ // https://jsfiddle.net/jjjs5wd3/3/å
211
+ if (+localStorage.tabCount > 0) {
212
+ this.logger.log('Chat IONIC Already open!');
213
+ } else {
214
+ localStorage.tabCount = 0;
215
+
216
+ localStorage.tabCount = +localStorage.tabCount + 1;
217
+ }
218
+ const terminationEvent = 'onpagehide' in self ? 'pagehide' : 'unload';
219
+ window.addEventListener(terminationEvent, (event) => {
220
+ if (localStorage.tabCount > 0) {
221
+ localStorage.tabCount = +localStorage.tabCount - 1;
222
+ }
223
+ }, { capture: true });
224
+ }
225
+
226
+ getPageState() {
170
227
  const getState = () => {
228
+ localStorage.setItem('visibilityState', document.visibilityState)
171
229
  if (document.visibilityState === 'hidden') {
172
230
  return 'hidden';
173
231
  }
@@ -178,16 +236,20 @@ export class AppComponent implements OnInit {
178
236
  };
179
237
 
180
238
  let state = getState();
181
- console.log('[CONVS-LIST-PAGE] page state ', state)
182
- if (state === 'hidden') {
183
- localStorage.setItem('hidden', 'true')
184
- }
239
+ // console.log('[CONVS-LIST-PAGE] page state ', state)
240
+ // if (state === 'hidden') {
241
+ // console.log(`State change: state ${state}`);
242
+ // localStorage.setItem('hidden', 'true')
243
+ // }
185
244
 
186
245
  const logStateChange = (nextState) => {
246
+
187
247
  const prevState = state;
188
248
  if (nextState !== prevState) {
189
249
  console.log(`State change: ${prevState} >>> ${nextState}`);
190
250
  state = nextState;
251
+ localStorage.setItem('state', nextState)
252
+
191
253
  }
192
254
  };
193
255
 
@@ -207,11 +269,12 @@ export class AppComponent implements OnInit {
207
269
  // If the event's persisted property is `true` the page is about
208
270
  // to enter the Back-Forward Cache, which is also in the frozen state.
209
271
  logStateChange('frozen');
210
- localStorage.setItem('terminated', 'true')
272
+ localStorage.setItem('state', 'frozen')
211
273
  } else {
212
274
  // If the event's persisted property is not `true` the page is
213
275
  // about to be unloaded.
214
276
  logStateChange('terminated');
277
+ localStorage.setItem('state', 'terminated')
215
278
  localStorage.setItem('terminated', 'true')
216
279
  }
217
280
  }, { capture: true });
@@ -240,7 +303,7 @@ export class AppComponent implements OnInit {
240
303
  if (token) {
241
304
  // this.isOnline = false;
242
305
  // this.logger.log('[APP-COMP] ngOnInit AUTOLOGIN token get with this.isOnline ', this.isOnline)
243
- this.logger.log('[APP-COMP] ngOnInit AUTOLOGIN token get with getParameterByName ', token)
306
+ console.log('[APP-COMP] ngOnInit AUTOLOGIN token get with getParameterByName ', token)
244
307
  // save token in local storage then
245
308
 
246
309
  const storedToken = this.appStorageService.getItem('tiledeskToken');
@@ -252,13 +315,13 @@ export class AppComponent implements OnInit {
252
315
  this.logger.log('[APP-COMP] ngOnInit AUTOLOGIN the current user already exist DON\'T SAVE ')
253
316
  }
254
317
  }
255
- this.initializeApp('oninit');
256
318
 
319
+
320
+ this.initializeApp('oninit');
257
321
  this.listenToPostMsgs();
258
322
  }
259
323
 
260
-
261
-
324
+
262
325
  listenToPostMsgs() {
263
326
  window.addEventListener("message", (event) => {
264
327
  // console.log("[APP-COMP] message event ", event);
@@ -391,7 +454,7 @@ export class AppComponent implements OnInit {
391
454
  if (this.platform.is('desktop')) {
392
455
  // console.log("running on desktop!");
393
456
  }
394
-
457
+
395
458
 
396
459
 
397
460
 
@@ -577,13 +640,14 @@ export class AppComponent implements OnInit {
577
640
  * @param user
578
641
  */
579
642
  goOnLine = () => {
643
+ // console.log('[APP-COMP] - GO-ONLINE ');
580
644
  // this.isOnline = true;
581
645
  // this.logger.info('initialize FROM [APP-COMP] - [APP-COMP] - GO-ONLINE isOnline ', this.isOnline);
582
646
 
583
647
  // clearTimeout(this.timeModalLogin);
584
648
  const tiledeskToken = this.tiledeskAuthService.getTiledeskToken();
585
649
  this.connetWebsocket(tiledeskToken)
586
-
650
+ this.events.publish('go:online', true);
587
651
  const currentUser = this.tiledeskAuthService.getCurrentUser();
588
652
  // this.logger.printDebug('APP-COMP - goOnLine****', currentUser);
589
653
  this.logger.log('[APP-COMP] - GO-ONLINE - currentUser ', currentUser);
@@ -619,10 +683,11 @@ export class AppComponent implements OnInit {
619
683
  webSocketClose() {
620
684
  this.logger.log('[APP-COMP] - GO-OFFLINE - webSocketClose');
621
685
  this.webSocketJs.close()
686
+ this.events.publish('go:offline', true);
622
687
  }
623
688
 
624
689
  goOffLine = () => {
625
- this.logger.log('[APP-COMP] - GO-OFFLINE');
690
+ // console.log('[APP-COMP] - GO-OFFLINE');
626
691
 
627
692
  this.webSocketClose()
628
693
  // this.isOnline = false;
@@ -666,7 +731,7 @@ export class AppComponent implements OnInit {
666
731
  }
667
732
 
668
733
  checkPlatform() {
669
- this.logger.debug('[APP-COMP] checkPlatform');
734
+ console.log('[APP-COMP] checkPlatform');
670
735
  // let pageUrl = '';
671
736
  // try {
672
737
  // const pathPage = this.route.snapshot.firstChild.routeConfig.path;
@@ -682,16 +747,21 @@ export class AppComponent implements OnInit {
682
747
  // }
683
748
 
684
749
  if (checkPlatformIsMobile()) {
750
+ // console.log('[APP-COMP] checkPlatformIsMobile',checkPlatformIsMobile());
685
751
  this.platformIs = PLATFORM_MOBILE;
686
752
  const IDConv = this.route.snapshot.firstChild.paramMap.get('IDConv');
687
- this.logger.log('[APP-COMP] PLATFORM_MOBILE2 navigateByUrl', PLATFORM_MOBILE, this.route.snapshot);
753
+ // console.log('[APP-COMP] platformIs', this.platformIs);
754
+ // console.log('[APP-COMP] PLATFORM', PLATFORM_MOBILE, 'route.snapshot', this.route.snapshot);
688
755
  if (!IDConv) {
689
756
  this.router.navigateByUrl('conversations-list')
690
757
  }
691
758
  // this.router.navigateByUrl(pageUrl);
692
759
  // this.navService.setRoot(ConversationListPage, {});
693
760
  } else {
761
+ // console.log('[APP-COMP] checkPlatformIsMobile',checkPlatformIsMobile());
694
762
  this.platformIs = PLATFORM_DESKTOP;
763
+ // console.log('[APP-COMP] platformIs', this.platformIs);
764
+ // console.log('[APP-COMP] PLATFORM', PLATFORM_DESKTOP, 'route.snapshot', this.route.snapshot);
695
765
  this.logger.log('[APP-COMP] PLATFORM_DESKTOP ', this.navService);
696
766
 
697
767
  this.navService.setRoot(ConversationListPage, {});
@@ -731,16 +801,23 @@ export class AppComponent implements OnInit {
731
801
  }
732
802
 
733
803
  private initAudio() {
804
+ // console.log('HERE IS initAudio ')
734
805
  // SET AUDIO
806
+ const href = window.location.href;
807
+ const hrefArray = href.split('/#/');
808
+ const chatBaseUrl = hrefArray[0]
809
+ // console.log('initAudio href', href)
810
+ // console.log('initAudio chatBaseUrl', chatBaseUrl)
811
+
735
812
  this.audio = new Audio();
736
- this.audio.src = URL_SOUND_LIST_CONVERSATION;
813
+ this.audio.src = chatBaseUrl + URL_SOUND_LIST_CONVERSATION;
737
814
  this.audio.load();
738
815
  }
739
816
 
740
817
  private manageTabNotification() {
741
818
  if (!this.isTabVisible) {
742
819
  // TAB IS HIDDEN --> manage title and SOUND
743
-
820
+ // console.log('HERE IS manageTabNotification ')
744
821
  let badgeNewConverstionNumber = this.conversationsHandlerService.countIsNew()
745
822
  badgeNewConverstionNumber > 0 ? badgeNewConverstionNumber : badgeNewConverstionNumber = 1
746
823
  document.title = "(" + badgeNewConverstionNumber + ") " + this.tabTitle
@@ -759,6 +836,7 @@ export class AppComponent implements OnInit {
759
836
  }
760
837
 
761
838
  soundMessage() {
839
+ // console.log('HERE IS soundMessage ')
762
840
  const that = this;
763
841
  // this.audio = new Audio();
764
842
  // // this.audio.src = '/assets/sounds/pling.mp3';
@@ -770,7 +848,7 @@ export class AppComponent implements OnInit {
770
848
  that.audio.play().then(() => {
771
849
  that.logger.debug('[APP-COMP] ****** soundMessage played *****');
772
850
  }).catch((error: any) => {
773
- that.logger.debug('[APP-COMP] ***soundMessage error*', error);
851
+ that.logger.error('[APP-COMP] ***soundMessage error*', error);
774
852
  });
775
853
  }, 1000);
776
854
  }
@@ -833,7 +911,7 @@ export class AppComponent implements OnInit {
833
911
 
834
912
  this.conversationsHandlerService.conversationChanged.subscribe((conversation: ConversationModel) => {
835
913
 
836
- this.logger.log('[APP-COMP] ***** subscribeConversationChanged conversation: ', conversation);
914
+ // console.log('[APP-COMP] ***** subscribeConversationChanged conversation: ', conversation);
837
915
  const currentUser = JSON.parse(this.appStorageService.getItem('currentUser'));
838
916
  this.logger.log('[APP-COMP] ***** subscribeConversationChanged current_user: ', currentUser);
839
917
 
@@ -852,7 +930,7 @@ export class AppComponent implements OnInit {
852
930
  * apro dettaglio conversazione
853
931
  */
854
932
  subscribeChangedConversationSelected = (user: UserModel, type: string) => {
855
- this.logger.log('[APP-COMP] subscribeUidConvSelectedChanged navigateByUrl', user, type);
933
+ console.log('[APP-COMP] subscribeUidConvSelectedChanged navigateByUrl', user, type);
856
934
  // this.router.navigateByUrl('conversation-detail/' + user.uid + '?conversationWithFullname=' + user.fullname);
857
935
  this.router.navigateByUrl('conversation-detail/' + user.uid + '/' + user.fullname + '/' + type);
858
936
  }
@@ -10,7 +10,7 @@
10
10
  <div class="chat21-bounce1" [ngStyle]="{'background-color': stylesMap.get('themeColor')}"></div>
11
11
  <div class="chat21-bounce2" [ngStyle]="{'background-color': stylesMap.get('themeColor')}"></div>
12
12
  <div class="chat21-bounce3" [ngStyle]="{'background-color': stylesMap.get('themeColor')}"></div>
13
- <span>{{translationMap.get('LABEL_LOADING')}}</span>
13
+ <span>{{translationMap?.get('LABEL_LOADING')}}</span>
14
14
  </div>
15
15
  </span>
16
16
 
@@ -34,7 +34,7 @@
34
34
  width="24px" height="24px" viewBox="0 0 24 24">
35
35
  <path fill="none" d="M0 0h24v24H0z"/>
36
36
  <path d="M13 3c-4.97 0-9 4.03-9 9H1l3.89 3.89.07.14L9 12H6c0-3.87 3.13-7 7-7s7 3.13 7 7-3.13 7-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42C8.27 19.99 10.51 21 13 21c4.97 0 9-4.03 9-9s-4.03-9-9-9zm-1 5v5l4.28 2.54.72-1.21-3.5-2.08V8H12z"/>
37
- <title id="altIconTitle">{{ translationMap.get('CLOSED') }}</title>
37
+ <title id="altIconTitle">{{ translationMap?.get('CLOSED') }}</title>
38
38
  </svg>
39
39
  </button>
40
40
  </div>
@@ -8,25 +8,25 @@
8
8
 
9
9
  <div class="signin-title" style="text-align:center">
10
10
  <h2 style="font-family: 'Montserrat', sans-serif; font-weight: 400;">
11
- {{ translationMap.get('LABEL_SIGNIN_TO') }}
11
+ {{ translationMap?.get('LABEL_SIGNIN_TO') }}
12
12
  {{companyName}}
13
13
  </h2>
14
14
  </div>
15
15
  <div class="login-container">
16
16
  <form [formGroup]="userForm" (ngSubmit)="signInWithEmailAndPassword()" novalidate>
17
17
 
18
- <ion-label stacked for="email">{{ translationMap.get('LABEL_EMAIL') }}</ion-label>
18
+ <ion-label stacked for="email">{{ translationMap?.get('LABEL_EMAIL') }}</ion-label>
19
19
  <ion-input #email formControlName="email" type="email" id="email" required autocapitalize="off" spellcheck="false"
20
- placeholder="{{ translationMap.get('LABEL_PLACEHOLDER_EMAIL') }}"
20
+ placeholder="{{ translationMap?.get('LABEL_PLACEHOLDER_EMAIL') }}"
21
21
  [class.invalid]="!userForm.controls.email.valid" ></ion-input>
22
22
  <div *ngIf="formErrors.email" class="is-danger">
23
23
  {{ formErrors.email }}
24
24
  </div>
25
25
 
26
26
 
27
- <ion-label stacked for="password">{{ translationMap.get('LABEL_PASSWORD') }}</ion-label>
27
+ <ion-label stacked for="password">{{ translationMap?.get('LABEL_PASSWORD') }}</ion-label>
28
28
  <ion-input #password formControlName="password" type="password" id="password" required
29
- placeholder="{{ translationMap.get('LABEL_PLACEHOLDER_PASSWORD') }}"
29
+ placeholder="{{ translationMap?.get('LABEL_PLACEHOLDER_PASSWORD') }}"
30
30
  [class.invalid]="!userForm.controls.password.valid"></ion-input>
31
31
 
32
32
  <div *ngIf="formErrors.password" class="is-danger">
@@ -36,7 +36,7 @@
36
36
 
37
37
  <button type="submit" class="btn signin-button ion-activatable ripple-parent" [ngClass]="{'signin-button-is-disabled': !userForm.valid}" [disabled]="!userForm.valid">
38
38
  <span class="signin-button-label" *ngIf="showSpinnerInLoginBtn === false" >
39
- {{ translationMap.get('LABEL_SIGNIN') }}
39
+ {{ translationMap?.get('LABEL_SIGNIN') }}
40
40
  </span>
41
41
  <ion-ripple-effect type="unbounded"></ion-ripple-effect>
42
42
  <ion-spinner *ngIf="showSpinnerInLoginBtn === true" name="bubbles" color="white" duration="2" ></ion-spinner>
@@ -50,9 +50,9 @@
50
50
  </p> -->
51
51
 
52
52
  <p style="color: #666666; font-size: 1.1em; text-align: center; margin-top: 16px;">
53
- {{ translationMap.get('LABEL_FORGOT_YOUR_PASSWORD') }}
53
+ {{ translationMap?.get('LABEL_FORGOT_YOUR_PASSWORD') }}
54
54
  <span style="color: #03a5e8; cursor:pointer" (click)="goToResetPsw()">
55
- {{ translationMap.get('LABEL_CLICK_HERE') }}
55
+ {{ translationMap?.get('LABEL_CLICK_HERE') }}
56
56
  </span>
57
57
  </p>
58
58
 
@@ -3,10 +3,8 @@
3
3
  <ion-toolbar>
4
4
 
5
5
  <ion-buttons slot="start">
6
- <!-- (click)="pushPage('conversations-list')" -->
7
- <ion-back-button text="" *ngIf="isMobile"
8
- defaultHref="/conversations-list"
9
- >
6
+ <!-- (click)="pushPage('conversations-list')" defaultHref="/conversations-list" -->
7
+ <ion-back-button style="display: block;" text="" *ngIf="isMobile" (click)="goBackToConversationList()">
10
8
  </ion-back-button>
11
9
  </ion-buttons>
12
10
 
@@ -1,5 +1,5 @@
1
1
  import { Component, OnInit, Input, Output, EventEmitter, OnChanges } from '@angular/core';
2
- import { ActivatedRoute } from '@angular/router';
2
+ import { ActivatedRoute, Router } from '@angular/router';
3
3
  import { ImageRepoService } from 'src/chat21-core/providers/abstract/image-repo.service';
4
4
 
5
5
  // Logger
@@ -43,7 +43,8 @@ export class HeaderConversationDetailComponent implements OnInit, OnChanges {
43
43
  constructor(
44
44
  public imageRepoService: ImageRepoService,
45
45
  private route: ActivatedRoute,
46
- public platform: Platform
46
+ public platform: Platform,
47
+ private router: Router
47
48
  ) {
48
49
  this.route.paramMap.subscribe(params => {
49
50
 
@@ -125,4 +126,8 @@ export class HeaderConversationDetailComponent implements OnInit, OnChanges {
125
126
  /** */
126
127
  pushPage(event) { }
127
128
 
129
+ goBackToConversationList() {
130
+ this.router.navigateByUrl('/conversations-list');
131
+ }
132
+
128
133
  }
@@ -130,7 +130,7 @@
130
130
  </svg>
131
131
  </div>
132
132
  <span *ngIf="project?.ws_projct_user_isBusy === true" class="project-item--isBusy-busy-text text-pulse-animation">
133
- {{translationMap.get('Busy')}}
133
+ {{translationMap?.get('Busy')}}
134
134
  </span>
135
135
  </div>
136
136
 
@@ -4,7 +4,7 @@
4
4
  padding-top: 0px;
5
5
  margin-top: 0px !important;
6
6
  padding-bottom: 0px !important;
7
- background: #fff;
7
+ // background: #fff;
8
8
  padding-left: 0px;
9
9
  width: 100%;
10
10
  // min-height: 70px;
@@ -12,12 +12,12 @@
12
12
  min-height: 55px;
13
13
  height: 55px;
14
14
  position: relative;
15
- top: -4px;
15
+ top: -5px;
16
16
  }
17
17
 
18
- .main-content-project-for-panel:hover {
19
- background-color: rgb(244, 243, 244);
20
- }
18
+ // .main-content-project-for-panel:hover {
19
+ // background-color: rgb(244, 243, 244);
20
+ // }
21
21
  .container-project-for-panel {
22
22
  padding: 0px !important;
23
23
  width: 296px;
@@ -298,7 +298,7 @@
298
298
 
299
299
  .availabily-and-busy-wpr {
300
300
  // margin-top: 6px;
301
- margin-top: 4px;
301
+ margin-top: 7px;
302
302
  margin-left: 11px;
303
303
  }
304
304
 
@@ -117,13 +117,14 @@ export class ProjectItemComponent implements OnInit {
117
117
  let stored_project = ''
118
118
  try {
119
119
  stored_project = localStorage.getItem('last_project')
120
+ this.logger.log('PROJECT-ITEM - THERE IS A STORED PROJECT ', stored_project)
120
121
  } catch (err) {
121
- console.log('Get loacal storage item LAST PROJECT ', err)
122
+ this.logger.log('Get local storage LAST PROJECT ', err)
122
123
  }
123
124
 
124
125
 
125
126
  if (!stored_project) {
126
- console.log('PROJECT-ITEM - THERE IS NOT STORED LAST PROJECT ', stored_project)
127
+ this.logger.log('PROJECT-ITEM - THERE IS NOT STORED LAST PROJECT ', stored_project)
127
128
  const tiledeskToken = this.appStorageService.getItem('tiledeskToken');
128
129
  this.logger.log('[INFO-CONTENT-COMP] - GET PROJECTS - tiledeskToken', tiledeskToken);
129
130
  this.tiledeskService.getProjects(tiledeskToken).subscribe(projects => {
@@ -3,6 +3,5 @@
3
3
  [translationMap] = translationMap
4
4
  [companyLogoBlackUrl]= companyLogoBlackUrl
5
5
  [companyName]= companyName
6
- (eventSignInWithEmailAndPassword)="returnSignInWithEmailAndPassword($event)"
7
- >
6
+ (eventSignInWithEmailAndPassword)="returnSignInWithEmailAndPassword($event)">
8
7
  </component-login>