@chat21/chat21-ionic 3.0.98-rc.1 → 3.0.98
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 +6 -0
- package/README.md +3 -1
- package/package.json +2 -1
- package/src/app/app-routing.module.ts +4 -7
- package/src/app/app.module.ts +7 -3
- package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.html +2 -4
- package/src/app/chatlib/conversation-detail/message/text/text.component.scss +12 -0
- package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.html +1 -1
- package/src/app/components/authentication/login/login.component.scss +1 -0
- package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.html +6 -6
- package/src/app/components/conversation-detail/message-text-area/message-text-area.component.ts +1 -0
- package/src/app/modals/maps/maps-routing.module.ts +17 -0
- package/src/app/modals/maps/maps.module.ts +22 -0
- package/src/app/modals/maps/maps.page.html +83 -0
- package/src/app/modals/maps/maps.page.scss +181 -0
- package/src/app/modals/maps/maps.page.spec.ts +24 -0
- package/src/app/modals/maps/maps.page.ts +189 -0
- package/src/app/modals/send-whatsapp-template/send-whatsapp-template.module.ts +6 -1
- package/src/app/modals/send-whatsapp-template/send-whatsapp-template.page.html +195 -13
- package/src/app/modals/send-whatsapp-template/send-whatsapp-template.page.scss +341 -70
- package/src/app/modals/send-whatsapp-template/send-whatsapp-template.page.spec.ts +5 -5
- package/src/app/modals/send-whatsapp-template/send-whatsapp-template.page.ts +216 -23
- package/src/app/pages/conversation-detail/conversation-detail.page.ts +7 -7
- package/src/assets/i18n/ar.json +1 -1
- package/src/assets/i18n/az.json +1 -1
- 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 +1 -1
- 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 +1 -1
- package/src/assets/i18n/tr.json +1 -1
- package/src/assets/i18n/uk.json +1 -1
- package/src/assets/i18n/uz.json +1 -1
- package/src/chat-config-template.json +2 -1
- package/src/chat-config.json +2 -1
- package/src/chat21-core/providers/mqtt/mqtt-conversation-handler.ts +1 -0
- package/src/chat21-core/utils/utils.ts +3 -3
- package/src/index.html +2 -1
|
@@ -1,8 +1,13 @@
|
|
|
1
|
-
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
|
|
1
|
+
import { Component, ElementRef, EventEmitter, Input, OnInit, Output, SecurityContext, ViewChild } from '@angular/core';
|
|
2
|
+
import { DomSanitizer } from '@angular/platform-browser';
|
|
2
3
|
import { ModalController } from '@ionic/angular';
|
|
3
4
|
import { TemplatesService } from 'src/app/services/templates/templates.service';
|
|
5
|
+
import { UploadModel } from 'src/chat21-core/models/upload';
|
|
6
|
+
import { UserModel } from 'src/chat21-core/models/user';
|
|
4
7
|
import { LoggerService } from 'src/chat21-core/providers/abstract/logger.service';
|
|
8
|
+
import { UploadService } from 'src/chat21-core/providers/abstract/upload.service';
|
|
5
9
|
import { LoggerInstance } from 'src/chat21-core/providers/logger/loggerInstance';
|
|
10
|
+
import { MapsPage } from '../maps/maps.page';
|
|
6
11
|
|
|
7
12
|
@Component({
|
|
8
13
|
selector: 'send-whatsapp-template-modal',
|
|
@@ -11,7 +16,8 @@ import { LoggerInstance } from 'src/chat21-core/providers/logger/loggerInstance'
|
|
|
11
16
|
})
|
|
12
17
|
export class SendWhatsappTemplateModal implements OnInit {
|
|
13
18
|
|
|
14
|
-
@Input()
|
|
19
|
+
@Input() loggedUser: UserModel;
|
|
20
|
+
@Input() enableBackdropDismiss: any;
|
|
15
21
|
@Input() conversationWith: string;
|
|
16
22
|
@Input() projectId: string;
|
|
17
23
|
@Input() stylesMap: Map<string, string>;
|
|
@@ -22,26 +28,43 @@ export class SendWhatsappTemplateModal implements OnInit {
|
|
|
22
28
|
editTemplateView: Boolean = false;
|
|
23
29
|
displayError: Boolean = false;
|
|
24
30
|
labelError: string;
|
|
31
|
+
templates = [];
|
|
25
32
|
|
|
26
33
|
selected_template: any;
|
|
27
34
|
header_component: any;
|
|
28
35
|
body_component: any;
|
|
29
36
|
footer_component: any;
|
|
30
37
|
buttons_component: any;
|
|
38
|
+
url_button_component: any;
|
|
39
|
+
url_button_component_temp: any;
|
|
31
40
|
header_component_temp: any;
|
|
32
41
|
body_component_temp: any;
|
|
33
42
|
body_params = [];
|
|
34
43
|
header_params = [];
|
|
35
|
-
|
|
44
|
+
url_button_params = [];
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
previsioning_url: string;
|
|
48
|
+
sanitizedUrl: any;
|
|
36
49
|
|
|
37
50
|
sendButtonDisabled: Boolean = true;
|
|
38
51
|
display_loader: Boolean = true;
|
|
52
|
+
invalidUrl: Boolean = false;
|
|
53
|
+
fileUploadAccept: string = "image/*";
|
|
54
|
+
|
|
55
|
+
displayFileUploaded: Boolean = false;
|
|
56
|
+
fileUploadedName: string;
|
|
57
|
+
src: any;
|
|
58
|
+
displayMapModal: Boolean = true;
|
|
39
59
|
|
|
40
60
|
private logger: LoggerService = LoggerInstance.getInstance()
|
|
41
61
|
|
|
42
62
|
constructor(
|
|
43
63
|
private templatesService: TemplatesService,
|
|
44
|
-
public viewCtrl: ModalController
|
|
64
|
+
public viewCtrl: ModalController,
|
|
65
|
+
public sanitizer: DomSanitizer,
|
|
66
|
+
private uploadService: UploadService,
|
|
67
|
+
public modalController: ModalController,
|
|
45
68
|
) { }
|
|
46
69
|
|
|
47
70
|
ngOnInit() {
|
|
@@ -54,12 +77,11 @@ export class SendWhatsappTemplateModal implements OnInit {
|
|
|
54
77
|
this.logger.debug('[SEND-TEMPLATE-MODAL] subscribe to getTemplates API response -->', res)
|
|
55
78
|
//this.selectionView = true;
|
|
56
79
|
this.templates = res;
|
|
57
|
-
console.log("templates: ", this.templates);
|
|
58
80
|
}, (error) => {
|
|
59
81
|
this.logger.error('[SEND-TEMPLATE-MODAL] subscribe to getTemplates API - ERROR ', error)
|
|
60
82
|
this.displayError = true;
|
|
61
83
|
this.display_loader = false;
|
|
62
|
-
if(error.error && error.error.code === '01'){
|
|
84
|
+
if (error.error && error.error.code === '01') {
|
|
63
85
|
this.labelError = this.translationMap.get('WHATSAPP.ERROR_WHATSAPP_NOT_INSTALLED')
|
|
64
86
|
} else {
|
|
65
87
|
this.labelError = this.translationMap.get('WHATSAPP.ERROR_WHATSAPP_GENERIC_ERROR')
|
|
@@ -80,29 +102,80 @@ export class SendWhatsappTemplateModal implements OnInit {
|
|
|
80
102
|
this.body_component = this.selected_template.components.find(c => c.type === 'BODY');
|
|
81
103
|
this.footer_component = this.selected_template.components.find(c => c.type === 'FOOTER');
|
|
82
104
|
this.buttons_component = this.selected_template.components.find(c => c.type === 'BUTTONS');
|
|
83
|
-
|
|
105
|
+
if (this.buttons_component) {
|
|
106
|
+
this.url_button_component = this.buttons_component.buttons.find(c => c.type === 'URL')
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
if (this.header_component) {
|
|
110
|
+
this.header_component_temp = JSON.parse(JSON.stringify(this.header_component));
|
|
111
|
+
if (this.header_component.example) {
|
|
112
|
+
|
|
113
|
+
if (this.header_component.example.header_text) {
|
|
114
|
+
this.header_component.example.header_text.forEach((p, i) => {
|
|
115
|
+
this.header_params.push({ index: i + 1, type: "text", text: null })
|
|
116
|
+
})
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
if (this.header_component.example.header_handle) {
|
|
120
|
+
if (this.header_component.format === 'IMAGE') {
|
|
121
|
+
this.header_component.example.header_handle.forEach((p, i) => {
|
|
122
|
+
this.header_params.push({ index: i + 1, type: this.header_component.format, image: { link: null } })
|
|
123
|
+
})
|
|
124
|
+
}
|
|
125
|
+
if (this.header_component.format === 'DOCUMENT') {
|
|
126
|
+
this.fileUploadAccept = ".pdf"
|
|
127
|
+
this.src = this.header_component.example.header_handle[0];
|
|
128
|
+
this.sanitizeUrl(this.header_component.example.header_handle[0]);
|
|
129
|
+
this.header_component.example.header_handle.forEach((p, i) => {
|
|
130
|
+
this.header_params.push({ index: i + 1, type: this.header_component.format, document: { link: null } })
|
|
131
|
+
})
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
} else {
|
|
136
|
+
|
|
137
|
+
if (this.header_component.format === 'LOCATION') {
|
|
138
|
+
this.header_params.push({ index: 1, type: this.header_component.format, location: { latitude: null, longitude: null, name: null, address: null } })
|
|
139
|
+
}
|
|
140
|
+
else {
|
|
141
|
+
this.logger.log("[SEND-TEMPLATE-MODAL] Check unrecognized Header: ", this.header_component)
|
|
142
|
+
//this.sendButtonDisabled = false;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
84
148
|
if (this.body_component) {
|
|
85
149
|
this.body_component_temp = JSON.parse(JSON.stringify(this.body_component));
|
|
86
150
|
if (this.body_component.example) {
|
|
87
151
|
this.body_component.example.body_text[0].forEach((p, i) => {
|
|
88
152
|
this.body_params.push({ index: i + 1, type: "text", text: null })
|
|
89
153
|
})
|
|
90
|
-
} else {
|
|
91
|
-
this.sendButtonDisabled = false;
|
|
92
154
|
}
|
|
93
|
-
|
|
155
|
+
// else {
|
|
156
|
+
// //this.sendButtonDisabled = false;
|
|
157
|
+
// }
|
|
94
158
|
}
|
|
95
159
|
|
|
96
|
-
if (this.
|
|
97
|
-
this.
|
|
98
|
-
if (this.
|
|
99
|
-
this.
|
|
100
|
-
this.
|
|
160
|
+
if (this.url_button_component) {
|
|
161
|
+
this.url_button_component_temp = JSON.parse(JSON.stringify(this.url_button_component));
|
|
162
|
+
if (this.url_button_component.example) {
|
|
163
|
+
this.url_button_component.example.forEach((p, i) => {
|
|
164
|
+
this.url_button_params.push({ index: i + 1, type: "text", text: null })
|
|
165
|
+
this.previsioning_url = this.url_button_component.url;
|
|
101
166
|
})
|
|
102
|
-
} else {
|
|
103
|
-
this.sendButtonDisabled = false;
|
|
104
167
|
}
|
|
168
|
+
// else {
|
|
169
|
+
// this.sendButtonDisabled = false;
|
|
170
|
+
// }
|
|
105
171
|
}
|
|
172
|
+
|
|
173
|
+
this.checkParameters();
|
|
174
|
+
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
sanitizeUrl(url) {
|
|
178
|
+
this.sanitizedUrl = this.sanitizer.bypassSecurityTrustResourceUrl(url);
|
|
106
179
|
}
|
|
107
180
|
|
|
108
181
|
onParamBodyChange(event, param_num) {
|
|
@@ -120,7 +193,19 @@ export class SendWhatsappTemplateModal implements OnInit {
|
|
|
120
193
|
|
|
121
194
|
onParamHeaderChange(event, param_num) {
|
|
122
195
|
this.header_component = JSON.parse(JSON.stringify(this.header_component_temp));
|
|
123
|
-
this.header_params[param_num - 1].
|
|
196
|
+
if (this.header_params[param_num - 1].type === 'TEXT') {
|
|
197
|
+
this.header_params[param_num - 1].text = event;
|
|
198
|
+
}
|
|
199
|
+
if (this.header_params[param_num - 1].type === 'IMAGE') {
|
|
200
|
+
this.header_params[param_num - 1].image.link = event;
|
|
201
|
+
this.invalidUrl = false;
|
|
202
|
+
}
|
|
203
|
+
if (this.header_params[param_num - 1].type === 'DOCUMENT') {
|
|
204
|
+
this.header_params[param_num - 1].document.link = event;
|
|
205
|
+
this.sanitizeUrl(event);
|
|
206
|
+
this.invalidUrl = false;
|
|
207
|
+
}
|
|
208
|
+
|
|
124
209
|
this.header_params.forEach((param, i) => {
|
|
125
210
|
let index = i + 1;
|
|
126
211
|
let regex = '{{' + index + '}}';
|
|
@@ -131,22 +216,41 @@ export class SendWhatsappTemplateModal implements OnInit {
|
|
|
131
216
|
this.checkParameters();
|
|
132
217
|
}
|
|
133
218
|
|
|
219
|
+
onParamButtonChange(event, param_num) {
|
|
220
|
+
this.url_button_component = JSON.parse(JSON.stringify(this.url_button_component_temp));
|
|
221
|
+
this.url_button_params[param_num - 1].text = event;
|
|
222
|
+
this.url_button_params.forEach((param, i) => {
|
|
223
|
+
let index = i + 1;
|
|
224
|
+
let regex = '{{' + index + '}}';
|
|
225
|
+
if (param.text) {
|
|
226
|
+
this.url_button_component.url = this.url_button_component.url.replace(regex, param.text);
|
|
227
|
+
}
|
|
228
|
+
let button_index = this.buttons_component.buttons.findIndex(b => b.type === 'URL');
|
|
229
|
+
this.buttons_component.buttons[button_index] = this.url_button_component;
|
|
230
|
+
this.previsioning_url = this.url_button_component.url;
|
|
231
|
+
})
|
|
232
|
+
}
|
|
233
|
+
|
|
134
234
|
backToSelection() {
|
|
135
235
|
this.selectionView = true;
|
|
136
236
|
this.editTemplateView = false;
|
|
137
237
|
this.body_params = [];
|
|
138
238
|
this.header_params = [];
|
|
239
|
+
this.url_button_params = [];
|
|
139
240
|
this.header_component = null;
|
|
140
241
|
this.body_component = null;
|
|
141
242
|
this.footer_component = null;
|
|
142
243
|
this.buttons_component = null;
|
|
143
244
|
this.header_component_temp = null;
|
|
144
245
|
this.body_component_temp = null;
|
|
246
|
+
this.url_button_component = null;
|
|
247
|
+
this.url_button_component_temp = null;
|
|
145
248
|
}
|
|
146
249
|
|
|
147
250
|
sendTemplate() {
|
|
148
251
|
const new_header_params = this.header_params.map(({ index, ...keepAttrs }) => keepAttrs)
|
|
149
252
|
const new_body_params = this.body_params.map(({ index, ...keepAttrs }) => keepAttrs)
|
|
253
|
+
const new_buttons_param = this.url_button_params.map(({ index, ...keepAttrs }) => keepAttrs)
|
|
150
254
|
let attachment = {
|
|
151
255
|
type: "wa_template",
|
|
152
256
|
template: {
|
|
@@ -154,7 +258,8 @@ export class SendWhatsappTemplateModal implements OnInit {
|
|
|
154
258
|
language: this.selected_template.language,
|
|
155
259
|
params: {
|
|
156
260
|
header: new_header_params,
|
|
157
|
-
body: new_body_params
|
|
261
|
+
body: new_body_params,
|
|
262
|
+
buttons: new_buttons_param
|
|
158
263
|
}
|
|
159
264
|
}
|
|
160
265
|
}
|
|
@@ -167,12 +272,72 @@ export class SendWhatsappTemplateModal implements OnInit {
|
|
|
167
272
|
this.viewCtrl.dismiss(data);
|
|
168
273
|
}
|
|
169
274
|
|
|
275
|
+
onHeaderImageError(event) {
|
|
276
|
+
this.invalidUrl = true;
|
|
277
|
+
this.sendButtonDisabled = true;
|
|
278
|
+
event.target.src = this.header_component.example.header_handle[0];
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
onHeaderDocumentError(event) {
|
|
282
|
+
this.logger.log("ERROR EVENT CATCHED - onHeaderDocumentError");
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
// evaluate async
|
|
286
|
+
onFileSelected(e: any) {
|
|
287
|
+
this.displayFileUploaded = true;
|
|
288
|
+
this.fileUploadedName = e.target.files.item(0).name;
|
|
289
|
+
this.logger.log('[SEND-TEMPLATE-MODAL] on file selected -->', e)
|
|
290
|
+
|
|
291
|
+
this.uploadFile(e).then((file_url) => {
|
|
292
|
+
if (this.header_params[0].image) {
|
|
293
|
+
this.header_params[0].image.link = file_url;
|
|
294
|
+
}
|
|
295
|
+
if (this.header_params[0].document) {
|
|
296
|
+
this.header_params[0].document.link = file_url;
|
|
297
|
+
this.sanitizeUrl(file_url);
|
|
298
|
+
}
|
|
299
|
+
this.invalidUrl = false;
|
|
300
|
+
}).catch((err) => {
|
|
301
|
+
this.logger.log('[SEND-TEMPLATE-MODAL] unable to upload file -->', err)
|
|
302
|
+
this.displayFileUploaded = false;
|
|
303
|
+
})
|
|
304
|
+
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
private async uploadFile(e: any) {
|
|
308
|
+
|
|
309
|
+
return new Promise((resolve, reject) => {
|
|
310
|
+
// evaluate drop and paste cases other than change
|
|
311
|
+
let file = e.target.files.item(0);
|
|
312
|
+
const currentUpload = new UploadModel(file);
|
|
313
|
+
this.logger.log('[SEND-TEMPLATE-MODAL] currentUpload -->', currentUpload);
|
|
314
|
+
this.uploadService.upload(this.loggedUser.uid, currentUpload).then((downloadURL) => {
|
|
315
|
+
this.logger.log('[SEND-TEMPLATE-MODAL] downloadURL -->', downloadURL);
|
|
316
|
+
resolve(downloadURL);
|
|
317
|
+
}).catch((err) => {
|
|
318
|
+
this.logger.log('[SEND-TEMPLATE-MODAL] uploading error ', err);
|
|
319
|
+
reject(err);
|
|
320
|
+
})
|
|
321
|
+
})
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
removeHeaderFile() {
|
|
325
|
+
this.displayFileUploaded = false;
|
|
326
|
+
this.fileUploadedName = "";
|
|
327
|
+
this.header_params[0].url = "";
|
|
328
|
+
this.checkParameters();
|
|
329
|
+
}
|
|
330
|
+
|
|
170
331
|
checkParameters() {
|
|
171
332
|
this.sendButtonDisabled = true;
|
|
172
|
-
let
|
|
173
|
-
let
|
|
174
|
-
|
|
175
|
-
|
|
333
|
+
let text_header_result = this.header_params.find(p => !p.text || p.text == '');
|
|
334
|
+
let media_header_result = this.header_params.find(p => (p.image && (!p.image.link || p.image.link == '')) || (p.document && (!p.document.link || p.document.link == '')) || (p.location && (!p.location.name || !p.location.address || !p.location.latitude || !p.location.longitude)));
|
|
335
|
+
let body_result = this.body_params.find(p => !p.text || p.text == '');
|
|
336
|
+
|
|
337
|
+
if ((!text_header_result || !media_header_result) && !body_result) {
|
|
338
|
+
if (this.invalidUrl === false) {
|
|
339
|
+
this.sendButtonDisabled = false;
|
|
340
|
+
}
|
|
176
341
|
}
|
|
177
342
|
}
|
|
178
343
|
|
|
@@ -180,4 +345,32 @@ export class SendWhatsappTemplateModal implements OnInit {
|
|
|
180
345
|
this.viewCtrl.dismiss()
|
|
181
346
|
}
|
|
182
347
|
|
|
348
|
+
|
|
349
|
+
// MAPS - START
|
|
350
|
+
|
|
351
|
+
displayMap() {
|
|
352
|
+
this.displayMapModal = true;
|
|
353
|
+
this.prensentTemplateModal();
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
private async prensentTemplateModal(): Promise<any> {
|
|
357
|
+
this.logger.log('[SEND-TEMPLATE-MODAL] openTemplateModal');
|
|
358
|
+
const attributes = {};
|
|
359
|
+
const modal: HTMLIonModalElement =
|
|
360
|
+
await this.modalController.create({
|
|
361
|
+
component: MapsPage,
|
|
362
|
+
componentProps: attributes,
|
|
363
|
+
swipeToClose: false,
|
|
364
|
+
backdropDismiss: true
|
|
365
|
+
})
|
|
366
|
+
modal.onDidDismiss().then((maps_detail: any) => {
|
|
367
|
+
this.logger.log('[SEND-TEMPLATE-MODAL] open map returned ', maps_detail);
|
|
368
|
+
this.header_params[0].location = maps_detail.data;
|
|
369
|
+
this.checkParameters();
|
|
370
|
+
});
|
|
371
|
+
return await modal.present();
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
// MAPS - END
|
|
375
|
+
|
|
183
376
|
}
|
|
@@ -857,7 +857,7 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
|
|
|
857
857
|
null,
|
|
858
858
|
conv.attributes['projectId'],
|
|
859
859
|
conv.attributes['project_name'],
|
|
860
|
-
conv.attributes['
|
|
860
|
+
conv.attributes['request_channel']
|
|
861
861
|
)
|
|
862
862
|
|
|
863
863
|
}
|
|
@@ -875,7 +875,7 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
|
|
|
875
875
|
null,
|
|
876
876
|
conv.attributes['projectId'],
|
|
877
877
|
conv.attributes['project_name'],
|
|
878
|
-
conv.attributes['
|
|
878
|
+
conv.attributes['request_channel']
|
|
879
879
|
)
|
|
880
880
|
let duration = getDateDifference(conv.timestamp, Date.now())
|
|
881
881
|
duration.days > 10 && conv.channel_type !== TYPE_DIRECT ? this.disableTextarea = true : this.disableTextarea = false
|
|
@@ -897,7 +897,7 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
|
|
|
897
897
|
null,
|
|
898
898
|
conv.attributes['projectId'],
|
|
899
899
|
conv.attributes['project_name'],
|
|
900
|
-
conv.attributes['
|
|
900
|
+
conv.attributes['request_channel']
|
|
901
901
|
)
|
|
902
902
|
let duration = getDateDifference(conv.timestamp, Date.now())
|
|
903
903
|
duration.days > 10 && conv.channel_type !== TYPE_DIRECT ? this.disableTextarea = true : this.disableTextarea = false
|
|
@@ -913,7 +913,7 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
|
|
|
913
913
|
null,
|
|
914
914
|
conv.attributes['projectId'],
|
|
915
915
|
conv.attributes['project_name'],
|
|
916
|
-
conv.attributes['
|
|
916
|
+
conv.attributes['request_channel']
|
|
917
917
|
)
|
|
918
918
|
}
|
|
919
919
|
this.logger.log('[CONVS-DETAIL] - setHeaderContent > conversationAvatar: ', this.conversationAvatar)
|
|
@@ -1072,7 +1072,7 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
|
|
|
1072
1072
|
msg = `[${metadata.name}](${metadata.src})`
|
|
1073
1073
|
}
|
|
1074
1074
|
}
|
|
1075
|
-
this.conversation.attributes && this.conversation.attributes['request_channel'] ? attributes.
|
|
1075
|
+
this.conversation.attributes && this.conversation.attributes['request_channel'] ? attributes.request_channel = this.conversation.attributes['request_channel'] : null;
|
|
1076
1076
|
metadata ? (metadata = metadata) : (metadata = '')
|
|
1077
1077
|
this.logger.log('[CONVS-DETAIL] attributes--->>>> 1111', this.conversation.attributes, attributes)
|
|
1078
1078
|
this.logger.log('[CONVS-DETAIL] - SEND MESSAGE msg: ', msg, ' - messages: ', this.messages, ' - loggedUser: ', this.loggedUser)
|
|
@@ -1271,7 +1271,7 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
|
|
|
1271
1271
|
null,
|
|
1272
1272
|
this.conversation.attributes['projectId'],
|
|
1273
1273
|
this.conversation.attributes['project_name'],
|
|
1274
|
-
this.conversation.attributes['
|
|
1274
|
+
this.conversation.attributes['request_channel']
|
|
1275
1275
|
)
|
|
1276
1276
|
}
|
|
1277
1277
|
if (msg.attributes && msg.attributes.hasOwnProperty("updateUserEmail")) {
|
|
@@ -1284,7 +1284,7 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
|
|
|
1284
1284
|
userEmail,
|
|
1285
1285
|
this.conversation.attributes['projectId'],
|
|
1286
1286
|
this.conversation.attributes['project_name'],
|
|
1287
|
-
this.conversation.attributes['
|
|
1287
|
+
this.conversation.attributes['request_channel']
|
|
1288
1288
|
)
|
|
1289
1289
|
this.getLeadDetail()
|
|
1290
1290
|
}
|
package/src/assets/i18n/ar.json
CHANGED
|
@@ -290,7 +290,7 @@
|
|
|
290
290
|
"LABEL_WA_TEMPLATES":"قوالب WhatsApp",
|
|
291
291
|
"SELECT_MESSAGE_TEMPLATE":"حدد قالب رسالة",
|
|
292
292
|
"ERROR_WHATSAPP_NOT_INSTALLED":"قم بتثبيت Whatsapp من App Store لاستخدام القوالب",
|
|
293
|
-
"ERROR_WHATSAPP_GENERIC_ERROR":"حدثت مشكلة أثناء الحصول على القوالب من whatsapp
|
|
293
|
+
"ERROR_WHATSAPP_GENERIC_ERROR":"حدثت مشكلة أثناء الحصول على القوالب من whatsapp.\nتحقق من التكوين الخاص بك أو اتصل بالمسؤول."
|
|
294
294
|
},
|
|
295
295
|
"EMAIL":{
|
|
296
296
|
"EMAIL_OFFLINE_TIP":"تحذير: المستخدم غير متصل! سيتم إرسال الرسالة عبر البريد الإلكتروني",
|
package/src/assets/i18n/az.json
CHANGED
|
@@ -290,7 +290,7 @@
|
|
|
290
290
|
"LABEL_WA_TEMPLATES":"WhatsApp şablonları",
|
|
291
291
|
"SELECT_MESSAGE_TEMPLATE":"Mesaj şablonu seçin",
|
|
292
292
|
"ERROR_WHATSAPP_NOT_INSTALLED":"Şablonlardan istifadə etmək üçün App Store-dan Whatsapp-ı quraşdırın",
|
|
293
|
-
"ERROR_WHATSAPP_GENERIC_ERROR":"Whatsapp-dan şablonları əldə edərkən problem yarand
|
|
293
|
+
"ERROR_WHATSAPP_GENERIC_ERROR":"Whatsapp-dan şablonları əldə edərkən problem yarandı.\nKonfiqurasiyanızı yoxlayın və ya administratorunuzla əlaqə saxlayın."
|
|
294
294
|
},
|
|
295
295
|
"EMAIL":{
|
|
296
296
|
"EMAIL_OFFLINE_TIP":"Xəbərdarlıq: istifadəçi oflayndır! Mesaj e-poçt vasitəsilə göndəriləcək",
|
package/src/assets/i18n/de.json
CHANGED
|
@@ -290,7 +290,7 @@
|
|
|
290
290
|
"LABEL_WA_TEMPLATES":"WhatsApp-Vorlagen",
|
|
291
291
|
"SELECT_MESSAGE_TEMPLATE":"Wählen Sie eine Nachrichtenvorlage aus",
|
|
292
292
|
"ERROR_WHATSAPP_NOT_INSTALLED":"Installieren Sie WhatsApp aus dem App Store, um Vorlagen zu verwenden",
|
|
293
|
-
"ERROR_WHATSAPP_GENERIC_ERROR":"Beim Abrufen von Vorlagen von WhatsApp ist ein Problem aufgetreten
|
|
293
|
+
"ERROR_WHATSAPP_GENERIC_ERROR":"Beim Abrufen von Vorlagen von WhatsApp ist ein Problem aufgetreten.\nÜberprüfen Sie Ihre Konfiguration oder wenden Sie sich an Ihren Administrator."
|
|
294
294
|
},
|
|
295
295
|
"EMAIL":{
|
|
296
296
|
"EMAIL_OFFLINE_TIP":"Achtung: Benutzer ist offline! Die Nachricht wird per E-Mail versendet",
|
package/src/assets/i18n/en.json
CHANGED
|
@@ -290,7 +290,7 @@
|
|
|
290
290
|
"LABEL_WA_TEMPLATES":"WhatsApp Templates",
|
|
291
291
|
"SELECT_MESSAGE_TEMPLATE":"Select a message template",
|
|
292
292
|
"ERROR_WHATSAPP_NOT_INSTALLED":"Install Whatsapp from the App Store to use templates",
|
|
293
|
-
"ERROR_WHATSAPP_GENERIC_ERROR":"A problem occurred while getting templates from whatsapp
|
|
293
|
+
"ERROR_WHATSAPP_GENERIC_ERROR":"A problem occurred while getting templates from whatsapp.\nCheck your configuration or contact your administrator."
|
|
294
294
|
},
|
|
295
295
|
"EMAIL":{
|
|
296
296
|
"EMAIL_OFFLINE_TIP":"Warning: user is offline! The message will be sent by email",
|
package/src/assets/i18n/es.json
CHANGED
|
@@ -290,7 +290,7 @@
|
|
|
290
290
|
"LABEL_WA_TEMPLATES":"Plantillas de WhatsApp",
|
|
291
291
|
"SELECT_MESSAGE_TEMPLATE":"Seleccione una plantilla de mensaje",
|
|
292
292
|
"ERROR_WHATSAPP_NOT_INSTALLED":"Instale Whatsapp desde la App Store para usar plantillas",
|
|
293
|
-
"ERROR_WHATSAPP_GENERIC_ERROR":"Ocurrió un problema al obtener plantillas de WhatsApp
|
|
293
|
+
"ERROR_WHATSAPP_GENERIC_ERROR":"Ocurrió un problema al obtener plantillas de WhatsApp.\nVerifique su configuración o contacte a su administrador."
|
|
294
294
|
},
|
|
295
295
|
"EMAIL":{
|
|
296
296
|
"EMAIL_OFFLINE_TIP":"Advertencia: ¡el usuario está desconectado! El mensaje será enviado por correo electrónico",
|
package/src/assets/i18n/fr.json
CHANGED
|
@@ -290,7 +290,7 @@
|
|
|
290
290
|
"LABEL_WA_TEMPLATES":"Modèles WhatsApp",
|
|
291
291
|
"SELECT_MESSAGE_TEMPLATE":"Sélectionnez un modèle de message",
|
|
292
292
|
"ERROR_WHATSAPP_NOT_INSTALLED":"Installez Whatsapp depuis l'App Store pour utiliser des modèles",
|
|
293
|
-
"ERROR_WHATSAPP_GENERIC_ERROR":"Un problème est survenu lors de l'obtention des modèles de WhatsApp
|
|
293
|
+
"ERROR_WHATSAPP_GENERIC_ERROR":"Un problème est survenu lors de l'obtention des modèles de WhatsApp.\nVérifiez votre configuration ou contactez votre administrateur."
|
|
294
294
|
},
|
|
295
295
|
"EMAIL":{
|
|
296
296
|
"EMAIL_OFFLINE_TIP":"Attention : l'utilisateur est hors ligne ! Le message sera envoyé par email",
|
package/src/assets/i18n/it.json
CHANGED
|
@@ -290,7 +290,7 @@
|
|
|
290
290
|
"LABEL_WA_TEMPLATES":"WhatsApp Templates",
|
|
291
291
|
"SELECT_MESSAGE_TEMPLATE":"Seleziona un template di messaggio",
|
|
292
292
|
"ERROR_WHATSAPP_NOT_INSTALLED":"Installa Whatsapp dall'App Store per utilizzare i template",
|
|
293
|
-
"ERROR_WHATSAPP_GENERIC_ERROR":"Si è verificato un problema durante
|
|
293
|
+
"ERROR_WHATSAPP_GENERIC_ERROR":"Si è verificato un problema durante il recupero dei modelli da whatsapp.\nControlla la tua configurazione o contatta il tuo amministratore."
|
|
294
294
|
},
|
|
295
295
|
"EMAIL":{
|
|
296
296
|
"EMAIL_OFFLINE_TIP":"Attenzione: l'utente è offline! Il messaggio sarà mandato per email",
|
package/src/assets/i18n/kk.json
CHANGED
|
@@ -290,7 +290,7 @@
|
|
|
290
290
|
"LABEL_WA_TEMPLATES":"WhatsApp шаблондары",
|
|
291
291
|
"SELECT_MESSAGE_TEMPLATE":"Хабарлама үлгісін таңдаңыз",
|
|
292
292
|
"ERROR_WHATSAPP_NOT_INSTALLED":"Үлгілерді пайдалану үшін App Store дүкенінен Whatsapp қолданбасын орнатыңыз",
|
|
293
|
-
"ERROR_WHATSAPP_GENERIC_ERROR":"Whatsapp-тан үлгілерді алу кезінде
|
|
293
|
+
"ERROR_WHATSAPP_GENERIC_ERROR":"Whatsapp-тан үлгілерді алу кезінде ақаулық орын алды.\n Конфигурацияңызды тексеріңіз немесе әкімшіге хабарласыңыз."
|
|
294
294
|
},
|
|
295
295
|
"EMAIL": {
|
|
296
296
|
"EMAIL_OFFLINE_TIP":"Ескерту: пайдаланушы желіден тыс! Хабарлама электрондық пошта арқылы жіберіледі",
|
package/src/assets/i18n/pt.json
CHANGED
|
@@ -290,7 +290,7 @@
|
|
|
290
290
|
"LABEL_WA_TEMPLATES":"Modelos do WhatsApp",
|
|
291
291
|
"SELECT_MESSAGE_TEMPLATE":"Selecione um modelo de mensagem",
|
|
292
292
|
"ERROR_WHATSAPP_NOT_INSTALLED":"Instale o Whatsapp da App Store para usar modelos",
|
|
293
|
-
"ERROR_WHATSAPP_GENERIC_ERROR":"Ocorreu um problema ao obter modelos do whatsapp
|
|
293
|
+
"ERROR_WHATSAPP_GENERIC_ERROR":"Ocorreu um problema ao obter modelos do whatsapp.\nVerifique sua configuração ou entre em contato com seu administrador."
|
|
294
294
|
},
|
|
295
295
|
"EMAIL": {
|
|
296
296
|
"EMAIL_OFFLINE_TIP":"Aviso: o usuário está offline! A mensagem será enviada por e-mail",
|
package/src/assets/i18n/ru.json
CHANGED
|
@@ -290,7 +290,7 @@
|
|
|
290
290
|
"LABEL_WA_TEMPLATES":"Шаблоны WhatsApp",
|
|
291
291
|
"SELECT_MESSAGE_TEMPLATE":"Выберите шаблон сообщения",
|
|
292
292
|
"ERROR_WHATSAPP_NOT_INSTALLED":"Установите Whatsapp из App Store, чтобы использовать шаблоны",
|
|
293
|
-
"ERROR_WHATSAPP_GENERIC_ERROR":"Возникла проблема при получении шаблонов из WhatsApp
|
|
293
|
+
"ERROR_WHATSAPP_GENERIC_ERROR":"Возникла проблема при получении шаблонов из WhatsApp.\n Проверьте конфигурацию или обратитесь к администратору."
|
|
294
294
|
},
|
|
295
295
|
"EMAIL": {
|
|
296
296
|
"EMAIL_OFFLINE_TIP":"Внимание: пользователь не в сети! Сообщение будет отправлено по электронной почте",
|
package/src/assets/i18n/sr.json
CHANGED
|
@@ -290,7 +290,7 @@
|
|
|
290
290
|
"LABEL_WA_TEMPLATES":"ВхатсАпп шаблони",
|
|
291
291
|
"SELECT_MESSAGE_TEMPLATE":"Изаберите шаблон поруке",
|
|
292
292
|
"ERROR_WHATSAPP_NOT_INSTALLED":"Инсталирајте Вхатсапп из Апп Сторе-а да бисте користили шаблоне",
|
|
293
|
-
"ERROR_WHATSAPP_GENERIC_ERROR":"Дошло је до проблема при преузимању шаблона из
|
|
293
|
+
"ERROR_WHATSAPP_GENERIC_ERROR":"Дошло је до проблема при преузимању шаблона из ВхатсАпп-а.\n Проверите своју конфигурацију или се обратите администратору."
|
|
294
294
|
},
|
|
295
295
|
"EMAIL": {
|
|
296
296
|
"EMAIL_OFFLINE_TIP":"Упозорење: корисник није на мрежи! Порука ће бити послата е-поштом",
|
package/src/assets/i18n/sv.json
CHANGED
|
@@ -290,7 +290,7 @@
|
|
|
290
290
|
"LABEL_WA_TEMPLATES":"WhatsApp-mallar",
|
|
291
291
|
"SELECT_MESSAGE_TEMPLATE":"Välj en meddelandemall",
|
|
292
292
|
"ERROR_WHATSAPP_NOT_INSTALLED":"Installera Whatsapp från App Store för att använda mallar",
|
|
293
|
-
"ERROR_WHATSAPP_GENERIC_ERROR":"Ett problem uppstod när mallar hämtades från WhatsApp
|
|
293
|
+
"ERROR_WHATSAPP_GENERIC_ERROR":"Ett problem uppstod när mallar hämtades från WhatsApp.\nKontrollera din konfiguration eller kontakta din administratör."
|
|
294
294
|
},
|
|
295
295
|
"EMAIL": {
|
|
296
296
|
"EMAIL_OFFLINE_TIP":"Varning: användaren är offline! Meddelandet kommer att skickas via e-post",
|
package/src/assets/i18n/tr.json
CHANGED
|
@@ -290,7 +290,7 @@
|
|
|
290
290
|
"LABEL_WA_TEMPLATES":"WhatsApp Şablonları",
|
|
291
291
|
"SELECT_MESSAGE_TEMPLATE":"Bir mesaj şablonu seçin",
|
|
292
292
|
"ERROR_WHATSAPP_NOT_INSTALLED":"Şablonları kullanmak için App Store'dan Whatsapp'ı yükleyin",
|
|
293
|
-
"ERROR_WHATSAPP_GENERIC_ERROR":"WhatsApp'tan şablonlar alınırken bir sorun oluştu
|
|
293
|
+
"ERROR_WHATSAPP_GENERIC_ERROR":"WhatsApp'tan şablonlar alınırken bir sorun oluştu.\nYapılandırmanızı kontrol edin veya yöneticinizle iletişime geçin."
|
|
294
294
|
},
|
|
295
295
|
"EMAIL": {
|
|
296
296
|
"EMAIL_OFFLINE_TIP":"Uyarı: kullanıcı çevrimdışı! Mesaj e-posta ile gönderilecek",
|
package/src/assets/i18n/uk.json
CHANGED
|
@@ -290,7 +290,7 @@
|
|
|
290
290
|
"LABEL_WA_TEMPLATES":"Шаблони WhatsApp",
|
|
291
291
|
"SELECT_MESSAGE_TEMPLATE":"Виберіть шаблон повідомлення",
|
|
292
292
|
"ERROR_WHATSAPP_NOT_INSTALLED":"Установіть Whatsapp з App Store, щоб використовувати шаблони",
|
|
293
|
-
"ERROR_WHATSAPP_GENERIC_ERROR":"Виникла проблема під час отримання шаблонів із WhatsApp
|
|
293
|
+
"ERROR_WHATSAPP_GENERIC_ERROR":"Виникла проблема під час отримання шаблонів із WhatsApp.\n Перевірте конфігурацію або зверніться до адміністратора."
|
|
294
294
|
},
|
|
295
295
|
"EMAIL": {
|
|
296
296
|
"EMAIL_OFFLINE_TIP":"Попередження: користувач офлайн! Повідомлення буде надіслано електронною поштою",
|
package/src/assets/i18n/uz.json
CHANGED
|
@@ -291,7 +291,7 @@
|
|
|
291
291
|
"LABEL_WA_TEMPLATES":"WhatsApp shablonlar",
|
|
292
292
|
"SELECT_MESSAGE_TEMPLATE":"Xabar shablonini tanlang",
|
|
293
293
|
"ERROR_WHATSAPP_NOT_INSTALLED":"Shablonlardan foydalanish uchun App Store'dan Whatsapp-ni o'rnating",
|
|
294
|
-
"ERROR_WHATSAPP_GENERIC_ERROR":"Whatsapp’dan shablonlarni olishda muammo yuz berdi
|
|
294
|
+
"ERROR_WHATSAPP_GENERIC_ERROR":"Whatsapp’dan shablonlarni olishda muammo yuz berdi.\nKonfiguratsiyangizni tekshiring yoki administratoringizga murojaat qiling."
|
|
295
295
|
},
|
|
296
296
|
"EMAIL": {
|
|
297
297
|
"EMAIL_OFFLINE_TIP":"Ogohlantirish: foydalanuvchi oflayn! Xabar elektron pochta orqali yuboriladi",
|
|
@@ -36,5 +36,6 @@
|
|
|
36
36
|
"wsUrlRel": "${WS_URL_RELATIVE}",
|
|
37
37
|
"storage_prefix": "${CHAT_STORAGE_PREFIX}",
|
|
38
38
|
"emailSection": "${EMAIL_SECTION}",
|
|
39
|
-
"whatsappTemplatesSection":"${WHATSAPP_TEMPLATES_SECTION}"
|
|
39
|
+
"whatsappTemplatesSection":"${WHATSAPP_TEMPLATES_SECTION}",
|
|
40
|
+
"googleMapsApiKey":"${GOOGLE_MAPS_APIKEY}"
|
|
40
41
|
}
|
package/src/chat-config.json
CHANGED
|
@@ -99,6 +99,7 @@ export class MQTTConversationHandler extends ConversationHandlerService {
|
|
|
99
99
|
}
|
|
100
100
|
this.chat21Service.chatClient.lastMessages(this.conversationWith, (err, messages) => {
|
|
101
101
|
if (!err) {
|
|
102
|
+
this.logger.log('[MQTTConversationHandlerSERVICE] message lastMessages:', messages);
|
|
102
103
|
messages.sort(compareValues('timestamp', 'asc'));
|
|
103
104
|
messages.forEach(message => {
|
|
104
105
|
const msg: MessageModel = message;
|
|
@@ -573,13 +573,13 @@ export function setConversationAvatar(
|
|
|
573
573
|
conversationWithEmail?: string,
|
|
574
574
|
projectId?: string,
|
|
575
575
|
project_name?: string,
|
|
576
|
-
|
|
576
|
+
request_channel?: string,
|
|
577
577
|
width?: string,
|
|
578
578
|
height?: string,
|
|
579
579
|
): any {
|
|
580
580
|
const conversationWidth = (width) ? width : '40px';
|
|
581
581
|
const conversationHeight = (height) ? height : '40px';
|
|
582
|
-
const conversationChannel = (
|
|
582
|
+
const conversationChannel = (request_channel) ? request_channel : 'chat21';
|
|
583
583
|
|
|
584
584
|
const conversationAvatar = {
|
|
585
585
|
uid: conversationWith,
|
|
@@ -591,7 +591,7 @@ export function setConversationAvatar(
|
|
|
591
591
|
color: getColorBck(conversationWithFullname),
|
|
592
592
|
projectId: projectId,
|
|
593
593
|
project_name: project_name,
|
|
594
|
-
|
|
594
|
+
request_channel: conversationChannel,
|
|
595
595
|
width: conversationWidth,
|
|
596
596
|
height: conversationHeight
|
|
597
597
|
};
|
package/src/index.html
CHANGED
|
@@ -11,7 +11,8 @@
|
|
|
11
11
|
|
|
12
12
|
<!-- <meta name="color-scheme" content="light dark" /> disable dark mode: Note in theme/variable.scss is also commented all the code that referts to dark-mode -->
|
|
13
13
|
<meta name="color-scheme" content="light" />
|
|
14
|
-
<meta name="viewport"
|
|
14
|
+
<meta name="viewport"
|
|
15
|
+
content="width=device-width, height=device-height ,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
|
|
15
16
|
<meta name="format-detection" content="telephone=no" />
|
|
16
17
|
<meta name="msapplication-tap-highlight" content="no" />
|
|
17
18
|
|