@chat21/chat21-ionic 3.4.32-rc7 → 3.4.32-rc8

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 CHANGED
@@ -8,6 +8,16 @@
8
8
  ### **Copyrigth**:
9
9
  *Tiledesk SRL*
10
10
 
11
+ # 3.4.32-rc8
12
+ - **bug-fixed**: sidebar-user-details — status dropdown not visible when clicking first/last project; moved outside #user-details container to avoid overflow clipping.
13
+ - **bug-fixed**: sidebar-user-details — replaced `transform` on #user-details with `left` animation to fix `position: fixed` containing block (dropdown positioning).
14
+ - **changed**: sidebar-user-details — projects_dropdown_container and status-dropdown now use same colors as ng-select teammate-status-in-drawer.
15
+ - **changed**: sidebar-user-details — projects-dropdown-wrapper styled to match ng-select container.
16
+ - **added**: sidebar-user-details — MPA feature flag in featuresToken: if MPA is true show projects_dropdown_container, else show availability_dropdown_container.
17
+ - **bug-fixed**: RouterModule.forRoot() called twice when clicking conversation — SharedModule now imports RouterModule.forChild([]) instead of AppRoutingModule.
18
+ - **changed**: FindPipe and FilterPipe moved from AppModule to SharedModule for app-wide availability.
19
+ - **added**: conversations-list — postMessage to hosting app on conversation selection (event: `onConversationChanged`, data: full conversation object).
20
+
11
21
  # 3.4.32-rc7
12
22
  - **addded**: ability to change availability status for each project the logged-in user in sidebar-user-detail
13
23
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@chat21/chat21-ionic",
3
3
  "author": "Tiledesk SRL",
4
- "version": "3.4.32-rc7",
4
+ "version": "3.4.32-rc8",
5
5
  "license": "MIT License",
6
6
  "homepage": "https://tiledesk.com/",
7
7
  "repository": {
@@ -80,21 +80,24 @@
80
80
  bindLabel="name" bindValue="id"
81
81
  [clearable]="false"
82
82
  [searchable]="false">
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>
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">{{ project?.name || 'Progetti' }}</span>
97
+ <span class="projects-dropdown-toggle-label">
98
+ {{ project?.name || 'Progetti' }}
99
+ <img 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
103
  <div class="ripple-container"></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;
@@ -228,6 +232,7 @@
228
232
  text-align: left;
229
233
  font-size: 14px;
230
234
  line-height: 1.4;
235
+ width: 250px;
231
236
 
232
237
  .projects-dropdown-toggle {
233
238
  background-color: transparent !important;
@@ -245,6 +250,9 @@
245
250
  overflow: hidden;
246
251
  text-overflow: ellipsis;
247
252
  white-space: nowrap;
253
+ display: flex;
254
+ align-items: center;
255
+ gap: 8px;
248
256
  }
249
257
 
250
258
  .dropdown-menu {
@@ -310,7 +310,8 @@ export class SidebarUserDetailsComponent implements OnInit, OnChanges {
310
310
  name: projectObjct['id_project']['name'],
311
311
  profile: projectObjct['id_project']['profile'],
312
312
  isActiveSubscription: projectObjct['id_project']['isActiveSubscription'],
313
- trialExpired: projectObjct['id_project']['trialExpired']
313
+ trialExpired: projectObjct['id_project']['trialExpired'],
314
+ teammateStatus: getUserStatusFromProjectUser(projectObjct as any)
314
315
  }
315
316
  if (this.project.profile.type === 'free') {
316
317
 
@@ -455,6 +456,9 @@ export class SidebarUserDetailsComponent implements OnInit, OnChanges {
455
456
  this.logger.log('[NAVBAR] - PROJECT-USER UPDATED ', projectUser)
456
457
  this.projects.find(p => p.id_project._id === projectUser.id_project._id).teammateStatus = getUserStatusFromProjectUser(projectUserUpdated as any);
457
458
 
459
+ if(projectUser.id_project._id === this.project._id) {
460
+ this.project.teammateStatus = getUserStatusFromProjectUser(projectUserUpdated as any);
461
+ }
458
462
  }, (error) => {
459
463
  this.logger.error('[NAVBAR] - PROJECT-USER UPDATED - ERROR ', error);
460
464
 
@@ -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,8 @@
1
+ import { FilterPipe } from './filter.pipe';
2
+
3
+ describe('FilterPipe', () => {
4
+ it('create an instance', () => {
5
+ const pipe = new FilterPipe();
6
+ expect(pipe).toBeTruthy();
7
+ });
8
+ });
@@ -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,8 @@
1
+ import { FindPipe } from './find.pipe';
2
+
3
+ describe('FindPipe', () => {
4
+ it('create an instance', () => {
5
+ const pipe = new FindPipe();
6
+ expect(pipe).toBeTruthy();
7
+ });
8
+ });
@@ -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
- AutofocusDirective,
72
- TooltipDirective,
73
- MarkedPipe,
74
- HtmlEntitiesEncodePipe,
75
- SafeHtmlPipe,
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
 
@@ -20,6 +20,7 @@ export interface Project {
20
20
  isActiveSubscription?: boolean;
21
21
  profile?: any;
22
22
  offlineMsgEmail?: boolean;
23
+ teammateStatus?: any;
23
24
  // subscription_end_date?: any;
24
25
  // subscription_id?: any;
25
26
  // subscription_creation_date?: any;
@@ -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