@chat21/chat21-ionic 3.0.89 → 3.0.90-rc.2

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.
Files changed (32) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/package.json +1 -1
  3. package/src/app/app-routing.module.ts +4 -4
  4. package/src/app/app.component.html +1 -1
  5. package/src/app/app.component.ts +15 -13
  6. package/src/app/app.module.ts +5 -3
  7. package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.html +12 -12
  8. package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.scss +8 -21
  9. package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.ts +2 -2
  10. package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.html +11 -3
  11. package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.scss +44 -0
  12. package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.ts +12 -0
  13. package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.ts +1 -1
  14. package/src/app/components/conversations-list/header-conversations-list/header-conversations-list.component.ts +1 -1
  15. package/src/app/components/navbar/navbar.component.html +3 -3
  16. package/src/app/components/navbar/navbar.component.scss +9 -0
  17. package/src/app/components/navbar/navbar.component.ts +2 -1
  18. package/src/app/components/sidebar/sidebar.component.html +14 -35
  19. package/src/app/components/sidebar/sidebar.component.ts +2 -0
  20. package/src/app/modals/create-canned-response/create-canned-response.page.scss +2 -2
  21. package/src/app/modals/create-canned-response/create-canned-response.page.ts +5 -0
  22. package/src/app/{pages → modals}/create-ticket/create-ticket-routing.module.ts +0 -0
  23. package/src/app/{pages → modals}/create-ticket/create-ticket.module.ts +0 -0
  24. package/src/app/{pages → modals}/create-ticket/create-ticket.page.html +1 -1
  25. package/src/app/{pages → modals}/create-ticket/create-ticket.page.scss +0 -0
  26. package/src/app/{pages → modals}/create-ticket/create-ticket.page.spec.ts +0 -0
  27. package/src/app/{pages → modals}/create-ticket/create-ticket.page.ts +0 -0
  28. package/src/app/modals/send-email/send-email.page.scss +2 -2
  29. package/src/app/modals/send-email/send-email.page.ts +5 -0
  30. package/src/app/pages/conversation-detail/conversation-detail.page.ts +42 -19
  31. package/src/chat21-core/utils/utils-message.ts +2 -1
  32. package/src/global.scss +9 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # chat21-ionic ver 3.0
2
2
 
3
+ ### 3.0.90-rc.2
4
+ - added: info and copy icon on received messages
5
+ - added: flash icon to distinguish chat offline message sent also by email
6
+
7
+ ### 3.0.90-rc.1
8
+ - added: autofocus on first input
9
+ - added: tiledesk logo on sidebar
10
+ - added: sourceTitle if exist as message info; otherwize show sourcePage info from message attributes
11
+ - added: email icon if chat message is sent also via email
12
+ - changed: default color submit button
13
+ - changed: removed login modal and moved to dashboard login on logout/first login
14
+ - bug-fixed: chinese characters not displayed due to isEmojii function
15
+ - bug-fixed: label not translated in navbar
16
+
17
+
3
18
  ### 3.0.89 in PROD
4
19
 
5
20
  ### 3.0.89-rc.1
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@chat21/chat21-ionic",
3
3
  "author": "Tiledesk SRL",
4
- "version": "3.0.89",
4
+ "version": "3.0.90-rc.2",
5
5
  "license": "MIT License",
6
6
  "homepage": "https://tiledesk.com/",
7
7
  "repository": {
@@ -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)
@@ -6,7 +6,7 @@
6
6
  <app-network-offline></app-network-offline>
7
7
 
8
8
 
9
- <app-navbar *ngIf="!IS_ON_MOBILE_DEVICE"
9
+ <app-navbar *ngIf="!IS_ON_MOBILE_DEVICE && lang"
10
10
  [isSoundEnabled]="isSoundEnabled"
11
11
  (onSoundChange)="onSoundChange($event)">
12
12
  </app-navbar>
@@ -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
- this.authModal = this.presentModal('initAuthentication');
751
- this.hadBeenCalledOpenModal = true;
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
- // this.goToDashboardLogin()
1123
+ this.goToDashboardLogin()
1120
1124
 
1121
- // clearTimeout(this.timeModalLogin);
1122
- // this.timeModalLogin = setTimeout(() => {
1123
- if (!this.hadBeenCalledOpenModal) {
1124
- this.authModal = this.presentModal('goOffLine');
1125
- this.hadBeenCalledOpenModal = true
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 + '/index.html'
1137
+ let DASHBOARD_URL = this.appConfigProvider.getConfig().dashboardUrl + '#/login'
1136
1138
  const myWindow = window.open(DASHBOARD_URL, '_self');
1137
1139
  myWindow.focus();
1138
1140
  }
@@ -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
- import { SendEmailModalModule } from './modals/send-email/send-email.module';
107
+
106
108
 
107
109
  // FACTORIES
108
110
  export function createTranslateLoader(http: HttpClient) {
@@ -110,8 +110,12 @@
110
110
 
111
111
  <div class="bubble-container">
112
112
 
113
- <div class="email-logo" *ngIf="message?.attributes?.channel && message?.attributes?.channel === TYPE_MSG_EMAIL">
113
+ <div class="email-logo" *ngIf="message?.attributes?.channel && message?.attributes?.channel.includes(TYPE_MSG_EMAIL)">
114
114
  <ion-icon name="mail"></ion-icon>
115
+ <ion-icon name="flash"
116
+ *ngIf="message?.attributes?.channel.includes('offline_')"
117
+ [ngStyle]="{'color': stylesMap.get('bubbleSentBackground')}">
118
+ </ion-icon>
115
119
  </div>
116
120
 
117
121
  <!--backgroundColor non viene ancora usato -->
@@ -174,18 +178,10 @@
174
178
  (onBeforeMessageRender)="onBeforeMessageRenderFN($event)"
175
179
  (onAfterMessageRender)="onAfterMessageRenderFN($event)"
176
180
  (onElementRendered)="onElementRenderedFN($event)"
177
- (click)="onBubbleMessageClick($event, message, i)">
181
+ (onCopy)="onClickCopyMesage($event)"
182
+ (onInfo)="onClickInfoMesage($event, i)">
178
183
  </chat-bubble-message>
179
184
 
180
- <div class="options-container">
181
- <div class="copy-logo" (click)="onClickCopyMesage($event, message)" *ngIf="message.text.trim() !== ''">
182
- <ion-icon name="copy-outline"></ion-icon>
183
- </div>
184
- <!-- <div class="menu-logo" (click)="onClickBubbleMenu($event, message)">
185
- <ion-icon name="caret-down"></ion-icon>
186
- </div> -->
187
- </div>
188
-
189
185
  </div>
190
186
 
191
187
  <ng-container *ngIf="areVisibleCAR && supportMode">
@@ -209,7 +205,11 @@
209
205
 
210
206
  <div class="base_receive sourcePage-container" *ngIf="messageType(MESSAGE_TYPE_OTHERS, message) && message?.attributes?.sourcePage" [class.show]="showSourceInfo && showSourceInfoIndex===i">
211
207
  <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
- <span title="{{message?.attributes?.sourcePage}}" class="truncate"><a target="_blank" href="{{message?.attributes?.sourcePage}}">{{message?.attributes?.sourcePage}}</a></span>
208
+ <a target="_blank" href="{{message?.attributes?.sourcePage}}" class="truncate">
209
+ <span title="{{message?.attributes?.sourcePage}}" *ngIf="!message?.attributes?.sourceTitle">{{message?.attributes?.sourcePage}}</span>
210
+ <span title="{{message?.attributes?.sourcePage}}" *ngIf="message?.attributes?.sourceTitle">{{message?.attributes?.sourceTitle}}</span>
211
+ </a>
212
+
213
213
  </div>
214
214
 
215
215
  <!-- message type:: button && -->
@@ -211,6 +211,14 @@ ion-item {
211
211
  height: 16px;
212
212
  border-radius: 3px;
213
213
  color: rgb(135, 150, 175);
214
+
215
+ ion-icon[name="flash"]{
216
+ position: absolute;
217
+ top: -5px;
218
+ left: -4px;
219
+ color: var(--bubble-blue);
220
+ font-size: small;
221
+ }
214
222
  }
215
223
 
216
224
  }
@@ -321,27 +329,6 @@ ion-item {
321
329
  }
322
330
  }
323
331
 
324
- .copy-logo{
325
- // background-color: var(--list-bkg-color);
326
- // box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.4);
327
- // position: relative;
328
- // display: flex;
329
- // -webkit-box-align: center;
330
- // align-items: center;
331
- // -webkit-box-pack: center;
332
- // justify-content: center;
333
- // top: 0px;
334
- // right: 50px;
335
- // z-index: 2;
336
- width: 20px;
337
- border-radius: 3px;
338
- color: rgb(135, 150, 175);
339
-
340
- &:hover{
341
- cursor: pointer;
342
- }
343
- }
344
-
345
332
  }
346
333
 
347
334
  .sourcePage-container{
@@ -156,13 +156,13 @@ export class IonConversationDetailComponent extends ConversationContentComponent
156
156
  this.presentPopover(event, message)
157
157
  }
158
158
 
159
- onClickCopyMesage(event, message: MessageModel){
159
+ onClickCopyMesage(message: MessageModel){
160
160
  this.logger.log('[CONVS-DETAIL][ION-CONVS-DETAIL] - onClickCopyMesage');
161
161
  navigator.clipboard.writeText(message.text)
162
162
  this.presentToast()
163
163
  }
164
164
 
165
- onBubbleMessageClick(event: any, message: MessageModel, index: number){
165
+ onClickInfoMesage(message: MessageModel, index: number){
166
166
  if(message && message.attributes && message.attributes.sourcePage){
167
167
  this.showSourceInfo = !this.showSourceInfo
168
168
  this.showSourceInfoIndex = index
@@ -2,10 +2,18 @@
2
2
  <!-- [ngStyle]="{'padding': (isImage(message) || isFrame(message))?'0px':'0 8px'}" -->
3
3
  <!-- isImage >{{isImage(message) }} message.metadata.width {{message?.metadata?.width }} -->
4
4
  <!-- 'width': (isImage(message) || isFrame(message))? sizeImage?.width : null -->
5
- <div id="bubble-message" [ngStyle]="{'padding': (isImage(message) || isFrame(message))?'0px':'0 8px' }" class="messages primary-color">
5
+ <div id="bubble-message" [ngStyle]="{'padding': (isImage(message) || isFrame(message))?'0px':'0 8px' }" class="messages primary-color">
6
6
 
7
+ <div class="options-container" *ngIf="messageType(MESSAGE_TYPE_OTHERS, message)">
8
+ <div class="info-logo" (click)="onClickInfoMessage($event, message)" *ngIf="message?.attributes && message?.attributes?.sourcePage">
9
+ <ion-icon name="information-circle-outline"></ion-icon>
10
+ </div>
11
+ <div class="copy-logo" (click)="onClickCopyMesage($event, message)" *ngIf="message.text.trim() !== '' && (!isImage(message) || !isFrame(message))">
12
+ <ion-icon name="copy-outline"></ion-icon>
13
+ </div>
14
+ </div>
7
15
 
8
- <div>
16
+ <div >
9
17
 
10
18
  <div *ngIf="messageType(MESSAGE_TYPE_OTHERS, message) && !isSameSender"
11
19
  [style.color]="convertColorToRGBA(fontColor, 65)"
@@ -47,7 +55,7 @@
47
55
 
48
56
 
49
57
  <!-- [tooltip]="timeTooltipLeft" [options]="tooltipOptions" placement="left" content-type="template" (click)="handleTooltipEvents($event)" -->
50
- <div *ngIf="message?.text">
58
+ <div *ngIf="message?.text" style="display: flex; margin: 0px 0px 0px 0px;">
51
59
 
52
60
  <chat-text *ngIf="message?.type !=='html'"
53
61
  [text]="message?.text"
@@ -5,12 +5,56 @@
5
5
  border-radius: 8px;
6
6
  padding: 0;
7
7
  word-wrap: break-word;
8
+ position: relative;
8
9
  // padding: 14px;
9
10
  // padding: 6px 6px 6px 6px;
10
11
  // box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
11
12
  // -webkit-animation: heartbeat 1.5s ease-in-out both;
12
13
  // animation: heartbeat 1.5s ease-in-out both;
13
14
 
15
+ &:hover{
16
+ .options-container > .copy-logo{
17
+ // display: flex;
18
+ visibility: visible;
19
+ }
20
+ }
21
+
22
+ .options-container{
23
+ display: flex;
24
+ position: absolute;
25
+ top: 0px;
26
+ right: -40px;
27
+ height: 16px;
28
+ // margin: 5px;
29
+ z-index: 2;
30
+
31
+ .copy-logo,
32
+ .info-logo{
33
+ // display: none;
34
+ display: flex;
35
+ visibility: hidden;
36
+ -webkit-box-align: center;
37
+ align-items: center;
38
+ -webkit-box-pack: center;
39
+ /* width: 20px; */
40
+ height: 16px;
41
+ border-radius: 3px;
42
+ color: rgb(135, 150, 175);
43
+ text-align: left;
44
+ justify-content: center;
45
+ font-size: initial;
46
+
47
+ &:hover{
48
+ cursor: pointer;
49
+ }
50
+ }
51
+
52
+ .info-logo{
53
+ display: flex;
54
+ visibility: visible;
55
+ }
56
+ }
57
+
14
58
  .message_sender_fullname{
15
59
  font-size: 12px;
16
60
  font-weight: 600;
@@ -25,6 +25,9 @@ export class BubbleMessageComponent implements OnInit, OnChanges {
25
25
  @Output() onBeforeMessageRender = new EventEmitter();
26
26
  @Output() onAfterMessageRender = new EventEmitter();
27
27
  @Output() onElementRendered = new EventEmitter<{element: string, status: boolean}>();
28
+ @Output() onCopy = new EventEmitter<MessageModel>();
29
+ @Output() onInfo = new EventEmitter<MessageModel>();
30
+
28
31
  isImage = isImage;
29
32
  isFile = isFile;
30
33
  isFrame = isFrame;
@@ -178,6 +181,15 @@ export class BubbleMessageComponent implements OnInit, OnChanges {
178
181
  }, showDelay);
179
182
  }
180
183
 
184
+
185
+ onClickCopyMesage(event, message){
186
+ this.onCopy.emit(message)
187
+ }
188
+
189
+ onClickInfoMessage(event, message){
190
+ this.onInfo.emit(message)
191
+ }
192
+
181
193
  // ========= begin:: event emitter function ============//
182
194
 
183
195
  // returnOpenAttachment(event: String) {
@@ -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/pages/create-ticket/create-ticket.page'
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/pages/create-ticket/create-ticket.page'
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
- <!-- <div class="navbar-left">
4
- left
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">
@@ -49,6 +49,15 @@ ion-navbar{
49
49
 
50
50
  .navbar-left{
51
51
  float: left;
52
+
53
+ display: inline-flex;
54
+ align-items: center;
55
+
56
+ padding-left: 15px;
57
+ }
58
+
59
+ .title{
60
+ font-size: 18px;
52
61
  }
53
62
 
54
63
  .simulate-visitor-btn{
@@ -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
 
@@ -144,8 +144,8 @@
144
144
  justify-content: center;
145
145
 
146
146
  ion-button{
147
- background-color: #f1f4f7;
148
- color: rgb(98, 112, 139);
147
+ background-color:rgb(0,86,192);
148
+ color:#f1f4f7;
149
149
  border-radius: 4px;
150
150
  font-size: 18px;
151
151
  height: 46px;
@@ -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{
@@ -1,4 +1,4 @@
1
- <ion-header>
1
+ <ion-header no-border class="ion-no-border">
2
2
  <ion-toolbar>
3
3
  <ion-title>{{'CreateTicket' | translate}}</ion-title>
4
4
  <ion-buttons slot="end">
@@ -133,8 +133,8 @@ ion-label.message-placeholder{
133
133
  justify-content: center;
134
134
 
135
135
  ion-button{
136
- background-color: #f1f4f7;
137
- color: rgb(98, 112, 139);
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
- this.conversationHandlerService.sendMessage(
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']= 'offline_'+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['updateUserFullname']) {
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['updateUserEmail']) {
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
- if(onlyEmojis === '' || visibleChars == '') return false
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
- padding: 13px 15px;
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 {