@chat21/chat21-web-widget 5.0.52-rc.3 → 5.0.52
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 +5 -0
- package/dist/assets/twp/chatbot-panel.html +4 -65
- package/dist/main.js +1 -1
- package/package.json +1 -1
- package/src/app/app.component.ts +2 -12
- package/src/app/component/conversation-detail/conversation/conversation.component.ts +0 -30
- package/src/app/component/conversation-detail/conversation-content/conversation-content.component.ts +0 -1
- package/src/app/component/conversation-detail/conversation-footer/conversation-footer.component.ts +0 -2
- package/src/app/component/conversation-detail/conversation-preview/conversation-preview.component.ts +0 -1
- package/src/app/component/eyeeye-catcher-card/eyeeye-catcher-card.component.ts +1 -2
- package/src/app/component/form/prechat-form/prechat-form.component.ts +0 -12
- package/src/app/component/home-conversations/home-conversations.component.ts +12 -72
- package/src/app/component/list-conversations/list-conversations.component.ts +1 -57
- package/src/app/component/message/avatar/avatar.component.ts +0 -1
- package/src/app/component/message/bubble-message/bubble-message.component.ts +0 -2
- package/src/app/component/message/image/image.component.ts +0 -1
- package/src/app/providers/global-settings.service.ts +0 -1
- package/src/app/providers/translator.service.ts +0 -2
- package/src/app/utils/globals.ts +1 -7
- package/src/assets/twp/chatbot-panel.html +4 -65
- package/src/chat21-core/providers/firebase/firebase-archivedconversations-handler.ts +0 -41
- package/src/chat21-core/providers/firebase/firebase-conversation-handler.ts +0 -4
- package/src/chat21-core/providers/firebase/firebase-image-repo.ts +0 -2
- package/src/chat21-core/providers/firebase/firebase-notifications.ts +1 -75
- package/src/chat21-core/providers/mqtt/chat-service.ts +1 -3
- package/src/chat21-core/providers/mqtt/mqtt-archivedconversations-handler.ts +0 -1
- package/src/chat21-core/providers/mqtt/mqtt-conversations-handler.ts +2 -1
- package/src/chat21-core/providers/mqtt/mqtt-notifications.ts +0 -2
- package/src/chat21-core/providers/mqtt/mqtt-presence.service.ts +0 -13
package/package.json
CHANGED
package/src/app/app.component.ts
CHANGED
|
@@ -945,23 +945,13 @@ export class AppComponent implements OnInit, AfterViewInit, OnDestroy {
|
|
|
945
945
|
if(error){
|
|
946
946
|
this.logger.error("[APP-COMP] getConverationRESTApi: ERORR while retriving data", error)
|
|
947
947
|
}
|
|
948
|
+
|
|
948
949
|
if(conv){
|
|
949
950
|
//start widget from this conversation
|
|
950
951
|
const recipientId : string = conv.uid
|
|
951
952
|
this.g.setParameter('recipientId', recipientId);
|
|
952
953
|
this.appStorageService.setItem('recipientId', recipientId)
|
|
953
|
-
|
|
954
|
-
// if (this.g.isOpen === true) {
|
|
955
|
-
// console.log('conversation from rest API go to conversationdetail -->', recipientId)
|
|
956
|
-
// this.isOpenHome = false;
|
|
957
|
-
// this.isOpenConversation = true;
|
|
958
|
-
// this.isOpenSelectionDepartment = false;
|
|
959
|
-
// this.isConversationArchived = false;
|
|
960
|
-
// this.triggerOnOpenEvent();
|
|
961
|
-
// } else {
|
|
962
|
-
// this.triggerOnCloseEvent();
|
|
963
|
-
// }
|
|
964
|
-
}else {
|
|
954
|
+
} else {
|
|
965
955
|
//start widget with NEW CONVERSATION
|
|
966
956
|
this.logger.debug("[APP-COMP] getConverationRESTApi: NO active conversations")
|
|
967
957
|
// this.isOpenHome = false;
|
|
@@ -929,7 +929,6 @@ export class ConversationComponent implements OnInit, AfterViewInit, OnChanges {
|
|
|
929
929
|
// try {
|
|
930
930
|
// that.isScrolling = true;
|
|
931
931
|
// const objDiv = document.getElementById(that.idDivScroll) as HTMLElement;
|
|
932
|
-
// console.log('divto scrool', objDiv);
|
|
933
932
|
// // const element = objDiv[0] as HTMLElement;
|
|
934
933
|
// setTimeout(function () {
|
|
935
934
|
|
|
@@ -1180,34 +1179,6 @@ export class ConversationComponent implements OnInit, AfterViewInit, OnChanges {
|
|
|
1180
1179
|
}
|
|
1181
1180
|
// ========= end:: DESTROY ALL SUBSCRIPTIONS ============//
|
|
1182
1181
|
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
/**
|
|
1186
|
-
* regola sound message:
|
|
1187
|
-
* se lo invio io -> NO SOUND
|
|
1188
|
-
* se non sono nella conversazione -> SOUND
|
|
1189
|
-
* se sono nella conversazione in fondo alla pagina -> NO SOUND
|
|
1190
|
-
* altrimenti -> SOUND
|
|
1191
|
-
*/
|
|
1192
|
-
// soundMessage(timestamp?) {
|
|
1193
|
-
// if (!isJustRecived(this.g.startedAt.getTime(), timestamp)) {
|
|
1194
|
-
// return;
|
|
1195
|
-
// }
|
|
1196
|
-
// const soundEnabled = this.g.soundEnabled;
|
|
1197
|
-
// const baseLocation = this.g.baseLocation;
|
|
1198
|
-
// if ( soundEnabled ) {
|
|
1199
|
-
// const that = this;
|
|
1200
|
-
// this.audio = new Audio();
|
|
1201
|
-
// this.audio.src = baseLocation + '/assets/sounds/justsaying.mp3';
|
|
1202
|
-
// this.audio.load();
|
|
1203
|
-
// // console.log('conversation play');
|
|
1204
|
-
// clearTimeout(this.setTimeoutSound);
|
|
1205
|
-
// this.setTimeoutSound = setTimeout(function () {
|
|
1206
|
-
// that.audio.play();
|
|
1207
|
-
// that.logger.debug('[CONV-COMP] ****** soundMessage 1 *****', that.audio.src);
|
|
1208
|
-
// }, 1000);
|
|
1209
|
-
// }
|
|
1210
|
-
// }
|
|
1211
1182
|
private onIncreaseWith(){
|
|
1212
1183
|
try{
|
|
1213
1184
|
const tiledeskDiv = this.g.windowContext.window.document.getElementById('tiledeskdiv')
|
|
@@ -1253,7 +1224,6 @@ export class ConversationComponent implements OnInit, AfterViewInit, OnChanges {
|
|
|
1253
1224
|
|
|
1254
1225
|
/** */
|
|
1255
1226
|
private actionButton(event: any) {
|
|
1256
|
-
// console.log(event);
|
|
1257
1227
|
const action = event.action ? event.action : '';
|
|
1258
1228
|
const message = event.value ? event.value : '';
|
|
1259
1229
|
const subtype = event.show_echo ? '' : 'info';
|
package/src/app/component/conversation-detail/conversation-content/conversation-content.component.ts
CHANGED
|
@@ -148,7 +148,6 @@ export class ConversationContentComponent implements OnInit {
|
|
|
148
148
|
|
|
149
149
|
// LISTEN TO SCROLL POSITION
|
|
150
150
|
onScroll(event): void {
|
|
151
|
-
// console.log('************** SCROLLLLLLLLLL *****************');
|
|
152
151
|
this.startScroll = false;
|
|
153
152
|
if (this.scrollMe) {
|
|
154
153
|
const divScrollMe = this.scrollMe.nativeElement;
|
package/src/app/component/conversation-detail/conversation-footer/conversation-footer.component.ts
CHANGED
|
@@ -355,7 +355,6 @@ export class ConversationFooterComponent implements OnInit, OnChanges {
|
|
|
355
355
|
const target = document.getElementById('chat21-main-message-context') as HTMLInputElement;
|
|
356
356
|
target.value = '';
|
|
357
357
|
target.style.height = this.HEIGHT_DEFAULT;
|
|
358
|
-
// console.log('target.style.height: ', target.style.height);
|
|
359
358
|
} catch (e) {
|
|
360
359
|
this.logger.error('[CONV-FOOTER] > Error :' + e);
|
|
361
360
|
}
|
|
@@ -511,7 +510,6 @@ export class ConversationFooterComponent implements OnInit, OnChanges {
|
|
|
511
510
|
*/
|
|
512
511
|
onkeypress(event) {
|
|
513
512
|
const keyCode = event.which || event.keyCode;
|
|
514
|
-
// console.log('keycode', keyCode)
|
|
515
513
|
this.textInputTextArea = ((document.getElementById('chat21-main-message-context') as HTMLInputElement).value);
|
|
516
514
|
if (keyCode === 13) { // ENTER pressed
|
|
517
515
|
if (this.textInputTextArea && this.textInputTextArea.trim() !== '') {
|
|
@@ -77,7 +77,7 @@ export class EyeeyeCatcherCardComponent implements OnInit {
|
|
|
77
77
|
this.checkIsEmoji();
|
|
78
78
|
const isOpen = this.g.isOpen;
|
|
79
79
|
this.logger.debug('[EYEEYE-CATCHER-CARD] openEyeCatcher: calloutStaus ---------> ', this.g.calloutStaus);
|
|
80
|
-
|
|
80
|
+
|
|
81
81
|
if (isOpen === false && this.g.calloutStaus) { // && this.g.isMobile === false
|
|
82
82
|
this.onCloseEyeCatcherCard.emit(true);
|
|
83
83
|
// this.g.displayEyeCatcherCard = 'block';
|
|
@@ -104,7 +104,6 @@ export class EyeeyeCatcherCardComponent implements OnInit {
|
|
|
104
104
|
while (match = regex.exec(title)) {
|
|
105
105
|
const emoji = match[0];
|
|
106
106
|
this.logger.debug('[EYEEYE-CATCHER-CARD]--> match', match)
|
|
107
|
-
// console.log(`Matched sequence ${ emoji } — code points: ${ [...emoji].length }`);
|
|
108
107
|
if (title.indexOf(emoji) === 0) {
|
|
109
108
|
this.title = title.replace(emoji, '');
|
|
110
109
|
this.emoticon = emoji;
|
|
@@ -92,10 +92,8 @@ export class PrechatFormComponent implements OnInit, AfterViewInit {
|
|
|
92
92
|
if (this.g.attributes) {
|
|
93
93
|
const attributes = this.g.attributes;
|
|
94
94
|
if ( this.privacyInputField && this.privacyInputField.nativeElement.checked === false) {
|
|
95
|
-
// console.log(this.privacyInputField.nativeElement.checked);
|
|
96
95
|
this.g.privacyApproved = false;
|
|
97
96
|
const spanCheck = window.document.getElementById('span-checkmark');
|
|
98
|
-
// console.log('-----------> ', spanCheck);
|
|
99
97
|
if (spanCheck) {
|
|
100
98
|
spanCheck.classList.add('unchecked');
|
|
101
99
|
}
|
|
@@ -118,16 +116,6 @@ export class PrechatFormComponent implements OnInit, AfterViewInit {
|
|
|
118
116
|
}
|
|
119
117
|
}
|
|
120
118
|
|
|
121
|
-
|
|
122
|
-
/** */
|
|
123
|
-
// checkInput() {
|
|
124
|
-
// const spanCheck = window.document.getElementById('span-checkmark');
|
|
125
|
-
// // console.log('-----------> ', spanCheck);
|
|
126
|
-
// if (spanCheck) {
|
|
127
|
-
// spanCheck.classList.remove('unchecked');
|
|
128
|
-
// }
|
|
129
|
-
// }
|
|
130
|
-
|
|
131
119
|
returnClosePage() {
|
|
132
120
|
this.onClosePage.emit();
|
|
133
121
|
}
|
|
@@ -86,7 +86,6 @@ export class HomeConversationsComponent implements OnInit, OnDestroy {
|
|
|
86
86
|
public translatorService: TranslatorService,
|
|
87
87
|
private customTranslateService: CustomTranslateService,
|
|
88
88
|
) {
|
|
89
|
-
// console.log(this.langService);
|
|
90
89
|
// https://www.npmjs.com/package/humanize-duration-ts
|
|
91
90
|
// https://github.com/Nightapes/HumanizeDuration.ts/blob/master/src/humanize-duration.ts
|
|
92
91
|
this.humanizer = new HumanizeDuration(this.langService);
|
|
@@ -165,89 +164,30 @@ export class HomeConversationsComponent implements OnInit, OnDestroy {
|
|
|
165
164
|
|
|
166
165
|
that.waitingTime = wt;
|
|
167
166
|
that.logger.debug('[HOMECONVERSATIONS] that.waitingTime', that.waitingTime);
|
|
168
|
-
// console.log('that.waitingTime', that.waitingTime);
|
|
169
167
|
|
|
170
168
|
const lang = that.translatorService.getLanguage();
|
|
171
169
|
that.humanWaitingTime = this.humanizer.humanize(wt, {language: lang});
|
|
172
|
-
|
|
173
|
-
// console.log('LIST CONVERSATION g.WAITING_TIME_FOUND ', this.g.WAITING_TIME_FOUND)
|
|
174
|
-
// console.log('LIST CONVERSATION g.WAITING_TIME_FOUND contains $reply_time', this.g.WAITING_TIME_FOUND.includes("$reply_time") )
|
|
175
|
-
|
|
170
|
+
|
|
176
171
|
// REPLACE
|
|
177
172
|
if (this.g.WAITING_TIME_FOUND.includes("$reply_time")) {
|
|
178
173
|
// REPLACE if exist
|
|
179
174
|
this.WAITING_TIME_FOUND_WITH_REPLYTIME_PLACEHOLDER = this.g.WAITING_TIME_FOUND.replace("$reply_time", that.humanWaitingTime);
|
|
180
175
|
}
|
|
181
|
-
// console.log('LIST CONVERSATION WAITING_TIME_FOUND_WITH_REPLYTIME_PLACEHOLDER', this.WAITING_TIME_FOUND_WITH_REPLYTIME_PLACEHOLDER)
|
|
182
|
-
// console.log('LIST CONVERSATION g.dynamicWaitTimeReply ', this.g.dynamicWaitTimeReply )
|
|
183
|
-
// console.log('LIST CONVERSATION typeof g.dynamicWaitTimeReply ', typeof this.g.dynamicWaitTimeReply )
|
|
184
|
-
|
|
185
|
-
// console.log('xxx', this.humanizer.humanize(wt));
|
|
186
|
-
// 'The team typically replies in ' + moment.duration(response[0].waiting_time_avg).format();
|
|
187
176
|
}
|
|
188
|
-
|
|
189
|
-
// that.waitingTimeMessage = 'waiting_time_not_found';
|
|
190
|
-
// // that.waitingTimeMessage = 'Will reply as soon as they can';
|
|
191
|
-
// }
|
|
177
|
+
|
|
192
178
|
});
|
|
193
179
|
}
|
|
194
180
|
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
checkShowAllConversation() {
|
|
198
|
-
if (this.archivedConversations && this.archivedConversations.length > 0) {
|
|
199
|
-
return true;
|
|
200
|
-
} else if (this.listConversations && this.listConversations.length > 0) {
|
|
201
|
-
return true;
|
|
202
181
|
}
|
|
203
|
-
return false;
|
|
204
|
-
}
|
|
205
|
-
// msToTime(duration) {
|
|
206
|
-
// let milliseconds = parseInt((duration % 1000) / 100),
|
|
207
|
-
// seconds = parseInt((duration / 1000) % 60),
|
|
208
|
-
// minutes = parseInt((duration / (1000 * 60)) % 60),
|
|
209
|
-
// hours = parseInt((duration / (1000 * 60 * 60)) % 24);
|
|
210
|
-
|
|
211
|
-
// hours = (hours < 10) ? "0" + hours : hours;
|
|
212
|
-
// minutes = (minutes < 10) ? "0" + minutes : minutes;
|
|
213
|
-
// seconds = (seconds < 10) ? "0" + seconds : seconds;
|
|
214
|
-
|
|
215
|
-
// return hours + ":" + minutes + ":" + seconds + "." + milliseconds;
|
|
216
|
-
// }
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
// dhm(t) {
|
|
220
|
-
// let cd = 24 * 60 * 60 * 1000,
|
|
221
|
-
// ch = 60 * 60 * 1000,
|
|
222
|
-
// d = Math.floor(t / cd),
|
|
223
|
-
// h = Math.floor( (t - d * cd) / ch),
|
|
224
|
-
// m = Math.round( (t - d * cd - h * ch) / 60000),
|
|
225
|
-
// pad = function(n){ return n < 10 ? '0' + n : n; };
|
|
226
|
-
// if ( m === 60 ) {
|
|
227
|
-
// h++;
|
|
228
|
-
// m = 0;
|
|
229
|
-
// }
|
|
230
|
-
// if ( h === 24 ) {
|
|
231
|
-
// d++;
|
|
232
|
-
// h = 0;
|
|
233
|
-
// }
|
|
234
|
-
// return [d, pad(h), pad(m)].join(':');
|
|
235
|
-
// }
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
// setImageProfile(agent) {
|
|
239
|
-
// //console.log(agent);
|
|
240
|
-
// this.contactService.setImageProfile(agent)
|
|
241
|
-
// .then(function (snapshot) {
|
|
242
|
-
// if (snapshot.val().trim()) {
|
|
243
|
-
// agent.image = snapshot.val();
|
|
244
|
-
// }
|
|
245
|
-
// })
|
|
246
|
-
// .catch(function (err) {
|
|
247
|
-
// console.log(err);
|
|
248
|
-
// });
|
|
249
|
-
// }
|
|
250
182
|
|
|
183
|
+
checkShowAllConversation() {
|
|
184
|
+
if (this.archivedConversations && this.archivedConversations.length > 0) {
|
|
185
|
+
return true;
|
|
186
|
+
} else if (this.listConversations && this.listConversations.length > 0) {
|
|
187
|
+
return true;
|
|
188
|
+
}
|
|
189
|
+
return false;
|
|
190
|
+
}
|
|
251
191
|
|
|
252
192
|
|
|
253
193
|
// ========= begin:: ACTIONS ============//
|
|
@@ -284,8 +224,8 @@ checkShowAllConversation() {
|
|
|
284
224
|
this.unsubscribe();
|
|
285
225
|
}
|
|
286
226
|
|
|
287
|
-
|
|
288
|
-
|
|
227
|
+
/** */
|
|
228
|
+
unsubscribe() {
|
|
289
229
|
this.subscriptions.forEach(function (subscription) {
|
|
290
230
|
subscription.unsubscribe();
|
|
291
231
|
});
|
|
@@ -45,22 +45,10 @@ export class ListConversationsComponent implements OnInit {
|
|
|
45
45
|
|
|
46
46
|
ngOnInit() {
|
|
47
47
|
this.logger.debug('[LISTCONVERSATIONS] ngOnInit', this.listConversations);
|
|
48
|
-
// console.log('empDifferMap::' + JSON.stringify(this.listConversations))
|
|
49
|
-
// this.listConversations.forEach(emp => {
|
|
50
|
-
// this.empDifferMap[emp.uid] = this.kvDiffers.find(emp).create();
|
|
51
|
-
// this.empMap[emp.uid] = emp;
|
|
52
|
-
// console.log('empDifferMap::', this.empDifferMap, this.empMap)
|
|
53
|
-
// })
|
|
54
48
|
}
|
|
55
49
|
|
|
56
50
|
ngOnChanges(changes: SimpleChanges){
|
|
57
|
-
|
|
58
|
-
// console.log('empDifferMap:: 1111', this.listConversations)
|
|
59
|
-
// this.listConversations.forEach(emp => {
|
|
60
|
-
// this.empDifferMap[emp.uid] = this.kvDiffers.find(emp).create();
|
|
61
|
-
// this.empMap[emp.uid] = emp;
|
|
62
|
-
// console.log('empDifferMap::', this.empDifferMap, this.empMap)
|
|
63
|
-
// })
|
|
51
|
+
|
|
64
52
|
}
|
|
65
53
|
|
|
66
54
|
public openConversationByID(conversation) {
|
|
@@ -79,51 +67,7 @@ export class ListConversationsComponent implements OnInit {
|
|
|
79
67
|
|
|
80
68
|
ngDoCheck() {
|
|
81
69
|
let changesListConversation = this.iterableDifferListConv.diff(this.listConversations);
|
|
82
|
-
if(changesListConversation){
|
|
83
|
-
// changesListConversation.forEachAddedItem(element => {
|
|
84
|
-
// let conv = element.item
|
|
85
|
-
// this.onImageLoaded.emit(conv)
|
|
86
|
-
// this.onConversationLoaded.emit(conv)
|
|
87
|
-
// });
|
|
88
|
-
// changesListConversation.forEachRemovedItem(element => {
|
|
89
|
-
// });
|
|
90
|
-
// changesListConversation.forEachOperation((element: IterableChangeRecord<ConversationModel>, adjustedPreviousIndex: number, currentIndex: number) => {
|
|
91
|
-
// // if (item.previousIndex == null) {
|
|
92
|
-
// // console.log('itemmmm 1111', item, adjustedPreviousIndex)
|
|
93
|
-
// // } else if (currentIndex == null) {
|
|
94
|
-
// // console.log('itemmmm 2222', item, adjustedPreviousIndex)
|
|
95
|
-
// // } else {
|
|
96
|
-
// // console.log('itemmmm 3333', item, adjustedPreviousIndex)
|
|
97
|
-
// // }
|
|
98
|
-
// if(element.currentIndex == null || element.previousIndex == null){
|
|
99
|
-
// console.log('itemmmm 44444', element, adjustedPreviousIndex, currentIndex)
|
|
100
|
-
// let conv = element.item
|
|
101
|
-
// this.onImageLoaded.emit(conv)
|
|
102
|
-
// this.onConversationLoaded.emit(conv)
|
|
103
|
-
// }
|
|
104
|
-
// });
|
|
105
|
-
// changesListConversation.forEachItem((item: IterableChangeRecord<ConversationModel>)=> {
|
|
106
|
-
// console.log('itemmmm forEachItem', item)
|
|
107
|
-
// });
|
|
108
|
-
|
|
109
|
-
}
|
|
110
|
-
|
|
111
70
|
|
|
112
|
-
//Detect changes in object inside array
|
|
113
|
-
// for (let [key, empDiffer] of this.objDiffers) {
|
|
114
|
-
// let empChanges = empDiffer.diff(this.differ.get(key));
|
|
115
|
-
// if (empChanges) {
|
|
116
|
-
// empChanges.forEachChangedItem(record => {
|
|
117
|
-
// console.log('--- Employee with id ' + key + ' updated ---');
|
|
118
|
-
// // this.changeLogs.push('--- Employee with id ' + key + ' updated ---');
|
|
119
|
-
// console.log('Previous value: ' + record.previousValue);
|
|
120
|
-
// // this.changeLogs.push('Previous value: ' + record.previousValue);
|
|
121
|
-
// console.log('Current value: ' + record.currentValue);
|
|
122
|
-
// // this.changeLogs.push('Current value: ' + record.currentValue);
|
|
123
|
-
// });
|
|
124
|
-
// }
|
|
125
|
-
// }
|
|
126
|
-
|
|
127
71
|
}
|
|
128
72
|
|
|
129
73
|
|
|
@@ -23,7 +23,6 @@ export class AvatarComponent implements OnInit {
|
|
|
23
23
|
let url = this.imageRepoService.getImagePhotoUrl(this.senderID)
|
|
24
24
|
// this.imageRepoService.checkImageExists(url, (existImage)=> {
|
|
25
25
|
// existImage? this.url = url: null;
|
|
26
|
-
// console.log('existttttt', existImage)
|
|
27
26
|
// })
|
|
28
27
|
this.checkImageExists(url, (existImage)=> {
|
|
29
28
|
existImage? this.url = url: null;
|
|
@@ -54,10 +54,8 @@ export class BubbleMessageComponent implements OnInit {
|
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
ngOnChanges() {
|
|
57
|
-
// console.log('BUBBLE-MSG Hello !!!! this.message ', this.message)
|
|
58
57
|
if (this.message && this.message.metadata && typeof this.message.metadata === 'object' ) {
|
|
59
58
|
this.sizeImage = this.getMetadataSize(this.message.metadata)
|
|
60
|
-
// console.log('BUBBLE-MSG ngOnChanges message > metadata', this.message.metadata)
|
|
61
59
|
}
|
|
62
60
|
|
|
63
61
|
}
|
|
@@ -44,7 +44,6 @@ export class ImageComponent implements OnInit {
|
|
|
44
44
|
console.log('Image COMP - IMAGE FILENAME ', fileName)
|
|
45
45
|
fileName? null: fileName = decodeURIComponent(decodeURIComponent(url).split('/').pop())
|
|
46
46
|
// const a: any = document.createElement('a');
|
|
47
|
-
// console.log('ellll', this.el)
|
|
48
47
|
// a.href = this.sanitizer.bypassSecurityTrustUrl(url);
|
|
49
48
|
// a.download = fileName;
|
|
50
49
|
// document.body.appendChild(a);
|
|
@@ -79,7 +79,6 @@ export class GlobalSettingsService {
|
|
|
79
79
|
// const projectid = globals.projectid;
|
|
80
80
|
this.getProjectParametersById(projectid).subscribe( response => {
|
|
81
81
|
const project = response['project'];
|
|
82
|
-
// console.log('1 - setParameters ', project);
|
|
83
82
|
if (project) {
|
|
84
83
|
that.globals.project.initialize(
|
|
85
84
|
project['id'],
|
|
@@ -69,10 +69,8 @@ export class TranslatorService {
|
|
|
69
69
|
if (browserLang === 'it') {
|
|
70
70
|
this._translate.use('it');
|
|
71
71
|
this.http.get(this.baseLocation + `/assets/i18n/${browserLang}.json`).subscribe(data=> {
|
|
72
|
-
console.log('ress lang', JSON.parse(data['_body']))
|
|
73
72
|
this._translate.setTranslation('it', JSON.parse(data['_body']));
|
|
74
73
|
this._translate.get('LABEL_PREVIEW').subscribe(res => {
|
|
75
|
-
console.log('default translate --> ', res)
|
|
76
74
|
});
|
|
77
75
|
})
|
|
78
76
|
// this._translate.setTranslation('it', './assets/i18n/en.json')
|
package/src/app/utils/globals.ts
CHANGED
|
@@ -221,30 +221,24 @@ export class Globals {
|
|
|
221
221
|
messangerPageTitle: string; // ******* new ********
|
|
222
222
|
telegramUsername: string; // ******* new ********
|
|
223
223
|
constructor(
|
|
224
|
-
) {
|
|
225
|
-
// console.log(' ---------------- 1: initDefafultParameters ---------------- ');
|
|
226
|
-
}
|
|
224
|
+
) { }
|
|
227
225
|
|
|
228
226
|
|
|
229
227
|
/**
|
|
230
228
|
* 1: initParameters
|
|
231
229
|
*/
|
|
232
230
|
initDefafultParameters() {
|
|
233
|
-
// console.log('initDefafultParameters, ', window, window.frameElement);
|
|
234
231
|
this.globalsParameters = {};
|
|
235
232
|
this.filterSystemMsg = true;
|
|
236
233
|
|
|
237
234
|
let wContext: any = window;
|
|
238
|
-
// console.log('windowContext 0', wContext);
|
|
239
235
|
if (window.frameElement && window.frameElement.getAttribute('tiledesk_context') === 'parent') {
|
|
240
236
|
wContext = window.parent;
|
|
241
237
|
}
|
|
242
|
-
// console.log('windowContext 1', wContext);
|
|
243
238
|
const windowcontextFromWindow = getParameterByName(window, 'windowcontext');
|
|
244
239
|
if (windowcontextFromWindow !== null && windowcontextFromWindow === 'window.parent') {
|
|
245
240
|
wContext = window.parent;
|
|
246
241
|
}
|
|
247
|
-
// console.log('windowContext 2', wContext);
|
|
248
242
|
// this.parameters['windowContext'] = windowContext;
|
|
249
243
|
this.windowContext = wContext;
|
|
250
244
|
|
|
@@ -231,10 +231,11 @@
|
|
|
231
231
|
}
|
|
232
232
|
</script> -->
|
|
233
233
|
|
|
234
|
-
|
|
235
|
-
<meta property="og:
|
|
234
|
+
|
|
235
|
+
<meta property="og:title" content="Try Tiledesk now!" />
|
|
236
|
+
<meta property="og:description" content="Qualify your leads to increase your sales faster. It's really easy to do it with the Tiledesk conversational form builder" />
|
|
237
|
+
<meta property="og:image" content="https://tiledesk.com/wp-content/uploads/2022/12/6029654-02-min.png" />
|
|
236
238
|
<meta property="og:locale" content="en">
|
|
237
|
-
<meta property="og:image" content="">
|
|
238
239
|
|
|
239
240
|
<link rel="icon" type="image/png" href="./tiledesk_widget_files/logo-short.png">
|
|
240
241
|
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
|
|
@@ -262,7 +263,6 @@
|
|
|
262
263
|
calloutTimer: 1,
|
|
263
264
|
singleConversation: true,
|
|
264
265
|
restartConversation: true,
|
|
265
|
-
isLogEnabled: true,
|
|
266
266
|
hideCloseConversationOptionMenu: true
|
|
267
267
|
// autostart: false
|
|
268
268
|
|
|
@@ -346,71 +346,10 @@
|
|
|
346
346
|
if(urlToConsole){
|
|
347
347
|
baseUrlConsole = urlToConsole;
|
|
348
348
|
}
|
|
349
|
-
|
|
350
|
-
|
|
351
349
|
|
|
352
350
|
var currentUrl = window.location.href
|
|
353
351
|
var baseUrl = window.location.origin
|
|
354
|
-
function shareOnFacebook() {
|
|
355
|
-
var fbShareUrl = "https://www.facebook.com/sharer.php?u=" + encodeURIComponent(currentUrl);
|
|
356
|
-
window.open(
|
|
357
|
-
fbShareUrl,
|
|
358
|
-
'_blank'
|
|
359
|
-
);
|
|
360
|
-
}
|
|
361
352
|
|
|
362
|
-
function shareOnTwitter() {
|
|
363
|
-
var TwShareUrl = "https://twitter.com/share?url=" + encodeURIComponent(currentUrl);
|
|
364
|
-
window.open(
|
|
365
|
-
TwShareUrl,
|
|
366
|
-
'_blank'
|
|
367
|
-
);
|
|
368
|
-
}
|
|
369
|
-
|
|
370
|
-
function shareOnLinkedin() {
|
|
371
|
-
var LinkedinShareUrl = "https://www.linkedin.com/shareArticle?mini=true&url=" + encodeURIComponent(currentUrl);
|
|
372
|
-
window.open(
|
|
373
|
-
LinkedinShareUrl,
|
|
374
|
-
'_blank'
|
|
375
|
-
);
|
|
376
|
-
}
|
|
377
|
-
|
|
378
|
-
function shareOnTelegram() {
|
|
379
|
-
var TelegramShareUrl = "tg://msg_url?url=" + encodeURIComponent(currentUrl) ;
|
|
380
|
-
// console.log('TelegramShareUrl ', TelegramShareUrl )
|
|
381
|
-
window.open(
|
|
382
|
-
TelegramShareUrl,
|
|
383
|
-
'_blank'
|
|
384
|
-
);
|
|
385
|
-
}
|
|
386
|
-
|
|
387
|
-
function shareOnWhatsapp() {
|
|
388
|
-
var WhatsappShareUrl = "whatsapp://send?text=" + currentUrl;
|
|
389
|
-
window.open(
|
|
390
|
-
WhatsappShareUrl,
|
|
391
|
-
'_blank'
|
|
392
|
-
);
|
|
393
|
-
}
|
|
394
|
-
|
|
395
|
-
function goToConsole(){
|
|
396
|
-
var url = new URL(currentUrl);
|
|
397
|
-
var tiledesk_projectid = url.searchParams.get("tiledesk_projectid");
|
|
398
|
-
var project_name = url.searchParams.get("project_name");
|
|
399
|
-
var urlConsole = baseUrlConsole + "#/project/"+tiledesk_projectid+"/home";
|
|
400
|
-
//var urlConsole = "dashboard/#/project/"+tiledesk_projectid+"/home";
|
|
401
|
-
window.open(
|
|
402
|
-
urlConsole,
|
|
403
|
-
'_blank'
|
|
404
|
-
);
|
|
405
|
-
}
|
|
406
|
-
|
|
407
|
-
function goToTestPage(){
|
|
408
|
-
var urlTestPage = currentUrl.replace('index.html', 'index-dev.html')
|
|
409
|
-
window.open(
|
|
410
|
-
urlTestPage,
|
|
411
|
-
'_blank'
|
|
412
|
-
);
|
|
413
|
-
}
|
|
414
353
|
|
|
415
354
|
var url = new URL(currentUrl);
|
|
416
355
|
var tiledesk_projectid = url.searchParams.get("tiledesk_projectid");
|
|
@@ -214,20 +214,6 @@ export class FirebaseArchivedConversationsHandler extends ArchivedConversationsH
|
|
|
214
214
|
// ---------------------------------------------------------- //
|
|
215
215
|
// BEGIN PRIVATE FUNCTIONS
|
|
216
216
|
// ---------------------------------------------------------- //
|
|
217
|
-
/**
|
|
218
|
-
*
|
|
219
|
-
*/
|
|
220
|
-
// private getConversationsFromStorage() {
|
|
221
|
-
// const that = this;
|
|
222
|
-
// this.databaseProvider.getConversations()
|
|
223
|
-
// .then((conversations: [ConversationModel]) => {
|
|
224
|
-
// that.loadedConversationsStorage.next(conversations);
|
|
225
|
-
// })
|
|
226
|
-
// .catch((e) => {
|
|
227
|
-
// console.log('error: ', e);
|
|
228
|
-
// });
|
|
229
|
-
// }
|
|
230
|
-
|
|
231
217
|
|
|
232
218
|
// /** DEPRECATED
|
|
233
219
|
// *
|
|
@@ -252,33 +238,6 @@ export class FirebaseArchivedConversationsHandler extends ArchivedConversationsH
|
|
|
252
238
|
}
|
|
253
239
|
}
|
|
254
240
|
|
|
255
|
-
/**
|
|
256
|
-
* @param childSnapshot
|
|
257
|
-
*/
|
|
258
|
-
// private conversationGenerate(childSnapshot: any): ConversationModel {
|
|
259
|
-
// console.log('conversationGenerate: ', childSnapshot.val());
|
|
260
|
-
// const childData: ConversationModel = childSnapshot.val();
|
|
261
|
-
// childData.uid = childSnapshot.key;
|
|
262
|
-
// const conversation = this.completeConversation(childData);
|
|
263
|
-
// if (this.isValidConversation(conversation)) {
|
|
264
|
-
// this.setClosingConversation(childSnapshot.key, false);
|
|
265
|
-
// const index = searchIndexInArrayForUid(this.conversations, conversation.uid);
|
|
266
|
-
// if (index > -1) {
|
|
267
|
-
// this.conversations.splice(index, 1, conversation);
|
|
268
|
-
// } else {
|
|
269
|
-
// this.conversations.splice(0, 0, conversation);
|
|
270
|
-
// }
|
|
271
|
-
// //this.databaseProvider.setConversation(conversation);
|
|
272
|
-
// this.conversations.sort(compareValues('timestamp', 'desc'));
|
|
273
|
-
// if (conversation.is_new) {
|
|
274
|
-
// this.soundMessage();
|
|
275
|
-
// }
|
|
276
|
-
// return conversation;
|
|
277
|
-
// } else {
|
|
278
|
-
// return null;
|
|
279
|
-
// }
|
|
280
|
-
// }
|
|
281
|
-
|
|
282
241
|
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/splice
|
|
283
242
|
/**
|
|
284
243
|
* 1 - completo la conversazione con i parametri mancanti
|
|
@@ -405,9 +405,7 @@ export class FirebaseConversationHandler extends ConversationHandlerService {
|
|
|
405
405
|
} else if ((message.attributes.messagelabel && message.attributes.messagelabel.key === CHAT_CLOSED)) {
|
|
406
406
|
message.text = INFO_SUPPORT_CHAT_CLOSED;
|
|
407
407
|
} else if ((message.attributes && message.attributes.messagelabel && message.attributes.messagelabel.key === TOUCHING_OPERATOR) && message.sender === "system") {
|
|
408
|
-
// console.log('FIREBASEConversationHandlerSERVICE message text', message.text)
|
|
409
408
|
const textAfterColon = message.text.split(":")[1]
|
|
410
|
-
// console.log('FIREBASEConversationHandlerSERVICE message text - textAfterColon', textAfterColon)
|
|
411
409
|
if (textAfterColon !== undefined) {
|
|
412
410
|
message.text = INFO_A_NEW_SUPPORT_REQUEST_HAS_BEEN_ASSIGNED_TO_YOU + ': ' + textAfterColon;
|
|
413
411
|
}
|
|
@@ -534,7 +532,6 @@ private addCommandMessage(msg: MessageModel){
|
|
|
534
532
|
that.logger.debug('[FIREBASEConversationHandlerSERVICE] addCommandMessage --> type="wait"', command, i, commands.length)
|
|
535
533
|
//publish waiting event to simulate user typing
|
|
536
534
|
if(isJustRecived(that.startTime.getTime(), msg.timestamp)){
|
|
537
|
-
// console.log('message just received::', command, i, commands)
|
|
538
535
|
that.messageWait.next({uid: that.conversationWith, uidUserTypingNow: msg.sender, nameUserTypingNow: msg.sender_fullname, waitTime: command.time, command: command})
|
|
539
536
|
}
|
|
540
537
|
setTimeout(function() {
|
|
@@ -571,7 +568,6 @@ private generateMessageObject(message, command_message, callback) {
|
|
|
571
568
|
|
|
572
569
|
|
|
573
570
|
private isValidMessage(msgToCkeck:MessageModel): boolean{
|
|
574
|
-
// console.log('message to check-->', msgToCkeck)
|
|
575
571
|
// if(!this.isValidField(msgToCkeck.uid)){
|
|
576
572
|
// return false;
|
|
577
573
|
// }
|
|
@@ -41,11 +41,9 @@ export class FirebaseImageRepoService extends ImageRepoService {
|
|
|
41
41
|
|
|
42
42
|
|
|
43
43
|
checkImageExists(url: string, callback: (exist: boolean) => void): void {
|
|
44
|
-
console.log('urllll', url)
|
|
45
44
|
this.http.get(url, { responseType: 'blob' }).subscribe( res => {
|
|
46
45
|
callback(true)
|
|
47
46
|
},(error) => {
|
|
48
|
-
console.log('ressssssss errorr', error);
|
|
49
47
|
callback(false)
|
|
50
48
|
})
|
|
51
49
|
}
|