@chat21/chat21-ionic 3.0.61-rc8 → 3.0.62
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +81 -0
- package/README.md +6 -0
- package/angular.json +2 -0
- package/config.xml +0 -1
- package/deploy_pre.sh +1 -1
- package/deploy_prod.sh +1 -1
- package/env.sample +1 -1
- package/package.json +4 -4
- package/src/app/app-routing.module.ts +15 -0
- package/src/app/app.component.ts +12 -9
- package/src/app/app.module.ts +11 -3
- package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.html +36 -25
- package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.scss +160 -50
- package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.ts +108 -18
- package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.html +21 -36
- package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.scss +19 -7
- package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.ts +35 -40
- package/src/app/chatlib/conversation-detail/message/message-attachment/message-attachment.component.scss +1 -1
- package/src/app/chatlib/list-conversations-component/list-conversations/list-conversations.component.ts +13 -10
- package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.html +3 -2
- package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.scss +2 -0
- package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.ts +142 -71
- package/src/app/components/conversation-detail/message-text-area/message-text-area.component.html +57 -20
- package/src/app/components/conversation-detail/message-text-area/message-text-area.component.scss +32 -9
- package/src/app/components/conversation-detail/message-text-area/message-text-area.component.ts +98 -24
- package/src/app/components/ddp-header/ddp-header.component.html +9 -2
- package/src/app/components/ddp-header/ddp-header.component.ts +93 -18
- package/src/app/components/project-item/project-item.component.html +1 -1
- package/src/app/components/project-item/project-item.component.scss +1 -1
- package/src/app/components/project-item/project-item.component.ts +3 -3
- package/src/app/components/sidebar/sidebar.component.html +65 -52
- package/src/app/components/sidebar/sidebar.component.scss +23 -0
- package/src/app/components/sidebar/sidebar.component.ts +74 -26
- package/src/app/components/sidebar-user-details/sidebar-user-details.component.html +20 -9
- package/src/app/components/sidebar-user-details/sidebar-user-details.component.scss +30 -5
- package/src/app/components/sidebar-user-details/sidebar-user-details.component.ts +24 -8
- package/src/app/pages/conversation-detail/conversation-detail.module.ts +5 -1
- package/src/app/pages/conversation-detail/conversation-detail.page.html +19 -10
- package/src/app/pages/conversation-detail/conversation-detail.page.scss +28 -0
- package/src/app/pages/conversation-detail/conversation-detail.page.ts +229 -389
- package/src/app/pages/conversations-list/conversations-list.page.ts +646 -454
- 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 +2 -11
- package/src/app/pages/profile-info/profile-info.page.html +2 -2
- package/src/app/pages/profile-info/profile-info.page.scss +12 -1
- package/src/app/services/tiledesk/tiledesk.service.ts +190 -0
- package/src/app/shared/shared.module.ts +1 -1
- package/src/assets/i18n/de.json +37 -1
- package/src/assets/i18n/en.json +37 -1
- package/src/assets/i18n/es.json +38 -2
- package/src/assets/i18n/fr.json +38 -2
- package/src/assets/i18n/it.json +38 -2
- package/src/assets/i18n/pt.json +38 -2
- package/src/assets/i18n/ru.json +38 -2
- package/src/assets/i18n/sr.json +38 -2
- package/src/assets/i18n/tr.json +37 -1
- package/src/assets/images/default-avatar-x-select.png +0 -0
- package/src/assets/images/priority_icons/high.svg +3 -0
- package/src/assets/images/priority_icons/high_v2.svg +14 -0
- package/src/assets/images/priority_icons/low.svg +10 -0
- package/src/assets/images/priority_icons/low_v2.svg +14 -0
- package/src/assets/images/priority_icons/medium.svg +16 -0
- package/src/assets/images/priority_icons/medium_v2.svg +11 -0
- package/src/assets/images/priority_icons/urgent.svg +4 -0
- package/src/assets/images/priority_icons/urgent_v2.svg +16 -0
- package/src/chat-config-mqtt.json +25 -16
- package/src/chat-config-pre-test.json +1 -1
- package/src/chat-config-template.json +5 -4
- package/src/chat-config.json +1 -0
- package/src/chat21-core/providers/firebase/firebase-conversation-handler.ts +8 -3
- package/src/chat21-core/utils/constants.ts +2 -0
- package/src/chat21-core/utils/utils-message.ts +19 -0
- package/src/global.scss +33 -9
package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.ts
CHANGED
|
@@ -8,6 +8,8 @@ import { LoggerInstance } from 'src/chat21-core/providers/logger/loggerInstance'
|
|
|
8
8
|
import { TranslateService } from '@ngx-translate/core';
|
|
9
9
|
import { TiledeskAuthService } from 'src/chat21-core/providers/tiledesk/tiledesk-auth.service';
|
|
10
10
|
import * as moment from 'moment';
|
|
11
|
+
import { CreateCannedResponsePage } from 'src/app/pages/create-canned-response/create-canned-response.page'
|
|
12
|
+
import { ModalController } from '@ionic/angular';
|
|
11
13
|
@Component({
|
|
12
14
|
selector: 'chat-bubble-message',
|
|
13
15
|
templateUrl: './bubble-message.component.html',
|
|
@@ -17,13 +19,15 @@ export class BubbleMessageComponent implements OnInit, OnChanges {
|
|
|
17
19
|
|
|
18
20
|
@Input() message: MessageModel;
|
|
19
21
|
@Input() textColor: string;
|
|
22
|
+
@Input() areVisibleCAR: boolean;
|
|
23
|
+
@Input() support_mode: boolean;
|
|
20
24
|
@Output() onBeforeMessageRender = new EventEmitter();
|
|
21
25
|
@Output() onAfterMessageRender = new EventEmitter();
|
|
22
26
|
@Output() onImageRendered = new EventEmitter<boolean>()
|
|
23
27
|
isImage = isImage;
|
|
24
28
|
isFile = isFile;
|
|
25
29
|
isFrame = isFrame;
|
|
26
|
-
|
|
30
|
+
@Input() addAsCannedResponseTooltipText : string;
|
|
27
31
|
public browserLang: string;
|
|
28
32
|
|
|
29
33
|
tooltipOptions = {
|
|
@@ -41,46 +45,14 @@ export class BubbleMessageComponent implements OnInit, OnChanges {
|
|
|
41
45
|
constructor(
|
|
42
46
|
public sanitizer: DomSanitizer,
|
|
43
47
|
private translate: TranslateService,
|
|
44
|
-
public tiledeskAuthService: TiledeskAuthService
|
|
45
|
-
|
|
48
|
+
public tiledeskAuthService: TiledeskAuthService,
|
|
49
|
+
public modalController: ModalController,
|
|
46
50
|
) {
|
|
47
51
|
// console.log('BUBBLE-MSG Hello !!!!')
|
|
48
52
|
}
|
|
49
53
|
|
|
50
54
|
ngOnInit() {
|
|
51
|
-
|
|
52
55
|
this.setMomentLocale()
|
|
53
|
-
// this.browserLang = this.translate.getBrowserLang();
|
|
54
|
-
|
|
55
|
-
// if (this.browserLang) {
|
|
56
|
-
// if (this.browserLang === 'it') {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
// moment.locale('it', {
|
|
60
|
-
// calendar: {
|
|
61
|
-
// lastDay: '[Ieri alle] LT',
|
|
62
|
-
// sameDay: '[Oggi alle] LT',
|
|
63
|
-
// nextDay: '[Domani alle] LT',
|
|
64
|
-
// lastWeek: '[Ultimo] dddd [alle] LT',
|
|
65
|
-
// nextWeek: 'dddd [alle] LT',
|
|
66
|
-
// sameElse: 'lll'
|
|
67
|
-
// }
|
|
68
|
-
// });
|
|
69
|
-
|
|
70
|
-
// } else {
|
|
71
|
-
// moment.locale('en', {
|
|
72
|
-
// calendar: {
|
|
73
|
-
// lastDay: '[Yesterday at] LT',
|
|
74
|
-
// sameDay: '[Today at] LT',
|
|
75
|
-
// nextDay: '[Tomorrow at] LT',
|
|
76
|
-
// lastWeek: '[last] dddd [at] LT',
|
|
77
|
-
// nextWeek: 'dddd [at] LT',
|
|
78
|
-
// sameElse: 'lll'
|
|
79
|
-
// }
|
|
80
|
-
// });
|
|
81
|
-
// }
|
|
82
|
-
// }
|
|
83
|
-
|
|
84
56
|
}
|
|
85
57
|
|
|
86
58
|
|
|
@@ -109,15 +81,18 @@ export class BubbleMessageComponent implements OnInit, OnChanges {
|
|
|
109
81
|
sameElse: 'LLLL'
|
|
110
82
|
}
|
|
111
83
|
});
|
|
84
|
+
// this.translate.getTranslation(chat_lang).subscribe((labels: string) => {
|
|
85
|
+
// console.log('[BUBBLE-MESSAGE] translations: ', labels);
|
|
86
|
+
// });
|
|
112
87
|
}
|
|
113
88
|
|
|
114
89
|
ngOnChanges() {
|
|
115
|
-
|
|
90
|
+
this.logger.log('BUBBLE-MSG Hello !!!! this.message ', this.message)
|
|
91
|
+
this.logger.log('BUBBLE-MSG ngOnChanges areVisibleCAR', this.areVisibleCAR)
|
|
92
|
+
this.logger.log('BUBBLE-MSG ngOnChanges support_mode', this.support_mode)
|
|
116
93
|
if (this.message && this.message.metadata && typeof this.message.metadata === 'object') {
|
|
117
94
|
this.getMetadataSize(this.message.metadata)
|
|
118
|
-
// console.log('BUBBLE-MSG ngOnChanges message > metadata', this.message.metadata)
|
|
119
95
|
}
|
|
120
|
-
|
|
121
96
|
}
|
|
122
97
|
|
|
123
98
|
|
|
@@ -184,11 +159,11 @@ export class BubbleMessageComponent implements OnInit, OnChanges {
|
|
|
184
159
|
const domRepresentation = document.getElementsByClassName('chat-tooltip');
|
|
185
160
|
if (domRepresentation) {
|
|
186
161
|
const item = domRepresentation[0] as HTMLInputElement;
|
|
187
|
-
if (!item.classList.contains('tooltip-show')) {
|
|
162
|
+
if (item && !item.classList.contains('tooltip-show')) {
|
|
188
163
|
item.classList.add('tooltip-show');
|
|
189
164
|
}
|
|
190
165
|
setTimeout(function () {
|
|
191
|
-
if (item.classList.contains('tooltip-show')) {
|
|
166
|
+
if (item && item.classList.contains('tooltip-show')) {
|
|
192
167
|
item.classList.remove('tooltip-show');
|
|
193
168
|
}
|
|
194
169
|
}, that.tooltipOptions['hideDelayAfterClick']);
|
|
@@ -224,6 +199,26 @@ export class BubbleMessageComponent implements OnInit, OnChanges {
|
|
|
224
199
|
this.onImageRendered.emit(event)
|
|
225
200
|
}
|
|
226
201
|
|
|
202
|
+
async presentCreateCannedResponseModal(): Promise<any> {
|
|
203
|
+
this.logger.log('[BUBBLE-MESSAGE] PRESENT CREATE CANNED RESPONSE MODAL ')
|
|
204
|
+
const attributes = {
|
|
205
|
+
message: this.message,
|
|
206
|
+
}
|
|
207
|
+
const modal: HTMLIonModalElement = await this.modalController.create({
|
|
208
|
+
component: CreateCannedResponsePage,
|
|
209
|
+
componentProps: attributes,
|
|
210
|
+
swipeToClose: false,
|
|
211
|
+
backdropDismiss: false,
|
|
212
|
+
})
|
|
213
|
+
modal.onDidDismiss().then((dataReturned: any) => {
|
|
214
|
+
//
|
|
215
|
+
this.logger.log('[BUBBLE-MESSAGE] ', dataReturned.data)
|
|
216
|
+
})
|
|
217
|
+
|
|
218
|
+
return await modal.present()
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
|
|
227
222
|
// printMessage(message, messageEl, component) {
|
|
228
223
|
// const messageOBJ = { message: message, sanitizer: this.sanitizer, messageEl: messageEl, component: component}
|
|
229
224
|
// this.onBeforeMessageRender.emit(messageOBJ)
|
|
@@ -15,7 +15,7 @@ export class ListConversationsComponent implements OnInit {
|
|
|
15
15
|
@Input() listConversations: ConversationModel[];
|
|
16
16
|
@Input() limit?: number
|
|
17
17
|
@Input() stylesMap: Map<string, string>;
|
|
18
|
-
@Input() translationMap: Map<
|
|
18
|
+
@Input() translationMap: Map<string, string>;
|
|
19
19
|
@Output() onConversationSelected = new EventEmitter<ConversationModel>();
|
|
20
20
|
@Output() onImageLoaded = new EventEmitter<ConversationModel>();
|
|
21
21
|
@Output() onConversationLoaded = new EventEmitter<ConversationModel>();
|
|
@@ -29,9 +29,11 @@ export class ListConversationsComponent implements OnInit {
|
|
|
29
29
|
arrayDiffer: any;
|
|
30
30
|
|
|
31
31
|
uidConvSelected: string;
|
|
32
|
-
constructor(
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
constructor(
|
|
33
|
+
public iterableDiffers: IterableDiffers,
|
|
34
|
+
public kvDiffers: KeyValueDiffers
|
|
35
|
+
) {
|
|
36
|
+
this.iterableDifferListConv = this.iterableDiffers.find([]).create(null);
|
|
35
37
|
}
|
|
36
38
|
|
|
37
39
|
ngOnInit() {
|
|
@@ -44,7 +46,7 @@ export class ListConversationsComponent implements OnInit {
|
|
|
44
46
|
// })
|
|
45
47
|
}
|
|
46
48
|
|
|
47
|
-
ngOnChanges(changes: SimpleChanges){
|
|
49
|
+
ngOnChanges(changes: SimpleChanges) {
|
|
48
50
|
// console.log('empDifferMap:: 1111' + JSON.stringify(this.listConversations[1]))
|
|
49
51
|
// console.log('empDifferMap:: 1111', this.listConversations)
|
|
50
52
|
// this.listConversations.forEach(emp => {
|
|
@@ -56,7 +58,8 @@ export class ListConversationsComponent implements OnInit {
|
|
|
56
58
|
|
|
57
59
|
public openConversationByID(conversation) {
|
|
58
60
|
this.logger.log('[LISTCONVERSATIONS-W] openConversationByID: ', conversation);
|
|
59
|
-
if (
|
|
61
|
+
if (conversation) {
|
|
62
|
+
this.logger.log(conversation.recipient_fullname)
|
|
60
63
|
// this.conversationsService.updateIsNew(conversation);
|
|
61
64
|
// this.conversationsService.updateConversationBadge();
|
|
62
65
|
this.uidConvSelected = conversation.uid
|
|
@@ -67,10 +70,10 @@ export class ListConversationsComponent implements OnInit {
|
|
|
67
70
|
ngAfterViewInit() {
|
|
68
71
|
this.logger.log('[LISTCONVERSATIONS-W] ---ngAfterViewInit---: listConversations ', this.listConversations);
|
|
69
72
|
}
|
|
70
|
-
|
|
73
|
+
|
|
71
74
|
ngDoCheck() {
|
|
72
75
|
let changesListConversation = this.iterableDifferListConv.diff(this.listConversations);
|
|
73
|
-
if(changesListConversation){
|
|
76
|
+
if (changesListConversation) {
|
|
74
77
|
// changesListConversation.forEachAddedItem(element => {
|
|
75
78
|
// console.log('itemmmm 1111 added ', element)
|
|
76
79
|
// let conv = element.item
|
|
@@ -104,7 +107,7 @@ export class ListConversationsComponent implements OnInit {
|
|
|
104
107
|
// console.log('... Array changes ...', empArrayChanges);
|
|
105
108
|
// empArrayChanges.forEachAddedItem((record) => {
|
|
106
109
|
// console.log('1111 Added ', record.currentValue);
|
|
107
|
-
|
|
110
|
+
|
|
108
111
|
// });
|
|
109
112
|
// empArrayChanges.forEachRemovedItem((record) => {
|
|
110
113
|
// console.log('1111 Removed ' + record.previousValue);
|
|
@@ -128,7 +131,7 @@ export class ListConversationsComponent implements OnInit {
|
|
|
128
131
|
// });
|
|
129
132
|
// }
|
|
130
133
|
// }
|
|
131
|
-
|
|
134
|
+
|
|
132
135
|
}
|
|
133
136
|
|
|
134
137
|
|
|
@@ -45,12 +45,13 @@
|
|
|
45
45
|
<!-- openInfoConversation {{openInfoConversation}} -->
|
|
46
46
|
<ion-buttons slot="end">
|
|
47
47
|
|
|
48
|
-
<!-- <ion-button ion-button fill="clear" color="primary" size="small" (click)="
|
|
48
|
+
<!-- <ion-button ion-button fill="clear" color="primary" size="small" (click)="presentCreateTicketModal()" [ngClass]="{'resolve-conv-margin-right': !isMobile}">
|
|
49
49
|
<ion-icon name="ticket-outline"></ion-icon>
|
|
50
50
|
<span style="text-transform: capitalize; margin-left: 5px;"> {{ 'Crea ticket' | translate}} </span>
|
|
51
51
|
</ion-button> -->
|
|
52
52
|
|
|
53
|
-
<ion-button *ngIf="idConv.startsWith('support-group')" ion-button fill="clear" color="primary" size="small"
|
|
53
|
+
<ion-button *ngIf="idConv.startsWith('support-group') && conv_type !== 'archived'" ion-button fill="clear" color="primary" size="small"
|
|
54
|
+
(click)="closeConversation()" [ngClass]="{'resolve-conv-margin-right': !isMobile}" [disabled]="conv_closed === true">
|
|
54
55
|
<!-- <ion-icon slot="icon-only" name="alert-circle-outline"></ion-icon> -->
|
|
55
56
|
<ion-icon name="archive-outline"></ion-icon>
|
|
56
57
|
<!-- <ion-icon slot="icon-only" name="information-outline"></ion-icon> -->
|
|
@@ -150,6 +150,7 @@ ion-header {
|
|
|
150
150
|
|
|
151
151
|
.tile-info-with-ios {
|
|
152
152
|
left: 82px !important;
|
|
153
|
+
top: 10px!important;
|
|
153
154
|
}
|
|
154
155
|
|
|
155
156
|
.user-presence-ios {
|
|
@@ -158,6 +159,7 @@ ion-header {
|
|
|
158
159
|
|
|
159
160
|
.avatar-container-ios {
|
|
160
161
|
left: 55px;
|
|
162
|
+
top: 10px;
|
|
161
163
|
}
|
|
162
164
|
|
|
163
165
|
.resolve-conv-margin-right {
|
|
@@ -1,15 +1,27 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import {
|
|
2
|
+
Component,
|
|
3
|
+
OnInit,
|
|
4
|
+
Input,
|
|
5
|
+
Output,
|
|
6
|
+
EventEmitter,
|
|
7
|
+
OnChanges,
|
|
8
|
+
} from '@angular/core'
|
|
9
|
+
import { ActivatedRoute, Router } from '@angular/router'
|
|
10
|
+
import { ImageRepoService } from 'src/chat21-core/providers/abstract/image-repo.service'
|
|
4
11
|
|
|
5
12
|
// Logger
|
|
6
|
-
import { LoggerService } from 'src/chat21-core/providers/abstract/logger.service'
|
|
7
|
-
import { LoggerInstance } from 'src/chat21-core/providers/logger/loggerInstance'
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
import {
|
|
13
|
+
import { LoggerService } from 'src/chat21-core/providers/abstract/logger.service'
|
|
14
|
+
import { LoggerInstance } from 'src/chat21-core/providers/logger/loggerInstance'
|
|
15
|
+
import {
|
|
16
|
+
setConversationAvatar,
|
|
17
|
+
setChannelType,
|
|
18
|
+
} from 'src/chat21-core/utils/utils'
|
|
19
|
+
import { Platform } from '@ionic/angular'
|
|
20
|
+
|
|
21
|
+
import { ModalController } from '@ionic/angular'
|
|
22
|
+
import { EventsService } from 'src/app/services/events-service'
|
|
23
|
+
import { CreateTicketPage } from 'src/app/pages/create-ticket/create-ticket.page'
|
|
24
|
+
import { TiledeskService } from 'src/app/services/tiledesk/tiledesk.service'
|
|
13
25
|
|
|
14
26
|
@Component({
|
|
15
27
|
selector: 'app-header-conversation-detail',
|
|
@@ -17,32 +29,34 @@ import { EventsService } from 'src/app/services/events-service';
|
|
|
17
29
|
styleUrls: ['./header-conversation-detail.component.scss'],
|
|
18
30
|
})
|
|
19
31
|
export class HeaderConversationDetailComponent implements OnInit, OnChanges {
|
|
20
|
-
@Input() conversationAvatar: any
|
|
21
|
-
@Input() idLoggedUser: string
|
|
22
|
-
@Input()
|
|
23
|
-
@Input()
|
|
24
|
-
@Input()
|
|
25
|
-
@
|
|
32
|
+
@Input() conversationAvatar: any
|
|
33
|
+
@Input() idLoggedUser: string
|
|
34
|
+
@Input() conv_type: string
|
|
35
|
+
@Input() isOpenInfoConversation: boolean
|
|
36
|
+
@Input() isMobile: boolean
|
|
37
|
+
@Input() translationMap: Map<string, string>
|
|
38
|
+
@Output() eventOpenCloseInfoConversation = new EventEmitter<boolean>()
|
|
26
39
|
conversationWithFullname: string
|
|
27
|
-
openInfoConversation = true
|
|
28
|
-
openInfoMessage = true
|
|
29
|
-
DIRECT = 'direct'
|
|
30
|
-
|
|
31
|
-
isDirect = false
|
|
32
|
-
isTyping = false
|
|
33
|
-
borderColor = '#ffffff'
|
|
34
|
-
fontColor = '#949494'
|
|
35
|
-
membersConversation = ['SYSTEM']
|
|
36
|
-
fullNameConv: string
|
|
37
|
-
idConv: string
|
|
38
|
-
conversation_with_fullname: string
|
|
39
|
-
platformName: string
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
openInfoConversation = true
|
|
41
|
+
openInfoMessage = true
|
|
42
|
+
DIRECT = 'direct'
|
|
43
|
+
|
|
44
|
+
isDirect = false
|
|
45
|
+
isTyping = false
|
|
46
|
+
borderColor = '#ffffff'
|
|
47
|
+
fontColor = '#949494'
|
|
48
|
+
membersConversation = ['SYSTEM']
|
|
49
|
+
fullNameConv: string
|
|
50
|
+
idConv: string
|
|
51
|
+
conversation_with_fullname: string
|
|
52
|
+
platformName: string
|
|
53
|
+
conv_closed: boolean = false;
|
|
54
|
+
IS_ON_IOS_MOBILE_DEVICE: boolean
|
|
55
|
+
private logger: LoggerService = LoggerInstance.getInstance()
|
|
42
56
|
|
|
43
57
|
/**
|
|
44
58
|
* Constructor
|
|
45
|
-
* @param imageRepoService
|
|
59
|
+
* @param imageRepoService
|
|
46
60
|
*/
|
|
47
61
|
constructor(
|
|
48
62
|
public imageRepoService: ImageRepoService,
|
|
@@ -50,98 +64,155 @@ export class HeaderConversationDetailComponent implements OnInit, OnChanges {
|
|
|
50
64
|
public platform: Platform,
|
|
51
65
|
private router: Router,
|
|
52
66
|
// public tiledeskAuthService: TiledeskAuthService,
|
|
53
|
-
|
|
67
|
+
public tiledeskService: TiledeskService,
|
|
54
68
|
public events: EventsService,
|
|
69
|
+
public modalController: ModalController,
|
|
55
70
|
) {
|
|
56
|
-
this.route.paramMap.subscribe(params => {
|
|
57
|
-
|
|
58
|
-
|
|
71
|
+
this.route.paramMap.subscribe((params) => {
|
|
59
72
|
// this.conversationWithFullname = params.get('FullNameConv');
|
|
60
|
-
this.logger.log('[CONVS-DETAIL][HEADER] -> params: ', params)
|
|
73
|
+
this.logger.log('[CONVS-DETAIL][HEADER] -> params: ', params)
|
|
61
74
|
this.fullNameConv = params.get('FullNameConv')
|
|
62
|
-
this.logger.log(
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
75
|
+
this.logger.log(
|
|
76
|
+
'[CONVS-DETAIL][HEADER] -> params > conversation_with_fullname: ',
|
|
77
|
+
this.fullNameConv,
|
|
78
|
+
)
|
|
79
|
+
this.idConv = params.get('IDConv')
|
|
80
|
+
this.logger.log(
|
|
81
|
+
'[CONVS-DETAIL][HEADER] -> params > conversation_with: ',
|
|
82
|
+
this.idConv,
|
|
83
|
+
)
|
|
84
|
+
})
|
|
66
85
|
}
|
|
67
86
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
87
|
// ----------------------------------------------------
|
|
73
88
|
// @ Lifehooks
|
|
74
89
|
// ----------------------------------------------------
|
|
75
90
|
ngOnInit() {
|
|
76
|
-
this.logger.log('[CONVS-DETAIL][HEADER] - (ngOnInit) - idLoggedUser', this.idLoggedUser);
|
|
77
|
-
this.logger.log('[CONVS-DETAIL][HEADER] - (ngOnInit) - conversationAvatar', this.conversationAvatar);
|
|
78
|
-
this.conversation_with_fullname = this.conversationAvatar.conversation_with_fullname
|
|
79
91
|
|
|
92
|
+
this.logger.log('[CONVS-DETAIL][HEADER] - (ngOnInit) - idLoggedUser', this.idLoggedUser,)
|
|
93
|
+
this.logger.log('[CONVS-DETAIL][HEADER] - (ngOnInit) - conversationAvatar', this.conversationAvatar,)
|
|
94
|
+
this.logger.log('[CONVS-DETAIL][HEADER] - (ngOnInit) - conv_type', this.conv_type,)
|
|
95
|
+
this.conversation_with_fullname = this.conversationAvatar.conversation_with_fullname
|
|
96
|
+
this.listenToConversationHasBeenClosed()
|
|
80
97
|
this.initialize();
|
|
98
|
+
// this.isOniOSMobileDevice()
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
isOniOSMobileDevice() {
|
|
102
|
+
this.IS_ON_IOS_MOBILE_DEVICE = false;
|
|
103
|
+
if (/iPad|iPhone|iPod/i.test(window.navigator.userAgent)) {
|
|
104
|
+
this.IS_ON_IOS_MOBILE_DEVICE = true;
|
|
105
|
+
|
|
106
|
+
}
|
|
107
|
+
// console.log('[CONVS-DETAIL][HEADER] IS_ON_IOS_MOBILE_DEVICE ', this.IS_ON_IOS_MOBILE_DEVICE)
|
|
108
|
+
return this.IS_ON_IOS_MOBILE_DEVICE;
|
|
81
109
|
}
|
|
82
110
|
|
|
83
111
|
ngOnChanges() {
|
|
84
|
-
this.logger.log('[CONVS-DETAIL][HEADER] - (ngOnChanges) - conversationAvatar', this.conversationAvatar)
|
|
112
|
+
this.logger.log('[CONVS-DETAIL][HEADER] - (ngOnChanges) - conversationAvatar', this.conversationAvatar)
|
|
85
113
|
if (this.conversationAvatar) {
|
|
86
|
-
this.conversationAvatar.imageurl = this.imageRepoService.getImagePhotoUrl(
|
|
114
|
+
this.conversationAvatar.imageurl = this.imageRepoService.getImagePhotoUrl(
|
|
115
|
+
this.conversationAvatar.uid,
|
|
116
|
+
)
|
|
87
117
|
} else {
|
|
88
|
-
const channelType = setChannelType(this.idConv)
|
|
89
|
-
this.logger.log('[CONVS-DETAIL][HEADER] - (ngOnChanges) - conversationAvatar usecase UNDEFINED channelType ', channelType)
|
|
118
|
+
const channelType = setChannelType(this.idConv)
|
|
119
|
+
this.logger.log('[CONVS-DETAIL][HEADER] - (ngOnChanges) - conversationAvatar usecase UNDEFINED channelType ', channelType)
|
|
90
120
|
this.conversationAvatar = setConversationAvatar(
|
|
91
121
|
this.idConv,
|
|
92
122
|
this.fullNameConv,
|
|
93
123
|
channelType,
|
|
94
|
-
)
|
|
124
|
+
)
|
|
95
125
|
if (this.conversationAvatar) {
|
|
96
|
-
this.conversationAvatar.imageurl = this.imageRepoService.getImagePhotoUrl(
|
|
126
|
+
this.conversationAvatar.imageurl = this.imageRepoService.getImagePhotoUrl(
|
|
127
|
+
this.conversationAvatar.uid,
|
|
128
|
+
)
|
|
97
129
|
}
|
|
98
|
-
this.logger.log('[CONVS-DETAIL][HEADER] - (ngOnChanges) - conversationAvatar usecase UNDEFINED conversationAvatar', this.conversationAvatar)
|
|
130
|
+
this.logger.log('[CONVS-DETAIL][HEADER] - (ngOnChanges) - conversationAvatar usecase UNDEFINED conversationAvatar', this.conversationAvatar)
|
|
99
131
|
}
|
|
100
132
|
|
|
101
|
-
this.logger.log(
|
|
102
|
-
|
|
133
|
+
this.logger.log(
|
|
134
|
+
'[CONVS-DETAIL][HEADER] - (ngOnChanges) - isOpenInfoConversation',
|
|
135
|
+
this.isOpenInfoConversation,
|
|
136
|
+
)
|
|
137
|
+
this.openInfoConversation = this.isOpenInfoConversation
|
|
103
138
|
}
|
|
104
139
|
|
|
105
|
-
|
|
106
140
|
// ----------------------------------------------------
|
|
107
141
|
// @ Initialize (called in ngOnInit)
|
|
108
142
|
// ----------------------------------------------------
|
|
109
143
|
initialize() {
|
|
110
144
|
this.getPlatformName()
|
|
111
|
-
if (
|
|
112
|
-
this.
|
|
145
|
+
if (
|
|
146
|
+
this.conversationAvatar &&
|
|
147
|
+
this.conversationAvatar.channelType === this.DIRECT
|
|
148
|
+
) {
|
|
149
|
+
this.isDirect = true
|
|
113
150
|
} else if (this.idLoggedUser) {
|
|
114
|
-
this.membersConversation.push(this.idLoggedUser)
|
|
151
|
+
this.membersConversation.push(this.idLoggedUser)
|
|
115
152
|
}
|
|
116
153
|
}
|
|
117
154
|
|
|
118
155
|
getPlatformName() {
|
|
119
|
-
this.logger.log('getPlatformName this.platform', this.platform)
|
|
156
|
+
this.logger.log('getPlatformName this.platform', this.platform)
|
|
120
157
|
if (this.platform.is('ios')) {
|
|
121
158
|
this.platformName = 'ios'
|
|
122
|
-
this.logger.log('getPlatformName platformName', this.platformName)
|
|
123
|
-
} else if (this.platform.is('android')){
|
|
159
|
+
this.logger.log('getPlatformName platformName', this.platformName)
|
|
160
|
+
} else if (this.platform.is('android')) {
|
|
124
161
|
this.platformName = 'android'
|
|
125
|
-
this.logger.log('getPlatformName platformName', this.platformName)
|
|
162
|
+
this.logger.log('getPlatformName platformName', this.platformName)
|
|
126
163
|
}
|
|
127
164
|
}
|
|
128
165
|
|
|
129
166
|
closeConversation() {
|
|
130
|
-
this.
|
|
167
|
+
this.logger.log('[CONVS-DETAIL][HEADER] click on RESOLVE this.events', this.events)
|
|
168
|
+
this.events.publish('conversation:closed', this.idConv)
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
listenToConversationHasBeenClosed() {
|
|
172
|
+
this.events.subscribe('conversationhasbeenclosed', (convId) => {
|
|
173
|
+
// console.log('[CONVS-DETAIL][HEADER] conversationhasbeenclosed convId', convId)
|
|
174
|
+
if (convId === this.idConv) {
|
|
175
|
+
this.logger.log('[CONVS-DETAIL][HEADER] the conversation was closed',)
|
|
176
|
+
this.conv_closed = true;
|
|
177
|
+
}
|
|
178
|
+
});
|
|
131
179
|
}
|
|
132
180
|
|
|
181
|
+
|
|
182
|
+
|
|
133
183
|
onOpenCloseInfoConversation() {
|
|
134
|
-
this.openInfoMessage = false
|
|
135
|
-
this.openInfoConversation = !this.openInfoConversation
|
|
136
|
-
this.logger.log(
|
|
137
|
-
|
|
184
|
+
this.openInfoMessage = false
|
|
185
|
+
this.openInfoConversation = !this.openInfoConversation
|
|
186
|
+
this.logger.log(
|
|
187
|
+
'[CONVS-DETAIL][HEADER] - onOpenCloseInfoConversation - openInfoConversation ',
|
|
188
|
+
this.openInfoConversation,
|
|
189
|
+
)
|
|
190
|
+
this.eventOpenCloseInfoConversation.emit(this.openInfoConversation)
|
|
138
191
|
}
|
|
139
192
|
|
|
140
193
|
/** */
|
|
141
194
|
pushPage(event) { }
|
|
142
195
|
|
|
143
196
|
goBackToConversationList() {
|
|
144
|
-
this.router.navigateByUrl('/conversations-list')
|
|
197
|
+
this.router.navigateByUrl('/conversations-list')
|
|
145
198
|
}
|
|
146
199
|
|
|
200
|
+
// -----------------------------------------------------------------
|
|
201
|
+
// PRESENT MODAL CREATE TICKET (MOVED IN ddp-deader.component.ts)
|
|
202
|
+
// -----------------------------------------------------------------
|
|
203
|
+
// async presentCreateTicketModal(e: any): Promise<any>{
|
|
204
|
+
|
|
205
|
+
// // const attributes = { enableBackdropDismiss: false };
|
|
206
|
+
// const modal: HTMLIonModalElement =
|
|
207
|
+
// await this.modalController.create({
|
|
208
|
+
// component: CreateTicketPage,
|
|
209
|
+
// // componentProps: attributes,
|
|
210
|
+
// swipeToClose: false,
|
|
211
|
+
// backdropDismiss: false
|
|
212
|
+
// });
|
|
213
|
+
// modal.onDidDismiss().then((detail: any) => {
|
|
214
|
+
// this.logger.log('[CONVS-DETAIL][HEADER] ', detail.data);
|
|
215
|
+
// });
|
|
216
|
+
// return await modal.present();
|
|
217
|
+
// }
|
|
147
218
|
}
|
package/src/app/components/conversation-detail/message-text-area/message-text-area.component.html
CHANGED
|
@@ -38,36 +38,73 @@
|
|
|
38
38
|
|
|
39
39
|
<ion-col col-auto>
|
|
40
40
|
|
|
41
|
-
<div class="start-buttons" style="position: absolute;display: flex;">
|
|
42
|
-
|
|
43
|
-
<ng-container *ngIf="areVisibleCAR">
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
<ion-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
41
|
+
<div class="start-buttons" style="position: absolute;display: flex; top: 2px;">
|
|
42
|
+
|
|
43
|
+
<ng-container *ngIf="areVisibleCAR && support_mode === true">
|
|
44
|
+
<div class="canned-responses-btn-wpr" style="margin-left: -5px;"
|
|
45
|
+
tooltip="{{translationMap?.get('CANNED_RESPONSES')}}" [options]="tooltipOptions" placement="top">
|
|
46
|
+
<ion-button ion-button fill="clear" class="canned-responses-btn" (click)="openCannedResponses()"
|
|
47
|
+
[disabled]="!IS_SUPPORT_GROUP_CONVERSATION || disableTextarea">
|
|
48
|
+
<ion-icon slot="icon-only" lazy="true" name="flash-outline" style="font-size: 24px;"></ion-icon>
|
|
49
|
+
</ion-button>
|
|
50
|
+
</div>
|
|
51
|
+
<div *ngIf="IS_SUPPORT_GROUP_CONVERSATION && tagsCannedCount === 0"
|
|
52
|
+
tooltip="{{translationMap?.get('NO_CANNED_RESPONSES')}}" [options]="tooltipOptions" placement="top"
|
|
53
|
+
class="no-canned-responses-btn-badge">
|
|
54
|
+
<ion-icon name="alert-sharp" style="vertical-align: middle;"></ion-icon>
|
|
55
|
+
</div>
|
|
56
|
+
<div *ngIf="IS_SUPPORT_GROUP_CONVERSATION && tagsCannedCount > 0"
|
|
57
|
+
tooltip="{{translationMap?.get('YES_CANNED_RESPONSES')}}" [options]="tooltipOptions" placement="top"
|
|
58
|
+
class="canned-responses-btn-badge">
|
|
59
|
+
<ion-icon name="information-sharp" style="vertical-align: middle;"></ion-icon>
|
|
60
|
+
</div>
|
|
61
|
+
</ng-container>
|
|
56
62
|
|
|
57
|
-
|
|
58
|
-
<div class="upload-image-btn-wpr" tooltip="{{translationMap?.get('UPLOAD')}}" [options]="tooltipOptions"
|
|
63
|
+
|
|
64
|
+
<div class="upload-image-btn-wpr" tooltip="{{translationMap?.get('UPLOAD')}}" [options]="tooltipOptions"
|
|
65
|
+
placement="top">
|
|
59
66
|
<ion-button ion-button fill="clear" class="upload-image-btn" [disabled]="disableTextarea">
|
|
60
67
|
<ion-icon slot="icon-only" lazy="true" name="attach-outline"
|
|
61
68
|
style="font-size: 30px;transform: rotate(42deg);"></ion-icon>
|
|
62
69
|
<input #fileInput type="file" (change)="onFileSelected($event)" capture="camera" id="file-input"
|
|
63
70
|
[accept]="fileUploadAccept">
|
|
64
|
-
|
|
71
|
+
|
|
65
72
|
</ion-button>
|
|
66
|
-
|
|
73
|
+
|
|
74
|
+
</div>
|
|
75
|
+
|
|
76
|
+
<!-- <ion-icon (click)="showEmojiPicker = !showEmojiPicker" color="secondary" name="happy" style="zoom:2;"></ion-icon> -->
|
|
77
|
+
<!-- --------------------------------------------- -->
|
|
78
|
+
<!-- Emoji Picker Button tooltip="{{translationMap?.get('CANNED_RESPONSES')}}" [options]="tooltipOptions" placement="top" -->
|
|
79
|
+
<!-- --------------------------------------------- -->
|
|
80
|
+
<div class="emoji-picker-btn-wpr">
|
|
81
|
+
<ion-button ion-button fill="clear" class="emoji-picker-btn" (click)="showEmojiPicker = !showEmojiPicker"
|
|
82
|
+
[disabled]="disableTextarea">
|
|
83
|
+
<!-- <ion-icon slot="icon-only" lazy="true" name="flash-outline" style="font-size: 24px;"></ion-icon> -->
|
|
84
|
+
<ion-icon slot="icon-only" lazy="true" name="happy-outline" style="font-size: 24px;"></ion-icon>
|
|
85
|
+
</ion-button>
|
|
86
|
+
|
|
87
|
+
<!-- <div class="emojiContainer" [style.height]="showEmojiPicker?'300px':'0px'"> -->
|
|
88
|
+
<!--Show/Hide emoji picker. Don't use *ngIf because the component will be created again and again and cause performance issue-->
|
|
89
|
+
<!-- <emoji-picker (onEmojiSelect)="addEmoji($event)"></emoji-picker> -->
|
|
90
|
+
<!-- { position: 'absolute', bottom: '20px', right: '20px' }" -->
|
|
91
|
+
<!-- --------------------------------------------------------------------- -->
|
|
92
|
+
<!-- https://www.npmjs.com/package/@ctrl/ngx-emoji-mart/v/1.0.6 -->
|
|
93
|
+
<!-- --------------------------------------------------------------------- -->
|
|
94
|
+
<!-- [style]="{ position: 'absolute', bottom: '53px', right: '-246px' }" -->
|
|
95
|
+
<emoji-mart [showPreview]="false" [perLine]="emojiPerLine" [style.visibility]="showEmojiPicker?'visible':'hidden'"
|
|
96
|
+
(emojiSelect)="addEmoji($event)" [ngClass]="{'emoji-mart-desktop': !IS_ON_MOBILE_DEVICE, 'emoji-mart-mobile': IS_ON_MOBILE_DEVICE }">
|
|
97
|
+
</emoji-mart>
|
|
98
|
+
<!-- </div> -->
|
|
99
|
+
|
|
67
100
|
</div>
|
|
68
101
|
</div>
|
|
69
102
|
|
|
70
|
-
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
<div class="text-message" [ngClass]="{'text-message-no-cr': areVisibleCAR === false || support_mode === false}">
|
|
71
108
|
<ion-textarea id="ion-textarea" #messageTextArea #message_text_area #textArea rows="1"
|
|
72
109
|
[placeholder]="TEXAREA_PLACEHOLDER" autosize="false" auto-grow="true" autofocus="true" [value]=""
|
|
73
110
|
[(ngModel)]="messageString" (ionChange)="ionChange($event);" [disabled]="disableTextarea"
|