@chat21/chat21-ionic 3.0.102 → 3.0.103-rc.2
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 +18 -0
- package/angular.json +25 -11
- package/config.xml +5 -5
- package/package.json +76 -43
- package/src/app/app-routing.module.ts +13 -10
- package/src/app/app.component.ts +102 -116
- package/src/app/app.module.ts +29 -18
- package/src/app/chatlib/conversation-detail/conversation-content/conversation-content.component.html +8 -8
- package/src/app/components/authentication/login/login.component.html +31 -2
- package/src/app/components/authentication/login/login.component.scss +63 -0
- package/src/app/components/authentication/login/login.component.ts +12 -5
- package/src/app/components/canned-response/canned-response.component.html +3 -0
- package/src/app/components/canned-response/canned-response.component.ts +7 -0
- package/src/app/components/conversation-detail/message-text-area/message-text-area.component.ts +2 -2
- package/src/app/components/conversation-info/conversation-info.module.ts +23 -1
- package/src/app/modals/send-email/send-email.page.ts +4 -4
- package/src/app/modals/send-whatsapp-template/send-whatsapp-template.module.ts +0 -1
- package/src/app/pages/authentication/login/login.page.html +1 -1
- package/src/app/pages/authentication/login/login.page.ts +1 -1
- package/src/app/pages/conversation-detail/conversation-detail.module.ts +55 -18
- package/src/app/pages/conversation-detail/conversation-detail.page.html +1 -0
- package/src/app/pages/conversation-detail/conversation-detail.page.ts +33 -13
- package/src/app/pages/conversations-list/conversations-list.module.ts +24 -4
- package/src/app/services/tiledesk/tiledesk.service.ts +2 -2
- package/src/app/shared/shared.module.ts +92 -69
- package/src/assets/i18n/en.json +30 -30
- package/src/assets/js/chat21client.js +1 -1
- package/src/chat21-core/models/projects.ts +9 -9
- package/src/chat21-core/providers/abstract/conversations-handler.service.ts +0 -1
- package/src/chat21-core/providers/abstract/groups-handler.service.ts +0 -1
- package/src/chat21-core/providers/abstract/notifications.service.ts +1 -1
- package/src/chat21-core/providers/firebase/firebase-notifications.ts +30 -15
- package/src/chat21-core/providers/mqtt/mqtt-conversation-handler.ts +0 -1
- package/src/chat21-core/providers/mqtt/mqtt-conversations-handler.ts +3 -3
- package/src/chat21-core/providers/mqtt/mqtt-notifications.ts +31 -5
- package/src/chat21-core/providers/tiledesk/tiledesk-auth.service.ts +0 -2
- package/src/chat21-core/utils/constants.ts +6 -0
- package/src/chat21-core/utils/convertRequestToConversation.ts +1 -1
- package/src/chat21-core/utils/utils-message.ts +4 -4
- package/src/chat21-core/utils/utils.ts +0 -16
- package/tsconfig.app.json +0 -1
- package/src/app/shared/shared-conversation-info.module.ts +0 -33
- package/src/models/department.ts +0 -12
package/src/app/app.component.ts
CHANGED
|
@@ -1,75 +1,48 @@
|
|
|
1
|
+
import { Component, HostListener, NgZone, OnInit, ViewChild } from '@angular/core';
|
|
1
2
|
|
|
2
|
-
import {
|
|
3
|
-
import { tranlatedLanguage, URL_SOUND_CONVERSATION_ADDED, URL_SOUND_LIST_CONVERSATION } from 'src/chat21-core/utils/constants';
|
|
4
|
-
import { ArchivedConversationsHandlerService } from 'src/chat21-core/providers/abstract/archivedconversations-handler.service';
|
|
5
|
-
import { AppStorageService } from 'src/chat21-core/providers/abstract/app-storage.service';
|
|
6
|
-
|
|
7
|
-
import { Component, ViewChild, NgZone, OnInit, HostListener, ElementRef, Renderer2, AfterViewInit, isDevMode} from '@angular/core';
|
|
8
|
-
import { Config, Platform, IonRouterOutlet, IonSplitPane, NavController, MenuController, AlertController, IonNav, ToastController } from '@ionic/angular';
|
|
9
|
-
import { ActivatedRoute, NavigationStart, Router } from '@angular/router';
|
|
10
|
-
import { Subscription, VirtualTimeScheduler } from 'rxjs';
|
|
11
|
-
import { ModalController } from '@ionic/angular';
|
|
12
|
-
|
|
13
|
-
// import * as firebase from 'firebase/app';
|
|
14
|
-
import firebase from "firebase/app";
|
|
15
|
-
import 'firebase/auth'; // nk in watch connection status
|
|
16
|
-
|
|
17
|
-
import { StatusBar } from '@ionic-native/status-bar/ngx';
|
|
3
|
+
import { AlertController, Config, IonNav, IonRouterOutlet, ModalController, NavController, Platform, ToastController } from '@ionic/angular';
|
|
18
4
|
import { SplashScreen } from '@ionic-native/splash-screen/ngx';
|
|
19
|
-
import {
|
|
5
|
+
import { StatusBar } from '@ionic-native/status-bar/ngx';
|
|
20
6
|
|
|
21
|
-
|
|
22
|
-
import {
|
|
23
|
-
|
|
24
|
-
|
|
7
|
+
import { Subscription } from 'rxjs';
|
|
8
|
+
import { LoggerService } from 'src/chat21-core/providers/abstract/logger.service';
|
|
9
|
+
import { LoggerInstance } from 'src/chat21-core/providers/logger/loggerInstance';
|
|
10
|
+
import { WebSocketJs } from './services/websocket/websocket-js';
|
|
11
|
+
import { checkPlatformIsMobile, getParameterByName, isOnMobileDevice } from 'src/chat21-core/utils/utils';
|
|
25
12
|
import { EventsService } from './services/events-service';
|
|
26
|
-
import { MessagingAuthService } from '../chat21-core/providers/abstract/messagingAuth.service';
|
|
27
|
-
import { PresenceService } from '../chat21-core/providers/abstract/presence.service';
|
|
28
|
-
import { TypingService } from '../chat21-core/providers/abstract/typing.service';
|
|
29
|
-
import { UploadService } from '../chat21-core/providers/abstract/upload.service';
|
|
30
|
-
// import { ChatPresenceHandler} from './services/chat-presence-handler';
|
|
31
13
|
import { NavProxyService } from './services/nav-proxy.service';
|
|
14
|
+
import { TiledeskAuthService } from 'src/chat21-core/providers/tiledesk/tiledesk-auth.service';
|
|
15
|
+
import { MessagingAuthService } from 'src/chat21-core/providers/abstract/messagingAuth.service';
|
|
16
|
+
import { AppConfigProvider } from './services/app-config';
|
|
17
|
+
import { AppStorageService } from 'src/chat21-core/providers/abstract/app-storage.service';
|
|
18
|
+
import { environment } from 'src/environments/environment';
|
|
32
19
|
import { ChatManager } from 'src/chat21-core/providers/chat-manager';
|
|
33
|
-
|
|
20
|
+
import { TranslateService } from '@ngx-translate/core';
|
|
21
|
+
import { PresenceService } from 'src/chat21-core/providers/abstract/presence.service';
|
|
22
|
+
import { TypingService } from 'src/chat21-core/providers/abstract/typing.service';
|
|
23
|
+
import { UploadService } from 'src/chat21-core/providers/abstract/upload.service';
|
|
34
24
|
import { ConversationsHandlerService } from 'src/chat21-core/providers/abstract/conversations-handler.service';
|
|
25
|
+
import { ArchivedConversationsHandlerService } from 'src/chat21-core/providers/abstract/archivedconversations-handler.service';
|
|
35
26
|
import { CustomTranslateService } from 'src/chat21-core/providers/custom-translate.service';
|
|
36
|
-
|
|
37
|
-
// pages
|
|
38
|
-
import { LoginPage } from './pages/authentication/login/login.page';
|
|
39
|
-
import { ConversationListPage } from './pages/conversations-list/conversations-list.page';
|
|
40
|
-
|
|
41
|
-
// utils
|
|
42
|
-
import { checkPlatformIsMobile, isGroup, getParameterByName, searchIndexInArrayForUid, compareValues, stripTags, isOnMobileDevice } from 'src/chat21-core/utils/utils';
|
|
43
|
-
import { STORAGE_PREFIX, PLATFORM_MOBILE, PLATFORM_DESKTOP, CHAT_ENGINE_FIREBASE, AUTH_STATE_OFFLINE, AUTH_STATE_ONLINE } from 'src/chat21-core/utils/constants';
|
|
44
|
-
import { environment } from '../environments/environment';
|
|
45
|
-
import { UserModel } from '../chat21-core/models/user';
|
|
46
|
-
import { ConversationModel } from 'src/chat21-core/models/conversation';
|
|
47
|
-
import { LoggerService } from 'src/chat21-core/providers/abstract/logger.service';
|
|
48
|
-
import { LoggerInstance } from 'src/chat21-core/providers/logger/loggerInstance';
|
|
49
|
-
import { TiledeskAuthService } from 'src/chat21-core/providers/tiledesk/tiledesk-auth.service';
|
|
50
|
-
// FCM
|
|
51
27
|
import { NotificationsService } from 'src/chat21-core/providers/abstract/notifications.service';
|
|
52
|
-
import { getImageUrlThumbFromFirebasestorage } from 'src/chat21-core/utils/utils-user';
|
|
53
|
-
|
|
54
|
-
// import { Network } from '@ionic-native/network/ngx';
|
|
55
|
-
// import { Observable, Observer, fromEvent, merge, of } from 'rxjs';
|
|
56
|
-
// import { mapTo } from 'rxjs/operators';
|
|
57
|
-
import { TiledeskService } from './services/tiledesk/tiledesk.service';
|
|
58
28
|
import { NetworkService } from './services/network-service/network.service';
|
|
59
|
-
import { filter } from 'rxjs/operators'
|
|
60
|
-
import { WebSocketJs } from './services/websocket/websocket-js';
|
|
61
|
-
import { Location } from '@angular/common'
|
|
62
29
|
import { ScriptService } from './services/scripts/script.service';
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
30
|
+
import { AUTH_STATE_OFFLINE, AUTH_STATE_ONLINE, PLATFORM_DESKTOP, PLATFORM_MOBILE, tranlatedLanguage, TYPE_DIRECT, URL_SOUND_CONVERSATION_ADDED, URL_SOUND_CONVERSATION_UNASSIGNED, URL_SOUND_LIST_CONVERSATION } from 'src/chat21-core/utils/constants';
|
|
31
|
+
import { ActivatedRoute, Router } from '@angular/router';
|
|
32
|
+
import { ConversationModel } from 'src/chat21-core/models/conversation';
|
|
33
|
+
import { LoginPage } from './pages/authentication/login/login.page';
|
|
34
|
+
import { UserModel } from 'src/chat21-core/models/user';
|
|
35
|
+
import { filter } from 'rxjs/operators';
|
|
36
|
+
import { ConversationListPage } from './pages/conversations-list/conversations-list.page';
|
|
37
|
+
import { Location } from '@angular/common'
|
|
38
|
+
import { FCM } from 'cordova-plugin-fcm-with-dependecy-updated/ionic/ngx'
|
|
39
|
+
import { Deeplinks } from '@ionic-native/deeplinks/ngx';
|
|
66
40
|
|
|
67
41
|
@Component({
|
|
68
42
|
selector: 'app-root',
|
|
69
43
|
templateUrl: 'app.component.html',
|
|
70
44
|
styleUrls: ['app.component.scss']
|
|
71
45
|
})
|
|
72
|
-
|
|
73
46
|
export class AppComponent implements OnInit {
|
|
74
47
|
@ViewChild('sidebarNav', { static: false }) sidebarNav: IonNav;
|
|
75
48
|
@ViewChild('detailNav', { static: false }) detailNav: IonRouterOutlet;
|
|
@@ -122,6 +95,7 @@ export class AppComponent implements OnInit {
|
|
|
122
95
|
private platform: Platform,
|
|
123
96
|
private splashScreen: SplashScreen,
|
|
124
97
|
private statusBar: StatusBar,
|
|
98
|
+
private deeplinks: Deeplinks,
|
|
125
99
|
private appConfigProvider: AppConfigProvider,
|
|
126
100
|
public events: EventsService,
|
|
127
101
|
public config: Config,
|
|
@@ -137,7 +111,6 @@ export class AppComponent implements OnInit {
|
|
|
137
111
|
public presenceService: PresenceService,
|
|
138
112
|
private router: Router,
|
|
139
113
|
private route: ActivatedRoute,
|
|
140
|
-
private renderer: Renderer2,
|
|
141
114
|
private navService: NavProxyService,
|
|
142
115
|
// public chatPresenceHandler: ChatPresenceHandler,
|
|
143
116
|
public typingService: TypingService,
|
|
@@ -156,19 +129,31 @@ export class AppComponent implements OnInit {
|
|
|
156
129
|
public webSocketJs: WebSocketJs,
|
|
157
130
|
public scriptService: ScriptService,
|
|
158
131
|
public location: Location,
|
|
159
|
-
|
|
132
|
+
private fcm: FCM
|
|
160
133
|
) {
|
|
161
134
|
|
|
162
|
-
|
|
163
135
|
this.saveInStorageNumberOfOpenedChatTab();
|
|
164
136
|
this.listenChatAlreadyOpenWithoutParamsInMobileMode()
|
|
165
137
|
this.IS_ON_MOBILE_DEVICE = isOnMobileDevice()
|
|
166
|
-
// this.listenToUrlChanges();
|
|
167
|
-
// this.getPageState();
|
|
168
138
|
}
|
|
169
139
|
|
|
140
|
+
saveInStorageNumberOfOpenedChatTab() {
|
|
141
|
+
// this.logger.log('Calling saveInStorageChatOpenedTab!');
|
|
142
|
+
// https://jsfiddle.net/jjjs5wd3/3/å
|
|
143
|
+
if (+localStorage.tabCount > 0) {
|
|
144
|
+
this.logger.log('Chat IONIC Already open!');
|
|
145
|
+
} else {
|
|
146
|
+
localStorage.tabCount = 0;
|
|
170
147
|
|
|
171
|
-
|
|
148
|
+
localStorage.tabCount = +localStorage.tabCount + 1;
|
|
149
|
+
}
|
|
150
|
+
const terminationEvent = 'onpagehide' in self ? 'pagehide' : 'unload';
|
|
151
|
+
window.addEventListener(terminationEvent, (event) => {
|
|
152
|
+
if (localStorage.tabCount > 0) {
|
|
153
|
+
localStorage.tabCount = +localStorage.tabCount - 1;
|
|
154
|
+
}
|
|
155
|
+
}, { capture: true });
|
|
156
|
+
}
|
|
172
157
|
|
|
173
158
|
listenChatAlreadyOpenWithoutParamsInMobileMode() {
|
|
174
159
|
this.events.subscribe('noparams:mobile', (isAlreadyOpenInMobileMode) => {
|
|
@@ -273,35 +258,7 @@ export class AppComponent implements OnInit {
|
|
|
273
258
|
// }
|
|
274
259
|
|
|
275
260
|
|
|
276
|
-
|
|
277
|
-
// this.logger.log('Calling saveInStorageChatOpenedTab!');
|
|
278
|
-
// https://jsfiddle.net/jjjs5wd3/3/å
|
|
279
|
-
if (+localStorage.tabCount > 0) {
|
|
280
|
-
this.logger.log('Chat IONIC Already open!');
|
|
281
|
-
} else {
|
|
282
|
-
localStorage.tabCount = 0;
|
|
283
|
-
|
|
284
|
-
localStorage.tabCount = +localStorage.tabCount + 1;
|
|
285
|
-
}
|
|
286
|
-
const terminationEvent = 'onpagehide' in self ? 'pagehide' : 'unload';
|
|
287
|
-
window.addEventListener(terminationEvent, (event) => {
|
|
288
|
-
if (localStorage.tabCount > 0) {
|
|
289
|
-
localStorage.tabCount = +localStorage.tabCount - 1;
|
|
290
|
-
}
|
|
291
|
-
}, { capture: true });
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
// param() {
|
|
297
|
-
// // PARAM
|
|
298
|
-
// const url: URL = new URL(window.top.location.href);
|
|
299
|
-
// const params: URLSearchParams = url.searchParams;
|
|
300
|
-
// return params;
|
|
301
|
-
// }
|
|
302
|
-
/**
|
|
303
|
-
*/
|
|
304
|
-
ngOnInit() {
|
|
261
|
+
ngOnInit(): void {
|
|
305
262
|
const appconfig = this.appConfigProvider.getConfig();
|
|
306
263
|
this.logger.log('[APP-COMP] ngOnInit appconfig', appconfig)
|
|
307
264
|
if (appconfig && appconfig.supportMode && (appconfig.supportMode === true || appconfig.supportMode === 'true')) {
|
|
@@ -435,10 +392,7 @@ export class AppComponent implements OnInit {
|
|
|
435
392
|
})
|
|
436
393
|
}
|
|
437
394
|
|
|
438
|
-
/** */
|
|
439
395
|
initializeApp(calledby: string) {
|
|
440
|
-
// this.logger.log('[APP-COMP] - X - initializeApp !!! CALLED-BY: ', calledby);
|
|
441
|
-
// console.log('[APP-COMP] appconfig platform is cordova: ', this.platform.is('cordova'))
|
|
442
396
|
|
|
443
397
|
if (!this.platform.is('desktop')) {
|
|
444
398
|
this.splashScreen.show();
|
|
@@ -460,13 +414,10 @@ export class AppComponent implements OnInit {
|
|
|
460
414
|
this.notificationsEnabled = true;
|
|
461
415
|
this.zone = new NgZone({}); // a cosa serve?
|
|
462
416
|
|
|
463
|
-
// ------------------------------------------
|
|
464
|
-
// Platform ready
|
|
465
|
-
// ------------------------------------------
|
|
466
417
|
this.platform.ready().then(() => {
|
|
467
|
-
|
|
468
|
-
this.getPlatformName();
|
|
418
|
+
let platform = this.getPlatformName();
|
|
469
419
|
|
|
420
|
+
this.initDeeplinks();
|
|
470
421
|
// this.setLanguage();
|
|
471
422
|
|
|
472
423
|
if (this.splashScreen) {
|
|
@@ -474,8 +425,6 @@ export class AppComponent implements OnInit {
|
|
|
474
425
|
}
|
|
475
426
|
this.statusBar.styleLightContent();
|
|
476
427
|
this.navService.init(this.sidebarNav, this.detailNav);
|
|
477
|
-
// this.persistence = appconfig.authPersistence;
|
|
478
|
-
// this.appStorageService.initialize(environment.storage_prefix, this.persistence, '')
|
|
479
428
|
this.tiledeskAuthService.initialize(this.appConfigProvider.getConfig().apiUrl);
|
|
480
429
|
this.messagingAuthService.initialize();
|
|
481
430
|
|
|
@@ -488,7 +437,7 @@ export class AppComponent implements OnInit {
|
|
|
488
437
|
const vap_id_Key = this.appConfigProvider.getConfig().firebaseConfig.vapidKey
|
|
489
438
|
|
|
490
439
|
if (pushEngine && pushEngine !== 'none') {
|
|
491
|
-
this.notificationsService.initialize(this.tenant, vap_id_Key)
|
|
440
|
+
this.notificationsService.initialize(this.tenant, vap_id_Key, platform)
|
|
492
441
|
}
|
|
493
442
|
this.uploadService.initialize();
|
|
494
443
|
|
|
@@ -507,22 +456,11 @@ export class AppComponent implements OnInit {
|
|
|
507
456
|
this.watchToConnectionStatus();
|
|
508
457
|
|
|
509
458
|
|
|
510
|
-
// this.fcm.onNotification().subscribe(data => {
|
|
511
|
-
// if (data.wasTapped) {
|
|
512
|
-
// console.log("Received in background");
|
|
513
|
-
// } else {
|
|
514
|
-
// console.log("Received in foreground");
|
|
515
|
-
// };
|
|
516
|
-
// });
|
|
517
|
-
|
|
518
|
-
// this.fcm.onTokenRefresh().subscribe(token => {
|
|
519
|
-
// // Register your new token in your back-end if you want
|
|
520
|
-
// // backend.registerToken(token);
|
|
521
|
-
// });
|
|
522
459
|
});
|
|
523
460
|
}
|
|
524
461
|
|
|
525
|
-
getPlatformName() {
|
|
462
|
+
getPlatformName(): string {
|
|
463
|
+
let platform: string = ''
|
|
526
464
|
if (this.platform.is('cordova')) {
|
|
527
465
|
this.logger.log("the device running Cordova");
|
|
528
466
|
}
|
|
@@ -532,18 +470,23 @@ export class AppComponent implements OnInit {
|
|
|
532
470
|
|
|
533
471
|
if (this.platform.is('android')) {
|
|
534
472
|
this.logger.log("running on Android device!");
|
|
473
|
+
platform = 'android'
|
|
535
474
|
}
|
|
536
475
|
if (this.platform.is('ios')) {
|
|
537
476
|
this.logger.log("running on iOS device!");
|
|
477
|
+
platform = 'ios'
|
|
538
478
|
}
|
|
539
479
|
if (this.platform.is('mobileweb')) {
|
|
540
480
|
this.logger.log("running in a browser on mobile!");
|
|
481
|
+
platform = 'mobileweb'
|
|
541
482
|
}
|
|
542
483
|
if (this.platform.is('desktop')) {
|
|
543
484
|
this.logger.log("running on desktop!");
|
|
485
|
+
platform = 'desktop'
|
|
544
486
|
}
|
|
545
|
-
}
|
|
546
487
|
|
|
488
|
+
return platform
|
|
489
|
+
}
|
|
547
490
|
|
|
548
491
|
getRouteParamsAndSetLoggerConfig() {
|
|
549
492
|
const appconfig = this.appConfigProvider.getConfig();
|
|
@@ -559,6 +502,18 @@ export class AppComponent implements OnInit {
|
|
|
559
502
|
});
|
|
560
503
|
}
|
|
561
504
|
|
|
505
|
+
initDeeplinks(){
|
|
506
|
+
this.deeplinks.route({'/conversation-detail': ConversationListPage}).subscribe(match => {
|
|
507
|
+
this.logger.log('[APP-COMP] deeplinks match route', JSON.stringify(match.$args))
|
|
508
|
+
if(match.$args && match.$args.jwt){
|
|
509
|
+
this.appStorageService.setItem('tiledeskToken', decodeURIComponent(match.$args.jwt))
|
|
510
|
+
this.initAuthentication()
|
|
511
|
+
}
|
|
512
|
+
}, (nomatch)=> {
|
|
513
|
+
this.logger.error("[APP-COMP] deeplinks: Got a deeplink that didn't match", nomatch);
|
|
514
|
+
})
|
|
515
|
+
}
|
|
516
|
+
|
|
562
517
|
/** */
|
|
563
518
|
setLanguage(currentUser) {
|
|
564
519
|
// const currentUser = JSON.parse(this.appStorageService.getItem('currentUser'));
|
|
@@ -1115,6 +1070,7 @@ export class AppComponent implements OnInit {
|
|
|
1115
1070
|
if (currentUser) {
|
|
1116
1071
|
if (pushEngine && pushEngine !== 'none') {
|
|
1117
1072
|
this.notificationsService.getNotificationPermissionAndSaveToken(currentUser.uid);
|
|
1073
|
+
this.handleNotifications()
|
|
1118
1074
|
}
|
|
1119
1075
|
this.presenceService.setPresence(currentUser.uid);
|
|
1120
1076
|
|
|
@@ -1385,6 +1341,37 @@ export class AppComponent implements OnInit {
|
|
|
1385
1341
|
}
|
|
1386
1342
|
}
|
|
1387
1343
|
|
|
1344
|
+
private handleNotifications(){
|
|
1345
|
+
if(this.platform.is('cordova')){
|
|
1346
|
+
this.fcm.onNotification().subscribe(data => {
|
|
1347
|
+
let pageUrl = 'conversation-detail/'
|
|
1348
|
+
if (data.wasTapped) {
|
|
1349
|
+
console.log("FCM: Received in background", JSON.stringify(data));
|
|
1350
|
+
let IDConv = data.channel_type === "group" ? data.recipient : data.sender;
|
|
1351
|
+
let FullNameConv = data.sender_fullname
|
|
1352
|
+
let Convtype = 'active'
|
|
1353
|
+
|
|
1354
|
+
if (IDConv && FullNameConv) {
|
|
1355
|
+
pageUrl += IDConv + '/' + FullNameConv + '/' + Convtype
|
|
1356
|
+
}
|
|
1357
|
+
// replace(/\(/g, '%28').replace(/\)/g, '%29') -> used for the encoder of any round brackets
|
|
1358
|
+
this.router.navigateByUrl(pageUrl.replace(/\(/g, '%28').replace(/\)/g, '%29').replace( /#/g, "%23" ));
|
|
1359
|
+
} else {
|
|
1360
|
+
console.log("FCM: Received in foreground", JSON.stringify(data));
|
|
1361
|
+
// let IDConv = data.recipient
|
|
1362
|
+
// let FullNameConv = data.sender_fullname
|
|
1363
|
+
// let Convtype = 'active'
|
|
1364
|
+
|
|
1365
|
+
// if (IDConv && FullNameConv) {
|
|
1366
|
+
// pageUrl += IDConv + '/' + FullNameConv + '/' + Convtype
|
|
1367
|
+
// }
|
|
1368
|
+
// // replace(/\(/g, '%28').replace(/\)/g, '%29') -> used for the encoder of any round brackets
|
|
1369
|
+
// this.router.navigateByUrl(pageUrl.replace(/\(/g, '%28').replace(/\)/g, '%29').replace( /#/g, "%23" ));
|
|
1370
|
+
};
|
|
1371
|
+
});
|
|
1372
|
+
}
|
|
1373
|
+
}
|
|
1374
|
+
|
|
1388
1375
|
private loadCustomScript(config){
|
|
1389
1376
|
if(config.hasOwnProperty("globalRemoteJSSrc")){
|
|
1390
1377
|
this.scriptService.buildScriptArray(config['globalRemoteJSSrc'])
|
|
@@ -1599,4 +1586,3 @@ export class AppComponent implements OnInit {
|
|
|
1599
1586
|
// console.log('HostListener onBlur-->', event)
|
|
1600
1587
|
// }
|
|
1601
1588
|
}
|
|
1602
|
-
|
package/src/app/app.module.ts
CHANGED
|
@@ -7,15 +7,20 @@ import { RouteReuseStrategy } from '@angular/router';
|
|
|
7
7
|
import { BrowserModule } from '@angular/platform-browser';
|
|
8
8
|
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
9
9
|
import { IonicModule, IonicRouteStrategy } from '@ionic/angular';
|
|
10
|
-
import { SplashScreen } from '@ionic-native/splash-screen/ngx';
|
|
11
|
-
import { StatusBar } from '@ionic-native/status-bar/ngx';
|
|
12
10
|
import { ActivatedRoute } from '@angular/router';
|
|
13
11
|
import { TranslateLoader, TranslateModule, TranslatePipe } from '@ngx-translate/core';
|
|
14
12
|
import { TranslateHttpLoader } from '@ngx-translate/http-loader';
|
|
15
13
|
import { HttpClient, HttpClientModule } from '@angular/common/http';
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
//NATIVE
|
|
16
17
|
import { Keyboard } from '@ionic-native/keyboard/ngx';
|
|
17
18
|
import { Chooser } from '@ionic-native/chooser/ngx';
|
|
18
19
|
import { LoggerModule, NGXLogger, NgxLoggerLevel } from "ngx-logger";
|
|
20
|
+
import { SplashScreen } from '@ionic-native/splash-screen/ngx';
|
|
21
|
+
import { StatusBar } from '@ionic-native/status-bar/ngx';
|
|
22
|
+
import { InAppBrowser } from '@ionic-native/in-app-browser/ngx';
|
|
23
|
+
import { FCM } from 'cordova-plugin-fcm-with-dependecy-updated/ionic/ngx';
|
|
19
24
|
|
|
20
25
|
// COMPONENTS
|
|
21
26
|
import { AppComponent } from './app.component';
|
|
@@ -108,6 +113,7 @@ import { UnassignedConversationsPageModule } from './pages/unassigned-conversati
|
|
|
108
113
|
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
|
109
114
|
import { MapsPageModule } from './modals/maps/maps.module';
|
|
110
115
|
import { GoogleMapsModule } from '@angular/google-maps';
|
|
116
|
+
import { Deeplinks } from '@ionic-native/deeplinks/ngx';
|
|
111
117
|
|
|
112
118
|
// FACTORIES
|
|
113
119
|
export function createTranslateLoader(http: HttpClient) {
|
|
@@ -234,12 +240,12 @@ export function uploadFactory(http: HttpClient, appConfig: AppConfigProvider, ap
|
|
|
234
240
|
}
|
|
235
241
|
}
|
|
236
242
|
|
|
237
|
-
export function notificationsServiceFactory(appConfig: AppConfigProvider, chat21Service: Chat21Service) {
|
|
243
|
+
export function notificationsServiceFactory(appConfig: AppConfigProvider, chat21Service: Chat21Service, fcm: FCM) {
|
|
238
244
|
const config = appConfig.getConfig()
|
|
239
245
|
if (config.pushEngine === PUSH_ENGINE_FIREBASE) {
|
|
240
|
-
return new FirebaseNotifications();
|
|
246
|
+
return new FirebaseNotifications(fcm);
|
|
241
247
|
} else if (config.pushEngine === PUSH_ENGINE_MQTT) {
|
|
242
|
-
return new MQTTNotifications(chat21Service);
|
|
248
|
+
return new MQTTNotifications(chat21Service, fcm);
|
|
243
249
|
} else {
|
|
244
250
|
return;
|
|
245
251
|
}
|
|
@@ -269,7 +275,6 @@ const appInitializerFn = (appConfig: AppConfigProvider, logger: NGXLogger) => {
|
|
|
269
275
|
IonicModule.forRoot(),
|
|
270
276
|
AppRoutingModule,
|
|
271
277
|
HttpClientModule,
|
|
272
|
-
LoginPageModule,
|
|
273
278
|
ConversationListPageModule,
|
|
274
279
|
ConversationDetailPageModule,
|
|
275
280
|
UnassignedConversationsPageModule,
|
|
@@ -291,16 +296,19 @@ const appInitializerFn = (appConfig: AppConfigProvider, logger: NGXLogger) => {
|
|
|
291
296
|
}),
|
|
292
297
|
ScrollbarThemeModule,
|
|
293
298
|
SharedModule,
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
CreateCannedResponsePageModule,
|
|
302
|
-
|
|
303
|
-
|
|
299
|
+
|
|
300
|
+
//LAXY LOADED
|
|
301
|
+
// CreateTicketPageModule,
|
|
302
|
+
// CreateRequesterPageModule,
|
|
303
|
+
// LoaderPreviewPageModule,
|
|
304
|
+
// ConversationInfoModule,
|
|
305
|
+
LoginPageModule,
|
|
306
|
+
// CreateCannedResponsePageModule,
|
|
307
|
+
// SendEmailModalModule,
|
|
308
|
+
// SendWhatsappTemplateModalModule,
|
|
309
|
+
// MapsPageModule,
|
|
310
|
+
// JsonMessagePageModule,
|
|
311
|
+
// GoogleMapsModule
|
|
304
312
|
],
|
|
305
313
|
bootstrap: [AppComponent],
|
|
306
314
|
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
|
@@ -366,7 +374,7 @@ const appInitializerFn = (appConfig: AppConfigProvider, logger: NGXLogger) => {
|
|
|
366
374
|
{
|
|
367
375
|
provide: NotificationsService,
|
|
368
376
|
useFactory: notificationsServiceFactory,
|
|
369
|
-
deps: [AppConfigProvider, Chat21Service]
|
|
377
|
+
deps: [AppConfigProvider, Chat21Service, FCM]
|
|
370
378
|
},
|
|
371
379
|
{
|
|
372
380
|
provide: AppStorageService,
|
|
@@ -382,7 +390,10 @@ const appInitializerFn = (appConfig: AppConfigProvider, logger: NGXLogger) => {
|
|
|
382
390
|
Chat21Service,
|
|
383
391
|
WebSocketJs,
|
|
384
392
|
ConvertRequestToConversation,
|
|
385
|
-
ScriptService
|
|
393
|
+
ScriptService,
|
|
394
|
+
FCM,
|
|
395
|
+
InAppBrowser,
|
|
396
|
+
Deeplinks
|
|
386
397
|
]
|
|
387
398
|
})
|
|
388
399
|
export class AppModule { }
|
package/src/app/chatlib/conversation-detail/conversation-content/conversation-content.component.html
CHANGED
|
@@ -26,19 +26,19 @@
|
|
|
26
26
|
<div role="messaggio" *ngIf="message.sender == senderId;" class="msg_container base_sent">
|
|
27
27
|
|
|
28
28
|
<!--backgroundColor non viene ancora usato -->
|
|
29
|
-
<tiledeskwidget-bubble-message class="messages msg_sent slide-in-right"
|
|
29
|
+
<!-- <tiledeskwidget-bubble-message class="messages msg_sent slide-in-right"
|
|
30
30
|
[ngClass]="{'button-in-msg' : message?.metadata && message?.metadata?.button}"
|
|
31
31
|
[class.chat-text-emoticon]="isEmojii(message?.text)"
|
|
32
32
|
[message]="message"
|
|
33
33
|
[textColor]="'col-msg-sent'"
|
|
34
34
|
(onBeforeMessageRender)="onBeforeMessageRenderFN($event)"
|
|
35
35
|
(onAfterMessageRender)="onAfterMessageRenderFN($event)">
|
|
36
|
-
</tiledeskwidget-bubble-message>
|
|
36
|
+
</tiledeskwidget-bubble-message> -->
|
|
37
37
|
|
|
38
38
|
<!-- icon status message -->
|
|
39
|
-
<tiledeskwidget-return-receipt class="slide-in-right"
|
|
39
|
+
<!-- <tiledeskwidget-return-receipt class="slide-in-right"
|
|
40
40
|
[status]="message?.status">
|
|
41
|
-
</tiledeskwidget-return-receipt>
|
|
41
|
+
</tiledeskwidget-return-receipt> -->
|
|
42
42
|
|
|
43
43
|
</div>
|
|
44
44
|
|
|
@@ -54,13 +54,13 @@
|
|
|
54
54
|
</tiledeskwidget-avatar-image> -->
|
|
55
55
|
|
|
56
56
|
<!--backgroundColor non viene ancora usato -->
|
|
57
|
-
<tiledeskwidget-bubble-message class="messages msg_receive slide-in-left"
|
|
57
|
+
<!-- <tiledeskwidget-bubble-message class="messages msg_receive slide-in-left"
|
|
58
58
|
[class.chat-text-emoticon]="isEmojii(message?.text)"
|
|
59
59
|
[message]="message"
|
|
60
60
|
[textColor]="'black'"
|
|
61
61
|
(onBeforeMessageRender)="onBeforeMessageRenderFN($event)"
|
|
62
62
|
(onAfterMessageRender)="onAfterMessageRenderFN($event)">
|
|
63
|
-
</tiledeskwidget-bubble-message>
|
|
63
|
+
</tiledeskwidget-bubble-message> -->
|
|
64
64
|
|
|
65
65
|
</div>
|
|
66
66
|
|
|
@@ -122,13 +122,13 @@
|
|
|
122
122
|
|
|
123
123
|
<!-- message type:: button && -->
|
|
124
124
|
<div *ngIf="message?.attributes && message?.attributes?.attachment " class="slide-in-left" >
|
|
125
|
-
<tiledeskwidget-message-attachment
|
|
125
|
+
<!-- <tiledeskwidget-message-attachment
|
|
126
126
|
style="height: 100%; display: block;"
|
|
127
127
|
[message]="message"
|
|
128
128
|
[isLastMessage] = "isLastMessage(message?.uid)"
|
|
129
129
|
[stylesMap]="stylesMap"
|
|
130
130
|
(onAttachmentButtonClicked)="onAttachmentButtonClickedFN($event)">
|
|
131
|
-
</tiledeskwidget-message-attachment>
|
|
131
|
+
</tiledeskwidget-message-attachment> -->
|
|
132
132
|
</div>
|
|
133
133
|
|
|
134
134
|
</div>
|
|
@@ -6,12 +6,41 @@
|
|
|
6
6
|
</div>
|
|
7
7
|
<div class="centered">
|
|
8
8
|
|
|
9
|
-
<div class="signin-title"
|
|
10
|
-
<h2
|
|
9
|
+
<div class="signin-title">
|
|
10
|
+
<h2>
|
|
11
11
|
{{ translationMap?.get('LABEL_SIGNIN_TO') }}
|
|
12
12
|
{{companyName}}
|
|
13
13
|
</h2>
|
|
14
14
|
</div>
|
|
15
|
+
|
|
16
|
+
<div class="login-container">
|
|
17
|
+
<button type="button" class="google-button" (click)="signInWithGoogle()">
|
|
18
|
+
<div style="margin-right: 10px; background: rgb(255, 255, 255); padding: 10px; border-radius: 2px;">
|
|
19
|
+
|
|
20
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 186.69 190.5"
|
|
21
|
+
xmlns:v="https://vecta.io/nano" style="position: relative;top: 2px;">
|
|
22
|
+
<g transform="translate(1184.583 765.171)">
|
|
23
|
+
<path clip-path="none" mask="none"
|
|
24
|
+
d="M-1089.333-687.239v36.888h51.262c-2.251 11.863-9.006 21.908-19.137 28.662l30.913 23.986c18.011-16.625 28.402-41.044 28.402-70.052 0-6.754-.606-13.249-1.732-19.483z"
|
|
25
|
+
fill="#4285f4" />
|
|
26
|
+
<path clip-path="none" mask="none"
|
|
27
|
+
d="M-1142.714-651.791l-6.972 5.337-24.679 19.223h0c15.673 31.086 47.796 52.561 85.03 52.561 25.717 0 47.278-8.486 63.038-23.033l-30.913-23.986c-8.486 5.715-19.31 9.179-32.125 9.179-24.765 0-45.806-16.712-53.34-39.226z"
|
|
28
|
+
fill="#34a853" />
|
|
29
|
+
<path clip-path="none" mask="none"
|
|
30
|
+
d="M-1174.365-712.61c-6.494 12.815-10.217 27.276-10.217 42.689s3.723 29.874 10.217 42.689c0 .086 31.693-24.592 31.693-24.592-1.905-5.715-3.031-11.776-3.031-18.098s1.126-12.383 3.031-18.098z"
|
|
31
|
+
fill="#fbbc05" />
|
|
32
|
+
<path
|
|
33
|
+
d="M-1089.333-727.244c14.028 0 26.497 4.849 36.455 14.201l27.276-27.276c-16.539-15.413-38.013-24.852-63.731-24.852-37.234 0-69.359 21.388-85.032 52.561l31.692 24.592c7.533-22.514 28.575-39.226 53.34-39.226z"
|
|
34
|
+
fill="#ea4335" clip-path="none" mask="none" />
|
|
35
|
+
</g>
|
|
36
|
+
</svg>
|
|
37
|
+
</div>
|
|
38
|
+
<div style="padding: 10px 10px 10px 0px; font-weight: 500; width: calc(100% - 91px);">Sign in with Google</div>
|
|
39
|
+
</button>
|
|
40
|
+
</div>
|
|
41
|
+
|
|
42
|
+
<div class="login-container auth---divider"><span> or </span></div>
|
|
43
|
+
|
|
15
44
|
<div class="login-container">
|
|
16
45
|
<form [formGroup]="userForm" (ngSubmit)="signInWithEmailAndPassword()" novalidate>
|
|
17
46
|
|
|
@@ -2,6 +2,18 @@
|
|
|
2
2
|
--overflow: hidden;
|
|
3
3
|
}
|
|
4
4
|
|
|
5
|
+
.signin-title > h2 {
|
|
6
|
+
font-size: 36px;
|
|
7
|
+
// line-height: 55px;
|
|
8
|
+
font-family: "Poppins", "Roboto", "Arial", sans-serif;
|
|
9
|
+
font-weight: 500;
|
|
10
|
+
text-align: left;
|
|
11
|
+
|
|
12
|
+
margin: 5px auto;
|
|
13
|
+
padding-left: 30px;
|
|
14
|
+
padding-right: 30px;
|
|
15
|
+
}
|
|
16
|
+
|
|
5
17
|
.login-container {
|
|
6
18
|
margin: 0 auto;
|
|
7
19
|
padding-left: 30px;
|
|
@@ -83,4 +95,55 @@
|
|
|
83
95
|
color: #da491c;
|
|
84
96
|
margin-top: -6px;
|
|
85
97
|
}
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
/* AUTH with Google
|
|
101
|
+
/* ***************************** */
|
|
102
|
+
&.auth---divider {
|
|
103
|
+
font-size: 16px;
|
|
104
|
+
text-align: center;
|
|
105
|
+
border-bottom: 1px solid #d9d9d9;
|
|
106
|
+
line-height: 0em;
|
|
107
|
+
display: block !important;
|
|
108
|
+
font-weight: 400;
|
|
109
|
+
font-family: "Poppins", "Roboto", "Arial", sans-serif;
|
|
110
|
+
margin: 30px 0px
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
&.auth---divider span {
|
|
114
|
+
background: #ffffff;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
//****** GOOGLE - LOGIN ******//
|
|
118
|
+
.google-button {
|
|
119
|
+
// background-color: rgb(66, 133, 244);
|
|
120
|
+
display: inline-flex;
|
|
121
|
+
align-items: center;
|
|
122
|
+
// color: rgb(255, 255, 255);
|
|
123
|
+
// box-shadow: rgba(0, 0, 0, 0.24) 0px 2px 2px 0px, rgba(0, 0, 0, 0.24) 0px 0px 1px 0px;
|
|
124
|
+
padding: 0px;
|
|
125
|
+
border-radius: 3px;
|
|
126
|
+
border: 1px solid #4285f4;
|
|
127
|
+
font-size: 16px;
|
|
128
|
+
font-weight: 500;
|
|
129
|
+
font-family: "Poppins", "Roboto", "Arial", sans-serif;
|
|
130
|
+
width: 100%;
|
|
131
|
+
// border-color: #c7e1ff !important;
|
|
132
|
+
// box-shadow: none !important;
|
|
133
|
+
background: #ffff !important;
|
|
134
|
+
color: #4285f4 !important;
|
|
135
|
+
// margin-bottom: 30px;
|
|
136
|
+
height: 56px;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.google-button:hover {
|
|
140
|
+
border-color: #94c8ff !important;
|
|
141
|
+
background-color: #f4f9ff !important;
|
|
142
|
+
opacity: 1 !important;
|
|
143
|
+
}
|
|
144
|
+
.google-button:hover > div {
|
|
145
|
+
border-color: #94c8ff !important;
|
|
146
|
+
background-color: #f4f9ff !important;
|
|
147
|
+
opacity: 1 !important;
|
|
148
|
+
}
|
|
86
149
|
}
|