@chat21/chat21-ionic 3.0.89 → 3.0.90-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 +11 -0
- package/package.json +1 -1
- package/src/app/app-routing.module.ts +4 -4
- package/src/app/app.component.html +1 -1
- package/src/app/app.component.ts +15 -13
- package/src/app/app.module.ts +5 -3
- package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.html +5 -1
- package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.ts +1 -1
- package/src/app/components/conversations-list/header-conversations-list/header-conversations-list.component.ts +1 -1
- package/src/app/components/navbar/navbar.component.html +3 -3
- package/src/app/components/navbar/navbar.component.scss +9 -0
- package/src/app/components/navbar/navbar.component.ts +2 -1
- package/src/app/components/sidebar/sidebar.component.html +14 -35
- package/src/app/components/sidebar/sidebar.component.ts +2 -0
- package/src/app/modals/create-canned-response/create-canned-response.page.scss +2 -2
- package/src/app/modals/create-canned-response/create-canned-response.page.ts +5 -0
- package/src/app/{pages → modals}/create-ticket/create-ticket-routing.module.ts +0 -0
- package/src/app/{pages → modals}/create-ticket/create-ticket.module.ts +0 -0
- package/src/app/{pages → modals}/create-ticket/create-ticket.page.html +1 -1
- package/src/app/{pages → modals}/create-ticket/create-ticket.page.scss +0 -0
- package/src/app/{pages → modals}/create-ticket/create-ticket.page.spec.ts +0 -0
- package/src/app/{pages → modals}/create-ticket/create-ticket.page.ts +0 -0
- package/src/app/modals/send-email/send-email.page.scss +2 -2
- package/src/app/modals/send-email/send-email.page.ts +5 -0
- package/src/app/pages/conversation-detail/conversation-detail.page.ts +42 -19
- package/src/chat21-core/utils/utils-message.ts +2 -1
- package/src/global.scss +9 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# chat21-ionic ver 3.0
|
|
2
2
|
|
|
3
|
+
### 3.0.90-rc.1
|
|
4
|
+
- added: autofocus on first input
|
|
5
|
+
- added: tiledesk logo on sidebar
|
|
6
|
+
- added: sourceTitle if exist as message info; otherwize show sourcePage info from message attributes
|
|
7
|
+
- added: email icon if chat message is sent also via email
|
|
8
|
+
- changed: default color submit button
|
|
9
|
+
- changed: removed login modal and moved to dashboard login on logout/first login
|
|
10
|
+
- bug-fixed: chinese characters not displayed due to isEmojii function
|
|
11
|
+
- bug-fixed: label not translated in navbar
|
|
12
|
+
|
|
13
|
+
|
|
3
14
|
### 3.0.89 in PROD
|
|
4
15
|
|
|
5
16
|
### 3.0.89-rc.1
|
package/package.json
CHANGED
|
@@ -49,14 +49,14 @@ const routes: Routes = [
|
|
|
49
49
|
path: 'unassigned-conversations',
|
|
50
50
|
loadChildren: () => import('./pages/unassigned-conversations/unassigned-conversations.module').then( m => m.UnassignedConversationsPageModule)
|
|
51
51
|
},
|
|
52
|
-
{
|
|
53
|
-
path: 'create-ticket',
|
|
54
|
-
loadChildren: () => import('./pages/create-ticket/create-ticket.module').then( m => m.CreateTicketPageModule)
|
|
55
|
-
},
|
|
56
52
|
{
|
|
57
53
|
path: 'create-requester',
|
|
58
54
|
loadChildren: () => import('./pages/create-requester/create-requester.module').then( m => m.CreateRequesterPageModule)
|
|
59
55
|
},
|
|
56
|
+
{
|
|
57
|
+
path: 'create-ticket',
|
|
58
|
+
loadChildren: () => import('./modals/create-ticket/create-ticket.module').then( m => m.CreateTicketPageModule)
|
|
59
|
+
},
|
|
60
60
|
{
|
|
61
61
|
path: 'create-canned-response',
|
|
62
62
|
loadChildren: () => import('./modals/create-canned-response/create-canned-response.module').then( m => m.CreateCannedResponsePageModule)
|
package/src/app/app.component.ts
CHANGED
|
@@ -109,6 +109,7 @@ export class AppComponent implements OnInit {
|
|
|
109
109
|
public executedInitializeAppByWatchConnection: boolean = false;
|
|
110
110
|
private isInitialized: boolean = false;
|
|
111
111
|
private version: string;
|
|
112
|
+
public lang: string;
|
|
112
113
|
IS_ONLINE: boolean;
|
|
113
114
|
IS_ON_MOBILE_DEVICE: boolean;
|
|
114
115
|
SUPPORT_MODE: boolean;
|
|
@@ -575,9 +576,11 @@ export class AppComponent implements OnInit {
|
|
|
575
576
|
}
|
|
576
577
|
else {
|
|
577
578
|
this.logger.log('[APP-COMP] tranlatedLanguage not includes', chat_lang, ': ', tranlatedLanguage.includes(chat_lang))
|
|
579
|
+
chat_lang = 'en'
|
|
578
580
|
this.translate.setDefaultLang('en');
|
|
579
581
|
this.translate.use('en');
|
|
580
582
|
}
|
|
583
|
+
this.lang=chat_lang
|
|
581
584
|
|
|
582
585
|
}
|
|
583
586
|
|
|
@@ -746,10 +749,11 @@ export class AppComponent implements OnInit {
|
|
|
746
749
|
this.IS_ONLINE = false;
|
|
747
750
|
// clearTimeout(this.timeModalLogin);
|
|
748
751
|
// this.timeModalLogin = setTimeout(() => {
|
|
749
|
-
if (!this.hadBeenCalledOpenModal) {
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
}
|
|
752
|
+
// if (!this.hadBeenCalledOpenModal) {
|
|
753
|
+
// this.authModal = this.presentModal('initAuthentication');
|
|
754
|
+
// this.hadBeenCalledOpenModal = true;
|
|
755
|
+
// }
|
|
756
|
+
this.goToDashboardLogin()
|
|
753
757
|
// }, 1000);
|
|
754
758
|
}
|
|
755
759
|
}
|
|
@@ -1116,15 +1120,13 @@ export class AppComponent implements OnInit {
|
|
|
1116
1120
|
this.chatManager.goOffLine();
|
|
1117
1121
|
|
|
1118
1122
|
this.router.navigateByUrl('conversation-detail/'); //redirect to basePage
|
|
1119
|
-
|
|
1123
|
+
this.goToDashboardLogin()
|
|
1120
1124
|
|
|
1121
|
-
|
|
1122
|
-
// this.
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
}
|
|
1127
|
-
// }, 1000);
|
|
1125
|
+
|
|
1126
|
+
// if (!this.hadBeenCalledOpenModal) {
|
|
1127
|
+
// this.authModal = this.presentModal('goOffLine');
|
|
1128
|
+
// this.hadBeenCalledOpenModal = true
|
|
1129
|
+
// }
|
|
1128
1130
|
|
|
1129
1131
|
// this.unsubscribe$.next();
|
|
1130
1132
|
// this.unsubscribe$.complete();
|
|
@@ -1132,7 +1134,7 @@ export class AppComponent implements OnInit {
|
|
|
1132
1134
|
}
|
|
1133
1135
|
|
|
1134
1136
|
goToDashboardLogin(){
|
|
1135
|
-
let DASHBOARD_URL = this.appConfigProvider.getConfig().dashboardUrl + '
|
|
1137
|
+
let DASHBOARD_URL = this.appConfigProvider.getConfig().dashboardUrl + '#/login'
|
|
1136
1138
|
const myWindow = window.open(DASHBOARD_URL, '_self');
|
|
1137
1139
|
myWindow.focus();
|
|
1138
1140
|
}
|
package/src/app/app.module.ts
CHANGED
|
@@ -82,10 +82,12 @@ import { AppStorageService } from 'src/chat21-core/providers/abstract/app-storag
|
|
|
82
82
|
import { ConversationListPageModule } from './pages/conversations-list/conversations-list.module';
|
|
83
83
|
import { ConversationDetailPageModule } from './pages/conversation-detail/conversation-detail.module';
|
|
84
84
|
import { LoginPageModule } from './pages/authentication/login/login.module';
|
|
85
|
-
import { LoaderPreviewPageModule } from './modals/loader-preview/loader-preview.module';
|
|
86
|
-
import { CreateTicketPageModule } from './pages/create-ticket/create-ticket.module';
|
|
87
85
|
import { CreateRequesterPageModule } from './pages/create-requester/create-requester.module';
|
|
86
|
+
// MODALS
|
|
87
|
+
import { LoaderPreviewPageModule } from './modals/loader-preview/loader-preview.module';
|
|
88
|
+
import { CreateTicketPageModule } from './modals/create-ticket/create-ticket.module';
|
|
88
89
|
import { CreateCannedResponsePageModule } from './modals/create-canned-response/create-canned-response.module';
|
|
90
|
+
import { SendEmailModalModule } from './modals/send-email/send-email.module';
|
|
89
91
|
// UTILS
|
|
90
92
|
import { ScrollbarThemeModule } from './utils/scrollbar-theme.directive';
|
|
91
93
|
import { SharedModule } from 'src/app/shared/shared.module';
|
|
@@ -102,7 +104,7 @@ import { ConnectionService } from 'ng-connection-service';
|
|
|
102
104
|
import { WebSocketJs } from './services/websocket/websocket-js';
|
|
103
105
|
import { UnassignedConversationsPageModule } from './pages/unassigned-conversations/unassigned-conversations.module';
|
|
104
106
|
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
|
105
|
-
|
|
107
|
+
|
|
106
108
|
|
|
107
109
|
// FACTORIES
|
|
108
110
|
export function createTranslateLoader(http: HttpClient) {
|
|
@@ -209,7 +209,11 @@
|
|
|
209
209
|
|
|
210
210
|
<div class="base_receive sourcePage-container" *ngIf="messageType(MESSAGE_TYPE_OTHERS, message) && message?.attributes?.sourcePage" [class.show]="showSourceInfo && showSourceInfoIndex===i">
|
|
211
211
|
<svg xmlns="http://www.w3.org/2000/svg" height="15px" width="15px" viewBox="0 0 24 24" fill="none"><path _ngcontent-wrg-c96="" d="M0 0h24v24H0V0z" fill="none"></path><path _ngcontent-wrg-c96="" d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zM4 12c0-.61.08-1.21.21-1.78L8.99 15v1c0 1.1.9 2 2 2v1.93C7.06 19.43 4 16.07 4 12zm13.89 5.4c-.26-.81-1-1.4-1.9-1.4h-1v-3c0-.55-.45-1-1-1h-6v-2h2c.55 0 1-.45 1-1V7h2c1.1 0 2-.9 2-2v-.41C17.92 5.77 20 8.65 20 12c0 2.08-.81 3.98-2.11 5.4z"></path></svg>
|
|
212
|
-
<
|
|
212
|
+
<a target="_blank" href="{{message?.attributes?.sourcePage}}" class="truncate">
|
|
213
|
+
<span title="{{message?.attributes?.sourcePage}}" *ngIf="!message?.attributes?.sourceTitle">{{message?.attributes?.sourcePage}}</span>
|
|
214
|
+
<span title="{{message?.attributes?.sourcePage}}" *ngIf="message?.attributes?.sourceTitle">{{message?.attributes?.sourceTitle}}</span>
|
|
215
|
+
</a>
|
|
216
|
+
|
|
213
217
|
</div>
|
|
214
218
|
|
|
215
219
|
<!-- message type:: button && -->
|
|
@@ -17,7 +17,7 @@ import { Platform } from '@ionic/angular'
|
|
|
17
17
|
|
|
18
18
|
import { ModalController } from '@ionic/angular'
|
|
19
19
|
import { EventsService } from 'src/app/services/events-service'
|
|
20
|
-
import { CreateTicketPage } from 'src/app/
|
|
20
|
+
import { CreateTicketPage } from 'src/app/modals/create-ticket/create-ticket.page'
|
|
21
21
|
import { TiledeskService } from 'src/app/services/tiledesk/tiledesk.service'
|
|
22
22
|
import { TYPE_DIRECT, TYPE_SUPPORT_GROUP } from 'src/chat21-core/utils/constants'
|
|
23
23
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core'
|
|
2
2
|
import { ModalController } from '@ionic/angular'
|
|
3
3
|
import { EventsService } from 'src/app/services/events-service'
|
|
4
|
-
import { CreateTicketPage } from 'src/app/
|
|
4
|
+
import { CreateTicketPage } from 'src/app/modals/create-ticket/create-ticket.page'
|
|
5
5
|
import { CustomTranslateService } from 'src/chat21-core/providers/custom-translate.service'
|
|
6
6
|
@Component({
|
|
7
7
|
selector: 'header-conversations-list',
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<ion-navbar class="navbar navbar-absolute">
|
|
2
2
|
<div class="container-fluid">
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
</div>
|
|
3
|
+
<div class="navbar-left">
|
|
4
|
+
<div class="title"> {{translationsMap?.get('LABEL_CHAT')}}</div>
|
|
5
|
+
</div>
|
|
6
6
|
<div class="navbar-right">
|
|
7
7
|
<!-- test site -->
|
|
8
8
|
<ng-container *ngIf="project">
|
|
@@ -59,7 +59,8 @@ export class NavbarComponent implements OnInit {
|
|
|
59
59
|
"NAVBAR.VIEW_ALL_PROJECTS",
|
|
60
60
|
"NAVBAR.ADD_PROJECT",
|
|
61
61
|
"NAVBAR.RECENT_PROJECTS",
|
|
62
|
-
"NAVBAR.OTHER_PROJECTS"
|
|
62
|
+
"NAVBAR.OTHER_PROJECTS",
|
|
63
|
+
"LABEL_CHAT"
|
|
63
64
|
]
|
|
64
65
|
|
|
65
66
|
this.translationsMap = this.translateService.translateLanguage(keys)
|
|
@@ -222,6 +222,20 @@
|
|
|
222
222
|
</li>
|
|
223
223
|
|
|
224
224
|
|
|
225
|
+
<!-- ------------------------------------------- -->
|
|
226
|
+
<!-- LOGO TILEDESK (click)="goToOfficialSite()" -->
|
|
227
|
+
<!-- ------------------------------------------- -->
|
|
228
|
+
<li matTooltipClass="custom-mat-tooltip" matTooltip="Tiledesk" class="logo"
|
|
229
|
+
#tooltip="matTooltip" matTooltipPosition='right' matTooltipHideDelay="100" style="text-align: center;">
|
|
230
|
+
<a target="_blank" href="{{ tiledesk_url }}" class="customAncor">
|
|
231
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="60px" height="40px" x="0px" y="0px" viewBox="0 0 60 60" xml:space="preserve">
|
|
232
|
+
<path fill="#F18876" d="M51.8,28.2h-19c-1.7,0-3-1.3-3-3V6.4c0-1.7-1.3-3-3-3H8c-1.7,0-3,1.3-3,3v22v22c0,1.7,1.3,3,3,3H6.7h3.4 c0.8,0,1.3,0.2,1.9,0.8l2.3,2.3l2.1,2.1c0.8,0.8,1.7,0.8,2.4,0l2.1-2.1l2.3-2.3c0.6-0.6,1.1-0.8,1.9-0.8H52c1.7,0,3-1.3,3-3V31.2 C54.8,29.5,53.5,28.2,51.8,28.2"/>
|
|
233
|
+
<path fill="#E5BBAD" d="M52,24.2H36.8c-1.5,0-2.8-1.3-2.8-2.8V6.2c0-1.5,1.3-2.8,2.8-2.8H52c1.5,0,2.8,1.3,2.8,2.8v15.2 C54.8,22.9,53.5,24.2,52,24.2"/>
|
|
234
|
+
</svg>
|
|
235
|
+
</a>
|
|
236
|
+
</li>
|
|
237
|
+
|
|
238
|
+
|
|
225
239
|
<!-- [_prjct_profile_name]="_prjct_profile_name" [plan_subscription_is_active]="plan_subscription_is_active"
|
|
226
240
|
[plan_name]="plan_name"
|
|
227
241
|
[plan_type]="plan_type"
|
|
@@ -236,41 +250,6 @@
|
|
|
236
250
|
(onCloseUserDetailsSidebar)='onCloseUserDetailsSidebar($event)'>
|
|
237
251
|
</app-sidebar-user-details> -->
|
|
238
252
|
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
253
|
</ul>
|
|
275
254
|
</div>
|
|
276
255
|
</div>
|
|
@@ -57,6 +57,7 @@ export class SidebarComponent implements OnInit {
|
|
|
57
57
|
dashboard_activities_url: string;
|
|
58
58
|
dashboard_history_url: string;
|
|
59
59
|
dashboard_settings_url: string;
|
|
60
|
+
tiledesk_url: string;
|
|
60
61
|
constructor(
|
|
61
62
|
public imageRepoService: ImageRepoService,
|
|
62
63
|
public appStorageService: AppStorageService,
|
|
@@ -107,6 +108,7 @@ export class SidebarComponent implements OnInit {
|
|
|
107
108
|
} else if (USER_ROLE === 'agent') {
|
|
108
109
|
this.dashboard_settings_url = this.DASHBOARD_URL + this.project_id + '/cannedresponses'
|
|
109
110
|
}
|
|
111
|
+
this.tiledesk_url = 'https://www.tiledesk.com'
|
|
110
112
|
|
|
111
113
|
}
|
|
112
114
|
|
|
@@ -96,6 +96,11 @@ export class CreateCannedResponsePage implements OnInit {
|
|
|
96
96
|
if(this.message && (this.message !== '' || this.message !== null)){
|
|
97
97
|
this.cannedFormGroup.patchValue({ message: this.message})
|
|
98
98
|
}
|
|
99
|
+
|
|
100
|
+
const that = this
|
|
101
|
+
setTimeout(() => {
|
|
102
|
+
that.addFocus()
|
|
103
|
+
}, 1500);
|
|
99
104
|
}
|
|
100
105
|
|
|
101
106
|
buildForm() : FormGroup{
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -133,8 +133,8 @@ ion-label.message-placeholder{
|
|
|
133
133
|
justify-content: center;
|
|
134
134
|
|
|
135
135
|
ion-button{
|
|
136
|
-
background-color:
|
|
137
|
-
color
|
|
136
|
+
background-color:rgb(0,86,192);
|
|
137
|
+
color:#f1f4f7;
|
|
138
138
|
border-radius: 4px;
|
|
139
139
|
font-size: 18px;
|
|
140
140
|
height: 46px;
|
|
@@ -44,6 +44,11 @@ export class SendEmailModal implements OnInit {
|
|
|
44
44
|
if(this.msg && (this.msg !== '' || this.msg !== null)){
|
|
45
45
|
this.emailFormGroup.patchValue({ text: this.msg})
|
|
46
46
|
}
|
|
47
|
+
|
|
48
|
+
const that = this
|
|
49
|
+
setTimeout(() => {
|
|
50
|
+
that.addFocus()
|
|
51
|
+
}, 1500);
|
|
47
52
|
}
|
|
48
53
|
|
|
49
54
|
addFocus(){
|
|
@@ -57,7 +57,8 @@ import {
|
|
|
57
57
|
MESSAGE_TYPE_MINE,
|
|
58
58
|
MESSAGE_TYPE_OTHERS,
|
|
59
59
|
URL_SOUND_LIST_CONVERSATION,
|
|
60
|
-
TYPE_DIRECT
|
|
60
|
+
TYPE_DIRECT,
|
|
61
|
+
TYPE_MSG_EMAIL
|
|
61
62
|
} from 'src/chat21-core/utils/constants'
|
|
62
63
|
import {
|
|
63
64
|
checkPlatformIsMobile,
|
|
@@ -77,7 +78,7 @@ import {
|
|
|
77
78
|
import { LoggerService } from 'src/chat21-core/providers/abstract/logger.service'
|
|
78
79
|
import { LoggerInstance } from 'src/chat21-core/providers/logger/loggerInstance'
|
|
79
80
|
|
|
80
|
-
import { Subject } from 'rxjs'
|
|
81
|
+
import { Observable, Subject } from 'rxjs'
|
|
81
82
|
import { takeUntil } from 'rxjs/operators'
|
|
82
83
|
import { TiledeskService } from '../../services/tiledesk/tiledesk.service'
|
|
83
84
|
import { NetworkService } from '../../services/network-service/network.service'
|
|
@@ -924,7 +925,7 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
|
|
|
924
925
|
|
|
925
926
|
}
|
|
926
927
|
|
|
927
|
-
sendEmail(message: string){
|
|
928
|
+
sendEmail(message: string): Observable<boolean>{
|
|
928
929
|
const tiledeskToken= this.tiledeskAuthService.getTiledeskToken();
|
|
929
930
|
const emailFormGroup = {
|
|
930
931
|
to: this.leadInfo.email,
|
|
@@ -932,17 +933,21 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
|
|
|
932
933
|
text: message,
|
|
933
934
|
request_id: this.conversationWith
|
|
934
935
|
}
|
|
936
|
+
let status = new Subject<boolean>();
|
|
935
937
|
this.tiledeskService.sendEmail(tiledeskToken, this.leadInfo.projectId, emailFormGroup).subscribe((res)=> {
|
|
936
938
|
this.logger.debug('[SEND-EMAIL-MODAL] subscribe to sendEmail API response -->', res)
|
|
937
939
|
if(res && res.queued){
|
|
938
940
|
this.presentToast(this.translationsMap.get('SEND_EMAIL_SUCCESS_OFFLINE_MESSAGE'), 'success', '', 2000)
|
|
941
|
+
status.next(true)
|
|
939
942
|
}
|
|
940
943
|
},(error)=> {
|
|
941
944
|
this.logger.error('[SEND-EMAIL-MODAL] subscribe to sendEmail API CALL - ERROR ', error)
|
|
942
945
|
this.presentToast(this.translationsMap.get('SEND_EMAIL_ERROR'), 'danger', '', 2000)
|
|
946
|
+
status.next(false)
|
|
943
947
|
}, ()=> {
|
|
944
948
|
this.logger.log('[SEND-EMAIL-MODAL] subscribe to sendEmail API CALL /* COMPLETE */')
|
|
945
949
|
})
|
|
950
|
+
return status.asObservable();
|
|
946
951
|
}
|
|
947
952
|
|
|
948
953
|
returnSendMessage(e: any) {
|
|
@@ -1011,21 +1016,40 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
|
|
|
1011
1016
|
this.logger.log('[CONVS-DETAIL] - SEND MESSAGE msg: ', msg, ' - messages: ', this.messages, ' - loggedUser: ', this.loggedUser)
|
|
1012
1017
|
|
|
1013
1018
|
if ((msg && msg.trim() !== '') || type !== TYPE_MSG_TEXT) {
|
|
1014
|
-
|
|
1015
|
-
msg,
|
|
1016
|
-
type,
|
|
1017
|
-
metadata,
|
|
1018
|
-
this.conversationWith,
|
|
1019
|
-
this.conversationWithFullname,
|
|
1020
|
-
this.loggedUser.uid,
|
|
1021
|
-
fullname,
|
|
1022
|
-
this.channelType,
|
|
1023
|
-
attributes,
|
|
1024
|
-
)
|
|
1025
|
-
|
|
1019
|
+
|
|
1026
1020
|
if(this.isEmailEnabled && !this.leadIsOnline && this.leadInfo && this.leadInfo.email){
|
|
1027
1021
|
this.logger.log('[CONVS-DETAIL] - SEND MESSAGE --> SENDING EMAIL', msg, this.leadInfo.email)
|
|
1028
|
-
this.sendEmail(msg)
|
|
1022
|
+
this.sendEmail(msg).subscribe(status => {
|
|
1023
|
+
if(status){
|
|
1024
|
+
//SEND MESSAGE ALSO AS EMAIL
|
|
1025
|
+
attributes['channel']= TYPE_MSG_EMAIL
|
|
1026
|
+
}
|
|
1027
|
+
|
|
1028
|
+
this.conversationHandlerService.sendMessage(
|
|
1029
|
+
msg,
|
|
1030
|
+
type,
|
|
1031
|
+
metadata,
|
|
1032
|
+
this.conversationWith,
|
|
1033
|
+
this.conversationWithFullname,
|
|
1034
|
+
this.loggedUser.uid,
|
|
1035
|
+
fullname,
|
|
1036
|
+
this.channelType,
|
|
1037
|
+
attributes,
|
|
1038
|
+
)
|
|
1039
|
+
})
|
|
1040
|
+
}else {
|
|
1041
|
+
//send STANDARD TEXT MESSAGE
|
|
1042
|
+
this.conversationHandlerService.sendMessage(
|
|
1043
|
+
msg,
|
|
1044
|
+
type,
|
|
1045
|
+
metadata,
|
|
1046
|
+
this.conversationWith,
|
|
1047
|
+
this.conversationWithFullname,
|
|
1048
|
+
this.loggedUser.uid,
|
|
1049
|
+
fullname,
|
|
1050
|
+
this.channelType,
|
|
1051
|
+
attributes,
|
|
1052
|
+
)
|
|
1029
1053
|
}
|
|
1030
1054
|
isDevMode()? null : this.segmentNewAgentMessage(this.conversation)
|
|
1031
1055
|
}
|
|
@@ -1161,7 +1185,7 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
|
|
|
1161
1185
|
}
|
|
1162
1186
|
|
|
1163
1187
|
updateLeadInfo(msg){
|
|
1164
|
-
if (msg.attributes && msg.attributes
|
|
1188
|
+
if (msg.attributes && msg.attributes.hasOwnProperty("updateUserFullname")) {
|
|
1165
1189
|
const userFullname = msg.attributes['updateUserFullname'];
|
|
1166
1190
|
this.logger.debug('[CONVS-DETAIL] newMessageAdded --> updateUserFullname', userFullname)
|
|
1167
1191
|
this.conversationWithFullname = userFullname //update info for next sendMessage object
|
|
@@ -1175,7 +1199,7 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
|
|
|
1175
1199
|
this.conversation.attributes['project_name']
|
|
1176
1200
|
)
|
|
1177
1201
|
}
|
|
1178
|
-
if (msg.attributes && msg.attributes
|
|
1202
|
+
if (msg.attributes && msg.attributes.hasOwnProperty("updateUserEmail")) {
|
|
1179
1203
|
const userEmail = msg.attributes['updateUserEmail'];
|
|
1180
1204
|
this.logger.debug('[CONVS-DETAIL] newMessageAdded --> userEmail', userEmail)
|
|
1181
1205
|
this.conversationAvatar = setConversationAvatar(
|
|
@@ -1187,7 +1211,6 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
|
|
|
1187
1211
|
this.conversation.attributes['project_name']
|
|
1188
1212
|
)
|
|
1189
1213
|
this.getLeadDetail()
|
|
1190
|
-
|
|
1191
1214
|
}
|
|
1192
1215
|
}
|
|
1193
1216
|
|
|
@@ -139,7 +139,8 @@ export function isEmojii(message: any){
|
|
|
139
139
|
if(!message) return false;
|
|
140
140
|
const onlyEmojis = message.replace(new RegExp('[\u0000-\u1eeff]', 'g'), '')
|
|
141
141
|
const visibleChars = message.replace(new RegExp('[\n\r\s]+|( )+', 'g'), '')
|
|
142
|
-
|
|
142
|
+
const chineseChars = message.replace(new RegExp('[\u4e00-\u9fa5]', 'g'), '')
|
|
143
|
+
if(onlyEmojis === '' || visibleChars == '' || chineseChars =='') return false
|
|
143
144
|
return (onlyEmojis.length === visibleChars.length && onlyEmojis.length <= 2)
|
|
144
145
|
} catch(e) {
|
|
145
146
|
return false
|
package/src/global.scss
CHANGED
|
@@ -314,7 +314,7 @@ select:-webkit-autofill:focus {
|
|
|
314
314
|
|
|
315
315
|
.sidebar .logo {
|
|
316
316
|
position: relative;
|
|
317
|
-
|
|
317
|
+
margin-top: auto;
|
|
318
318
|
z-index: 4;
|
|
319
319
|
}
|
|
320
320
|
|
|
@@ -447,10 +447,18 @@ select:-webkit-autofill:focus {
|
|
|
447
447
|
margin-top: 0px;
|
|
448
448
|
}
|
|
449
449
|
|
|
450
|
+
.nav-container {
|
|
451
|
+
height: 100%;
|
|
452
|
+
}
|
|
453
|
+
|
|
450
454
|
.nav {
|
|
451
455
|
padding-left: 0;
|
|
452
456
|
margin-bottom: 0;
|
|
453
457
|
list-style: none;
|
|
458
|
+
display: flex;
|
|
459
|
+
flex-direction: column;
|
|
460
|
+
height: 100%;
|
|
461
|
+
|
|
454
462
|
}
|
|
455
463
|
|
|
456
464
|
.nav:before {
|