@chat21/chat21-ionic 3.0.77 → 3.0.78-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.
Files changed (39) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/package.json +1 -1
  3. package/src/app/app.component.scss +1 -1
  4. package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.html +11 -0
  5. package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.scss +45 -0
  6. package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.ts +15 -2
  7. package/src/app/chatlib/conversation-detail/message/info-message/info-message.component.scss +2 -2
  8. package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.html +62 -34
  9. package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.scss +58 -18
  10. package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.ts +14 -10
  11. package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.html +61 -37
  12. package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.scss +56 -28
  13. package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.ts +6 -20
  14. package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component_2.html +1 -1
  15. package/src/app/components/project-item/project-item.component.html +98 -149
  16. package/src/app/components/project-item/project-item.component.scss +39 -32
  17. package/src/app/components/project-item/project-item.component.ts +4 -3
  18. package/src/app/pages/conversation-detail/conversation-detail.page.html +11 -10
  19. package/src/app/pages/conversation-detail/conversation-detail.page.scss +0 -2
  20. package/src/app/pages/conversation-detail/conversation-detail.page.ts +66 -29
  21. package/src/app/pages/conversations-list/conversations-list.page.html +2 -2
  22. package/src/app/pages/conversations-list/conversations-list.page.scss +2 -2
  23. package/src/app/pages/conversations-list/conversations-list.page.ts +7 -0
  24. package/src/assets/i18n/ar.json +268 -265
  25. package/src/assets/i18n/az.json +3 -0
  26. package/src/assets/i18n/de.json +3 -0
  27. package/src/assets/i18n/en.json +3 -0
  28. package/src/assets/i18n/es.json +3 -0
  29. package/src/assets/i18n/fr.json +3 -0
  30. package/src/assets/i18n/it.json +3 -0
  31. package/src/assets/i18n/kk.json +3 -0
  32. package/src/assets/i18n/pt.json +3 -0
  33. package/src/assets/i18n/ru.json +3 -0
  34. package/src/assets/i18n/sr.json +3 -0
  35. package/src/assets/i18n/sv.json +3 -0
  36. package/src/assets/i18n/tr.json +3 -0
  37. package/src/assets/i18n/uk.json +3 -0
  38. package/src/assets/i18n/uz.json +3 -0
  39. package/src/chat21-core/utils/utils.ts +5 -1
@@ -37,10 +37,8 @@
37
37
  [idLoggedUser]="loggedUser.uid"
38
38
  [conversationUid]="conversationWith"
39
39
  [conversationAvatar]="conversationAvatar"
40
- [translationMap]="translationMap"
41
- [isOpenInfoConversation]="isOpenInfoConversation"
42
- [conv_type]="conv_type"
43
- (eventOpenCloseInfoConversation)="returnOpenCloseInfoConversation($event)">
40
+ [translationsMap]="translationsHeaderMap"
41
+ [conv_type]="conv_type">
44
42
  </app-header-conversation-detail>
45
43
 
46
44
  <ion-content id="conv-details">
@@ -125,7 +123,9 @@
125
123
  [senderId]="loggedUser.uid"
126
124
  [baseLocation]="window?.location?.origin"
127
125
  [areVisibleCAR]="areVisibleCAR"
128
- [supportMode]= "supportMode"
126
+ [supportMode]= "supportMode"
127
+ [isMobile]="isMobile"
128
+ [translationMap]="translationsContentMap"
129
129
  [stylesMap]="styleMap"
130
130
  (onBeforeMessageRender)="onBeforeMessageRenderFN($event)"
131
131
  (onAfterMessageRender)="onAfterMessageRenderFN($event)"
@@ -133,7 +133,8 @@
133
133
  (onScrollContent)="returnOnScrollContent($event)"
134
134
  (onMenuOptionShow)="returnOnMenuOption($event)"
135
135
  (onElementRendered)="onElementRenderedFN($event)"
136
- (onAddUploadingBubble)="addUploadingBubbleEvent($event)">
136
+ (onAddUploadingBubble)="addUploadingBubbleEvent($event)"
137
+ (onOpenCloseInfoConversation)="onOpenCloseInfoConversation($event)">
137
138
  </ion-conversation-detail>
138
139
 
139
140
  </ion-content>
@@ -155,7 +156,7 @@
155
156
  [conversationWith]="conversationWith"
156
157
  [conversationWithFullname]="conversationWithFullname"
157
158
  [currentString]="messageStr"
158
- [translationMap]="translationMap"
159
+ [translationMap]="translationsMap"
159
160
  (onLoadedCannedResponses)="onLoadedCannedResponses($event)"
160
161
  (onClickCanned)="replaceTagInMessage($event)"
161
162
  (onClickAddCannedResponse)="presentCreateCannedResponseModal()">
@@ -211,9 +212,9 @@
211
212
  [loggedUser]="loggedUser"
212
213
  [conversationWith]="conversationWith"
213
214
  [tagsCannedFilter]="tagsCannedFilter"
214
- [translationMap]="translationMap"
215
+ [translationMap]="translationsMap"
215
216
  [fileUploadAccept]="appConfigProvider.getConfig().fileUploadAccept"
216
- [isOpenInfoConversation]="isOpenInfoConversation"
217
+ [isOpenInfoConversation]="openInfoConversation"
217
218
  [dropEvent]="dropEvent"
218
219
  [disableTextarea]="disableTextarea"
219
220
  (eventChangeTextArea)="returnChangeTextArea($event)"
@@ -230,7 +231,7 @@
230
231
  [ngClass]="{'info-convs-apps-sidebar-wide': appsidebarIsWide === true}">
231
232
  <app-info-content
232
233
  [openInfoConversation]="openInfoConversation"
233
- [translationMap]="translationMap"
234
+ [translationMap]="translationsMap"
234
235
  [loggedUser]="loggedUser"
235
236
  [tenant]="tenant"
236
237
  [groupDetail]="groupDetail">
@@ -25,8 +25,6 @@
25
25
  font-size: 24px;
26
26
  }
27
27
 
28
-
29
-
30
28
  #canned > ion-list > ion-item.canned-item.add-canned-response-wpr:hover > span {
31
29
  color: #1877f2;
32
30
  }
@@ -113,14 +113,15 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
113
113
  public lastConnectionDate: string
114
114
  public showMessageWelcome: boolean
115
115
  public openInfoConversation = false
116
- public openInfoMessage: boolean // check is open info message
117
116
  public isMobile = false
118
117
  public isLessThan991px = false // nk added
119
118
  public isTyping = false
120
119
  public nameUserTypingNow: string
121
120
 
122
121
  public heightMessageTextArea = ''
123
- public translationMap: Map<string, string>
122
+ public translationsMap: Map<string, string> = new Map()
123
+ public translationsHeaderMap: Map<string, string> = new Map()
124
+ public translationsContentMap: Map<string, string> = new Map()
124
125
  public conversationAvatar: any
125
126
  public membersConversation: any
126
127
  public member: UserModel
@@ -148,7 +149,6 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
148
149
  //SOUND
149
150
  setTimeoutSound: any;
150
151
  audio: any;
151
- isOpenInfoConversation: boolean;
152
152
  USER_HAS_OPENED_CLOSE_INFO_CONV: boolean = false;
153
153
  isHovering: boolean = false;
154
154
  conversation_count: number;
@@ -336,7 +336,12 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
336
336
  // this.updateConversationBadge()
337
337
  // }
338
338
  if(conv.uid && conv.uid === this.conversationWith){
339
- this.conversationAvatar = setConversationAvatar(conv.conversation_with,conv.conversation_with_fullname,conv.channel_type)
339
+ this.conversationAvatar = setConversationAvatar(
340
+ conv.conversation_with,
341
+ conv.conversation_with_fullname,
342
+ conv.channel_type,
343
+ conv.attributes['projectId'],
344
+ conv.attributes['project_name'])
340
345
  }
341
346
 
342
347
  }
@@ -488,7 +493,6 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
488
493
 
489
494
  this.messages = [] // list messages of conversation
490
495
  this.isFileSelected = false // indicates if a file has been selected (image to upload)
491
- this.openInfoMessage = false // indicates whether the info message panel is open
492
496
 
493
497
  if (checkPlatformIsMobile()) {
494
498
  this.isMobile = true
@@ -504,13 +508,11 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
504
508
  if (checkWindowWidthIsLessThan991px()) {
505
509
  this.logger.log('[CONVS-DETAIL] - initialize -> checkWindowWidthIsLessThan991px ', checkWindowWidthIsLessThan991px())
506
510
  this.openInfoConversation = false // indica se è aperto il box info conversazione
507
- this.isOpenInfoConversation = false
508
- this.logger.log('[CONVS-DETAIL] - initialize -> openInfoConversation ', this.openInfoConversation, ' -> isOpenInfoConversation ', this.isOpenInfoConversation)
511
+ this.logger.log('[CONVS-DETAIL] - initialize -> openInfoConversation ', this.openInfoConversation)
509
512
  } else {
510
513
  this.logger.log('[CONVS-DETAIL] - initialize -> checkWindowWidthIsLessThan991px ', checkWindowWidthIsLessThan991px())
511
514
  this.openInfoConversation = true
512
- this.isOpenInfoConversation = true
513
- this.logger.log('[CONVS-DETAIL] - initialize -> openInfoConversation ', this.openInfoConversation, ' -> isOpenInfoConversation ', this.isOpenInfoConversation)
515
+ this.logger.log('[CONVS-DETAIL] - initialize -> openInfoConversation ', this.openInfoConversation)
514
516
  }
515
517
  }
516
518
 
@@ -563,22 +565,12 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
563
565
  })
564
566
  }
565
567
 
566
- returnOpenCloseInfoConversation(openInfoConversation: boolean) {
567
- this.logger.log('[CONVS-DETAIL] returnOpenCloseInfoConversation - openInfoConversation ', openInfoConversation)
568
- this.resizeTextArea()
569
- this.openInfoMessage = false
570
- this.openInfoConversation = openInfoConversation
571
- this.isOpenInfoConversation = openInfoConversation
572
- this.USER_HAS_OPENED_CLOSE_INFO_CONV = true
573
- }
574
-
575
568
  @HostListener('window:resize', ['$event'])
576
569
  onResize(event: any) {
577
570
  const newInnerWidth = event.target.innerWidth
578
571
  if (newInnerWidth < 991) {
579
572
  if (this.USER_HAS_OPENED_CLOSE_INFO_CONV === false) {
580
573
  this.openInfoConversation = false
581
- this.isOpenInfoConversation = false
582
574
  }
583
575
  }
584
576
  }
@@ -616,11 +608,34 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
616
608
  'THERE_ARE_NO_CANNED_RESPONSES_AVAILABLE',
617
609
  'TO_CREATE_THEM_GO_TO_THE_PROJECT',
618
610
  "AddNewCannedResponse",
619
- "LABEL_LOADING"
611
+ "LABEL_LOADING",
612
+ "DIRECT_CHAT",
613
+ "GROUP_CHAT",
620
614
  ]
621
615
 
622
- this.translationMap = this.customTranslateService.translateLanguage(keys)
623
- this.logger.log('[CONVS-DETAIL] x this.translationMap ',this.translationMap)
616
+ const keysHeader = [
617
+ 'DIRECT_CHAT',
618
+ 'GROUP_CHAT',
619
+ 'LABEL_IS_WRITING',
620
+ 'LABEL_AVAILABLE',
621
+ 'LABEL_NOT_AVAILABLE',
622
+ 'LABEL_INACTIVE',
623
+ 'LABEL_TODAY',
624
+ 'LABEL_TOMORROW',
625
+ 'LABEL_TO',
626
+ 'LABEL_LAST_ACCESS',
627
+ 'ARRAY_DAYS',
628
+ ]
629
+
630
+ const keysContentDetail = [
631
+ 'LABEL_OPEN_INFO_CONVERSATION',
632
+ 'LABEL_CLOSE_GROUP'
633
+ ]
634
+
635
+ this.translationsMap = this.customTranslateService.translateLanguage(keys)
636
+ this.translationsHeaderMap = this.customTranslateService.translateLanguage(keysHeader)
637
+ this.translationsContentMap = this.customTranslateService.translateLanguage(keysContentDetail)
638
+ this.logger.log('[CONVS-DETAIL] x this.translationMap ',this.translationsMap)
624
639
  }
625
640
 
626
641
  // --------------------------------------------------------
@@ -749,6 +764,8 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
749
764
  conv.conversation_with,
750
765
  conv.conversation_with_fullname,
751
766
  conv.channel_type,
767
+ conv.attributes['projectId'],
768
+ conv.attributes['project_name']
752
769
  )
753
770
  }
754
771
  if(!conv){
@@ -761,6 +778,8 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
761
778
  conv.conversation_with,
762
779
  conv.conversation_with_fullname,
763
780
  conv.channel_type,
781
+ conv.attributes['projectId'],
782
+ conv.attributes['project_name']
764
783
  )
765
784
  let duration = getDateDifference(conv.timestamp, Date.now())
766
785
  duration.days > 10? this.disableTextarea = true: this.disableTextarea = false
@@ -779,6 +798,8 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
779
798
  conv.conversation_with,
780
799
  conv.conversation_with_fullname,
781
800
  conv.channel_type,
801
+ conv.attributes['projectId'],
802
+ conv.attributes['project_name']
782
803
  )
783
804
  let duration = getDateDifference(conv.timestamp, Date.now())
784
805
  duration.days > 10? this.disableTextarea = true: this.disableTextarea = false
@@ -790,6 +811,8 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
790
811
  conv.conversation_with,
791
812
  conv.conversation_with_fullname,
792
813
  conv.channel_type,
814
+ conv.attributes['projectId'],
815
+ conv.attributes['project_name']
793
816
  )
794
817
  }
795
818
  this.logger.log('[CONVS-DETAIL] - setHeaderContent > conversationAvatar: ', this.conversationAvatar)
@@ -1024,7 +1047,9 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
1024
1047
  this.conversationAvatar = setConversationAvatar(
1025
1048
  this.conversationWith,
1026
1049
  this.conversationWithFullname,
1027
- this.channelType
1050
+ this.channelType,
1051
+ this.conversation.attributes['projectId'],
1052
+ this.conversation.attributes['project_name']
1028
1053
  )
1029
1054
 
1030
1055
  }
@@ -1147,7 +1172,7 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
1147
1172
  setTimeout(() => {
1148
1173
  if (this.conversationWith.startsWith('support-group')) {
1149
1174
  const pos = message.lastIndexOf('/')
1150
- this.logger.log('[CONVS-DETAIL] - returnChangeTextArea - canned responses pos of / (using lastIndexOf) ', pos)
1175
+ this.logger.log('[CONVS-DETAIL] - returnChangeTextArea - canned responses pos of / (using lastIndexOf) ', message, pos)
1151
1176
 
1152
1177
  if (pos === -1) {
1153
1178
  // this.tagsCannedFilter = []
@@ -1172,7 +1197,7 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
1172
1197
  // --------------------------------------------
1173
1198
  // Load canned responses
1174
1199
  // --------------------------------------------
1175
- this.HIDE_CANNED_RESPONSES = false
1200
+ // this.HIDE_CANNED_RESPONSES = false
1176
1201
  this.messageStr = strSearch
1177
1202
  // ------------------------------------------------------------------------------------------------------------------------------------------
1178
1203
  // Hide / display Canned when the SLASH has POSITION POS 0 and checking if there is a space after the SLASH (in this case it will be hidden)
@@ -1201,13 +1226,17 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
1201
1226
  this.logger.log('[CONVS-DETAIL] - returnChangeTextArea --> beforeSlash', beforeSlash)
1202
1227
  this.logger.log('[CONVS-DETAIL] - returnChangeTextArea --> afterSlash', afterSlash)
1203
1228
 
1229
+ console.log('bbbbbbb', beforeSlash[beforeSlash.length-1].indexOf(' '), afterSlash === '', this.HIDE_CANNED_RESPONSES)
1204
1230
 
1205
- if(beforeSlash[beforeSlash.length-1].indexOf(' ') >= 0 && afterSlash[0] === ''){
1231
+ if(beforeSlash[beforeSlash.length-1].indexOf(' ') >= 0 && afterSlash === ''){
1206
1232
  this.HIDE_CANNED_RESPONSES = false
1207
- } else if(beforeSlash[beforeSlash.length-1].indexOf(' ') < 0 && afterSlash[0] === '' ){
1233
+ console.log('bbbbbbb 1111', beforeSlash[beforeSlash.length-1])
1234
+ } else if(beforeSlash[beforeSlash.length-1].indexOf(' ') < 0 && afterSlash === '' ){
1208
1235
  this.HIDE_CANNED_RESPONSES = true
1209
- } else if(beforeSlash[beforeSlash.length-1].indexOf(' ') >= 0 && afterSlash[0] === ' '){
1236
+ console.log('bbbbbbb 22222', beforeSlash[beforeSlash.length-1])
1237
+ } else if(beforeSlash[beforeSlash.length-1].indexOf(' ') >= 0 && afterSlash === ' '){
1210
1238
  this.HIDE_CANNED_RESPONSES = true
1239
+ console.log('bbbbbbb 33333', beforeSlash[beforeSlash.length-1])
1211
1240
  // this.tagsCannedFilter = []
1212
1241
  }
1213
1242
  }
@@ -1497,6 +1526,13 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
1497
1526
  }
1498
1527
  }
1499
1528
 
1529
+ onOpenCloseInfoConversation(event){
1530
+ this.logger.log('[CONVS-DETAIL] onOpenCloseInfoConversation - openInfoConversation ', event)
1531
+ this.resizeTextArea()
1532
+ this.openInfoConversation = event
1533
+ this.USER_HAS_OPENED_CLOSE_INFO_CONV = true
1534
+ }
1535
+
1500
1536
  // -------------- START SCROLL/RESIZE -------------- //
1501
1537
  /** */
1502
1538
  resizeTextArea() {
@@ -1598,6 +1634,7 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
1598
1634
  this.heightMessageTextArea = '57' // NK edited
1599
1635
  }
1600
1636
  }
1637
+
1601
1638
  checkAcceptedFile(draggedFileMimeType) {
1602
1639
  let isAcceptFile = false
1603
1640
  this.logger.log('[CONVS-DETAIL] > checkAcceptedFile - fileUploadAccept: ',this.appConfigProvider.getConfig().fileUploadAccept)
@@ -1706,7 +1743,7 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
1706
1743
 
1707
1744
  async presentToastOnlyImageFilesAreAllowedToDrag() {
1708
1745
  const toast = await this.toastController.create({
1709
- message: this.translationMap.get('FAILED_TO_UPLOAD_THE_FORMAT_IS_NOT_SUPPORTED'),
1746
+ message: this.translationsMap.get('FAILED_TO_UPLOAD_THE_FORMAT_IS_NOT_SUPPORTED'),
1710
1747
  duration: 5000,
1711
1748
  color: 'danger',
1712
1749
  cssClass: 'toast-custom-class',
@@ -22,14 +22,14 @@
22
22
  <ion-list>
23
23
 
24
24
  <!-- supportMode && -->
25
- <ion-item *ngIf="displayNewConvsItem && conversationType !=='archived' && supportMode" class="ion-no-padding open-iframe-item">
25
+ <ion-item *ngIf="displayNewConvsItem && conversationType !=='archived' && supportMode" class="ion-no-padding open-iframe-item" lines="none">
26
26
  <div tabindex="0"></div>
27
27
  <!-- <ion-note class="pinned-project">
28
28
  {{ 'PINNED_PROJECT' | translate }}
29
29
  </ion-note> -->
30
30
 
31
31
  <app-project-item
32
- style="width: 100%;"
32
+ style="width: 100%; margin: 0px 8px; border-bottom: 1px dashed #d3dbe5;"
33
33
  (openUnsevedConvsEvent)="openUnsevedConversationIframe($event)"
34
34
  (projectIdEvent)="getLastProjectId($event)">
35
35
  </app-project-item>
@@ -43,7 +43,7 @@ ion-list {
43
43
 
44
44
  ion-item {
45
45
  cursor: pointer;
46
- height: 64px;
46
+ // height: 64px;
47
47
  position: relative;
48
48
  display: flex;
49
49
  text-decoration: none;
@@ -324,7 +324,7 @@ ion-list {
324
324
  padding-left: 0px !important ;
325
325
  padding-right: 0px !important;
326
326
  // height: 55px !important;
327
- border-bottom: 1px solid rgba(0, 0, 0, 0.05);
327
+ // border-bottom: 1px solid rgba(0, 0, 0, 0.05);
328
328
  --background-hover: #ffffff;
329
329
  cursor:default !important;
330
330
  }
@@ -753,6 +753,13 @@ export class ConversationListPage implements OnInit {
753
753
  }
754
754
  }
755
755
 
756
+ if(conversation.attributes && conversation.attributes['projectId']){
757
+ let project = localStorage.getItem(conversation.attributes['projectId'])
758
+ if(project){
759
+ project = JSON.parse(project)
760
+ conversation.attributes.project_name = project['name']
761
+ }
762
+ }
756
763
  // if(conversation.conversation_with_fullname === 'Guest '){
757
764
  // conversation.conversation_with_fullname = 'guest' + '#' + this.getUUidConversation(conversation.uid)
758
765
  // }