@chat21/chat21-web-widget 5.0.71-rc.9 → 5.0.72-rc.1
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 +26 -1
- package/package.json +1 -1
- package/src/app/app.component.ts +39 -39
- package/src/app/component/conversation-detail/conversation/conversation.component.ts +11 -16
- package/src/app/component/message/carousel/carousel.component.ts +1 -1
- package/src/app/component/message-attachment/message-attachment.component.ts +1 -1
- package/src/app/providers/translator.service.ts +9 -6
- package/src/app/utils/constants.ts +0 -5
- package/src/app/utils/globals.ts +4 -5
- package/src/assets/i18n/en.json +5 -6
- package/src/assets/i18n/es.json +13 -10
- package/src/assets/i18n/fr.json +13 -10
- package/src/assets/i18n/it.json +13 -10
- package/src/assets/js/chat21client.js +1 -2
- package/src/assets/twp/chatbot-panel.html +4 -5
- package/src/assets/twp/index-dev.html +96 -27
- package/src/assets/twp/index.html +19 -6
- package/src/chat21-core/providers/firebase/firebase-archivedconversations-handler.ts +1 -1
- package/src/chat21-core/providers/firebase/firebase-conversation-handler.ts +11 -20
- package/src/chat21-core/providers/mqtt/mqtt-conversation-handler.ts +11 -21
- package/src/chat21-core/providers/tiledesk/tiledesk-auth.service.ts +0 -3
- package/src/chat21-core/utils/constants.ts +21 -15
- package/src/chat21-core/utils/utils-message.ts +31 -11
- package/src/models/message.ts +0 -21
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,30 @@
|
|
|
1
1
|
# chat21-web-widget ver 5.0
|
|
2
2
|
|
|
3
|
+
### 5.0.72-rc.1
|
|
4
|
+
- changed: set retain option in mqtt connection as FALSE
|
|
5
|
+
|
|
6
|
+
### 5.0.71.2 in PROD
|
|
7
|
+
- bug-fixing: widget do not restart conversation in chatbot-panel.html file
|
|
8
|
+
|
|
9
|
+
### 5.0.71.1 in PROD
|
|
10
|
+
- bug-fixed: WELCOME_TITLE and WELCOME_TITLE not showed if user change them on dashboard widget settings
|
|
11
|
+
|
|
12
|
+
### 5.0.71 in PROD
|
|
13
|
+
|
|
14
|
+
### 5.0.71-rc.13
|
|
15
|
+
- bug-fixed: wellcome message string
|
|
16
|
+
|
|
17
|
+
### 5.0.71-rc.12
|
|
18
|
+
- changed: index.js, index-dev.js and chatbot-panel.js UI improved
|
|
19
|
+
|
|
20
|
+
### 5.0.71-rc.11
|
|
21
|
+
- added: INFO_MESSAGE_TYPE enum added to manage info message keys into message.attributes object
|
|
22
|
+
- changed: translations aligned for all lang
|
|
23
|
+
- changed: index.js, index-dev.js and chatbot-panel.js UI improved
|
|
24
|
+
|
|
25
|
+
### 5.0.71-rc.10
|
|
26
|
+
- bug-fixed: signInWithCustomToken override tiledesk_token key
|
|
27
|
+
|
|
3
28
|
### 5.0.71-rc.9
|
|
4
29
|
- added: brandSrc env property
|
|
5
30
|
|
|
@@ -17,7 +42,7 @@
|
|
|
17
42
|
- bug-fixed: do not disable url buttons on carousel element
|
|
18
43
|
- bug-fixed: do not sound if convAdded is fired and on reconnect event
|
|
19
44
|
- bug-fixed: init Rules only if widget is closed
|
|
20
|
-
- removed: 'Powereb By Tiledesk' on conversation and home components only for
|
|
45
|
+
- removed: 'Powereb By Tiledesk' on conversation and home components only for chatbot-panel.html page
|
|
21
46
|
|
|
22
47
|
### 5.0.71-rc.3
|
|
23
48
|
- added: delete method for firebase-upload service
|
package/package.json
CHANGED
package/src/app/app.component.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ScriptService } from './../chat21-core/providers/scripts/script.service';
|
|
2
|
-
import { TYPE_DIRECT } from './../chat21-core/utils/constants';
|
|
3
2
|
/** ANGULAR MODULES */
|
|
4
3
|
import { AfterViewInit, Component, ElementRef, HostListener, NgZone, OnDestroy, OnInit, ViewChild, ViewEncapsulation } from '@angular/core';
|
|
5
4
|
import { environment } from 'src/environments/environment';
|
|
@@ -38,7 +37,7 @@ import { TranslatorService } from './providers/translator.service';
|
|
|
38
37
|
// UTILS
|
|
39
38
|
import * as dayjs from 'dayjs';
|
|
40
39
|
import { MessageModel } from 'src/chat21-core/models/message';
|
|
41
|
-
import { AUTH_STATE_OFFLINE, AUTH_STATE_ONLINE, TYPE_MSG_FILE, TYPE_MSG_IMAGE, URL_SOUND_LIST_CONVERSATION } from 'src/chat21-core/utils/constants';
|
|
40
|
+
import { AUTH_STATE_OFFLINE, AUTH_STATE_ONLINE, CHANNEL_TYPE, TYPE_MSG_FILE, TYPE_MSG_IMAGE, URL_SOUND_LIST_CONVERSATION } from 'src/chat21-core/utils/constants';
|
|
42
41
|
import { supports_html5_storage } from 'src/chat21-core/utils/utils';
|
|
43
42
|
import { UID_SUPPORT_GROUP_MESSAGES } from './utils/constants';
|
|
44
43
|
import { Globals } from './utils/globals';
|
|
@@ -138,9 +137,42 @@ export class AppComponent implements OnInit, AfterViewInit, OnDestroy {
|
|
|
138
137
|
this.logger.info('[APP-CONF]---------------- ngAfterViewInit: APP.COMPONENT ---------------- ')
|
|
139
138
|
this.ngZone.run(() => {
|
|
140
139
|
const that = this;
|
|
140
|
+
const subAddedConversation = this.conversationsHandlerService.conversationAdded.subscribe((conversation) => {
|
|
141
|
+
// that.ngZone.run(() => {
|
|
142
|
+
if (that.g.isOpen === true && conversation) {
|
|
143
|
+
that.g.setParameter('displayEyeCatcherCard', 'none');
|
|
144
|
+
that.triggerOnConversationUpdated(conversation);
|
|
145
|
+
that.logger.debug('[APP-COMP] obsAddedConversation ::: ', conversation);
|
|
146
|
+
if (conversation.attributes && conversation.attributes['subtype'] === 'info') {
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
if (conversation.is_new) {
|
|
150
|
+
that.manageTabNotification(false, 'conv-added')
|
|
151
|
+
// this.soundMessage();
|
|
152
|
+
}
|
|
153
|
+
if(this.g.isOpen === false){
|
|
154
|
+
that.lastConversation = conversation;
|
|
155
|
+
that.g.isOpenNewMessage = true;
|
|
156
|
+
}
|
|
157
|
+
} else {
|
|
158
|
+
//widget closed
|
|
159
|
+
|
|
160
|
+
let badgeNewConverstionNumber = that.conversationsHandlerService.countIsNew()
|
|
161
|
+
that.g.setParameter('conversationsBadge', badgeNewConverstionNumber);
|
|
162
|
+
}
|
|
163
|
+
// that.manageTabNotification()
|
|
164
|
+
// });
|
|
165
|
+
if(conversation){
|
|
166
|
+
this.onImageLoaded(conversation)
|
|
167
|
+
this.onConversationLoaded(conversation)
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
});
|
|
171
|
+
this.subscriptions.push(subAddedConversation);
|
|
172
|
+
|
|
141
173
|
const subChangedConversation = this.conversationsHandlerService.conversationChanged.subscribe((conversation) => {
|
|
142
174
|
// that.ngZone.run(() => {
|
|
143
|
-
|
|
175
|
+
if (conversation) {
|
|
144
176
|
this.onImageLoaded(conversation)
|
|
145
177
|
this.onConversationLoaded(conversation)
|
|
146
178
|
|
|
@@ -150,7 +182,7 @@ export class AppComponent implements OnInit, AfterViewInit, OnDestroy {
|
|
|
150
182
|
}
|
|
151
183
|
|
|
152
184
|
if(conversation.is_new && conversation.sender !== this.g.senderId && !isInfo(conversation)){
|
|
153
|
-
that.manageTabNotification(conversation.sound);
|
|
185
|
+
that.manageTabNotification(conversation.sound, 'conv-changed');
|
|
154
186
|
}
|
|
155
187
|
|
|
156
188
|
if (that.g.isOpen === true) {
|
|
@@ -186,39 +218,6 @@ export class AppComponent implements OnInit, AfterViewInit, OnDestroy {
|
|
|
186
218
|
});
|
|
187
219
|
this.subscriptions.push(subChangedConversation);
|
|
188
220
|
|
|
189
|
-
const subAddedConversation = this.conversationsHandlerService.conversationAdded.subscribe((conversation) => {
|
|
190
|
-
// that.ngZone.run(() => {
|
|
191
|
-
if (that.g.isOpen === true && conversation) {
|
|
192
|
-
that.g.setParameter('displayEyeCatcherCard', 'none');
|
|
193
|
-
that.triggerOnConversationUpdated(conversation);
|
|
194
|
-
that.logger.debug('[APP-COMP] obsAddedConversation ::: ', conversation);
|
|
195
|
-
if (conversation.attributes && conversation.attributes['subtype'] === 'info') {
|
|
196
|
-
return;
|
|
197
|
-
}
|
|
198
|
-
if (conversation.is_new) {
|
|
199
|
-
that.manageTabNotification(false)
|
|
200
|
-
// this.soundMessage();
|
|
201
|
-
}
|
|
202
|
-
if(this.g.isOpen === false){
|
|
203
|
-
that.lastConversation = conversation;
|
|
204
|
-
that.g.isOpenNewMessage = true;
|
|
205
|
-
}
|
|
206
|
-
} else {
|
|
207
|
-
//widget closed
|
|
208
|
-
|
|
209
|
-
let badgeNewConverstionNumber = that.conversationsHandlerService.countIsNew()
|
|
210
|
-
that.g.setParameter('conversationsBadge', badgeNewConverstionNumber);
|
|
211
|
-
}
|
|
212
|
-
// that.manageTabNotification()
|
|
213
|
-
// });
|
|
214
|
-
if(conversation){
|
|
215
|
-
this.onImageLoaded(conversation)
|
|
216
|
-
this.onConversationLoaded(conversation)
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
});
|
|
220
|
-
this.subscriptions.push(subAddedConversation);
|
|
221
|
-
|
|
222
221
|
const subAddedArchivedConversations = this.archivedConversationsService.archivedConversationAdded.subscribe((conversation) => {
|
|
223
222
|
// that.ngZone.run(() => {
|
|
224
223
|
if (conversation) {
|
|
@@ -1473,7 +1472,7 @@ export class AppComponent implements OnInit, AfterViewInit, OnDestroy {
|
|
|
1473
1472
|
}
|
|
1474
1473
|
}
|
|
1475
1474
|
|
|
1476
|
-
private manageTabNotification(canSound: boolean) {
|
|
1475
|
+
private manageTabNotification(canSound: boolean, calledby: string) {
|
|
1477
1476
|
if (!this.isTabVisible) {
|
|
1478
1477
|
// TAB IS HIDDEN --> manage title and SOUND
|
|
1479
1478
|
// this.g.windowContext.parent.title = "HIDDEN"
|
|
@@ -1493,6 +1492,7 @@ export class AppComponent implements OnInit, AfterViewInit, OnDestroy {
|
|
|
1493
1492
|
}
|
|
1494
1493
|
}, 1000);
|
|
1495
1494
|
}
|
|
1495
|
+
this.logger.debug('[APP-COMP] manageTabNotification canSound:calledby---->', canSound, calledby)
|
|
1496
1496
|
if(canSound)
|
|
1497
1497
|
this.soundMessage()
|
|
1498
1498
|
}
|
|
@@ -1695,7 +1695,7 @@ export class AppComponent implements OnInit, AfterViewInit, OnDestroy {
|
|
|
1695
1695
|
this._f21_open()
|
|
1696
1696
|
}
|
|
1697
1697
|
// this.conversationSelected = $event;
|
|
1698
|
-
if($event.channel_type ===
|
|
1698
|
+
if($event.channel_type === CHANNEL_TYPE.DIRECT){
|
|
1699
1699
|
this.g.setParameter('recipientId', $event.sender);
|
|
1700
1700
|
this.appStorageService.setItem('recipientId', $event.sender)
|
|
1701
1701
|
}else {
|
|
@@ -6,18 +6,18 @@ import { ConversationFooterComponent } from './../conversation-footer/conversati
|
|
|
6
6
|
// tslint:disable-next-line:max-line-length
|
|
7
7
|
import { AfterViewInit, ChangeDetectorRef, Component, ElementRef, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges, ViewChild } from '@angular/core';
|
|
8
8
|
|
|
9
|
-
import {
|
|
10
|
-
CHANNEL_TYPE_DIRECT, CHANNEL_TYPE_GROUP, TYPE_MSG_TEXT,
|
|
11
|
-
UID_SUPPORT_GROUP_MESSAGES
|
|
12
|
-
} from 'src/app/utils/constants';
|
|
13
9
|
|
|
14
|
-
// models
|
|
15
10
|
|
|
11
|
+
// models
|
|
16
12
|
import { MessageModel } from 'src/chat21-core/models/message';
|
|
13
|
+
import { ConversationModel } from 'src/chat21-core/models/conversation';
|
|
17
14
|
|
|
18
15
|
// utils
|
|
19
16
|
import { v4 as uuidv4 } from 'uuid';
|
|
20
|
-
|
|
17
|
+
import { UID_SUPPORT_GROUP_MESSAGES } from 'src/app/utils/constants';
|
|
18
|
+
import { CHANNEL_TYPE, INFO_MESSAGE_TYPE, TYPE_MSG_TEXT } from 'src/chat21-core/utils/constants';
|
|
19
|
+
import { getDateDifference } from 'src/chat21-core/utils/utils';
|
|
20
|
+
import { isJustRecived, isUserBanned } from 'src/chat21-core/utils/utils-message';
|
|
21
21
|
|
|
22
22
|
// Import the resized event model
|
|
23
23
|
|
|
@@ -28,7 +28,6 @@ import { takeUntil } from 'rxjs/operators';
|
|
|
28
28
|
import { AppConfigService } from 'src/app/providers/app-config.service';
|
|
29
29
|
import { StarRatingWidgetService } from 'src/app/providers/star-rating-widget.service';
|
|
30
30
|
import { Globals } from 'src/app/utils/globals';
|
|
31
|
-
import { ConversationModel } from 'src/chat21-core/models/conversation';
|
|
32
31
|
import { AppStorageService } from 'src/chat21-core/providers/abstract/app-storage.service';
|
|
33
32
|
import { ArchivedConversationsHandlerService } from 'src/chat21-core/providers/abstract/archivedconversations-handler.service';
|
|
34
33
|
import { ConversationHandlerBuilderService } from 'src/chat21-core/providers/abstract/conversation-handler-builder.service';
|
|
@@ -39,10 +38,6 @@ import { TypingService } from 'src/chat21-core/providers/abstract/typing.service
|
|
|
39
38
|
import { CustomTranslateService } from 'src/chat21-core/providers/custom-translate.service';
|
|
40
39
|
import { LoggerInstance } from 'src/chat21-core/providers/logger/loggerInstance';
|
|
41
40
|
import { TiledeskRequestsService } from 'src/chat21-core/providers/tiledesk/tiledesk-requests.service';
|
|
42
|
-
import { LIVE_PAGE } from 'src/chat21-core/utils/constants';
|
|
43
|
-
import { getDateDifference } from 'src/chat21-core/utils/utils';
|
|
44
|
-
import { isJustRecived, isUserBanned } from 'src/chat21-core/utils/utils-message';
|
|
45
|
-
import { AppComponent } from '../../../app.component';
|
|
46
41
|
import { ConversationContentComponent } from '../conversation-content/conversation-content.component';
|
|
47
42
|
// import { TranslateService } from '@ngx-translate/core';
|
|
48
43
|
|
|
@@ -167,7 +162,7 @@ export class ConversationComponent implements OnInit, AfterViewInit, OnChanges {
|
|
|
167
162
|
public g: Globals,
|
|
168
163
|
public starRatingWidgetService: StarRatingWidgetService,
|
|
169
164
|
public sanitizer: DomSanitizer,
|
|
170
|
-
public appComponent: AppComponent,
|
|
165
|
+
// public appComponent: AppComponent,
|
|
171
166
|
public appStorageService: AppStorageService,
|
|
172
167
|
public conversationHandlerBuilderService: ConversationHandlerBuilderService,
|
|
173
168
|
public appConfigService: AppConfigService,
|
|
@@ -525,12 +520,12 @@ export class ConversationComponent implements OnInit, AfterViewInit, OnChanges {
|
|
|
525
520
|
*
|
|
526
521
|
*/
|
|
527
522
|
private setChannelType() {
|
|
528
|
-
let channelTypeTEMP =
|
|
523
|
+
let channelTypeTEMP = CHANNEL_TYPE.GROUP;
|
|
529
524
|
const projectid = this.g.projectid;
|
|
530
525
|
if (this.g.recipientId && this.g.recipientId.indexOf('group') !== -1) {
|
|
531
|
-
channelTypeTEMP =
|
|
526
|
+
channelTypeTEMP = CHANNEL_TYPE.GROUP;
|
|
532
527
|
} else if (!projectid) {
|
|
533
|
-
channelTypeTEMP =
|
|
528
|
+
channelTypeTEMP = CHANNEL_TYPE.DIRECT;
|
|
534
529
|
}
|
|
535
530
|
return channelTypeTEMP;
|
|
536
531
|
}
|
|
@@ -628,7 +623,7 @@ export class ConversationComponent implements OnInit, AfterViewInit, OnChanges {
|
|
|
628
623
|
const message= 'Moved to: [' + this.g.attributes.sourceTitle + '](' + this.g.attributes.sourcePage + ')'
|
|
629
624
|
const attributes={
|
|
630
625
|
subtype: 'info/support',
|
|
631
|
-
messagelabel: {key: LIVE_PAGE}
|
|
626
|
+
messagelabel: {key: INFO_MESSAGE_TYPE.LIVE_PAGE}
|
|
632
627
|
}
|
|
633
628
|
this.logger.debug('[CONV-COMP] sendLivePage --> attributes+message', attributes, message)
|
|
634
629
|
this.conversationFooter.sendMessage(message, TYPE_MSG_TEXT, null, attributes);
|
|
@@ -36,7 +36,7 @@ export class CarouselComponent implements OnInit{
|
|
|
36
36
|
constructor(private elementRef: ElementRef) { }
|
|
37
37
|
|
|
38
38
|
ngOnInit() {
|
|
39
|
-
console.log('[CAROUSEL-MESSAGE] hello', this.message, isCarousel(this.message))
|
|
39
|
+
// console.log('[CAROUSEL-MESSAGE] hello', this.message, isCarousel(this.message))
|
|
40
40
|
|
|
41
41
|
|
|
42
42
|
this.wrapper = this.elementRef.nativeElement.querySelector('.wrapper')
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
|
|
2
2
|
|
|
3
3
|
// models
|
|
4
|
-
import { MessageModel } from '
|
|
4
|
+
import { MessageModel } from 'src/chat21-core/models/message';
|
|
5
5
|
|
|
6
6
|
@Component({
|
|
7
7
|
selector: 'chat-message-attachment',
|
|
@@ -210,7 +210,6 @@ export class TranslatorService {
|
|
|
210
210
|
// this.setLanguage(globals.windowContext, globals.lang);
|
|
211
211
|
|
|
212
212
|
const labels: string[] = [
|
|
213
|
-
'LABEL_TU',
|
|
214
213
|
'LABEL_PLACEHOLDER',
|
|
215
214
|
'LABEL_START_NW_CONV',
|
|
216
215
|
'LABEL_SELECT_TOPIC',
|
|
@@ -235,8 +234,12 @@ export class TranslatorService {
|
|
|
235
234
|
'BUTTON_EDIT_PROFILE',
|
|
236
235
|
'DOWNLOAD_TRANSCRIPT',
|
|
237
236
|
'RATE_CHAT',
|
|
237
|
+
'WELLCOME',
|
|
238
238
|
'WELLCOME_TITLE',
|
|
239
239
|
'WELLCOME_MSG',
|
|
240
|
+
'WELCOME',
|
|
241
|
+
'WELCOME_TITLE',
|
|
242
|
+
'WELCOME_MSG',
|
|
240
243
|
'OPTIONS',
|
|
241
244
|
'SOUND_ON',
|
|
242
245
|
'SOUND_OFF',
|
|
@@ -264,7 +267,6 @@ export class TranslatorService {
|
|
|
264
267
|
|
|
265
268
|
this._translate.get(labels).subscribe(res => {
|
|
266
269
|
// console.log('»»»» initI18n »»»»»» »»»»»» GET TRANSLATED LABELS RES ', res);
|
|
267
|
-
globals.LABEL_TU = res['LABEL_TU']
|
|
268
270
|
globals.LABEL_PLACEHOLDER = res['LABEL_PLACEHOLDER']
|
|
269
271
|
globals.LABEL_START_NW_CONV = res['LABEL_START_NW_CONV'];
|
|
270
272
|
globals.LABEL_SELECT_TOPIC = res['LABEL_SELECT_TOPIC'];
|
|
@@ -288,8 +290,9 @@ export class TranslatorService {
|
|
|
288
290
|
globals.BUTTON_EDIT_PROFILE = res['BUTTON_EDIT_PROFILE']; // is used ??
|
|
289
291
|
globals.DOWNLOAD_TRANSCRIPT = res['DOWNLOAD_TRANSCRIPT'];
|
|
290
292
|
globals.RATE_CHAT = res['RATE_CHAT']; // is used ??
|
|
291
|
-
globals.
|
|
292
|
-
globals.
|
|
293
|
+
globals.WELCOME = res['WELLCOME'];
|
|
294
|
+
globals.WELCOME_TITLE = res['WELLCOME_TITLE'];
|
|
295
|
+
globals.WELCOME_MSG = res['WELLCOME_MSG'];
|
|
293
296
|
globals.OPTIONS = res['OPTIONS'];
|
|
294
297
|
globals.SOUND_ON = res['SOUND_ON'];
|
|
295
298
|
globals.SOUND_OFF = res['SOUND_OFF'];
|
|
@@ -315,10 +318,10 @@ export class TranslatorService {
|
|
|
315
318
|
globals.LABEL_ERROR_FIELD_REQUIRED= res['LABEL_ERROR_FIELD_REQUIRED']
|
|
316
319
|
|
|
317
320
|
if (!globals.welcomeTitle) {
|
|
318
|
-
globals.welcomeTitle = globals.
|
|
321
|
+
globals.welcomeTitle = globals.WELCOME_TITLE; /** Set the widget welcome message. Value type : string */
|
|
319
322
|
}
|
|
320
323
|
if (!globals.welcomeMsg) {
|
|
321
|
-
globals.welcomeMsg = globals.
|
|
324
|
+
globals.welcomeMsg = globals.WELCOME_MSG; /** Set the widget welcome message. Value type : string */
|
|
322
325
|
}
|
|
323
326
|
|
|
324
327
|
}, (error) => {
|
|
@@ -29,10 +29,6 @@ export const TYPE_MSG_IMAGE = 'image';
|
|
|
29
29
|
export const TYPE_MSG_FILE = 'file';
|
|
30
30
|
export const TYPE_MSG_BUTTON = 'button';
|
|
31
31
|
|
|
32
|
-
// CHANNEL TYPE
|
|
33
|
-
export const CHANNEL_TYPE_GROUP = 'group';
|
|
34
|
-
export const CHANNEL_TYPE_DIRECT = 'direct';
|
|
35
|
-
|
|
36
32
|
// NODE MESSAGES
|
|
37
33
|
export const UID_SUPPORT_GROUP_MESSAGES = 'support-group-';
|
|
38
34
|
|
|
@@ -52,7 +48,6 @@ export const BCK_COLOR_CONVERSATION_SELECTED = '#EEEEEE';
|
|
|
52
48
|
export const BCK_COLOR_CONVERSATION_UNSELECTED = '#FFFFFF';
|
|
53
49
|
|
|
54
50
|
// LABELS
|
|
55
|
-
// export const LABEL_TU = 'you: ';
|
|
56
51
|
// export const LABEL_MSG_PUSH_START_CHAT = 'Premi qui per chattare con qualcuno';
|
|
57
52
|
// export const LABEL_MSG_START_CHAT = 'inizia a chattare';
|
|
58
53
|
// export const LABEL_ACTIVE_NOW = 'attivo/a ora';
|
package/src/app/utils/globals.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { BehaviorSubject } from 'rxjs';
|
|
|
4
4
|
import { environment } from '../../environments/environment';
|
|
5
5
|
|
|
6
6
|
/** CONSTANTS */
|
|
7
|
-
import {
|
|
7
|
+
import { CHANNEL_TYPE } from 'src/chat21-core/utils/constants';
|
|
8
8
|
|
|
9
9
|
/** MODELS */
|
|
10
10
|
import { DepartmentModel } from 'src/models/department';
|
|
@@ -72,7 +72,6 @@ export class Globals {
|
|
|
72
72
|
privacyApproved = false;
|
|
73
73
|
|
|
74
74
|
// ============ BEGIN: LABELS ==============//
|
|
75
|
-
LABEL_TU: string;
|
|
76
75
|
LABEL_PLACEHOLDER: string;
|
|
77
76
|
LABEL_START_NW_CONV: string;
|
|
78
77
|
LABEL_SELECT_TOPIC: string;
|
|
@@ -428,9 +427,9 @@ export class Globals {
|
|
|
428
427
|
/** Set the widget title label shown in the widget header. Value type : string.
|
|
429
428
|
The default value is Tiledesk. */
|
|
430
429
|
/** name tenant ex: tilechat */
|
|
431
|
-
this.channelType =
|
|
432
|
-
// this.parameters['channelType'] =
|
|
433
|
-
// this.parameters.push({'channelType':
|
|
430
|
+
this.channelType = CHANNEL_TYPE.GROUP;
|
|
431
|
+
// this.parameters['channelType'] = CHANNEL_TYPE.GROUP;
|
|
432
|
+
// this.parameters.push({'channelType': CHANNEL_TYPE.GROUP});
|
|
434
433
|
/** channelType: group/direct */
|
|
435
434
|
this.default_settings = {};
|
|
436
435
|
// this.parameters.push({'default_settings': '' });
|
package/src/assets/i18n/en.json
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
{
|
|
2
|
-
"LABEL_TU": "",
|
|
3
2
|
"LABEL_PLACEHOLDER": "type your message..",
|
|
4
3
|
"LABEL_START_NW_CONV": "New conversation",
|
|
5
4
|
"LABEL_WHATSAPP": "Message us",
|
|
@@ -17,7 +16,7 @@
|
|
|
17
16
|
"GUEST_LABEL": "Guest",
|
|
18
17
|
"ALL_AGENTS_OFFLINE_LABEL": "All operators are offline at the moment",
|
|
19
18
|
"LABEL_LOADING": "Loading...",
|
|
20
|
-
"CALLOUT_TITLE_PLACEHOLDER": "Need Help?",
|
|
19
|
+
"CALLOUT_TITLE_PLACEHOLDER": "🖐 Need Help?",
|
|
21
20
|
"CALLOUT_MSG_PLACEHOLDER": "Click here and start chatting with us!",
|
|
22
21
|
"CUSTOMER_SATISFACTION": "Customer satisfaction",
|
|
23
22
|
"YOUR_OPINION_ON_OUR_CUSTOMER_SERVICE": "your opinion on our customer service",
|
|
@@ -35,8 +34,9 @@
|
|
|
35
34
|
"BUTTON_CLOSE_TO_ICON": "Minimize chat",
|
|
36
35
|
"BUTTON_EDIT_PROFILE": "Update profile",
|
|
37
36
|
"RATE_CHAT": "Rate chat",
|
|
38
|
-
"
|
|
39
|
-
"
|
|
37
|
+
"WELCOME_TITLE": "Hi, welcome to Tiledesk 👋",
|
|
38
|
+
"WELCOME_MSG": "How can we help?",
|
|
39
|
+
"WELCOME": "Welcome",
|
|
40
40
|
"OPTIONS": "options",
|
|
41
41
|
"SOUND_OFF": "Sound off",
|
|
42
42
|
"SOUND_ON": "Sound on",
|
|
@@ -87,6 +87,5 @@
|
|
|
87
87
|
"SENT_AN_IMAGE":"sent an image",
|
|
88
88
|
|
|
89
89
|
"LABEL_PREVIEW": "Preview",
|
|
90
|
-
"SWITCH_TO":"Or switch to:"
|
|
91
|
-
|
|
90
|
+
"SWITCH_TO": "Or switch to:"
|
|
92
91
|
}
|
package/src/assets/i18n/es.json
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
{
|
|
2
|
-
"LABEL_TU": "",
|
|
3
2
|
"LABEL_PLACEHOLDER": "escribe tu mensaje..",
|
|
4
3
|
"LABEL_START_NW_CONV": "Nueva conversación",
|
|
4
|
+
"LABEL_WHATSAPP": "Envíanos un mensaje",
|
|
5
5
|
"LABEL_SELECT_TOPIC": "Elige un tema",
|
|
6
6
|
"LABEL_COMPLETE_FORM": "Complete el formulario para iniciar una conversación con el próximo agente disponible.",
|
|
7
7
|
"LABEL_FIELD_NAME": "Nombre",
|
|
8
8
|
"LABEL_ERROR_FIELD_NAME": "Campo obligatorio (mínimo 5 caracteres).",
|
|
9
9
|
"LABEL_FIELD_EMAIL": "Email",
|
|
10
10
|
"LABEL_ERROR_FIELD_EMAIL": "Introduzca una dirección de correo electrónico válida.",
|
|
11
|
+
"LABEL_ERROR_FIELD_REQUIRED": "Campo obligatorio",
|
|
11
12
|
"LABEL_WRITING": "esta escribiendo...",
|
|
12
13
|
"LABEL_SEND_NEW_MESSAGE": "Enviar un mensaje nuevo",
|
|
13
14
|
"AGENT_NOT_AVAILABLE": " Fuera de línea",
|
|
@@ -15,7 +16,7 @@
|
|
|
15
16
|
"GUEST_LABEL": "Huésped",
|
|
16
17
|
"ALL_AGENTS_OFFLINE_LABEL": "Todos los operadores están desconectados en este momento.",
|
|
17
18
|
"LABEL_LOADING": "Cargando...",
|
|
18
|
-
"CALLOUT_TITLE_PLACEHOLDER": "¿Necesitas ayuda?",
|
|
19
|
+
"CALLOUT_TITLE_PLACEHOLDER": "🖐 ¿Necesitas ayuda?",
|
|
19
20
|
"CALLOUT_MSG_PLACEHOLDER": "¡Haz clic aquí y comienza a chatear con nosotros!",
|
|
20
21
|
"CUSTOMER_SATISFACTION": "La satisfacción del cliente",
|
|
21
22
|
"YOUR_OPINION_ON_OUR_CUSTOMER_SERVICE": "su opinión sobre nuestro servicio al cliente",
|
|
@@ -33,8 +34,9 @@
|
|
|
33
34
|
"BUTTON_CLOSE_TO_ICON": "Minimiza el chat",
|
|
34
35
|
"BUTTON_EDIT_PROFILE": "Actualización del perfil",
|
|
35
36
|
"RATE_CHAT": "Califica el chat",
|
|
36
|
-
"
|
|
37
|
-
"
|
|
37
|
+
"WELCOME_TITLE": "Hola, bienvenido a Tiledesk 👋",
|
|
38
|
+
"WELCOME_MSG": "¿Cómo podemos ayudar?",
|
|
39
|
+
"WELCOME": "Podemos",
|
|
38
40
|
"OPTIONS": "opciones",
|
|
39
41
|
"SOUND_OFF": "Sonido apagado",
|
|
40
42
|
"SOUND_ON": "Sonido encendido",
|
|
@@ -53,6 +55,7 @@
|
|
|
53
55
|
"CLOSE_CHAT": "Cerrar chat",
|
|
54
56
|
"MINIMIZE":"Minimizar",
|
|
55
57
|
"MAXIMIZE":"Maximizar",
|
|
58
|
+
|
|
56
59
|
"INFO_SUPPORT_USER_ADDED_SUBJECT":"tú",
|
|
57
60
|
"INFO_SUPPORT_USER_ADDED_YOU_VERB":"han sido agregados a ",
|
|
58
61
|
"INFO_SUPPORT_USER_ADDED_COMPLEMENT":"joined",
|
|
@@ -63,12 +66,7 @@
|
|
|
63
66
|
"INFO_SUPPORT_MEMBER_LEFT_GROUP":"eliminado del grupo",
|
|
64
67
|
"INFO_SUPPORT_MEMBER_ABANDONED_GROUP":"abandonó la conversación",
|
|
65
68
|
"INFO_A_NEW_SUPPORT_REQUEST_HAS_BEEN_ASSIGNED_TO_YOU": "Se le ha asignado una nueva solicitud de soporte",
|
|
66
|
-
"TICKET_TAKING":"La solicitud ha sido recibida y el personal de asistencia está tratando con ella. \nPara agregar más comentarios, responda a este correo electrónico.",
|
|
67
69
|
|
|
68
|
-
"LABEL_ERROR_FIELD_REQUIRED": "Campo obligatorio",
|
|
69
|
-
"SENT_AN_ATTACHMENT": "envió un archivo adjunto",
|
|
70
|
-
"SENT_AN_IMAGE": "envió una imagen",
|
|
71
|
-
|
|
72
70
|
"LABEL_PRECHAT_USER_FULLNAME": "Nombre completo",
|
|
73
71
|
"LABEL_PRECHAT_USER_EMAIL": "Correo electrónico",
|
|
74
72
|
"LABEL_PRECHAT_USER_EMAIL_ERROR": "Dirección de correo electrónico no válida",
|
|
@@ -84,5 +82,10 @@
|
|
|
84
82
|
"LABEL_LAST_ACCESS": "ultimo acceso",
|
|
85
83
|
"LABEL_TO": "a",
|
|
86
84
|
"ARRAY_DAYS": ["Lunes", "Martes", "Miércoles", "Jueves", "Viernes", "Sábado", "Domingo"],
|
|
87
|
-
|
|
85
|
+
|
|
86
|
+
"SENT_AN_ATTACHMENT": "envió un archivo adjunto",
|
|
87
|
+
"SENT_AN_IMAGE": "envió una imagen",
|
|
88
|
+
|
|
89
|
+
"LABEL_PREVIEW": "Avance",
|
|
90
|
+
"SWITCH_TO":"O cambiar a:"
|
|
88
91
|
}
|
package/src/assets/i18n/fr.json
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
{
|
|
2
|
-
"LABEL_TU": "",
|
|
3
2
|
"LABEL_PLACEHOLDER": "Écrivez votre question ...",
|
|
4
3
|
"LABEL_START_NW_CONV": "Nouvelle conversation",
|
|
4
|
+
"LABEL_WHATSAPP": "Contactez-nous",
|
|
5
5
|
"LABEL_SELECT_TOPIC": "Sélectionnez un sujet",
|
|
6
6
|
"LABEL_COMPLETE_FORM": "Remplissez le formulaire pour démarrer une conversation avec le prochain agent disponible.",
|
|
7
7
|
"LABEL_FIELD_NAME": "Prenom",
|
|
8
8
|
"LABEL_ERROR_FIELD_NAME": "Nom demandé (minimum 2 caractères).",
|
|
9
9
|
"LABEL_FIELD_EMAIL": "Email",
|
|
10
10
|
"LABEL_ERROR_FIELD_EMAIL": "Entrer une adresse email valide.",
|
|
11
|
+
"LABEL_ERROR_FIELD_REQUIRED": "Champ obligatoire",
|
|
11
12
|
"LABEL_WRITING": "écrit ...",
|
|
12
13
|
"LABEL_SEND_NEW_MESSAGE": "Envoyez un nouveau message",
|
|
13
14
|
"AGENT_NOT_AVAILABLE": " Hors ligne",
|
|
@@ -15,7 +16,7 @@
|
|
|
15
16
|
"GUEST_LABEL": "Hôte",
|
|
16
17
|
"ALL_AGENTS_OFFLINE_LABEL": "Tous les opérateurs sont actuellement hors ligne",
|
|
17
18
|
"LABEL_LOADING": "Chargement en cours ...",
|
|
18
|
-
"CALLOUT_TITLE_PLACEHOLDER": "Besoin d'aide?",
|
|
19
|
+
"CALLOUT_TITLE_PLACEHOLDER": "🖐 Besoin d'aide?",
|
|
19
20
|
"CALLOUT_MSG_PLACEHOLDER": "Cliquez ici et commencez à discuter avec nous!",
|
|
20
21
|
"CUSTOMER_SATISFACTION": "Évaluation des services",
|
|
21
22
|
"YOUR_OPINION_ON_OUR_CUSTOMER_SERVICE": "votre avis sur notre service client",
|
|
@@ -33,8 +34,9 @@
|
|
|
33
34
|
"BUTTON_CLOSE_TO_ICON": "Minimisez le chat",
|
|
34
35
|
"BUTTON_EDIT_PROFILE": "Modifier le profil",
|
|
35
36
|
"RATE_CHAT": "évaluer la conversation",
|
|
36
|
-
"
|
|
37
|
-
"
|
|
37
|
+
"WELCOME_TITLE": "Salut, bienvenue à Tiledesk 👋",
|
|
38
|
+
"WELCOME_MSG": "Comment pouvons-nous vous aider?",
|
|
39
|
+
"WELCOME": "Bienvenue",
|
|
38
40
|
"OPTIONS": "options",
|
|
39
41
|
"SOUND_OFF": "Sound off",
|
|
40
42
|
"SOUND_ON": "Sound on",
|
|
@@ -53,6 +55,7 @@
|
|
|
53
55
|
"CLOSE_CHAT": "Fermer le chat",
|
|
54
56
|
"MINIMIZE":"Minimiser",
|
|
55
57
|
"MAXIMIZE":"Maximiser",
|
|
58
|
+
|
|
56
59
|
"INFO_SUPPORT_USER_ADDED_SUBJECT":"toi",
|
|
57
60
|
"INFO_SUPPORT_USER_ADDED_YOU_VERB":"ont été ajoutés à ",
|
|
58
61
|
"INFO_SUPPORT_USER_ADDED_COMPLEMENT":"rejointe",
|
|
@@ -63,11 +66,6 @@
|
|
|
63
66
|
"INFO_SUPPORT_MEMBER_LEFT_GROUP":"supprimé du groupe",
|
|
64
67
|
"INFO_SUPPORT_MEMBER_ABANDONED_GROUP":"a quitté la conversation",
|
|
65
68
|
"INFO_A_NEW_SUPPORT_REQUEST_HAS_BEEN_ASSIGNED_TO_YOU": "Une nouvelle demande de support vous a été attribuée",
|
|
66
|
-
"TICKET_TAKING":"La demande a été reçue et le personnel d'assistance la traite.\nPour ajouter d'autres commentaires, répondez à cet e-mail.",
|
|
67
|
-
|
|
68
|
-
"LABEL_ERROR_FIELD_REQUIRED": "Champ obligatoire",
|
|
69
|
-
"SENT_AN_ATTACHMENT": "envoyé une pièce jointe",
|
|
70
|
-
"SENT_AN_IMAGE": "envoyé une image",
|
|
71
69
|
|
|
72
70
|
"LABEL_PRECHAT_USER_FULLNAME": "Nom complet",
|
|
73
71
|
"LABEL_PRECHAT_USER_EMAIL": "E-mail",
|
|
@@ -84,5 +82,10 @@
|
|
|
84
82
|
"LABEL_LAST_ACCESS": "dernier accès",
|
|
85
83
|
"LABEL_TO": "à",
|
|
86
84
|
"ARRAY_DAYS": ["Lundi", "Mardi", "Mercredi", "Jeudi", "Vendredi", "Samedi", "Dimanche"],
|
|
87
|
-
|
|
85
|
+
|
|
86
|
+
"SENT_AN_ATTACHMENT": "envoyé une pièce jointe",
|
|
87
|
+
"SENT_AN_IMAGE": "envoyé une image",
|
|
88
|
+
|
|
89
|
+
"LABEL_PREVIEW": "Aperçu",
|
|
90
|
+
"SWITCH_TO":"Ou passer à:"
|
|
88
91
|
}
|
package/src/assets/i18n/it.json
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
{
|
|
2
|
-
"LABEL_TU": "",
|
|
3
2
|
"LABEL_PLACEHOLDER": "Scrivi la tua domanda...",
|
|
4
3
|
"LABEL_START_NW_CONV": "Nuova conversazione",
|
|
4
|
+
"LABEL_WHATSAPP": "Contattaci",
|
|
5
5
|
"LABEL_SELECT_TOPIC": "Seleziona un argomento",
|
|
6
6
|
"LABEL_COMPLETE_FORM": "Completa il form per iniziare una conversazione con il prossimo agente disponibile.",
|
|
7
7
|
"LABEL_FIELD_NAME": "Nome",
|
|
8
8
|
"LABEL_ERROR_FIELD_NAME": "Nome richiesto (minimo 2 caratteri).",
|
|
9
9
|
"LABEL_FIELD_EMAIL": "Email",
|
|
10
10
|
"LABEL_ERROR_FIELD_EMAIL": "Inserisci un indirizzo email valido.",
|
|
11
|
+
"LABEL_ERROR_FIELD_REQUIRED": "Campo richiesto",
|
|
11
12
|
"LABEL_WRITING": "sta scrivendo...",
|
|
12
13
|
"LABEL_SEND_NEW_MESSAGE": "Invia un nuovo messaggio",
|
|
13
14
|
"AGENT_NOT_AVAILABLE": " Offline",
|
|
@@ -15,7 +16,7 @@
|
|
|
15
16
|
"GUEST_LABEL": "Ospite",
|
|
16
17
|
"ALL_AGENTS_OFFLINE_LABEL": "Tutti gli operatori sono offline al momento",
|
|
17
18
|
"LABEL_LOADING": "Caricamento...",
|
|
18
|
-
"CALLOUT_TITLE_PLACEHOLDER": "Bisogno di aiuto?",
|
|
19
|
+
"CALLOUT_TITLE_PLACEHOLDER": "🖐 Bisogno di aiuto?",
|
|
19
20
|
"CALLOUT_MSG_PLACEHOLDER": "Clicca qui e inizia a chattare con noi!",
|
|
20
21
|
"CUSTOMER_SATISFACTION": "Valutazione servizio",
|
|
21
22
|
"YOUR_OPINION_ON_OUR_CUSTOMER_SERVICE": "il tuo giudizio sul nostro servizio clienti",
|
|
@@ -33,8 +34,9 @@
|
|
|
33
34
|
"BUTTON_CLOSE_TO_ICON": "Riduci a icona la chat",
|
|
34
35
|
"BUTTON_EDIT_PROFILE": "Modifica profilo",
|
|
35
36
|
"RATE_CHAT": "Valuta chat",
|
|
36
|
-
"
|
|
37
|
-
"
|
|
37
|
+
"WELCOME_TITLE": "Ciao, benvenuto su Tiledesk 👋",
|
|
38
|
+
"WELCOME_MSG": "Come possiamo aiutarti?",
|
|
39
|
+
"WELCOME": "Benvenuto",
|
|
38
40
|
"OPTIONS": "opzioni",
|
|
39
41
|
"SOUND_OFF": "Suono spento",
|
|
40
42
|
"SOUND_ON": "Suono acceso",
|
|
@@ -53,6 +55,7 @@
|
|
|
53
55
|
"CLOSE_CHAT": "Chiudi chat",
|
|
54
56
|
"MINIMIZE":"Minimizza",
|
|
55
57
|
"MAXIMIZE":"Massimizza",
|
|
58
|
+
|
|
56
59
|
"INFO_SUPPORT_USER_ADDED_SUBJECT":"tu",
|
|
57
60
|
"INFO_SUPPORT_USER_ADDED_YOU_VERB":"sei stato aggiunto ",
|
|
58
61
|
"INFO_SUPPORT_USER_ADDED_COMPLEMENT":"si è unito",
|
|
@@ -63,11 +66,6 @@
|
|
|
63
66
|
"INFO_SUPPORT_MEMBER_LEFT_GROUP":"ha lasciato il gruppo",
|
|
64
67
|
"INFO_SUPPORT_MEMBER_ABANDONED_GROUP": "ha abbandonato la conversazione",
|
|
65
68
|
"INFO_A_NEW_SUPPORT_REQUEST_HAS_BEEN_ASSIGNED_TO_YOU": "Una nuova richiesta di supporto è stata assegnata a te",
|
|
66
|
-
"TICKET_TAKING":"La richiesta è stata ricevuta e il personale di assistenza se ne sta occupando.\nPer aggiungere ulteriori commenti, rispondi a questa email.",
|
|
67
|
-
|
|
68
|
-
"LABEL_ERROR_FIELD_REQUIRED": "Campo richiesto",
|
|
69
|
-
"SENT_AN_ATTACHMENT": "ha inviato un allegato",
|
|
70
|
-
"SENT_AN_IMAGE":"ha inviato un'immagine",
|
|
71
69
|
|
|
72
70
|
"LABEL_PRECHAT_USER_FULLNAME": "Nome completo",
|
|
73
71
|
"LABEL_PRECHAT_USER_EMAIL": "E-mail",
|
|
@@ -84,5 +82,10 @@
|
|
|
84
82
|
"LABEL_LAST_ACCESS": "ultimo accesso",
|
|
85
83
|
"LABEL_TO": "a",
|
|
86
84
|
"ARRAY_DAYS": ["Lunedì", "Martedì", "Mercoledì", "Giovedì", "Venerdì", "Sabato", "Domenica"],
|
|
87
|
-
|
|
85
|
+
|
|
86
|
+
"SENT_AN_ATTACHMENT": "ha inviato un allegato",
|
|
87
|
+
"SENT_AN_IMAGE":"ha inviato un'immagine",
|
|
88
|
+
|
|
89
|
+
"LABEL_PREVIEW": "Anteprima",
|
|
90
|
+
"SWITCH_TO":"Oppure passa a:"
|
|
88
91
|
}
|
|
@@ -986,7 +986,7 @@ class Chat21Client {
|
|
|
986
986
|
topic: this.presence_topic,
|
|
987
987
|
payload: '{"disconnected":true}',
|
|
988
988
|
qos: 1,
|
|
989
|
-
retain:
|
|
989
|
+
retain: false
|
|
990
990
|
},
|
|
991
991
|
clientId: this.client_id,
|
|
992
992
|
username: 'JWT',
|
|
@@ -1001,7 +1001,6 @@ class Chat21Client {
|
|
|
1001
1001
|
this.client.on('connect', // TODO if token is wrong it must reply with an error!
|
|
1002
1002
|
() => {
|
|
1003
1003
|
if (this.log) {
|
|
1004
|
-
console.log("Chat client connected. User:" + user_id)
|
|
1005
1004
|
console.log("Chat client connected. this.connected:" + this.connected)
|
|
1006
1005
|
}
|
|
1007
1006
|
if (!this.connected) {
|
|
@@ -14,10 +14,6 @@
|
|
|
14
14
|
@-ms-keyframes blink {0%{opacity:1;} 50%{opacity:0;} 100%{opacity:1;}} /* IE */
|
|
15
15
|
@keyframes blink {0%{opacity:1;} 50%{opacity:0;} 100%{opacity:1;}} /* Opera and prob css3 final iteration */
|
|
16
16
|
|
|
17
|
-
:root {
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
|
|
21
17
|
body{
|
|
22
18
|
--font-family-poppins: 'Poppins', 'Roboto', Arial, sans-serif;
|
|
23
19
|
--blu: #506493;
|
|
@@ -467,7 +463,10 @@
|
|
|
467
463
|
// calloutTimer: 1,
|
|
468
464
|
singleConversation: true,
|
|
469
465
|
restartConversation: true,
|
|
470
|
-
|
|
466
|
+
hideHeaderCloseButton: true,
|
|
467
|
+
hideCloseConversationOptionMenu: true,
|
|
468
|
+
isLogEnabled:true,
|
|
469
|
+
customAttributes: { sound: false }
|
|
471
470
|
// autostart: false
|
|
472
471
|
|
|
473
472
|
};
|
|
@@ -14,6 +14,15 @@
|
|
|
14
14
|
@-ms-keyframes blink {0%{opacity:1;} 50%{opacity:0;} 100%{opacity:1;}} /* IE */
|
|
15
15
|
@keyframes blink {0%{opacity:1;} 50%{opacity:0;} 100%{opacity:1;}} /* Opera and prob css3 final iteration */
|
|
16
16
|
|
|
17
|
+
body{
|
|
18
|
+
--font-family-poppins: 'Poppins', 'Roboto', Arial, sans-serif;
|
|
19
|
+
--blu: #506493;
|
|
20
|
+
--gray-light-02: rgb(223, 227, 237);
|
|
21
|
+
--base-company-logo: rgb(224,106,88);
|
|
22
|
+
--header-height: 80px;
|
|
23
|
+
--footer-height: 80px;
|
|
24
|
+
}
|
|
25
|
+
|
|
17
26
|
#preloader {
|
|
18
27
|
background: #fff;
|
|
19
28
|
position: fixed;
|
|
@@ -51,6 +60,52 @@
|
|
|
51
60
|
animation:blink normal 2s infinite ease-in-out; /* Opera and prob css3 final iteration */
|
|
52
61
|
}
|
|
53
62
|
|
|
63
|
+
.loader{
|
|
64
|
+
display: block;
|
|
65
|
+
z-index: 99;
|
|
66
|
+
position: absolute;
|
|
67
|
+
top: calc( 50% - 50px);
|
|
68
|
+
left: calc( 50% - 50px);
|
|
69
|
+
width: 100px;
|
|
70
|
+
height: 100px;
|
|
71
|
+
border: 3px solid var(--base-company-logo);
|
|
72
|
+
border-radius: 50%;
|
|
73
|
+
|
|
74
|
+
animation: spin 7s ease-in-out;
|
|
75
|
+
animation-iteration-count: infinite;
|
|
76
|
+
transition-duration: 0.1s;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.loader:hover {
|
|
80
|
+
scale: 0.95;
|
|
81
|
+
/*Loader on hover effect*/
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.loader:active {
|
|
85
|
+
scale: 1.2;
|
|
86
|
+
/*Loader on click effect*/
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
@keyframes spin {
|
|
90
|
+
0% {
|
|
91
|
+
transform: rotate(0deg);
|
|
92
|
+
border-bottom: solid 3px transparent;
|
|
93
|
+
border-top: solid 3px transparent;
|
|
94
|
+
}
|
|
95
|
+
50% {
|
|
96
|
+
transform: rotate(1800deg);
|
|
97
|
+
border: 3px solid white;
|
|
98
|
+
border-left: solid 3px transparent;
|
|
99
|
+
border-right: solid 3px transparent;
|
|
100
|
+
}
|
|
101
|
+
100% {
|
|
102
|
+
/*Reversed spinning*/
|
|
103
|
+
transform: rotate(0deg);
|
|
104
|
+
border-bottom: solid 3px transparent;
|
|
105
|
+
border-top: solid 3px transparent;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
54
109
|
#deferred-styles {
|
|
55
110
|
display: none;
|
|
56
111
|
}
|
|
@@ -93,7 +148,11 @@
|
|
|
93
148
|
justify-content: space-around;
|
|
94
149
|
}
|
|
95
150
|
#header-logo{
|
|
96
|
-
height:
|
|
151
|
+
max-height: 45px;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.navbar{
|
|
155
|
+
display: flex;
|
|
97
156
|
}
|
|
98
157
|
|
|
99
158
|
#wrapper {
|
|
@@ -108,22 +167,22 @@
|
|
|
108
167
|
left: 0px;
|
|
109
168
|
right: 0px;
|
|
110
169
|
overflow: hidden;
|
|
111
|
-
height:
|
|
170
|
+
height: var(--header-height);
|
|
171
|
+
font-family: var(--font-family-poppins);
|
|
112
172
|
}
|
|
113
173
|
|
|
114
174
|
#main {
|
|
175
|
+
padding: 20px;
|
|
115
176
|
padding-bottom:100px;
|
|
116
|
-
margin: 20px;
|
|
177
|
+
margin: 20px auto 20px auto;
|
|
178
|
+
/* width: 970px !important; */
|
|
179
|
+
justify-content: start;
|
|
117
180
|
|
|
118
181
|
position: absolute;
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
left: 0px;
|
|
123
|
-
right: 0px;
|
|
182
|
+
top: var(--header-height);
|
|
183
|
+
bottom: var(--footer-height);
|
|
184
|
+
overflow: scroll;
|
|
124
185
|
width: 100%;
|
|
125
|
-
justify-content: flex-start;
|
|
126
|
-
flex-direction: row;
|
|
127
186
|
}
|
|
128
187
|
|
|
129
188
|
.row {
|
|
@@ -131,6 +190,12 @@
|
|
|
131
190
|
margin-right: 0 !important;
|
|
132
191
|
}
|
|
133
192
|
|
|
193
|
+
@media screen and (max-width: 1020px){
|
|
194
|
+
.row{
|
|
195
|
+
width: 100% !important;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
|
|
134
199
|
|
|
135
200
|
.b_frame {
|
|
136
201
|
-webkit-box-shadow: 0px 19px 147px -41px rgba(0,0,0,0.75);
|
|
@@ -183,7 +248,7 @@
|
|
|
183
248
|
|
|
184
249
|
/* position: relative;
|
|
185
250
|
margin-top: -100px; negative value of footer height */
|
|
186
|
-
height:
|
|
251
|
+
height: var(--footer-height);
|
|
187
252
|
clear:both;
|
|
188
253
|
|
|
189
254
|
position: absolute;
|
|
@@ -294,7 +359,7 @@
|
|
|
294
359
|
}
|
|
295
360
|
|
|
296
361
|
div.section .btn:hover{
|
|
297
|
-
background:
|
|
362
|
+
background: var(--base-company-logo);
|
|
298
363
|
color: #ffffff;
|
|
299
364
|
}
|
|
300
365
|
|
|
@@ -352,7 +417,7 @@
|
|
|
352
417
|
}
|
|
353
418
|
|
|
354
419
|
div.method_container .btn:hover{
|
|
355
|
-
background:
|
|
420
|
+
background: var(--base-company-logo);
|
|
356
421
|
color: #ffffff;
|
|
357
422
|
}
|
|
358
423
|
|
|
@@ -1592,8 +1657,12 @@
|
|
|
1592
1657
|
</head>
|
|
1593
1658
|
|
|
1594
1659
|
<body class="website white" >
|
|
1595
|
-
<div id="preloader">
|
|
1660
|
+
<!-- <div id="preloader">
|
|
1596
1661
|
<div class="logo"></div>
|
|
1662
|
+
</div> -->
|
|
1663
|
+
|
|
1664
|
+
<div id="preloader">
|
|
1665
|
+
<div class="loader"></div>
|
|
1597
1666
|
</div>
|
|
1598
1667
|
|
|
1599
1668
|
<div id="wrapper">
|
|
@@ -1626,9 +1695,8 @@
|
|
|
1626
1695
|
</nav>
|
|
1627
1696
|
</header>
|
|
1628
1697
|
|
|
1629
|
-
<div id="main"
|
|
1630
|
-
<div class="row">
|
|
1631
|
-
<div class="col-md-12">
|
|
1698
|
+
<div id="main">
|
|
1699
|
+
<div class="row" style="width: 70%;">
|
|
1632
1700
|
<h1 style="min-height: 39px;">TEST ACTIONS</h1>
|
|
1633
1701
|
<h3 id="project_name" style="min-height: 39px;"></h3>
|
|
1634
1702
|
<div class="row method_container">
|
|
@@ -2415,19 +2483,20 @@
|
|
|
2415
2483
|
<button class="btn btn-light" onclick="onClickClearHistory()">Clear <i class="fa fa-trash" aria-hidden="true"></i></button>
|
|
2416
2484
|
</div>
|
|
2417
2485
|
</div>
|
|
2418
|
-
|
|
2486
|
+
|
|
2487
|
+
<div class="row" style="width: 100%;">
|
|
2488
|
+
<h1 id="project_name" style="min-height: 39px;"></h1>
|
|
2489
|
+
<h2></h2>
|
|
2490
|
+
<div class="b_integrations_agent_links">
|
|
2491
|
+
<a href="" data-toggle="modal" data-target="#embedModal" id="enbed" style="display: none;"><i class="fa-code fa"></i>Embed</a>
|
|
2492
|
+
<!-- <a href="mailto:?subject=Tiledesk%20widget%20test%20page"><i class="fa-envelope-o fa" target="_blank"></i>Email</a> -->
|
|
2493
|
+
<a href="" data-toggle="modal" data-target="#shareModal"><i class="fa-reply fa"></i>Share</a>
|
|
2494
|
+
</div>
|
|
2495
|
+
</div>
|
|
2419
2496
|
|
|
2420
2497
|
</div>
|
|
2421
2498
|
|
|
2422
|
-
|
|
2423
|
-
<h1 id="project_name" style="min-height: 39px;"></h1>
|
|
2424
|
-
<h2></h2>
|
|
2425
|
-
<div class="b_integrations_agent_links">
|
|
2426
|
-
<a href="" data-toggle="modal" data-target="#embedModal" id="enbed" style="display: none;"><i class="fa-code fa"></i>Embed</a>
|
|
2427
|
-
<!-- <a href="mailto:?subject=Tiledesk%20widget%20test%20page"><i class="fa-envelope-o fa" target="_blank"></i>Email</a> -->
|
|
2428
|
-
<a href="" data-toggle="modal" data-target="#shareModal"><i class="fa-reply fa"></i>Share</a>
|
|
2429
|
-
</div>
|
|
2430
|
-
</div>
|
|
2499
|
+
|
|
2431
2500
|
|
|
2432
2501
|
|
|
2433
2502
|
<div class="modal fade" tabindex="-1" id="embedModal" role="dialog">
|
|
@@ -14,6 +14,15 @@
|
|
|
14
14
|
@-ms-keyframes blink {0%{opacity:1;} 50%{opacity:0;} 100%{opacity:1;}} /* IE */
|
|
15
15
|
@keyframes blink {0%{opacity:1;} 50%{opacity:0;} 100%{opacity:1;}} /* Opera and prob css3 final iteration */
|
|
16
16
|
|
|
17
|
+
body{
|
|
18
|
+
--font-family-poppins: 'Poppins', 'Roboto', Arial, sans-serif;
|
|
19
|
+
--blu: #506493;
|
|
20
|
+
--gray-light-02: rgb(223, 227, 237);
|
|
21
|
+
--base-company-logo: rgb(224,106,88);
|
|
22
|
+
--header-height: 80px;
|
|
23
|
+
--footer-height: 80px;
|
|
24
|
+
}
|
|
25
|
+
|
|
17
26
|
#preloader {
|
|
18
27
|
background: #fff;
|
|
19
28
|
position: absolute;
|
|
@@ -61,7 +70,7 @@
|
|
|
61
70
|
left: calc( 50% - 50px);
|
|
62
71
|
width: 100px;
|
|
63
72
|
height: 100px;
|
|
64
|
-
border: 3px solid
|
|
73
|
+
border: 3px solid var(--base-company-logo);
|
|
65
74
|
border-radius: 50%;
|
|
66
75
|
|
|
67
76
|
animation: spin 7s ease-in-out;
|
|
@@ -142,7 +151,7 @@
|
|
|
142
151
|
justify-content: space-around;
|
|
143
152
|
}
|
|
144
153
|
#header-logo{
|
|
145
|
-
height:
|
|
154
|
+
max-height: 45px;
|
|
146
155
|
}
|
|
147
156
|
|
|
148
157
|
#wrapper {
|
|
@@ -154,13 +163,17 @@
|
|
|
154
163
|
#main {
|
|
155
164
|
padding-bottom:100px;
|
|
156
165
|
margin: 20px auto 0 auto;
|
|
157
|
-
width: 970px !important;
|
|
166
|
+
/* width: 970px !important; */
|
|
158
167
|
justify-content: start;
|
|
159
168
|
}
|
|
160
169
|
|
|
170
|
+
.navbar{
|
|
171
|
+
display: flex;
|
|
172
|
+
}
|
|
173
|
+
|
|
161
174
|
.row {
|
|
162
|
-
margin-left: 0;
|
|
163
|
-
margin-right: 0;
|
|
175
|
+
margin-left: 0 !important;
|
|
176
|
+
margin-right: 0 !important;
|
|
164
177
|
}
|
|
165
178
|
|
|
166
179
|
|
|
@@ -195,7 +208,7 @@
|
|
|
195
208
|
|
|
196
209
|
/* position: relative;
|
|
197
210
|
margin-top: -100px; negative value of footer height */
|
|
198
|
-
height:
|
|
211
|
+
height: var(--footer-height);
|
|
199
212
|
clear:both;
|
|
200
213
|
|
|
201
214
|
position: absolute;
|
|
@@ -336,7 +336,7 @@ export class FirebaseArchivedConversationsHandler extends ArchivedConversationsH
|
|
|
336
336
|
conversation_with_fullname = conv.recipient_fullname;
|
|
337
337
|
conv.sender_fullname = this.translationMap.get('YOU')
|
|
338
338
|
// conv.last_message_text = YOU + conv.last_message_text;
|
|
339
|
-
// } else if (conv.channel_type ===
|
|
339
|
+
// } else if (conv.channel_type === CHANNEL_TYPE.GROUP) {
|
|
340
340
|
} else if (isGroup(conv)) {
|
|
341
341
|
// conversation_with_fullname = conv.sender_fullname;
|
|
342
342
|
// conv.last_message_text = conv.last_message_text;
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { LIVE_PAGE, MEMBER_LEFT_GROUP, TOUCHING_OPERATOR } from './../../utils/constants';
|
|
2
|
-
|
|
3
1
|
import { Inject, Injectable } from '@angular/core';
|
|
4
2
|
import { BehaviorSubject } from 'rxjs';
|
|
5
3
|
|
|
@@ -17,14 +15,10 @@ import { LoggerService } from '../abstract/logger.service';
|
|
|
17
15
|
import { LoggerInstance } from '../logger/loggerInstance';
|
|
18
16
|
|
|
19
17
|
// utils
|
|
20
|
-
import { MSG_STATUS_RECEIVED,
|
|
21
|
-
import {
|
|
22
|
-
compareValues,
|
|
23
|
-
searchIndexInArrayForUid,
|
|
24
|
-
conversationMessagesRef
|
|
25
|
-
} from '../../utils/utils';
|
|
18
|
+
import { MSG_STATUS_RECEIVED, TYPE_DIRECT, MESSAGE_TYPE_INFO, INFO_MESSAGE_TYPE } from '../../utils/constants';
|
|
19
|
+
import { compareValues, searchIndexInArrayForUid, conversationMessagesRef } from '../../utils/utils';
|
|
26
20
|
import { v4 as uuidv4 } from 'uuid';
|
|
27
|
-
import { messageType, checkIfIsMemberJoinedGroup, hideInfoMessage, isJustRecived, isSender } from '../../utils/utils-message';
|
|
21
|
+
import { messageType, checkIfIsMemberJoinedGroup, hideInfoMessage, isJustRecived, isSender, infoMessageType } from '../../utils/utils-message';
|
|
28
22
|
|
|
29
23
|
// @Injectable({ providedIn: 'root' })
|
|
30
24
|
@Injectable()
|
|
@@ -377,10 +371,7 @@ export class FirebaseConversationHandler extends ConversationHandlerService {
|
|
|
377
371
|
const INFO_A_NEW_SUPPORT_REQUEST_HAS_BEEN_ASSIGNED_TO_YOU = this.translationMap.get('INFO_A_NEW_SUPPORT_REQUEST_HAS_BEEN_ASSIGNED_TO_YOU');
|
|
378
372
|
const INFO_SUPPORT_LIVE_PAGE = this.translationMap.get('INFO_SUPPORT_LIVE_PAGE');
|
|
379
373
|
|
|
380
|
-
if (message.attributes.messagelabel
|
|
381
|
-
&& message.attributes.messagelabel.parameters
|
|
382
|
-
&& message.attributes.messagelabel.key === MEMBER_JOINED_GROUP
|
|
383
|
-
) {
|
|
374
|
+
if (infoMessageType(message) === INFO_MESSAGE_TYPE.MEMBER_JOINED_GROUP && message.attributes.messagelabel.parameters) {
|
|
384
375
|
let subject: string;
|
|
385
376
|
let verb: string;
|
|
386
377
|
let complement: string;
|
|
@@ -403,18 +394,18 @@ export class FirebaseConversationHandler extends ConversationHandlerService {
|
|
|
403
394
|
}
|
|
404
395
|
}
|
|
405
396
|
message.text = subject + ' ' + verb + ' ' + complement;
|
|
406
|
-
} else if ((message
|
|
397
|
+
} else if (infoMessageType(message) === INFO_MESSAGE_TYPE.CHAT_REOPENED ) {
|
|
407
398
|
message.text = INFO_SUPPORT_CHAT_REOPENED;
|
|
408
|
-
} else if ((message
|
|
399
|
+
} else if (infoMessageType(message) === INFO_MESSAGE_TYPE.CHAT_CLOSED ) {
|
|
409
400
|
message.text = INFO_SUPPORT_CHAT_CLOSED;
|
|
410
|
-
} else if ((message
|
|
401
|
+
} else if ((infoMessageType(message) === INFO_MESSAGE_TYPE.TOUCHING_OPERATOR) && message.sender === "system") {
|
|
411
402
|
const textAfterColon = message.text.split(":")[1]
|
|
412
403
|
if (textAfterColon !== undefined) {
|
|
413
404
|
message.text = INFO_A_NEW_SUPPORT_REQUEST_HAS_BEEN_ASSIGNED_TO_YOU + ': ' + textAfterColon;
|
|
414
405
|
}
|
|
415
|
-
} else if ((message
|
|
406
|
+
} else if (infoMessageType(message) === INFO_MESSAGE_TYPE.LEAD_UPDATED) {
|
|
416
407
|
message.text = INFO_SUPPORT_LEAD_UPDATED;
|
|
417
|
-
} else if ((message
|
|
408
|
+
} else if (infoMessageType(message) === INFO_MESSAGE_TYPE.MEMBER_LEFT_GROUP) {
|
|
418
409
|
let subject: string = '';
|
|
419
410
|
if (message.attributes.messagelabel.parameters.fullname) {
|
|
420
411
|
subject = message.attributes.messagelabel.parameters.fullname;
|
|
@@ -422,7 +413,7 @@ export class FirebaseConversationHandler extends ConversationHandlerService {
|
|
|
422
413
|
subject = message.attributes.messagelabel.parameters.member_id;
|
|
423
414
|
}
|
|
424
415
|
message.text = subject + ' ' + INFO_SUPPORT_MEMBER_LEFT_GROUP ;
|
|
425
|
-
} else if(message
|
|
416
|
+
} else if(infoMessageType(message) === INFO_MESSAGE_TYPE.LIVE_PAGE){
|
|
426
417
|
let sourceUrl: string = '';
|
|
427
418
|
if(message.attributes && message.attributes.sourcePage){
|
|
428
419
|
sourceUrl = message.attributes.sourcePage
|
|
@@ -447,7 +438,7 @@ export class FirebaseConversationHandler extends ConversationHandlerService {
|
|
|
447
438
|
if (msg.status < MSG_STATUS_RECEIVED ) { // && !msg.attributes.commands
|
|
448
439
|
//get message uid from attributes.parentUid if msg is a splitted one, from msg.uid otherwize
|
|
449
440
|
let uid = msg.uid
|
|
450
|
-
msg.attributes.commands? uid = msg.attributes.parentUid: null
|
|
441
|
+
msg.attributes && msg.attributes.commands? uid = msg.attributes.parentUid: null
|
|
451
442
|
if (msg.sender !== this.loggedUser.uid && msg.status < MSG_STATUS_RECEIVED) {
|
|
452
443
|
const urlNodeMessagesUpdate = this.urlNodeFirebase + '/' + uid;
|
|
453
444
|
this.logger.debug('[FIREBASEConversationHandlerSERVICE] update message status', urlNodeMessagesUpdate);
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { async } from '@angular/core/testing';
|
|
2
|
-
import { LIVE_PAGE, TOUCHING_OPERATOR } from './../../utils/constants';
|
|
3
1
|
import { Inject, Injectable } from '@angular/core';
|
|
4
2
|
import { BehaviorSubject } from 'rxjs';
|
|
5
3
|
|
|
@@ -17,15 +15,10 @@ import { UserModel } from '../../models/user';
|
|
|
17
15
|
import { ConversationHandlerService } from '../abstract/conversation-handler.service';
|
|
18
16
|
|
|
19
17
|
// utils
|
|
20
|
-
import { MSG_STATUS_RECEIVED,
|
|
21
|
-
import {
|
|
22
|
-
|
|
23
|
-
compareValues,
|
|
24
|
-
searchIndexInArrayForUid,
|
|
25
|
-
conversationMessagesRef
|
|
26
|
-
} from '../../utils/utils';
|
|
18
|
+
import { MSG_STATUS_RECEIVED, TYPE_DIRECT, MESSAGE_TYPE_INFO, INFO_MESSAGE_TYPE } from '../../utils/constants';
|
|
19
|
+
import { compareValues, searchIndexInArrayForUid } from '../../utils/utils';
|
|
20
|
+
import { messageType, checkIfIsMemberJoinedGroup, hideInfoMessage, isJustRecived, isSender, infoMessageType } from '../../utils/utils-message';
|
|
27
21
|
import { v4 as uuidv4 } from 'uuid';
|
|
28
|
-
import { messageType, checkIfIsMemberJoinedGroup, hideInfoMessage, isJustRecived, isSender } from '../../utils/utils-message';
|
|
29
22
|
|
|
30
23
|
|
|
31
24
|
// @Injectable({ providedIn: 'root' })
|
|
@@ -373,10 +366,7 @@ export class MQTTConversationHandler extends ConversationHandlerService {
|
|
|
373
366
|
const INFO_A_NEW_SUPPORT_REQUEST_HAS_BEEN_ASSIGNED_TO_YOU = this.translationMap.get('INFO_A_NEW_SUPPORT_REQUEST_HAS_BEEN_ASSIGNED_TO_YOU');
|
|
374
367
|
const INFO_SUPPORT_LIVE_PAGE = this.translationMap.get('INFO_SUPPORT_LIVE_PAGE');
|
|
375
368
|
|
|
376
|
-
if (message.attributes.messagelabel
|
|
377
|
-
&& message.attributes.messagelabel.parameters
|
|
378
|
-
&& message.attributes.messagelabel.key === MEMBER_JOINED_GROUP
|
|
379
|
-
) {
|
|
369
|
+
if (infoMessageType(message) === INFO_MESSAGE_TYPE.MEMBER_JOINED_GROUP && message.attributes.messagelabel.parameters ) {
|
|
380
370
|
let subject: string;
|
|
381
371
|
let verb: string;
|
|
382
372
|
let complement: string;
|
|
@@ -398,20 +388,20 @@ export class MQTTConversationHandler extends ConversationHandlerService {
|
|
|
398
388
|
}
|
|
399
389
|
}
|
|
400
390
|
message.text = subject + ' ' + verb + ' ' + complement;
|
|
401
|
-
} else if ((message
|
|
391
|
+
} else if (infoMessageType(message) === INFO_MESSAGE_TYPE.CHAT_REOPENED) {
|
|
402
392
|
message.text = INFO_SUPPORT_CHAT_REOPENED;
|
|
403
|
-
} else if ((message
|
|
393
|
+
} else if (infoMessageType(message) === INFO_MESSAGE_TYPE.CHAT_CLOSED) {
|
|
404
394
|
message.text = INFO_SUPPORT_CHAT_CLOSED;
|
|
405
|
-
} else if ((message
|
|
395
|
+
} else if ((infoMessageType(message) ===INFO_MESSAGE_TYPE.TOUCHING_OPERATOR) && message.sender === "system") {
|
|
406
396
|
// console.log('FIREBASEConversationHandlerSERVICE message text', message.text)
|
|
407
397
|
const textAfterColon = message.text.split(":")[1]
|
|
408
398
|
// console.log('FIREBASEConversationHandlerSERVICE message text - textAfterColon', textAfterColon)
|
|
409
399
|
if (textAfterColon !== undefined) {
|
|
410
400
|
message.text = INFO_A_NEW_SUPPORT_REQUEST_HAS_BEEN_ASSIGNED_TO_YOU + ': ' + textAfterColon;
|
|
411
401
|
}
|
|
412
|
-
} else if ((message
|
|
402
|
+
} else if (infoMessageType(message) === INFO_MESSAGE_TYPE.LEAD_UPDATED) {
|
|
413
403
|
message.text = INFO_SUPPORT_LEAD_UPDATED;
|
|
414
|
-
} else if ((message
|
|
404
|
+
} else if (infoMessageType(message) === INFO_MESSAGE_TYPE.MEMBER_LEFT_GROUP) {
|
|
415
405
|
let subject: string;
|
|
416
406
|
if (message.attributes.messagelabel.parameters.fullname) {
|
|
417
407
|
subject = message.attributes.messagelabel.parameters.fullname;
|
|
@@ -419,7 +409,7 @@ export class MQTTConversationHandler extends ConversationHandlerService {
|
|
|
419
409
|
subject = message.attributes.messagelabel.parameters.member_id;
|
|
420
410
|
}
|
|
421
411
|
message.text = subject + ' ' + INFO_SUPPORT_MEMBER_LEFT_GROUP ;
|
|
422
|
-
} else if(message
|
|
412
|
+
} else if(infoMessageType(message) === INFO_MESSAGE_TYPE.LIVE_PAGE){
|
|
423
413
|
let sourceUrl: string = '';
|
|
424
414
|
if(message.attributes && message.attributes.sourcePage){
|
|
425
415
|
sourceUrl = message.attributes.sourcePage
|
|
@@ -444,7 +434,7 @@ export class MQTTConversationHandler extends ConversationHandlerService {
|
|
|
444
434
|
if (msg['status'] < MSG_STATUS_RECEIVED && msg['status'] > 0) {
|
|
445
435
|
this.logger.log('[MQTTConversationHandlerSERVICE] status ', msg['status'], ' < (RECEIVED:200)', MSG_STATUS_RECEIVED);
|
|
446
436
|
let uid = msg.uid
|
|
447
|
-
msg.attributes.commands? uid = msg.attributes.parentUid: null
|
|
437
|
+
msg.attributes && msg.attributes.commands? uid = msg.attributes.parentUid: null
|
|
448
438
|
if (msg.sender !== this.loggedUser.uid && msg.status < MSG_STATUS_RECEIVED) {
|
|
449
439
|
this.logger.log('[MQTTConversationHandlerSERVICE] updating message with status received');
|
|
450
440
|
this.chat21Service.chatClient.updateMessageStatus(uid, this.conversationWith, MSG_STATUS_RECEIVED, null);
|
|
@@ -130,7 +130,6 @@ export class TiledeskAuthService {
|
|
|
130
130
|
this.logger.debug('[TILEDESK-AUTH] logOut()');
|
|
131
131
|
this.appStorage.removeItem('tiledeskToken');
|
|
132
132
|
this.appStorage.removeItem('currentUser');
|
|
133
|
-
localStorage.removeItem('tiledesk_token')
|
|
134
133
|
this.setCurrentUser(null);
|
|
135
134
|
}
|
|
136
135
|
|
|
@@ -179,8 +178,6 @@ export class TiledeskAuthService {
|
|
|
179
178
|
} else if (storedTiledeskToken && storedTiledeskToken === tiledeskToken) {
|
|
180
179
|
this.logger.log('[TILEDESK-AUTH] - checkAndSetInStorageTiledeskToken STORED-TOKEN EXIST AND IS = TO TOKEN ')
|
|
181
180
|
}
|
|
182
|
-
|
|
183
|
-
localStorage.setItem('tiledesk_token', tiledeskToken)
|
|
184
181
|
}
|
|
185
182
|
|
|
186
183
|
|
|
@@ -36,14 +36,17 @@ export const PARENT_PAGE_DETAIL_CONVERSATION = 'dettaglio-conversazione ';
|
|
|
36
36
|
export const BCK_COLOR_CONVERSATION_SELECTED = '#EEEEEE ';
|
|
37
37
|
export const BCK_COLOR_CONVERSATION_UNSELECTED = '#FFFFFF ';
|
|
38
38
|
|
|
39
|
-
export
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
39
|
+
export enum CHANNEL_TYPE {
|
|
40
|
+
SUPPORT_GROUP = 'support-group',
|
|
41
|
+
GROUP = 'group',
|
|
42
|
+
DIRECT = 'direct',
|
|
43
|
+
CHAT21 = 'chat21',
|
|
44
|
+
EMAIL = 'email',
|
|
45
|
+
FORM = 'form',
|
|
46
|
+
MESSENGER = 'messenger',
|
|
47
|
+
WHATSAPP = 'whatsapp',
|
|
48
|
+
TELEGRAM = 'telegram'
|
|
49
|
+
}
|
|
47
50
|
|
|
48
51
|
// TYPES MESSAGES
|
|
49
52
|
export const TYPE_MSG_TEXT = 'text';
|
|
@@ -68,13 +71,16 @@ export const MESSAGE_TYPE_INFO = 'INFO';
|
|
|
68
71
|
export const MESSAGE_TYPE_MINE = 'MINE';
|
|
69
72
|
export const MESSAGE_TYPE_OTHERS = 'OTHERS';
|
|
70
73
|
|
|
71
|
-
export
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
74
|
+
export enum INFO_MESSAGE_TYPE {
|
|
75
|
+
CHAT_REOPENED = 'CHAT_REOPENED',
|
|
76
|
+
CHAT_CLOSED = 'CHAT_CLOSED',
|
|
77
|
+
MEMBER_JOINED_GROUP = 'MEMBER_JOINED_GROUP',
|
|
78
|
+
MEMBER_LEFT_GROUP = "MEMBER_LEFT_GROUP",
|
|
79
|
+
LEAD_UPDATED = "LEAD_UPDATED",
|
|
80
|
+
TOUCHING_OPERATOR = "TOUCHING_OPERATOR",
|
|
81
|
+
LIVE_PAGE = "LIVE_PAGE",
|
|
82
|
+
PLAN_EXPIRED = "PLAN_EXPIRED"
|
|
83
|
+
}
|
|
78
84
|
|
|
79
85
|
// URLS
|
|
80
86
|
// export const URL_SOUND = 'assets/sounds/pling.mp3';
|
|
@@ -2,14 +2,13 @@ import { MessageModel } from './../models/message';
|
|
|
2
2
|
import { ConversationModel } from './../models/conversation';
|
|
3
3
|
import { v4 as uuidv4 } from 'uuid';
|
|
4
4
|
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
} from '
|
|
12
|
-
|
|
5
|
+
MESSAGE_TYPE_INFO,
|
|
6
|
+
MESSAGE_TYPE_MINE,
|
|
7
|
+
MESSAGE_TYPE_OTHERS,
|
|
8
|
+
MAX_WIDTH_IMAGES,
|
|
9
|
+
INFO_MESSAGE_TYPE,
|
|
10
|
+
CHANNEL_TYPE
|
|
11
|
+
} from '../../chat21-core/utils/constants';
|
|
13
12
|
/** */
|
|
14
13
|
export function isCarousel(message: any) {
|
|
15
14
|
if (message && message.type && message.type === 'gallery' && message?.attributes && message?.attributes?.attachment && message?.attributes?.attachment?.gallery ) {
|
|
@@ -122,6 +121,27 @@ export function messageType(msgType: string, message: any) {
|
|
|
122
121
|
}
|
|
123
122
|
}
|
|
124
123
|
|
|
124
|
+
export function infoMessageType(msg: MessageModel): string{
|
|
125
|
+
if(msg && msg.attributes.messagelabel && msg.attributes.messagelabel.key === INFO_MESSAGE_TYPE.MEMBER_JOINED_GROUP){
|
|
126
|
+
return INFO_MESSAGE_TYPE.MEMBER_JOINED_GROUP
|
|
127
|
+
}
|
|
128
|
+
if(msg && msg.attributes.messagelabel && msg.attributes.messagelabel.key === INFO_MESSAGE_TYPE.CHAT_REOPENED){
|
|
129
|
+
return INFO_MESSAGE_TYPE.CHAT_REOPENED
|
|
130
|
+
}
|
|
131
|
+
if(msg && msg.attributes.messagelabel && msg.attributes.messagelabel.key === INFO_MESSAGE_TYPE.TOUCHING_OPERATOR){
|
|
132
|
+
return INFO_MESSAGE_TYPE.TOUCHING_OPERATOR
|
|
133
|
+
}
|
|
134
|
+
if(msg && msg.attributes.messagelabel && msg.attributes.messagelabel.key === INFO_MESSAGE_TYPE.LEAD_UPDATED){
|
|
135
|
+
return INFO_MESSAGE_TYPE.LEAD_UPDATED
|
|
136
|
+
}
|
|
137
|
+
if(msg && msg.attributes.messagelabel && msg.attributes.messagelabel.key === INFO_MESSAGE_TYPE.MEMBER_LEFT_GROUP){
|
|
138
|
+
return INFO_MESSAGE_TYPE.MEMBER_LEFT_GROUP
|
|
139
|
+
}
|
|
140
|
+
if(msg && msg.attributes.messagelabel && msg.attributes.messagelabel.key === INFO_MESSAGE_TYPE.LIVE_PAGE){
|
|
141
|
+
return INFO_MESSAGE_TYPE.LIVE_PAGE
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
125
145
|
/** */
|
|
126
146
|
export function getSizeImg(message: any, maxWidthImage?: number): any {
|
|
127
147
|
try {
|
|
@@ -147,9 +167,9 @@ export function getSizeImg(message: any, maxWidthImage?: number): any {
|
|
|
147
167
|
|
|
148
168
|
/** */
|
|
149
169
|
export function isChannelTypeGroup(channelType: string) {
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
170
|
+
if (channelType === CHANNEL_TYPE.GROUP || channelType === CHANNEL_TYPE.SUPPORT_GROUP) {
|
|
171
|
+
return true;
|
|
172
|
+
}
|
|
153
173
|
return false;
|
|
154
174
|
}
|
|
155
175
|
|
package/src/models/message.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
// firebase
|
|
2
|
-
export class MessageModel {
|
|
3
|
-
public sender_urlImage: string;
|
|
4
|
-
constructor(
|
|
5
|
-
public uid: string,
|
|
6
|
-
public language: string,
|
|
7
|
-
public recipient: string,
|
|
8
|
-
public recipient_fullname: string,
|
|
9
|
-
public sender: string,
|
|
10
|
-
public sender_fullname: string,
|
|
11
|
-
public status: string,
|
|
12
|
-
public metadata: any,
|
|
13
|
-
public text: any,
|
|
14
|
-
public timestamp: any,
|
|
15
|
-
public type: string,
|
|
16
|
-
public attributes: any,
|
|
17
|
-
public channel_type: string,
|
|
18
|
-
public projectid: string,
|
|
19
|
-
public emoticon?: boolean
|
|
20
|
-
) { }
|
|
21
|
-
}
|