@chat21/chat21-ionic 3.0.90-rc.4 → 3.0.90-rc.6

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 (42) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/README.md +7 -1
  3. package/package.json +1 -1
  4. package/src/app/app.component.ts +11 -16
  5. package/src/app/app.module.ts +5 -3
  6. package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.scss +4 -2
  7. package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.ts +4 -3
  8. package/src/app/chatlib/conversation-detail/message/info-message/info-message.component.html +5 -5
  9. package/src/app/chatlib/conversation-detail/message/info-message/info-message.component.scss +6 -0
  10. package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.html +9 -1
  11. package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.scss +56 -0
  12. package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.ts +2 -0
  13. package/src/app/components/sidebar/sidebar.component.html +2 -2
  14. package/src/app/pages/conversation-detail/conversation-detail.page.html +2 -1
  15. package/src/app/pages/conversation-detail/conversation-detail.page.ts +14 -1
  16. package/src/app/pages/conversations-list/conversations-list.page.ts +1 -1
  17. package/src/app/services/scripts/script.service.spec.ts +12 -0
  18. package/src/app/services/scripts/script.service.ts +71 -0
  19. package/src/assets/i18n/ar.json +3 -1
  20. package/src/assets/i18n/az.json +3 -1
  21. package/src/assets/i18n/de.json +3 -1
  22. package/src/assets/i18n/en.json +3 -1
  23. package/src/assets/i18n/es.json +3 -1
  24. package/src/assets/i18n/fr.json +3 -1
  25. package/src/assets/i18n/it.json +3 -1
  26. package/src/assets/i18n/kk.json +3 -1
  27. package/src/assets/i18n/pt.json +3 -1
  28. package/src/assets/i18n/ru.json +3 -1
  29. package/src/assets/i18n/sr.json +3 -1
  30. package/src/assets/i18n/sv.json +3 -1
  31. package/src/assets/i18n/tr.json +3 -1
  32. package/src/assets/i18n/uk.json +3 -1
  33. package/src/assets/i18n/uz.json +3 -1
  34. package/src/chat-config-pre.json +1 -0
  35. package/src/chat-config-template.json +1 -0
  36. package/src/chat-config.json +1 -0
  37. package/src/chat21-core/providers/firebase/firebase-conversation-handler.ts +12 -2
  38. package/src/chat21-core/providers/mqtt/mqtt-conversation-handler.ts +14 -4
  39. package/src/chat21-core/providers/mqtt/mqtt-conversations-handler.ts +3 -1
  40. package/src/chat21-core/utils/constants.ts +2 -1
  41. package/src/global.scss +10 -0
  42. package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component_2.html +0 -116
package/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # chat21-ionic ver 3.0
2
2
 
3
+ ### 3.0.90-rc.6
4
+ - changed: dimension of bottom tiledesk logo in left sidebar
5
+ - removed: isDev control
6
+
7
+ ### 3.0.90-rc.5
8
+ - added: implementation of conversationChangedDetailed in MQTTConversationsHandler service
9
+ - added: LIVE_PAGE info-message type
10
+ - added: live page info in conversation. header (work in progress)
11
+ - changed: info-message UI
12
+ - bug-fixed: options-container not has transparent background if one emotion is present
13
+ - bug-fixed: modals not closed on ESC keyboard button
14
+ - removed: forward of logs to server
15
+
3
16
  ### 3.0.90-rc.4
4
17
  - added: splitMessage in MQTTConversationHandler service
5
18
  - changed: aligned FirebaseConversationHandler service to widget
package/README.md CHANGED
@@ -74,6 +74,7 @@ Use [Docker Compose Tiledesk installation guide](https://github.com/Tiledesk/til
74
74
  production: false,
75
75
  remoteConfig: true,
76
76
  remoteConfigUrl: '/chat-config.json',
77
+ globalRemoteJSSrc: "https://<YOUR_CUSTOM_SCRIPT_1>, https://<YOUR_CUSTOM_SCRIPT_2>"
77
78
  chatEngine: "mqtt", // OR YOUR CUSTOM CHAT ENGINE
78
79
  updloaEngine: "native", // OR YOUR CUSTOM UPLOAD ENGINE
79
80
  pushEngine:"none", // OR YOUR CUSTOM PUSH ENGINE
@@ -106,7 +107,12 @@ Use [Docker Compose Tiledesk installation guide](https://github.com/Tiledesk/til
106
107
  }
107
108
  };
108
109
  ```
109
-
110
+
111
+ # Load external scripts
112
+
113
+
114
+ * `globalRemoteJSSrc`: load external scripts by setting a comma separated script string url.
115
+
110
116
  * `logLevel`: The Chat21-ionic supports 4 log levels. The order is as follows:
111
117
  `Error < Warn < Info < Debug`
112
118
 
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.90-rc.4",
4
+ "version": "3.0.90-rc.6",
5
5
  "license": "MIT License",
6
6
  "homepage": "https://tiledesk.com/",
7
7
  "repository": {
@@ -60,6 +60,7 @@ import * as PACKAGE from 'package.json';
60
60
  import { filter } from 'rxjs/operators'
61
61
  import { WebSocketJs } from './services/websocket/websocket-js';
62
62
  import { Location } from '@angular/common'
63
+ import { ScriptService } from './services/scripts/script.service';
63
64
 
64
65
  // import { filter } from 'rxjs/operators';
65
66
 
@@ -153,6 +154,7 @@ export class AppComponent implements OnInit {
153
154
  // private tiledeskService: TiledeskService,
154
155
  private networkService: NetworkService,
155
156
  public webSocketJs: WebSocketJs,
157
+ public scriptService: ScriptService,
156
158
  public location: Location
157
159
  ) {
158
160
 
@@ -341,7 +343,7 @@ export class AppComponent implements OnInit {
341
343
 
342
344
 
343
345
  this.initializeApp('oninit');
344
- this.initSegment()
346
+ this.loadCustomScript(appconfig)
345
347
  this.listenToPostMsgs();
346
348
  }
347
349
 
@@ -1045,7 +1047,7 @@ export class AppComponent implements OnInit {
1045
1047
  this.logger.log('[APP-COMP] ***** conversationRemoved *****', conversation);
1046
1048
  if(conversation) {
1047
1049
  this.updateConversationsOnStorage();
1048
- isDevMode()? null: this.segmentResolved(conversation)
1050
+ this.segmentResolved(conversation)
1049
1051
  }
1050
1052
  });
1051
1053
  }
@@ -1091,7 +1093,7 @@ export class AppComponent implements OnInit {
1091
1093
 
1092
1094
  this.initConversationsHandler(currentUser.uid);
1093
1095
  this.initArchivedConversationsHandler(currentUser.uid);
1094
- isDevMode()? null: this.segmentSignIn()
1096
+ this.segmentSignIn()
1095
1097
  }
1096
1098
  this.checkPlatform();
1097
1099
  try {
@@ -1198,7 +1200,7 @@ export class AppComponent implements OnInit {
1198
1200
 
1199
1201
 
1200
1202
  if (hasClickedLogout === true) {
1201
- isDevMode()? null: this.segmentSignedOut()
1203
+ this.segmentSignedOut()
1202
1204
  this.appStorageService.removeItem('conversations')
1203
1205
  this.isInitialized = false;
1204
1206
  // ----------------------------------------------
@@ -1292,7 +1294,7 @@ export class AppComponent implements OnInit {
1292
1294
  }
1293
1295
 
1294
1296
  private initConversationsHandler(userId: string) {
1295
- const keys = ['YOU', 'INFO_A_NEW_SUPPORT_REQUEST_HAS_BEEN_ASSIGNED_TO_YOU'];
1297
+ const keys = ['YOU'];
1296
1298
  const translationMap = this.translateService.translateLanguage(keys);
1297
1299
 
1298
1300
  this.logger.log('[APP-COMP] initConversationsHandler ------------->', userId, this.tenant);
@@ -1346,17 +1348,10 @@ export class AppComponent implements OnInit {
1346
1348
  }
1347
1349
  }
1348
1350
 
1349
- private initSegment(){
1350
- if(!isDevMode()){
1351
- var head = document.getElementsByTagName('head')[0];
1352
- var script = document.createElement('script');
1353
- script.type="text/javascript";
1354
- script.text =`!function(){var analytics=window.analytics=window.analytics||[];if(!analytics.initialize)if(analytics.invoked)window.console&&console.error&&console.error("Segment snippet included twice.");else{analytics.invoked=!0;analytics.methods=["trackSubmit","trackClick","trackLink","trackForm","pageview","identify","reset","group","track","ready","alias","debug","page","once","off","on","addSourceMiddleware","addIntegrationMiddleware","setAnonymousId","addDestinationMiddleware"];analytics.factory=function(e){return function(){var t=Array.prototype.slice.call(arguments);t.unshift(e);analytics.push(t);return analytics}};for(var e=0;e<analytics.methods.length;e++){var key=analytics.methods[e];analytics[key]=analytics.factory(key)}analytics.load=function(key,e){var t=document.createElement("script");t.type="text/javascript";t.async=!0;t.src="https://cdn.segment.com/analytics.js/v1/" + key + "/analytics.min.js";var n=document.getElementsByTagName("script")[0];n.parentNode.insertBefore(t,n);analytics._loadOptions=e};analytics._writeKey="qaTU0wG6VH6xPAhOzD2kneI70Txg1fTB";;analytics.SNIPPET_VERSION="4.15.3";
1355
- analytics.load("qaTU0wG6VH6xPAhOzD2kneI70Txg1fTB");
1356
- analytics.page();
1357
- }}();`
1358
- head.appendChild(script);
1359
- }
1351
+ private loadCustomScript(config){
1352
+ if(config.hasOwnProperty("globalRemoteJSSrc")){
1353
+ this.scriptService.buildScriptArray(config['globalRemoteJSSrc'])
1354
+ }
1360
1355
  }
1361
1356
 
1362
1357
  private segmentSignIn(){
@@ -1,3 +1,4 @@
1
+ import { ScriptService } from './services/scripts/script.service';
1
2
  import { ConvertRequestToConversation } from './../chat21-core/utils/convertRequestToConversation';
2
3
  import { LogLevel, PUSH_ENGINE_FIREBASE, PUSH_ENGINE_MQTT } from './../chat21-core/utils/constants';
3
4
  import { CustomLogger } from 'src/chat21-core/providers/logger/customLogger';
@@ -280,12 +281,12 @@ const appInitializerFn = (appConfig: AppConfigProvider, logger: NGXLogger) => {
280
281
  }),
281
282
  LoggerModule.forRoot({
282
283
  level: NgxLoggerLevel.DEBUG,
283
- serverLogLevel: NgxLoggerLevel.ERROR,
284
+ // serverLogLevel: NgxLoggerLevel.ERROR,
284
285
  timestampFormat: 'HH:mm:ss.SSS',
285
286
  enableSourceMaps: false,
286
287
  disableFileDetails: true,
287
288
  colorScheme: ['purple', 'yellow', 'gray', 'gray', 'red', 'red', 'red'],
288
- serverLoggingUrl: 'https://tiledesk-server-pre.herokuapp.com/logs'
289
+ // serverLoggingUrl: 'https://tiledesk-server-pre.herokuapp.com/logs'
289
290
  }),
290
291
  ScrollbarThemeModule,
291
292
  SharedModule,
@@ -377,7 +378,8 @@ const appInitializerFn = (appConfig: AppConfigProvider, logger: NGXLogger) => {
377
378
  Chooser,
378
379
  Chat21Service,
379
380
  WebSocketJs,
380
- ConvertRequestToConversation
381
+ ConvertRequestToConversation,
382
+ ScriptService
381
383
  ]
382
384
  })
383
385
  export class AppModule { }
@@ -35,7 +35,8 @@
35
35
 
36
36
 
37
37
  //------- MANAGE CHAT-OPTIONS component :: INIT ------- //
38
- :host .base_sent .msg_sent.no-background ::ng-deep > div{
38
+ :host .base_sent .msg_sent.no-background ::ng-deep > div,
39
+ :host .base_sent .msg_sent.emoticon ::ng-deep > div{
39
40
  .options-container{
40
41
  background: transparent;
41
42
 
@@ -46,7 +47,8 @@
46
47
 
47
48
  }
48
49
 
49
- :host .base_receive .msg_receive.no-background ::ng-deep > div{
50
+ :host .base_receive .msg_receive.no-background ::ng-deep > div,
51
+ :host .base_receive .msg_receive.emoticon ::ng-deep > div{
50
52
  .options-container{
51
53
  background: transparent;
52
54
 
@@ -111,6 +111,7 @@ export class IonConversationDetailComponent extends ConversationContentComponent
111
111
  } else if (this.browserLang && stored_preferred_lang) {
112
112
  chat_lang = stored_preferred_lang
113
113
  }
114
+
114
115
  moment.locale(chat_lang)
115
116
  // this.translate.getTranslation(chat_lang).subscribe((labels: string) => {
116
117
  // console.log('[CONVS-DETAIL] translations: ', labels);
@@ -211,7 +212,7 @@ export class IonConversationDetailComponent extends ConversationContentComponent
211
212
  component: CreateCannedResponsePage,
212
213
  componentProps: attributes,
213
214
  swipeToClose: false,
214
- backdropDismiss: false,
215
+ backdropDismiss: true,
215
216
  })
216
217
  modal.onDidDismiss().then((dataReturned: any) => {
217
218
  //
@@ -231,8 +232,8 @@ export class IonConversationDetailComponent extends ConversationContentComponent
231
232
  cssClass: 'json-modal-class',
232
233
  componentProps: attributes,
233
234
  swipeToClose: false,
234
- backdropDismiss: false,
235
- keyboardClose: true,
235
+ backdropDismiss: true,
236
+ // keyboardClose: true,
236
237
  })
237
238
  modal.onDidDismiss().then((dataReturned: any) => {
238
239
  //
@@ -1,20 +1,20 @@
1
1
  <div class="info-container">
2
- <!-- <div class="spinner">
2
+ <div class="spinner">
3
3
  <div class="bounce3"></div>
4
4
  <div class="bounce2"></div>
5
5
  <div class="bounce1"></div>
6
- </div> -->
6
+ </div>
7
7
 
8
- <div>
8
+ <div style="max-width: 70%;">
9
9
  <span class="base_info" [innerHTML]="message?.text | marked" [options]="tooltipOptions" [tooltip]="timeTooltipLeft" placement="left" content-type="template"></span>
10
10
  <ng-template #timeTooltipLeft>
11
11
  <span>{{message.timestamp | amTimeAgo}} ({{message.timestamp | amLocal | amDateFormat: 'L HH:mm:ss'}})</span>
12
12
  </ng-template>
13
13
  </div>
14
14
 
15
- <!-- <div class="spinner">
15
+ <div class="spinner">
16
16
  <div class="bounce1"></div>
17
17
  <div class="bounce2"></div>
18
18
  <div class="bounce3"></div>
19
- </div> -->
19
+ </div>
20
20
  </div>
@@ -3,6 +3,7 @@
3
3
  align-content: center;
4
4
  justify-content: center;
5
5
  padding: 4px 0px 2px 0px;
6
+ width: 100%;
6
7
  }
7
8
 
8
9
  .base_info {
@@ -17,6 +18,11 @@
17
18
  color: var(--basic-gray);
18
19
  margin-left: 5px; //32px;
19
20
  margin-right: 5px; //32px;
21
+
22
+ a {
23
+ word-break: break-all;
24
+ }
25
+
20
26
 
21
27
  }
22
28
 
@@ -63,10 +63,18 @@
63
63
  </div>
64
64
  </div>
65
65
 
66
-
66
+ <!-- <div>
67
+ <ion-button class="live" ion-button color="danger">
68
+ <span class="live-icon"></span>
69
+ <span class="live-text">{{translationsMap.get('LIVE')}}</span>
70
+ <span class="live-content">source page</span>
71
+ </ion-button>
72
+ </div> -->
67
73
 
68
74
 
69
75
  </div>
76
+
77
+
70
78
 
71
79
 
72
80
  <!-- <div *ngIf="conversationWithFullname" class="tile-info-with" (click)="onOpenCloseInfoConversation()">
@@ -222,4 +222,60 @@ ion-header {
222
222
  left: 63px;
223
223
  }
224
224
 
225
+ ion-button.live{
226
+ --padding-end: 0px;
227
+ --padding-start: 5px;
228
+
229
+ span.live-icon{
230
+ display: inline-block;
231
+ position: relative;
232
+ // top: calc(50% - 5px);
233
+ background-color: white;
234
+ width: 10px;
235
+ height: 10px;
236
+ margin-left: 5px;
237
+ margin-right: 5px;
238
+ border: 1px solid rgba(black, .1);
239
+ border-radius: 50%;
240
+ z-index: 1;
241
+ &:before{
242
+ content: '';
243
+ display: block;
244
+ position: absolute;
245
+ background-color: rgba(white,.6);
246
+ width: 100%;
247
+ height: 100%;
248
+ border-radius: 50%;
249
+ animation: live 2s ease-in-out infinite;
250
+ z-index: -1;
251
+ }
252
+ }
253
+
254
+ span.live-text{
255
+ color: white;
256
+ margin-left: 5px;
257
+ margin-right: 5px;
258
+ }
259
+
260
+ span.live-content{
261
+ background-color: white;
262
+ color: red;
263
+ margin-left: 5px;
264
+ padding: 0px 5px;
265
+ height: 100%;
266
+ display: flex;
267
+ align-items: center;
268
+ }
269
+
270
+ @keyframes live {
271
+ 0% {
272
+ transform: scale(1,1);
273
+ }
274
+ 100% {
275
+ transform: scale(3.5,3.5);
276
+ background-color: rgba(red,0);
277
+ }
278
+ }
279
+ }
280
+
225
281
 
@@ -27,10 +27,12 @@ import { TYPE_DIRECT, TYPE_SUPPORT_GROUP } from 'src/chat21-core/utils/constants
27
27
  styleUrls: ['./header-conversation-detail.component.scss'],
28
28
  })
29
29
  export class HeaderConversationDetailComponent implements OnInit, OnChanges {
30
+
30
31
  @Input() conversationAvatar: any
31
32
  @Input() idLoggedUser: string
32
33
  @Input() conversationUid: string
33
34
  @Input() conv_type: string
35
+ @Input() liveInfo: {sourcePage: string, sourceTitle: string}
34
36
  @Input() isMobile: boolean
35
37
  @Input() translationsMap: Map<string, string>
36
38
  conversationWithFullname: string
@@ -226,9 +226,9 @@
226
226
  <!-- LOGO TILEDESK (click)="goToOfficialSite()" -->
227
227
  <!-- ------------------------------------------- -->
228
228
  <li matTooltipClass="custom-mat-tooltip" matTooltip="Tiledesk" class="logo"
229
- #tooltip="matTooltip" matTooltipPosition='right' matTooltipHideDelay="100" style="text-align: center;">
229
+ #tooltip="matTooltip" matTooltipPosition='right' matTooltipHideDelay="100" style="text-align: center;min-height:43px">
230
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">
231
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="60px" height="30px" x="0px" y="0px" viewBox="0 0 60 60" xml:space="preserve">
232
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
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
234
  </svg>
@@ -42,7 +42,8 @@
42
42
  [isMobile]="isMobile"
43
43
  [idLoggedUser]="loggedUser.uid"
44
44
  [conversationUid]="conversationWith"
45
- [conversationAvatar]="conversationAvatar"
45
+ [conversationAvatar]="conversationAvatar"
46
+ [liveInfo]="liveInfo"
46
47
  [translationsMap]="translationsHeaderMap"
47
48
  [conv_type]="conv_type">
48
49
  </app-header-conversation-detail>
@@ -127,6 +127,7 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
127
127
  public translationsContentMap: Map<string, string> = new Map()
128
128
  public conversationAvatar: any
129
129
  public leadInfo: {lead_id: string, hasEmail: boolean , email: string, projectId: string};
130
+ public liveInfo: {sourcePage: string, sourceTitle: string}
130
131
  public member: UserModel
131
132
  public isFileSelected: boolean
132
133
  public showIonContent = false
@@ -650,6 +651,7 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
650
651
  'LABEL_TO',
651
652
  'LABEL_LAST_ACCESS',
652
653
  'ARRAY_DAYS',
654
+ 'LIVE',
653
655
  'Resolve',
654
656
  ]
655
657
 
@@ -682,6 +684,7 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
682
684
  'INFO_SUPPORT_LEAD_UPDATED',
683
685
  'INFO_SUPPORT_MEMBER_LEFT_GROUP',
684
686
  'INFO_SUPPORT_MEMBER_ABANDONED_GROUP',
687
+ 'INFO_SUPPORT_LIVE_PAGE',
685
688
  'LABEL_TODAY',
686
689
  'LABEL_TOMORROW',
687
690
  'LABEL_LAST_ACCESS',
@@ -1051,7 +1054,7 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
1051
1054
  attributes,
1052
1055
  )
1053
1056
  }
1054
- isDevMode()? null : this.segmentNewAgentMessage(this.conversation)
1057
+ this.segmentNewAgentMessage(this.conversation)
1055
1058
  }
1056
1059
  }
1057
1060
  // ----------------------------------------------------------
@@ -1106,6 +1109,7 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
1106
1109
  this.logger.log('[CONVS-DETAIL] subscribe to messageInfo - messageId ', msg, this.conversation)
1107
1110
  if (msg) {
1108
1111
  that.updateLeadInfo(msg)
1112
+ // this.updateLiveInfo(msg)
1109
1113
  // this.setHeaderContent()
1110
1114
  }
1111
1115
  })
@@ -1214,6 +1218,15 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
1214
1218
  }
1215
1219
  }
1216
1220
 
1221
+ updateLiveInfo(msg){
1222
+ if(msg.attributes && msg.attributes.hasOwnProperty("sourcePage")){
1223
+ this.liveInfo = { sourcePage: msg.attributes['sourcePage'], sourceTitle: null}
1224
+ }
1225
+ if(msg.attributes && msg.attributes.hasOwnProperty("sourceTitle")){
1226
+ this.liveInfo = { sourcePage: msg.attributes['sourcePage'], sourceTitle: msg.attributes['sourceTitle']}
1227
+ }
1228
+ }
1229
+
1217
1230
  // ----------------------------------------------------------------
1218
1231
  // @ Unsubscribe all subscribed events (called in ionViewWillLeave)
1219
1232
  // ----------------------------------------------------------------
@@ -501,7 +501,7 @@ export class ConversationListPage implements OnInit {
501
501
  if (conversation) {
502
502
  this.onImageLoaded(conversation)
503
503
  this.onConversationLoaded(conversation)
504
- !isDevMode() && conversation.is_new && this.isInitialized? this.segmentNewConversationAdded(conversation) : null;
504
+ conversation.is_new && this.isInitialized? this.segmentNewConversationAdded(conversation) : null;
505
505
  }
506
506
  })
507
507
 
@@ -0,0 +1,12 @@
1
+ import { TestBed } from '@angular/core/testing';
2
+
3
+ import { ScriptService } from './script.service';
4
+
5
+ describe('ScriptService', () => {
6
+ beforeEach(() => TestBed.configureTestingModule({}));
7
+
8
+ it('should be created', () => {
9
+ const service: ScriptService = TestBed.get(ScriptService);
10
+ expect(service).toBeTruthy();
11
+ });
12
+ });
@@ -0,0 +1,71 @@
1
+ import { HttpClient } from '@angular/common/http';
2
+ import { Injectable } from '@angular/core';
3
+ import { LoggerService } from 'src/chat21-core/providers/abstract/logger.service';
4
+ import { LoggerInstance } from 'src/chat21-core/providers/logger/loggerInstance';
5
+
6
+ @Injectable({
7
+ providedIn: 'root'
8
+ })
9
+ export class ScriptService {
10
+
11
+ private scriptList: Array<{name: string, loaded: boolean, src: string}> = []
12
+ private logger: LoggerService = LoggerInstance.getInstance();
13
+
14
+ constructor(
15
+ public http: HttpClient,
16
+ ) { }
17
+
18
+ buildScriptArray(globalRemoteJSSrc: string){
19
+ this.logger.log('[SCRIPT-SERVICE] buildScriptArray globalRemoteJSSrc ', globalRemoteJSSrc);
20
+ if(!this.isEmpty(globalRemoteJSSrc)){
21
+ var scriptArray = globalRemoteJSSrc.split(",")
22
+
23
+ let count = 0;
24
+ scriptArray.forEach(element => {
25
+ count = count + 1;
26
+ this.scriptList.push({name: element.split('/').pop(), loaded: false, src: element})
27
+ });
28
+ this.logger.log('[SCRIPT-SERVICE] buildScriptArray ', this.scriptList);
29
+ this.load()
30
+
31
+ }
32
+ }
33
+
34
+ load() {
35
+ this.logger.log('[SCRIPT-SERV] load ...scripts ', this.scriptList)
36
+ var promises: any[] = [];
37
+ this.scriptList.forEach((script) => promises.push(this.loadScript(script)));
38
+ return Promise.all(promises).catch((err) => {
39
+ // log that I have an error, return the entire array;
40
+ this.logger.error('A promise failed to resolve', err);
41
+
42
+ });
43
+ }
44
+
45
+
46
+ loadScript(currentScript){
47
+ this.logger.log('[SCRIPT-SERVICE] load script:', currentScript);
48
+ return new Promise((resolve, reject) => {
49
+ //resolve if already loaded
50
+ if (currentScript.loaded) {
51
+ resolve({ script: currentScript.name, loaded: true, status: 'Already Loaded' });
52
+ }
53
+ else {
54
+ //load script
55
+ let script = document.createElement('script')
56
+ script.type = 'text/javascript';
57
+ script.src = currentScript.src;
58
+ script.onload = () => {
59
+ currentScript.loaded = true;
60
+ resolve({ script: name, loaded: true, status: 'Loaded' });
61
+ }
62
+ script.onerror = (error: any) => resolve({ script: currentScript.name, loaded: false, status: 'Loaded' });
63
+ document.getElementsByTagName('head')[0].appendChild(script);
64
+ }
65
+ });
66
+ }
67
+
68
+ isEmpty(url: string) {
69
+ return (url === undefined || url == null || url.length <= 0) ? true : false;
70
+ }
71
+ }
@@ -82,6 +82,7 @@
82
82
  "INFO_SUPPORT_MEMBER_LEFT_GROUP":"تمت إزالته من المجموعة",
83
83
  "INFO_SUPPORT_MEMBER_ABANDONED_GROUP":"وقد غادر المحادثة",
84
84
  "INFO_A_NEW_SUPPORT_REQUEST_HAS_BEEN_ASSIGNED_TO_YOU": "تم تعيين طلب دعم جديد لك",
85
+ "INFO_SUPPORT_LIVE_PAGE": "انتقل ل",
85
86
  "LABEL_PROFILE": "الملف الشخصي",
86
87
  "LABEL_CLOSE": "مغلق",
87
88
  "LABEL_DISCONNECT": "قطع الاتصال",
@@ -290,5 +291,6 @@
290
291
  "RECENT_PROJECTS":"مشاريع حديثه",
291
292
  "OTHER_PROJECTS":"مشاريع أخرى"
292
293
  },
293
- "JSON_RESPONSE":"استجابة JSON"
294
+ "JSON_RESPONSE":"استجابة JSON",
295
+ "LIVE":"حاليا"
294
296
  }
@@ -82,6 +82,7 @@
82
82
  "INFO_SUPPORT_MEMBER_LEFT_GROUP":"qrupdan çıxarıldı",
83
83
  "INFO_SUPPORT_MEMBER_ABANDONED_GROUP":"söhbəti tərk etdi",
84
84
  "INFO_A_NEW_SUPPORT_REQUEST_HAS_BEEN_ASSIGNED_TO_YOU": "Sizə yeni dəstək sorğusu təyin edilib",
85
+ "INFO_SUPPORT_LIVE_PAGE":"Köçürüldü",
85
86
  "LABEL_PROFILE": "Profil",
86
87
  "LABEL_CLOSE": "Bağlı",
87
88
  "LABEL_DISCONNECT": "Bağlantını kəsin",
@@ -290,5 +291,6 @@
290
291
  "RECENT_PROJECTS":"Son layihələr",
291
292
  "OTHER_PROJECTS":"Digər layihələr"
292
293
  },
293
- "JSON_RESPONSE":"JSON cavabı"
294
+ "JSON_RESPONSE":"JSON cavabı",
295
+ "LIVE":"Canlı"
294
296
  }
@@ -82,6 +82,7 @@
82
82
  "INFO_SUPPORT_MEMBER_LEFT_GROUP":"aus der Gruppe entfernt",
83
83
  "INFO_SUPPORT_MEMBER_ABANDONED_GROUP":"hat die Unterhaltung verlassen",
84
84
  "INFO_A_NEW_SUPPORT_REQUEST_HAS_BEEN_ASSIGNED_TO_YOU": "Ihnen wurde eine neue Support-Anfrage zugewiesen",
85
+ "INFO_SUPPORT_LIVE_PAGE":"Umgezogen nach",
85
86
  "LABEL_PROFILE": "Profil",
86
87
  "LABEL_CLOSE": "Abgeschlossen",
87
88
  "LABEL_DISCONNECT": "Trennen",
@@ -290,5 +291,6 @@
290
291
  "RECENT_PROJECTS":"Letzte Projekte",
291
292
  "OTHER_PROJECTS":"Weitere Projekte"
292
293
  },
293
- "JSON_RESPONSE":"JSON Response"
294
+ "JSON_RESPONSE":"JSON Response",
295
+ "LIVE":"Live"
294
296
  }
@@ -82,6 +82,7 @@
82
82
  "INFO_SUPPORT_MEMBER_LEFT_GROUP":"removed from group",
83
83
  "INFO_SUPPORT_MEMBER_ABANDONED_GROUP":"has left the conversation",
84
84
  "INFO_A_NEW_SUPPORT_REQUEST_HAS_BEEN_ASSIGNED_TO_YOU": "A new support request has been assigned to you",
85
+ "INFO_SUPPORT_LIVE_PAGE":"Moved to",
85
86
  "LABEL_PROFILE": "Profile",
86
87
  "LABEL_CLOSE": "Closed",
87
88
  "LABEL_DISCONNECT": "Disconnect",
@@ -290,5 +291,6 @@
290
291
  "RECENT_PROJECTS":"Recent projects",
291
292
  "OTHER_PROJECTS":"Other projects"
292
293
  },
293
- "JSON_RESPONSE":"JSON Response"
294
+ "JSON_RESPONSE":"JSON Response",
295
+ "LIVE":"Live"
294
296
  }
@@ -82,6 +82,7 @@
82
82
  "INFO_SUPPORT_MEMBER_LEFT_GROUP":"eliminado del grupo",
83
83
  "INFO_SUPPORT_MEMBER_ABANDONED_GROUP":"ha abandonado la conversación",
84
84
  "INFO_A_NEW_SUPPORT_REQUEST_HAS_BEEN_ASSIGNED_TO_YOU":"Se le ha asignado una nueva solicitud de soporte",
85
+ "INFO_SUPPORT_LIVE_PAGE":"Trasladado a",
85
86
  "LABEL_PROFILE": "Perfil",
86
87
  "LABEL_CLOSE": "Cerrado",
87
88
  "LABEL_DISCONNECT": "Desconectar",
@@ -290,5 +291,6 @@
290
291
  "RECENT_PROJECTS":"Proyectos recientes",
291
292
  "OTHER_PROJECTS":"Otros proyectos"
292
293
  },
293
- "JSON_RESPONSE":"Respuesta JSON"
294
+ "JSON_RESPONSE":"Respuesta JSON",
295
+ "LIVE":"En Vivo"
294
296
  }
@@ -82,6 +82,7 @@
82
82
  "INFO_SUPPORT_MEMBER_LEFT_GROUP":"supprimé du groupe",
83
83
  "INFO_SUPPORT_MEMBER_ABANDONED_GROUP":"a quitté la conversation",
84
84
  "INFO_A_NEW_SUPPORT_REQUEST_HAS_BEEN_ASSIGNED_TO_YOU": "Une nouvelle demande de support vous a été attribuée",
85
+ "INFO_SUPPORT_LIVE_PAGE":"Déplacé vers",
85
86
  "LABEL_PROFILE": "Profil",
86
87
  "LABEL_CLOSE": "Fermé",
87
88
  "LABEL_DISCONNECT": "Déconnecter",
@@ -290,5 +291,6 @@
290
291
  "RECENT_PROJECTS":"Les projets récents",
291
292
  "OTHER_PROJECTS":"Autres projets"
292
293
  },
293
- "JSON_RESPONSE":"Réponse JSON"
294
+ "JSON_RESPONSE":"Réponse JSON",
295
+ "LIVE":"En direct"
294
296
  }
@@ -82,6 +82,7 @@
82
82
  "INFO_SUPPORT_MEMBER_LEFT_GROUP":"rimosso dal gruppo",
83
83
  "INFO_SUPPORT_MEMBER_ABANDONED_GROUP": "ha abbandonato la conversazione",
84
84
  "INFO_A_NEW_SUPPORT_REQUEST_HAS_BEEN_ASSIGNED_TO_YOU":"Una nuova richiesta di supporto è stata assegnata a te",
85
+ "INFO_SUPPORT_LIVE_PAGE":"Spostato in",
85
86
  "LABEL_PROFILE": "Profilo",
86
87
  "LABEL_CLOSE": "Chiusa",
87
88
  "LABEL_DISCONNECT": "Disconnetti",
@@ -290,5 +291,6 @@
290
291
  "RECENT_PROJECTS":"Progetti recenti",
291
292
  "OTHER_PROJECTS":"Altri progetti"
292
293
  },
293
- "JSON_RESPONSE":"JSON di risposta"
294
+ "JSON_RESPONSE":"JSON di risposta",
295
+ "LIVE":"Live"
294
296
  }
@@ -82,6 +82,7 @@
82
82
  "INFO_SUPPORT_MEMBER_LEFT_GROUP":"топтан шығарылды",
83
83
  "INFO_SUPPORT_MEMBER_ABANDONED_GROUP":"әңгімеден шығып кетті",
84
84
  "INFO_A_NEW_SUPPORT_REQUEST_HAS_BEEN_ASSIGNED_TO_YOU": "Сізге жаңа қолдау сұрауы тағайындалды",
85
+ "INFO_SUPPORT_LIVE_PAGE":"Көшті",
85
86
  "LABEL_PROFILE": "Профиль",
86
87
  "LABEL_CLOSE": "Жабық",
87
88
  "LABEL_DISCONNECT": "Ажырату",
@@ -290,5 +291,6 @@
290
291
  "RECENT_PROJECTS":"Соңғы жобалар",
291
292
  "OTHER_PROJECTS":"Басқа жобалар"
292
293
  },
293
- "JSON_RESPONSE":"JSON жауабы"
294
+ "JSON_RESPONSE":"JSON жауабы",
295
+ "LIVE": "Тікелей эфир"
294
296
  }
@@ -82,6 +82,7 @@
82
82
  "INFO_SUPPORT_MEMBER_LEFT_GROUP":"removido do grupo",
83
83
  "INFO_SUPPORT_MEMBER_ABANDONED_GROUP":"deixou a conversa",
84
84
  "INFO_A_NEW_SUPPORT_REQUEST_HAS_BEEN_ASSIGNED_TO_YOU": "Uma nova solicitação de suporte foi atribuída a você",
85
+ "INFO_SUPPORT_LIVE_PAGE":"Movido para",
85
86
  "LABEL_PROFILE": "Perfil",
86
87
  "LABEL_CLOSE": "Fechadas",
87
88
  "LABEL_DISCONNECT": "Desconectar",
@@ -290,5 +291,6 @@
290
291
  "RECENT_PROJECTS":"Projetos Recentes",
291
292
  "OTHER_PROJECTS":"Outros projetos"
292
293
  },
293
- "JSON_RESPONSE":"Resposta JSON"
294
+ "JSON_RESPONSE":"Resposta JSON",
295
+ "LIVE":"Ao vivo"
294
296
  }
@@ -82,6 +82,7 @@
82
82
  "INFO_SUPPORT_MEMBER_LEFT_GROUP":"удален из группы",
83
83
  "INFO_SUPPORT_MEMBER_ABANDONED_GROUP":"вышел из беседы",
84
84
  "INFO_A_NEW_SUPPORT_REQUEST_HAS_BEEN_ASSIGNED_TO_YOU": "Вам назначен новый запрос в службу поддержки",
85
+ "INFO_SUPPORT_LIVE_PAGE":"Переехал в",
85
86
  "LABEL_PROFILE": "Профиль",
86
87
  "LABEL_CLOSE": "Закрыто",
87
88
  "LABEL_DISCONNECT": "Отключить",
@@ -290,5 +291,6 @@
290
291
  "RECENT_PROJECTS":"Недавние Проекты",
291
292
  "OTHER_PROJECTS":"Другие проекты"
292
293
  },
293
- "JSON_RESPONSE":"JSON-ответ"
294
+ "JSON_RESPONSE":"JSON-ответ",
295
+ "LIVE":"Жить"
294
296
  }
@@ -82,6 +82,7 @@
82
82
  "INFO_SUPPORT_MEMBER_LEFT_GROUP":"уклоњен из групе",
83
83
  "INFO_SUPPORT_MEMBER_ABANDONED_GROUP":"је напустио разговор",
84
84
  "INFO_A_NEW_SUPPORT_REQUEST_HAS_BEEN_ASSIGNED_TO_YOU": "Додељен вам је нови захтев за подршку",
85
+ "INFO_SUPPORT_LIVE_PAGE":"Преселио у",
85
86
  "LABEL_PROFILE": "Профил",
86
87
  "LABEL_CLOSE": "Затворено",
87
88
  "LABEL_DISCONNECT": "Прекини везу",
@@ -290,5 +291,6 @@
290
291
  "RECENT_PROJECTS":"Недавни пројекти",
291
292
  "OTHER_PROJECTS":"Остали пројекти"
292
293
  },
293
- "JSON_RESPONSE":"ЈСОН одговор"
294
+ "JSON_RESPONSE":"ЈСОН одговор",
295
+ "LIVE":"Уживо"
294
296
  }
@@ -82,6 +82,7 @@
82
82
  "INFO_SUPPORT_MEMBER_LEFT_GROUP":"borttagen från gruppen",
83
83
  "INFO_SUPPORT_MEMBER_ABANDONED_GROUP":"har lämnat konversationen",
84
84
  "INFO_A_NEW_SUPPORT_REQUEST_HAS_BEEN_ASSIGNED_TO_YOU": "En ny supportförfrågan har tilldelats dig",
85
+ "INFO_SUPPORT_LIVE_PAGE":"Flyttade till",
85
86
  "LABEL_PROFILE": "Profil",
86
87
  "LABEL_CLOSE": "Stängd",
87
88
  "LABEL_DISCONNECT": "Koppla ifrån",
@@ -290,5 +291,6 @@
290
291
  "RECENT_PROJECTS":"Nyliga projekt",
291
292
  "OTHER_PROJECTS":"Andra projekt"
292
293
  },
293
- "JSON_RESPONSE":"JSON-svar"
294
+ "JSON_RESPONSE":"JSON-svar",
295
+ "LIVE":"Lev"
294
296
  }
@@ -82,6 +82,7 @@
82
82
  "INFO_SUPPORT_MEMBER_LEFT_GROUP":"gruptan kaldırıldı",
83
83
  "INFO_SUPPORT_MEMBER_ABANDONED_GROUP":"görüşmeden ayrıldı",
84
84
  "INFO_A_NEW_SUPPORT_REQUEST_HAS_BEEN_ASSIGNED_TO_YOU": "Size yeni bir destek talebi atandı",
85
+ "INFO_SUPPORT_LIVE_PAGE":"Şuraya taşındı:",
85
86
  "LABEL_PROFILE": "Profil",
86
87
  "LABEL_CLOSE": "Kapalı",
87
88
  "LABEL_DISCONNECT": "Bağlantıyı kes",
@@ -290,5 +291,6 @@
290
291
  "RECENT_PROJECTS":"Son Projeler",
291
292
  "OTHER_PROJECTS":"Diğer projeler"
292
293
  },
293
- "JSON_RESPONSE":"JSON Yanıtı"
294
+ "JSON_RESPONSE":"JSON Yanıtı",
295
+ "LIVE":"Canlı"
294
296
  }
@@ -82,6 +82,7 @@
82
82
  "INFO_SUPPORT_MEMBER_LEFT_GROUP":"видалено з групи",
83
83
  "INFO_SUPPORT_MEMBER_ABANDONED_GROUP":"залишив бесіду",
84
84
  "INFO_A_NEW_SUPPORT_REQUEST_HAS_BEEN_ASSIGNED_TO_YOU": "Вам призначено новий запит на підтримку",
85
+ "INFO_SUPPORT_LIVE_PAGE":"Переїхав до",
85
86
  "LABEL_PROFILE": "Профіль",
86
87
  "LABEL_CLOSE": "зачинено",
87
88
  "LABEL_DISCONNECT": "Від’єднати",
@@ -290,5 +291,6 @@
290
291
  "RECENT_PROJECTS":"Останні проекти",
291
292
  "OTHER_PROJECTS":"Інші проекти"
292
293
  },
293
- "JSON_RESPONSE":"Відповідь JSON"
294
+ "JSON_RESPONSE":"Відповідь JSON",
295
+ "LIVE":"Жити"
294
296
  }
@@ -83,6 +83,7 @@
83
83
  "INFO_SUPPORT_MEMBER_LEFT_GROUP":"guruhdan olib tashlandi",
84
84
  "INFO_SUPPORT_MEMBER_ABANDONED_GROUP":"suhbatni tark etdi",
85
85
  "INFO_A_NEW_SUPPORT_REQUEST_HAS_BEEN_ASSIGNED_TO_YOU": "Sizga yangi qoʻllab-quvvatlash soʻrovi tayinlandi",
86
+ "INFO_SUPPORT_LIVE_PAGE":"Koʻchirildi",
86
87
  "LABEL_PROFILE": "Profil",
87
88
  "LABEL_CLOSE": "Yopiq",
88
89
  "LABEL_DISCONNECT": "Ulanishni uzing",
@@ -291,5 +292,6 @@
291
292
  "RECENT_PROJECTS":"So'nggi loyihalar",
292
293
  "OTHER_PROJECTS":"Boshqa loyihalar"
293
294
  },
294
- "JSON_RESPONSE":"JSON javobi"
295
+ "JSON_RESPONSE":"JSON javobi",
296
+ "LIVE":"Jonli"
295
297
  }
@@ -1,5 +1,6 @@
1
1
  {
2
2
  "t2y12PruGU9wUtEGzBJfolMIgK": "CAR:T-PAY:T-ANA:T-ACT:T-APP:T-MTT:T",
3
+ "globalRemoteJSSrc":"https://console.tiledesk.com/v2/dashboard/scripts/script_2.js, https://console.tiledesk.com/v2/dashboard/scripts/script_2.js",
3
4
  "chatEngine": "firebase",
4
5
  "uploadEngine": "firebase",
5
6
  "pushEngine": "firebase",
@@ -1,5 +1,6 @@
1
1
  {
2
2
  "t2y12PruGU9wUtEGzBJfolMIgK": "${FEATURES_TOKEN}",
3
+ "globalRemoteJSSrc":"${REMOTE_JS_SRC}",
3
4
  "chatEngine": "${CHAT21_ENGINE}",
4
5
  "uploadEngine": "${UPLOAD_ENGINE}",
5
6
  "pushEngine":"${PUSH_ENGINE}",
@@ -1,5 +1,6 @@
1
1
  {
2
2
  "t2y12PruGU9wUtEGzBJfolMIgK":"${FEATURES_TOKEN}",
3
+ "globalRemoteJSSrc":"${REMOTE_JS_SRC}",
3
4
  "chatEngine": "mqtt",
4
5
  "updloaEngine": "native",
5
6
  "pushEngine":"none",
@@ -18,7 +18,7 @@ import { ConversationHandlerService } from '../abstract/conversation-handler.ser
18
18
  import { LoggerService } from '../abstract/logger.service';
19
19
  import { LoggerInstance } from '../logger/loggerInstance';
20
20
  // utils
21
- import { MSG_STATUS_RECEIVED, CHAT_REOPENED, CHAT_CLOSED, MEMBER_JOINED_GROUP, TYPE_DIRECT, MESSAGE_TYPE_INFO, TOUCHING_OPERATOR, LEAD_UPDATED, MEMBER_LEFT_GROUP } from '../../utils/constants';
21
+ import { MSG_STATUS_RECEIVED, CHAT_REOPENED, CHAT_CLOSED, MEMBER_JOINED_GROUP, TYPE_DIRECT, MESSAGE_TYPE_INFO, TOUCHING_OPERATOR, LEAD_UPDATED, MEMBER_LEFT_GROUP, LIVE_PAGE } from '../../utils/constants';
22
22
  import { compareValues, searchIndexInArrayForUid, conversationMessagesRef } from '../../utils/utils';
23
23
 
24
24
 
@@ -374,7 +374,8 @@ export class FirebaseConversationHandler extends ConversationHandlerService {
374
374
  const INFO_SUPPORT_LEAD_UPDATED = this.translationMap.get('INFO_SUPPORT_LEAD_UPDATED');
375
375
  const INFO_SUPPORT_MEMBER_LEFT_GROUP = this.translationMap.get('INFO_SUPPORT_MEMBER_LEFT_GROUP');
376
376
  const INFO_A_NEW_SUPPORT_REQUEST_HAS_BEEN_ASSIGNED_TO_YOU = this.translationMap.get('INFO_A_NEW_SUPPORT_REQUEST_HAS_BEEN_ASSIGNED_TO_YOU');
377
-
377
+ const INFO_SUPPORT_LIVE_PAGE = this.translationMap.get('INFO_SUPPORT_LIVE_PAGE');
378
+
378
379
  if (message.attributes.messagelabel
379
380
  && message.attributes.messagelabel.parameters
380
381
  && message.attributes.messagelabel.key === MEMBER_JOINED_GROUP
@@ -422,6 +423,15 @@ export class FirebaseConversationHandler extends ConversationHandlerService {
422
423
  subject = message.attributes.messagelabel.parameters.member_id;
423
424
  }
424
425
  message.text = subject + ' ' + INFO_SUPPORT_MEMBER_LEFT_GROUP ;
426
+ } else if(message.attributes.messagelabel && message.attributes.messagelabel.key === LIVE_PAGE){
427
+ let sourceUrl: string = '';
428
+ if(message.attributes && message.attributes.sourcePage){
429
+ sourceUrl = message.attributes.sourcePage
430
+ }
431
+ if(message.attributes && message.attributes.sourceTitle){
432
+ sourceUrl = '['+message.attributes.sourceTitle+']('+sourceUrl+')'
433
+ }
434
+ message.text= INFO_SUPPORT_LIVE_PAGE + ': ' + sourceUrl
425
435
  }
426
436
  }
427
437
 
@@ -1,4 +1,4 @@
1
- import { TOUCHING_OPERATOR, LEAD_UPDATED, MEMBER_LEFT_GROUP } from './../../utils/constants';
1
+ import { TOUCHING_OPERATOR, LEAD_UPDATED, MEMBER_LEFT_GROUP, LIVE_PAGE } from './../../utils/constants';
2
2
  import { Inject, Injectable } from '@angular/core';
3
3
  import { BehaviorSubject } from 'rxjs';
4
4
 
@@ -118,7 +118,7 @@ export class MQTTConversationHandler extends ConversationHandlerService {
118
118
  const handler_message_updated = this.chat21Service.chatClient.onMessageUpdatedInConversation(
119
119
  this.conversationWith, (message, topic) => {
120
120
  this.logger.log('[MQTTConversationHandler] message updated:', message, 'on topic:', topic);
121
- this.updatedMessageStatus(message);
121
+ this.changed(message);
122
122
  });
123
123
  }
124
124
 
@@ -255,7 +255,7 @@ export class MQTTConversationHandler extends ConversationHandlerService {
255
255
  }
256
256
 
257
257
  /** */
258
- private updatedMessageStatus(patch: any) {
258
+ private changed(patch: any) {
259
259
  if(this.skipInfoMessage && messageType(MESSAGE_TYPE_INFO, patch) ){
260
260
  return;
261
261
  }
@@ -332,7 +332,8 @@ export class MQTTConversationHandler extends ConversationHandlerService {
332
332
  const INFO_SUPPORT_LEAD_UPDATED = this.translationMap.get('INFO_SUPPORT_LEAD_UPDATED');
333
333
  const INFO_SUPPORT_MEMBER_LEFT_GROUP = this.translationMap.get('INFO_SUPPORT_MEMBER_LEFT_GROUP');
334
334
  const INFO_A_NEW_SUPPORT_REQUEST_HAS_BEEN_ASSIGNED_TO_YOU = this.translationMap.get('INFO_A_NEW_SUPPORT_REQUEST_HAS_BEEN_ASSIGNED_TO_YOU');
335
-
335
+ const INFO_SUPPORT_LIVE_PAGE = this.translationMap.get('INFO_SUPPORT_LIVE_PAGE');
336
+
336
337
  if (message.attributes.messagelabel
337
338
  && message.attributes.messagelabel.parameters
338
339
  && message.attributes.messagelabel.key === MEMBER_JOINED_GROUP
@@ -379,6 +380,15 @@ export class MQTTConversationHandler extends ConversationHandlerService {
379
380
  subject = message.attributes.messagelabel.parameters.member_id;
380
381
  }
381
382
  message.text = subject + ' ' + INFO_SUPPORT_MEMBER_LEFT_GROUP ;
383
+ } else if(message.attributes.messagelabel && message.attributes.messagelabel.key === LIVE_PAGE){
384
+ let sourceUrl: string = '';
385
+ if(message.attributes && message.attributes.sourcePage){
386
+ sourceUrl = message.attributes.sourcePage
387
+ }
388
+ if(message.attributes && message.attributes.sourceTitle){
389
+ sourceUrl = '['+message.attributes.sourceTitle+']('+sourceUrl+')'
390
+ }
391
+ message.text= INFO_SUPPORT_LIVE_PAGE + ': ' + sourceUrl
382
392
  }
383
393
  }
384
394
 
@@ -158,7 +158,7 @@ export class MQTTConversationsHandler extends ConversationsHandlerService {
158
158
  this.changed(conversation);
159
159
  }
160
160
  else {
161
- this.logger.log('[MQTTConversationsHandler]Added conv -> Added!')
161
+ this.logger.log('[MQTTConversationsHandler] Added conv -> Added!')
162
162
  this.added(conversation);
163
163
  }
164
164
  });
@@ -252,6 +252,7 @@ export class MQTTConversationsHandler extends ConversationsHandlerService {
252
252
  conversation.conversation_with = conversation.conversWith // conversWith comes from remote
253
253
  }
254
254
  const index = searchIndexInArrayForUid(this.conversations, conversation.conversation_with);
255
+ const oldConversation = this.conversations[index]
255
256
  if (index > -1) {
256
257
  // const conv = this.conversations[index];
257
258
  this.logger.log("Conversation to update found", this.conversations[index]);
@@ -259,6 +260,7 @@ export class MQTTConversationsHandler extends ConversationsHandlerService {
259
260
  this.logger.debug('[MQTTConversationsHandler] conversationchanged.isnew', JSON.stringify(conversation))
260
261
  this.logger.log("this.conversations:" + JSON.stringify(this.conversations));
261
262
  this.logger.log("Conversation updated --> ", this.conversations[index]);
263
+ this.conversationChangedDetailed.next({value: this.conversations[index], previousValue: oldConversation})
262
264
  this.conversationChanged.next(this.conversations[index]);
263
265
  this.conversations.sort(compareValues('timestamp', 'desc'));
264
266
  }
@@ -65,9 +65,10 @@ export const MESSAGE_TYPE_OTHERS = 'OTHERS';
65
65
  export const CHAT_REOPENED = 'CHAT_REOPENED';
66
66
  export const CHAT_CLOSED = 'CHAT_CLOSED';
67
67
  export const MEMBER_JOINED_GROUP = 'MEMBER_JOINED_GROUP';
68
- export const MEMBER_LEFT_GROUP = "MEMBER_LEFT_GROUP"
68
+ export const MEMBER_LEFT_GROUP = "MEMBER_LEFT_GROUP";
69
69
  export const LEAD_UPDATED = "LEAD_UPDATED";
70
70
  export const TOUCHING_OPERATOR = "TOUCHING_OPERATOR";
71
+ export const LIVE_PAGE = "LIVE_PAGE"
71
72
 
72
73
 
73
74
  // URLS
package/src/global.scss CHANGED
@@ -252,6 +252,10 @@ select:-webkit-autofill:focus {
252
252
  .base_info > p {
253
253
  margin-top: 0 !important;
254
254
  margin-bottom: 0 !important;
255
+
256
+ a {
257
+ word-break: break-all;
258
+ }
255
259
  }
256
260
 
257
261
  .toast-custom-class {
@@ -510,6 +514,10 @@ select:-webkit-autofill:focus {
510
514
  padding-bottom: 5px;
511
515
  min-height: 60px;
512
516
  width: 60px; // for SMALL SIDEBAR
517
+
518
+ a.customAncor{
519
+ margin: 0px;
520
+ }
513
521
  }
514
522
 
515
523
  .sidebar .logo:after {
@@ -520,6 +528,8 @@ select:-webkit-autofill:focus {
520
528
  height: 1px;
521
529
  width: 80%;
522
530
  background-color: rgba(180, 180, 180, 0.3);
531
+
532
+
523
533
  }
524
534
 
525
535
  .logo-img-wpr {
@@ -1,116 +0,0 @@
1
- <ion-header no-border class="ion-no-border">
2
- <ion-toolbar style="height:60px">
3
- <div class="flex-container">
4
- <div class="back-flex-container">
5
- <ion-buttons slot="start" style="height:60px">
6
- <!-- (click)="pushPage('conversations-list')" defaultHref="/conversations-list" -->
7
- <ion-back-button style="display: block;" text="" *ngIf="isMobile" (click)="goBackToConversationList()">
8
- </ion-back-button>
9
- </ion-buttons>
10
- </div>
11
- <div class="user-info-flex-container">
12
- <div style="display: flex;">
13
- <div>1</div>
14
- <div>2</div>
15
- </div>
16
- </div>
17
-
18
- <div class="resolve-flex-container">
19
- <ion-buttons slot="end">
20
-
21
- <!-- <ion-button ion-button fill="clear" color="primary" size="small" (click)="presentCreateTicketModal()" [ngClass]="{'resolve-conv-margin-right': !isMobile}">
22
- <ion-icon name="ticket-outline"></ion-icon>
23
- <span style="text-transform: capitalize; margin-left: 5px;"> {{ 'Crea ticket' | translate}} </span>
24
- </ion-button> -->
25
-
26
- <ion-button *ngIf="conversationUid?.startsWith('support-group') && conv_type !== 'archived'" ion-button fill="clear" color="primary" size="small"
27
- (click)="closeConversation()" [ngClass]="{'resolve-conv-margin-right': !isMobile}" [disabled]="conv_closed === true">
28
- <!-- <ion-icon slot="icon-only" name="alert-circle-outline"></ion-icon> -->
29
- <ion-icon name="archive-outline"></ion-icon>
30
- <!-- <ion-icon slot="icon-only" name="information-outline"></ion-icon> -->
31
- <span style="text-transform: capitalize; margin-left: 5px;"> {{ 'Resolve' | translate}} </span>
32
- </ion-button>
33
-
34
- <ion-button *ngIf="!openInfoConversation" ion-button fill="clear" (click)="onOpenCloseInfoConversation()">
35
- <!-- <ion-icon slot="icon-only" name="alert-circle-outline"></ion-icon> -->
36
- <ion-icon slot="icon-only" name="information-circle-outline"></ion-icon>
37
- <!-- <ion-icon slot="icon-only" name="information-outline"></ion-icon> -->
38
-
39
- </ion-button>
40
- <ion-button *ngIf="openInfoConversation" ion-button fill="clear" (click)="onOpenCloseInfoConversation()">
41
- <ion-icon slot="icon-only" name="close-circle-outline"></ion-icon>
42
- </ion-button>
43
-
44
- </ion-buttons>
45
- </div>
46
-
47
- </div>
48
- </ion-toolbar>
49
- </ion-header>
50
-
51
-
52
-
53
-
54
- <ion-title>
55
-
56
- <div *ngIf="conversationAvatar" class="avatar-and-typing-wpr" >
57
- <!-- [ngStyle] = "{ 'left': platformName === 'ios' ? '55px' : '' }" -->
58
- <div *ngIf="conversationAvatar" class="avatar-container" (click)="onOpenCloseInfoConversation()" style="cursor: pointer"
59
- [ngClass]="{ 'avatar-container-ios': platformName === 'ios' }">
60
- <app-avatar-profile [itemAvatar]=conversationAvatar></app-avatar-profile>
61
- </div>
62
- <!-- [ngStyle] = "{ 'left': platformName === 'ios' ? '63px' : '' }" -->
63
- <div *ngIf="isDirect" class="user-presence" [ngClass]="{ 'user-presence-ios': platformName === 'ios' }">
64
- <app-user-presence [idUser]=conversationAvatar.conversation_with [translationMap]=translationMap
65
- [borderColor]=borderColor [fontColor]=fontColor>
66
- </app-user-presence>
67
- </div>
68
-
69
- <div *ngIf="conversationAvatar" class="user-typing">
70
- <app-user-typing [idConversation]=conversationAvatar.uid [idCurrentUser]=idLoggedUser [isDirect]=isDirect
71
- [translationMap]=translationMap [color]=fontColor [membersConversation]=membersConversation>
72
- </app-user-typing>
73
- </div>
74
-
75
- </div>
76
- <!-- [ngClass] = "{ 'tile-info-with-ios': platformName === 'ios' ? '82px' : ''82px'' }" -->
77
- <!-- (click)="onOpenCloseInfoConversation()" -->
78
- <div *ngIf="conversationAvatar" class="tile-info-with"
79
- [ngClass]="{ 'tile-info-with-ios': platformName === 'ios' }">
80
- <span class="tile-username">{{ conversationAvatar.conversation_with_fullname | truncate:50 }} </span>
81
- <!-- <span class="tile-username">{{ conversation_with_fullname }} </span> -->
82
-
83
- </div>
84
-
85
- <!-- <div *ngIf="conversationWithFullname" class="tile-info-with" (click)="onOpenCloseInfoConversation()">
86
- <span class="tile-username">{{ conversationWithFullname }} </span>
87
- </div> -->
88
-
89
- </ion-title>
90
- <!-- openInfoConversation {{openInfoConversation}} -->
91
- <ion-buttons slot="end">
92
-
93
- <!-- <ion-button ion-button fill="clear" color="primary" size="small" (click)="presentCreateTicketModal()" [ngClass]="{'resolve-conv-margin-right': !isMobile}">
94
- <ion-icon name="ticket-outline"></ion-icon>
95
- <span style="text-transform: capitalize; margin-left: 5px;"> {{ 'Crea ticket' | translate}} </span>
96
- </ion-button> -->
97
-
98
- <ion-button *ngIf="conversationUid?.startsWith('support-group') && conv_type !== 'archived'" ion-button fill="clear" color="primary" size="small"
99
- (click)="closeConversation()" [ngClass]="{'resolve-conv-margin-right': !isMobile}" [disabled]="conv_closed === true">
100
- <!-- <ion-icon slot="icon-only" name="alert-circle-outline"></ion-icon> -->
101
- <ion-icon name="archive-outline"></ion-icon>
102
- <!-- <ion-icon slot="icon-only" name="information-outline"></ion-icon> -->
103
- <span style="text-transform: capitalize; margin-left: 5px;"> {{ 'Resolve' | translate}} </span>
104
- </ion-button>
105
-
106
- <ion-button *ngIf="!openInfoConversation" ion-button fill="clear" (click)="onOpenCloseInfoConversation()">
107
- <!-- <ion-icon slot="icon-only" name="alert-circle-outline"></ion-icon> -->
108
- <ion-icon slot="icon-only" name="information-circle-outline"></ion-icon>
109
- <!-- <ion-icon slot="icon-only" name="information-outline"></ion-icon> -->
110
-
111
- </ion-button>
112
- <ion-button *ngIf="openInfoConversation" ion-button fill="clear" (click)="onOpenCloseInfoConversation()">
113
- <ion-icon slot="icon-only" name="close-circle-outline"></ion-icon>
114
- </ion-button>
115
-
116
- </ion-buttons>