@chat21/chat21-ionic 3.0.58 → 3.0.59-rc4
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 +24 -0
- package/README.md +4 -0
- 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-routing.module.ts +21 -17
- package/src/app/app.component.html +6 -3
- package/src/app/app.component.ts +195 -41
- package/src/app/app.module.ts +4 -1
- package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.html +4 -4
- package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.scss +8 -2
- package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.ts +6 -1
- package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.html +7 -2
- package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.ts +47 -2
- package/src/app/chatlib/conversation-detail/message/image/image.component.html +7 -6
- package/src/app/chatlib/conversation-detail/message/image/image.component.ts +20 -1
- package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.html +34 -5
- package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.scss +8 -144
- package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.ts +14 -18
- package/src/app/components/authentication/login/login.component.html +2 -2
- package/src/app/components/authentication/login/login.component.ts +2 -1
- package/src/app/components/conversation-detail/bubble-my-message/bubble-my-message.component.ts +1 -1
- package/src/app/components/conversation-detail/bubble-others-message/bubble-others-message.component.ts +1 -1
- package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.html +17 -12
- package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.scss +12 -0
- package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.ts +21 -5
- package/src/app/components/conversation-detail/message-text-area/message-text-area.component.html +3 -2
- package/src/app/components/conversation-detail/message-text-area/message-text-area.component.scss +22 -17
- package/src/app/components/conversation-detail/message-text-area/message-text-area.component.ts +46 -5
- package/src/app/components/image-viewer/image-viewer.component.html +23 -0
- package/src/app/components/image-viewer/image-viewer.component.scss +107 -0
- package/src/app/components/image-viewer/image-viewer.component.spec.ts +24 -0
- package/src/app/components/image-viewer/image-viewer.component.ts +38 -0
- package/src/app/components/project-item/project-item.component.html +102 -0
- package/src/app/components/project-item/project-item.component.scss +542 -0
- package/src/app/components/project-item/project-item.component.spec.ts +24 -0
- package/src/app/components/project-item/project-item.component.ts +308 -0
- package/src/app/components/utils/avatar-profile/avatar-profile.component.html +7 -0
- package/src/app/components/utils/avatar-profile/avatar-profile.component.ts +22 -5
- package/src/app/pages/authentication/login/login.page.ts +1 -1
- package/src/app/pages/conversation-detail/conversation-detail.page.html +5 -3
- package/src/app/pages/conversation-detail/conversation-detail.page.ts +122 -30
- package/src/app/pages/conversations-list/conversations-list.page.html +40 -24
- package/src/app/pages/conversations-list/conversations-list.page.scss +146 -1
- package/src/app/pages/conversations-list/conversations-list.page.ts +80 -6
- package/src/app/pages/unassigned-conversations/unassigned-conversations-routing.module.ts +17 -0
- package/src/app/pages/unassigned-conversations/unassigned-conversations.module.ts +22 -0
- package/src/app/pages/unassigned-conversations/unassigned-conversations.page.html +14 -0
- package/src/app/pages/unassigned-conversations/unassigned-conversations.page.scss +0 -0
- package/src/app/pages/unassigned-conversations/unassigned-conversations.page.spec.ts +24 -0
- package/src/app/pages/unassigned-conversations/unassigned-conversations.page.ts +105 -0
- package/src/app/services/nav-proxy.service.ts +1 -1
- package/src/app/services/tiledesk/tiledesk.service.ts +22 -1
- package/src/app/services/websocket/websocket-js.ts +559 -0
- package/src/app/services/websocket/websocket.service.spec.ts +12 -0
- package/src/app/services/websocket/websocket.service.ts +274 -0
- package/src/app/shared/shared.module.ts +7 -1
- package/src/assets/i18n/en.json +8 -1
- package/src/assets/i18n/it.json +8 -1
- package/src/chat21-core/providers/chat-manager.ts +3 -3
- package/src/chat21-core/providers/firebase/firebase-archivedconversations-handler.ts +1 -1
- package/src/chat21-core/providers/firebase/firebase-auth-service.ts +6 -6
- package/src/chat21-core/providers/firebase/firebase-conversation-handler.ts +1 -1
- package/src/chat21-core/providers/firebase/firebase-notifications.ts +1 -1
- package/src/chat21-core/providers/firebase/firebase-presence.service.ts +2 -2
- package/src/chat21-core/providers/firebase/firebase-typing.service.ts +1 -1
- package/src/chat21-core/providers/firebase/firebase-upload.service.ts +1 -1
- package/src/chat21-core/providers/tiledesk/tiledesk-auth.service.ts +1 -1
- package/src/chat21-core/utils/utils.ts +1 -1
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
import { Injectable } from '@angular/core';
|
|
2
|
+
import { BehaviorSubject } from 'rxjs';
|
|
3
|
+
import { WebSocketJs } from "./websocket-js";
|
|
4
|
+
import { AppConfigProvider } from '../app-config';
|
|
5
|
+
import { HttpClient, HttpHeaders } from '@angular/common/http';
|
|
6
|
+
import { map } from 'rxjs/operators';
|
|
7
|
+
import { LoggerService } from 'src/chat21-core/providers/abstract/logger.service';
|
|
8
|
+
import { LoggerInstance } from 'src/chat21-core/providers/logger/loggerInstance';
|
|
9
|
+
|
|
10
|
+
@Injectable({
|
|
11
|
+
providedIn: 'root'
|
|
12
|
+
})
|
|
13
|
+
export class WebsocketService {
|
|
14
|
+
private apiUrl: string;
|
|
15
|
+
public currentProjectUserAvailability$: BehaviorSubject<[]> = new BehaviorSubject<[]>([])
|
|
16
|
+
|
|
17
|
+
wsService: WebSocketJs;
|
|
18
|
+
wsRequestsList: any;
|
|
19
|
+
public wsRequestsList$: BehaviorSubject<Request[]> = new BehaviorSubject<Request[]>([]);
|
|
20
|
+
|
|
21
|
+
private logger: LoggerService = LoggerInstance.getInstance();
|
|
22
|
+
|
|
23
|
+
constructor(
|
|
24
|
+
public webSocketJs: WebSocketJs,
|
|
25
|
+
public http: HttpClient,
|
|
26
|
+
public appConfigProvider: AppConfigProvider
|
|
27
|
+
|
|
28
|
+
) {
|
|
29
|
+
this.apiUrl = appConfigProvider.getConfig().apiUrl;
|
|
30
|
+
// SERVER_BASE_URL: 'https://tiledesk-server-pre.herokuapp.com/'
|
|
31
|
+
// CHAT IONIC API URL https://tiledesk-server-pre.herokuapp.com/"
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
subscriptionToWsCurrentProjectUserAvailability(projectid, prjctuserid) {
|
|
36
|
+
var self = this;
|
|
37
|
+
const path = '/' + projectid + '/project_users/' + prjctuserid
|
|
38
|
+
this.logger.log('[WS-SERV] - SUBSCR (REF) TO WS CURRENT USERS PATH: ', path);
|
|
39
|
+
|
|
40
|
+
return new Promise(function (resolve, reject) {
|
|
41
|
+
|
|
42
|
+
self.webSocketJs.ref(path, 'subscriptionToWsCurrentUser_allProject',
|
|
43
|
+
function (data, notification) {
|
|
44
|
+
// console.log("[WS-SERV] SUBSCR TO WS CURRENT PROJECT-USER AVAILABILITY - CREATE - data ", data);
|
|
45
|
+
resolve(data)
|
|
46
|
+
// self.currentUserWsAvailability$.next(data.user_available);
|
|
47
|
+
self.currentProjectUserAvailability$.next(data)
|
|
48
|
+
|
|
49
|
+
}, function (data, notification) {
|
|
50
|
+
resolve(data)
|
|
51
|
+
// console.log("[WS-SERV] SUBSCR TO WS CURRENT PROJECT-USER AVAILABILITY - UPDATE - data ", data);
|
|
52
|
+
self.currentProjectUserAvailability$.next(data)
|
|
53
|
+
|
|
54
|
+
}, function (data, notification) {
|
|
55
|
+
resolve(data)
|
|
56
|
+
if (data) {
|
|
57
|
+
// console.log("[WS-SERV] SUBSCR TO WS CURRENT PROJECT-USER AVAILABILITY - UPDATE - data", data);
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
})
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
public updateCurrentUserAvailability(token: string, projectId: string, user_is_available: boolean) {
|
|
65
|
+
const httpOptions = {
|
|
66
|
+
headers: new HttpHeaders({
|
|
67
|
+
'Accept': 'application/json',
|
|
68
|
+
'Content-Type': 'application/json',
|
|
69
|
+
Authorization: token
|
|
70
|
+
})
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
const body = { 'user_available': user_is_available };
|
|
74
|
+
|
|
75
|
+
const url = this.apiUrl + projectId + '/project_users/';
|
|
76
|
+
|
|
77
|
+
this.logger.log('[WS-SERV] - UPDATE CURRENT PROJECT-USER AVAILABILITY (PUT) URL ', url);
|
|
78
|
+
return this.http
|
|
79
|
+
.put(url, body, httpOptions)
|
|
80
|
+
.pipe(map((res: any) => {
|
|
81
|
+
this.logger.log('[WS-SERV] - UPDATE CURRENT PROJECT-USER AVAILABILITY (PUT) ', res);
|
|
82
|
+
return res
|
|
83
|
+
}))
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
subscriptionToWsConversations(project_id) {
|
|
87
|
+
this.logger.log("[WS-SERV] - CALLED SUBSC TO WS CONVS - PROJECT ID ", project_id);
|
|
88
|
+
var self = this;
|
|
89
|
+
this.wsRequestsList = [];
|
|
90
|
+
|
|
91
|
+
this.webSocketJs.ref('/' + project_id + '/requests', 'getCurrentProjectAndSubscribeTo_WsRequests',
|
|
92
|
+
|
|
93
|
+
function (data, notification) {
|
|
94
|
+
// self.logger.log("[WS-SERV] - CONVS - CREATE DATA ", data);
|
|
95
|
+
if (data) {
|
|
96
|
+
// ------------------------------------------------
|
|
97
|
+
// @ Agents - pass in data agents get from snapshot
|
|
98
|
+
// ------------------------------------------------
|
|
99
|
+
if (data.snapshot && data.snapshot.agents) {
|
|
100
|
+
|
|
101
|
+
data.agents = data['snapshot']["agents"]
|
|
102
|
+
} else if (data.agents) {
|
|
103
|
+
// ---------------------------------------------------------------
|
|
104
|
+
// @ Agents - else (if exist agents in data) pass agents from data
|
|
105
|
+
// ---------------------------------------------------------------
|
|
106
|
+
data.agents = data.agents
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// ---------------------------------------------
|
|
110
|
+
// @ Lead - pass in data lead get from snapshot
|
|
111
|
+
// ----------------------------------------------
|
|
112
|
+
if (data.snapshot && data.snapshot.lead) {
|
|
113
|
+
|
|
114
|
+
data.lead = data['snapshot']["lead"];
|
|
115
|
+
|
|
116
|
+
} else {
|
|
117
|
+
// ---------------------------------------------------------------------
|
|
118
|
+
// @ Lead - else (if exist lead in attributes) pass lead from attributes
|
|
119
|
+
// ---------------------------------------------------------------------
|
|
120
|
+
if (data['attributes'] && data['attributes'] !== undefined) {
|
|
121
|
+
|
|
122
|
+
if (data['attributes']['userFullname'] && data['attributes']['userEmail'] && data['attributes']['requester_id']) {
|
|
123
|
+
data.lead = { 'fullname': data['attributes']['userFullname'], 'email': data['attributes']['userEmail'], 'lead_id': data['attributes']['requester_id'] }
|
|
124
|
+
}
|
|
125
|
+
// ---------------------------------------------------------
|
|
126
|
+
// @ Lead - else (if exist lead in data) pass lead from data
|
|
127
|
+
// ---------------------------------------------------------
|
|
128
|
+
else if (data.lead) {
|
|
129
|
+
data.lead = data.lead
|
|
130
|
+
}
|
|
131
|
+
} else if (data.lead) {
|
|
132
|
+
data.lead = data.lead;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
// -----------------------------------------------------
|
|
137
|
+
// @ Requester pass in data requester get from snapshot
|
|
138
|
+
// -----------------------------------------------------
|
|
139
|
+
if (data.snapshot && data.snapshot.requester) {
|
|
140
|
+
|
|
141
|
+
data.requester = data['snapshot']["requester"]
|
|
142
|
+
|
|
143
|
+
} else if (data.requester) {
|
|
144
|
+
// ---------------------------------------------------------------------
|
|
145
|
+
// @ Lead - else (if exist requester in data) pass requester from data
|
|
146
|
+
// ---------------------------------------------------------------------
|
|
147
|
+
data.requester = data.requester
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
// ------------------------------------------------------
|
|
151
|
+
// @ Department pass in data department get from snapshot
|
|
152
|
+
// ------------------------------------------------------
|
|
153
|
+
if (data.snapshot && data.snapshot.department) {
|
|
154
|
+
|
|
155
|
+
data.department = data['snapshot']["department"]
|
|
156
|
+
|
|
157
|
+
} else if (data.department) {
|
|
158
|
+
// ----------------------------------------------------------------------------
|
|
159
|
+
// @ Department - else (if exist department in data) pass department from data
|
|
160
|
+
// ----------------------------------------------------------------------------
|
|
161
|
+
data.department = data.department
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
// https://stackoverflow.com/questions/36719477/array-push-and-unique-items
|
|
166
|
+
const index = self.wsRequestsList.findIndex((e) => e.id === data.id);
|
|
167
|
+
|
|
168
|
+
if (index === -1) {
|
|
169
|
+
self.addWsRequests(data)
|
|
170
|
+
// self.logger.log("[WS-REQUESTS-SERV] - CREATE - ADD REQUESTS");
|
|
171
|
+
} else {
|
|
172
|
+
// self.logger.log("[WS-REQUESTS-SERV] - CREATE - REQUEST ALREADY EXIST - NOT ADD");
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
}, function (data, notification) {
|
|
176
|
+
|
|
177
|
+
// self.logger.log("[WS-SERV] - CONVS - UPDATE DATA ", data);
|
|
178
|
+
|
|
179
|
+
// -------------------------------------------------------
|
|
180
|
+
// @ Agents (UPDATE) pass in data agents get from snapshot
|
|
181
|
+
// -------------------------------------------------------
|
|
182
|
+
if (data.snapshot && data.snapshot.agents) {
|
|
183
|
+
data.agents = data['snapshot']["agents"]
|
|
184
|
+
} else if (data.agents) {
|
|
185
|
+
// ---------------------------------------------------------------
|
|
186
|
+
// @ Agents - else (if exist agents in data) pass agents from data
|
|
187
|
+
// ---------------------------------------------------------------
|
|
188
|
+
data.agents = data.agents
|
|
189
|
+
}
|
|
190
|
+
self.updateWsRequests(data)
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
}, function (data, notification) {
|
|
194
|
+
// self.logger.log("[WS-SERV] - CONVS - ON-DATA - DATA ", data);
|
|
195
|
+
|
|
196
|
+
}
|
|
197
|
+
);
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* REQUESTS publish @ the CREATE
|
|
202
|
+
*
|
|
203
|
+
* @param request
|
|
204
|
+
*/
|
|
205
|
+
addWsRequests(request: Request) {
|
|
206
|
+
if (request !== null && request !== undefined) {
|
|
207
|
+
this.wsRequestsList.push(request);
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
if (this.wsRequestsList) {
|
|
211
|
+
// -----------------------------------------------------------------------------------------------------
|
|
212
|
+
// publish all REQUESTS
|
|
213
|
+
// -----------------------------------------------------------------------------------------------------
|
|
214
|
+
this.wsRequestsList$.next(this.wsRequestsList);
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* REQUESTS - publish @ the UPDATE
|
|
220
|
+
* overwrite the request in the requests-list with the upcoming request if the id is the same
|
|
221
|
+
* remove the request from the requests-list if the status is === 1000 (i.e. archived request)
|
|
222
|
+
*
|
|
223
|
+
* @param request
|
|
224
|
+
*/
|
|
225
|
+
updateWsRequests(request: any) {
|
|
226
|
+
|
|
227
|
+
// QUANDO UNA RICHIESTA VIENE EMESSA CON preflight = true non passa dal ON CREATE
|
|
228
|
+
// sull ON UPDATE VENGONO AGGIORNATE SOLO LE RICHIESTE CHE VERIFICANO LA condizione request._id === this.wsRequestsList[i]._id
|
|
229
|
+
// PER PUBBLICARE LE RICHIESTE CHE LA CUI PROPRIETà preflight = true E AGGIORNATA A FALSE (E CHE QUINDI è DA VISUALIZZARE) CERCO
|
|
230
|
+
// L'ESISTENZA DELL'ID NELLA wsRequestsList
|
|
231
|
+
// const hasFound = this.wsRequestsList.filter((obj: any) => {
|
|
232
|
+
// return obj._id === request._id;
|
|
233
|
+
// });
|
|
234
|
+
// this.logger.log("% »»» WebSocketJs WF +++++ ws-requests--- service ON-UPATE hasFound IN wsRequestsList: ", hasFound , 'THE REQUEST ID', request._id);
|
|
235
|
+
|
|
236
|
+
const index = this.wsRequestsList.findIndex((e) => e.id === request.id);
|
|
237
|
+
if (index === -1) {
|
|
238
|
+
|
|
239
|
+
this.wsRequestsList.push(request);
|
|
240
|
+
this.wsRequestsList$.next(this.wsRequestsList);
|
|
241
|
+
|
|
242
|
+
} else {
|
|
243
|
+
this.logger.log("[WS-SERV] - ON-UPATE - THE CONV NOT EXIST ");
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
for (let i = 0; i < this.wsRequestsList.length; i++) {
|
|
248
|
+
if (request._id === this.wsRequestsList[i]._id) {
|
|
249
|
+
|
|
250
|
+
if (request.status !== 1000) {
|
|
251
|
+
|
|
252
|
+
// --------------------------
|
|
253
|
+
// UPATE AN EXISTING REQUESTS
|
|
254
|
+
// --------------------------
|
|
255
|
+
this.logger.log("[WS-SERV] - UPDATE AN EXISTING CONV ");
|
|
256
|
+
|
|
257
|
+
this.wsRequestsList[i] = request
|
|
258
|
+
|
|
259
|
+
} else if (request.status === 1000) {
|
|
260
|
+
|
|
261
|
+
this.wsRequestsList.splice(i, 1);
|
|
262
|
+
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
if (this.wsRequestsList) {
|
|
266
|
+
this.wsRequestsList$.next(this.wsRequestsList);
|
|
267
|
+
this.logger.log("[WS-SERV] - ON-UPATE CONVS LIST ", this.wsRequestsList);
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
|
|
274
|
+
}
|
|
@@ -17,6 +17,7 @@ import { IonicModule } from '@ionic/angular';
|
|
|
17
17
|
|
|
18
18
|
import { AvatarProfileComponent } from 'src/app/components/utils/avatar-profile/avatar-profile.component';
|
|
19
19
|
import { DdpHeaderComponent } from 'src/app/components/ddp-header/ddp-header.component';
|
|
20
|
+
|
|
20
21
|
import { UserPresenceComponent } from 'src/app/components/utils/user-presence/user-presence.component';
|
|
21
22
|
import { UserTypingComponent } from 'src/chat21-core/utils/user-typing/user-typing.component';
|
|
22
23
|
import { ListConversationsComponent } from '../chatlib/list-conversations-component/list-conversations/list-conversations.component';
|
|
@@ -37,6 +38,8 @@ import { InfoGroupComponent } from '../components/conversation-info/info-group/i
|
|
|
37
38
|
import { TooltipModule } from 'ng2-tooltip-directive';
|
|
38
39
|
import { OptionHeaderComponent } from '../components/conversation-detail/option-header/option-header.component';
|
|
39
40
|
import { MessageAttachmentComponent } from '../chatlib/conversation-detail/message/message-attachment/message-attachment.component';
|
|
41
|
+
import { ImageViewerComponent } from '../components/image-viewer/image-viewer.component';
|
|
42
|
+
import { ProjectItemComponent } from '../components/project-item/project-item.component';
|
|
40
43
|
|
|
41
44
|
@NgModule({
|
|
42
45
|
declarations: [
|
|
@@ -46,7 +49,8 @@ import { MessageAttachmentComponent } from '../chatlib/conversation-detail/messa
|
|
|
46
49
|
UserTypingComponent,
|
|
47
50
|
ListConversationsComponent,
|
|
48
51
|
IonListConversationsComponent,
|
|
49
|
-
|
|
52
|
+
ImageViewerComponent,
|
|
53
|
+
ProjectItemComponent,
|
|
50
54
|
IonConversationDetailComponent,
|
|
51
55
|
ConversationContentComponent,
|
|
52
56
|
AvatarComponent,
|
|
@@ -79,6 +83,8 @@ import { MessageAttachmentComponent } from '../chatlib/conversation-detail/messa
|
|
|
79
83
|
AutofocusDirective,
|
|
80
84
|
AvatarProfileComponent,
|
|
81
85
|
DdpHeaderComponent,
|
|
86
|
+
ImageViewerComponent,
|
|
87
|
+
ProjectItemComponent,
|
|
82
88
|
UserPresenceComponent,
|
|
83
89
|
UserTypingComponent,
|
|
84
90
|
ListConversationsComponent,
|
package/src/assets/i18n/en.json
CHANGED
|
@@ -179,5 +179,12 @@
|
|
|
179
179
|
"CONTACT_ID": "Contact ID",
|
|
180
180
|
"USER_ID": "User ID",
|
|
181
181
|
"CLOSE_TOAST": "Close",
|
|
182
|
-
"WAITING_FOR_NETWORK": "Waiting for network"
|
|
182
|
+
"WAITING_FOR_NETWORK": "Waiting for network",
|
|
183
|
+
"Available": "Available",
|
|
184
|
+
"Unavailable": "Unavailable",
|
|
185
|
+
"Busy": "Busy",
|
|
186
|
+
"YouAreAboutToJoinThisChat":"You are about to join this chat",
|
|
187
|
+
"Cancel": "Cancel",
|
|
188
|
+
"AreYouSure":"Are you sure?",
|
|
189
|
+
"UnassignedConversations":"Unassigned Conversations"
|
|
183
190
|
}
|
package/src/assets/i18n/it.json
CHANGED
|
@@ -187,5 +187,12 @@
|
|
|
187
187
|
"CONTACT_ID": "ID contatto",
|
|
188
188
|
"USER_ID": "ID utente",
|
|
189
189
|
"CLOSE_TOAST": "Chiudi",
|
|
190
|
-
"WAITING_FOR_NETWORK": "In attesa di rete"
|
|
190
|
+
"WAITING_FOR_NETWORK": "In attesa di rete",
|
|
191
|
+
"Available": "Disponibile",
|
|
192
|
+
"Unavailable": "Non disponibile",
|
|
193
|
+
"Busy": "Occupato",
|
|
194
|
+
"YouAreAboutToJoinThisChat":"Stai per entrare in questa chat",
|
|
195
|
+
"Cancel": "Annulla",
|
|
196
|
+
"AreYouSure":"Sei sicuro?",
|
|
197
|
+
"UnassignedConversations":"Conversazioni non assegnate"
|
|
191
198
|
}
|
|
@@ -46,7 +46,7 @@ export class ChatManager {
|
|
|
46
46
|
initialize() {
|
|
47
47
|
const appconfig = this.appConfigProvider.getConfig();
|
|
48
48
|
this.tenant = appconfig.firebaseConfig.tenant;
|
|
49
|
-
this.logger.
|
|
49
|
+
this.logger.log('[CHAT MANAGER] - initialize -> firebaseConfig tenant ', this.tenant);
|
|
50
50
|
this.handlers = [];
|
|
51
51
|
this.openInfoConversation = true;
|
|
52
52
|
this.currentUser = null;
|
|
@@ -57,7 +57,7 @@ export class ChatManager {
|
|
|
57
57
|
* setTiledeskToken
|
|
58
58
|
*/
|
|
59
59
|
public setTiledeskToken(tiledeskToken: string) {
|
|
60
|
-
this.logger.
|
|
60
|
+
this.logger.log('initialize FROM [APP-COMP] - [CHAT MANAGER] - initialize -> firebaseConfig tenant ', this.tenant);
|
|
61
61
|
this.tiledeskToken = tiledeskToken;
|
|
62
62
|
}
|
|
63
63
|
|
|
@@ -72,7 +72,7 @@ export class ChatManager {
|
|
|
72
72
|
* setCurrentUser
|
|
73
73
|
*/
|
|
74
74
|
public setCurrentUser(currentUser: UserModel) {
|
|
75
|
-
this.logger.
|
|
75
|
+
this.logger.log('initialize FROM [APP-COMP] - [CHAT MANAGER] setCurrentUser currentUser ', currentUser)
|
|
76
76
|
this.currentUser = currentUser;
|
|
77
77
|
}
|
|
78
78
|
|
|
@@ -64,7 +64,7 @@ export class FirebaseArchivedConversationsHandler extends ArchivedConversationsH
|
|
|
64
64
|
* inizializzo conversations handler
|
|
65
65
|
*/
|
|
66
66
|
initialize(tenant: string, userId: string, translationMap: Map<string, string>) {
|
|
67
|
-
this.logger.
|
|
67
|
+
this.logger.log('initialize FROM [APP-COMP] - FIREBASEArchivedConversationsHandlerSERVICE] tenant ', tenant, ' - userId: ', userId, ' - translationMap: ', translationMap)
|
|
68
68
|
this.tenant = tenant;
|
|
69
69
|
this.loggedUserId = userId;
|
|
70
70
|
this.translationMap = translationMap;
|
|
@@ -75,10 +75,10 @@ export class FirebaseAuthService extends MessagingAuthService {
|
|
|
75
75
|
*
|
|
76
76
|
*/
|
|
77
77
|
initialize() {
|
|
78
|
-
|
|
78
|
+
this.logger.log('initialize FROM [APP-COMP] [FIREBASEAuthSERVICE]')
|
|
79
79
|
this.SERVER_BASE_URL = this.getBaseUrl();
|
|
80
80
|
this.URL_TILEDESK_CREATE_CUSTOM_TOKEN = this.SERVER_BASE_URL + 'chat21/firebase/auth/createCustomToken';
|
|
81
|
-
this.logger.
|
|
81
|
+
this.logger.log('[FIREBASEAuthSERVICE] - initialize URL_TILEDESK_CREATE_CUSTOM_TOKEN ', this.URL_TILEDESK_CREATE_CUSTOM_TOKEN)
|
|
82
82
|
|
|
83
83
|
|
|
84
84
|
let firebasePersistence;
|
|
@@ -102,7 +102,7 @@ export class FirebaseAuthService extends MessagingAuthService {
|
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
104
|
firebase.auth().setPersistence(firebasePersistence).then(async () => {
|
|
105
|
-
|
|
105
|
+
this.logger.log('[FIREBASEAuthSERVICE] firebasePersistence ', firebasePersistence)
|
|
106
106
|
// this.onAuthStateChanged(); // commented for new-login
|
|
107
107
|
})
|
|
108
108
|
.catch((error) => {
|
|
@@ -203,12 +203,12 @@ export class FirebaseAuthService extends MessagingAuthService {
|
|
|
203
203
|
// Only one subscriber x application allowed
|
|
204
204
|
// ---------------------------------------------------------------------------------------------------
|
|
205
205
|
if (this.unsubscribe) {
|
|
206
|
-
|
|
206
|
+
this.logger.log('initialize FROM [APP-COMP] - [FIREBASEAuthSERVICE] onAuthStateChanged ALREADY SUBSCRIBED')
|
|
207
207
|
return
|
|
208
208
|
}
|
|
209
209
|
|
|
210
210
|
this.unsubscribe = firebase.auth().onAuthStateChanged(user => {
|
|
211
|
-
|
|
211
|
+
this.logger.log('initialize FROM [APP-COMP] - [FIREBASEAuthSERVICE] onAuthStateChanged', user)
|
|
212
212
|
|
|
213
213
|
|
|
214
214
|
if (!user) {
|
|
@@ -351,7 +351,7 @@ export class FirebaseAuthService extends MessagingAuthService {
|
|
|
351
351
|
// }
|
|
352
352
|
// return firebase.auth().setPersistence(firebasePersistence).then(async () => {
|
|
353
353
|
return firebase.auth().signInWithCustomToken(token).then(async (user) => {
|
|
354
|
-
|
|
354
|
+
this.logger.log('[FIREBASEAuthSERVICE] signInWithCustomToken user: ', user);
|
|
355
355
|
if (user) {
|
|
356
356
|
this.BSAuthStateChanged.next('online');
|
|
357
357
|
}
|
|
@@ -65,7 +65,7 @@ export class FirebaseConversationHandler extends ConversationHandlerService {
|
|
|
65
65
|
* inizializzo conversation handler
|
|
66
66
|
*/
|
|
67
67
|
initialize(recipientId: string,recipientFullName: string,loggedUser: UserModel,tenant: string,translationMap: Map<string, string>) {
|
|
68
|
-
this.logger.
|
|
68
|
+
this.logger.log('[FIREBASEConversationHandlerSERVICE] initWithRecipient',recipientId, recipientFullName, loggedUser, tenant, translationMap)
|
|
69
69
|
this.recipientId = recipientId;
|
|
70
70
|
this.recipientFullname = recipientFullName;
|
|
71
71
|
this.loggedUser = loggedUser;
|
|
@@ -26,7 +26,7 @@ export class FirebaseNotifications extends NotificationsService {
|
|
|
26
26
|
initialize(tenant: string, vapId: string): void {
|
|
27
27
|
this.tenant = tenant
|
|
28
28
|
this.vapidkey = vapId
|
|
29
|
-
this.logger.
|
|
29
|
+
this.logger.log('[FIREBASE-NOTIFICATIONS] initialize - tenant ', this.tenant)
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
if (!('serviceWorker' in navigator)) {
|
|
@@ -49,7 +49,7 @@ export class FirebasePresenceService extends PresenceService {
|
|
|
49
49
|
public initialize(tenant: string) {
|
|
50
50
|
// this.tenant = this.getTenant();
|
|
51
51
|
this.tenant = tenant;
|
|
52
|
-
this.logger.
|
|
52
|
+
this.logger.log('[FIREBASEPresenceSERVICE] initialize this.tenant', this.tenant);
|
|
53
53
|
this.urlNodePresence = '/apps/' + this.tenant + '/presence/';
|
|
54
54
|
}
|
|
55
55
|
|
|
@@ -129,7 +129,7 @@ export class FirebasePresenceService extends PresenceService {
|
|
|
129
129
|
* @param userid
|
|
130
130
|
*/
|
|
131
131
|
public setPresence(userid: string): void {
|
|
132
|
-
this.logger.
|
|
132
|
+
this.logger.log('initialize FROM [APP-COMP] - [FIREBASEPresenceSERVICE] - SET PRESENCE userid ', userid)
|
|
133
133
|
this.onlineConnectionsRef = this.referenceOnlineForUser(userid);
|
|
134
134
|
this.lastOnlineConnectionsRef = this.referenceLastOnlineForUser(userid);
|
|
135
135
|
const connectedRefURL = '/.info/connected';
|
|
@@ -52,7 +52,7 @@ export class FirebaseTypingService extends TypingService {
|
|
|
52
52
|
public initialize(tenant: string) {
|
|
53
53
|
// this.tenant = this.getTenant();
|
|
54
54
|
this.tenant = tenant;
|
|
55
|
-
this.logger.
|
|
55
|
+
this.logger.log('[FIREBASETypingSERVICE] initialize - tenant ', this.tenant)
|
|
56
56
|
this.urlNodeTypings = '/apps/' + this.tenant + '/typings/';
|
|
57
57
|
}
|
|
58
58
|
|
|
@@ -43,7 +43,7 @@ export class FirebaseUploadService extends UploadService {
|
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
public initialize() {
|
|
46
|
-
this.logger.
|
|
46
|
+
this.logger.log('[FIREBASEUploadSERVICE] initialize');
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
public upload(userId: string, upload: UploadModel): Promise<any> {
|
|
@@ -35,7 +35,7 @@ export class TiledeskAuthService {
|
|
|
35
35
|
|
|
36
36
|
|
|
37
37
|
initialize(serverBaseUrl: string) {
|
|
38
|
-
this.logger.
|
|
38
|
+
this.logger.log('[TILEDESK-AUTH-SERV] - initialize serverBaseUrl', serverBaseUrl);
|
|
39
39
|
this.SERVER_BASE_URL = serverBaseUrl;
|
|
40
40
|
this.URL_TILEDESK_SIGNIN = this.SERVER_BASE_URL + 'auth/signin';
|
|
41
41
|
this.URL_TILEDESK_SIGNIN_ANONYMOUSLY = this.SERVER_BASE_URL + 'auth/signinAnonymously'
|
|
@@ -497,7 +497,7 @@ export function createConfirm(translate, alertCtrl, events, title, message, acti
|
|
|
497
497
|
text: LABEL_ANNULLA,
|
|
498
498
|
handler: () => {
|
|
499
499
|
events.publish('PopupConfirmation', LABEL_ANNULLA, action);
|
|
500
|
-
console.log('Disagree clicked');
|
|
500
|
+
// console.log('Disagree clicked');
|
|
501
501
|
}
|
|
502
502
|
},
|
|
503
503
|
{
|