@chat21/chat21-ionic 3.0.66 → 3.0.68-rc.3
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 +16 -0
- package/deploy_amazon_prod.sh +7 -3
- package/package.json +1 -1
- package/src/app/app.component.ts +90 -31
- package/src/app/app.module.ts +4 -4
- package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.scss +8 -0
- package/src/app/chatlib/conversation-detail/message/info-message/info-message.component.ts +0 -2
- package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.ts +1 -3
- package/src/app/components/conversation-info/info-content/info-content.component.ts +22 -25
- package/src/app/components/ddp-header/ddp-header.component.html +20 -5
- package/src/app/components/ddp-header/ddp-header.component.ts +8 -0
- package/src/app/components/project-item/project-item.component.ts +28 -50
- package/src/app/components/sidebar/sidebar.component.ts +20 -49
- package/src/app/pages/conversation-detail/conversation-detail.page.ts +54 -106
- package/src/app/pages/conversations-list/conversations-list.page.html +3 -1
- package/src/app/pages/conversations-list/conversations-list.page.ts +48 -30
- package/src/app/pages/create-canned-response/create-canned-response.page.ts +22 -29
- package/src/app/pages/loader-preview/loader-preview.page.ts +12 -43
- package/src/app/services/websocket/websocket.service.ts +1 -1
- package/src/assets/i18n/ar.json +1 -1
- package/src/assets/i18n/az.json +266 -0
- package/src/assets/i18n/de.json +1 -1
- package/src/assets/i18n/en.json +1 -1
- package/src/assets/i18n/es.json +1 -1
- package/src/assets/i18n/fr.json +1 -1
- package/src/assets/i18n/it.json +1 -1
- package/src/assets/i18n/kk.json +266 -0
- package/src/assets/i18n/pt.json +1 -1
- package/src/assets/i18n/ru.json +1 -1
- package/src/assets/i18n/sr.json +1 -1
- package/src/assets/i18n/sv.json +266 -0
- package/src/assets/i18n/tr.json +1 -1
- package/src/assets/i18n/uk.json +1 -1
- package/src/assets/i18n/uz.json +267 -0
- package/src/assets/images/language_flag/az.png +0 -0
- package/src/assets/images/language_flag/kk.png +0 -0
- package/src/assets/images/language_flag/{sv-SE.png → sv.png} +0 -0
- package/src/assets/images/language_flag/uz.png +0 -0
- package/src/chat-config-mqtt-localhost.json +10 -3
- package/src/chat-config-pre.json +3 -1
- package/src/chat21-core/providers/abstract/archivedconversations-handler.service.ts +1 -2
- package/src/chat21-core/providers/abstract/conversations-handler.service.ts +4 -4
- package/src/chat21-core/providers/firebase/firebase-archivedconversations-handler.ts +3 -6
- package/src/chat21-core/providers/firebase/firebase-auth-service.ts +2 -8
- package/src/chat21-core/providers/firebase/firebase-conversation-handler.ts +4 -4
- package/src/chat21-core/providers/firebase/firebase-conversations-handler.ts +49 -10
- package/src/chat21-core/providers/firebase/firebase-groups-handler.ts +5 -5
- package/src/chat21-core/providers/firebase/firebase-image-repo.ts +2 -1
- package/src/chat21-core/providers/firebase/firebase-presence.service.ts +2 -3
- package/src/chat21-core/providers/firebase/firebase-typing.service.ts +2 -2
- package/src/chat21-core/providers/firebase/firebase-upload.service.ts +1 -1
- package/src/chat21-core/providers/mqtt/mqtt-archivedconversations-handler.ts +74 -274
- package/src/chat21-core/providers/mqtt/mqtt-auth-service.ts +26 -29
- package/src/chat21-core/providers/mqtt/mqtt-conversation-handler.ts +7 -28
- package/src/chat21-core/providers/mqtt/mqtt-conversations-handler.ts +24 -52
- package/src/chat21-core/providers/mqtt/mqtt-groups-handler.ts +11 -15
- package/src/chat21-core/providers/mqtt/mqtt-notifications.ts +88 -93
- package/src/chat21-core/providers/mqtt/mqtt-presence.service.ts +3 -2
- package/src/chat21-core/providers/mqtt/mqtt-typing.service.ts +5 -0
- package/src/chat21-core/providers/native/native-image-repo.ts +9 -2
- package/src/chat21-core/providers/native/native-upload-service.ts +3 -11
- package/src/chat21-core/providers/tiledesk/tiledesk-auth.service.ts +0 -2
- package/src/chat21-core/utils/constants.ts +1 -1
- package/src/chat21-core/utils/utils-message.ts +1 -1
- package/deploy_pre.sh +0 -44
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# chat21-ionic ver 3.0
|
|
2
2
|
|
|
3
|
+
### 3.0.68-rc3
|
|
4
|
+
- bug-fixed: not sound with unservedRequest if WebSocket restart again (every 3/5min)
|
|
5
|
+
|
|
6
|
+
### 3.0.68-rc2
|
|
7
|
+
- bug-fixed: removed lookup API call for old requests
|
|
8
|
+
|
|
9
|
+
### 3.0.68-rc1
|
|
10
|
+
- bug-fixed: not sound if conversation.is_new changed from true to false in conversationChange BS
|
|
11
|
+
- changed: if message contains only 1 emoji remove bubble message background and increase font-size
|
|
12
|
+
- added: new languages az, sv, kk, uz
|
|
13
|
+
- removed: control in info-content component for old project id with 32 characters
|
|
14
|
+
|
|
15
|
+
### 3.0.67 in PROD
|
|
16
|
+
- added: control to 'foregroundCount' when tab is hidden/visible
|
|
17
|
+
- added: sound control on/off to new conversations and conversations changed
|
|
18
|
+
|
|
3
19
|
### 3.0.66 in PROD
|
|
4
20
|
- added: control to 'foregroundCount' locale storage variable from dashboard
|
|
5
21
|
- added: uk translations
|
package/deploy_amazon_prod.sh
CHANGED
|
@@ -7,18 +7,22 @@ echo 'URL_VER: ---->'$URL_VER
|
|
|
7
7
|
|
|
8
8
|
# sed -i -e "s/$start$ver.$build/$start$NEW_VER.$NEW_BUILD/g" src/utils/constants.ts
|
|
9
9
|
sed -i -e "s/$URL_VER/g" src/utils/constants.ts
|
|
10
|
+
|
|
11
|
+
|
|
10
12
|
ionic cordova platform add browser --save
|
|
11
13
|
#ionic cordova build --env=prod browser -- --base-href /www/ --prod
|
|
12
14
|
ionic cordova build --env=prod browser --prod
|
|
15
|
+
|
|
13
16
|
cp -p src/firebase-messaging-sw.js platforms/browser/www/
|
|
14
17
|
cp -p src/manifest.json platforms/browser/www/
|
|
15
18
|
cp -p src/chat-config.json platforms/browser/www/
|
|
16
19
|
|
|
17
20
|
cd platforms/browser/www
|
|
18
|
-
aws s3 sync . s3://tiledesk-console/v2/chat/
|
|
19
|
-
aws s3 sync . s3://tiledesk-console/v2/chat/$version/
|
|
20
|
-
|
|
21
|
+
# aws s3 sync . s3://tiledesk-console/v2/chat/
|
|
22
|
+
# aws s3 sync . s3://tiledesk-console/v2/chat/$version/
|
|
23
|
+
aws s3 sync . s3://tiledesk-console/v2/chat/latest/
|
|
21
24
|
cd ../../../
|
|
25
|
+
|
|
22
26
|
# aws cloudfront create-invalidation --distribution-id E36UIP90GOSFPM --paths "/*"
|
|
23
27
|
|
|
24
28
|
# echo new version deployed on s3://tiledesk-dashboard/chat/$NEW_BUILD/
|
package/package.json
CHANGED
package/src/app/app.component.ts
CHANGED
|
@@ -89,6 +89,8 @@ export class AppComponent implements OnInit {
|
|
|
89
89
|
private setIntervalTime: any;
|
|
90
90
|
private setTimeoutSound: any;
|
|
91
91
|
private isTabVisible: boolean = true;
|
|
92
|
+
private isSoundEnabled: boolean;
|
|
93
|
+
private hasPlayed: boolean;
|
|
92
94
|
private tabTitle: string;
|
|
93
95
|
private setTimeoutConversationsEvent: any;
|
|
94
96
|
private logger: LoggerService = LoggerInstance.getInstance();
|
|
@@ -99,7 +101,7 @@ export class AppComponent implements OnInit {
|
|
|
99
101
|
private hadBeenCalledOpenModal: boolean = false;
|
|
100
102
|
public missingConnectionToast: any
|
|
101
103
|
public executedInitializeAppByWatchConnection: boolean = false;
|
|
102
|
-
|
|
104
|
+
private isInitialized: boolean = false;
|
|
103
105
|
private version: string;
|
|
104
106
|
IS_ONLINE: boolean;
|
|
105
107
|
IS_ON_MOBILE_DEVICE: boolean;
|
|
@@ -560,15 +562,13 @@ export class AppComponent implements OnInit {
|
|
|
560
562
|
chat_lang = stored_preferred_lang
|
|
561
563
|
}
|
|
562
564
|
|
|
563
|
-
this.logger.log('[APP-COMP] - chat_lang', chat_lang)
|
|
564
|
-
|
|
565
565
|
if (tranlatedLanguage.includes(chat_lang)) {
|
|
566
566
|
this.logger.log('[APP-COMP] tranlatedLanguage includes', chat_lang, ': ', tranlatedLanguage.includes(chat_lang))
|
|
567
567
|
this.translate.setDefaultLang(chat_lang)
|
|
568
568
|
this.translate.use(chat_lang);
|
|
569
569
|
}
|
|
570
570
|
else {
|
|
571
|
-
this.logger.log('[APP-COMP] tranlatedLanguage includes', chat_lang, ': ', tranlatedLanguage.includes(chat_lang))
|
|
571
|
+
this.logger.log('[APP-COMP] tranlatedLanguage not includes', chat_lang, ': ', tranlatedLanguage.includes(chat_lang))
|
|
572
572
|
this.translate.setDefaultLang('en');
|
|
573
573
|
this.translate.use('en');
|
|
574
574
|
}
|
|
@@ -830,12 +830,20 @@ export class AppComponent implements OnInit {
|
|
|
830
830
|
this.audio = new Audio();
|
|
831
831
|
this.audio.src = chatBaseUrl + URL_SOUND_LIST_CONVERSATION;
|
|
832
832
|
this.audio.load();
|
|
833
|
+
|
|
834
|
+
const sound_status = localStorage.getItem('dshbrd----sound')
|
|
835
|
+
if(sound_status && sound_status !== 'undefined'){
|
|
836
|
+
this.isSoundEnabled = sound_status === 'enabled'? true: false
|
|
837
|
+
}else{
|
|
838
|
+
this.isSoundEnabled = true
|
|
839
|
+
}
|
|
840
|
+
|
|
833
841
|
}
|
|
834
842
|
|
|
835
|
-
private manageTabNotification() {
|
|
843
|
+
private manageTabNotification(badgeNotificationCount?: number) {
|
|
836
844
|
if (!this.isTabVisible) {
|
|
837
845
|
// TAB IS HIDDEN --> manage title and SOUND
|
|
838
|
-
let badgeNewConverstionNumber = this.conversationsHandlerService.countIsNew()
|
|
846
|
+
let badgeNewConverstionNumber = badgeNotificationCount? badgeNotificationCount : this.conversationsHandlerService.countIsNew()
|
|
839
847
|
badgeNewConverstionNumber > 0 ? badgeNewConverstionNumber : badgeNewConverstionNumber = 1
|
|
840
848
|
document.title = "(" + badgeNewConverstionNumber + ") " + this.tabTitle
|
|
841
849
|
|
|
@@ -848,26 +856,41 @@ export class AppComponent implements OnInit {
|
|
|
848
856
|
document.title = "(" + badgeNewConverstionNumber + ") " + that.tabTitle;
|
|
849
857
|
}
|
|
850
858
|
}, 1000);
|
|
851
|
-
this.soundMessage()
|
|
859
|
+
// if(this.isSoundEnabled) this.soundMessage()
|
|
860
|
+
}
|
|
861
|
+
|
|
862
|
+
const sound_status = localStorage.getItem('dshbrd----sound')
|
|
863
|
+
if(sound_status && sound_status !== 'undefined'){
|
|
864
|
+
this.isSoundEnabled = sound_status === 'enabled'? true: false
|
|
852
865
|
}
|
|
853
|
-
//
|
|
866
|
+
// this.logger.debug('[APP-COMP] manageTabNotification can saund?', this.isInitialized, this.isSoundEnabled)
|
|
867
|
+
if(this.isInitialized && this.isSoundEnabled) this.soundMessage()
|
|
854
868
|
}
|
|
855
869
|
|
|
856
870
|
soundMessage() {
|
|
857
871
|
const that = this;
|
|
858
|
-
// this.
|
|
859
|
-
//
|
|
860
|
-
// this.
|
|
861
|
-
//
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
872
|
+
// this.logger.debug('[APP-COMP] conversation play', this.audio);
|
|
873
|
+
// clearTimeout(this.setTimeoutSound);
|
|
874
|
+
// this.setTimeoutSound = setTimeout(function () {
|
|
875
|
+
// that.audio.play().then(() => {
|
|
876
|
+
// that.logger.debug('[APP-COMP] ****** soundMessage played *****');
|
|
877
|
+
// }).catch((error: any) => {
|
|
878
|
+
// that.logger.error('[APP-COMP] ***soundMessage error*', error);
|
|
879
|
+
// });
|
|
880
|
+
// }, 4000);
|
|
881
|
+
|
|
882
|
+
//play sound every 4s from the fist time you receive a conversation added/changed
|
|
883
|
+
if(!this.hasPlayed){
|
|
865
884
|
that.audio.play().then(() => {
|
|
885
|
+
that.hasPlayed = true
|
|
866
886
|
that.logger.debug('[APP-COMP] ****** soundMessage played *****');
|
|
887
|
+
setTimeout(() => {
|
|
888
|
+
that.hasPlayed = false
|
|
889
|
+
}, 4000);
|
|
867
890
|
}).catch((error: any) => {
|
|
868
891
|
that.logger.error('[APP-COMP] ***soundMessage error*', error);
|
|
869
892
|
});
|
|
870
|
-
}
|
|
893
|
+
}
|
|
871
894
|
}
|
|
872
895
|
/**---------------- SOUND FUNCTIONS --> END <--- +*/
|
|
873
896
|
/***************************************************+*/
|
|
@@ -915,11 +938,10 @@ export class AppComponent implements OnInit {
|
|
|
915
938
|
|
|
916
939
|
this.events.subscribe('uidConvSelected:changed', this.subscribeChangedConversationSelected);
|
|
917
940
|
this.events.subscribe('profileInfoButtonClick:logout', this.subscribeProfileInfoButtonLogOut);
|
|
918
|
-
|
|
941
|
+
this.events.subscribe('unservedRequest:count', this.subscribeUnservedRequestCount)
|
|
919
942
|
|
|
920
943
|
this.conversationsHandlerService.conversationAdded.subscribe((conversation: ConversationModel) => {
|
|
921
|
-
this.logger.log('[APP-COMP] *****
|
|
922
|
-
// that.conversationsChanged(conversations);
|
|
944
|
+
// this.logger.log('[APP-COMP] ***** subscribeConversationAdded *****', conversation);
|
|
923
945
|
if (conversation && conversation.is_new === true) {
|
|
924
946
|
this.manageTabNotification()
|
|
925
947
|
}
|
|
@@ -930,17 +952,23 @@ export class AppComponent implements OnInit {
|
|
|
930
952
|
// console.log('[APP-COMP] ***** subscribeConversationChanged conversation: ', conversation);
|
|
931
953
|
if(conversation) this.updateConversationsOnStorage();
|
|
932
954
|
const currentUser = this.tiledeskAuthService.getCurrentUser()
|
|
955
|
+
});
|
|
956
|
+
|
|
957
|
+
this.conversationsHandlerService.conversationChangedDetailed.subscribe((changes: {value: ConversationModel, previousValue: ConversationModel}) => {
|
|
958
|
+
// console.log('[APP-COMP] ***** subscribeConversationChangedDetailed conversation: ', changes);
|
|
959
|
+
const currentUser = this.tiledeskAuthService.getCurrentUser()
|
|
933
960
|
if (currentUser && currentUser !== null) {
|
|
934
|
-
this.logger.log('[APP-COMP] *****
|
|
935
|
-
if (
|
|
936
|
-
|
|
961
|
+
this.logger.log('[APP-COMP] ***** subscribeConversationChangedDetailed currentUser: ', currentUser);
|
|
962
|
+
if (changes.value && changes.value.sender !== currentUser.uid) {
|
|
963
|
+
if(changes.value.is_new === changes.previousValue.is_new){
|
|
964
|
+
this.manageTabNotification();
|
|
965
|
+
}
|
|
937
966
|
}
|
|
938
967
|
}
|
|
939
968
|
});
|
|
940
969
|
|
|
941
970
|
this.conversationsHandlerService.conversationRemoved.subscribe((conversation: ConversationModel) => {
|
|
942
971
|
this.logger.log('[APP-COMP] ***** conversationRemoved *****', conversation);
|
|
943
|
-
// that.conversationsChanged(conversations);
|
|
944
972
|
if(conversation) this.updateConversationsOnStorage();
|
|
945
973
|
});
|
|
946
974
|
}
|
|
@@ -1014,7 +1042,8 @@ export class AppComponent implements OnInit {
|
|
|
1014
1042
|
this.chatManager.goOffLine();
|
|
1015
1043
|
|
|
1016
1044
|
this.router.navigateByUrl('conversation-detail/'); //redirect to basePage
|
|
1017
|
-
|
|
1045
|
+
// this.goToDashboardLogin()
|
|
1046
|
+
|
|
1018
1047
|
// clearTimeout(this.timeModalLogin);
|
|
1019
1048
|
// this.timeModalLogin = setTimeout(() => {
|
|
1020
1049
|
if (!this.hadBeenCalledOpenModal) {
|
|
@@ -1028,6 +1057,12 @@ export class AppComponent implements OnInit {
|
|
|
1028
1057
|
|
|
1029
1058
|
}
|
|
1030
1059
|
|
|
1060
|
+
goToDashboardLogin(){
|
|
1061
|
+
let DASHBOARD_URL = this.appConfigProvider.getConfig().dashboardUrl + '/index.html'
|
|
1062
|
+
const myWindow = window.open(DASHBOARD_URL, '_self');
|
|
1063
|
+
myWindow.focus();
|
|
1064
|
+
}
|
|
1065
|
+
|
|
1031
1066
|
|
|
1032
1067
|
webSocketClose() {
|
|
1033
1068
|
this.logger.log('[APP-COMP] - GO-OFFLINE - webSocketClose');
|
|
@@ -1108,6 +1143,12 @@ export class AppComponent implements OnInit {
|
|
|
1108
1143
|
}
|
|
1109
1144
|
}
|
|
1110
1145
|
|
|
1146
|
+
subscribeUnservedRequestCount = (unservedRequestCount) => {
|
|
1147
|
+
if(unservedRequestCount && unservedRequestCount > 0){
|
|
1148
|
+
this.manageTabNotification(unservedRequestCount) //sound and alternate title
|
|
1149
|
+
}
|
|
1150
|
+
}
|
|
1151
|
+
|
|
1111
1152
|
private async presentModal(calledby): Promise<any> {
|
|
1112
1153
|
this.logger.log('[APP-COMP] presentModal calledby', calledby, '- hadBeenCalledOpenModal: ', this.hadBeenCalledOpenModal);
|
|
1113
1154
|
const attributes = { tenant: this.tenant, enableBackdropDismiss: false };
|
|
@@ -1185,12 +1226,12 @@ export class AppComponent implements OnInit {
|
|
|
1185
1226
|
private updateConversationsOnStorage(){
|
|
1186
1227
|
const that = this
|
|
1187
1228
|
// reset timer and save conversation on storage after 2s
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1229
|
+
clearTimeout(this.setTimeoutConversationsEvent);
|
|
1230
|
+
this.setTimeoutConversationsEvent = setTimeout(() => {
|
|
1231
|
+
// that.logger.debug('[APP-COMP] updateConversationsOnStorage: reset timer and save conversations -> ', this.conversationsHandlerService.conversations.length)
|
|
1232
|
+
// that.appStorageService.setItem('conversations', JSON.stringify(that.conversationsHandlerService.conversations))
|
|
1233
|
+
that.isInitialized = true;
|
|
1234
|
+
}, 2000);
|
|
1194
1235
|
}
|
|
1195
1236
|
|
|
1196
1237
|
private initArchivedConversationsHandler(userId: string) {
|
|
@@ -1202,6 +1243,18 @@ export class AppComponent implements OnInit {
|
|
|
1202
1243
|
this.archivedConversationsHandlerService.initialize(this.tenant, userId, translationMap);
|
|
1203
1244
|
}
|
|
1204
1245
|
|
|
1246
|
+
checkAndRemoveDashboardForegroundCount(){
|
|
1247
|
+
try {
|
|
1248
|
+
const dashboardForegroundCount = localStorage.getItem('dshbrd----foregroundcount')
|
|
1249
|
+
this.logger.log('[SIDEBAR] - THERE IS DASHBOARD FOREGROUND COUNT', dashboardForegroundCount)
|
|
1250
|
+
if (dashboardForegroundCount && dashboardForegroundCount !== 'undefined') {
|
|
1251
|
+
localStorage.setItem('dshbrd----foregroundcount', '0')
|
|
1252
|
+
}
|
|
1253
|
+
} catch (err) {
|
|
1254
|
+
this.logger.error('Get local storage dshbrd----foregroundcount ', err)
|
|
1255
|
+
}
|
|
1256
|
+
}
|
|
1257
|
+
|
|
1205
1258
|
|
|
1206
1259
|
@HostListener('document:visibilitychange', [])
|
|
1207
1260
|
visibilitychange() {
|
|
@@ -1213,6 +1266,7 @@ export class AppComponent implements OnInit {
|
|
|
1213
1266
|
clearInterval(this.setIntervalTime)
|
|
1214
1267
|
this.isTabVisible = true;
|
|
1215
1268
|
document.title = this.tabTitle;
|
|
1269
|
+
this.checkAndRemoveDashboardForegroundCount()
|
|
1216
1270
|
}
|
|
1217
1271
|
}
|
|
1218
1272
|
|
|
@@ -1222,7 +1276,7 @@ export class AppComponent implements OnInit {
|
|
|
1222
1276
|
@HostListener('window:storage', ['$event'])
|
|
1223
1277
|
onStorageChanged(event: any) {
|
|
1224
1278
|
|
|
1225
|
-
if (event.key !== 'chat_sv5__tiledeskToken') {
|
|
1279
|
+
if (event.key !== 'chat_sv5__tiledeskToken' && event.key !== 'dshbrd----sound') {
|
|
1226
1280
|
return;
|
|
1227
1281
|
}
|
|
1228
1282
|
|
|
@@ -1259,6 +1313,11 @@ export class AppComponent implements OnInit {
|
|
|
1259
1313
|
|
|
1260
1314
|
}
|
|
1261
1315
|
}
|
|
1316
|
+
|
|
1317
|
+
if(event.key === 'dshbrd----sound'){
|
|
1318
|
+
this.events.publish('storage:sound', event.newValue);
|
|
1319
|
+
this.isSoundEnabled = event.newValue === 'enabled'? true: false
|
|
1320
|
+
}
|
|
1262
1321
|
}
|
|
1263
1322
|
}
|
|
1264
1323
|
|
package/src/app/app.module.ts
CHANGED
|
@@ -200,15 +200,15 @@ export function presenceFactory(appConfig: AppConfigProvider) {
|
|
|
200
200
|
}
|
|
201
201
|
}
|
|
202
202
|
|
|
203
|
-
export function imageRepoFactory(appConfig: AppConfigProvider) {
|
|
203
|
+
export function imageRepoFactory(appConfig: AppConfigProvider, http: HttpClient) {
|
|
204
204
|
|
|
205
205
|
const config = appConfig.getConfig()
|
|
206
206
|
if (config.uploadEngine === UPLOAD_ENGINE_NATIVE) {
|
|
207
|
-
const imageService = new NativeImageRepoService()
|
|
207
|
+
const imageService = new NativeImageRepoService(http)
|
|
208
208
|
imageService.setImageBaseUrl(config.baseImageUrl)
|
|
209
209
|
return imageService
|
|
210
210
|
} else {
|
|
211
|
-
const imageService = new FirebaseImageRepoService();
|
|
211
|
+
const imageService = new FirebaseImageRepoService(http);
|
|
212
212
|
FirebaseInitService.initFirebase(config.firebaseConfig)
|
|
213
213
|
imageService.setImageBaseUrl(config.baseImageUrl)
|
|
214
214
|
return imageService
|
|
@@ -345,7 +345,7 @@ const appInitializerFn = (appConfig: AppConfigProvider, logger: NGXLogger) => {
|
|
|
345
345
|
{
|
|
346
346
|
provide: ImageRepoService,
|
|
347
347
|
useFactory: imageRepoFactory,
|
|
348
|
-
deps: [AppConfigProvider]
|
|
348
|
+
deps: [AppConfigProvider, HttpClient]
|
|
349
349
|
},
|
|
350
350
|
{
|
|
351
351
|
provide: ConversationHandlerBuilderService,
|
|
@@ -22,13 +22,11 @@ export class InfoMessageComponent implements OnInit, OnChanges {
|
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
ngOnChanges() {
|
|
25
|
-
this.logger.debug('[INFO-COMP] message ', this.message)
|
|
26
25
|
// Fixes the bug: if a snippet of code is pasted and sent it is not displayed correctly info message
|
|
27
26
|
if(this.message && this.message.text) {
|
|
28
27
|
var regex = /<br\s*[\/]?>/gi;
|
|
29
28
|
this.message.text = this.message.text.replace(regex, "\n")
|
|
30
29
|
// this.message.text = replaceEndOfLine(this.message.text);
|
|
31
|
-
this.logger.debug('[INFO-COMP] message .text ', this.message.text )
|
|
32
30
|
}
|
|
33
31
|
}
|
|
34
32
|
|
|
@@ -88,7 +88,6 @@ export class IonListConversationsComponent extends ListConversationsComponent im
|
|
|
88
88
|
// }
|
|
89
89
|
|
|
90
90
|
this.currentYear = moment().format('YYYY');
|
|
91
|
-
this.logger.log('[ION-LIST-CONVS-COMP] - currentYear ', this.currentYear)
|
|
92
91
|
|
|
93
92
|
const DASHBOARD_BASE_URL = this.appConfigProvider.getConfig().dashboardUrl;
|
|
94
93
|
|
|
@@ -99,8 +98,7 @@ export class IonListConversationsComponent extends ListConversationsComponent im
|
|
|
99
98
|
}
|
|
100
99
|
ngOnInit() {
|
|
101
100
|
this.isApp = this.platform.is('ios') || this.platform.is('android')
|
|
102
|
-
this.logger.log('[ION-LIST-CONVS-COMP] - ngOnInit - IS-APP ', this.isApp)
|
|
103
|
-
this.logger.log('[ION-LIST-CONVS-COMP] - ngOnInit - Platform', this.platform.platforms());
|
|
101
|
+
this.logger.log('[ION-LIST-CONVS-COMP] - ngOnInit - IS-APP ', this.isApp);
|
|
104
102
|
|
|
105
103
|
}
|
|
106
104
|
|
|
@@ -91,24 +91,21 @@ export class InfoContentComponent implements OnInit {
|
|
|
91
91
|
const lastArrayElement = conversationWith_segments[conversationWith_segments.length - 1]
|
|
92
92
|
this.logger.log('[INFO-CONTENT-COMP] - paramMap.subscribe lastArrayElement ', lastArrayElement);
|
|
93
93
|
this.logger.log('[INFO-CONTENT-COMP] - paramMap.subscribe lastArrayElement length', lastArrayElement.length);
|
|
94
|
-
if (lastArrayElement.length !== 32) {
|
|
95
|
-
|
|
96
|
-
}
|
|
94
|
+
// if (lastArrayElement.length !== 32) {
|
|
95
|
+
// conversationWith_segments.pop();
|
|
96
|
+
// }
|
|
97
97
|
}
|
|
98
98
|
|
|
99
99
|
|
|
100
100
|
this.logger.log('[INFO-CONTENT-COMP] - paramMap.subscribe conversationWith_segments: ', conversationWith_segments);
|
|
101
101
|
|
|
102
102
|
if (this.conversationWith.startsWith("support-group")) {
|
|
103
|
-
if (conversationWith_segments.length === 4) {
|
|
103
|
+
// if (conversationWith_segments.length === 4) {
|
|
104
104
|
this.project_id = conversationWith_segments[2];
|
|
105
|
-
|
|
106
105
|
this.selectInfoContentTypeInfoSupportGroup();
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
this.getProjectIdByConversationWith(this.conversationWith)
|
|
111
|
-
}
|
|
106
|
+
// } else {
|
|
107
|
+
// this.getProjectIdByConversationWith(this.conversationWith)
|
|
108
|
+
// }
|
|
112
109
|
} else {
|
|
113
110
|
this.selectInfoContentTypeDirectAndGroup(this.conversationWith);
|
|
114
111
|
}
|
|
@@ -118,25 +115,25 @@ export class InfoContentComponent implements OnInit {
|
|
|
118
115
|
|
|
119
116
|
}
|
|
120
117
|
|
|
121
|
-
getProjectIdByConversationWith(conversationWith: string) {
|
|
122
|
-
|
|
118
|
+
// getProjectIdByConversationWith(conversationWith: string) {
|
|
119
|
+
// const tiledeskToken = this.tiledeskAuthService.getTiledeskToken();
|
|
123
120
|
|
|
124
|
-
|
|
125
|
-
|
|
121
|
+
// this.tiledeskService.getProjectIdByConvRecipient(tiledeskToken, conversationWith).subscribe(res => {
|
|
122
|
+
// this.logger.log('[INFO-CONTENT-COMP] - GET PROJECTID BY CONV RECIPIENT RES', res);
|
|
126
123
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
124
|
+
// if (res) {
|
|
125
|
+
// this.project_id = res.id_project
|
|
126
|
+
// this.logger.log('[INFO-CONTENT-COMP] - GET PROJECTID BY CONV RECIPIENT this.project_id', this.project_id);
|
|
127
|
+
// }
|
|
131
128
|
|
|
132
|
-
|
|
133
|
-
|
|
129
|
+
// }, (error) => {
|
|
130
|
+
// this.logger.error('[INFO-CONTENT-COMP] - GET PROJECTID BY CONV RECIPIENT - ERROR ', error);
|
|
134
131
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
}
|
|
132
|
+
// }, () => {
|
|
133
|
+
// this.logger.log('[INFO-CONTENT-COMP] - GET PROJECTID BY CONV RECIPIENT * COMPLETE *');
|
|
134
|
+
// this.selectInfoContentTypeInfoSupportGroup();
|
|
135
|
+
// });
|
|
136
|
+
// }
|
|
140
137
|
|
|
141
138
|
ngOnInit() {
|
|
142
139
|
this.logger.log('>>> N INFO-CONTENT-COMP CALLING ngOnInit');
|
|
@@ -11,25 +11,40 @@
|
|
|
11
11
|
<div *ngIf="numberOpenConv > 0" class="number-open-conv">({{numberOpenConv}})</div>
|
|
12
12
|
</ion-title>
|
|
13
13
|
|
|
14
|
-
<ion-buttons slot="
|
|
14
|
+
<ion-buttons slot="start">
|
|
15
|
+
<ion-button *ngIf="sound_btn==='enabled'" ion-button fill="clear" (click)="onSoundChangeFN('disabled')">
|
|
16
|
+
<ion-icon slot="icon-only" name="volume-high-outline" ></ion-icon>
|
|
17
|
+
</ion-button>
|
|
15
18
|
|
|
19
|
+
<ion-button *ngIf="sound_btn==='disabled'" ion-button fill="clear" (click)="onSoundChangeFN('enabled')">
|
|
20
|
+
<ion-icon slot="icon-only" name="volume-mute-outline" ></ion-icon>
|
|
21
|
+
</ion-button>
|
|
22
|
+
</ion-buttons>
|
|
23
|
+
|
|
24
|
+
<ion-buttons slot="end">
|
|
25
|
+
|
|
16
26
|
<ion-button ion-button fill="clear" (click)="presentCreateTicketModal()"
|
|
17
|
-
tooltip="{{translationMap?.get('CreateTicket')}}"
|
|
27
|
+
tooltip="{{translationMap?.get('CreateTicket')}}"
|
|
28
|
+
[options]="tooltipOptions"
|
|
29
|
+
placement="bottom">
|
|
18
30
|
<ion-icon slot="icon-only" name="ticket-outline"></ion-icon>
|
|
19
31
|
</ion-button>
|
|
20
32
|
|
|
21
33
|
<ion-button *ngIf="archived_btn" ion-button fill="clear" (click)="onClickArchivedConversation()"
|
|
22
|
-
tooltip="{{translationMap?.get('ViewArchivedConversations')}}"
|
|
34
|
+
tooltip="{{translationMap?.get('ViewArchivedConversations')}}"
|
|
35
|
+
[options]="tooltipOptions"
|
|
36
|
+
placement="bottom">
|
|
23
37
|
<ion-icon slot="icon-only" name="file-tray-full-outline"></ion-icon>
|
|
24
38
|
<!-- <ion-icon name="file-tray-stacked-outline"></ion-icon> -->
|
|
25
39
|
<!-- <ion-icon name="file-tray-full-outline"></ion-icon> -->
|
|
26
40
|
</ion-button>
|
|
27
41
|
|
|
28
42
|
<ion-button *ngIf="writeto_btn" ion-button fill="clear" (click)="onOpenContactsDirectory($event)"
|
|
29
|
-
|
|
43
|
+
tooltip="{{translationMap?.get('ViewContactsList')}}"
|
|
44
|
+
[options]="tooltipOptions"
|
|
45
|
+
placement="bottom">
|
|
30
46
|
<ion-icon slot="icon-only" name="create-outline"></ion-icon>
|
|
31
47
|
<!-- <ion-icon slot="icon-only" name="people-outline"></ion-icon> -->
|
|
32
|
-
|
|
33
48
|
</ion-button>
|
|
34
49
|
|
|
35
50
|
<!-- <button ion-button icon-only (click)="onOpenArchivedConversationsPage()">
|
|
@@ -9,12 +9,16 @@ import { CustomTranslateService } from 'src/chat21-core/providers/custom-transla
|
|
|
9
9
|
styleUrls: ['./ddp-header.component.scss'],
|
|
10
10
|
})
|
|
11
11
|
export class DdpHeaderComponent implements OnInit {
|
|
12
|
+
|
|
12
13
|
@Input() numberOpenConv: number
|
|
13
14
|
@Input() supportMode: boolean
|
|
14
15
|
@Input() archived_btn: boolean
|
|
15
16
|
@Input() writeto_btn: boolean
|
|
17
|
+
@Input() sound_btn: string
|
|
18
|
+
@Output() onSoundChange = new EventEmitter<string>()
|
|
16
19
|
@Output() openContactsDirectory = new EventEmitter()
|
|
17
20
|
@Output() openProfileInfo = new EventEmitter()
|
|
21
|
+
|
|
18
22
|
IS_ON_MOBILE_DEVICE: boolean
|
|
19
23
|
createTicketModal = null
|
|
20
24
|
public translationMap: Map<string, string>;
|
|
@@ -87,6 +91,10 @@ export class DdpHeaderComponent implements OnInit {
|
|
|
87
91
|
onOpenContactsDirectory(e: any) {
|
|
88
92
|
this.openContactsDirectory.emit(e)
|
|
89
93
|
}
|
|
94
|
+
|
|
95
|
+
onSoundChangeFN(e: any){
|
|
96
|
+
this.onSoundChange.emit(e)
|
|
97
|
+
}
|
|
90
98
|
// END @Output() //
|
|
91
99
|
|
|
92
100
|
onClickArchivedConversation() {
|