@chat21/chat21-ionic 3.0.61-rc8 → 3.0.62

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 (90) hide show
  1. package/CHANGELOG.md +81 -0
  2. package/README.md +6 -0
  3. package/angular.json +2 -0
  4. package/config.xml +0 -1
  5. package/deploy_pre.sh +1 -1
  6. package/deploy_prod.sh +1 -1
  7. package/env.sample +1 -1
  8. package/package.json +4 -4
  9. package/src/app/app-routing.module.ts +15 -0
  10. package/src/app/app.component.ts +12 -9
  11. package/src/app/app.module.ts +11 -3
  12. package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.html +36 -25
  13. package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.scss +160 -50
  14. package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.ts +108 -18
  15. package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.html +21 -36
  16. package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.scss +19 -7
  17. package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.ts +35 -40
  18. package/src/app/chatlib/conversation-detail/message/message-attachment/message-attachment.component.scss +1 -1
  19. package/src/app/chatlib/list-conversations-component/list-conversations/list-conversations.component.ts +13 -10
  20. package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.html +3 -2
  21. package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.scss +2 -0
  22. package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.ts +142 -71
  23. package/src/app/components/conversation-detail/message-text-area/message-text-area.component.html +57 -20
  24. package/src/app/components/conversation-detail/message-text-area/message-text-area.component.scss +32 -9
  25. package/src/app/components/conversation-detail/message-text-area/message-text-area.component.ts +98 -24
  26. package/src/app/components/ddp-header/ddp-header.component.html +9 -2
  27. package/src/app/components/ddp-header/ddp-header.component.ts +93 -18
  28. package/src/app/components/project-item/project-item.component.html +1 -1
  29. package/src/app/components/project-item/project-item.component.scss +1 -1
  30. package/src/app/components/project-item/project-item.component.ts +3 -3
  31. package/src/app/components/sidebar/sidebar.component.html +65 -52
  32. package/src/app/components/sidebar/sidebar.component.scss +23 -0
  33. package/src/app/components/sidebar/sidebar.component.ts +74 -26
  34. package/src/app/components/sidebar-user-details/sidebar-user-details.component.html +20 -9
  35. package/src/app/components/sidebar-user-details/sidebar-user-details.component.scss +30 -5
  36. package/src/app/components/sidebar-user-details/sidebar-user-details.component.ts +24 -8
  37. package/src/app/pages/conversation-detail/conversation-detail.module.ts +5 -1
  38. package/src/app/pages/conversation-detail/conversation-detail.page.html +19 -10
  39. package/src/app/pages/conversation-detail/conversation-detail.page.scss +28 -0
  40. package/src/app/pages/conversation-detail/conversation-detail.page.ts +229 -389
  41. package/src/app/pages/conversations-list/conversations-list.page.ts +646 -454
  42. package/src/app/pages/create-canned-response/create-canned-response-routing.module.ts +17 -0
  43. package/src/app/pages/create-canned-response/create-canned-response.module.ts +30 -0
  44. package/src/app/pages/create-canned-response/create-canned-response.page.html +150 -0
  45. package/src/app/pages/create-canned-response/create-canned-response.page.scss +55 -0
  46. package/src/app/pages/create-canned-response/create-canned-response.page.spec.ts +24 -0
  47. package/src/app/pages/create-canned-response/create-canned-response.page.ts +319 -0
  48. package/src/app/pages/create-requester/create-requester-routing.module.ts +17 -0
  49. package/src/app/pages/create-requester/create-requester.module.ts +28 -0
  50. package/src/app/pages/create-requester/create-requester.page.html +67 -0
  51. package/src/app/pages/create-requester/create-requester.page.scss +30 -0
  52. package/src/app/pages/create-requester/create-requester.page.spec.ts +24 -0
  53. package/src/app/pages/create-requester/create-requester.page.ts +138 -0
  54. package/src/app/pages/create-ticket/create-ticket-routing.module.ts +17 -0
  55. package/src/app/pages/create-ticket/create-ticket.module.ts +28 -0
  56. package/src/app/pages/create-ticket/create-ticket.page.html +171 -0
  57. package/src/app/pages/create-ticket/create-ticket.page.scss +52 -0
  58. package/src/app/pages/create-ticket/create-ticket.page.spec.ts +24 -0
  59. package/src/app/pages/create-ticket/create-ticket.page.ts +432 -0
  60. package/src/app/pages/loader-preview/loader-preview.page.ts +2 -11
  61. package/src/app/pages/profile-info/profile-info.page.html +2 -2
  62. package/src/app/pages/profile-info/profile-info.page.scss +12 -1
  63. package/src/app/services/tiledesk/tiledesk.service.ts +190 -0
  64. package/src/app/shared/shared.module.ts +1 -1
  65. package/src/assets/i18n/de.json +37 -1
  66. package/src/assets/i18n/en.json +37 -1
  67. package/src/assets/i18n/es.json +38 -2
  68. package/src/assets/i18n/fr.json +38 -2
  69. package/src/assets/i18n/it.json +38 -2
  70. package/src/assets/i18n/pt.json +38 -2
  71. package/src/assets/i18n/ru.json +38 -2
  72. package/src/assets/i18n/sr.json +38 -2
  73. package/src/assets/i18n/tr.json +37 -1
  74. package/src/assets/images/default-avatar-x-select.png +0 -0
  75. package/src/assets/images/priority_icons/high.svg +3 -0
  76. package/src/assets/images/priority_icons/high_v2.svg +14 -0
  77. package/src/assets/images/priority_icons/low.svg +10 -0
  78. package/src/assets/images/priority_icons/low_v2.svg +14 -0
  79. package/src/assets/images/priority_icons/medium.svg +16 -0
  80. package/src/assets/images/priority_icons/medium_v2.svg +11 -0
  81. package/src/assets/images/priority_icons/urgent.svg +4 -0
  82. package/src/assets/images/priority_icons/urgent_v2.svg +16 -0
  83. package/src/chat-config-mqtt.json +25 -16
  84. package/src/chat-config-pre-test.json +1 -1
  85. package/src/chat-config-template.json +5 -4
  86. package/src/chat-config.json +1 -0
  87. package/src/chat21-core/providers/firebase/firebase-conversation-handler.ts +8 -3
  88. package/src/chat21-core/utils/constants.ts +2 -0
  89. package/src/chat21-core/utils/utils-message.ts +19 -0
  90. package/src/global.scss +33 -9
@@ -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
  // ---------------------------------------------------------
@@ -104,7 +109,12 @@ export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChange
104
109
 
105
110
  ngOnInit() {
106
111
  // this.setSubscriptions();
112
+
107
113
  this.logger.log("[CONVS-DETAIL] [MSG-TEXT-AREA] HELLO !!!!! ");
114
+ this.logger.log("[CONVS-DETAIL] [MSG-TEXT-AREA] areVisibleCAR ", this.areVisibleCAR);
115
+ if (this.areVisibleCAR === false) {
116
+ this.emojiPerLine = 7
117
+ }
108
118
  // this.events.subscribe((cannedmessage) => {
109
119
  // this.logger.log("[CONVS-DETAIL] [MSG-TEXT-AREA] events.subscribe cannedmessage ", cannedmessage);
110
120
  // })
@@ -112,12 +122,24 @@ export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChange
112
122
  // this.logger.log("[CONVS-DETAIL][MSG-TEXT-AREA] LONG_TEXAREA_PLACEHOLDER ", this.LONG_TEXAREA_PLACEHOLDER);
113
123
  // this.logger.log("[CONVS-DETAIL][MSG-TEXT-AREA] SHORT_TEXAREA_PLACEHOLDER ", this.SHORT_TEXAREA_PLACEHOLDER);
114
124
  // this.logger.log("[CONVS-DETAIL][MSG-TEXT-AREA] SHORTER_TEXAREA_PLACEHOLDER ", this.SHORTER_TEXAREA_PLACEHOLDER);
115
-
125
+ this.listenToNewCannedResponseCreated()
116
126
  this.getWindowWidth();
127
+ this.isOnMobileDevice()
128
+ }
129
+
130
+ isOnMobileDevice() {
131
+ this.IS_ON_MOBILE_DEVICE = false;
132
+ if (/Android|iPhone/i.test(window.navigator.userAgent)) {
133
+ this.IS_ON_MOBILE_DEVICE = true;
134
+ this.emojiPerLine = 7
135
+ }
136
+ // this.logger.log('[APP-COMP] IS_ON_MOBILE_DEVICE', this.IS_ON_MOBILE_DEVICE)
137
+ return this.IS_ON_MOBILE_DEVICE;
117
138
  }
118
139
 
119
140
 
120
141
 
142
+
121
143
  ngOnChanges() {
122
144
  if (this.translationMap) {
123
145
  // this.LONG_TEXAREA_PLACEHOLDER = this.translationMap.get('LABEL_ENTER_MSG')
@@ -125,7 +147,7 @@ export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChange
125
147
  // this.SHORTER_TEXAREA_PLACEHOLDER = this.translationMap.get('LABEL_ENTER_MSG_SHORTER')
126
148
 
127
149
  this.TEXAREA_PLACEHOLDER = this.translationMap.get('LABEL_ENTER_MSG_SHORT')
128
-
150
+
129
151
  }
130
152
 
131
153
  if (this.conversationWith.startsWith("support-group")) {
@@ -133,11 +155,12 @@ export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChange
133
155
  } else {
134
156
  this.IS_SUPPORT_GROUP_CONVERSATION = false
135
157
  }
158
+ this.logger.log('[CONVS-DETAIL][MSG-TEXT-AREA] ngOnChanges support_mode ', this.support_mode)
136
159
  this.logger.log('[CONVS-DETAIL][MSG-TEXT-AREA] ngOnChanges disableTextarea ', this.disableTextarea)
137
160
  this.logger.log("[CONVS-DETAIL][MSG-TEXT-AREA] ngOnChanges DROP EVENT ", this.dropEvent);
138
161
  this.logger.log("[CONVS-DETAIL][MSG-TEXT-AREA] ngOnChanges tagsCannedFilter ", this.tagsCannedFilter);
139
162
  this.logger.log("[CONVS-DETAIL][MSG-TEXT-AREA] ngOnChanges areVisibleCAR; ", this.areVisibleCAR);
140
-
163
+
141
164
 
142
165
  this.logger.log('[CONVS-DETAIL] - returnChangeTextArea ngOnChanges in [MSG-TEXT-AREA] this.tagsCannedFilter.length ', this.tagsCannedFilter.length)
143
166
 
@@ -218,8 +241,8 @@ export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChange
218
241
  @HostListener('window:resize', ['$event'])
219
242
  onResize(event) {
220
243
  // this.getIfTexareaIsEmpty('onResize')
221
- this.logger.log("[CONVS-DETAIL][MSG-TEXT-AREA] event.target.innerWidth; ", event.target.innerWidth);
222
-
244
+ // console.log("[CONVS-DETAIL][MSG-TEXT-AREA] event.target.innerWidth; ", event.target.innerWidth);
245
+
223
246
 
224
247
 
225
248
  // if (event.target.innerWidth >= 844 && this.isOpenInfoConversation === false && this.conversationWith.startsWith("support-group")) {
@@ -349,7 +372,7 @@ export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChange
349
372
  }
350
373
  // this.logger.log('presentModal e.target.files.length', e.target.files.length);
351
374
 
352
- const attributes = { files: dataFiles, enableBackdropDismiss: false , msg: this.msg};
375
+ const attributes = { files: dataFiles, enableBackdropDismiss: false, msg: this.msg };
353
376
  this.logger.log('[CONVS-DETAIL][MSG-TEXT-AREA] attributes', attributes);
354
377
  const modal: HTMLIonModalElement =
355
378
  await this.modalController.create({
@@ -546,28 +569,21 @@ export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChange
546
569
  }
547
570
  }
548
571
  }
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
-
558
- // }
559
572
 
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)
573
+ listenToNewCannedResponseCreated() {
574
+ this.eventsService.subscribe('newcannedresponse:created', (openCannedResponses) => {
575
+ this.logger.log('[CONVS-DETAIL][MSG-TEXT-AREA] - listenToNewCannedResponseCreated - openUserDetailsSidebar', openCannedResponses);
576
+ this.openCannedResponses()
577
+ });
578
+ }
565
579
 
580
+ openCannedResponses() {
566
581
  this.hasClickedOpenCannedResponses.emit(true);
567
582
  }
568
583
 
569
584
 
570
585
  sendMessage(text: string) {
586
+ this.showEmojiPicker = false;
571
587
  this.logger.log('[CONVS-DETAIL][MSG-TEXT-AREA] sendMessage text', text);
572
588
  this.logger.log('[CONVS-DETAIL][MSG-TEXT-AREA] sendMessage conve width', this.conversationWith);
573
589
  // text.replace(/\s/g, "")
@@ -578,6 +594,64 @@ export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChange
578
594
  }
579
595
  }
580
596
 
597
+ addEmoji($event) {
598
+ // console.log('[CONVS-DETAIL][MSG-TEXT-AREA] ADD EMOJI $event', $event)
599
+ // console.log('[CONVS-DETAIL][MSG-TEXT-AREA] ADD EMOJI $event > emoji', $event.emoji)
600
+ // console.log('[CONVS-DETAIL][MSG-TEXT-AREA] ADD EMOJI $event > emoji > native', $event.emoji.native)
601
+ // console.log('[CONVS-DETAIL][MSG-TEXT-AREA] ADD EMOJI messageString', this.messageString)
602
+ if (this.messageString === undefined) {
603
+ this.addWhiteSpaceBefore = false;
604
+ // console.log('[CONVS-DETAIL][MSG-TEXT-AREA] ADD EMOJI addWhiteSpaceBefore ', this.addWhiteSpaceBefore)
605
+ } else {
606
+ this.addWhiteSpaceBefore = true
607
+ // console.log('[CONVS-DETAIL][MSG-TEXT-AREA] ADD EMOJI addWhiteSpaceBefore ', this.addWhiteSpaceBefore)
608
+ }
609
+ const elTextArea = this.message_text_area['el'];
610
+ // console.log('[CONVS-DETAIL][MSG-TEXT-AREA] ADD EMOJI elTextArea ', elTextArea)
611
+ this.insertAtCursor(elTextArea, $event.emoji.native)
612
+ }
613
+
614
+ insertAtCursor(myField, myValue) {
615
+ this.logger.log('[CANNED-RES-EDIT-CREATE] - insertAtCursor - myValue ', myValue);
616
+
617
+ if (this.addWhiteSpaceBefore === true) {
618
+ myValue = ' ' + myValue;
619
+ this.logger.log('[CANNED-RES-EDIT-CREATE] - GET TEXT AREA - QUI ENTRO myValue ', myValue);
620
+ }
621
+
622
+ //IE support
623
+ if (myField.selection) {
624
+ myField.focus();
625
+ let sel = myField.selection.createRange();
626
+ sel.text = myValue;
627
+ // this.cannedResponseMessage = sel.text;
628
+ }
629
+ //MOZILLA and others
630
+ else if (myField.selectionStart || myField.selectionStart == '0') {
631
+ var startPos = myField.selectionStart;
632
+ this.logger.log('[CANNED-RES-EDIT-CREATE] - insertAtCursor - startPos ', startPos);
633
+
634
+ var endPos = myField.selectionEnd;
635
+ this.logger.log('[CANNED-RES-EDIT-CREATE] - insertAtCursor - endPos ', endPos);
636
+
637
+ myField.value = myField.value.substring(0, startPos) + myValue + myField.value.substring(endPos, myField.value.length);
638
+
639
+ // place cursor at end of text in text input element
640
+ myField.focus();
641
+ var val = myField.value; //store the value of the element
642
+ myField.value = ''; //clear the value of the element
643
+ myField.value = val + ' '; //set that value back.
644
+
645
+
646
+ // myField.select();
647
+ } else {
648
+ myField.value += myValue;
649
+
650
+ }
651
+ }
652
+
653
+
654
+
581
655
  // --------------------------------
582
656
  // on mobile !
583
657
  // --------------------------------
@@ -13,13 +13,20 @@
13
13
 
14
14
  <ion-buttons slot="end">
15
15
 
16
- <ion-button *ngIf="archived_btn" ion-button fill="clear" (click)="onClickArchivedConversation()">
16
+ <ion-button ion-button fill="clear" (click)="presentCreateTicketModal()"
17
+ tooltip="{{translationMap?.get('CreateTicket')}}" [options]="tooltipOptions" placement="bottom">
18
+ <ion-icon slot="icon-only" name="ticket-outline"></ion-icon>
19
+ </ion-button>
20
+
21
+ <ion-button *ngIf="archived_btn" ion-button fill="clear" (click)="onClickArchivedConversation()"
22
+ tooltip="{{translationMap?.get('ViewArchivedConversations')}}" [options]="tooltipOptions" placement="bottom">
17
23
  <ion-icon slot="icon-only" name="file-tray-full-outline"></ion-icon>
18
24
  <!-- <ion-icon name="file-tray-stacked-outline"></ion-icon> -->
19
25
  <!-- <ion-icon name="file-tray-full-outline"></ion-icon> -->
20
26
  </ion-button>
21
27
 
22
- <ion-button *ngIf="writeto_btn" ion-button fill="clear" (click)="onOpenContactsDirectory($event)">
28
+ <ion-button *ngIf="writeto_btn" ion-button fill="clear" (click)="onOpenContactsDirectory($event)"
29
+ tooltip="{{translationMap?.get('ViewContactsList')}}" [options]="tooltipOptions" placement="bottom">
23
30
  <ion-icon slot="icon-only" name="create-outline"></ion-icon>
24
31
  <!-- <ion-icon slot="icon-only" name="people-outline"></ion-icon> -->
25
32
 
@@ -1,32 +1,76 @@
1
- import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
2
- import { EventsService } from 'src/app/services/events-service';
1
+ import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core'
2
+ import { ModalController } from '@ionic/angular'
3
+ import { EventsService } from 'src/app/services/events-service'
4
+ import { CreateTicketPage } from 'src/app/pages/create-ticket/create-ticket.page'
5
+ import { CustomTranslateService } from 'src/chat21-core/providers/custom-translate.service'
3
6
  @Component({
4
7
  selector: 'app-ddp-header',
5
8
  templateUrl: './ddp-header.component.html',
6
9
  styleUrls: ['./ddp-header.component.scss'],
7
10
  })
8
11
  export class DdpHeaderComponent implements OnInit {
9
- @Input() numberOpenConv: number;
10
- @Input() supportMode: boolean;
11
- @Input() archived_btn: boolean;
12
- @Input() writeto_btn: boolean;
13
- @Output() openContactsDirectory = new EventEmitter();
14
- @Output() openProfileInfo = new EventEmitter();
15
- IS_ON_MOBILE_DEVICE: boolean;
16
-
12
+ @Input() numberOpenConv: number
13
+ @Input() supportMode: boolean
14
+ @Input() archived_btn: boolean
15
+ @Input() writeto_btn: boolean
16
+ @Output() openContactsDirectory = new EventEmitter()
17
+ @Output() openProfileInfo = new EventEmitter()
18
+ IS_ON_MOBILE_DEVICE: boolean
19
+ createTicketModal = null
20
+ public translationMap: Map<string, string>;
21
+ tooltipOptions = {
22
+ 'show-delay': 0,
23
+ 'tooltip-class': 'chat-tooltip',
24
+ 'theme': 'light',
25
+ 'shadow': false,
26
+ 'hide-delay-mobile': 0,
27
+ 'hideDelayAfterClick': 3000,
28
+ 'hide-delay': 0
29
+ };
17
30
  constructor(
18
31
  public events: EventsService,
19
- ) {
20
- this.isOnMobileDevice()
32
+ public modalController: ModalController,
33
+ private translateService: CustomTranslateService,
34
+ ) {
35
+ this.isOnMobileDevice();
36
+ this.translations();
37
+ // this.listenToCloseCreateTicketModal() // published from create ticket page
38
+ }
39
+
40
+ public translations() {
41
+ const keys = [
42
+ 'CreateTicket',
43
+ 'ViewArchivedConversations',
44
+ 'ViewContactsList'
45
+ ];
46
+ this.translationMap = this.translateService.translateLanguage(keys);
21
47
  }
22
48
 
49
+ // listenToCloseCreateTicketModal() {
50
+ // this.events.subscribe('closeModalCreateTicket', (bool) => {
51
+ // console.log('[HEADER-CONV] closeModalCreateTicket ', bool)
52
+ // if (bool === true) {
53
+ // this.closeCreateTicketModal()
54
+
55
+ // }
56
+ // })
57
+ // }
58
+
59
+ // closeCreateTicketModal() {
60
+ // if (this.createTicketModal) {
61
+ // this.createTicketModal.dismiss().then(() => {
62
+ // this.createTicketModal = null;
63
+ // });
64
+ // }
65
+ // }
66
+
23
67
  isOnMobileDevice() {
24
- this.IS_ON_MOBILE_DEVICE = false;
68
+ this.IS_ON_MOBILE_DEVICE = false
25
69
  if (/Android|iPhone/i.test(window.navigator.userAgent)) {
26
- this.IS_ON_MOBILE_DEVICE = true;
70
+ this.IS_ON_MOBILE_DEVICE = true
27
71
  }
28
72
  // console.log('[DDP-HEADER] IS_ON_MOBILE_DEVICE', this.IS_ON_MOBILE_DEVICE)
29
- return this.IS_ON_MOBILE_DEVICE;
73
+ return this.IS_ON_MOBILE_DEVICE
30
74
  }
31
75
 
32
76
  ngOnInit() {
@@ -36,17 +80,48 @@ export class DdpHeaderComponent implements OnInit {
36
80
  // START @Output() //
37
81
  /** */
38
82
  onOpenProfileInfo(e: any) {
39
- this.openProfileInfo.emit(e);
83
+ this.openProfileInfo.emit(e)
40
84
  }
41
85
 
42
86
  /** */
43
87
  onOpenContactsDirectory(e: any) {
44
- this.openContactsDirectory.emit(e);
88
+ this.openContactsDirectory.emit(e)
45
89
  }
46
90
  // END @Output() //
47
91
 
48
92
  onClickArchivedConversation() {
49
- this.events.publish('profileInfoButtonClick:changed', 'displayArchived');
93
+ this.events.publish('profileInfoButtonClick:changed', 'displayArchived')
50
94
  }
51
95
 
96
+ // PRESENT MODAL CREATE TICKET
97
+ // async presentCreateTicketModal(): Promise<any>{
98
+
99
+ // // const attributes = { enableBackdropDismiss: false };
100
+ // const modal: HTMLIonModalElement =
101
+ // await this.modalController.create({
102
+ // component: CreateTicketPage,
103
+ // // componentProps: attributes,
104
+ // swipeToClose: false,
105
+ // backdropDismiss: false
106
+ // });
107
+ // modal.onDidDismiss().then((detail: any) => {
108
+ // console.log('[DDP-HEADER] ', detail.data);
109
+ // });
110
+ // return await modal.present();
111
+ // }
112
+
113
+ async presentCreateTicketModal() {
114
+ // const attributes = { enableBackdropDismiss: false };
115
+ const modal = await this.modalController.create({
116
+ component: CreateTicketPage,
117
+ // componentProps: attributes,
118
+ swipeToClose: false,
119
+ backdropDismiss: false,
120
+ })
121
+ modal.onDidDismiss().then((detail: any) => {
122
+ // console.log('[DDP-HEADER] ', detail.data)
123
+ })
124
+ modal.present()
125
+ this.createTicketModal = modal
126
+ }
52
127
  }
@@ -88,7 +88,7 @@
88
88
  {{translationMap?.get('Unavailable')}}
89
89
  </span>
90
90
 
91
- <div class="project-item--isBusy-icon-wpr" *ngIf="project?.ws_projct_user_isBusy === true" tooltip=" {{translationMap?.get('Busy')}}"
91
+ <div class="project-item--isBusy-icon-wpr" *ngIf="project?.ws_projct_user_isBusy === true" tooltip="{{translationMap?.get('Busy')}}"
92
92
  [options]="tooltipOptions" placement="top" >
93
93
  <!-- <span class="material-icons project-item--isBusy-icon">
94
94
  access_time
@@ -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
  }
@@ -179,8 +179,8 @@ export class ProjectItemComponent implements OnInit {
179
179
  }
180
180
 
181
181
 
182
- if (!stored_project) {
183
- this.logger.log('PROJECT-ITEM - THERE IS NOT STORED LAST PROJECT ', stored_project)
182
+ if (!stored_project || stored_project === 'undefined') {
183
+ this.logger.log('PROJECT-ITEM - THERE IS NOT STORED LAST PROJECT OR IS UNDEFINED ', stored_project)
184
184
  const tiledeskToken = this.appStorageService.getItem('tiledeskToken');
185
185
  this.logger.log('[PROJECT-ITEM] - GET PROJECTS - tiledeskToken', tiledeskToken);
186
186
  this.tiledeskService.getProjects(tiledeskToken).subscribe(projects => {
@@ -204,7 +204,7 @@ export class ProjectItemComponent implements OnInit {
204
204
  }
205
205
 
206
206
 
207
- if (stored_project) {
207
+ if (stored_project && stored_project !== 'undefined') {
208
208
  this.logger.log('PROJECT-ITEM - THERE IS STORED LAST PROJECT ', stored_project)
209
209
  if (stored_project) {
210
210
  this.project = JSON.parse(stored_project)