@chat21/chat21-ionic 3.0.61-rc5 → 3.0.61
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +90 -0
- package/README.md +6 -0
- package/angular.json +2 -0
- package/config.xml +4 -5
- package/deploy_pre.sh +10 -10
- package/deploy_prod.sh +4 -0
- package/env.sample +1 -1
- package/package.json +8 -8
- package/resources/{Android → android}/icon/drawable-hdpi-icon.png +0 -0
- package/resources/{Android → android}/icon/drawable-ldpi-icon.png +0 -0
- package/resources/{Android → android}/icon/drawable-mdpi-icon.png +0 -0
- package/resources/{Android → android}/icon/drawable-xhdpi-icon.png +0 -0
- package/resources/{Android → android}/icon/drawable-xxhdpi-icon.png +0 -0
- package/resources/{Android → android}/icon/drawable-xxxhdpi-icon.png +0 -0
- package/resources/{Android → android}/icon.png +0 -0
- package/resources/{Android → android}/splash/drawable-land-hdpi-screen.png +0 -0
- package/resources/{Android → android}/splash/drawable-land-ldpi-screen.png +0 -0
- package/resources/{Android → android}/splash/drawable-land-mdpi-screen.png +0 -0
- package/resources/{Android → android}/splash/drawable-land-xhdpi-screen.png +0 -0
- package/resources/{Android → android}/splash/drawable-land-xxhdpi-screen.png +0 -0
- package/resources/{Android → android}/splash/drawable-land-xxxhdpi-screen.png +0 -0
- package/resources/{Android → android}/splash/drawable-port-hdpi-screen.png +0 -0
- package/resources/{Android → android}/splash/drawable-port-ldpi-screen.png +0 -0
- package/resources/{Android → android}/splash/drawable-port-mdpi-screen.png +0 -0
- package/resources/{Android → android}/splash/drawable-port-xhdpi-screen.png +0 -0
- package/resources/{Android → android}/splash/drawable-port-xxhdpi-screen.png +0 -0
- package/resources/{Android → android}/splash/drawable-port-xxxhdpi-screen.png +0 -0
- package/resources/{Android → android}/splash.png +0 -0
- package/src/app/app-routing.module.ts +15 -0
- package/src/app/app.component.html +2 -2
- package/src/app/app.component.scss +2 -1
- package/src/app/app.component.ts +34 -20
- package/src/app/app.module.ts +11 -3
- package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.html +36 -25
- package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.scss +160 -50
- package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.ts +108 -18
- package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.html +21 -36
- package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.scss +19 -7
- package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.ts +35 -40
- package/src/app/chatlib/conversation-detail/message/message-attachment/message-attachment.component.scss +1 -1
- package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.ts +78 -15
- package/src/app/chatlib/list-conversations-component/list-conversations/list-conversations.component.ts +13 -10
- package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.html +11 -4
- package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.scss +3 -1
- package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.ts +142 -71
- package/src/app/components/conversation-detail/message-text-area/message-text-area.component.html +59 -22
- package/src/app/components/conversation-detail/message-text-area/message-text-area.component.scss +32 -9
- package/src/app/components/conversation-detail/message-text-area/message-text-area.component.ts +107 -23
- package/src/app/components/ddp-header/ddp-header.component.html +9 -2
- package/src/app/components/ddp-header/ddp-header.component.ts +93 -18
- package/src/app/components/project-item/project-item.component.html +1 -1
- package/src/app/components/project-item/project-item.component.scss +1 -1
- package/src/app/components/project-item/project-item.component.ts +3 -3
- package/src/app/components/sidebar/sidebar.component.html +151 -86
- package/src/app/components/sidebar/sidebar.component.scss +60 -3
- package/src/app/components/sidebar/sidebar.component.ts +173 -47
- package/src/app/components/sidebar-user-details/sidebar-user-details.component.html +26 -7
- package/src/app/components/sidebar-user-details/sidebar-user-details.component.scss +44 -19
- package/src/app/components/sidebar-user-details/sidebar-user-details.component.ts +109 -35
- package/src/app/pages/conversation-detail/conversation-detail.module.ts +5 -1
- package/src/app/pages/conversation-detail/conversation-detail.page.html +19 -9
- package/src/app/pages/conversation-detail/conversation-detail.page.scss +28 -0
- package/src/app/pages/conversation-detail/conversation-detail.page.ts +1124 -778
- package/src/app/pages/conversations-list/conversations-list.page.html +3 -1
- package/src/app/pages/conversations-list/conversations-list.page.ts +647 -445
- package/src/app/pages/create-canned-response/create-canned-response-routing.module.ts +17 -0
- package/src/app/pages/create-canned-response/create-canned-response.module.ts +30 -0
- package/src/app/pages/create-canned-response/create-canned-response.page.html +150 -0
- package/src/app/pages/create-canned-response/create-canned-response.page.scss +55 -0
- package/src/app/pages/create-canned-response/create-canned-response.page.spec.ts +24 -0
- package/src/app/pages/create-canned-response/create-canned-response.page.ts +319 -0
- package/src/app/pages/create-requester/create-requester-routing.module.ts +17 -0
- package/src/app/pages/create-requester/create-requester.module.ts +28 -0
- package/src/app/pages/create-requester/create-requester.page.html +67 -0
- package/src/app/pages/create-requester/create-requester.page.scss +30 -0
- package/src/app/pages/create-requester/create-requester.page.spec.ts +24 -0
- package/src/app/pages/create-requester/create-requester.page.ts +138 -0
- package/src/app/pages/create-ticket/create-ticket-routing.module.ts +17 -0
- package/src/app/pages/create-ticket/create-ticket.module.ts +28 -0
- package/src/app/pages/create-ticket/create-ticket.page.html +171 -0
- package/src/app/pages/create-ticket/create-ticket.page.scss +52 -0
- package/src/app/pages/create-ticket/create-ticket.page.spec.ts +24 -0
- package/src/app/pages/create-ticket/create-ticket.page.ts +432 -0
- package/src/app/pages/loader-preview/loader-preview.page.ts +226 -166
- package/src/app/pages/profile-info/profile-info.page.html +2 -2
- package/src/app/pages/profile-info/profile-info.page.scss +13 -2
- package/src/app/services/tiledesk/tiledesk.service.ts +209 -0
- package/src/app/shared/shared.module.ts +1 -1
- package/src/assets/i18n/de.json +45 -7
- package/src/assets/i18n/en.json +41 -3
- package/src/assets/i18n/es.json +41 -3
- package/src/assets/i18n/fr.json +44 -6
- package/src/assets/i18n/it.json +41 -3
- package/src/assets/i18n/pt.json +41 -3
- package/src/assets/i18n/ru.json +42 -4
- package/src/assets/i18n/sr.json +265 -0
- package/src/assets/i18n/tr.json +41 -4
- package/src/assets/images/default-avatar-x-select.png +0 -0
- package/src/assets/images/priority_icons/high.svg +3 -0
- package/src/assets/images/priority_icons/high_v2.svg +14 -0
- package/src/assets/images/priority_icons/low.svg +10 -0
- package/src/assets/images/priority_icons/low_v2.svg +14 -0
- package/src/assets/images/priority_icons/medium.svg +16 -0
- package/src/assets/images/priority_icons/medium_v2.svg +11 -0
- package/src/assets/images/priority_icons/urgent.svg +4 -0
- package/src/assets/images/priority_icons/urgent_v2.svg +16 -0
- package/src/chat-config-mqtt.json +25 -16
- package/src/chat-config-template.json +5 -4
- package/src/chat-config.json +1 -0
- package/src/chat21-core/providers/firebase/firebase-conversation-handler.ts +8 -3
- package/src/chat21-core/utils/constants.ts +6 -1
- package/src/chat21-core/utils/utils-message.ts +19 -0
- package/src/global.scss +65 -76
- package/publish_pre.sh +0 -33
- package/publish_prod.sh +0 -33
package/src/app/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)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component, EventEmitter, Input, IterableDiffers, KeyValueDiffers, OnInit, Output } from '@angular/core';
|
|
1
|
+
import { Component, EventEmitter, Input, IterableDiffers, KeyValueDiffers, OnInit, Output, SimpleChange } from '@angular/core';
|
|
2
2
|
import { ConversationModel } from 'src/chat21-core/models/conversation';
|
|
3
3
|
import { ImageRepoService } from 'src/chat21-core/providers/abstract/image-repo.service';
|
|
4
4
|
import { convertMessage } from 'src/chat21-core/utils/utils';
|
|
@@ -13,7 +13,7 @@ import { NetworkService } from '../../../services/network-service/network.servic
|
|
|
13
13
|
import { AppConfigProvider } from 'src/app/services/app-config';
|
|
14
14
|
import { DomSanitizer } from '@angular/platform-browser'
|
|
15
15
|
import { TiledeskAuthService } from 'src/chat21-core/providers/tiledesk/tiledesk-auth.service';
|
|
16
|
-
|
|
16
|
+
import { AlertController } from '@ionic/angular';
|
|
17
17
|
// import { LoggerService } from 'src/chat21-core/providers/abstract/logger.service';
|
|
18
18
|
// import { LoggerInstance } from 'src/chat21-core/providers/logger/loggerInstance';
|
|
19
19
|
|
|
@@ -24,8 +24,10 @@ import { TiledeskAuthService } from 'src/chat21-core/providers/tiledesk/tiledesk
|
|
|
24
24
|
})
|
|
25
25
|
export class IonListConversationsComponent extends ListConversationsComponent implements OnInit {
|
|
26
26
|
|
|
27
|
+
@Input() archiveActionNotAllowed: boolean;
|
|
27
28
|
@Input() uidConvSelected: string;
|
|
28
29
|
@Output() onCloseConversation = new EventEmitter<ConversationModel>();
|
|
30
|
+
@Output() onCloseAlert = new EventEmitter();
|
|
29
31
|
|
|
30
32
|
convertMessage = convertMessage;
|
|
31
33
|
isApp: boolean = false;
|
|
@@ -36,6 +38,10 @@ export class IonListConversationsComponent extends ListConversationsComponent im
|
|
|
36
38
|
public PROJECT_FOR_PANEL: any;
|
|
37
39
|
public archive_btn_tooltip: string;
|
|
38
40
|
public resolve_btn_tooltip: string;
|
|
41
|
+
public alert_lbl: string;
|
|
42
|
+
public actionNotAllowed_lbl: string;
|
|
43
|
+
public youAreNoLongerAmongTheTeammatesManagingThisConversation_lbl: string;
|
|
44
|
+
public ok_lbl: string;
|
|
39
45
|
|
|
40
46
|
tooltip_options = {
|
|
41
47
|
'show-delay': 0,
|
|
@@ -61,7 +67,8 @@ export class IonListConversationsComponent extends ListConversationsComponent im
|
|
|
61
67
|
private appConfigProvider: AppConfigProvider,
|
|
62
68
|
private sanitizer: DomSanitizer,
|
|
63
69
|
public tiledeskAuthService: TiledeskAuthService,
|
|
64
|
-
|
|
70
|
+
public alertController: AlertController
|
|
71
|
+
|
|
65
72
|
) {
|
|
66
73
|
super(iterableDiffers, kvDiffers)
|
|
67
74
|
this.setMomentLocale();
|
|
@@ -88,23 +95,58 @@ export class IonListConversationsComponent extends ListConversationsComponent im
|
|
|
88
95
|
// console.log('[ION-LIST-CONVS-COMP] - DASHBOARD_BASE_URL ', DASHBOARD_BASE_URL)
|
|
89
96
|
this.PROJECT_FOR_PANEL = this.sanitizer.bypassSecurityTrustResourceUrl(DASHBOARD_BASE_URL + '#/project-for-panel');
|
|
90
97
|
this.translateLbls();
|
|
91
|
-
|
|
98
|
+
|
|
99
|
+
}
|
|
100
|
+
ngOnInit() {
|
|
101
|
+
this.isApp = this.platform.is('ios') || this.platform.is('android')
|
|
102
|
+
this.logger.log('[ION-LIST-CONVS-COMP] - ngOnInit - IS-APP ', this.isApp)
|
|
103
|
+
this.logger.log('[ION-LIST-CONVS-COMP] - ngOnInit - Platform', this.platform.platforms());
|
|
104
|
+
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
ngOnChanges(changes: { [property: string]: SimpleChange }) {
|
|
108
|
+
// Extract changes to the input property by its name
|
|
109
|
+
let change: SimpleChange = changes['archiveActionNotAllowed'];
|
|
110
|
+
this.logger.log('[ION-LIST-CONVS-COMP] - ngOnChanges change ', change);
|
|
111
|
+
// console.log('[ION-LIST-CONVS-COMP] - ngOnChanges change currentValue ', change.currentValue)
|
|
112
|
+
if (change && change.currentValue === true) {
|
|
113
|
+
this.pesentAlertActionNotAllowed()
|
|
114
|
+
}
|
|
115
|
+
// Whenever the data in the parent changes, this method gets triggered. You
|
|
116
|
+
// can act on the changes here. You will have both the previous value and the
|
|
117
|
+
// current value here.
|
|
92
118
|
}
|
|
93
119
|
|
|
94
120
|
|
|
95
121
|
translateLbls() {
|
|
96
122
|
this.translate.get('Resolve')
|
|
97
123
|
.subscribe((text: string) => {
|
|
98
|
-
// this.deleteContact_msg = text;
|
|
99
124
|
this.resolve_btn_tooltip = text;
|
|
100
|
-
// console.log('[ION-LIST-CONVS-COMP] getTranslations Resolve : ', text)
|
|
101
|
-
|
|
102
125
|
});
|
|
103
|
-
|
|
126
|
+
|
|
127
|
+
this.translate.get('Archive')
|
|
104
128
|
.subscribe((text: string) => {
|
|
105
|
-
// this.deleteContact_msg = text;
|
|
106
129
|
this.archive_btn_tooltip = text;
|
|
107
|
-
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
this.translate.get('ALERT_TITLE')
|
|
133
|
+
.subscribe((text: string) => {
|
|
134
|
+
this.alert_lbl = text;
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
this.translate.get('ActionNotAllowed')
|
|
138
|
+
.subscribe((text: string) => {
|
|
139
|
+
this.actionNotAllowed_lbl = text;
|
|
140
|
+
});
|
|
141
|
+
|
|
142
|
+
this.translate.get('YouAreNoLongerAmongTheTeammatesManagingThisConversation')
|
|
143
|
+
.subscribe((text: string) => {
|
|
144
|
+
this.youAreNoLongerAmongTheTeammatesManagingThisConversation_lbl = text;
|
|
145
|
+
});
|
|
146
|
+
|
|
147
|
+
this.translate.get('CLOSE_ALERT_CONFIRM_LABEL')
|
|
148
|
+
.subscribe((text: string) => {
|
|
149
|
+
this.ok_lbl = text;
|
|
108
150
|
});
|
|
109
151
|
}
|
|
110
152
|
|
|
@@ -131,10 +173,29 @@ export class IonListConversationsComponent extends ListConversationsComponent im
|
|
|
131
173
|
moment.locale(chat_lang)
|
|
132
174
|
}
|
|
133
175
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
async pesentAlertActionNotAllowed() {
|
|
179
|
+
|
|
180
|
+
const alert = await this.alertController.create({
|
|
181
|
+
cssClass: 'my-custom-class',
|
|
182
|
+
header: this.alert_lbl,
|
|
183
|
+
subHeader: this.actionNotAllowed_lbl,
|
|
184
|
+
message: this.youAreNoLongerAmongTheTeammatesManagingThisConversation_lbl,
|
|
185
|
+
buttons: [
|
|
186
|
+
{
|
|
187
|
+
text: this.ok_lbl,
|
|
188
|
+
handler: () => {
|
|
189
|
+
this.alertClosed();
|
|
190
|
+
// console.log('Confirm Okay');
|
|
191
|
+
},
|
|
192
|
+
},
|
|
193
|
+
],
|
|
194
|
+
});
|
|
195
|
+
|
|
196
|
+
await alert.present();
|
|
197
|
+
|
|
198
|
+
|
|
138
199
|
}
|
|
139
200
|
|
|
140
201
|
|
|
@@ -158,7 +219,9 @@ export class IonListConversationsComponent extends ListConversationsComponent im
|
|
|
158
219
|
// });
|
|
159
220
|
// }
|
|
160
221
|
|
|
161
|
-
|
|
222
|
+
alertClosed() {
|
|
223
|
+
this.onCloseAlert.emit(true)
|
|
224
|
+
}
|
|
162
225
|
|
|
163
226
|
closeConversation(conversation: ConversationModel) {
|
|
164
227
|
var conversationId = conversation.uid;
|
|
@@ -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
|
|
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
|
|
9
9
|
<ion-title [class.info-open]="openInfoConversation || openInfoMessage">
|
|
10
10
|
|
|
11
|
-
<div *ngIf="conversationAvatar" class="avatar-and-typing-wpr">
|
|
11
|
+
<div *ngIf="conversationAvatar" class="avatar-and-typing-wpr" >
|
|
12
12
|
<!-- [ngStyle] = "{ 'left': platformName === 'ios' ? '55px' : '' }" -->
|
|
13
|
-
<div *ngIf="conversationAvatar" class="avatar-container"
|
|
13
|
+
<div *ngIf="conversationAvatar" class="avatar-container" (click)="onOpenCloseInfoConversation()" style="cursor: pointer"
|
|
14
14
|
[ngClass]="{ 'avatar-container-ios': platformName === 'ios' }">
|
|
15
15
|
<app-avatar-profile [itemAvatar]=conversationAvatar></app-avatar-profile>
|
|
16
16
|
</div>
|
|
@@ -29,7 +29,8 @@
|
|
|
29
29
|
|
|
30
30
|
</div>
|
|
31
31
|
<!-- [ngClass] = "{ 'tile-info-with-ios': platformName === 'ios' ? '82px' : ''82px'' }" -->
|
|
32
|
-
|
|
32
|
+
<!-- (click)="onOpenCloseInfoConversation()" -->
|
|
33
|
+
<div *ngIf="conversationAvatar" class="tile-info-with"
|
|
33
34
|
[ngClass]="{ 'tile-info-with-ios': platformName === 'ios' }">
|
|
34
35
|
<!-- <span class="tile-username">{{ conversationAvatar.conversation_with_fullname }} </span> -->
|
|
35
36
|
<span class="tile-username">{{ conversation_with_fullname }} </span>
|
|
@@ -44,7 +45,13 @@
|
|
|
44
45
|
<!-- openInfoConversation {{openInfoConversation}} -->
|
|
45
46
|
<ion-buttons slot="end">
|
|
46
47
|
|
|
47
|
-
<ion-button
|
|
48
|
+
<!-- <ion-button ion-button fill="clear" color="primary" size="small" (click)="presentCreateTicketModal()" [ngClass]="{'resolve-conv-margin-right': !isMobile}">
|
|
49
|
+
<ion-icon name="ticket-outline"></ion-icon>
|
|
50
|
+
<span style="text-transform: capitalize; margin-left: 5px;"> {{ 'Crea ticket' | translate}} </span>
|
|
51
|
+
</ion-button> -->
|
|
52
|
+
|
|
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">
|
|
48
55
|
<!-- <ion-icon slot="icon-only" name="alert-circle-outline"></ion-icon> -->
|
|
49
56
|
<ion-icon name="archive-outline"></ion-icon>
|
|
50
57
|
<!-- <ion-icon slot="icon-only" name="information-outline"></ion-icon> -->
|
|
@@ -58,7 +58,7 @@ ion-header {
|
|
|
58
58
|
top: 0;
|
|
59
59
|
left: 50px;
|
|
60
60
|
vertical-align: middle;
|
|
61
|
-
cursor: pointer;
|
|
61
|
+
// cursor: pointer;
|
|
62
62
|
}
|
|
63
63
|
.tile-point {
|
|
64
64
|
width: 10px;
|
|
@@ -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 {
|