@chat21/chat21-ionic 3.0.61-rc5 → 3.0.61
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.
- package/CHANGELOG.md +90 -0
- package/README.md +6 -0
- package/angular.json +2 -0
- package/config.xml +4 -5
- package/deploy_pre.sh +10 -10
- package/deploy_prod.sh +4 -0
- package/env.sample +1 -1
- package/package.json +8 -8
- package/resources/{Android → android}/icon/drawable-hdpi-icon.png +0 -0
- package/resources/{Android → android}/icon/drawable-ldpi-icon.png +0 -0
- package/resources/{Android → android}/icon/drawable-mdpi-icon.png +0 -0
- package/resources/{Android → android}/icon/drawable-xhdpi-icon.png +0 -0
- package/resources/{Android → android}/icon/drawable-xxhdpi-icon.png +0 -0
- package/resources/{Android → android}/icon/drawable-xxxhdpi-icon.png +0 -0
- package/resources/{Android → android}/icon.png +0 -0
- package/resources/{Android → android}/splash/drawable-land-hdpi-screen.png +0 -0
- package/resources/{Android → android}/splash/drawable-land-ldpi-screen.png +0 -0
- package/resources/{Android → android}/splash/drawable-land-mdpi-screen.png +0 -0
- package/resources/{Android → android}/splash/drawable-land-xhdpi-screen.png +0 -0
- package/resources/{Android → android}/splash/drawable-land-xxhdpi-screen.png +0 -0
- package/resources/{Android → android}/splash/drawable-land-xxxhdpi-screen.png +0 -0
- package/resources/{Android → android}/splash/drawable-port-hdpi-screen.png +0 -0
- package/resources/{Android → android}/splash/drawable-port-ldpi-screen.png +0 -0
- package/resources/{Android → android}/splash/drawable-port-mdpi-screen.png +0 -0
- package/resources/{Android → android}/splash/drawable-port-xhdpi-screen.png +0 -0
- package/resources/{Android → android}/splash/drawable-port-xxhdpi-screen.png +0 -0
- package/resources/{Android → android}/splash/drawable-port-xxxhdpi-screen.png +0 -0
- package/resources/{Android → android}/splash.png +0 -0
- package/src/app/app-routing.module.ts +15 -0
- package/src/app/app.component.html +2 -2
- package/src/app/app.component.scss +2 -1
- package/src/app/app.component.ts +34 -20
- package/src/app/app.module.ts +11 -3
- package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.html +36 -25
- package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.scss +160 -50
- package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.ts +108 -18
- package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.html +21 -36
- package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.scss +19 -7
- package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.ts +35 -40
- package/src/app/chatlib/conversation-detail/message/message-attachment/message-attachment.component.scss +1 -1
- package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.ts +78 -15
- package/src/app/chatlib/list-conversations-component/list-conversations/list-conversations.component.ts +13 -10
- package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.html +11 -4
- package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.scss +3 -1
- package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.ts +142 -71
- package/src/app/components/conversation-detail/message-text-area/message-text-area.component.html +59 -22
- package/src/app/components/conversation-detail/message-text-area/message-text-area.component.scss +32 -9
- package/src/app/components/conversation-detail/message-text-area/message-text-area.component.ts +107 -23
- package/src/app/components/ddp-header/ddp-header.component.html +9 -2
- package/src/app/components/ddp-header/ddp-header.component.ts +93 -18
- package/src/app/components/project-item/project-item.component.html +1 -1
- package/src/app/components/project-item/project-item.component.scss +1 -1
- package/src/app/components/project-item/project-item.component.ts +3 -3
- package/src/app/components/sidebar/sidebar.component.html +151 -86
- package/src/app/components/sidebar/sidebar.component.scss +60 -3
- package/src/app/components/sidebar/sidebar.component.ts +173 -47
- package/src/app/components/sidebar-user-details/sidebar-user-details.component.html +26 -7
- package/src/app/components/sidebar-user-details/sidebar-user-details.component.scss +44 -19
- package/src/app/components/sidebar-user-details/sidebar-user-details.component.ts +109 -35
- package/src/app/pages/conversation-detail/conversation-detail.module.ts +5 -1
- package/src/app/pages/conversation-detail/conversation-detail.page.html +19 -9
- package/src/app/pages/conversation-detail/conversation-detail.page.scss +28 -0
- package/src/app/pages/conversation-detail/conversation-detail.page.ts +1124 -778
- package/src/app/pages/conversations-list/conversations-list.page.html +3 -1
- package/src/app/pages/conversations-list/conversations-list.page.ts +647 -445
- package/src/app/pages/create-canned-response/create-canned-response-routing.module.ts +17 -0
- package/src/app/pages/create-canned-response/create-canned-response.module.ts +30 -0
- package/src/app/pages/create-canned-response/create-canned-response.page.html +150 -0
- package/src/app/pages/create-canned-response/create-canned-response.page.scss +55 -0
- package/src/app/pages/create-canned-response/create-canned-response.page.spec.ts +24 -0
- package/src/app/pages/create-canned-response/create-canned-response.page.ts +319 -0
- package/src/app/pages/create-requester/create-requester-routing.module.ts +17 -0
- package/src/app/pages/create-requester/create-requester.module.ts +28 -0
- package/src/app/pages/create-requester/create-requester.page.html +67 -0
- package/src/app/pages/create-requester/create-requester.page.scss +30 -0
- package/src/app/pages/create-requester/create-requester.page.spec.ts +24 -0
- package/src/app/pages/create-requester/create-requester.page.ts +138 -0
- package/src/app/pages/create-ticket/create-ticket-routing.module.ts +17 -0
- package/src/app/pages/create-ticket/create-ticket.module.ts +28 -0
- package/src/app/pages/create-ticket/create-ticket.page.html +171 -0
- package/src/app/pages/create-ticket/create-ticket.page.scss +52 -0
- package/src/app/pages/create-ticket/create-ticket.page.spec.ts +24 -0
- package/src/app/pages/create-ticket/create-ticket.page.ts +432 -0
- package/src/app/pages/loader-preview/loader-preview.page.ts +226 -166
- package/src/app/pages/profile-info/profile-info.page.html +2 -2
- package/src/app/pages/profile-info/profile-info.page.scss +13 -2
- package/src/app/services/tiledesk/tiledesk.service.ts +209 -0
- package/src/app/shared/shared.module.ts +1 -1
- package/src/assets/i18n/de.json +45 -7
- package/src/assets/i18n/en.json +41 -3
- package/src/assets/i18n/es.json +41 -3
- package/src/assets/i18n/fr.json +44 -6
- package/src/assets/i18n/it.json +41 -3
- package/src/assets/i18n/pt.json +41 -3
- package/src/assets/i18n/ru.json +42 -4
- package/src/assets/i18n/sr.json +265 -0
- package/src/assets/i18n/tr.json +41 -4
- package/src/assets/images/default-avatar-x-select.png +0 -0
- package/src/assets/images/priority_icons/high.svg +3 -0
- package/src/assets/images/priority_icons/high_v2.svg +14 -0
- package/src/assets/images/priority_icons/low.svg +10 -0
- package/src/assets/images/priority_icons/low_v2.svg +14 -0
- package/src/assets/images/priority_icons/medium.svg +16 -0
- package/src/assets/images/priority_icons/medium_v2.svg +11 -0
- package/src/assets/images/priority_icons/urgent.svg +4 -0
- package/src/assets/images/priority_icons/urgent_v2.svg +16 -0
- package/src/chat-config-mqtt.json +25 -16
- package/src/chat-config-template.json +5 -4
- package/src/chat-config.json +1 -0
- package/src/chat21-core/providers/firebase/firebase-conversation-handler.ts +8 -3
- package/src/chat21-core/utils/constants.ts +6 -1
- package/src/chat21-core/utils/utils-message.ts +19 -0
- package/src/global.scss +65 -76
- package/publish_pre.sh +0 -33
- package/publish_prod.sh +0 -33
package/src/app/components/conversation-detail/message-text-area/message-text-area.component.ts
CHANGED
|
@@ -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;
|
|
@@ -54,6 +56,7 @@ export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChange
|
|
|
54
56
|
@Output() hasClickedOpenCannedResponses = new EventEmitter<boolean>();
|
|
55
57
|
@Output() eventSendMessage = new EventEmitter<object>();
|
|
56
58
|
@Output() onPresentModalScrollToBottom = new EventEmitter<boolean>();
|
|
59
|
+
@Input() disableTextarea: boolean;
|
|
57
60
|
|
|
58
61
|
public conversationEnabled = false;
|
|
59
62
|
public messageString: string;
|
|
@@ -67,8 +70,9 @@ export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChange
|
|
|
67
70
|
private logger: LoggerService = LoggerInstance.getInstance();
|
|
68
71
|
public countClicks: number = 0;
|
|
69
72
|
public IS_SUPPORT_GROUP_CONVERSATION: boolean;
|
|
70
|
-
|
|
73
|
+
public IS_ON_MOBILE_DEVICE: boolean;
|
|
71
74
|
TYPE_MSG_TEXT = TYPE_MSG_TEXT;
|
|
75
|
+
msg: string
|
|
72
76
|
|
|
73
77
|
tooltipOptions = {
|
|
74
78
|
'show-delay': 500,
|
|
@@ -80,7 +84,9 @@ export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChange
|
|
|
80
84
|
'hide-delay': 200
|
|
81
85
|
};
|
|
82
86
|
|
|
83
|
-
|
|
87
|
+
showEmojiPicker: boolean = false; //To show/hide emoji picker
|
|
88
|
+
addWhiteSpaceBefore: boolean;
|
|
89
|
+
emojiPerLine: number = 9
|
|
84
90
|
/**
|
|
85
91
|
* Constructor
|
|
86
92
|
* @param chooser
|
|
@@ -94,6 +100,7 @@ export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChange
|
|
|
94
100
|
public uploadService: UploadService,
|
|
95
101
|
public toastController: ToastController,
|
|
96
102
|
private renderer: Renderer2,
|
|
103
|
+
public eventsService: EventsService
|
|
97
104
|
) { }
|
|
98
105
|
|
|
99
106
|
// ---------------------------------------------------------
|
|
@@ -102,7 +109,12 @@ export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChange
|
|
|
102
109
|
|
|
103
110
|
ngOnInit() {
|
|
104
111
|
// this.setSubscriptions();
|
|
112
|
+
|
|
105
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
|
+
}
|
|
106
118
|
// this.events.subscribe((cannedmessage) => {
|
|
107
119
|
// this.logger.log("[CONVS-DETAIL] [MSG-TEXT-AREA] events.subscribe cannedmessage ", cannedmessage);
|
|
108
120
|
// })
|
|
@@ -110,12 +122,24 @@ export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChange
|
|
|
110
122
|
// this.logger.log("[CONVS-DETAIL][MSG-TEXT-AREA] LONG_TEXAREA_PLACEHOLDER ", this.LONG_TEXAREA_PLACEHOLDER);
|
|
111
123
|
// this.logger.log("[CONVS-DETAIL][MSG-TEXT-AREA] SHORT_TEXAREA_PLACEHOLDER ", this.SHORT_TEXAREA_PLACEHOLDER);
|
|
112
124
|
// this.logger.log("[CONVS-DETAIL][MSG-TEXT-AREA] SHORTER_TEXAREA_PLACEHOLDER ", this.SHORTER_TEXAREA_PLACEHOLDER);
|
|
113
|
-
|
|
125
|
+
this.listenToNewCannedResponseCreated()
|
|
114
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;
|
|
115
138
|
}
|
|
116
139
|
|
|
117
140
|
|
|
118
141
|
|
|
142
|
+
|
|
119
143
|
ngOnChanges() {
|
|
120
144
|
if (this.translationMap) {
|
|
121
145
|
// this.LONG_TEXAREA_PLACEHOLDER = this.translationMap.get('LABEL_ENTER_MSG')
|
|
@@ -123,6 +147,7 @@ export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChange
|
|
|
123
147
|
// this.SHORTER_TEXAREA_PLACEHOLDER = this.translationMap.get('LABEL_ENTER_MSG_SHORTER')
|
|
124
148
|
|
|
125
149
|
this.TEXAREA_PLACEHOLDER = this.translationMap.get('LABEL_ENTER_MSG_SHORT')
|
|
150
|
+
|
|
126
151
|
}
|
|
127
152
|
|
|
128
153
|
if (this.conversationWith.startsWith("support-group")) {
|
|
@@ -130,11 +155,12 @@ export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChange
|
|
|
130
155
|
} else {
|
|
131
156
|
this.IS_SUPPORT_GROUP_CONVERSATION = false
|
|
132
157
|
}
|
|
133
|
-
|
|
158
|
+
this.logger.log('[CONVS-DETAIL][MSG-TEXT-AREA] ngOnChanges support_mode ', this.support_mode)
|
|
159
|
+
this.logger.log('[CONVS-DETAIL][MSG-TEXT-AREA] ngOnChanges disableTextarea ', this.disableTextarea)
|
|
134
160
|
this.logger.log("[CONVS-DETAIL][MSG-TEXT-AREA] ngOnChanges DROP EVENT ", this.dropEvent);
|
|
135
161
|
this.logger.log("[CONVS-DETAIL][MSG-TEXT-AREA] ngOnChanges tagsCannedFilter ", this.tagsCannedFilter);
|
|
136
162
|
this.logger.log("[CONVS-DETAIL][MSG-TEXT-AREA] ngOnChanges areVisibleCAR; ", this.areVisibleCAR);
|
|
137
|
-
|
|
163
|
+
|
|
138
164
|
|
|
139
165
|
this.logger.log('[CONVS-DETAIL] - returnChangeTextArea ngOnChanges in [MSG-TEXT-AREA] this.tagsCannedFilter.length ', this.tagsCannedFilter.length)
|
|
140
166
|
|
|
@@ -215,8 +241,8 @@ export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChange
|
|
|
215
241
|
@HostListener('window:resize', ['$event'])
|
|
216
242
|
onResize(event) {
|
|
217
243
|
// this.getIfTexareaIsEmpty('onResize')
|
|
218
|
-
|
|
219
|
-
|
|
244
|
+
// console.log("[CONVS-DETAIL][MSG-TEXT-AREA] event.target.innerWidth; ", event.target.innerWidth);
|
|
245
|
+
|
|
220
246
|
|
|
221
247
|
|
|
222
248
|
// if (event.target.innerWidth >= 844 && this.isOpenInfoConversation === false && this.conversationWith.startsWith("support-group")) {
|
|
@@ -269,6 +295,8 @@ export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChange
|
|
|
269
295
|
|
|
270
296
|
let content = event.clipboardData.getData('text/plain');
|
|
271
297
|
this.logger.log("[CONVS-DETAIL][MSG-TEXT-AREA] onPaste content ", content);
|
|
298
|
+
this.logger.log("[CONVS-DETAIL][MSG-TEXT-AREA] onPaste this.messageString ", this.messageString);
|
|
299
|
+
this.msg = this.messageString
|
|
272
300
|
setTimeout(() => {
|
|
273
301
|
this.messageString = "";
|
|
274
302
|
}, 100);
|
|
@@ -301,6 +329,11 @@ export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChange
|
|
|
301
329
|
|
|
302
330
|
onFileSelected(e: any) {
|
|
303
331
|
this.logger.log('[CONVS-DETAIL][MSG-TEXT-AREA] - onFileSelected event', e);
|
|
332
|
+
this.logger.log("[CONVS-DETAIL][MSG-TEXT-AREA] - onFileSelected this.messageString ", this.messageString);
|
|
333
|
+
this.msg = this.messageString
|
|
334
|
+
setTimeout(() => {
|
|
335
|
+
this.messageString = "";
|
|
336
|
+
}, 100);
|
|
304
337
|
this.presentModal(e);
|
|
305
338
|
|
|
306
339
|
}
|
|
@@ -339,7 +372,7 @@ export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChange
|
|
|
339
372
|
}
|
|
340
373
|
// this.logger.log('presentModal e.target.files.length', e.target.files.length);
|
|
341
374
|
|
|
342
|
-
const attributes = { files: dataFiles, enableBackdropDismiss: false };
|
|
375
|
+
const attributes = { files: dataFiles, enableBackdropDismiss: false, msg: this.msg };
|
|
343
376
|
this.logger.log('[CONVS-DETAIL][MSG-TEXT-AREA] attributes', attributes);
|
|
344
377
|
const modal: HTMLIonModalElement =
|
|
345
378
|
await this.modalController.create({
|
|
@@ -536,28 +569,21 @@ export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChange
|
|
|
536
569
|
}
|
|
537
570
|
}
|
|
538
571
|
}
|
|
539
|
-
openCannedResponses() {
|
|
540
|
-
// console.log('[MSG-TEXT-AREA] has clicked OPEN-CANNED-RESPONSES messageString ', this.messageString)
|
|
541
|
-
// if (this.messageString) {
|
|
542
|
-
// console.log('[MSG-TEXT-AREA] has clicked OPEN-CANNED-RESPONSES messageString.trim ', this.messageString.trim)
|
|
543
|
-
// }
|
|
544
|
-
// if (this.messageString === undefined) {
|
|
545
|
-
// this.messageString = '/'
|
|
546
|
-
// } else {
|
|
547
|
-
|
|
548
|
-
// }
|
|
549
572
|
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
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
|
+
}
|
|
555
579
|
|
|
580
|
+
openCannedResponses() {
|
|
556
581
|
this.hasClickedOpenCannedResponses.emit(true);
|
|
557
582
|
}
|
|
558
583
|
|
|
559
584
|
|
|
560
585
|
sendMessage(text: string) {
|
|
586
|
+
this.showEmojiPicker = false;
|
|
561
587
|
this.logger.log('[CONVS-DETAIL][MSG-TEXT-AREA] sendMessage text', text);
|
|
562
588
|
this.logger.log('[CONVS-DETAIL][MSG-TEXT-AREA] sendMessage conve width', this.conversationWith);
|
|
563
589
|
// text.replace(/\s/g, "")
|
|
@@ -568,6 +594,64 @@ export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChange
|
|
|
568
594
|
}
|
|
569
595
|
}
|
|
570
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
|
+
|
|
571
655
|
// --------------------------------
|
|
572
656
|
// on mobile !
|
|
573
657
|
// --------------------------------
|
|
@@ -13,13 +13,20 @@
|
|
|
13
13
|
|
|
14
14
|
<ion-buttons slot="end">
|
|
15
15
|
|
|
16
|
-
<ion-button
|
|
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 {
|
|
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
|
-
|
|
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="
|
|
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
|
|
@@ -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)
|