@chat21/chat21-ionic 3.0.59-rc9 → 3.0.59
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 +53 -0
- package/README.md +5 -0
- package/config.xml +2 -2
- package/env.sample +1 -1
- package/package.json +1 -1
- package/resources/Android/splash/drawable-land-hdpi-screen.png +0 -0
- package/resources/Android/splash/drawable-land-ldpi-screen.png +0 -0
- package/resources/Android/splash/drawable-land-mdpi-screen.png +0 -0
- package/resources/Android/splash/drawable-land-xhdpi-screen.png +0 -0
- package/resources/Android/splash/drawable-land-xxhdpi-screen.png +0 -0
- package/resources/Android/splash/drawable-land-xxxhdpi-screen.png +0 -0
- package/resources/Android/splash/drawable-port-hdpi-screen.png +0 -0
- package/resources/Android/splash/drawable-port-ldpi-screen.png +0 -0
- package/resources/Android/splash/drawable-port-mdpi-screen.png +0 -0
- package/resources/Android/splash/drawable-port-xhdpi-screen.png +0 -0
- package/resources/Android/splash/drawable-port-xxhdpi-screen.png +0 -0
- package/resources/Android/splash/drawable-port-xxxhdpi-screen.png +0 -0
- package/resources/Android/splash.png +0 -0
- package/src/app/app.component.scss +10 -5
- package/src/app/app.component.ts +377 -228
- package/src/app/app.module.ts +12 -7
- package/src/app/chatlib/conversation-detail/conversation-content/conversation-content.component.html +1 -1
- package/src/app/chatlib/list-conversations-component/list-conversations/list-conversations.component.html +1 -1
- package/src/app/components/authentication/login/login.component.html +8 -8
- package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.html +2 -4
- package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.ts +7 -2
- package/src/app/components/project-item/project-item.component.html +2 -2
- package/src/app/components/project-item/project-item.component.scss +6 -6
- package/src/app/components/project-item/project-item.component.ts +46 -32
- package/src/app/pages/authentication/login/login.page.html +1 -2
- package/src/app/pages/conversation-detail/conversation-detail.page.ts +2 -0
- package/src/app/pages/conversations-list/conversations-list.page.html +12 -7
- package/src/app/pages/conversations-list/conversations-list.page.scss +279 -261
- package/src/app/pages/conversations-list/conversations-list.page.ts +138 -13
- package/src/app/pages/unassigned-conversations/unassigned-conversations.page.ts +10 -2
- package/src/app/services/app-config.ts +77 -5
- package/src/app/services/websocket/websocket-js.ts +12 -14
- package/src/app/services/websocket/websocket.service.ts +26 -8
- package/src/assets/js/chat21client.js +144 -82
- package/src/assets/logo.png +0 -0
- package/src/assets/transparent.png +0 -0
- package/src/chat-config-template.json +1 -0
- package/src/chat-config.json +1 -0
- package/src/chat21-core/providers/firebase/firebase-archivedconversations-handler.ts +1 -1
- package/src/chat21-core/providers/firebase/firebase-conversations-handler.ts +1 -1
- package/src/chat21-core/providers/firebase/firebase-notifications.ts +31 -23
- package/src/chat21-core/providers/mqtt/mqtt-conversation-handler.ts +3 -5
- package/src/chat21-core/providers/mqtt/mqtt-conversations-handler.ts +13 -5
- package/src/chat21-core/providers/mqtt/mqtt-notifications.ts +101 -11
- package/src/chat21-core/providers/tiledesk/tiledesk-auth.service.ts +12 -3
- package/src/chat21-core/utils/utils-message.ts +2 -2
- package/src/firebase-messaging-sw-template.js +1 -1
- package/src/assets/images/tiledesk_logo_50x50.png +0 -0
package/src/app/app.module.ts
CHANGED
|
@@ -103,7 +103,7 @@ export function createTranslateLoader(http: HttpClient) {
|
|
|
103
103
|
|
|
104
104
|
}
|
|
105
105
|
|
|
106
|
-
export function authenticationFactory(http: HttpClient, appConfig: AppConfigProvider, chat21Service: Chat21Service, appSorage: AppStorageService, network: Network, connectionService:ConnectionService) {
|
|
106
|
+
export function authenticationFactory(http: HttpClient, appConfig: AppConfigProvider, chat21Service: Chat21Service, appSorage: AppStorageService, network: Network, connectionService: ConnectionService) {
|
|
107
107
|
const config = appConfig.getConfig()
|
|
108
108
|
if (config.chatEngine === CHAT_ENGINE_MQTT) {
|
|
109
109
|
|
|
@@ -112,8 +112,13 @@ export function authenticationFactory(http: HttpClient, appConfig: AppConfigProv
|
|
|
112
112
|
|
|
113
113
|
const auth = new MQTTAuthService(http, chat21Service, appSorage);
|
|
114
114
|
|
|
115
|
-
auth.setBaseUrl(appConfig.getConfig().apiUrl)
|
|
116
|
-
|
|
115
|
+
auth.setBaseUrl(appConfig.getConfig().apiUrl);
|
|
116
|
+
|
|
117
|
+
if (config.pushEngine = PUSH_ENGINE_MQTT) {
|
|
118
|
+
// FOR PUSH NOTIFICATIONS INIT FIREBASE APP
|
|
119
|
+
FirebaseInitService.initFirebase(config.firebaseConfig);
|
|
120
|
+
}
|
|
121
|
+
|
|
117
122
|
return auth
|
|
118
123
|
} else {
|
|
119
124
|
|
|
@@ -121,7 +126,7 @@ export function authenticationFactory(http: HttpClient, appConfig: AppConfigProv
|
|
|
121
126
|
// console.log('[APP-MOD] FirebaseInitService config ', config)
|
|
122
127
|
const auth = new FirebaseAuthService(http, network, connectionService);
|
|
123
128
|
auth.setBaseUrl(config.apiUrl)
|
|
124
|
-
|
|
129
|
+
|
|
125
130
|
return auth
|
|
126
131
|
}
|
|
127
132
|
}
|
|
@@ -217,12 +222,12 @@ export function uploadFactory(http: HttpClient, appConfig: AppConfigProvider, ap
|
|
|
217
222
|
}
|
|
218
223
|
}
|
|
219
224
|
|
|
220
|
-
export function notificationsServiceFactory(appConfig: AppConfigProvider) {
|
|
225
|
+
export function notificationsServiceFactory(appConfig: AppConfigProvider, chat21Service: Chat21Service) {
|
|
221
226
|
const config = appConfig.getConfig()
|
|
222
227
|
if (config.pushEngine === PUSH_ENGINE_FIREBASE) {
|
|
223
228
|
return new FirebaseNotifications();
|
|
224
229
|
} else if (config.pushEngine === PUSH_ENGINE_MQTT) {
|
|
225
|
-
return new MQTTNotifications();
|
|
230
|
+
return new MQTTNotifications(chat21Service);
|
|
226
231
|
} else {
|
|
227
232
|
return;
|
|
228
233
|
}
|
|
@@ -340,7 +345,7 @@ const appInitializerFn = (appConfig: AppConfigProvider, logger: NGXLogger) => {
|
|
|
340
345
|
{
|
|
341
346
|
provide: NotificationsService,
|
|
342
347
|
useFactory: notificationsServiceFactory,
|
|
343
|
-
deps: [AppConfigProvider]
|
|
348
|
+
deps: [AppConfigProvider, Chat21Service]
|
|
344
349
|
},
|
|
345
350
|
{
|
|
346
351
|
provide: AppStorageService,
|
package/src/app/chatlib/conversation-detail/conversation-content/conversation-content.component.html
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
<div class="chat21-bounce1" [ngStyle]="{'background-color': stylesMap.get('themeColor')}"></div>
|
|
11
11
|
<div class="chat21-bounce2" [ngStyle]="{'background-color': stylesMap.get('themeColor')}"></div>
|
|
12
12
|
<div class="chat21-bounce3" [ngStyle]="{'background-color': stylesMap.get('themeColor')}"></div>
|
|
13
|
-
<span>{{translationMap
|
|
13
|
+
<span>{{translationMap?.get('LABEL_LOADING')}}</span>
|
|
14
14
|
</div>
|
|
15
15
|
</span>
|
|
16
16
|
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
width="24px" height="24px" viewBox="0 0 24 24">
|
|
35
35
|
<path fill="none" d="M0 0h24v24H0z"/>
|
|
36
36
|
<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"/>
|
|
37
|
-
<title id="altIconTitle">{{ translationMap
|
|
37
|
+
<title id="altIconTitle">{{ translationMap?.get('CLOSED') }}</title>
|
|
38
38
|
</svg>
|
|
39
39
|
</button>
|
|
40
40
|
</div>
|
|
@@ -8,25 +8,25 @@
|
|
|
8
8
|
|
|
9
9
|
<div class="signin-title" style="text-align:center">
|
|
10
10
|
<h2 style="font-family: 'Montserrat', sans-serif; font-weight: 400;">
|
|
11
|
-
{{ translationMap
|
|
11
|
+
{{ translationMap?.get('LABEL_SIGNIN_TO') }}
|
|
12
12
|
{{companyName}}
|
|
13
13
|
</h2>
|
|
14
14
|
</div>
|
|
15
15
|
<div class="login-container">
|
|
16
16
|
<form [formGroup]="userForm" (ngSubmit)="signInWithEmailAndPassword()" novalidate>
|
|
17
17
|
|
|
18
|
-
<ion-label stacked for="email">{{ translationMap
|
|
18
|
+
<ion-label stacked for="email">{{ translationMap?.get('LABEL_EMAIL') }}</ion-label>
|
|
19
19
|
<ion-input #email formControlName="email" type="email" id="email" required autocapitalize="off" spellcheck="false"
|
|
20
|
-
placeholder="{{ translationMap
|
|
20
|
+
placeholder="{{ translationMap?.get('LABEL_PLACEHOLDER_EMAIL') }}"
|
|
21
21
|
[class.invalid]="!userForm.controls.email.valid" ></ion-input>
|
|
22
22
|
<div *ngIf="formErrors.email" class="is-danger">
|
|
23
23
|
{{ formErrors.email }}
|
|
24
24
|
</div>
|
|
25
25
|
|
|
26
26
|
|
|
27
|
-
<ion-label stacked for="password">{{ translationMap
|
|
27
|
+
<ion-label stacked for="password">{{ translationMap?.get('LABEL_PASSWORD') }}</ion-label>
|
|
28
28
|
<ion-input #password formControlName="password" type="password" id="password" required
|
|
29
|
-
placeholder="{{ translationMap
|
|
29
|
+
placeholder="{{ translationMap?.get('LABEL_PLACEHOLDER_PASSWORD') }}"
|
|
30
30
|
[class.invalid]="!userForm.controls.password.valid"></ion-input>
|
|
31
31
|
|
|
32
32
|
<div *ngIf="formErrors.password" class="is-danger">
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
|
|
37
37
|
<button type="submit" class="btn signin-button ion-activatable ripple-parent" [ngClass]="{'signin-button-is-disabled': !userForm.valid}" [disabled]="!userForm.valid">
|
|
38
38
|
<span class="signin-button-label" *ngIf="showSpinnerInLoginBtn === false" >
|
|
39
|
-
{{ translationMap
|
|
39
|
+
{{ translationMap?.get('LABEL_SIGNIN') }}
|
|
40
40
|
</span>
|
|
41
41
|
<ion-ripple-effect type="unbounded"></ion-ripple-effect>
|
|
42
42
|
<ion-spinner *ngIf="showSpinnerInLoginBtn === true" name="bubbles" color="white" duration="2" ></ion-spinner>
|
|
@@ -50,9 +50,9 @@
|
|
|
50
50
|
</p> -->
|
|
51
51
|
|
|
52
52
|
<p style="color: #666666; font-size: 1.1em; text-align: center; margin-top: 16px;">
|
|
53
|
-
{{ translationMap
|
|
53
|
+
{{ translationMap?.get('LABEL_FORGOT_YOUR_PASSWORD') }}
|
|
54
54
|
<span style="color: #03a5e8; cursor:pointer" (click)="goToResetPsw()">
|
|
55
|
-
{{ translationMap
|
|
55
|
+
{{ translationMap?.get('LABEL_CLICK_HERE') }}
|
|
56
56
|
</span>
|
|
57
57
|
</p>
|
|
58
58
|
|
|
@@ -3,10 +3,8 @@
|
|
|
3
3
|
<ion-toolbar>
|
|
4
4
|
|
|
5
5
|
<ion-buttons slot="start">
|
|
6
|
-
<!-- (click)="pushPage('conversations-list')" -->
|
|
7
|
-
<ion-back-button text="" *ngIf="isMobile"
|
|
8
|
-
defaultHref="/conversations-list"
|
|
9
|
-
>
|
|
6
|
+
<!-- (click)="pushPage('conversations-list')" defaultHref="/conversations-list" -->
|
|
7
|
+
<ion-back-button style="display: block;" text="" *ngIf="isMobile" (click)="goBackToConversationList()">
|
|
10
8
|
</ion-back-button>
|
|
11
9
|
</ion-buttons>
|
|
12
10
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Component, OnInit, Input, Output, EventEmitter, OnChanges } from '@angular/core';
|
|
2
|
-
import { ActivatedRoute } from '@angular/router';
|
|
2
|
+
import { ActivatedRoute, Router } from '@angular/router';
|
|
3
3
|
import { ImageRepoService } from 'src/chat21-core/providers/abstract/image-repo.service';
|
|
4
4
|
|
|
5
5
|
// Logger
|
|
@@ -43,7 +43,8 @@ export class HeaderConversationDetailComponent implements OnInit, OnChanges {
|
|
|
43
43
|
constructor(
|
|
44
44
|
public imageRepoService: ImageRepoService,
|
|
45
45
|
private route: ActivatedRoute,
|
|
46
|
-
public platform: Platform
|
|
46
|
+
public platform: Platform,
|
|
47
|
+
private router: Router
|
|
47
48
|
) {
|
|
48
49
|
this.route.paramMap.subscribe(params => {
|
|
49
50
|
|
|
@@ -125,4 +126,8 @@ export class HeaderConversationDetailComponent implements OnInit, OnChanges {
|
|
|
125
126
|
/** */
|
|
126
127
|
pushPage(event) { }
|
|
127
128
|
|
|
129
|
+
goBackToConversationList() {
|
|
130
|
+
this.router.navigateByUrl('/conversations-list');
|
|
131
|
+
}
|
|
132
|
+
|
|
128
133
|
}
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
</div>
|
|
60
60
|
|
|
61
61
|
|
|
62
|
-
<div class="flex-child-right"
|
|
62
|
+
<div class="flex-child-right">
|
|
63
63
|
<div class="project-name-project-for-panel">
|
|
64
64
|
{{ project?.id_project?.name }}
|
|
65
65
|
</div>
|
|
@@ -130,7 +130,7 @@
|
|
|
130
130
|
</svg>
|
|
131
131
|
</div>
|
|
132
132
|
<span *ngIf="project?.ws_projct_user_isBusy === true" class="project-item--isBusy-busy-text text-pulse-animation">
|
|
133
|
-
{{translationMap
|
|
133
|
+
{{translationMap?.get('Busy')}}
|
|
134
134
|
</span>
|
|
135
135
|
</div>
|
|
136
136
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
padding-top: 0px;
|
|
5
5
|
margin-top: 0px !important;
|
|
6
6
|
padding-bottom: 0px !important;
|
|
7
|
-
background: #fff;
|
|
7
|
+
// background: #fff;
|
|
8
8
|
padding-left: 0px;
|
|
9
9
|
width: 100%;
|
|
10
10
|
// min-height: 70px;
|
|
@@ -12,12 +12,12 @@
|
|
|
12
12
|
min-height: 55px;
|
|
13
13
|
height: 55px;
|
|
14
14
|
position: relative;
|
|
15
|
-
top: -
|
|
15
|
+
top: -5px;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
.main-content-project-for-panel:hover {
|
|
19
|
-
|
|
20
|
-
}
|
|
18
|
+
// .main-content-project-for-panel:hover {
|
|
19
|
+
// background-color: rgb(244, 243, 244);
|
|
20
|
+
// }
|
|
21
21
|
.container-project-for-panel {
|
|
22
22
|
padding: 0px !important;
|
|
23
23
|
width: 296px;
|
|
@@ -298,7 +298,7 @@
|
|
|
298
298
|
|
|
299
299
|
.availabily-and-busy-wpr {
|
|
300
300
|
// margin-top: 6px;
|
|
301
|
-
margin-top:
|
|
301
|
+
margin-top: 7px;
|
|
302
302
|
margin-left: 11px;
|
|
303
303
|
}
|
|
304
304
|
|
|
@@ -8,6 +8,7 @@ import { LoggerInstance } from 'src/chat21-core/providers/logger/loggerInstance'
|
|
|
8
8
|
import { CustomTranslateService } from 'src/chat21-core/providers/custom-translate.service';
|
|
9
9
|
import { TiledeskAuthService } from 'src/chat21-core/providers/tiledesk/tiledesk-auth.service';
|
|
10
10
|
import { TiledeskService } from 'src/app/services/tiledesk/tiledesk.service';
|
|
11
|
+
import { WebSocketJs } from 'src/app/services/websocket/websocket-js';
|
|
11
12
|
|
|
12
13
|
@Component({
|
|
13
14
|
selector: 'app-project-item',
|
|
@@ -35,7 +36,8 @@ export class ProjectItemComponent implements OnInit {
|
|
|
35
36
|
public appStorageService: AppStorageService,
|
|
36
37
|
private translateService: CustomTranslateService,
|
|
37
38
|
public tiledeskAuthService: TiledeskAuthService,
|
|
38
|
-
public tiledeskService: TiledeskService
|
|
39
|
+
public tiledeskService: TiledeskService,
|
|
40
|
+
public webSocketJs: WebSocketJs,
|
|
39
41
|
) { }
|
|
40
42
|
|
|
41
43
|
ngOnInit() {
|
|
@@ -45,6 +47,7 @@ export class ProjectItemComponent implements OnInit {
|
|
|
45
47
|
this.translations();
|
|
46
48
|
this.listenToPostMsgs();
|
|
47
49
|
this.onInitWindowWidth();
|
|
50
|
+
|
|
48
51
|
}
|
|
49
52
|
|
|
50
53
|
listenToPostMsgs() {
|
|
@@ -52,9 +55,14 @@ export class ProjectItemComponent implements OnInit {
|
|
|
52
55
|
// console.log("[PROJECT-ITEM] post message event ", event);
|
|
53
56
|
|
|
54
57
|
if (event && event.data && event.data) {
|
|
55
|
-
// console.log("[
|
|
58
|
+
// console.log("[PROJECT-ITEM] message event data ", event.data);
|
|
56
59
|
if (event.data === 'hasChangedProject') {
|
|
60
|
+
this.unservedRequestCount = 0;
|
|
61
|
+
if (this.project) {
|
|
62
|
+
this.webSocketJs.unsubscribe('/' + this.project.id_project._id + '/requests');
|
|
63
|
+
}
|
|
57
64
|
this.getLastProjectStoredAndSubscToWSAvailabilityAndConversations();
|
|
65
|
+
|
|
58
66
|
}
|
|
59
67
|
}
|
|
60
68
|
})
|
|
@@ -72,26 +80,26 @@ export class ProjectItemComponent implements OnInit {
|
|
|
72
80
|
@HostListener('window:resize', ['$event'])
|
|
73
81
|
onResize(event: any) {
|
|
74
82
|
this.newInnerWidth = event.target.innerWidth;
|
|
75
|
-
this.logger.log('[
|
|
83
|
+
this.logger.log('[PROJECT-ITEM] - INNER WIDTH ', this.newInnerWidth)
|
|
76
84
|
|
|
77
|
-
if (this.newInnerWidth <= 150) {
|
|
78
|
-
|
|
79
|
-
} else {
|
|
80
|
-
|
|
81
|
-
}
|
|
85
|
+
// if (this.newInnerWidth <= 150) {
|
|
86
|
+
// this.window_width_is_60 = true;
|
|
87
|
+
// } else {
|
|
88
|
+
// this.window_width_is_60 = false;
|
|
89
|
+
// }
|
|
82
90
|
}
|
|
83
91
|
|
|
84
92
|
onInitWindowWidth(): any {
|
|
85
93
|
const actualWidth = window.innerWidth;
|
|
86
|
-
this.logger.log('[
|
|
94
|
+
this.logger.log('[PROJECT-ITEM] - ACTUAL Width ', actualWidth);
|
|
87
95
|
|
|
88
96
|
|
|
89
|
-
|
|
90
|
-
if (actualWidth <= 150) {
|
|
91
|
-
|
|
92
|
-
} else {
|
|
93
|
-
|
|
94
|
-
}
|
|
97
|
+
|
|
98
|
+
// if (actualWidth <= 150) {
|
|
99
|
+
// this.window_width_is_60 = true;
|
|
100
|
+
// } else {
|
|
101
|
+
// this.window_width_is_60 = false;
|
|
102
|
+
// }
|
|
95
103
|
}
|
|
96
104
|
|
|
97
105
|
|
|
@@ -117,22 +125,26 @@ export class ProjectItemComponent implements OnInit {
|
|
|
117
125
|
let stored_project = ''
|
|
118
126
|
try {
|
|
119
127
|
stored_project = localStorage.getItem('last_project')
|
|
128
|
+
this.logger.log('PROJECT-ITEM - THERE IS A STORED PROJECT ', stored_project)
|
|
120
129
|
} catch (err) {
|
|
121
|
-
|
|
130
|
+
this.logger.error('Get local storage LAST PROJECT ', err)
|
|
122
131
|
}
|
|
123
132
|
|
|
124
133
|
|
|
125
134
|
if (!stored_project) {
|
|
126
|
-
|
|
135
|
+
this.logger.log('PROJECT-ITEM - THERE IS NOT STORED LAST PROJECT ', stored_project)
|
|
127
136
|
const tiledeskToken = this.appStorageService.getItem('tiledeskToken');
|
|
128
137
|
this.logger.log('[INFO-CONTENT-COMP] - GET PROJECTS - tiledeskToken', tiledeskToken);
|
|
129
138
|
this.tiledeskService.getProjects(tiledeskToken).subscribe(projects => {
|
|
130
139
|
this.logger.log('[INFO-CONTENT-COMP] - GET PROJECTS - RES', projects);
|
|
131
|
-
|
|
140
|
+
|
|
132
141
|
this.logger.log('[INFO-CONTENT-COMP] - GET PROJECTS - RES this.project', this.project);
|
|
133
142
|
|
|
134
143
|
localStorage.setItem('last_project', JSON.stringify(projects[0]))
|
|
135
|
-
|
|
144
|
+
if (projects[0]) {
|
|
145
|
+
this.project = projects[0];
|
|
146
|
+
this.doProjectSubscriptions(this.project)
|
|
147
|
+
}
|
|
136
148
|
|
|
137
149
|
}, (error) => {
|
|
138
150
|
this.logger.error('[INFO-CONTENT-COMP] - GET PROJECTS - ERROR ', error);
|
|
@@ -146,7 +158,9 @@ export class ProjectItemComponent implements OnInit {
|
|
|
146
158
|
|
|
147
159
|
if (stored_project) {
|
|
148
160
|
this.logger.log('PROJECT-ITEM - THERE IS STORED LAST PROJECT ', stored_project)
|
|
149
|
-
|
|
161
|
+
if (stored_project) {
|
|
162
|
+
this.project = JSON.parse(stored_project)
|
|
163
|
+
}
|
|
150
164
|
this.doProjectSubscriptions(this.project)
|
|
151
165
|
this.logger.log('[PROJECT-ITEM] - LAST PROJECT PARSED ', this.project)
|
|
152
166
|
}
|
|
@@ -155,6 +169,7 @@ export class ProjectItemComponent implements OnInit {
|
|
|
155
169
|
}
|
|
156
170
|
|
|
157
171
|
doProjectSubscriptions(project) {
|
|
172
|
+
this.logger.log('[PROJECT-ITEM] doProjectSubscriptions project ', project)
|
|
158
173
|
if (project) {
|
|
159
174
|
const user_role = this.project.role
|
|
160
175
|
this.logger.log('[PROJECT-ITEM] - user_role ', user_role)
|
|
@@ -229,29 +244,28 @@ export class ProjectItemComponent implements OnInit {
|
|
|
229
244
|
}
|
|
230
245
|
|
|
231
246
|
updateUnservedRequestCount() {
|
|
247
|
+
// console.log('[PROJECT-ITEM] updateUnservedRequestCount ')
|
|
232
248
|
// this.requestsService.requestsList_bs.subscribe((requests) => {
|
|
233
249
|
this.wsService.wsRequestsList$
|
|
234
|
-
.pipe(
|
|
235
|
-
takeUntil(this.unsubscribe$)
|
|
236
|
-
)
|
|
237
250
|
.subscribe((requests) => {
|
|
238
|
-
|
|
251
|
+
// console.log('[PROJECT-ITEM] requests ', requests)
|
|
239
252
|
if (requests) {
|
|
240
253
|
let count = 0;
|
|
241
254
|
requests.forEach(r => {
|
|
242
255
|
// this.logger.log('NAVBAR - UPDATE-UNSERVED-REQUEST-COUNT request agents', r.agents)
|
|
243
256
|
// *bug fix: when the user is an agent also for the unserved we have to consider if he is present in agents
|
|
244
|
-
|
|
257
|
+
// && this.ROLE_IS_AGENT === true
|
|
258
|
+
if (r['status'] === 100 ) {
|
|
245
259
|
if (this.hasmeInAgents(r['agents']) === true) {
|
|
246
260
|
count = count + 1;
|
|
247
261
|
}
|
|
248
262
|
}
|
|
249
|
-
if (r['status'] === 100 && this.ROLE_IS_AGENT === false) {
|
|
250
|
-
|
|
251
|
-
}
|
|
263
|
+
// if (r['status'] === 100 && this.ROLE_IS_AGENT === false) {
|
|
264
|
+
// count = count + 1;
|
|
265
|
+
// }
|
|
252
266
|
});
|
|
253
267
|
this.unservedRequestCount = count;
|
|
254
|
-
|
|
268
|
+
// console.log('[PROJECT-ITEM] UNSERVED REQUEST COUNT - RES ', this.unservedRequestCount)
|
|
255
269
|
}
|
|
256
270
|
}, error => {
|
|
257
271
|
this.logger.error('[PROJECT-ITEM] UNSERVED REQUEST COUNT * error * ', error)
|
|
@@ -263,10 +277,10 @@ export class ProjectItemComponent implements OnInit {
|
|
|
263
277
|
hasmeInAgents(agents) {
|
|
264
278
|
if (agents) {
|
|
265
279
|
for (let j = 0; j < agents.length; j++) {
|
|
266
|
-
this.logger.log('[PROJECT-ITEM] hasmeInAgents currentUserId ', this.currentUserId)
|
|
267
|
-
this.logger.log('[PROJECT-ITEM] hasmeInAgents agent ', agents[j].id_user)
|
|
280
|
+
// this.logger.log('[PROJECT-ITEM] hasmeInAgents currentUserId ', this.currentUserId)
|
|
281
|
+
// this.logger.log('[PROJECT-ITEM] hasmeInAgents agent ', agents[j].id_user)
|
|
268
282
|
if (this.currentUserId === agents[j].id_user) {
|
|
269
|
-
this.logger.log('[PROJECT-ITEM] hasmeInAgents ')
|
|
283
|
+
// this.logger.log('[PROJECT-ITEM] hasmeInAgents ')
|
|
270
284
|
return true
|
|
271
285
|
}
|
|
272
286
|
}
|
|
@@ -3,6 +3,5 @@
|
|
|
3
3
|
[translationMap] = translationMap
|
|
4
4
|
[companyLogoBlackUrl]= companyLogoBlackUrl
|
|
5
5
|
[companyName]= companyName
|
|
6
|
-
(eventSignInWithEmailAndPassword)="returnSignInWithEmailAndPassword($event)"
|
|
7
|
-
>
|
|
6
|
+
(eventSignInWithEmailAndPassword)="returnSignInWithEmailAndPassword($event)">
|
|
8
7
|
</component-login>
|
|
@@ -179,6 +179,8 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
|
|
|
179
179
|
this.conversationWith = params.get('IDConv');
|
|
180
180
|
this.conversationWithFullname = params.get('FullNameConv');
|
|
181
181
|
this.conv_type = params.get('Convtype');
|
|
182
|
+
|
|
183
|
+
this.events.publish('supportconvid:haschanged', this.conversationWith);
|
|
182
184
|
});
|
|
183
185
|
|
|
184
186
|
}
|
|
@@ -12,13 +12,8 @@
|
|
|
12
12
|
|
|
13
13
|
<div id="scrollbar2">
|
|
14
14
|
<ion-list>
|
|
15
|
-
<span
|
|
16
|
-
*ngIf="(conversations.length > 0 && conversationType ==='active') || (archivedConversations.length > 0 && conversationType ==='archived');then contentConversations else contentMessageWelcome">
|
|
17
|
-
here is ignored
|
|
18
|
-
</span>
|
|
19
15
|
|
|
20
|
-
|
|
21
|
-
<!-- -------------------------------------------------------------------------- -->
|
|
16
|
+
<!-- -------------------------------------------------------------------------- -->
|
|
22
17
|
<!-- New <ion-spinner class="spinner-middle" style="margin-left: 19px;"></ion-spinner> -->
|
|
23
18
|
<!-- -------------------------------------------------------------------------- -->
|
|
24
19
|
<ion-item *ngIf="isOnline === false" style="padding-left:0px!important ;padding-right:0px!important" button="true" lines="none" class="ion-no-padding waiting-for-connection">
|
|
@@ -42,11 +37,21 @@
|
|
|
42
37
|
<ion-label part="message-text" class="waiting-for-network-msg"> Waiting for network</ion-label>
|
|
43
38
|
</ion-item>
|
|
44
39
|
|
|
45
|
-
<ion-item
|
|
40
|
+
<ion-item *ngIf="supportMode && displayNewConvsItem" class="ion-no-padding open-iframe-item"
|
|
41
|
+
button="true"
|
|
46
42
|
(click)="openUnsevedConversationIframe()">
|
|
47
43
|
<div tabindex="0"></div>
|
|
48
44
|
<app-project-item (projectIdEvent)="getLastProjectId($event)"></app-project-item>
|
|
49
45
|
</ion-item>
|
|
46
|
+
|
|
47
|
+
<span
|
|
48
|
+
*ngIf="(conversations.length > 0 && conversationType ==='active') || (archivedConversations.length > 0 && conversationType ==='archived');then contentConversations else contentMessageWelcome">
|
|
49
|
+
here is ignored
|
|
50
|
+
</span>
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
<ng-template #contentConversations>
|
|
50
55
|
<!-- ---------------------------------- -->
|
|
51
56
|
<!-- ACTIVE CONVERSATION LIST -->
|
|
52
57
|
<!-- ---------------------------------- -->
|