@chat21/chat21-ionic 3.0.60-rc2 → 3.0.60
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 +39 -0
- package/LICENSE +661 -21
- package/deploy_pre.sh +45 -6
- package/deploy_prod.sh +34 -9
- package/env.sample +1 -1
- package/package.json +1 -1
- package/src/app/app.component.ts +45 -21
- package/src/app/app.module.ts +2 -2
- package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.ts +62 -36
- package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.ts +42 -13
- package/src/app/components/conversation-detail/message-text-area/message-text-area.component.html +13 -6
- package/src/app/components/conversation-detail/message-text-area/message-text-area.component.scss +38 -3
- package/src/app/components/conversation-detail/message-text-area/message-text-area.component.ts +8 -6
- package/src/app/components/image-viewer/image-viewer.component.scss +2 -2
- package/src/app/components/project-item/project-item.component.html +140 -118
- package/src/app/components/project-item/project-item.component.scss +167 -90
- package/src/app/components/project-item/project-item.component.ts +41 -20
- package/src/app/pages/conversation-detail/conversation-detail.module.ts +2 -1
- package/src/app/pages/conversation-detail/conversation-detail.page.html +36 -43
- package/src/app/pages/conversation-detail/conversation-detail.page.ts +199 -110
- package/src/app/pages/conversations-list/conversations-list.page.html +9 -5
- package/src/app/pages/conversations-list/conversations-list.page.scss +12 -1
- package/src/app/pages/conversations-list/conversations-list.page.ts +24 -6
- 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/shared/shared.module.ts +6 -5
- package/src/assets/i18n/de.json +209 -0
- package/src/assets/i18n/en.json +24 -8
- package/src/assets/i18n/es.json +209 -0
- package/src/assets/i18n/fr.json +209 -0
- package/src/assets/i18n/it.json +42 -34
- package/src/assets/i18n/pt.json +209 -0
- package/src/assets/i18n/ru.json +209 -0
- package/src/assets/i18n/tr.json +209 -0
- package/src/assets/js/chat21client.js +16 -3
- package/src/chat-config-mqtt.json +2 -1
- package/src/chat-config-pre-test.json +2 -0
- package/src/chat-config-template.json +1 -0
- package/src/chat-config.json +1 -0
- package/src/chat21-core/providers/firebase/firebase-conversation-handler.ts +54 -43
- 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 +2 -0
- package/src/chat21-core/utils/utils.ts +12 -1
- package/src/global.scss +4 -0
package/deploy_pre.sh
CHANGED
|
@@ -24,21 +24,60 @@ sed -i -e "s/$URL_VER/g" src/utils/constants.ts
|
|
|
24
24
|
|
|
25
25
|
# ng build --prod --base-href /$NEW_BUILD/
|
|
26
26
|
#ionic cordova build browser --prod
|
|
27
|
-
|
|
28
|
-
ionic cordova platform add browser --save
|
|
29
27
|
#ionic cordova build browser --prod --release
|
|
30
|
-
ionic cordova build --env=pre browser
|
|
28
|
+
# ionic cordova build --env=pre browser --prod #--verbose
|
|
31
29
|
|
|
30
|
+
ionic cordova platform add browser --save
|
|
31
|
+
ionic cordova build -c=pre browser --prod
|
|
32
32
|
cp -p src/firebase-messaging-sw.js platforms/browser/www/
|
|
33
33
|
cp -p src/manifest.json platforms/browser/www/
|
|
34
34
|
cp -p src/chat-config.json platforms/browser/www/
|
|
35
|
-
|
|
35
|
+
cp config.xml platforms/browser/www/
|
|
36
|
+
|
|
37
|
+
######### chat-ionic5 - the good one - publish in pre
|
|
36
38
|
cd platforms/browser/www
|
|
37
39
|
aws s3 sync . s3://tiledesk-dashboard-pre/chat-ionic5/$version/
|
|
38
40
|
aws s3 sync . s3://tiledesk-dashboard-pre/chat-ionic5/
|
|
39
41
|
cd ../../../
|
|
40
42
|
|
|
41
|
-
|
|
43
|
+
aws cloudfront create-invalidation --distribution-id E2DTAKWHWQ7C3J --paths "/*"
|
|
42
44
|
|
|
43
45
|
echo new version deployed on s3://tiledesk-dashboard-pre/chat-ionic5/$version/
|
|
44
|
-
echo available on https://s3.eu-west-1.amazonaws.com/tiledesk-dashboard-pre/chat-ionic5/$version/index.html
|
|
46
|
+
echo available on https://s3.eu-west-1.amazonaws.com/tiledesk-dashboard-pre/chat-ionic5/$version/index.html
|
|
47
|
+
echo available on https://support-pre.tiledesk.com/chat-ionic5/$version/index.html
|
|
48
|
+
echo available on https://support-pre.tiledesk.com/chat-ionic5/index.html
|
|
49
|
+
|
|
50
|
+
######### chat-ionic5-test - publish in pre with the projects right panel
|
|
51
|
+
# cd platforms/browser/www
|
|
52
|
+
# aws s3 sync . s3://tiledesk-dashboard-pre/chat-ionic5-test/$version/
|
|
53
|
+
# aws s3 sync . s3://tiledesk-dashboard-pre/chat-ionic5-test/
|
|
54
|
+
# cd ../../../
|
|
55
|
+
|
|
56
|
+
# aws cloudfront create-invalidation --distribution-id E2DTAKWHWQ7C3J --paths "/*"
|
|
57
|
+
|
|
58
|
+
# echo new version deployed on s3://tiledesk-dashboard-pre/chat-ionic5-test/$version/
|
|
59
|
+
# echo available on https://s3.eu-west-1.amazonaws.com/tiledesk-dashboard-pre/chat-ionic5-test/$version/index.html
|
|
60
|
+
# echo available on https://support-pre.tiledesk.com/chat-ionic5-test/$version/index.html
|
|
61
|
+
# echo available on https://support-pre.tiledesk.com/chat-ionic5-test/index.html
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
####### chat ionic MQTT in pre da aggiungere in deploy_pre.sh
|
|
65
|
+
# cd platforms/browser/www
|
|
66
|
+
# aws s3 sync . s3://tiledesk-dashboard-pre/native-mqtt/chat-ionic5/
|
|
67
|
+
# aws s3 sync . s3://tiledesk-dashboard-pre/native-mqtt/chat-ionic5/$version
|
|
68
|
+
# cd ../../../
|
|
69
|
+
# echo new version deployed on s3://tiledesk-dashboard-pre/native-mqtt/chat-ionic5/
|
|
70
|
+
# echo new version deployed on s3://tiledesk-dashboard-pre/native-mqtt/chat-ionic5/$version
|
|
71
|
+
# echo http://tiledesk-dashboard-pre.s3-eu-west-1.amazonaws.com/native-mqtt/chat-ionic5/index.html
|
|
72
|
+
# echo http://tiledesk-dashboard-pre.s3-eu-west-1.amazonaws.com/native-mqtt/chat-ionic5/$version/index.html
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
####### chat ionic FIREBASE in pre da aggiungere in deploy_pre.sh
|
|
76
|
+
# cd platforms/browser/www
|
|
77
|
+
# aws s3 sync . s3://tiledesk-dashboard-pre/chat5/
|
|
78
|
+
# aws s3 sync . s3://tiledesk-dashboard-pre/chat5/$version
|
|
79
|
+
# cd ../../../
|
|
80
|
+
# echo new version deployed on s3://tiledesk-dashboard-pre/chat5/$version
|
|
81
|
+
# echo new version deployed on s3://tiledesk-dashboard-pre/chat5/
|
|
82
|
+
# echo available on http://support-pre.tiledesk.com/chat5/index.html
|
|
83
|
+
# echo available on http://support-pre.tiledesk.com/chat5/$version/index.html
|
package/deploy_prod.sh
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
npm version patch
|
|
1
|
+
# npm version patch
|
|
2
2
|
version=`node -e 'console.log(require("./package.json").version)'`
|
|
3
3
|
echo "version $version"
|
|
4
4
|
|
|
@@ -12,22 +12,47 @@ echo 'URL_VER: ---->'$URL_VER
|
|
|
12
12
|
# npm publish
|
|
13
13
|
# fi
|
|
14
14
|
|
|
15
|
-
# sed -i -e "s/$start$ver.$build/$start$NEW_VER.$NEW_BUILD/g" src/utils/constants.ts
|
|
16
15
|
sed -i -e "s/$URL_VER/g" src/utils/constants.ts
|
|
16
|
+
|
|
17
17
|
ionic cordova platform add browser --save
|
|
18
18
|
#ionic cordova build --env=prod browser -- --base-href /www/ --prod
|
|
19
19
|
ionic cordova build --env=prod browser --prod
|
|
20
20
|
cp -p src/firebase-messaging-sw.js platforms/browser/www/
|
|
21
21
|
cp -p src/manifest.json platforms/browser/www/
|
|
22
22
|
cp -p src/chat-config.json platforms/browser/www/
|
|
23
|
+
cp -p config.xml platforms/browser/www/
|
|
24
|
+
|
|
23
25
|
|
|
26
|
+
###### CHAT in prod
|
|
24
27
|
cd platforms/browser/www
|
|
25
|
-
|
|
26
|
-
aws s3 sync . s3://tiledesk-console/v2/chat
|
|
27
|
-
aws s3 sync . s3://tiledesk-console/v2/chat-ionic5/$version/
|
|
28
|
+
aws s3 sync . s3://tiledesk-console/v2/chat/
|
|
29
|
+
aws s3 sync . s3://tiledesk-console/v2/chat/$version/
|
|
28
30
|
cd ../../../
|
|
29
|
-
|
|
31
|
+
echo new version deployed on s3://tiledesk-console/v2/chat/
|
|
32
|
+
echo available on https://console.tiledesk.com/v2/chat/$version/index.html
|
|
33
|
+
echo available on https://console.tiledesk.com/v2/chat/index.html
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
###### CHAT-IONIC5
|
|
37
|
+
# cd platforms/browser/www
|
|
38
|
+
# #aws s3 sync . s3://tiledesk-dashboard/chat/
|
|
39
|
+
# aws s3 sync . s3://tiledesk-console/v2/chat-ionic5/
|
|
40
|
+
# aws s3 sync . s3://tiledesk-console/v2/chat-ionic5/$version/
|
|
41
|
+
# cd ../../../
|
|
42
|
+
# # aws cloudfront create-invalidation --distribution-id E2DTAKWHWQ7C3J --paths "/*"
|
|
43
|
+
|
|
44
|
+
# # echo new version deployed on s3://tiledesk-dashboard/chat/$NEW_BUILD/
|
|
45
|
+
# echo new version deployed on s3://tiledesk-console/v2/chat-ionic5/$version/
|
|
46
|
+
# echo available on https://console.tiledesk.com/v2/chat-ionic5/$version/index.html
|
|
47
|
+
|
|
48
|
+
|
|
30
49
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
50
|
+
####### chat ionic FIREBASE in PROD IN SUBFOLDER
|
|
51
|
+
# cd platforms/browser/www
|
|
52
|
+
# aws s3 sync . s3://tiledesk-console/v2/chat5-dev/
|
|
53
|
+
# aws s3 sync . s3://tiledesk-console/v2/chat5-dev/$version
|
|
54
|
+
# cd ../../../
|
|
55
|
+
# echo new version deployed on s3://console.tiledesk.com/v2/chat5-dev/$version
|
|
56
|
+
# echo new version deployed on s3://console.tiledesk.com/v2/chat5-dev/
|
|
57
|
+
# echo available on http://console.tiledesk.com/v2/chat5-dev/index.html
|
|
58
|
+
# echo available on http://console.tiledesk.com/v2/chat5-dev/$version/index.html
|
package/env.sample
CHANGED
package/package.json
CHANGED
package/src/app/app.component.ts
CHANGED
|
@@ -98,7 +98,7 @@ export class AppComponent implements OnInit {
|
|
|
98
98
|
public missingConnectionToast: any
|
|
99
99
|
public executedInitializeAppByWatchConnection: boolean = false;
|
|
100
100
|
private version: string;
|
|
101
|
-
|
|
101
|
+
|
|
102
102
|
// private isOnline: boolean = false;
|
|
103
103
|
|
|
104
104
|
wsService: WebSocketJs;
|
|
@@ -416,9 +416,9 @@ export class AppComponent implements OnInit {
|
|
|
416
416
|
// this.logger.log('[APP-COMP] - X - initializeApp !!! CALLED-BY: ', calledby);
|
|
417
417
|
// console.log('[APP-COMP] appconfig platform is cordova: ', this.platform.is('cordova'))
|
|
418
418
|
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
419
|
+
if (!this.platform.is('cordova')) {
|
|
420
|
+
this.splashScreen.show();
|
|
421
|
+
}
|
|
422
422
|
this.tabTitle = document.title;
|
|
423
423
|
|
|
424
424
|
this.getRouteParamsAndSetLoggerConfig();
|
|
@@ -443,11 +443,11 @@ export class AppComponent implements OnInit {
|
|
|
443
443
|
// console.log("Check platform");
|
|
444
444
|
this.getPlatformName();
|
|
445
445
|
|
|
446
|
-
this.setLanguage();
|
|
446
|
+
// this.setLanguage();
|
|
447
447
|
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
448
|
+
if (this.splashScreen) {
|
|
449
|
+
this.splashScreen.hide();
|
|
450
|
+
}
|
|
451
451
|
this.statusBar.styleDefault();
|
|
452
452
|
this.navService.init(this.sidebarNav, this.detailNav);
|
|
453
453
|
// this.persistence = appconfig.authPersistence;
|
|
@@ -521,19 +521,42 @@ export class AppComponent implements OnInit {
|
|
|
521
521
|
}
|
|
522
522
|
|
|
523
523
|
/** */
|
|
524
|
-
setLanguage() {
|
|
524
|
+
setLanguage(currentUser) {
|
|
525
|
+
// const currentUser = JSON.parse(this.appStorageService.getItem('currentUser'));
|
|
526
|
+
this.logger.log('[APP-COMP] - setLanguage current_user uid: ', currentUser);
|
|
527
|
+
|
|
528
|
+
let currentUserId = ''
|
|
529
|
+
if (currentUser) {
|
|
530
|
+
currentUserId = currentUser.uid;
|
|
531
|
+
this.logger.log('[APP-COMP] - setLanguage current_user uid: ', currentUserId);
|
|
532
|
+
}
|
|
525
533
|
this.translate.setDefaultLang('en');
|
|
526
534
|
this.translate.use('en');
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
+
|
|
536
|
+
const browserLang = this.translate.getBrowserLang();
|
|
537
|
+
this.logger.log('[APP-COMP] browserLang: ', browserLang);
|
|
538
|
+
const stored_preferred_lang = localStorage.getItem(currentUserId + '_lang');
|
|
539
|
+
this.logger.log('[APP-COMP] stored_preferred_lang: ', stored_preferred_lang);
|
|
540
|
+
|
|
541
|
+
let chat_lang = ''
|
|
542
|
+
if (browserLang && !stored_preferred_lang) {
|
|
543
|
+
chat_lang = browserLang
|
|
544
|
+
} else if (browserLang && stored_preferred_lang) {
|
|
545
|
+
chat_lang = stored_preferred_lang
|
|
535
546
|
}
|
|
536
|
-
|
|
547
|
+
|
|
548
|
+
this.translate.use(chat_lang);
|
|
549
|
+
|
|
550
|
+
// this.logger.debug('[APP-COMP] navigator.language: ', navigator.language);
|
|
551
|
+
// let language;
|
|
552
|
+
// if (navigator.language.indexOf('-') !== -1) {
|
|
553
|
+
// language = navigator.language.substring(0, navigator.language.indexOf('-'));
|
|
554
|
+
// } else if (navigator.language.indexOf('_') !== -1) {
|
|
555
|
+
// language = navigator.language.substring(0, navigator.language.indexOf('_'));
|
|
556
|
+
// } else {
|
|
557
|
+
// language = navigator.language;
|
|
558
|
+
// }
|
|
559
|
+
// this.translate.use(language);
|
|
537
560
|
}
|
|
538
561
|
|
|
539
562
|
|
|
@@ -802,7 +825,7 @@ export class AppComponent implements OnInit {
|
|
|
802
825
|
.pipe(filter((state) => state !== null))
|
|
803
826
|
.subscribe((state: any) => {
|
|
804
827
|
this.logger.log('initialize FROM [APP-COMP] - [APP-COMP] ***** BSAuthStateChanged state', state);
|
|
805
|
-
|
|
828
|
+
|
|
806
829
|
if (state && state === AUTH_STATE_ONLINE) {
|
|
807
830
|
// const user = this.tiledeskAuthService.getCurrentUser();
|
|
808
831
|
// if (this.isOnline === false) {
|
|
@@ -868,6 +891,7 @@ export class AppComponent implements OnInit {
|
|
|
868
891
|
// }
|
|
869
892
|
this.events.publish('go:online', true);
|
|
870
893
|
const currentUser = this.tiledeskAuthService.getCurrentUser();
|
|
894
|
+
this.setLanguage(currentUser);
|
|
871
895
|
// this.logger.printDebug('APP-COMP - goOnLine****', currentUser);
|
|
872
896
|
this.logger.log('[APP-COMP] - GO-ONLINE - currentUser ', currentUser);
|
|
873
897
|
this.chatManager.setTiledeskToken(tiledeskToken);
|
|
@@ -907,7 +931,7 @@ export class AppComponent implements OnInit {
|
|
|
907
931
|
const supportmode = this.appConfigProvider.getConfig().supportMode;
|
|
908
932
|
this.logger.log('[APP-COMP] - GO-OFFINE - supportmode ', supportmode);
|
|
909
933
|
if (supportmode === true) {
|
|
910
|
-
|
|
934
|
+
this.webSocketClose()
|
|
911
935
|
}
|
|
912
936
|
// this.isOnline = false;
|
|
913
937
|
// this.conversationsHandlerService.conversations = [];
|
|
@@ -1088,7 +1112,7 @@ export class AppComponent implements OnInit {
|
|
|
1088
1112
|
}
|
|
1089
1113
|
|
|
1090
1114
|
private initConversationsHandler(userId: string) {
|
|
1091
|
-
const keys = ['YOU'];
|
|
1115
|
+
const keys = ['YOU', 'INFO_A_NEW_SUPPORT_REQUEST_HAS_BEEN_ASSIGNED_TO_YOU'];
|
|
1092
1116
|
const translationMap = this.translateService.translateLanguage(keys);
|
|
1093
1117
|
|
|
1094
1118
|
this.logger.log('[APP-COMP] initConversationsHandler ------------->', userId, this.tenant);
|
package/src/app/app.module.ts
CHANGED
|
@@ -90,7 +90,7 @@ import { ConversationInfoModule } from 'src/app/components/conversation-info/con
|
|
|
90
90
|
|
|
91
91
|
|
|
92
92
|
// Directives
|
|
93
|
-
|
|
93
|
+
|
|
94
94
|
import { LoggerInstance } from 'src/chat21-core/providers/logger/loggerInstance';
|
|
95
95
|
import { Network } from '@ionic-native/network/ngx';
|
|
96
96
|
import { ConnectionService } from 'ng-connection-service';
|
|
@@ -114,7 +114,7 @@ export function authenticationFactory(http: HttpClient, appConfig: AppConfigProv
|
|
|
114
114
|
|
|
115
115
|
auth.setBaseUrl(appConfig.getConfig().apiUrl);
|
|
116
116
|
|
|
117
|
-
if (config.pushEngine
|
|
117
|
+
if (config.pushEngine === PUSH_ENGINE_MQTT) {
|
|
118
118
|
// FOR PUSH NOTIFICATIONS INIT FIREBASE APP
|
|
119
119
|
FirebaseInitService.initFirebase(config.firebaseConfig);
|
|
120
120
|
}
|
package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.ts
CHANGED
|
@@ -6,6 +6,7 @@ import { LoggerService } from 'src/chat21-core/providers/abstract/logger.service
|
|
|
6
6
|
import { isFile, isFrame, isImage } from 'src/chat21-core/utils/utils-message';
|
|
7
7
|
import { LoggerInstance } from 'src/chat21-core/providers/logger/loggerInstance';
|
|
8
8
|
import { TranslateService } from '@ngx-translate/core';
|
|
9
|
+
import { TiledeskAuthService } from 'src/chat21-core/providers/tiledesk/tiledesk-auth.service';
|
|
9
10
|
import * as moment from 'moment';
|
|
10
11
|
@Component({
|
|
11
12
|
selector: 'chat-bubble-message',
|
|
@@ -36,53 +37,78 @@ export class BubbleMessageComponent implements OnInit, OnChanges {
|
|
|
36
37
|
};
|
|
37
38
|
|
|
38
39
|
private logger: LoggerService = LoggerInstance.getInstance()
|
|
40
|
+
|
|
39
41
|
constructor(
|
|
40
42
|
public sanitizer: DomSanitizer,
|
|
41
|
-
private translate: TranslateService
|
|
43
|
+
private translate: TranslateService,
|
|
44
|
+
public tiledeskAuthService: TiledeskAuthService
|
|
45
|
+
|
|
46
|
+
) {
|
|
42
47
|
// console.log('BUBBLE-MSG Hello !!!!')
|
|
43
48
|
}
|
|
44
49
|
|
|
45
50
|
ngOnInit() {
|
|
51
|
+
|
|
52
|
+
this.setMomentLocale()
|
|
53
|
+
// this.browserLang = this.translate.getBrowserLang();
|
|
54
|
+
|
|
55
|
+
// if (this.browserLang) {
|
|
56
|
+
// if (this.browserLang === 'it') {
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
// moment.locale('it', {
|
|
60
|
+
// calendar: {
|
|
61
|
+
// lastDay: '[Ieri alle] LT',
|
|
62
|
+
// sameDay: '[Oggi alle] LT',
|
|
63
|
+
// nextDay: '[Domani alle] LT',
|
|
64
|
+
// lastWeek: '[Ultimo] dddd [alle] LT',
|
|
65
|
+
// nextWeek: 'dddd [alle] LT',
|
|
66
|
+
// sameElse: 'lll'
|
|
67
|
+
// }
|
|
68
|
+
// });
|
|
69
|
+
|
|
70
|
+
// } else {
|
|
71
|
+
// moment.locale('en', {
|
|
72
|
+
// calendar: {
|
|
73
|
+
// lastDay: '[Yesterday at] LT',
|
|
74
|
+
// sameDay: '[Today at] LT',
|
|
75
|
+
// nextDay: '[Tomorrow at] LT',
|
|
76
|
+
// lastWeek: '[last] dddd [at] LT',
|
|
77
|
+
// nextWeek: 'dddd [at] LT',
|
|
78
|
+
// sameElse: 'lll'
|
|
79
|
+
// }
|
|
80
|
+
// });
|
|
81
|
+
// }
|
|
82
|
+
// }
|
|
83
|
+
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
setMomentLocale() {
|
|
46
88
|
this.browserLang = this.translate.getBrowserLang();
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
moment.locale('it', {
|
|
54
|
-
calendar: {
|
|
55
|
-
lastDay: '[Ieri alle] LT',
|
|
56
|
-
sameDay: '[Oggi alle] LT',
|
|
57
|
-
nextDay: '[Domani alle] LT',
|
|
58
|
-
lastWeek: '[Ultimo] dddd [alle] LT',
|
|
59
|
-
nextWeek: 'dddd [alle] LT',
|
|
60
|
-
sameElse: 'lll'
|
|
61
|
-
}
|
|
62
|
-
});
|
|
63
|
-
|
|
64
|
-
} else {
|
|
65
|
-
// console.log('BUBBLE-MSG browserLang ', this.browserLang)
|
|
66
|
-
// moment.locale('en')
|
|
67
|
-
|
|
68
|
-
moment.locale('en', {
|
|
69
|
-
calendar: {
|
|
70
|
-
lastDay: '[Yesterday at] LT',
|
|
71
|
-
sameDay: '[Today at] LT',
|
|
72
|
-
nextDay: '[Tomorrow at] LT',
|
|
73
|
-
lastWeek: '[last] dddd [at] LT',
|
|
74
|
-
nextWeek: 'dddd [at] LT',
|
|
75
|
-
sameElse: 'lll'
|
|
76
|
-
}
|
|
77
|
-
});
|
|
78
|
-
}
|
|
89
|
+
const currentUser = this.tiledeskAuthService.getCurrentUser();
|
|
90
|
+
this.logger.log('[BUBBLE-MESSAGE] - ngOnInit - currentUser ', currentUser)
|
|
91
|
+
let currentUserId = ''
|
|
92
|
+
if (currentUser) {
|
|
93
|
+
currentUserId = currentUser.uid
|
|
94
|
+
this.logger.log('[BUBBLE-MESSAGE] - ngOnInit - currentUserId ', currentUserId)
|
|
79
95
|
}
|
|
80
96
|
|
|
97
|
+
const stored_preferred_lang = localStorage.getItem(currentUserId + '_lang');
|
|
98
|
+
this.logger.log('[BUBBLE-MESSAGE] stored_preferred_lang: ', stored_preferred_lang);
|
|
81
99
|
|
|
82
100
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
101
|
+
let chat_lang = ''
|
|
102
|
+
if (this.browserLang && !stored_preferred_lang) {
|
|
103
|
+
chat_lang = this.browserLang
|
|
104
|
+
} else if (this.browserLang && stored_preferred_lang) {
|
|
105
|
+
chat_lang = stored_preferred_lang
|
|
106
|
+
}
|
|
107
|
+
moment.locale(chat_lang , {
|
|
108
|
+
calendar: {
|
|
109
|
+
sameElse: 'LLLL'
|
|
110
|
+
}
|
|
111
|
+
});
|
|
86
112
|
}
|
|
87
113
|
|
|
88
114
|
ngOnChanges() {
|
|
@@ -14,6 +14,7 @@ import * as moment from 'moment';
|
|
|
14
14
|
import { NetworkService } from '../../../services/network-service/network.service';
|
|
15
15
|
import { AppConfigProvider } from 'src/app/services/app-config';
|
|
16
16
|
import { DomSanitizer } from '@angular/platform-browser'
|
|
17
|
+
import { TiledeskAuthService } from 'src/chat21-core/providers/tiledesk/tiledesk-auth.service';
|
|
17
18
|
// import { LoggerService } from 'src/chat21-core/providers/abstract/logger.service';
|
|
18
19
|
// import { LoggerInstance } from 'src/chat21-core/providers/logger/loggerInstance';
|
|
19
20
|
|
|
@@ -32,7 +33,7 @@ export class IonListConversationsComponent extends ListConversationsComponent im
|
|
|
32
33
|
public logger: LoggerService = LoggerInstance.getInstance();
|
|
33
34
|
public currentYear: any;
|
|
34
35
|
public browserLang: string;
|
|
35
|
-
|
|
36
|
+
|
|
36
37
|
public PROJECT_FOR_PANEL: any;
|
|
37
38
|
|
|
38
39
|
/**
|
|
@@ -51,19 +52,24 @@ export class IonListConversationsComponent extends ListConversationsComponent im
|
|
|
51
52
|
private networkService: NetworkService,
|
|
52
53
|
private appConfigProvider: AppConfigProvider,
|
|
53
54
|
private sanitizer: DomSanitizer,
|
|
55
|
+
public tiledeskAuthService: TiledeskAuthService
|
|
54
56
|
) {
|
|
55
57
|
super(iterableDiffers, kvDiffers)
|
|
56
|
-
this.
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
}
|
|
58
|
+
this.setMomentLocale();
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
// if (this.browserLang) {
|
|
62
|
+
|
|
63
|
+
// moment.locale(this.browserLang)
|
|
64
|
+
// // if (this.browserLang === 'it') {
|
|
65
|
+
// // // this.translate.use('it');
|
|
66
|
+
// // moment.locale('it')
|
|
67
|
+
|
|
68
|
+
// // } else {
|
|
69
|
+
// // // this.translate.use('en');
|
|
70
|
+
// // moment.locale('en')
|
|
71
|
+
// // }
|
|
72
|
+
// }
|
|
67
73
|
|
|
68
74
|
this.currentYear = moment().format('YYYY');
|
|
69
75
|
this.logger.log('[ION-LIST-CONVS-COMP] - currentYear ', this.currentYear)
|
|
@@ -74,13 +80,36 @@ export class IonListConversationsComponent extends ListConversationsComponent im
|
|
|
74
80
|
this.PROJECT_FOR_PANEL = this.sanitizer.bypassSecurityTrustResourceUrl(DASHBOARD_BASE_URL + '#/project-for-panel');
|
|
75
81
|
}
|
|
76
82
|
|
|
83
|
+
setMomentLocale() {
|
|
84
|
+
this.browserLang = this.translate.getBrowserLang();
|
|
85
|
+
const currentUser = this.tiledeskAuthService.getCurrentUser();
|
|
86
|
+
this.logger.log('[ION-LIST-CONVS-COMP] - ngOnInit - currentUser ', currentUser)
|
|
87
|
+
let currentUserId = ''
|
|
88
|
+
if (currentUser) {
|
|
89
|
+
currentUserId = currentUser.uid
|
|
90
|
+
this.logger.log('[ION-LIST-CONVS-COMP] - ngOnInit - currentUserId ', currentUserId)
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
const stored_preferred_lang = localStorage.getItem(currentUserId + '_lang');
|
|
94
|
+
this.logger.log('[ION-LIST-CONVS-COMP] stored_preferred_lang: ', stored_preferred_lang);
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
let chat_lang = ''
|
|
98
|
+
if (this.browserLang && !stored_preferred_lang) {
|
|
99
|
+
chat_lang = this.browserLang
|
|
100
|
+
} else if (this.browserLang && stored_preferred_lang) {
|
|
101
|
+
chat_lang = stored_preferred_lang
|
|
102
|
+
}
|
|
103
|
+
moment.locale(chat_lang)
|
|
104
|
+
}
|
|
105
|
+
|
|
77
106
|
ngOnInit() {
|
|
78
107
|
this.isApp = this.platform.is('ios') || this.platform.is('android')
|
|
79
108
|
this.logger.log('[ION-LIST-CONVS-COMP] - ngOnInit - IS-APP ', this.isApp)
|
|
80
109
|
this.logger.log('[ION-LIST-CONVS-COMP] - ngOnInit - Platform', this.platform.platforms());
|
|
81
110
|
}
|
|
82
111
|
|
|
83
|
-
|
|
112
|
+
|
|
84
113
|
|
|
85
114
|
|
|
86
115
|
|
package/src/app/components/conversation-detail/message-text-area/message-text-area.component.html
CHANGED
|
@@ -39,16 +39,23 @@
|
|
|
39
39
|
<ion-col col-auto>
|
|
40
40
|
|
|
41
41
|
<div class="start-buttons" style="position: absolute;display: flex;">
|
|
42
|
-
|
|
43
|
-
<
|
|
44
|
-
|
|
42
|
+
|
|
43
|
+
<ng-container *ngIf="areVisibleCAR">
|
|
44
|
+
<div class="canned-responses-btn-wpr" style="margin-left: -5px;" tooltip="{{translationMap?.get('CANNED_RESPONSES')}}" [options]="tooltipOptions" placement="top">
|
|
45
45
|
<ion-button ion-button fill="clear" class="canned-responses-btn" (click)="openCannedResponses()" [disabled]="!IS_SUPPORT_GROUP_CONVERSATION">
|
|
46
46
|
<ion-icon slot="icon-only" lazy="true" name="flash-outline" style="font-size: 24px;"></ion-icon>
|
|
47
47
|
</ion-button>
|
|
48
|
-
|
|
49
48
|
</div>
|
|
49
|
+
<div *ngIf="IS_SUPPORT_GROUP_CONVERSATION && tagsCannedCount === 0" tooltip="{{translationMap?.get('NO_CANNED_RESPONSES')}}" [options]="tooltipOptions" placement="top" class="no-canned-responses-btn-badge">
|
|
50
|
+
<ion-icon name="alert-sharp" style="vertical-align: middle;"></ion-icon>
|
|
51
|
+
</div>
|
|
52
|
+
<div *ngIf="IS_SUPPORT_GROUP_CONVERSATION && tagsCannedCount > 0" tooltip="{{translationMap?.get('YES_CANNED_RESPONSES')}}" [options]="tooltipOptions" placement="top" class="canned-responses-btn-badge">
|
|
53
|
+
<ion-icon name="information-sharp" style="vertical-align: middle;"></ion-icon>
|
|
54
|
+
</div>
|
|
55
|
+
</ng-container>
|
|
50
56
|
|
|
51
|
-
|
|
57
|
+
|
|
58
|
+
<div class="upload-image-btn-wpr" tooltip="{{translationMap?.get('UPLOAD')}}" [options]="tooltipOptions" placement="top">
|
|
52
59
|
<ion-button ion-button fill="clear" class="upload-image-btn">
|
|
53
60
|
<ion-icon slot="icon-only" lazy="true" name="attach-outline"
|
|
54
61
|
style="font-size: 30px;transform: rotate(42deg);"></ion-icon>
|
|
@@ -60,7 +67,7 @@
|
|
|
60
67
|
</div>
|
|
61
68
|
</div>
|
|
62
69
|
|
|
63
|
-
<div class="text-message">
|
|
70
|
+
<div class="text-message" [ngClass]="{'text-message-no-cr': areVisibleCAR === false}">
|
|
64
71
|
<ion-textarea id="ion-textarea" #messageTextArea #message_text_area #textArea rows="1"
|
|
65
72
|
[placeholder]="TEXAREA_PLACEHOLDER" autosize="false" auto-grow="true" autofocus="true" [value]=""
|
|
66
73
|
[(ngModel)]="messageString" (ionChange)="ionChange($event);"
|
package/src/app/components/conversation-detail/message-text-area/message-text-area.component.scss
CHANGED
|
@@ -67,6 +67,10 @@
|
|
|
67
67
|
font-size: 15px;
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
|
+
.text-message-no-cr {
|
|
71
|
+
margin: 0 35px !important;
|
|
72
|
+
width: calc(100% - 70px) !important;
|
|
73
|
+
}
|
|
70
74
|
}
|
|
71
75
|
|
|
72
76
|
#fileInput {
|
|
@@ -107,12 +111,43 @@
|
|
|
107
111
|
--padding-bottom: 0px;
|
|
108
112
|
--padding-top: 0px;
|
|
109
113
|
--border-radius: 50%;
|
|
110
|
-
--padding-end:
|
|
111
|
-
--padding-start:
|
|
114
|
+
--padding-end: 2px;
|
|
115
|
+
--padding-start: 2px;
|
|
112
116
|
height: 33px !important;
|
|
113
|
-
width:
|
|
117
|
+
width: 33px;
|
|
114
118
|
}
|
|
115
119
|
|
|
120
|
+
.no-canned-responses-btn-badge {
|
|
121
|
+
position: absolute;
|
|
122
|
+
font-size: 12px;
|
|
123
|
+
background-color: transparent;
|
|
124
|
+
border-radius: 50%;
|
|
125
|
+
padding: 1px 2px;
|
|
126
|
+
top: 4px;
|
|
127
|
+
color: red;
|
|
128
|
+
left: -3px;
|
|
129
|
+
cursor: pointer;
|
|
130
|
+
}
|
|
131
|
+
.no-canned-responses-btn-badge:hover {
|
|
132
|
+
background-color: rgba(0, 0, 0, 0.05);;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.canned-responses-btn-badge {
|
|
136
|
+
position: absolute;
|
|
137
|
+
font-size: 12px;
|
|
138
|
+
background-color: transparent;
|
|
139
|
+
border-radius: 50%;
|
|
140
|
+
padding: 1px 2px;
|
|
141
|
+
top: 4px;
|
|
142
|
+
color: #92949c;
|
|
143
|
+
left: -3px;
|
|
144
|
+
cursor: pointer;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.canned-responses-btn-badge:hover {
|
|
148
|
+
background-color: rgba(0, 0, 0, 0.05);;
|
|
149
|
+
}
|
|
150
|
+
|
|
116
151
|
|
|
117
152
|
.upload-image-btn .button-native {
|
|
118
153
|
border-radius: 50%;
|
package/src/app/components/conversation-detail/message-text-area/message-text-area.component.ts
CHANGED
|
@@ -43,7 +43,8 @@ export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChange
|
|
|
43
43
|
@Input() loggedUser: UserModel;
|
|
44
44
|
@Input() conversationWith: string;
|
|
45
45
|
@Input() tagsCannedFilter: any = [];
|
|
46
|
-
|
|
46
|
+
@Input() tagsCannedCount: number;
|
|
47
|
+
@Input() areVisibleCAR: boolean;
|
|
47
48
|
@Input() events: Observable<void>;
|
|
48
49
|
@Input() fileUploadAccept: string
|
|
49
50
|
@Input() isOpenInfoConversation: boolean;
|
|
@@ -132,6 +133,9 @@ export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChange
|
|
|
132
133
|
|
|
133
134
|
this.logger.log("[CONVS-DETAIL][MSG-TEXT-AREA] ngOnChanges DROP EVENT ", this.dropEvent);
|
|
134
135
|
this.logger.log("[CONVS-DETAIL][MSG-TEXT-AREA] ngOnChanges tagsCannedFilter ", this.tagsCannedFilter);
|
|
136
|
+
this.logger.log("[CONVS-DETAIL][MSG-TEXT-AREA] ngOnChanges areVisibleCAR; ", this.areVisibleCAR);
|
|
137
|
+
|
|
138
|
+
|
|
135
139
|
this.logger.log('[CONVS-DETAIL] - returnChangeTextArea ngOnChanges in [MSG-TEXT-AREA] this.tagsCannedFilter.length ', this.tagsCannedFilter.length)
|
|
136
140
|
|
|
137
141
|
// use case drop
|
|
@@ -202,9 +206,7 @@ export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChange
|
|
|
202
206
|
} else if (this.currentWindowWidth <= 273) {
|
|
203
207
|
this.TEXAREA_PLACEHOLDER = this.SHORTER_TEXAREA_PLACEHOLDER;
|
|
204
208
|
}
|
|
205
|
-
|
|
206
209
|
}
|
|
207
|
-
|
|
208
210
|
}
|
|
209
211
|
|
|
210
212
|
// -------------------------------------------------------------------------------------------
|
|
@@ -429,7 +431,7 @@ export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChange
|
|
|
429
431
|
// this.logger.log("[CONVS-DETAIL][MSG-TEXT-AREA] ionChange detail.value ", e.detail.value);
|
|
430
432
|
|
|
431
433
|
const message = e.detail.value
|
|
432
|
-
|
|
434
|
+
this.logger.log("[CONVS-DETAIL] [MSG-TEXT-AREA] ionChange message ", message);
|
|
433
435
|
// this.logger.log("[CONVS-DETAIL] [MSG-TEXT-AREA] ionChange this.messageString ", this.messageString);
|
|
434
436
|
const height = e.target.offsetHeight + 20; // nk added +20
|
|
435
437
|
// this.logger.log("[CONVS-DETAIL] [MSG-TEXT-AREA] ionChange text-area height ", height);
|
|
@@ -556,12 +558,12 @@ export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChange
|
|
|
556
558
|
|
|
557
559
|
|
|
558
560
|
sendMessage(text: string) {
|
|
559
|
-
this.logger.log('[CONVS-DETAIL][MSG-TEXT-AREA] sendMessage', text);
|
|
561
|
+
this.logger.log('[CONVS-DETAIL][MSG-TEXT-AREA] sendMessage text', text);
|
|
560
562
|
this.logger.log('[CONVS-DETAIL][MSG-TEXT-AREA] sendMessage conve width', this.conversationWith);
|
|
561
563
|
// text.replace(/\s/g, "")
|
|
562
564
|
this.messageString = '';
|
|
563
565
|
// text = text.replace(/(\r\n|\n|\r)/gm, '');
|
|
564
|
-
if (text.trim() !== '') {
|
|
566
|
+
if (text && text.trim() !== '') {
|
|
565
567
|
this.eventSendMessage.emit({ message: text, type: TYPE_MSG_TEXT });
|
|
566
568
|
}
|
|
567
569
|
}
|