@chat21/chat21-web-widget 5.1.34-rc1 → 5.1.34
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/.github/workflows/docker-community-push-latest.yml +13 -23
- package/.github/workflows/docker-image-tag-community-tag-push.yml +12 -22
- package/CHANGELOG.md +8 -129
- package/Dockerfile +5 -4
- package/angular.json +3 -21
- package/docs/changelog/this-branch.md +0 -36
- package/env.sample +2 -3
- package/nginx.conf +2 -22
- package/package.json +3 -10
- package/src/app/app.component.html +2 -2
- package/src/app/app.component.scss +14 -25
- package/src/app/app.component.spec.ts +6 -21
- package/src/app/app.component.ts +9 -10
- package/src/app/app.module.ts +0 -13
- package/src/app/component/conversation-detail/conversation/conversation.component.html +11 -25
- package/src/app/component/conversation-detail/conversation/conversation.component.scss +2 -40
- package/src/app/component/conversation-detail/conversation/conversation.component.spec.ts +75 -644
- package/src/app/component/conversation-detail/conversation/conversation.component.ts +14 -100
- package/src/app/component/conversation-detail/conversation-audio-recorder/conversation-audio-recorder.component.html +13 -25
- package/src/app/component/conversation-detail/conversation-audio-recorder/conversation-audio-recorder.component.spec.ts +5 -123
- package/src/app/component/conversation-detail/conversation-audio-recorder/conversation-audio-recorder.component.ts +0 -1
- package/src/app/component/conversation-detail/conversation-content/conversation-content.component.html +10 -23
- package/src/app/component/conversation-detail/conversation-content/conversation-content.component.scss +1 -19
- package/src/app/component/conversation-detail/conversation-content/conversation-content.component.spec.ts +149 -242
- package/src/app/component/conversation-detail/conversation-content/conversation-content.component.ts +5 -8
- package/src/app/component/conversation-detail/conversation-emojii/conversation-emojii.component.spec.ts +3 -53
- package/src/app/component/conversation-detail/conversation-footer/conversation-footer.component.html +96 -200
- package/src/app/component/conversation-detail/conversation-footer/conversation-footer.component.scss +6 -211
- package/src/app/component/conversation-detail/conversation-footer/conversation-footer.component.spec.ts +78 -452
- package/src/app/component/conversation-detail/conversation-footer/conversation-footer.component.ts +76 -291
- package/src/app/component/conversation-detail/conversation-header/conversation-header.component.html +53 -113
- package/src/app/component/conversation-detail/conversation-header/conversation-header.component.scss +4 -12
- package/src/app/component/conversation-detail/conversation-header/conversation-header.component.spec.ts +29 -274
- package/src/app/component/conversation-detail/conversation-internal-frame/conversation-internal-frame.component.html +9 -23
- package/src/app/component/conversation-detail/conversation-internal-frame/conversation-internal-frame.component.spec.ts +8 -80
- package/src/app/component/conversation-detail/conversation-preview/conversation-preview.component.html +23 -29
- package/src/app/component/conversation-detail/conversation-preview/conversation-preview.component.spec.ts +16 -185
- package/src/app/component/conversation-detail/conversation-preview/conversation-preview.component.ts +14 -34
- package/src/app/component/error-alert/error-alert.component.spec.ts +5 -65
- package/src/app/component/eyeeye-catcher-card/eyeeye-catcher-card.component.html +7 -16
- package/src/app/component/eyeeye-catcher-card/eyeeye-catcher-card.component.scss +0 -21
- package/src/app/component/eyeeye-catcher-card/eyeeye-catcher-card.component.spec.ts +7 -89
- package/src/app/component/form/form-builder/form-builder.component.html +1 -1
- package/src/app/component/form/form-builder/form-builder.component.spec.ts +21 -163
- package/src/app/component/form/inputs/form-checkbox/form-checkbox.component.html +4 -8
- package/src/app/component/form/inputs/form-checkbox/form-checkbox.component.scss +5 -10
- package/src/app/component/form/inputs/form-checkbox/form-checkbox.component.spec.ts +16 -90
- package/src/app/component/form/inputs/form-checkbox/form-checkbox.component.ts +0 -26
- package/src/app/component/form/inputs/form-label/form-label.component.spec.ts +11 -45
- package/src/app/component/form/inputs/form-radio-button/form-radio-button.component.spec.ts +6 -24
- package/src/app/component/form/inputs/form-select/form-select.component.spec.ts +5 -14
- package/src/app/component/form/inputs/form-text/form-text.component.html +12 -14
- package/src/app/component/form/inputs/form-text/form-text.component.scss +1 -11
- package/src/app/component/form/inputs/form-text/form-text.component.spec.ts +17 -113
- package/src/app/component/form/inputs/form-text/form-text.component.ts +3 -35
- package/src/app/component/form/inputs/form-textarea/form-textarea.component.html +11 -13
- package/src/app/component/form/inputs/form-textarea/form-textarea.component.scss +5 -6
- package/src/app/component/form/inputs/form-textarea/form-textarea.component.spec.ts +13 -149
- package/src/app/component/form/inputs/form-textarea/form-textarea.component.ts +0 -26
- package/src/app/component/form/prechat-form/prechat-form.component.html +11 -14
- package/src/app/component/form/prechat-form/prechat-form.component.spec.ts +10 -102
- package/src/app/component/form/prechat-form/prechat-form.component.ts +1 -8
- package/src/app/component/home/home.component.html +31 -38
- package/src/app/component/home/home.component.scss +2 -4
- package/src/app/component/home/home.component.spec.ts +11 -226
- package/src/app/component/home-conversations/home-conversations.component.html +26 -30
- package/src/app/component/home-conversations/home-conversations.component.scss +0 -3
- package/src/app/component/home-conversations/home-conversations.component.spec.ts +36 -212
- package/src/app/component/last-message/last-message.component.html +9 -15
- package/src/app/component/last-message/last-message.component.scss +2 -16
- package/src/app/component/last-message/last-message.component.spec.ts +23 -204
- package/src/app/component/last-message/last-message.component.ts +1 -4
- package/src/app/component/launcher-button/launcher-button.component.html +13 -8
- package/src/app/component/launcher-button/launcher-button.component.spec.ts +8 -104
- package/src/app/component/list-all-conversations/list-all-conversations.component.html +17 -12
- package/src/app/component/list-all-conversations/list-all-conversations.component.scss +0 -2
- package/src/app/component/list-conversations/list-conversations.component.html +22 -22
- package/src/app/component/menu-options/menu-options.component.html +20 -30
- package/src/app/component/menu-options/menu-options.component.spec.ts +9 -125
- package/src/app/component/message/audio/audio.component.html +15 -13
- package/src/app/component/message/audio/audio.component.spec.ts +5 -140
- package/src/app/component/message/audio/audio.component.ts +5 -1
- package/src/app/component/message/avatar/avatar.component.html +2 -2
- package/src/app/component/message/avatar/avatar.component.spec.ts +7 -99
- package/src/app/component/message/bubble-message/bubble-message.component.html +51 -38
- package/src/app/component/message/bubble-message/bubble-message.component.scss +1 -54
- package/src/app/component/message/bubble-message/bubble-message.component.spec.ts +57 -154
- package/src/app/component/message/bubble-message/bubble-message.component.ts +11 -89
- package/src/app/component/message/buttons/action-button/action-button.component.html +4 -3
- package/src/app/component/message/buttons/action-button/action-button.component.spec.ts +5 -49
- package/src/app/component/message/buttons/link-button/link-button.component.scss +8 -5
- package/src/app/component/message/buttons/link-button/link-button.component.spec.ts +5 -50
- package/src/app/component/message/buttons/text-button/text-button.component.spec.ts +5 -44
- package/src/app/component/message/carousel/carousel.component.html +16 -29
- package/src/app/component/message/carousel/carousel.component.scss +8 -20
- package/src/app/component/message/carousel/carousel.component.spec.ts +3 -80
- package/src/app/component/message/carousel/carousel.component.ts +0 -16
- package/src/app/component/message/frame/frame.component.html +4 -9
- package/src/app/component/message/frame/frame.component.spec.ts +15 -34
- package/src/app/component/message/frame/frame.component.ts +2 -7
- package/src/app/component/message/html/html.component.html +1 -1
- package/src/app/component/message/html/html.component.scss +1 -1
- package/src/app/component/message/html/html.component.spec.ts +7 -24
- package/src/app/component/message/image/image.component.html +10 -12
- package/src/app/component/message/image/image.component.scss +0 -16
- package/src/app/component/message/image/image.component.spec.ts +15 -101
- package/src/app/component/message/image/image.component.ts +51 -90
- package/src/app/component/message/info-message/info-message.component.spec.ts +14 -26
- package/src/app/component/message/like-unlike/like-unlike.component.html +9 -7
- package/src/app/component/message/like-unlike/like-unlike.component.spec.ts +3 -31
- package/src/app/component/message/return-receipt/return-receipt.component.spec.ts +17 -38
- package/src/app/component/message/text/text.component.html +3 -3
- package/src/app/component/message/text/text.component.scss +86 -80
- package/src/app/component/message/text/text.component.spec.ts +13 -106
- package/src/app/component/message-attachment/message-attachment.component.spec.ts +13 -134
- package/src/app/component/selection-department/selection-department.component.html +23 -21
- package/src/app/component/selection-department/selection-department.component.spec.ts +14 -159
- package/src/app/component/selection-department/selection-department.component.ts +1 -8
- package/src/app/component/send-button/send-button.component.html +13 -5
- package/src/app/component/send-button/send-button.component.spec.ts +2 -2
- package/src/app/component/star-rating-widget/star-rating-widget.component.html +81 -51
- package/src/app/directives/tooltip.directive.spec.ts +4 -8
- package/src/app/modals/confirm-close/confirm-close.component.html +8 -20
- package/src/app/modals/confirm-close/confirm-close.component.scss +0 -3
- package/src/app/modals/confirm-close/confirm-close.component.spec.ts +4 -13
- package/src/app/modals/confirm-close/confirm-close.component.ts +1 -8
- package/src/app/pipe/html-entites-encode.pipe.spec.ts +2 -35
- package/src/app/pipe/marked.pipe.spec.ts +2 -38
- package/src/app/pipe/marked.pipe.ts +41 -51
- package/src/app/providers/app-config.service.ts +2 -4
- package/src/app/providers/brand.service.spec.ts +2 -23
- package/src/app/providers/brand.service.ts +1 -1
- package/src/app/providers/global-settings.service.spec.ts +14 -1009
- package/src/app/providers/global-settings.service.ts +2 -82
- package/src/app/providers/translator.service.ts +6 -26
- package/src/app/sass/_variables.scss +0 -3
- package/src/app/sass/animations.scss +1 -19
- package/src/app/utils/globals.ts +1 -21
- package/src/app/utils/utils-resources.ts +1 -1
- package/src/assets/i18n/en.json +99 -106
- package/src/assets/i18n/es.json +100 -107
- package/src/assets/i18n/fr.json +100 -107
- package/src/assets/i18n/it.json +98 -107
- package/src/assets/twp/index-dev.html +0 -18
- package/src/chat21-core/models/message.ts +1 -2
- package/src/chat21-core/providers/firebase/firebase-conversation-handler.ts +2 -3
- package/src/chat21-core/providers/mqtt/mqtt-conversation-handler.ts +0 -12
- package/src/chat21-core/providers/scripts/script.service.spec.ts +2 -12
- package/src/chat21-core/providers/tiledesk/tiledesk-requests.service.ts +1 -1
- package/src/chat21-core/utils/utils-message.ts +0 -7
- package/src/chat21-core/utils/utils.ts +2 -5
- package/src/widget-config-template.json +1 -4
- package/src/widget-config.json +1 -4
- package/tsconfig.json +0 -5
- package/.angular-mcp-cache/package.json +0 -1
- package/.cursor/angular18-accessibility-auditor-skill.md +0 -442
- package/.cursor/mcp.json +0 -15
- package/.github/workflows/build.yml +0 -22
- package/.github/workflows/playwright.yml +0 -27
- package/mocks/voice-websocket-mock/server.cjs +0 -245
- package/playwright.config.ts +0 -41
- package/src/app/component/conversation-detail/stream-audio-spectrum/stream-audio-spectrum.component.html +0 -46
- package/src/app/component/conversation-detail/stream-audio-spectrum/stream-audio-spectrum.component.scss +0 -83
- package/src/app/component/conversation-detail/stream-audio-spectrum/stream-audio-spectrum.component.ts +0 -192
- package/src/app/component/form/prechat-form-test-mock.ts +0 -35
- package/src/app/component/message/audio-sync/audio-sync.component.html +0 -18
- package/src/app/component/message/audio-sync/audio-sync.component.scss +0 -65
- package/src/app/component/message/audio-sync/audio-sync.component.spec.ts +0 -103
- package/src/app/component/message/audio-sync/audio-sync.component.ts +0 -643
- package/src/app/providers/tts-audio-playback-coordinator.service.spec.ts +0 -117
- package/src/app/providers/tts-audio-playback-coordinator.service.ts +0 -109
- package/src/app/providers/voice/STT&TTS/openai-voice.config.ts +0 -12
- package/src/app/providers/voice/STT&TTS/openai-voice.provider.ts +0 -171
- package/src/app/providers/voice/STT&TTS/speech-provider.abstract.ts +0 -39
- package/src/app/providers/voice/audio.types.ts +0 -40
- package/src/app/providers/voice/vad.service.spec.ts +0 -28
- package/src/app/providers/voice/vad.service.ts +0 -70
- package/src/app/providers/voice/voice-streaming.service.spec.ts +0 -23
- package/src/app/providers/voice/voice-streaming.service.ts +0 -702
- package/src/app/providers/voice/voice-streaming.types.ts +0 -112
- package/src/app/providers/voice/voice.service.spec.ts +0 -227
- package/src/app/providers/voice/voice.service.ts +0 -973
- package/src/app/shims/onnxruntime-web-wasm.ts +0 -4
- package/src/assets/onnx/ort-wasm-simd-threaded.mjs +0 -59
- package/src/assets/onnx/ort-wasm-simd-threaded.wasm +0 -0
- package/src/assets/sounds/keyboard.mp3 +0 -0
- package/src/assets/twp/tiledesk_widget_files/widget-css-override-example.css +0 -14
- package/src/assets/vad/silero_vad_legacy.onnx +0 -0
- package/src/assets/vad/vad.worklet.bundle.min.js +0 -1
- package/src/chat21-core/providers/chat-manager.spec.ts +0 -72
- package/tests/widget-form-rich.spec.ts +0 -67
- package/tests/widget-index-dev-settings.spec.ts +0 -52
- package/tests/widget-twp-iframe.spec.ts +0 -39
|
@@ -1,179 +1,34 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { ComponentFixture, fakeAsync, TestBed, tick, waitForAsync } from '@angular/core/testing';
|
|
4
|
-
import { By } from '@angular/platform-browser';
|
|
5
|
-
import { NGXLogger } from 'ngx-logger';
|
|
6
|
-
|
|
1
|
+
import { ElementRef } from '@angular/core';
|
|
2
|
+
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
|
7
3
|
import { AppStorageService } from '../../../chat21-core/providers/abstract/app-storage.service';
|
|
8
|
-
import { CustomLogger } from '../../../chat21-core/providers/logger/customLogger';
|
|
9
|
-
import { LoggerInstance } from '../../../chat21-core/providers/logger/loggerInstance';
|
|
10
4
|
import { Globals } from '../../utils/globals';
|
|
11
5
|
|
|
12
6
|
import { SelectionDepartmentComponent } from './selection-department.component';
|
|
13
7
|
|
|
14
|
-
@Injectable()
|
|
15
|
-
class AppStorageServiceStub extends AppStorageService {
|
|
16
|
-
lastAttributesJson: string | null = null;
|
|
17
|
-
setItem = jasmine.createSpy('setItem').and.callFake((key: string, value: any) => {
|
|
18
|
-
if (key === 'attributes') {
|
|
19
|
-
this.lastAttributesJson = value as string;
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
|
-
getItem(): any {
|
|
23
|
-
return null;
|
|
24
|
-
}
|
|
25
|
-
getItemWithoutProjectID(): any {
|
|
26
|
-
return null;
|
|
27
|
-
}
|
|
28
|
-
setItemWithoutProjectID(): void {}
|
|
29
|
-
removeItem(): void {}
|
|
30
|
-
clear(): void {}
|
|
31
|
-
initialize(): void {}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
8
|
describe('SelectionDepartmentComponent', () => {
|
|
35
9
|
let component: SelectionDepartmentComponent;
|
|
36
10
|
let fixture: ComponentFixture<SelectionDepartmentComponent>;
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
beforeEach(waitForAsync(() => {
|
|
41
|
-
const ngxlogger = jasmine.createSpyObj('NGXLogger', ['log', 'trace', 'debug', 'warn', 'error', 'info']);
|
|
42
|
-
LoggerInstance.setInstance(new CustomLogger(ngxlogger));
|
|
11
|
+
class MockElementRef {}
|
|
12
|
+
|
|
13
|
+
beforeEach(async(() => {
|
|
43
14
|
TestBed.configureTestingModule({
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
15
|
+
declarations: [ SelectionDepartmentComponent ],
|
|
16
|
+
providers: [
|
|
17
|
+
Globals,
|
|
18
|
+
{ provide: ElementRef, useClass: MockElementRef },
|
|
19
|
+
AppStorageService
|
|
20
|
+
]
|
|
21
|
+
})
|
|
22
|
+
.compileComponents();
|
|
52
23
|
}));
|
|
53
24
|
|
|
54
25
|
beforeEach(() => {
|
|
55
26
|
fixture = TestBed.createComponent(SelectionDepartmentComponent);
|
|
56
27
|
component = fixture.componentInstance;
|
|
57
|
-
|
|
58
|
-
storage = TestBed.inject(AppStorageService) as unknown as AppStorageServiceStub;
|
|
59
|
-
globals.initDefafultParameters();
|
|
60
|
-
globals.themeColor = '#112233';
|
|
61
|
-
globals.themeForegroundColor = '#ddeeff';
|
|
62
|
-
globals.colorGradient180 = 'linear-gradient(#000,#fff)';
|
|
63
|
-
globals.LABEL_SELECT_TOPIC = 'Scegli un argomento';
|
|
64
|
-
globals.BUTTON_CLOSE_TO_ICON = 'Chiudi';
|
|
65
|
-
globals.departments = [
|
|
66
|
-
{ _id: 'dep-a', name: 'Vendite' } as any,
|
|
67
|
-
{ _id: 'dep-b', name: 'Supporto' } as any,
|
|
68
|
-
];
|
|
69
|
-
globals.attributes = { userFullname: 'Ada', userEmail: 'ada@example.com' } as any;
|
|
70
|
-
globals.windowContext = {} as any;
|
|
28
|
+
fixture.detectChanges();
|
|
71
29
|
});
|
|
72
30
|
|
|
73
31
|
it('should create', () => {
|
|
74
|
-
fixture.detectChanges();
|
|
75
32
|
expect(component).toBeTruthy();
|
|
76
33
|
});
|
|
77
|
-
|
|
78
|
-
it('should render dialog with topic label and one list row per department', () => {
|
|
79
|
-
fixture.detectChanges();
|
|
80
|
-
const dialog = fixture.nativeElement.querySelector('#chat21-selection-department') as HTMLElement;
|
|
81
|
-
expect(dialog.getAttribute('role')).toBe('dialog');
|
|
82
|
-
expect(dialog.getAttribute('aria-modal')).toBe('true');
|
|
83
|
-
expect(dialog.getAttribute('aria-label')).toBe('Scegli un argomento');
|
|
84
|
-
const heading = fixture.nativeElement.querySelector('h2.c21-message-field') as HTMLElement;
|
|
85
|
-
expect(heading.textContent?.trim()).toBe('Scegli un argomento');
|
|
86
|
-
const buttons = fixture.nativeElement.querySelectorAll('.c21-button-department');
|
|
87
|
-
expect(buttons.length).toBe(2);
|
|
88
|
-
expect(buttons[0].textContent).toContain('Vendite');
|
|
89
|
-
expect(buttons[1].textContent).toContain('Supporto');
|
|
90
|
-
});
|
|
91
|
-
|
|
92
|
-
it('onSelectDepartment should set globals, attributes and persist JSON in storage', () => {
|
|
93
|
-
fixture.detectChanges();
|
|
94
|
-
spyOn(component.onDepartmentSelected, 'emit');
|
|
95
|
-
const dept = { _id: 'dep-b', name: 'Supporto' };
|
|
96
|
-
component.onSelectDepartment(dept);
|
|
97
|
-
expect(globals.departmentSelected).toEqual(dept as any);
|
|
98
|
-
expect(globals.attributes.departmentId).toBe('dep-b');
|
|
99
|
-
expect(globals.attributes.departmentName).toBe('Supporto');
|
|
100
|
-
expect(storage.setItem).toHaveBeenCalledWith('attributes', jasmine.any(String));
|
|
101
|
-
const parsed = JSON.parse(storage.lastAttributesJson!);
|
|
102
|
-
expect(parsed.departmentId).toBe('dep-b');
|
|
103
|
-
expect(parsed.departmentName).toBe('Supporto');
|
|
104
|
-
expect(parsed.userEmail).toBe('ada@example.com');
|
|
105
|
-
expect(component.onDepartmentSelected.emit).toHaveBeenCalledWith(dept);
|
|
106
|
-
});
|
|
107
|
-
|
|
108
|
-
it('click on department button should trigger selection flow', () => {
|
|
109
|
-
fixture.detectChanges();
|
|
110
|
-
spyOn(component, 'onSelectDepartment').and.callThrough();
|
|
111
|
-
const second = fixture.debugElement.queryAll(By.css('.c21-button-department'))[1];
|
|
112
|
-
second.nativeElement.click();
|
|
113
|
-
expect(component.onSelectDepartment).toHaveBeenCalledWith(jasmine.objectContaining({ _id: 'dep-b' }));
|
|
114
|
-
});
|
|
115
|
-
|
|
116
|
-
it('closePage should emit onClose', () => {
|
|
117
|
-
fixture.detectChanges();
|
|
118
|
-
spyOn(component.onClose, 'emit');
|
|
119
|
-
component.closePage();
|
|
120
|
-
expect(component.onClose.emit).toHaveBeenCalled();
|
|
121
|
-
});
|
|
122
|
-
|
|
123
|
-
it('openPage should emit onOpen', () => {
|
|
124
|
-
fixture.detectChanges();
|
|
125
|
-
spyOn(component.onOpen, 'emit');
|
|
126
|
-
component.openPage();
|
|
127
|
-
expect(component.onOpen.emit).toHaveBeenCalled();
|
|
128
|
-
});
|
|
129
|
-
|
|
130
|
-
it('cancelPage should reset newConversationStart and emit onClose', () => {
|
|
131
|
-
fixture.detectChanges();
|
|
132
|
-
globals.newConversationStart = true;
|
|
133
|
-
spyOn(component.onClose, 'emit');
|
|
134
|
-
component.cancelPage();
|
|
135
|
-
expect(globals.newConversationStart).toBe(false);
|
|
136
|
-
expect(component.onClose.emit).toHaveBeenCalled();
|
|
137
|
-
});
|
|
138
|
-
|
|
139
|
-
it('should invoke beforeDepartmentsFormRender hook when present on windowContext.tiledesk', () => {
|
|
140
|
-
const hook = jasmine.createSpy('beforeDepartmentsFormRender').and.returnValue([{ _id: 'x', name: 'Filtered' }]);
|
|
141
|
-
globals.windowContext = { tiledesk: { beforeDepartmentsFormRender: hook } } as any;
|
|
142
|
-
const f2 = TestBed.createComponent(SelectionDepartmentComponent);
|
|
143
|
-
const c2 = f2.componentInstance;
|
|
144
|
-
f2.detectChanges();
|
|
145
|
-
expect(hook).toHaveBeenCalledWith(globals.departments);
|
|
146
|
-
expect(c2.departments.length).toBe(1);
|
|
147
|
-
expect(c2.departments[0].name).toBe('Filtered');
|
|
148
|
-
f2.destroy();
|
|
149
|
-
});
|
|
150
|
-
|
|
151
|
-
it('should emit onBeforeDepartmentsFormRender when hook is absent', () => {
|
|
152
|
-
spyOn(component.onBeforeDepartmentsFormRender, 'emit');
|
|
153
|
-
fixture.detectChanges();
|
|
154
|
-
expect(component.onBeforeDepartmentsFormRender.emit).toHaveBeenCalledWith(
|
|
155
|
-
jasmine.arrayContaining([jasmine.objectContaining({ name: 'Vendite' })]),
|
|
156
|
-
);
|
|
157
|
-
});
|
|
158
|
-
|
|
159
|
-
it('Escape host listener should call closePage', () => {
|
|
160
|
-
fixture.detectChanges();
|
|
161
|
-
spyOn(component, 'closePage');
|
|
162
|
-
const ev = new KeyboardEvent('keydown', { key: 'Escape' });
|
|
163
|
-
spyOn(ev, 'preventDefault');
|
|
164
|
-
spyOn(ev, 'stopPropagation');
|
|
165
|
-
component.onEscape(ev);
|
|
166
|
-
expect(ev.preventDefault).toHaveBeenCalled();
|
|
167
|
-
expect(ev.stopPropagation).toHaveBeenCalled();
|
|
168
|
-
expect(component.closePage).toHaveBeenCalled();
|
|
169
|
-
});
|
|
170
|
-
|
|
171
|
-
it('should focus afSelectionDepartment after delay in ngAfterViewInit', fakeAsync(() => {
|
|
172
|
-
fixture.detectChanges();
|
|
173
|
-
const dialog = fixture.nativeElement.querySelector('#chat21-selection-department') as HTMLElement;
|
|
174
|
-
spyOn(dialog, 'focus');
|
|
175
|
-
component.ngAfterViewInit();
|
|
176
|
-
tick(1000);
|
|
177
|
-
expect(dialog.focus).toHaveBeenCalled();
|
|
178
|
-
}));
|
|
179
34
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AfterViewInit, Component, ElementRef, EventEmitter,
|
|
1
|
+
import { AfterViewInit, Component, ElementRef, EventEmitter, OnInit, Output, ViewChild } from '@angular/core';
|
|
2
2
|
import { LoggerInstance } from 'src/chat21-core/providers/logger/loggerInstance';
|
|
3
3
|
import { Globals } from '../../utils/globals';
|
|
4
4
|
|
|
@@ -172,13 +172,6 @@ export class SelectionDepartmentComponent implements OnInit, AfterViewInit {
|
|
|
172
172
|
this.onClose.emit();
|
|
173
173
|
}
|
|
174
174
|
|
|
175
|
-
@HostListener('keydown.escape', ['$event'])
|
|
176
|
-
onEscape(event: KeyboardEvent){
|
|
177
|
-
event.preventDefault();
|
|
178
|
-
event.stopPropagation();
|
|
179
|
-
this.closePage();
|
|
180
|
-
}
|
|
181
|
-
|
|
182
175
|
cancelPage() {
|
|
183
176
|
this.logger.debug('[SELECT-DEP] cancelPage');
|
|
184
177
|
this.g.newConversationStart = false;
|
|
@@ -1,13 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
<!-- tabindex="000"-->
|
|
2
|
+
|
|
3
|
+
<button aflauncherbutton #aflauncherbutton id="c21-launcher-button" class="c21-button-clean scale-in-center c21-align-right"
|
|
4
|
+
*ngIf="g.isLogged == true"
|
|
3
5
|
[style]="{ 'background-color': g.themeColor, 'bottom': g.marginY+'px!important', 'left':(g.align==='left')?g.marginX+'px!important':'', 'right':(g.align==='right')?g.marginX+'px!important':'', 'width': g.launcherWidth, 'height': g.launcherHeight, 'border-radius': g.baloonShape}"
|
|
4
6
|
(click)="onSendPressed($event)"
|
|
5
|
-
|
|
7
|
+
tabindex="1000"
|
|
8
|
+
aria-label=" apri chat"
|
|
9
|
+
>
|
|
6
10
|
|
|
7
11
|
<!-- SEND ICON -->
|
|
8
|
-
|
|
9
|
-
|
|
12
|
+
<!-- [@enterBubbleAnimation] -->
|
|
13
|
+
<div class="launcher-button rotate-center" >
|
|
14
|
+
<!-- <img *ngIf="g.baloonImage !== '' " [src]="g.baloonImage" [ngStyle]="{'width': '100%', 'height': '100%', 'margin': 'auto'}"> -->
|
|
15
|
+
<svg role="img" [style]="{'fill': g.themeForegroundColor, 'display': (g.baloonImage==='')?'':'none' }" xmlns="http://www.w3.org/2000/svg" width="100%"
|
|
10
16
|
height="100%" viewBox="0 0 90 90">
|
|
17
|
+
<!-- <path fill="none" d="M0 0h24v24H0V0z" />
|
|
18
|
+
<path d="M33.57,31A4.58,4.58,0,0,0,29,35.57V58.3a1.94,1.94,0,0,0,3.32,1.38l3-3a.29.29,0,0,1,.21-.09H56.43A4.58,4.58,0,0,0,61,52V35.57A4.58,4.58,0,0,0,56.43,31Z" /> -->
|
|
11
19
|
<path d="M2.01 21L23 12 2.01 3 2 10l15 2-15 2z" />
|
|
12
20
|
</svg>
|
|
13
21
|
</div>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ComponentFixture, TestBed
|
|
1
|
+
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
2
|
|
|
3
3
|
import { SendButtonComponent } from './send-button.component';
|
|
4
4
|
|
|
@@ -6,7 +6,7 @@ describe('SendButtonComponent', () => {
|
|
|
6
6
|
let component: SendButtonComponent;
|
|
7
7
|
let fixture: ComponentFixture<SendButtonComponent>;
|
|
8
8
|
|
|
9
|
-
beforeEach(
|
|
9
|
+
beforeEach(async(() => {
|
|
10
10
|
TestBed.configureTestingModule({
|
|
11
11
|
declarations: [ SendButtonComponent ]
|
|
12
12
|
})
|
|
@@ -9,22 +9,33 @@ svg.star:hover{
|
|
|
9
9
|
fill: #FFD700;
|
|
10
10
|
}
|
|
11
11
|
</style>
|
|
12
|
-
<div id="chat21-star-rating-widget"
|
|
12
|
+
<div id="chat21-star-rating-widget">
|
|
13
13
|
<!-- HEADER -->
|
|
14
14
|
<div class="c21-header" [ngStyle]="{ 'color': g.themeForegroundColor, 'background-image': g.colorGradient180 }">
|
|
15
15
|
<div class="c21-header-container">
|
|
16
|
+
<!-- ICON CLOSE CHAT -->
|
|
17
|
+
<!-- <div class="c21-header-button">
|
|
18
|
+
<div class="c21-close-button c21-small" aria-label="Close" aria-hidden="true" role="button">
|
|
19
|
+
<div class="c21-close-button-body" (click)="returnClosePage()">
|
|
20
|
+
<svg role="img" aria-labelledby="altIconTitle" [ngStyle]="{'fill': g.themeForegroundColor }"
|
|
21
|
+
xmlns="http://www.w3.org/2000/svg" width="20px" height="20px" viewBox="0 0 24 24">
|
|
22
|
+
<path fill="none" d="M0 0h24v24H0V0z" />
|
|
23
|
+
<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 12 19 6.41z" />
|
|
24
|
+
</svg>
|
|
25
|
+
</div>
|
|
26
|
+
</div>
|
|
27
|
+
</div> -->
|
|
28
|
+
|
|
16
29
|
<!-- CONTENT HEADER -->
|
|
17
30
|
<div class="c21-header-content">
|
|
18
31
|
<!-- ICON BACK -->
|
|
19
|
-
<button *ngIf="(step > 0 && step != 2)"
|
|
20
|
-
|
|
21
|
-
[attr.aria-label]="g['BACK']"
|
|
22
|
-
class="c21-header-button c21-left c21-button-clean"
|
|
23
|
-
(click)="prevStep()">
|
|
24
|
-
<svg aria-hidden="true" focusable="false" [ngStyle]="{'fill': stylesMap?.get('foregroundColor') }" xmlns="http://www.w3.org/2000/svg"
|
|
32
|
+
<button *ngIf="(step > 0 && step != 2)" tabindex="1417" aria-label=" indietro " class="c21-header-button c21-left c21-button-clean" (click)="prevStep()">
|
|
33
|
+
<svg role="img" aria-labelledby="altIconTitle" [ngStyle]="{'fill': stylesMap?.get('foregroundColor') }" xmlns="http://www.w3.org/2000/svg"
|
|
25
34
|
width="24px" height="24px" viewBox="0 0 24 24">
|
|
35
|
+
<!-- <path fill="none" d="M0 0h24v24H0V0z"/><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zM7.07 18.28c.43-.9 3.05-1.78 4.93-1.78s4.51.88 4.93 1.78C15.57 19.36 13.86 20 12 20s-3.57-.64-4.93-1.72zm11.29-1.45c-1.43-1.74-4.9-2.33-6.36-2.33s-4.93.59-6.36 2.33C4.62 15.49 4 13.82 4 12c0-4.41 3.59-8 8-8s8 3.59 8 8c0 1.82-.62 3.49-1.64 4.83zM12 6c-1.94 0-3.5 1.56-3.5 3.5S10.06 13 12 13s3.5-1.56 3.5-3.5S13.94 6 12 6zm0 5c-.83 0-1.5-.67-1.5-1.5S11.17 8 12 8s1.5.67 1.5 1.5S12.83 11 12 11z"/> -->
|
|
26
36
|
<path fill="none" d="M0 0h24v24H0V0z" />
|
|
27
37
|
<path d="M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12l4.58-4.59z" />
|
|
38
|
+
<title id="altIconTitle">{{ g['BACK'] }}</title>
|
|
28
39
|
</svg>
|
|
29
40
|
</button>
|
|
30
41
|
<!-- TITLE HEADER -->
|
|
@@ -47,56 +58,61 @@ svg.star:hover{
|
|
|
47
58
|
<!-- *************** STEP 0 : BEGIN ***************** -->
|
|
48
59
|
<div *ngIf="step==0" class="step-rate">
|
|
49
60
|
<div *ngIf="g.allowTranscriptDownload" class="c21-modal-content" style="text-align: right; margin: 0px 20px 30px 10px;">
|
|
50
|
-
<
|
|
61
|
+
<div class="c21-link" (click)="dowloadTranscript()" >
|
|
51
62
|
<span [ngStyle]="{'color': stylesMap?.get('themeColor')}">{{ g.DOWNLOAD_TRANSCRIPT }}</span>
|
|
52
|
-
</
|
|
63
|
+
</div>
|
|
53
64
|
</div>
|
|
54
65
|
<div class="clear"></div>
|
|
55
|
-
|
|
66
|
+
|
|
56
67
|
<!-- CONTENT -->
|
|
57
68
|
<div class="c21-modal-content">
|
|
58
69
|
<div class="default-text">{{ g.YOUR_OPINION_ON_OUR_CUSTOMER_SERVICE }}</div>
|
|
59
70
|
<fieldset class="chat21-rating" [attr.disabled]="!g.isOpenStartRating? '' : null">
|
|
60
|
-
<legend class="visually-hidden">{{ g.YOUR_RATING }}</legend>
|
|
61
71
|
<input class="c21-input-star" type="radio" id="star1" name="rating" value="1" />
|
|
62
72
|
<label (mouseover)="mouseOverRate(1)" (mouseleave)="mouseOverRate(0)" (click)="openRate(1)" class="full c21-button" for="star1" title="scarso - 1 star">
|
|
63
|
-
<svg
|
|
73
|
+
<svg class="star" [class.active]="mouseRate>=1" width="30px" height="30px" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512"><path d="M259.3 17.8L194 150.2 47.9 171.5c-26.2 3.8-36.7 36.1-17.7 54.6l105.7 103-25 145.5c-4.5 26.3 23.2 46 46.4 33.7L288 439.6l130.7 68.7c23.2 12.2 50.9-7.4 46.4-33.7l-25-145.5 105.7-103c19-18.5 8.5-50.8-17.7-54.6L382 150.2 316.7 17.8c-11.7-23.6-45.6-23.9-57.4 0z"/></svg>
|
|
64
74
|
</label>
|
|
65
75
|
<input class="c21-input-star" type="radio" id="star2" name="rating" value="2" />
|
|
66
76
|
<label (mouseover)="mouseOverRate(2)" (mouseleave)="mouseOverRate(0)" (click)="openRate(2)" class="full c21-button" for="star2" title="sufficiente - 2 stars">
|
|
67
|
-
<svg
|
|
77
|
+
<svg class="star" [class.active]="mouseRate>=2" width="30px" height="30px" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512"><path d="M259.3 17.8L194 150.2 47.9 171.5c-26.2 3.8-36.7 36.1-17.7 54.6l105.7 103-25 145.5c-4.5 26.3 23.2 46 46.4 33.7L288 439.6l130.7 68.7c23.2 12.2 50.9-7.4 46.4-33.7l-25-145.5 105.7-103c19-18.5 8.5-50.8-17.7-54.6L382 150.2 316.7 17.8c-11.7-23.6-45.6-23.9-57.4 0z"/></svg>
|
|
68
78
|
</label>
|
|
69
79
|
<input class="c21-input-star" type="radio" id="star3" name="rating" value="3" />
|
|
70
80
|
<label (mouseover)="mouseOverRate(3)" (mouseleave)="mouseOverRate(0)" (click)="openRate(3)" class="full c21-button" for="star3" title="buono - 3 stars">
|
|
71
|
-
<svg
|
|
81
|
+
<svg class="star" [class.active]="mouseRate>=3" width="30px" height="30px" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512"><path d="M259.3 17.8L194 150.2 47.9 171.5c-26.2 3.8-36.7 36.1-17.7 54.6l105.7 103-25 145.5c-4.5 26.3 23.2 46 46.4 33.7L288 439.6l130.7 68.7c23.2 12.2 50.9-7.4 46.4-33.7l-25-145.5 105.7-103c19-18.5 8.5-50.8-17.7-54.6L382 150.2 316.7 17.8c-11.7-23.6-45.6-23.9-57.4 0z"/></svg>
|
|
72
82
|
</label>
|
|
73
83
|
<input class="c21-input-star" type="radio" id="star4" name="rating" value="4" />
|
|
74
84
|
<label (mouseover)="mouseOverRate(4)" (mouseleave)="mouseOverRate(0)" (click)="openRate(4)" class="full c21-button" for="star4" title="ottimo - 4 stars">
|
|
75
|
-
<svg
|
|
85
|
+
<svg class="star" [class.active]="mouseRate>=4" width="30px" height="30px" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512"><path d="M259.3 17.8L194 150.2 47.9 171.5c-26.2 3.8-36.7 36.1-17.7 54.6l105.7 103-25 145.5c-4.5 26.3 23.2 46 46.4 33.7L288 439.6l130.7 68.7c23.2 12.2 50.9-7.4 46.4-33.7l-25-145.5 105.7-103c19-18.5 8.5-50.8-17.7-54.6L382 150.2 316.7 17.8c-11.7-23.6-45.6-23.9-57.4 0z"/></svg>
|
|
76
86
|
</label>
|
|
77
87
|
<input class="c21-input-star" type="radio" id="star5" name="rating" value="5" />
|
|
78
88
|
<label (mouseover)="mouseOverRate(5)" (mouseleave)="mouseOverRate(0)" (click)="openRate(5)" class="full c21-button" for="star5" title="eccellente - 5 stars">
|
|
79
|
-
<svg
|
|
89
|
+
<svg class="star" [class.active]="mouseRate>=5" width="30px" height="30px" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512"><path d="M259.3 17.8L194 150.2 47.9 171.5c-26.2 3.8-36.7 36.1-17.7 54.6l105.7 103-25 145.5c-4.5 26.3 23.2 46 46.4 33.7L288 439.6l130.7 68.7c23.2 12.2 50.9-7.4 46.4-33.7l-25-145.5 105.7-103c19-18.5 8.5-50.8-17.7-54.6L382 150.2 316.7 17.8c-11.7-23.6-45.6-23.9-57.4 0z"/></svg>
|
|
80
90
|
</label>
|
|
81
91
|
</fieldset>
|
|
82
92
|
</div>
|
|
83
93
|
<div class="clear"></div>
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
94
|
+
<!-- <button [attr.disabled]="!g.isOpenStartRating? '' : null" *ngIf="g.allowTranscriptDownload !== true" class="c21-button-primary" [ngStyle]="{'background-color': g.themeColor, 'border-color': g.themeColor}"
|
|
95
|
+
(click)="dowloadTranscript()">
|
|
96
|
+
<span [ngStyle]="{'color': g.themeForegroundColor}">{{ g.DOWNLOAD_TRANSCRIPT }}</span>
|
|
97
|
+
</button> -->
|
|
98
|
+
<!-- <button class="c21-button-link" (click)="returnClosePage()">
|
|
99
|
+
<span>{{ g.CLOSE }}</span>
|
|
100
|
+
</button> -->
|
|
101
|
+
|
|
102
|
+
<!-- ICON CLOSE -->
|
|
103
|
+
<button tabindex="1414" class="c21-button-primary" (click)="returnClosePage()" [ngStyle]="{'background-color': stylesMap?.get('themeColor'), 'border-color': stylesMap?.get('themeColor'), 'color': stylesMap?.get('foregroundColor') }">
|
|
90
104
|
<span class="v-align-center">
|
|
91
|
-
<svg
|
|
105
|
+
<svg role="img" aria-labelledby="altIconTitle" [ngStyle]="{'fill': stylesMap?.get('foregroundColor')}" xmlns="http://www.w3.org/2000/svg"
|
|
92
106
|
width="18" height="18" viewBox="0 0 24 24">
|
|
93
107
|
<path fill="none" d="M0 0h24v24H0V0z" />
|
|
94
108
|
<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 12 19 6.41z" />
|
|
109
|
+
<title id="altIconTitle">{{ g.CLOSE }}</title>
|
|
95
110
|
</svg>
|
|
96
111
|
</span>
|
|
97
112
|
<span class="v-align-center c21-label-button">
|
|
98
113
|
{{ g.CLOSE }}
|
|
99
|
-
|
|
114
|
+
<!-- {{translationMap?.get('LABEL_START_NW_CONV')}} -->
|
|
115
|
+
</span>
|
|
100
116
|
<div class="clear"></div>
|
|
101
117
|
</button>
|
|
102
118
|
</div>
|
|
@@ -104,47 +120,62 @@ svg.star:hover{
|
|
|
104
120
|
|
|
105
121
|
<!-- *************** STEP 1 : BEGIN ***************** -->
|
|
106
122
|
<div *ngIf="step==1" class="step-rate">
|
|
123
|
+
<!-- CONTENT -->
|
|
124
|
+
<!-- <div *ngIf="g.allowTranscriptDownload" class="c21-modal-content" style="text-align: right; margin: 0px 20px 30px 10px;">
|
|
125
|
+
<div class="c21-link" (click)="dowloadTranscript()" >
|
|
126
|
+
<span [ngStyle]="{'color': g.themeColor}">{{ g.DOWNLOAD_TRANSCRIPT }}</span>
|
|
127
|
+
</div>
|
|
128
|
+
</div> -->
|
|
107
129
|
<div class="clear"></div>
|
|
108
130
|
<div class="c21-step-content">
|
|
109
|
-
|
|
131
|
+
<!-- il tuo voto: -->
|
|
132
|
+
|
|
133
|
+
<!-- <div class="chat21-stars">
|
|
134
|
+
<span *ngIf="rate>0" class="fa fa-star checked"></span>
|
|
135
|
+
<span *ngIf="rate>1" class="fa fa-star checked"></span>
|
|
136
|
+
<span *ngIf="rate>2" class="fa fa-star checked"></span>
|
|
137
|
+
<span *ngIf="rate>3" class="fa fa-star checked"></span>
|
|
138
|
+
<span *ngIf="rate>4" class="fa fa-star checked"></span>
|
|
139
|
+
</div> -->
|
|
140
|
+
<!-- <div class="default-text">{{ g.YOUR_RATING }}</div> -->
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
<!-- Scrivi la tua opinione...(opzionale) -->
|
|
110
144
|
<textarea #textbox rows="1" id="chat21-message-rate-context" class='textarea-rate'
|
|
111
|
-
[attr.aria-label]="g.WRITE_YOUR_OPINION"
|
|
112
145
|
placeholder="{{ g.WRITE_YOUR_OPINION }}">{{message}}</textarea>
|
|
113
146
|
<div class="clear"></div>
|
|
114
147
|
|
|
115
|
-
<!--
|
|
116
|
-
<button
|
|
117
|
-
[attr.aria-label]="g.CLOSE"
|
|
118
|
-
(click)="returnClosePage()"
|
|
119
|
-
[ngStyle]="{'background-color': stylesMap?.get('themeColor'), 'border-color': stylesMap?.get('themeColor'), 'color': stylesMap?.get('foregroundColor') }">
|
|
148
|
+
<!-- ICON CLOSE -->
|
|
149
|
+
<button tabindex="1415" class="c21-button-primary" (click)="returnClosePage()" [ngStyle]="{'background-color': stylesMap?.get('themeColor'), 'border-color': stylesMap?.get('themeColor'), 'color': stylesMap?.get('foregroundColor') }">
|
|
120
150
|
<span class="v-align-center">
|
|
121
|
-
<svg
|
|
151
|
+
<svg role="img" aria-labelledby="altIconTitle" [ngStyle]="{'fill': stylesMap?.get('foregroundColor')}" xmlns="http://www.w3.org/2000/svg"
|
|
122
152
|
width="18" height="18" viewBox="0 0 24 24">
|
|
123
153
|
<path fill="none" d="M0 0h24v24H0V0z" />
|
|
124
154
|
<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 12 19 6.41z" />
|
|
155
|
+
<title id="altIconTitle">{{ g.CLOSE }}</title>
|
|
125
156
|
</svg>
|
|
126
157
|
</span>
|
|
127
158
|
<span class="v-align-center c21-label-button">
|
|
128
159
|
{{ g.CLOSE }}
|
|
129
|
-
|
|
160
|
+
<!-- {{translationMap?.get('LABEL_START_NW_CONV')}} -->
|
|
161
|
+
</span>
|
|
130
162
|
<div class="clear"></div>
|
|
131
163
|
</button>
|
|
132
164
|
|
|
133
|
-
<!--
|
|
134
|
-
<button
|
|
135
|
-
[attr.aria-label]="g.SUBMIT"
|
|
136
|
-
(click)="sendRate()"
|
|
137
|
-
[ngStyle]="{'background-color': stylesMap?.get('themeColor'), 'border-color': stylesMap?.get('themeColor'), 'color': stylesMap?.get('foregroundColor') }">
|
|
165
|
+
<!-- ICON SUBMIT -->
|
|
166
|
+
<button tabindex="1416" class="c21-button-primary" (click)="sendRate()" [ngStyle]="{'background-color': stylesMap?.get('themeColor'), 'border-color': stylesMap?.get('themeColor'), 'color': stylesMap?.get('foregroundColor') }">
|
|
138
167
|
<span class="v-align-center">
|
|
139
|
-
<svg
|
|
168
|
+
<svg role="img" aria-labelledby="altIconTitle" [ngStyle]="{'fill': stylesMap?.get('foregroundColor')}" xmlns="http://www.w3.org/2000/svg"
|
|
140
169
|
width="18" height="18" viewBox="0 0 24 24">
|
|
141
170
|
<path d="M2.01 21L23 12 2.01 3 2 10l15 2-15 2z"/>
|
|
142
171
|
<path d="M0 0h24v24H0z" fill="none"/>
|
|
172
|
+
<title id="altIconTitle">{{ g.SUBMIT }}</title>
|
|
143
173
|
</svg>
|
|
144
174
|
</span>
|
|
145
175
|
<span class="v-align-center c21-label-button">
|
|
146
176
|
{{ g.SUBMIT }}
|
|
147
|
-
|
|
177
|
+
<!-- {{translationMap?.get('LABEL_START_NW_CONV')}} -->
|
|
178
|
+
</span>
|
|
148
179
|
<div class="clear"></div>
|
|
149
180
|
</button>
|
|
150
181
|
|
|
@@ -156,33 +187,32 @@ svg.star:hover{
|
|
|
156
187
|
<!-- *************** STEP 2 : BEGIN ***************** -->
|
|
157
188
|
<div *ngIf="step==2" class="step-rate">
|
|
158
189
|
<div *ngIf="g.allowTranscriptDownload" class="c21-modal-content" style="text-align: right; margin: 0px 20px 30px 10px;">
|
|
159
|
-
<
|
|
190
|
+
<div class="c21-link" (click)="dowloadTranscript()" >
|
|
160
191
|
<span [ngStyle]="{'color': stylesMap?.get('themeColor')}">{{ g.DOWNLOAD_TRANSCRIPT }}</span>
|
|
161
|
-
</
|
|
192
|
+
</div>
|
|
162
193
|
</div>
|
|
163
194
|
<div class="clear"></div>
|
|
164
|
-
|
|
195
|
+
|
|
165
196
|
<!-- CONTENT -->
|
|
166
197
|
<div class="c21-step-content">
|
|
167
198
|
<div class="default-title">{{ g.THANK_YOU_FOR_YOUR_EVALUATION }}</div>
|
|
168
199
|
<div class="default-text">{{ g.YOUR_RATING_HAS_BEEN_RECEIVED }}</div>
|
|
169
200
|
</div>
|
|
170
201
|
|
|
171
|
-
<!--
|
|
172
|
-
<button
|
|
173
|
-
[attr.aria-label]="g.CLOSE"
|
|
174
|
-
(click)="returnClosePage()"
|
|
175
|
-
[ngStyle]="{'background-color': stylesMap?.get('themeColor'), 'border-color': stylesMap?.get('themeColor'), 'color': stylesMap?.get('foregroundColor') }">
|
|
202
|
+
<!-- ICON CLOSE -->
|
|
203
|
+
<button tabindex="1415" class="c21-button-primary" (click)="returnClosePage()" [ngStyle]="{'background-color': stylesMap?.get('themeColor'), 'border-color': stylesMap?.get('themeColor'), 'color': stylesMap?.get('foregroundColor') }">
|
|
176
204
|
<span class="v-align-center">
|
|
177
|
-
<svg
|
|
205
|
+
<svg role="img" aria-labelledby="altIconTitle" [ngStyle]="{'fill': stylesMap?.get('foregroundColor')}" xmlns="http://www.w3.org/2000/svg"
|
|
178
206
|
width="18" height="18" viewBox="0 0 24 24">
|
|
179
207
|
<path fill="none" d="M0 0h24v24H0V0z" />
|
|
180
208
|
<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 12 19 6.41z" />
|
|
209
|
+
<title id="altIconTitle">{{ g.CLOSE }}</title>
|
|
181
210
|
</svg>
|
|
182
211
|
</span>
|
|
183
212
|
<span class="v-align-center c21-label-button">
|
|
184
213
|
{{ g.CLOSE }}
|
|
185
|
-
|
|
214
|
+
<!-- {{translationMap?.get('LABEL_START_NW_CONV')}} -->
|
|
215
|
+
</span>
|
|
186
216
|
<div class="clear"></div>
|
|
187
217
|
</button>
|
|
188
218
|
</div>
|
|
@@ -195,4 +225,4 @@ svg.star:hover{
|
|
|
195
225
|
|
|
196
226
|
</div>
|
|
197
227
|
|
|
198
|
-
</div>
|
|
228
|
+
</div>
|
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
import { ElementRef, Renderer2 } from '@angular/core';
|
|
2
|
-
|
|
3
1
|
import { TooltipDirective } from './tooltip.directive';
|
|
4
2
|
|
|
5
3
|
describe('TooltipDirective', () => {
|
|
6
|
-
it('should create', () => {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
expect(directive).toBeTruthy();
|
|
11
|
-
});
|
|
4
|
+
// it('should create an instance', () => {
|
|
5
|
+
// const directive = new TooltipDirective();
|
|
6
|
+
// expect(directive).toBeTruthy();
|
|
7
|
+
// });
|
|
12
8
|
});
|
|
@@ -1,37 +1,25 @@
|
|
|
1
|
-
<div class="modal-container"
|
|
2
|
-
role="dialog"
|
|
3
|
-
aria-modal="true"
|
|
4
|
-
cdkTrapFocus
|
|
5
|
-
[cdkTrapFocusAutoCapture]="true"
|
|
6
|
-
aria-labelledby="confirm-close-title"
|
|
7
|
-
[attr.aria-label]="translationMap?.get('CONFIRM_CLOSE_CHAT')">
|
|
1
|
+
<div class="modal-container">
|
|
8
2
|
<div class="header">
|
|
9
3
|
<!-- ICON CLOSE CHAT -->
|
|
10
|
-
<button
|
|
11
|
-
|
|
12
|
-
[attr.aria-label]="translationMap?.get('CLOSE')"
|
|
13
|
-
(click)="onBack()">
|
|
14
|
-
<svg aria-hidden="true" focusable="false" [ngStyle]="{'fill': stylesMap?.get('themeColor') }" xmlns="http://www.w3.org/2000/svg" width="24px" height="24px" viewBox="0 0 24 24">
|
|
4
|
+
<button tabindex="-1" class="c21-header-button c21-right c21-close c21-button-clean" (click)="onBack()">
|
|
5
|
+
<svg role="img" aria-labelledby="altIconTitle" [ngStyle]="{'fill': stylesMap?.get('themeColor') }" xmlns="http://www.w3.org/2000/svg" width="24px" height="24px" viewBox="0 0 24 24">
|
|
15
6
|
<path fill="none" d="M0 0h24v24H0V0z" />
|
|
16
7
|
<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 12 19 6.41z" />
|
|
8
|
+
<title id="altIconTitle">{{ translationMap?.get('CLOSE') }}</title>
|
|
17
9
|
</svg>
|
|
18
10
|
</button>
|
|
19
11
|
</div>
|
|
20
12
|
<div class="content">
|
|
21
|
-
<
|
|
13
|
+
<div class="text">{{ translationMap?.get('CONFIRM_CLOSE_CHAT') }}</div>
|
|
22
14
|
<div class="options">
|
|
23
15
|
|
|
24
16
|
<!-- BUTTON CANCEL-->
|
|
25
|
-
<
|
|
26
|
-
class="c21-button-clean v-align-center c21-label-button back-button"
|
|
27
|
-
[class.disabled]="isLoadingActive"
|
|
28
|
-
[attr.disabled]="isLoadingActive ? true : null"
|
|
29
|
-
(click)="onBack()">
|
|
17
|
+
<span class="v-align-center c21-label-button back-button" [class.disabled]="isLoadingActive" (click)="onBack()">
|
|
30
18
|
{{translationMap?.get('BACK')}}
|
|
31
|
-
</
|
|
19
|
+
</span>
|
|
32
20
|
|
|
33
21
|
<!-- BUTTON CLOSE-->
|
|
34
|
-
<button
|
|
22
|
+
<button tabindex="1040" aflistconv #aflistconv class="c21-button-primary" (click)="onConfirm()" [ngStyle]="{'background-color': stylesMap?.get('themeColor'), 'border-color': stylesMap?.get('themeColor'), 'color': stylesMap?.get('foregroundColor') }">
|
|
35
23
|
<span *ngIf="isLoadingActive" class="spinner-container">
|
|
36
24
|
<svg xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="25" height="25" [ngStyle]="{'fill': stylesMap?.get('foregroundColor') }"
|
|
37
25
|
viewBox="0 0 100 100" enable-background="new 0 0 0 0" xml:space="preserve">
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
|
3
|
-
|
|
4
|
-
import { CustomLogger } from 'src/chat21-core/providers/logger/customLogger';
|
|
5
|
-
import { LoggerInstance } from 'src/chat21-core/providers/logger/loggerInstance';
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
6
2
|
|
|
7
3
|
import { ConfirmCloseComponent } from './confirm-close.component';
|
|
8
4
|
|
|
@@ -10,17 +6,12 @@ describe('ConfirmCloseComponent', () => {
|
|
|
10
6
|
let component: ConfirmCloseComponent;
|
|
11
7
|
let fixture: ComponentFixture<ConfirmCloseComponent>;
|
|
12
8
|
|
|
13
|
-
beforeEach(
|
|
14
|
-
|
|
15
|
-
LoggerInstance.setInstance(new CustomLogger(ngxlogger));
|
|
16
|
-
TestBed.configureTestingModule({
|
|
17
|
-
imports: [A11yModule],
|
|
9
|
+
beforeEach(async () => {
|
|
10
|
+
await TestBed.configureTestingModule({
|
|
18
11
|
declarations: [ ConfirmCloseComponent ]
|
|
19
12
|
})
|
|
20
|
-
|
|
21
|
-
}));
|
|
13
|
+
.compileComponents();
|
|
22
14
|
|
|
23
|
-
beforeEach(() => {
|
|
24
15
|
fixture = TestBed.createComponent(ConfirmCloseComponent);
|
|
25
16
|
component = fixture.componentInstance;
|
|
26
17
|
fixture.detectChanges();
|