@chat21/chat21-web-widget 5.0.84-rc.3 → 5.0.85-rc.1
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 +10 -0
- package/package.json +1 -1
- package/src/app/component/conversation-detail/conversation/conversation.component.html +1 -2
- package/src/app/component/conversation-detail/conversation/conversation.component.ts +17 -18
- package/src/app/component/conversation-detail/conversation-footer/conversation-footer.component.html +2 -2
- package/src/app/component/conversation-detail/conversation-footer/conversation-footer.component.ts +52 -43
- package/src/app/providers/global-settings.service.ts +14 -14
- package/src/app/utils/globals.ts +6 -6
- package/src/app/utils/utils.ts +45 -0
- package/src/assets/i18n/en.json +1 -1
- package/src/assets/i18n/es.json +1 -1
- package/src/assets/i18n/fr.json +6 -6
- package/src/assets/i18n/it.json +1 -1
- package/src/assets/twp/index-dev.html +9 -8
- package/src/iframe-style.css +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,16 @@
|
|
|
6
6
|
### **Copyrigth**:
|
|
7
7
|
*Tiledesk SRL*
|
|
8
8
|
|
|
9
|
+
# 5.0.85-rc.1
|
|
10
|
+
- **added**: hide header restart menu option if conversation is closed
|
|
11
|
+
- **removed**: continueConversationBeforeTime settings property
|
|
12
|
+
|
|
13
|
+
# 5.0.85 in PROD
|
|
14
|
+
|
|
15
|
+
# 5.0.84-rc.4
|
|
16
|
+
- **added**: checkAcceptedFile fn on dragleave event conversation-content component
|
|
17
|
+
- **added**: checkAcceptedFile fn in conversation-footer component
|
|
18
|
+
|
|
9
19
|
# 5.0.84-rc.3
|
|
10
20
|
- **changed**: index-dev lib order import
|
|
11
21
|
|
package/package.json
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
[hideHeaderCloseButton]="g?.hideHeaderCloseButton"
|
|
16
16
|
[hideHeaderBackButton]="g?.singleConversation"
|
|
17
17
|
[hideCloseConversationOptionMenu]="(isConversationArchived || g?.hideCloseConversationOptionMenu)"
|
|
18
|
-
[hideRestartConversationOptionsMenu]="((!g?.singleConversation && !hideTextAreaContent) || g?.hideRestartConversationOptionsMenu)"
|
|
18
|
+
[hideRestartConversationOptionsMenu]="(isConversationArchived || (!g?.singleConversation && !hideTextAreaContent) || g?.hideRestartConversationOptionsMenu)"
|
|
19
19
|
[hideHeaderConversationOptionsMenu]="g?.hideHeaderConversationOptionsMenu"
|
|
20
20
|
[hideSignOutOptionMenu]="(!g?.singleConversation || !g?.showLogoutOption)"
|
|
21
21
|
[hideChatDetailOptionMenu]="(!g?.isDevMode)"
|
|
@@ -116,7 +116,6 @@
|
|
|
116
116
|
[channelType]="g?.channelType"
|
|
117
117
|
[userFullname]="g?.userFullname"
|
|
118
118
|
[userEmail]="g?.userEmail"
|
|
119
|
-
[showContinueConversationButton]="g?.singleConversation && showContinueConversationButton"
|
|
120
119
|
[showAttachmentButton]="g?.showAttachmentButton"
|
|
121
120
|
[hideTextAreaContent]="(g?.singleConversation && hideTextAreaContent) || (isConversationArchived && !g?.allowReopen)"
|
|
122
121
|
[isConversationArchived]="isConversationArchived"
|
|
@@ -39,6 +39,7 @@ import { CustomTranslateService } from 'src/chat21-core/providers/custom-transla
|
|
|
39
39
|
import { LoggerInstance } from 'src/chat21-core/providers/logger/loggerInstance';
|
|
40
40
|
import { TiledeskRequestsService } from 'src/chat21-core/providers/tiledesk/tiledesk-requests.service';
|
|
41
41
|
import { ConversationContentComponent } from '../conversation-content/conversation-content.component';
|
|
42
|
+
import { checkAcceptedFile } from 'src/app/utils/utils';
|
|
42
43
|
// import { TranslateService } from '@ngx-translate/core';
|
|
43
44
|
|
|
44
45
|
@Component({
|
|
@@ -90,7 +91,7 @@ export class ConversationComponent implements OnInit, AfterViewInit, OnChanges {
|
|
|
90
91
|
footerMessagePlaceholder: string = '';
|
|
91
92
|
textInputTextArea: String;
|
|
92
93
|
isTrascriptDownloadEnabled = false;
|
|
93
|
-
showContinueConversationButton: boolean = false
|
|
94
|
+
// showContinueConversationButton: boolean = false
|
|
94
95
|
// ========= begin:: gestione scroll view messaggi ======= //
|
|
95
96
|
//startScroll = true; // indica lo stato dello scroll: true/false -> è in movimento/ è fermo
|
|
96
97
|
isScrolling = false;
|
|
@@ -401,8 +402,8 @@ export class ConversationComponent implements OnInit, AfterViewInit, OnChanges {
|
|
|
401
402
|
this.conversation = conv;
|
|
402
403
|
this.isConversationArchived = true;
|
|
403
404
|
/**calc time difference between now and last conversation timestamp to allow "Continue" button */
|
|
404
|
-
let duration = getDateDifference(this.conversation.timestamp, Date.now())
|
|
405
|
-
duration.hours < this.g.continueConversationBeforeTime? this.showContinueConversationButton = true: this.showContinueConversationButton = false
|
|
405
|
+
// let duration = getDateDifference(this.conversation.timestamp, Date.now())
|
|
406
|
+
// duration.hours < this.g.continueConversationBeforeTime? this.showContinueConversationButton = true: this.showContinueConversationButton = false
|
|
406
407
|
callback(this.isConversationArchived)
|
|
407
408
|
}else if(!conv) {
|
|
408
409
|
callback(null);
|
|
@@ -1346,34 +1347,32 @@ export class ConversationComponent implements OnInit, AfterViewInit, OnChanges {
|
|
|
1346
1347
|
var mimeType = fileList[0].type
|
|
1347
1348
|
this.logger.log('[CONV-COMP] ----> FILE - DROP mimeType files ', mimeType)
|
|
1348
1349
|
|
|
1349
|
-
// if (mimeType.startsWith("image") || mimeType.startsWith("application")) {
|
|
1350
|
-
// this.logger.log('[CONV-COMP] ----> FILE - DROP mimeType files: ', this.appConfigProvider.getConfig().fileUploadAccept);
|
|
1351
|
-
// this.checkAcceptedFile(mimeType);
|
|
1352
|
-
// const isAccepted = this.checkAcceptedFile(mimeType)
|
|
1353
|
-
// this.logger.log('[CONV-COMP] > checkAcceptedFile - fileUploadAccept isAcceptFile FILE - DROP',isAccepted)
|
|
1354
|
-
// if (isAccepted === true) {
|
|
1355
1350
|
this.dropEvent = event
|
|
1356
|
-
// } else {
|
|
1357
|
-
// this.logger.log( '[CONV-COMP] ----> FILE - DROP mimeType files ', mimeType,'NOT SUPPORTED FILE TYPE')
|
|
1358
|
-
// this.presentToast(this.translationsMap.get('FAILED_TO_UPLOAD_THE_FORMAT_IS_NOT_SUPPORTED'), 'danger','toast-custom-class', 5000 )
|
|
1359
|
-
// // this.presentToastOnlyImageFilesAreAllowedToDrag()
|
|
1360
|
-
// }
|
|
1361
1351
|
|
|
1362
1352
|
}
|
|
1363
1353
|
}
|
|
1364
1354
|
|
|
1365
1355
|
allowDrop(event: any) {
|
|
1366
|
-
event.preventDefault()
|
|
1367
|
-
event.stopPropagation()
|
|
1356
|
+
event.preventDefault();
|
|
1357
|
+
event.stopPropagation();
|
|
1368
1358
|
this.logger.log('[CONV-COMP] ----> FILE - (dragover) allowDrop ev ', event)
|
|
1369
1359
|
this.isHovering = true
|
|
1370
1360
|
}
|
|
1371
1361
|
|
|
1372
1362
|
drag(event){
|
|
1373
|
-
event.preventDefault()
|
|
1363
|
+
event.preventDefault();
|
|
1364
|
+
this.logger.log('[CONV-COMP] ----> FILE - (dragleave) drag ev ', event)
|
|
1365
|
+
if (event.dataTransfer && event.dataTransfer.files) {
|
|
1366
|
+
const files = event.dataTransfer.files;
|
|
1367
|
+
const canUploadFile = checkAcceptedFile(files[0].type, this.appConfigService.getConfig().fileUploadAccept)
|
|
1368
|
+
if(!canUploadFile){
|
|
1369
|
+
this.logger.error('[IMAGE-UPLOAD] detectFiles: can not upload current file type--> NOT ALLOWED', this.appConfigService.getConfig().fileUploadAccept)
|
|
1370
|
+
return;
|
|
1371
|
+
}
|
|
1372
|
+
}
|
|
1374
1373
|
event.stopPropagation()
|
|
1375
|
-
console.log('dragleave-->', event)
|
|
1376
1374
|
this.isHovering = false
|
|
1377
1375
|
}
|
|
1378
1376
|
|
|
1379
1377
|
}
|
|
1378
|
+
|
package/src/app/component/conversation-detail/conversation-footer/conversation-footer.component.html
CHANGED
|
@@ -118,10 +118,10 @@
|
|
|
118
118
|
</span>
|
|
119
119
|
<div class="clear"></div>
|
|
120
120
|
</button>
|
|
121
|
-
<button *ngIf="showContinueConversationButton" tabindex="1040" class="c21-button-primary" (click)="onContinueConversation()" [ngStyle]="{'background-color': stylesMap.get('themeColor'), 'border-color': stylesMap.get('themeColor'), 'color': stylesMap?.get('foregroundColor')}">
|
|
121
|
+
<!-- <button *ngIf="showContinueConversationButton" tabindex="1040" class="c21-button-primary" (click)="onContinueConversation()" [ngStyle]="{'background-color': stylesMap.get('themeColor'), 'border-color': stylesMap.get('themeColor'), 'color': stylesMap?.get('foregroundColor')}">
|
|
122
122
|
<span class="v-align-center c21-label-button">
|
|
123
123
|
{{translationMap?.get('CONTINUE')}}
|
|
124
124
|
</span>
|
|
125
125
|
<div class="clear"></div>
|
|
126
|
-
</button>
|
|
126
|
+
</button> -->
|
|
127
127
|
</div>
|
package/src/app/component/conversation-detail/conversation-footer/conversation-footer.component.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Component, ComponentFactoryResolver, ElementRef, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges, ViewChild, ViewContainerRef } from '@angular/core';
|
|
2
2
|
import { Globals } from 'src/app/utils/globals';
|
|
3
|
+
import { checkAcceptedFile } from 'src/app/utils/utils';
|
|
3
4
|
import { MessageModel } from 'src/chat21-core/models/message';
|
|
4
5
|
import { UploadModel } from 'src/chat21-core/models/upload';
|
|
5
6
|
import { ConversationHandlerService } from 'src/chat21-core/providers/abstract/conversation-handler.service';
|
|
@@ -27,7 +28,7 @@ export class ConversationFooterComponent implements OnInit, OnChanges {
|
|
|
27
28
|
@Input() userFullname: string;
|
|
28
29
|
@Input() userEmail: string;
|
|
29
30
|
@Input() showAttachmentButton: boolean;
|
|
30
|
-
@Input() showContinueConversationButton: boolean;
|
|
31
|
+
// @Input() showContinueConversationButton: boolean;
|
|
31
32
|
@Input() isConversationArchived: boolean;
|
|
32
33
|
@Input() hideTextAreaContent: boolean;
|
|
33
34
|
@Input() hideTextReply: boolean;
|
|
@@ -130,48 +131,56 @@ export class ConversationFooterComponent implements OnInit, OnChanges {
|
|
|
130
131
|
|
|
131
132
|
const that = this;
|
|
132
133
|
if (event.target.files && event.target.files[0]) {
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
that.logger.log('[CONV-FOOTER] onload file');
|
|
158
|
-
const fileXLoad = {
|
|
159
|
-
src: reader.result.toString(),
|
|
160
|
-
title: nameFile
|
|
161
|
-
};
|
|
134
|
+
|
|
135
|
+
const canUploadFile = checkAcceptedFile(event.target.files[0].type, this.fileUploadAccept)
|
|
136
|
+
if(!canUploadFile){
|
|
137
|
+
this.logger.error('[IMAGE-UPLOAD] detectFiles: can not upload current file type--> NOT ALLOWED', this.fileUploadAccept)
|
|
138
|
+
this.isFilePendingToUpload = false;
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
const nameFile = event.target.files[0].name;
|
|
143
|
+
const typeFile = event.target.files[0].type;
|
|
144
|
+
const size = event.target.files[0].size
|
|
145
|
+
const reader = new FileReader();
|
|
146
|
+
that.logger.debug('[CONV-FOOTER] OK preload: ', nameFile, typeFile, reader);
|
|
147
|
+
reader.addEventListener('load', function () {
|
|
148
|
+
that.logger.debug('[CONV-FOOTER] addEventListener load', reader.result);
|
|
149
|
+
that.isFileSelected = true;
|
|
150
|
+
// se inizia con image
|
|
151
|
+
if (typeFile.startsWith('image') && !typeFile.includes('svg')) {
|
|
152
|
+
const imageXLoad = new Image;
|
|
153
|
+
that.logger.debug('[CONV-FOOTER] onload ', imageXLoad);
|
|
154
|
+
imageXLoad.src = reader.result.toString();
|
|
155
|
+
imageXLoad.title = nameFile;
|
|
156
|
+
imageXLoad.onload = function () {
|
|
157
|
+
that.logger.debug('[CONV-FOOTER] onload image');
|
|
162
158
|
// that.arrayFilesLoad.push(imageXLoad);
|
|
163
159
|
const uid = (new Date().getTime()).toString(36); // imageXLoad.src.substring(imageXLoad.src.length - 16);
|
|
164
|
-
that.arrayFilesLoad[0] = { uid: uid, file:
|
|
165
|
-
that.logger.
|
|
160
|
+
that.arrayFilesLoad[0] = { uid: uid, file: imageXLoad, type: typeFile, size: size };
|
|
161
|
+
that.logger.debug('[CONV-FOOTER] OK: ', that.arrayFilesLoad[0]);
|
|
166
162
|
// SEND MESSAGE
|
|
167
163
|
that.loadFile();
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
164
|
+
};
|
|
165
|
+
} else {
|
|
166
|
+
that.logger.debug('[CONV-FOOTER] onload file');
|
|
167
|
+
const fileXLoad = {
|
|
168
|
+
src: reader.result.toString(),
|
|
169
|
+
title: nameFile
|
|
170
|
+
};
|
|
171
|
+
// that.arrayFilesLoad.push(imageXLoad);
|
|
172
|
+
const uid = (new Date().getTime()).toString(36); // imageXLoad.src.substring(imageXLoad.src.length - 16);
|
|
173
|
+
that.arrayFilesLoad[0] = { uid: uid, file: fileXLoad, type: typeFile, size: size };
|
|
174
|
+
that.logger.debug('[CONV-FOOTER] OK: ', that.arrayFilesLoad[0]);
|
|
175
|
+
// SEND MESSAGE
|
|
176
|
+
that.loadFile();
|
|
174
177
|
}
|
|
178
|
+
}, false);
|
|
179
|
+
|
|
180
|
+
if (event.target.files[0]) {
|
|
181
|
+
reader.readAsDataURL(event.target.files[0]);
|
|
182
|
+
that.logger.debug('[CONV-FOOTER] reader-result: ', event.target.files[0]);
|
|
183
|
+
}
|
|
175
184
|
}
|
|
176
185
|
}
|
|
177
186
|
}
|
|
@@ -584,11 +593,11 @@ export class ConversationFooterComponent implements OnInit, OnChanges {
|
|
|
584
593
|
this.onNewConversationButtonClicked.emit();
|
|
585
594
|
}
|
|
586
595
|
|
|
587
|
-
onContinueConversation(){
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
}
|
|
596
|
+
// onContinueConversation(){
|
|
597
|
+
// this.hideTextAreaContent = false;
|
|
598
|
+
// this.onBackButton.emit(false)
|
|
599
|
+
// this.restoreTextArea()
|
|
600
|
+
// }
|
|
592
601
|
|
|
593
602
|
onBackButtonFN(){
|
|
594
603
|
this.onBackButton.emit(false)
|
|
@@ -974,7 +974,7 @@ export class GlobalSettingsService {
|
|
|
974
974
|
globals.singleConversation = (TEMP === true) ? true : false;
|
|
975
975
|
}
|
|
976
976
|
TEMP = tiledeskSettings['restartConversation'];
|
|
977
|
-
// this.logger.debug('[GLOBAL-SET] setVariablesFromSettings >
|
|
977
|
+
// this.logger.debug('[GLOBAL-SET] setVariablesFromSettings > restartConversation:: ', TEMP]);
|
|
978
978
|
if (TEMP !== undefined) {
|
|
979
979
|
globals.restartConversation = (TEMP === true) ? true : false;
|
|
980
980
|
}
|
|
@@ -1001,11 +1001,11 @@ export class GlobalSettingsService {
|
|
|
1001
1001
|
globals.showInfoMessage.push('CHAT_CLOSED')
|
|
1002
1002
|
}
|
|
1003
1003
|
}
|
|
1004
|
-
TEMP = tiledeskSettings['continueConversationBeforeTime'];
|
|
1005
|
-
// this.logger.debug('[GLOBAL-SET] setVariablesFromSettings > continueConversationBeforeTime:: ', TEMP]);
|
|
1006
|
-
if (TEMP !== undefined) {
|
|
1007
|
-
|
|
1008
|
-
}
|
|
1004
|
+
// TEMP = tiledeskSettings['continueConversationBeforeTime'];
|
|
1005
|
+
// // this.logger.debug('[GLOBAL-SET] setVariablesFromSettings > continueConversationBeforeTime:: ', TEMP]);
|
|
1006
|
+
// if (TEMP !== undefined) {
|
|
1007
|
+
// globals.continueConversationBeforeTime = +TEMP;
|
|
1008
|
+
// }
|
|
1009
1009
|
TEMP = tiledeskSettings['participants'];
|
|
1010
1010
|
// this.logger.debug('[GLOBAL-SET] setVariablesFromSettings > participants:: ', TEMP]);
|
|
1011
1011
|
if (TEMP !== undefined) {
|
|
@@ -1310,10 +1310,10 @@ export class GlobalSettingsService {
|
|
|
1310
1310
|
this.globals.showInfoMessage.push('CHAT_CLOSED')
|
|
1311
1311
|
}
|
|
1312
1312
|
}
|
|
1313
|
-
TEMP = el.nativeElement.getAttribute('continueConversationBeforeTime');
|
|
1314
|
-
if (TEMP !== null) {
|
|
1315
|
-
|
|
1316
|
-
}
|
|
1313
|
+
// TEMP = el.nativeElement.getAttribute('continueConversationBeforeTime');
|
|
1314
|
+
// if (TEMP !== null) {
|
|
1315
|
+
// this.globals.continueConversationBeforeTime = +TEMP;
|
|
1316
|
+
// }
|
|
1317
1317
|
TEMP = el.nativeElement.getAttribute('participants');
|
|
1318
1318
|
if (TEMP !== null) {
|
|
1319
1319
|
this.globals.participants = TEMP.split(',').map(key => { return key.trim()});
|
|
@@ -1755,10 +1755,10 @@ export class GlobalSettingsService {
|
|
|
1755
1755
|
}
|
|
1756
1756
|
}
|
|
1757
1757
|
|
|
1758
|
-
TEMP = getParameterByName(windowContext, 'tiledesk_continueConversationBeforeTime');
|
|
1759
|
-
if (TEMP) {
|
|
1760
|
-
|
|
1761
|
-
}
|
|
1758
|
+
// TEMP = getParameterByName(windowContext, 'tiledesk_continueConversationBeforeTime');
|
|
1759
|
+
// if (TEMP) {
|
|
1760
|
+
// globals.continueConversationBeforeTime = +TEMP;
|
|
1761
|
+
// }
|
|
1762
1762
|
|
|
1763
1763
|
TEMP = getParameterByName(windowContext, 'tiledesk_participants');
|
|
1764
1764
|
if (TEMP) {
|
package/src/app/utils/globals.ts
CHANGED
|
@@ -201,7 +201,7 @@ export class Globals {
|
|
|
201
201
|
showInfoMessage: Array<string>; // ******* new ********
|
|
202
202
|
typingLocation: string; // ******* new ********
|
|
203
203
|
allowReopen: boolean; // ******* new ********
|
|
204
|
-
continueConversationBeforeTime: number; // ******* new ********
|
|
204
|
+
// continueConversationBeforeTime: number; // ******* new ********
|
|
205
205
|
participants: Array<string>; // ******* new ********
|
|
206
206
|
whatsappNumber: string; // ******* new ********
|
|
207
207
|
messangerPageTitle: string; // ******* new ********
|
|
@@ -378,7 +378,7 @@ export class Globals {
|
|
|
378
378
|
/** set the location of typing indicator (header or content) */
|
|
379
379
|
this.allowReopen = false;
|
|
380
380
|
/** enable the user to reopen a closed conversation */
|
|
381
|
-
this.continueConversationBeforeTime = 48;
|
|
381
|
+
// this.continueConversationBeforeTime = 48;
|
|
382
382
|
/** enable user to continue archived confersation before the value time from last timeout message */
|
|
383
383
|
this.participants = [];
|
|
384
384
|
/** enable user to talk with specific chat-bots/humans */
|
|
@@ -567,10 +567,10 @@ export class Globals {
|
|
|
567
567
|
if(isOpen && isMobile){
|
|
568
568
|
//block body scroll
|
|
569
569
|
// window.parent.document.body.style.height = '100vh';
|
|
570
|
-
window.parent.document.body.style.height
|
|
571
|
-
window.parent.document.body.style.width
|
|
572
|
-
window.parent.document.body.style.
|
|
573
|
-
window.parent.document.body.style.position
|
|
570
|
+
window.parent.document.body.style.setProperty('height', '0', 'important')
|
|
571
|
+
window.parent.document.body.style.setProperty('width', '100%', 'important')
|
|
572
|
+
window.parent.document.body.style.setProperty('overflow-y', 'hidden', 'important')
|
|
573
|
+
window.parent.document.body.style.setProperty('position', 'fixed', 'important')
|
|
574
574
|
}else if(!isOpen && isMobile){
|
|
575
575
|
//reset body style
|
|
576
576
|
window.parent.document.body.style.removeProperty('height')
|
package/src/app/utils/utils.ts
CHANGED
|
@@ -387,3 +387,48 @@ export function getUnique(arr, comp) {
|
|
|
387
387
|
// eliminate the dead keys & store unique objects
|
|
388
388
|
.filter(e => arr[e]).map(e => arr[e]);
|
|
389
389
|
}
|
|
390
|
+
|
|
391
|
+
export function checkAcceptedFile(fileType, fileUploadAccept ): boolean{
|
|
392
|
+
|
|
393
|
+
if (fileUploadAccept === '*/*') {
|
|
394
|
+
return true
|
|
395
|
+
}
|
|
396
|
+
// Dividi la stringa fileUploadAccept in un array di tipi accettati
|
|
397
|
+
const acceptedTypes = fileUploadAccept.split(',');
|
|
398
|
+
|
|
399
|
+
// Verifica se il tipo di file è accettato
|
|
400
|
+
return acceptedTypes.some((accept) => {
|
|
401
|
+
accept = accept.trim();
|
|
402
|
+
// Controlla per i tipi MIME con wildcard, come image/*
|
|
403
|
+
if (accept.endsWith('/*')) {
|
|
404
|
+
const baseMimeType = fileType.split('/')[0]; // Ottieni la parte principale del MIME type
|
|
405
|
+
return accept.replace('/*', '') === baseMimeType;
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
// Controlla se l'accettazione è un MIME type esatto (come image/jpeg)
|
|
409
|
+
if (accept === fileType) {
|
|
410
|
+
return true;
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
// Controlla per le estensioni di file specifiche come .pdf o .txt
|
|
414
|
+
return fileType === getMimeTypeFromExtension(accept);
|
|
415
|
+
});
|
|
416
|
+
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
function getMimeTypeFromExtension(extension: string): string {
|
|
420
|
+
// Rimuovi il punto dall'estensione e ottieni il MIME type
|
|
421
|
+
const mimeTypes: { [key: string]: string } = {
|
|
422
|
+
'.jpg': 'image/jpeg',
|
|
423
|
+
'.jpeg': 'image/jpeg',
|
|
424
|
+
'.png': 'image/png',
|
|
425
|
+
'.gif': 'image/gif',
|
|
426
|
+
'.pdf': 'application/pdf',
|
|
427
|
+
'.txt': 'text/plain',
|
|
428
|
+
'.doc': 'application/msword',
|
|
429
|
+
'.docx': 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
|
|
430
|
+
'.wav' : 'audio/wav'
|
|
431
|
+
// Aggiungi altri tipi MIME se necessario
|
|
432
|
+
};
|
|
433
|
+
return mimeTypes[extension] || '';
|
|
434
|
+
}
|
package/src/assets/i18n/en.json
CHANGED
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"CLOSE_CHAT": "Close chat",
|
|
56
56
|
"MINIMIZE":"Minimize",
|
|
57
57
|
"MAXIMIZE":"Maximize",
|
|
58
|
-
"CONFIRM_CLOSE_CHAT":"Are you sure you
|
|
58
|
+
"CONFIRM_CLOSE_CHAT":"Are you sure you want to close this chat?",
|
|
59
59
|
|
|
60
60
|
"INFO_SUPPORT_USER_ADDED_SUBJECT":"you",
|
|
61
61
|
"INFO_SUPPORT_USER_ADDED_YOU_VERB":"have been added to ",
|
package/src/assets/i18n/es.json
CHANGED
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"CLOSE_CHAT": "Cerrar chat",
|
|
56
56
|
"MINIMIZE":"Minimizar",
|
|
57
57
|
"MAXIMIZE":"Maximizar",
|
|
58
|
-
"CONFIRM_CLOSE_CHAT":"¿Estás
|
|
58
|
+
"CONFIRM_CLOSE_CHAT":"¿Estás seguro de que quieres cerrar este chat?",
|
|
59
59
|
|
|
60
60
|
"INFO_SUPPORT_USER_ADDED_SUBJECT":"tú",
|
|
61
61
|
"INFO_SUPPORT_USER_ADDED_YOU_VERB":"han sido agregados a ",
|
package/src/assets/i18n/fr.json
CHANGED
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"ALERT_LEAVE_CHAT": "Voulez-vous quitter la conversation?",
|
|
32
32
|
"YES": "Oui",
|
|
33
33
|
"NO": "Non",
|
|
34
|
-
"BUTTON_CLOSE_TO_ICON": "Minimisez
|
|
34
|
+
"BUTTON_CLOSE_TO_ICON": "Minimisez la discussion",
|
|
35
35
|
"BUTTON_EDIT_PROFILE": "Modifier le profil",
|
|
36
36
|
"RATE_CHAT": "évaluer la conversation",
|
|
37
37
|
"WELCOME_TITLE": "Salut, bienvenue à Tiledesk 👋",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"CLOSE": "Fermer",
|
|
45
45
|
"RESTART":"Redémarrer",
|
|
46
46
|
"PREV_CONVERSATIONS": "Vos conversations",
|
|
47
|
-
"YOU": "
|
|
47
|
+
"YOU": "Tu",
|
|
48
48
|
"SHOW_ALL_CONV": "voir tout",
|
|
49
49
|
"START_A_CONVERSATION": "Démarrer une conversation",
|
|
50
50
|
"NO_CONVERSATION": "Aucune conversation active",
|
|
@@ -52,17 +52,17 @@
|
|
|
52
52
|
"WAITING_TIME_FOUND": "L'équipe répond généralement en $reply_time",
|
|
53
53
|
"WAITING_TIME_NOT_FOUND": "Nous vous répondrons dans les plus brefs délais",
|
|
54
54
|
"CLOSED": "Fermé",
|
|
55
|
-
"CLOSE_CHAT": "Fermer
|
|
55
|
+
"CLOSE_CHAT": "Fermer la discussion",
|
|
56
56
|
"MINIMIZE":"Minimiser",
|
|
57
57
|
"MAXIMIZE":"Maximiser",
|
|
58
58
|
"CONFIRM_CLOSE_CHAT":"Etes-vous sûr de vouloir fermer cette discussion?",
|
|
59
59
|
|
|
60
|
-
"INFO_SUPPORT_USER_ADDED_SUBJECT":"
|
|
60
|
+
"INFO_SUPPORT_USER_ADDED_SUBJECT":"tu",
|
|
61
61
|
"INFO_SUPPORT_USER_ADDED_YOU_VERB":"ont été ajoutés à ",
|
|
62
62
|
"INFO_SUPPORT_USER_ADDED_COMPLEMENT":"rejointe",
|
|
63
63
|
"INFO_SUPPORT_USER_ADDED_VERB":"la discussion",
|
|
64
|
-
"INFO_SUPPORT_CHAT_REOPENED":"
|
|
65
|
-
"INFO_SUPPORT_CHAT_CLOSED":"
|
|
64
|
+
"INFO_SUPPORT_CHAT_REOPENED":"Discussion rouvert",
|
|
65
|
+
"INFO_SUPPORT_CHAT_CLOSED":"Discussion fermé",
|
|
66
66
|
"INFO_SUPPORT_LEAD_UPDATED":"Prospect mis à jour",
|
|
67
67
|
"INFO_SUPPORT_MEMBER_LEFT_GROUP":"supprimé du groupe",
|
|
68
68
|
"INFO_SUPPORT_MEMBER_ABANDONED_GROUP":"a quitté la conversation",
|
package/src/assets/i18n/it.json
CHANGED
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"CLOSE_CHAT": "Chiudi chat",
|
|
56
56
|
"MINIMIZE":"Minimizza",
|
|
57
57
|
"MAXIMIZE":"Massimizza",
|
|
58
|
-
"CONFIRM_CLOSE_CHAT":"
|
|
58
|
+
"CONFIRM_CLOSE_CHAT":"Sei sicuro di voler chiudere questa chat?",
|
|
59
59
|
|
|
60
60
|
"INFO_SUPPORT_USER_ADDED_SUBJECT":"tu",
|
|
61
61
|
"INFO_SUPPORT_USER_ADDED_YOU_VERB":"sei stato aggiunto ",
|
|
@@ -131,6 +131,7 @@
|
|
|
131
131
|
display: -webkit-box;
|
|
132
132
|
max-height: 258px; /* Fallback for non-webkit */
|
|
133
133
|
line-height: 2.3;
|
|
134
|
+
line-clamp: 8;
|
|
134
135
|
-webkit-line-clamp: 8;
|
|
135
136
|
-webkit-box-orient: vertical;
|
|
136
137
|
overflow: hidden;
|
|
@@ -1284,12 +1285,12 @@
|
|
|
1284
1285
|
window.Tiledesk('restart')
|
|
1285
1286
|
}
|
|
1286
1287
|
|
|
1287
|
-
function onClickContinueConversationBeforeTime(){
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
}
|
|
1288
|
+
// function onClickContinueConversationBeforeTime(){
|
|
1289
|
+
// let text = document.getElementById('continueConversationBeforeTime').value
|
|
1290
|
+
// window.tiledeskSettings['continueConversationBeforeTime'] = text
|
|
1291
|
+
// console.log('onClickContinueConversationBeforeTime:',window.tiledeskSettings);
|
|
1292
|
+
// window.Tiledesk('restart')
|
|
1293
|
+
// }
|
|
1293
1294
|
|
|
1294
1295
|
function onClickRecipientId(){
|
|
1295
1296
|
let text = document.getElementById('recipientId').value
|
|
@@ -2294,7 +2295,7 @@
|
|
|
2294
2295
|
<button class="btn btn-light" onclick="onClickAllowReopen()">Test this setting <i class="fa fa-magic" aria-hidden="true"></i></button>
|
|
2295
2296
|
</div>
|
|
2296
2297
|
</div>
|
|
2297
|
-
<div class="row">
|
|
2298
|
+
<!-- <div class="row">
|
|
2298
2299
|
<div class="col-md-5 formElement"><span><em><strong>continueConversationBeforeTime</strong></em></span></div>
|
|
2299
2300
|
<div class="col-md-5 formElement">
|
|
2300
2301
|
<div class="col-form-label" style="width: 90px">Time (h):</div>
|
|
@@ -2303,7 +2304,7 @@
|
|
|
2303
2304
|
<div class="col-md-2">
|
|
2304
2305
|
<button class="btn btn-light" onclick="onClickContinueConversationBeforeTime()">Test this setting <i class="fa fa-magic" aria-hidden="true"></i></button>
|
|
2305
2306
|
</div>
|
|
2306
|
-
</div>
|
|
2307
|
+
</div> -->
|
|
2307
2308
|
<div class="row">
|
|
2308
2309
|
<div class="col-md-5 formElement"><span><em><strong>recipientId</strong></em></span></div>
|
|
2309
2310
|
<div class="col-md-5">
|