@chat21/chat21-ionic 3.0.5-9.2 → 3.0.6-2.3
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 +202 -0
- package/LICENSE +661 -21
- package/README.md +13 -1
- package/angular.json +4 -0
- package/config.xml +4 -5
- package/deploy_pre.sh +44 -5
- package/deploy_prod.sh +36 -7
- package/env.sample +4 -2
- package/package.json +12 -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 +14 -4
- package/src/app/app.component.scss +18 -1
- package/src/app/app.component.ts +98 -37
- package/src/app/app.module.ts +14 -5
- 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 +63 -42
- 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.html +7 -2
- package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.ts +141 -21
- 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 +39 -36
- package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.scss +7 -1
- package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.ts +148 -63
- package/src/app/components/conversation-detail/message-text-area/message-text-area.component.html +101 -39
- package/src/app/components/conversation-detail/message-text-area/message-text-area.component.scss +73 -2
- package/src/app/components/conversation-detail/message-text-area/message-text-area.component.ts +168 -98
- package/src/app/components/ddp-header/ddp-header.component.html +20 -6
- package/src/app/components/ddp-header/ddp-header.component.scss +4 -0
- package/src/app/components/ddp-header/ddp-header.component.ts +104 -10
- package/src/app/components/image-viewer/image-viewer.component.scss +2 -2
- package/src/app/components/project-item/project-item.component.html +141 -118
- package/src/app/components/project-item/project-item.component.scss +173 -91
- package/src/app/components/project-item/project-item.component.ts +59 -25
- package/src/app/components/sidebar/sidebar.component.html +275 -0
- package/src/app/components/sidebar/sidebar.component.scss +79 -0
- package/src/app/components/sidebar/sidebar.component.spec.ts +24 -0
- package/src/app/components/sidebar/sidebar.component.ts +541 -0
- package/src/app/components/sidebar-user-details/sidebar-user-details.component.html +137 -0
- package/src/app/components/sidebar-user-details/sidebar-user-details.component.scss +389 -0
- package/src/app/components/sidebar-user-details/sidebar-user-details.component.spec.ts +24 -0
- package/src/app/components/sidebar-user-details/sidebar-user-details.component.ts +530 -0
- package/src/app/pages/conversation-detail/conversation-detail.module.ts +9 -2
- package/src/app/pages/conversation-detail/conversation-detail.page.html +53 -49
- package/src/app/pages/conversation-detail/conversation-detail.page.scss +28 -0
- package/src/app/pages/conversation-detail/conversation-detail.page.ts +1254 -753
- package/src/app/pages/conversations-list/conversations-list.module.ts +2 -1
- package/src/app/pages/conversations-list/conversations-list.page.html +24 -11
- package/src/app/pages/conversations-list/conversations-list.page.scss +20 -1
- package/src/app/pages/conversations-list/conversations-list.page.ts +687 -420
- 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 +4 -4
- package/src/app/pages/profile-info/profile-info.page.scss +13 -2
- package/src/app/pages/profile-info/profile-info.page.ts +23 -21
- package/src/app/pages/unassigned-conversations/unassigned-conversations.page.html +16 -11
- package/src/app/pages/unassigned-conversations/unassigned-conversations.page.scss +157 -63
- package/src/app/pages/unassigned-conversations/unassigned-conversations.page.ts +51 -16
- package/src/app/services/app-config.ts +14 -14
- package/src/app/services/tiledesk/tiledesk.service.ts +209 -0
- package/src/app/shared/shared.module.ts +21 -7
- package/src/app/utils/scrollbar-theme.directive.ts +58 -24
- package/src/assets/i18n/de.json +266 -0
- package/src/assets/i18n/en.json +85 -10
- package/src/assets/i18n/es.json +266 -0
- package/src/assets/i18n/fr.json +266 -0
- package/src/assets/i18n/it.json +104 -37
- package/src/assets/i18n/pt.json +266 -0
- package/src/assets/i18n/ru.json +266 -0
- package/src/assets/i18n/sr.json +266 -0
- package/src/assets/i18n/tr.json +266 -0
- package/src/assets/images/default-avatar-x-select.png +0 -0
- package/src/assets/images/language_flag/ar.png +0 -0
- package/src/assets/images/language_flag/bg.png +0 -0
- package/src/assets/images/language_flag/ca.png +0 -0
- package/src/assets/images/language_flag/cs.png +0 -0
- package/src/assets/images/language_flag/da.png +0 -0
- package/src/assets/images/language_flag/de.png +0 -0
- package/src/assets/images/language_flag/el.png +0 -0
- package/src/assets/images/language_flag/en.png +0 -0
- package/src/assets/images/language_flag/es.png +0 -0
- package/src/assets/images/language_flag/fa.png +0 -0
- package/src/assets/images/language_flag/fi.png +0 -0
- package/src/assets/images/language_flag/fr.png +0 -0
- package/src/assets/images/language_flag/he.png +0 -0
- package/src/assets/images/language_flag/hi.png +0 -0
- package/src/assets/images/language_flag/hr.png +0 -0
- package/src/assets/images/language_flag/hu.png +0 -0
- package/src/assets/images/language_flag/id.png +0 -0
- package/src/assets/images/language_flag/it.png +0 -0
- package/src/assets/images/language_flag/ja.png +0 -0
- package/src/assets/images/language_flag/ko.png +0 -0
- package/src/assets/images/language_flag/ml-IN.png +0 -0
- package/src/assets/images/language_flag/ne-NP.png +0 -0
- package/src/assets/images/language_flag/nl.png +0 -0
- package/src/assets/images/language_flag/no.png +0 -0
- package/src/assets/images/language_flag/pl.png +0 -0
- package/src/assets/images/language_flag/pt-BR.png +0 -0
- package/src/assets/images/language_flag/pt.png +0 -0
- package/src/assets/images/language_flag/ro.png +0 -0
- package/src/assets/images/language_flag/ru.png +0 -0
- package/src/assets/images/language_flag/sk.png +0 -0
- package/src/assets/images/language_flag/sl.png +0 -0
- package/src/assets/images/language_flag/sr.png +0 -0
- package/src/assets/images/language_flag/sv-SE.png +0 -0
- package/src/assets/images/language_flag/ta.png +0 -0
- package/src/assets/images/language_flag/th.png +0 -0
- package/src/assets/images/language_flag/tr.png +0 -0
- package/src/assets/images/language_flag/uk.png +0 -0
- package/src/assets/images/language_flag/vi.png +0 -0
- package/src/assets/images/language_flag/zh-CN.png +0 -0
- package/src/assets/images/language_flag/zh-TW.png +0 -0
- package/src/assets/images/no_image_user.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/assets/js/chat21client.js +16 -3
- package/src/assets/tiledesk-solo-logo.png +0 -0
- package/src/chat-config-mqtt.json +27 -17
- package/src/chat-config-pre-test.json +5 -1
- package/src/chat-config-pre.json +15 -3
- package/src/chat-config-template.json +6 -2
- package/src/chat-config.json +5 -1
- package/src/chat21-core/providers/firebase/firebase-conversation-handler.ts +61 -45
- package/src/chat21-core/providers/firebase/firebase-conversations-handler.ts +23 -0
- package/src/chat21-core/providers/mqtt/mqtt-archivedconversations-handler.ts +1 -1
- package/src/chat21-core/utils/constants.ts +8 -1
- package/src/chat21-core/utils/utils-message.ts +19 -0
- package/src/chat21-core/utils/utils.ts +12 -1
- package/src/global.scss +408 -2
- package/src/index.html +7 -0
- 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({
|
|
@@ -43,15 +44,19 @@ export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChange
|
|
|
43
44
|
@Input() loggedUser: UserModel;
|
|
44
45
|
@Input() conversationWith: string;
|
|
45
46
|
@Input() tagsCannedFilter: any = [];
|
|
46
|
-
|
|
47
|
+
@Input() tagsCannedCount: number;
|
|
48
|
+
@Input() areVisibleCAR: boolean;
|
|
49
|
+
@Input() support_mode: boolean;
|
|
47
50
|
@Input() events: Observable<void>;
|
|
48
51
|
@Input() fileUploadAccept: string
|
|
49
52
|
@Input() isOpenInfoConversation: boolean;
|
|
50
53
|
@Input() translationMap: Map<string, string>;
|
|
51
54
|
@Input() dropEvent: any;
|
|
52
55
|
@Output() eventChangeTextArea = new EventEmitter<object>();
|
|
56
|
+
@Output() hasClickedOpenCannedResponses = new EventEmitter<boolean>();
|
|
53
57
|
@Output() eventSendMessage = new EventEmitter<object>();
|
|
54
58
|
@Output() onPresentModalScrollToBottom = new EventEmitter<boolean>();
|
|
59
|
+
@Input() disableTextarea: boolean;
|
|
55
60
|
|
|
56
61
|
public conversationEnabled = false;
|
|
57
62
|
public messageString: string;
|
|
@@ -64,9 +69,24 @@ export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChange
|
|
|
64
69
|
public currentWindowWidth: any;
|
|
65
70
|
private logger: LoggerService = LoggerInstance.getInstance();
|
|
66
71
|
public countClicks: number = 0;
|
|
67
|
-
|
|
72
|
+
public IS_SUPPORT_GROUP_CONVERSATION: boolean;
|
|
73
|
+
public IS_ON_MOBILE_DEVICE: boolean;
|
|
68
74
|
TYPE_MSG_TEXT = TYPE_MSG_TEXT;
|
|
69
|
-
|
|
75
|
+
msg: string
|
|
76
|
+
|
|
77
|
+
tooltipOptions = {
|
|
78
|
+
'show-delay': 500,
|
|
79
|
+
'tooltip-class': 'chat-tooltip',
|
|
80
|
+
'theme': 'light',
|
|
81
|
+
'shadow': false,
|
|
82
|
+
'hide-delay-mobile': 0,
|
|
83
|
+
'hideDelayAfterClick': 3000,
|
|
84
|
+
'hide-delay': 200
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
showEmojiPicker: boolean = false; //To show/hide emoji picker
|
|
88
|
+
addWhiteSpaceBefore: boolean;
|
|
89
|
+
emojiPerLine: number = 9
|
|
70
90
|
/**
|
|
71
91
|
* Constructor
|
|
72
92
|
* @param chooser
|
|
@@ -80,6 +100,7 @@ export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChange
|
|
|
80
100
|
public uploadService: UploadService,
|
|
81
101
|
public toastController: ToastController,
|
|
82
102
|
private renderer: Renderer2,
|
|
103
|
+
public eventsService: EventsService
|
|
83
104
|
) { }
|
|
84
105
|
|
|
85
106
|
// ---------------------------------------------------------
|
|
@@ -88,7 +109,12 @@ export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChange
|
|
|
88
109
|
|
|
89
110
|
ngOnInit() {
|
|
90
111
|
// this.setSubscriptions();
|
|
112
|
+
|
|
91
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
|
+
}
|
|
92
118
|
// this.events.subscribe((cannedmessage) => {
|
|
93
119
|
// this.logger.log("[CONVS-DETAIL] [MSG-TEXT-AREA] events.subscribe cannedmessage ", cannedmessage);
|
|
94
120
|
// })
|
|
@@ -96,22 +122,46 @@ export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChange
|
|
|
96
122
|
// this.logger.log("[CONVS-DETAIL][MSG-TEXT-AREA] LONG_TEXAREA_PLACEHOLDER ", this.LONG_TEXAREA_PLACEHOLDER);
|
|
97
123
|
// this.logger.log("[CONVS-DETAIL][MSG-TEXT-AREA] SHORT_TEXAREA_PLACEHOLDER ", this.SHORT_TEXAREA_PLACEHOLDER);
|
|
98
124
|
// this.logger.log("[CONVS-DETAIL][MSG-TEXT-AREA] SHORTER_TEXAREA_PLACEHOLDER ", this.SHORTER_TEXAREA_PLACEHOLDER);
|
|
99
|
-
|
|
125
|
+
this.listenToNewCannedResponseCreated()
|
|
100
126
|
this.getWindowWidth();
|
|
127
|
+
this.isOnMobileDevice()
|
|
101
128
|
}
|
|
102
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;
|
|
138
|
+
}
|
|
103
139
|
|
|
104
140
|
|
|
105
|
-
ngOnChanges() {
|
|
106
141
|
|
|
142
|
+
|
|
143
|
+
ngOnChanges() {
|
|
107
144
|
if (this.translationMap) {
|
|
108
|
-
this.LONG_TEXAREA_PLACEHOLDER = this.translationMap.get('LABEL_ENTER_MSG')
|
|
109
|
-
this.SHORT_TEXAREA_PLACEHOLDER = this.translationMap.get('LABEL_ENTER_MSG_SHORT')
|
|
110
|
-
this.SHORTER_TEXAREA_PLACEHOLDER = this.translationMap.get('LABEL_ENTER_MSG_SHORTER')
|
|
145
|
+
// this.LONG_TEXAREA_PLACEHOLDER = this.translationMap.get('LABEL_ENTER_MSG')
|
|
146
|
+
// this.SHORT_TEXAREA_PLACEHOLDER = this.translationMap.get('LABEL_ENTER_MSG_SHORT')
|
|
147
|
+
// this.SHORTER_TEXAREA_PLACEHOLDER = this.translationMap.get('LABEL_ENTER_MSG_SHORTER')
|
|
148
|
+
|
|
149
|
+
this.TEXAREA_PLACEHOLDER = this.translationMap.get('LABEL_ENTER_MSG_SHORT')
|
|
150
|
+
|
|
111
151
|
}
|
|
112
152
|
|
|
153
|
+
if (this.conversationWith.startsWith("support-group")) {
|
|
154
|
+
this.IS_SUPPORT_GROUP_CONVERSATION = true
|
|
155
|
+
} else {
|
|
156
|
+
this.IS_SUPPORT_GROUP_CONVERSATION = false
|
|
157
|
+
}
|
|
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)
|
|
113
160
|
this.logger.log("[CONVS-DETAIL][MSG-TEXT-AREA] ngOnChanges DROP EVENT ", this.dropEvent);
|
|
114
161
|
this.logger.log("[CONVS-DETAIL][MSG-TEXT-AREA] ngOnChanges tagsCannedFilter ", this.tagsCannedFilter);
|
|
162
|
+
this.logger.log("[CONVS-DETAIL][MSG-TEXT-AREA] ngOnChanges areVisibleCAR; ", this.areVisibleCAR);
|
|
163
|
+
|
|
164
|
+
|
|
115
165
|
this.logger.log('[CONVS-DETAIL] - returnChangeTextArea ngOnChanges in [MSG-TEXT-AREA] this.tagsCannedFilter.length ', this.tagsCannedFilter.length)
|
|
116
166
|
|
|
117
167
|
// use case drop
|
|
@@ -120,21 +170,20 @@ export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChange
|
|
|
120
170
|
}
|
|
121
171
|
// if (this.isOpenInfoConversation === true) {
|
|
122
172
|
// this.getIfTexareaIsEmpty('ngOnChanges')
|
|
123
|
-
this.getWindowWidth();
|
|
173
|
+
// this.getWindowWidth();
|
|
124
174
|
// }
|
|
125
175
|
}
|
|
126
176
|
|
|
127
177
|
// ngAfterViewInit() {
|
|
128
178
|
ngAfterViewInit() {
|
|
129
179
|
|
|
130
|
-
|
|
131
|
-
|
|
180
|
+
// console.log("[CONVS-DETAIL][MSG-TEXT-AREA] ngAfterViewInit message_text_area ", this.message_text_area);
|
|
181
|
+
// console.log("[CONVS-DETAIL][MSG-TEXT-AREA] ngAfterViewInit messageTextArea ", this.messageTextArea);
|
|
132
182
|
if (this.messageTextArea) {
|
|
133
183
|
setTimeout(() => {
|
|
134
184
|
|
|
135
|
-
|
|
136
185
|
const elTextArea = this.message_text_area['el'];
|
|
137
|
-
//
|
|
186
|
+
// console.log("[CONVS-DETAIL][MSG-TEXT-AREA] ngAfterViewInit elTextArea ", elTextArea);
|
|
138
187
|
// this.logger.log("[CONVS-DETAIL][MSG-TEXT-AREA] ngAfterViewInit elTextArea children", elTextArea.children);
|
|
139
188
|
if (elTextArea.children.length === 1) {
|
|
140
189
|
|
|
@@ -148,10 +197,8 @@ export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChange
|
|
|
148
197
|
}
|
|
149
198
|
}
|
|
150
199
|
|
|
151
|
-
|
|
152
200
|
// this.logger.log("[CONVS-DETAIL][MSG-TEXT-AREA] set focus on ", this.messageTextArea);
|
|
153
201
|
// Keyboard.show() // for android
|
|
154
|
-
|
|
155
202
|
this.messageTextArea.setFocus();
|
|
156
203
|
|
|
157
204
|
}, 1500); //a least 150ms.
|
|
@@ -162,46 +209,19 @@ export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChange
|
|
|
162
209
|
getWindowWidth(): any {
|
|
163
210
|
this.currentWindowWidth = window.innerWidth;
|
|
164
211
|
|
|
165
|
-
// if ((this.currentWindowWidth < 1045 && this.currentWindowWidth > 835) && this.isOpenInfoConversation === true) {
|
|
166
|
-
// this.logger.log("[CONVS-DETAIL] [MSG-TEXT-AREA] DISPLAY SHORT_TEXAREA_PLACEHOLDER ");
|
|
167
|
-
// // this.TEXAREA_PLACEHOLDER = '';
|
|
168
|
-
// this.TEXAREA_PLACEHOLDER = this.SHORT_TEXAREA_PLACEHOLDER;
|
|
169
|
-
// } else if (this.currentWindowWidth < 835 && this.isOpenInfoConversation === true) {
|
|
170
|
-
// this.logger.log("[CONVS-DETAIL] [MSG-TEXT-AREA] DISPLAY SHORTER_TEXAREA_PLACEHOLDER ");
|
|
171
|
-
|
|
172
212
|
|
|
213
|
+
// if (this.currentWindowWidth >= 844 && this.isOpenInfoConversation === false && this.conversationWith.startsWith("support-group")) {
|
|
214
|
+
// this.TEXAREA_PLACEHOLDER = this.LONG_TEXAREA_PLACEHOLDER;
|
|
215
|
+
// this.logger.log('[CONVS-DETAIL][MSG-TEXT-AREA] currentWindowWidth', this.currentWindowWidth, ' - DISPLAY LONG_TEXAREA_PLACEHOLDER ');
|
|
216
|
+
// } else if (this.currentWindowWidth >= 844 && this.isOpenInfoConversation === true && this.conversationWith.startsWith("support-group")) {
|
|
217
|
+
// this.TEXAREA_PLACEHOLDER = this.SHORT_TEXAREA_PLACEHOLDER;
|
|
218
|
+
// } else if (this.currentWindowWidth < 844 && this.isOpenInfoConversation === false && this.conversationWith.startsWith("support-group")) {
|
|
219
|
+
// this.TEXAREA_PLACEHOLDER = this.SHORT_TEXAREA_PLACEHOLDER;
|
|
220
|
+
// } else if (this.currentWindowWidth < 844 && this.isOpenInfoConversation === true && this.conversationWith.startsWith("support-group")) {
|
|
173
221
|
// this.TEXAREA_PLACEHOLDER = this.SHORTER_TEXAREA_PLACEHOLDER;
|
|
174
|
-
//
|
|
175
|
-
|
|
176
|
-
// }
|
|
177
|
-
// this.logger.log("[CONVS-DETAIL][MSG-TEXT-AREA] currentWindowWidth ", this.currentWindowWidth);
|
|
178
|
-
// this.logger.log('[CONVS-DETAIL][MSG-TEXT-AREA] isOpenInfoConversation', this.isOpenInfoConversation);
|
|
179
|
-
// this.logger.log('[CONVS-DETAIL][MSG-TEXT-AREA] this.conversationWith.startsWith("support-group")', this.conversationWith.startsWith("support-group"));
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
if (this.currentWindowWidth >= 844 && this.isOpenInfoConversation === false && this.conversationWith.startsWith("support-group")) {
|
|
183
|
-
|
|
184
|
-
this.TEXAREA_PLACEHOLDER = this.LONG_TEXAREA_PLACEHOLDER;
|
|
185
|
-
|
|
186
|
-
this.logger.log('[CONVS-DETAIL][MSG-TEXT-AREA] currentWindowWidth', this.currentWindowWidth, ' - DISPLAY LONG_TEXAREA_PLACEHOLDER ');
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
} else if (this.currentWindowWidth >= 844 && this.isOpenInfoConversation === true && this.conversationWith.startsWith("support-group")) {
|
|
190
|
-
this.TEXAREA_PLACEHOLDER = this.SHORT_TEXAREA_PLACEHOLDER;
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
} else if (this.currentWindowWidth < 844 && this.isOpenInfoConversation === false && this.conversationWith.startsWith("support-group")) {
|
|
194
|
-
|
|
195
|
-
this.TEXAREA_PLACEHOLDER = this.SHORT_TEXAREA_PLACEHOLDER;
|
|
196
|
-
|
|
197
|
-
} else if (this.currentWindowWidth < 844 && this.isOpenInfoConversation === true && this.conversationWith.startsWith("support-group")) {
|
|
198
|
-
|
|
199
|
-
this.TEXAREA_PLACEHOLDER = this.SHORTER_TEXAREA_PLACEHOLDER;
|
|
200
|
-
|
|
201
|
-
} else if (!this.conversationWith.startsWith("support-group")) {
|
|
202
|
-
this.TEXAREA_PLACEHOLDER = this.SHORT_TEXAREA_PLACEHOLDER;
|
|
203
|
-
|
|
204
|
-
}
|
|
222
|
+
// } else if (!this.conversationWith.startsWith("support-group")) {
|
|
223
|
+
// this.TEXAREA_PLACEHOLDER = this.SHORT_TEXAREA_PLACEHOLDER;
|
|
224
|
+
// }
|
|
205
225
|
|
|
206
226
|
// this.logger.log("[CONVS-DETAIL][MSG-TEXT-AREA] checkPlatformIsMobile() ", checkPlatformIsMobile());
|
|
207
227
|
if (checkPlatformIsMobile() === true) {
|
|
@@ -212,13 +232,7 @@ export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChange
|
|
|
212
232
|
} else if (this.currentWindowWidth <= 273) {
|
|
213
233
|
this.TEXAREA_PLACEHOLDER = this.SHORTER_TEXAREA_PLACEHOLDER;
|
|
214
234
|
}
|
|
215
|
-
|
|
216
235
|
}
|
|
217
|
-
// if (checkPlatformIsMobile && this.currentWindowWidth <= 430) {
|
|
218
|
-
// this.TEXAREA_PLACEHOLDER = this.SHORT_TEXAREA_PLACEHOLDER;
|
|
219
|
-
// } else if (checkPlatformIsMobile && this.currentWindowWidth > 430) {
|
|
220
|
-
// this.TEXAREA_PLACEHOLDER = this.LONG_TEXAREA_PLACEHOLDER;
|
|
221
|
-
// }
|
|
222
236
|
}
|
|
223
237
|
|
|
224
238
|
// -------------------------------------------------------------------------------------------
|
|
@@ -227,37 +241,21 @@ export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChange
|
|
|
227
241
|
@HostListener('window:resize', ['$event'])
|
|
228
242
|
onResize(event) {
|
|
229
243
|
// this.getIfTexareaIsEmpty('onResize')
|
|
230
|
-
|
|
231
|
-
// if ((event.target.innerWidth < 1045 && event.target.innerWidth > 835) && this.isOpenInfoConversation === true) {
|
|
232
|
-
// this.logger.log("[CONVS-DETAIL] [MSG-TEXT-AREA] ON RESIZE DISPAY SHORT_TEXAREA_PLACEHOLDER");
|
|
233
|
-
// this.TEXAREA_PLACEHOLDER = this.SHORT_TEXAREA_PLACEHOLDER;
|
|
234
|
-
// } else if (event.target.innerWidth < 835 && this.isOpenInfoConversation === true) {
|
|
235
|
-
// this.TEXAREA_PLACEHOLDER = this.SHORTER_TEXAREA_PLACEHOLDER;
|
|
236
|
-
// } else {
|
|
237
|
-
// this.TEXAREA_PLACEHOLDER = this.LONG_TEXAREA_PLACEHOLDER;
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
if (event.target.innerWidth >= 844 && this.isOpenInfoConversation === false && this.conversationWith.startsWith("support-group")) {
|
|
241
|
-
this.TEXAREA_PLACEHOLDER = this.LONG_TEXAREA_PLACEHOLDER;
|
|
242
|
-
// this.logger.log('[CONVS-DETAIL][MSG-TEXT-AREA] - else - DISPLAY LONG_TEXAREA_PLACEHOLDER ');
|
|
243
|
-
// this.logger.log('[CONVS-DETAIL][MSG-TEXT-AREA] - else - this.currentWindowWidth ', this.currentWindowWidth);
|
|
244
|
-
|
|
245
|
-
} else if (event.target.innerWidth >= 844 && this.isOpenInfoConversation === true && this.conversationWith.startsWith("support-group")) {
|
|
246
|
-
this.TEXAREA_PLACEHOLDER = this.SHORT_TEXAREA_PLACEHOLDER;
|
|
247
|
-
|
|
244
|
+
// console.log("[CONVS-DETAIL][MSG-TEXT-AREA] event.target.innerWidth; ", event.target.innerWidth);
|
|
248
245
|
|
|
249
|
-
} else if (event.target.innerWidth < 844 && this.isOpenInfoConversation === false && this.conversationWith.startsWith("support-group")) {
|
|
250
246
|
|
|
251
|
-
this.TEXAREA_PLACEHOLDER = this.SHORT_TEXAREA_PLACEHOLDER;
|
|
252
247
|
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
} else if (
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
248
|
+
// if (event.target.innerWidth >= 844 && this.isOpenInfoConversation === false && this.conversationWith.startsWith("support-group")) {
|
|
249
|
+
// this.TEXAREA_PLACEHOLDER = this.LONG_TEXAREA_PLACEHOLDER;
|
|
250
|
+
// } else if (event.target.innerWidth >= 844 && this.isOpenInfoConversation === true && this.conversationWith.startsWith("support-group")) {
|
|
251
|
+
// this.TEXAREA_PLACEHOLDER = this.SHORT_TEXAREA_PLACEHOLDER;
|
|
252
|
+
// } else if (event.target.innerWidth < 844 && this.isOpenInfoConversation === false && this.conversationWith.startsWith("support-group")) {
|
|
253
|
+
// this.TEXAREA_PLACEHOLDER = this.SHORT_TEXAREA_PLACEHOLDER;
|
|
254
|
+
// } else if (event.target.innerWidth < 844 && this.isOpenInfoConversation === true && this.conversationWith.startsWith("support-group")) {
|
|
255
|
+
// this.TEXAREA_PLACEHOLDER = this.SHORTER_TEXAREA_PLACEHOLDER;
|
|
256
|
+
// } else if (!this.conversationWith.startsWith("support-group")) {
|
|
257
|
+
// this.TEXAREA_PLACEHOLDER = this.SHORT_TEXAREA_PLACEHOLDER;
|
|
258
|
+
// }
|
|
261
259
|
|
|
262
260
|
// this.logger.log('[CONVS-DETAIL][MSG-TEXT-AREA] checkPlatformIsMobile() ', checkPlatformIsMobile());
|
|
263
261
|
if (checkPlatformIsMobile() === true) {
|
|
@@ -297,6 +295,8 @@ export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChange
|
|
|
297
295
|
|
|
298
296
|
let content = event.clipboardData.getData('text/plain');
|
|
299
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
|
|
300
300
|
setTimeout(() => {
|
|
301
301
|
this.messageString = "";
|
|
302
302
|
}, 100);
|
|
@@ -329,6 +329,11 @@ export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChange
|
|
|
329
329
|
|
|
330
330
|
onFileSelected(e: any) {
|
|
331
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);
|
|
332
337
|
this.presentModal(e);
|
|
333
338
|
|
|
334
339
|
}
|
|
@@ -367,7 +372,7 @@ export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChange
|
|
|
367
372
|
}
|
|
368
373
|
// this.logger.log('presentModal e.target.files.length', e.target.files.length);
|
|
369
374
|
|
|
370
|
-
const attributes = { files: dataFiles, enableBackdropDismiss: false };
|
|
375
|
+
const attributes = { files: dataFiles, enableBackdropDismiss: false, msg: this.msg };
|
|
371
376
|
this.logger.log('[CONVS-DETAIL][MSG-TEXT-AREA] attributes', attributes);
|
|
372
377
|
const modal: HTMLIonModalElement =
|
|
373
378
|
await this.modalController.create({
|
|
@@ -459,7 +464,7 @@ export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChange
|
|
|
459
464
|
// this.logger.log("[CONVS-DETAIL][MSG-TEXT-AREA] ionChange detail.value ", e.detail.value);
|
|
460
465
|
|
|
461
466
|
const message = e.detail.value
|
|
462
|
-
|
|
467
|
+
this.logger.log("[CONVS-DETAIL] [MSG-TEXT-AREA] ionChange message ", message);
|
|
463
468
|
// this.logger.log("[CONVS-DETAIL] [MSG-TEXT-AREA] ionChange this.messageString ", this.messageString);
|
|
464
469
|
const height = e.target.offsetHeight + 20; // nk added +20
|
|
465
470
|
// this.logger.log("[CONVS-DETAIL] [MSG-TEXT-AREA] ionChange text-area height ", height);
|
|
@@ -476,7 +481,6 @@ export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChange
|
|
|
476
481
|
this.conversationEnabled = false;
|
|
477
482
|
}
|
|
478
483
|
|
|
479
|
-
|
|
480
484
|
this.eventChangeTextArea.emit({ msg: message, offsetHeight: height });
|
|
481
485
|
}
|
|
482
486
|
|
|
@@ -530,7 +534,7 @@ export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChange
|
|
|
530
534
|
this.logger.log("[CONVS-DETAIL] replaceTagInMessage onKeydown in msg-texarea SEND MESSAGE 2 message: ", message);
|
|
531
535
|
this.logger.log('[CONVS-DETAIL][MSG-TEXT-AREA] onKeydown - SEND MESSAGE 2 message value: ', message.value);
|
|
532
536
|
this.logger.log('[CONVS-DETAIL][MSG-TEXT-AREA] onKeydown - SEND MESSAGE 2 text: ', text);
|
|
533
|
-
|
|
537
|
+
|
|
534
538
|
this.logger.log("[CONVS-DETAIL] replaceTagInMessage onKeydown in msg-texarea SEND MESSAGE 2 this.tagsCannedFilter.length: ", this.tagsCannedFilter.length);
|
|
535
539
|
this.logger.log("[CONVS-DETAIL] replaceTagInMessage onKeydown in msg-texarea SEND MESSAGE 2 this.countClicks: ", this.countClicks);
|
|
536
540
|
this.logger.log("[CONVS-DETAIL][MSG-TEXT-AREA] onKeydown in msg-texarea SEND MESSAGE 2 this.countClicks: ", this.countClicks);
|
|
@@ -539,7 +543,7 @@ export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChange
|
|
|
539
543
|
|
|
540
544
|
this.sendMessage(text);
|
|
541
545
|
this.countClicks = 0
|
|
542
|
-
} else if (text.includes("/") && pos > 0 && this.countClicks > 1 && this.tagsCannedFilter.length > 0 && text.substr(-1) !== '/'
|
|
546
|
+
} else if (text.includes("/") && pos > 0 && this.countClicks > 1 && this.tagsCannedFilter.length > 0 && text.substr(-1) !== '/') {
|
|
543
547
|
this.logger.log('[CONVS-DETAIL][MSG-TEXT-AREA] onKeydown - tagsCannedFilter.length 3: ', this.tagsCannedFilter.length);
|
|
544
548
|
this.logger.log("[CONVS-DETAIL] replaceTagInMessage onKeydown in msg-texarea SEND MESSAGE 3 message: ", message);
|
|
545
549
|
// this.logger.log('[CONVS-DETAIL][MSG-TEXT-AREA] onKeydown - SEND MESSAGE 3 message value: ', message.value);
|
|
@@ -566,18 +570,88 @@ export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChange
|
|
|
566
570
|
}
|
|
567
571
|
}
|
|
568
572
|
|
|
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
|
+
}
|
|
579
|
+
|
|
580
|
+
openCannedResponses() {
|
|
581
|
+
this.hasClickedOpenCannedResponses.emit(true);
|
|
582
|
+
}
|
|
583
|
+
|
|
569
584
|
|
|
570
585
|
sendMessage(text: string) {
|
|
571
|
-
this.
|
|
586
|
+
this.showEmojiPicker = false;
|
|
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, "")
|
|
574
590
|
this.messageString = '';
|
|
575
591
|
// text = text.replace(/(\r\n|\n|\r)/gm, '');
|
|
576
|
-
if (text.trim() !== '') {
|
|
592
|
+
if (text && text.trim() !== '') {
|
|
577
593
|
this.eventSendMessage.emit({ message: text, type: TYPE_MSG_TEXT });
|
|
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
|
// --------------------------------
|
|
@@ -625,11 +699,7 @@ export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChange
|
|
|
625
699
|
|
|
626
700
|
// Note: on mac keyboard "metakey" matches "cmd"
|
|
627
701
|
if (event.key === 'Enter' && event.altKey || event.key === 'Enter' && event.ctrlKey || event.key === 'Enter' && event.metaKey) {
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
702
|
this.logger.log('[CONVS-DETAIL][MSG-TEXT-AREA] HAS PRESSED COMBO KEYS this.messageString', this.messageString);
|
|
632
|
-
|
|
633
703
|
if (this.messageString !== undefined && this.messageString.trim() !== '') {
|
|
634
704
|
this.logger.log('[CONVS-DETAIL][MSG-TEXT-AREA] HAS PRESSED Enter + ALT this.messageString', this.messageString);
|
|
635
705
|
this.messageString = this.messageString + "\r\n"
|
|
@@ -1,24 +1,38 @@
|
|
|
1
|
+
<ion-toolbar style="height:60px" [ngClass]="{'bottom-border-on-mobile':IS_ON_MOBILE_DEVICE === true }">
|
|
1
2
|
|
|
2
|
-
<ion-
|
|
3
|
-
|
|
4
|
-
<ion-buttons slot="start">
|
|
3
|
+
<ion-buttons *ngIf="IS_ON_MOBILE_DEVICE === true || supportMode === false" slot="start" style="height:60px">
|
|
5
4
|
<ion-button ion-button icon-only fill="clear" (click)="onOpenProfileInfo($event)">
|
|
6
5
|
<ion-icon slot="icon-only" name="reorder-three-outline"></ion-icon>
|
|
7
6
|
</ion-button>
|
|
8
7
|
</ion-buttons>
|
|
9
8
|
|
|
10
9
|
<ion-title>
|
|
11
|
-
<img src="assets/chat21-logo.svg" class="header-logo" alt="header-logo">
|
|
10
|
+
<!-- <img src="assets/chat21-logo.svg" class="header-logo" alt="header-logo"> -->
|
|
12
11
|
<div *ngIf="numberOpenConv > 0" class="number-open-conv">({{numberOpenConv}})</div>
|
|
13
12
|
</ion-title>
|
|
14
13
|
|
|
15
14
|
<ion-buttons slot="end">
|
|
16
15
|
|
|
17
|
-
<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">
|
|
23
|
+
<ion-icon slot="icon-only" name="file-tray-full-outline"></ion-icon>
|
|
24
|
+
<!-- <ion-icon name="file-tray-stacked-outline"></ion-icon> -->
|
|
25
|
+
<!-- <ion-icon name="file-tray-full-outline"></ion-icon> -->
|
|
26
|
+
</ion-button>
|
|
27
|
+
|
|
28
|
+
<ion-button *ngIf="writeto_btn" ion-button fill="clear" (click)="onOpenContactsDirectory($event)"
|
|
29
|
+
tooltip="{{translationMap?.get('ViewContactsList')}}" [options]="tooltipOptions" placement="bottom">
|
|
18
30
|
<ion-icon slot="icon-only" name="create-outline"></ion-icon>
|
|
31
|
+
<!-- <ion-icon slot="icon-only" name="people-outline"></ion-icon> -->
|
|
32
|
+
|
|
19
33
|
</ion-button>
|
|
20
34
|
|
|
21
|
-
<!--
|
|
35
|
+
<!-- <button ion-button icon-only (click)="onOpenArchivedConversationsPage()">
|
|
22
36
|
<span class="material-icons">history</span>
|
|
23
37
|
</button>
|
|
24
38
|
|
|
@@ -1,18 +1,77 @@
|
|
|
1
|
-
import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core'
|
|
2
|
-
|
|
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
|
-
@
|
|
12
|
-
@
|
|
13
|
-
|
|
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
|
+
};
|
|
14
30
|
constructor(
|
|
15
|
-
|
|
31
|
+
public events: EventsService,
|
|
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);
|
|
47
|
+
}
|
|
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
|
+
|
|
67
|
+
isOnMobileDevice() {
|
|
68
|
+
this.IS_ON_MOBILE_DEVICE = false
|
|
69
|
+
if (/Android|iPhone/i.test(window.navigator.userAgent)) {
|
|
70
|
+
this.IS_ON_MOBILE_DEVICE = true
|
|
71
|
+
}
|
|
72
|
+
// console.log('[DDP-HEADER] IS_ON_MOBILE_DEVICE', this.IS_ON_MOBILE_DEVICE)
|
|
73
|
+
return this.IS_ON_MOBILE_DEVICE
|
|
74
|
+
}
|
|
16
75
|
|
|
17
76
|
ngOnInit() {
|
|
18
77
|
// console.log('DDP HEADER SUPPORT MODE ', this.supportMode)
|
|
@@ -21,13 +80,48 @@ export class DdpHeaderComponent implements OnInit {
|
|
|
21
80
|
// START @Output() //
|
|
22
81
|
/** */
|
|
23
82
|
onOpenProfileInfo(e: any) {
|
|
24
|
-
this.openProfileInfo.emit(e)
|
|
83
|
+
this.openProfileInfo.emit(e)
|
|
25
84
|
}
|
|
26
85
|
|
|
27
86
|
/** */
|
|
28
87
|
onOpenContactsDirectory(e: any) {
|
|
29
|
-
this.openContactsDirectory.emit(e)
|
|
88
|
+
this.openContactsDirectory.emit(e)
|
|
30
89
|
}
|
|
31
90
|
// END @Output() //
|
|
32
91
|
|
|
92
|
+
onClickArchivedConversation() {
|
|
93
|
+
this.events.publish('profileInfoButtonClick:changed', 'displayArchived')
|
|
94
|
+
}
|
|
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
|
+
}
|
|
33
127
|
}
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
text-decoration: none;
|
|
71
71
|
cursor: pointer;
|
|
72
72
|
svg {
|
|
73
|
-
fill: rgba(255,255,255);
|
|
73
|
+
fill: rgba(255,255,255, 1);
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
76
|
|
|
@@ -95,7 +95,7 @@
|
|
|
95
95
|
text-decoration: none;
|
|
96
96
|
cursor: pointer;
|
|
97
97
|
svg {
|
|
98
|
-
fill: rgba(255,255,255);
|
|
98
|
+
fill: rgba(255,255,255, 1);
|
|
99
99
|
}
|
|
100
100
|
}
|
|
101
101
|
|