@chat21/chat21-ionic 3.0.70 → 3.0.72-rc.1
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 +11 -0
- package/package.json +1 -1
- package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.html +1 -1
- package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.scss +5 -0
- package/src/app/chatlib/conversation-detail/message/info-message/info-message.component.html +20 -5
- package/src/app/chatlib/conversation-detail/message/info-message/info-message.component.scss +39 -2
- package/src/app/chatlib/conversation-detail/message/info-message/info-message.component.ts +11 -0
- package/src/app/components/contacts-directory/contacts-directory.component.html +6 -0
- package/src/app/components/contacts-directory/contacts-directory.component.scss +9 -0
- package/src/app/components/contacts-directory/contacts-directory.component.ts +6 -1
- package/src/app/components/conversation-detail/message-text-area/message-text-area.component.ts +5 -5
- package/src/app/components/conversation-detail/option-header/option-header.component.ts +1 -0
- package/src/app/components/conversation-info/info-group/info-group.component.ts +1 -4
- package/src/app/components/presence/presence.component.html +2 -0
- package/src/app/components/presence/presence.component.scss +24 -0
- package/src/app/components/presence/presence.component.spec.ts +24 -0
- package/src/app/components/presence/presence.component.ts +22 -0
- package/src/app/components/sidebar-user-details/sidebar-user-details.component.ts +1 -2
- package/src/app/pages/contacts-directory/contacts-directory.module.ts +4 -3
- package/src/app/pages/conversation-detail/conversation-detail.page.ts +33 -0
- package/src/app/pages/loader-preview/loader-preview.page.html +7 -2
- package/src/app/pages/loader-preview/loader-preview.page.ts +3 -2
- package/src/app/shared/shared.module.ts +2 -1
- package/src/chat-config-mqtt.json +1 -1
- package/src/chat21-core/providers/abstract/conversation-handler.service.ts +3 -1
- package/src/chat21-core/providers/firebase/firebase-conversation-handler.ts +4 -0
- package/src/chat21-core/providers/mqtt/mqtt-conversation-handler.ts +6 -2
- package/src/chat21-core/providers/native/native-upload-service.ts +4 -2
- package/src/chat21-core/utils/utils-message.ts +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# chat21-ionic ver 3.0
|
|
2
2
|
|
|
3
|
+
### 3.0.72-rc.1
|
|
4
|
+
- added: user presence on contact-directory component
|
|
5
|
+
|
|
6
|
+
### 3.0.71 in PROD
|
|
7
|
+
|
|
8
|
+
### 3.0.71-rc.1
|
|
9
|
+
- changed: native downloadURL on new file uploaded
|
|
10
|
+
- added: update lead info in conversation-detail and conversation-header when agent updates
|
|
11
|
+
- added: private message UI when agent receive a private message from other agents
|
|
12
|
+
- removed: scroll-bar from conversation-list page
|
|
13
|
+
|
|
3
14
|
### 3.0.70 in PROD
|
|
4
15
|
|
|
5
16
|
### 3.0.70-rc.2
|
package/package.json
CHANGED
|
@@ -119,7 +119,7 @@
|
|
|
119
119
|
<!--backgroundColor non viene ancora usato -->
|
|
120
120
|
|
|
121
121
|
<chat-bubble-message class="messages msg_receive" id="message_msg_receive" style="position: relative;"
|
|
122
|
-
[ngClass]="{'has-metadata': (isImage(message) || isFrame(message))}"
|
|
122
|
+
[ngClass]="{'has-metadata': (isImage(message) || isFrame(message)), 'privateMsg': (message?.attributes && message?.attributes?.subtype === 'private')}"
|
|
123
123
|
[class.emoticon]="isEmojii(message?.text)"
|
|
124
124
|
[message]="message"
|
|
125
125
|
[textColor]="'black'"
|
package/src/app/chatlib/conversation-detail/message/info-message/info-message.component.html
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
|
-
<
|
|
2
|
-
<!-- <
|
|
3
|
-
<
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
<div class="info-container">
|
|
2
|
+
<!-- <div class="spinner">
|
|
3
|
+
<div class="bounce3"></div>
|
|
4
|
+
<div class="bounce2"></div>
|
|
5
|
+
<div class="bounce1"></div>
|
|
6
|
+
</div> -->
|
|
7
|
+
|
|
8
|
+
<div>
|
|
9
|
+
<span class="base_info" [innerHTML]="message?.text | marked" [options]="tooltipOptions" [tooltip]="timeTooltipLeft" placement="left" content-type="template"></span>
|
|
10
|
+
<ng-template #timeTooltipLeft>
|
|
11
|
+
<span>{{message.timestamp | amTimeAgo}} ({{message.timestamp | amLocal | amDateFormat: 'L HH:mm:ss'}})</span>
|
|
12
|
+
</ng-template>
|
|
13
|
+
</div>
|
|
14
|
+
|
|
15
|
+
<!-- <div class="spinner">
|
|
16
|
+
<div class="bounce1"></div>
|
|
17
|
+
<div class="bounce2"></div>
|
|
18
|
+
<div class="bounce3"></div>
|
|
19
|
+
</div> -->
|
|
20
|
+
</div>
|
package/src/app/chatlib/conversation-detail/message/info-message/info-message.component.scss
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
.info-container{
|
|
2
|
+
display: flex;
|
|
3
|
+
align-content: center;
|
|
4
|
+
justify-content: center;
|
|
5
|
+
}
|
|
6
|
+
|
|
1
7
|
.base_info {
|
|
2
8
|
border-radius: 14px;
|
|
3
9
|
border: 1px solid #C9E4F6;
|
|
@@ -8,8 +14,39 @@
|
|
|
8
14
|
background: #C9E4F6;
|
|
9
15
|
font-size: 0.70em;
|
|
10
16
|
color: var(--basic-gray);
|
|
11
|
-
margin-left: 32px;
|
|
12
|
-
margin-right: 32px;
|
|
17
|
+
margin-left: 5px; //32px;
|
|
18
|
+
margin-right: 5px; //32px;
|
|
13
19
|
|
|
14
20
|
}
|
|
15
21
|
|
|
22
|
+
.spinner {
|
|
23
|
+
// margin: 15px 10px; //remove it if activate avatar image
|
|
24
|
+
width: 45px;
|
|
25
|
+
// text-align: center;
|
|
26
|
+
min-height: 100%;
|
|
27
|
+
margin: auto 0px;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.spinner > div {
|
|
31
|
+
width: 10px;
|
|
32
|
+
height: 10px;
|
|
33
|
+
background-color: #333;
|
|
34
|
+
|
|
35
|
+
border-radius: 100%;
|
|
36
|
+
display: inline-block;
|
|
37
|
+
margin: 0px 2px;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.spinner .bounce1 {
|
|
41
|
+
background-color: #C9E4F6;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.spinner .bounce2 {
|
|
45
|
+
background-color: #C9E4F6;
|
|
46
|
+
opacity: 0.6
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.spinner .bounce3 {
|
|
50
|
+
background-color: #C9E4F6;
|
|
51
|
+
opacity: 0.4
|
|
52
|
+
}
|
|
@@ -16,6 +16,17 @@ export class InfoMessageComponent implements OnInit, OnChanges {
|
|
|
16
16
|
|
|
17
17
|
public message_text: string
|
|
18
18
|
private logger: LoggerService = LoggerInstance.getInstance()
|
|
19
|
+
|
|
20
|
+
tooltipOptions = {
|
|
21
|
+
'show-delay': 500,
|
|
22
|
+
'tooltip-class': 'chat-tooltip',
|
|
23
|
+
'theme': 'light',
|
|
24
|
+
'shadow': false,
|
|
25
|
+
'hide-delay-mobile': 0,
|
|
26
|
+
'hideDelayAfterClick': 3000,
|
|
27
|
+
'hide-delay': 200
|
|
28
|
+
};
|
|
29
|
+
|
|
19
30
|
constructor() { }
|
|
20
31
|
|
|
21
32
|
ngOnInit() {
|
|
@@ -10,7 +10,13 @@
|
|
|
10
10
|
<div #avatarPlaceholder class="avatar-placeholder" [ngStyle]="{'background': 'linear-gradient(rgb(255,255,255) -125%,' + user.color + ')'}" [innerHTML]="user.avatar"></div>
|
|
11
11
|
<div *ngIf="user.imageurl" #avatarImage class="avatar-profile" [style.background-image]="'url(' + user.imageurl + ')'"></div>
|
|
12
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>
|
|
13
18
|
</ion-avatar>
|
|
19
|
+
|
|
14
20
|
<ion-label>
|
|
15
21
|
<h2>{{ user.fullname }}</h2>
|
|
16
22
|
<p>{{ user.uid }}</p>
|
|
@@ -52,6 +52,13 @@ ion-item {
|
|
|
52
52
|
border-style: solid;
|
|
53
53
|
border-width: 0px;
|
|
54
54
|
}
|
|
55
|
+
.user-presence{
|
|
56
|
+
position: absolute;
|
|
57
|
+
width: 100%;
|
|
58
|
+
height: 40px;
|
|
59
|
+
top: 30px;
|
|
60
|
+
left: calc(50% + 15px);
|
|
61
|
+
}
|
|
55
62
|
}
|
|
56
63
|
ion-label {
|
|
57
64
|
flex: 1 1 0px;
|
|
@@ -81,6 +88,8 @@ ion-item {
|
|
|
81
88
|
}
|
|
82
89
|
|
|
83
90
|
}
|
|
91
|
+
|
|
92
|
+
|
|
84
93
|
ion-note {
|
|
85
94
|
position: absolute;
|
|
86
95
|
right: 8px;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { PresenceService } from 'src/chat21-core/providers/abstract/presence.service';
|
|
1
2
|
import { Component, OnInit, Input, Output, EventEmitter, OnChanges } from '@angular/core';
|
|
2
3
|
import { UserModel } from 'src/chat21-core/models/user';
|
|
3
4
|
import { ImageRepoService } from 'src/chat21-core/providers/abstract/image-repo.service';
|
|
@@ -5,6 +6,7 @@ import { ImageRepoService } from 'src/chat21-core/providers/abstract/image-repo.
|
|
|
5
6
|
// Logger
|
|
6
7
|
import { LoggerService } from 'src/chat21-core/providers/abstract/logger.service';
|
|
7
8
|
import { LoggerInstance } from 'src/chat21-core/providers/logger/loggerInstance';
|
|
9
|
+
import { filter } from 'rxjs/operators';
|
|
8
10
|
|
|
9
11
|
@Component({
|
|
10
12
|
selector: 'component-contacts-directory',
|
|
@@ -12,6 +14,7 @@ import { LoggerInstance } from 'src/chat21-core/providers/logger/loggerInstance'
|
|
|
12
14
|
styleUrls: ['./contacts-directory.component.scss'],
|
|
13
15
|
})
|
|
14
16
|
export class ContactsDirectoryComponent implements OnInit, OnChanges {
|
|
17
|
+
|
|
15
18
|
@Input() contacts: Array<UserModel>;
|
|
16
19
|
@Output() onOpenNewChat = new EventEmitter<UserModel>();
|
|
17
20
|
|
|
@@ -20,7 +23,8 @@ export class ContactsDirectoryComponent implements OnInit, OnChanges {
|
|
|
20
23
|
private logger: LoggerService = LoggerInstance.getInstance();
|
|
21
24
|
|
|
22
25
|
constructor(
|
|
23
|
-
public imageRepoService: ImageRepoService
|
|
26
|
+
public imageRepoService: ImageRepoService,
|
|
27
|
+
public presenceService: PresenceService
|
|
24
28
|
) { }
|
|
25
29
|
|
|
26
30
|
/**
|
|
@@ -35,6 +39,7 @@ export class ContactsDirectoryComponent implements OnInit, OnChanges {
|
|
|
35
39
|
if(this.contacts){
|
|
36
40
|
this.contacts.forEach(contact => {
|
|
37
41
|
contact.imageurl = this.imageRepoService.getImagePhotoUrl(contact.uid)
|
|
42
|
+
this.presenceService.userIsOnline(contact.uid).pipe(filter((isOnline) => isOnline !== null)).subscribe((status)=> {contact.online = status.isOnline })
|
|
38
43
|
});
|
|
39
44
|
}
|
|
40
45
|
}
|
package/src/app/components/conversation-detail/message-text-area/message-text-area.component.ts
CHANGED
|
@@ -157,11 +157,11 @@ export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChange
|
|
|
157
157
|
} else {
|
|
158
158
|
this.IS_SUPPORT_GROUP_CONVERSATION = false
|
|
159
159
|
}
|
|
160
|
-
this.logger.log('[CONVS-DETAIL][MSG-TEXT-AREA] ngOnChanges supportMode ', this.supportMode)
|
|
161
|
-
this.logger.log('[CONVS-DETAIL][MSG-TEXT-AREA] ngOnChanges disableTextarea ', this.disableTextarea)
|
|
162
|
-
this.logger.log("[CONVS-DETAIL][MSG-TEXT-AREA] ngOnChanges DROP EVENT ", this.dropEvent);
|
|
163
|
-
this.logger.log("[CONVS-DETAIL][MSG-TEXT-AREA] ngOnChanges tagsCannedFilter ", this.tagsCannedFilter);
|
|
164
|
-
this.logger.log("[CONVS-DETAIL][MSG-TEXT-AREA] ngOnChanges areVisibleCAR; ", this.areVisibleCAR);
|
|
160
|
+
// this.logger.log('[CONVS-DETAIL][MSG-TEXT-AREA] ngOnChanges supportMode ', this.supportMode)
|
|
161
|
+
// this.logger.log('[CONVS-DETAIL][MSG-TEXT-AREA] ngOnChanges disableTextarea ', this.disableTextarea)
|
|
162
|
+
// this.logger.log("[CONVS-DETAIL][MSG-TEXT-AREA] ngOnChanges DROP EVENT ", this.dropEvent);
|
|
163
|
+
// this.logger.log("[CONVS-DETAIL][MSG-TEXT-AREA] ngOnChanges tagsCannedFilter ", this.tagsCannedFilter);
|
|
164
|
+
// this.logger.log("[CONVS-DETAIL][MSG-TEXT-AREA] ngOnChanges areVisibleCAR; ", this.areVisibleCAR);
|
|
165
165
|
|
|
166
166
|
|
|
167
167
|
this.logger.log('[CONVS-DETAIL] - returnChangeTextArea ngOnChanges in [MSG-TEXT-AREA] this.tagsCannedFilter.length ', this.tagsCannedFilter.length)
|
|
@@ -148,10 +148,7 @@ export class InfoGroupComponent implements OnInit, AfterViewInit, OnChanges {
|
|
|
148
148
|
for (const [key, value] of Object.entries(this.groupDetail.members)) {
|
|
149
149
|
this.logger.log('CONVERSATION-DETAIL group detail Key:', key, ' -Value: ', value);
|
|
150
150
|
|
|
151
|
-
this.presenceService.userIsOnline(key)
|
|
152
|
-
.pipe(takeUntil(this.unsubscribe$))
|
|
153
|
-
.pipe(filter((isOnline) => isOnline !== null))
|
|
154
|
-
.subscribe((isOnline: any) => {
|
|
151
|
+
this.presenceService.userIsOnline(key).pipe(takeUntil(this.unsubscribe$)).pipe(filter((isOnline) => isOnline !== null)).subscribe((isOnline: any) => {
|
|
155
152
|
this.logger.log('InfoGroupComponent group detail BSIsOnline isOnline', isOnline)
|
|
156
153
|
members_isonline_array[key]['isSignin'] = isOnline.isOnline
|
|
157
154
|
if (this.member_array.length > 0) {
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
.status-icon {
|
|
2
|
+
position: absolute;
|
|
3
|
+
width: 14px;
|
|
4
|
+
height: 14px;
|
|
5
|
+
top: 0px;
|
|
6
|
+
left: 0;
|
|
7
|
+
border: 2px solid #ffffff;
|
|
8
|
+
border-radius: 50%;
|
|
9
|
+
background-color: #f44336;
|
|
10
|
+
&.online {
|
|
11
|
+
background-color: #4caf50;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
}
|
|
15
|
+
.online-point {
|
|
16
|
+
position: absolute;
|
|
17
|
+
display: inline-block;
|
|
18
|
+
top: 0;
|
|
19
|
+
left: 20px;
|
|
20
|
+
color: rgba(255, 255, 255, 0.5);
|
|
21
|
+
font-size: 12px;
|
|
22
|
+
line-height: 14px;
|
|
23
|
+
text-align: left;
|
|
24
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
import { IonicModule } from '@ionic/angular';
|
|
3
|
+
|
|
4
|
+
import { PresenceComponent } from './presence.component';
|
|
5
|
+
|
|
6
|
+
describe('PresenceComponent', () => {
|
|
7
|
+
let component: PresenceComponent;
|
|
8
|
+
let fixture: ComponentFixture<PresenceComponent>;
|
|
9
|
+
|
|
10
|
+
beforeEach(async(() => {
|
|
11
|
+
TestBed.configureTestingModule({
|
|
12
|
+
declarations: [ PresenceComponent ],
|
|
13
|
+
imports: [IonicModule.forRoot()]
|
|
14
|
+
}).compileComponents();
|
|
15
|
+
|
|
16
|
+
fixture = TestBed.createComponent(PresenceComponent);
|
|
17
|
+
component = fixture.componentInstance;
|
|
18
|
+
fixture.detectChanges();
|
|
19
|
+
}));
|
|
20
|
+
|
|
21
|
+
it('should create', () => {
|
|
22
|
+
expect(component).toBeTruthy();
|
|
23
|
+
});
|
|
24
|
+
});
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Component, Input, OnInit } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
@Component({
|
|
4
|
+
selector: 'app-presence',
|
|
5
|
+
templateUrl: './presence.component.html',
|
|
6
|
+
styleUrls: ['./presence.component.scss'],
|
|
7
|
+
})
|
|
8
|
+
export class PresenceComponent implements OnInit {
|
|
9
|
+
|
|
10
|
+
@Input() isOnline: boolean = false;
|
|
11
|
+
@Input() translationMap: Map<string, string>;
|
|
12
|
+
// @Input() fontColor: string;
|
|
13
|
+
// @Input() borderColor: string;
|
|
14
|
+
|
|
15
|
+
borderColor = '#ffffff';
|
|
16
|
+
fontColor = '#949494';
|
|
17
|
+
|
|
18
|
+
constructor() { }
|
|
19
|
+
|
|
20
|
+
ngOnInit() {}
|
|
21
|
+
|
|
22
|
+
}
|
|
@@ -137,8 +137,7 @@ export class SidebarUserDetailsComponent implements OnInit, OnChanges {
|
|
|
137
137
|
|
|
138
138
|
@HostListener('document:click', ['$event'])
|
|
139
139
|
clickout(event) {
|
|
140
|
-
this.logger.log('[SIDEBAR-USER-DETAILSS-CHAT] clickout event.target)', event.target)
|
|
141
|
-
this.logger.log('[SIDEBAR-USER-DETAILSS-CHAT] clickout event.target)', event.target.id)
|
|
140
|
+
// this.logger.log('[SIDEBAR-USER-DETAILSS-CHAT] clickout event.target)', event.target)
|
|
142
141
|
const clicked_element_id = event.target.id
|
|
143
142
|
if (this.eRef.nativeElement.contains(event.target)) {
|
|
144
143
|
// this.logger.log('[SIDEBAR-USER-DETAILS] clicked inside')
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { PresenceComponent } from '../../components/presence/presence.component';
|
|
1
2
|
import { NgModule } from '@angular/core';
|
|
2
3
|
import { CommonModule } from '@angular/common';
|
|
3
4
|
import { FormsModule } from '@angular/forms';
|
|
4
5
|
import { IonicModule } from '@ionic/angular';
|
|
5
|
-
import {
|
|
6
|
+
import {TranslateModule} from '@ngx-translate/core';
|
|
6
7
|
|
|
7
8
|
import { ContactsDirectoryPageRoutingModule } from './contacts-directory-routing.module';
|
|
8
9
|
import { ContactsDirectoryComponent } from '../../components/contacts-directory/contacts-directory.component';
|
|
@@ -10,7 +11,6 @@ import { ContactsDirectoryComponent } from '../../components/contacts-directory/
|
|
|
10
11
|
import { ContactsDirectoryPage } from './contacts-directory.page';
|
|
11
12
|
// import { ContactsDirectoryService } from '../../services/contacts-directory.service';
|
|
12
13
|
// import { TiledeskContactsDirectoryService } from '../../services/tiledesk/tiledesk-contacts-directory.service';
|
|
13
|
-
import { HttpClient } from '@angular/common/http';
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
// export function contactsFactory(http: HttpClient) {
|
|
@@ -36,7 +36,8 @@ import { HttpClient } from '@angular/common/http';
|
|
|
36
36
|
],
|
|
37
37
|
declarations: [
|
|
38
38
|
ContactsDirectoryPage,
|
|
39
|
-
ContactsDirectoryComponent
|
|
39
|
+
ContactsDirectoryComponent,
|
|
40
|
+
PresenceComponent
|
|
40
41
|
]
|
|
41
42
|
})
|
|
42
43
|
export class ContactsDirectoryPageModule {}
|
|
@@ -971,6 +971,20 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
|
|
|
971
971
|
this.subscriptions.push(subscribe)
|
|
972
972
|
}
|
|
973
973
|
|
|
974
|
+
subscriptionKey = 'messageInfo'
|
|
975
|
+
subscription = this.subscriptions.find((item) => item.key === subscriptionKey)
|
|
976
|
+
if (!subscription) {
|
|
977
|
+
subscription = this.conversationHandlerService.messageInfo.pipe(takeUntil(this.unsubscribe$)).subscribe((msg: any) => {
|
|
978
|
+
this.logger.log('[CONVS-DETAIL] subscribe to messageInfo - messageId ', msg)
|
|
979
|
+
if (msg) {
|
|
980
|
+
that.updateLeadInfo(msg)
|
|
981
|
+
// this.setHeaderContent()
|
|
982
|
+
}
|
|
983
|
+
})
|
|
984
|
+
const subscribe = { key: subscriptionKey, value: subscription }
|
|
985
|
+
this.subscriptions.push(subscribe)
|
|
986
|
+
}
|
|
987
|
+
|
|
974
988
|
// subscriptionKey = 'onGroupChange';
|
|
975
989
|
// subscription = this.subscriptions.find(item => item.key === subscriptionKey);
|
|
976
990
|
// if (!subscription) {
|
|
@@ -1009,6 +1023,25 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
|
|
|
1009
1023
|
})
|
|
1010
1024
|
}
|
|
1011
1025
|
|
|
1026
|
+
updateLeadInfo(msg){
|
|
1027
|
+
if (msg.attributes && msg.attributes['updateUserFullname']) {
|
|
1028
|
+
const userFullname = msg.attributes['updateUserFullname'];
|
|
1029
|
+
this.logger.debug('[CONVS-DETAIL] newMessageAdded --> updateUserFullname', userFullname)
|
|
1030
|
+
this.conversationWithFullname = userFullname //update info for next sendMessage object
|
|
1031
|
+
//updates conversation header info
|
|
1032
|
+
this.conversationAvatar = setConversationAvatar(
|
|
1033
|
+
this.conversationWith,
|
|
1034
|
+
this.conversationWithFullname,
|
|
1035
|
+
this.conversationAvatar.channel_type
|
|
1036
|
+
)
|
|
1037
|
+
|
|
1038
|
+
}
|
|
1039
|
+
if (msg.attributes && msg.attributes['updateUserEmail']) {
|
|
1040
|
+
const userEmail = msg.attributes['updateUserEmail'];
|
|
1041
|
+
this.logger.debug('[CONVS-DETAIL] newMessageAdded --> userEmail', userEmail)
|
|
1042
|
+
}
|
|
1043
|
+
}
|
|
1044
|
+
|
|
1012
1045
|
// ----------------------------------------------------------------
|
|
1013
1046
|
// @ Unsubscribe all subscribed events (called in ionViewWillLeave)
|
|
1014
1047
|
// ----------------------------------------------------------------
|
|
@@ -27,8 +27,13 @@
|
|
|
27
27
|
<ion-item>
|
|
28
28
|
<ion-label color="primary" position="floating" floating> {{'AddACaption' | translate}}...</ion-label>
|
|
29
29
|
<!-- <ion-input clearInput></ion-input> -->
|
|
30
|
-
<ion-textarea #messageTextArea #imageCaptionTexarea
|
|
31
|
-
|
|
30
|
+
<ion-textarea #messageTextArea #imageCaptionTexarea
|
|
31
|
+
rows="1"
|
|
32
|
+
autosize="false"
|
|
33
|
+
auto-grow="true"
|
|
34
|
+
[(ngModel)]="messageString"
|
|
35
|
+
(ionInput)="onChangeTextArea($event);"
|
|
36
|
+
(keyup.enter)="onKeyUp($event, messageString);">
|
|
32
37
|
</ion-textarea>
|
|
33
38
|
</ion-item>
|
|
34
39
|
|
|
@@ -333,8 +333,9 @@ export class LoaderPreviewPage implements OnInit, AfterViewInit {
|
|
|
333
333
|
}
|
|
334
334
|
}
|
|
335
335
|
|
|
336
|
-
|
|
337
|
-
|
|
336
|
+
|
|
337
|
+
onKeyUp(event: any, text: string) {
|
|
338
|
+
this.logger.log('[LOADER-PREVIEW-PAGE] onKeyUp - event:: ', event)
|
|
338
339
|
// const message = e.target.textContent.trim();
|
|
339
340
|
// if (e.inputType === 'insertLineBreak' && message === '') {
|
|
340
341
|
// this.messageString = '';
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ContactsDirectoryComponent } from './../components/contacts-directory/contacts-directory.component';
|
|
1
2
|
import { HtmlComponent } from './../chatlib/conversation-detail/message/html/html.component';
|
|
2
3
|
import { BubbleOthersMessageComponent } from './../components/conversation-detail/bubble-others-message/bubble-others-message.component';
|
|
3
4
|
|
|
@@ -91,7 +92,7 @@ import { SafeHtmlPipe } from '../directives/safe-html.pipe';
|
|
|
91
92
|
AutofocusDirective,
|
|
92
93
|
HtmlEntitiesEncodePipe,
|
|
93
94
|
SafeHtmlPipe,
|
|
94
|
-
OptionHeaderComponent
|
|
95
|
+
OptionHeaderComponent,
|
|
95
96
|
],
|
|
96
97
|
exports: [
|
|
97
98
|
// MessageTextAreaComponent,
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"messagingSenderId": "269505353043",
|
|
12
12
|
"appId": "1:269505353043:web:b82af070572669e3707da6",
|
|
13
13
|
"chat21ApiUrl": "https://us-central1-chat21-pre-01.cloudfunctions.net",
|
|
14
|
-
"tenant":"tilechat"
|
|
14
|
+
"tenant": "tilechat"
|
|
15
15
|
},
|
|
16
16
|
"chat21Config": {
|
|
17
17
|
"appId": "tilechat",
|
|
@@ -15,7 +15,9 @@ export abstract class ConversationHandlerService {
|
|
|
15
15
|
abstract messageAdded: BehaviorSubject<MessageModel> = new BehaviorSubject<MessageModel>(null);
|
|
16
16
|
abstract messageChanged: BehaviorSubject<MessageModel> = new BehaviorSubject<MessageModel>(null);
|
|
17
17
|
abstract messageRemoved: BehaviorSubject<string> = new BehaviorSubject<string>(null);
|
|
18
|
-
|
|
18
|
+
abstract messageWait: BehaviorSubject<any> = new BehaviorSubject<any>(null);
|
|
19
|
+
abstract messageInfo: BehaviorSubject<MessageModel> = new BehaviorSubject<MessageModel>(null);
|
|
20
|
+
|
|
19
21
|
// params
|
|
20
22
|
abstract attributes: any;
|
|
21
23
|
abstract messages: Array<MessageModel> = [];
|
|
@@ -36,6 +36,7 @@ export class FirebaseConversationHandler extends ConversationHandlerService {
|
|
|
36
36
|
messageChanged: BehaviorSubject<MessageModel> = new BehaviorSubject<MessageModel>(null);;
|
|
37
37
|
messageRemoved: BehaviorSubject<string> = new BehaviorSubject<string>(null);
|
|
38
38
|
messageWait: BehaviorSubject<any> = new BehaviorSubject<string>(null);
|
|
39
|
+
messageInfo: BehaviorSubject<MessageModel> = new BehaviorSubject<MessageModel>(null);
|
|
39
40
|
|
|
40
41
|
// public variables
|
|
41
42
|
public attributes: any;
|
|
@@ -245,6 +246,9 @@ export class FirebaseConversationHandler extends ConversationHandlerService {
|
|
|
245
246
|
if (this.skipMessage && messageType(MESSAGE_TYPE_INFO, msg)) {
|
|
246
247
|
return;
|
|
247
248
|
}
|
|
249
|
+
if(!this.skipMessage && messageType(MESSAGE_TYPE_INFO, msg)) {
|
|
250
|
+
this.messageInfo.next(msg)
|
|
251
|
+
}
|
|
248
252
|
this.addRepalceMessageInArray(childSnapshot.key, msg);
|
|
249
253
|
this.messageAdded.next(msg);
|
|
250
254
|
}
|
|
@@ -34,7 +34,8 @@ export class MQTTConversationHandler extends ConversationHandlerService {
|
|
|
34
34
|
messageChanged: BehaviorSubject<MessageModel> = new BehaviorSubject<MessageModel>(null);;
|
|
35
35
|
messageRemoved: BehaviorSubject<string> = new BehaviorSubject<string>(null);
|
|
36
36
|
messageWait: BehaviorSubject<any> = new BehaviorSubject<string>(null);
|
|
37
|
-
|
|
37
|
+
messageInfo: BehaviorSubject<MessageModel> = new BehaviorSubject<MessageModel>(null);
|
|
38
|
+
|
|
38
39
|
// public variables
|
|
39
40
|
public attributes: any;
|
|
40
41
|
public messages: MessageModel[];
|
|
@@ -230,9 +231,12 @@ export class MQTTConversationHandler extends ConversationHandlerService {
|
|
|
230
231
|
private addedMessage(messageSnapshot: any) {
|
|
231
232
|
const msg = this.messageGenerate(messageSnapshot);
|
|
232
233
|
msg.uid = msg.message_id;
|
|
233
|
-
if(this.skipInfoMessage && messageType(MESSAGE_TYPE_INFO, msg)
|
|
234
|
+
if(this.skipInfoMessage && messageType(MESSAGE_TYPE_INFO, msg)){
|
|
234
235
|
return;
|
|
235
236
|
}
|
|
237
|
+
if(!this.skipInfoMessage && messageType(MESSAGE_TYPE_INFO, msg)){
|
|
238
|
+
this.messageInfo.next(msg)
|
|
239
|
+
}
|
|
236
240
|
// imposto il giorno del messaggio per visualizzare o nascondere l'header data
|
|
237
241
|
msg.headerDate = null;
|
|
238
242
|
const headerDate = setHeaderDate(this.translationMap, msg.timestamp);
|
|
@@ -63,8 +63,10 @@ export class NativeUploadService extends UploadService {
|
|
|
63
63
|
const url = this.URL_TILEDESK_FILE + '/users'
|
|
64
64
|
return new Promise((resolve, reject) => {
|
|
65
65
|
that.http.post(url, formData, requestOptions).subscribe(data => {
|
|
66
|
-
|
|
67
|
-
|
|
66
|
+
let downloadURL = this.URL_TILEDESK_FILE + '/download' + '?path=' + encodeURI(data['filename']);
|
|
67
|
+
if(upload.file.type.includes('pdf')){
|
|
68
|
+
downloadURL = this.URL_TILEDESK_FILE + '?path=' + encodeURI(data['filename']);
|
|
69
|
+
}
|
|
68
70
|
// that.BSStateUpload.next({upload: upload});
|
|
69
71
|
}, (error) => {
|
|
70
72
|
this.logger.error('[NATIVE UPLOAD] - ERROR upload new file ', error)
|
|
@@ -72,13 +72,13 @@ export function messageType(msgType: string, message: any) {
|
|
|
72
72
|
return false;
|
|
73
73
|
}
|
|
74
74
|
if (msgType === MESSAGE_TYPE_INFO) {
|
|
75
|
-
return
|
|
75
|
+
return isInfo(message);
|
|
76
76
|
}
|
|
77
77
|
if (msgType === MESSAGE_TYPE_MINE) {
|
|
78
|
-
return
|
|
78
|
+
return isMine(message);
|
|
79
79
|
}
|
|
80
80
|
if (msgType === MESSAGE_TYPE_OTHERS) {
|
|
81
|
-
if (
|
|
81
|
+
if (isInfo(message) === false && isMine(message) === false) {
|
|
82
82
|
return true;
|
|
83
83
|
}
|
|
84
84
|
return false;
|