@chat21/chat21-web-widget 5.1.32-rc8 → 5.1.33-rc11
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/.angular-mcp-cache/package.json +1 -0
- package/.cursor/angular18-accessibility-auditor-skill.md +442 -0
- package/.cursor/mcp.json +15 -0
- package/.github/workflows/playwright.yml +27 -0
- package/.playwright-mcp/console-2026-05-08T15-31-09-000Z.log +17 -0
- package/.playwright-mcp/console-2026-05-08T15-32-19-412Z.log +89 -0
- package/.playwright-mcp/console-2026-05-08T16-18-48-424Z.log +133 -0
- package/.playwright-mcp/console-2026-05-11T12-54-06-869Z.log +13 -0
- package/.playwright-mcp/console-2026-05-11T12-54-56-229Z.log +147 -0
- package/.playwright-mcp/console-2026-05-11T12-55-47-174Z.log +183 -0
- package/.playwright-mcp/console-2026-05-11T15-34-03-590Z.log +210 -0
- package/.playwright-mcp/console-2026-05-12T15-07-31-880Z.log +118 -0
- package/.playwright-mcp/page-2026-05-08T15-32-19-900Z.yml +851 -0
- package/.playwright-mcp/page-2026-05-08T15-32-47-264Z.yml +857 -0
- package/.playwright-mcp/page-2026-05-08T15-33-17-089Z.yml +1110 -0
- package/.playwright-mcp/page-2026-05-08T15-33-23-486Z.yml +1069 -0
- package/.playwright-mcp/page-2026-05-08T15-33-45-390Z.yml +1076 -0
- package/.playwright-mcp/page-2026-05-08T15-33-52-666Z.yml +1072 -0
- package/.playwright-mcp/page-2026-05-08T15-34-01-338Z.yml +1085 -0
- package/.playwright-mcp/page-2026-05-08T15-34-07-227Z.yml +1072 -0
- package/.playwright-mcp/page-2026-05-08T15-34-13-875Z.yml +1072 -0
- package/.playwright-mcp/page-2026-05-08T15-34-21-885Z.yml +1109 -0
- package/.playwright-mcp/page-2026-05-08T15-34-32-755Z.yml +1109 -0
- package/.playwright-mcp/page-2026-05-08T15-35-09-607Z.yml +1119 -0
- package/.playwright-mcp/page-2026-05-08T15-35-14-242Z.yml +1109 -0
- package/.playwright-mcp/page-2026-05-08T16-18-48-671Z.yml +44 -0
- package/.playwright-mcp/page-2026-05-08T16-18-52-753Z.png +0 -0
- package/.playwright-mcp/page-2026-05-08T16-19-13-919Z.yml +68 -0
- package/.playwright-mcp/page-2026-05-08T16-19-17-977Z.png +0 -0
- package/.playwright-mcp/page-2026-05-08T16-19-25-733Z.yml +120 -0
- package/.playwright-mcp/page-2026-05-08T16-19-29-252Z.png +0 -0
- package/.playwright-mcp/page-2026-05-08T16-19-39-269Z.yml +80 -0
- package/.playwright-mcp/page-2026-05-08T16-19-43-915Z.png +0 -0
- package/.playwright-mcp/page-2026-05-08T16-20-04-407Z.yml +81 -0
- package/.playwright-mcp/page-2026-05-08T16-20-08-984Z.png +0 -0
- package/.playwright-mcp/page-2026-05-08T16-20-32-397Z.png +0 -0
- package/.playwright-mcp/page-2026-05-08T16-20-58-658Z.png +0 -0
- package/.playwright-mcp/page-2026-05-08T16-21-12-320Z.yml +86 -0
- package/.playwright-mcp/page-2026-05-08T16-21-39-154Z.yml +91 -0
- package/.playwright-mcp/page-2026-05-08T16-21-45-420Z.png +0 -0
- package/.playwright-mcp/page-2026-05-08T16-22-21-062Z.yml +0 -0
- package/.playwright-mcp/page-2026-05-08T16-22-58-232Z.yml +91 -0
- package/.playwright-mcp/page-2026-05-08T16-23-36-520Z.yml +0 -0
- package/.playwright-mcp/page-2026-05-08T16-23-46-805Z.yml +100 -0
- package/.playwright-mcp/page-2026-05-08T16-23-55-169Z.png +0 -0
- package/.playwright-mcp/page-2026-05-08T16-24-26-574Z.yml +91 -0
- package/.playwright-mcp/page-2026-05-08T16-25-34-414Z.png +0 -0
- package/.playwright-mcp/page-2026-05-08T16-25-59-831Z.png +0 -0
- package/.playwright-mcp/page-2026-05-08T16-26-21-809Z.yml +91 -0
- package/.playwright-mcp/page-2026-05-08T16-26-47-443Z.yml +105 -0
- package/.playwright-mcp/page-2026-05-08T16-26-56-136Z.png +0 -0
- package/.playwright-mcp/page-2026-05-08T16-27-59-610Z.yml +48 -0
- package/.playwright-mcp/page-2026-05-11T12-54-07-180Z.yml +44 -0
- package/.playwright-mcp/page-2026-05-11T12-54-56-946Z.yml +4 -0
- package/.playwright-mcp/page-2026-05-11T12-55-47-503Z.yml +24 -0
- package/.playwright-mcp/page-2026-05-11T12-56-00-766Z.yml +28 -0
- package/.playwright-mcp/page-2026-05-11T12-56-06-438Z.yml +90 -0
- package/.playwright-mcp/page-2026-05-11T12-57-56-838Z.yml +106 -0
- package/.playwright-mcp/page-2026-05-11T12-58-00-124Z.yml +106 -0
- package/.playwright-mcp/page-2026-05-11T12-59-08-836Z.yml +61 -0
- package/.playwright-mcp/page-2026-05-11T12-59-12-088Z.yml +61 -0
- package/.playwright-mcp/page-2026-05-11T12-59-26-215Z.yml +69 -0
- package/.playwright-mcp/page-2026-05-11T12-59-29-519Z.yml +69 -0
- package/.playwright-mcp/page-2026-05-11T12-59-37-309Z.yml +0 -0
- package/.playwright-mcp/page-2026-05-11T12-59-39-968Z.yml +79 -0
- package/.playwright-mcp/page-2026-05-11T12-59-45-983Z.yml +78 -0
- package/.playwright-mcp/page-2026-05-11T12-59-49-951Z.yml +78 -0
- package/.playwright-mcp/page-2026-05-11T15-34-04-515Z.yml +0 -0
- package/.playwright-mcp/page-2026-05-12T15-07-32-171Z.yml +44 -0
- package/.playwright-mcp/page-2026-05-12T15-08-09-820Z.yml +119 -0
- package/CHANGELOG.md +68 -3
- package/angular.json +20 -3
- package/deploy_amazon_beta.sh +7 -17
- package/deploy_amazon_prod.sh +41 -0
- package/docs/TILEDESK_WIDGET_ACCESSIBILITY_STATEMENT_COMPLETE.md +379 -0
- package/env.sample +3 -2
- package/mocks/voice-websocket-mock/server.cjs +245 -0
- package/package.json +7 -3
- package/playwright.config.ts +41 -0
- package/src/app/app.component.html +2 -2
- package/src/app/app.component.scss +25 -14
- package/src/app/app.component.spec.ts +21 -6
- package/src/app/app.module.ts +4 -0
- package/src/app/component/conversation-detail/conversation/conversation.component.html +19 -11
- package/src/app/component/conversation-detail/conversation/conversation.component.scss +28 -0
- package/src/app/component/conversation-detail/conversation/conversation.component.spec.ts +644 -75
- package/src/app/component/conversation-detail/conversation/conversation.component.ts +63 -17
- package/src/app/component/conversation-detail/conversation-audio-recorder/conversation-audio-recorder.component.html +25 -13
- package/src/app/component/conversation-detail/conversation-audio-recorder/conversation-audio-recorder.component.spec.ts +123 -5
- package/src/app/component/conversation-detail/conversation-audio-recorder/conversation-audio-recorder.component.ts +1 -0
- package/src/app/component/conversation-detail/conversation-content/conversation-content.component.html +22 -9
- package/src/app/component/conversation-detail/conversation-content/conversation-content.component.scss +23 -1
- package/src/app/component/conversation-detail/conversation-content/conversation-content.component.spec.ts +242 -149
- package/src/app/component/conversation-detail/conversation-content/conversation-content.component.ts +7 -6
- package/src/app/component/conversation-detail/conversation-emojii/conversation-emojii.component.spec.ts +53 -3
- package/src/app/component/conversation-detail/conversation-footer/conversation-footer.component copy.html +172 -0
- package/src/app/component/conversation-detail/conversation-footer/conversation-footer.component.html +112 -61
- package/src/app/component/conversation-detail/conversation-footer/conversation-footer.component.scss +133 -16
- package/src/app/component/conversation-detail/conversation-footer/conversation-footer.component.spec.ts +452 -78
- package/src/app/component/conversation-detail/conversation-footer/conversation-footer.component.ts +199 -79
- package/src/app/component/conversation-detail/conversation-header/conversation-header.component.html +113 -53
- package/src/app/component/conversation-detail/conversation-header/conversation-header.component.scss +12 -4
- package/src/app/component/conversation-detail/conversation-header/conversation-header.component.spec.ts +274 -29
- package/src/app/component/conversation-detail/conversation-internal-frame/conversation-internal-frame.component.html +23 -9
- package/src/app/component/conversation-detail/conversation-internal-frame/conversation-internal-frame.component.spec.ts +80 -8
- package/src/app/component/conversation-detail/conversation-preview/conversation-preview.component.html +29 -23
- package/src/app/component/conversation-detail/conversation-preview/conversation-preview.component.spec.ts +185 -16
- package/src/app/component/conversation-detail/conversation-preview/conversation-preview.component.ts +34 -14
- package/src/app/component/conversation-detail/stream-audio-spectrum/stream-audio-spectrum.component.html +46 -19
- package/src/app/component/conversation-detail/stream-audio-spectrum/stream-audio-spectrum.component.scss +67 -10
- package/src/app/component/conversation-detail/stream-audio-spectrum/stream-audio-spectrum.component.ts +142 -12
- package/src/app/component/error-alert/error-alert.component.spec.ts +65 -5
- package/src/app/component/eyeeye-catcher-card/eyeeye-catcher-card.component.html +16 -7
- package/src/app/component/eyeeye-catcher-card/eyeeye-catcher-card.component.scss +21 -0
- package/src/app/component/eyeeye-catcher-card/eyeeye-catcher-card.component.spec.ts +89 -7
- 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 +163 -21
- package/src/app/component/form/inputs/form-checkbox/form-checkbox.component.html +8 -4
- package/src/app/component/form/inputs/form-checkbox/form-checkbox.component.scss +10 -5
- package/src/app/component/form/inputs/form-checkbox/form-checkbox.component.spec.ts +90 -16
- package/src/app/component/form/inputs/form-checkbox/form-checkbox.component.ts +26 -0
- package/src/app/component/form/inputs/form-label/form-label.component.spec.ts +45 -11
- package/src/app/component/form/inputs/form-radio-button/form-radio-button.component.spec.ts +24 -6
- package/src/app/component/form/inputs/form-select/form-select.component.spec.ts +14 -5
- package/src/app/component/form/inputs/form-text/form-text.component.html +14 -12
- package/src/app/component/form/inputs/form-text/form-text.component.scss +11 -1
- package/src/app/component/form/inputs/form-text/form-text.component.spec.ts +113 -17
- package/src/app/component/form/inputs/form-text/form-text.component.ts +35 -3
- package/src/app/component/form/inputs/form-textarea/form-textarea.component.html +13 -11
- package/src/app/component/form/inputs/form-textarea/form-textarea.component.scss +6 -5
- package/src/app/component/form/inputs/form-textarea/form-textarea.component.spec.ts +149 -13
- package/src/app/component/form/inputs/form-textarea/form-textarea.component.ts +26 -0
- package/src/app/component/form/prechat-form/prechat-form.component.html +14 -11
- package/src/app/component/form/prechat-form/prechat-form.component.spec.ts +102 -10
- package/src/app/component/form/prechat-form/prechat-form.component.ts +8 -1
- package/src/app/component/form/prechat-form-test-mock.ts +35 -0
- package/src/app/component/home/home.component.html +38 -31
- package/src/app/component/home/home.component.scss +4 -2
- package/src/app/component/home/home.component.spec.ts +226 -11
- package/src/app/component/home-conversations/home-conversations.component.html +30 -26
- package/src/app/component/home-conversations/home-conversations.component.scss +3 -0
- package/src/app/component/home-conversations/home-conversations.component.spec.ts +212 -36
- package/src/app/component/last-message/last-message.component.html +15 -9
- package/src/app/component/last-message/last-message.component.scss +16 -2
- package/src/app/component/last-message/last-message.component.spec.ts +204 -23
- package/src/app/component/launcher-button/launcher-button.component.html +8 -13
- package/src/app/component/launcher-button/launcher-button.component.spec.ts +104 -8
- package/src/app/component/list-all-conversations/list-all-conversations.component.html +12 -17
- package/src/app/component/list-all-conversations/list-all-conversations.component.scss +2 -0
- package/src/app/component/list-conversations/list-conversations.component.html +22 -22
- package/src/app/component/menu-options/menu-options.component.html +30 -20
- package/src/app/component/menu-options/menu-options.component.spec.ts +125 -9
- package/src/app/component/message/audio/audio.component.html +13 -15
- package/src/app/component/message/audio/audio.component.spec.ts +140 -5
- package/src/app/component/message/audio/audio.component.ts +1 -0
- package/src/app/component/message/audio-sync/audio-sync.component.scss +1 -1
- package/src/app/component/message/audio-sync/audio-sync.component.spec.ts +81 -1
- package/src/app/component/message/audio-sync/audio-sync.component.ts +134 -24
- package/src/app/component/message/avatar/avatar.component.html +2 -2
- package/src/app/component/message/avatar/avatar.component.spec.ts +99 -7
- package/src/app/component/message/bubble-message/bubble-message.component.html +39 -52
- package/src/app/component/message/bubble-message/bubble-message.component.scss +59 -1
- package/src/app/component/message/bubble-message/bubble-message.component.spec.ts +154 -57
- package/src/app/component/message/bubble-message/bubble-message.component.ts +152 -110
- package/src/app/component/message/buttons/action-button/action-button.component.html +3 -4
- package/src/app/component/message/buttons/action-button/action-button.component.spec.ts +49 -5
- package/src/app/component/message/buttons/link-button/link-button.component.scss +5 -8
- package/src/app/component/message/buttons/link-button/link-button.component.spec.ts +50 -5
- package/src/app/component/message/buttons/text-button/text-button.component.spec.ts +44 -5
- package/src/app/component/message/carousel/carousel.component.html +29 -16
- package/src/app/component/message/carousel/carousel.component.scss +20 -8
- package/src/app/component/message/carousel/carousel.component.spec.ts +80 -3
- package/src/app/component/message/carousel/carousel.component.ts +16 -0
- package/src/app/component/message/frame/frame.component.html +9 -4
- package/src/app/component/message/frame/frame.component.spec.ts +34 -15
- package/src/app/component/message/frame/frame.component.ts +7 -2
- 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 +24 -7
- package/src/app/component/message/image/image.component.html +12 -10
- package/src/app/component/message/image/image.component.scss +16 -0
- package/src/app/component/message/image/image.component.spec.ts +101 -15
- package/src/app/component/message/image/image.component.ts +90 -51
- package/src/app/component/message/info-message/info-message.component.spec.ts +26 -14
- package/src/app/component/message/json-sources/json-sources.component.html +38 -0
- package/src/app/component/message/json-sources/json-sources.component.scss +201 -0
- package/src/app/component/message/json-sources/json-sources.component.ts +89 -0
- package/src/app/component/message/like-unlike/like-unlike.component.html +7 -9
- package/src/app/component/message/like-unlike/like-unlike.component.spec.ts +31 -3
- package/src/app/component/message/return-receipt/return-receipt.component.spec.ts +38 -17
- package/src/app/component/message/text/text.component.html +3 -3
- package/src/app/component/message/text/text.component.scss +80 -86
- package/src/app/component/message/text/text.component.spec.ts +106 -13
- package/src/app/component/message-attachment/message-attachment.component.spec.ts +134 -13
- package/src/app/component/selection-department/selection-department.component.html +21 -23
- package/src/app/component/selection-department/selection-department.component.spec.ts +159 -14
- package/src/app/component/selection-department/selection-department.component.ts +8 -1
- package/src/app/component/send-button/send-button.component.html +5 -13
- 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 +51 -81
- package/src/app/directives/tooltip.directive.spec.ts +8 -4
- package/src/app/modals/confirm-close/confirm-close.component.html +20 -8
- package/src/app/modals/confirm-close/confirm-close.component.scss +3 -0
- package/src/app/modals/confirm-close/confirm-close.component.spec.ts +13 -4
- package/src/app/modals/confirm-close/confirm-close.component.ts +8 -1
- package/src/app/pipe/html-entites-encode.pipe.spec.ts +35 -2
- package/src/app/pipe/marked.pipe.spec.ts +38 -2
- package/src/app/pipe/marked.pipe.ts +51 -41
- package/src/app/providers/app-config.service.ts +4 -2
- package/src/app/providers/brand.service.spec.ts +23 -2
- package/src/app/providers/brand.service.ts +1 -1
- package/src/app/providers/global-settings.service.spec.ts +1009 -14
- package/src/app/providers/global-settings.service.ts +59 -2
- package/src/app/providers/json-sources-parser.service.ts +175 -0
- package/src/app/providers/translator.service.ts +24 -6
- package/src/app/providers/tts-audio-playback-coordinator.service.spec.ts +117 -0
- package/src/app/providers/tts-audio-playback-coordinator.service.ts +45 -7
- package/src/app/providers/url-preview.service.ts +82 -0
- package/src/app/providers/voice/audio.types.ts +6 -0
- package/src/app/providers/voice/voice-streaming.service.spec.ts +23 -0
- package/src/app/providers/voice/voice-streaming.service.ts +702 -0
- package/src/app/providers/voice/voice-streaming.types.ts +112 -0
- package/src/app/providers/voice/voice.service.spec.ts +170 -3
- package/src/app/providers/voice/voice.service.ts +695 -16
- package/src/app/sass/_variables.scss +1 -1
- package/src/app/sass/animations.scss +19 -1
- package/src/app/utils/globals.ts +14 -0
- package/src/app/utils/json-sources-utils.ts +27 -0
- package/src/app/utils/url-utils.ts +98 -0
- package/src/app/utils/utils-resources.ts +1 -1
- package/src/assets/i18n/en.json +106 -100
- package/src/assets/i18n/es.json +107 -101
- package/src/assets/i18n/fr.json +107 -101
- package/src/assets/i18n/it.json +107 -99
- package/src/assets/sounds/keyboard.mp3 +0 -0
- package/src/assets/twp/index-dev.html +18 -0
- package/src/assets/twp/tiledesk_widget_files/widget-css-override-example.css +14 -0
- package/src/chat21-core/providers/chat-manager.spec.ts +72 -0
- package/src/chat21-core/providers/scripts/script.service.spec.ts +12 -2
- package/src/chat21-core/utils/constants.ts +4 -0
- package/src/chat21-core/utils/utils-message.ts +23 -1
- package/src/widget-config-template.json +3 -1
- package/src/widget-config.json +28 -27
- package/tests/widget-form-rich.spec.ts +67 -0
- package/tests/widget-index-dev-settings.spec.ts +52 -0
- package/tests/widget-twp-iframe.spec.ts +39 -0
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
|
2
2
|
import { By } from '@angular/platform-browser';
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
MSG_STATUS_RETURN_RECEIPT,
|
|
5
|
+
MSG_STATUS_SENT,
|
|
6
|
+
MSG_STATUS_SENT_SERVER,
|
|
7
|
+
} from 'src/app/utils/constants';
|
|
4
8
|
|
|
5
9
|
import { ReturnReceiptComponent } from './return-receipt.component';
|
|
6
10
|
|
|
@@ -10,31 +14,48 @@ describe('ReturnReceiptComponent', () => {
|
|
|
10
14
|
|
|
11
15
|
beforeEach(waitForAsync(() => {
|
|
12
16
|
TestBed.configureTestingModule({
|
|
13
|
-
declarations: [
|
|
14
|
-
})
|
|
15
|
-
.compileComponents();
|
|
17
|
+
declarations: [ReturnReceiptComponent],
|
|
18
|
+
}).compileComponents();
|
|
16
19
|
}));
|
|
17
20
|
|
|
18
21
|
beforeEach(() => {
|
|
19
22
|
fixture = TestBed.createComponent(ReturnReceiptComponent);
|
|
20
23
|
component = fixture.componentInstance;
|
|
21
|
-
fixture.detectChanges();
|
|
22
24
|
});
|
|
23
25
|
|
|
24
26
|
it('should create', () => {
|
|
27
|
+
fixture.detectChanges();
|
|
25
28
|
expect(component).toBeTruthy();
|
|
26
29
|
});
|
|
27
30
|
|
|
28
|
-
it('
|
|
29
|
-
component.status=
|
|
31
|
+
it('should render schedule icon when status is falsy', () => {
|
|
32
|
+
component.status = 0 as any;
|
|
33
|
+
fixture.detectChanges();
|
|
34
|
+
const icons = fixture.debugElement.queryAll(By.css('.icon'));
|
|
35
|
+
expect(icons.length).toBe(1);
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
it('should render sent icon for MSG_STATUS_SENT', () => {
|
|
39
|
+
component.status = MSG_STATUS_SENT;
|
|
40
|
+
fixture.detectChanges();
|
|
41
|
+
expect(fixture.debugElement.queryAll(By.css('.icon')).length).toBe(1);
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
it('should render server-sent icon for MSG_STATUS_SENT_SERVER', () => {
|
|
45
|
+
component.status = MSG_STATUS_SENT_SERVER;
|
|
46
|
+
fixture.detectChanges();
|
|
47
|
+
expect(fixture.debugElement.queryAll(By.css('.icon')).length).toBe(1);
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
it('should render return receipt icon for MSG_STATUS_RETURN_RECEIPT', () => {
|
|
51
|
+
component.status = MSG_STATUS_RETURN_RECEIPT;
|
|
30
52
|
fixture.detectChanges();
|
|
31
|
-
expect(
|
|
32
|
-
})
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
// })
|
|
53
|
+
expect(fixture.debugElement.queryAll(By.css('.icon')).length).toBe(1);
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
it('should expose status constants on component', () => {
|
|
57
|
+
expect(component.MSG_STATUS_SENT).toBe(MSG_STATUS_SENT);
|
|
58
|
+
expect(component.MSG_STATUS_SENT_SERVER).toBe(MSG_STATUS_SENT_SERVER);
|
|
59
|
+
expect(component.MSG_STATUS_RETURN_RECEIPT).toBe(MSG_STATUS_RETURN_RECEIPT);
|
|
60
|
+
});
|
|
40
61
|
});
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
<
|
|
2
|
-
[innerHTML]="printMessage(text, messageEl, this) | marked"
|
|
3
|
-
[style.color]="color"></
|
|
1
|
+
<div #messageEl class="message_innerhtml marked"
|
|
2
|
+
[innerHTML]="printMessage(text, messageEl, this) | marked"
|
|
3
|
+
[style.color]="color"></div>
|
|
@@ -1,113 +1,107 @@
|
|
|
1
|
-
// Shadow DOM styles - isolati dal resto dell'applicazione
|
|
2
1
|
:host {
|
|
3
2
|
display: block;
|
|
4
|
-
// Le variabili CSS custom properties possono attraversare il boundary del Shadow DOM
|
|
5
3
|
font-size: var(--font-size-bubble-message, 14px);
|
|
6
4
|
}
|
|
7
5
|
|
|
8
6
|
.message_innerhtml {
|
|
9
7
|
margin: 0px;
|
|
10
|
-
|
|
11
|
-
&.marked{
|
|
8
|
+
|
|
9
|
+
&.marked {
|
|
12
10
|
padding: 12px 16px;
|
|
13
|
-
margin-block-start: 0em!important;
|
|
14
|
-
margin-block-end: 0em!important;
|
|
11
|
+
margin-block-start: 0em !important;
|
|
12
|
+
margin-block-end: 0em !important;
|
|
15
13
|
}
|
|
16
|
-
|
|
14
|
+
|
|
17
15
|
.text-message {
|
|
18
16
|
padding-top: 14px;
|
|
19
17
|
}
|
|
20
|
-
}
|
|
21
18
|
|
|
22
|
-
p {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
19
|
+
p {
|
|
20
|
+
font-size: inherit;
|
|
21
|
+
margin: 0;
|
|
22
|
+
line-height: 1.4em;
|
|
23
|
+
font-style: normal;
|
|
24
|
+
letter-spacing: normal;
|
|
25
|
+
font-stretch: normal;
|
|
26
|
+
font-variant: normal;
|
|
27
|
+
font-weight: 300;
|
|
28
|
+
overflow: hidden;
|
|
29
|
+
}
|
|
34
30
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}
|
|
31
|
+
a {
|
|
32
|
+
word-break: break-word;
|
|
33
|
+
color: inherit;
|
|
34
|
+
text-decoration: underline;
|
|
35
|
+
}
|
|
41
36
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}
|
|
37
|
+
a:hover {
|
|
38
|
+
margin-block-end: 0em;
|
|
39
|
+
margin-block-start: 0em;
|
|
40
|
+
}
|
|
47
41
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
42
|
+
ol {
|
|
43
|
+
margin-block-end: 0em;
|
|
44
|
+
margin-block-start: 0em;
|
|
45
|
+
padding-inline-start: 15px;
|
|
46
|
+
|
|
47
|
+
li::before {
|
|
48
|
+
content: "";
|
|
49
|
+
font-size: 1.4em;
|
|
50
|
+
vertical-align: middle;
|
|
51
|
+
}
|
|
57
52
|
}
|
|
58
|
-
}
|
|
59
53
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
}
|
|
54
|
+
h1, h2, h3, h4, h5, h6 {
|
|
55
|
+
margin-block-start: 0.5em;
|
|
56
|
+
margin-block-end: 0.5em;
|
|
57
|
+
font-weight: bold;
|
|
58
|
+
color: inherit;
|
|
59
|
+
}
|
|
67
60
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
}
|
|
61
|
+
&.marked h1 {
|
|
62
|
+
line-height: normal;
|
|
63
|
+
}
|
|
71
64
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
}
|
|
65
|
+
ul {
|
|
66
|
+
margin-block-end: 0em;
|
|
67
|
+
margin-block-start: 0em;
|
|
68
|
+
padding-inline-start: 15px;
|
|
69
|
+
}
|
|
77
70
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
}
|
|
71
|
+
code {
|
|
72
|
+
background-color: rgba(0, 0, 0, 0.05);
|
|
73
|
+
padding: 2px 4px;
|
|
74
|
+
border-radius: 3px;
|
|
75
|
+
font-family: monospace;
|
|
76
|
+
}
|
|
84
77
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
}
|
|
78
|
+
pre {
|
|
79
|
+
background-color: rgba(0, 0, 0, 0.05);
|
|
80
|
+
padding: 10px;
|
|
81
|
+
border-radius: 3px;
|
|
82
|
+
overflow-x: auto;
|
|
83
|
+
}
|
|
91
84
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
}
|
|
85
|
+
blockquote {
|
|
86
|
+
border-left: 3px solid rgba(0, 0, 0, 0.1);
|
|
87
|
+
padding-left: 10px;
|
|
88
|
+
margin-left: 0;
|
|
89
|
+
font-style: italic;
|
|
90
|
+
}
|
|
98
91
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
}
|
|
92
|
+
table {
|
|
93
|
+
border-collapse: collapse;
|
|
94
|
+
width: 100%;
|
|
95
|
+
margin: 10px 0;
|
|
96
|
+
}
|
|
104
97
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
}
|
|
98
|
+
table td, table th {
|
|
99
|
+
border: 1px solid rgba(0, 0, 0, 0.1);
|
|
100
|
+
padding: 8px;
|
|
101
|
+
}
|
|
109
102
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
103
|
+
table th {
|
|
104
|
+
background-color: rgba(0, 0, 0, 0.05);
|
|
105
|
+
font-weight: bold;
|
|
106
|
+
}
|
|
113
107
|
}
|
|
@@ -1,33 +1,126 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { MarkedPipe } from './../../../pipe/marked.pipe';
|
|
3
|
-
import { async, ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
|
1
|
+
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
|
4
2
|
|
|
3
|
+
import { MarkedPipe } from '../../../pipe/marked.pipe';
|
|
5
4
|
import { TextComponent } from './text.component';
|
|
6
5
|
|
|
7
|
-
|
|
6
|
+
/**
|
|
7
|
+
* Il template usa solo `| marked` su ciò che ritorna `printMessage(...)`:
|
|
8
|
+
* `[innerHTML]="printMessage(text, messageEl, this) | marked"`
|
|
9
|
+
* I test qui riproducono gli stessi use case (XSS / HTML grezzo / markdown) sulla pipeline reale del componente.
|
|
10
|
+
*/
|
|
11
|
+
describe('TextComponent (render via MarkedPipe)', () => {
|
|
8
12
|
let component: TextComponent;
|
|
9
13
|
let fixture: ComponentFixture<TextComponent>;
|
|
14
|
+
let markedPipe: MarkedPipe;
|
|
15
|
+
|
|
16
|
+
function shadowInnerHtml(): string {
|
|
17
|
+
const host = fixture.nativeElement as HTMLElement;
|
|
18
|
+
const root = host.shadowRoot;
|
|
19
|
+
if (!root) {
|
|
20
|
+
throw new Error('Expected ShadowDom root');
|
|
21
|
+
}
|
|
22
|
+
return (root.querySelector('.message_innerhtml') as HTMLElement).innerHTML;
|
|
23
|
+
}
|
|
10
24
|
|
|
11
25
|
beforeEach(waitForAsync(() => {
|
|
12
26
|
TestBed.configureTestingModule({
|
|
13
|
-
declarations: [
|
|
14
|
-
|
|
15
|
-
MarkedPipe,
|
|
16
|
-
HtmlEntitiesEncodePipe
|
|
17
|
-
]
|
|
18
|
-
})
|
|
19
|
-
.compileComponents();
|
|
27
|
+
declarations: [TextComponent, MarkedPipe],
|
|
28
|
+
}).compileComponents();
|
|
20
29
|
}));
|
|
21
30
|
|
|
22
31
|
beforeEach(() => {
|
|
23
32
|
fixture = TestBed.createComponent(TextComponent);
|
|
24
33
|
component = fixture.componentInstance;
|
|
25
|
-
|
|
26
|
-
component.
|
|
34
|
+
markedPipe = new MarkedPipe();
|
|
35
|
+
component.text = 'Msg text';
|
|
36
|
+
component.color = 'black';
|
|
27
37
|
fixture.detectChanges();
|
|
28
38
|
});
|
|
29
39
|
|
|
30
40
|
it('should create', () => {
|
|
31
41
|
expect(component).toBeTruthy();
|
|
32
42
|
});
|
|
43
|
+
|
|
44
|
+
it('printMessage should emit before and after and return text (input grezzo per la pipe)', () => {
|
|
45
|
+
spyOn(component.onBeforeMessageRender, 'emit');
|
|
46
|
+
spyOn(component.onAfterMessageRender, 'emit');
|
|
47
|
+
const out = component.printMessage('Hello', {} as any, component);
|
|
48
|
+
expect(out).toBe('Hello');
|
|
49
|
+
expect(component.onBeforeMessageRender.emit).toHaveBeenCalled();
|
|
50
|
+
expect(component.onAfterMessageRender.emit).toHaveBeenCalled();
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
it('should render message container with color style', () => {
|
|
54
|
+
const host = fixture.nativeElement as HTMLElement;
|
|
55
|
+
const el = host.shadowRoot!.querySelector('div.message_innerhtml') as HTMLElement;
|
|
56
|
+
expect(el).toBeTruthy();
|
|
57
|
+
expect(el.style.color).toBe('black');
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
describe('markdown (use case contenuto legittimo)', () => {
|
|
61
|
+
it('should render heading and bold from markdown', () => {
|
|
62
|
+
component.text = '# Title\n\n**Bold**';
|
|
63
|
+
fixture.detectChanges();
|
|
64
|
+
const html = shadowInnerHtml();
|
|
65
|
+
expect(html).toMatch(/<h1|<h2/i);
|
|
66
|
+
expect(html).toMatch(/<strong>|<b>/i);
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
it('should render unordered list from markdown', () => {
|
|
70
|
+
component.text = '- uno\n- due';
|
|
71
|
+
fixture.detectChanges();
|
|
72
|
+
const html = shadowInnerHtml();
|
|
73
|
+
expect(html).toMatch(/<ul/i);
|
|
74
|
+
expect(html).toMatch(/<li/i);
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
it('should render safe https link with rel=noopener (MarkedPipe renderer)', () => {
|
|
78
|
+
component.text = '[label](https://example.com/path)';
|
|
79
|
+
fixture.detectChanges();
|
|
80
|
+
const html = shadowInnerHtml();
|
|
81
|
+
expect(html).toContain('https://example.com/path');
|
|
82
|
+
expect(html).toContain('rel="noopener noreferrer"');
|
|
83
|
+
expect(html).toContain('target="_blank"');
|
|
84
|
+
});
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
describe('sicurezza / anti code-injection (stesso use case, solo marked)', () => {
|
|
88
|
+
it('should not leave raw script tags in DOM innerHTML', () => {
|
|
89
|
+
component.text = '<script>alert(1)</script>testo';
|
|
90
|
+
fixture.detectChanges();
|
|
91
|
+
const html = shadowInnerHtml();
|
|
92
|
+
expect(html.toLowerCase()).not.toContain('<script');
|
|
93
|
+
expect(html).toContain('<');
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
it('should escape inline HTML img/onerror so it is not a live <img> node', () => {
|
|
97
|
+
component.text = 'Hi <img src=x onerror="alert(1)">';
|
|
98
|
+
fixture.detectChanges();
|
|
99
|
+
const html = shadowInnerHtml();
|
|
100
|
+
expect(html.toLowerCase()).not.toContain('<img');
|
|
101
|
+
expect(html).toContain('<');
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
it('should not emit javascript: href for markdown link', () => {
|
|
105
|
+
component.text = '[bad](javascript:void(0))';
|
|
106
|
+
fixture.detectChanges();
|
|
107
|
+
const html = shadowInnerHtml();
|
|
108
|
+
expect(html).not.toMatch(/href=["']javascript:/i);
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
it('should not emit data: href for markdown link', () => {
|
|
112
|
+
component.text = '[bad](data:text/html,<script>alert(1)</script>)';
|
|
113
|
+
fixture.detectChanges();
|
|
114
|
+
const html = shadowInnerHtml();
|
|
115
|
+
expect(html).not.toMatch(/href=["']data:/i);
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
it('DOM innerHTML should match MarkedPipe applied to printMessage output (stessa pipeline del template)', () => {
|
|
119
|
+
component.text = 'Line1\n\n**x**';
|
|
120
|
+
fixture.detectChanges();
|
|
121
|
+
const raw = component.printMessage(component.text, {} as any, component);
|
|
122
|
+
const viaPipe = markedPipe.transform(raw) as string;
|
|
123
|
+
expect(shadowInnerHtml()).toBe(viaPipe);
|
|
124
|
+
});
|
|
125
|
+
});
|
|
33
126
|
});
|
|
@@ -1,33 +1,154 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
1
|
+
import { CommonModule } from '@angular/common';
|
|
2
|
+
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
|
3
|
+
import { By } from '@angular/platform-browser';
|
|
4
|
+
|
|
5
|
+
import { MessageModel } from 'src/chat21-core/models/message';
|
|
6
|
+
import { ActionButtonComponent } from '../message/buttons/action-button/action-button.component';
|
|
7
|
+
import { LinkButtonComponent } from '../message/buttons/link-button/link-button.component';
|
|
8
|
+
import { TextButtonComponent } from '../message/buttons/text-button/text-button.component';
|
|
5
9
|
|
|
6
10
|
import { MessageAttachmentComponent } from './message-attachment.component';
|
|
7
11
|
|
|
12
|
+
function makeMessageWithAttachment(buttons: any[]): MessageModel {
|
|
13
|
+
return new MessageModel(
|
|
14
|
+
'm1',
|
|
15
|
+
'it',
|
|
16
|
+
'r1',
|
|
17
|
+
'Recipient',
|
|
18
|
+
's1',
|
|
19
|
+
'Sender',
|
|
20
|
+
200,
|
|
21
|
+
{},
|
|
22
|
+
'testo',
|
|
23
|
+
Date.now(),
|
|
24
|
+
'text',
|
|
25
|
+
{
|
|
26
|
+
attachment: {
|
|
27
|
+
type: 'template',
|
|
28
|
+
buttons,
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
'chat',
|
|
32
|
+
true,
|
|
33
|
+
false,
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
|
|
8
37
|
describe('MessageAttachmentComponent', () => {
|
|
9
38
|
let component: MessageAttachmentComponent;
|
|
10
39
|
let fixture: ComponentFixture<MessageAttachmentComponent>;
|
|
11
40
|
|
|
12
41
|
beforeEach(waitForAsync(() => {
|
|
13
42
|
TestBed.configureTestingModule({
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
.compileComponents();
|
|
43
|
+
imports: [CommonModule],
|
|
44
|
+
declarations: [
|
|
45
|
+
MessageAttachmentComponent,
|
|
46
|
+
LinkButtonComponent,
|
|
47
|
+
TextButtonComponent,
|
|
48
|
+
ActionButtonComponent,
|
|
49
|
+
],
|
|
50
|
+
}).compileComponents();
|
|
22
51
|
}));
|
|
23
52
|
|
|
24
53
|
beforeEach(() => {
|
|
25
54
|
fixture = TestBed.createComponent(MessageAttachmentComponent);
|
|
26
55
|
component = fixture.componentInstance;
|
|
27
|
-
|
|
56
|
+
component.isConversationArchived = false;
|
|
57
|
+
component.isLastMessage = true;
|
|
58
|
+
component.fullscreenMode = false;
|
|
59
|
+
component.limit = 5;
|
|
60
|
+
component.stylesMap = new Map<string, string>([
|
|
61
|
+
['buttonFontSize', '14px'],
|
|
62
|
+
['buttonBackgroundColor', '#eee'],
|
|
63
|
+
['buttonTextColor', '#111'],
|
|
64
|
+
['buttonHoverBackgroundColor', '#ddd'],
|
|
65
|
+
['buttonHoverTextColor', '#000'],
|
|
66
|
+
]);
|
|
28
67
|
});
|
|
29
68
|
|
|
30
69
|
it('should create', () => {
|
|
70
|
+
component.message = makeMessageWithAttachment([]);
|
|
71
|
+
fixture.detectChanges();
|
|
31
72
|
expect(component).toBeTruthy();
|
|
32
73
|
});
|
|
74
|
+
|
|
75
|
+
it('getAttachmentButton should read type and buttons from message.attributes.attachment', () => {
|
|
76
|
+
component.message = makeMessageWithAttachment([
|
|
77
|
+
{ type: 'text', value: 'OK' },
|
|
78
|
+
{ type: 'url', value: 'Apri', link: 'https://example.com' },
|
|
79
|
+
]);
|
|
80
|
+
component.ngOnInit();
|
|
81
|
+
expect(component.type).toBe('template');
|
|
82
|
+
expect((component.buttons as unknown as any[]).length).toBe(2);
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
it('should render text and url attachment buttons in DOM when isLastMessage is true for text', () => {
|
|
86
|
+
component.message = makeMessageWithAttachment([
|
|
87
|
+
{ type: 'text', value: 'Conferma' },
|
|
88
|
+
{ type: 'url', value: 'Vai', link: 'https://example.com', target: '_blank' },
|
|
89
|
+
]);
|
|
90
|
+
fixture.detectChanges();
|
|
91
|
+
const root = fixture.nativeElement.querySelector('#buttons-in-message') as HTMLElement;
|
|
92
|
+
expect(root).toBeTruthy();
|
|
93
|
+
expect(fixture.nativeElement.querySelector('chat-text-button-attachment')).toBeTruthy();
|
|
94
|
+
expect(fixture.nativeElement.querySelector('chat-link-button-attachment')).toBeTruthy();
|
|
95
|
+
const textBtn = fixture.nativeElement.querySelector('chat-text-button-attachment .text') as HTMLElement;
|
|
96
|
+
expect(textBtn.textContent?.trim()).toContain('Conferma');
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
it('should respect limit via slice (only first button when limit is 1)', () => {
|
|
100
|
+
component.limit = 1;
|
|
101
|
+
component.message = makeMessageWithAttachment([
|
|
102
|
+
{ type: 'text', value: 'A' },
|
|
103
|
+
{ type: 'text', value: 'B' },
|
|
104
|
+
]);
|
|
105
|
+
fixture.detectChanges();
|
|
106
|
+
const textButtons = fixture.nativeElement.querySelectorAll('chat-text-button-attachment');
|
|
107
|
+
expect(textButtons.length).toBe(1);
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
it('should hide text and action buttons when isLastMessage is false', () => {
|
|
111
|
+
component.isLastMessage = false;
|
|
112
|
+
component.message = makeMessageWithAttachment([
|
|
113
|
+
{ type: 'text', value: 'Nascosto' },
|
|
114
|
+
{ type: 'url', value: 'Visibile', link: 'https://x.com' },
|
|
115
|
+
]);
|
|
116
|
+
fixture.detectChanges();
|
|
117
|
+
expect(fixture.nativeElement.querySelector('chat-text-button-attachment')).toBeNull();
|
|
118
|
+
expect(fixture.nativeElement.querySelector('chat-link-button-attachment')).toBeTruthy();
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
it('returnOnAttachmentButtonClicked should emit structured event when target exists', () => {
|
|
122
|
+
component.message = makeMessageWithAttachment([{ type: 'text', value: 'X' }]);
|
|
123
|
+
fixture.detectChanges();
|
|
124
|
+
spyOn(component.onAttachmentButtonClicked, 'emit');
|
|
125
|
+
const inner = fixture.debugElement.query(By.css('chat-text-button-attachment .text'));
|
|
126
|
+
inner.triggerEventHandler('click', {});
|
|
127
|
+
expect(component.onAttachmentButtonClicked.emit).toHaveBeenCalled();
|
|
128
|
+
const arg = (component.onAttachmentButtonClicked.emit as jasmine.Spy).calls.mostRecent().args[0];
|
|
129
|
+
expect(arg.message).toBe(component.message);
|
|
130
|
+
expect(arg.target).toBeTruthy();
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
it('returnOnAttachmentButtonClicked should not emit when event has no target', () => {
|
|
134
|
+
component.message = makeMessageWithAttachment([{ type: 'text', value: 'X' }]);
|
|
135
|
+
fixture.detectChanges();
|
|
136
|
+
spyOn(component.onAttachmentButtonClicked, 'emit');
|
|
137
|
+
component.returnOnAttachmentButtonClicked({} as any);
|
|
138
|
+
expect(component.onAttachmentButtonClicked.emit).not.toHaveBeenCalled();
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
it('ngAfterViewInit should emit onElementRendered for attachment', () => {
|
|
142
|
+
spyOn(component.onElementRendered, 'emit');
|
|
143
|
+
component.message = makeMessageWithAttachment([{ type: 'url', value: 'L', link: 'https://a' }]);
|
|
144
|
+
fixture.detectChanges();
|
|
145
|
+
component.ngAfterViewInit();
|
|
146
|
+
expect(component.onElementRendered.emit).toHaveBeenCalledWith({ element: 'attachment', status: true });
|
|
147
|
+
});
|
|
148
|
+
|
|
149
|
+
it('should render action button when type is action and isLastMessage', () => {
|
|
150
|
+
component.message = makeMessageWithAttachment([{ type: 'action', value: 'Azione', action: 'reply' }]);
|
|
151
|
+
fixture.detectChanges();
|
|
152
|
+
expect(fixture.nativeElement.querySelector('chat-action-button-attachment')).toBeTruthy();
|
|
153
|
+
});
|
|
33
154
|
});
|
|
@@ -1,24 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
<!-- tabindex="1200"-->
|
|
3
|
-
|
|
4
|
-
<div id="chat21-selection-department"
|
|
1
|
+
<div id="chat21-selection-department"
|
|
5
2
|
#afSelectionDepartment
|
|
6
|
-
|
|
3
|
+
role="dialog"
|
|
7
4
|
aria-modal="true"
|
|
8
|
-
|
|
5
|
+
cdkTrapFocus
|
|
6
|
+
[cdkTrapFocusAutoCapture]="true"
|
|
7
|
+
[attr.aria-label]="g.LABEL_SELECT_TOPIC">
|
|
9
8
|
|
|
10
9
|
<!-- HEADER -->
|
|
11
|
-
<div class="c21-header" [ngStyle]="{'color': g.themeForegroundColor, 'background-image': g.colorGradient180 }"
|
|
10
|
+
<div class="c21-header" [ngStyle]="{'color': g.themeForegroundColor, 'background-image': g.colorGradient180 }">
|
|
12
11
|
<div class="c21-header-container">
|
|
13
12
|
|
|
14
|
-
<!-- ICON CLOSE
|
|
13
|
+
<!-- ICON CLOSE PANEL -->
|
|
15
14
|
<div class="c21-header-button">
|
|
16
|
-
<div class="c21-close-button c21-small"
|
|
17
|
-
<button
|
|
18
|
-
|
|
15
|
+
<div class="c21-close-button c21-small">
|
|
16
|
+
<button type="button"
|
|
17
|
+
[attr.aria-label]="g.BUTTON_CLOSE_TO_ICON || 'Close panel'"
|
|
18
|
+
class="c21-close-button-body"
|
|
19
|
+
(click)="closePage()">
|
|
20
|
+
<svg aria-hidden="true" focusable="false" xmlns="http://www.w3.org/2000/svg" width="20px" height="20px" viewBox="0 0 24 24">
|
|
19
21
|
<path fill="none" d="M0 0h24v24H0V0z"/>
|
|
20
22
|
<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"/>
|
|
21
|
-
<!-- <title id="altIconTitle">{{BUTTON_CLOSE_CHAT}}</title> -->
|
|
22
23
|
</svg>
|
|
23
24
|
</button>
|
|
24
25
|
</div>
|
|
@@ -26,9 +27,7 @@
|
|
|
26
27
|
|
|
27
28
|
<!-- CONTENT HEADER -->
|
|
28
29
|
<div class="c21-header-content">
|
|
29
|
-
<!-- TITLE HEADER -->
|
|
30
30
|
<div class="c21-title" [ngStyle]="{'color': g.themeForegroundColor}">
|
|
31
|
-
<!-- <span>{{g.LABEL_SELECT_TOPIC}}</span> -->
|
|
32
31
|
</div>
|
|
33
32
|
</div>
|
|
34
33
|
|
|
@@ -40,15 +39,17 @@
|
|
|
40
39
|
<div class="c21-body-container">
|
|
41
40
|
|
|
42
41
|
<div class="c21-body-header">
|
|
43
|
-
<
|
|
42
|
+
<h2 start-focus-chat21-selection-department class="c21-message-field">{{g.LABEL_SELECT_TOPIC}}</h2>
|
|
44
43
|
</div>
|
|
45
44
|
|
|
46
|
-
<div class="c21-body-content"
|
|
45
|
+
<div class="c21-body-content">
|
|
47
46
|
<ul class="chat21-content-modal-select">
|
|
48
47
|
<li *ngFor="let department of departments; let i = index">
|
|
49
|
-
<button
|
|
50
|
-
|
|
51
|
-
|
|
48
|
+
<button type="button"
|
|
49
|
+
class="c21-button-department c21-button-clean"
|
|
50
|
+
(click)="onSelectDepartment(department)">
|
|
51
|
+
<span class="chat21-badge" aria-hidden="true">{{i+1}}</span>
|
|
52
|
+
<span class="chat21-name-list">{{department?.name}}</span>
|
|
52
53
|
</button>
|
|
53
54
|
</li>
|
|
54
55
|
</ul>
|
|
@@ -56,7 +57,4 @@
|
|
|
56
57
|
|
|
57
58
|
</div>
|
|
58
59
|
</div>
|
|
59
|
-
|
|
60
|
-
<span style="height:0px" tabindex="1299" onFocus="document.querySelector('[start-focus-chat21-selection-department]').focus()"></span>
|
|
61
|
-
</div>
|
|
62
|
-
|
|
60
|
+
</div>
|