@chat21/chat21-ionic 3.0.6-2.2 → 3.0.6-2.4-rc1

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 (28) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/deploy_prod.sh +3 -3
  3. package/package.json +2 -1
  4. package/src/app/app.component.ts +103 -31
  5. package/src/app/chatlib/conversation-detail/conversation-content/conversation-content.component.html +2 -0
  6. package/src/app/chatlib/conversation-detail/conversation-content/conversation-content.component.ts +2 -1
  7. package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.html +33 -21
  8. package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.scss +27 -11
  9. package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.ts +2 -1
  10. package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.scss +1 -1
  11. package/src/app/chatlib/conversation-detail/message/image/image.component.ts +5 -3
  12. package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.html +3 -3
  13. package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.ts +10 -55
  14. package/src/app/components/conversation-detail/message-text-area/message-text-area.component.html +8 -2
  15. package/src/app/components/conversation-detail/message-text-area/message-text-area.component.ts +2 -0
  16. package/src/app/components/image-viewer/image-viewer.component.ts +28 -10
  17. package/src/app/components/sidebar-user-details/sidebar-user-details.component.scss +2 -0
  18. package/src/app/pages/authentication/login/login.page.ts +12 -1
  19. package/src/app/pages/conversation-detail/conversation-detail.page.html +36 -17
  20. package/src/app/pages/conversation-detail/conversation-detail.page.ts +137 -239
  21. package/src/app/pages/conversations-list/conversations-list.page.html +18 -10
  22. package/src/app/pages/conversations-list/conversations-list.page.ts +58 -181
  23. package/src/assets/js/chat21client.js +1 -1
  24. package/src/chat-config-pre-test.json +3 -2
  25. package/src/chat21-core/providers/firebase/firebase-conversation-handler.ts +2 -3
  26. package/src/chat21-core/providers/firebase/firebase-conversations-handler.ts +18 -3
  27. package/src/chat21-core/providers/logger/customLogger.ts +2 -10
  28. package/src/chat21-core/utils/utils-message.ts +99 -85
package/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # chat21-ionic ver 3.0
2
2
 
3
+ ### 3.0.62.4-rc1
4
+ - Fixes the bug: when the user profile is updated in the dashboard it is not updated in the chat
5
+ - Fixes the bug: when is sent a message with only emojis, some emojis have the chat balloon background
6
+ - Fixes the bug: in the conversation detail header the requester's avatar does not update after the same has filled in the pre-chat form requested by the bot
7
+ - Fixes the bug: images that are not in the database cannot be downloaded
8
+ - Adds default chat color to emojis picker tabs
9
+ - Fixes the bug: the selected conversation is undefined
10
+ - Fixes the bug: in the conversation list, the name of the requester changes according to the order of arrival of the conversations
11
+
12
+ ### 3.0.62.3
13
+ - Fixes the bug: the method setTyping fired twice after that a message is sent
14
+ - Other minor improvements
15
+
3
16
  ### 3.0.62.2
4
17
  - Fixed bug: if the teammate has the role of agent when switching from the dashboard to the chat and vice versa, the icons that only owners and admins have access to are displayed briefly in the left sidebar
5
18
  - Adds the "Edit Profile" button and a link to the help center in the teammate details drawer
package/deploy_prod.sh CHANGED
@@ -25,16 +25,16 @@ cp -p config.xml platforms/browser/www/
25
25
 
26
26
  ###### CHAT in prod
27
27
  cd platforms/browser/www
28
- aws s3 sync . s3://tiledesk-console/v2/chat/
28
+ # aws s3 sync . s3://tiledesk-console/v2/chat/
29
29
  aws s3 sync . s3://tiledesk-console/v2/chat/$version/
30
30
  cd ../../../
31
31
  # aws cloudfront create-invalidation --distribution-id E2DTAKWHWQ7C3J --paths "/*"
32
32
 
33
33
  # echo new version deployed on s3://tiledesk-dashboard/chat/$NEW_BUILD/
34
34
  echo new version deployed on s3://tiledesk-console/v2/chat/$version/
35
- echo new version deployed on s3://tiledesk-console/v2/chat/
35
+ # echo new version deployed on s3://tiledesk-console/v2/chat/
36
36
  echo available on https://console.tiledesk.com/v2/chat/$version/index.html
37
- echo available on https://console.tiledesk.com/v2/chat/index.html
37
+ # echo available on https://console.tiledesk.com/v2/chat/index.html
38
38
 
39
39
 
40
40
  ###### CHAT-IONIC5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chat21/chat21-ionic",
3
- "version": "3.0.62.2",
3
+ "version": "3.0.62.4-rc1",
4
4
  "author": "Tiledesk SRL",
5
5
  "homepage": "https://tiledesk.com/",
6
6
  "scripts": {
@@ -52,6 +52,7 @@
52
52
  "cordova-plugin-whitelist": "^1.3.5",
53
53
  "cordova-res": "^0.15.1",
54
54
  "core-js": "^2.5.4",
55
+ "file-saver": "^2.0.5",
55
56
  "firebase": "^8.6.7",
56
57
  "marked": "^2.0.1",
57
58
  "material-design-icons": "^3.0.1",
@@ -269,7 +269,6 @@ export class AppComponent implements OnInit {
269
269
 
270
270
  saveInStorageNumberOfOpenedChatTab() {
271
271
  // this.logger.log('Calling saveInStorageChatOpenedTab!');
272
-
273
272
  // https://jsfiddle.net/jjjs5wd3/3/å
274
273
  if (+localStorage.tabCount > 0) {
275
274
  this.logger.log('Chat IONIC Already open!');
@@ -299,7 +298,7 @@ export class AppComponent implements OnInit {
299
298
  ngOnInit() {
300
299
  const appconfig = this.appConfigProvider.getConfig();
301
300
  this.logger.log('[APP-COMP] ngOnInit appconfig', appconfig)
302
- if (appconfig && appconfig.supportMode && (appconfig.supportMode === true || appconfig.supportMode === 'true' )) {
301
+ if (appconfig && appconfig.supportMode && (appconfig.supportMode === true || appconfig.supportMode === 'true')) {
303
302
  this.SUPPORT_MODE = true;
304
303
  this.logger.log('[APP-COMP] appconfig > SUPPORT_MODE', this.SUPPORT_MODE)
305
304
  } else {
@@ -564,16 +563,16 @@ export class AppComponent implements OnInit {
564
563
  } else if (browserLang && stored_preferred_lang) {
565
564
  chat_lang = stored_preferred_lang
566
565
  }
567
-
566
+
568
567
  this.logger.log('[APP-COMP] - chat_lang', chat_lang)
569
-
568
+
570
569
  if (tranlatedLanguage.includes(chat_lang)) {
571
- this.logger.log('[APP-COMP] tranlatedLanguage includes',chat_lang , ': ', tranlatedLanguage.includes(chat_lang))
570
+ this.logger.log('[APP-COMP] tranlatedLanguage includes', chat_lang, ': ', tranlatedLanguage.includes(chat_lang))
572
571
  this.translate.setDefaultLang(chat_lang)
573
572
  this.translate.use(chat_lang);
574
573
  }
575
574
  else {
576
- this.logger.log('[APP-COMP] tranlatedLanguage includes',chat_lang , ': ', tranlatedLanguage.includes(chat_lang))
575
+ this.logger.log('[APP-COMP] tranlatedLanguage includes', chat_lang, ': ', tranlatedLanguage.includes(chat_lang))
577
576
  this.translate.setDefaultLang('en');
578
577
  this.translate.use('en');
579
578
  }
@@ -659,6 +658,87 @@ export class AppComponent implements OnInit {
659
658
  }
660
659
 
661
660
 
661
+ updateStoredCurrentUser() {
662
+ const storedCurrentUser = this.appStorageService.getItem('currentUser')
663
+ const storedDshbrdUser = localStorage.getItem('user')
664
+
665
+ this.logger.log('[APP-COMP] updateStoredCurrentUser - stored currentUser', storedCurrentUser)
666
+ this.logger.log('[APP-COMP] updateStoredCurrentUser - stored dshbrdUser', storedDshbrdUser)
667
+ if ((storedCurrentUser && storedCurrentUser !== 'undefined') && (storedDshbrdUser && storedDshbrdUser !== 'undefined')) {
668
+ const currentUser = JSON.parse(storedCurrentUser);
669
+ const dshbrdUser = JSON.parse(storedDshbrdUser);
670
+ if (currentUser && dshbrdUser) {
671
+ if (currentUser.color !== dshbrdUser.fillColour) {
672
+ this.logger.log('[APP-COMP] updateStoredCurrentUser - currentUser.color !== dshbrdUser.fillColour')
673
+ this.logger.log('[APP-COMP] updateStoredCurrentUser - currentUser.color ', currentUser.color)
674
+ this.logger.log('[APP-COMP] updateStoredCurrentUser - dshbrdUser.fillColour ', dshbrdUser.fillColour)
675
+ currentUser.color = dshbrdUser.fillColour;
676
+ } else {
677
+ this.logger.log('[APP-COMP] updateStoredCurrentUser - currentUser.color === dshbrdUser.fillColour')
678
+ this.logger.log('[APP-COMP] updateStoredCurrentUser - currentUser.color ', currentUser.color)
679
+ this.logger.log('[APP-COMP] updateStoredCurrentUser - dshbrdUser.fillColour ', dshbrdUser.fillColour)
680
+ }
681
+
682
+ if (currentUser.firstname !== dshbrdUser.firstname) {
683
+ this.logger.log('[APP-COMP] updateStoredCurrentUser - currentUser.firstname !== dshbrdUser.firstname')
684
+ this.logger.log('[APP-COMP] updateStoredCurrentUser - currentUser.firstname ', currentUser.firstname)
685
+ this.logger.log('[APP-COMP] updateStoredCurrentUser - dshbrdUser.firstname ', dshbrdUser.firstname)
686
+ currentUser.firstname = dshbrdUser.firstname;
687
+ } else {
688
+ this.logger.log('[APP-COMP] updateStoredCurrentUser - currentUser.firstname === dshbrdUser.firstname')
689
+ this.logger.log('[APP-COMP] updateStoredCurrentUser - currentUser.firstname ', currentUser.firstname)
690
+ this.logger.log('[APP-COMP] updateStoredCurrentUser - dshbrdUser.firstname ', dshbrdUser.firstname)
691
+ }
692
+
693
+ if (currentUser.lastname !== dshbrdUser.lastname) {
694
+ this.logger.log('[APP-COMP] updateStoredCurrentUser - currentUser.lastname !== dshbrdUser.lastname')
695
+ this.logger.log('[APP-COMP] updateStoredCurrentUser - currentUser.lastname ', currentUser.lastname)
696
+ this.logger.log('[APP-COMP] updateStoredCurrentUser - dshbrdUser.lastname ', dshbrdUser.lastname)
697
+ currentUser.lastname = dshbrdUser.lastname;
698
+ } else {
699
+ this.logger.log('[APP-COMP] updateStoredCurrentUser - currentUser.lastname === dshbrdUser.lastname')
700
+ this.logger.log('[APP-COMP] updateStoredCurrentUser - currentUser.lastname ', currentUser.lastname)
701
+ this.logger.log('[APP-COMP] updateStoredCurrentUser - dshbrdUser.lastname ', dshbrdUser.lastname)
702
+ }
703
+
704
+ if (currentUser.avatar !== dshbrdUser.fullname_initial) {
705
+ this.logger.log('[APP-COMP] updateStoredCurrentUser - currentUser.avatar !== dshbrdUser.fullname_initial')
706
+ this.logger.log('[APP-COMP] updateStoredCurrentUser - currentUser.avatar ', currentUser.avatar)
707
+ this.logger.log('[APP-COMP] updateStoredCurrentUser - dshbrdUser.fullname_initial ', dshbrdUser.fullname_initial)
708
+ currentUser.avatar = dshbrdUser.fullname_initial
709
+ } else {
710
+ this.logger.log('[APP-COMP] updateStoredCurrentUser - currentUser.avatar === dshbrdUser.fullname_initial')
711
+ this.logger.log('[APP-COMP] updateStoredCurrentUser - currentUser.avatar ', currentUser.avatar)
712
+ this.logger.log('[APP-COMP] updateStoredCurrentUser - dshbrdUser.fullname_initial ', dshbrdUser.fullname_initial)
713
+ }
714
+
715
+ let fullname = ""
716
+ if (dshbrdUser.firstname && !dshbrdUser.lastname) {
717
+ fullname = dshbrdUser.firstname
718
+ } else if (dshbrdUser.firstname && dshbrdUser.lastname) {
719
+ fullname = dshbrdUser.firstname + ' ' + dshbrdUser.lastname
720
+ this.logger.log('[APP-COMP] updateStoredCurrentUser - fullname ', fullname)
721
+ }
722
+
723
+ if (fullname !== currentUser.fullname) {
724
+ this.logger.log('[APP-COMP] updateStoredCurrentUser - currentUser.fullname !== dshbrdUser.fullname ')
725
+ this.logger.log('[APP-COMP] updateStoredCurrentUser - currentUser.fullname ', fullname)
726
+ this.logger.log('[APP-COMP] updateStoredCurrentUser - dshbrdUser.fullname ', currentUser.fullname)
727
+ currentUser.fullname = fullname
728
+ } else {
729
+ this.logger.log('[APP-COMP] updateStoredCurrentUser - currentUser.fullname === dshbrdUser.fullname ')
730
+ this.logger.log('[APP-COMP] updateStoredCurrentUser - currentUser.fullname ', fullname)
731
+ this.logger.log('[APP-COMP] updateStoredCurrentUser - dshbrdUser.fullname ', currentUser.fullname)
732
+ }
733
+
734
+ this.appStorageService.setItem('currentUser', JSON.stringify(currentUser));
735
+ this.tiledeskAuthService.setCurrentUser(currentUser);
736
+ }
737
+ } else {
738
+ this.logger.error('[APP-COMP] updateStoredCurrentUser - currentuser or dashboarduser not found in storage')
739
+ }
740
+ }
741
+
662
742
  /***************************************************+*/
663
743
  /**------- AUTHENTICATION FUNCTIONS --> START <--- +*/
664
744
  private initAuthentication() {
@@ -672,6 +752,9 @@ export class AppComponent implements OnInit {
672
752
  this.logger.log('[APP-COMP] >>> initAuthentication I LOG IN WITH A TOKEN EXISTING IN THE LOCAL STORAGE OR WITH A TOKEN PASSED IN THE URL PARAMETERS <<<')
673
753
  this.tiledeskAuthService.signInWithCustomToken(tiledeskToken).then(user => {
674
754
  this.logger.log('[APP-COMP] >>> initAuthentication user ', user)
755
+
756
+ this.updateStoredCurrentUser()
757
+
675
758
  this.messagingAuthService.createCustomToken(tiledeskToken)
676
759
  }).catch(error => {
677
760
  this.logger.error('[APP-COMP] initAuthentication SIGNINWITHCUSTOMTOKEN error::', error)
@@ -701,24 +784,7 @@ export class AppComponent implements OnInit {
701
784
  /**------- AUTHENTICATION FUNCTIONS --> END <--- +*/
702
785
  /***************************************************+*/
703
786
 
704
-
705
-
706
787
  checkPlatform() {
707
- // console.log('[APP-COMP] checkPlatform');
708
- // let pageUrl = '';
709
- // try {
710
- // const pathPage = this.route.snapshot.firstChild.routeConfig.path;
711
- // this.route.snapshot.firstChild.url.forEach(element => {
712
- // pageUrl += '/' + element.path;
713
- // });
714
- // } catch (error) {
715
- // this.logger.debug('error', error);
716
- // }
717
- // this.logger.debug('checkPlatform pathPage: ', pageUrl);
718
- // if (!pageUrl || pageUrl === '') {
719
- // pageUrl = '/conversations-list';
720
- // }
721
-
722
788
  if (checkPlatformIsMobile()) {
723
789
  this.chatManager.startApp();
724
790
 
@@ -894,14 +960,20 @@ export class AppComponent implements OnInit {
894
960
  this.conversationsHandlerService.conversationChanged.subscribe((conversation: ConversationModel) => {
895
961
 
896
962
  // console.log('[APP-COMP] ***** subscribeConversationChanged conversation: ', conversation);
897
- const currentUser = JSON.parse(this.appStorageService.getItem('currentUser'));
898
- this.logger.log('[APP-COMP] ***** subscribeConversationChanged current_user: ', currentUser);
899
-
900
- if (currentUser) {
901
- this.logger.log('[APP-COMP] ***** subscribeConversationChanged current_user uid: ', currentUser.uid);
902
- if (conversation && conversation.sender !== currentUser.uid) {
903
- this.manageTabNotification();
963
+ let currentUser = null
964
+ const storedCurrentUser = this.appStorageService.getItem('currentUser')
965
+ if (storedCurrentUser && storedCurrentUser !== 'undefined') {
966
+ currentUser = JSON.parse(storedCurrentUser);
967
+ this.logger.log('[APP-COMP] ***** subscribeConversationChanged currentUser: ', currentUser);
968
+
969
+ if (currentUser) {
970
+ this.logger.log('[APP-COMP] ***** subscribeConversationChanged current_user uid: ', currentUser.uid);
971
+ if (conversation && conversation.sender !== currentUser.uid) {
972
+ this.manageTabNotification();
973
+ }
904
974
  }
975
+ } else {
976
+ this.logger.error('[APP-COMP] ***** subscribeConversationChanged currentUser nor found in storage ');
905
977
  }
906
978
  });
907
979
  }
@@ -1007,7 +1079,7 @@ export class AppComponent implements OnInit {
1007
1079
  let platformIsNow = PLATFORM_DESKTOP;
1008
1080
  if (checkPlatformIsMobile()) {
1009
1081
  platformIsNow = PLATFORM_MOBILE;
1010
- this.logger.log('onResize platformIsNow ', platformIsNow)
1082
+ this.logger.log('onResize platformIsNow ', platformIsNow)
1011
1083
  }
1012
1084
  if (!this.platformIs || this.platformIs === '') {
1013
1085
  this.platformIs = platformIsNow;
@@ -28,6 +28,7 @@
28
28
  <!--backgroundColor non viene ancora usato -->
29
29
  <tiledeskwidget-bubble-message class="messages msg_sent slide-in-right"
30
30
  [ngClass]="{'button-in-msg' : message?.metadata && message?.metadata?.button}"
31
+ [class.chat-text-emoticon]="isEmojii(message?.text)"
31
32
  [message]="message"
32
33
  [textColor]="'col-msg-sent'"
33
34
  (onBeforeMessageRender)="returnOnBeforeMessageRender($event)"
@@ -54,6 +55,7 @@
54
55
 
55
56
  <!--backgroundColor non viene ancora usato -->
56
57
  <tiledeskwidget-bubble-message class="messages msg_receive slide-in-left"
58
+ [class.chat-text-emoticon]="isEmojii(message?.text)"
57
59
  [message]="message"
58
60
  [textColor]="'black'"
59
61
  (onBeforeMessageRender)="returnOnBeforeMessageRender($event)"
@@ -5,7 +5,7 @@ import { MSG_STATUS_SENT, MSG_STATUS_RETURN_RECEIPT, MSG_STATUS_SENT_SERVER, MAX
5
5
  import { LoggerService } from 'src/chat21-core/providers/abstract/logger.service';
6
6
  import { LoggerInstance } from 'src/chat21-core/providers/logger/loggerInstance';
7
7
  import { UploadService } from 'src/chat21-core/providers/abstract/upload.service';
8
- import { isInfo, isMine, messageType } from 'src/chat21-core/utils/utils-message';
8
+ import { isEmojii, isInfo, isMine, messageType } from 'src/chat21-core/utils/utils-message';
9
9
  @Component({
10
10
  selector: 'tiledeskwidget-conversation-content',
11
11
  templateUrl: './conversation-content.component.html',
@@ -49,6 +49,7 @@ export class ConversationContentComponent implements OnInit {
49
49
  isMine = isMine;
50
50
  isInfo = isInfo;
51
51
  messageType = messageType;
52
+ isEmojii = isEmojii;
52
53
 
53
54
  MESSAGE_TYPE_INFO = MESSAGE_TYPE_INFO;
54
55
  MESSAGE_TYPE_MINE = MESSAGE_TYPE_MINE;
@@ -68,9 +68,9 @@
68
68
  </div>
69
69
  </ng-container>
70
70
 
71
- <div class="align-center" class="ion-text-center" *ngIf="messageType(MESSAGE_TYPE_INFO, message)"
72
- class="msg_info_container">
73
- <chat-info-message class="messages" [message]="message">
71
+ <div class="align-center ion-text-center msg_info_container" *ngIf="messageType(MESSAGE_TYPE_INFO, message)">
72
+ <chat-info-message class="messages"
73
+ [message]="message">
74
74
  </chat-info-message>
75
75
  </div>
76
76
 
@@ -78,19 +78,25 @@
78
78
  <div role="messaggio" *ngIf="messageType(MESSAGE_TYPE_MINE, message)" class="msg_container base_sent">
79
79
 
80
80
  <!--backgroundColor non viene ancora usato -->
81
-
82
- <chat-bubble-message style="position: relative;"
83
- [ngClass]="{'has-metadata': (isImage(message) || isFrame(message))}" class="messages msg_sent"
84
- id="message_msg_sent" [ngClass]="{'button-in-msg' : message.metadata && message.metadata.button}"
85
- [message]="message" [textColor]="'col-msg-sent'" (onBeforeMessageRender)="returnOnBeforeMessageRender($event)"
86
- (onAfterMessageRender)="returnOnAfterMessageRender($event)" (onImageRendered)="onImageRenderedFN($event)"
87
- [addAsCannedResponseTooltipText]="addAsCannedResponseTooltipText" [areVisibleCAR]="areVisibleCAR"
81
+ <chat-bubble-message class="messages msg_sent" id="message_msg_sent" style="position: relative;"
82
+ [ngClass]="{'has-metadata': (isImage(message) || isFrame(message))}"
83
+ [class.emoticon]="isEmojii(message?.text)"
84
+ [ngClass]="{'button-in-msg' : message.metadata && message.metadata.button}"
85
+ [message]="message"
86
+ [textColor]="'col-msg-sent'"
87
+ [addAsCannedResponseTooltipText]="addAsCannedResponseTooltipText"
88
+ [areVisibleCAR]="areVisibleCAR"
88
89
  [support_mode]="support_mode"
89
- [class.emoticon]="message?.emoticon">
90
+ (onBeforeMessageRender)="returnOnBeforeMessageRender($event)"
91
+ (onAfterMessageRender)="returnOnAfterMessageRender($event)"
92
+ (onImageRendered)="onImageRenderedFN($event)">
90
93
  </chat-bubble-message>
91
94
 
92
95
  <!-- icon status message -->
93
- <chat-return-receipt [status]="message.status" [message]="message" [senderId]="senderId">
96
+ <chat-return-receipt
97
+ [status]="message.status"
98
+ [message]="message"
99
+ [senderId]="senderId">
94
100
  </chat-return-receipt>
95
101
 
96
102
  </div>
@@ -112,21 +118,27 @@
112
118
 
113
119
  <!--backgroundColor non viene ancora usato -->
114
120
 
115
- <chat-bubble-message style="position: relative;"
116
- [ngClass]="{'has-metadata': (isImage(message) || isFrame(message))}" class="messages msg_receive"
117
- id="message_msg_receive" [message]="message" [textColor]="'black'"
118
- (onBeforeMessageRender)="returnOnBeforeMessageRender($event)"
119
- (onAfterMessageRender)="returnOnAfterMessageRender($event)" (onImageRendered)="onImageRenderedFN($event)"
120
- [addAsCannedResponseTooltipText]="addAsCannedResponseTooltipText" [areVisibleCAR]="areVisibleCAR"
121
+ <chat-bubble-message class="messages msg_receive" id="message_msg_receive" style="position: relative;"
122
+ [ngClass]="{'has-metadata': (isImage(message) || isFrame(message))}"
123
+ [class.emoticon]="isEmojii(message?.text)"
124
+ [message]="message"
125
+ [textColor]="'black'"
126
+ [addAsCannedResponseTooltipText]="addAsCannedResponseTooltipText"
127
+ [areVisibleCAR]="areVisibleCAR"
121
128
  [support_mode]="support_mode"
122
- [class.emoticon]="message?.emoticon">
129
+ (onBeforeMessageRender)="returnOnBeforeMessageRender($event)"
130
+ (onAfterMessageRender)="returnOnAfterMessageRender($event)"
131
+ (onImageRendered)="onImageRenderedFN($event)"
132
+ >
123
133
  </chat-bubble-message>
124
134
  </div>
125
135
 
126
136
  <!-- message type:: button && -->
127
137
  <div *ngIf="message?.attributes && message?.attributes?.attachment " class="slide-in-left">
128
- <chat-message-attachment style="height: 100%; display: block;" [message]="message"
129
- [isLastMessage]="isLastMessage(message?.uid)" [stylesMap]="stylesMap"
138
+ <chat-message-attachment style="height: 100%; display: block;"
139
+ [message]="message"
140
+ [isLastMessage]="isLastMessage(message?.uid)"
141
+ [stylesMap]="stylesMap"
130
142
  (onAttachmentButtonClicked)="returnOnAttachmentButtonClicked($event)">
131
143
  </chat-message-attachment>
132
144
  </div>
@@ -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 {
@@ -94,8 +96,9 @@ ion-item {
94
96
  .emoticon {
95
97
  background: unset !important;
96
98
  font-size: 4em;
97
- padding-bottom: 21px;
99
+ // padding-bottom: 21px;
98
100
  padding-top: 30px;
101
+ text-align: right;
99
102
  }
100
103
  .has-metadata {
101
104
  max-width: 100% !important;
@@ -297,13 +300,26 @@ ion-item {
297
300
  // emoticon
298
301
  // ---------------------------------------------------------
299
302
 
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
- }
303
+ // :host .base_sent .msg_sent ::ng-deep div > div > div > .chat-text-emoticon > p > p {
304
+ // margin-bottom: 6px !important;
305
+ // margin-right: -7px !important;
306
+ // }
307
+
308
+ // :host .base_receive .msg_receive ::ng-deep div > div > div > .chat-text-emoticon > p > p {
309
+ // margin-bottom: 41px !important;
310
+ // margin-left: -8px !important;
311
+ // margin-top: 49px !important;
312
+ // }
313
+
304
314
 
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;
315
+ // :host .base_sent .msg_sent .emoticon ::ng-deep div > div > div > chat-text > p > p {
316
+ // margin-bottom: 38px;
317
+ // }
318
+
319
+ :host .base_sent .emoticon ::ng-deep div > div > div > chat-text > p > p {
320
+ margin-bottom: 38px;
309
321
  }
322
+
323
+ :host .base_receive .emoticon ::ng-deep div > div > div > chat-text > p > p {
324
+ margin-bottom: 38px;
325
+ }
@@ -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 ? null : 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
  }
@@ -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
  }