@chat21/chat21-ionic 3.0.60 → 3.0.61-rc14
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 +93 -0
- package/README.md +2 -0
- package/angular.json +4 -0
- package/config.xml +5 -5
- package/deploy_pre.sh +10 -10
- package/deploy_prod.sh +5 -1
- package/env.sample +3 -1
- package/package.json +13 -7
- 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 +14 -4
- package/src/app/app.component.scss +18 -1
- package/src/app/app.component.ts +50 -16
- package/src/app/app.module.ts +12 -3
- package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.html +23 -5
- package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.scss +142 -49
- 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 +20 -36
- package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.scss +10 -0
- package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.ts +35 -40
- package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.html +7 -2
- package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.ts +103 -12
- package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.html +39 -36
- 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/ddp-header/ddp-header.component.html +20 -6
- package/src/app/components/ddp-header/ddp-header.component.scss +4 -0
- package/src/app/components/ddp-header/ddp-header.component.ts +104 -10
- package/src/app/components/project-item/project-item.component.html +8 -7
- package/src/app/components/project-item/project-item.component.scss +7 -2
- package/src/app/components/project-item/project-item.component.ts +15 -2
- package/src/app/components/sidebar/sidebar.component.html +275 -0
- package/src/app/components/sidebar/sidebar.component.scss +79 -0
- package/src/app/components/sidebar/sidebar.component.spec.ts +24 -0
- package/src/app/components/sidebar/sidebar.component.ts +539 -0
- package/src/app/components/sidebar-user-details/sidebar-user-details.component.html +117 -0
- package/src/app/components/sidebar-user-details/sidebar-user-details.component.scss +330 -0
- package/src/app/components/sidebar-user-details/sidebar-user-details.component.spec.ts +24 -0
- package/src/app/components/sidebar-user-details/sidebar-user-details.component.ts +490 -0
- 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 +1132 -784
- package/src/app/pages/conversations-list/conversations-list.module.ts +2 -1
- package/src/app/pages/conversations-list/conversations-list.page.html +18 -9
- package/src/app/pages/conversations-list/conversations-list.page.scss +9 -1
- package/src/app/pages/conversations-list/conversations-list.page.ts +738 -425
- package/src/app/pages/create-canned-response/create-canned-response-routing.module.ts +17 -0
- package/src/app/pages/create-canned-response/create-canned-response.module.ts +30 -0
- package/src/app/pages/create-canned-response/create-canned-response.page.html +150 -0
- package/src/app/pages/create-canned-response/create-canned-response.page.scss +55 -0
- package/src/app/pages/create-canned-response/create-canned-response.page.spec.ts +24 -0
- package/src/app/pages/create-canned-response/create-canned-response.page.ts +319 -0
- package/src/app/pages/create-requester/create-requester-routing.module.ts +17 -0
- package/src/app/pages/create-requester/create-requester.module.ts +28 -0
- package/src/app/pages/create-requester/create-requester.page.html +67 -0
- package/src/app/pages/create-requester/create-requester.page.scss +30 -0
- package/src/app/pages/create-requester/create-requester.page.spec.ts +24 -0
- package/src/app/pages/create-requester/create-requester.page.ts +138 -0
- package/src/app/pages/create-ticket/create-ticket-routing.module.ts +17 -0
- package/src/app/pages/create-ticket/create-ticket.module.ts +28 -0
- package/src/app/pages/create-ticket/create-ticket.page.html +171 -0
- package/src/app/pages/create-ticket/create-ticket.page.scss +52 -0
- package/src/app/pages/create-ticket/create-ticket.page.spec.ts +24 -0
- package/src/app/pages/create-ticket/create-ticket.page.ts +432 -0
- package/src/app/pages/loader-preview/loader-preview.page.ts +226 -166
- package/src/app/pages/profile-info/profile-info.page.html +4 -4
- package/src/app/pages/profile-info/profile-info.page.scss +13 -2
- package/src/app/pages/profile-info/profile-info.page.ts +23 -21
- package/src/app/services/tiledesk/tiledesk.service.ts +209 -0
- package/src/app/shared/shared.module.ts +14 -1
- package/src/app/utils/scrollbar-theme.directive.ts +58 -24
- package/src/assets/i18n/de.json +69 -13
- package/src/assets/i18n/en.json +62 -6
- package/src/assets/i18n/es.json +61 -5
- package/src/assets/i18n/fr.json +64 -8
- package/src/assets/i18n/it.json +61 -5
- package/src/assets/i18n/pt.json +61 -5
- package/src/assets/i18n/ru.json +62 -6
- package/src/assets/i18n/sr.json +265 -0
- package/src/assets/i18n/tr.json +61 -5
- package/src/assets/images/default-avatar-x-select.png +0 -0
- package/src/assets/images/language_flag/ar.png +0 -0
- package/src/assets/images/language_flag/bg.png +0 -0
- package/src/assets/images/language_flag/ca.png +0 -0
- package/src/assets/images/language_flag/cs.png +0 -0
- package/src/assets/images/language_flag/da.png +0 -0
- package/src/assets/images/language_flag/de.png +0 -0
- package/src/assets/images/language_flag/el.png +0 -0
- package/src/assets/images/language_flag/en.png +0 -0
- package/src/assets/images/language_flag/es.png +0 -0
- package/src/assets/images/language_flag/fa.png +0 -0
- package/src/assets/images/language_flag/fi.png +0 -0
- package/src/assets/images/language_flag/fr.png +0 -0
- package/src/assets/images/language_flag/he.png +0 -0
- package/src/assets/images/language_flag/hi.png +0 -0
- package/src/assets/images/language_flag/hr.png +0 -0
- package/src/assets/images/language_flag/hu.png +0 -0
- package/src/assets/images/language_flag/id.png +0 -0
- package/src/assets/images/language_flag/it.png +0 -0
- package/src/assets/images/language_flag/ja.png +0 -0
- package/src/assets/images/language_flag/ko.png +0 -0
- package/src/assets/images/language_flag/ml-IN.png +0 -0
- package/src/assets/images/language_flag/ne-NP.png +0 -0
- package/src/assets/images/language_flag/nl.png +0 -0
- package/src/assets/images/language_flag/no.png +0 -0
- package/src/assets/images/language_flag/pl.png +0 -0
- package/src/assets/images/language_flag/pt-BR.png +0 -0
- package/src/assets/images/language_flag/pt.png +0 -0
- package/src/assets/images/language_flag/ro.png +0 -0
- package/src/assets/images/language_flag/ru.png +0 -0
- package/src/assets/images/language_flag/sk.png +0 -0
- package/src/assets/images/language_flag/sl.png +0 -0
- package/src/assets/images/language_flag/sr.png +0 -0
- package/src/assets/images/language_flag/sv-SE.png +0 -0
- package/src/assets/images/language_flag/ta.png +0 -0
- package/src/assets/images/language_flag/th.png +0 -0
- package/src/assets/images/language_flag/tr.png +0 -0
- package/src/assets/images/language_flag/uk.png +0 -0
- package/src/assets/images/language_flag/vi.png +0 -0
- package/src/assets/images/language_flag/zh-CN.png +0 -0
- package/src/assets/images/language_flag/zh-TW.png +0 -0
- package/src/assets/images/no_image_user.png +0 -0
- package/src/assets/images/priority_icons/high.svg +3 -0
- package/src/assets/images/priority_icons/high_v2.svg +14 -0
- package/src/assets/images/priority_icons/low.svg +10 -0
- package/src/assets/images/priority_icons/low_v2.svg +14 -0
- package/src/assets/images/priority_icons/medium.svg +16 -0
- package/src/assets/images/priority_icons/medium_v2.svg +11 -0
- package/src/assets/images/priority_icons/urgent.svg +4 -0
- package/src/assets/images/priority_icons/urgent_v2.svg +16 -0
- package/src/assets/tiledesk-solo-logo.png +0 -0
- package/src/chat-config-pre-test.json +3 -1
- package/src/chat-config-template.json +3 -1
- package/src/chat-config.json +4 -2
- package/src/chat21-core/utils/constants.ts +6 -1
- package/src/global.scss +405 -3
- package/src/index.html +7 -0
- package/publish_pre.sh +0 -33
- package/publish_prod.sh +0 -33
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> - ->
|
|
@@ -142,7 +147,7 @@
|
|
|
142
147
|
{{browserLang === 'en' ? (conversation.timestamp | amDateFormat:'MMM DD YYYY') : (conversation.timestamp| amDateFormat:'DD MMM YYYY') }}
|
|
143
148
|
<!-- {{conversation.timestamp | amDateFormat:'DD MMM YYYY'}} -->
|
|
144
149
|
</span>
|
|
145
|
-
<i class="material-icons" item-end style="font-size: 15px;font-weight: 400;color: #666666;"> history </i>
|
|
150
|
+
<!-- <i class="material-icons" item-end style="font-size: 15px;font-weight: 400;color: #666666;"> history </i> -->
|
|
146
151
|
</div>
|
|
147
152
|
|
|
148
153
|
<!-- && !conversation?.archived -->
|
|
@@ -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;
|
|
@@ -35,7 +36,22 @@ export class IonListConversationsComponent extends ListConversationsComponent im
|
|
|
35
36
|
public browserLang: string;
|
|
36
37
|
|
|
37
38
|
public PROJECT_FOR_PANEL: any;
|
|
38
|
-
|
|
39
|
+
public archive_btn_tooltip: string;
|
|
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,
|
|
48
|
+
'tooltip-class': 'chat-tooltip',
|
|
49
|
+
'theme': 'light',
|
|
50
|
+
'shadow': false,
|
|
51
|
+
'hide-delay-mobile': 0,
|
|
52
|
+
'hideDelayAfterClick': 3000,
|
|
53
|
+
'hide-delay': 100
|
|
54
|
+
};
|
|
39
55
|
/**
|
|
40
56
|
*
|
|
41
57
|
* @param iterableDiffers
|
|
@@ -47,12 +63,12 @@ export class IonListConversationsComponent extends ListConversationsComponent im
|
|
|
47
63
|
public kvDiffers: KeyValueDiffers,
|
|
48
64
|
public platform: Platform,
|
|
49
65
|
private translate: TranslateService,
|
|
50
|
-
// private events: EventsService,
|
|
51
|
-
// private tiledeskService: TiledeskService,
|
|
52
66
|
private networkService: NetworkService,
|
|
53
67
|
private appConfigProvider: AppConfigProvider,
|
|
54
68
|
private sanitizer: DomSanitizer,
|
|
55
|
-
public tiledeskAuthService: TiledeskAuthService
|
|
69
|
+
public tiledeskAuthService: TiledeskAuthService,
|
|
70
|
+
public alertController: AlertController
|
|
71
|
+
|
|
56
72
|
) {
|
|
57
73
|
super(iterableDiffers, kvDiffers)
|
|
58
74
|
this.setMomentLocale();
|
|
@@ -78,6 +94,60 @@ export class IonListConversationsComponent extends ListConversationsComponent im
|
|
|
78
94
|
|
|
79
95
|
// console.log('[ION-LIST-CONVS-COMP] - DASHBOARD_BASE_URL ', DASHBOARD_BASE_URL)
|
|
80
96
|
this.PROJECT_FOR_PANEL = this.sanitizer.bypassSecurityTrustResourceUrl(DASHBOARD_BASE_URL + '#/project-for-panel');
|
|
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.
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
translateLbls() {
|
|
122
|
+
this.translate.get('Resolve')
|
|
123
|
+
.subscribe((text: string) => {
|
|
124
|
+
this.resolve_btn_tooltip = text;
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
this.translate.get('Archive')
|
|
128
|
+
.subscribe((text: string) => {
|
|
129
|
+
this.archive_btn_tooltip = text;
|
|
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;
|
|
150
|
+
});
|
|
81
151
|
}
|
|
82
152
|
|
|
83
153
|
setMomentLocale() {
|
|
@@ -103,10 +173,29 @@ export class IonListConversationsComponent extends ListConversationsComponent im
|
|
|
103
173
|
moment.locale(chat_lang)
|
|
104
174
|
}
|
|
105
175
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
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
|
+
|
|
110
199
|
}
|
|
111
200
|
|
|
112
201
|
|
|
@@ -130,7 +219,9 @@ export class IonListConversationsComponent extends ListConversationsComponent im
|
|
|
130
219
|
// });
|
|
131
220
|
// }
|
|
132
221
|
|
|
133
|
-
|
|
222
|
+
alertClosed() {
|
|
223
|
+
this.onCloseAlert.emit(true)
|
|
224
|
+
}
|
|
134
225
|
|
|
135
226
|
closeConversation(conversation: ConversationModel) {
|
|
136
227
|
var conversationId = conversation.uid;
|
|
@@ -1,50 +1,40 @@
|
|
|
1
|
-
|
|
2
1
|
<ion-header no-border class="ion-no-border">
|
|
3
|
-
<ion-toolbar>
|
|
4
|
-
|
|
5
|
-
<ion-buttons slot="start">
|
|
2
|
+
<ion-toolbar style="height:60px">
|
|
3
|
+
<ion-buttons slot="start" style="height:60px">
|
|
6
4
|
<!-- (click)="pushPage('conversations-list')" defaultHref="/conversations-list" -->
|
|
7
5
|
<ion-back-button style="display: block;" text="" *ngIf="isMobile" (click)="goBackToConversationList()">
|
|
8
|
-
</ion-back-button>
|
|
6
|
+
</ion-back-button>
|
|
9
7
|
</ion-buttons>
|
|
10
8
|
|
|
11
9
|
<ion-title [class.info-open]="openInfoConversation || openInfoMessage">
|
|
12
10
|
|
|
13
|
-
<div *ngIf="conversationAvatar" class="avatar-and-typing-wpr">
|
|
11
|
+
<div *ngIf="conversationAvatar" class="avatar-and-typing-wpr" >
|
|
14
12
|
<!-- [ngStyle] = "{ 'left': platformName === 'ios' ? '55px' : '' }" -->
|
|
15
|
-
<div *ngIf="conversationAvatar" class="avatar-container"
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
></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>
|
|
19
16
|
</div>
|
|
20
17
|
<!-- [ngStyle] = "{ 'left': platformName === 'ios' ? '63px' : '' }" -->
|
|
21
|
-
<div *ngIf="isDirect" class="user-presence" [ngClass]
|
|
22
|
-
<app-user-presence
|
|
23
|
-
[
|
|
24
|
-
[translationMap] = translationMap
|
|
25
|
-
[borderColor] = borderColor
|
|
26
|
-
[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>
|
|
27
21
|
</app-user-presence>
|
|
28
22
|
</div>
|
|
29
23
|
|
|
30
24
|
<div *ngIf="conversationAvatar" class="user-typing">
|
|
31
|
-
<app-user-typing
|
|
32
|
-
[
|
|
33
|
-
|
|
34
|
-
[isDirect] = isDirect
|
|
35
|
-
[translationMap] = translationMap
|
|
36
|
-
[color] = fontColor
|
|
37
|
-
[membersConversation] = membersConversation
|
|
38
|
-
></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>
|
|
39
28
|
</div>
|
|
40
29
|
|
|
41
30
|
</div>
|
|
42
31
|
<!-- [ngClass] = "{ 'tile-info-with-ios': platformName === 'ios' ? '82px' : ''82px'' }" -->
|
|
43
|
-
|
|
44
|
-
|
|
32
|
+
<!-- (click)="onOpenCloseInfoConversation()" -->
|
|
33
|
+
<div *ngIf="conversationAvatar" class="tile-info-with"
|
|
34
|
+
[ngClass]="{ 'tile-info-with-ios': platformName === 'ios' }">
|
|
45
35
|
<!-- <span class="tile-username">{{ conversationAvatar.conversation_with_fullname }} </span> -->
|
|
46
36
|
<span class="tile-username">{{ conversation_with_fullname }} </span>
|
|
47
|
-
|
|
37
|
+
|
|
48
38
|
</div>
|
|
49
39
|
|
|
50
40
|
<!-- <div *ngIf="conversationWithFullname" class="tile-info-with" (click)="onOpenCloseInfoConversation()">
|
|
@@ -55,15 +45,28 @@
|
|
|
55
45
|
<!-- openInfoConversation {{openInfoConversation}} -->
|
|
56
46
|
<ion-buttons slot="end">
|
|
57
47
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
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>
|
|
67
70
|
|
|
68
71
|
</ion-buttons>
|
|
69
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
|
}
|