@chat21/chat21-ionic 3.0.61-rc11 → 3.0.61-rc12

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 (51) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/angular.json +1 -0
  3. package/package.json +2 -1
  4. package/src/app/app-routing.module.ts +5 -0
  5. package/src/app/app.module.ts +6 -3
  6. package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.html +23 -5
  7. package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.scss +142 -49
  8. package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.ts +101 -18
  9. package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.html +20 -36
  10. package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.scss +10 -0
  11. package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.ts +35 -40
  12. package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.scss +2 -0
  13. package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.ts +28 -25
  14. package/src/app/components/conversation-detail/message-text-area/message-text-area.component.html +57 -20
  15. package/src/app/components/conversation-detail/message-text-area/message-text-area.component.scss +32 -9
  16. package/src/app/components/conversation-detail/message-text-area/message-text-area.component.ts +93 -24
  17. package/src/app/components/project-item/project-item.component.scss +1 -1
  18. package/src/app/components/sidebar/sidebar.component.html +9 -9
  19. package/src/app/components/sidebar/sidebar.component.ts +13 -10
  20. package/src/app/components/sidebar-user-details/sidebar-user-details.component.html +7 -0
  21. package/src/app/components/sidebar-user-details/sidebar-user-details.component.scss +13 -1
  22. package/src/app/components/sidebar-user-details/sidebar-user-details.component.ts +11 -7
  23. package/src/app/pages/conversation-detail/conversation-detail.module.ts +5 -1
  24. package/src/app/pages/conversation-detail/conversation-detail.page.html +19 -11
  25. package/src/app/pages/conversation-detail/conversation-detail.page.scss +28 -0
  26. package/src/app/pages/conversation-detail/conversation-detail.page.ts +221 -368
  27. package/src/app/pages/conversations-list/conversations-list.page.ts +6 -18
  28. package/src/app/pages/create-canned-response/create-canned-response-routing.module.ts +17 -0
  29. package/src/app/pages/create-canned-response/create-canned-response.module.ts +30 -0
  30. package/src/app/pages/create-canned-response/create-canned-response.page.html +150 -0
  31. package/src/app/pages/create-canned-response/create-canned-response.page.scss +55 -0
  32. package/src/app/pages/create-canned-response/create-canned-response.page.spec.ts +24 -0
  33. package/src/app/pages/create-canned-response/create-canned-response.page.ts +319 -0
  34. package/src/app/pages/create-requester/create-requester.page.html +1 -1
  35. package/src/app/pages/create-requester/create-requester.page.ts +1 -0
  36. package/src/app/pages/create-ticket/create-ticket.page.html +1 -1
  37. package/src/app/pages/create-ticket/create-ticket.page.ts +13 -4
  38. package/src/app/pages/profile-info/profile-info.page.html +2 -2
  39. package/src/app/pages/profile-info/profile-info.page.scss +12 -1
  40. package/src/app/services/tiledesk/tiledesk.service.ts +28 -0
  41. package/src/app/shared/shared.module.ts +1 -1
  42. package/src/assets/i18n/de.json +17 -3
  43. package/src/assets/i18n/en.json +17 -3
  44. package/src/assets/i18n/es.json +17 -3
  45. package/src/assets/i18n/fr.json +17 -3
  46. package/src/assets/i18n/it.json +17 -3
  47. package/src/assets/i18n/pt.json +17 -3
  48. package/src/assets/i18n/ru.json +17 -3
  49. package/src/assets/i18n/sr.json +17 -3
  50. package/src/assets/i18n/tr.json +17 -3
  51. package/src/global.scss +8 -0
@@ -18,6 +18,7 @@ import { checkPlatformIsMobile } from 'src/chat21-core/utils/utils';
18
18
  // Logger
19
19
  import { LoggerService } from 'src/chat21-core/providers/abstract/logger.service';
20
20
  import { LoggerInstance } from 'src/chat21-core/providers/logger/loggerInstance';
21
+ import { EventsService } from 'src/app/services/events-service';
21
22
 
22
23
 
23
24
  @Component({
@@ -45,6 +46,7 @@ export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChange
45
46
  @Input() tagsCannedFilter: any = [];
46
47
  @Input() tagsCannedCount: number;
47
48
  @Input() areVisibleCAR: boolean;
49
+ @Input() support_mode: boolean;
48
50
  @Input() events: Observable<void>;
49
51
  @Input() fileUploadAccept: string
50
52
  @Input() isOpenInfoConversation: boolean;
@@ -68,9 +70,9 @@ export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChange
68
70
  private logger: LoggerService = LoggerInstance.getInstance();
69
71
  public countClicks: number = 0;
70
72
  public IS_SUPPORT_GROUP_CONVERSATION: boolean;
71
-
73
+ public IS_ON_MOBILE_DEVICE: boolean;
72
74
  TYPE_MSG_TEXT = TYPE_MSG_TEXT;
73
- msg : string
75
+ msg: string
74
76
 
75
77
  tooltipOptions = {
76
78
  'show-delay': 500,
@@ -82,7 +84,9 @@ export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChange
82
84
  'hide-delay': 200
83
85
  };
84
86
 
85
-
87
+ showEmojiPicker: boolean = false; //To show/hide emoji picker
88
+ addWhiteSpaceBefore: boolean;
89
+ emojiPerLine: number = 9
86
90
  /**
87
91
  * Constructor
88
92
  * @param chooser
@@ -96,6 +100,7 @@ export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChange
96
100
  public uploadService: UploadService,
97
101
  public toastController: ToastController,
98
102
  private renderer: Renderer2,
103
+ public eventsService: EventsService
99
104
  ) { }
100
105
 
101
106
  // ---------------------------------------------------------
@@ -112,12 +117,24 @@ export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChange
112
117
  // this.logger.log("[CONVS-DETAIL][MSG-TEXT-AREA] LONG_TEXAREA_PLACEHOLDER ", this.LONG_TEXAREA_PLACEHOLDER);
113
118
  // this.logger.log("[CONVS-DETAIL][MSG-TEXT-AREA] SHORT_TEXAREA_PLACEHOLDER ", this.SHORT_TEXAREA_PLACEHOLDER);
114
119
  // this.logger.log("[CONVS-DETAIL][MSG-TEXT-AREA] SHORTER_TEXAREA_PLACEHOLDER ", this.SHORTER_TEXAREA_PLACEHOLDER);
115
-
120
+ this.listenToNewCannedResponseCreated()
116
121
  this.getWindowWidth();
122
+ this.isOnMobileDevice()
123
+ }
124
+
125
+ isOnMobileDevice() {
126
+ this.IS_ON_MOBILE_DEVICE = false;
127
+ if (/Android|iPhone/i.test(window.navigator.userAgent)) {
128
+ this.IS_ON_MOBILE_DEVICE = true;
129
+ this.emojiPerLine = 7
130
+ }
131
+ // this.logger.log('[APP-COMP] IS_ON_MOBILE_DEVICE', this.IS_ON_MOBILE_DEVICE)
132
+ return this.IS_ON_MOBILE_DEVICE;
117
133
  }
118
134
 
119
135
 
120
136
 
137
+
121
138
  ngOnChanges() {
122
139
  if (this.translationMap) {
123
140
  // this.LONG_TEXAREA_PLACEHOLDER = this.translationMap.get('LABEL_ENTER_MSG')
@@ -125,7 +142,7 @@ export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChange
125
142
  // this.SHORTER_TEXAREA_PLACEHOLDER = this.translationMap.get('LABEL_ENTER_MSG_SHORTER')
126
143
 
127
144
  this.TEXAREA_PLACEHOLDER = this.translationMap.get('LABEL_ENTER_MSG_SHORT')
128
-
145
+
129
146
  }
130
147
 
131
148
  if (this.conversationWith.startsWith("support-group")) {
@@ -133,11 +150,12 @@ export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChange
133
150
  } else {
134
151
  this.IS_SUPPORT_GROUP_CONVERSATION = false
135
152
  }
153
+ this.logger.log('[CONVS-DETAIL][MSG-TEXT-AREA] ngOnChanges support_mode ', this.support_mode)
136
154
  this.logger.log('[CONVS-DETAIL][MSG-TEXT-AREA] ngOnChanges disableTextarea ', this.disableTextarea)
137
155
  this.logger.log("[CONVS-DETAIL][MSG-TEXT-AREA] ngOnChanges DROP EVENT ", this.dropEvent);
138
156
  this.logger.log("[CONVS-DETAIL][MSG-TEXT-AREA] ngOnChanges tagsCannedFilter ", this.tagsCannedFilter);
139
157
  this.logger.log("[CONVS-DETAIL][MSG-TEXT-AREA] ngOnChanges areVisibleCAR; ", this.areVisibleCAR);
140
-
158
+
141
159
 
142
160
  this.logger.log('[CONVS-DETAIL] - returnChangeTextArea ngOnChanges in [MSG-TEXT-AREA] this.tagsCannedFilter.length ', this.tagsCannedFilter.length)
143
161
 
@@ -218,8 +236,8 @@ export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChange
218
236
  @HostListener('window:resize', ['$event'])
219
237
  onResize(event) {
220
238
  // this.getIfTexareaIsEmpty('onResize')
221
- this.logger.log("[CONVS-DETAIL][MSG-TEXT-AREA] event.target.innerWidth; ", event.target.innerWidth);
222
-
239
+ // console.log("[CONVS-DETAIL][MSG-TEXT-AREA] event.target.innerWidth; ", event.target.innerWidth);
240
+
223
241
 
224
242
 
225
243
  // if (event.target.innerWidth >= 844 && this.isOpenInfoConversation === false && this.conversationWith.startsWith("support-group")) {
@@ -349,7 +367,7 @@ export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChange
349
367
  }
350
368
  // this.logger.log('presentModal e.target.files.length', e.target.files.length);
351
369
 
352
- const attributes = { files: dataFiles, enableBackdropDismiss: false , msg: this.msg};
370
+ const attributes = { files: dataFiles, enableBackdropDismiss: false, msg: this.msg };
353
371
  this.logger.log('[CONVS-DETAIL][MSG-TEXT-AREA] attributes', attributes);
354
372
  const modal: HTMLIonModalElement =
355
373
  await this.modalController.create({
@@ -546,28 +564,21 @@ export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChange
546
564
  }
547
565
  }
548
566
  }
549
- openCannedResponses() {
550
- // console.log('[MSG-TEXT-AREA] has clicked OPEN-CANNED-RESPONSES messageString ', this.messageString)
551
- // if (this.messageString) {
552
- // console.log('[MSG-TEXT-AREA] has clicked OPEN-CANNED-RESPONSES messageString.trim ', this.messageString.trim)
553
- // }
554
- // if (this.messageString === undefined) {
555
- // this.messageString = '/'
556
- // } else {
557
567
 
558
- // }
559
-
560
- // const elTextArea = this.message_text_area['el'];
561
- // console.log('[MSG-TEXT-AREA] textArea elTextArea ', elTextArea)
562
- // const textArea = elTextArea.getElementsByTagName('ion-textarea')[0];
563
- // console.log("[MSG-TEXT-AREA] textArea textArea ", textArea);
564
- // this.logger.log("[MSG-TEXT-AREA] textArea value", textArea.value)
568
+ listenToNewCannedResponseCreated() {
569
+ this.eventsService.subscribe('newcannedresponse:created', (openCannedResponses) => {
570
+ this.logger.log('[CONVS-DETAIL][MSG-TEXT-AREA] - listenToNewCannedResponseCreated - openUserDetailsSidebar', openCannedResponses);
571
+ this.openCannedResponses()
572
+ });
573
+ }
565
574
 
575
+ openCannedResponses() {
566
576
  this.hasClickedOpenCannedResponses.emit(true);
567
577
  }
568
578
 
569
579
 
570
580
  sendMessage(text: string) {
581
+ this.showEmojiPicker = false;
571
582
  this.logger.log('[CONVS-DETAIL][MSG-TEXT-AREA] sendMessage text', text);
572
583
  this.logger.log('[CONVS-DETAIL][MSG-TEXT-AREA] sendMessage conve width', this.conversationWith);
573
584
  // text.replace(/\s/g, "")
@@ -578,6 +589,64 @@ export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChange
578
589
  }
579
590
  }
580
591
 
592
+ addEmoji($event) {
593
+ // console.log('[CONVS-DETAIL][MSG-TEXT-AREA] ADD EMOJI $event', $event)
594
+ // console.log('[CONVS-DETAIL][MSG-TEXT-AREA] ADD EMOJI $event > emoji', $event.emoji)
595
+ // console.log('[CONVS-DETAIL][MSG-TEXT-AREA] ADD EMOJI $event > emoji > native', $event.emoji.native)
596
+ // console.log('[CONVS-DETAIL][MSG-TEXT-AREA] ADD EMOJI messageString', this.messageString)
597
+ if (this.messageString === undefined) {
598
+ this.addWhiteSpaceBefore = false;
599
+ // console.log('[CONVS-DETAIL][MSG-TEXT-AREA] ADD EMOJI addWhiteSpaceBefore ', this.addWhiteSpaceBefore)
600
+ } else {
601
+ this.addWhiteSpaceBefore = true
602
+ // console.log('[CONVS-DETAIL][MSG-TEXT-AREA] ADD EMOJI addWhiteSpaceBefore ', this.addWhiteSpaceBefore)
603
+ }
604
+ const elTextArea = this.message_text_area['el'];
605
+ // console.log('[CONVS-DETAIL][MSG-TEXT-AREA] ADD EMOJI elTextArea ', elTextArea)
606
+ this.insertAtCursor(elTextArea, $event.emoji.native)
607
+ }
608
+
609
+ insertAtCursor(myField, myValue) {
610
+ this.logger.log('[CANNED-RES-EDIT-CREATE] - insertAtCursor - myValue ', myValue );
611
+
612
+ if (this.addWhiteSpaceBefore === true) {
613
+ myValue = ' ' + myValue;
614
+ this.logger.log('[CANNED-RES-EDIT-CREATE] - GET TEXT AREA - QUI ENTRO myValue ', myValue );
615
+ }
616
+
617
+ //IE support
618
+ if (myField.selection) {
619
+ myField.focus();
620
+ let sel = myField.selection.createRange();
621
+ sel.text = myValue;
622
+ // this.cannedResponseMessage = sel.text;
623
+ }
624
+ //MOZILLA and others
625
+ else if (myField.selectionStart || myField.selectionStart == '0') {
626
+ var startPos = myField.selectionStart;
627
+ this.logger.log('[CANNED-RES-EDIT-CREATE] - insertAtCursor - startPos ', startPos);
628
+
629
+ var endPos = myField.selectionEnd;
630
+ this.logger.log('[CANNED-RES-EDIT-CREATE] - insertAtCursor - endPos ', endPos);
631
+
632
+ myField.value = myField.value.substring(0, startPos) + myValue + myField.value.substring(endPos, myField.value.length);
633
+
634
+ // place cursor at end of text in text input element
635
+ myField.focus();
636
+ var val = myField.value; //store the value of the element
637
+ myField.value = ''; //clear the value of the element
638
+ myField.value = val + ' '; //set that value back.
639
+
640
+
641
+ // myField.select();
642
+ } else {
643
+ myField.value += myValue;
644
+
645
+ }
646
+ }
647
+
648
+
649
+
581
650
  // --------------------------------
582
651
  // on mobile !
583
652
  // --------------------------------
@@ -477,7 +477,7 @@
477
477
  width: 22px;
478
478
  height: 22px;
479
479
  color: #fff;
480
- // left: 28px;
480
+
481
481
  left: 34px;
482
482
  border: 1px solid #fff;
483
483
  }
@@ -52,7 +52,7 @@
52
52
  #tooltip="matTooltip" matTooltipPosition='right' matTooltipHideDelay="100" style="text-align: center; ">
53
53
  <a class="customAncor" style="margin-right: 0px !important">
54
54
  <!-- <i class="material-icons sidebar-icons">chat</i> -->
55
- <span id="openchat-span" style="position: relative;top: 10px;vertical-align: middle;">
55
+ <span id="openchat-span" style="position: relative;top: 9px;vertical-align: middle;">
56
56
  <svg id="openchat-svg" version="1.1" xmlns="http://www.w3.org/2000/svg"
57
57
  xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 23 21"
58
58
  style="enable-background:new 0 0 23 21;" xml:space="preserve"
@@ -93,7 +93,7 @@
93
93
  <span class="bot-icon-wpr">
94
94
  <svg version="1.1" id="Objects" xmlns="http://www.w3.org/2000/svg"
95
95
  xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 30 30"
96
- style="enable-background:new 0 0 30 30;" xml:space="preserve" style="width: 25px;height: 25px;margin-top: 6px;">
96
+ style="enable-background:new 0 0 30 30;" xml:space="preserve" style="width: 25px;height: 25px;margin-top: 7px;">
97
97
  <g>
98
98
  <g>
99
99
  <path class="chat-bot-icon-st0" d="M24.6,12.6c-0.1,0-0.2,0-0.3,0c-1.6-2.9-4.5-5.8-9.2-5.8c-4.7,0-7.6,2.9-9.2,5.8c-0.2,0-0.4-0.1-0.6-0.1
@@ -124,7 +124,7 @@
124
124
  <span class="realtime-icon-wpr" >
125
125
 
126
126
  <svg version="1.1" id="Livello_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
127
- viewBox="0 0 24 24" style="enable-background:new 0 0 24 24;" xml:space="preserve" style="width: 30px;height: 30px;margin-top: 6px;">
127
+ viewBox="0 0 24 24" style="enable-background:new 0 0 24 24;" xml:space="preserve" style="width: 30px;height: 30px;margin-top: 5px;">
128
128
 
129
129
  <path class="realtime-icon-st3" d="M17.9,11.6l-1.4,1.9l-3.2-5.6l-1-2l-0.2,0.2l-3.7,6.4l-3-4.8L2.7,9.9v2.4l2.4-1.8L9,16.2l3.3-6.2l4,6.7l2.7-3.3
130
130
  l0.9,0c0.5-0.7,1-1.4,1.4-2L17.9,11.6z"/>
@@ -156,7 +156,7 @@
156
156
  <!-- <i class="material-icons sidebar-icons">dashboard_customize</i> -->
157
157
  <span class="dashboard-customize-icon-wpr">
158
158
  <svg version="1.1" id="Livello_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
159
- viewBox="0 0 24 24" style="enable-background:new 0 0 24 24;" xml:space="preserve" style="width: 20px;height: 20px;margin-top: 9px;">
159
+ viewBox="0 0 24 24" style="enable-background:new 0 0 24 24;" xml:space="preserve" style="width: 20px;height: 20px;margin-top: 10px;">
160
160
  <path class="dashboard_customize-st0" d="M0,0h24v24H0V0z"/>
161
161
  <path class="dashboard_customize-st1" d="M3,3h8v8H3V3z M13,3h8v8h-8V3z M3,13h8v8H3V13z M18,13h-2v3h-3v2h3v3h2v-3h3v-2h-3V13z"/>
162
162
  </svg>
@@ -177,7 +177,7 @@
177
177
  <!-- <i class="material-icons sidebar-icons"> bar_chart </i> -->
178
178
  <span class="bar-chart-icon-wpr">
179
179
  <svg version="1.1" id="Livello_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
180
- viewBox="0 0 24 24" style="enable-background:new 0 0 24 24;" xml:space="preserve" style="width: 20px;height: 20px;margin-top: 9px;">
180
+ viewBox="0 0 24 24" style="enable-background:new 0 0 24 24;" xml:space="preserve" style="width: 20px;height: 20px;margin-top: 10px;">
181
181
  <path class="bar-chart-icon-st0" d="M0,0h24v24H0V0z"/>
182
182
  <path class="bar-chart-icon-st1" d="M5,9.2h3V19H5V9.2z M10.6,5h2.8v14h-2.8V5z M16.2,13H19v6h-2.8V13z"/>
183
183
  </svg>
@@ -209,10 +209,10 @@
209
209
  </a>
210
210
  </li>
211
211
 
212
- <!-- ------------------------------------------- -->
213
- <!-- SETTINGS -->
214
- <!-- ------------------------------------------- -->
215
- <li *ngIf="USER_ROLE !== 'agent'" (click)="goToSettings_CannedResponses()" matTooltipClass="custom-mat-tooltip"
212
+ <!-- ----------------------------------------------------------------------------------- -->
213
+ <!-- SETTINGS // old: goToSettings_CannedResponses() *ngIf="USER_ROLE !== 'agent'" -->
214
+ <!-- ----------------------------------------------------------------------------------- -->
215
+ <li (click)="goToWidgetSetUp()" matTooltipClass="custom-mat-tooltip"
216
216
  matTooltip="{{ settings_lbl }}" #tooltip="matTooltip" matTooltipPosition='right' matTooltipHideDelay="100" style="text-align: center;">
217
217
  <a class="customAncor">
218
218
  <i class="material-icons sidebar-icons">settings</i>
@@ -13,7 +13,7 @@ import { EventsService } from 'src/app/services/events-service';
13
13
  import { tranlatedLanguage } from '../../../chat21-core/utils/constants';
14
14
 
15
15
  // utils
16
- import { avatarPlaceholder, getColorBck} from 'src/chat21-core/utils/utils-user';
16
+ import { avatarPlaceholder, getColorBck } from 'src/chat21-core/utils/utils-user';
17
17
 
18
18
  @Component({
19
19
  selector: 'app-sidebar',
@@ -59,13 +59,13 @@ export class SidebarComponent implements OnInit {
59
59
  public appConfigProvider: AppConfigProvider,
60
60
  private translate: TranslateService,
61
61
  public events: EventsService,
62
-
62
+
63
63
  ) { }
64
64
 
65
65
  ngOnInit() {
66
66
  this.DASHBOARD_URL = this.appConfig.getConfig().dashboardUrl + '#/project/';
67
67
  // console.log('[SIDEBAR] DASHBOARD_URL ', this.DASHBOARD_URL)
68
- this.getStoredProjectAndDashboardBaseUrl()
68
+ this.getStoredProjectAndUserRole()
69
69
  this.subcribeToAuthStateChanged()
70
70
  this.listenTocurrentProjectUserUserAvailability$()
71
71
  this.getOSCODE();
@@ -106,12 +106,12 @@ export class SidebarComponent implements OnInit {
106
106
  }
107
107
 
108
108
  checkIfExistPhotoProfile(imageUrl) {
109
- this.verifyImageURL(imageUrl, (imageExists) => {
109
+ this.verifyImageURL(imageUrl, (imageExists) => {
110
110
 
111
111
  if (imageExists === true) {
112
112
  this.USER_PHOTO_PROFILE_EXIST = true;
113
113
  this.logger.log('[SIDEBAR] photo_profile_URL IMAGE EXIST ', imageExists)
114
-
114
+
115
115
  } else {
116
116
  this.USER_PHOTO_PROFILE_EXIST = false;
117
117
  this.logger.log('[SIDEBAR] photo_profile_URL IMAGE EXIST ', imageExists)
@@ -134,7 +134,7 @@ export class SidebarComponent implements OnInit {
134
134
  currentUser['fullname_initial'] = 'N/A'
135
135
  currentUser['fillColour'] = 'rgb(98, 100, 167)'
136
136
  }
137
- }
137
+ }
138
138
 
139
139
  verifyImageURL(image_url, callBack) {
140
140
  const img = new Image();
@@ -378,10 +378,7 @@ export class SidebarComponent implements OnInit {
378
378
  // }
379
379
  // }
380
380
 
381
-
382
-
383
-
384
- getStoredProjectAndDashboardBaseUrl() {
381
+ getStoredProjectAndUserRole() {
385
382
  const stored_project = localStorage.getItem('last_project')
386
383
  // console.log('[SIDEBAR] stored_project ', stored_project)
387
384
  if (stored_project) {
@@ -452,6 +449,12 @@ export class SidebarComponent implements OnInit {
452
449
  myWindow.focus();
453
450
  }
454
451
 
452
+ goToWidgetSetUp() {
453
+ let url = this.DASHBOARD_URL + this.project_id + '/widget-set-up'
454
+ const myWindow = window.open(url, '_self');
455
+ myWindow.focus();
456
+ }
457
+
455
458
  public translations() {
456
459
  const keys = [
457
460
  'Available',
@@ -107,4 +107,11 @@
107
107
  <div> Logout</div>
108
108
  </section>
109
109
 
110
+ <section class="user-details-footer-chat-version">
111
+ <div class="chat-version">
112
+ <!-- &copy; {{test | date: 'yyyy'}} {{company_name}} ver {{version}} -->
113
+ ver {{version}}
114
+ </div>
115
+ </section>
116
+
110
117
  </div>
@@ -275,6 +275,18 @@ button.user-details-btn-close {
275
275
  color: #fff;
276
276
  }
277
277
 
278
+ .user-details-footer-chat-version {
279
+ position: absolute;
280
+ bottom: 11px;
281
+ text-align: center;
282
+ margin: auto;
283
+ transform: translateX(-50%);
284
+ left: 50%;
285
+ margin: auto;
286
+ font-size: 12px;
287
+ font-weight: 400;
288
+ }
289
+
278
290
  :host ::ng-deep .mat-slide-toggle.mat-checked:not(.mat-disabled) .mat-slide-toggle-bar {
279
291
  background-color: #a9afbb;
280
292
  margin-left: 30px;
@@ -315,4 +327,4 @@ button.user-details-btn-close {
315
327
  font-weight: 400;
316
328
  font-family: "Poppins";
317
329
  font-size: 32px;
318
- }
330
+ }
@@ -11,7 +11,8 @@ import { skip } from 'rxjs/operators';
11
11
  import { AppConfigProvider } from 'src/app/services/app-config';
12
12
  import { EventsService } from 'src/app/services/events-service';
13
13
  import { tranlatedLanguage } from '../../../chat21-core/utils/constants';
14
- import { avatarPlaceholder, getColorBck} from 'src/chat21-core/utils/utils-user';
14
+ import { avatarPlaceholder, getColorBck } from 'src/chat21-core/utils/utils-user';
15
+ import * as PACKAGE from 'package.json';
15
16
  @Component({
16
17
  selector: 'app-sidebar-user-details',
17
18
  templateUrl: './sidebar-user-details.component.html',
@@ -53,8 +54,10 @@ export class SidebarUserDetailsComponent implements OnInit, OnChanges {
53
54
  public_Key: any
54
55
  plan_name: string;
55
56
  plan_subscription_is_active: boolean;
56
- USER_PHOTO_PROFILE_EXIST: boolean;
57
-
57
+ USER_PHOTO_PROFILE_EXIST: boolean;
58
+ version: string
59
+ test: Date = new Date();
60
+ company_name: string = 'Tiledesk'
58
61
  constructor(
59
62
  private translate: TranslateService,
60
63
  public tiledeskAuthService: TiledeskAuthService,
@@ -68,6 +71,7 @@ export class SidebarUserDetailsComponent implements OnInit, OnChanges {
68
71
  ) { }
69
72
 
70
73
  ngOnInit() {
74
+ this.version = PACKAGE.version;
71
75
  this.getCurrentChatLangAndTranslateLabels();
72
76
  this.subcribeToAuthStateChanged();
73
77
  this.listenTocurrentProjectUserUserAvailability$();
@@ -95,12 +99,12 @@ export class SidebarUserDetailsComponent implements OnInit, OnChanges {
95
99
  }
96
100
 
97
101
  checkIfExistPhotoProfile(imageUrl) {
98
- this.verifyImageURL(imageUrl, (imageExists) => {
102
+ this.verifyImageURL(imageUrl, (imageExists) => {
99
103
 
100
104
  if (imageExists === true) {
101
105
  this.USER_PHOTO_PROFILE_EXIST = true;
102
106
  this.logger.log('[SIDEBAR-USER-DETAILS] photo_profile_URL IMAGE EXIST ', imageExists)
103
-
107
+
104
108
  } else {
105
109
  this.USER_PHOTO_PROFILE_EXIST = false;
106
110
  this.logger.log('[SIDEBAR-USER-DETAILS] photo_profile_URL IMAGE EXIST ', imageExists)
@@ -124,7 +128,7 @@ export class SidebarUserDetailsComponent implements OnInit, OnChanges {
124
128
  currentUser['fullname_initial'] = 'N/A'
125
129
  currentUser['fillColour'] = 'rgb(98, 100, 167)'
126
130
  }
127
- }
131
+ }
128
132
 
129
133
  verifyImageURL(image_url, callBack) {
130
134
  const img = new Image();
@@ -198,7 +202,7 @@ export class SidebarUserDetailsComponent implements OnInit, OnChanges {
198
202
  this.logger.log('[SIDEBAR-USER-DETAILS] chat_lang: ', this.chat_lang);
199
203
  }
200
204
 
201
-
205
+
202
206
  if (tranlatedLanguage.includes(this.chat_lang)) {
203
207
  this.logger.log('[SIDEBAR-USER-DETAILS] tranlatedLanguage includes', this.chat_lang, ': ', tranlatedLanguage.includes(this.chat_lang))
204
208
  this.translate.use(this.chat_lang);
@@ -35,6 +35,9 @@ import { SharedModule } from 'src/app/shared/shared.module';
35
35
  // import { SharedConversationInfoModule } from 'src/app/shared/shared-conversation-info.module';
36
36
  import { NgxLinkifyjsModule } from 'ngx-linkifyjs';
37
37
  import { ScrollbarThemeModule } from '../../utils/scrollbar-theme.directive';
38
+ import { PickerModule } from '@ctrl/ngx-emoji-mart';
39
+
40
+
38
41
  @NgModule({
39
42
  imports: [
40
43
  CommonModule,
@@ -43,6 +46,7 @@ import { ScrollbarThemeModule } from '../../utils/scrollbar-theme.directive';
43
46
  TooltipModule,
44
47
  ConversationDetailPageRoutingModule,
45
48
  ScrollbarThemeModule,
49
+ PickerModule,
46
50
  TranslateModule.forChild({
47
51
  loader: {
48
52
  provide: TranslateLoader,
@@ -58,7 +62,7 @@ import { ScrollbarThemeModule } from '../../utils/scrollbar-theme.directive';
58
62
  declarations: [
59
63
  ConversationDetailPage,
60
64
  HeaderConversationDetailComponent,
61
- MessageTextAreaComponent,
65
+ MessageTextAreaComponent
62
66
  // BubbleDayMessageComponent,
63
67
  // BubbleSystemMessageComponent,
64
68
  // BubbleMyMessageComponent,
@@ -1,7 +1,7 @@
1
1
  <span *ngIf="conversationWith && loggedUser; then showConversation else showPlaceholder"></span>
2
2
  <ng-template #showPlaceholder>
3
3
  <!-- class="splash-page" -->
4
- <ion-content padding >
4
+ <ion-content padding>
5
5
  <!-- <div padding class="image-splash-page"></div>
6
6
  <div padding class="title-splash-page">
7
7
  text new conversation + button
@@ -9,7 +9,8 @@
9
9
 
10
10
  <ion-grid style="height: 100%;">
11
11
  <ion-row class="ion-justify-content-center ion-align-items-center" style="height: 100%; flex-direction: column">
12
- <span *ngIf="isOnline === true && !showSpinner" style="color: #92949c; font-size: 16px;line-height: 18px;margin-top: -160px;">
12
+ <span *ngIf="isOnline === true && !showSpinner"
13
+ style="color: #92949c; font-size: 16px;line-height: 18px;margin-top: -160px;">
13
14
  <span *ngIf="conversation_count > 0 ">
14
15
  {{'PleaseSelectChatToStartMessaging' | translate }}
15
16
  </span>
@@ -34,8 +35,7 @@
34
35
  <app-header-conversation-detail [isMobile]="isMobile" [idLoggedUser]="loggedUser.uid"
35
36
  [conversationAvatar]="conversationAvatar" [translationMap]="translationMap"
36
37
  (eventOpenCloseInfoConversation)="returnOpenCloseInfoConversation($event)"
37
- [isOpenInfoConversation]="isOpenInfoConversation"
38
- [conv_type]="conv_type">
38
+ [isOpenInfoConversation]="isOpenInfoConversation" [conv_type]="conv_type">
39
39
  </app-header-conversation-detail>
40
40
 
41
41
  <ion-content id="conv-details">
@@ -137,15 +137,24 @@
137
137
  <!-- ----------------------------------------------------------- -->
138
138
  <!-- Canned responses -->
139
139
  <!-- ----------------------------------------------------------- -->
140
-
141
- <div id="canned" *ngIf="tagsCannedFilter.length > 0 && HIDE_CANNED_RESPONSES === false">
142
- <ion-list class="canned-list">
140
+ <div id="canned">
141
+ <ion-list class="canned-list" *ngIf="tagsCannedFilter.length > 0 && HIDE_CANNED_RESPONSES === false">
143
142
  <ion-item button="true" [ngClass]="{'is_active_item': i == arrowkeyLocation}" lines="none"
144
143
  class="canned-item" id="{{'canned-item_'+ i }}"
145
144
  *ngFor="let canned of tagsCannedFilter; let i = index;" [innerHtml]="canned.title"
146
145
  (click)="replaceTagInMessage(canned, $event)">
147
146
  </ion-item>
147
+ <ion-item class="canned-item add-canned-response-wpr" button="true" lines="none" (click)="presentCreateCannedResponseModal()">
148
+ <ion-icon class="add-canned-response-icon" name="flash-outline"></ion-icon>
149
+ <span class="add-canned-response-add-icon">+</span>
150
+ <label class="add-canned-response-label" >{{translationMap?.get('AddNewCannedResponse')}}</label>
151
+ </ion-item>
148
152
  </ion-list>
153
+ <!-- <ion-list class="canned-list" *ngIf="tagsCannedFilter.length === 0 && HIDE_CANNED_RESPONSES === false">
154
+ <ion-item button="true" >
155
+ There are no canned responses available
156
+ </ion-item>
157
+ </ion-list> -->
149
158
  </div>
150
159
 
151
160
 
@@ -156,15 +165,14 @@
156
165
  <!-- openInfoConversation {{openInfoConversation}} - isMobile {{isMobile}} -->
157
166
  <app-message-text-area
158
167
  *ngIf="(openInfoConversation === false && isMobile === true) || (openInfoConversation === true && isMobile === false) || (openInfoConversation === false && isMobile === false)"
159
- [tagsCannedCount]="tagsCannedCount" [areVisibleCAR]="areVisibleCAR" [loggedUser]="loggedUser"
160
- [conversationWith]="conversationWith" [tagsCannedFilter]="tagsCannedFilter"
168
+ [tagsCannedCount]="tagsCannedCount" [areVisibleCAR]="areVisibleCAR" [support_mode]="support_mode"
169
+ [loggedUser]="loggedUser" [conversationWith]="conversationWith" [tagsCannedFilter]="tagsCannedFilter"
161
170
  (eventChangeTextArea)="returnChangeTextArea($event)"
162
171
  (hasClickedOpenCannedResponses)="hasClickedOpenCannedResponses($event)"
163
172
  (eventSendMessage)="returnSendMessage($event)" [translationMap]="translationMap"
164
173
  [fileUploadAccept]="appConfigProvider.getConfig().fileUploadAccept"
165
174
  [isOpenInfoConversation]="isOpenInfoConversation" [dropEvent]="dropEvent"
166
- (onPresentModalScrollToBottom)="onPresentModalScrollToBottom($event)"
167
- [disableTextarea]="disableTextarea">
175
+ (onPresentModalScrollToBottom)="onPresentModalScrollToBottom($event)" [disableTextarea]="disableTextarea">
168
176
  </app-message-text-area>
169
177
  <!-- [events]="eventsReplaceTexareaText.asObservable()" -->
170
178
  </ion-row>
@@ -25,6 +25,34 @@
25
25
  font-size: 24px;
26
26
  }
27
27
 
28
+ .add-canned-response-icon {
29
+ color: #b3bfd0;
30
+ cursor: pointer;
31
+ font-size: 18px;
32
+ }
33
+ .add-canned-response-label {
34
+ color: #b3bfd0;
35
+ cursor: pointer;
36
+ }
37
+ .add-canned-response-add-icon {
38
+ color: #b3bfd0;
39
+ cursor: pointer;
40
+ position: relative;
41
+ top: 4px;
42
+ left: -6px;
43
+ }
44
+
45
+ #canned > ion-list > ion-item.canned-item.add-canned-response-wpr:hover > span {
46
+ color: #1877f2;
47
+ }
48
+
49
+ #canned > ion-list > ion-item.canned-item.add-canned-response-wpr:hover > ion-icon {
50
+ color: #1877f2;
51
+ }
52
+ #canned > ion-list > ion-item.canned-item.add-canned-response-wpr:hover > label {
53
+ color: #1877f2;
54
+ }
55
+
28
56
  // ion-back-button{
29
57
  // display: none!important;
30
58
  // }