@chat21/chat21-ionic 3.4.13-rc2 → 3.4.13-rc4
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 +8 -0
- package/package.json +1 -1
- package/src/app/app.component.ts +7 -6
- package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.html +3 -28
- package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.ts +12 -7
- package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.html +2 -1
- package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.ts +5 -30
- package/src/app/chatlib/conversation-detail/message/options/options.component.html +4 -1
- package/src/app/chatlib/conversation-detail/message/options/options.component.scss +7 -0
- package/src/app/chatlib/conversation-detail/message/options/options.component.ts +41 -8
- package/src/app/components/canned-response/canned-response.component.html +8 -3
- package/src/app/components/canned-response/canned-response.component.scss +26 -0
- package/src/app/components/canned-response/canned-response.component.ts +8 -28
- package/src/app/components/conversation-detail/message-text-area/message-text-area.component.html +3 -4
- package/src/app/components/conversation-detail/message-text-area/message-text-area.component.scss +11 -0
- package/src/app/components/conversation-detail/message-text-area/message-text-area.component.ts +1 -0
- package/src/app/components/conversation-info/info-content/info-content.component.ts +9 -11
- package/src/app/components/conversation-info/info-group/info-group.component.ts +2 -10
- package/src/app/components/copilot-popover/copilot-popover.component.html +25 -0
- package/src/app/components/copilot-popover/copilot-popover.component.scss +101 -0
- package/src/app/components/copilot-popover/copilot-popover.component.spec.ts +24 -0
- package/src/app/components/copilot-popover/copilot-popover.component.ts +81 -0
- package/src/app/components/copilot-suggestions/copilot-suggestions.component.ts +37 -18
- package/src/app/components/navbar/navbar.component.ts +4 -4
- package/src/app/components/project-item/project-item.component.ts +3 -4
- package/src/app/modals/create-canned-response/create-canned-response.page.ts +1 -1
- package/src/app/pages/contacts-directory/contacts-directory.page.ts +5 -4
- package/src/app/pages/conversation-detail/conversation-detail.module.ts +3 -1
- package/src/app/pages/conversation-detail/conversation-detail.page.html +6 -3
- package/src/app/pages/conversation-detail/conversation-detail.page.ts +29 -28
- package/src/app/pages/conversations-list/conversations-list.page.ts +1 -1
- package/src/app/services/canned-responses/canned-responses.service.ts +22 -16
- package/src/app/services/contacts/contacts.service.ts +23 -20
- package/src/app/services/copilot/copilot.service.ts +46 -19
- package/src/app/services/projects/{projects.service.spec.ts → project.service.spec.ts} +2 -2
- package/src/app/services/projects/project.service.ts +68 -0
- package/src/app/services/tiledesk/tiledesk.service.ts +0 -35
- package/src/app/utils/project-utils.ts +140 -0
- package/src/assets/i18n/en.json +4 -1
- package/src/assets/i18n/it.json +4 -1
- package/src/chat21-core/utils/constants.ts +3 -0
- package/src/global.scss +6 -0
- package/src/variables.scss +1 -0
- package/src/app/services/projects/projects.service.ts +0 -43
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# chat21-ionic ver 3.0
|
|
2
2
|
|
|
3
|
+
### 3.4.13-rc.4
|
|
4
|
+
- added: management for copilot option in project.profile obj
|
|
5
|
+
- removed: token in each tiledesk Service method calls and added initialize method for each services
|
|
6
|
+
|
|
7
|
+
### 3.4.13-rc.3
|
|
8
|
+
- added: copilot-popover on each received message
|
|
9
|
+
- changed: canned-responsed no data ui
|
|
10
|
+
|
|
3
11
|
### 3.4.13-rc.2
|
|
4
12
|
- added: no-suggestions in copilot component
|
|
5
13
|
- changed: HIDE_CANNED_RESPONSES with SHOW CANNED_RESPONSES
|
package/package.json
CHANGED
package/src/app/app.component.ts
CHANGED
|
@@ -40,7 +40,8 @@ import { Deeplinks } from '@ionic-native/deeplinks/ngx';
|
|
|
40
40
|
import { TriggerEvents } from './services/triggerEvents/triggerEvents';
|
|
41
41
|
import { Globals } from './utils/globals';
|
|
42
42
|
import { GlobalSettingsService } from './services/global-settings/global-settings.service';
|
|
43
|
-
import {
|
|
43
|
+
import { conversationToMessage } from 'src/chat21-core/utils/utils-message';
|
|
44
|
+
import { ProjectService } from './services/projects/project.service';
|
|
44
45
|
|
|
45
46
|
@Component({
|
|
46
47
|
selector: 'app-root',
|
|
@@ -103,13 +104,10 @@ export class AppComponent implements OnInit {
|
|
|
103
104
|
private appConfigProvider: AppConfigProvider,
|
|
104
105
|
public events: EventsService,
|
|
105
106
|
public triggerEvents: TriggerEvents,
|
|
106
|
-
public config: Config,
|
|
107
107
|
public chatManager: ChatManager,
|
|
108
108
|
public translate: TranslateService,
|
|
109
109
|
public alertController: AlertController,
|
|
110
110
|
public navCtrl: NavController,
|
|
111
|
-
// public userService: UserService,
|
|
112
|
-
// public currentUserService: CurrentUserService,
|
|
113
111
|
public modalController: ModalController,
|
|
114
112
|
public messagingAuthService: MessagingAuthService,
|
|
115
113
|
public tiledeskAuthService: TiledeskAuthService,
|
|
@@ -137,7 +135,8 @@ export class AppComponent implements OnInit {
|
|
|
137
135
|
public fcm: FCM,
|
|
138
136
|
public el: ElementRef,
|
|
139
137
|
public g: Globals,
|
|
140
|
-
public globalSettingsService: GlobalSettingsService
|
|
138
|
+
public globalSettingsService: GlobalSettingsService,
|
|
139
|
+
public projectService: ProjectService
|
|
141
140
|
) {
|
|
142
141
|
|
|
143
142
|
this.saveInStorageNumberOfOpenedChatTab();
|
|
@@ -1153,7 +1152,7 @@ export class AppComponent implements OnInit {
|
|
|
1153
1152
|
// this.logger.info('initialize FROM [APP-COMP] - [APP-COMP] - GO-ONLINE isOnline ', this.isOnline);
|
|
1154
1153
|
// clearTimeout(this.timeModalLogin);
|
|
1155
1154
|
const tiledeskToken = this.tiledeskAuthService.getTiledeskToken();
|
|
1156
|
-
|
|
1155
|
+
const serverBaseURL = this.appConfigProvider.getConfig().apiUrl
|
|
1157
1156
|
// const supportmode = this.appConfigProvider.getConfig().supportMode;
|
|
1158
1157
|
// this.logger.log('[APP-COMP] - GO-ONLINE - supportmode ', supportmode);
|
|
1159
1158
|
// if (supportmode === true) {
|
|
@@ -1166,6 +1165,8 @@ export class AppComponent implements OnInit {
|
|
|
1166
1165
|
this.logger.log('[APP-COMP] - GO-ONLINE - currentUser ', currentUser);
|
|
1167
1166
|
this.chatManager.setTiledeskToken(tiledeskToken);
|
|
1168
1167
|
this.chatManager.setCurrentUser(currentUser);
|
|
1168
|
+
|
|
1169
|
+
this.projectService.initialize(serverBaseURL)
|
|
1169
1170
|
// this.chatManager.startApp();
|
|
1170
1171
|
|
|
1171
1172
|
// ----------------------------------------------
|
|
@@ -97,16 +97,6 @@
|
|
|
97
97
|
<div role="messaggio" *ngIf="messageType(MESSAGE_TYPE_MINE, message)" class="msg_container base_sent">
|
|
98
98
|
|
|
99
99
|
<div class="message-date-hover"> {{message.timestamp | date:'HH:mm' }} </div>
|
|
100
|
-
|
|
101
|
-
<!-- <ng-container *ngIf="areVisibleCAR && supportMode">
|
|
102
|
-
<ion-button shape="round" size="small" class="btn-add-msg canned" ion-button fill="clear"
|
|
103
|
-
(click)="presentCreateCannedResponseModal(message)" [tooltip]="addAsCannedResponseTooltipText"
|
|
104
|
-
[options]="tooltipOptions" placement="bottom">
|
|
105
|
-
<ion-icon slot="icon-only" name="flash-outline" style="font-size: 1em;"> </ion-icon>
|
|
106
|
-
<span class="add-canned-response-add-icon">+</span>
|
|
107
|
-
</ion-button>
|
|
108
|
-
</ng-container> -->
|
|
109
|
-
|
|
110
100
|
|
|
111
101
|
<div class="bubble-container">
|
|
112
102
|
|
|
@@ -132,7 +122,7 @@
|
|
|
132
122
|
(onBeforeMessageRender)="onBeforeMessageRenderFN($event)"
|
|
133
123
|
(onAfterMessageRender)="onAfterMessageRenderFN($event)"
|
|
134
124
|
(onElementRendered)="onElementRenderedFN($event)"
|
|
135
|
-
(
|
|
125
|
+
(onOptionsDataReturned)="onClickBubbleOptions($event)">
|
|
136
126
|
</chat-bubble-message>
|
|
137
127
|
</div>
|
|
138
128
|
|
|
@@ -174,10 +164,11 @@
|
|
|
174
164
|
[fontSize]="stylesMap?.get('fontSize')"
|
|
175
165
|
[fontFamily]="stylesMap?.get('fontFamily')"
|
|
176
166
|
[stylesMap]="stylesMap"
|
|
167
|
+
[isCopilotEnabled]="isCopilotEnabled"
|
|
177
168
|
(onBeforeMessageRender)="onBeforeMessageRenderFN($event)"
|
|
178
169
|
(onAfterMessageRender)="onAfterMessageRenderFN($event)"
|
|
179
170
|
(onElementRendered)="onElementRenderedFN($event)"
|
|
180
|
-
(
|
|
171
|
+
(onOptionsDataReturned)="onClickBubbleOptions($event)">
|
|
181
172
|
</chat-bubble-message>
|
|
182
173
|
|
|
183
174
|
</div>
|
|
@@ -189,22 +180,6 @@
|
|
|
189
180
|
</ion-button>
|
|
190
181
|
</ng-container>
|
|
191
182
|
|
|
192
|
-
<!-- <ng-container *ngIf="areVisibleCAR && supportMode">
|
|
193
|
-
<ion-button shape="round" size="small" class="btn-add-msg canned" ion-button fill="clear"
|
|
194
|
-
(click)="presentCreateCannedResponseModal(message)" [tooltip]="addAsCannedResponseTooltipText"
|
|
195
|
-
[options]="tooltipOptions" placement="bottom">
|
|
196
|
-
<ion-icon slot="icon-only" name="flash-outline" style="font-size: 1em;"> </ion-icon>
|
|
197
|
-
<span class="add-canned-response-add-icon">+</span>
|
|
198
|
-
</ion-button>
|
|
199
|
-
</ng-container> -->
|
|
200
|
-
<!-- <ng-container *ngIf="supportMode">
|
|
201
|
-
<ion-button shape="round" size="small" class="btn-add-msg emoji" ion-button fill="clear"
|
|
202
|
-
(click)="presentEmojiiModal()" tooltip="{{addAsCannedResponseTooltipText}}"
|
|
203
|
-
[options]="tooltipOptions" placement="bottom">
|
|
204
|
-
<ion-icon slot="icon-only" name="happy-outline" style="font-size: 1em;"> </ion-icon>
|
|
205
|
-
</ion-button>
|
|
206
|
-
</ng-container> -->
|
|
207
|
-
|
|
208
183
|
<div class="message-date-hover" *ngIf="isChannelTypeGroup(channelType)"> {{message.timestamp | date:'HH:mm' }} </div>
|
|
209
184
|
</div>
|
|
210
185
|
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { JsonMessagePage } from './../../../modals/json-message/json-message.page';
|
|
2
|
-
import { BubbleInfoPopoverComponent } from '../../../components/bubbleMessageInfo-popover/bubbleinfo-popover.component';
|
|
3
2
|
import { MessageModel } from 'src/chat21-core/models/message';
|
|
4
3
|
import { ConversationContentComponent } from '../conversation-content/conversation-content.component';
|
|
5
4
|
import { ChangeDetectorRef, Component, Input, OnInit, Output, EventEmitter, SimpleChange, SimpleChanges } from '@angular/core';
|
|
@@ -18,6 +17,7 @@ import * as moment from 'moment';
|
|
|
18
17
|
import { AppConfigProvider } from 'src/app/services/app-config';
|
|
19
18
|
import { ModalController, PopoverController, ToastController } from '@ionic/angular';
|
|
20
19
|
import { CreateCannedResponsePage } from 'src/app/modals/create-canned-response/create-canned-response.page';
|
|
20
|
+
import { EventsService } from 'src/app/services/events-service';
|
|
21
21
|
|
|
22
22
|
@Component({
|
|
23
23
|
selector: 'ion-conversation-detail',
|
|
@@ -29,6 +29,7 @@ export class IonConversationDetailComponent extends ConversationContentComponent
|
|
|
29
29
|
@Input() senderId: string;
|
|
30
30
|
@Input() channelType: string;
|
|
31
31
|
@Input() areVisibleCAR: boolean;
|
|
32
|
+
@Input() isCopilotEnabled: boolean = false
|
|
32
33
|
@Input() supportMode: boolean;
|
|
33
34
|
@Input() isMobile: boolean;
|
|
34
35
|
@Input() openInfoConversation: boolean;
|
|
@@ -73,7 +74,8 @@ export class IonConversationDetailComponent extends ConversationContentComponent
|
|
|
73
74
|
public appConfigProvider: AppConfigProvider,
|
|
74
75
|
public modalController: ModalController,
|
|
75
76
|
public popoverController: PopoverController,
|
|
76
|
-
public toastController: ToastController
|
|
77
|
+
public toastController: ToastController,
|
|
78
|
+
private eventService: EventsService
|
|
77
79
|
) {
|
|
78
80
|
super(cdref, uploadService)
|
|
79
81
|
|
|
@@ -154,16 +156,19 @@ export class IonConversationDetailComponent extends ConversationContentComponent
|
|
|
154
156
|
this.onAddUploadingBubble.emit(value);
|
|
155
157
|
}
|
|
156
158
|
|
|
157
|
-
|
|
158
|
-
this.logger.log('[CONVS-DETAIL][ION-CONVS-DETAIL] -
|
|
159
|
+
onClickBubbleOptions(event:{option: string, data: any}){
|
|
160
|
+
this.logger.log('[CONVS-DETAIL][ION-CONVS-DETAIL] - onClickBubbleOptions', event);
|
|
159
161
|
if(event.option==='copy'){
|
|
160
|
-
this.onClickCopyMessage(event.message)
|
|
162
|
+
this.onClickCopyMessage(event.data.message)
|
|
161
163
|
}else if(event.option === 'addCanned'){
|
|
162
164
|
if(this.areVisibleCAR && this.supportMode){
|
|
163
|
-
this.presentCreateCannedResponseModal(event.message)
|
|
165
|
+
this.presentCreateCannedResponseModal(event.data.message)
|
|
164
166
|
}
|
|
165
167
|
}else if(event.option === 'jsonInfo'){
|
|
166
|
-
this.presentJsonMessageModal(event.message)
|
|
168
|
+
this.presentJsonMessageModal(event.data.message)
|
|
169
|
+
} else if(event.option === 'copilot_question'){
|
|
170
|
+
this.eventService.publish('copilot:new_question', {text: event.data.text})
|
|
171
|
+
|
|
167
172
|
}
|
|
168
173
|
}
|
|
169
174
|
|
package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.html
CHANGED
|
@@ -11,8 +11,9 @@
|
|
|
11
11
|
</div> -->
|
|
12
12
|
<chat-options
|
|
13
13
|
[message]="message"
|
|
14
|
+
[isCopilotEnabled]="isCopilotEnabled"
|
|
14
15
|
[logLevel]="logger.getLoggerConfig().logLevel"
|
|
15
|
-
(
|
|
16
|
+
(onOptionsDataReturned)="onOptionsDataReturnedFN($event)">
|
|
16
17
|
</chat-options>
|
|
17
18
|
|
|
18
19
|
<div>
|
package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.ts
CHANGED
|
@@ -26,10 +26,11 @@ export class BubbleMessageComponent implements OnInit, OnChanges {
|
|
|
26
26
|
@Input() fontFamily: string;
|
|
27
27
|
@Input() stylesMap: Map<string, string>;
|
|
28
28
|
@Input() supportMode: boolean;
|
|
29
|
+
@Input() isCopilotEnabled: boolean = false;
|
|
29
30
|
@Output() onBeforeMessageRender = new EventEmitter();
|
|
30
31
|
@Output() onAfterMessageRender = new EventEmitter();
|
|
31
32
|
@Output() onElementRendered = new EventEmitter<{element: string, status: boolean}>();
|
|
32
|
-
@Output()
|
|
33
|
+
@Output() onOptionsDataReturned = new EventEmitter<{option: string, message: MessageModel}>();
|
|
33
34
|
|
|
34
35
|
isImage = isImage;
|
|
35
36
|
isFile = isFile;
|
|
@@ -54,8 +55,7 @@ export class BubbleMessageComponent implements OnInit, OnChanges {
|
|
|
54
55
|
public sanitizer: DomSanitizer,
|
|
55
56
|
private translate: TranslateService,
|
|
56
57
|
public tiledeskAuthService: TiledeskAuthService,
|
|
57
|
-
public modalController: ModalController
|
|
58
|
-
private popoverController: PopoverController
|
|
58
|
+
public modalController: ModalController
|
|
59
59
|
) {
|
|
60
60
|
// console.log('BUBBLE-MSG Hello !!!!')
|
|
61
61
|
}
|
|
@@ -162,34 +162,9 @@ export class BubbleMessageComponent implements OnInit, OnChanges {
|
|
|
162
162
|
// this.logger.log('[BUBBLE-MESSAGE] - onClickOptionsMessage', message);
|
|
163
163
|
// this.presentPopover(event, message)
|
|
164
164
|
// }
|
|
165
|
-
|
|
166
|
-
this.
|
|
165
|
+
onOptionsDataReturnedFN(event){
|
|
166
|
+
this.onOptionsDataReturned.emit(event)
|
|
167
167
|
}
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
// async presentPopover(ev: any, message: MessageModel) {
|
|
171
|
-
// const attributes = {
|
|
172
|
-
// message: message,
|
|
173
|
-
// conversationWith: message.recipient
|
|
174
|
-
// }
|
|
175
|
-
// const popover = await this.popoverController.create({
|
|
176
|
-
// component: BubbleInfoPopoverComponent,
|
|
177
|
-
// cssClass: 'info-popover',
|
|
178
|
-
// componentProps: attributes,
|
|
179
|
-
// event: ev,
|
|
180
|
-
// translucent: true,
|
|
181
|
-
// keyboardClose: true,
|
|
182
|
-
// showBackdrop: false
|
|
183
|
-
// });
|
|
184
|
-
// popover.onDidDismiss().then((dataReturned: any) => {
|
|
185
|
-
// this.logger.log('[BUBBLE-MESSAGE] presentPopover dismissed. Returned value::', dataReturned.data)
|
|
186
|
-
// if(dataReturned.data){
|
|
187
|
-
// this.onOptionsMessage.emit({option: dataReturned.data.option, message: message})
|
|
188
|
-
// }
|
|
189
|
-
// })
|
|
190
|
-
|
|
191
|
-
// return await popover.present();
|
|
192
|
-
// }
|
|
193
168
|
// ========= begin:: event emitter function ============//
|
|
194
169
|
|
|
195
170
|
// returnOpenAttachment(event: String) {
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
<div class="options-container" >
|
|
2
|
-
<div class="options-logo" (click)="onClickOptionsMessage($event
|
|
2
|
+
<div class="options-logo" (click)="onClickOptionsMessage($event)" >
|
|
3
3
|
<ion-icon name="chevron-down"></ion-icon>
|
|
4
4
|
</div>
|
|
5
|
+
<div *ngIf="isCopilotEnabled" class="options-logo" (click)="onClickOptionsCopilot($event)">
|
|
6
|
+
<ion-icon id="copilot" src="assets/images/icons/copilot.svg"></ion-icon>
|
|
7
|
+
</div>
|
|
5
8
|
</div>
|
|
@@ -4,6 +4,7 @@ import { BubbleInfoPopoverComponent } from 'src/app/components/bubbleMessageInfo
|
|
|
4
4
|
import { MessageModel } from 'src/chat21-core/models/message';
|
|
5
5
|
import { LoggerService } from 'src/chat21-core/providers/abstract/logger.service';
|
|
6
6
|
import { LoggerInstance } from 'src/chat21-core/providers/logger/loggerInstance';
|
|
7
|
+
import { CopilotPopoverComponent } from 'src/app/components/copilot-popover/copilot-popover.component';
|
|
7
8
|
|
|
8
9
|
@Component({
|
|
9
10
|
selector: 'chat-options',
|
|
@@ -13,8 +14,9 @@ import { LoggerInstance } from 'src/chat21-core/providers/logger/loggerInstance'
|
|
|
13
14
|
export class OptionsComponent implements OnInit {
|
|
14
15
|
|
|
15
16
|
@Input() message: MessageModel;
|
|
17
|
+
@Input() isCopilotEnabled: boolean = false;
|
|
16
18
|
@Input() logLevel: number;
|
|
17
|
-
@Output()
|
|
19
|
+
@Output() onOptionsDataReturned = new EventEmitter<{option: string, data: any}>();
|
|
18
20
|
|
|
19
21
|
private logger: LoggerService = LoggerInstance.getInstance()
|
|
20
22
|
|
|
@@ -22,17 +24,23 @@ export class OptionsComponent implements OnInit {
|
|
|
22
24
|
|
|
23
25
|
ngOnInit() {}
|
|
24
26
|
|
|
25
|
-
onClickOptionsMessage(event
|
|
26
|
-
this.logger.log('[BUBBLE-MESSAGE] - onClickOptionsMessage', message);
|
|
27
|
-
this.presentPopover(event
|
|
27
|
+
onClickOptionsMessage(event){
|
|
28
|
+
this.logger.log('[BUBBLE-MESSAGE] - onClickOptionsMessage', this.message);
|
|
29
|
+
this.presentPopover(event)
|
|
28
30
|
}
|
|
31
|
+
|
|
32
|
+
onClickOptionsCopilot(event){
|
|
33
|
+
this.logger.log('[BUBBLE-MESSAGE] - onClickOptionsCopilot', this.message);
|
|
34
|
+
this.presentCopilotPopover(event)
|
|
35
|
+
}
|
|
36
|
+
|
|
29
37
|
|
|
30
38
|
|
|
31
|
-
async presentPopover(ev: any
|
|
39
|
+
async presentPopover(ev: any) {
|
|
32
40
|
const attributes = {
|
|
33
|
-
message: message,
|
|
41
|
+
message: this.message,
|
|
34
42
|
logLevel: this.logLevel,
|
|
35
|
-
conversationWith: message.recipient
|
|
43
|
+
conversationWith: this.message.recipient
|
|
36
44
|
}
|
|
37
45
|
const popover = await this.popoverController.create({
|
|
38
46
|
component: BubbleInfoPopoverComponent,
|
|
@@ -46,7 +54,32 @@ export class OptionsComponent implements OnInit {
|
|
|
46
54
|
popover.onDidDismiss().then((dataReturned: any) => {
|
|
47
55
|
this.logger.log('[BUBBLE-MESSAGE] presentPopover dismissed. Returned value::', dataReturned.data)
|
|
48
56
|
if(dataReturned.data){
|
|
49
|
-
this.
|
|
57
|
+
this.onOptionsDataReturned.emit({option: dataReturned.data.option, data: {message: this.message}})
|
|
58
|
+
}
|
|
59
|
+
})
|
|
60
|
+
|
|
61
|
+
return await popover.present();
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
async presentCopilotPopover(ev: any) {
|
|
65
|
+
const attributes = {
|
|
66
|
+
message: this.message,
|
|
67
|
+
logLevel: this.logLevel,
|
|
68
|
+
conversationWith: this.message.recipient
|
|
69
|
+
}
|
|
70
|
+
const popover = await this.popoverController.create({
|
|
71
|
+
component: CopilotPopoverComponent,
|
|
72
|
+
cssClass: 'copilot-popover',
|
|
73
|
+
componentProps: attributes,
|
|
74
|
+
event: ev,
|
|
75
|
+
translucent: true,
|
|
76
|
+
keyboardClose: true,
|
|
77
|
+
showBackdrop: false,
|
|
78
|
+
});
|
|
79
|
+
popover.onDidDismiss().then((dataReturned: any) => {
|
|
80
|
+
this.logger.log('[BUBBLE-MESSAGE] presentCopilotPopover dismissed. Returned value::', dataReturned.data)
|
|
81
|
+
if(dataReturned.data){
|
|
82
|
+
this.onOptionsDataReturned.emit({option: 'copilot_question', data: {text: dataReturned.data.text}})
|
|
50
83
|
}
|
|
51
84
|
})
|
|
52
85
|
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
</ion-item>
|
|
22
22
|
</div>
|
|
23
23
|
<!-- LOADER -->
|
|
24
|
-
<div class="loader" *ngIf="
|
|
24
|
+
<div class="loader" *ngIf="showLoading">
|
|
25
25
|
<div class="box">
|
|
26
26
|
<!-- <div class="container">
|
|
27
27
|
<span class="circle" [ngStyle]="{'background-color': stylesMap?.get('themeColor')}"></span>
|
|
@@ -33,7 +33,12 @@
|
|
|
33
33
|
<div class="label">{{translationMap.get('LABEL_LOADING')}}</div>
|
|
34
34
|
</div>
|
|
35
35
|
</div>
|
|
36
|
-
<div *ngIf="!
|
|
37
|
-
|
|
36
|
+
<div class="no-data" *ngIf="tagsCannedFilter.length === 0 && !showLoading">
|
|
37
|
+
<div class="container">
|
|
38
|
+
<ion-item button="false" lines="none" class="canned-item no-ripple border">
|
|
39
|
+
<ion-icon name="cloud-offline" slot="start"></ion-icon>
|
|
40
|
+
<ion-label>{{translationMap.get('THERE_ARE_NO_CANNED_RESPONSES_AVAILABLE')}}</ion-label>
|
|
41
|
+
</ion-item>
|
|
42
|
+
</div>
|
|
38
43
|
</div>
|
|
39
44
|
</div>
|
|
@@ -255,4 +255,30 @@ ion-item {
|
|
|
255
255
|
opacity: 0;
|
|
256
256
|
}
|
|
257
257
|
}
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
.no-data{
|
|
261
|
+
|
|
262
|
+
background-color: white !important;
|
|
263
|
+
width: 100%;
|
|
264
|
+
max-height: 310px;
|
|
265
|
+
overflow-y: auto;
|
|
266
|
+
// padding: 10px 0;
|
|
267
|
+
// margin: 0;
|
|
268
|
+
margin-bottom: 1px;
|
|
269
|
+
font-size: 14px;
|
|
270
|
+
line-height: 1.42857143;
|
|
271
|
+
color: #080f1a;
|
|
272
|
+
box-sizing: border-box;
|
|
273
|
+
-webkit-font-smoothing: antialiased;
|
|
274
|
+
// list-style: none;
|
|
275
|
+
z-index: 999999;
|
|
276
|
+
|
|
277
|
+
.container{
|
|
278
|
+
display: flex;
|
|
279
|
+
justify-content: center;
|
|
280
|
+
flex-direction: column;
|
|
281
|
+
align-items: center;
|
|
282
|
+
|
|
283
|
+
}
|
|
258
284
|
}
|
|
@@ -32,6 +32,7 @@ export class CannedResponseComponent implements OnInit {
|
|
|
32
32
|
|
|
33
33
|
public tagsCanned: any = []
|
|
34
34
|
public tagsCannedFilter: any = []
|
|
35
|
+
public showLoading: boolean = false
|
|
35
36
|
|
|
36
37
|
public arrowkeyLocation = -1
|
|
37
38
|
|
|
@@ -119,21 +120,24 @@ export class CannedResponseComponent implements OnInit {
|
|
|
119
120
|
}
|
|
120
121
|
|
|
121
122
|
getAndShowCannedResponses(strSearch, projectId) {
|
|
122
|
-
const tiledeskToken = this.tiledeskAuthService.getTiledeskToken()
|
|
123
123
|
this.logger.log('[CANNED] - loadTagsCanned tagsCanned.length', this.tagsCanned.length)
|
|
124
124
|
//if(this.tagsCanned.length <= 0 ){
|
|
125
125
|
this.tagsCanned = []
|
|
126
|
-
this.
|
|
126
|
+
this.showLoading = true;
|
|
127
|
+
this.cannedResponsesService.getAll(projectId).subscribe((res) => {
|
|
127
128
|
this.logger.log('[CANNED] - loadTagsCanned getCannedResponses RES', res)
|
|
128
129
|
|
|
129
130
|
this.tagsCanned = res
|
|
130
131
|
// if (this.HIDE_CANNED_RESPONSES === false) {
|
|
131
|
-
|
|
132
|
+
this.showTagsCanned(strSearch)
|
|
132
133
|
// }
|
|
133
134
|
}, (error) => {
|
|
134
135
|
this.logger.error('[CANNED] - loadTagsCanned getCannedResponses - ERROR ', error)
|
|
135
136
|
}, () => {
|
|
136
137
|
this.logger.log('[CANNED] - loadTagsCanned getCannedResponses * COMPLETE *')
|
|
138
|
+
setTimeout(() => {
|
|
139
|
+
this.showLoading = false
|
|
140
|
+
}, 1000);
|
|
137
141
|
})
|
|
138
142
|
}
|
|
139
143
|
|
|
@@ -163,33 +167,9 @@ export class CannedResponseComponent implements OnInit {
|
|
|
163
167
|
canned.text = this.replacePlaceholderInCanned(canned.text);
|
|
164
168
|
canned.disabled = true
|
|
165
169
|
});
|
|
166
|
-
if (this.tagsCannedFilter && this.tagsCannedFilter.length === 0) {
|
|
167
|
-
// const button = this.renderer.createElement('button');
|
|
168
|
-
// const buttonText = this.renderer.createText('Click me');
|
|
169
|
-
// this.renderer.appendChild(button, buttonText);
|
|
170
|
-
// console.log('[CANNED] - this.el.nativeElement ', this.el.nativeElement)
|
|
171
|
-
// this.renderer.listen(button, 'click', () => { alert('hi'); });
|
|
172
|
-
// let nocanned = {}
|
|
173
|
-
// if (this.USER_ROLE !== 'agent') {
|
|
174
|
-
const nocanned = {
|
|
175
|
-
// "<div class='cannedContent'><div class='cannedTitle nocannedTitle #noCannedTitle'>" + this.translationMap.get('THERE_ARE_NO_CANNED_RESPONSES_AVAILABLE') + ".</div><div class='cannedText'>" + this.translationMap.get('TO_CREATE_THEM_GO_TO_THE_PROJECT') + '</div></div>'
|
|
176
|
-
// <div class='cannedText no-canned-available-text'>" + this.translationMap.get('AddNewCannedResponse') + '</div>
|
|
177
|
-
title: this.translationMap.get('THERE_ARE_NO_CANNED_RESPONSES_AVAILABLE') ,
|
|
178
|
-
text: '',
|
|
179
|
-
disabled: true
|
|
180
|
-
}
|
|
181
|
-
// } else if (this.USER_ROLE === 'agent') {
|
|
182
|
-
// nocanned = {
|
|
183
|
-
// // "<div class='cannedContent'><div class='cannedTitle nocannedTitle #noCannedTitle'>" + this.translationMap.get('THERE_ARE_NO_CANNED_RESPONSES_AVAILABLE') + ".</div><div class='cannedText'>" + this.translationMap.get('TO_CREATE_THEM_GO_TO_THE_PROJECT') + '</div></div>'
|
|
184
|
-
// title:
|
|
185
|
-
// "<div class='cannedContent'><div class='cannedTitle nocannedTitle #noCannedTitle'>" + this.translationMap.get('THERE_ARE_NO_CANNED_RESPONSES_AVAILABLE') + ".</div></div>",
|
|
186
|
-
// text: 'There are no canned responses available',
|
|
187
|
-
// }
|
|
188
|
-
// }
|
|
189
|
-
this.tagsCannedFilter.push(nocanned)
|
|
190
|
-
}
|
|
191
170
|
this.appStorageService.setItem(this.projectID+'_canned', JSON.stringify(this.tagsCannedFilter))
|
|
192
171
|
this.onLoadedCannedResponses.emit(this.tagsCannedFilter)
|
|
172
|
+
|
|
193
173
|
}
|
|
194
174
|
|
|
195
175
|
filterItems(items, searchTerm) {
|
package/src/app/components/conversation-detail/message-text-area/message-text-area.component.html
CHANGED
|
@@ -28,10 +28,10 @@
|
|
|
28
28
|
</div>
|
|
29
29
|
</div>
|
|
30
30
|
|
|
31
|
-
<div>
|
|
31
|
+
<div *ngIf="isCopilotEnabled">
|
|
32
32
|
<!-- COPILOT-OPTION -->
|
|
33
33
|
<div class="section-option" id="copilot" tooltip="{{translationMap?.get('COPILOT.ASK_AI')}}" placement="top">
|
|
34
|
-
<ion-button fill="clear" [class.active]="section ==='copilot'" (click)="onOpenSection('copilot')">
|
|
34
|
+
<ion-button id="copilot" fill="clear" [class.active]="section ==='copilot'" (click)="onOpenSection('copilot')">
|
|
35
35
|
<ion-icon class="channel-icon" src="assets/images/icons/copilot.svg"></ion-icon>
|
|
36
36
|
{{translationMap?.get('COPILOT.ASK_AI')}}
|
|
37
37
|
</ion-button>
|
|
@@ -55,8 +55,7 @@
|
|
|
55
55
|
|
|
56
56
|
<!-- CANNED RESPONSES -->
|
|
57
57
|
<ng-container *ngIf="areVisibleCAR && supportMode">
|
|
58
|
-
<div class="canned-responses-btn-wpr"
|
|
59
|
-
tooltip="{{translationMap?.get('CANNED_RESPONSES')}}" placement="top">
|
|
58
|
+
<div class="canned-responses-btn-wpr" tooltip="{{translationMap?.get('CANNED_RESPONSES')}}" placement="top">
|
|
60
59
|
<ion-button ion-button fill="clear" class="canned-responses-btn" (click)="openCannedResponses()"
|
|
61
60
|
[disabled]="!conversationWith?.startsWith(CHANNEL_TYPE.SUPPORT_GROUP) || disableTextarea">
|
|
62
61
|
<ion-icon slot="icon-only" name="flash-outline" style="font-size: 24px;"></ion-icon>
|
package/src/app/components/conversation-detail/message-text-area/message-text-area.component.ts
CHANGED
|
@@ -52,6 +52,7 @@ export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChange
|
|
|
52
52
|
@Input() channel: string;
|
|
53
53
|
@Input() tagsCannedFilter: any;
|
|
54
54
|
@Input() areVisibleCAR: boolean;
|
|
55
|
+
@Input() isCopilotEnabled: boolean = false;
|
|
55
56
|
@Input() supportMode: boolean;
|
|
56
57
|
@Input() leadInfo: {lead_id: string, hasEmail: boolean, email: string, projectId: string, presence: {}};
|
|
57
58
|
@Input() fileUploadAccept: string;
|
|
@@ -225,17 +225,15 @@ export class InfoContentComponent implements OnInit {
|
|
|
225
225
|
|
|
226
226
|
this.member = null;
|
|
227
227
|
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
.
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
this.logger.log('I[INFO-CONTENT-COMP] - setInfoDirect loadContactDetail * COMPLETE *');
|
|
238
|
-
});
|
|
228
|
+
this.contactsService.loadContactDetail(this.conversationWith).subscribe(res => {
|
|
229
|
+
this.logger.log('[INFO-CONTENT-COMP] - setInfoDirect loadContactDetail RES', res);
|
|
230
|
+
this.member = res
|
|
231
|
+
this.logger.log('[INFO-CONTENT-COMP] - setInfoDirect member', this.member);
|
|
232
|
+
}, (error) => {
|
|
233
|
+
this.logger.error('[INFO-CONTENT-COMP] - setInfoDirect loadContactDetail - ERROR ', error);
|
|
234
|
+
}, () => {
|
|
235
|
+
this.logger.log('I[INFO-CONTENT-COMP] - setInfoDirect loadContactDetail * COMPLETE *');
|
|
236
|
+
});
|
|
239
237
|
}
|
|
240
238
|
|
|
241
239
|
// ---------------------------------------------------
|
|
@@ -38,7 +38,6 @@ export class InfoGroupComponent implements OnInit, AfterViewInit, OnChanges {
|
|
|
38
38
|
constructor(
|
|
39
39
|
public imageRepoService: ImageRepoService,
|
|
40
40
|
public presenceService: PresenceService,
|
|
41
|
-
public tiledeskAuthService: TiledeskAuthService,
|
|
42
41
|
public contactsService: ContactsService,
|
|
43
42
|
public renderer: Renderer2,
|
|
44
43
|
private router: Router,
|
|
@@ -56,10 +55,7 @@ export class InfoGroupComponent implements OnInit, AfterViewInit, OnChanges {
|
|
|
56
55
|
// const currentUrl = this.router.url;
|
|
57
56
|
// this.logger.log('InfoGroupComponent current_url ', currentUrl);
|
|
58
57
|
// .pipe(takeUntil(this.unsubscribe$))
|
|
59
|
-
router.events
|
|
60
|
-
.pipe(filter(event => event instanceof NavigationEnd))
|
|
61
|
-
|
|
62
|
-
.subscribe((event: NavigationEnd) => {
|
|
58
|
+
router.events.pipe(filter(event => event instanceof NavigationEnd)).subscribe((event: NavigationEnd) => {
|
|
63
59
|
// console.log('InfoGroupComponent - router.events prev url :', event.url);
|
|
64
60
|
this.previousUrl = event.url;
|
|
65
61
|
|
|
@@ -122,8 +118,6 @@ export class InfoGroupComponent implements OnInit, AfterViewInit, OnChanges {
|
|
|
122
118
|
|
|
123
119
|
if (this.groupDetail) {
|
|
124
120
|
if (this.groupDetail.uid.startsWith('group-')) {
|
|
125
|
-
const tiledeskToken = this.tiledeskAuthService.getTiledeskToken();
|
|
126
|
-
|
|
127
121
|
this.member_array = []
|
|
128
122
|
const members_isonline_array = []
|
|
129
123
|
|
|
@@ -156,9 +150,7 @@ export class InfoGroupComponent implements OnInit, AfterViewInit, OnChanges {
|
|
|
156
150
|
|
|
157
151
|
});
|
|
158
152
|
|
|
159
|
-
this.contactsService.loadContactDetail(
|
|
160
|
-
.pipe(takeUntil(this.unsubscribe$))
|
|
161
|
-
.subscribe(user => {
|
|
153
|
+
this.contactsService.loadContactDetail(key).pipe(takeUntil(this.unsubscribe$)).subscribe(user => {
|
|
162
154
|
this.logger.log('InfoGroupComponent group detail loadContactDetail RES', user);
|
|
163
155
|
// this.logger.log('InfoGroupComponent group detail this.presenceService.BSIsOnline.value()', this.presenceService.BSIsOnline.getValue);
|
|
164
156
|
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<div id="copilot-container">
|
|
2
|
+
<ion-header class="ion-no-border">
|
|
3
|
+
<ion-label class="main-title">{{translationsMap.get('HELLO')}}<span *ngIf="loggedUser?.firstname">, {{loggedUser?.firstname}}</span></ion-label>
|
|
4
|
+
<ion-label class="title">{{translationsMap.get('COPILOT.HOW_CAN_I_HELP_YOU')}}</ion-label>
|
|
5
|
+
</ion-header>
|
|
6
|
+
<ion-content>
|
|
7
|
+
<div class="content-container">
|
|
8
|
+
<div class="text-message">
|
|
9
|
+
<ion-textarea
|
|
10
|
+
[placeholder]="translationsMap.get('COPILOT.ASK_ME_SOMETHING')"
|
|
11
|
+
[(ngModel)]="text"
|
|
12
|
+
(ionChange)="ionChange($event);"
|
|
13
|
+
(ionFocus)="ionFocus()"
|
|
14
|
+
(keydown.enter)="onKeydown($event, messageString)">
|
|
15
|
+
</ion-textarea>
|
|
16
|
+
</div>
|
|
17
|
+
</div>
|
|
18
|
+
</ion-content>
|
|
19
|
+
<ion-footer class="ion-no-border">
|
|
20
|
+
<ion-button fill="clear" (click)="onClickCopilot()">
|
|
21
|
+
<ion-icon src="assets/images/icons/copilot.svg"></ion-icon>
|
|
22
|
+
{{translationsMap.get('COPILOT.ASK_AI') }}
|
|
23
|
+
</ion-button>
|
|
24
|
+
</ion-footer>
|
|
25
|
+
</div>
|