@chat21/chat21-ionic 3.0.61-rc23 → 3.0.61-rc26
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 +10 -1
- package/README.md +6 -0
- package/deploy_pre.sh +18 -18
- package/env.sample +1 -1
- package/package.json +1 -1
- package/src/app/app.component.ts +2 -2
- package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.ts +1 -1
- package/src/app/chatlib/list-conversations-component/list-conversations/list-conversations.component.ts +13 -10
- package/src/app/components/project-item/project-item.component.ts +3 -3
- package/src/app/components/sidebar/sidebar.component.ts +4 -2
- package/src/app/components/sidebar-user-details/sidebar-user-details.component.ts +1 -1
- package/src/app/pages/conversation-detail/conversation-detail.page.ts +1 -1
- package/src/app/pages/conversations-list/conversations-list.page.ts +67 -131
- package/src/chat-config-mqtt.json +25 -16
- package/src/chat-config-template.json +5 -4
- package/src/chat-config.json +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,8 +1,17 @@
|
|
|
1
1
|
# chat21-ionic ver 3.0
|
|
2
2
|
|
|
3
|
+
### 3.0.61-rc26
|
|
4
|
+
- Fixes the bug: the conversation detail is not opened if the URL contains round brackets
|
|
5
|
+
|
|
6
|
+
### 3.0.61-rc25
|
|
7
|
+
- Handles the case that in the storage the value of the "last_project" key is undefined
|
|
8
|
+
|
|
9
|
+
### 3.0.61-rc24
|
|
10
|
+
- Handles the "writeToButton" and the 'archivedButton' environment variables if are returned as a string
|
|
11
|
+
- Adds the "authPersistence" key in the chat-config-template.json, chat-config.json and env.sample files
|
|
3
12
|
|
|
4
13
|
### 3.0.61-rc23
|
|
5
|
-
- Handles the "
|
|
14
|
+
- Handles the "supportMode" environment variable if returned as a string (fixes the Docker image bugs: part of the conversation details go under the sidebar in mobile mode, the "add message as canned response" button is not displayed)
|
|
6
15
|
- Fixes the position of the emoji selection window pop up when the canned responses button is not visible
|
|
7
16
|
|
|
8
17
|
### 3.0.61-rc22
|
package/README.md
CHANGED
|
@@ -36,6 +36,12 @@ In progress git
|
|
|
36
36
|
* A Firebase project. Create one free on `https://firebase.google.com`
|
|
37
37
|
* "Chat21 Firebase cloud functions" installed. Instructions:`https://github.com/chat21/chat21-cloud-functions`
|
|
38
38
|
|
|
39
|
+
# Run Tiledesk with Docker Compose
|
|
40
|
+
|
|
41
|
+
Do you want to install all the Tiledesk components on your server with just one click?
|
|
42
|
+
Use [Docker Compose Tiledesk installation guide](https://github.com/Tiledesk/tiledesk-deployment/blob/master/docker-compose/README.md)
|
|
43
|
+
|
|
44
|
+
|
|
39
45
|
# Installation #
|
|
40
46
|
* Install the latest stable release. Check on Github page the last release under the Releases tab and then run
|
|
41
47
|
- `git clone https://github.com/frontiere21/chat21-ionic.git --branch <LATEST-RELEASE-VERSION>`
|
package/deploy_pre.sh
CHANGED
|
@@ -32,20 +32,20 @@ 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
|
-
cp -p config.xml platforms/browser/www/
|
|
35
|
+
# cp -p config.xml platforms/browser/www/
|
|
36
36
|
|
|
37
37
|
######### chat-ionic5 - the good one - publish in pre
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
38
|
+
cd platforms/browser/www
|
|
39
|
+
aws s3 sync . s3://tiledesk-dashboard-pre/chat-ionic5/$version/
|
|
40
|
+
aws s3 sync . s3://tiledesk-dashboard-pre/chat-ionic5/
|
|
41
|
+
cd ../../../
|
|
42
42
|
|
|
43
|
-
|
|
43
|
+
aws cloudfront create-invalidation --distribution-id E2DTAKWHWQ7C3J --paths "/*"
|
|
44
44
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
45
|
+
echo new version deployed on s3://tiledesk-dashboard-pre/chat-ionic5/$version/
|
|
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
49
|
|
|
50
50
|
######### chat-ionic5-panel - publish in pre with the projects right panel
|
|
51
51
|
# cd platforms/browser/www
|
|
@@ -73,11 +73,11 @@ cp -p config.xml platforms/browser/www/
|
|
|
73
73
|
|
|
74
74
|
|
|
75
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
|
|
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/env.sample
CHANGED
package/package.json
CHANGED
package/src/app/app.component.ts
CHANGED
|
@@ -754,8 +754,8 @@ export class AppComponent implements OnInit {
|
|
|
754
754
|
if (IDConv && FullNameConv) {
|
|
755
755
|
pageUrl += IDConv + '/' + FullNameConv + '/' + Convtype
|
|
756
756
|
}
|
|
757
|
-
|
|
758
|
-
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'));
|
|
759
759
|
|
|
760
760
|
|
|
761
761
|
// const DASHBOARD_URL = this.appConfigProvider.getConfig().DASHBOARD_URL;
|
|
@@ -99,7 +99,7 @@ export class IonConversationDetailComponent extends ConversationContentComponent
|
|
|
99
99
|
|
|
100
100
|
if (!this.public_Key.includes('CAR')) {
|
|
101
101
|
this.areVisibleCAR = false
|
|
102
|
-
console.log('[CONVS-DETAIL][ION-CONVS-DETAIL] PUBLIC-KEY - areVisibleCAR', this.areVisibleCAR)
|
|
102
|
+
// console.log('[CONVS-DETAIL][ION-CONVS-DETAIL] PUBLIC-KEY - areVisibleCAR', this.areVisibleCAR)
|
|
103
103
|
}
|
|
104
104
|
} else {
|
|
105
105
|
this.areVisibleCAR = false
|
|
@@ -15,7 +15,7 @@ export class ListConversationsComponent implements OnInit {
|
|
|
15
15
|
@Input() listConversations: ConversationModel[];
|
|
16
16
|
@Input() limit?: number
|
|
17
17
|
@Input() stylesMap: Map<string, string>;
|
|
18
|
-
@Input() translationMap: Map<
|
|
18
|
+
@Input() translationMap: Map<string, string>;
|
|
19
19
|
@Output() onConversationSelected = new EventEmitter<ConversationModel>();
|
|
20
20
|
@Output() onImageLoaded = new EventEmitter<ConversationModel>();
|
|
21
21
|
@Output() onConversationLoaded = new EventEmitter<ConversationModel>();
|
|
@@ -29,9 +29,11 @@ export class ListConversationsComponent implements OnInit {
|
|
|
29
29
|
arrayDiffer: any;
|
|
30
30
|
|
|
31
31
|
uidConvSelected: string;
|
|
32
|
-
constructor(
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
constructor(
|
|
33
|
+
public iterableDiffers: IterableDiffers,
|
|
34
|
+
public kvDiffers: KeyValueDiffers
|
|
35
|
+
) {
|
|
36
|
+
this.iterableDifferListConv = this.iterableDiffers.find([]).create(null);
|
|
35
37
|
}
|
|
36
38
|
|
|
37
39
|
ngOnInit() {
|
|
@@ -44,7 +46,7 @@ export class ListConversationsComponent implements OnInit {
|
|
|
44
46
|
// })
|
|
45
47
|
}
|
|
46
48
|
|
|
47
|
-
ngOnChanges(changes: SimpleChanges){
|
|
49
|
+
ngOnChanges(changes: SimpleChanges) {
|
|
48
50
|
// console.log('empDifferMap:: 1111' + JSON.stringify(this.listConversations[1]))
|
|
49
51
|
// console.log('empDifferMap:: 1111', this.listConversations)
|
|
50
52
|
// this.listConversations.forEach(emp => {
|
|
@@ -56,7 +58,8 @@ export class ListConversationsComponent implements OnInit {
|
|
|
56
58
|
|
|
57
59
|
public openConversationByID(conversation) {
|
|
58
60
|
this.logger.log('[LISTCONVERSATIONS-W] openConversationByID: ', conversation);
|
|
59
|
-
if (
|
|
61
|
+
if (conversation) {
|
|
62
|
+
this.logger.log(conversation.recipient_fullname)
|
|
60
63
|
// this.conversationsService.updateIsNew(conversation);
|
|
61
64
|
// this.conversationsService.updateConversationBadge();
|
|
62
65
|
this.uidConvSelected = conversation.uid
|
|
@@ -67,10 +70,10 @@ export class ListConversationsComponent implements OnInit {
|
|
|
67
70
|
ngAfterViewInit() {
|
|
68
71
|
this.logger.log('[LISTCONVERSATIONS-W] ---ngAfterViewInit---: listConversations ', this.listConversations);
|
|
69
72
|
}
|
|
70
|
-
|
|
73
|
+
|
|
71
74
|
ngDoCheck() {
|
|
72
75
|
let changesListConversation = this.iterableDifferListConv.diff(this.listConversations);
|
|
73
|
-
if(changesListConversation){
|
|
76
|
+
if (changesListConversation) {
|
|
74
77
|
// changesListConversation.forEachAddedItem(element => {
|
|
75
78
|
// console.log('itemmmm 1111 added ', element)
|
|
76
79
|
// let conv = element.item
|
|
@@ -104,7 +107,7 @@ export class ListConversationsComponent implements OnInit {
|
|
|
104
107
|
// console.log('... Array changes ...', empArrayChanges);
|
|
105
108
|
// empArrayChanges.forEachAddedItem((record) => {
|
|
106
109
|
// console.log('1111 Added ', record.currentValue);
|
|
107
|
-
|
|
110
|
+
|
|
108
111
|
// });
|
|
109
112
|
// empArrayChanges.forEachRemovedItem((record) => {
|
|
110
113
|
// console.log('1111 Removed ' + record.previousValue);
|
|
@@ -128,7 +131,7 @@ export class ListConversationsComponent implements OnInit {
|
|
|
128
131
|
// });
|
|
129
132
|
// }
|
|
130
133
|
// }
|
|
131
|
-
|
|
134
|
+
|
|
132
135
|
}
|
|
133
136
|
|
|
134
137
|
|
|
@@ -179,8 +179,8 @@ export class ProjectItemComponent implements OnInit {
|
|
|
179
179
|
}
|
|
180
180
|
|
|
181
181
|
|
|
182
|
-
if (!stored_project) {
|
|
183
|
-
this.logger.log('PROJECT-ITEM - THERE IS NOT STORED LAST PROJECT ', stored_project)
|
|
182
|
+
if (!stored_project || stored_project === 'undefined') {
|
|
183
|
+
this.logger.log('PROJECT-ITEM - THERE IS NOT STORED LAST PROJECT OR IS UNDEFINED ', stored_project)
|
|
184
184
|
const tiledeskToken = this.appStorageService.getItem('tiledeskToken');
|
|
185
185
|
this.logger.log('[PROJECT-ITEM] - GET PROJECTS - tiledeskToken', tiledeskToken);
|
|
186
186
|
this.tiledeskService.getProjects(tiledeskToken).subscribe(projects => {
|
|
@@ -204,7 +204,7 @@ export class ProjectItemComponent implements OnInit {
|
|
|
204
204
|
}
|
|
205
205
|
|
|
206
206
|
|
|
207
|
-
if (stored_project) {
|
|
207
|
+
if (stored_project && stored_project !== 'undefined') {
|
|
208
208
|
this.logger.log('PROJECT-ITEM - THERE IS STORED LAST PROJECT ', stored_project)
|
|
209
209
|
if (stored_project) {
|
|
210
210
|
this.project = JSON.parse(stored_project)
|
|
@@ -100,8 +100,8 @@ export class SidebarComponent implements OnInit {
|
|
|
100
100
|
|
|
101
101
|
getStoredProjectAndUserRole() {
|
|
102
102
|
const stored_project = localStorage.getItem('last_project')
|
|
103
|
-
|
|
104
|
-
if (stored_project) {
|
|
103
|
+
this.logger.log('[SIDEBAR] stored_project ', stored_project)
|
|
104
|
+
if (stored_project && stored_project !== 'undefined') {
|
|
105
105
|
const project = JSON.parse(stored_project)
|
|
106
106
|
this.logger.log('[SIDEBAR] project ', project)
|
|
107
107
|
|
|
@@ -111,6 +111,8 @@ export class SidebarComponent implements OnInit {
|
|
|
111
111
|
this.USER_ROLE = project.role;
|
|
112
112
|
this.logger.log('[SIDEBAR] USER_ROLE ', this.USER_ROLE)
|
|
113
113
|
this.buildURLs(this.USER_ROLE)
|
|
114
|
+
} else {
|
|
115
|
+
this.logger.log('[SIDEBAR] stored_project ', stored_project)
|
|
114
116
|
}
|
|
115
117
|
}
|
|
116
118
|
|
|
@@ -313,7 +313,7 @@ export class SidebarUserDetailsComponent implements OnInit, OnChanges {
|
|
|
313
313
|
getCurrentStoredProject() {
|
|
314
314
|
try {
|
|
315
315
|
const project = localStorage.getItem('last_project')
|
|
316
|
-
if (project) {
|
|
316
|
+
if (project && project !== 'undefined') {
|
|
317
317
|
const projectObjct = JSON.parse(localStorage.getItem('last_project'))
|
|
318
318
|
// console.log('[SIDEBAR-USER-DETAILS] - GET STORED PROJECT ', projectObjct)
|
|
319
319
|
|
|
@@ -257,7 +257,7 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
|
|
|
257
257
|
getStoredProjectAndUserRole() {
|
|
258
258
|
const stored_project = localStorage.getItem('last_project')
|
|
259
259
|
// console.log('[SIDEBAR] stored_project ', stored_project)
|
|
260
|
-
if (stored_project) {
|
|
260
|
+
if (stored_project && stored_project !== undefined) {
|
|
261
261
|
const project = JSON.parse(stored_project)
|
|
262
262
|
// this.logger.log('[CONVS-DETAIL] project ', project)
|
|
263
263
|
|
|
@@ -227,29 +227,44 @@ export class ConversationListPage implements OnInit {
|
|
|
227
227
|
|
|
228
228
|
getConversationListHeight() {
|
|
229
229
|
var scrollbar2element = document.getElementById('scrollbar2')
|
|
230
|
-
this.logger.log(
|
|
231
|
-
'[CONVS-LIST-PAGE] getConversationListHeight scrollbar2element',
|
|
232
|
-
scrollbar2element,
|
|
233
|
-
)
|
|
230
|
+
this.logger.log('[CONVS-LIST-PAGE] getConversationListHeight scrollbar2element', scrollbar2element)
|
|
234
231
|
}
|
|
235
232
|
|
|
233
|
+
// this.support_mode = null
|
|
234
|
+
// if( this.appConfigProvider.getConfig().supportMode === true || this.appConfigProvider.getConfig().supportMode === 'true') {
|
|
235
|
+
// this.support_mode = true
|
|
236
|
+
// } else if ( this.appConfigProvider.getConfig().supportMode === false || this.appConfigProvider.getConfig().supportMode === 'false') {
|
|
237
|
+
// this.support_mode = false
|
|
238
|
+
// } else if ( !this.appConfigProvider.getConfig().supportMode ) {
|
|
239
|
+
// this.support_mode = false
|
|
240
|
+
// }
|
|
241
|
+
|
|
236
242
|
getAppConfigToHideDiplayBtns() {
|
|
237
243
|
const appConfig = this.appConfigProvider.getConfig()
|
|
238
|
-
// console.log('[
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
244
|
+
// console.log('[CONVS-LIST-PAGE] - appConfig ', appConfig)
|
|
245
|
+
this.supportMode = null
|
|
246
|
+
if (appConfig && appConfig.supportMode === true || appConfig.supportMode === 'true') {
|
|
247
|
+
this.supportMode = true;
|
|
248
|
+
this.logger.log('[CONVS-LIST-PAGE] getAppConfigToHideDiplayBtns supportMode ', this.supportMode)
|
|
249
|
+
} else if (appConfig && appConfig.supportMode === false || appConfig.supportMode === 'false') {
|
|
242
250
|
this.supportMode = false
|
|
251
|
+
this.logger.log('[CONVS-LIST-PAGE] getAppConfigToHideDiplayBtns supportMode ', this.supportMode)
|
|
243
252
|
}
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
this.archived_btn
|
|
253
|
+
this.archived_btn = null
|
|
254
|
+
if (appConfig && appConfig.archivedButton === true || appConfig.archivedButton === 'true') {
|
|
255
|
+
this.archived_btn = true;
|
|
256
|
+
this.logger.log('[CONVS-LIST-PAGE] getAppConfigToHideDiplayBtns archived_btn ', this.archived_btn)
|
|
257
|
+
} else if (appConfig && appConfig.archivedButton === false || appConfig.archivedButton === 'false') {
|
|
258
|
+
this.archived_btn = false;
|
|
259
|
+
this.logger.log('[CONVS-LIST-PAGE] getAppConfigToHideDiplayBtns archived_btn ', this.archived_btn)
|
|
248
260
|
}
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
this.writeto_btn
|
|
261
|
+
this.writeto_btn = null
|
|
262
|
+
if (appConfig && appConfig.writeToButton === true || appConfig.writeToButton === 'true') {
|
|
263
|
+
this.writeto_btn = true;
|
|
264
|
+
this.logger.log('[CONVS-LIST-PAGE] getAppConfigToHideDiplayBtns writeto_btn ', this.writeto_btn)
|
|
265
|
+
} else if (appConfig && appConfig.writeToButton === false || appConfig.writeToButton === 'false') {
|
|
266
|
+
this.writeto_btn = false;
|
|
267
|
+
this.logger.log('[CONVS-LIST-PAGE] getAppConfigToHideDiplayBtns writeto_btn ', this.writeto_btn)
|
|
253
268
|
}
|
|
254
269
|
// console.log('[ION-LIST-CONVS-COMP] - supportMode ', this.supportMode)
|
|
255
270
|
}
|
|
@@ -257,10 +272,7 @@ export class ConversationListPage implements OnInit {
|
|
|
257
272
|
watchToConnectionStatus() {
|
|
258
273
|
this.networkService.checkInternetFunc().subscribe((isOnline) => {
|
|
259
274
|
this.checkInternet = isOnline
|
|
260
|
-
this.logger.log(
|
|
261
|
-
'[ION-LIST-CONVS-COMP] - watchToConnectionStatus - isOnline',
|
|
262
|
-
this.checkInternet,
|
|
263
|
-
)
|
|
275
|
+
this.logger.log('[ION-LIST-CONVS-COMP] - watchToConnectionStatus - isOnline', this.checkInternet)
|
|
264
276
|
|
|
265
277
|
// checking internet connection
|
|
266
278
|
if (this.checkInternet == true) {
|
|
@@ -833,29 +845,13 @@ export class ConversationListPage implements OnInit {
|
|
|
833
845
|
if (uidConvSelected) {
|
|
834
846
|
let conversationSelected
|
|
835
847
|
if (conversationType === 'active') {
|
|
836
|
-
conversationSelected = this.conversations.find(
|
|
837
|
-
|
|
838
|
-
)
|
|
839
|
-
} else if (conversationType === 'archived') {
|
|
840
|
-
conversationSelected = this.archivedConversations.find(
|
|
841
|
-
(item) => item.uid === this.uidConvSelected,
|
|
842
|
-
)
|
|
843
|
-
}
|
|
848
|
+
conversationSelected = this.conversations.find((item) => item.uid === this.uidConvSelected)
|
|
849
|
+
} else if (conversationType === 'archived') { conversationSelected = this.archivedConversations.find((item) => item.uid === this.uidConvSelected) }
|
|
844
850
|
if (conversationSelected) {
|
|
845
|
-
this.logger.log(
|
|
846
|
-
|
|
847
|
-
conversationSelected,
|
|
848
|
-
)
|
|
849
|
-
this.logger.log(
|
|
850
|
-
'[CONVS-LIST-PAGE] the conversation ',
|
|
851
|
-
this.conversationSelected,
|
|
852
|
-
' has already been loaded',
|
|
853
|
-
)
|
|
851
|
+
this.logger.log('[CONVS-LIST-PAGE] conversationSelected', conversationSelected,)
|
|
852
|
+
this.logger.log('[CONVS-LIST-PAGE] the conversation ', this.conversationSelected, ' has already been loaded')
|
|
854
853
|
this.conversationSelected = conversationSelected
|
|
855
|
-
this.logger.log(
|
|
856
|
-
'[CONVS-LIST-PAGE] setUidConvSelected: ',
|
|
857
|
-
this.conversationSelected,
|
|
858
|
-
)
|
|
854
|
+
this.logger.log('[CONVS-LIST-PAGE] setUidConvSelected: ', this.conversationSelected)
|
|
859
855
|
}
|
|
860
856
|
}
|
|
861
857
|
}
|
|
@@ -864,16 +860,11 @@ export class ConversationListPage implements OnInit {
|
|
|
864
860
|
this.logger.log('onConversationSelected conversation', conversation)
|
|
865
861
|
if (conversation.archived) {
|
|
866
862
|
this.navigateByUrl('archived', conversation.uid)
|
|
867
|
-
this.logger.log(
|
|
868
|
-
'[CONVS-LIST-PAGE] onConversationSelected archived conversation.uid ',
|
|
869
|
-
conversation.uid,
|
|
863
|
+
this.logger.log('[CONVS-LIST-PAGE] onConversationSelected archived conversation.uid ', conversation.uid,
|
|
870
864
|
)
|
|
871
865
|
} else {
|
|
872
866
|
this.navigateByUrl('active', conversation.uid)
|
|
873
|
-
this.logger.log(
|
|
874
|
-
'[CONVS-LIST-PAGE] onConversationSelected active conversation.uid ',
|
|
875
|
-
conversation.uid,
|
|
876
|
-
)
|
|
867
|
+
this.logger.log('[CONVS-LIST-PAGE] onConversationSelected active conversation.uid ', conversation.uid)
|
|
877
868
|
}
|
|
878
869
|
}
|
|
879
870
|
|
|
@@ -910,52 +901,35 @@ export class ConversationListPage implements OnInit {
|
|
|
910
901
|
|
|
911
902
|
var regex = /<br\s*[\/]?>/gi
|
|
912
903
|
if (conversation && conversation.last_message_text) {
|
|
913
|
-
conversation.last_message_text = conversation.last_message_text.replace(
|
|
914
|
-
regex,
|
|
915
|
-
'',
|
|
916
|
-
)
|
|
904
|
+
conversation.last_message_text = conversation.last_message_text.replace(regex, '',)
|
|
917
905
|
|
|
918
906
|
//FIX-BUG: 'YOU: YOU: YOU: text' on last-message-text in conversation-list
|
|
919
|
-
if (
|
|
920
|
-
conversation.sender === this.loggedUserUid &&
|
|
921
|
-
!conversation.last_message_text.includes(': ')
|
|
922
|
-
) {
|
|
907
|
+
if (conversation.sender === this.loggedUserUid && !conversation.last_message_text.includes(': ')) {
|
|
923
908
|
// this.logger.log('[CONVS-LIST-PAGE] onConversationLoaded', conversation)
|
|
924
909
|
|
|
925
910
|
if (conversation.type !== 'image' && conversation.type !== 'file') {
|
|
926
|
-
conversation.last_message_text =
|
|
927
|
-
translationMap.get('YOU') + ': ' + conversation.last_message_text
|
|
911
|
+
conversation.last_message_text = translationMap.get('YOU') + ': ' + conversation.last_message_text
|
|
928
912
|
} else if (conversation.type === 'image') {
|
|
929
913
|
// this.logger.log('[CONVS-LIST-PAGE] HAS SENT AN IMAGE');
|
|
930
914
|
// this.logger.log("[CONVS-LIST-PAGE] translationMap.get('YOU')")
|
|
931
|
-
const SENT_AN_IMAGE = (conversation[
|
|
932
|
-
'last_message_text'
|
|
933
|
-
] = translationMap.get('SENT_AN_IMAGE'))
|
|
915
|
+
const SENT_AN_IMAGE = (conversation['last_message_text'] = translationMap.get('SENT_AN_IMAGE'))
|
|
934
916
|
|
|
935
|
-
conversation.last_message_text =
|
|
936
|
-
translationMap.get('YOU') + ': ' + SENT_AN_IMAGE
|
|
917
|
+
conversation.last_message_text = translationMap.get('YOU') + ': ' + SENT_AN_IMAGE
|
|
937
918
|
} else if (conversation.type === 'file') {
|
|
938
919
|
// this.logger.log('[CONVS-LIST-PAGE] HAS SENT FILE')
|
|
939
|
-
const SENT_AN_ATTACHMENT = (conversation[
|
|
940
|
-
|
|
941
|
-
] = translationMap.get('SENT_AN_ATTACHMENT'))
|
|
942
|
-
conversation.last_message_text =
|
|
943
|
-
translationMap.get('YOU') + ': ' + SENT_AN_ATTACHMENT
|
|
920
|
+
const SENT_AN_ATTACHMENT = (conversation['last_message_text'] = translationMap.get('SENT_AN_ATTACHMENT'))
|
|
921
|
+
conversation.last_message_text = translationMap.get('YOU') + ': ' + SENT_AN_ATTACHMENT
|
|
944
922
|
}
|
|
945
923
|
} else {
|
|
946
924
|
if (conversation.type === 'image') {
|
|
947
925
|
// this.logger.log('[CONVS-LIST-PAGE] HAS SENT AN IMAGE');
|
|
948
926
|
// this.logger.log("[CONVS-LIST-PAGE] translationMap.get('YOU')")
|
|
949
|
-
const SENT_AN_IMAGE = (conversation[
|
|
950
|
-
'last_message_text'
|
|
951
|
-
] = translationMap.get('SENT_AN_IMAGE'))
|
|
927
|
+
const SENT_AN_IMAGE = (conversation['last_message_text'] = translationMap.get('SENT_AN_IMAGE'))
|
|
952
928
|
|
|
953
929
|
conversation.last_message_text = SENT_AN_IMAGE
|
|
954
930
|
} else if (conversation.type === 'file') {
|
|
955
931
|
// this.logger.log('[CONVS-LIST-PAGE] HAS SENT FILE')
|
|
956
|
-
const SENT_AN_ATTACHMENT = (conversation[
|
|
957
|
-
'last_message_text'
|
|
958
|
-
] = translationMap.get('SENT_AN_ATTACHMENT'))
|
|
932
|
+
const SENT_AN_ATTACHMENT = (conversation['last_message_text'] = translationMap.get('SENT_AN_ATTACHMENT'))
|
|
959
933
|
conversation.last_message_text = SENT_AN_ATTACHMENT
|
|
960
934
|
}
|
|
961
935
|
}
|
|
@@ -974,69 +948,31 @@ export class ConversationListPage implements OnInit {
|
|
|
974
948
|
// }
|
|
975
949
|
|
|
976
950
|
navigateByUrl(converationType: string, uidConvSelected: string) {
|
|
977
|
-
|
|
978
|
-
this.logger.log(
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
)
|
|
982
|
-
this.logger.log(
|
|
983
|
-
'[CONVS-LIST-PAGE] navigateByUrl run this.setUidConvSelected',
|
|
984
|
-
)
|
|
985
|
-
this.logger.log(
|
|
986
|
-
'[CONVS-LIST-PAGE] navigateByUrl this.uidConvSelected ',
|
|
987
|
-
this.uidConvSelected,
|
|
988
|
-
)
|
|
989
|
-
this.logger.log(
|
|
990
|
-
'[CONVS-LIST-PAGE] navigateByUrl this.conversationSelected ',
|
|
991
|
-
this.conversationSelected,
|
|
992
|
-
)
|
|
951
|
+
|
|
952
|
+
this.logger.log('[CONVS-LIST-PAGE] navigateByUrl uidConvSelected: ', uidConvSelected)
|
|
953
|
+
|
|
954
|
+
this.logger.log('[CONVS-LIST-PAGE] navigateByUrl this.uidConvSelected ', this.uidConvSelected)
|
|
993
955
|
|
|
994
956
|
this.setUidConvSelected(uidConvSelected, converationType)
|
|
995
957
|
if (checkPlatformIsMobile()) {
|
|
996
|
-
this.logger.log(
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
this.logger.log(
|
|
1001
|
-
'[CONVS-LIST-PAGE] DESKTOP (window >= 768)',
|
|
1002
|
-
this.navService,
|
|
1003
|
-
)
|
|
1004
|
-
let pageUrl =
|
|
1005
|
-
'conversation-detail/' +
|
|
1006
|
-
this.uidConvSelected +
|
|
1007
|
-
'/' +
|
|
1008
|
-
this.conversationSelected.conversation_with_fullname +
|
|
1009
|
-
'/' +
|
|
1010
|
-
converationType
|
|
958
|
+
this.logger.log('[CONVS-LIST-PAGE] checkPlatformIsMobile(): ', checkPlatformIsMobile())
|
|
959
|
+
this.logger.log('[CONVS-LIST-PAGE] DESKTOP (window < 768)', this.navService)
|
|
960
|
+
this.logger.log('[CONVS-LIST-PAGE] navigateByUrl this.conversationSelected conversation_with_fullname ', this.conversationSelected.conversation_with_fullname)
|
|
961
|
+
let pageUrl = 'conversation-detail/' + this.uidConvSelected + '/' + this.conversationSelected.conversation_with_fullname + '/' + converationType
|
|
1011
962
|
this.logger.log('[CONVS-LIST-PAGE] pageURL', pageUrl)
|
|
1012
|
-
|
|
963
|
+
// replace(/\(/g, '%28').replace(/\)/g, '%29') -> used for the encoder of any round brackets
|
|
964
|
+
this.router.navigateByUrl(pageUrl.replace(/\(/g, '%28').replace(/\)/g, '%29'))
|
|
1013
965
|
} else {
|
|
1014
|
-
this.logger.log(
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
)
|
|
1018
|
-
this.logger.log(
|
|
1019
|
-
'[CONVS-LIST-PAGE] MOBILE (window < 768) ',
|
|
1020
|
-
this.navService,
|
|
1021
|
-
)
|
|
966
|
+
this.logger.log('[CONVS-LIST-PAGE] navigateByUrl this.conversationSelected conversation_with_fullname ', this.conversationSelected.conversation_with_fullname)
|
|
967
|
+
this.logger.log('[CONVS-LIST-PAGE] checkPlatformIsMobile(): ', checkPlatformIsMobile())
|
|
968
|
+
this.logger.log('[CONVS-LIST-PAGE] MOBILE (window >= 768) ', this.navService)
|
|
1022
969
|
let pageUrl = 'conversation-detail/' + this.uidConvSelected
|
|
1023
|
-
if (
|
|
1024
|
-
this.conversationSelected
|
|
1025
|
-
this.conversationSelected.conversation_with_fullname
|
|
1026
|
-
) {
|
|
1027
|
-
pageUrl =
|
|
1028
|
-
'conversation-detail/' +
|
|
1029
|
-
this.uidConvSelected +
|
|
1030
|
-
'/' +
|
|
1031
|
-
this.conversationSelected.conversation_with_fullname +
|
|
1032
|
-
'/' +
|
|
1033
|
-
converationType
|
|
970
|
+
if (this.conversationSelected && this.conversationSelected.conversation_with_fullname) {
|
|
971
|
+
pageUrl = 'conversation-detail/' + this.uidConvSelected + '/' + this.conversationSelected.conversation_with_fullname + '/' + converationType
|
|
1034
972
|
}
|
|
1035
|
-
this.logger.log(
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
)
|
|
1039
|
-
this.router.navigateByUrl(pageUrl)
|
|
973
|
+
this.logger.log('[CONVS-LIST-PAGE] setUidConvSelected navigateByUrl--->: ', pageUrl)
|
|
974
|
+
// replace(/\(/g, '%28').replace(/\)/g, '%29') -> used for the encoder of any round brackets
|
|
975
|
+
this.router.navigateByUrl(pageUrl.replace(/\(/g, '%28').replace(/\)/g, '%29'))
|
|
1040
976
|
}
|
|
1041
977
|
}
|
|
1042
978
|
|
|
@@ -1109,7 +1045,7 @@ export class ConversationListPage implements OnInit {
|
|
|
1109
1045
|
if (conversation) {
|
|
1110
1046
|
const conversationId = conversation.uid
|
|
1111
1047
|
|
|
1112
|
-
this.logger.log(
|
|
1048
|
+
this.logger.log('[CONVS-LIST-PAGE] onCloseConversation conversationId: ', conversationId)
|
|
1113
1049
|
|
|
1114
1050
|
const conversationWith_segments = conversationId.split('-')
|
|
1115
1051
|
this.logger.log(
|
|
@@ -1,27 +1,36 @@
|
|
|
1
1
|
{
|
|
2
|
+
"t2y12PruGU9wUtEGzBJfolMIgK": "",
|
|
2
3
|
"chatEngine": "mqtt",
|
|
3
4
|
"uploadEngine": "native",
|
|
4
|
-
"pushEngine":
|
|
5
|
+
"pushEngine":"none",
|
|
5
6
|
"fileUploadAccept":"*/*",
|
|
6
|
-
"logLevel":
|
|
7
|
+
"logLevel":"info",
|
|
8
|
+
"authPersistence": "LOCAL",
|
|
9
|
+
"supportMode": "true",
|
|
10
|
+
"writeToButton": "true",
|
|
11
|
+
"archivedButton": "true",
|
|
7
12
|
"firebaseConfig": {
|
|
8
|
-
"tenant":
|
|
9
|
-
"apiKey": "
|
|
10
|
-
"authDomain": "
|
|
11
|
-
"databaseURL": "
|
|
12
|
-
"projectId": "
|
|
13
|
-
"storageBucket": "
|
|
14
|
-
"messagingSenderId": "
|
|
15
|
-
"appId": "
|
|
16
|
-
"chat21ApiUrl": "
|
|
13
|
+
"tenant":"tilechat",
|
|
14
|
+
"apiKey": "",
|
|
15
|
+
"authDomain": "",
|
|
16
|
+
"databaseURL": "",
|
|
17
|
+
"projectId": "",
|
|
18
|
+
"storageBucket": "",
|
|
19
|
+
"messagingSenderId": "",
|
|
20
|
+
"appId": "",
|
|
21
|
+
"chat21ApiUrl": "",
|
|
22
|
+
"vapidKey": ""
|
|
17
23
|
},
|
|
18
24
|
"chat21Config": {
|
|
19
25
|
"appId": "tilechat",
|
|
20
|
-
"MQTTendpoint": "ws://
|
|
21
|
-
"APIendpoint": "
|
|
26
|
+
"MQTTendpoint": "ws://localhost:8081/mqws/ws",
|
|
27
|
+
"APIendpoint": "/chatapi/api"
|
|
22
28
|
},
|
|
23
|
-
"apiUrl": "
|
|
24
|
-
"baseImageUrl": "
|
|
25
|
-
"dashboardUrl": "
|
|
29
|
+
"apiUrl": "/api/",
|
|
30
|
+
"baseImageUrl": "/api/",
|
|
31
|
+
"dashboardUrl": "/dashboard/",
|
|
32
|
+
"wsUrl": "",
|
|
33
|
+
"wsUrlRel": ""
|
|
26
34
|
}
|
|
27
35
|
|
|
36
|
+
|
|
@@ -5,6 +5,10 @@
|
|
|
5
5
|
"pushEngine":"${PUSH_ENGINE}",
|
|
6
6
|
"fileUploadAccept":"${FILE_UPLOAD_ACCEPT}",
|
|
7
7
|
"logLevel":"${LOG_LEVEL}",
|
|
8
|
+
"authPersistence": "${AUTH_PERSISTENCE}",
|
|
9
|
+
"supportMode": "${SUPPORT_MODE}",
|
|
10
|
+
"writeToButton": "${WRITE_TO_BUTTON}",
|
|
11
|
+
"archivedButton": "${ARCHIVED_BUTTON}",
|
|
8
12
|
"firebaseConfig": {
|
|
9
13
|
"tenant":"${FIREBASE_TENANT}",
|
|
10
14
|
"apiKey": "${FIREBASE_APIKEY}",
|
|
@@ -26,8 +30,5 @@
|
|
|
26
30
|
"baseImageUrl": "${API_BASEIMAGE_URL}",
|
|
27
31
|
"dashboardUrl": "${DASHBOARD_URL}",
|
|
28
32
|
"wsUrl": "${WS_URL}",
|
|
29
|
-
"wsUrlRel": "${WS_URL_RELATIVE}"
|
|
30
|
-
"supportMode": "${SUPPORT_MODE}",
|
|
31
|
-
"writeToButton": "${WRITE_TO_BUTTON}",
|
|
32
|
-
"archivedButton": "${ARCHIVED_BUTTON}"
|
|
33
|
+
"wsUrlRel": "${WS_URL_RELATIVE}"
|
|
33
34
|
}
|