@chat21/chat21-ionic 3.0.62 → 3.0.64

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 (58) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/README.md +6 -2
  3. package/deploy_amazon_beta.sh +29 -0
  4. package/deploy_amazon_prod.sh +25 -0
  5. package/deploy_pre.sh +6 -78
  6. package/deploy_prod.sh +6 -57
  7. package/package.json +2 -1
  8. package/src/app/app.component.ts +104 -34
  9. package/src/app/chatlib/conversation-detail/conversation-content/conversation-content.component.html +2 -0
  10. package/src/app/chatlib/conversation-detail/conversation-content/conversation-content.component.ts +2 -1
  11. package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.html +33 -21
  12. package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.scss +34 -12
  13. package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.ts +2 -1
  14. package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.scss +1 -1
  15. package/src/app/chatlib/conversation-detail/message/image/image.component.ts +5 -3
  16. package/src/app/chatlib/conversation-detail/message/return-receipt/return-receipt.component.scss +1 -1
  17. package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.html +1 -1
  18. package/src/app/components/conversation-detail/bubble-my-message/bubble-my-message.component.html +1 -1
  19. package/src/app/components/conversation-detail/bubble-my-message/bubble-my-message.component.scss +4 -4
  20. package/src/app/components/conversation-detail/bubble-others-message/bubble-others-message.component.html +1 -1
  21. package/src/app/components/conversation-detail/bubble-others-message/bubble-others-message.component.scss +3 -3
  22. package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.html +3 -3
  23. package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.ts +10 -55
  24. package/src/app/components/conversation-detail/message-text-area/message-text-area.component.html +8 -2
  25. package/src/app/components/conversation-detail/message-text-area/message-text-area.component.ts +2 -0
  26. package/src/app/components/image-viewer/image-viewer.component.ts +28 -10
  27. package/src/app/components/project-item/project-item.component.ts +6 -30
  28. package/src/app/components/sidebar/sidebar.component.html +2 -2
  29. package/src/app/components/sidebar/sidebar.component.ts +49 -83
  30. package/src/app/components/sidebar-user-details/sidebar-user-details.component.html +17 -1
  31. package/src/app/components/sidebar-user-details/sidebar-user-details.component.scss +52 -6
  32. package/src/app/components/sidebar-user-details/sidebar-user-details.component.ts +81 -111
  33. package/src/app/pages/authentication/login/login.page.ts +20 -1
  34. package/src/app/pages/conversation-detail/conversation-detail.page.html +40 -19
  35. package/src/app/pages/conversation-detail/conversation-detail.page.scss +15 -6
  36. package/src/app/pages/conversation-detail/conversation-detail.page.ts +179 -244
  37. package/src/app/services/nav-proxy.service.ts +15 -13
  38. package/src/assets/i18n/de.json +2 -1
  39. package/src/assets/i18n/en.json +2 -1
  40. package/src/assets/i18n/es.json +2 -1
  41. package/src/assets/i18n/fr.json +2 -1
  42. package/src/assets/i18n/it.json +2 -1
  43. package/src/assets/i18n/pt.json +2 -1
  44. package/src/assets/i18n/ru.json +2 -1
  45. package/src/assets/i18n/sr.json +2 -1
  46. package/src/assets/i18n/tr.json +2 -1
  47. package/src/assets/js/chat21client.js +1 -1
  48. package/src/{chat-config-mqtt-ver-uploaded.json → chat-config-mqtt-localhost.json} +10 -6
  49. package/src/chat-config-mqtt.json +18 -28
  50. package/src/chat-config-native-mqtt.json +30 -0
  51. package/src/chat-config-pre.json +15 -7
  52. package/src/chat21-core/providers/firebase/firebase-conversation-handler.ts +2 -3
  53. package/src/chat21-core/providers/firebase/firebase-conversations-handler.ts +20 -3
  54. package/src/chat21-core/providers/logger/customLogger.ts +2 -10
  55. package/src/chat21-core/providers/tiledesk/tiledesk-auth.service.ts +1 -1
  56. package/src/chat21-core/utils/utils-message.ts +102 -85
  57. package/src/variables.scss +4 -1
  58. package/src/chat-config-pre-test.json +0 -36
@@ -59,9 +59,11 @@ ion-item {
59
59
  }
60
60
 
61
61
  .message_sender_fullname {
62
- font-size: 0.7em;
62
+ font-size: 0.9em;
63
63
  margin: 0 0 1px 10px;
64
- color: var(--gray);
64
+ // color: var(--gray);
65
+ font-weight: 500;
66
+ color: #080f1a;
65
67
  }
66
68
 
67
69
  .messages {
@@ -82,7 +84,7 @@ ion-item {
82
84
  // padding: 2px 0px 4px 40px;
83
85
  padding: 2px 0px 14px 40px; // edited to display the date at the bottom of the "message bubble"
84
86
  .msg_sent {
85
- background-color: var(--bobble-blue);
87
+ background-color: var(--bubble-blue);
86
88
  color: var(--col-msg-sent);
87
89
  margin-right: 4px;
88
90
  margin-left: 4px;
@@ -90,12 +92,19 @@ ion-item {
90
92
  min-width: 14px;
91
93
  border-top-right-radius: 8px;
92
94
  border-bottom-right-radius: 0px;
95
+
96
+ &.privateMsg{
97
+ background-color: var(--bubble-privateMsg);
98
+ color: var(--bubble-privateMsgColor)
99
+ }
100
+
93
101
  }
94
102
  .emoticon {
95
103
  background: unset !important;
96
104
  font-size: 4em;
97
- padding-bottom: 21px;
105
+ // padding-bottom: 21px;
98
106
  padding-top: 30px;
107
+ text-align: right;
99
108
  }
100
109
  .has-metadata {
101
110
  max-width: 100% !important;
@@ -297,13 +306,26 @@ ion-item {
297
306
  // emoticon
298
307
  // ---------------------------------------------------------
299
308
 
300
- :host .base_sent .msg_sent ::ng-deep div > div > div > .chat-text-emoticon > p > p {
301
- margin-bottom: 6px !important;
302
- margin-right: -7px !important;
303
- }
309
+ // :host .base_sent .msg_sent ::ng-deep div > div > div > .chat-text-emoticon > p > p {
310
+ // margin-bottom: 6px !important;
311
+ // margin-right: -7px !important;
312
+ // }
304
313
 
305
- :host .base_receive .msg_receive ::ng-deep div > div > div > .chat-text-emoticon > p > p {
306
- margin-bottom: 41px !important;
307
- margin-left: -8px !important;
308
- margin-top: 49px !important;
314
+ // :host .base_receive .msg_receive ::ng-deep div > div > div > .chat-text-emoticon > p > p {
315
+ // margin-bottom: 41px !important;
316
+ // margin-left: -8px !important;
317
+ // margin-top: 49px !important;
318
+ // }
319
+
320
+
321
+ // :host .base_sent .msg_sent .emoticon ::ng-deep div > div > div > chat-text > p > p {
322
+ // margin-bottom: 38px;
323
+ // }
324
+
325
+ :host .base_sent .emoticon ::ng-deep div > div > div > chat-text > p > p {
326
+ margin-bottom: 38px;
309
327
  }
328
+
329
+ :host .base_receive .emoticon ::ng-deep div > div > div > chat-text > p > p {
330
+ margin-bottom: 38px;
331
+ }
@@ -3,7 +3,7 @@ import { ChangeDetectorRef, Component, Input, OnInit, Output, EventEmitter } fro
3
3
 
4
4
 
5
5
  import { MESSAGE_TYPE_INFO, MESSAGE_TYPE_MINE, MESSAGE_TYPE_OTHERS } from 'src/chat21-core/utils/constants';
6
- import { isChannelTypeGroup, isFirstMessage, isInfo, isMine, messageType } from 'src/chat21-core/utils/utils-message';
6
+ import { isChannelTypeGroup, isEmojii, isFirstMessage, isInfo, isMine, messageType } from 'src/chat21-core/utils/utils-message';
7
7
  import { UploadService } from 'src/chat21-core/providers/abstract/upload.service';
8
8
  import { isFile, isFrame, isImage } from 'src/chat21-core/utils/utils-message';
9
9
 
@@ -41,6 +41,7 @@ export class IonConversationDetailComponent extends ConversationContentComponent
41
41
  isFirstMessage = isFirstMessage;
42
42
  messageType = messageType;
43
43
  isChannelTypeGroup = isChannelTypeGroup;
44
+ isEmojii = isEmojii;
44
45
 
45
46
  MESSAGE_TYPE_INFO = MESSAGE_TYPE_INFO;
46
47
  MESSAGE_TYPE_MINE = MESSAGE_TYPE_MINE;
@@ -53,7 +53,7 @@
53
53
  border-radius: 50%;
54
54
  --padding-end: 7px;
55
55
  --padding-start: 7px;
56
- box-shadow: 0 1px 2px 0 rgb(0 0 0 / 6%);
56
+ box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.6);
57
57
  }
58
58
 
59
59
  // .emoticon {
@@ -66,11 +66,13 @@ export class ImageComponent implements OnInit {
66
66
  var modalImg = <HTMLImageElement>document.getElementById("image-viewer-img");
67
67
  var captionText = document.getElementById("caption");
68
68
  modalImg.src = url
69
- captionText.innerHTML = fileName;
69
+ if (captionText) {
70
70
 
71
- }
71
+ captionText.innerHTML = fileName ? fileName : decodeURIComponent(decodeURIComponent(url).split('/').pop());
72
+ // console.log('XXXX ', decodeURIComponent(decodeURIComponent(url).split('/').pop()))
73
+ }
72
74
 
73
-
75
+ }
74
76
 
75
77
 
76
78
  }
@@ -12,7 +12,7 @@
12
12
  }
13
13
 
14
14
  svg {
15
- fill: var(--bobble-blue)
15
+ fill: var(--bubble-blue)
16
16
  }
17
17
 
18
18
  .c21-ico-schedule {
@@ -90,7 +90,7 @@
90
90
  <!-- <div *ngIf="getImageAvatar(conversation.sender)" #avatarImage class="avatar-profile" [style.background-image]="'url(' + getImageAvatar(conversation.sender) + ')'"></div> -->
91
91
  </ion-avatar>
92
92
  <ion-label>
93
- <div class="conversation_with truncate" [innerHTML]="conversation.conversation_with_fullname"></div>
93
+ <div class="conversation_with truncate">{{conversation.conversation_with_fullname}}</div>
94
94
  <div class="conversation_message truncate-conv-msg" [ngClass]="{'truncate-on-desktop': !isApp}">
95
95
 
96
96
  <!-- -------------------------------------------------------------------------- -->
@@ -1,6 +1,6 @@
1
1
  <div class="message message-my" [class.first-message]="isFirstMessage" >
2
2
 
3
- <div class="bobble-message"
3
+ <div class="bubble-message"
4
4
  [class.image]="message.type == 'image'"
5
5
  [class.no-text]="!message.text"
6
6
  (mouseover)="showButtonInfo()">
@@ -1,5 +1,5 @@
1
1
  .message {
2
- .bobble-message {
2
+ .bubble-message {
3
3
  position: relative;
4
4
  border-radius: 15px;
5
5
  font-size: 15px;
@@ -57,8 +57,8 @@
57
57
  }
58
58
 
59
59
 
60
- .bobble-message {
61
- background-color: var(--bobble-blue);
60
+ .bubble-message {
61
+ background-color: var(--bubble-blue);
62
62
  color: white;
63
63
  margin-right: 24px;
64
64
  float: right;
@@ -67,7 +67,7 @@
67
67
  }
68
68
  &.first-message {
69
69
  margin-top: 10px;
70
- .bobble-message {
70
+ .bubble-message {
71
71
  border-top-right-radius: 12px;
72
72
  border-bottom-right-radius: 0px;
73
73
  }
@@ -2,7 +2,7 @@
2
2
 
3
3
  <span class="button-info" [ngClass]="message.uid" (click)="presentPopover($event, message)"></span>
4
4
 
5
- <div class="bobble-message"
5
+ <div class="bubble-message"
6
6
  [class.image]="message.type == 'image'"
7
7
  [class.no-text]="!message.text"
8
8
  (mouseover)="showButtonInfo()">
@@ -1,5 +1,5 @@
1
1
  .message {
2
- .bobble-message {
2
+ .bubble-message {
3
3
  position: relative;
4
4
  border-radius: 15px;
5
5
  font-size: 15px;
@@ -50,7 +50,7 @@
50
50
  .message-other {
51
51
  width: 100%;
52
52
  margin-top: 4px;
53
- .bobble-message {
53
+ .bubble-message {
54
54
  background-color: var(--light-gray);
55
55
  color: var(--black);
56
56
  margin-left: 24px;
@@ -72,7 +72,7 @@
72
72
  }
73
73
  &.first-message {
74
74
  margin-top: 10px;
75
- .bobble-message {
75
+ .bubble-message {
76
76
  border-top-left-radius: 12px;
77
77
  border-bottom-left-radius: 0px;
78
78
  }
@@ -32,8 +32,8 @@
32
32
  <!-- (click)="onOpenCloseInfoConversation()" -->
33
33
  <div *ngIf="conversationAvatar" class="tile-info-with"
34
34
  [ngClass]="{ 'tile-info-with-ios': platformName === 'ios' }">
35
- <!-- <span class="tile-username">{{ conversationAvatar.conversation_with_fullname }} </span> -->
36
- <span class="tile-username">{{ conversation_with_fullname }} </span>
35
+ <span class="tile-username">{{ conversationAvatar.conversation_with_fullname }} </span>
36
+ <!-- <span class="tile-username">{{ conversation_with_fullname }} </span> -->
37
37
 
38
38
  </div>
39
39
 
@@ -50,7 +50,7 @@
50
50
  <span style="text-transform: capitalize; margin-left: 5px;"> {{ 'Crea ticket' | translate}} </span>
51
51
  </ion-button> -->
52
52
 
53
- <ion-button *ngIf="idConv.startsWith('support-group') && conv_type !== 'archived'" ion-button fill="clear" color="primary" size="small"
53
+ <ion-button *ngIf="conversationUid?.startsWith('support-group') && conv_type !== 'archived'" ion-button fill="clear" color="primary" size="small"
54
54
  (click)="closeConversation()" [ngClass]="{'resolve-conv-margin-right': !isMobile}" [disabled]="conv_closed === true">
55
55
  <!-- <ion-icon slot="icon-only" name="alert-circle-outline"></ion-icon> -->
56
56
  <ion-icon name="archive-outline"></ion-icon>
@@ -22,6 +22,7 @@ import { ModalController } from '@ionic/angular'
22
22
  import { EventsService } from 'src/app/services/events-service'
23
23
  import { CreateTicketPage } from 'src/app/pages/create-ticket/create-ticket.page'
24
24
  import { TiledeskService } from 'src/app/services/tiledesk/tiledesk.service'
25
+ import { TYPE_DIRECT } from 'src/chat21-core/utils/constants'
25
26
 
26
27
  @Component({
27
28
  selector: 'app-header-conversation-detail',
@@ -31,57 +32,36 @@ import { TiledeskService } from 'src/app/services/tiledesk/tiledesk.service'
31
32
  export class HeaderConversationDetailComponent implements OnInit, OnChanges {
32
33
  @Input() conversationAvatar: any
33
34
  @Input() idLoggedUser: string
35
+ @Input() conversationUid: string
34
36
  @Input() conv_type: string
35
- @Input() isOpenInfoConversation: boolean
37
+ @Input() isOpenInfoConversation: boolean = true
36
38
  @Input() isMobile: boolean
37
39
  @Input() translationMap: Map<string, string>
38
40
  @Output() eventOpenCloseInfoConversation = new EventEmitter<boolean>()
39
41
  conversationWithFullname: string
40
42
  openInfoConversation = true
41
43
  openInfoMessage = true
42
- DIRECT = 'direct'
43
44
 
44
45
  isDirect = false
45
46
  isTyping = false
46
47
  borderColor = '#ffffff'
47
48
  fontColor = '#949494'
48
49
  membersConversation = ['SYSTEM']
49
- fullNameConv: string
50
- idConv: string
51
- conversation_with_fullname: string
52
50
  platformName: string
53
51
  conv_closed: boolean = false;
54
52
  IS_ON_IOS_MOBILE_DEVICE: boolean
55
53
  private logger: LoggerService = LoggerInstance.getInstance()
56
54
 
57
- /**
58
- * Constructor
59
- * @param imageRepoService
60
- */
61
55
  constructor(
62
56
  public imageRepoService: ImageRepoService,
63
57
  private route: ActivatedRoute,
64
58
  public platform: Platform,
65
59
  private router: Router,
66
- // public tiledeskAuthService: TiledeskAuthService,
67
60
  public tiledeskService: TiledeskService,
68
61
  public events: EventsService,
69
62
  public modalController: ModalController,
70
63
  ) {
71
- this.route.paramMap.subscribe((params) => {
72
- // this.conversationWithFullname = params.get('FullNameConv');
73
- this.logger.log('[CONVS-DETAIL][HEADER] -> params: ', params)
74
- this.fullNameConv = params.get('FullNameConv')
75
- this.logger.log(
76
- '[CONVS-DETAIL][HEADER] -> params > conversation_with_fullname: ',
77
- this.fullNameConv,
78
- )
79
- this.idConv = params.get('IDConv')
80
- this.logger.log(
81
- '[CONVS-DETAIL][HEADER] -> params > conversation_with: ',
82
- this.idConv,
83
- )
84
- })
64
+
85
65
  }
86
66
 
87
67
  // ----------------------------------------------------
@@ -91,8 +71,7 @@ export class HeaderConversationDetailComponent implements OnInit, OnChanges {
91
71
 
92
72
  this.logger.log('[CONVS-DETAIL][HEADER] - (ngOnInit) - idLoggedUser', this.idLoggedUser,)
93
73
  this.logger.log('[CONVS-DETAIL][HEADER] - (ngOnInit) - conversationAvatar', this.conversationAvatar,)
94
- this.logger.log('[CONVS-DETAIL][HEADER] - (ngOnInit) - conv_type', this.conv_type,)
95
- this.conversation_with_fullname = this.conversationAvatar.conversation_with_fullname
74
+ this.logger.log('[CONVS-DETAIL][HEADER] - (ngOnInit) - conv_type', this.conv_type)
96
75
  this.listenToConversationHasBeenClosed()
97
76
  this.initialize();
98
77
  // this.isOniOSMobileDevice()
@@ -111,29 +90,8 @@ export class HeaderConversationDetailComponent implements OnInit, OnChanges {
111
90
  ngOnChanges() {
112
91
  this.logger.log('[CONVS-DETAIL][HEADER] - (ngOnChanges) - conversationAvatar', this.conversationAvatar)
113
92
  if (this.conversationAvatar) {
114
- this.conversationAvatar.imageurl = this.imageRepoService.getImagePhotoUrl(
115
- this.conversationAvatar.uid,
116
- )
117
- } else {
118
- const channelType = setChannelType(this.idConv)
119
- this.logger.log('[CONVS-DETAIL][HEADER] - (ngOnChanges) - conversationAvatar usecase UNDEFINED channelType ', channelType)
120
- this.conversationAvatar = setConversationAvatar(
121
- this.idConv,
122
- this.fullNameConv,
123
- channelType,
124
- )
125
- if (this.conversationAvatar) {
126
- this.conversationAvatar.imageurl = this.imageRepoService.getImagePhotoUrl(
127
- this.conversationAvatar.uid,
128
- )
129
- }
130
- this.logger.log('[CONVS-DETAIL][HEADER] - (ngOnChanges) - conversationAvatar usecase UNDEFINED conversationAvatar', this.conversationAvatar)
131
- }
132
-
133
- this.logger.log(
134
- '[CONVS-DETAIL][HEADER] - (ngOnChanges) - isOpenInfoConversation',
135
- this.isOpenInfoConversation,
136
- )
93
+ this.conversationAvatar.imageurl = this.imageRepoService.getImagePhotoUrl(this.conversationAvatar.uid)
94
+ }
137
95
  this.openInfoConversation = this.isOpenInfoConversation
138
96
  }
139
97
 
@@ -142,10 +100,7 @@ export class HeaderConversationDetailComponent implements OnInit, OnChanges {
142
100
  // ----------------------------------------------------
143
101
  initialize() {
144
102
  this.getPlatformName()
145
- if (
146
- this.conversationAvatar &&
147
- this.conversationAvatar.channelType === this.DIRECT
148
- ) {
103
+ if ( this.conversationAvatar && this.conversationAvatar.channelType === TYPE_DIRECT ) {
149
104
  this.isDirect = true
150
105
  } else if (this.idLoggedUser) {
151
106
  this.membersConversation.push(this.idLoggedUser)
@@ -165,13 +120,13 @@ export class HeaderConversationDetailComponent implements OnInit, OnChanges {
165
120
 
166
121
  closeConversation() {
167
122
  this.logger.log('[CONVS-DETAIL][HEADER] click on RESOLVE this.events', this.events)
168
- this.events.publish('conversation:closed', this.idConv)
123
+ this.events.publish('conversation:closed', this.conversationUid)
169
124
  }
170
125
 
171
126
  listenToConversationHasBeenClosed() {
172
127
  this.events.subscribe('conversationhasbeenclosed', (convId) => {
173
128
  // console.log('[CONVS-DETAIL][HEADER] conversationhasbeenclosed convId', convId)
174
- if (convId === this.idConv) {
129
+ if (convId === this.conversationUid) {
175
130
  this.logger.log('[CONVS-DETAIL][HEADER] the conversation was closed',)
176
131
  this.conv_closed = true;
177
132
  }
@@ -92,8 +92,14 @@
92
92
  <!-- https://www.npmjs.com/package/@ctrl/ngx-emoji-mart/v/1.0.6 -->
93
93
  <!-- --------------------------------------------------------------------- -->
94
94
  <!-- [style]="{ position: 'absolute', bottom: '53px', right: '-246px' }" -->
95
- <emoji-mart [showPreview]="false" [perLine]="emojiPerLine" [style.visibility]="showEmojiPicker?'visible':'hidden'"
96
- (emojiSelect)="addEmoji($event)" [ngClass]="{'emoji-mart-desktop': !IS_ON_MOBILE_DEVICE, 'emoji-mart-mobile': IS_ON_MOBILE_DEVICE }">
95
+ <emoji-mart
96
+ [showPreview]="false"
97
+ [perLine]="emojiPerLine"
98
+ [style.visibility]="showEmojiPicker?'visible':'hidden'"
99
+ [include]="emojiiCategories"
100
+ [color]="emojiColor"
101
+ [ngClass]="{'emoji-mart-desktop': !IS_ON_MOBILE_DEVICE, 'emoji-mart-mobile': IS_ON_MOBILE_DEVICE }"
102
+ (emojiSelect)="addEmoji($event)">
97
103
  </emoji-mart>
98
104
  <!-- </div> -->
99
105
 
@@ -87,6 +87,8 @@ export class MessageTextAreaComponent implements OnInit, AfterViewInit, OnChange
87
87
  showEmojiPicker: boolean = false; //To show/hide emoji picker
88
88
  addWhiteSpaceBefore: boolean;
89
89
  emojiPerLine: number = 9
90
+ emojiColor: string ="#3880ff"
91
+ emojiiCategories = [ 'recent', 'people', 'nature', 'activity']
90
92
  /**
91
93
  * Constructor
92
94
  * @param chooser
@@ -1,5 +1,5 @@
1
1
  import { Component, OnInit } from '@angular/core';
2
-
2
+ import { saveAs } from 'file-saver';
3
3
  @Component({
4
4
  selector: 'app-image-viewer',
5
5
  templateUrl: './image-viewer.component.html',
@@ -7,9 +7,14 @@ import { Component, OnInit } from '@angular/core';
7
7
  })
8
8
  export class ImageViewerComponent implements OnInit {
9
9
 
10
- constructor() { }
10
+ constructor(
11
+
12
+ ) { }
13
+
14
+
15
+ ngOnInit() { }
16
+
11
17
 
12
- ngOnInit() {}
13
18
 
14
19
  closeImageViewerModal() {
15
20
  // console.log('HAS CLICKED CLOSE MODAL')
@@ -18,6 +23,24 @@ export class ImageViewerComponent implements OnInit {
18
23
  modal.style.display = "none";
19
24
  }
20
25
 
26
+ // __downloadImage() {
27
+ // var modalImg = <HTMLImageElement>document.getElementById("image-viewer-img")
28
+ // console.log('HAS CLICKED CLOSE DWNLD IMG modalImg ', modalImg)
29
+ // var modalImgURL = modalImg.src;
30
+ // console.log('HAS CLICKED CLOSE DWNLD IMG modalImgURL ', modalImgURL)
31
+ // var captionText = document.getElementById("caption").innerHTML;
32
+ // console.log('HAS CLICKED CLOSE DWNLD IMG captionText ', captionText)
33
+
34
+ // const a: any = document.createElement('a');
35
+ // a.href = modalImgURL;
36
+ // a.download = captionText;
37
+ // document.body.appendChild(a);
38
+ // a.style = 'display: none';
39
+ // a.click();
40
+ // a.remove();
41
+ // }
42
+
43
+
21
44
  downloadImage() {
22
45
  var modalImg = <HTMLImageElement>document.getElementById("image-viewer-img")
23
46
  // console.log('HAS CLICKED CLOSE DWNLD IMG modalImg ', modalImg)
@@ -26,13 +49,8 @@ export class ImageViewerComponent implements OnInit {
26
49
  var captionText = document.getElementById("caption").innerHTML;
27
50
  // console.log('HAS CLICKED CLOSE DWNLD IMG captionText ', captionText)
28
51
 
29
- const a: any = document.createElement('a');
30
- a.href = modalImgURL;
31
- a.download = captionText;
32
- document.body.appendChild(a);
33
- a.style = 'display: none';
34
- a.click();
35
- a.remove();
52
+ saveAs(modalImgURL, captionText);
53
+ this.closeImageViewerModal()
36
54
  }
37
55
 
38
56
  }
@@ -61,9 +61,7 @@ export class ProjectItemComponent implements OnInit {
61
61
  this.translations();
62
62
  this.listenToPostMsgs();
63
63
  this.onInitWindowWidth();
64
-
65
- this.isOnMobileDevice()
66
- // console.log('[PROJECT-ITEM] - on INIT')
64
+ this.isOnMobileDevice();
67
65
  }
68
66
 
69
67
  isOnMobileDevice() {
@@ -71,7 +69,6 @@ export class ProjectItemComponent implements OnInit {
71
69
  if (/Android|iPhone/i.test(window.navigator.userAgent)) {
72
70
  this.IS_ON_MOBILE_DEVICE = true;
73
71
  }
74
- // console.log('[PROJECT-ITEM] IS_ON_MOBILE_DEVICE', this.IS_ON_MOBILE_DEVICE)
75
72
  return this.IS_ON_MOBILE_DEVICE;
76
73
  }
77
74
 
@@ -107,10 +104,7 @@ export class ProjectItemComponent implements OnInit {
107
104
 
108
105
  listenToPostMsgs() {
109
106
  window.addEventListener("message", (event) => {
110
- // console.log("[PROJECT-ITEM] post message event ", event);
111
-
112
107
  if (event && event.data) {
113
- // console.log("[PROJECT-ITEM] message event data ", event.data);
114
108
  if (event.data === 'hasChangedProject') {
115
109
  this.unservedRequestCount = 0;
116
110
  if (this.project) {
@@ -161,11 +155,13 @@ export class ProjectItemComponent implements OnInit {
161
155
  getStoredCurrenUser() {
162
156
  const storedCurrentUser = this.appStorageService.getItem('currentUser');
163
157
  this.logger.log('[PROJECT-ITEM] - STORED CURRENT USER ', storedCurrentUser)
164
- if (storedCurrentUser) {
158
+ if (storedCurrentUser && storedCurrentUser !== 'undefined') {
165
159
  const currentUser = JSON.parse(storedCurrentUser)
166
160
  this.logger.log('[PROJECT-ITEM] - STORED CURRENT USER OBJCT', currentUser);
167
161
  this.currentUserId = currentUser.uid
168
162
  this.logger.log('[PROJECT-ITEM] - CURRENT USER ID', this.currentUserId);
163
+ } else {
164
+ this.logger.error('[PROJECT-ITEM] - STORED CURRENT USER OBJCT NOT FOUND IN STORAGE');
169
165
  }
170
166
  }
171
167
 
@@ -298,28 +294,19 @@ export class ProjectItemComponent implements OnInit {
298
294
  }
299
295
 
300
296
  updateUnservedRequestCount() {
301
- // console.log('[PROJECT-ITEM] updateUnservedRequestCount ')
302
- // this.requestsService.requestsList_bs.subscribe((requests) => {
297
+
303
298
  this.wsService.wsRequestsList$
304
299
  .subscribe((requests) => {
305
- // console.log('[PROJECT-ITEM] requests ', requests)
306
300
  if (requests) {
307
301
  let count = 0;
308
302
  requests.forEach(r => {
309
- // this.logger.log('NAVBAR - UPDATE-UNSERVED-REQUEST-COUNT request agents', r.agents)
310
- // *bug fix: when the user is an agent also for the unserved we have to consider if he is present in agents
311
- // && this.ROLE_IS_AGENT === true
312
303
  if (r['status'] === 100) {
313
304
  if (this.hasmeInAgents(r['agents']) === true) {
314
305
  count = count + 1;
315
306
  }
316
307
  }
317
- // if (r['status'] === 100 && this.ROLE_IS_AGENT === false) {
318
- // count = count + 1;
319
- // }
320
308
  });
321
309
  this.unservedRequestCount = count;
322
- // console.log('[PROJECT-ITEM] UNSERVED REQUEST COUNT - RES ', this.unservedRequestCount)
323
310
  }
324
311
  }, error => {
325
312
  this.logger.error('[PROJECT-ITEM] UNSERVED REQUEST COUNT * error * ', error)
@@ -331,10 +318,7 @@ export class ProjectItemComponent implements OnInit {
331
318
  hasmeInAgents(agents) {
332
319
  if (agents) {
333
320
  for (let j = 0; j < agents.length; j++) {
334
- // this.logger.log('[PROJECT-ITEM] hasmeInAgents currentUserId ', this.currentUserId)
335
- // this.logger.log('[PROJECT-ITEM] hasmeInAgents agent ', agents[j].id_user)
336
321
  if (this.currentUserId === agents[j].id_user) {
337
- // this.logger.log('[PROJECT-ITEM] hasmeInAgents ')
338
322
  return true
339
323
  }
340
324
  }
@@ -344,7 +328,6 @@ export class ProjectItemComponent implements OnInit {
344
328
  }
345
329
 
346
330
  updateCurrentUserRequestCount() {
347
- // this.requestsService.requestsList_bs.subscribe((requests) => {
348
331
  this.wsService.wsRequestsList$
349
332
  .pipe(
350
333
  takeUntil(this.unsubscribe$)
@@ -353,15 +336,9 @@ export class ProjectItemComponent implements OnInit {
353
336
  if (requests) {
354
337
  let count = 0;
355
338
  requests.forEach(r => {
356
-
357
- // const membersArray = Object.keys(r.members);
358
339
  const participantsArray = r['participants'] // new used with ws
359
- // this.logger.log('[NAVBAR] »» WIDGET updateCurrentUserRequestCount REQUEST currentUserRequestCount membersArray ', membersArray);
360
-
361
- // const currentUserIsInParticipants = membersArray.includes(this.user._id);
340
+
362
341
  const currentUserIsInParticipants = participantsArray.includes(this.currentUserId); // new used with ws
363
-
364
- // this.logger.log('[NAVBAR] »» WIDGET updateCurrentUserRequestCount REQUEST currentUserRequestCount currentUserIsInParticipants ', currentUserIsInParticipants);
365
342
  if (currentUserIsInParticipants === true) {
366
343
  count = count + 1;
367
344
  }
@@ -374,7 +351,6 @@ export class ProjectItemComponent implements OnInit {
374
351
  }, () => {
375
352
  this.logger.log('[PROJECT-ITEM] CURRENT USER REQUEST COUNT */* COMPLETE */*')
376
353
  })
377
-
378
354
  }
379
355
 
380
356
 
@@ -117,7 +117,7 @@
117
117
  <!-- ------------------------------------------- -->
118
118
  <!-- Conversations (MONITOR) (click)="goToConversations()" -->
119
119
  <!-- ------------------------------------------- -->
120
- <ng-container *ngIf="USER_ROLE !== 'agent'">
120
+ <!-- <ng-container *ngIf="USER_ROLE !== 'agent'"> -->
121
121
  <li matTooltipClass="custom-mat-tooltip" matTooltip="Monitor"
122
122
  #tooltip="matTooltip" matTooltipPosition='right' matTooltipHideDelay="100" style="text-align: center;">
123
123
  <a target="_self" href="{{ dashboard_convs_url }}" class="customAncor" style="height: 40px;margin-right: 0px !important;">
@@ -134,7 +134,7 @@
134
134
 
135
135
  </a>
136
136
  </li>
137
- </ng-container>
137
+ <!-- </ng-container> -->
138
138
 
139
139
  <!-- ------------------------------------------- -->
140
140
  <!-- CONTACTS (LEADS) (click)="goToContacts()" -->