@chat21/chat21-ionic 3.0.61-rc2 → 3.0.61-rc21
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/angular.json +2 -0
- package/config.xml +4 -5
- package/deploy_pre.sh +27 -27
- package/deploy_prod.sh +5 -1
- 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 +4 -3
- package/src/app/app.component.scss +6 -1
- package/src/app/app.component.ts +29 -18
- 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 +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/chatlib/conversation-detail/message/message-attachment/message-attachment.component.scss +1 -1
- package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.html +6 -1
- package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.ts +89 -21
- package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.html +37 -33
- package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.scss +7 -1
- package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.ts +148 -63
- package/src/app/components/conversation-detail/message-text-area/message-text-area.component.html +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 +102 -23
- package/src/app/components/conversation-info/info-content/info-content.component.html +2 -2
- package/src/app/components/ddp-header/ddp-header.component.html +11 -4
- package/src/app/components/ddp-header/ddp-header.component.ts +94 -19
- package/src/app/components/project-item/project-item.component.html +2 -2
- package/src/app/components/project-item/project-item.component.scss +1 -1
- package/src/app/components/project-item/project-item.component.ts +1 -1
- package/src/app/components/sidebar/sidebar.component.html +151 -86
- package/src/app/components/sidebar/sidebar.component.scss +72 -4
- package/src/app/components/sidebar/sidebar.component.ts +211 -72
- package/src/app/components/sidebar-user-details/sidebar-user-details.component.html +29 -10
- package/src/app/components/sidebar-user-details/sidebar-user-details.component.scss +53 -29
- package/src/app/components/sidebar-user-details/sidebar-user-details.component.ts +176 -97
- package/src/app/pages/conversation-detail/conversation-detail.module.ts +6 -1
- package/src/app/pages/conversation-detail/conversation-detail.page.html +20 -10
- package/src/app/pages/conversation-detail/conversation-detail.page.scss +28 -0
- package/src/app/pages/conversation-detail/conversation-detail.page.ts +1124 -777
- package/src/app/pages/conversations-list/conversations-list.module.ts +2 -1
- package/src/app/pages/conversations-list/conversations-list.page.html +9 -6
- package/src/app/pages/conversations-list/conversations-list.page.scss +9 -1
- package/src/app/pages/conversations-list/conversations-list.page.ts +724 -436
- 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/app/utils/scrollbar-theme.directive.ts +58 -24
- package/src/assets/i18n/de.json +46 -7
- package/src/assets/i18n/en.json +42 -3
- package/src/assets/i18n/es.json +42 -3
- package/src/assets/i18n/fr.json +45 -6
- package/src/assets/i18n/it.json +42 -3
- package/src/assets/i18n/pt.json +42 -3
- package/src/assets/i18n/ru.json +43 -4
- package/src/assets/i18n/sr.json +265 -0
- package/src/assets/i18n/tr.json +42 -4
- package/src/assets/images/default-avatar-x-select.png +0 -0
- package/src/assets/images/language_flag/hr.png +0 -0
- package/src/assets/images/language_flag/sr.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-pre-test.json +1 -1
- package/src/chat-config-template.json +1 -1
- package/src/chat-config.json +1 -1
- 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 -111
- 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)
|
|
@@ -118,12 +118,17 @@
|
|
|
118
118
|
<ion-note *ngIf="!conversation.archived" class="conversation_time">{{conversation.timestamp | amTimeAgo}}</ion-note>
|
|
119
119
|
|
|
120
120
|
<ion-buttons slot="end">
|
|
121
|
-
<ion-button *ngIf="!conversation.archived"
|
|
121
|
+
<ion-button *ngIf="!conversation.archived" [tooltip]="archiveTooltip" [options]="tooltip_options" placement="bottom" content-type="template"
|
|
122
122
|
[ngClass]="{'hide': !isApp, 'button-on-desktop': !isApp, 'button-on-mobile': isApp }"
|
|
123
123
|
id="{{ 'close_conversation_button' + conversation.uid }}" class="close-conversation-button" ion-button clear
|
|
124
124
|
item-end (click)="closeConversation(conversation);$event.stopPropagation();" padding>
|
|
125
125
|
<ion-icon slot="icon-only" style="display:block;" id="{{ 'close_button_icon' + conversation.uid }}"
|
|
126
126
|
color="close-conversation" name="archive-outline" item-end></ion-icon>
|
|
127
|
+
|
|
128
|
+
<ng-template #archiveTooltip>
|
|
129
|
+
<span *ngIf="conversation?.recipient.startsWith('support-group')"> {{ resolve_btn_tooltip}} </span>
|
|
130
|
+
<span *ngIf="!conversation?.recipient.startsWith('support-group')"> {{ archive_btn_tooltip }} </span>
|
|
131
|
+
</ng-template>
|
|
127
132
|
</ion-button>
|
|
128
133
|
<!-- <ion-button *ngIf="conversation.archived" class="close-conversation-button" ion-button clear item-end disabled padding>
|
|
129
134
|
<!- - <ion-icon style="display:block;" id="{{ 'close_button_icon' + conversation.uid }}" color="close-conversation" name="archive-outline" item-end></ion-icon> - ->
|
|
@@ -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';
|
|
@@ -9,12 +9,11 @@ import { LoggerInstance } from 'src/chat21-core/providers/logger/loggerInstance'
|
|
|
9
9
|
import { TranslateService } from '@ngx-translate/core';
|
|
10
10
|
|
|
11
11
|
import * as moment from 'moment';
|
|
12
|
-
// import { EventsService } from 'src/app/services/events-service';
|
|
13
|
-
// import { TiledeskService } from '../../../services/tiledesk/tiledesk.service';
|
|
14
12
|
import { NetworkService } from '../../../services/network-service/network.service';
|
|
15
13
|
import { AppConfigProvider } from 'src/app/services/app-config';
|
|
16
14
|
import { DomSanitizer } from '@angular/platform-browser'
|
|
17
15
|
import { TiledeskAuthService } from 'src/chat21-core/providers/tiledesk/tiledesk-auth.service';
|
|
16
|
+
import { AlertController } from '@ionic/angular';
|
|
18
17
|
// import { LoggerService } from 'src/chat21-core/providers/abstract/logger.service';
|
|
19
18
|
// import { LoggerInstance } from 'src/chat21-core/providers/logger/loggerInstance';
|
|
20
19
|
|
|
@@ -25,8 +24,10 @@ import { TiledeskAuthService } from 'src/chat21-core/providers/tiledesk/tiledesk
|
|
|
25
24
|
})
|
|
26
25
|
export class IonListConversationsComponent extends ListConversationsComponent implements OnInit {
|
|
27
26
|
|
|
27
|
+
@Input() archiveActionNotAllowed: boolean;
|
|
28
28
|
@Input() uidConvSelected: string;
|
|
29
29
|
@Output() onCloseConversation = new EventEmitter<ConversationModel>();
|
|
30
|
+
@Output() onCloseAlert = new EventEmitter();
|
|
30
31
|
|
|
31
32
|
convertMessage = convertMessage;
|
|
32
33
|
isApp: boolean = false;
|
|
@@ -36,15 +37,20 @@ export class IonListConversationsComponent extends ListConversationsComponent im
|
|
|
36
37
|
|
|
37
38
|
public PROJECT_FOR_PANEL: any;
|
|
38
39
|
public archive_btn_tooltip: string;
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
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;
|
|
45
|
+
|
|
46
|
+
tooltip_options = {
|
|
47
|
+
'show-delay': 0,
|
|
42
48
|
'tooltip-class': 'chat-tooltip',
|
|
43
49
|
'theme': 'light',
|
|
44
50
|
'shadow': false,
|
|
45
51
|
'hide-delay-mobile': 0,
|
|
46
52
|
'hideDelayAfterClick': 3000,
|
|
47
|
-
'hide-delay':
|
|
53
|
+
'hide-delay': 100
|
|
48
54
|
};
|
|
49
55
|
/**
|
|
50
56
|
*
|
|
@@ -57,12 +63,12 @@ export class IonListConversationsComponent extends ListConversationsComponent im
|
|
|
57
63
|
public kvDiffers: KeyValueDiffers,
|
|
58
64
|
public platform: Platform,
|
|
59
65
|
private translate: TranslateService,
|
|
60
|
-
// private events: EventsService,
|
|
61
|
-
// private tiledeskService: TiledeskService,
|
|
62
66
|
private networkService: NetworkService,
|
|
63
67
|
private appConfigProvider: AppConfigProvider,
|
|
64
68
|
private sanitizer: DomSanitizer,
|
|
65
|
-
public tiledeskAuthService: TiledeskAuthService
|
|
69
|
+
public tiledeskAuthService: TiledeskAuthService,
|
|
70
|
+
public alertController: AlertController
|
|
71
|
+
|
|
66
72
|
) {
|
|
67
73
|
super(iterableDiffers, kvDiffers)
|
|
68
74
|
this.setMomentLocale();
|
|
@@ -88,18 +94,59 @@ export class IonListConversationsComponent extends ListConversationsComponent im
|
|
|
88
94
|
|
|
89
95
|
// console.log('[ION-LIST-CONVS-COMP] - DASHBOARD_BASE_URL ', DASHBOARD_BASE_URL)
|
|
90
96
|
this.PROJECT_FOR_PANEL = this.sanitizer.bypassSecurityTrustResourceUrl(DASHBOARD_BASE_URL + '#/project-for-panel');
|
|
91
|
-
this.
|
|
97
|
+
this.translateLbls();
|
|
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
|
+
|
|
121
|
+
translateLbls() {
|
|
95
122
|
this.translate.get('Resolve')
|
|
96
123
|
.subscribe((text: string) => {
|
|
97
|
-
|
|
98
|
-
|
|
124
|
+
this.resolve_btn_tooltip = text;
|
|
125
|
+
});
|
|
99
126
|
|
|
127
|
+
this.translate.get('Archive')
|
|
128
|
+
.subscribe((text: string) => {
|
|
100
129
|
this.archive_btn_tooltip = text;
|
|
101
|
-
|
|
102
|
-
|
|
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;
|
|
103
150
|
});
|
|
104
151
|
}
|
|
105
152
|
|
|
@@ -126,10 +173,29 @@ export class IonListConversationsComponent extends ListConversationsComponent im
|
|
|
126
173
|
moment.locale(chat_lang)
|
|
127
174
|
}
|
|
128
175
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
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
|
+
|
|
133
199
|
}
|
|
134
200
|
|
|
135
201
|
|
|
@@ -153,7 +219,9 @@ export class IonListConversationsComponent extends ListConversationsComponent im
|
|
|
153
219
|
// });
|
|
154
220
|
// }
|
|
155
221
|
|
|
156
|
-
|
|
222
|
+
alertClosed() {
|
|
223
|
+
this.onCloseAlert.emit(true)
|
|
224
|
+
}
|
|
157
225
|
|
|
158
226
|
closeConversation(conversation: ConversationModel) {
|
|
159
227
|
var conversationId = conversation.uid;
|
|
@@ -1,49 +1,40 @@
|
|
|
1
|
-
|
|
2
1
|
<ion-header no-border class="ion-no-border">
|
|
3
2
|
<ion-toolbar style="height:60px">
|
|
4
3
|
<ion-buttons slot="start" style="height:60px">
|
|
5
4
|
<!-- (click)="pushPage('conversations-list')" defaultHref="/conversations-list" -->
|
|
6
5
|
<ion-back-button style="display: block;" text="" *ngIf="isMobile" (click)="goBackToConversationList()">
|
|
7
|
-
</ion-back-button>
|
|
6
|
+
</ion-back-button>
|
|
8
7
|
</ion-buttons>
|
|
9
8
|
|
|
10
9
|
<ion-title [class.info-open]="openInfoConversation || openInfoMessage">
|
|
11
10
|
|
|
12
|
-
<div *ngIf="conversationAvatar" class="avatar-and-typing-wpr">
|
|
11
|
+
<div *ngIf="conversationAvatar" class="avatar-and-typing-wpr" >
|
|
13
12
|
<!-- [ngStyle] = "{ 'left': platformName === 'ios' ? '55px' : '' }" -->
|
|
14
|
-
<div *ngIf="conversationAvatar" class="avatar-container"
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
></app-avatar-profile>
|
|
13
|
+
<div *ngIf="conversationAvatar" class="avatar-container" (click)="onOpenCloseInfoConversation()" style="cursor: pointer"
|
|
14
|
+
[ngClass]="{ 'avatar-container-ios': platformName === 'ios' }">
|
|
15
|
+
<app-avatar-profile [itemAvatar]=conversationAvatar></app-avatar-profile>
|
|
18
16
|
</div>
|
|
19
17
|
<!-- [ngStyle] = "{ 'left': platformName === 'ios' ? '63px' : '' }" -->
|
|
20
|
-
<div *ngIf="isDirect" class="user-presence" [ngClass]
|
|
21
|
-
<app-user-presence
|
|
22
|
-
[
|
|
23
|
-
[translationMap] = translationMap
|
|
24
|
-
[borderColor] = borderColor
|
|
25
|
-
[fontColor] = fontColor>
|
|
18
|
+
<div *ngIf="isDirect" class="user-presence" [ngClass]="{ 'user-presence-ios': platformName === 'ios' }">
|
|
19
|
+
<app-user-presence [idUser]=conversationAvatar.conversation_with [translationMap]=translationMap
|
|
20
|
+
[borderColor]=borderColor [fontColor]=fontColor>
|
|
26
21
|
</app-user-presence>
|
|
27
22
|
</div>
|
|
28
23
|
|
|
29
24
|
<div *ngIf="conversationAvatar" class="user-typing">
|
|
30
|
-
<app-user-typing
|
|
31
|
-
[
|
|
32
|
-
|
|
33
|
-
[isDirect] = isDirect
|
|
34
|
-
[translationMap] = translationMap
|
|
35
|
-
[color] = fontColor
|
|
36
|
-
[membersConversation] = membersConversation
|
|
37
|
-
></app-user-typing>
|
|
25
|
+
<app-user-typing [idConversation]=conversationAvatar.uid [idCurrentUser]=idLoggedUser [isDirect]=isDirect
|
|
26
|
+
[translationMap]=translationMap [color]=fontColor [membersConversation]=membersConversation>
|
|
27
|
+
</app-user-typing>
|
|
38
28
|
</div>
|
|
39
29
|
|
|
40
30
|
</div>
|
|
41
31
|
<!-- [ngClass] = "{ 'tile-info-with-ios': platformName === 'ios' ? '82px' : ''82px'' }" -->
|
|
42
|
-
|
|
43
|
-
|
|
32
|
+
<!-- (click)="onOpenCloseInfoConversation()" -->
|
|
33
|
+
<div *ngIf="conversationAvatar" class="tile-info-with"
|
|
34
|
+
[ngClass]="{ 'tile-info-with-ios': platformName === 'ios' }">
|
|
44
35
|
<!-- <span class="tile-username">{{ conversationAvatar.conversation_with_fullname }} </span> -->
|
|
45
36
|
<span class="tile-username">{{ conversation_with_fullname }} </span>
|
|
46
|
-
|
|
37
|
+
|
|
47
38
|
</div>
|
|
48
39
|
|
|
49
40
|
<!-- <div *ngIf="conversationWithFullname" class="tile-info-with" (click)="onOpenCloseInfoConversation()">
|
|
@@ -54,15 +45,28 @@
|
|
|
54
45
|
<!-- openInfoConversation {{openInfoConversation}} -->
|
|
55
46
|
<ion-buttons slot="end">
|
|
56
47
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
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">
|
|
55
|
+
<!-- <ion-icon slot="icon-only" name="alert-circle-outline"></ion-icon> -->
|
|
56
|
+
<ion-icon name="archive-outline"></ion-icon>
|
|
57
|
+
<!-- <ion-icon slot="icon-only" name="information-outline"></ion-icon> -->
|
|
58
|
+
<span style="text-transform: capitalize; margin-left: 5px;"> {{ 'Resolve' | translate}} </span>
|
|
59
|
+
</ion-button>
|
|
60
|
+
|
|
61
|
+
<ion-button *ngIf="!openInfoConversation" ion-button fill="clear" (click)="onOpenCloseInfoConversation()">
|
|
62
|
+
<!-- <ion-icon slot="icon-only" name="alert-circle-outline"></ion-icon> -->
|
|
63
|
+
<ion-icon slot="icon-only" name="information-circle-outline"></ion-icon>
|
|
64
|
+
<!-- <ion-icon slot="icon-only" name="information-outline"></ion-icon> -->
|
|
65
|
+
|
|
66
|
+
</ion-button>
|
|
67
|
+
<ion-button *ngIf="openInfoConversation" ion-button fill="clear" (click)="onOpenCloseInfoConversation()">
|
|
68
|
+
<ion-icon slot="icon-only" name="close-circle-outline"></ion-icon>
|
|
69
|
+
</ion-button>
|
|
66
70
|
|
|
67
71
|
</ion-buttons>
|
|
68
72
|
|
|
@@ -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,4 +159,9 @@ ion-header {
|
|
|
158
159
|
|
|
159
160
|
.avatar-container-ios {
|
|
160
161
|
left: 55px;
|
|
162
|
+
top: 10px;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.resolve-conv-margin-right {
|
|
166
|
+
margin-right: 52px;
|
|
161
167
|
}
|