@chat21/chat21-ionic 3.4.32-rc7 → 3.4.32-rc9
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 +17 -0
- package/package.json +1 -1
- package/src/app/components/sidebar-user-details/sidebar-user-details.component.html +26 -20
- package/src/app/components/sidebar-user-details/sidebar-user-details.component.scss +32 -22
- package/src/app/components/sidebar-user-details/sidebar-user-details.component.ts +70 -20
- package/src/app/pages/conversations-list/conversations-list.page.ts +2 -0
- package/src/app/pipe/filter.pipe.spec.ts +8 -0
- package/src/app/pipe/filter.pipe.ts +15 -0
- package/src/app/pipe/find.pipe.spec.ts +8 -0
- package/src/app/pipe/find.pipe.ts +15 -0
- package/src/app/services/triggerEvents/triggerEvents.ts +12 -0
- package/src/app/shared/shared.module.ts +11 -6
- package/src/chat21-core/models/projects.ts +1 -0
- package/src/chat21-core/utils/constants.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,23 @@
|
|
|
8
8
|
### **Copyrigth**:
|
|
9
9
|
*Tiledesk SRL*
|
|
10
10
|
|
|
11
|
+
# 3.4.32-rc9
|
|
12
|
+
- **added**: sidebar-user-details — MutationObserver to close dropdowns when user details panel is hidden (watches #user-details class); cleanup in ngOnDestroy to prevent memory leaks.
|
|
13
|
+
- **changed**: sidebar-user-details — refined closeDropdowns for better dropdown management when panel closes.
|
|
14
|
+
- **added**: sidebar-user-details — hover to open status dropdown; improved status dropdown positioning logic.
|
|
15
|
+
- **changed**: sidebar-user-details — flexbox layout (justify-content: space-between) for improved project item spacing.
|
|
16
|
+
- **changed**: sidebar-user-details — HTML structure for conditional rendering of teammate status images and titles; cleaned up unused SCSS.
|
|
17
|
+
|
|
18
|
+
# 3.4.32-rc8
|
|
19
|
+
- **bug-fixed**: sidebar-user-details — status dropdown not visible when clicking first/last project; moved outside #user-details container to avoid overflow clipping.
|
|
20
|
+
- **bug-fixed**: sidebar-user-details — replaced `transform` on #user-details with `left` animation to fix `position: fixed` containing block (dropdown positioning).
|
|
21
|
+
- **changed**: sidebar-user-details — projects_dropdown_container and status-dropdown now use same colors as ng-select teammate-status-in-drawer.
|
|
22
|
+
- **changed**: sidebar-user-details — projects-dropdown-wrapper styled to match ng-select container.
|
|
23
|
+
- **added**: sidebar-user-details — MPA feature flag in featuresToken: if MPA is true show projects_dropdown_container, else show availability_dropdown_container.
|
|
24
|
+
- **bug-fixed**: RouterModule.forRoot() called twice when clicking conversation — SharedModule now imports RouterModule.forChild([]) instead of AppRoutingModule.
|
|
25
|
+
- **changed**: FindPipe and FilterPipe moved from AppModule to SharedModule for app-wide availability.
|
|
26
|
+
- **added**: conversations-list — postMessage to hosting app on conversation selection (event: `onConversationChanged`, data: full conversation object).
|
|
27
|
+
|
|
11
28
|
# 3.4.32-rc7
|
|
12
29
|
- **addded**: ability to change availability status for each project the logged-in user in sidebar-user-detail
|
|
13
30
|
|
package/package.json
CHANGED
|
@@ -80,36 +80,40 @@
|
|
|
80
80
|
bindLabel="name" bindValue="id"
|
|
81
81
|
[clearable]="false"
|
|
82
82
|
[searchable]="false">
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
83
|
+
<ng-template ng-label-tmp let-item="item">
|
|
84
|
+
<img style="width: 15px;height: 15px;position: relative; top: 1px;" height="15" width="15" [src]="item?.avatar" />
|
|
85
|
+
<span id="sidebaravatar_{{item.name}}" style="text-transform: capitalize; margin-left:8px"> {{item.label | translate}} </span>
|
|
86
|
+
</ng-template>
|
|
87
|
+
<ng-template ng-option-tmp let-item="item" let-index="index">
|
|
88
|
+
<img style="width: 15px;height: 15px;position: relative; top: 1px;" height="15" width="15" [src]="item?.avatar" />
|
|
89
|
+
<span id="sidebaravatar_{{item.name}}" style="text-transform: capitalize; margin-left:8px"> {{item.label | translate}} </span>
|
|
90
|
+
</ng-template>
|
|
91
|
+
</ng-select>
|
|
92
92
|
</ng-container>
|
|
93
93
|
|
|
94
94
|
<ng-container *ngIf="isVisibleMPA && projects?.length > 0" id="projects_dropdown_container">
|
|
95
95
|
<div class="projects-dropdown-wrapper">
|
|
96
96
|
<button class="btn projects-dropdown-toggle" (click)="toggleProjectsDropdown()">
|
|
97
|
-
<span class="projects-dropdown-toggle-label">
|
|
97
|
+
<span class="projects-dropdown-toggle-label">
|
|
98
|
+
{{ project?.name || 'Progetti' }}
|
|
99
|
+
<img *ngIf="project?.teammateStatus" style="width: 15px; height: 15px; position: relative; top: 1px; cursor: pointer;" height="15" width="15" [src]="project?.teammateStatus?.avatar" />
|
|
100
|
+
</span>
|
|
98
101
|
<i class="material-icons" style="margin-left: 4px; font-size: 18px;">arrow_drop_down</i>
|
|
99
102
|
</button>
|
|
100
|
-
<div class="ripple-container"></div>
|
|
101
103
|
<div id="projects_dropdown" class="dropdown-menu" [ngClass]="{'open': openDropdownProjects}">
|
|
102
|
-
<li *ngFor="let prjct of projects?.slice() | slice:0:
|
|
103
|
-
|
|
104
|
+
<li *ngFor="let prjct of projects?.slice() | slice:0:10; let i=index" style="cursor: pointer"
|
|
105
|
+
(mouseenter)="openStatusDropdownOnHover($event, prjct)"
|
|
106
|
+
(mouseleave)="closeStatusDropdownOnLeave()">
|
|
107
|
+
<a [ngClass]="{'li-selected' : prjct?.id_project?._id === openStatusDropdownProjectId }"
|
|
104
108
|
class="project-item-row">
|
|
105
109
|
<span class="project-item-name">{{ prjct?.id_project?.name }}</span>
|
|
106
110
|
<span class="project-item-status project-item-status-wrapper"
|
|
107
|
-
[attr.title]="
|
|
108
|
-
|
|
109
|
-
<img
|
|
111
|
+
[attr.title]="prjct?.teammateStatus?.name">
|
|
112
|
+
<span class="project-item-status-name">{{prjct?.teammateStatus?.name}}</span>
|
|
113
|
+
<img [src]="prjct?.teammateStatus?.avatar" />
|
|
110
114
|
</span>
|
|
111
115
|
</a>
|
|
112
|
-
|
|
116
|
+
</li>
|
|
113
117
|
</div>
|
|
114
118
|
</div>
|
|
115
119
|
</ng-container>
|
|
@@ -168,11 +172,13 @@
|
|
|
168
172
|
</div>
|
|
169
173
|
|
|
170
174
|
<!-- Status dropdown fuori da #user-details per evitare clipping da overflow -->
|
|
171
|
-
<div class="status-dropdown status-dropdown-fixed status-dropdown-outside" *ngIf="openStatusDropdownProjectId && selectedProjectForStatus"
|
|
172
|
-
[style.top.px]="statusDropdownPosition.top" [style.
|
|
175
|
+
<div class="status-dropdown status-dropdown-fixed status-dropdown-outside" *ngIf="openStatusDropdownProjectId && selectedProjectForStatus"
|
|
176
|
+
[style.top.px]="statusDropdownPosition.top" [style.left.px]="statusDropdownPosition.left"
|
|
177
|
+
(mouseenter)="cancelStatusDropdownClose()"
|
|
178
|
+
(mouseleave)="closeStatusDropdownOnLeave()">
|
|
173
179
|
<div class="status-dropdown-option" *ngFor="let status of TEAMMATE_STATUS"
|
|
174
180
|
(click)="$event.stopPropagation(); onChangeProjectStatus(selectedProjectForStatus, status.id)">
|
|
175
181
|
<img style="width: 15px; height: 15px; margin-right: 6px;" [src]="status.avatar" />
|
|
176
|
-
<span>{{
|
|
182
|
+
<span>{{ status.name }}</span>
|
|
177
183
|
</div>
|
|
178
184
|
</div>
|
|
@@ -164,7 +164,6 @@
|
|
|
164
164
|
text-align: center;
|
|
165
165
|
background-color: var(--sidebar-user-detail-select-background);
|
|
166
166
|
padding: 4px 0px;
|
|
167
|
-
width: 192px;
|
|
168
167
|
border-radius: 4px;
|
|
169
168
|
-webkit-transform: translateX(-50%);
|
|
170
169
|
transform: translateX(-50%);
|
|
@@ -174,6 +173,7 @@
|
|
|
174
173
|
z-index: 2;
|
|
175
174
|
|
|
176
175
|
|
|
176
|
+
|
|
177
177
|
.btn{
|
|
178
178
|
display: flex;
|
|
179
179
|
position: relative;
|
|
@@ -213,6 +213,10 @@
|
|
|
213
213
|
border: 1px solid var(--sidebar-user-detail-select-background);
|
|
214
214
|
}
|
|
215
215
|
|
|
216
|
+
.teammate-status-in-drawer {
|
|
217
|
+
width: 190px;
|
|
218
|
+
}
|
|
219
|
+
|
|
216
220
|
/* projects-dropdown-wrapper - stile come ng-select .ng-select-container (teammate-status-in-drawer) */
|
|
217
221
|
.projects-dropdown-wrapper {
|
|
218
222
|
position: relative;
|
|
@@ -222,12 +226,12 @@
|
|
|
222
226
|
color: var(--sidebar-user-detail-select-color);
|
|
223
227
|
border: 1px solid var(--sidebar-user-detail-select-background);
|
|
224
228
|
border-radius: 4px;
|
|
225
|
-
cursor: pointer;
|
|
226
229
|
display: flex;
|
|
227
230
|
align-items: center;
|
|
228
231
|
text-align: left;
|
|
229
232
|
font-size: 14px;
|
|
230
233
|
line-height: 1.4;
|
|
234
|
+
width: 250px;
|
|
231
235
|
|
|
232
236
|
.projects-dropdown-toggle {
|
|
233
237
|
background-color: transparent !important;
|
|
@@ -235,7 +239,7 @@
|
|
|
235
239
|
padding: 0 !important;
|
|
236
240
|
min-height: auto;
|
|
237
241
|
flex: 1;
|
|
238
|
-
justify-content:
|
|
242
|
+
justify-content: space-between;
|
|
239
243
|
color: inherit;
|
|
240
244
|
font-size: inherit;
|
|
241
245
|
}
|
|
@@ -245,6 +249,9 @@
|
|
|
245
249
|
overflow: hidden;
|
|
246
250
|
text-overflow: ellipsis;
|
|
247
251
|
white-space: nowrap;
|
|
252
|
+
display: flex;
|
|
253
|
+
align-items: center;
|
|
254
|
+
gap: 8px;
|
|
248
255
|
}
|
|
249
256
|
|
|
250
257
|
.dropdown-menu {
|
|
@@ -309,16 +316,6 @@
|
|
|
309
316
|
background-color: var(--sidebar-user-detail-select-hover-background);
|
|
310
317
|
}
|
|
311
318
|
|
|
312
|
-
&.all-projects,
|
|
313
|
-
&.add-project{
|
|
314
|
-
color: var(--sidebar-user-detail-select-color);
|
|
315
|
-
i{
|
|
316
|
-
padding-right: 5px;
|
|
317
|
-
margin-bottom: 2px;
|
|
318
|
-
font-size: 20px
|
|
319
|
-
}
|
|
320
|
-
}
|
|
321
|
-
|
|
322
319
|
&.section-title{
|
|
323
320
|
padding-left: 24px;
|
|
324
321
|
font-size: 12px;
|
|
@@ -327,14 +324,6 @@
|
|
|
327
324
|
}
|
|
328
325
|
}
|
|
329
326
|
|
|
330
|
-
.dropdown-menu .divider{
|
|
331
|
-
background-color: rgba(255, 255, 255, 0.2);
|
|
332
|
-
margin: 5px 0;
|
|
333
|
-
|
|
334
|
-
height: 1px;
|
|
335
|
-
overflow: hidden;
|
|
336
|
-
}
|
|
337
|
-
|
|
338
327
|
.dropdown-menu li>a{
|
|
339
328
|
font-size: 13px;
|
|
340
329
|
padding: 10px 20px;
|
|
@@ -348,7 +337,14 @@
|
|
|
348
337
|
color: var(--sidebar-user-detail-select-color);
|
|
349
338
|
white-space: nowrap;
|
|
350
339
|
text-decoration: none;
|
|
351
|
-
cursor:
|
|
340
|
+
cursor: auto;
|
|
341
|
+
|
|
342
|
+
img {
|
|
343
|
+
width: 15px;
|
|
344
|
+
height: 15px;
|
|
345
|
+
position: relative;
|
|
346
|
+
top: 1px;
|
|
347
|
+
}
|
|
352
348
|
|
|
353
349
|
.material-icons {
|
|
354
350
|
vertical-align: middle;
|
|
@@ -375,6 +371,7 @@
|
|
|
375
371
|
}
|
|
376
372
|
|
|
377
373
|
.project-item-status {
|
|
374
|
+
cursor: pointer;
|
|
378
375
|
flex: 0 0 10%;
|
|
379
376
|
display: flex;
|
|
380
377
|
justify-content: flex-end;
|
|
@@ -439,6 +436,19 @@
|
|
|
439
436
|
box-shadow: 0 2px 5px 0 rgb(0, 0, 0, 0.26);
|
|
440
437
|
list-style: none;
|
|
441
438
|
|
|
439
|
+
/* Triangolino in alto a sinistra, fuori dal container, con leggero gap in basso */
|
|
440
|
+
&::before {
|
|
441
|
+
content: '';
|
|
442
|
+
position: absolute;
|
|
443
|
+
left: -7px;
|
|
444
|
+
top: 10px;
|
|
445
|
+
width: 0;
|
|
446
|
+
height: 0;
|
|
447
|
+
border-top: 7px solid transparent;
|
|
448
|
+
border-bottom: 7px solid transparent;
|
|
449
|
+
border-right: 7px solid var(--sidebar-user-detail-select-background);
|
|
450
|
+
}
|
|
451
|
+
|
|
442
452
|
.status-dropdown-option {
|
|
443
453
|
display: flex;
|
|
444
454
|
align-items: center;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component, ElementRef, EventEmitter, HostListener, Input, OnChanges, OnInit, Output } from '@angular/core';
|
|
1
|
+
import { Component, ElementRef, EventEmitter, HostListener, Input, OnDestroy, OnChanges, OnInit, Output } from '@angular/core';
|
|
2
2
|
import { LoggerInstance } from 'src/chat21-core/providers/logger/loggerInstance';
|
|
3
3
|
import { LoggerService } from 'src/chat21-core/providers/abstract/logger.service';
|
|
4
4
|
import { TranslateService } from '@ngx-translate/core';
|
|
@@ -24,7 +24,7 @@ import { ProjectUser } from 'src/chat21-core/models/project_user';
|
|
|
24
24
|
templateUrl: './sidebar-user-details.component.html',
|
|
25
25
|
styleUrls: ['./sidebar-user-details.component.scss'],
|
|
26
26
|
})
|
|
27
|
-
export class SidebarUserDetailsComponent implements OnInit, OnChanges {
|
|
27
|
+
export class SidebarUserDetailsComponent implements OnInit, OnChanges, OnDestroy {
|
|
28
28
|
// HAS_CLICKED_OPEN_USER_DETAIL: boolean = false;
|
|
29
29
|
// @Output() onCloseUserDetailsSidebar = new EventEmitter();
|
|
30
30
|
|
|
@@ -61,9 +61,11 @@ export class SidebarUserDetailsComponent implements OnInit, OnChanges {
|
|
|
61
61
|
selectedProjectForStatus: ProjectUser | null = null;
|
|
62
62
|
public openDropdownProjects: boolean = false
|
|
63
63
|
public openStatusDropdownProjectId: string | null = null
|
|
64
|
-
statusDropdownPosition = { top: 0,
|
|
64
|
+
statusDropdownPosition = { top: 0, left: 0 };
|
|
65
65
|
isVisibleMT = false;
|
|
66
66
|
isVisibleMPA = false;
|
|
67
|
+
private userDetailsMutationObserver: MutationObserver | null = null;
|
|
68
|
+
private statusDropdownCloseTimeout: any = null;
|
|
67
69
|
|
|
68
70
|
translationsMap: Map<string, string> = new Map();
|
|
69
71
|
|
|
@@ -91,10 +93,45 @@ export class SidebarUserDetailsComponent implements OnInit, OnChanges {
|
|
|
91
93
|
this.listenToCurrentStoredProject();
|
|
92
94
|
this.listenToUserGoOnline();
|
|
93
95
|
this.getOSCODE();
|
|
96
|
+
this.setupUserDetailsCloseObserver();
|
|
94
97
|
}
|
|
95
98
|
|
|
96
99
|
ngOnChanges() { }
|
|
97
100
|
|
|
101
|
+
ngOnDestroy(): void {
|
|
102
|
+
this.userDetailsMutationObserver?.disconnect();
|
|
103
|
+
this.userDetailsMutationObserver = null;
|
|
104
|
+
this.cancelStatusDropdownClose();
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Osserva la rimozione della classe 'active' da #user-details (es. chiusura via click avatar nel sidebar)
|
|
109
|
+
* per chiudere i dropdown aperti
|
|
110
|
+
*/
|
|
111
|
+
private setupUserDetailsCloseObserver(): void {
|
|
112
|
+
setTimeout(() => {
|
|
113
|
+
const el = document.getElementById('user-details');
|
|
114
|
+
if (!el) return;
|
|
115
|
+
this.userDetailsMutationObserver = new MutationObserver((mutations) => {
|
|
116
|
+
mutations.forEach((mutation) => {
|
|
117
|
+
if (mutation.type === 'attributes' && mutation.attributeName === 'class') {
|
|
118
|
+
const target = mutation.target as HTMLElement;
|
|
119
|
+
if (!target.classList.contains('active')) {
|
|
120
|
+
this.closeDropdowns();
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
});
|
|
125
|
+
this.userDetailsMutationObserver.observe(el, { attributes: true, attributeFilter: ['class'] });
|
|
126
|
+
}, 0);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
private closeDropdowns(): void {
|
|
130
|
+
this.openDropdownProjects = false;
|
|
131
|
+
this.openStatusDropdownProjectId = null;
|
|
132
|
+
this.selectedProjectForStatus = null;
|
|
133
|
+
}
|
|
134
|
+
|
|
98
135
|
subcribeToAuthStateChanged() {
|
|
99
136
|
this.messagingAuthService.BSAuthStateChanged.subscribe((state) => {
|
|
100
137
|
this.logger.log('[SIDEBAR-USER-DETAILS] BSAuthStateChanged ', state)
|
|
@@ -310,7 +347,8 @@ export class SidebarUserDetailsComponent implements OnInit, OnChanges {
|
|
|
310
347
|
name: projectObjct['id_project']['name'],
|
|
311
348
|
profile: projectObjct['id_project']['profile'],
|
|
312
349
|
isActiveSubscription: projectObjct['id_project']['isActiveSubscription'],
|
|
313
|
-
trialExpired: projectObjct['id_project']['trialExpired']
|
|
350
|
+
trialExpired: projectObjct['id_project']['trialExpired'],
|
|
351
|
+
teammateStatus: getUserStatusFromProjectUser(projectObjct as any)
|
|
314
352
|
}
|
|
315
353
|
if (this.project.profile.type === 'free') {
|
|
316
354
|
|
|
@@ -415,23 +453,32 @@ export class SidebarUserDetailsComponent implements OnInit, OnChanges {
|
|
|
415
453
|
}
|
|
416
454
|
}
|
|
417
455
|
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
const
|
|
422
|
-
const
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
456
|
+
openStatusDropdownOnHover(event: Event, prjct: any) {
|
|
457
|
+
this.cancelStatusDropdownClose();
|
|
458
|
+
const projectId = prjct?.id_project?._id;
|
|
459
|
+
const el = event.currentTarget as HTMLElement;
|
|
460
|
+
const rect = el.getBoundingClientRect();
|
|
461
|
+
this.statusDropdownPosition = {
|
|
462
|
+
top: rect.top,
|
|
463
|
+
left: rect.right + 10
|
|
464
|
+
};
|
|
465
|
+
this.selectedProjectForStatus = prjct;
|
|
466
|
+
this.openStatusDropdownProjectId = projectId;
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
closeStatusDropdownOnLeave() {
|
|
470
|
+
this.cancelStatusDropdownClose();
|
|
471
|
+
this.statusDropdownCloseTimeout = setTimeout(() => {
|
|
472
|
+
this.closeDropdowns();
|
|
473
|
+
this.statusDropdownCloseTimeout = null;
|
|
474
|
+
}, 150);
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
cancelStatusDropdownClose() {
|
|
478
|
+
if (this.statusDropdownCloseTimeout) {
|
|
479
|
+
clearTimeout(this.statusDropdownCloseTimeout);
|
|
480
|
+
this.statusDropdownCloseTimeout = null;
|
|
433
481
|
}
|
|
434
|
-
this.openStatusDropdownProjectId = this.openStatusDropdownProjectId === projectId ? null : projectId
|
|
435
482
|
}
|
|
436
483
|
|
|
437
484
|
onChangeProjectStatus(projectUser: ProjectUser, selectedStatusID: any) {
|
|
@@ -455,6 +502,9 @@ export class SidebarUserDetailsComponent implements OnInit, OnChanges {
|
|
|
455
502
|
this.logger.log('[NAVBAR] - PROJECT-USER UPDATED ', projectUser)
|
|
456
503
|
this.projects.find(p => p.id_project._id === projectUser.id_project._id).teammateStatus = getUserStatusFromProjectUser(projectUserUpdated as any);
|
|
457
504
|
|
|
505
|
+
if(projectUser.id_project._id === this.project._id) {
|
|
506
|
+
this.project.teammateStatus = getUserStatusFromProjectUser(projectUserUpdated as any);
|
|
507
|
+
}
|
|
458
508
|
}, (error) => {
|
|
459
509
|
this.logger.error('[NAVBAR] - PROJECT-USER UPDATED - ERROR ', error);
|
|
460
510
|
|
|
@@ -147,6 +147,7 @@ export class ConversationListPage implements OnInit {
|
|
|
147
147
|
public wsService: WebsocketService,
|
|
148
148
|
public g: Globals,
|
|
149
149
|
public appStorageService: AppStorageService,
|
|
150
|
+
private triggerEvents: TriggerEvents,
|
|
150
151
|
) {
|
|
151
152
|
this.checkPlatform();
|
|
152
153
|
this.translations();
|
|
@@ -837,6 +838,7 @@ export class ConversationListPage implements OnInit {
|
|
|
837
838
|
this.logger.log('[CONVS-LIST-PAGE] onConversationSelected active conversation.uid ', conversation.uid)
|
|
838
839
|
this.events.publish('convList:onConversationSelected', conversation)
|
|
839
840
|
}
|
|
841
|
+
this.triggerEvents.triggerOnConversationChanged(conversation)
|
|
840
842
|
}
|
|
841
843
|
|
|
842
844
|
onImageLoaded(conversation: any) {
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Pipe, PipeTransform } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
@Pipe({
|
|
4
|
+
name: 'filter'
|
|
5
|
+
})
|
|
6
|
+
export class FilterPipe implements PipeTransform {
|
|
7
|
+
|
|
8
|
+
transform(items: any[], filter: Object): any {
|
|
9
|
+
if (!items || !filter) {
|
|
10
|
+
return items;
|
|
11
|
+
}
|
|
12
|
+
return items.filter(item => item[filter['key']] === filter['value']);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Pipe, PipeTransform } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
@Pipe({
|
|
4
|
+
name: 'find'
|
|
5
|
+
})
|
|
6
|
+
export class FindPipe implements PipeTransform {
|
|
7
|
+
|
|
8
|
+
transform(items: any[], filter: Object): any {
|
|
9
|
+
if (!items || !filter) {
|
|
10
|
+
return items;
|
|
11
|
+
}
|
|
12
|
+
return items.find(item => item[filter['key']] === filter['value']);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
}
|
|
@@ -131,4 +131,16 @@ export class TriggerEvents {
|
|
|
131
131
|
}
|
|
132
132
|
|
|
133
133
|
|
|
134
|
+
public triggerOnConversationChanged(conversation: ConversationModel) {
|
|
135
|
+
this.logger.debug(' ---------------- triggerOnConversationChanged ---------------- ', conversation);
|
|
136
|
+
try {
|
|
137
|
+
const windowContext = this.windowContext;
|
|
138
|
+
if (windowContext) {
|
|
139
|
+
windowContext.postMessage({ type: 'onConversationChanged', data: conversation }, '*');
|
|
140
|
+
}
|
|
141
|
+
} catch (e) {
|
|
142
|
+
this.logger.error('[TRIGGER-HANDLER] > Error triggerOnConversationChanged:' + e);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
134
146
|
}
|
|
@@ -26,6 +26,8 @@ import { TranslateLoader, TranslateModule } from '@ngx-translate/core';
|
|
|
26
26
|
import { createTranslateLoader } from 'src/chat21-core/utils/utils';
|
|
27
27
|
import { HttpClient } from '@angular/common/http';
|
|
28
28
|
import { RouterModule } from '@angular/router';
|
|
29
|
+
import { FindPipe } from '../pipe/find.pipe';
|
|
30
|
+
import { FilterPipe } from '../pipe/filter.pipe';
|
|
29
31
|
|
|
30
32
|
@NgModule({
|
|
31
33
|
declarations: [
|
|
@@ -68,12 +70,13 @@ import { RouterModule } from '@angular/router';
|
|
|
68
70
|
SidebarUserDetailsComponent,
|
|
69
71
|
|
|
70
72
|
//DIRECTIVES
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
73
|
+
AutofocusDirective,
|
|
74
|
+
TooltipDirective,
|
|
75
|
+
MarkedPipe,
|
|
76
|
+
HtmlEntitiesEncodePipe,
|
|
77
|
+
SafeHtmlPipe,
|
|
78
|
+
FindPipe,
|
|
79
|
+
FilterPipe,
|
|
77
80
|
|
|
78
81
|
|
|
79
82
|
AvatarProfileComponent,
|
|
@@ -124,6 +127,8 @@ import { RouterModule } from '@angular/router';
|
|
|
124
127
|
MarkedPipe,
|
|
125
128
|
HtmlEntitiesEncodePipe,
|
|
126
129
|
SafeHtmlPipe,
|
|
130
|
+
FindPipe,
|
|
131
|
+
FilterPipe,
|
|
127
132
|
|
|
128
133
|
RouterModule,
|
|
129
134
|
|
|
@@ -153,6 +153,6 @@ export const TEAMMATE_STATUS = [
|
|
|
153
153
|
{ id: 1, name: 'Available', avatar: 'assets/img/teammate-status/avaible.svg', label: "LABEL_AVAILABLE" },
|
|
154
154
|
{ id: 2, name: 'Unavailable', avatar: 'assets/img/teammate-status/unavaible.svg', label: "LABEL_NOT_AVAILABLE" },
|
|
155
155
|
{ id: 3, name: 'Inactive', avatar: 'assets/img/teammate-status/inactive.svg', label: "LABEL_INACTIVE" },
|
|
156
|
-
|
|
156
|
+
];
|
|
157
157
|
|
|
158
158
|
|