@chat21/chat21-ionic 3.0.5-8.1 → 3.0.6-2.1
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 +300 -0
- package/LICENSE +661 -21
- package/README.md +21 -0
- package/angular.json +4 -0
- package/config.xml +6 -7
- package/deploy_pre.sh +44 -5
- package/deploy_prod.sh +36 -7
- package/env.sample +7 -3
- 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/splash/drawable-land-hdpi-screen.png +0 -0
- package/resources/android/splash/drawable-land-ldpi-screen.png +0 -0
- package/resources/android/splash/drawable-land-mdpi-screen.png +0 -0
- package/resources/android/splash/drawable-land-xhdpi-screen.png +0 -0
- package/resources/android/splash/drawable-land-xxhdpi-screen.png +0 -0
- package/resources/android/splash/drawable-land-xxxhdpi-screen.png +0 -0
- package/resources/android/splash/drawable-port-hdpi-screen.png +0 -0
- package/resources/android/splash/drawable-port-ldpi-screen.png +0 -0
- package/resources/android/splash/drawable-port-mdpi-screen.png +0 -0
- package/resources/android/splash/drawable-port-xhdpi-screen.png +0 -0
- package/resources/android/splash/drawable-port-xxhdpi-screen.png +0 -0
- package/resources/android/splash/drawable-port-xxxhdpi-screen.png +0 -0
- package/resources/android/splash.png +0 -0
- package/src/app/app-routing.module.ts +36 -17
- package/src/app/app.component.html +18 -5
- package/src/app/app.component.scss +27 -5
- package/src/app/app.component.ts +526 -175
- package/src/app/app.module.ts +29 -12
- package/src/app/chatlib/conversation-detail/conversation-content/conversation-content.component.html +1 -1
- package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.html +35 -24
- package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.scss +166 -50
- package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.ts +113 -18
- package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.html +23 -33
- 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 +73 -7
- package/src/app/chatlib/conversation-detail/message/image/image.component.html +7 -6
- package/src/app/chatlib/conversation-detail/message/image/image.component.ts +20 -1
- 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 +46 -11
- package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.scss +8 -144
- package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.ts +149 -32
- package/src/app/chatlib/list-conversations-component/list-conversations/list-conversations.component.html +1 -1
- package/src/app/chatlib/list-conversations-component/list-conversations/list-conversations.component.ts +13 -10
- package/src/app/components/authentication/login/login.component.html +10 -10
- package/src/app/components/authentication/login/login.component.ts +2 -1
- package/src/app/components/conversation-detail/bubble-my-message/bubble-my-message.component.ts +1 -1
- package/src/app/components/conversation-detail/bubble-others-message/bubble-others-message.component.ts +1 -1
- package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.html +45 -39
- package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.scss +19 -1
- package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.ts +160 -54
- package/src/app/components/conversation-detail/message-text-area/message-text-area.component.html +101 -38
- package/src/app/components/conversation-detail/message-text-area/message-text-area.component.scss +95 -19
- package/src/app/components/conversation-detail/message-text-area/message-text-area.component.ts +209 -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 +107 -11
- package/src/app/components/image-viewer/image-viewer.component.html +23 -0
- package/src/app/components/image-viewer/image-viewer.component.scss +107 -0
- package/src/app/components/image-viewer/image-viewer.component.spec.ts +24 -0
- package/src/app/components/image-viewer/image-viewer.component.ts +38 -0
- package/src/app/components/project-item/project-item.component.html +170 -0
- package/src/app/components/project-item/project-item.component.scss +751 -0
- package/src/app/components/project-item/project-item.component.spec.ts +24 -0
- package/src/app/components/project-item/project-item.component.ts +384 -0
- 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 +121 -0
- package/src/app/components/sidebar-user-details/sidebar-user-details.component.scss +343 -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 +502 -0
- package/src/app/components/utils/avatar-profile/avatar-profile.component.html +7 -0
- package/src/app/components/utils/avatar-profile/avatar-profile.component.ts +22 -5
- package/src/app/pages/authentication/login/login.page.html +1 -2
- package/src/app/pages/authentication/login/login.page.ts +1 -1
- package/src/app/pages/conversation-detail/conversation-detail.module.ts +9 -2
- package/src/app/pages/conversation-detail/conversation-detail.page.html +55 -49
- package/src/app/pages/conversation-detail/conversation-detail.page.scss +28 -0
- package/src/app/pages/conversation-detail/conversation-detail.page.ts +1285 -688
- package/src/app/pages/conversations-list/conversations-list.module.ts +2 -1
- package/src/app/pages/conversations-list/conversations-list.page.html +55 -21
- package/src/app/pages/conversations-list/conversations-list.page.scss +309 -127
- package/src/app/pages/conversations-list/conversations-list.page.ts +833 -358
- 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-routing.module.ts +17 -0
- package/src/app/pages/unassigned-conversations/unassigned-conversations.module.ts +22 -0
- package/src/app/pages/unassigned-conversations/unassigned-conversations.page.html +27 -0
- package/src/app/pages/unassigned-conversations/unassigned-conversations.page.scss +173 -0
- package/src/app/pages/unassigned-conversations/unassigned-conversations.page.spec.ts +24 -0
- package/src/app/pages/unassigned-conversations/unassigned-conversations.page.ts +151 -0
- package/src/app/services/app-config.ts +77 -5
- package/src/app/services/nav-proxy.service.ts +1 -1
- package/src/app/services/tiledesk/tiledesk.service.ts +231 -1
- package/src/app/services/websocket/websocket-js.ts +560 -0
- package/src/app/services/websocket/websocket.service.spec.ts +12 -0
- package/src/app/services/websocket/websocket.service.ts +292 -0
- package/src/app/shared/shared.module.ts +28 -8
- package/src/app/utils/scrollbar-theme.directive.ts +58 -24
- package/src/assets/i18n/de.json +265 -0
- package/src/assets/i18n/en.json +89 -7
- package/src/assets/i18n/es.json +265 -0
- package/src/assets/i18n/fr.json +265 -0
- package/src/assets/i18n/it.json +108 -34
- package/src/assets/i18n/pt.json +265 -0
- package/src/assets/i18n/ru.json +265 -0
- package/src/assets/i18n/sr.json +265 -0
- package/src/assets/i18n/tr.json +265 -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 +159 -84
- package/src/assets/logo.png +0 -0
- package/src/assets/tiledesk-solo-logo.png +0 -0
- package/src/assets/transparent.png +0 -0
- package/src/chat-config-mqtt.json +27 -17
- package/src/chat-config-pre-test.json +6 -2
- package/src/chat-config-template.json +8 -1
- package/src/chat-config.json +8 -1
- package/src/chat21-core/providers/chat-manager.ts +3 -3
- package/src/chat21-core/providers/firebase/firebase-archivedconversations-handler.ts +2 -2
- package/src/chat21-core/providers/firebase/firebase-auth-service.ts +6 -6
- package/src/chat21-core/providers/firebase/firebase-conversation-handler.ts +61 -45
- package/src/chat21-core/providers/firebase/firebase-conversations-handler.ts +24 -1
- package/src/chat21-core/providers/firebase/firebase-notifications.ts +32 -24
- package/src/chat21-core/providers/firebase/firebase-presence.service.ts +2 -2
- package/src/chat21-core/providers/firebase/firebase-typing.service.ts +1 -1
- package/src/chat21-core/providers/firebase/firebase-upload.service.ts +1 -1
- package/src/chat21-core/providers/mqtt/mqtt-archivedconversations-handler.ts +1 -1
- package/src/chat21-core/providers/mqtt/mqtt-conversation-handler.ts +3 -5
- package/src/chat21-core/providers/mqtt/mqtt-conversations-handler.ts +13 -5
- package/src/chat21-core/providers/mqtt/mqtt-notifications.ts +101 -11
- package/src/chat21-core/providers/tiledesk/tiledesk-auth.service.ts +13 -4
- package/src/chat21-core/utils/constants.ts +8 -1
- package/src/chat21-core/utils/utils-message.ts +21 -2
- package/src/chat21-core/utils/utils.ts +13 -2
- package/src/firebase-messaging-sw-template.js +1 -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/resources/Android/splash/drawable-land-hdpi-screen.png +0 -0
- package/resources/Android/splash/drawable-land-ldpi-screen.png +0 -0
- package/resources/Android/splash/drawable-land-mdpi-screen.png +0 -0
- package/resources/Android/splash/drawable-land-xhdpi-screen.png +0 -0
- package/resources/Android/splash/drawable-land-xxhdpi-screen.png +0 -0
- package/resources/Android/splash/drawable-land-xxxhdpi-screen.png +0 -0
- package/resources/Android/splash/drawable-port-hdpi-screen.png +0 -0
- package/resources/Android/splash/drawable-port-ldpi-screen.png +0 -0
- package/resources/Android/splash/drawable-port-mdpi-screen.png +0 -0
- package/resources/Android/splash/drawable-port-xhdpi-screen.png +0 -0
- package/resources/Android/splash/drawable-port-xxhdpi-screen.png +0 -0
- package/resources/Android/splash/drawable-port-xxxhdpi-screen.png +0 -0
- package/resources/Android/splash.png +0 -0
- package/src/assets/images/tiledesk_logo_50x50.png +0 -0
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,14 +44,19 @@ export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChange
|
|
|
43
44
|
@Input() loggedUser: UserModel;
|
|
44
45
|
@Input() conversationWith: string;
|
|
45
46
|
@Input() tagsCannedFilter: any = [];
|
|
47
|
+
@Input() tagsCannedCount: number;
|
|
48
|
+
@Input() areVisibleCAR: boolean;
|
|
49
|
+
@Input() support_mode: boolean;
|
|
46
50
|
@Input() events: Observable<void>;
|
|
47
51
|
@Input() fileUploadAccept: string
|
|
48
52
|
@Input() isOpenInfoConversation: boolean;
|
|
49
53
|
@Input() translationMap: Map<string, string>;
|
|
50
54
|
@Input() dropEvent: any;
|
|
51
55
|
@Output() eventChangeTextArea = new EventEmitter<object>();
|
|
56
|
+
@Output() hasClickedOpenCannedResponses = new EventEmitter<boolean>();
|
|
52
57
|
@Output() eventSendMessage = new EventEmitter<object>();
|
|
53
58
|
@Output() onPresentModalScrollToBottom = new EventEmitter<boolean>();
|
|
59
|
+
@Input() disableTextarea: boolean;
|
|
54
60
|
|
|
55
61
|
public conversationEnabled = false;
|
|
56
62
|
public messageString: string;
|
|
@@ -63,9 +69,24 @@ export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChange
|
|
|
63
69
|
public currentWindowWidth: any;
|
|
64
70
|
private logger: LoggerService = LoggerInstance.getInstance();
|
|
65
71
|
public countClicks: number = 0;
|
|
66
|
-
|
|
72
|
+
public IS_SUPPORT_GROUP_CONVERSATION: boolean;
|
|
73
|
+
public IS_ON_MOBILE_DEVICE: boolean;
|
|
67
74
|
TYPE_MSG_TEXT = TYPE_MSG_TEXT;
|
|
68
|
-
|
|
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
|
|
69
90
|
/**
|
|
70
91
|
* Constructor
|
|
71
92
|
* @param chooser
|
|
@@ -79,6 +100,7 @@ export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChange
|
|
|
79
100
|
public uploadService: UploadService,
|
|
80
101
|
public toastController: ToastController,
|
|
81
102
|
private renderer: Renderer2,
|
|
103
|
+
public eventsService: EventsService
|
|
82
104
|
) { }
|
|
83
105
|
|
|
84
106
|
// ---------------------------------------------------------
|
|
@@ -87,7 +109,12 @@ export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChange
|
|
|
87
109
|
|
|
88
110
|
ngOnInit() {
|
|
89
111
|
// this.setSubscriptions();
|
|
112
|
+
|
|
90
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
|
+
}
|
|
91
118
|
// this.events.subscribe((cannedmessage) => {
|
|
92
119
|
// this.logger.log("[CONVS-DETAIL] [MSG-TEXT-AREA] events.subscribe cannedmessage ", cannedmessage);
|
|
93
120
|
// })
|
|
@@ -95,59 +122,83 @@ export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChange
|
|
|
95
122
|
// this.logger.log("[CONVS-DETAIL][MSG-TEXT-AREA] LONG_TEXAREA_PLACEHOLDER ", this.LONG_TEXAREA_PLACEHOLDER);
|
|
96
123
|
// this.logger.log("[CONVS-DETAIL][MSG-TEXT-AREA] SHORT_TEXAREA_PLACEHOLDER ", this.SHORT_TEXAREA_PLACEHOLDER);
|
|
97
124
|
// this.logger.log("[CONVS-DETAIL][MSG-TEXT-AREA] SHORTER_TEXAREA_PLACEHOLDER ", this.SHORTER_TEXAREA_PLACEHOLDER);
|
|
98
|
-
|
|
125
|
+
this.listenToNewCannedResponseCreated()
|
|
99
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;
|
|
100
138
|
}
|
|
101
139
|
|
|
102
140
|
|
|
103
141
|
|
|
142
|
+
|
|
104
143
|
ngOnChanges() {
|
|
105
144
|
if (this.translationMap) {
|
|
106
|
-
this.LONG_TEXAREA_PLACEHOLDER = this.translationMap.get('LABEL_ENTER_MSG')
|
|
107
|
-
this.SHORT_TEXAREA_PLACEHOLDER = this.translationMap.get('LABEL_ENTER_MSG_SHORT')
|
|
108
|
-
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
|
+
|
|
109
151
|
}
|
|
110
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)
|
|
111
160
|
this.logger.log("[CONVS-DETAIL][MSG-TEXT-AREA] ngOnChanges DROP EVENT ", this.dropEvent);
|
|
112
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
|
+
|
|
165
|
+
this.logger.log('[CONVS-DETAIL] - returnChangeTextArea ngOnChanges in [MSG-TEXT-AREA] this.tagsCannedFilter.length ', this.tagsCannedFilter.length)
|
|
166
|
+
|
|
113
167
|
// use case drop
|
|
114
168
|
if (this.dropEvent) {
|
|
115
169
|
this.presentModal(this.dropEvent)
|
|
116
170
|
}
|
|
117
171
|
// if (this.isOpenInfoConversation === true) {
|
|
118
172
|
// this.getIfTexareaIsEmpty('ngOnChanges')
|
|
119
|
-
this.getWindowWidth();
|
|
173
|
+
// this.getWindowWidth();
|
|
120
174
|
// }
|
|
121
175
|
}
|
|
122
176
|
|
|
123
177
|
// ngAfterViewInit() {
|
|
124
178
|
ngAfterViewInit() {
|
|
125
179
|
|
|
126
|
-
|
|
127
|
-
|
|
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);
|
|
128
182
|
if (this.messageTextArea) {
|
|
129
183
|
setTimeout(() => {
|
|
130
184
|
|
|
131
|
-
|
|
132
185
|
const elTextArea = this.message_text_area['el'];
|
|
133
|
-
//
|
|
186
|
+
// console.log("[CONVS-DETAIL][MSG-TEXT-AREA] ngAfterViewInit elTextArea ", elTextArea);
|
|
134
187
|
// this.logger.log("[CONVS-DETAIL][MSG-TEXT-AREA] ngAfterViewInit elTextArea children", elTextArea.children);
|
|
135
188
|
if (elTextArea.children.length === 1) {
|
|
136
189
|
|
|
137
190
|
const elTextAreaWrapper = elTextArea.children[0]
|
|
138
191
|
// this.logger.log("[CONVS-DETAIL][MSG-TEXT-AREA] ngAfterViewInit elTextAreaWrapper", elTextAreaWrapper);
|
|
139
|
-
|
|
192
|
+
|
|
140
193
|
if (elTextAreaWrapper.children.length === 1) {
|
|
141
194
|
const elNativeTearea = elTextAreaWrapper.children[0]
|
|
142
195
|
// this.logger.log("[CONVS-DETAIL][MSG-TEXT-AREA] ngAfterViewInit elNativeTearea", elNativeTearea);
|
|
143
|
-
|
|
196
|
+
elNativeTearea.setAttribute("style", "height: 37px !important; ");
|
|
144
197
|
}
|
|
145
198
|
}
|
|
146
199
|
|
|
147
|
-
|
|
148
200
|
// this.logger.log("[CONVS-DETAIL][MSG-TEXT-AREA] set focus on ", this.messageTextArea);
|
|
149
201
|
// Keyboard.show() // for android
|
|
150
|
-
|
|
151
202
|
this.messageTextArea.setFocus();
|
|
152
203
|
|
|
153
204
|
}, 1500); //a least 150ms.
|
|
@@ -158,46 +209,19 @@ export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChange
|
|
|
158
209
|
getWindowWidth(): any {
|
|
159
210
|
this.currentWindowWidth = window.innerWidth;
|
|
160
211
|
|
|
161
|
-
// if ((this.currentWindowWidth < 1045 && this.currentWindowWidth > 835) && this.isOpenInfoConversation === true) {
|
|
162
|
-
// this.logger.log("[CONVS-DETAIL] [MSG-TEXT-AREA] DISPLAY SHORT_TEXAREA_PLACEHOLDER ");
|
|
163
|
-
// // this.TEXAREA_PLACEHOLDER = '';
|
|
164
|
-
// this.TEXAREA_PLACEHOLDER = this.SHORT_TEXAREA_PLACEHOLDER;
|
|
165
|
-
// } else if (this.currentWindowWidth < 835 && this.isOpenInfoConversation === true) {
|
|
166
|
-
// this.logger.log("[CONVS-DETAIL] [MSG-TEXT-AREA] DISPLAY SHORTER_TEXAREA_PLACEHOLDER ");
|
|
167
|
-
|
|
168
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")) {
|
|
169
221
|
// this.TEXAREA_PLACEHOLDER = this.SHORTER_TEXAREA_PLACEHOLDER;
|
|
170
|
-
//
|
|
171
|
-
|
|
172
|
-
// }
|
|
173
|
-
// this.logger.log("[CONVS-DETAIL][MSG-TEXT-AREA] currentWindowWidth ", this.currentWindowWidth);
|
|
174
|
-
// this.logger.log('[CONVS-DETAIL][MSG-TEXT-AREA] isOpenInfoConversation', this.isOpenInfoConversation);
|
|
175
|
-
// this.logger.log('[CONVS-DETAIL][MSG-TEXT-AREA] this.conversationWith.startsWith("support-group")', this.conversationWith.startsWith("support-group"));
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
if (this.currentWindowWidth >= 844 && this.isOpenInfoConversation === false && this.conversationWith.startsWith("support-group")) {
|
|
179
|
-
|
|
180
|
-
this.TEXAREA_PLACEHOLDER = this.LONG_TEXAREA_PLACEHOLDER;
|
|
181
|
-
|
|
182
|
-
this.logger.log('[CONVS-DETAIL][MSG-TEXT-AREA] currentWindowWidth', this.currentWindowWidth, ' - DISPLAY LONG_TEXAREA_PLACEHOLDER ');
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
} else if (this.currentWindowWidth >= 844 && this.isOpenInfoConversation === true && this.conversationWith.startsWith("support-group")) {
|
|
186
|
-
this.TEXAREA_PLACEHOLDER = this.SHORT_TEXAREA_PLACEHOLDER;
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
} else if (this.currentWindowWidth < 844 && this.isOpenInfoConversation === false && this.conversationWith.startsWith("support-group")) {
|
|
190
|
-
|
|
191
|
-
this.TEXAREA_PLACEHOLDER = this.SHORT_TEXAREA_PLACEHOLDER;
|
|
192
|
-
|
|
193
|
-
} else if (this.currentWindowWidth < 844 && this.isOpenInfoConversation === true && this.conversationWith.startsWith("support-group")) {
|
|
194
|
-
|
|
195
|
-
this.TEXAREA_PLACEHOLDER = this.SHORTER_TEXAREA_PLACEHOLDER;
|
|
196
|
-
|
|
197
|
-
} else if (!this.conversationWith.startsWith("support-group")) {
|
|
198
|
-
this.TEXAREA_PLACEHOLDER = this.SHORT_TEXAREA_PLACEHOLDER;
|
|
199
|
-
|
|
200
|
-
}
|
|
222
|
+
// } else if (!this.conversationWith.startsWith("support-group")) {
|
|
223
|
+
// this.TEXAREA_PLACEHOLDER = this.SHORT_TEXAREA_PLACEHOLDER;
|
|
224
|
+
// }
|
|
201
225
|
|
|
202
226
|
// this.logger.log("[CONVS-DETAIL][MSG-TEXT-AREA] checkPlatformIsMobile() ", checkPlatformIsMobile());
|
|
203
227
|
if (checkPlatformIsMobile() === true) {
|
|
@@ -208,13 +232,7 @@ export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChange
|
|
|
208
232
|
} else if (this.currentWindowWidth <= 273) {
|
|
209
233
|
this.TEXAREA_PLACEHOLDER = this.SHORTER_TEXAREA_PLACEHOLDER;
|
|
210
234
|
}
|
|
211
|
-
|
|
212
235
|
}
|
|
213
|
-
// if (checkPlatformIsMobile && this.currentWindowWidth <= 430) {
|
|
214
|
-
// this.TEXAREA_PLACEHOLDER = this.SHORT_TEXAREA_PLACEHOLDER;
|
|
215
|
-
// } else if (checkPlatformIsMobile && this.currentWindowWidth > 430) {
|
|
216
|
-
// this.TEXAREA_PLACEHOLDER = this.LONG_TEXAREA_PLACEHOLDER;
|
|
217
|
-
// }
|
|
218
236
|
}
|
|
219
237
|
|
|
220
238
|
// -------------------------------------------------------------------------------------------
|
|
@@ -223,37 +241,21 @@ export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChange
|
|
|
223
241
|
@HostListener('window:resize', ['$event'])
|
|
224
242
|
onResize(event) {
|
|
225
243
|
// this.getIfTexareaIsEmpty('onResize')
|
|
226
|
-
|
|
227
|
-
// if ((event.target.innerWidth < 1045 && event.target.innerWidth > 835) && this.isOpenInfoConversation === true) {
|
|
228
|
-
// this.logger.log("[CONVS-DETAIL] [MSG-TEXT-AREA] ON RESIZE DISPAY SHORT_TEXAREA_PLACEHOLDER");
|
|
229
|
-
// this.TEXAREA_PLACEHOLDER = this.SHORT_TEXAREA_PLACEHOLDER;
|
|
230
|
-
// } else if (event.target.innerWidth < 835 && this.isOpenInfoConversation === true) {
|
|
231
|
-
// this.TEXAREA_PLACEHOLDER = this.SHORTER_TEXAREA_PLACEHOLDER;
|
|
232
|
-
// } else {
|
|
233
|
-
// this.TEXAREA_PLACEHOLDER = this.LONG_TEXAREA_PLACEHOLDER;
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
if (event.target.innerWidth >= 844 && this.isOpenInfoConversation === false && this.conversationWith.startsWith("support-group")) {
|
|
237
|
-
this.TEXAREA_PLACEHOLDER = this.LONG_TEXAREA_PLACEHOLDER;
|
|
238
|
-
// this.logger.log('[CONVS-DETAIL][MSG-TEXT-AREA] - else - DISPLAY LONG_TEXAREA_PLACEHOLDER ');
|
|
239
|
-
// this.logger.log('[CONVS-DETAIL][MSG-TEXT-AREA] - else - this.currentWindowWidth ', this.currentWindowWidth);
|
|
240
|
-
|
|
241
|
-
} else if (event.target.innerWidth >= 844 && this.isOpenInfoConversation === true && this.conversationWith.startsWith("support-group")) {
|
|
242
|
-
this.TEXAREA_PLACEHOLDER = this.SHORT_TEXAREA_PLACEHOLDER;
|
|
243
|
-
|
|
244
|
+
// console.log("[CONVS-DETAIL][MSG-TEXT-AREA] event.target.innerWidth; ", event.target.innerWidth);
|
|
244
245
|
|
|
245
|
-
} else if (event.target.innerWidth < 844 && this.isOpenInfoConversation === false && this.conversationWith.startsWith("support-group")) {
|
|
246
246
|
|
|
247
|
-
this.TEXAREA_PLACEHOLDER = this.SHORT_TEXAREA_PLACEHOLDER;
|
|
248
247
|
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
} else if (
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
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
|
+
// }
|
|
257
259
|
|
|
258
260
|
// this.logger.log('[CONVS-DETAIL][MSG-TEXT-AREA] checkPlatformIsMobile() ', checkPlatformIsMobile());
|
|
259
261
|
if (checkPlatformIsMobile() === true) {
|
|
@@ -293,6 +295,8 @@ export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChange
|
|
|
293
295
|
|
|
294
296
|
let content = event.clipboardData.getData('text/plain');
|
|
295
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
|
|
296
300
|
setTimeout(() => {
|
|
297
301
|
this.messageString = "";
|
|
298
302
|
}, 100);
|
|
@@ -325,6 +329,11 @@ export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChange
|
|
|
325
329
|
|
|
326
330
|
onFileSelected(e: any) {
|
|
327
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);
|
|
328
337
|
this.presentModal(e);
|
|
329
338
|
|
|
330
339
|
}
|
|
@@ -363,7 +372,7 @@ export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChange
|
|
|
363
372
|
}
|
|
364
373
|
// this.logger.log('presentModal e.target.files.length', e.target.files.length);
|
|
365
374
|
|
|
366
|
-
const attributes = { files: dataFiles, enableBackdropDismiss: false };
|
|
375
|
+
const attributes = { files: dataFiles, enableBackdropDismiss: false, msg: this.msg };
|
|
367
376
|
this.logger.log('[CONVS-DETAIL][MSG-TEXT-AREA] attributes', attributes);
|
|
368
377
|
const modal: HTMLIonModalElement =
|
|
369
378
|
await this.modalController.create({
|
|
@@ -455,7 +464,7 @@ export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChange
|
|
|
455
464
|
// this.logger.log("[CONVS-DETAIL][MSG-TEXT-AREA] ionChange detail.value ", e.detail.value);
|
|
456
465
|
|
|
457
466
|
const message = e.detail.value
|
|
458
|
-
|
|
467
|
+
this.logger.log("[CONVS-DETAIL] [MSG-TEXT-AREA] ionChange message ", message);
|
|
459
468
|
// this.logger.log("[CONVS-DETAIL] [MSG-TEXT-AREA] ionChange this.messageString ", this.messageString);
|
|
460
469
|
const height = e.target.offsetHeight + 20; // nk added +20
|
|
461
470
|
// this.logger.log("[CONVS-DETAIL] [MSG-TEXT-AREA] ionChange text-area height ", height);
|
|
@@ -472,7 +481,6 @@ export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChange
|
|
|
472
481
|
this.conversationEnabled = false;
|
|
473
482
|
}
|
|
474
483
|
|
|
475
|
-
|
|
476
484
|
this.eventChangeTextArea.emit({ msg: message, offsetHeight: height });
|
|
477
485
|
}
|
|
478
486
|
|
|
@@ -481,7 +489,10 @@ export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChange
|
|
|
481
489
|
// if the message is not empty it is passed to the control method
|
|
482
490
|
// ------------------------------------------------------------------------
|
|
483
491
|
onKeydown(e: any, text: string) {
|
|
492
|
+
this.logger.log("[CONVS-DETAIL] - returnChangeTextArea - onKeydown in MSG-TEXT-AREA event", e)
|
|
493
|
+
this.logger.log("[CONVS-DETAIL] - returnChangeTextArea - onKeydown in MSG-TEXT-AREA text", text)
|
|
484
494
|
e.preventDefault(); // Prevent press enter from creating new line
|
|
495
|
+
// console.log("[CONVS-DETAIL] replaceTagInMessage onKeydown in msg-texarea * event: ", e);
|
|
485
496
|
|
|
486
497
|
this.countClicks++;
|
|
487
498
|
this.logger.log('[CONVS-DETAIL][MSG-TEXT-AREA] onKeydown - countClicks: ', this.countClicks);
|
|
@@ -489,9 +500,18 @@ export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChange
|
|
|
489
500
|
this.logger.log('[CONVS-DETAIL][MSG-TEXT-AREA] onKeydown - event target: ', e.target);
|
|
490
501
|
this.logger.log('[CONVS-DETAIL][MSG-TEXT-AREA] onKeydown - event target textContent: ', e.target.textContent);
|
|
491
502
|
this.logger.log('[CONVS-DETAIL][MSG-TEXT-AREA] onKeydown - tagsCannedFilter: ', this.tagsCannedFilter);
|
|
503
|
+
|
|
492
504
|
// this.logger.error("[CONVS-DETAIL][MSG-TEXT-AREA] pressedOnKeyboard e.keyCode ", e.keyCode);
|
|
505
|
+
// this.events.subscribe((cannedmessage) => {
|
|
506
|
+
|
|
507
|
+
// console.log("[CONVS-DETAIL] replaceTagInMessage onKeydown in msg-texarea * cannedmessage: ", cannedmessage);
|
|
508
|
+
// });
|
|
493
509
|
|
|
494
|
-
|
|
510
|
+
// user and time are the same arguments passed in `events.publish(user, time)`
|
|
511
|
+
|
|
512
|
+
|
|
513
|
+
|
|
514
|
+
let message = e.target.textContent.trim();
|
|
495
515
|
this.logger.log('[CONVS-DETAIL][MSG-TEXT-AREA] onKeydown - event target textContent (message): ', message);
|
|
496
516
|
// e.inputType === 'insertLineBreak' &&
|
|
497
517
|
if (e.inputType === 'insertLineBreak' && message === '') {
|
|
@@ -501,13 +521,37 @@ export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChange
|
|
|
501
521
|
} else {
|
|
502
522
|
var pos = text.lastIndexOf("/");
|
|
503
523
|
this.logger.log("[CONVS-DETAIL][MSG-TEXT-AREA] onKeydown - POSITION OF '/': ", pos);
|
|
524
|
+
this.logger.log("[CONVS-DETAIL] returnChangeTextArea onKeydown in msg-texarea POSITION OF '/': ", pos);
|
|
525
|
+
this.logger.log("[CONVS-DETAIL] returnChangeTextArea onKeydown in msg-texarea this.tagsCannedFilter.length': ", this.tagsCannedFilter.length);
|
|
504
526
|
if (!text.includes("/")) {
|
|
505
527
|
this.logger.log('[CONVS-DETAIL][MSG-TEXT-AREA] onKeydown - SEND MESSAGE 1 message: ', message);
|
|
528
|
+
this.logger.log("[CONVS-DETAIL] replaceTagInMessage onKeydown in msg-texarea SEND MESSAGE 1 message: ", message);
|
|
506
529
|
this.messageString = '';
|
|
507
530
|
this.sendMessage(text);
|
|
508
531
|
this.countClicks = 0
|
|
509
|
-
} else if (text.includes("/") && pos
|
|
532
|
+
} else if (text.includes("/") && pos === 0 && this.countClicks > 1 && this.tagsCannedFilter.length > 0) {
|
|
510
533
|
this.logger.log('[CONVS-DETAIL][MSG-TEXT-AREA] onKeydown - tagsCannedFilter.length 2: ', this.tagsCannedFilter.length);
|
|
534
|
+
this.logger.log("[CONVS-DETAIL] replaceTagInMessage onKeydown in msg-texarea SEND MESSAGE 2 message: ", message);
|
|
535
|
+
this.logger.log('[CONVS-DETAIL][MSG-TEXT-AREA] onKeydown - SEND MESSAGE 2 message value: ', message.value);
|
|
536
|
+
this.logger.log('[CONVS-DETAIL][MSG-TEXT-AREA] onKeydown - SEND MESSAGE 2 text: ', text);
|
|
537
|
+
|
|
538
|
+
this.logger.log("[CONVS-DETAIL] replaceTagInMessage onKeydown in msg-texarea SEND MESSAGE 2 this.tagsCannedFilter.length: ", this.tagsCannedFilter.length);
|
|
539
|
+
this.logger.log("[CONVS-DETAIL] replaceTagInMessage onKeydown in msg-texarea SEND MESSAGE 2 this.countClicks: ", this.countClicks);
|
|
540
|
+
this.logger.log("[CONVS-DETAIL][MSG-TEXT-AREA] onKeydown in msg-texarea SEND MESSAGE 2 this.countClicks: ", this.countClicks);
|
|
541
|
+
this.logger.log('[CONVS-DETAIL][MSG-TEXT-AREA] onKeydown - SEND MESSAGE 2 message: ', message);
|
|
542
|
+
this.messageString = '';
|
|
543
|
+
|
|
544
|
+
this.sendMessage(text);
|
|
545
|
+
this.countClicks = 0
|
|
546
|
+
} else if (text.includes("/") && pos > 0 && this.countClicks > 1 && this.tagsCannedFilter.length > 0 && text.substr(-1) !== '/') {
|
|
547
|
+
this.logger.log('[CONVS-DETAIL][MSG-TEXT-AREA] onKeydown - tagsCannedFilter.length 3: ', this.tagsCannedFilter.length);
|
|
548
|
+
this.logger.log("[CONVS-DETAIL] replaceTagInMessage onKeydown in msg-texarea SEND MESSAGE 3 message: ", message);
|
|
549
|
+
// this.logger.log('[CONVS-DETAIL][MSG-TEXT-AREA] onKeydown - SEND MESSAGE 3 message value: ', message.value);
|
|
550
|
+
this.logger.log('[CONVS-DETAIL][MSG-TEXT-AREA] onKeydown - SEND MESSAGE 3 text: ', text);
|
|
551
|
+
|
|
552
|
+
this.logger.log("[CONVS-DETAIL] replaceTagInMessage onKeydown in msg-texarea SEND MESSAGE 2 this.tagsCannedFilter.length: ", this.tagsCannedFilter.length);
|
|
553
|
+
this.logger.log("[CONVS-DETAIL] replaceTagInMessage onKeydown in msg-texarea SEND MESSAGE 2 this.countClicks: ", this.countClicks);
|
|
554
|
+
this.logger.log("[CONVS-DETAIL][MSG-TEXT-AREA] onKeydown in msg-texarea SEND MESSAGE 2 this.countClicks: ", this.countClicks);
|
|
511
555
|
this.logger.log('[CONVS-DETAIL][MSG-TEXT-AREA] onKeydown - SEND MESSAGE 2 message: ', message);
|
|
512
556
|
this.messageString = '';
|
|
513
557
|
|
|
@@ -516,6 +560,7 @@ export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChange
|
|
|
516
560
|
} else if (text.includes("/") && this.tagsCannedFilter.length === 0) {
|
|
517
561
|
this.logger.log('[CONVS-DETAIL][MSG-TEXT-AREA] onKeydown - tagsCannedFilter.length 3: ', this.tagsCannedFilter.length);
|
|
518
562
|
this.logger.log('[CONVS-DETAIL][MSG-TEXT-AREA] onKeydown - SEND MESSAGE 3 message: ', message);
|
|
563
|
+
this.logger.log("[CONVS-DETAIL] replaceTagInMessage onKeydown in msg-texarea SEND MESSAGE 3 message: ", message);
|
|
519
564
|
this.messageString = '';
|
|
520
565
|
|
|
521
566
|
this.sendMessage(text);
|
|
@@ -525,18 +570,88 @@ export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChange
|
|
|
525
570
|
}
|
|
526
571
|
}
|
|
527
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
|
+
|
|
528
584
|
|
|
529
585
|
sendMessage(text: string) {
|
|
530
|
-
this.
|
|
586
|
+
this.showEmojiPicker = false;
|
|
587
|
+
this.logger.log('[CONVS-DETAIL][MSG-TEXT-AREA] sendMessage text', text);
|
|
531
588
|
this.logger.log('[CONVS-DETAIL][MSG-TEXT-AREA] sendMessage conve width', this.conversationWith);
|
|
532
589
|
// text.replace(/\s/g, "")
|
|
533
590
|
this.messageString = '';
|
|
534
591
|
// text = text.replace(/(\r\n|\n|\r)/gm, '');
|
|
535
|
-
if (text.trim() !== '') {
|
|
592
|
+
if (text && text.trim() !== '') {
|
|
536
593
|
this.eventSendMessage.emit({ message: text, type: TYPE_MSG_TEXT });
|
|
537
594
|
}
|
|
538
595
|
}
|
|
539
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
|
+
|
|
540
655
|
// --------------------------------
|
|
541
656
|
// on mobile !
|
|
542
657
|
// --------------------------------
|
|
@@ -584,11 +699,7 @@ export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChange
|
|
|
584
699
|
|
|
585
700
|
// Note: on mac keyboard "metakey" matches "cmd"
|
|
586
701
|
if (event.key === 'Enter' && event.altKey || event.key === 'Enter' && event.ctrlKey || event.key === 'Enter' && event.metaKey) {
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
702
|
this.logger.log('[CONVS-DETAIL][MSG-TEXT-AREA] HAS PRESSED COMBO KEYS this.messageString', this.messageString);
|
|
591
|
-
|
|
592
703
|
if (this.messageString !== undefined && this.messageString.trim() !== '') {
|
|
593
704
|
this.logger.log('[CONVS-DETAIL][MSG-TEXT-AREA] HAS PRESSED Enter + ALT this.messageString', this.messageString);
|
|
594
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
|
|