@chat21/chat21-ionic 3.0.52-beta → 3.0.55-RC6

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.
Files changed (54) hide show
  1. package/CHANGELOG.md +55 -0
  2. package/LICENSE +21 -0
  3. package/config.xml +1 -0
  4. package/env.sample +1 -0
  5. package/package.json +6 -2
  6. package/resources/Android/icon/drawable-hdpi-icon.png +0 -0
  7. package/resources/Android/icon/drawable-ldpi-icon.png +0 -0
  8. package/resources/Android/icon/drawable-mdpi-icon.png +0 -0
  9. package/resources/Android/icon/drawable-xhdpi-icon.png +0 -0
  10. package/resources/Android/icon/drawable-xxhdpi-icon.png +0 -0
  11. package/resources/Android/icon/drawable-xxxhdpi-icon.png +0 -0
  12. package/resources/Android/icon.png +0 -0
  13. package/resources/Android/splash/drawable-land-hdpi-screen.png +0 -0
  14. package/resources/Android/splash/drawable-land-ldpi-screen.png +0 -0
  15. package/resources/Android/splash/drawable-land-mdpi-screen.png +0 -0
  16. package/resources/Android/splash/drawable-land-xhdpi-screen.png +0 -0
  17. package/resources/Android/splash/drawable-land-xxhdpi-screen.png +0 -0
  18. package/resources/Android/splash/drawable-land-xxxhdpi-screen.png +0 -0
  19. package/resources/Android/splash/drawable-port-hdpi-screen.png +0 -0
  20. package/resources/Android/splash/drawable-port-ldpi-screen.png +0 -0
  21. package/resources/Android/splash/drawable-port-mdpi-screen.png +0 -0
  22. package/resources/Android/splash/drawable-port-xhdpi-screen.png +0 -0
  23. package/resources/Android/splash/drawable-port-xxhdpi-screen.png +0 -0
  24. package/resources/Android/splash/drawable-port-xxxhdpi-screen.png +0 -0
  25. package/resources/Android/splash.png +0 -0
  26. package/src/app/app.component.ts +509 -434
  27. package/src/app/app.module.ts +10 -5
  28. package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.scss +4 -0
  29. package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.html +27 -30
  30. package/src/app/chatlib/conversation-detail/message/text/text.component.html +1 -1
  31. package/src/app/chatlib/conversation-detail/message/text/text.component.ts +27 -3
  32. package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.html +18 -5
  33. package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.scss +15 -3
  34. package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.ts +24 -6
  35. package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.html +4 -0
  36. package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.ts +17 -4
  37. package/src/app/components/conversation-detail/message-text-area/message-text-area.component.ts +20 -16
  38. package/src/app/components/conversation-info/info-content/info-content.component.ts +8 -1
  39. package/src/app/pages/conversation-detail/conversation-detail.page.html +37 -16
  40. package/src/app/pages/conversation-detail/conversation-detail.page.ts +143 -53
  41. package/src/app/pages/conversations-list/conversations-list.page.html +5 -2
  42. package/src/app/pages/conversations-list/conversations-list.page.ts +19 -14
  43. package/src/chat-config-pre-test.json +4 -2
  44. package/src/chat-config-template.json +2 -1
  45. package/src/chat-config.json +2 -1
  46. package/src/chat21-core/providers/abstract/messagingAuth.service.ts +1 -1
  47. package/src/chat21-core/providers/abstract/notifications.service.ts +2 -2
  48. package/src/chat21-core/providers/firebase/firebase-archivedconversations-handler.ts +6 -4
  49. package/src/chat21-core/providers/firebase/firebase-auth-service.ts +84 -17
  50. package/src/chat21-core/providers/firebase/firebase-conversations-handler.ts +15 -10
  51. package/src/chat21-core/providers/firebase/firebase-notifications.ts +119 -18
  52. package/src/chat21-core/providers/localSessionStorage.ts +2 -1
  53. package/src/chat21-core/utils/utils-user.ts +2 -1
  54. package/src/index.html +87 -6
@@ -92,7 +92,8 @@ import { ConversationInfoModule } from 'src/app/components/conversation-info/con
92
92
  // Directives
93
93
  import { TooltipModule } from 'ng2-tooltip-directive';
94
94
  import { LoggerInstance } from 'src/chat21-core/providers/logger/loggerInstance';
95
-
95
+ import { Network } from '@ionic-native/network/ngx';
96
+ import { ConnectionService } from 'ng-connection-service';
96
97
 
97
98
 
98
99
  // FACTORIES
@@ -101,7 +102,7 @@ export function createTranslateLoader(http: HttpClient) {
101
102
 
102
103
  }
103
104
 
104
- export function authenticationFactory(http: HttpClient, appConfig: AppConfigProvider, chat21Service: Chat21Service, appSorage: AppStorageService) {
105
+ export function authenticationFactory(http: HttpClient, appConfig: AppConfigProvider, chat21Service: Chat21Service, appSorage: AppStorageService, network: Network, connectionService:ConnectionService) {
105
106
  const config = appConfig.getConfig()
106
107
  if (config.chatEngine === CHAT_ENGINE_MQTT) {
107
108
 
@@ -111,12 +112,15 @@ export function authenticationFactory(http: HttpClient, appConfig: AppConfigProv
111
112
  const auth = new MQTTAuthService(http, chat21Service, appSorage);
112
113
 
113
114
  auth.setBaseUrl(appConfig.getConfig().apiUrl)
115
+
114
116
  return auth
115
117
  } else {
116
118
 
117
119
  FirebaseInitService.initFirebase(config.firebaseConfig)
118
- const auth = new FirebaseAuthService(http);
120
+ console.log('[APP-MOD] FirebaseInitService config ', config)
121
+ const auth = new FirebaseAuthService(http, network, connectionService);
119
122
  auth.setBaseUrl(config.apiUrl)
123
+
120
124
  return auth
121
125
  }
122
126
  }
@@ -262,7 +266,7 @@ const appInitializerFn = (appConfig: AppConfigProvider, logger: NGXLogger) => {
262
266
  timestampFormat: 'HH:mm:ss.SSS',
263
267
  enableSourceMaps: false,
264
268
  colorScheme: ['purple', 'yellow', 'gray', 'gray', 'red', 'red', 'red'],
265
- serverLoggingUrl: 'http://tiledesk-server-pre.herokuapp.com/logs'
269
+ serverLoggingUrl: 'https://tiledesk-server-pre.herokuapp.com/logs'
266
270
  }),
267
271
  ScrollbarThemeModule,
268
272
  SharedModule,
@@ -283,7 +287,7 @@ const appInitializerFn = (appConfig: AppConfigProvider, logger: NGXLogger) => {
283
287
  {
284
288
  provide: MessagingAuthService,
285
289
  useFactory: authenticationFactory,
286
- deps: [HttpClient, AppConfigProvider, Chat21Service, AppStorageService]
290
+ deps: [HttpClient, AppConfigProvider, Chat21Service, AppStorageService, Network, ConnectionService]
287
291
  },
288
292
  {
289
293
  provide: PresenceService,
@@ -343,6 +347,7 @@ const appInitializerFn = (appConfig: AppConfigProvider, logger: NGXLogger) => {
343
347
  StatusBar,
344
348
  SplashScreen,
345
349
  Keyboard,
350
+ Network,
346
351
  { provide: RouteReuseStrategy, useClass: IonicRouteStrategy },
347
352
  EventsService,
348
353
  Chooser,
@@ -1,9 +1,13 @@
1
1
  :host .base_sent .msg_sent ::ng-deep div > div > div > tiledeskwidget-text > p > p > a {
2
2
  color: lightblue;
3
+
3
4
  }
4
5
 
5
6
  :host .base_sent .msg_sent ::ng-deep div > div > div > tiledeskwidget-text > p > p {
6
7
  margin-top:12px !important;
8
+ white-space: nowrap;
9
+ overflow: hidden;
10
+ text-overflow: ellipsis;
7
11
  }
8
12
 
9
13
  :host .base_sent .msg_sent ::ng-deep > div > div > tiledeskwidget-image > div {
@@ -1,7 +1,8 @@
1
1
  <!-- [ngClass]="{'button-in-msg' : message.metadata && message.metadata.button}" -->
2
- <div [ngStyle]="{'padding': (isImage(message) || isFrame(message))?'0px':'0 8px'}" class="messages primary-color" [class.emoticon]="message?.emoticon">
3
-
4
-
2
+ <div [ngStyle]="{'padding': (isImage(message) || isFrame(message))?'0px':'0 8px'}" class="messages primary-color"
3
+ [class.emoticon]="message?.emoticon">
4
+
5
+
5
6
  <div>
6
7
  <!-- message type:: image -->
7
8
  <!-- <div *ngIf="message.type == 'image' && message.metadata" [ngStyle] = "{ 'max-width': getSizeImg(message).width, 'max-height': getSizeImg(message).height }">
@@ -12,16 +13,16 @@
12
13
  [src]="message.metadata.src" [width]="getSizeImg(message).width"
13
14
  [height]="getSizeImg(message).height" /> -->
14
15
 
15
- <tiledeskwidget-image *ngIf="isImage(message)"
16
+ <tiledeskwidget-image *ngIf="isImage(message)"
16
17
  [metadata]="message.metadata"
17
- [width]="getMetadataSize(message.metadata).width"
18
+ [width]="getMetadataSize(message.metadata).width"
18
19
  [height]="getMetadataSize(message.metadata).height"
19
20
  (onImageRendered)="onImageRenderedFN($event)">
20
21
  </tiledeskwidget-image>
21
22
 
22
- <tiledeskwidget-frame *ngIf="isFrame(message)"
23
+ <tiledeskwidget-frame *ngIf="isFrame(message)"
23
24
  [metadata]="message.metadata"
24
- [width]="getMetadataSize(message.metadata).width"
25
+ [width]="getMetadataSize(message.metadata).width"
25
26
  [height]="getMetadataSize(message.metadata).height">
26
27
  </tiledeskwidget-frame>
27
28
 
@@ -30,22 +31,24 @@
30
31
  [width]="message.metadata.width"
31
32
  [height]="message.metadata.height">
32
33
  </tiledeskwidget-frame> -->
33
-
34
- <!-- message type:: text -->
35
- <!-- <div *ngIf="message.type == 'text'"> -->
36
- <div *ngIf="message?.text" [tooltip]="timeTooltipLeft" [options]="tooltipOptions" placement="left" content-type="template" (click)="handleTooltipEvents($event)">
37
- <ng-template #timeTooltipLeft>
38
- <span>{{message.timestamp | amTimeAgo}}</span>
39
- </ng-template>
40
34
 
41
- <tiledeskwidget-text
42
- [text]="message?.text"
43
- [color]="textColor"
44
- (onBeforeMessageRender)="returnOnBeforeMessageRender($event)"
45
- (onAfterMessageRender)="returnOnAfterMessageRender($event)">
46
- </tiledeskwidget-text>
47
- <!-- <p #messageEl class="message_innerhtml marked" [innerHTML]="printMessage(message, messageEl, this) | marked"></p> -->
48
- <!-- <div *ngIf="isPopupUrl(message.text); then contentPopup else contentNewTab">here
35
+ <!-- message type:: text -->
36
+ <!-- <div *ngIf="message.type == 'text'"> -->
37
+ <div *ngIf="message?.text" [tooltip]="timeTooltipLeft" [options]="tooltipOptions" placement="left"
38
+ content-type="template" (click)="handleTooltipEvents($event)">
39
+ <ng-template #timeTooltipLeft>
40
+ <span>{{message.timestamp | amTimeAgo}}</span>
41
+ </ng-template>
42
+
43
+ <tiledeskwidget-text
44
+ [text]="message?.text"
45
+ [color]="textColor"
46
+ [message]="message"
47
+ (onBeforeMessageRender)="returnOnBeforeMessageRender($event)"
48
+ (onAfterMessageRender)="returnOnAfterMessageRender($event)">
49
+ </tiledeskwidget-text>
50
+ <!-- <p #messageEl class="message_innerhtml marked" [innerHTML]="printMessage(message, messageEl, this) | marked"></p> -->
51
+ <!-- <div *ngIf="isPopupUrl(message.text); then contentPopup else contentNewTab">here
49
52
  is ignored</div>
50
53
  <ng-template #contentPopup>
51
54
  <p style="text-decoration: underline; padding:8px; cursor: pointer;"
@@ -54,13 +57,7 @@
54
57
  <ng-template #contentNewTab>
55
58
  <p #messageEl [innerHTML]="printMessage(message, messageEl, this) | linky"></p>
56
59
  </ng-template> -->
57
- </div>
60
+ </div>
58
61
  </div>
59
62
 
60
- </div>
61
-
62
-
63
-
64
-
65
-
66
-
63
+ </div>
@@ -1,4 +1,4 @@
1
- <p #messageEl class="message_innerhtml marked"
1
+ <p [ngStyle] = "{ 'width': media_width +'px' }" #messageEl class="message_innerhtml marked"
2
2
  [innerHTML]="printMessage(text, messageEl, this) | htmlEntiesEncode | marked"
3
3
  [ngStyle]="{'color': '$'+ color }">
4
4
  </p>
@@ -1,5 +1,5 @@
1
1
  import { Component, EventEmitter, Input, OnChanges, OnInit, Output, Sanitizer } from '@angular/core';
2
-
2
+ import { MAX_WIDTH_IMAGES } from 'src/chat21-core/utils/constants';
3
3
  @Component({
4
4
  selector: 'tiledeskwidget-text',
5
5
  templateUrl: './text.component.html',
@@ -11,7 +11,12 @@ export class TextComponent implements OnInit {
11
11
  @Input() color: string;
12
12
  @Output() onBeforeMessageRender = new EventEmitter();
13
13
  @Output() onAfterMessageRender = new EventEmitter();
14
-
14
+
15
+ @Input() message: any;
16
+
17
+ public media_width: number;
18
+ public media_height: number;
19
+
15
20
  constructor() { }
16
21
 
17
22
  ngOnInit() {
@@ -19,7 +24,7 @@ export class TextComponent implements OnInit {
19
24
 
20
25
 
21
26
  printMessage(text, messageEl, component) {
22
- const messageOBJ = { messageEl: messageEl, component: component}
27
+ const messageOBJ = { messageEl: messageEl, component: component }
23
28
  this.onBeforeMessageRender.emit(messageOBJ)
24
29
  const messageText = text;
25
30
  this.onAfterMessageRender.emit(messageOBJ)
@@ -29,4 +34,23 @@ export class TextComponent implements OnInit {
29
34
  return messageText;
30
35
  }
31
36
 
37
+ ngOnChanges() {
38
+ if (this.message.type === 'image') {
39
+ console.log('TextComponent message ', this.message)
40
+ if (this.message.metadata.width && this.message.metadata.width > MAX_WIDTH_IMAGES) {
41
+
42
+ const ratio = (this.message.metadata['width'] / this.message.metadata['height']);
43
+
44
+ this.media_width = MAX_WIDTH_IMAGES;
45
+ this.media_height = MAX_WIDTH_IMAGES / ratio;
46
+
47
+ console.log('TextComponent media_width ', this.media_width, ' media_height' , this.media_height)
48
+ } else {
49
+ this.media_width = this.message.metadata.width;
50
+ this.media_height = this.message.metadata.height;
51
+ console.log('TextComponent media_width ', this.media_width, ' media_height' , this.media_height)
52
+ }
53
+ }
54
+ }
55
+
32
56
  }
@@ -23,10 +23,12 @@
23
23
  </div> -->
24
24
 
25
25
 
26
- <ion-item button="true" lines="none" class="ion-no-padding" *ngFor="let conversation of listConversations"
26
+ <ion-item button="true" lines="none" class="ion-no-padding" [class.ion-selected]="conversation.uid === uidConvSelected" *ngFor="let conversation of listConversations"
27
27
  (click)="openConversationByID(conversation)">
28
28
  <!-- (mouseup)="openMessageList()" -->
29
- <div [class.selected]="conversation.uid === uidConvSelected"></div>
29
+
30
+
31
+ <!-- <div [class.selected]="conversation.uid === uidConvSelected"></div> -->
30
32
  <ion-avatar item-start>
31
33
  <div #avatarPlaceholder class="avatar-placeholder" [style.background-color]="conversation.color"
32
34
  [innerHTML]="conversation.avatar"></div>
@@ -57,7 +59,8 @@
57
59
  </span>
58
60
  </div>
59
61
  </ion-label>
60
- <ion-note *ngIf="!conversation.archived" class="conversation_time">{{conversation.time_last_message}}</ion-note>
62
+
63
+ <ion-note *ngIf="!conversation.archived" class="conversation_time">{{conversation.timestamp | amTimeAgo}}</ion-note>
61
64
 
62
65
  <ion-buttons slot="end">
63
66
  <ion-button *ngIf="!conversation.archived" [ngClass]="{'hide': !isApp, 'button-on-desktop': !isApp }"
@@ -74,11 +77,21 @@
74
77
  </ion-buttons>
75
78
 
76
79
  <div item-end *ngIf="conversation?.archived" class="achived-icon-wpr">
77
- <i class="material-icons" item-end style="font-size: 18px;font-weight: 400;color: #aaa;"> history </i>
80
+ <span *ngIf="(conversation.timestamp | amDateFormat:'YYYY') === currentYear" class="time-in-archived">
81
+ {{browserLang === 'it' ? (conversation.timestamp| amDateFormat:'DD MMM') : (conversation.timestamp | amDateFormat:'MMM DD')}}
82
+
83
+ <!-- {{conversation.timestamp | amDateFormat:'DD MMM'}} -->
84
+ </span>
85
+ <span *ngIf="(conversation.timestamp | amDateFormat:'YYYY') !== currentYear" class="time-in-archived">
86
+ {{browserLang === 'it' ? (conversation.timestamp| amDateFormat:'DD MMM') : (conversation.timestamp | amDateFormat:'MMM DD YYYY')}}
87
+ <!-- {{conversation.timestamp | amDateFormat:'DD MMM YYYY'}} -->
88
+ </span>
89
+ <i class="material-icons" item-end style="font-size: 15px;font-weight: 400;color: #666666;"> history </i>
78
90
  </div>
79
91
 
92
+ <!-- && !conversation?.archived -->
80
93
  <div item-end class="notification_point"
81
- [ngClass]="{'notification_point-on-desktop': !isApp && !conversation?.archived}" *ngIf="conversation.is_new">
94
+ [ngClass]="{'notification_point-on-desktop': !isApp }" *ngIf="conversation.is_new">
82
95
  </div>
83
96
 
84
97
  </ion-item>
@@ -9,7 +9,8 @@
9
9
  }
10
10
  ion-item {
11
11
  cursor: pointer;
12
- height: 64px;
12
+ height: 70px;
13
+ --min-height: 70px;
13
14
  position: relative;
14
15
  display: flex;
15
16
  text-decoration: none;
@@ -139,7 +140,7 @@ ion-item {
139
140
  }
140
141
 
141
142
  .notification_point-on-desktop {
142
- bottom: 24px !important;
143
+ bottom: 29px !important;
143
144
  }
144
145
  }
145
146
 
@@ -177,7 +178,7 @@ ion-item:hover {
177
178
  .achived-icon-wpr {
178
179
  position: absolute;
179
180
  right: 3px;
180
- top: 11px;
181
+ top: 4px;
181
182
  font-size: 12px;
182
183
  }
183
184
 
@@ -197,4 +198,15 @@ ion-item:hover {
197
198
  padding-right: 0px;
198
199
  vertical-align: middle;
199
200
  color: #999999;
201
+ }
202
+
203
+ .ion-selected {
204
+ --background: rgb(231, 241, 255);
205
+ }
206
+
207
+ .time-in-archived {
208
+ color: #666666;
209
+ font-size: 10px;
210
+ position: relative;
211
+ top: -4px;
200
212
  }
@@ -6,7 +6,8 @@ import { ListConversationsComponent } from '../list-conversations/list-conversat
6
6
  import { Platform } from '@ionic/angular';
7
7
  import { LoggerService } from 'src/chat21-core/providers/abstract/logger.service';
8
8
  import { LoggerInstance } from 'src/chat21-core/providers/logger/loggerInstance';
9
-
9
+ import { TranslateService } from '@ngx-translate/core';
10
+ import * as moment from 'moment';
10
11
  // import { LoggerService } from 'src/chat21-core/providers/abstract/logger.service';
11
12
  // import { LoggerInstance } from 'src/chat21-core/providers/logger/loggerInstance';
12
13
 
@@ -22,7 +23,9 @@ export class IonListConversationsComponent extends ListConversationsComponent im
22
23
 
23
24
  convertMessage = convertMessage;
24
25
  isApp: boolean = false;
25
- public logger: LoggerService = LoggerInstance.getInstance()
26
+ public logger: LoggerService = LoggerInstance.getInstance();
27
+ public currentYear: any
28
+ public browserLang: string
26
29
  /**
27
30
  *
28
31
  * @param iterableDiffers
@@ -32,20 +35,35 @@ export class IonListConversationsComponent extends ListConversationsComponent im
32
35
  constructor(
33
36
  public iterableDiffers: IterableDiffers,
34
37
  public kvDiffers: KeyValueDiffers,
35
- public platform: Platform
38
+ public platform: Platform,
39
+ private translate: TranslateService,
36
40
  ) {
37
41
  super(iterableDiffers, kvDiffers)
42
+ this.browserLang = this.translate.getBrowserLang();
43
+ if (this.browserLang) {
44
+ if (this.browserLang === 'it') {
45
+ // this.translate.use('it');
46
+ moment.locale('it')
47
+
48
+ } else {
49
+ // this.translate.use('en');
50
+ moment.locale('en')
51
+ }
52
+ }
53
+
54
+ this.currentYear = moment().format('YYYY');
55
+ this.logger.log('[ION-LIST-CONVS-COMP] - currentYear ', this.currentYear)
38
56
  }
39
57
 
40
58
  ngOnInit() {
41
59
  this.isApp = this.platform.is('ios') || this.platform.is('android')
42
- this.logger.log('[ION-LIST-CONVS-COMP] - ngOnInit - IS-APP ',this.isApp )
60
+ this.logger.log('[ION-LIST-CONVS-COMP] - ngOnInit - IS-APP ', this.isApp)
43
61
  this.logger.log('[ION-LIST-CONVS-COMP] - ngOnInit - Platform', this.platform.platforms());
44
- }
62
+ }
45
63
 
46
64
  closeConversation(conversation: ConversationModel) {
47
65
  var conversationId = conversation.uid;
48
- this.logger.log('[ION-LIST-CONVS-COMP] - closeConversation - conversationId ',conversationId )
66
+ this.logger.log('[ION-LIST-CONVS-COMP] - closeConversation - conversationId ', conversationId)
49
67
  this.onCloseConversation.emit(conversation)
50
68
  }
51
69
 
@@ -44,6 +44,10 @@
44
44
  <span class="tile-username">{{ conversationAvatar.conversation_with_fullname }} </span>
45
45
  </div>
46
46
 
47
+ <!-- <div *ngIf="conversationWithFullname" class="tile-info-with" (click)="onOpenCloseInfoConversation()">
48
+ <span class="tile-username">{{ conversationWithFullname }} </span>
49
+ </div> -->
50
+
47
51
  </ion-title>
48
52
  <!-- openInfoConversation {{openInfoConversation}} -->
49
53
  <ion-buttons slot="end">
@@ -1,4 +1,5 @@
1
1
  import { Component, OnInit, Input, Output, EventEmitter, OnChanges } from '@angular/core';
2
+ import { ActivatedRoute } from '@angular/router';
2
3
  import { ImageRepoService } from 'src/chat21-core/providers/abstract/image-repo.service';
3
4
 
4
5
  // Logger
@@ -17,7 +18,7 @@ export class HeaderConversationDetailComponent implements OnInit, OnChanges {
17
18
  @Input() isMobile: boolean;
18
19
  @Input() translationMap: Map<string, string>;
19
20
  @Output() eventOpenCloseInfoConversation = new EventEmitter<boolean>();
20
-
21
+ conversationWithFullname: string
21
22
  openInfoConversation = true;
22
23
  openInfoMessage = true;
23
24
  DIRECT = 'direct';
@@ -35,9 +36,17 @@ export class HeaderConversationDetailComponent implements OnInit, OnChanges {
35
36
  * @param imageRepoService
36
37
  */
37
38
  constructor(
38
- public imageRepoService: ImageRepoService
39
-
40
- ) { }
39
+ public imageRepoService: ImageRepoService,
40
+ private route: ActivatedRoute,
41
+ ) {
42
+ // this.route.paramMap.subscribe(params => {
43
+
44
+
45
+ // this.conversationWithFullname = params.get('FullNameConv');
46
+ // this.logger.log('[CONVS-DETAIL][HEADER]- initialize -> params: ', params);
47
+ // this.logger.log('[CONVS-DETAIL][HEADER]- initialize -> params > : ', this.conversationWithFullname);
48
+ // });
49
+ }
41
50
 
42
51
  // ----------------------------------------------------
43
52
  // @ Lifehooks
@@ -64,6 +73,10 @@ export class HeaderConversationDetailComponent implements OnInit, OnChanges {
64
73
  // @ Initialize (called in ngOnInit)
65
74
  // ----------------------------------------------------
66
75
  initialize() {
76
+
77
+
78
+
79
+
67
80
  if (this.conversationAvatar && this.conversationAvatar.channelType === this.DIRECT) {
68
81
  this.isDirect = true;
69
82
  } else if (this.idLoggedUser) {
@@ -27,12 +27,12 @@ import { LoggerInstance } from 'src/chat21-core/providers/logger/loggerInstance'
27
27
  export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChanges {
28
28
 
29
29
  @ViewChild('textArea', { static: false }) messageTextArea: any
30
- // set textArea(element: ElementRef<HTMLInputElement>) {
31
- // if(element) {
32
- // this.logger.log("[CONVS-DETAIL][MSG-TEXT-AREA] ViewChild element ", element);
33
- // element.nativeElement.focus()
34
- // }
35
- // }
30
+ // set textArea(element: ElementRef<HTMLInputElement>) {
31
+ // if(element) {
32
+ // this.logger.log("[CONVS-DETAIL][MSG-TEXT-AREA] ViewChild element ", element);
33
+ // element.nativeElement.focus()
34
+ // }
35
+ // }
36
36
 
37
37
 
38
38
  @ViewChild('fileInput', { static: false }) fileInput: any;
@@ -88,9 +88,7 @@ export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChange
88
88
  // this.events.subscribe((cannedmessage) => {
89
89
  // this.logger.log("[CONVS-DETAIL] [MSG-TEXT-AREA] events.subscribe cannedmessage ", cannedmessage);
90
90
  // })
91
- this.LONG_TEXAREA_PLACEHOLDER = this.translationMap.get('LABEL_ENTER_MSG')
92
- this.SHORT_TEXAREA_PLACEHOLDER = this.translationMap.get('LABEL_ENTER_MSG_SHORT')
93
- this.SHORTER_TEXAREA_PLACEHOLDER = this.translationMap.get('LABEL_ENTER_MSG_SHORTER')
91
+
94
92
  // this.logger.log("[CONVS-DETAIL][MSG-TEXT-AREA] LONG_TEXAREA_PLACEHOLDER ", this.LONG_TEXAREA_PLACEHOLDER);
95
93
  // this.logger.log("[CONVS-DETAIL][MSG-TEXT-AREA] SHORT_TEXAREA_PLACEHOLDER ", this.SHORT_TEXAREA_PLACEHOLDER);
96
94
  // this.logger.log("[CONVS-DETAIL][MSG-TEXT-AREA] SHORTER_TEXAREA_PLACEHOLDER ", this.SHORTER_TEXAREA_PLACEHOLDER);
@@ -101,6 +99,12 @@ export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChange
101
99
 
102
100
 
103
101
  ngOnChanges() {
102
+ if (this.translationMap) {
103
+ this.LONG_TEXAREA_PLACEHOLDER = this.translationMap.get('LABEL_ENTER_MSG')
104
+ this.SHORT_TEXAREA_PLACEHOLDER = this.translationMap.get('LABEL_ENTER_MSG_SHORT')
105
+ this.SHORTER_TEXAREA_PLACEHOLDER = this.translationMap.get('LABEL_ENTER_MSG_SHORTER')
106
+ }
107
+
104
108
  // this.logger.log("[CONVS-DETAIL][MSG-TEXT-AREA] ngOnChanges this.isOpenInfoConversation ", this.isOpenInfoConversation);
105
109
  this.logger.log("[CONVS-DETAIL][MSG-TEXT-AREA] ngOnChanges DROP EVENT ", this.dropEvent);
106
110
 
@@ -116,9 +120,9 @@ export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChange
116
120
  }
117
121
 
118
122
  // ngAfterViewInit() {
119
- ngAfterViewInit() {
123
+ ngAfterViewInit() {
124
+
120
125
 
121
-
122
126
  // const element = this.renderer.selectRootElement('#textArea');
123
127
  // this.logger.log("[CONVS-DETAIL][MSG-TEXT-AREA] ngAfterViewInit element get with renderer ", element);
124
128
  // const elemTexarea= <HTMLElement>document.querySelector('#ion-textarea');
@@ -317,7 +321,7 @@ export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChange
317
321
  data.items.add(new File([file], file.name, { type: file.type }));
318
322
  this.logger.log("[CONVS-DETAIL][MSG-TEXT-AREA] onPaste data ", data);
319
323
  this.logger.log("[CONVS-DETAIL][MSG-TEXT-AREA] onPaste file ", file);
320
-
324
+
321
325
  this.presentModal(data);
322
326
 
323
327
  } else if (item.type.startsWith("application")) {
@@ -386,7 +390,7 @@ export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChange
386
390
  backdropDismiss: true
387
391
  });
388
392
  modal.onDidDismiss().then((detail: any) => {
389
-
393
+
390
394
  this.logger.log('presentModal onDidDismiss detail', detail);
391
395
  if (detail.data !== undefined) {
392
396
  let type = ''
@@ -438,9 +442,9 @@ export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChange
438
442
  this.logger.log('[CONVS-DETAIL][MSG-TEXT-AREA] FIREBASE-UPLOAD presentModal invio msg type::: ', type);
439
443
  this.logger.log('[CONVS-DETAIL][MSG-TEXT-AREA] FIREBASE-UPLOAD presentModal invio msg message::: ', messageString);
440
444
  // send message
441
- // if(messageString === undefined) {
442
- // messageString = metadata.name
443
- // }
445
+ // if(messageString === undefined) {
446
+ // messageString = metadata.name
447
+ // }
444
448
 
445
449
  that.eventSendMessage.emit({ message: messageString, type: type, metadata: metadata });
446
450
 
@@ -78,8 +78,15 @@ export class InfoContentComponent implements OnInit {
78
78
  this.logger.log('[INFO-CONTENT-COMP] - paramMap.subscribe conversationWith: ', this.conversationWith);
79
79
  this.conversationWithFullname = params.get('FullNameConv');
80
80
  this.conv_type = params.get('Convtype');
81
-
81
+
82
82
  const conversationWith_segments = this.conversationWith.split('-');
83
+
84
+ // Removes the last element of the array if is = to the separator
85
+ if (conversationWith_segments[conversationWith_segments.length - 1] === '') {
86
+ conversationWith_segments.pop();
87
+ }
88
+
89
+
83
90
  this.logger.log('[INFO-CONTENT-COMP] - paramMap.subscribe conversationWith_segments: ', conversationWith_segments);
84
91
 
85
92
  if (this.conversationWith.startsWith("support-group")) {
@@ -19,8 +19,11 @@
19
19
 
20
20
  <ng-template #showConversation>
21
21
 
22
- <app-header-conversation-detail [isMobile]=isMobile [idLoggedUser]=loggedUser.uid
23
- [conversationAvatar]=conversationAvatar [translationMap]=translationMap
22
+ <app-header-conversation-detail
23
+ [isMobile]="isMobile"
24
+ [idLoggedUser]="loggedUser.uid"
25
+ [conversationAvatar]="conversationAvatar"
26
+ [translationMap]="translationMap"
24
27
  (eventOpenCloseInfoConversation)="returnOpenCloseInfoConversation($event)"
25
28
  [isOpenInfoConversation]="isOpenInfoConversation">
26
29
  </app-header-conversation-detail>
@@ -79,10 +82,15 @@
79
82
  </ng-template>
80
83
 
81
84
  <ng-template #content_messages>
82
- <ion-content #ionContentChatArea class="ionContentChatArea" (drop)="drop($event)"
83
- (dragover)="allowDrop($event)" (dragleave)="drag($event)" [scrollEvents]="true"
84
- (ionScrollStart)="logScrollStart($event)" (ionScroll)="logScrolling($event)"
85
- (ionScrollEnd)="logScrollEnd($event)" [class.active]="showIonContent">
85
+ <ion-content #ionContentChatArea class="ionContentChatArea"
86
+ (drop)="drop($event)"
87
+ (dragover)="allowDrop($event)"
88
+ (dragleave)="drag($event)"
89
+ [scrollEvents]="true"
90
+ (ionScrollStart)="logScrollStart($event)"
91
+ (ionScroll)="logScrolling($event)"
92
+ (ionScrollEnd)="logScrollEnd($event)"
93
+ [class.active]="showIonContent">
86
94
 
87
95
  <!-- ----------------------------------------------------------- -->
88
96
  <!-- DROPZONE -->
@@ -100,15 +108,18 @@
100
108
 
101
109
 
102
110
  <ion-conversation-detail *ngIf="isHovering === false" #conversationContentDetail
103
- [channelType]="channelType" [messages]="messages" [senderId]="loggedUser.uid"
104
- [baseLocation]="window?.location?.origin" [stylesMap]="styleMap"
111
+ [channelType]="channelType"
112
+ [messages]="messages"
113
+ [senderId]="loggedUser.uid"
114
+ [baseLocation]="window?.location?.origin"
115
+ [stylesMap]="styleMap"
105
116
  (onBeforeMessageRender)="returnOnBeforeMessageRender($event)"
106
117
  (onAfterMessageRender)="returnOnAfterMessageRender($event)"
107
118
  (onAttachmentButtonClicked)="returnOnAttachmentButtonClicked($event)"
108
- (onScrollContent)="returnOnScrollContent($event)" (onMenuOptionShow)="returnOnMenuOption($event)"
119
+ (onScrollContent)="returnOnScrollContent($event)"
120
+ (onMenuOptionShow)="returnOnMenuOption($event)"
109
121
  (onImageRendered)="onImageRenderedFN($event)"
110
122
  (onAddUploadingBubble)="addUploadingBubbleEvent($event)">
111
-
112
123
  </ion-conversation-detail>
113
124
 
114
125
  </ion-content>
@@ -139,10 +150,16 @@
139
150
  <!-- openInfoConversation {{openInfoConversation}} - isMobile {{isMobile}} -->
140
151
  <app-message-text-area
141
152
  *ngIf="(openInfoConversation === false && isMobile === true) || (openInfoConversation === true && isMobile === false) || (openInfoConversation === false && isMobile === false)"
142
- [loggedUser]="loggedUser" [conversationWith]="conversationWith" [tagsCannedFilter]="tagsCannedFilter"
143
- (eventChangeTextArea)="returnChangeTextArea($event)" (eventSendMessage)="returnSendMessage($event)"
144
- [translationMap]="translationMap" [fileUploadAccept]="appConfigProvider.getConfig().fileUploadAccept"
145
- [isOpenInfoConversation]="isOpenInfoConversation" [dropEvent]="dropEvent" (onPresentModalScrollToBottom)="onPresentModalScrollToBottom($event)">
153
+ [loggedUser]="loggedUser"
154
+ [conversationWith]="conversationWith"
155
+ [tagsCannedFilter]="tagsCannedFilter"
156
+ (eventChangeTextArea)="returnChangeTextArea($event)"
157
+ (eventSendMessage)="returnSendMessage($event)"
158
+ [translationMap]="translationMap"
159
+ [fileUploadAccept]="appConfigProvider.getConfig().fileUploadAccept"
160
+ [isOpenInfoConversation]="isOpenInfoConversation"
161
+ [dropEvent]="dropEvent"
162
+ (onPresentModalScrollToBottom)="onPresentModalScrollToBottom($event)">
146
163
  </app-message-text-area>
147
164
  <!-- [events]="eventsReplaceTexareaText.asObservable()" -->
148
165
  </ion-row>
@@ -150,8 +167,12 @@
150
167
  </ion-col>
151
168
 
152
169
  <ion-col id="chat21-info-conversation" [class.mobile]="isMobile" [class.open]="openInfoConversation">
153
- <app-info-content [openInfoConversation]="openInfoConversation" [translationMap]="translationMap"
154
- [loggedUser]="loggedUser" [tenant]="tenant" [groupDetail]="groupDetail">
170
+ <app-info-content
171
+ [openInfoConversation]="openInfoConversation"
172
+ [translationMap]="translationMap"
173
+ [loggedUser]="loggedUser"
174
+ [tenant]="tenant"
175
+ [groupDetail]="groupDetail">
155
176
  </app-info-content>
156
177
  </ion-col>
157
178