@chat21/chat21-ionic 3.0.79-rc.1 → 3.0.79-rc.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # chat21-ionic ver 3.0
2
2
 
3
+ ### 3.0.79-rc.2
4
+ - added: new sound if new conversation is triggered in agent's chat
5
+ - changed: header UI of header-conversation-detail and unassigned-conversations components
6
+
3
7
  ### 3.0.79-rc.1
4
8
  - added: LABEL_ONLINE, LABEL_OFFLINE translations
5
9
  - changed: renamed ddp-header with conversations-list-header
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@chat21/chat21-ionic",
3
3
  "author": "Tiledesk SRL",
4
- "version": "3.0.79-rc.1",
4
+ "version": "3.0.79-rc.2",
5
5
  "license": "MIT License",
6
6
  "homepage": "https://tiledesk.com/",
7
7
  "repository": {
@@ -1,4 +1,4 @@
1
- import { tranlatedLanguage, URL_SOUND_LIST_CONVERSATION } from './../chat21-core/utils/constants';
1
+ import { tranlatedLanguage, URL_SOUND_CONVERSATION_ADDED, URL_SOUND_LIST_CONVERSATION } from './../chat21-core/utils/constants';
2
2
  import { ArchivedConversationsHandlerService } from 'src/chat21-core/providers/abstract/archivedconversations-handler.service';
3
3
  import { AppStorageService } from 'src/chat21-core/providers/abstract/app-storage.service';
4
4
 
@@ -86,11 +86,13 @@ export class AppComponent implements OnInit {
86
86
  public authModal: any;
87
87
 
88
88
  private audio: any;
89
+ private audio_NewConv: any;
89
90
  private setIntervalTime: any;
90
91
  private setTimeoutSound: any;
91
92
  private isTabVisible: boolean = true;
92
93
  private isSoundEnabled: boolean;
93
94
  private hasPlayed: boolean;
95
+ private hasPlayedConversation: boolean;
94
96
  private tabTitle: string;
95
97
  private setTimeoutConversationsEvent: any;
96
98
  private logger: LoggerService = LoggerInstance.getInstance();
@@ -831,6 +833,10 @@ export class AppComponent implements OnInit {
831
833
  this.audio.src = chatBaseUrl + URL_SOUND_LIST_CONVERSATION;
832
834
  this.audio.load();
833
835
 
836
+ this.audio_NewConv = new Audio();
837
+ this.audio_NewConv.src = chatBaseUrl + URL_SOUND_CONVERSATION_ADDED;
838
+ this.audio_NewConv.load();
839
+
834
840
  const sound_status = localStorage.getItem('dshbrd----sound')
835
841
  if(sound_status && sound_status !== 'undefined'){
836
842
  this.isSoundEnabled = sound_status === 'enabled'? true: false
@@ -840,7 +846,7 @@ export class AppComponent implements OnInit {
840
846
 
841
847
  }
842
848
 
843
- private manageTabNotification(badgeNotificationCount?: number) {
849
+ private manageTabNotification(sound_type: string, badgeNotificationCount?: number) {
844
850
  if (!this.isTabVisible) {
845
851
  // TAB IS HIDDEN --> manage title and SOUND
846
852
  let badgeNewConverstionNumber = badgeNotificationCount? badgeNotificationCount : this.conversationsHandlerService.countIsNew()
@@ -864,7 +870,9 @@ export class AppComponent implements OnInit {
864
870
  this.isSoundEnabled = sound_status === 'enabled'? true: false
865
871
  }
866
872
  this.logger.debug('[APP-COMP] manageTabNotification can saund?', this.isInitialized, this.isSoundEnabled)
867
- if(this.isInitialized && this.isSoundEnabled) this.soundMessage()
873
+ if(this.isInitialized && this.isSoundEnabled) {
874
+ sound_type === 'conv_added'? this.soundConversationAdded(): this.soundMessage();
875
+ }
868
876
  }
869
877
 
870
878
  soundMessage() {
@@ -880,7 +888,7 @@ export class AppComponent implements OnInit {
880
888
  // }, 4000);
881
889
 
882
890
  //play sound every 4s from the fist time you receive a conversation added/changed
883
- if(!this.hasPlayed){
891
+ if(!this.hasPlayed && !this.hasPlayedConversation){
884
892
  that.audio.play().then(() => {
885
893
  that.hasPlayed = true
886
894
  that.logger.debug('[APP-COMP] ****** soundMessage played *****');
@@ -892,6 +900,22 @@ export class AppComponent implements OnInit {
892
900
  });
893
901
  }
894
902
  }
903
+
904
+ soundConversationAdded(){
905
+ const that = this;
906
+ console.log('soundConversationAdded ENABLEDDDD-->', this.hasPlayed)
907
+ if(!this.hasPlayedConversation ){
908
+ that.audio_NewConv.play().then(() => {
909
+ that.hasPlayedConversation = true
910
+ that.logger.debug('[APP-COMP] ****** soundConversationAdded played *****');
911
+ setTimeout(() => {
912
+ that.hasPlayedConversation = false
913
+ }, 4000);
914
+ }).catch((error: any) => {
915
+ that.logger.error('[APP-COMP] ***soundConversationAdded error*', error);
916
+ });
917
+ }
918
+ }
895
919
  /**---------------- SOUND FUNCTIONS --> END <--- +*/
896
920
  /***************************************************+*/
897
921
 
@@ -943,7 +967,7 @@ export class AppComponent implements OnInit {
943
967
  this.conversationsHandlerService.conversationAdded.subscribe((conversation: ConversationModel) => {
944
968
  // this.logger.log('[APP-COMP] ***** subscribeConversationAdded *****', conversation);
945
969
  if (conversation && conversation.is_new === true) {
946
- this.manageTabNotification()
970
+ this.manageTabNotification('conv_added')
947
971
  }
948
972
  if(conversation) this.updateConversationsOnStorage()
949
973
  });
@@ -961,7 +985,7 @@ export class AppComponent implements OnInit {
961
985
  this.logger.log('[APP-COMP] ***** subscribeConversationChangedDetailed currentUser: ', currentUser);
962
986
  if (changes.value && changes.value.sender !== currentUser.uid) {
963
987
  if(changes.value.is_new === changes.previousValue.is_new){
964
- this.manageTabNotification();
988
+ this.manageTabNotification('new_message');
965
989
  }
966
990
  }
967
991
  }
@@ -1325,5 +1349,26 @@ export class AppComponent implements OnInit {
1325
1349
  this.isSoundEnabled = event.newValue === 'enabled'? true: false
1326
1350
  }
1327
1351
  }
1352
+
1353
+
1354
+ // @HostListener('mouseenter', ['$event'])
1355
+ // onMouseEnter(event: any) {
1356
+ // console.log('HostListener onMouseEnter-->', event)
1357
+ // }
1358
+
1359
+ // @HostListener('mouseleave', ['$event'])
1360
+ // onMouseLeave(event: any) {
1361
+ // console.log('HostListener onMouseLeave-->', event)
1362
+ // }
1363
+
1364
+ // @HostListener('focus', ['$event'])
1365
+ // onFocus(event: any) {
1366
+ // console.log('HostListener onFocus-->', event)
1367
+ // }
1368
+
1369
+ // @HostListener('blur', ['$event'])
1370
+ // onBlur(event: any) {
1371
+ // console.log('HostListener onBlur-->', event)
1372
+ // }
1328
1373
  }
1329
1374
 
@@ -112,6 +112,7 @@ ion-item {
112
112
  }
113
113
 
114
114
  .conversation_message {
115
+ margin: 5px 0px;
115
116
  p {
116
117
  color: #6e6f73; //#3c4858;
117
118
  font-size: 15px;
@@ -10,8 +10,7 @@
10
10
 
11
11
  <div *ngIf="conversationAvatar" class="avatar-and-typing-wpr" [ngClass]="{'mobile': isMobile}">
12
12
  <!-- [ngStyle] = "{ 'left': platformName === 'ios' ? '55px' : '' }" -->
13
- <div class="avatar-container" style="cursor: pointer"
14
- [ngClass]="{ 'avatar-container-ios': platformName === 'ios' }">
13
+ <div class="avatar-container" [ngClass]="{ 'avatar-container-ios': platformName === 'ios' }">
15
14
  <app-avatar-profile
16
15
  [itemAvatar]=conversationAvatar>
17
16
  </app-avatar-profile>
@@ -141,7 +141,7 @@ ion-header {
141
141
  }
142
142
 
143
143
  .avatar-container {
144
- background-color: #fff;
144
+ // background-color: #fff;
145
145
  color: #fff;
146
146
  text-align: center;
147
147
  width: 44px;
@@ -158,6 +158,12 @@ ion-header {
158
158
  border-width: 0px;
159
159
  line-height: 40px;
160
160
  display: inline-block;
161
+ cursor: pointer;
162
+ }
163
+
164
+ .avatar-container-ios {
165
+ left: 55px;
166
+ top: 10px;
161
167
  }
162
168
 
163
169
  .info-container{
@@ -216,7 +222,4 @@ ion-header {
216
222
  left: 63px;
217
223
  }
218
224
 
219
- .avatar-container-ios {
220
- left: 55px;
221
- top: 10px;
222
- }
225
+
@@ -38,4 +38,4 @@ ion-content {
38
38
  &::-webkit-scrollbar-thumb:hover {
39
39
  background-color: #727272;
40
40
  }
41
- }
41
+ }
@@ -1,5 +1,5 @@
1
1
  <ion-header>
2
- <ion-toolbar>
2
+ <ion-toolbar [class.mobile]="isMobile">
3
3
  <ion-title *ngIf="callerBtn !== 'pinbtn'" style="font-size: 16px;">
4
4
  {{translationMap?.get('UnassignedConversations') }}
5
5
  </ion-title>
@@ -1,3 +1,45 @@
1
+ ion-toolbar {
2
+ height: var(--header-height);
3
+ &:not(.mobile){
4
+ --background: var(--list-bkg-color);
5
+ border: none;
6
+ }
7
+ &.mobile{
8
+ border-bottom: 1px solid rgba(0, 0, 0, 0.05);
9
+ }
10
+
11
+ ion-button{
12
+ --color: var(--basic-blue);
13
+ }
14
+ }
15
+
16
+ ion-content {
17
+ // overwrite inline styles
18
+ --overflow: hidden;
19
+ overflow: scroll;
20
+ &:not(.mobile){
21
+ background: var(--list-bkg-color);
22
+ }
23
+
24
+ &::-webkit-scrollbar {
25
+ width: 6px;
26
+ height: 8px;
27
+ display: none;
28
+ }
29
+
30
+ &::-webkit-scrollbar-track {
31
+ background: #f9f9f9;
32
+ }
33
+ &::-webkit-scrollbar-thumb {
34
+ background-color: #b9b9b9;
35
+ border-radius: 0px;
36
+ }
37
+ &::-webkit-scrollbar-thumb:hover {
38
+ background-color: #727272;
39
+ }
40
+ }
41
+
42
+
1
43
  .ion-content-black-background {
2
44
  --background: #2d323e;
3
45
  }
@@ -16,6 +16,7 @@ export class UnassignedConversationsPage implements OnInit {
16
16
 
17
17
  @Input() iframe_URL: any;
18
18
  @Input() callerBtn: string;
19
+ @Input() isMobile: boolean;
19
20
  // @Input() prjctsxpanel_url: any;
20
21
  // @Input() unassigned_convs_url: any;
21
22
 
@@ -73,7 +73,7 @@ export const TOUCHING_OPERATOR = "TOUCHING_OPERATOR";
73
73
  // URLS
74
74
  // export const URL_SOUND = 'assets/sounds/pling.mp3';
75
75
  export const URL_SOUND_LIST_CONVERSATION = '/assets/sounds/pling.mp3';
76
- export const URL_SOUND_CONVERSATION_DETAIL = '/assets/sounds/justsaying.mp3';
76
+ export const URL_SOUND_CONVERSATION_ADDED = '/assets/sounds/wheep-wheep.mp3';
77
77
  // export const CHAT_SEND_BY_EMAIL_LINK =
78
78
  // 'mailto:?subject=Transcript Chat Conversation&body=Salve,%0D%0A%0D%0Adi
79
79
  // seguito potrà scaricare il transcript della conversazione intercorsa con il nostro servizio di