@chat21/chat21-web-widget 5.0.45 → 5.0.46-rc.2
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/angular.json +2 -1
- package/dist/assets/i18n/en.json +1 -1
- package/dist/assets/i18n/es.json +22 -9
- package/dist/assets/i18n/fr.json +20 -7
- package/dist/assets/i18n/it.json +24 -11
- package/dist/assets/twp/index-dev.html +1 -1
- package/dist/iframe-style.css +8 -1
- package/dist/main.js +1 -1
- package/package.json +1 -1
- package/src/app/app.component.scss +4 -3
- package/src/app/app.component.spec.ts +59 -18
- package/src/app/component/conversation-detail/conversation/conversation.component.spec.ts +12 -1
- package/src/app/component/conversation-detail/conversation/conversation.component.ts +4 -2
- package/src/app/component/conversation-detail/conversation-content/conversation-content.component.spec.ts +7 -4
- package/src/app/component/conversation-detail/conversation-footer/conversation-footer.component.spec.ts +11 -3
- package/src/app/component/conversation-detail/conversation-header/conversation-header.component.spec.ts +11 -4
- package/src/app/component/conversation-detail/conversation-preview/conversation-preview.component.spec.ts +9 -59
- package/src/app/component/form/form-builder/form-builder.component.spec.ts +9 -1
- package/src/app/component/form/inputs/form-textarea/form-textarea.component.html +5 -5
- package/src/app/component/form/inputs/form-textarea/form-textarea.component.spec.ts +1 -1
- package/src/app/component/form/inputs/form-textarea/form-textarea.component.ts +1 -1
- package/src/app/component/home/home.component.spec.ts +12 -3
- package/src/app/component/home-conversations/home-conversations.component.spec.ts +9 -1
- package/src/app/component/list-all-conversations/list-all-conversations.component.spec.ts +9 -11
- package/src/app/component/list-conversations/list-conversations.component.spec.ts +9 -1
- package/src/app/component/message/buttons/action-button/action-button.component.scss +1 -0
- package/src/app/component/message/buttons/link-button/link-button.component.scss +1 -0
- package/src/app/component/message/buttons/text-button/text-button.component.scss +1 -0
- package/src/app/component/message/frame/frame.component.spec.ts +16 -3
- package/src/app/component/message/frame/frame.component.ts +2 -2
- package/src/app/component/message/image/image.component.ts +46 -0
- package/src/app/component/message/info-message/info-message.component.spec.ts +9 -1
- package/src/app/component/message/return-receipt/return-receipt.component.spec.ts +17 -2
- package/src/app/component/message/text/text.component.spec.ts +2 -2
- package/src/app/providers/settings-saver.service.ts +1 -1
- package/src/app/utils/globals.ts +1 -1
- package/src/assets/i18n/en.json +1 -1
- package/src/assets/i18n/es.json +22 -9
- package/src/assets/i18n/fr.json +20 -7
- package/src/assets/i18n/it.json +24 -11
- package/src/assets/twp/index-dev.html +1 -1
- package/src/chat21-core/providers/firebase/firebase-conversation-handler.ts +6 -47
- package/src/chat21-core/providers/mqtt/mqtt-conversation-handler.ts +5 -23
- package/src/chat21-core/providers/tiledesk/tiledesk-auth.service.spec.ts +29 -19
- package/src/chat21-core/utils/utils-message.ts +1 -1
- package/src/chat21-core/utils/utils.ts +3 -3
- package/src/iframe-style.css +8 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
|
1
|
+
import { async, ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
|
2
|
+
import { DomSanitizer } from '@angular/platform-browser';
|
|
2
3
|
|
|
3
4
|
import { FrameComponent } from './frame.component';
|
|
4
5
|
|
|
@@ -6,9 +7,18 @@ describe('FrameComponent', () => {
|
|
|
6
7
|
let component: FrameComponent;
|
|
7
8
|
let fixture: ComponentFixture<FrameComponent>;
|
|
8
9
|
|
|
9
|
-
beforeEach(
|
|
10
|
+
beforeEach(waitForAsync(() => {
|
|
10
11
|
TestBed.configureTestingModule({
|
|
11
|
-
declarations: [ FrameComponent ]
|
|
12
|
+
declarations: [ FrameComponent ],
|
|
13
|
+
providers: [
|
|
14
|
+
{
|
|
15
|
+
provide: DomSanitizer,
|
|
16
|
+
useValue: {
|
|
17
|
+
sanitize: () => 'safeString',
|
|
18
|
+
bypassSecurityTrustResourceUrl: () => 'safeString'
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
,]
|
|
12
22
|
})
|
|
13
23
|
.compileComponents();
|
|
14
24
|
}));
|
|
@@ -20,6 +30,9 @@ describe('FrameComponent', () => {
|
|
|
20
30
|
});
|
|
21
31
|
|
|
22
32
|
it('should create', () => {
|
|
33
|
+
component.url = component['sanitizer'].bypassSecurityTrustResourceUrl('http://www.tiledesk.com');
|
|
34
|
+
console.log('cccccc', component)
|
|
35
|
+
fixture.detectChanges();
|
|
23
36
|
expect(component).toBeTruthy();
|
|
24
37
|
});
|
|
25
38
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DomSanitizer } from '@angular/platform-browser';
|
|
1
|
+
import { DomSanitizer, SafeResourceUrl } from '@angular/platform-browser';
|
|
2
2
|
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
|
|
3
3
|
|
|
4
4
|
@Component({
|
|
@@ -13,7 +13,7 @@ export class FrameComponent implements OnInit {
|
|
|
13
13
|
@Input() height: number;
|
|
14
14
|
@Output() onElementRendered = new EventEmitter<{element: string, status: boolean}>();
|
|
15
15
|
|
|
16
|
-
url:
|
|
16
|
+
url: SafeResourceUrl = null
|
|
17
17
|
loading: boolean = true
|
|
18
18
|
constructor(private sanitizer: DomSanitizer) { }
|
|
19
19
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Globals } from 'src/app/utils/globals';
|
|
1
2
|
import { Component, Input, OnInit, SimpleChanges, EventEmitter, Output } from '@angular/core';
|
|
2
3
|
import { popupUrl } from 'src/chat21-core/utils/utils';
|
|
3
4
|
import { saveAs} from 'file-saver';
|
|
@@ -51,6 +52,51 @@ export class ImageComponent implements OnInit {
|
|
|
51
52
|
// a.click();
|
|
52
53
|
// a.remove();
|
|
53
54
|
saveAs(url, fileName);
|
|
55
|
+
// this.onClickImage()
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
onClickImage(){
|
|
59
|
+
|
|
60
|
+
// var ifrm = document.createElement("iframe");
|
|
61
|
+
// ifrm.setAttribute("frameborder", "0");
|
|
62
|
+
// ifrm.setAttribute("border", "0");
|
|
63
|
+
// ifrm.setAttribute('id','tiledeskiframe');
|
|
64
|
+
// ifrm.setAttribute('tiledesk_context','parent');
|
|
65
|
+
// ifrm.setAttribute('style', 'width: 100%; height: 100%; position: fixed; top: 0px; left: 0px; z-index: 2147483003; border: 0px;')
|
|
66
|
+
|
|
67
|
+
// var iframeContent = '<html>'
|
|
68
|
+
// iframeContent += '<head></head>'
|
|
69
|
+
// iframeContent += '<body>'
|
|
70
|
+
// iframeContent += '<div class="frame-root">'
|
|
71
|
+
// iframeContent += '<div class="frame-content">'
|
|
72
|
+
// iframeContent += '<div class="tiledesk-popup" style="opacity: 1;"></div>'
|
|
73
|
+
// iframeContent += '<div role="button" tabindex="-1" class="tidio-popup-1y163m9">'
|
|
74
|
+
// iframeContent += '<button type="button" data-testid="closeButton" class="tidio-popup-fru4e5 >'
|
|
75
|
+
// iframeContent += '<svg id="ic_close" fill="#000000" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg" aria-hidden="true"><path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"></path><path d="M0 0h24v24H0z" fill="none"></path></svg>'
|
|
76
|
+
// iframeContent += '</button>'
|
|
77
|
+
// iframeContent += '<a href="#popup" data-testid="popupImage-wrapper" class="tidio-popup-vgwcqv" style="opacity: 1; transform: translate3d(0px, 0px, 0px);">'
|
|
78
|
+
// iframeContent += '<img src="'+this.metadata.src+'" alt="popup" class="tidio-popup-wuejeg">'
|
|
79
|
+
// iframeContent += '</a>'
|
|
80
|
+
// iframeContent += '</div>'
|
|
81
|
+
// iframeContent += '</div>'
|
|
82
|
+
// iframeContent += '</div>'
|
|
83
|
+
// iframeContent +='</body>'
|
|
84
|
+
// iframeContent +='</html>'
|
|
85
|
+
|
|
86
|
+
// var tiledeskdiv = this.globals.windowContext.document.getElementById('tiledeskdiv');
|
|
87
|
+
|
|
88
|
+
// tiledeskdiv.appendChild(ifrm);
|
|
89
|
+
// ifrm.contentWindow.document.open();
|
|
90
|
+
// ifrm.contentWindow.document.write(iframeContent);
|
|
91
|
+
// ifrm.contentWindow.document.close();
|
|
92
|
+
|
|
93
|
+
// ifrm.onload = function(ev) {
|
|
94
|
+
// // var button = document.getElementById("button");
|
|
95
|
+
// // button.addEventListener("click", function(event){
|
|
96
|
+
// // alert(event.target);
|
|
97
|
+
// // });
|
|
98
|
+
// };
|
|
99
|
+
|
|
54
100
|
}
|
|
55
101
|
|
|
56
102
|
|
|
@@ -1,17 +1,22 @@
|
|
|
1
|
+
import { CustomLogger } from './../../../../chat21-core/providers/logger/customLogger';
|
|
2
|
+
import { LoggerInstance } from './../../../../chat21-core/providers/logger/loggerInstance';
|
|
1
3
|
import { LoggerService } from 'src/chat21-core/providers/abstract/logger.service';
|
|
2
4
|
import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing';
|
|
3
5
|
import { MarkedPipe } from '../../../directives/marked.pipe';
|
|
4
6
|
|
|
5
7
|
import { InfoMessageComponent } from './info-message.component';
|
|
8
|
+
import { NGXLogger } from 'ngx-logger';
|
|
6
9
|
|
|
7
10
|
describe('InfoMessageComponent', () => {
|
|
8
11
|
let component: InfoMessageComponent;
|
|
9
12
|
let fixture: ComponentFixture<InfoMessageComponent>;
|
|
13
|
+
let ngxlogger: NGXLogger;
|
|
14
|
+
let customLogger = new CustomLogger(ngxlogger)
|
|
10
15
|
|
|
11
16
|
beforeEach(waitForAsync(() => {
|
|
12
17
|
TestBed.configureTestingModule({
|
|
13
18
|
declarations: [ InfoMessageComponent, MarkedPipe ],
|
|
14
|
-
providers: [LoggerService]
|
|
19
|
+
providers: [LoggerService, NGXLogger]
|
|
15
20
|
})
|
|
16
21
|
.compileComponents();
|
|
17
22
|
}));
|
|
@@ -19,6 +24,9 @@ describe('InfoMessageComponent', () => {
|
|
|
19
24
|
beforeEach(() => {
|
|
20
25
|
fixture = TestBed.createComponent(InfoMessageComponent);
|
|
21
26
|
component = fixture.componentInstance;
|
|
27
|
+
LoggerInstance.setInstance(customLogger)
|
|
28
|
+
let logger = LoggerInstance.getInstance()
|
|
29
|
+
component['logger']= logger
|
|
22
30
|
fixture.detectChanges();
|
|
23
31
|
});
|
|
24
32
|
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
|
1
|
+
import { async, ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
|
2
|
+
import { By } from '@angular/platform-browser';
|
|
3
|
+
import { MSG_STATUS_SENT } from 'src/chat21-core/utils/constants';
|
|
2
4
|
|
|
3
5
|
import { ReturnReceiptComponent } from './return-receipt.component';
|
|
4
6
|
|
|
@@ -6,7 +8,7 @@ describe('ReturnReceiptComponent', () => {
|
|
|
6
8
|
let component: ReturnReceiptComponent;
|
|
7
9
|
let fixture: ComponentFixture<ReturnReceiptComponent>;
|
|
8
10
|
|
|
9
|
-
beforeEach(
|
|
11
|
+
beforeEach(waitForAsync(() => {
|
|
10
12
|
TestBed.configureTestingModule({
|
|
11
13
|
declarations: [ ReturnReceiptComponent ]
|
|
12
14
|
})
|
|
@@ -22,4 +24,17 @@ describe('ReturnReceiptComponent', () => {
|
|
|
22
24
|
it('should create', () => {
|
|
23
25
|
expect(component).toBeTruthy();
|
|
24
26
|
});
|
|
27
|
+
|
|
28
|
+
it('shold render MSG_STATUS_SENT icon', ()=> {
|
|
29
|
+
component.status= MSG_STATUS_SENT
|
|
30
|
+
fixture.detectChanges();
|
|
31
|
+
expect(component.status).toBe(MSG_STATUS_SENT)
|
|
32
|
+
})
|
|
33
|
+
|
|
34
|
+
// it('shold render MSG_STATUS_SENT icon', ()=> {
|
|
35
|
+
// component.status= MSG_STATUS_SENT
|
|
36
|
+
// fixture.detectChanges();
|
|
37
|
+
// let element = fixture.debugElement.query(By.css('icon'))
|
|
38
|
+
// expect(element.classes).toBeE('icon')
|
|
39
|
+
// })
|
|
25
40
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HtmlEntitiesEncodePipe } from './../../../directives/html-entities-encode.pipe';
|
|
2
2
|
import { MarkedPipe } from './../../../directives/marked.pipe';
|
|
3
|
-
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
|
3
|
+
import { async, ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
|
4
4
|
|
|
5
5
|
import { TextComponent } from './text.component';
|
|
6
6
|
|
|
@@ -8,7 +8,7 @@ describe('TextComponent', () => {
|
|
|
8
8
|
let component: TextComponent;
|
|
9
9
|
let fixture: ComponentFixture<TextComponent>;
|
|
10
10
|
|
|
11
|
-
beforeEach(
|
|
11
|
+
beforeEach(waitForAsync(() => {
|
|
12
12
|
TestBed.configureTestingModule({
|
|
13
13
|
declarations: [
|
|
14
14
|
TextComponent,
|
|
@@ -48,7 +48,7 @@ export class SettingsSaverService {
|
|
|
48
48
|
// console.log('key: ', key);
|
|
49
49
|
// console.log('val: ', val);
|
|
50
50
|
// console.log('========================================');
|
|
51
|
-
this.appStorageService.setItem(key, stringToBoolean(value));
|
|
51
|
+
// this.appStorageService.setItem(key, stringToBoolean(value));
|
|
52
52
|
|
|
53
53
|
//this.g.wdLog(['SET key: ', key, ' - VAL: ', stringToBoolean(value), ' ---------->', JSON.stringify(value) ]);
|
|
54
54
|
}
|
package/src/app/utils/globals.ts
CHANGED
|
@@ -303,7 +303,7 @@ export class Globals {
|
|
|
303
303
|
(color of the header, color of the launcher button,
|
|
304
304
|
other minor elements). Permitted values: Hex color
|
|
305
305
|
codes, e.g. #87BC65 and RGB color codes, e.g. rgb(135,188,101) */
|
|
306
|
-
this.themeColorOpacity =
|
|
306
|
+
this.themeColorOpacity = 100
|
|
307
307
|
/**allows you to change opacity in background headers component
|
|
308
308
|
* Permitted values: [0..1] */
|
|
309
309
|
this.themeForegroundColor = convertColorToRGBA('#ffffff', 100);
|
package/src/assets/i18n/en.json
CHANGED
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"INFO_SUPPORT_CHAT_CLOSED":"Chat closed",
|
|
66
66
|
"INFO_SUPPORT_LEAD_UPDATED":"Lead updated",
|
|
67
67
|
"INFO_SUPPORT_MEMBER_LEFT_GROUP":"removed from group",
|
|
68
|
-
"INFO_SUPPORT_MEMBER_ABANDONED_GROUP":"has left the
|
|
68
|
+
"INFO_SUPPORT_MEMBER_ABANDONED_GROUP":"has left the conversation",
|
|
69
69
|
"INFO_A_NEW_SUPPORT_REQUEST_HAS_BEEN_ASSIGNED_TO_YOU": "A new support request has been assigned to you",
|
|
70
70
|
|
|
71
71
|
"LABEL_PRECHAT_USER_FULLNAME": "Full name",
|
package/src/assets/i18n/es.json
CHANGED
|
@@ -10,7 +10,6 @@
|
|
|
10
10
|
"LABEL_ERROR_FIELD_NAME": "Campo obligatorio (mínimo 5 caracteres).",
|
|
11
11
|
"LABEL_FIELD_EMAIL": "Email",
|
|
12
12
|
"LABEL_ERROR_FIELD_EMAIL": "Introduzca una dirección de correo electrónico válida.",
|
|
13
|
-
"LABEL_ERROR_FIELD_REQUIRED":"Campo requerido",
|
|
14
13
|
"LABEL_WRITING": "esta escribiendo...",
|
|
15
14
|
"LABEL_SEND_NEW_MESSAGE": "Enviar un mensaje nuevo",
|
|
16
15
|
"AGENT_NOT_AVAILABLE": " Fuera de línea",
|
|
@@ -39,10 +38,11 @@
|
|
|
39
38
|
"WELLCOME_TITLE": "Hola, bienvenido a Tiledesk 👋",
|
|
40
39
|
"WELLCOME_MSG": "¿Cómo podemos ayudar?",
|
|
41
40
|
"OPTIONS": "opciones",
|
|
42
|
-
"SOUND_OFF": "
|
|
43
|
-
"SOUND_ON": "
|
|
44
|
-
"LOGOUT": "
|
|
41
|
+
"SOUND_OFF": "Sonido apagado",
|
|
42
|
+
"SOUND_ON": "Sonido encendido",
|
|
43
|
+
"LOGOUT": "Cerrar sesión",
|
|
45
44
|
"CLOSE": "cerca",
|
|
45
|
+
"RESTART":"Reiniciar",
|
|
46
46
|
"PREV_CONVERSATIONS": "Tus conversaciones",
|
|
47
47
|
"YOU": "Tú",
|
|
48
48
|
"SHOW_ALL_CONV": "mostrar todo",
|
|
@@ -52,7 +52,9 @@
|
|
|
52
52
|
"WAITING_TIME_FOUND": "El equipo típicamente responde en $reply_time",
|
|
53
53
|
"WAITING_TIME_NOT_FOUND": "El equipo responderá lo antes posible",
|
|
54
54
|
"CLOSED": "CERRADA",
|
|
55
|
-
|
|
55
|
+
"CLOSE_CHAT": "Cerrar chat",
|
|
56
|
+
"MINIMIZE":"Minimizar",
|
|
57
|
+
"MAXIMIZE":"Maximizar",
|
|
56
58
|
"INFO_SUPPORT_USER_ADDED_SUBJECT":"tú",
|
|
57
59
|
"INFO_SUPPORT_USER_ADDED_YOU_VERB":"han sido agregados a ",
|
|
58
60
|
"INFO_SUPPORT_USER_ADDED_COMPLEMENT":"joined",
|
|
@@ -63,15 +65,26 @@
|
|
|
63
65
|
"INFO_SUPPORT_MEMBER_LEFT_GROUP":"eliminado del grupo",
|
|
64
66
|
"INFO_SUPPORT_MEMBER_ABANDONED_GROUP":"abandonó la conversación",
|
|
65
67
|
"INFO_A_NEW_SUPPORT_REQUEST_HAS_BEEN_ASSIGNED_TO_YOU": "Se le ha asignado una nueva solicitud de soporte",
|
|
68
|
+
"TICKET_TAKING":"La solicitud ha sido recibida y el personal de asistencia está tratando con ella. \nPara agregar más comentarios, responda a este correo electrónico.",
|
|
69
|
+
|
|
70
|
+
"LABEL_ERROR_FIELD_REQUIRED": "Campo obligatorio",
|
|
71
|
+
"SENT_AN_ATTACHMENT": "envió un archivo adjunto",
|
|
72
|
+
"SENT_AN_IMAGE": "envió una imagen",
|
|
66
73
|
|
|
74
|
+
"LABEL_PRECHAT_USER_FULLNAME": "Nombre completo",
|
|
75
|
+
"LABEL_PRECHAT_USER_EMAIL": "Correo electrónico",
|
|
76
|
+
"LABEL_PRECHAT_USER_EMAIL_ERROR": "Dirección de correo electrónico no válida",
|
|
77
|
+
"LABEL_PRECHAT_USER_PHONE": "Teléfono",
|
|
78
|
+
"LABEL_PRECHAT_USER_PHONE_ERROR": "Se requiere teléfono",
|
|
79
|
+
"LABEL_PRECHAT_FIRST_MESSAGE": "Tu mensaje para el equipo de soporte",
|
|
80
|
+
"LABEL_PRECHAT_STATIC_TERMS_PRIVACY": "Antes de continuar con la conversación, acepte nuestros <a href='https://tiledesk.com/termsofservice/' target='_blank'>Términos</a> y <a href='https:/ /tiledesk.com/privacy.html' target='_blank'>Política de privacidad</a>",
|
|
81
|
+
"LABEL_PRECHAT_ACCEPT_TERMS_PRIVACY": "Acepto",
|
|
82
|
+
"PRECHAT_REQUIRED_ERROR": "Este campo es obligatorio",
|
|
83
|
+
|
|
67
84
|
"LABEL_TODAY": "hoy",
|
|
68
85
|
"LABEL_TOMORROW": "ayer",
|
|
69
86
|
"LABEL_LAST_ACCESS": "ultimo acceso",
|
|
70
87
|
"LABEL_TO": "a",
|
|
71
88
|
"ARRAY_DAYS": ["Lunes", "Martes", "Miércoles", "Jueves", "Viernes", "Sábado", "Domingo"],
|
|
72
|
-
|
|
73
|
-
"SENT_AN_ATTACHMENT": "envió un archivo adjunto",
|
|
74
|
-
"SENT_AN_IMAGE":"envió una imagen",
|
|
75
|
-
|
|
76
89
|
"LABEL_PREVIEW": "Avance"
|
|
77
90
|
}
|
package/src/assets/i18n/fr.json
CHANGED
|
@@ -10,7 +10,6 @@
|
|
|
10
10
|
"LABEL_ERROR_FIELD_NAME": "Nom demandé (minimum 2 caractères).",
|
|
11
11
|
"LABEL_FIELD_EMAIL": "Email",
|
|
12
12
|
"LABEL_ERROR_FIELD_EMAIL": "Entrer une adresse email valide.",
|
|
13
|
-
"LABEL_ERROR_FIELD_REQUIRED":"Champs requis",
|
|
14
13
|
"LABEL_WRITING": "écrit ...",
|
|
15
14
|
"LABEL_SEND_NEW_MESSAGE": "Envoyez un nouveau message",
|
|
16
15
|
"AGENT_NOT_AVAILABLE": " Hors ligne",
|
|
@@ -43,6 +42,7 @@
|
|
|
43
42
|
"SOUND_ON": "Sound on",
|
|
44
43
|
"LOGOUT": "Connectez-out",
|
|
45
44
|
"CLOSE": "Fermer",
|
|
45
|
+
"RESTART":"Redémarrer",
|
|
46
46
|
"PREV_CONVERSATIONS": "Vos conversations",
|
|
47
47
|
"YOU": "Toi",
|
|
48
48
|
"SHOW_ALL_CONV": "voir tout",
|
|
@@ -51,8 +51,10 @@
|
|
|
51
51
|
"SEE_PREVIOUS": "voir les conversations précédentes",
|
|
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
|
-
"CLOSED": "
|
|
55
|
-
|
|
54
|
+
"CLOSED": "Fermé",
|
|
55
|
+
"CLOSE_CHAT": "Fermer le chat",
|
|
56
|
+
"MINIMIZE":"Minimiser",
|
|
57
|
+
"MAXIMIZE":"Maximiser",
|
|
56
58
|
"INFO_SUPPORT_USER_ADDED_SUBJECT":"toi",
|
|
57
59
|
"INFO_SUPPORT_USER_ADDED_YOU_VERB":"ont été ajoutés à ",
|
|
58
60
|
"INFO_SUPPORT_USER_ADDED_COMPLEMENT":"rejointe",
|
|
@@ -63,15 +65,26 @@
|
|
|
63
65
|
"INFO_SUPPORT_MEMBER_LEFT_GROUP":"supprimé du groupe",
|
|
64
66
|
"INFO_SUPPORT_MEMBER_ABANDONED_GROUP":"a quitté la conversation",
|
|
65
67
|
"INFO_A_NEW_SUPPORT_REQUEST_HAS_BEEN_ASSIGNED_TO_YOU": "Une nouvelle demande de support vous a été attribuée",
|
|
68
|
+
"TICKET_TAKING":"La demande a été reçue et le personnel d'assistance la traite.\nPour ajouter d'autres commentaires, répondez à cet e-mail.",
|
|
69
|
+
|
|
70
|
+
"LABEL_ERROR_FIELD_REQUIRED": "Champ obligatoire",
|
|
71
|
+
"SENT_AN_ATTACHMENT": "envoyé une pièce jointe",
|
|
72
|
+
"SENT_AN_IMAGE": "envoyé une image",
|
|
73
|
+
|
|
74
|
+
"LABEL_PRECHAT_USER_FULLNAME": "Nom complet",
|
|
75
|
+
"LABEL_PRECHAT_USER_EMAIL": "E-mail",
|
|
76
|
+
"LABEL_PRECHAT_USER_EMAIL_ERROR": "Adresse e-mail invalide",
|
|
77
|
+
"LABEL_PRECHAT_USER_PHONE": "Téléphone",
|
|
78
|
+
"LABEL_PRECHAT_USER_PHONE_ERROR": "Le téléphone est requis",
|
|
79
|
+
"LABEL_PRECHAT_FIRST_MESSAGE": "Votre message pour l'équipe d'assistance",
|
|
80
|
+
"LABEL_PRECHAT_STATIC_TERMS_PRIVACY": "Avant de poursuivre la conversation, veuillez accepter nos <a href='https://tiledesk.com/termsofservice/' target='_blank'>Conditions</a> et <a href='https:/ /tiledesk.com/privacy.html' target='_blank'>Politique de confidentialité</a>",
|
|
81
|
+
"LABEL_PRECHAT_ACCEPT_TERMS_PRIVACY": "Je suis d'accord",
|
|
82
|
+
"PRECHAT_REQUIRED_ERROR": "Ce champ est obligatoire",
|
|
66
83
|
|
|
67
84
|
"LABEL_TODAY": "aujourd'hui",
|
|
68
85
|
"LABEL_TOMORROW": "hier",
|
|
69
86
|
"LABEL_LAST_ACCESS": "dernier accès",
|
|
70
87
|
"LABEL_TO": "à",
|
|
71
88
|
"ARRAY_DAYS": ["Lundi", "Mardi", "Mercredi", "Jeudi", "Vendredi", "Samedi", "Dimanche"],
|
|
72
|
-
|
|
73
|
-
"SENT_AN_ATTACHMENT": "envoyé une pièce jointe",
|
|
74
|
-
"SENT_AN_IMAGE":"envoyé une image",
|
|
75
|
-
|
|
76
89
|
"LABEL_PREVIEW": "Aperçu"
|
|
77
90
|
}
|
package/src/assets/i18n/it.json
CHANGED
|
@@ -10,7 +10,6 @@
|
|
|
10
10
|
"LABEL_ERROR_FIELD_NAME": "Nome richiesto (minimo 2 caratteri).",
|
|
11
11
|
"LABEL_FIELD_EMAIL": "Email",
|
|
12
12
|
"LABEL_ERROR_FIELD_EMAIL": "Inserisci un indirizzo email valido.",
|
|
13
|
-
"LABEL_ERROR_FIELD_REQUIRED":"Campo obbligatorio",
|
|
14
13
|
"LABEL_WRITING": "sta scrivendo...",
|
|
15
14
|
"LABEL_SEND_NEW_MESSAGE": "Invia un nuovo messaggio",
|
|
16
15
|
"AGENT_NOT_AVAILABLE": " Offline",
|
|
@@ -39,10 +38,11 @@
|
|
|
39
38
|
"WELLCOME_TITLE": "Ciao, benvenuto su Tiledesk 👋",
|
|
40
39
|
"WELLCOME_MSG": "Come possiamo aiutarti?",
|
|
41
40
|
"OPTIONS": "opzioni",
|
|
42
|
-
"SOUND_OFF": "
|
|
43
|
-
"SOUND_ON": "
|
|
44
|
-
"LOGOUT": "
|
|
41
|
+
"SOUND_OFF": "Suono spento",
|
|
42
|
+
"SOUND_ON": "Suono acceso",
|
|
43
|
+
"LOGOUT": "Disconnetti",
|
|
45
44
|
"CLOSE": "Chiudi",
|
|
45
|
+
"RESTART":"Ricomincia",
|
|
46
46
|
"PREV_CONVERSATIONS": "Le tue conversazioni",
|
|
47
47
|
"YOU": "Tu",
|
|
48
48
|
"SHOW_ALL_CONV": "vedi tutte",
|
|
@@ -51,8 +51,10 @@
|
|
|
51
51
|
"SEE_PREVIOUS": "vedi precedenti",
|
|
52
52
|
"WAITING_TIME_FOUND": "Il team tipicamente risponde in $reply_time",
|
|
53
53
|
"WAITING_TIME_NOT_FOUND": "Vi risponderemo appena possibile",
|
|
54
|
-
"CLOSED": "
|
|
55
|
-
|
|
54
|
+
"CLOSED": "Chiusa",
|
|
55
|
+
"CLOSE_CHAT": "Chiudi chat",
|
|
56
|
+
"MINIMIZE":"Minimizza",
|
|
57
|
+
"MAXIMIZE":"Massimizza",
|
|
56
58
|
"INFO_SUPPORT_USER_ADDED_SUBJECT":"tu",
|
|
57
59
|
"INFO_SUPPORT_USER_ADDED_YOU_VERB":"sei stato aggiunto ",
|
|
58
60
|
"INFO_SUPPORT_USER_ADDED_COMPLEMENT":"si è unito",
|
|
@@ -63,15 +65,26 @@
|
|
|
63
65
|
"INFO_SUPPORT_MEMBER_LEFT_GROUP":"ha lasciato il gruppo",
|
|
64
66
|
"INFO_SUPPORT_MEMBER_ABANDONED_GROUP": "ha abbandonato la conversazione",
|
|
65
67
|
"INFO_A_NEW_SUPPORT_REQUEST_HAS_BEEN_ASSIGNED_TO_YOU": "Una nuova richiesta di supporto è stata assegnata a te",
|
|
68
|
+
"TICKET_TAKING":"La richiesta è stata ricevuta e il personale di assistenza se ne sta occupando.\nPer aggiungere ulteriori commenti, rispondi a questa email.",
|
|
69
|
+
|
|
70
|
+
"LABEL_ERROR_FIELD_REQUIRED": "Campo richiesto",
|
|
71
|
+
"SENT_AN_ATTACHMENT": "ha inviato un allegato",
|
|
72
|
+
"SENT_AN_IMAGE":"ha inviato un'immagine",
|
|
73
|
+
|
|
74
|
+
"LABEL_PRECHAT_USER_FULLNAME": "Nome completo",
|
|
75
|
+
"LABEL_PRECHAT_USER_EMAIL": "E-mail",
|
|
76
|
+
"LABEL_PRECHAT_USER_EMAIL_ERROR": "Indirizzo email non valido",
|
|
77
|
+
"LABEL_PRECHAT_USER_PHONE": "Telefono",
|
|
78
|
+
"LABEL_PRECHAT_USER_PHONE_ERROR": "Telefono richiesto",
|
|
79
|
+
"LABEL_PRECHAT_FIRST_MESSAGE": "Il tuo messaggio per il team di supporto",
|
|
80
|
+
"LABEL_PRECHAT_STATIC_TERMS_PRIVACY": "Prima di procedere nella conversazione, accetta i nostri <a href='https://tiledesk.com/termsofservice/' target='_blank'>Termini</a> e <a href='https:/ /tiledesk.com/privacy.html' target='_blank'>Norme sulla privacy</a>",
|
|
81
|
+
"LABEL_PRECHAT_ACCEPT_TERMS_PRIVACY": "Sono d'accordo",
|
|
82
|
+
"PRECHAT_REQUIRED_ERROR": "Questo campo è obbligatorio",
|
|
66
83
|
|
|
67
84
|
"LABEL_TODAY": "oggi",
|
|
68
85
|
"LABEL_TOMORROW": "ieri",
|
|
69
86
|
"LABEL_LAST_ACCESS": "ultimo accesso",
|
|
70
|
-
"LABEL_TO": "
|
|
87
|
+
"LABEL_TO": "a",
|
|
71
88
|
"ARRAY_DAYS": ["Lunedì", "Martedì", "Mercoledì", "Giovedì", "Venerdì", "Sabato", "Domenica"],
|
|
72
|
-
|
|
73
|
-
"SENT_AN_ATTACHMENT": "ha inviato un allegato",
|
|
74
|
-
"SENT_AN_IMAGE":"ha inviato un'immagine",
|
|
75
|
-
|
|
76
89
|
"LABEL_PREVIEW": "Anteprima"
|
|
77
90
|
}
|
|
@@ -1722,7 +1722,7 @@
|
|
|
1722
1722
|
<div class="row">
|
|
1723
1723
|
<div class="col-md-5 formElement"><span><em><strong>themeColorOpacity</strong></em></span></div>
|
|
1724
1724
|
<div class="col-md-5 formElement">
|
|
1725
|
-
<input class="form-range" type="range" id="themeColorOpacity" name="themeColorOpacity" min="0" max="100" value="
|
|
1725
|
+
<input class="form-range" type="range" id="themeColorOpacity" name="themeColorOpacity" min="0" max="100" value="100" style="width: 80%;" oninput="onChangeThemeColorOpacity()"><label class="col-form-label" id="themeColorOpacityText">100 %</label>
|
|
1726
1726
|
</div>
|
|
1727
1727
|
<div class="col-md-2">
|
|
1728
1728
|
<button class="btn btn-light" onclick="onClickThemeColorOpacity()">Test this setting <i class="fa fa-magic" aria-hidden="true"></i></button>
|
|
@@ -220,40 +220,6 @@ export class FirebaseConversationHandler extends ConversationHandlerService {
|
|
|
220
220
|
// this.ref.off();
|
|
221
221
|
}
|
|
222
222
|
|
|
223
|
-
|
|
224
|
-
// ---------------------------------------------------------- //
|
|
225
|
-
// BEGIN PRIVATE FUNCTIONS
|
|
226
|
-
// ---------------------------------------------------------- //
|
|
227
|
-
/** */
|
|
228
|
-
// private setAttributes(): any {
|
|
229
|
-
// const attributes: any = {
|
|
230
|
-
// client: this.CLIENT_BROWSER,
|
|
231
|
-
// sourcePage: location.href,
|
|
232
|
-
|
|
233
|
-
// };
|
|
234
|
-
|
|
235
|
-
// if(this.loggedUser && this.loggedUser.email ){
|
|
236
|
-
// attributes.userEmail = this.loggedUser.email
|
|
237
|
-
// }
|
|
238
|
-
// if(this.loggedUser && this.loggedUser.fullname) {
|
|
239
|
-
// attributes.userFullname = this.loggedUser.fullname
|
|
240
|
-
// }
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
// // let attributes: any = JSON.parse(sessionStorage.getItem('attributes'));
|
|
244
|
-
// // if (!attributes || attributes === 'undefined') {
|
|
245
|
-
// // attributes = {
|
|
246
|
-
// // client: this.CLIENT_BROWSER,
|
|
247
|
-
// // sourcePage: location.href,
|
|
248
|
-
// // userEmail: this.loggedUser.email,
|
|
249
|
-
// // userFullname: this.loggedUser.fullname
|
|
250
|
-
// // };
|
|
251
|
-
// // this.logger.printLog('>>>>>>>>>>>>>> setAttributes: ', JSON.stringify(attributes));
|
|
252
|
-
// // sessionStorage.setItem('attributes', JSON.stringify(attributes));
|
|
253
|
-
// // }
|
|
254
|
-
// return attributes;
|
|
255
|
-
// }
|
|
256
|
-
|
|
257
223
|
/** */
|
|
258
224
|
private added(childSnapshot: any) {
|
|
259
225
|
const msg = this.messageGenerate(childSnapshot);
|
|
@@ -270,6 +236,10 @@ export class FirebaseConversationHandler extends ConversationHandlerService {
|
|
|
270
236
|
if(this.isValidMessage(msg)){
|
|
271
237
|
// msg.attributes && msg.attributes['subtype'] === 'info'
|
|
272
238
|
let isInfoMessage = messageType(MESSAGE_TYPE_INFO, msg)
|
|
239
|
+
if(isInfoMessage){
|
|
240
|
+
this.messageInfo.next(msg)
|
|
241
|
+
}
|
|
242
|
+
|
|
273
243
|
if(isInfoMessage && hideInfoMessage(msg, this.showInfoMessage)){
|
|
274
244
|
//if showBubbleInfoMessage array keys not includes msg.attributes.messagelabel['key'] exclude CURRENT INFO MESSAGE
|
|
275
245
|
return;
|
|
@@ -281,9 +251,7 @@ export class FirebaseConversationHandler extends ConversationHandlerService {
|
|
|
281
251
|
}
|
|
282
252
|
}
|
|
283
253
|
|
|
284
|
-
|
|
285
|
-
this.messageInfo.next(msg)
|
|
286
|
-
}
|
|
254
|
+
|
|
287
255
|
|
|
288
256
|
this.addRepalceMessageInArray(msg.uid, msg);
|
|
289
257
|
this.messageAdded.next(msg);
|
|
@@ -350,11 +318,6 @@ export class FirebaseConversationHandler extends ConversationHandlerService {
|
|
|
350
318
|
if (messageType(MESSAGE_TYPE_INFO, msg)) {
|
|
351
319
|
this.translateInfoSupportMessages(msg);
|
|
352
320
|
}
|
|
353
|
-
/// commented because NOW ATTRIBUTES COMES FROM OUTSIDE
|
|
354
|
-
// if (msg.attributes && msg.attributes.projectId) {
|
|
355
|
-
// this.attributes.projectId = msg.attributes.projectId;
|
|
356
|
-
// // sessionStorage.setItem('attributes', JSON.stringify(attributes));
|
|
357
|
-
// }
|
|
358
321
|
return msg;
|
|
359
322
|
}
|
|
360
323
|
|
|
@@ -380,11 +343,7 @@ export class FirebaseConversationHandler extends ConversationHandlerService {
|
|
|
380
343
|
if (messageType(MESSAGE_TYPE_INFO, msg)) {
|
|
381
344
|
this.translateInfoSupportMessages(msg);
|
|
382
345
|
}
|
|
383
|
-
|
|
384
|
-
// if (msg.attributes && msg.attributes.projectId) {
|
|
385
|
-
// this.attributes.projectId = msg.attributes.projectId;
|
|
386
|
-
// // sessionStorage.setItem('attributes', JSON.stringify(attributes));
|
|
387
|
-
// }
|
|
346
|
+
|
|
388
347
|
return msg;
|
|
389
348
|
}
|
|
390
349
|
|
|
@@ -212,31 +212,15 @@ export class MQTTConversationHandler extends ConversationHandlerService {
|
|
|
212
212
|
// this.ref.off();
|
|
213
213
|
}
|
|
214
214
|
|
|
215
|
-
|
|
216
|
-
// ---------------------------------------------------------- //
|
|
217
|
-
// BEGIN PRIVATE FUNCTIONS
|
|
218
|
-
// ---------------------------------------------------------- //
|
|
219
|
-
/** */
|
|
220
|
-
// private setAttributes(): any {
|
|
221
|
-
// let attributes: any = JSON.parse(sessionStorage.getItem('attributes'));
|
|
222
|
-
// if (!attributes || attributes === 'undefined') {
|
|
223
|
-
// attributes = {
|
|
224
|
-
// client: this.CLIENT_BROWSER,
|
|
225
|
-
// sourcePage: location.href,
|
|
226
|
-
// userEmail: this.loggedUser.email,
|
|
227
|
-
// userFullname: this.loggedUser.fullname
|
|
228
|
-
// };
|
|
229
|
-
// this.logger.log('>>>>>>>>>>>>>> setAttributes: ', JSON.stringify(attributes));
|
|
230
|
-
// sessionStorage.setItem('attributes', JSON.stringify(attributes));
|
|
231
|
-
// }
|
|
232
|
-
// return attributes;
|
|
233
|
-
// }
|
|
234
|
-
|
|
235
215
|
/** */
|
|
236
216
|
private addedMessage(messageSnapshot: any) {
|
|
237
217
|
const msg = this.messageGenerate(messageSnapshot);
|
|
238
218
|
msg.uid = msg.message_id;
|
|
239
219
|
let isInfoMessage = messageType(MESSAGE_TYPE_INFO, msg)
|
|
220
|
+
if(isInfoMessage){
|
|
221
|
+
this.messageInfo.next(msg)
|
|
222
|
+
}
|
|
223
|
+
|
|
240
224
|
if(isInfoMessage && hideInfoMessage(msg, this.showInfoMessage)){
|
|
241
225
|
//if showBubbleInfoMessage array keys not includes msg.attributes.messagelabel['key'] exclude CURRENT INFO MESSAGE
|
|
242
226
|
return;
|
|
@@ -248,9 +232,7 @@ export class MQTTConversationHandler extends ConversationHandlerService {
|
|
|
248
232
|
}
|
|
249
233
|
}
|
|
250
234
|
|
|
251
|
-
|
|
252
|
-
this.messageInfo.next(msg)
|
|
253
|
-
}
|
|
235
|
+
|
|
254
236
|
|
|
255
237
|
// imposto il giorno del messaggio per visualizzare o nascondere l'header data
|
|
256
238
|
msg.headerDate = null;
|
|
@@ -3,15 +3,19 @@ import { TestBed } from '@angular/core/testing';
|
|
|
3
3
|
import { AppStorageService } from '../abstract/app-storage.service';
|
|
4
4
|
import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing';
|
|
5
5
|
import { TiledeskAuthService } from './tiledesk-auth.service';
|
|
6
|
+
import { NGXLogger } from 'ngx-logger';
|
|
7
|
+
import { CustomLogger } from '../logger/customLogger';
|
|
8
|
+
import { LoggerInstance } from '../logger/loggerInstance';
|
|
6
9
|
|
|
7
10
|
describe('TiledeskAuthService', () => {
|
|
8
11
|
// let httpClientMock;
|
|
9
12
|
let httpMock: HttpTestingController;
|
|
10
13
|
let service : TiledeskAuthService;
|
|
11
14
|
let appStorage: AppStorageService;
|
|
15
|
+
let ngxlogger: NGXLogger;
|
|
16
|
+
let customLogger = new CustomLogger(ngxlogger)
|
|
12
17
|
|
|
13
18
|
beforeEach(() => {
|
|
14
|
-
|
|
15
19
|
TestBed.configureTestingModule({
|
|
16
20
|
providers: [
|
|
17
21
|
TiledeskAuthService,
|
|
@@ -22,11 +26,17 @@ describe('TiledeskAuthService', () => {
|
|
|
22
26
|
})
|
|
23
27
|
|
|
24
28
|
// httpClientMock = jasmine.createSpyObj(['getAllObjects']);
|
|
25
|
-
httpMock = TestBed.
|
|
26
|
-
service = TestBed.
|
|
27
|
-
appStorage = TestBed.
|
|
29
|
+
httpMock = TestBed.inject(HttpTestingController);
|
|
30
|
+
service = TestBed.inject(TiledeskAuthService);
|
|
31
|
+
appStorage = TestBed.inject(AppStorageService)
|
|
32
|
+
|
|
33
|
+
LoggerInstance.setInstance(customLogger)
|
|
34
|
+
let logger = LoggerInstance.getInstance()
|
|
35
|
+
service['logger']= logger
|
|
28
36
|
});
|
|
29
37
|
|
|
38
|
+
|
|
39
|
+
|
|
30
40
|
afterEach(() => {
|
|
31
41
|
// After every test, assert that there are no more pending requests.
|
|
32
42
|
httpMock.verify();
|
|
@@ -56,23 +66,23 @@ describe('TiledeskAuthService', () => {
|
|
|
56
66
|
}
|
|
57
67
|
}
|
|
58
68
|
|
|
59
|
-
it('signInAnonymously api return tiledeskToken', (done) => {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
69
|
+
// it('signInAnonymously api return tiledeskToken', (done) => {
|
|
70
|
+
// const base_url = 'https://tiledesk-server-pre.herokuapp.com/'
|
|
71
|
+
// const projectId = '6013ec749b32000045be650e'
|
|
72
|
+
// service.appStorage = appStorage
|
|
63
73
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
74
|
+
// service.initialize(base_url)
|
|
75
|
+
// service.signInAnonymously(projectId).then(response => {
|
|
76
|
+
// console.log('response', response)
|
|
77
|
+
// // expect(response).not.toBeUndefined()
|
|
78
|
+
// // done()
|
|
79
|
+
// // fail()
|
|
80
|
+
// });
|
|
71
81
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
})
|
|
82
|
+
// const req = httpMock.expectOne(service.SERVER_BASE_URL + 'auth/signinAnonymously');
|
|
83
|
+
// expect(req.request.method).toBe('POST');
|
|
84
|
+
// req.flush(dummyResponseSignInAnonymously);
|
|
85
|
+
// })
|
|
76
86
|
|
|
77
87
|
|
|
78
88
|
});
|