@chat21/chat21-ionic 3.0.5-9.1 → 3.0.6-2.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 +203 -1
- package/LICENSE +661 -21
- package/README.md +13 -1
- package/angular.json +4 -0
- package/config.xml +4 -5
- package/deploy_pre.sh +44 -5
- package/deploy_prod.sh +36 -7
- package/env.sample +4 -2
- package/package.json +12 -8
- package/resources/{Android → android}/icon/drawable-hdpi-icon.png +0 -0
- package/resources/{Android → android}/icon/drawable-ldpi-icon.png +0 -0
- package/resources/{Android → android}/icon/drawable-mdpi-icon.png +0 -0
- package/resources/{Android → android}/icon/drawable-xhdpi-icon.png +0 -0
- package/resources/{Android → android}/icon/drawable-xxhdpi-icon.png +0 -0
- package/resources/{Android → android}/icon/drawable-xxxhdpi-icon.png +0 -0
- package/resources/{Android → android}/icon.png +0 -0
- package/resources/{Android → android}/splash/drawable-land-hdpi-screen.png +0 -0
- package/resources/{Android → android}/splash/drawable-land-ldpi-screen.png +0 -0
- package/resources/{Android → android}/splash/drawable-land-mdpi-screen.png +0 -0
- package/resources/{Android → android}/splash/drawable-land-xhdpi-screen.png +0 -0
- package/resources/{Android → android}/splash/drawable-land-xxhdpi-screen.png +0 -0
- package/resources/{Android → android}/splash/drawable-land-xxxhdpi-screen.png +0 -0
- package/resources/{Android → android}/splash/drawable-port-hdpi-screen.png +0 -0
- package/resources/{Android → android}/splash/drawable-port-ldpi-screen.png +0 -0
- package/resources/{Android → android}/splash/drawable-port-mdpi-screen.png +0 -0
- package/resources/{Android → android}/splash/drawable-port-xhdpi-screen.png +0 -0
- package/resources/{Android → android}/splash/drawable-port-xxhdpi-screen.png +0 -0
- package/resources/{Android → android}/splash/drawable-port-xxxhdpi-screen.png +0 -0
- package/resources/{Android → android}/splash.png +0 -0
- package/src/app/app-routing.module.ts +15 -0
- package/src/app/app.component.html +14 -4
- package/src/app/app.component.scss +18 -1
- package/src/app/app.component.ts +104 -75
- package/src/app/app.module.ts +14 -5
- package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.html +36 -25
- package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.scss +160 -50
- package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.ts +108 -18
- package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.html +21 -36
- package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.scss +19 -7
- package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.ts +63 -42
- package/src/app/chatlib/conversation-detail/message/message-attachment/message-attachment.component.scss +1 -1
- package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.html +7 -2
- package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.ts +141 -21
- package/src/app/chatlib/list-conversations-component/list-conversations/list-conversations.component.ts +13 -10
- package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.html +39 -36
- package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.scss +7 -1
- package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.ts +148 -63
- package/src/app/components/conversation-detail/message-text-area/message-text-area.component.html +101 -39
- package/src/app/components/conversation-detail/message-text-area/message-text-area.component.scss +73 -2
- package/src/app/components/conversation-detail/message-text-area/message-text-area.component.ts +168 -98
- package/src/app/components/ddp-header/ddp-header.component.html +20 -6
- package/src/app/components/ddp-header/ddp-header.component.scss +4 -0
- package/src/app/components/ddp-header/ddp-header.component.ts +104 -10
- package/src/app/components/image-viewer/image-viewer.component.scss +2 -2
- package/src/app/components/project-item/project-item.component.html +141 -118
- package/src/app/components/project-item/project-item.component.scss +173 -91
- package/src/app/components/project-item/project-item.component.ts +82 -28
- package/src/app/components/sidebar/sidebar.component.html +275 -0
- package/src/app/components/sidebar/sidebar.component.scss +79 -0
- package/src/app/components/sidebar/sidebar.component.spec.ts +24 -0
- package/src/app/components/sidebar/sidebar.component.ts +541 -0
- package/src/app/components/sidebar-user-details/sidebar-user-details.component.html +137 -0
- package/src/app/components/sidebar-user-details/sidebar-user-details.component.scss +387 -0
- package/src/app/components/sidebar-user-details/sidebar-user-details.component.spec.ts +24 -0
- package/src/app/components/sidebar-user-details/sidebar-user-details.component.ts +530 -0
- package/src/app/pages/conversation-detail/conversation-detail.module.ts +9 -2
- package/src/app/pages/conversation-detail/conversation-detail.page.html +53 -49
- package/src/app/pages/conversation-detail/conversation-detail.page.scss +28 -0
- package/src/app/pages/conversation-detail/conversation-detail.page.ts +1258 -755
- package/src/app/pages/conversations-list/conversations-list.module.ts +2 -1
- package/src/app/pages/conversations-list/conversations-list.page.html +24 -11
- package/src/app/pages/conversations-list/conversations-list.page.scss +20 -1
- package/src/app/pages/conversations-list/conversations-list.page.ts +687 -420
- package/src/app/pages/create-canned-response/create-canned-response-routing.module.ts +17 -0
- package/src/app/pages/create-canned-response/create-canned-response.module.ts +30 -0
- package/src/app/pages/create-canned-response/create-canned-response.page.html +150 -0
- package/src/app/pages/create-canned-response/create-canned-response.page.scss +55 -0
- package/src/app/pages/create-canned-response/create-canned-response.page.spec.ts +24 -0
- package/src/app/pages/create-canned-response/create-canned-response.page.ts +319 -0
- package/src/app/pages/create-requester/create-requester-routing.module.ts +17 -0
- package/src/app/pages/create-requester/create-requester.module.ts +28 -0
- package/src/app/pages/create-requester/create-requester.page.html +67 -0
- package/src/app/pages/create-requester/create-requester.page.scss +30 -0
- package/src/app/pages/create-requester/create-requester.page.spec.ts +24 -0
- package/src/app/pages/create-requester/create-requester.page.ts +138 -0
- package/src/app/pages/create-ticket/create-ticket-routing.module.ts +17 -0
- package/src/app/pages/create-ticket/create-ticket.module.ts +28 -0
- package/src/app/pages/create-ticket/create-ticket.page.html +171 -0
- package/src/app/pages/create-ticket/create-ticket.page.scss +52 -0
- package/src/app/pages/create-ticket/create-ticket.page.spec.ts +24 -0
- package/src/app/pages/create-ticket/create-ticket.page.ts +432 -0
- package/src/app/pages/loader-preview/loader-preview.page.ts +226 -166
- package/src/app/pages/profile-info/profile-info.page.html +4 -4
- package/src/app/pages/profile-info/profile-info.page.scss +13 -2
- package/src/app/pages/profile-info/profile-info.page.ts +23 -21
- package/src/app/pages/unassigned-conversations/unassigned-conversations.page.html +16 -11
- package/src/app/pages/unassigned-conversations/unassigned-conversations.page.scss +157 -63
- package/src/app/pages/unassigned-conversations/unassigned-conversations.page.ts +51 -16
- package/src/app/services/app-config.ts +14 -14
- package/src/app/services/tiledesk/tiledesk.service.ts +209 -0
- package/src/app/services/websocket/websocket-js.ts +2 -2
- package/src/app/shared/shared.module.ts +21 -7
- package/src/app/utils/scrollbar-theme.directive.ts +58 -24
- package/src/assets/i18n/de.json +266 -0
- package/src/assets/i18n/en.json +85 -10
- package/src/assets/i18n/es.json +266 -0
- package/src/assets/i18n/fr.json +266 -0
- package/src/assets/i18n/it.json +104 -37
- package/src/assets/i18n/pt.json +266 -0
- package/src/assets/i18n/ru.json +266 -0
- package/src/assets/i18n/sr.json +266 -0
- package/src/assets/i18n/tr.json +266 -0
- package/src/assets/images/default-avatar-x-select.png +0 -0
- package/src/assets/images/language_flag/ar.png +0 -0
- package/src/assets/images/language_flag/bg.png +0 -0
- package/src/assets/images/language_flag/ca.png +0 -0
- package/src/assets/images/language_flag/cs.png +0 -0
- package/src/assets/images/language_flag/da.png +0 -0
- package/src/assets/images/language_flag/de.png +0 -0
- package/src/assets/images/language_flag/el.png +0 -0
- package/src/assets/images/language_flag/en.png +0 -0
- package/src/assets/images/language_flag/es.png +0 -0
- package/src/assets/images/language_flag/fa.png +0 -0
- package/src/assets/images/language_flag/fi.png +0 -0
- package/src/assets/images/language_flag/fr.png +0 -0
- package/src/assets/images/language_flag/he.png +0 -0
- package/src/assets/images/language_flag/hi.png +0 -0
- package/src/assets/images/language_flag/hr.png +0 -0
- package/src/assets/images/language_flag/hu.png +0 -0
- package/src/assets/images/language_flag/id.png +0 -0
- package/src/assets/images/language_flag/it.png +0 -0
- package/src/assets/images/language_flag/ja.png +0 -0
- package/src/assets/images/language_flag/ko.png +0 -0
- package/src/assets/images/language_flag/ml-IN.png +0 -0
- package/src/assets/images/language_flag/ne-NP.png +0 -0
- package/src/assets/images/language_flag/nl.png +0 -0
- package/src/assets/images/language_flag/no.png +0 -0
- package/src/assets/images/language_flag/pl.png +0 -0
- package/src/assets/images/language_flag/pt-BR.png +0 -0
- package/src/assets/images/language_flag/pt.png +0 -0
- package/src/assets/images/language_flag/ro.png +0 -0
- package/src/assets/images/language_flag/ru.png +0 -0
- package/src/assets/images/language_flag/sk.png +0 -0
- package/src/assets/images/language_flag/sl.png +0 -0
- package/src/assets/images/language_flag/sr.png +0 -0
- package/src/assets/images/language_flag/sv-SE.png +0 -0
- package/src/assets/images/language_flag/ta.png +0 -0
- package/src/assets/images/language_flag/th.png +0 -0
- package/src/assets/images/language_flag/tr.png +0 -0
- package/src/assets/images/language_flag/uk.png +0 -0
- package/src/assets/images/language_flag/vi.png +0 -0
- package/src/assets/images/language_flag/zh-CN.png +0 -0
- package/src/assets/images/language_flag/zh-TW.png +0 -0
- package/src/assets/images/no_image_user.png +0 -0
- package/src/assets/images/priority_icons/high.svg +3 -0
- package/src/assets/images/priority_icons/high_v2.svg +14 -0
- package/src/assets/images/priority_icons/low.svg +10 -0
- package/src/assets/images/priority_icons/low_v2.svg +14 -0
- package/src/assets/images/priority_icons/medium.svg +16 -0
- package/src/assets/images/priority_icons/medium_v2.svg +11 -0
- package/src/assets/images/priority_icons/urgent.svg +4 -0
- package/src/assets/images/priority_icons/urgent_v2.svg +16 -0
- package/src/assets/js/chat21client.js +16 -3
- package/src/assets/tiledesk-solo-logo.png +0 -0
- package/src/chat-config-mqtt.json +27 -17
- package/src/chat-config-pre-test.json +5 -1
- package/src/chat-config-pre.json +15 -3
- package/src/chat-config-template.json +6 -2
- package/src/chat-config.json +5 -1
- package/src/chat21-core/providers/firebase/firebase-conversation-handler.ts +61 -45
- package/src/chat21-core/providers/firebase/firebase-conversations-handler.ts +23 -0
- package/src/chat21-core/providers/mqtt/mqtt-archivedconversations-handler.ts +1 -1
- package/src/chat21-core/utils/constants.ts +8 -1
- package/src/chat21-core/utils/utils-message.ts +19 -0
- package/src/chat21-core/utils/utils.ts +12 -1
- package/src/global.scss +408 -2
- package/src/index.html +7 -0
- package/publish_pre.sh +0 -33
- package/publish_prod.sh +0 -33
package/src/app/app.component.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { URL_SOUND_LIST_CONVERSATION } from './../chat21-core/utils/constants';
|
|
1
|
+
import { tranlatedLanguage, 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
|
|
|
@@ -58,6 +58,7 @@ 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
62
|
// import { filter } from 'rxjs/operators';
|
|
62
63
|
|
|
63
64
|
@Component({
|
|
@@ -77,7 +78,7 @@ export class AppComponent implements OnInit {
|
|
|
77
78
|
public sidebarPage: any;
|
|
78
79
|
public notificationsEnabled: boolean;
|
|
79
80
|
public zone: NgZone;
|
|
80
|
-
|
|
81
|
+
public platformIs: string;
|
|
81
82
|
private doitResize: any;
|
|
82
83
|
private timeModalLogin: any;
|
|
83
84
|
public tenant: string;
|
|
@@ -98,7 +99,9 @@ export class AppComponent implements OnInit {
|
|
|
98
99
|
public missingConnectionToast: any
|
|
99
100
|
public executedInitializeAppByWatchConnection: boolean = false;
|
|
100
101
|
private version: string;
|
|
101
|
-
|
|
102
|
+
IS_ONLINE: boolean;
|
|
103
|
+
IS_ON_MOBILE_DEVICE: boolean;
|
|
104
|
+
SUPPORT_MODE: boolean;
|
|
102
105
|
// private isOnline: boolean = false;
|
|
103
106
|
|
|
104
107
|
wsService: WebSocketJs;
|
|
@@ -145,32 +148,21 @@ export class AppComponent implements OnInit {
|
|
|
145
148
|
|
|
146
149
|
this.saveInStorageNumberOfOpenedChatTab();
|
|
147
150
|
this.listenChatAlreadyOpenWithoutParamsInMobileMode()
|
|
148
|
-
|
|
151
|
+
this.isOnMobileDevice()
|
|
149
152
|
// this.listenToUrlChanges();
|
|
150
153
|
// this.getPageState();
|
|
154
|
+
}
|
|
151
155
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
// this.navigateToDetail(convId, requesterFullaname)
|
|
156
|
+
isOnMobileDevice() {
|
|
157
|
+
this.IS_ON_MOBILE_DEVICE = false;
|
|
158
|
+
if (/Android|iPhone/i.test(window.navigator.userAgent)) {
|
|
159
|
+
this.IS_ON_MOBILE_DEVICE = true;
|
|
160
|
+
}
|
|
161
|
+
this.logger.log('[APP-COMP] IS_ON_MOBILE_DEVICE', this.IS_ON_MOBILE_DEVICE)
|
|
162
|
+
return this.IS_ON_MOBILE_DEVICE;
|
|
163
|
+
}
|
|
162
164
|
|
|
163
|
-
// this.events.publish('convid:haschanged', convId);
|
|
164
|
-
// }
|
|
165
|
-
// });
|
|
166
165
|
|
|
167
|
-
router.events.subscribe((event) => {
|
|
168
|
-
if (event instanceof NavigationStart) {
|
|
169
|
-
this.browserRefresh = !router.navigated;
|
|
170
|
-
// console.log('browserRefresh ', this.browserRefresh)
|
|
171
|
-
}
|
|
172
|
-
});
|
|
173
|
-
}
|
|
174
166
|
|
|
175
167
|
listenChatAlreadyOpenWithoutParamsInMobileMode() {
|
|
176
168
|
this.events.subscribe('noparams:mobile', (isAlreadyOpenInMobileMode) => {
|
|
@@ -276,7 +268,7 @@ export class AppComponent implements OnInit {
|
|
|
276
268
|
|
|
277
269
|
|
|
278
270
|
saveInStorageNumberOfOpenedChatTab() {
|
|
279
|
-
this.logger.log('Calling saveInStorageChatOpenedTab!');
|
|
271
|
+
// this.logger.log('Calling saveInStorageChatOpenedTab!');
|
|
280
272
|
|
|
281
273
|
// https://jsfiddle.net/jjjs5wd3/3/å
|
|
282
274
|
if (+localStorage.tabCount > 0) {
|
|
@@ -306,6 +298,14 @@ export class AppComponent implements OnInit {
|
|
|
306
298
|
*/
|
|
307
299
|
ngOnInit() {
|
|
308
300
|
const appconfig = this.appConfigProvider.getConfig();
|
|
301
|
+
this.logger.log('[APP-COMP] ngOnInit appconfig', appconfig)
|
|
302
|
+
if (appconfig && appconfig.supportMode && (appconfig.supportMode === true || appconfig.supportMode === 'true' )) {
|
|
303
|
+
this.SUPPORT_MODE = true;
|
|
304
|
+
this.logger.log('[APP-COMP] appconfig > SUPPORT_MODE', this.SUPPORT_MODE)
|
|
305
|
+
} else {
|
|
306
|
+
this.SUPPORT_MODE = false;
|
|
307
|
+
this.logger.log('[APP-COMP] appconfig > SUPPORT_MODE', this.SUPPORT_MODE)
|
|
308
|
+
}
|
|
309
309
|
this.persistence = appconfig.authPersistence;
|
|
310
310
|
this.appStorageService.initialize(environment.storage_prefix, this.persistence, '')
|
|
311
311
|
// this.logger.log('[APP-COMP] HELLO ngOnInit !!!!!!!')
|
|
@@ -436,9 +436,9 @@ export class AppComponent implements OnInit {
|
|
|
436
436
|
// this.logger.log('[APP-COMP] - X - initializeApp !!! CALLED-BY: ', calledby);
|
|
437
437
|
// console.log('[APP-COMP] appconfig platform is cordova: ', this.platform.is('cordova'))
|
|
438
438
|
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
439
|
+
if (!this.platform.is('desktop')) {
|
|
440
|
+
this.splashScreen.show();
|
|
441
|
+
}
|
|
442
442
|
this.tabTitle = document.title;
|
|
443
443
|
|
|
444
444
|
this.getRouteParamsAndSetLoggerConfig();
|
|
@@ -463,11 +463,11 @@ export class AppComponent implements OnInit {
|
|
|
463
463
|
// console.log("Check platform");
|
|
464
464
|
this.getPlatformName();
|
|
465
465
|
|
|
466
|
-
this.setLanguage();
|
|
466
|
+
// this.setLanguage();
|
|
467
467
|
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
468
|
+
if (this.splashScreen) {
|
|
469
|
+
this.splashScreen.hide();
|
|
470
|
+
}
|
|
471
471
|
this.statusBar.styleDefault();
|
|
472
472
|
this.navService.init(this.sidebarNav, this.detailNav);
|
|
473
473
|
// this.persistence = appconfig.authPersistence;
|
|
@@ -541,19 +541,53 @@ export class AppComponent implements OnInit {
|
|
|
541
541
|
}
|
|
542
542
|
|
|
543
543
|
/** */
|
|
544
|
-
setLanguage() {
|
|
545
|
-
this.
|
|
546
|
-
this.
|
|
547
|
-
|
|
548
|
-
let
|
|
549
|
-
if (
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
language = navigator.language.substring(0, navigator.language.indexOf('_'));
|
|
553
|
-
} else {
|
|
554
|
-
language = navigator.language;
|
|
544
|
+
setLanguage(currentUser) {
|
|
545
|
+
// const currentUser = JSON.parse(this.appStorageService.getItem('currentUser'));
|
|
546
|
+
this.logger.log('[APP-COMP] - setLanguage current_user uid: ', currentUser);
|
|
547
|
+
|
|
548
|
+
let currentUserId = ''
|
|
549
|
+
if (currentUser) {
|
|
550
|
+
currentUserId = currentUser.uid;
|
|
551
|
+
this.logger.log('[APP-COMP] - setLanguage current_user uid: ', currentUserId);
|
|
555
552
|
}
|
|
556
|
-
this.translate.
|
|
553
|
+
// this.translate.setDefaultLang('en');
|
|
554
|
+
// this.translate.use('en');
|
|
555
|
+
|
|
556
|
+
const browserLang = this.translate.getBrowserLang();
|
|
557
|
+
this.logger.log('[APP-COMP] browserLang: ', browserLang);
|
|
558
|
+
const stored_preferred_lang = localStorage.getItem(currentUserId + '_lang');
|
|
559
|
+
this.logger.log('[APP-COMP] stored_preferred_lang: ', stored_preferred_lang);
|
|
560
|
+
|
|
561
|
+
let chat_lang = ''
|
|
562
|
+
if (browserLang && !stored_preferred_lang) {
|
|
563
|
+
chat_lang = browserLang
|
|
564
|
+
} else if (browserLang && stored_preferred_lang) {
|
|
565
|
+
chat_lang = stored_preferred_lang
|
|
566
|
+
}
|
|
567
|
+
|
|
568
|
+
this.logger.log('[APP-COMP] - chat_lang', chat_lang)
|
|
569
|
+
|
|
570
|
+
if (tranlatedLanguage.includes(chat_lang)) {
|
|
571
|
+
this.logger.log('[APP-COMP] tranlatedLanguage includes',chat_lang , ': ', tranlatedLanguage.includes(chat_lang))
|
|
572
|
+
this.translate.setDefaultLang(chat_lang)
|
|
573
|
+
this.translate.use(chat_lang);
|
|
574
|
+
}
|
|
575
|
+
else {
|
|
576
|
+
this.logger.log('[APP-COMP] tranlatedLanguage includes',chat_lang , ': ', tranlatedLanguage.includes(chat_lang))
|
|
577
|
+
this.translate.setDefaultLang('en');
|
|
578
|
+
this.translate.use('en');
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
// this.logger.debug('[APP-COMP] navigator.language: ', navigator.language);
|
|
582
|
+
// let language;
|
|
583
|
+
// if (navigator.language.indexOf('-') !== -1) {
|
|
584
|
+
// language = navigator.language.substring(0, navigator.language.indexOf('-'));
|
|
585
|
+
// } else if (navigator.language.indexOf('_') !== -1) {
|
|
586
|
+
// language = navigator.language.substring(0, navigator.language.indexOf('_'));
|
|
587
|
+
// } else {
|
|
588
|
+
// language = navigator.language;
|
|
589
|
+
// }
|
|
590
|
+
// this.translate.use(language);
|
|
557
591
|
}
|
|
558
592
|
|
|
559
593
|
|
|
@@ -644,7 +678,7 @@ export class AppComponent implements OnInit {
|
|
|
644
678
|
})
|
|
645
679
|
} else {
|
|
646
680
|
this.logger.warn('[APP-COMP] >>> I AM NOT LOGGED IN <<<')
|
|
647
|
-
|
|
681
|
+
this.IS_ONLINE = false;
|
|
648
682
|
// clearTimeout(this.timeModalLogin);
|
|
649
683
|
// this.timeModalLogin = setTimeout(() => {
|
|
650
684
|
if (!this.hadBeenCalledOpenModal) {
|
|
@@ -690,6 +724,7 @@ export class AppComponent implements OnInit {
|
|
|
690
724
|
|
|
691
725
|
this.logger.log('[APP-COMP] checkPlatformIsMobile', checkPlatformIsMobile());
|
|
692
726
|
this.platformIs = PLATFORM_MOBILE;
|
|
727
|
+
this.logger.log('[APP-COMP] this.platformIs', this.platformIs);
|
|
693
728
|
const IDConv = this.route.snapshot.firstChild.paramMap.get('IDConv');
|
|
694
729
|
|
|
695
730
|
// console.log('[APP-COMP] platformIs', this.platformIs);
|
|
@@ -703,7 +738,7 @@ export class AppComponent implements OnInit {
|
|
|
703
738
|
this.chatManager.startApp();
|
|
704
739
|
this.logger.log('[APP-COMP] checkPlatformIsMobile', checkPlatformIsMobile());
|
|
705
740
|
this.platformIs = PLATFORM_DESKTOP;
|
|
706
|
-
|
|
741
|
+
this.logger.log('[APP-COMP] platformIs', this.platformIs);
|
|
707
742
|
// console.log('[APP-COMP] PLATFORM', PLATFORM_DESKTOP, 'route.snapshot', this.route.snapshot);
|
|
708
743
|
this.logger.log('[APP-COMP] PLATFORM_DESKTOP ', this.navService);
|
|
709
744
|
|
|
@@ -719,8 +754,8 @@ export class AppComponent implements OnInit {
|
|
|
719
754
|
if (IDConv && FullNameConv) {
|
|
720
755
|
pageUrl += IDConv + '/' + FullNameConv + '/' + Convtype
|
|
721
756
|
}
|
|
722
|
-
|
|
723
|
-
this.router.navigateByUrl(pageUrl);
|
|
757
|
+
// replace(/\(/g, '%28').replace(/\)/g, '%29') -> used for the encoder of any round brackets
|
|
758
|
+
this.router.navigateByUrl(pageUrl.replace(/\(/g, '%28').replace(/\)/g, '%29'));
|
|
724
759
|
|
|
725
760
|
|
|
726
761
|
// const DASHBOARD_URL = this.appConfigProvider.getConfig().DASHBOARD_URL;
|
|
@@ -822,15 +857,19 @@ export class AppComponent implements OnInit {
|
|
|
822
857
|
.pipe(filter((state) => state !== null))
|
|
823
858
|
.subscribe((state: any) => {
|
|
824
859
|
this.logger.log('initialize FROM [APP-COMP] - [APP-COMP] ***** BSAuthStateChanged state', state);
|
|
825
|
-
|
|
860
|
+
|
|
826
861
|
if (state && state === AUTH_STATE_ONLINE) {
|
|
827
862
|
// const user = this.tiledeskAuthService.getCurrentUser();
|
|
828
863
|
// if (this.isOnline === false) {
|
|
829
864
|
// if (AUTH_STATE_ONLINE) {
|
|
865
|
+
this.IS_ONLINE = true;
|
|
866
|
+
// console.log('[APP-COMP] IS_ONLINE', this.IS_ONLINE)
|
|
830
867
|
this.goOnLine();
|
|
831
868
|
// }
|
|
832
869
|
} else if (state === AUTH_STATE_OFFLINE) {
|
|
833
870
|
// this.checkTokenAndGoOffline() //se c'è un tiledeskToken salvato, allora aspetta, altrimenti vai offline
|
|
871
|
+
this.IS_ONLINE = false;
|
|
872
|
+
// console.log('[APP-COMP] IS_ONLINE', this.IS_ONLINE)
|
|
834
873
|
this.goOffLine()
|
|
835
874
|
}
|
|
836
875
|
}, error => {
|
|
@@ -868,12 +907,12 @@ export class AppComponent implements OnInit {
|
|
|
868
907
|
}
|
|
869
908
|
|
|
870
909
|
/**
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
910
|
+
* goOnLine:
|
|
911
|
+
* 1 - nascondo splashscreen
|
|
912
|
+
* 2 - recupero il tiledeskToken e lo salvo in chat manager
|
|
913
|
+
* 3 - carico in d
|
|
914
|
+
* @param user
|
|
915
|
+
*/
|
|
877
916
|
goOnLine = () => {
|
|
878
917
|
this.logger.log('[APP-COMP]- GO-ONLINE ');
|
|
879
918
|
// this.isOnline = true;
|
|
@@ -881,15 +920,14 @@ export class AppComponent implements OnInit {
|
|
|
881
920
|
// clearTimeout(this.timeModalLogin);
|
|
882
921
|
const tiledeskToken = this.tiledeskAuthService.getTiledeskToken();
|
|
883
922
|
|
|
884
|
-
const supportmode = this.appConfigProvider.getConfig().supportMode;
|
|
885
|
-
this.logger.log('[APP-COMP] - GO-ONLINE - supportmode ', supportmode);
|
|
886
|
-
if (supportmode === true) {
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
}
|
|
923
|
+
// const supportmode = this.appConfigProvider.getConfig().supportMode;
|
|
924
|
+
// this.logger.log('[APP-COMP] - GO-ONLINE - supportmode ', supportmode);
|
|
925
|
+
// if (supportmode === true) {
|
|
926
|
+
// this.connetWebsocket() // moved in the comp project-item
|
|
927
|
+
// }
|
|
891
928
|
this.events.publish('go:online', true);
|
|
892
929
|
const currentUser = this.tiledeskAuthService.getCurrentUser();
|
|
930
|
+
this.setLanguage(currentUser);
|
|
893
931
|
// this.logger.printDebug('APP-COMP - goOnLine****', currentUser);
|
|
894
932
|
this.logger.log('[APP-COMP] - GO-ONLINE - currentUser ', currentUser);
|
|
895
933
|
this.chatManager.setTiledeskToken(tiledeskToken);
|
|
@@ -921,17 +959,7 @@ export class AppComponent implements OnInit {
|
|
|
921
959
|
}
|
|
922
960
|
}
|
|
923
961
|
|
|
924
|
-
|
|
925
|
-
const appconfig = this.appConfigProvider.getConfig();
|
|
926
|
-
this.logger.log('connetWebsocket appconfig wsUrl ', appconfig.wsUrl)
|
|
927
|
-
const WS_URL = appconfig.wsUrl + '?token=' + tiledeskToken
|
|
928
|
-
this.webSocketJs.init(
|
|
929
|
-
WS_URL,
|
|
930
|
-
undefined,
|
|
931
|
-
undefined,
|
|
932
|
-
undefined
|
|
933
|
-
);
|
|
934
|
-
}
|
|
962
|
+
|
|
935
963
|
|
|
936
964
|
|
|
937
965
|
goOffLine = () => {
|
|
@@ -939,7 +967,7 @@ export class AppComponent implements OnInit {
|
|
|
939
967
|
const supportmode = this.appConfigProvider.getConfig().supportMode;
|
|
940
968
|
this.logger.log('[APP-COMP] - GO-OFFINE - supportmode ', supportmode);
|
|
941
969
|
if (supportmode === true) {
|
|
942
|
-
|
|
970
|
+
this.webSocketClose()
|
|
943
971
|
}
|
|
944
972
|
// this.isOnline = false;
|
|
945
973
|
// this.conversationsHandlerService.conversations = [];
|
|
@@ -979,6 +1007,7 @@ export class AppComponent implements OnInit {
|
|
|
979
1007
|
let platformIsNow = PLATFORM_DESKTOP;
|
|
980
1008
|
if (checkPlatformIsMobile()) {
|
|
981
1009
|
platformIsNow = PLATFORM_MOBILE;
|
|
1010
|
+
this.logger.log('onResize platformIsNow ', platformIsNow)
|
|
982
1011
|
}
|
|
983
1012
|
if (!this.platformIs || this.platformIs === '') {
|
|
984
1013
|
this.platformIs = platformIsNow;
|
|
@@ -1120,7 +1149,7 @@ export class AppComponent implements OnInit {
|
|
|
1120
1149
|
}
|
|
1121
1150
|
|
|
1122
1151
|
private initConversationsHandler(userId: string) {
|
|
1123
|
-
const keys = ['YOU'];
|
|
1152
|
+
const keys = ['YOU', 'INFO_A_NEW_SUPPORT_REQUEST_HAS_BEEN_ASSIGNED_TO_YOU'];
|
|
1124
1153
|
const translationMap = this.translateService.translateLanguage(keys);
|
|
1125
1154
|
|
|
1126
1155
|
this.logger.log('[APP-COMP] initConversationsHandler ------------->', userId, this.tenant);
|
package/src/app/app.module.ts
CHANGED
|
@@ -82,7 +82,9 @@ import { ConversationListPageModule } from './pages/conversations-list/conversat
|
|
|
82
82
|
import { ConversationDetailPageModule } from './pages/conversation-detail/conversation-detail.module';
|
|
83
83
|
import { LoginPageModule } from './pages/authentication/login/login.module';
|
|
84
84
|
import { LoaderPreviewPageModule } from './pages/loader-preview/loader-preview.module';
|
|
85
|
-
|
|
85
|
+
import { CreateTicketPageModule } from './pages/create-ticket/create-ticket.module';
|
|
86
|
+
import { CreateRequesterPageModule } from './pages/create-requester/create-requester.module';
|
|
87
|
+
import { CreateCannedResponsePageModule } from './pages/create-canned-response/create-canned-response.module';
|
|
86
88
|
// UTILS
|
|
87
89
|
import { ScrollbarThemeModule } from './utils/scrollbar-theme.directive';
|
|
88
90
|
import { SharedModule } from 'src/app/shared/shared.module';
|
|
@@ -90,12 +92,15 @@ import { ConversationInfoModule } from 'src/app/components/conversation-info/con
|
|
|
90
92
|
|
|
91
93
|
|
|
92
94
|
// Directives
|
|
93
|
-
import {
|
|
95
|
+
// import { HtmlEntitiesEncodePipe } from './directives/html-entities-encode.pipe';
|
|
96
|
+
// import { MarkedPipe } from './directives/marked.pipe';
|
|
97
|
+
|
|
94
98
|
import { LoggerInstance } from 'src/chat21-core/providers/logger/loggerInstance';
|
|
95
99
|
import { Network } from '@ionic-native/network/ngx';
|
|
96
100
|
import { ConnectionService } from 'ng-connection-service';
|
|
97
101
|
import { WebSocketJs } from './services/websocket/websocket-js';
|
|
98
102
|
import { UnassignedConversationsPageModule } from './pages/unassigned-conversations/unassigned-conversations.module';
|
|
103
|
+
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
|
99
104
|
|
|
100
105
|
// FACTORIES
|
|
101
106
|
export function createTranslateLoader(http: HttpClient) {
|
|
@@ -114,7 +119,7 @@ export function authenticationFactory(http: HttpClient, appConfig: AppConfigProv
|
|
|
114
119
|
|
|
115
120
|
auth.setBaseUrl(appConfig.getConfig().apiUrl);
|
|
116
121
|
|
|
117
|
-
if (config.pushEngine
|
|
122
|
+
if (config.pushEngine === PUSH_ENGINE_MQTT) {
|
|
118
123
|
// FOR PUSH NOTIFICATIONS INIT FIREBASE APP
|
|
119
124
|
FirebaseInitService.initFirebase(config.firebaseConfig);
|
|
120
125
|
}
|
|
@@ -245,12 +250,13 @@ const appInitializerFn = (appConfig: AppConfigProvider, logger: NGXLogger) => {
|
|
|
245
250
|
|
|
246
251
|
@NgModule({
|
|
247
252
|
declarations: [
|
|
248
|
-
AppComponent
|
|
253
|
+
AppComponent
|
|
249
254
|
],
|
|
250
255
|
entryComponents: [
|
|
251
256
|
],
|
|
252
257
|
imports: [
|
|
253
258
|
BrowserModule,
|
|
259
|
+
BrowserAnimationsModule,
|
|
254
260
|
FormsModule,
|
|
255
261
|
ReactiveFormsModule,
|
|
256
262
|
IonicModule.forRoot(),
|
|
@@ -279,7 +285,10 @@ const appInitializerFn = (appConfig: AppConfigProvider, logger: NGXLogger) => {
|
|
|
279
285
|
SharedModule,
|
|
280
286
|
ConversationInfoModule,
|
|
281
287
|
NgxLinkifyjsModule.forRoot(),
|
|
282
|
-
LoaderPreviewPageModule
|
|
288
|
+
LoaderPreviewPageModule,
|
|
289
|
+
CreateTicketPageModule,
|
|
290
|
+
CreateRequesterPageModule,
|
|
291
|
+
CreateCannedResponsePageModule
|
|
283
292
|
],
|
|
284
293
|
bootstrap: [AppComponent],
|
|
285
294
|
|
|
@@ -54,12 +54,23 @@
|
|
|
54
54
|
<!-- ----------------------------------------------------------- -->
|
|
55
55
|
|
|
56
56
|
<div class="conversation-wpr" style="height: 100%;">
|
|
57
|
-
<div *ngFor="let message of messages; let i = index">
|
|
57
|
+
<div *ngFor="let message of messages; let i = index; let first = first; trackBy: trackByFn">
|
|
58
|
+
|
|
59
|
+
<ng-container *ngIf="first || (messages[i - 1].timestamp | date:'d') !== (message.timestamp | date:'d')">
|
|
60
|
+
<div class="long-date-divider-wpr">
|
|
61
|
+
<div class="long-date-divider-border-b"></div>
|
|
62
|
+
<div class="long-date-divider">
|
|
63
|
+
<!-- {{message.timestamp | date: 'longDate' : 'it'}} -->
|
|
64
|
+
{{message.timestamp | amDateFormat:'LL'}}
|
|
65
|
+
|
|
66
|
+
</div>
|
|
67
|
+
<div class="long-date-divider-border-b"></div>
|
|
68
|
+
</div>
|
|
69
|
+
</ng-container>
|
|
58
70
|
|
|
59
71
|
<div class="align-center" class="ion-text-center" *ngIf="messageType(MESSAGE_TYPE_INFO, message)"
|
|
60
72
|
class="msg_info_container">
|
|
61
|
-
<chat-info-message class="messages"
|
|
62
|
-
[message]="message">
|
|
73
|
+
<chat-info-message class="messages" [message]="message">
|
|
63
74
|
</chat-info-message>
|
|
64
75
|
</div>
|
|
65
76
|
|
|
@@ -67,13 +78,15 @@
|
|
|
67
78
|
<div role="messaggio" *ngIf="messageType(MESSAGE_TYPE_MINE, message)" class="msg_container base_sent">
|
|
68
79
|
|
|
69
80
|
<!--backgroundColor non viene ancora usato -->
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
[ngClass]="{'
|
|
73
|
-
[
|
|
74
|
-
(onBeforeMessageRender)="returnOnBeforeMessageRender($event)"
|
|
75
|
-
(onAfterMessageRender)="returnOnAfterMessageRender($event)"
|
|
76
|
-
|
|
81
|
+
|
|
82
|
+
<chat-bubble-message style="position: relative;"
|
|
83
|
+
[ngClass]="{'has-metadata': (isImage(message) || isFrame(message))}" class="messages msg_sent"
|
|
84
|
+
id="message_msg_sent" [ngClass]="{'button-in-msg' : message.metadata && message.metadata.button}"
|
|
85
|
+
[message]="message" [textColor]="'col-msg-sent'" (onBeforeMessageRender)="returnOnBeforeMessageRender($event)"
|
|
86
|
+
(onAfterMessageRender)="returnOnAfterMessageRender($event)" (onImageRendered)="onImageRenderedFN($event)"
|
|
87
|
+
[addAsCannedResponseTooltipText]="addAsCannedResponseTooltipText" [areVisibleCAR]="areVisibleCAR"
|
|
88
|
+
[support_mode]="support_mode"
|
|
89
|
+
[class.emoticon]="message?.emoticon">
|
|
77
90
|
</chat-bubble-message>
|
|
78
91
|
|
|
79
92
|
<!-- icon status message -->
|
|
@@ -98,32 +111,30 @@
|
|
|
98
111
|
</chat-avatar-image> -->
|
|
99
112
|
|
|
100
113
|
<!--backgroundColor non viene ancora usato -->
|
|
101
|
-
|
|
102
|
-
<chat-bubble-message
|
|
103
|
-
[
|
|
104
|
-
[textColor]="'black'"
|
|
114
|
+
|
|
115
|
+
<chat-bubble-message style="position: relative;"
|
|
116
|
+
[ngClass]="{'has-metadata': (isImage(message) || isFrame(message))}" class="messages msg_receive"
|
|
117
|
+
id="message_msg_receive" [message]="message" [textColor]="'black'"
|
|
105
118
|
(onBeforeMessageRender)="returnOnBeforeMessageRender($event)"
|
|
106
|
-
(onAfterMessageRender)="returnOnAfterMessageRender($event)"
|
|
107
|
-
|
|
119
|
+
(onAfterMessageRender)="returnOnAfterMessageRender($event)" (onImageRendered)="onImageRenderedFN($event)"
|
|
120
|
+
[addAsCannedResponseTooltipText]="addAsCannedResponseTooltipText" [areVisibleCAR]="areVisibleCAR"
|
|
121
|
+
[support_mode]="support_mode"
|
|
122
|
+
[class.emoticon]="message?.emoticon">
|
|
108
123
|
</chat-bubble-message>
|
|
109
124
|
</div>
|
|
110
125
|
|
|
111
126
|
<!-- message type:: button && -->
|
|
112
|
-
<div *ngIf="message?.attributes && message?.attributes?.attachment " class="slide-in-left"
|
|
113
|
-
<chat-message-attachment
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
[isLastMessage] = "isLastMessage(message?.uid)"
|
|
117
|
-
[stylesMap]="stylesMap"
|
|
118
|
-
(onAttachmentButtonClicked)="returnOnAttachmentButtonClicked($event)">
|
|
127
|
+
<div *ngIf="message?.attributes && message?.attributes?.attachment " class="slide-in-left">
|
|
128
|
+
<chat-message-attachment style="height: 100%; display: block;" [message]="message"
|
|
129
|
+
[isLastMessage]="isLastMessage(message?.uid)" [stylesMap]="stylesMap"
|
|
130
|
+
(onAttachmentButtonClicked)="returnOnAttachmentButtonClicked($event)">
|
|
119
131
|
</chat-message-attachment>
|
|
120
132
|
</div>
|
|
121
133
|
</div>
|
|
122
134
|
<!-- (fileType === 'file' && uploadProgress !== 100) -->
|
|
123
135
|
|
|
124
136
|
<!-- uploadProgress -> {{ uploadProgress }} -->
|
|
125
|
-
<div *ngIf="uploadProgress !== 100" class="msg_container base_sent"
|
|
126
|
-
style="margin-right: 20px;">
|
|
137
|
+
<div *ngIf="uploadProgress !== 100" class="msg_container base_sent" style="margin-right: 20px;">
|
|
127
138
|
<div class="messages msg_sent">
|
|
128
139
|
<div class="spinner">
|
|
129
140
|
<div class="bounce1"></div>
|