@chat21/chat21-ionic 3.0.61-rc11 → 3.0.61-rc15
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 +22 -0
- package/angular.json +1 -0
- package/package.json +2 -1
- package/src/app/app-routing.module.ts +5 -0
- package/src/app/app.module.ts +6 -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 +101 -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/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 +28 -25
- 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 +93 -24
- package/src/app/components/project-item/project-item.component.scss +1 -1
- package/src/app/components/sidebar/sidebar.component.html +36 -35
- package/src/app/components/sidebar/sidebar.component.ts +72 -26
- package/src/app/components/sidebar-user-details/sidebar-user-details.component.html +7 -0
- package/src/app/components/sidebar-user-details/sidebar-user-details.component.scss +13 -1
- package/src/app/components/sidebar-user-details/sidebar-user-details.component.ts +11 -7
- package/src/app/pages/conversation-detail/conversation-detail.module.ts +5 -1
- package/src/app/pages/conversation-detail/conversation-detail.page.html +19 -11
- package/src/app/pages/conversation-detail/conversation-detail.page.scss +28 -0
- package/src/app/pages/conversation-detail/conversation-detail.page.ts +221 -368
- package/src/app/pages/conversations-list/conversations-list.page.ts +6 -18
- 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.page.html +1 -1
- package/src/app/pages/create-requester/create-requester.page.ts +1 -0
- package/src/app/pages/create-ticket/create-ticket.page.html +1 -1
- package/src/app/pages/create-ticket/create-ticket.page.ts +13 -4
- 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 +28 -0
- package/src/app/shared/shared.module.ts +1 -1
- package/src/assets/i18n/de.json +17 -3
- package/src/assets/i18n/en.json +17 -3
- package/src/assets/i18n/es.json +17 -3
- package/src/assets/i18n/fr.json +17 -3
- package/src/assets/i18n/it.json +17 -3
- package/src/assets/i18n/pt.json +17 -3
- package/src/assets/i18n/ru.json +17 -3
- package/src/assets/i18n/sr.json +17 -3
- package/src/assets/i18n/tr.json +17 -3
- package/src/chat21-core/providers/firebase/firebase-conversation-handler.ts +8 -3
- package/src/chat21-core/utils/utils-message.ts +19 -0
- package/src/global.scss +8 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ConversationContentComponent } from '../conversation-content/conversation-content.component';
|
|
2
|
-
import { ChangeDetectorRef, Component, Input, OnInit, Output, EventEmitter} from '@angular/core';
|
|
2
|
+
import { ChangeDetectorRef, Component, Input, OnInit, Output, EventEmitter } from '@angular/core';
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
import { MESSAGE_TYPE_INFO, MESSAGE_TYPE_MINE, MESSAGE_TYPE_OTHERS } from 'src/chat21-core/utils/constants';
|
|
@@ -9,23 +9,29 @@ import { isFile, isFrame, isImage } from 'src/chat21-core/utils/utils-message';
|
|
|
9
9
|
|
|
10
10
|
import { LoggerService } from 'src/chat21-core/providers/abstract/logger.service';
|
|
11
11
|
import { LoggerInstance } from 'src/chat21-core/providers/logger/loggerInstance';
|
|
12
|
-
|
|
12
|
+
import { TiledeskAuthService } from 'src/chat21-core/providers/tiledesk/tiledesk-auth.service';
|
|
13
|
+
import { TranslateService } from '@ngx-translate/core';
|
|
14
|
+
import * as moment from 'moment';
|
|
15
|
+
import { AppConfigProvider } from 'src/app/services/app-config';
|
|
13
16
|
@Component({
|
|
14
17
|
selector: 'ion-conversation-detail',
|
|
15
18
|
templateUrl: './ion-conversation-detail.component.html',
|
|
16
19
|
styleUrls: ['./ion-conversation-detail.component.scss'],
|
|
17
20
|
})
|
|
18
21
|
export class IonConversationDetailComponent extends ConversationContentComponent implements OnInit {
|
|
19
|
-
|
|
22
|
+
|
|
20
23
|
@Input() senderId: string;
|
|
21
24
|
@Input() channelType: string;
|
|
22
|
-
@Output() onImageRendered = new EventEmitter<boolean>()
|
|
25
|
+
@Output() onImageRendered = new EventEmitter<boolean>()
|
|
23
26
|
@Output() onAddUploadingBubble = new EventEmitter<boolean>();
|
|
24
|
-
|
|
25
27
|
|
|
28
|
+
public public_Key: any
|
|
29
|
+
public areVisibleCAR: boolean
|
|
30
|
+
public support_mode: boolean
|
|
26
31
|
public uploadProgress: number = 100
|
|
27
32
|
public fileType: any
|
|
28
|
-
|
|
33
|
+
public browserLang: string;
|
|
34
|
+
public addAsCannedResponseTooltipText: string;
|
|
29
35
|
isImage = isImage;
|
|
30
36
|
isFile = isFile;
|
|
31
37
|
isFrame = isFrame;
|
|
@@ -47,38 +53,105 @@ export class IonConversationDetailComponent extends ConversationContentComponent
|
|
|
47
53
|
*/
|
|
48
54
|
constructor(
|
|
49
55
|
public cdref: ChangeDetectorRef,
|
|
50
|
-
public uploadService: UploadService
|
|
56
|
+
public uploadService: UploadService,
|
|
57
|
+
public tiledeskAuthService: TiledeskAuthService,
|
|
58
|
+
private translate: TranslateService,
|
|
59
|
+
public appConfigProvider: AppConfigProvider,
|
|
51
60
|
) {
|
|
52
61
|
super(cdref, uploadService)
|
|
53
|
-
|
|
62
|
+
|
|
54
63
|
}
|
|
55
64
|
|
|
56
|
-
ngOnInit() {
|
|
57
|
-
|
|
65
|
+
ngOnInit() {
|
|
66
|
+
this.getOSCODE()
|
|
67
|
+
this.listenToUploadFileProgress();
|
|
68
|
+
this.setMomentLocaleAndGetTranslation();
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
getOSCODE() {
|
|
72
|
+
this.support_mode = this.appConfigProvider.getConfig().supportMode
|
|
73
|
+
this.public_Key = this.appConfigProvider.getConfig().t2y12PruGU9wUtEGzBJfolMIgK
|
|
74
|
+
this.logger.log('[CONVS-DETAIL][ION-CONVS-DETAIL] AppConfigService getAppConfig public_Key', this.public_Key)
|
|
75
|
+
|
|
76
|
+
if (this.public_Key) {
|
|
77
|
+
let keys = this.public_Key.split('-')
|
|
78
|
+
this.logger.log('[CONVS-DETAIL][ION-CONVS-DETAIL] PUBLIC-KEY - public_Key keys', keys)
|
|
79
|
+
|
|
80
|
+
keys.forEach((key) => {
|
|
81
|
+
if (key.includes('CAR')) {
|
|
82
|
+
let car = key.split(':')
|
|
83
|
+
if (car[1] === 'F') {
|
|
84
|
+
this.areVisibleCAR = false
|
|
85
|
+
this.logger.log('[CONVS-DETAIL][ION-CONVS-DETAIL] PUBLIC-KEY - areVisibleCAR', this.areVisibleCAR)
|
|
86
|
+
} else {
|
|
87
|
+
this.areVisibleCAR = true
|
|
88
|
+
this.logger.log('[CONVS-DETAIL][ION-CONVS-DETAIL] PUBLIC-KEY - areVisibleCAR', this.areVisibleCAR)
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
})
|
|
92
|
+
|
|
93
|
+
if (!this.public_Key.includes('CAR')) {
|
|
94
|
+
this.areVisibleCAR = false
|
|
95
|
+
console.log('[CONVS-DETAIL][ION-CONVS-DETAIL] PUBLIC-KEY - areVisibleCAR', this.areVisibleCAR)
|
|
96
|
+
}
|
|
97
|
+
} else {
|
|
98
|
+
this.areVisibleCAR = false
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
setMomentLocaleAndGetTranslation() {
|
|
103
|
+
this.browserLang = this.translate.getBrowserLang();
|
|
104
|
+
const currentUser = this.tiledeskAuthService.getCurrentUser();
|
|
105
|
+
this.logger.log('[CONVS-DETAIL][ION-CONVS-DETAIL] - ngOnInit - currentUser ', currentUser)
|
|
106
|
+
let currentUserId = ''
|
|
107
|
+
if (currentUser) {
|
|
108
|
+
currentUserId = currentUser.uid
|
|
109
|
+
this.logger.log('[CONVS-DETAIL][ION-CONVS-DETAIL]] - ngOnInit - currentUserId ', currentUserId)
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
const stored_preferred_lang = localStorage.getItem(currentUserId + '_lang');
|
|
113
|
+
this.logger.log('[CONVS-DETAIL][ION-CONVS-DETAIL] stored_preferred_lang: ', stored_preferred_lang);
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
let chat_lang = ''
|
|
117
|
+
if (this.browserLang && !stored_preferred_lang) {
|
|
118
|
+
chat_lang = this.browserLang
|
|
119
|
+
} else if (this.browserLang && stored_preferred_lang) {
|
|
120
|
+
chat_lang = stored_preferred_lang
|
|
121
|
+
}
|
|
122
|
+
moment.locale(chat_lang)
|
|
123
|
+
// this.translate.getTranslation(chat_lang).subscribe((labels: string) => {
|
|
124
|
+
// console.log('[CONVS-DETAIL] translations: ', labels);
|
|
125
|
+
// });
|
|
126
|
+
this.translate.get('AddAsCannedResponse')
|
|
127
|
+
.subscribe((text: string) => {
|
|
128
|
+
// console.log('[CONVS-DETAIL] AddAsCannedResponse translated: ', text);
|
|
129
|
+
this.addAsCannedResponseTooltipText = text
|
|
130
|
+
})
|
|
58
131
|
}
|
|
59
132
|
|
|
60
133
|
listenToUploadFileProgress() {
|
|
61
134
|
this.logger.log('[CONVS-DETAIL][ION-CONVS-DETAIL] FIREBASE-UPLOAD - calling BSStateUpload ');
|
|
62
135
|
this.uploadService.BSStateUpload.subscribe((data: any) => {
|
|
63
136
|
this.logger.log('[CONVS-DETAIL][ION-CONVS-DETAIL] FIREBASE-UPLOAD - BSStateUpload data', data);
|
|
64
|
-
|
|
137
|
+
|
|
65
138
|
if (data) {
|
|
66
139
|
this.logger.log('[CONVS-DETAIL][ION-CONVS-DETAIL] FIREBASE-UPLOAD - BSStateUpload data.upload', data.upload);
|
|
67
140
|
this.logger.log('[CONVS-DETAIL][ION-CONVS-DETAIL] FIREBASE-UPLOAD - BSStateUpload data.upload typeof', typeof data.upload);
|
|
68
141
|
this.uploadProgress = data.upload
|
|
69
142
|
|
|
70
|
-
if (isNaN(data.upload))
|
|
143
|
+
if (isNaN(data.upload)) {
|
|
71
144
|
this.logger.log('[CONVS-DETAIL][ION-CONVS-DETAIL] FIREBASE-UPLOAD - BSStateUpload data.upload IS NaN (e.g. file size is 0)');
|
|
72
145
|
this.uploadProgress = 100
|
|
73
146
|
}
|
|
74
147
|
// if (data.type.startsWith("application")) {
|
|
75
148
|
// if (!data.type.startsWith("image")) {
|
|
76
|
-
|
|
77
|
-
// this.fileType = 'file'
|
|
78
149
|
|
|
79
|
-
|
|
150
|
+
// this.fileType = 'file'
|
|
151
|
+
|
|
152
|
+
this.addUploadingBubblePlaceholder(true)
|
|
80
153
|
|
|
81
|
-
|
|
154
|
+
// this.logger.log('[CONVS-DETAIL][ION-CONVS-DETAIL] FIREBASE-UPLOAD - BSStateUpload this.fileType', this.fileType);
|
|
82
155
|
// }
|
|
83
156
|
}
|
|
84
157
|
});
|
|
@@ -88,10 +161,20 @@ export class IonConversationDetailComponent extends ConversationContentComponent
|
|
|
88
161
|
this.onAddUploadingBubble.emit(value);
|
|
89
162
|
}
|
|
90
163
|
|
|
91
|
-
onImageRenderedFN(event){
|
|
164
|
+
onImageRenderedFN(event) {
|
|
92
165
|
this.logger.log('[CONVS-DETAIL][ION-CONVS-DETAIL] - onImageRenderedFN:::ionic', event)
|
|
93
166
|
this.onImageRendered.emit(event)
|
|
94
167
|
}
|
|
95
168
|
|
|
96
|
-
|
|
169
|
+
/**
|
|
170
|
+
* Track by function for ngFor loops
|
|
171
|
+
*
|
|
172
|
+
* @param index
|
|
173
|
+
* @param item
|
|
174
|
+
*/
|
|
175
|
+
trackByFn(index: number, item: any): any {
|
|
176
|
+
// console.log('[CONVS-DETAIL][ION-CONVS-DETAIL] - trackByFn index', index)
|
|
177
|
+
// console.log('[CONVS-DETAIL][ION-CONVS-DETAIL] - trackByFn item', item)
|
|
178
|
+
return item.uid || index;
|
|
179
|
+
}
|
|
97
180
|
}
|
package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.html
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<!-- [ngClass]="{'button-in-msg' : message.metadata && message.metadata.button}" -->
|
|
2
2
|
<!-- [ngStyle]="{'padding': (isImage(message) || isFrame(message))?'0px':'0 8px'}" -->
|
|
3
3
|
<!-- isImage >{{isImage(message) }} message.metadata.width {{message?.metadata?.width }} -->
|
|
4
|
-
<div id="bubble-message"
|
|
5
|
-
|
|
6
|
-
[class.emoticon]="message?.emoticon">
|
|
4
|
+
<div id="bubble-message"
|
|
5
|
+
[ngStyle]="{'padding': (isImage(message) || isFrame(message))?'0px':'0 8px', 'width': (isImage(message) || isFrame(message))? message?.metadata?.width + 'px' : null }"
|
|
6
|
+
class="messages primary-color" [class.emoticon]="message?.emoticon">
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
<div>
|
|
@@ -18,19 +18,13 @@
|
|
|
18
18
|
|
|
19
19
|
<!-- [width]="getMetadataSize(message.metadata).width"
|
|
20
20
|
[height]="getMetadataSize(message.metadata).height" -->
|
|
21
|
-
<chat-image *ngIf="isImage(message)"
|
|
22
|
-
[
|
|
23
|
-
|
|
24
|
-
[width]="message.metadata.width"
|
|
25
|
-
[height]="message.metadata.height"
|
|
26
|
-
(onImageRendered)="onImageRenderedFN($event)">
|
|
21
|
+
<chat-image *ngIf="isImage(message)" [metadata]="message.metadata" [width]="message.metadata.width"
|
|
22
|
+
[height]="message.metadata.height" (onImageRendered)="onImageRenderedFN($event)">
|
|
27
23
|
</chat-image>
|
|
28
24
|
|
|
29
25
|
<!-- [width]="getMetadataSize(message.metadata).width" -->
|
|
30
26
|
<!-- [height]="getMetadataSize(message.metadata).height"> -->
|
|
31
|
-
<chat-frame *ngIf="isFrame(message)"
|
|
32
|
-
[metadata]="message.metadata"
|
|
33
|
-
[width]="message.metadata.width"
|
|
27
|
+
<chat-frame *ngIf="isFrame(message)" [metadata]="message.metadata" [width]="message.metadata.width"
|
|
34
28
|
[height]="message.metadata.height">
|
|
35
29
|
</chat-frame>
|
|
36
30
|
|
|
@@ -40,36 +34,27 @@
|
|
|
40
34
|
[height]="message.metadata.height">
|
|
41
35
|
</chat-frame> -->
|
|
42
36
|
|
|
43
|
-
<!-- message type:: text -->
|
|
44
|
-
<!-- <div *ngIf="message.type == 'text'"> -->
|
|
45
|
-
|
|
46
|
-
<div *ngIf="message?.text" [tooltip]="timeTooltipLeft" [options]="tooltipOptions" placement="left"
|
|
47
|
-
content-type="template" (click)="handleTooltipEvents($event)">
|
|
48
|
-
<ng-template #timeTooltipLeft>
|
|
49
|
-
<!-- <span>{{message.timestamp | amTimeAgo}}</span> -->
|
|
50
|
-
<!-- <span> {{browserLang === 'it' ? (message.timestamp| amDateFormat:'DD MMM') : (message.timestamp |
|
|
51
|
-
amDateFormat:'MMM DD')}} </span> amCalendar -->
|
|
52
37
|
|
|
38
|
+
<!-- [tooltip]="timeTooltipLeft" [options]="tooltipOptions" placement="left" content-type="template" (click)="handleTooltipEvents($event)" -->
|
|
39
|
+
<div *ngIf="message?.text">
|
|
40
|
+
<span class="message-date"> {{message.timestamp | date:'HH:mm' }} </span>
|
|
41
|
+
<!-- <ng-template #timeTooltipLeft>
|
|
53
42
|
<span> {{message.timestamp | amCalendar }} </span>
|
|
54
|
-
</ng-template>
|
|
43
|
+
</ng-template> -->
|
|
55
44
|
|
|
56
|
-
<chat-text
|
|
57
|
-
|
|
58
|
-
[color]="textColor"
|
|
59
|
-
[message]="message"
|
|
45
|
+
<chat-text [text]="message?.text" [color]="textColor" [message]="message"
|
|
46
|
+
[class.chat-text-emoticon]="message?.emoticon"
|
|
60
47
|
(onBeforeMessageRender)="returnOnBeforeMessageRender($event)"
|
|
61
48
|
(onAfterMessageRender)="returnOnAfterMessageRender($event)">
|
|
62
49
|
</chat-text>
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
</
|
|
70
|
-
|
|
71
|
-
<p #messageEl [innerHTML]="printMessage(message, messageEl, this) | linky"></p>
|
|
72
|
-
</ng-template> -->
|
|
50
|
+
|
|
51
|
+
<ng-container *ngIf="areVisibleCAR && support_mode === true">
|
|
52
|
+
<ion-button shape="round" size="small" class="btn-add-msg-as-canned-response" ion-button fill="clear"
|
|
53
|
+
(click)="presentCreateCannedResponseModal()" tooltip="{{addAsCannedResponseTooltipText}}"
|
|
54
|
+
[options]="tooltipOptions" placement="bottom">
|
|
55
|
+
<ion-icon slot="icon-only" name="flash-outline" style="font-size: 1em;"> </ion-icon>
|
|
56
|
+
</ion-button>
|
|
57
|
+
</ng-container>
|
|
73
58
|
</div>
|
|
74
59
|
</div>
|
|
75
60
|
|
package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.scss
CHANGED
|
@@ -21,7 +21,6 @@
|
|
|
21
21
|
font-variant: normal;
|
|
22
22
|
font-weight: 300;
|
|
23
23
|
overflow: hidden;
|
|
24
|
-
|
|
25
24
|
}
|
|
26
25
|
img {
|
|
27
26
|
border-radius: 8px;
|
|
@@ -32,20 +31,33 @@
|
|
|
32
31
|
height: auto;
|
|
33
32
|
object-fit: cover;
|
|
34
33
|
}
|
|
34
|
+
|
|
35
35
|
.message_innerhtml {
|
|
36
36
|
margin: 0px;
|
|
37
37
|
// padding: 0px 14px;
|
|
38
|
-
&.marked{
|
|
39
|
-
padding:8px;
|
|
40
|
-
margin-block-start: -1em!important;
|
|
41
|
-
margin-block-end: -1em!important;
|
|
38
|
+
&.marked {
|
|
39
|
+
padding: 8px;
|
|
40
|
+
margin-block-start: -1em !important;
|
|
41
|
+
margin-block-end: -1em !important;
|
|
42
42
|
}
|
|
43
|
-
|
|
43
|
+
|
|
44
44
|
.text-message {
|
|
45
45
|
padding-top: 14px;
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
|
-
|
|
49
48
|
}
|
|
49
|
+
// > .button-native
|
|
50
|
+
.btn-add-msg-as-canned-response {
|
|
51
|
+
// padding-left: 5px ;
|
|
52
|
+
// padding-right: 5px ;
|
|
53
|
+
border-radius: 50%;
|
|
54
|
+
--padding-end: 7px;
|
|
55
|
+
--padding-start: 7px;
|
|
56
|
+
box-shadow: 0 1px 2px 0 rgb(0 0 0 / 6%);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// .emoticon {
|
|
60
|
+
// padding: 35px 0px !important;
|
|
61
|
+
// }
|
|
50
62
|
|
|
51
63
|
|
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)
|
|
@@ -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 {
|
|
@@ -51,7 +51,7 @@ export class HeaderConversationDetailComponent implements OnInit, OnChanges {
|
|
|
51
51
|
conversation_with_fullname: string
|
|
52
52
|
platformName: string
|
|
53
53
|
conv_closed: boolean = false;
|
|
54
|
-
|
|
54
|
+
IS_ON_IOS_MOBILE_DEVICE: boolean
|
|
55
55
|
private logger: LoggerService = LoggerInstance.getInstance()
|
|
56
56
|
|
|
57
57
|
/**
|
|
@@ -88,30 +88,35 @@ export class HeaderConversationDetailComponent implements OnInit, OnChanges {
|
|
|
88
88
|
// @ Lifehooks
|
|
89
89
|
// ----------------------------------------------------
|
|
90
90
|
ngOnInit() {
|
|
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,
|
|
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
95
|
this.conversation_with_fullname = this.conversationAvatar.conversation_with_fullname
|
|
96
96
|
this.listenToConversationHasBeenClosed()
|
|
97
|
-
this.initialize()
|
|
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;
|
|
98
109
|
}
|
|
99
110
|
|
|
100
111
|
ngOnChanges() {
|
|
101
|
-
this.logger.log(
|
|
102
|
-
'[CONVS-DETAIL][HEADER] - (ngOnChanges) - conversationAvatar',
|
|
103
|
-
this.conversationAvatar,
|
|
104
|
-
)
|
|
112
|
+
this.logger.log('[CONVS-DETAIL][HEADER] - (ngOnChanges) - conversationAvatar', this.conversationAvatar)
|
|
105
113
|
if (this.conversationAvatar) {
|
|
106
114
|
this.conversationAvatar.imageurl = this.imageRepoService.getImagePhotoUrl(
|
|
107
115
|
this.conversationAvatar.uid,
|
|
108
116
|
)
|
|
109
117
|
} else {
|
|
110
118
|
const channelType = setChannelType(this.idConv)
|
|
111
|
-
this.logger.log(
|
|
112
|
-
'[CONVS-DETAIL][HEADER] - (ngOnChanges) - conversationAvatar usecase UNDEFINED channelType ',
|
|
113
|
-
channelType,
|
|
114
|
-
)
|
|
119
|
+
this.logger.log('[CONVS-DETAIL][HEADER] - (ngOnChanges) - conversationAvatar usecase UNDEFINED channelType ', channelType)
|
|
115
120
|
this.conversationAvatar = setConversationAvatar(
|
|
116
121
|
this.idConv,
|
|
117
122
|
this.fullNameConv,
|
|
@@ -122,10 +127,7 @@ export class HeaderConversationDetailComponent implements OnInit, OnChanges {
|
|
|
122
127
|
this.conversationAvatar.uid,
|
|
123
128
|
)
|
|
124
129
|
}
|
|
125
|
-
this.logger.log(
|
|
126
|
-
'[CONVS-DETAIL][HEADER] - (ngOnChanges) - conversationAvatar usecase UNDEFINED conversationAvatar',
|
|
127
|
-
this.conversationAvatar,
|
|
128
|
-
)
|
|
130
|
+
this.logger.log('[CONVS-DETAIL][HEADER] - (ngOnChanges) - conversationAvatar usecase UNDEFINED conversationAvatar', this.conversationAvatar)
|
|
129
131
|
}
|
|
130
132
|
|
|
131
133
|
this.logger.log(
|
|
@@ -162,20 +164,21 @@ export class HeaderConversationDetailComponent implements OnInit, OnChanges {
|
|
|
162
164
|
}
|
|
163
165
|
|
|
164
166
|
closeConversation() {
|
|
165
|
-
this.
|
|
167
|
+
this.logger.log('[CONVS-DETAIL][HEADER] click on RESOLVE this.events', this.events)
|
|
168
|
+
this.events.publish('conversation:closed', this.idConv)
|
|
166
169
|
}
|
|
167
170
|
|
|
168
171
|
listenToConversationHasBeenClosed() {
|
|
169
172
|
this.events.subscribe('conversationhasbeenclosed', (convId) => {
|
|
170
173
|
// console.log('[CONVS-DETAIL][HEADER] conversationhasbeenclosed convId', convId)
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
174
|
+
if (convId === this.idConv) {
|
|
175
|
+
this.logger.log('[CONVS-DETAIL][HEADER] the conversation was closed',)
|
|
176
|
+
this.conv_closed = true;
|
|
177
|
+
}
|
|
175
178
|
});
|
|
176
179
|
}
|
|
177
180
|
|
|
178
|
-
|
|
181
|
+
|
|
179
182
|
|
|
180
183
|
onOpenCloseInfoConversation() {
|
|
181
184
|
this.openInfoMessage = false
|
|
@@ -188,7 +191,7 @@ export class HeaderConversationDetailComponent implements OnInit, OnChanges {
|
|
|
188
191
|
}
|
|
189
192
|
|
|
190
193
|
/** */
|
|
191
|
-
pushPage(event) {}
|
|
194
|
+
pushPage(event) { }
|
|
192
195
|
|
|
193
196
|
goBackToConversationList() {
|
|
194
197
|
this.router.navigateByUrl('/conversations-list')
|