@chat21/chat21-ionic 3.0.102 → 3.0.103
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 +21 -0
- package/angular.json +25 -11
- package/config.xml +5 -5
- package/package.json +74 -39
- package/src/app/app-routing.module.ts +13 -10
- package/src/app/app.component.ts +102 -116
- package/src/app/app.module.ts +29 -18
- package/src/app/chatlib/conversation-detail/conversation-content/conversation-content.component.html +8 -8
- package/src/app/components/authentication/login/login.component.html +31 -2
- package/src/app/components/authentication/login/login.component.scss +63 -0
- package/src/app/components/authentication/login/login.component.ts +12 -5
- package/src/app/components/canned-response/canned-response.component.html +3 -0
- package/src/app/components/canned-response/canned-response.component.ts +7 -0
- package/src/app/components/conversation-detail/message-text-area/message-text-area.component.ts +2 -2
- package/src/app/components/conversation-info/conversation-info.module.ts +23 -1
- package/src/app/modals/send-email/send-email.page.ts +1 -4
- package/src/app/modals/send-whatsapp-template/send-whatsapp-template.module.ts +0 -1
- package/src/app/pages/authentication/login/login.page.html +1 -1
- package/src/app/pages/authentication/login/login.page.ts +1 -1
- package/src/app/pages/conversation-detail/conversation-detail.module.ts +55 -18
- package/src/app/pages/conversation-detail/conversation-detail.page.html +1 -0
- package/src/app/pages/conversation-detail/conversation-detail.page.ts +33 -13
- package/src/app/pages/conversations-list/conversations-list.module.ts +24 -4
- package/src/app/services/tiledesk/tiledesk.service.ts +2 -2
- package/src/app/shared/shared.module.ts +92 -69
- package/src/assets/i18n/en.json +30 -30
- package/src/assets/js/chat21client.js +1 -1
- package/src/chat21-core/models/projects.ts +9 -9
- package/src/chat21-core/providers/abstract/conversations-handler.service.ts +0 -1
- package/src/chat21-core/providers/abstract/groups-handler.service.ts +0 -1
- package/src/chat21-core/providers/abstract/notifications.service.ts +1 -1
- package/src/chat21-core/providers/firebase/firebase-notifications.ts +30 -15
- package/src/chat21-core/providers/mqtt/mqtt-conversation-handler.ts +0 -1
- package/src/chat21-core/providers/mqtt/mqtt-conversations-handler.ts +3 -3
- package/src/chat21-core/providers/mqtt/mqtt-notifications.ts +31 -5
- package/src/chat21-core/providers/tiledesk/tiledesk-auth.service.ts +0 -2
- package/src/chat21-core/utils/constants.ts +6 -0
- package/src/chat21-core/utils/convertRequestToConversation.ts +1 -1
- package/src/chat21-core/utils/utils-message.ts +4 -4
- package/src/chat21-core/utils/utils.ts +0 -16
- package/tsconfig.app.json +0 -1
- package/src/app/shared/shared-conversation-info.module.ts +0 -33
- package/src/models/department.ts +0 -12
|
@@ -2,7 +2,7 @@ import { Injectable, Component, OnInit, Input, Output, EventEmitter, ViewChild }
|
|
|
2
2
|
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
|
|
3
3
|
import { ToastController, IonInput } from '@ionic/angular';
|
|
4
4
|
import { AppConfigProvider } from '../../../services/app-config';
|
|
5
|
-
|
|
5
|
+
import { InAppBrowser } from '@ionic-native/in-app-browser/ngx';
|
|
6
6
|
|
|
7
7
|
// Logger
|
|
8
8
|
import { LoggerService } from 'src/chat21-core/providers/abstract/logger.service';
|
|
@@ -24,8 +24,8 @@ export class LoginComponent implements OnInit {
|
|
|
24
24
|
@Input() translationMap: Map<string, string>;
|
|
25
25
|
@Input() companyLogoBlackUrl: string;
|
|
26
26
|
@Input() companyName: string;
|
|
27
|
-
@Output()
|
|
28
|
-
|
|
27
|
+
@Output() onSignInWithEmailAndPassword = new EventEmitter<{ email: string, password: string }>();
|
|
28
|
+
@Output() onSignInWithGoogle = new EventEmitter()
|
|
29
29
|
// (eventSignInWithEmailAndPassword)="returnSignInWithEmailAndPassword($event)"
|
|
30
30
|
|
|
31
31
|
// @ViewChild('email', { static: false }) emailInputEl: IonInput;
|
|
@@ -53,7 +53,8 @@ export class LoginComponent implements OnInit {
|
|
|
53
53
|
constructor(
|
|
54
54
|
public formBuilder: FormBuilder,
|
|
55
55
|
public toastController: ToastController,
|
|
56
|
-
public appConfig: AppConfigProvider
|
|
56
|
+
public appConfig: AppConfigProvider,
|
|
57
|
+
public iab: InAppBrowser,
|
|
57
58
|
) { }
|
|
58
59
|
|
|
59
60
|
ngOnInit() {
|
|
@@ -130,7 +131,13 @@ export class LoginComponent implements OnInit {
|
|
|
130
131
|
const emailValue = this.userForm.value.email;
|
|
131
132
|
const pswValue = this.userForm.value.password;
|
|
132
133
|
this.showSpinnerInLoginBtn = true;
|
|
133
|
-
this.
|
|
134
|
+
this.onSignInWithEmailAndPassword.emit({ email: emailValue, password: pswValue });
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
signInWithGoogle(){
|
|
138
|
+
// const url = this.SERVER_BASE_PATH + "auth/google"
|
|
139
|
+
const url = "https://eu.rtmv3.tiledesk.com/api/auth/google" + '?forced_redirect_url=chat://conversation-detail?from=google'
|
|
140
|
+
this.iab.create(url, '_system', 'locaation=yes')
|
|
134
141
|
}
|
|
135
142
|
|
|
136
143
|
/** */
|
|
@@ -8,6 +8,7 @@ import { LoggerInstance } from 'src/chat21-core/providers/logger/loggerInstance'
|
|
|
8
8
|
import { TiledeskAuthService } from 'src/chat21-core/providers/tiledesk/tiledesk-auth.service';
|
|
9
9
|
import { compareValues, htmlEntities } from 'src/chat21-core/utils/utils';
|
|
10
10
|
import { getProjectIdSelectedConversation } from 'src/chat21-core/utils/utils-message';
|
|
11
|
+
import { PLAN_NAME } from 'src/chat21-core/utils/constants';
|
|
11
12
|
|
|
12
13
|
@Component({
|
|
13
14
|
selector: 'app-canned-response',
|
|
@@ -20,6 +21,7 @@ export class CannedResponseComponent implements OnInit {
|
|
|
20
21
|
@Input() conversationWith: string;
|
|
21
22
|
@Input() conversationWithFullname: string;
|
|
22
23
|
@Input() currentString: string;
|
|
24
|
+
@Input() canShowCanned: boolean = true;
|
|
23
25
|
@Input() stylesMap: Map<string, string>;
|
|
24
26
|
@Input() translationMap: Map<string, string>;
|
|
25
27
|
@Output() onLoadedCannedResponses = new EventEmitter<[any]>();
|
|
@@ -33,6 +35,9 @@ export class CannedResponseComponent implements OnInit {
|
|
|
33
35
|
public tagsCannedFilter: any = []
|
|
34
36
|
|
|
35
37
|
public arrowkeyLocation = -1
|
|
38
|
+
|
|
39
|
+
tparams: any;
|
|
40
|
+
PLAN_NAME = PLAN_NAME
|
|
36
41
|
|
|
37
42
|
private logger: LoggerService = LoggerInstance.getInstance();
|
|
38
43
|
constructor(
|
|
@@ -45,6 +50,7 @@ export class CannedResponseComponent implements OnInit {
|
|
|
45
50
|
|
|
46
51
|
ngOnInit() {
|
|
47
52
|
this.loggedUser = this.tiledeskAuthService.getCurrentUser()
|
|
53
|
+
this.tparams = {'plan_name': PLAN_NAME.A}
|
|
48
54
|
}
|
|
49
55
|
|
|
50
56
|
ngOnChanges(changes: SimpleChange){
|
|
@@ -56,6 +62,7 @@ export class CannedResponseComponent implements OnInit {
|
|
|
56
62
|
if(this.currentString !== undefined){
|
|
57
63
|
this.loadTagsCanned(this.currentString, this.conversationWith)
|
|
58
64
|
}
|
|
65
|
+
console.log('can show canneddddddd', this.canShowCanned)
|
|
59
66
|
}
|
|
60
67
|
|
|
61
68
|
// getProjectIdSelectedConversation(conversationWith: string): string{
|
package/src/app/components/conversation-detail/message-text-area/message-text-area.component.ts
CHANGED
|
@@ -396,7 +396,7 @@ export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChange
|
|
|
396
396
|
enableBackdropDismiss: false,
|
|
397
397
|
conversationWith: this.conversationWith,
|
|
398
398
|
msg: this.messageString,
|
|
399
|
-
email: this.leadInfo.email,
|
|
399
|
+
// email: this.leadInfo.email,
|
|
400
400
|
projectId: this.leadInfo.projectId,
|
|
401
401
|
translationMap: this.translationMap};
|
|
402
402
|
const modal: HTMLIonModalElement =
|
|
@@ -594,7 +594,7 @@ export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChange
|
|
|
594
594
|
this.messageString = '';
|
|
595
595
|
// text = text.replace(/(\r\n|\n|\r)/gm, '');
|
|
596
596
|
if (text && text.trim() !== '') {
|
|
597
|
-
this.eventSendMessage.emit({ msg: text, type: TYPE_MSG_TEXT });
|
|
597
|
+
this.eventSendMessage.emit({ msg: text, type: TYPE_MSG_TEXT, metadata: null, attributes: null });
|
|
598
598
|
}
|
|
599
599
|
}
|
|
600
600
|
|
|
@@ -1,11 +1,33 @@
|
|
|
1
1
|
import { NgModule } from '@angular/core';
|
|
2
2
|
import { CommonModule } from '@angular/common';
|
|
3
|
+
import { InfoContentComponent } from './info-content/info-content.component';
|
|
4
|
+
import { InfoSupportGroupComponent } from './info-support-group/info-support-group.component';
|
|
5
|
+
import { InfoDirectComponent } from './info-direct/info-direct.component';
|
|
6
|
+
import { InfoGroupComponent } from './info-group/info-group.component';
|
|
7
|
+
import { AdvancedInfoAccordionComponent } from './advanced-info-accordion/advanced-info-accordion.component';
|
|
8
|
+
import { IonicModule } from '@ionic/angular';
|
|
9
|
+
import { SharedModule } from 'src/app/shared/shared.module';
|
|
3
10
|
|
|
4
11
|
|
|
5
12
|
@NgModule({
|
|
6
|
-
declarations: [
|
|
13
|
+
declarations: [
|
|
14
|
+
InfoContentComponent,
|
|
15
|
+
InfoSupportGroupComponent,
|
|
16
|
+
InfoDirectComponent,
|
|
17
|
+
InfoGroupComponent,
|
|
18
|
+
AdvancedInfoAccordionComponent
|
|
19
|
+
],
|
|
20
|
+
exports:[
|
|
21
|
+
InfoContentComponent,
|
|
22
|
+
InfoSupportGroupComponent,
|
|
23
|
+
InfoDirectComponent,
|
|
24
|
+
InfoGroupComponent,
|
|
25
|
+
AdvancedInfoAccordionComponent
|
|
26
|
+
],
|
|
7
27
|
imports: [
|
|
8
28
|
CommonModule,
|
|
29
|
+
IonicModule,
|
|
30
|
+
SharedModule
|
|
9
31
|
]
|
|
10
32
|
})
|
|
11
33
|
export class ConversationInfoModule { }
|
|
@@ -18,7 +18,6 @@ export class SendEmailModal implements OnInit {
|
|
|
18
18
|
@Input() enableBackdropDismiss: any
|
|
19
19
|
@Input() conversationWith: string;
|
|
20
20
|
@Input() msg: string;
|
|
21
|
-
@Input() email: string;
|
|
22
21
|
@Input() projectId: string;
|
|
23
22
|
@Input() translationMap: Map<string, string>;
|
|
24
23
|
@Output() onSubmitForm = new EventEmitter<{}>();
|
|
@@ -72,8 +71,6 @@ export class SendEmailModal implements OnInit {
|
|
|
72
71
|
return this.formBuilder.group({
|
|
73
72
|
subject: ['', [Validators.required]],
|
|
74
73
|
text: ['', Validators.required],
|
|
75
|
-
to: this.email,
|
|
76
|
-
request_id: this.conversationWith
|
|
77
74
|
})
|
|
78
75
|
}
|
|
79
76
|
async onClose() {
|
|
@@ -83,7 +80,7 @@ export class SendEmailModal implements OnInit {
|
|
|
83
80
|
onSubmit(){
|
|
84
81
|
this.logger.log('[SEND-EMAIL-MODAL] onSubmit -->',this.emailFormGroup)
|
|
85
82
|
const tiledeskToken = this.tiledeskAuthService.getTiledeskToken()
|
|
86
|
-
this.tiledeskService.sendEmail(tiledeskToken, this.projectId, this.emailFormGroup.value).subscribe((res)=> {
|
|
83
|
+
this.tiledeskService.sendEmail(tiledeskToken, this.projectId, this.conversationWith, this.emailFormGroup.value).subscribe((res)=> {
|
|
87
84
|
this.logger.debug('[SEND-EMAIL-MODAL] subscribe to sendEmail API response -->', res)
|
|
88
85
|
if(res && res.queued){
|
|
89
86
|
this.viewCtrl.dismiss({form: this.emailFormGroup.value})
|
|
@@ -3,5 +3,5 @@
|
|
|
3
3
|
[translationMap] = translationMap
|
|
4
4
|
[companyLogoBlackUrl]= companyLogoBlackUrl
|
|
5
5
|
[companyName]= companyName
|
|
6
|
-
(
|
|
6
|
+
(onSignInWithEmailAndPassword)="onSignInWithEmailAndPassword($event)">
|
|
7
7
|
</component-login>
|
|
@@ -118,7 +118,7 @@ export class LoginPage implements OnInit {
|
|
|
118
118
|
*
|
|
119
119
|
* @param auth
|
|
120
120
|
*/
|
|
121
|
-
|
|
121
|
+
onSignInWithEmailAndPassword(auth: any) {
|
|
122
122
|
this.showSpinnerInLoginBtn = true
|
|
123
123
|
this.logger.log('[LOGIN PAGE] returnSignInWithEmailAndPassword', auth, auth.email, auth.password);
|
|
124
124
|
this.tiledeskAuthService.signInWithEmailAndPassword(auth.email, auth.password)
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { BubbleInfoPopoverComponent } from '../../components/bubbleMessageInfo-popover/bubbleinfo-popover.component';
|
|
2
|
-
import { BubbleMessageComponent } from './../../chatlib/conversation-detail/message/bubble-message/bubble-message.component';
|
|
3
2
|
import { CannedResponseComponent } from './../../components/canned-response/canned-response.component';
|
|
4
3
|
import { TruncatePipe } from './../../directives/truncate.pipe';
|
|
5
4
|
import { IonConversationDetailComponent } from '../../chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component';
|
|
@@ -15,19 +14,7 @@ import { IonicModule } from '@ionic/angular';
|
|
|
15
14
|
import { ConversationDetailPageRoutingModule } from './conversation-detail-routing.module';
|
|
16
15
|
import { ConversationDetailPage } from './conversation-detail.page';
|
|
17
16
|
|
|
18
|
-
// import { InfoSupportGroupComponent } from '../../components/conversation-info/info-support-group/info-support-group.component';
|
|
19
|
-
// import { InfoDirectComponent } from '../../components/conversation-info/info-direct/info-direct.component';
|
|
20
|
-
// import { InfoGroupComponent } from '../../components/conversation-info/info-group/info-group.component';
|
|
21
|
-
|
|
22
17
|
// tslint:disable-next-line: max-line-length
|
|
23
|
-
import { HeaderConversationDetailComponent } from '../../components/conversation-detail/header-conversation-detail/header-conversation-detail.component';
|
|
24
|
-
import { MessageTextAreaComponent } from '../../components/conversation-detail/message-text-area/message-text-area.component';
|
|
25
|
-
// import { InfoContentComponent } from '../../components/conversation-info/info-content/info-content.component';
|
|
26
|
-
// import { InfoDirectComponent } from '../../components/conversation-info/info-direct/info-direct.component';
|
|
27
|
-
import { InfoContentComponent } from 'src/app/components/conversation-info/info-content/info-content.component';
|
|
28
|
-
import { InfoSupportGroupComponent } from 'src/app/components/conversation-info/info-support-group/info-support-group.component';
|
|
29
|
-
import { InfoDirectComponent } from 'src/app/components/conversation-info/info-direct/info-direct.component';
|
|
30
|
-
import { InfoGroupComponent } from 'src/app/components/conversation-info/info-group/info-group.component';
|
|
31
18
|
|
|
32
19
|
|
|
33
20
|
import { SharedModule } from 'src/app/shared/shared.module';
|
|
@@ -35,12 +22,36 @@ import { ScrollbarThemeModule } from '../../utils/scrollbar-theme.directive';
|
|
|
35
22
|
import { PickerModule } from '@ctrl/ngx-emoji-mart';
|
|
36
23
|
|
|
37
24
|
|
|
25
|
+
import { ConversationInfoModule } from 'src/app/components/conversation-info/conversation-info.module';
|
|
26
|
+
import { ConversationContentComponent } from 'src/app/chatlib/conversation-detail/conversation-content/conversation-content.component';
|
|
27
|
+
import { HeaderConversationDetailComponent } from '../../components/conversation-detail/header-conversation-detail/header-conversation-detail.component';
|
|
28
|
+
import { MessageTextAreaComponent } from '../../components/conversation-detail/message-text-area/message-text-area.component';
|
|
29
|
+
import { BubbleMessageComponent } from './../../chatlib/conversation-detail/message/bubble-message/bubble-message.component';
|
|
30
|
+
import { FrameComponent } from 'src/app/chatlib/conversation-detail/message/frame/frame.component';
|
|
31
|
+
import { ImageComponent } from 'src/app/chatlib/conversation-detail/message/image/image.component';
|
|
32
|
+
import { AudioComponent } from 'src/app/chatlib/conversation-detail/message/audio/audio.component';
|
|
33
|
+
import { TextComponent } from 'src/app/chatlib/conversation-detail/message/text/text.component';
|
|
34
|
+
import { MomentModule } from 'ngx-moment';
|
|
35
|
+
import { AvatarComponent } from 'src/app/chatlib/conversation-detail/message/avatar/avatar.component';
|
|
36
|
+
import { ActionButtonComponent } from 'src/app/chatlib/conversation-detail/message/buttons/action-button/action-button.component';
|
|
37
|
+
import { LinkButtonComponent } from 'src/app/chatlib/conversation-detail/message/buttons/link-button/link-button.component';
|
|
38
|
+
import { TextButtonComponent } from 'src/app/chatlib/conversation-detail/message/buttons/text-button/text-button.component';
|
|
39
|
+
import { HtmlComponent } from 'src/app/chatlib/conversation-detail/message/html/html.component';
|
|
40
|
+
import { InfoMessageComponent } from 'src/app/chatlib/conversation-detail/message/info-message/info-message.component';
|
|
41
|
+
import { MessageAttachmentComponent } from 'src/app/chatlib/conversation-detail/message/message-attachment/message-attachment.component';
|
|
42
|
+
import { ReturnReceiptComponent } from 'src/app/chatlib/conversation-detail/message/return-receipt/return-receipt.component';
|
|
43
|
+
import { OptionsComponent } from 'src/app/chatlib/conversation-detail/message/options/options.component';
|
|
44
|
+
import { UserTypingComponent } from 'src/chat21-core/utils/user-typing/user-typing.component';
|
|
45
|
+
import { AvatarProfileComponent } from 'src/app/components/utils/avatar-profile/avatar-profile.component';
|
|
46
|
+
|
|
47
|
+
|
|
38
48
|
@NgModule({
|
|
39
49
|
imports: [
|
|
40
50
|
CommonModule,
|
|
41
51
|
FormsModule,
|
|
42
52
|
IonicModule,
|
|
43
53
|
ConversationDetailPageRoutingModule,
|
|
54
|
+
ConversationInfoModule,
|
|
44
55
|
ScrollbarThemeModule,
|
|
45
56
|
PickerModule,
|
|
46
57
|
TranslateModule.forChild({
|
|
@@ -51,20 +62,46 @@ import { PickerModule } from '@ctrl/ngx-emoji-mart';
|
|
|
51
62
|
},
|
|
52
63
|
}),
|
|
53
64
|
SharedModule,
|
|
65
|
+
MomentModule
|
|
54
66
|
],
|
|
55
67
|
// entryComponents: [MessageTextAreaComponent],
|
|
56
68
|
entryComponents: [ BubbleInfoPopoverComponent],
|
|
57
69
|
declarations: [
|
|
58
70
|
ConversationDetailPage,
|
|
71
|
+
//******** COMPONENTS - init ********//
|
|
72
|
+
// --------- header --------- //
|
|
59
73
|
HeaderConversationDetailComponent,
|
|
74
|
+
// --------- content --------- //
|
|
75
|
+
IonConversationDetailComponent,
|
|
76
|
+
ConversationContentComponent,
|
|
77
|
+
BubbleMessageComponent,
|
|
78
|
+
FrameComponent,
|
|
79
|
+
ImageComponent,
|
|
80
|
+
AudioComponent,
|
|
81
|
+
TextComponent,
|
|
82
|
+
AvatarComponent,
|
|
83
|
+
HtmlComponent,
|
|
84
|
+
InfoMessageComponent,
|
|
85
|
+
MessageAttachmentComponent,
|
|
86
|
+
ActionButtonComponent,
|
|
87
|
+
LinkButtonComponent,
|
|
88
|
+
TextButtonComponent,
|
|
89
|
+
ReturnReceiptComponent,
|
|
90
|
+
OptionsComponent,
|
|
91
|
+
BubbleInfoPopoverComponent,
|
|
92
|
+
UserTypingComponent,
|
|
93
|
+
// --------- footer --------- //
|
|
60
94
|
MessageTextAreaComponent,
|
|
61
95
|
CannedResponseComponent,
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
// InfoSupportGroupComponent,
|
|
65
|
-
// InfoDirectComponent,
|
|
66
|
-
// InfoGroupComponent,
|
|
96
|
+
|
|
97
|
+
|
|
67
98
|
TruncatePipe
|
|
99
|
+
],
|
|
100
|
+
exports:[
|
|
101
|
+
// --------- content --------- //
|
|
102
|
+
// IonConversationDetailComponent,
|
|
103
|
+
// ConversationContentComponent,
|
|
104
|
+
// BubbleMessageComponent,
|
|
68
105
|
]
|
|
69
106
|
})
|
|
70
107
|
export class ConversationDetailPageModule {}
|
|
@@ -170,6 +170,7 @@
|
|
|
170
170
|
<!-- ----------------------------------------------------------- -->
|
|
171
171
|
<app-canned-response *ngIf="HIDE_CANNED_RESPONSES === false"
|
|
172
172
|
id="canned"
|
|
173
|
+
[canShowCanned]="canShowCanned"
|
|
173
174
|
[conversationWith]="conversationWith"
|
|
174
175
|
[conversationWithFullname]="conversationWithFullname"
|
|
175
176
|
[currentString]="messageStr"
|
|
@@ -88,6 +88,7 @@ import { NetworkService } from '../../services/network-service/network.service'
|
|
|
88
88
|
import { EventsService } from '../../services/events-service'
|
|
89
89
|
import { ScrollbarThemeDirective } from 'src/app/utils/scrollbar-theme.directive'
|
|
90
90
|
import { WebsocketService } from 'src/app/services/websocket/websocket.service';
|
|
91
|
+
import { Project } from 'src/chat21-core/models/projects';
|
|
91
92
|
|
|
92
93
|
@Component({
|
|
93
94
|
selector: 'app-conversation-detail',
|
|
@@ -141,6 +142,7 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
|
|
|
141
142
|
public tagsCannedFilter: Array<any> = [];
|
|
142
143
|
public tagsCannedCount: number;
|
|
143
144
|
public HIDE_CANNED_RESPONSES: boolean = true
|
|
145
|
+
public canShowCanned: boolean = true
|
|
144
146
|
|
|
145
147
|
public window: any = window
|
|
146
148
|
public styleMap: Map<string, string> = new Map()
|
|
@@ -523,7 +525,7 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
|
|
|
523
525
|
// this.initConversationsHandler(); // nk
|
|
524
526
|
if (this.conversationWith) {
|
|
525
527
|
this.disableTextarea = false
|
|
526
|
-
|
|
528
|
+
this._getProjectIdByConversationWith(this.conversationWith)
|
|
527
529
|
this.initConversationHandler()
|
|
528
530
|
this.initGroupsHandler()
|
|
529
531
|
this.initSubscriptions()
|
|
@@ -539,7 +541,6 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
|
|
|
539
541
|
|
|
540
542
|
_getProjectIdByConversationWith(conversationWith: string) {
|
|
541
543
|
const tiledeskToken = this.tiledeskAuthService.getTiledeskToken()
|
|
542
|
-
|
|
543
544
|
this.tiledeskService.getProjectIdByConvRecipient(tiledeskToken, conversationWith).subscribe((res) => {
|
|
544
545
|
this.logger.log('[CONVS-DETAIL] - GET PROJECTID BY CONV RECIPIENT RES + projectId', res, res.id_project)
|
|
545
546
|
if (res) {
|
|
@@ -554,10 +555,11 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
|
|
|
554
555
|
}
|
|
555
556
|
|
|
556
557
|
getProjectById(tiledeskToken, projectId) {
|
|
557
|
-
this.tiledeskService.getProjectById(tiledeskToken, projectId).subscribe((
|
|
558
|
-
this.logger.log('[CONVS-DETAIL] - GET PROJECTID BY CONV RECIPIENT RES',
|
|
559
|
-
if (
|
|
560
|
-
const projectId =
|
|
558
|
+
this.tiledeskService.getProjectById(tiledeskToken, projectId).subscribe((project) => {
|
|
559
|
+
this.logger.log('[CONVS-DETAIL] - GET PROJECTID BY CONV RECIPIENT RES', project)
|
|
560
|
+
if (project) {
|
|
561
|
+
const projectId = project.id_project
|
|
562
|
+
this.canShowCanned = this.checkPlanIsExpired(project)
|
|
561
563
|
}
|
|
562
564
|
}, (error) => {
|
|
563
565
|
this.logger.error('[CONVS-DETAIL] - GET PROJECTID BY CONV RECIPIENT - ERROR ', error)
|
|
@@ -569,6 +571,27 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
|
|
|
569
571
|
})
|
|
570
572
|
}
|
|
571
573
|
|
|
574
|
+
|
|
575
|
+
checkPlanIsExpired(project: Project): boolean {
|
|
576
|
+
let check: boolean = false
|
|
577
|
+
|
|
578
|
+
//case FREE plan
|
|
579
|
+
if(project && project.trialExpired && project.profile.type=== 'trial'){
|
|
580
|
+
check = true
|
|
581
|
+
}else if(project && !project.trialExpired && project.profile.type=== 'trial'){
|
|
582
|
+
check = false
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
//case PAYMENT plan
|
|
586
|
+
if(project && project.isActiveSubscription && project.profile.type=== 'payment'){
|
|
587
|
+
check = true
|
|
588
|
+
}else if(project && !project.isActiveSubscription && project.profile.type=== 'payment'){
|
|
589
|
+
check = false
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
return check
|
|
593
|
+
}
|
|
594
|
+
|
|
572
595
|
// getProjectIdSelectedConversation(conversationWith: string): string{
|
|
573
596
|
// const conversationWith_segments = conversationWith.split('-')
|
|
574
597
|
// // Removes the last element of the array if is = to the separator
|
|
@@ -845,7 +868,7 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
|
|
|
845
868
|
// this.logger.log('[CONVS-DETAIL] - setHeaderContent conversationWith', this.conversationWith)
|
|
846
869
|
// this.logger.log('[CONVS-DETAIL] - setHeaderContent conversationsHandlerService', this.conversationsHandlerService)
|
|
847
870
|
// this.logger.log('[CONVS-DETAIL] - setHeaderContent conv_type', this.conv_type)
|
|
848
|
-
if (this.conversationWith && this.conversationsHandlerService && this.conv_type === 'active') {
|
|
871
|
+
if (this.conversationWith && this.conversationsHandlerService && (this.conv_type === 'active' || this.conv_type === 'new')) {
|
|
849
872
|
this.logger.log('[CONVS-DETAIL] - setHeaderContent getConversationDetail CALLING')
|
|
850
873
|
this.conversationsHandlerService.getConversationDetail(this.conversationWith, (conv) => {
|
|
851
874
|
this.logger.debug('[CONV-COMP] setHeaderContent getConversationDetail: conversationsHandlerService ', this.conversationWith, conv, this.conv_type)
|
|
@@ -1006,13 +1029,11 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
|
|
|
1006
1029
|
sendEmail(message: string): Observable<boolean> {
|
|
1007
1030
|
const tiledeskToken = this.tiledeskAuthService.getTiledeskToken();
|
|
1008
1031
|
const emailFormGroup = {
|
|
1009
|
-
to: this.leadInfo.email,
|
|
1010
1032
|
subject: this.translationsMap.get('EMAIL.SUBJECT_OFFLINE_MESSAGE'),
|
|
1011
|
-
text: message
|
|
1012
|
-
request_id: this.conversationWith
|
|
1033
|
+
text: message
|
|
1013
1034
|
}
|
|
1014
1035
|
let status = new Subject<boolean>();
|
|
1015
|
-
this.tiledeskService.sendEmail(tiledeskToken, this.leadInfo.projectId, emailFormGroup).subscribe((res) => {
|
|
1036
|
+
this.tiledeskService.sendEmail(tiledeskToken, this.leadInfo.projectId, this.conversationWith, emailFormGroup).subscribe((res) => {
|
|
1016
1037
|
this.logger.debug('[SEND-EMAIL-MODAL] subscribe to sendEmail API response -->', res)
|
|
1017
1038
|
if (res && res.queued) {
|
|
1018
1039
|
this.presentToast(this.translationsMap.get('EMAIL.SEND_EMAIL_SUCCESS_OFFLINE_MESSAGE'), 'success', '', 2000)
|
|
@@ -1089,9 +1110,8 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
|
|
|
1089
1110
|
msg = `[${metadata.name}](${metadata.src})`
|
|
1090
1111
|
}
|
|
1091
1112
|
}
|
|
1092
|
-
this.conversation.attributes && this.conversation.attributes['request_channel'] ? attributes.request_channel = this.conversation.attributes['request_channel'] : null;
|
|
1113
|
+
this.conversation && this.conversation.attributes && this.conversation.attributes['request_channel'] ? attributes.request_channel = this.conversation.attributes['request_channel'] : null;
|
|
1093
1114
|
metadata ? (metadata = metadata) : (metadata = '')
|
|
1094
|
-
this.logger.log('[CONVS-DETAIL] attributes--->>>> 1111', this.conversation.attributes, attributes)
|
|
1095
1115
|
this.logger.log('[CONVS-DETAIL] - SEND MESSAGE msg: ', msg, ' - messages: ', this.messages, ' - loggedUser: ', this.loggedUser)
|
|
1096
1116
|
|
|
1097
1117
|
|
|
@@ -19,6 +19,15 @@ import { ProfileInfoPageModule } from '../profile-info/profile-info.module';
|
|
|
19
19
|
// import { ConversationDetailPageModule } from '../conversation-detail/conversation-detail.module';
|
|
20
20
|
import { SharedModule } from 'src/app/shared/shared.module';
|
|
21
21
|
import { ScrollbarThemeModule } from '../../utils/scrollbar-theme.directive';
|
|
22
|
+
import { ListConversationsComponent } from 'src/app/chatlib/list-conversations-component/list-conversations/list-conversations.component';
|
|
23
|
+
import { IonListConversationsComponent } from 'src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component';
|
|
24
|
+
import { HeaderConversationsList } from 'src/app/components/conversations-list/header-conversations-list/header-conversations-list.component';
|
|
25
|
+
import { HeaderConversationsListArchived } from 'src/app/components/conversations-list/header-conversations-list-archived/header-conversations-list-archived.component';
|
|
26
|
+
import { HeaderConversationsListUnassigned } from 'src/app/components/conversations-list/header-conversations-list-unassigned/header-conversations-list-unassigned.component';
|
|
27
|
+
import { ProjectItemComponent } from 'src/app/components/project-item/project-item.component';
|
|
28
|
+
import { MomentModule } from 'ngx-moment';
|
|
29
|
+
|
|
30
|
+
|
|
22
31
|
@NgModule({
|
|
23
32
|
imports: [
|
|
24
33
|
CommonModule,
|
|
@@ -26,8 +35,8 @@ import { ScrollbarThemeModule } from '../../utils/scrollbar-theme.directive';
|
|
|
26
35
|
IonicModule,
|
|
27
36
|
ConversationListPageRoutingModule,
|
|
28
37
|
// ConversationDetailPageModule,
|
|
29
|
-
ContactsDirectoryPageModule,
|
|
30
|
-
ProfileInfoPageModule,
|
|
38
|
+
// ContactsDirectoryPageModule,
|
|
39
|
+
// ProfileInfoPageModule,
|
|
31
40
|
ScrollbarThemeModule,
|
|
32
41
|
TranslateModule.forChild({
|
|
33
42
|
loader: {
|
|
@@ -36,9 +45,20 @@ import { ScrollbarThemeModule } from '../../utils/scrollbar-theme.directive';
|
|
|
36
45
|
deps: [HttpClient]
|
|
37
46
|
}
|
|
38
47
|
}),
|
|
39
|
-
SharedModule
|
|
48
|
+
SharedModule,
|
|
49
|
+
MomentModule
|
|
40
50
|
],
|
|
41
51
|
// entryComponents: [DdpHeaderComponent],
|
|
42
|
-
declarations: [
|
|
52
|
+
declarations: [
|
|
53
|
+
ConversationListPage,
|
|
54
|
+
//******** COMPONENTS - init ********//
|
|
55
|
+
ListConversationsComponent,
|
|
56
|
+
IonListConversationsComponent,
|
|
57
|
+
HeaderConversationsList,
|
|
58
|
+
HeaderConversationsListArchived,
|
|
59
|
+
HeaderConversationsListUnassigned,
|
|
60
|
+
ProjectItemComponent
|
|
61
|
+
|
|
62
|
+
]
|
|
43
63
|
})
|
|
44
64
|
export class ConversationListPageModule { }
|
|
@@ -275,7 +275,7 @@ export class TiledeskService {
|
|
|
275
275
|
// -----------------------------------------------------------------------------------------
|
|
276
276
|
// @ Send Email
|
|
277
277
|
// -----------------------------------------------------------------------------------------
|
|
278
|
-
public sendEmail(token: string, projectid: string,
|
|
278
|
+
public sendEmail(token: string, projectid: string, request_id: string, form: { subject: string, text: string}) {
|
|
279
279
|
|
|
280
280
|
const httpOptions = {
|
|
281
281
|
headers: new HttpHeaders({
|
|
@@ -287,7 +287,7 @@ export class TiledeskService {
|
|
|
287
287
|
|
|
288
288
|
const body = form;
|
|
289
289
|
|
|
290
|
-
const url = this.apiUrl + projectid + '/
|
|
290
|
+
const url = this.apiUrl + projectid + '/requests/' + request_id + '/email/send';
|
|
291
291
|
this.logger.log('[TILEDESK-SERVICE] - sendEmail URL ', url);
|
|
292
292
|
return this.http.post(url, body, httpOptions).pipe(map((res: any) => {
|
|
293
293
|
this.logger.log('[TILEDESK-SERVICE] - sendEmail - RES ', res);
|