@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,222 +1,41 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { ConversationModel } from 'src/chat21-core/models/conversation';
|
|
6
|
-
import { ImageRepoService } from 'src/chat21-core/providers/abstract/image-repo.service';
|
|
7
|
-
import { CustomLogger } from 'src/chat21-core/providers/logger/customLogger';
|
|
8
|
-
import { LoggerInstance } from 'src/chat21-core/providers/logger/loggerInstance';
|
|
9
|
-
import { EventsService } from '../../providers/events.service';
|
|
10
|
-
import { HtmlEntitiesEncodePipe } from '../../pipe/html-entities-encode.pipe';
|
|
11
|
-
import { MarkedPipe } from '../../pipe/marked.pipe';
|
|
1
|
+
import { MarkedPipe } from './../../pipe/marked.pipe';
|
|
2
|
+
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
|
3
|
+
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
|
4
|
+
import { ImageRepoService } from '../../../chat21-core/providers/abstract/image-repo.service';
|
|
12
5
|
import { Globals } from '../../utils/globals';
|
|
13
|
-
import { MIN_WIDTH_IMAGES } from '../../utils/constants';
|
|
14
|
-
import { LastMessageComponent } from './last-message.component';
|
|
15
6
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
getImagePhotoUrl(): string {
|
|
19
|
-
return '';
|
|
20
|
-
}
|
|
21
|
-
checkImageExists(_uid: string, callback: (exist: boolean) => void): void {
|
|
22
|
-
callback(false);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
7
|
+
import { LastMessageComponent } from './last-message.component';
|
|
8
|
+
import { HtmlEntitiesEncodePipe } from '../../pipe/html-entities-encode.pipe';
|
|
25
9
|
|
|
26
10
|
describe('LastMessageComponent', () => {
|
|
27
|
-
let fixture: ComponentFixture<LastMessageComponent>;
|
|
28
11
|
let component: LastMessageComponent;
|
|
29
|
-
let
|
|
30
|
-
let events: EventsService;
|
|
31
|
-
const ngxlogger = jasmine.createSpyObj('NGXLogger', ['log', 'trace', 'debug', 'warn', 'error', 'info']);
|
|
32
|
-
|
|
33
|
-
function makeConversation(overrides: Partial<ConversationModel> = {}): ConversationModel {
|
|
34
|
-
return {
|
|
35
|
-
uid: 'conv-1',
|
|
36
|
-
attributes: {},
|
|
37
|
-
channel_type: 'direct',
|
|
38
|
-
conversation_with_fullname: 'Agent',
|
|
39
|
-
conversation_with: 'agent-1',
|
|
40
|
-
recipient: 'user-1',
|
|
41
|
-
recipient_fullname: 'User',
|
|
42
|
-
image: '',
|
|
43
|
-
is_new: true,
|
|
44
|
-
last_message_text: 'Messaggio mock in anteprima',
|
|
45
|
-
text: '',
|
|
46
|
-
sender: 'agent-1',
|
|
47
|
-
senderAuthInfo: null,
|
|
48
|
-
sender_fullname: 'Agent Name',
|
|
49
|
-
status: '200',
|
|
50
|
-
timestamp: '1',
|
|
51
|
-
selected: false,
|
|
52
|
-
color: '',
|
|
53
|
-
avatar: '',
|
|
54
|
-
archived: false,
|
|
55
|
-
type: 'text',
|
|
56
|
-
sound: true,
|
|
57
|
-
...overrides,
|
|
58
|
-
} as ConversationModel;
|
|
59
|
-
}
|
|
12
|
+
let fixture: ComponentFixture<LastMessageComponent>;
|
|
60
13
|
|
|
61
|
-
beforeEach(
|
|
62
|
-
LoggerInstance.setInstance(new CustomLogger(ngxlogger));
|
|
14
|
+
beforeEach(async(() => {
|
|
63
15
|
TestBed.configureTestingModule({
|
|
64
|
-
declarations: [
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
16
|
+
declarations: [
|
|
17
|
+
LastMessageComponent,
|
|
18
|
+
MarkedPipe,
|
|
19
|
+
HtmlEntitiesEncodePipe
|
|
20
|
+
],
|
|
21
|
+
imports: [
|
|
22
|
+
],
|
|
23
|
+
providers: [
|
|
24
|
+
Globals,
|
|
25
|
+
ImageRepoService,
|
|
26
|
+
],
|
|
27
|
+
schemas: [NO_ERRORS_SCHEMA]
|
|
28
|
+
})
|
|
29
|
+
.compileComponents();
|
|
68
30
|
}));
|
|
69
31
|
|
|
70
32
|
beforeEach(() => {
|
|
71
33
|
fixture = TestBed.createComponent(LastMessageComponent);
|
|
72
34
|
component = fixture.componentInstance;
|
|
73
|
-
|
|
74
|
-
events = TestBed.inject(EventsService);
|
|
75
|
-
globals.initDefafultParameters();
|
|
76
|
-
globals.senderId = 'user-1';
|
|
77
|
-
globals.isOpen = false;
|
|
78
|
-
globals.isOpenNewMessage = true;
|
|
79
|
-
spyOn(globals, 'setWidgetPreviewContainerSize').and.stub();
|
|
80
|
-
component.baseLocation = 'https://widget.test/';
|
|
81
|
-
component.stylesMap = new Map([['bubbleReceivedTextColor', '#111']]);
|
|
35
|
+
fixture.detectChanges();
|
|
82
36
|
});
|
|
83
37
|
|
|
84
38
|
it('should create', () => {
|
|
85
39
|
expect(component).toBeTruthy();
|
|
86
40
|
});
|
|
87
|
-
|
|
88
|
-
it('con widget chiuso (isOpen=false) e anteprima attiva: mostra il bubble con il testo del messaggio mockato', fakeAsync(() => {
|
|
89
|
-
const conv = makeConversation();
|
|
90
|
-
component.conversation = conv;
|
|
91
|
-
component.ngOnChanges({
|
|
92
|
-
conversation: new SimpleChange(undefined, conv, true),
|
|
93
|
-
});
|
|
94
|
-
fixture.detectChanges();
|
|
95
|
-
|
|
96
|
-
const preview = fixture.debugElement.query(By.css('#messagePreview'));
|
|
97
|
-
expect(preview).toBeTruthy();
|
|
98
|
-
expect(component.messages.length).toBe(1);
|
|
99
|
-
expect(component.messages[0].text).toContain('Messaggio mock in anteprima');
|
|
100
|
-
expect(globals.isOpen).toBe(false);
|
|
101
|
-
flush();
|
|
102
|
-
}));
|
|
103
|
-
|
|
104
|
-
it('closeMessagePreview azzera conversazione, isOpenNewMessage e emette onCloseMessagePreview', () => {
|
|
105
|
-
const conv = makeConversation();
|
|
106
|
-
component.conversation = conv;
|
|
107
|
-
component.ngOnChanges({ conversation: new SimpleChange(undefined, conv, true) });
|
|
108
|
-
fixture.detectChanges();
|
|
109
|
-
|
|
110
|
-
spyOn(component.onCloseMessagePreview, 'emit');
|
|
111
|
-
component.closeMessagePreview();
|
|
112
|
-
expect(component.conversation).toBeNull();
|
|
113
|
-
expect(globals.isOpenNewMessage).toBe(false);
|
|
114
|
-
expect(component.onCloseMessagePreview.emit).toHaveBeenCalled();
|
|
115
|
-
});
|
|
116
|
-
|
|
117
|
-
it('openConversationByID emette onSelectedConversation e azzera isOpenNewMessage', () => {
|
|
118
|
-
const conv = makeConversation();
|
|
119
|
-
spyOn(component.onSelectedConversation, 'emit');
|
|
120
|
-
component.openConversationByID(conv);
|
|
121
|
-
expect(component.onSelectedConversation.emit).toHaveBeenCalledWith(conv as any);
|
|
122
|
-
expect(globals.isOpenNewMessage).toBe(false);
|
|
123
|
-
expect(component.conversation).toBeNull();
|
|
124
|
-
});
|
|
125
|
-
|
|
126
|
-
it('onAttachmentButtonClicked apre la conversazione e pubblica lastMessage:attachmentButtonClicked', fakeAsync(() => {
|
|
127
|
-
spyOn(events, 'publish');
|
|
128
|
-
const conv = makeConversation({
|
|
129
|
-
attributes: { attachment: { a: 1 } },
|
|
130
|
-
last_message_text: 'file',
|
|
131
|
-
});
|
|
132
|
-
component.conversation = conv;
|
|
133
|
-
component.ngOnChanges({ conversation: new SimpleChange(undefined, conv, true) });
|
|
134
|
-
fixture.detectChanges();
|
|
135
|
-
|
|
136
|
-
const payload = { kind: 'test' };
|
|
137
|
-
component.onAttachmentButtonClicked(payload);
|
|
138
|
-
tick(600);
|
|
139
|
-
expect(events.publish).toHaveBeenCalledWith('lastMessage:attachmentButtonClicked', payload);
|
|
140
|
-
}));
|
|
141
|
-
|
|
142
|
-
it('conversation con attributes.commands usa addCommandMessage', fakeAsync(() => {
|
|
143
|
-
const conv = makeConversation({
|
|
144
|
-
attributes: {
|
|
145
|
-
commands: [
|
|
146
|
-
{
|
|
147
|
-
type: 'message',
|
|
148
|
-
message: { text: ' cmd-a ', type: 'text', metadata: {} },
|
|
149
|
-
},
|
|
150
|
-
{ type: 'wait', time: 5 },
|
|
151
|
-
{
|
|
152
|
-
type: 'message',
|
|
153
|
-
message: { text: ' cmd-b ', type: 'text', metadata: {} },
|
|
154
|
-
},
|
|
155
|
-
],
|
|
156
|
-
},
|
|
157
|
-
last_message_text: 'ignored',
|
|
158
|
-
});
|
|
159
|
-
component.conversation = conv;
|
|
160
|
-
component.ngOnChanges({ conversation: new SimpleChange(undefined, conv, true) });
|
|
161
|
-
tick(0);
|
|
162
|
-
expect(component.messages.length).toBe(1);
|
|
163
|
-
tick(5);
|
|
164
|
-
expect(component.messages.length).toBe(2);
|
|
165
|
-
expect(component.messages[0].text).toContain('cmd-a');
|
|
166
|
-
expect(component.messages[1].text).toContain('cmd-b');
|
|
167
|
-
}));
|
|
168
|
-
|
|
169
|
-
it('getMetadataSize scala larghezza oltre il massimo', () => {
|
|
170
|
-
const meta = { width: 400, height: 100 };
|
|
171
|
-
const out = component.getMetadataSize(meta);
|
|
172
|
-
expect(out.width).toBe(230);
|
|
173
|
-
expect(out.height).toBeLessThan(100);
|
|
174
|
-
});
|
|
175
|
-
|
|
176
|
-
it('getMetadataSize alza immagini molto strette al minimo', () => {
|
|
177
|
-
const meta = { width: 40, height: 80 };
|
|
178
|
-
const out = component.getMetadataSize(meta);
|
|
179
|
-
expect(out.width).toBe(MIN_WIDTH_IMAGES);
|
|
180
|
-
});
|
|
181
|
-
|
|
182
|
-
it('getMetadataSize scala altezza oltre il massimo verticale', () => {
|
|
183
|
-
const meta = { width: 100, height: 400 };
|
|
184
|
-
const out = component.getMetadataSize(meta);
|
|
185
|
-
expect(out.height).toBe(150);
|
|
186
|
-
});
|
|
187
|
-
|
|
188
|
-
it('isSameSender delega a utils-message', () => {
|
|
189
|
-
component.messages = [{ sender: 'a' } as any, { sender: 'a' } as any];
|
|
190
|
-
expect(component.isSameSender('a', 1)).toBe(true);
|
|
191
|
-
});
|
|
192
|
-
|
|
193
|
-
it('onElementRenderedFN con messaggi renderizzati agenda setWidgetPreviewContainerSize', fakeAsync(() => {
|
|
194
|
-
const conv = makeConversation();
|
|
195
|
-
component.conversation = conv;
|
|
196
|
-
component.ngOnChanges({ conversation: new SimpleChange(undefined, conv, true) });
|
|
197
|
-
fixture.detectChanges();
|
|
198
|
-
component.onElementRenderedFN({});
|
|
199
|
-
tick(100);
|
|
200
|
-
flush();
|
|
201
|
-
expect(globals.setWidgetPreviewContainerSize).toHaveBeenCalled();
|
|
202
|
-
}));
|
|
203
|
-
|
|
204
|
-
it('ngOnDestroy pulisce stato', () => {
|
|
205
|
-
const conv = makeConversation();
|
|
206
|
-
component.conversation = conv;
|
|
207
|
-
component.messages = [{} as any];
|
|
208
|
-
globals.isOpenNewMessage = true;
|
|
209
|
-
component.ngOnDestroy();
|
|
210
|
-
expect(component.conversation).toBeNull();
|
|
211
|
-
expect(globals.isOpenNewMessage).toBe(false);
|
|
212
|
-
expect(component.messages.length).toBe(0);
|
|
213
|
-
});
|
|
214
|
-
|
|
215
|
-
it('unsubscribe svuota subscriptions', () => {
|
|
216
|
-
const sub = jasmine.createSpyObj('Subscription', ['unsubscribe']);
|
|
217
|
-
component.subscriptions = [sub];
|
|
218
|
-
component.unsubscribe();
|
|
219
|
-
expect(sub.unsubscribe).toHaveBeenCalled();
|
|
220
|
-
expect(component.subscriptions.length).toBe(0);
|
|
221
|
-
});
|
|
222
41
|
});
|
|
@@ -12,7 +12,7 @@ import { MIN_WIDTH_IMAGES } from 'src/app/utils/constants';
|
|
|
12
12
|
import { ConversationModel } from 'src/chat21-core/models/conversation';
|
|
13
13
|
import { LoggerService } from 'src/chat21-core/providers/abstract/logger.service';
|
|
14
14
|
import { LoggerInstance } from 'src/chat21-core/providers/logger/loggerInstance';
|
|
15
|
-
import { commandToMessage, conversationToMessage, isEmojii, isFrame, isImage,
|
|
15
|
+
import { commandToMessage, conversationToMessage, isEmojii, isFrame, isImage, isSameSender } from 'src/chat21-core/utils/utils-message';
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
@Component({
|
|
@@ -59,9 +59,6 @@ export class LastMessageComponent implements OnInit, AfterViewInit, OnDestroy {
|
|
|
59
59
|
ngOnChanges(changes: SimpleChanges) {
|
|
60
60
|
this.logger.debug('[LASTMESSAGE] onChanges', changes)
|
|
61
61
|
if(this.conversation){
|
|
62
|
-
|
|
63
|
-
/** if the message is sent by the logged user, do not add it to the messages array */
|
|
64
|
-
if(isSender(this.conversation.sender, this.g.senderId)) return;
|
|
65
62
|
|
|
66
63
|
if(this.conversation.attributes && this.conversation.attributes.commands){
|
|
67
64
|
this.addCommandMessage(this.conversation)
|
|
@@ -1,15 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
<!-- tabindex="000"-->
|
|
2
|
+
|
|
3
|
+
<button aflauncherbutton #aflauncherbutton id="c21-launcher-button" class="c21-button-clean scale-in-center"
|
|
4
|
+
*ngIf="g.isOpen == false"
|
|
3
5
|
[ngClass]="{'c21-align-left' : g.align === 'left', 'c21-align-right' : g.align !== 'left'}"
|
|
4
6
|
[ngStyle]="{ 'background-color': g.baloonImage? null: 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}"
|
|
5
7
|
(click)="openCloseWidget()"
|
|
6
|
-
|
|
7
|
-
|
|
8
|
+
tabindex="1000"
|
|
9
|
+
aria-label=" apri chat"
|
|
10
|
+
>
|
|
11
|
+
|
|
12
|
+
<!-- <div *ngIf="g.conversationsBadge>0" class="c21-divBudge">{{g.conversationsBadge}}</div> -->
|
|
8
13
|
|
|
9
14
|
<!-- OPEN ICON -->
|
|
10
15
|
<div *ngIf="!g.isOpen" class="launcher-button rotate-center" [@enterBubbleAnimation]>
|
|
11
|
-
<img *ngIf="g.baloonImage !== '' " [src]="g.baloonImage"
|
|
12
|
-
<svg
|
|
16
|
+
<img *ngIf="g.baloonImage !== '' " [src]="g.baloonImage" [ngStyle]="{'width': '100%', 'height': '100%', 'margin': 'auto', 'border-radius': g.baloonShape}">
|
|
17
|
+
<svg role="img" [ngStyle]="{'fill': g.themeForegroundColor, 'display': (g.baloonImage==='')?'':'none' }" xmlns="http://www.w3.org/2000/svg" width="100%"
|
|
13
18
|
height="100%" viewBox="0 0 90 90">
|
|
14
19
|
<path fill="none" d="M0 0h24v24H0V0z" />
|
|
15
20
|
<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" />
|
|
@@ -23,11 +28,11 @@
|
|
|
23
28
|
|
|
24
29
|
<!-- CLOSE ICON -->
|
|
25
30
|
<div *ngIf="g.isOpen" class="launcher-button rotate-center" [@enterCloseAnimation]>
|
|
26
|
-
<svg
|
|
31
|
+
<svg role="img" [ngStyle]="{'fill': g.themeForegroundColor }" xmlns="http://www.w3.org/2000/svg" width="100%"
|
|
27
32
|
height="100%" viewBox="0 0 90 90">
|
|
28
33
|
<path fill="none" d="M0 0h24v24H0V0z" />
|
|
29
34
|
<path class="cls-1" d="M54.92,37.08l-2-2L45,43l-7.92-7.92-2,2L43,45l-7.92,7.92,2,2L45,47l7.92,7.92,2-2L47,45Z" />
|
|
30
35
|
</svg>
|
|
31
36
|
</div>
|
|
32
37
|
|
|
33
|
-
</button>
|
|
38
|
+
</button>
|
|
@@ -1,124 +1,28 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ComponentFixture, fakeAsync, TestBed, tick, waitForAsync } from '@angular/core/testing';
|
|
3
|
-
import { By } from '@angular/platform-browser';
|
|
4
|
-
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
|
1
|
+
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
|
5
2
|
import { AppStorageService } from '../../../chat21-core/providers/abstract/app-storage.service';
|
|
6
|
-
import { convertColorToRGBA } from 'src/chat21-core/utils/utils';
|
|
7
3
|
import { Globals } from '../../utils/globals';
|
|
8
|
-
import { LauncherButtonComponent } from './launcher-button.component';
|
|
9
4
|
|
|
10
|
-
|
|
11
|
-
class AppStorageStub extends AppStorageService {
|
|
12
|
-
initialize(): void {}
|
|
13
|
-
getItem(): any {
|
|
14
|
-
return null;
|
|
15
|
-
}
|
|
16
|
-
setItem(): void {}
|
|
17
|
-
getItemWithoutProjectID(): any {
|
|
18
|
-
return null;
|
|
19
|
-
}
|
|
20
|
-
setItemWithoutProjectID(): void {}
|
|
21
|
-
removeItem(): void {}
|
|
22
|
-
clear(): void {}
|
|
23
|
-
}
|
|
5
|
+
import { LauncherButtonComponent } from './launcher-button.component';
|
|
24
6
|
|
|
25
7
|
describe('LauncherButtonComponent', () => {
|
|
26
|
-
let fixture: ComponentFixture<LauncherButtonComponent>;
|
|
27
8
|
let component: LauncherButtonComponent;
|
|
28
|
-
let
|
|
9
|
+
let fixture: ComponentFixture<LauncherButtonComponent>;
|
|
29
10
|
|
|
30
11
|
beforeEach(waitForAsync(() => {
|
|
31
12
|
TestBed.configureTestingModule({
|
|
32
|
-
declarations: [LauncherButtonComponent],
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}).compileComponents();
|
|
13
|
+
declarations: [ LauncherButtonComponent ],
|
|
14
|
+
providers: [ Globals, AppStorageService]
|
|
15
|
+
})
|
|
16
|
+
.compileComponents();
|
|
37
17
|
}));
|
|
38
18
|
|
|
39
19
|
beforeEach(() => {
|
|
40
20
|
fixture = TestBed.createComponent(LauncherButtonComponent);
|
|
41
21
|
component = fixture.componentInstance;
|
|
42
|
-
|
|
43
|
-
globals.initDefafultParameters();
|
|
44
|
-
globals.isOpen = false;
|
|
45
|
-
globals.align = 'right';
|
|
46
|
-
globals.marginX = '20px';
|
|
47
|
-
globals.marginY = '24px';
|
|
48
|
-
globals.themeColor = '#2a6ac1';
|
|
49
|
-
globals.themeForegroundColor = '#ffffff';
|
|
50
|
-
globals.launcherWidth = '60px';
|
|
51
|
-
globals.launcherHeight = '60px';
|
|
52
|
-
globals.baloonShape = '50%';
|
|
53
|
-
globals.baloonImage = '';
|
|
22
|
+
fixture.detectChanges();
|
|
54
23
|
});
|
|
55
24
|
|
|
56
25
|
it('should create', () => {
|
|
57
26
|
expect(component).toBeTruthy();
|
|
58
27
|
});
|
|
59
|
-
|
|
60
|
-
it('mostra il pulsante quando il widget è chiuso (isOpen=false)', () => {
|
|
61
|
-
fixture.detectChanges();
|
|
62
|
-
const btn = fixture.debugElement.query(By.css('#c21-launcher-button'));
|
|
63
|
-
expect(btn).toBeTruthy();
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
it('non mostra il launcher quando il widget è aperto', () => {
|
|
67
|
-
globals.isOpen = true;
|
|
68
|
-
fixture.detectChanges();
|
|
69
|
-
expect(fixture.debugElement.query(By.css('#c21-launcher-button'))).toBeNull();
|
|
70
|
-
});
|
|
71
|
-
|
|
72
|
-
it('applica border-radius da baloonShape e dimensioni da launcherWidth/Height', () => {
|
|
73
|
-
globals.baloonShape = '12px 4px 18px 8px';
|
|
74
|
-
globals.launcherWidth = '72px';
|
|
75
|
-
globals.launcherHeight = '80px';
|
|
76
|
-
fixture.detectChanges();
|
|
77
|
-
const btn = fixture.debugElement.query(By.css('#c21-launcher-button')).nativeElement as HTMLElement;
|
|
78
|
-
expect(btn.style.borderRadius).toBe('12px 4px 18px 8px');
|
|
79
|
-
expect(btn.style.width).toBe('72px');
|
|
80
|
-
expect(btn.style.height).toBe('80px');
|
|
81
|
-
});
|
|
82
|
-
|
|
83
|
-
it('con baloonImage: sfondo pulsante null e immagine con stesso border-radius', () => {
|
|
84
|
-
globals.baloonImage = 'https://cdn.example/launcher.svg';
|
|
85
|
-
globals.baloonShape = '8px';
|
|
86
|
-
fixture.detectChanges();
|
|
87
|
-
const btn = fixture.debugElement.query(By.css('#c21-launcher-button')).nativeElement as HTMLElement;
|
|
88
|
-
expect(btn.style.backgroundColor === '' || btn.style.backgroundColor === 'rgba(0, 0, 0, 0)').toBe(true);
|
|
89
|
-
const img = fixture.debugElement.query(By.css('img')).nativeElement as HTMLImageElement;
|
|
90
|
-
expect(img.src).toContain('launcher.svg');
|
|
91
|
-
expect(img.style.borderRadius).toBe('8px');
|
|
92
|
-
});
|
|
93
|
-
|
|
94
|
-
it('senza baloonImage: usa themeColor come background e classe allineamento sinistro', () => {
|
|
95
|
-
globals.baloonImage = '';
|
|
96
|
-
globals.align = 'left';
|
|
97
|
-
globals.themeColor = '#ff0000';
|
|
98
|
-
fixture.detectChanges();
|
|
99
|
-
const btn = fixture.debugElement.query(By.css('#c21-launcher-button')).nativeElement as HTMLElement;
|
|
100
|
-
expect(btn.style.backgroundColor).not.toBe('');
|
|
101
|
-
expect(btn.classList.contains('c21-align-left')).toBe(true);
|
|
102
|
-
});
|
|
103
|
-
|
|
104
|
-
it('ngAfterViewInit imposta box-shadow quando widget chiuso', fakeAsync(() => {
|
|
105
|
-
globals.isOpen = false;
|
|
106
|
-
fixture.detectChanges();
|
|
107
|
-
tick(0);
|
|
108
|
-
const btn = fixture.debugElement.query(By.css('#c21-launcher-button'))?.nativeElement as HTMLElement;
|
|
109
|
-
expect(btn).toBeTruthy();
|
|
110
|
-
const shadow = btn.style.boxShadow.replace(/\s/g, '');
|
|
111
|
-
expect(shadow).toContain('0px4px20px');
|
|
112
|
-
expect(shadow).toContain(convertColorToRGBA(globals.themeColor, 50).replace(/\s/g, ''));
|
|
113
|
-
}));
|
|
114
|
-
|
|
115
|
-
it('openCloseWidget emette lo stato corrente di isOpen', () => {
|
|
116
|
-
globals.isOpen = false;
|
|
117
|
-
spyOn(component.onButtonClicked, 'emit');
|
|
118
|
-
component.openCloseWidget();
|
|
119
|
-
expect(component.onButtonClicked.emit).toHaveBeenCalledWith(false);
|
|
120
|
-
globals.isOpen = true;
|
|
121
|
-
component.openCloseWidget();
|
|
122
|
-
expect(component.onButtonClicked.emit).toHaveBeenCalledWith(true);
|
|
123
|
-
});
|
|
124
28
|
});
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
<div id='c21-app-list-all-conversations'
|
|
2
|
-
|
|
3
|
-
[attr.aria-label]="g?.project?.widgetTitle || 'Conversations history'">
|
|
1
|
+
<div id='c21-app-list-all-conversations'>
|
|
2
|
+
<!-- tabindex="1300"-->
|
|
4
3
|
|
|
5
4
|
<!-- HEADER -->
|
|
6
5
|
<div class="c21-header" [ngStyle]="{'color': g.themeForegroundColor, 'background-image': g.colorGradient180 }">
|
|
@@ -8,11 +7,12 @@
|
|
|
8
7
|
<!-- CONTENT HEADER -->
|
|
9
8
|
<div class="c21-header-content">
|
|
10
9
|
<!-- ICON CLOSE CHAT -->
|
|
11
|
-
<div class="c21-header-button c21-right c21-close"
|
|
12
|
-
<svg
|
|
10
|
+
<div class="c21-header-button c21-right c21-close">
|
|
11
|
+
<svg role="img" aria-labelledby="altIconTitle" [ngStyle]="{'fill': g.themeForegroundColor }" xmlns="http://www.w3.org/2000/svg"
|
|
13
12
|
width="24px" height="24px" viewBox="0 0 24 24">
|
|
14
13
|
<path fill="none" d="M0 0h24v24H0V0z" />
|
|
15
14
|
<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" />
|
|
15
|
+
<title id="altIconTitle">{{g.BUTTON_CLOSE_TO_ICON}}</title>
|
|
16
16
|
</svg>
|
|
17
17
|
</div>
|
|
18
18
|
|
|
@@ -54,21 +54,26 @@
|
|
|
54
54
|
</div> -->
|
|
55
55
|
|
|
56
56
|
<!-- ICON BACK -->
|
|
57
|
-
<button
|
|
58
|
-
|
|
59
|
-
class="c21-header-button c21-left c21-button-clean"
|
|
60
|
-
(click)="returnClosePage()">
|
|
61
|
-
<svg aria-hidden="true" focusable="false" [ngStyle]="{'fill': g.themeForegroundColor }" xmlns="http://www.w3.org/2000/svg"
|
|
57
|
+
<button tabindex="1310" aria-label="indietro" class="c21-header-button c21-left c21-button-clean" (click)="returnClosePage()">
|
|
58
|
+
<svg role="img" aria-labelledby="altIconTitle" [ngStyle]="{'fill': g.themeForegroundColor }" xmlns="http://www.w3.org/2000/svg"
|
|
62
59
|
width="24px" height="24px" viewBox="0 0 24 24">
|
|
60
|
+
<!-- <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"/> -->
|
|
63
61
|
<path fill="none" d="M0 0h24v24H0V0z" />
|
|
64
62
|
<path d="M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12l4.58-4.59z" />
|
|
63
|
+
<title id="altIconTitle">{{g.PREV_CONVERSATIONS}}</title>
|
|
65
64
|
</svg>
|
|
66
65
|
</button>
|
|
67
66
|
|
|
68
67
|
<!-- TITLE HEADER -->
|
|
69
68
|
<div class="c21-title" [ngStyle]="{'color': g.themeForegroundColor}">
|
|
70
|
-
<
|
|
69
|
+
<!-- <div *ngIf="g.project.logoChat !== 'nologo'" class='avatar-project' item-start>
|
|
70
|
+
<div *ngIf="g.project.logoChat == 'tiledesklogo'" #avatarPlaceholder class="avatar-placeholder" [style.background-color]="g.project.color" [innerHTML]="g.project.avatar"></div>
|
|
71
|
+
<div *ngIf="g.project.logoChat !== 'tiledesklogo'" #avatarImage class="avatar-image" [style.background-image]="'url(' + g.project.logoChat + ')'"></div>
|
|
72
|
+
</div> -->
|
|
73
|
+
<div class="titleText">{{g.project.widgetTitle}}</div>
|
|
74
|
+
<!-- <span id="agent-available-status">{{areAgentsAvailableText}}</span> -->
|
|
71
75
|
</div>
|
|
76
|
+
<!-- <p class="c21-header-writing">{{writingMessage}}</p> -->
|
|
72
77
|
|
|
73
78
|
</div>
|
|
74
79
|
|
|
@@ -77,7 +82,7 @@
|
|
|
77
82
|
</div>
|
|
78
83
|
|
|
79
84
|
<!-- CONTENT -->
|
|
80
|
-
<div class="c21-body">
|
|
85
|
+
<div class="c21-body" tabindex="1311" onFocus="document.querySelector('[start-focus]').focus()">
|
|
81
86
|
|
|
82
87
|
<chat-list-conversations
|
|
83
88
|
[listConversations]="allConversations"
|
|
@@ -1,16 +1,12 @@
|
|
|
1
|
-
<div id='c21-app-list-conversations'
|
|
2
|
-
<div *ngFor="let conversation of listConversations | slice:0:limit"
|
|
3
|
-
<button
|
|
4
|
-
class="c21-item-conversation"
|
|
5
|
-
[attr.aria-label]="conversation?.sender_fullname + ': ' + conversation.last_message_text"
|
|
6
|
-
(click)="openConversationByID(conversation)">
|
|
1
|
+
<div id='c21-app-list-conversations'>
|
|
2
|
+
<div *ngFor="let conversation of listConversations | slice:0:limit">
|
|
3
|
+
<button tabindex="1103" class="c21-item-conversation" (click)="openConversationByID(conversation)">
|
|
7
4
|
<div class="c21-body-conv">
|
|
8
5
|
<div class="c21-left-conv">
|
|
9
6
|
<div class="c21-ball" [ngStyle]="{'background': isImageLoaded(conversation) ? 'transparent' : 'linear-gradient(rgb(255,255,255) -125%, ' + conversation.color + ')'}">
|
|
10
|
-
<span *ngIf="!isImageLoaded(conversation)" class="c21-ball-label"
|
|
11
|
-
<img *ngIf="conversation?.image"
|
|
12
|
-
[src]="conversation.image"
|
|
13
|
-
alt=""
|
|
7
|
+
<span *ngIf="!isImageLoaded(conversation)" class="c21-ball-label">{{conversation?.avatar}}</span>
|
|
8
|
+
<img *ngIf="conversation?.image"
|
|
9
|
+
[src]="conversation.image"
|
|
14
10
|
style="display: none;"
|
|
15
11
|
(load)="onImageLoad(conversation)"
|
|
16
12
|
(error)="onImageError(conversation)">
|
|
@@ -20,19 +16,21 @@
|
|
|
20
16
|
<div class="c21-right-conv">
|
|
21
17
|
<div class="c21-last-time">{{conversation?.timestamp | dateAgo}}</div>
|
|
22
18
|
<div class="truncate c21-name">{{conversation?.sender_fullname }}</div>
|
|
23
|
-
|
|
19
|
+
|
|
24
20
|
<!-- --- IMAGE PREVIEW ICON ---- -->
|
|
25
21
|
<div *ngIf="conversation?.type ==='image'" [class.not-read]="conversation?.is_new" class="c21-msg" style="float: left; margin-right: 5px;">
|
|
26
|
-
<svg
|
|
22
|
+
<svg role="img" aria-labelledby="altIconTitle" xmlns="http://www.w3.org/2000/svg" fill="#000000"
|
|
27
23
|
width="20px" height="20px" viewBox="0 0 24 24">
|
|
28
24
|
<path d="M0 0h24v24H0V0z" fill="none"/>
|
|
29
25
|
<path d="M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-4.86 8.86l-3 3.87L9 13.14 6 17h12l-3.86-5.14z"/>
|
|
30
26
|
</svg>
|
|
31
27
|
</div>
|
|
32
|
-
|
|
28
|
+
<!-- <div [class.not-read]="conversation.is_new" [class.archived]="conversation.archived" class="truncate c21-msg">{{conversation.last_message_text}}</div> -->
|
|
29
|
+
<!-- <div [class.not-read]="conversation.is_new" class="truncate c21-msg" [innerHTML]="conversation.last_message_text"></div> -->
|
|
30
|
+
|
|
33
31
|
<!-- --- ATTACHMENT ICON ---- -->
|
|
34
32
|
<div *ngIf="conversation.type !== 'image' && conversation.type !== 'text'" [class.not-read]="conversation.is_new" class="c21-msg" style="float: left; margin-right: 5px;">
|
|
35
|
-
<svg
|
|
33
|
+
<svg role="img" aria-labelledby="altIconTitle" xmlns="http://www.w3.org/2000/svg" fill="#000000"
|
|
36
34
|
width="20px" height="20px" viewBox="0 0 24 24" transform="rotate(45)">
|
|
37
35
|
<path d="M16.5 6v11.5c0 2.21-1.79 4-4 4s-4-1.79-4-4V5c0-1.38 1.12-2.5 2.5-2.5s2.5 1.12 2.5 2.5v10.5c0 .55-.45 1-1 1s-1-.45-1-1V6H10v9.5c0 1.38 1.12 2.5 2.5 2.5s2.5-1.12 2.5-2.5V5c0-2.21-1.79-4-4-4S7 2.79 7 5v12.5c0 3.04 2.46 5.5 5.5 5.5s5.5-2.46 5.5-5.5V6h-1.5z" />
|
|
38
36
|
</svg>
|
|
@@ -40,23 +38,25 @@
|
|
|
40
38
|
|
|
41
39
|
<!-- --- LAST MESSAGE ---- -->
|
|
42
40
|
<div [class.not-read]="conversation.is_new" [class.archived]="conversation.archived" class="truncate c21-msg">{{conversation.last_message_text}}</div>
|
|
41
|
+
<!-- <div *ngIf="conversation.type !=='image'" [class.not-read]="conversation.is_new" [class.archived]="conversation.archived" class="truncate c21-msg" [innerHTML]="conversation.last_message_text"></div> -->
|
|
43
42
|
</div>
|
|
44
|
-
|
|
45
|
-
<div *ngIf="conversation.is_new" [ngStyle]="{ 'background-color': stylesMap.get('themeColor') }" class="c21-divBudge"
|
|
46
|
-
<div
|
|
47
|
-
|
|
48
|
-
|
|
43
|
+
|
|
44
|
+
<div *ngIf="conversation.is_new" [ngStyle] = "{ 'background-color': stylesMap.get('themeColor') }" class="c21-divBudge">{{conversation.badge}}</div>
|
|
45
|
+
<div class="c21-icon-archived-chat" *ngIf="conversation.archived">
|
|
46
|
+
<!-- ICON ARCHIVED CHAT -->
|
|
47
|
+
<button tabindex="-1" class="c21-header-button c21-right c21-close c21-button-clean">
|
|
48
|
+
<svg role="img" aria-labelledby="altIconTitle" xmlns="http://www.w3.org/2000/svg" fill="#aaaaaa"
|
|
49
49
|
width="24px" height="24px" viewBox="0 0 24 24">
|
|
50
50
|
<path fill="none" d="M0 0h24v24H0z"/>
|
|
51
51
|
<path d="M13 3c-4.97 0-9 4.03-9 9H1l3.89 3.89.07.14L9 12H6c0-3.87 3.13-7 7-7s7 3.13 7 7-3.13 7-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42C8.27 19.99 10.51 21 13 21c4.97 0 9-4.03 9-9s-4.03-9-9-9zm-1 5v5l4.28 2.54.72-1.21-3.5-2.08V8H12z"/>
|
|
52
|
+
<title id="altIconTitle">{{ translationMap.get('CLOSED') }}</title>
|
|
52
53
|
</svg>
|
|
53
|
-
</
|
|
54
|
+
</button>
|
|
54
55
|
</div>
|
|
55
56
|
</div>
|
|
56
57
|
<div class="clear"></div>
|
|
57
58
|
</button>
|
|
58
|
-
|
|
59
|
+
|
|
59
60
|
</div>
|
|
60
61
|
</div>
|
|
61
62
|
|
|
62
|
-
|