@chat21/chat21-ionic 3.0.82-rc.7 → 3.0.82
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +5 -99
- package/README.md +2 -2
- package/package.json +3 -4
- package/src/app/app.component.html +1 -7
- package/src/app/app.component.scss +2 -20
- package/src/app/app.component.ts +18 -129
- package/src/app/app.module.ts +1 -3
- package/src/app/chatlib/conversation-detail/conversation-content/conversation-content.component.ts +1 -8
- package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.html +23 -77
- package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.scss +88 -171
- package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.ts +2 -40
- package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.html +24 -11
- package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.scss +10 -6
- package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.spec.ts +2 -2
- package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.ts +25 -16
- package/src/app/chatlib/conversation-detail/message/buttons/action-button/action-button.component.html +1 -5
- package/src/app/chatlib/conversation-detail/message/buttons/action-button/action-button.component.scss +15 -22
- package/src/app/chatlib/conversation-detail/message/buttons/action-button/action-button.component.ts +5 -25
- package/src/app/chatlib/conversation-detail/message/buttons/link-button/link-button.component.html +1 -2
- package/src/app/chatlib/conversation-detail/message/buttons/link-button/link-button.component.scss +15 -14
- package/src/app/chatlib/conversation-detail/message/buttons/link-button/link-button.component.ts +5 -24
- package/src/app/chatlib/conversation-detail/message/buttons/text-button/text-button.component.html +1 -6
- package/src/app/chatlib/conversation-detail/message/buttons/text-button/text-button.component.scss +13 -12
- package/src/app/chatlib/conversation-detail/message/buttons/text-button/text-button.component.ts +5 -26
- package/src/app/chatlib/conversation-detail/message/frame/frame.component.html +2 -8
- package/src/app/chatlib/conversation-detail/message/frame/frame.component.scss +0 -36
- package/src/app/chatlib/conversation-detail/message/frame/frame.component.ts +2 -2
- package/src/app/chatlib/conversation-detail/message/html/html.component.ts +1 -0
- package/src/app/chatlib/conversation-detail/message/image/image.component.html +2 -3
- package/src/app/chatlib/conversation-detail/message/image/image.component.scss +5 -17
- package/src/app/chatlib/conversation-detail/message/image/image.component.ts +1 -1
- package/src/app/chatlib/conversation-detail/message/info-message/info-message.component.scss +2 -3
- package/src/app/chatlib/conversation-detail/message/message-attachment/message-attachment.component.html +6 -16
- package/src/app/chatlib/conversation-detail/message/message-attachment/message-attachment.component.scss +3 -1
- package/src/app/chatlib/conversation-detail/message/message-attachment/message-attachment.component.ts +0 -2
- package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.html +52 -78
- package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.scss +20 -63
- package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.ts +10 -14
- package/src/app/components/canned-response/canned-response.component.html +9 -9
- package/src/app/components/canned-response/canned-response.component.scss +7 -14
- package/src/app/components/canned-response/canned-response.component.ts +1 -1
- package/src/app/components/contacts-directory/contacts-directory.component.html +26 -22
- package/src/app/components/contacts-directory/contacts-directory.component.scss +6 -8
- package/src/app/components/conversation-detail/bubble-day-message/bubble-day-message.component.html +3 -0
- package/src/app/components/conversation-detail/bubble-day-message/bubble-day-message.component.scss +21 -0
- package/src/app/components/conversation-detail/bubble-day-message/bubble-day-message.component.spec.ts +24 -0
- package/src/app/components/conversation-detail/bubble-day-message/bubble-day-message.component.ts +14 -0
- package/src/app/components/conversation-detail/bubble-my-message/bubble-my-message.component.html +54 -0
- package/src/app/components/conversation-detail/bubble-my-message/bubble-my-message.component.scss +98 -0
- package/src/app/components/{conversations-list/header-conversations-list/header-conversations-list.component.spec.ts → conversation-detail/bubble-my-message/bubble-my-message.component.spec.ts} +6 -6
- package/src/app/components/conversation-detail/bubble-my-message/bubble-my-message.component.ts +84 -0
- package/src/app/components/conversation-detail/bubble-others-message/bubble-others-message.component.html +30 -0
- package/src/app/components/conversation-detail/bubble-others-message/bubble-others-message.component.scss +83 -0
- package/src/app/components/conversation-detail/bubble-others-message/bubble-others-message.component.spec.ts +24 -0
- package/src/app/components/conversation-detail/bubble-others-message/bubble-others-message.component.ts +68 -0
- package/src/app/components/conversation-detail/bubble-system-message/bubble-system-message.component.html +3 -0
- package/src/app/components/conversation-detail/bubble-system-message/bubble-system-message.component.scss +10 -0
- package/src/app/components/conversation-detail/bubble-system-message/bubble-system-message.component.spec.ts +24 -0
- package/src/app/components/conversation-detail/bubble-system-message/bubble-system-message.component.ts +14 -0
- package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.html +42 -61
- package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.scss +61 -98
- package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.ts +25 -9
- package/src/app/components/conversation-detail/message-text-area/message-text-area.component.html +8 -17
- package/src/app/components/conversation-detail/message-text-area/message-text-area.component.scss +4 -4
- package/src/app/components/conversation-detail/message-text-area/message-text-area.component.ts +84 -24
- package/src/app/components/conversation-detail/option-header/option-header.component.html +13 -0
- package/src/app/components/conversation-detail/option-header/option-header.component.scss +0 -0
- package/src/app/components/{conversations-list/header-conversations-list-archived/header-conversations-list-archived.component.spec.ts → conversation-detail/option-header/option-header.component.spec.ts} +5 -5
- package/src/app/components/{conversations-list/header-conversations-list-archived/header-conversations-list-archived.component.ts → conversation-detail/option-header/option-header.component.ts} +4 -5
- package/src/app/components/conversation-info/info-content/info-content.component.html +4 -8
- package/src/app/components/conversation-info/info-content/info-content.component.ts +6 -3
- package/src/app/components/conversation-info/info-direct/info-direct.component.html +13 -7
- package/src/app/components/conversation-info/info-direct/info-direct.component.scss +0 -23
- package/src/app/components/conversation-info/info-direct/info-direct.component.ts +6 -1
- package/src/app/components/conversation-info/info-group/info-group.component.html +108 -44
- package/src/app/components/conversation-info/info-group/info-group.component.scss +61 -101
- package/src/app/components/conversation-info/info-group/info-group.component.ts +0 -1
- package/src/app/components/conversation-info/info-support-group/info-support-group.component.html +1 -2
- package/src/app/components/conversation-info/info-support-group/info-support-group.component.ts +1 -0
- package/src/app/components/{conversations-list/header-conversations-list/header-conversations-list.component.html → ddp-header/ddp-header.component.html} +3 -3
- package/src/app/components/{conversations-list/header-conversations-list/header-conversations-list.component.scss → ddp-header/ddp-header.component.scss} +4 -16
- package/src/app/components/{navbar/navbar.component.spec.ts → ddp-header/ddp-header.component.spec.ts} +6 -6
- package/src/app/components/{conversations-list/header-conversations-list/header-conversations-list.component.ts → ddp-header/ddp-header.component.ts} +16 -7
- package/src/app/components/project-item/project-item.component.html +149 -98
- package/src/app/components/project-item/project-item.component.scss +35 -43
- package/src/app/components/project-item/project-item.component.ts +4 -16
- package/src/app/components/sidebar-user-details/sidebar-user-details.component.html +5 -5
- package/src/app/components/sidebar-user-details/sidebar-user-details.component.ts +10 -23
- package/src/app/components/utils/user-presence/user-presence.component.html +2 -7
- package/src/app/components/utils/user-presence/user-presence.component.scss +18 -35
- package/src/app/components/utils/user-presence/user-presence.component.ts +10 -6
- package/src/app/pages/contacts-directory/contacts-directory.page.html +1 -1
- package/src/app/pages/contacts-directory/contacts-directory.page.scss +0 -47
- package/src/app/pages/contacts-directory/contacts-directory.page.ts +0 -2
- package/src/app/pages/conversation-detail/conversation-detail.module.ts +8 -0
- package/src/app/pages/conversation-detail/conversation-detail.page.html +23 -41
- package/src/app/pages/conversation-detail/conversation-detail.page.scss +250 -40
- package/src/app/pages/conversation-detail/conversation-detail.page.ts +112 -186
- package/src/app/pages/conversations-list/conversations-list.page.html +8 -11
- package/src/app/pages/conversations-list/conversations-list.page.scss +2 -18
- package/src/app/pages/conversations-list/conversations-list.page.ts +22 -25
- package/src/app/pages/create-canned-response/create-canned-response.page.ts +13 -13
- package/src/app/pages/loader-preview/loader-preview.page.html +1 -1
- package/src/app/pages/loader-preview/loader-preview.page.scss +0 -4
- package/src/app/pages/loader-preview/loader-preview.page.ts +2 -1
- package/src/app/pages/profile-info/profile-info.page.html +4 -2
- package/src/app/pages/unassigned-conversations/unassigned-conversations.page.html +1 -1
- package/src/app/pages/unassigned-conversations/unassigned-conversations.page.scss +0 -42
- package/src/app/pages/unassigned-conversations/unassigned-conversations.page.ts +0 -1
- package/src/app/services/canned-responses/canned-responses.service.ts +0 -26
- package/src/app/services/tiledesk/tiledesk.service.ts +25 -1
- package/src/app/services/websocket/websocket.service.ts +1 -1
- package/src/app/shared/shared.module.ts +33 -24
- package/src/assets/i18n/ar.json +265 -278
- package/src/assets/i18n/az.json +1 -14
- package/src/assets/i18n/de.json +2 -15
- package/src/assets/i18n/en.json +2 -15
- package/src/assets/i18n/es.json +2 -15
- package/src/assets/i18n/fr.json +1 -14
- package/src/assets/i18n/it.json +1 -14
- package/src/assets/i18n/kk.json +2 -15
- package/src/assets/i18n/pt.json +2 -15
- package/src/assets/i18n/ru.json +1 -14
- package/src/assets/i18n/sr.json +264 -277
- package/src/assets/i18n/sv.json +2 -15
- package/src/assets/i18n/tr.json +2 -15
- package/src/assets/i18n/uk.json +2 -15
- package/src/assets/i18n/uz.json +1 -14
- package/src/assets/js/chat21client.js +148 -175
- package/src/chat-config-mqtt-localhost.json +2 -2
- package/src/chat-config-native-mqtt.json +0 -3
- package/src/chat21-core/models/conversation.ts +1 -0
- package/src/chat21-core/providers/firebase/firebase-typing.service.ts +9 -7
- package/src/chat21-core/providers/mqtt/mqtt-auth-service.ts +8 -7
- package/src/chat21-core/utils/constants.ts +1 -6
- package/src/chat21-core/utils/user-typing/user-typing.component.html +5 -8
- package/src/chat21-core/utils/user-typing/user-typing.component.scss +17 -87
- package/src/chat21-core/utils/user-typing/user-typing.component.ts +94 -12
- package/src/chat21-core/utils/utils.ts +10 -38
- package/src/global.scss +255 -52
- package/src/index.html +9 -0
- package/src/variables.scss +10 -30
- package/deploy_amazon_beta.sh +0 -29
- package/deploy_amazon_prod.sh +0 -30
- package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component_2.html +0 -116
- package/src/app/components/conversations-list/header-conversations-list-archived/header-conversations-list-archived.component.html +0 -12
- package/src/app/components/conversations-list/header-conversations-list-archived/header-conversations-list-archived.component.scss +0 -14
- package/src/app/components/navbar/navbar.component.html +0 -103
- package/src/app/components/navbar/navbar.component.scss +0 -249
- package/src/app/components/navbar/navbar.component.ts +0 -190
- package/src/app/services/projects/projects.service.spec.ts +0 -12
- package/src/app/services/projects/projects.service.ts +0 -43
- package/src/assets/sounds/interface-start.mp3 +0 -0
- package/src/assets/sounds/wheep-wheep.mp3 +0 -0
- package/src/chat21-core/models/projects.ts +0 -27
- package/src/chat21-core/utils/convertRequestToConversation.ts +0 -41
|
@@ -1,24 +1,28 @@
|
|
|
1
1
|
|
|
2
|
-
<ion-
|
|
3
|
-
|
|
4
|
-
<ion-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
</ion-
|
|
2
|
+
<ion-content padding>
|
|
3
|
+
<ion-searchbar id="contacts-searchbar" debounce="500" (ionInput)="onSearchInput($event)"></ion-searchbar>
|
|
4
|
+
<ion-list>
|
|
5
|
+
|
|
6
|
+
<ion-item button="true" lines="none" class="ion-no-padding" *ngFor="let user of contacts" (click)="goToChat(user)">
|
|
7
|
+
<div tabindex="0"></div>
|
|
8
|
+
<!-- <div [class.selected]="user.uid === uidUserSelected"></div> [style.background-color]="user.color"-->
|
|
9
|
+
<ion-avatar slot="start">
|
|
10
|
+
<div #avatarPlaceholder class="avatar-placeholder" [ngStyle]="{'background': 'linear-gradient(rgb(255,255,255) -125%,' + user.color + ')'}" [innerHTML]="user.avatar"></div>
|
|
11
|
+
<div *ngIf="user.imageurl" #avatarImage class="avatar-profile" [style.background-image]="'url(' + user.imageurl + ')'"></div>
|
|
12
|
+
<!-- <div *ngIf="getImageAvatar(conversation.sender)" #avatarImage class="avatar-profile" [style.background-image]="'url(' + getImageAvatar(conversation.sender) + ')'"></div> -->
|
|
13
|
+
<div class="user-presence">
|
|
14
|
+
<app-presence
|
|
15
|
+
[isOnline]="user.online">
|
|
16
|
+
</app-presence>
|
|
17
|
+
</div>
|
|
18
|
+
</ion-avatar>
|
|
19
|
+
|
|
20
|
+
<ion-label>
|
|
21
|
+
<h2>{{ user.fullname }}</h2>
|
|
22
|
+
<!-- <p>{{ user.uid }}</p> -->
|
|
23
|
+
</ion-label>
|
|
24
|
+
|
|
25
|
+
</ion-item>
|
|
24
26
|
|
|
27
|
+
</ion-list>
|
|
28
|
+
</ion-content>
|
|
@@ -1,24 +1,22 @@
|
|
|
1
1
|
ion-item {
|
|
2
2
|
cursor: pointer;
|
|
3
3
|
height: 64px;
|
|
4
|
-
--min-height: 64px;
|
|
5
4
|
position: relative;
|
|
6
5
|
display: flex;
|
|
7
6
|
text-decoration: none;
|
|
8
|
-
|
|
7
|
+
padding-left: 8px;
|
|
8
|
+
padding-right: 8px;
|
|
9
9
|
--padding-start: 0;
|
|
10
10
|
--inner-padding-end: 0;
|
|
11
|
-
--background: transparent;
|
|
12
|
-
--background-hover: #000000 !important;
|
|
13
|
-
border-radius: var(--border-radius-item);
|
|
14
|
-
|
|
15
11
|
.selected {
|
|
12
|
+
border-radius: 10px;
|
|
13
|
+
padding-left: 8px;
|
|
14
|
+
padding-right: 8px;
|
|
16
15
|
position: absolute;
|
|
17
16
|
width: 100%;
|
|
18
17
|
height: 100%;
|
|
19
18
|
z-index:-1;
|
|
20
|
-
background:
|
|
21
|
-
border-right: 4px solid var(--basic-blue);
|
|
19
|
+
background-color: rgba(0, 0, 0, .05);
|
|
22
20
|
}
|
|
23
21
|
ion-avatar {
|
|
24
22
|
position: relative;
|
package/src/app/components/conversation-detail/bubble-day-message/bubble-day-message.component.scss
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
.row-day {
|
|
2
|
+
padding: 0 10px;
|
|
3
|
+
text-align: center;
|
|
4
|
+
width: 100%;
|
|
5
|
+
margin-top: 15px;
|
|
6
|
+
margin-bottom: 5px;
|
|
7
|
+
}
|
|
8
|
+
.header-day {
|
|
9
|
+
background-color: var(--transparent);
|
|
10
|
+
padding-top: 4px;
|
|
11
|
+
padding-bottom: 4px;
|
|
12
|
+
padding-left: 12px;
|
|
13
|
+
padding-right: 12px;
|
|
14
|
+
vertical-align: middle;
|
|
15
|
+
border-radius: 13px;
|
|
16
|
+
font-size: 14px;
|
|
17
|
+
font-weight: bold;
|
|
18
|
+
color: var(--basic-gray);
|
|
19
|
+
display: inline-block;
|
|
20
|
+
}
|
|
21
|
+
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
import { IonicModule } from '@ionic/angular';
|
|
3
|
+
|
|
4
|
+
import { BubbleDayMessageComponent } from './bubble-day-message.component';
|
|
5
|
+
|
|
6
|
+
describe('BubbleDayMessageComponent', () => {
|
|
7
|
+
let component: BubbleDayMessageComponent;
|
|
8
|
+
let fixture: ComponentFixture<BubbleDayMessageComponent>;
|
|
9
|
+
|
|
10
|
+
beforeEach(async(() => {
|
|
11
|
+
TestBed.configureTestingModule({
|
|
12
|
+
declarations: [ BubbleDayMessageComponent ],
|
|
13
|
+
imports: [IonicModule.forRoot()]
|
|
14
|
+
}).compileComponents();
|
|
15
|
+
|
|
16
|
+
fixture = TestBed.createComponent(BubbleDayMessageComponent);
|
|
17
|
+
component = fixture.componentInstance;
|
|
18
|
+
fixture.detectChanges();
|
|
19
|
+
}));
|
|
20
|
+
|
|
21
|
+
it('should create', () => {
|
|
22
|
+
expect(component).toBeTruthy();
|
|
23
|
+
});
|
|
24
|
+
});
|
package/src/app/components/conversation-detail/bubble-day-message/bubble-day-message.component.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Component, OnInit, Input } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
@Component({
|
|
4
|
+
selector: 'app-bubble-day-message',
|
|
5
|
+
templateUrl: './bubble-day-message.component.html',
|
|
6
|
+
styleUrls: ['./bubble-day-message.component.scss'],
|
|
7
|
+
})
|
|
8
|
+
export class BubbleDayMessageComponent implements OnInit {
|
|
9
|
+
@Input() messageDate = '';
|
|
10
|
+
constructor() { }
|
|
11
|
+
|
|
12
|
+
ngOnInit() {}
|
|
13
|
+
|
|
14
|
+
}
|
package/src/app/components/conversation-detail/bubble-my-message/bubble-my-message.component.html
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
<div class="message message-my" [class.first-message]="isFirstMessage" >
|
|
2
|
+
|
|
3
|
+
<div class="bubble-message"
|
|
4
|
+
[class.image]="message.type == 'image'"
|
|
5
|
+
[class.no-text]="!message.text"
|
|
6
|
+
(mouseover)="showButtonInfo()">
|
|
7
|
+
<span class="buttonInfo" (click)="presentPopover($event, message)"> </span>
|
|
8
|
+
|
|
9
|
+
<div *ngIf="message.type == 'image';"
|
|
10
|
+
(click)="popupUrl(message.metadata.src,'windowName')"
|
|
11
|
+
>
|
|
12
|
+
<img
|
|
13
|
+
class="message-content message-content-image"
|
|
14
|
+
[src]="message.metadata.src"
|
|
15
|
+
[width]="getSizeImg(message).width"
|
|
16
|
+
[height]="getSizeImg(message).height" />
|
|
17
|
+
</div>
|
|
18
|
+
|
|
19
|
+
<div *ngIf="message.type == 'file';" class="message-content message-content-text"
|
|
20
|
+
[innerHTML]="urlify(message.metadata.src, message.metadata.name)"
|
|
21
|
+
></div>
|
|
22
|
+
|
|
23
|
+
<div>
|
|
24
|
+
|
|
25
|
+
<!-- <div *ngIf="message.type == 'text'"> -->
|
|
26
|
+
<div *ngIf="isPopupUrl(message.text); then contentPopup else contentNewTab">here is ignored</div>
|
|
27
|
+
<ng-template #contentPopup>
|
|
28
|
+
<div style="text-decoration: underline; padding:8px; cursor: pointer;" (click)="popupUrl(message.text,'windowName')">{{stripTags(message.text)}}</div>
|
|
29
|
+
</ng-template>
|
|
30
|
+
<ng-template #contentNewTab>
|
|
31
|
+
<div class="message-content message-content-text" [innerHTML]="message.text"></div>
|
|
32
|
+
</ng-template>
|
|
33
|
+
<!-- </div> -->
|
|
34
|
+
|
|
35
|
+
</div>
|
|
36
|
+
|
|
37
|
+
<div class="timestamp-message right">{{message.timestamp | date: 'H:mm'}}</div>
|
|
38
|
+
</div>
|
|
39
|
+
|
|
40
|
+
<div class="attribute-message">
|
|
41
|
+
<div class="status-message">
|
|
42
|
+
<span *ngIf="!message.status" class="material-icons">
|
|
43
|
+
<ion-icon name="time-outline"></ion-icon>
|
|
44
|
+
</span>
|
|
45
|
+
<span *ngIf="message.status==MSG_STATUS_SENT" class="material-icons">
|
|
46
|
+
<ion-icon name="checkmark-outline"></ion-icon>
|
|
47
|
+
</span>
|
|
48
|
+
<span *ngIf="message.status==MSG_STATUS_RETURN_RECEIPT" class="material-icons">
|
|
49
|
+
<ion-icon name="checkmark-done-outline"></ion-icon>
|
|
50
|
+
</span>
|
|
51
|
+
</div>
|
|
52
|
+
</div>
|
|
53
|
+
|
|
54
|
+
</div>
|
package/src/app/components/conversation-detail/bubble-my-message/bubble-my-message.component.scss
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
.message {
|
|
2
|
+
.bubble-message {
|
|
3
|
+
position: relative;
|
|
4
|
+
border-radius: 15px;
|
|
5
|
+
font-size: 15px;
|
|
6
|
+
// padding: 5px 10px 10px 10px;
|
|
7
|
+
display: block;
|
|
8
|
+
width: auto;
|
|
9
|
+
max-width: 80%;
|
|
10
|
+
line-height: 1.34;
|
|
11
|
+
direction: ltr;
|
|
12
|
+
padding: 0px;
|
|
13
|
+
.message-content-image {
|
|
14
|
+
border-radius: 15px 6px 0px 0px;
|
|
15
|
+
}
|
|
16
|
+
&.no-text {
|
|
17
|
+
line-height: 0;
|
|
18
|
+
.message-content-image {
|
|
19
|
+
border-radius: 15px 6px 0px 15px;
|
|
20
|
+
}
|
|
21
|
+
.message-content.message-content-text{
|
|
22
|
+
padding: 0px;
|
|
23
|
+
height: 0px;
|
|
24
|
+
}
|
|
25
|
+
.timestamp-message {
|
|
26
|
+
background-color: #00000045;
|
|
27
|
+
padding: 4px;
|
|
28
|
+
color: white;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
&.image{
|
|
32
|
+
max-width: 300px;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
.message-content:after {
|
|
40
|
+
content: "\00a0\00a0\00a0\00a0\00a0\00a0";
|
|
41
|
+
}
|
|
42
|
+
.timestamp-message {
|
|
43
|
+
font-size: 10px;
|
|
44
|
+
padding: 0px;
|
|
45
|
+
position: absolute;
|
|
46
|
+
bottom: 2px;
|
|
47
|
+
right: 6px;
|
|
48
|
+
line-height: 15px;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
.message-my {
|
|
52
|
+
width: 100%;
|
|
53
|
+
margin-top: 4px;
|
|
54
|
+
.message-content.message-content-text{
|
|
55
|
+
color: var(--white)!important;
|
|
56
|
+
padding: 5px 20px 5px 10px;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
.bubble-message {
|
|
61
|
+
background-color: var(--bubble-blue);
|
|
62
|
+
color: white;
|
|
63
|
+
margin-right: 24px;
|
|
64
|
+
float: right;
|
|
65
|
+
border-top-right-radius: 6px;
|
|
66
|
+
border-bottom-right-radius: 6px;
|
|
67
|
+
}
|
|
68
|
+
&.first-message {
|
|
69
|
+
margin-top: 10px;
|
|
70
|
+
.bubble-message {
|
|
71
|
+
border-top-right-radius: 12px;
|
|
72
|
+
border-bottom-right-radius: 0px;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
.timestamp-message {
|
|
76
|
+
color: var(--white);
|
|
77
|
+
}
|
|
78
|
+
.attribute-message {
|
|
79
|
+
position: absolute;
|
|
80
|
+
width: 100%;
|
|
81
|
+
background-color: transparent;
|
|
82
|
+
bottom: 0;
|
|
83
|
+
right: 0;
|
|
84
|
+
.status-message {
|
|
85
|
+
position: absolute;
|
|
86
|
+
top: 0;
|
|
87
|
+
right: 0;
|
|
88
|
+
width: 15px;
|
|
89
|
+
.material-icons {
|
|
90
|
+
font-size: 15px;
|
|
91
|
+
color: var(--basic-blue);
|
|
92
|
+
position: absolute;
|
|
93
|
+
bottom: 4px;
|
|
94
|
+
right: 2px;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
2
|
import { IonicModule } from '@ionic/angular';
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import { BubbleMyMessageComponent } from './bubble-my-message.component';
|
|
5
5
|
|
|
6
|
-
describe('
|
|
7
|
-
let component:
|
|
8
|
-
let fixture: ComponentFixture<
|
|
6
|
+
describe('BubbleMineMessageComponent', () => {
|
|
7
|
+
let component: BubbleMyMessageComponent;
|
|
8
|
+
let fixture: ComponentFixture<BubbleMyMessageComponent>;
|
|
9
9
|
|
|
10
10
|
beforeEach(async(() => {
|
|
11
11
|
TestBed.configureTestingModule({
|
|
12
|
-
declarations: [
|
|
12
|
+
declarations: [ BubbleMyMessageComponent ],
|
|
13
13
|
imports: [IonicModule.forRoot()]
|
|
14
14
|
}).compileComponents();
|
|
15
15
|
|
|
16
|
-
fixture = TestBed.createComponent(
|
|
16
|
+
fixture = TestBed.createComponent(BubbleMyMessageComponent);
|
|
17
17
|
component = fixture.componentInstance;
|
|
18
18
|
fixture.detectChanges();
|
|
19
19
|
}));
|
package/src/app/components/conversation-detail/bubble-my-message/bubble-my-message.component.ts
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { Component, OnInit, Input } from '@angular/core';
|
|
2
|
+
import { MessageModel } from 'src/chat21-core/models/message';
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
// utils
|
|
7
|
+
import {
|
|
8
|
+
popupUrl,
|
|
9
|
+
urlify,
|
|
10
|
+
isPopupUrl,
|
|
11
|
+
stripTags
|
|
12
|
+
} from 'src/chat21-core/utils/utils';
|
|
13
|
+
|
|
14
|
+
import {
|
|
15
|
+
getSizeImg
|
|
16
|
+
} from 'src/chat21-core/utils/utils-message';
|
|
17
|
+
|
|
18
|
+
import {
|
|
19
|
+
MSG_STATUS_SENT,
|
|
20
|
+
MSG_STATUS_RETURN_RECEIPT,
|
|
21
|
+
MAX_WIDTH_IMAGES
|
|
22
|
+
} from 'src/chat21-core/utils/constants';
|
|
23
|
+
|
|
24
|
+
@Component({
|
|
25
|
+
selector: 'app-bubble-my-message',
|
|
26
|
+
templateUrl: './bubble-my-message.component.html',
|
|
27
|
+
styleUrls: ['./bubble-my-message.component.scss'],
|
|
28
|
+
})
|
|
29
|
+
|
|
30
|
+
export class BubbleMyMessageComponent implements OnInit {
|
|
31
|
+
@Input() message: MessageModel;
|
|
32
|
+
@Input() isFirstMessage = true;
|
|
33
|
+
|
|
34
|
+
// utils functions
|
|
35
|
+
popupUrl = popupUrl;
|
|
36
|
+
urlify = urlify;
|
|
37
|
+
isPopupUrl = isPopupUrl;
|
|
38
|
+
stripTags = stripTags;
|
|
39
|
+
|
|
40
|
+
// utils-message functions
|
|
41
|
+
getSizeImg = getSizeImg;
|
|
42
|
+
|
|
43
|
+
MSG_STATUS_SENT = MSG_STATUS_SENT;
|
|
44
|
+
MSG_STATUS_RETURN_RECEIPT = MSG_STATUS_RETURN_RECEIPT;
|
|
45
|
+
MAX_WIDTH_IMAGES = MAX_WIDTH_IMAGES;
|
|
46
|
+
|
|
47
|
+
constructor() { }
|
|
48
|
+
|
|
49
|
+
ngOnInit() {
|
|
50
|
+
// console.log('msg::::', JSON.stringify(this.message));
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/** */
|
|
54
|
+
showButtonInfo() {
|
|
55
|
+
//console.log('showButtonInfo');
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* apro il menu delle opzioni
|
|
60
|
+
* (metodo richiamato da html)
|
|
61
|
+
* alla chiusura controllo su quale opzione ho premuto e attivo l'azione corrispondete
|
|
62
|
+
*/
|
|
63
|
+
presentPopover(event, msg) {
|
|
64
|
+
// console.log('presentPopover');
|
|
65
|
+
// let popover = this.popoverCtrl.create(PopoverPage, { typePopup: TYPE_POPUP_DETAIL_MESSAGE, message: msg });
|
|
66
|
+
// popover.present({
|
|
67
|
+
// ev: event
|
|
68
|
+
// });
|
|
69
|
+
// /**
|
|
70
|
+
// *
|
|
71
|
+
// */
|
|
72
|
+
// popover.onDidDismiss((data: string) => {
|
|
73
|
+
// console.log(" ********* data::: ", data);
|
|
74
|
+
// if (data == 'logOut') {
|
|
75
|
+
// //this.logOut();
|
|
76
|
+
// }
|
|
77
|
+
// else if (data == 'ProfilePage') {
|
|
78
|
+
// if (this.chatManager.getLoggedUser()) {
|
|
79
|
+
// this.navCtrl.push(ProfilePage);
|
|
80
|
+
// }
|
|
81
|
+
// }
|
|
82
|
+
// });
|
|
83
|
+
}
|
|
84
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<div class="message message-other" [class.first-message]="isFirstMessage">
|
|
2
|
+
|
|
3
|
+
<span class="button-info" [ngClass]="message.uid" (click)="presentPopover($event, message)"></span>
|
|
4
|
+
|
|
5
|
+
<div class="bubble-message"
|
|
6
|
+
[class.image]="message.type == 'image'"
|
|
7
|
+
[class.no-text]="!message.text"
|
|
8
|
+
(mouseover)="showButtonInfo()">
|
|
9
|
+
|
|
10
|
+
<div *ngIf="isChannelTypeGroup(channelType)" class="message-sender-fullname" [style.color]="getColorBck(message.sender_fullname)">{{message.sender_fullname}}</div>
|
|
11
|
+
|
|
12
|
+
<div *ngIf="isImage(message);" (click)="popupUrl(message.metadata.src,'windowName')">
|
|
13
|
+
<img class="message-content message-content-image" [src]="message.metadata.src" [width]="getSizeImg(message).width" [height]="getSizeImg(message).height" />
|
|
14
|
+
</div>
|
|
15
|
+
|
|
16
|
+
<div *ngIf="isFile(message);" class="message-content message-content-text" [innerHTML]="urlify(message.metadata.src, message.metadata.name)"></div>
|
|
17
|
+
|
|
18
|
+
<!-- <div *ngIf="message.type == 'text'"> -->
|
|
19
|
+
<div *ngIf="isPopupUrl(message.text); then contentPopup else contentNewTab">here is ignored</div>
|
|
20
|
+
<ng-template #contentPopup>
|
|
21
|
+
<div style="text-decoration: underline; padding:8px; cursor: pointer;" (click)="popupUrl(message.text,'windowName')">{{stripTags(message.text)}}contentOther</div>
|
|
22
|
+
</ng-template>
|
|
23
|
+
<ng-template #contentNewTab>
|
|
24
|
+
<div class="message-content message-content-text" [innerHTML]="message.text"></div>
|
|
25
|
+
</ng-template>
|
|
26
|
+
<!-- </div> -->
|
|
27
|
+
<div class="timestamp-message right">{{message.timestamp | date: 'H:mm'}}</div>
|
|
28
|
+
</div>
|
|
29
|
+
|
|
30
|
+
</div>
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
.message {
|
|
2
|
+
.bubble-message {
|
|
3
|
+
position: relative;
|
|
4
|
+
border-radius: 15px;
|
|
5
|
+
font-size: 15px;
|
|
6
|
+
//padding: 5px 10px 10px 10px;
|
|
7
|
+
display: block;
|
|
8
|
+
width: auto;
|
|
9
|
+
max-width: 80%;
|
|
10
|
+
line-height: 1.34;
|
|
11
|
+
direction: ltr;
|
|
12
|
+
padding: 0px;
|
|
13
|
+
.message-content-image {
|
|
14
|
+
border-radius: 15px 6px 0px 0px;
|
|
15
|
+
}
|
|
16
|
+
.message-content.message-content-text{
|
|
17
|
+
padding: 5px 20px 5px 10px;
|
|
18
|
+
}
|
|
19
|
+
&.no-text {
|
|
20
|
+
line-height: 0;
|
|
21
|
+
.message-content-image {
|
|
22
|
+
border-radius: 15px 6px 6px 0px;
|
|
23
|
+
}
|
|
24
|
+
.message-content.message-content-text{
|
|
25
|
+
padding: 0px;
|
|
26
|
+
height: 0px;
|
|
27
|
+
}
|
|
28
|
+
.timestamp-message {
|
|
29
|
+
background-color: #00000045;
|
|
30
|
+
padding: 4px;
|
|
31
|
+
color: white;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
&.image{
|
|
35
|
+
max-width: 300px;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
.message-content:after {
|
|
39
|
+
content: "\00a0\00a0\00a0\00a0\00a0\00a0";
|
|
40
|
+
}
|
|
41
|
+
.timestamp-message {
|
|
42
|
+
font-size: 10px;
|
|
43
|
+
padding: 0px;
|
|
44
|
+
position: absolute;
|
|
45
|
+
bottom: 0px;
|
|
46
|
+
right: 6px;
|
|
47
|
+
line-height: 15px;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
.message-other {
|
|
51
|
+
width: 100%;
|
|
52
|
+
margin-top: 4px;
|
|
53
|
+
.bubble-message {
|
|
54
|
+
background-color: var(--light-gray);
|
|
55
|
+
color: var(--black);
|
|
56
|
+
margin-left: 24px;
|
|
57
|
+
float: left;
|
|
58
|
+
border-top-left-radius: 6px;
|
|
59
|
+
border-bottom-left-radius: 6px;
|
|
60
|
+
}
|
|
61
|
+
.message-sender-fullname {
|
|
62
|
+
margin: 0;
|
|
63
|
+
font-size: 15px;
|
|
64
|
+
color: var(--basic-gray);
|
|
65
|
+
font-weight: bold;
|
|
66
|
+
display: none;
|
|
67
|
+
}
|
|
68
|
+
.timestamp-message {
|
|
69
|
+
color: var(--basic-gray);
|
|
70
|
+
bottom: 2px;
|
|
71
|
+
right: 10px;
|
|
72
|
+
}
|
|
73
|
+
&.first-message {
|
|
74
|
+
margin-top: 10px;
|
|
75
|
+
.bubble-message {
|
|
76
|
+
border-top-left-radius: 12px;
|
|
77
|
+
border-bottom-left-radius: 0px;
|
|
78
|
+
}
|
|
79
|
+
.message-sender-fullname {
|
|
80
|
+
display: block;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
import { IonicModule } from '@ionic/angular';
|
|
3
|
+
|
|
4
|
+
import { BubbleOthersMessageComponent } from './bubble-others-message.component';
|
|
5
|
+
|
|
6
|
+
describe('BubbleOthersMessageComponent', () => {
|
|
7
|
+
let component: BubbleOthersMessageComponent;
|
|
8
|
+
let fixture: ComponentFixture<BubbleOthersMessageComponent>;
|
|
9
|
+
|
|
10
|
+
beforeEach(async(() => {
|
|
11
|
+
TestBed.configureTestingModule({
|
|
12
|
+
declarations: [ BubbleOthersMessageComponent ],
|
|
13
|
+
imports: [IonicModule.forRoot()]
|
|
14
|
+
}).compileComponents();
|
|
15
|
+
|
|
16
|
+
fixture = TestBed.createComponent(BubbleOthersMessageComponent);
|
|
17
|
+
component = fixture.componentInstance;
|
|
18
|
+
fixture.detectChanges();
|
|
19
|
+
}));
|
|
20
|
+
|
|
21
|
+
it('should create', () => {
|
|
22
|
+
expect(component).toBeTruthy();
|
|
23
|
+
});
|
|
24
|
+
});
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { Component, OnInit, Input } from '@angular/core';
|
|
2
|
+
import { MessageModel } from 'src/chat21-core/models/message';
|
|
3
|
+
// utils
|
|
4
|
+
import {
|
|
5
|
+
popupUrl,
|
|
6
|
+
urlify,
|
|
7
|
+
isPopupUrl,
|
|
8
|
+
stripTags
|
|
9
|
+
} from 'src/chat21-core/utils/utils';
|
|
10
|
+
|
|
11
|
+
import {
|
|
12
|
+
getColorBck
|
|
13
|
+
} from 'src/chat21-core/utils/utils-user';
|
|
14
|
+
|
|
15
|
+
import {
|
|
16
|
+
isImage,
|
|
17
|
+
isFile,
|
|
18
|
+
isInfo,
|
|
19
|
+
getSizeImg,
|
|
20
|
+
isChannelTypeGroup
|
|
21
|
+
} from 'src/chat21-core/utils/utils-message';
|
|
22
|
+
|
|
23
|
+
import {
|
|
24
|
+
MSG_STATUS_SENT,
|
|
25
|
+
MSG_STATUS_RETURN_RECEIPT
|
|
26
|
+
} from 'src/chat21-core/utils/constants';
|
|
27
|
+
|
|
28
|
+
@Component({
|
|
29
|
+
selector: 'app-bubble-others-message',
|
|
30
|
+
templateUrl: './bubble-others-message.component.html',
|
|
31
|
+
styleUrls: ['./bubble-others-message.component.scss'],
|
|
32
|
+
})
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
export class BubbleOthersMessageComponent implements OnInit {
|
|
36
|
+
@Input() message: MessageModel;
|
|
37
|
+
@Input() isFirstMessage = true;
|
|
38
|
+
@Input() channelType: string;
|
|
39
|
+
|
|
40
|
+
// utils functions
|
|
41
|
+
popupUrl = popupUrl;
|
|
42
|
+
urlify = urlify;
|
|
43
|
+
isPopupUrl = isPopupUrl;
|
|
44
|
+
getColorBck = getColorBck;
|
|
45
|
+
stripTags = stripTags;
|
|
46
|
+
|
|
47
|
+
// utils-message functions
|
|
48
|
+
isImage = isImage;
|
|
49
|
+
isFile = isFile;
|
|
50
|
+
isInfo = isInfo;
|
|
51
|
+
getSizeImg = getSizeImg;
|
|
52
|
+
isChannelTypeGroup = isChannelTypeGroup;
|
|
53
|
+
|
|
54
|
+
MSG_STATUS_SENT = MSG_STATUS_SENT;
|
|
55
|
+
MSG_STATUS_RETURN_RECEIPT = MSG_STATUS_RETURN_RECEIPT;
|
|
56
|
+
|
|
57
|
+
constructor() { }
|
|
58
|
+
|
|
59
|
+
ngOnInit() {}
|
|
60
|
+
|
|
61
|
+
showButtonInfo() {
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
presentPopover(event, msg) {
|
|
65
|
+
// console.log('presentPopover');
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
import { IonicModule } from '@ionic/angular';
|
|
3
|
+
|
|
4
|
+
import { BubbleSystemMessageComponent } from './bubble-system-message.component';
|
|
5
|
+
|
|
6
|
+
describe('BubbleSystemMessageComponent', () => {
|
|
7
|
+
let component: BubbleSystemMessageComponent;
|
|
8
|
+
let fixture: ComponentFixture<BubbleSystemMessageComponent>;
|
|
9
|
+
|
|
10
|
+
beforeEach(async(() => {
|
|
11
|
+
TestBed.configureTestingModule({
|
|
12
|
+
declarations: [ BubbleSystemMessageComponent ],
|
|
13
|
+
imports: [IonicModule.forRoot()]
|
|
14
|
+
}).compileComponents();
|
|
15
|
+
|
|
16
|
+
fixture = TestBed.createComponent(BubbleSystemMessageComponent);
|
|
17
|
+
component = fixture.componentInstance;
|
|
18
|
+
fixture.detectChanges();
|
|
19
|
+
}));
|
|
20
|
+
|
|
21
|
+
it('should create', () => {
|
|
22
|
+
expect(component).toBeTruthy();
|
|
23
|
+
});
|
|
24
|
+
});
|