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

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 (53) hide show
  1. package/CHANGELOG.md +22 -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 +36 -25
  7. package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.scss +160 -50
  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 +21 -36
  10. package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.scss +19 -7
  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 +36 -35
  19. package/src/app/components/sidebar/sidebar.component.ts +72 -26
  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/chat21-core/providers/firebase/firebase-conversation-handler.ts +8 -3
  52. package/src/chat21-core/utils/utils-message.ts +19 -0
  53. package/src/global.scss +8 -0
@@ -38,36 +38,73 @@
38
38
 
39
39
  <ion-col col-auto>
40
40
 
41
- <div class="start-buttons" style="position: absolute;display: flex;">
42
-
43
- <ng-container *ngIf="areVisibleCAR">
44
- <div class="canned-responses-btn-wpr" style="margin-left: -5px;" tooltip="{{translationMap?.get('CANNED_RESPONSES')}}" [options]="tooltipOptions" placement="top">
45
- <ion-button ion-button fill="clear" class="canned-responses-btn" (click)="openCannedResponses()" [disabled]="!IS_SUPPORT_GROUP_CONVERSATION || disableTextarea">
46
- <ion-icon slot="icon-only" lazy="true" name="flash-outline" style="font-size: 24px;"></ion-icon>
47
- </ion-button>
48
- </div>
49
- <div *ngIf="IS_SUPPORT_GROUP_CONVERSATION && tagsCannedCount === 0" tooltip="{{translationMap?.get('NO_CANNED_RESPONSES')}}" [options]="tooltipOptions" placement="top" class="no-canned-responses-btn-badge">
50
- <ion-icon name="alert-sharp" style="vertical-align: middle;"></ion-icon>
51
- </div>
52
- <div *ngIf="IS_SUPPORT_GROUP_CONVERSATION && tagsCannedCount > 0" tooltip="{{translationMap?.get('YES_CANNED_RESPONSES')}}" [options]="tooltipOptions" placement="top" class="canned-responses-btn-badge">
53
- <ion-icon name="information-sharp" style="vertical-align: middle;"></ion-icon>
54
- </div>
55
- </ng-container>
41
+ <div class="start-buttons" style="position: absolute;display: flex; top: 2px;">
42
+
43
+ <ng-container *ngIf="areVisibleCAR && support_mode === true">
44
+ <div class="canned-responses-btn-wpr" style="margin-left: -5px;"
45
+ tooltip="{{translationMap?.get('CANNED_RESPONSES')}}" [options]="tooltipOptions" placement="top">
46
+ <ion-button ion-button fill="clear" class="canned-responses-btn" (click)="openCannedResponses()"
47
+ [disabled]="!IS_SUPPORT_GROUP_CONVERSATION || disableTextarea">
48
+ <ion-icon slot="icon-only" lazy="true" name="flash-outline" style="font-size: 24px;"></ion-icon>
49
+ </ion-button>
50
+ </div>
51
+ <div *ngIf="IS_SUPPORT_GROUP_CONVERSATION && tagsCannedCount === 0"
52
+ tooltip="{{translationMap?.get('NO_CANNED_RESPONSES')}}" [options]="tooltipOptions" placement="top"
53
+ class="no-canned-responses-btn-badge">
54
+ <ion-icon name="alert-sharp" style="vertical-align: middle;"></ion-icon>
55
+ </div>
56
+ <div *ngIf="IS_SUPPORT_GROUP_CONVERSATION && tagsCannedCount > 0"
57
+ tooltip="{{translationMap?.get('YES_CANNED_RESPONSES')}}" [options]="tooltipOptions" placement="top"
58
+ class="canned-responses-btn-badge">
59
+ <ion-icon name="information-sharp" style="vertical-align: middle;"></ion-icon>
60
+ </div>
61
+ </ng-container>
56
62
 
57
-
58
- <div class="upload-image-btn-wpr" tooltip="{{translationMap?.get('UPLOAD')}}" [options]="tooltipOptions" placement="top">
63
+
64
+ <div class="upload-image-btn-wpr" tooltip="{{translationMap?.get('UPLOAD')}}" [options]="tooltipOptions"
65
+ placement="top">
59
66
  <ion-button ion-button fill="clear" class="upload-image-btn" [disabled]="disableTextarea">
60
67
  <ion-icon slot="icon-only" lazy="true" name="attach-outline"
61
68
  style="font-size: 30px;transform: rotate(42deg);"></ion-icon>
62
69
  <input #fileInput type="file" (change)="onFileSelected($event)" capture="camera" id="file-input"
63
70
  [accept]="fileUploadAccept">
64
-
71
+
65
72
  </ion-button>
66
-
73
+
74
+ </div>
75
+
76
+ <!-- <ion-icon (click)="showEmojiPicker = !showEmojiPicker" color="secondary" name="happy" style="zoom:2;"></ion-icon> -->
77
+ <!-- --------------------------------------------- -->
78
+ <!-- Emoji Picker Button tooltip="{{translationMap?.get('CANNED_RESPONSES')}}" [options]="tooltipOptions" placement="top" -->
79
+ <!-- --------------------------------------------- -->
80
+ <div class="emoji-picker-btn-wpr">
81
+ <ion-button ion-button fill="clear" class="emoji-picker-btn" (click)="showEmojiPicker = !showEmojiPicker"
82
+ [disabled]="disableTextarea">
83
+ <!-- <ion-icon slot="icon-only" lazy="true" name="flash-outline" style="font-size: 24px;"></ion-icon> -->
84
+ <ion-icon slot="icon-only" lazy="true" name="happy-outline" style="font-size: 24px;"></ion-icon>
85
+ </ion-button>
86
+
87
+ <!-- <div class="emojiContainer" [style.height]="showEmojiPicker?'300px':'0px'"> -->
88
+ <!--Show/Hide emoji picker. Don't use *ngIf because the component will be created again and again and cause performance issue-->
89
+ <!-- <emoji-picker (onEmojiSelect)="addEmoji($event)"></emoji-picker> -->
90
+ <!-- { position: 'absolute', bottom: '20px', right: '20px' }" -->
91
+ <!-- --------------------------------------------------------------------- -->
92
+ <!-- https://www.npmjs.com/package/@ctrl/ngx-emoji-mart/v/1.0.6 -->
93
+ <!-- --------------------------------------------------------------------- -->
94
+ <!-- [style]="{ position: 'absolute', bottom: '53px', right: '-246px' }" -->
95
+ <emoji-mart [showPreview]="false" [perLine]="emojiPerLine" [style.visibility]="showEmojiPicker?'visible':'hidden'"
96
+ (emojiSelect)="addEmoji($event)" [ngClass]="{'emoji-mart-desktop': !IS_ON_MOBILE_DEVICE, 'emoji-mart-mobile': IS_ON_MOBILE_DEVICE }">
97
+ </emoji-mart>
98
+ <!-- </div> -->
99
+
67
100
  </div>
68
101
  </div>
69
102
 
70
- <div class="text-message" [ngClass]="{'text-message-no-cr': areVisibleCAR === false}">
103
+
104
+
105
+
106
+
107
+ <div class="text-message" [ngClass]="{'text-message-no-cr': areVisibleCAR === false || support_mode === false}">
71
108
  <ion-textarea id="ion-textarea" #messageTextArea #message_text_area #textArea rows="1"
72
109
  [placeholder]="TEXAREA_PLACEHOLDER" autosize="false" auto-grow="true" autofocus="true" [value]=""
73
110
  [(ngModel)]="messageString" (ionChange)="ionChange($event);" [disabled]="disableTextarea"
@@ -44,8 +44,12 @@
44
44
  position: relative;
45
45
  // margin: 0 35px;
46
46
  // width: calc(100% - 70px);
47
- margin: 0 70px;
48
- width: calc(100% - 100px);
47
+ // ----- new after adding canned open /close canned responses
48
+ // margin: 0 70px;
49
+ // width: calc(100% - 100px);
50
+ // ----- new after adding emoji picker
51
+ margin: 0 108px;
52
+ width: calc(100% - 140px);
49
53
  ion-textarea {
50
54
  // border-radius: 4px;
51
55
  border-radius: 20px; // NK edited
@@ -68,8 +72,8 @@
68
72
  }
69
73
  }
70
74
  .text-message-no-cr {
71
- margin: 0 35px !important;
72
- width: calc(100% - 70px) !important;
75
+ margin: 0 72px !important;
76
+ width: calc(100% - 101px) !important;
73
77
  }
74
78
  }
75
79
 
@@ -106,7 +110,6 @@
106
110
  height: 33px !important;
107
111
  }
108
112
 
109
-
110
113
  .canned-responses-btn {
111
114
  --padding-bottom: 0px;
112
115
  --padding-top: 0px;
@@ -115,7 +118,17 @@
115
118
  --padding-start: 2px;
116
119
  height: 33px !important;
117
120
  width: 33px;
118
- }
121
+ }
122
+
123
+ .emoji-picker-btn {
124
+ --padding-bottom: 0px;
125
+ --padding-top: 0px;
126
+ --border-radius: 50%;
127
+ --padding-end: 2px;
128
+ --padding-start: 2px;
129
+ height: 33px !important;
130
+ width: 33px;
131
+ }
119
132
 
120
133
  .no-canned-responses-btn-badge {
121
134
  position: absolute;
@@ -129,7 +142,7 @@
129
142
  cursor: pointer;
130
143
  }
131
144
  .no-canned-responses-btn-badge:hover {
132
- background-color: rgba(0, 0, 0, 0.05);;
145
+ background-color: rgba(0, 0, 0, 0.05);
133
146
  }
134
147
 
135
148
  .canned-responses-btn-badge {
@@ -145,10 +158,9 @@
145
158
  }
146
159
 
147
160
  .canned-responses-btn-badge:hover {
148
- background-color: rgba(0, 0, 0, 0.05);;
161
+ background-color: rgba(0, 0, 0, 0.05);
149
162
  }
150
163
 
151
-
152
164
  .upload-image-btn .button-native {
153
165
  border-radius: 50%;
154
166
  }
@@ -163,6 +175,17 @@
163
175
  pointer-events: none;
164
176
  }
165
177
 
178
+ .emoji-mart-desktop {
179
+ position: absolute;
180
+ bottom: 53px;
181
+ right: -246px;
182
+ }
183
+ .emoji-mart-mobile {
184
+ position: absolute;
185
+ bottom: 50px;
186
+ right: -123px;
187
+ width: 230px;
188
+ }
166
189
  // input[placeholder] { text-overflow: ellipsis; }
167
190
  // ::-moz-placeholder { text-overflow: ellipsis; } /* firefox 19+ */
168
191
  // input:-moz-placeholder { text-overflow: ellipsis; }
@@ -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"
@@ -71,11 +71,12 @@
71
71
  </li>
72
72
 
73
73
  <!-- ------------------------------------------- -->
74
- <!-- HOME -->
74
+ <!-- HOME (click)="goToHome()"" -->
75
75
  <!-- ------------------------------------------- -->
76
- <li (click)="goToHome()" matTooltip="Home" #tooltip="matTooltip" matTooltipPosition='right'
76
+
77
+ <li matTooltip="Home" #tooltip="matTooltip" matTooltipPosition='right'
77
78
  matTooltipHideDelay="100" matTooltipClass="custom-mat-tooltip">
78
- <a class="customAncor">
79
+ <a target="_self" href="{{ dashboard_home_url }}" class="customAncor">
79
80
  <i class="material-icons sidebar-icons">
80
81
  home
81
82
  </i>
@@ -84,16 +85,16 @@
84
85
 
85
86
 
86
87
  <!-- ---------------------------------- -->
87
- <!-- Bot -->
88
+ <!-- Bot (click)="goToBots()" -->
88
89
  <!-- ---------------------------------- -->
89
90
  <ng-container *ngIf="USER_ROLE !== 'agent'">
90
- <li (click)="goToBots()" id="bot-anchor-wpr" matTooltipClass="custom-mat-tooltip" matTooltip="Bots"
91
+ <li id="bot-anchor-wpr" matTooltipClass="custom-mat-tooltip" matTooltip="Bots"
91
92
  #tooltip="matTooltip" matTooltipPosition='right' matTooltipHideDelay="100" style="text-align: center;">
92
- <a id="bot-anchor" #botbtn class="customAncor" style="height: 40px;margin-right: 0px !important;">
93
+ <a target="_self" href="{{ dashboard_bots_url }}" id="bot-anchor" #botbtn class="customAncor" style="height: 40px;margin-right: 0px !important;">
93
94
  <span class="bot-icon-wpr">
94
95
  <svg version="1.1" id="Objects" xmlns="http://www.w3.org/2000/svg"
95
96
  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;">
97
+ style="enable-background:new 0 0 30 30;" xml:space="preserve" style="width: 25px;height: 25px;margin-top: 7px;">
97
98
  <g>
98
99
  <g>
99
100
  <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
@@ -114,17 +115,17 @@
114
115
  </ng-container>
115
116
 
116
117
  <!-- ------------------------------------------- -->
117
- <!-- Conversations (VISITORS) {{ conversations_lbl }} -->
118
+ <!-- Conversations (MONITOR) (click)="goToConversations()" -->
118
119
  <!-- ------------------------------------------- -->
119
120
  <ng-container *ngIf="USER_ROLE !== 'agent'">
120
- <li (click)="goToConversations()" matTooltipClass="custom-mat-tooltip" matTooltip="Monitor"
121
+ <li matTooltipClass="custom-mat-tooltip" matTooltip="Monitor"
121
122
  #tooltip="matTooltip" matTooltipPosition='right' matTooltipHideDelay="100" style="text-align: center;">
122
- <a class="customAncor" style="height: 40px;margin-right: 0px !important;">
123
+ <a target="_self" href="{{ dashboard_convs_url }}" class="customAncor" style="height: 40px;margin-right: 0px !important;">
123
124
  <!-- <i class="material-icons sidebar-icons">forum</i> -->
124
125
  <span class="realtime-icon-wpr" >
125
126
 
126
127
  <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;">
128
+ 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
129
 
129
130
  <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
131
  l0.9,0c0.5-0.7,1-1.4,1.4-2L17.9,11.6z"/>
@@ -136,27 +137,27 @@
136
137
  </ng-container>
137
138
 
138
139
  <!-- ------------------------------------------- -->
139
- <!-- CONTACTS (LEADS) -->
140
+ <!-- CONTACTS (LEADS) (click)="goToContacts()" -->
140
141
  <!-- ------------------------------------------- -->
141
- <li (click)="goToContacts()" matTooltipClass="custom-mat-tooltip" matTooltip="{{ contacts_lbl }}"
142
+ <li matTooltipClass="custom-mat-tooltip" matTooltip="{{ contacts_lbl }}"
142
143
  #tooltip="matTooltip" matTooltipPosition='right' matTooltipHideDelay="100" style="text-align: center;">
143
- <a class="customAncor">
144
+ <a target="_self" href="{{ dashboard_contacts_url }}" class="customAncor">
144
145
  <i class="material-icons sidebar-icons">contacts</i>
145
146
  </a>
146
147
  </li>
147
148
 
148
149
  <!-- ------------------------------------------- -->
149
- <!-- APPS -->
150
+ <!-- APPS (click)="goToAppStore()" -->
150
151
  <!-- ------------------------------------------- -->
151
152
  <ng-container *ngIf="isVisibleAPP && USER_ROLE !== 'agent'">
152
- <li (click)="goToAppStore()" matTooltipClass="custom-mat-tooltip" matTooltip="{{ apps_lbl }}"
153
+ <li matTooltipClass="custom-mat-tooltip" matTooltip="{{ apps_lbl }}"
153
154
  #tooltip="matTooltip" matTooltipPosition='right' matTooltipHideDelay="100" style="text-align: center;">
154
- <a class="customAncor" style="margin-right: 0px !important;">
155
+ <a target="_self" href="{{ dashboard_app_url }}" class="customAncor" style="margin-right: 0px !important;">
155
156
  <!-- <i class="material-icons sidebar-icons">apps</i> -->
156
157
  <!-- <i class="material-icons sidebar-icons">dashboard_customize</i> -->
157
158
  <span class="dashboard-customize-icon-wpr">
158
159
  <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;">
160
+ 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
161
  <path class="dashboard_customize-st0" d="M0,0h24v24H0V0z"/>
161
162
  <path class="dashboard_customize-st1" d="M3,3h8v8H3V3z M13,3h8v8h-8V3z M3,13h8v8H3V13z M18,13h-2v3h-3v2h3v3h2v-3h3v-2h-3V13z"/>
162
163
  </svg>
@@ -166,18 +167,18 @@
166
167
  </ng-container>
167
168
 
168
169
  <!-- ------------------------------------------- -->
169
- <!-- ANALYTICS -->
170
+ <!-- ANALYTICS (click)="goToAnalytics()" -->
170
171
  <!-- ------------------------------------------- -->
171
172
  <ng-container *ngIf="isVisibleANA && USER_ROLE !== 'agent'">
172
- <li (click)="goToAnalytics()" matTooltipClass="custom-mat-tooltip" matTooltip="{{ analytics_lbl }}"
173
- #tooltip="matTooltip" matTooltipPosition='right' matTooltipHideDelay="100" style="text-align: center;">
174
- <a class="customAncor" style="margin-right: 0px !important;">
173
+ <li matTooltipClass="custom-mat-tooltip" matTooltip="{{ analytics_lbl }}"
174
+ #tooltip="matTooltip" matTooltipPosition='right' matTooltipHideDelay="100" style="text-align: center;" >
175
+ <a target="_self" href="{{ dashboard_analytics_url }}" class="customAncor" style="margin-right: 0px !important;">
175
176
  <!-- <i class="material-icons sidebar-icons">trending_up</i> -->
176
177
  <!-- <i class="material-icons sidebar-icons"> analytics </i> -->
177
178
  <!-- <i class="material-icons sidebar-icons"> bar_chart </i> -->
178
179
  <span class="bar-chart-icon-wpr">
179
180
  <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;">
181
+ 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
182
  <path class="bar-chart-icon-st0" d="M0,0h24v24H0V0z"/>
182
183
  <path class="bar-chart-icon-st1" d="M5,9.2h3V19H5V9.2z M10.6,5h2.8v14h-2.8V5z M16.2,13H19v6h-2.8V13z"/>
183
184
  </svg>
@@ -187,12 +188,12 @@
187
188
  </ng-container>
188
189
 
189
190
  <!-- ------------------------------------------- -->
190
- <!-- ACTIVITIES -->
191
+ <!-- ACTIVITIES (click)="goToActivities()" -->
191
192
  <!-- ------------------------------------------- -->
192
193
  <ng-container *ngIf="isVisibleACT">
193
- <li *ngIf="USER_ROLE !== 'agent'" (click)="goToActivities()" matTooltipClass="custom-mat-tooltip"
194
+ <li *ngIf="USER_ROLE !== 'agent'" matTooltipClass="custom-mat-tooltip"
194
195
  matTooltip="{{ activities_lbl }}" #tooltip="matTooltip" matTooltipPosition='right' matTooltipHideDelay="100" style="text-align: center;">
195
- <a class="customAncor">
196
+ <a target="_self" href="{{ dashboard_activities_url }}" class="customAncor">
196
197
  <i class="material-icons sidebar-icons">assignment</i>
197
198
  </a>
198
199
  </li>
@@ -200,21 +201,21 @@
200
201
 
201
202
 
202
203
  <!-- ------------------------------------------- -->
203
- <!-- REQUESTS HISTORY -->
204
+ <!-- REQUESTS HISTORY (click)="goToHistory()" -->
204
205
  <!-- ------------------------------------------- -->
205
- <li (click)="goToHistory()" matTooltipClass="custom-mat-tooltip" matTooltip="{{ history_lbl }}"
206
+ <li matTooltipClass="custom-mat-tooltip" matTooltip="{{ history_lbl }}"
206
207
  #tooltip="matTooltip" matTooltipPosition='right' matTooltipHideDelay="100" style="text-align: center;">
207
- <a class="customAncor">
208
+ <a target="_self" href="{{ dashboard_history_url }}" class="customAncor">
208
209
  <i class="material-icons sidebar-icons">history</i>
209
210
  </a>
210
211
  </li>
211
212
 
212
- <!-- ------------------------------------------- -->
213
- <!-- SETTINGS -->
214
- <!-- ------------------------------------------- -->
215
- <li *ngIf="USER_ROLE !== 'agent'" (click)="goToSettings_CannedResponses()" matTooltipClass="custom-mat-tooltip"
213
+ <!-- ----------------------------------------------------------------------------------- -->
214
+ <!-- SETTINGS // old: goToSettings_CannedResponses() *ngIf="USER_ROLE !== 'agent'" (click)="goToWidgetSetUpOrToCannedResponses()" -->
215
+ <!-- ----------------------------------------------------------------------------------- -->
216
+ <li matTooltipClass="custom-mat-tooltip"
216
217
  matTooltip="{{ settings_lbl }}" #tooltip="matTooltip" matTooltipPosition='right' matTooltipHideDelay="100" style="text-align: center;">
217
- <a class="customAncor">
218
+ <a target="_self" href="{{ dashboard_settings_url }}" class="customAncor">
218
219
  <i class="material-icons sidebar-icons">settings</i>
219
220
  </a>
220
221
  </li>