@chat21/chat21-ionic 3.0.81 → 3.0.82-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 (151) hide show
  1. package/CHANGELOG.md +88 -4
  2. package/README.md +2 -2
  3. package/deploy_amazon_beta.sh +29 -0
  4. package/deploy_amazon_prod.sh +30 -0
  5. package/package.json +2 -2
  6. package/src/app/app.component.html +7 -1
  7. package/src/app/app.component.scss +20 -2
  8. package/src/app/app.component.ts +128 -18
  9. package/src/app/app.module.ts +3 -1
  10. package/src/app/chatlib/conversation-detail/conversation-content/conversation-content.component.ts +8 -1
  11. package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.html +77 -23
  12. package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.scss +171 -88
  13. package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.ts +40 -2
  14. package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.html +11 -24
  15. package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.scss +6 -10
  16. package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.spec.ts +2 -2
  17. package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.ts +16 -25
  18. package/src/app/chatlib/conversation-detail/message/buttons/action-button/action-button.component.html +5 -1
  19. package/src/app/chatlib/conversation-detail/message/buttons/action-button/action-button.component.scss +22 -15
  20. package/src/app/chatlib/conversation-detail/message/buttons/action-button/action-button.component.ts +25 -5
  21. package/src/app/chatlib/conversation-detail/message/buttons/link-button/link-button.component.html +2 -1
  22. package/src/app/chatlib/conversation-detail/message/buttons/link-button/link-button.component.scss +14 -15
  23. package/src/app/chatlib/conversation-detail/message/buttons/link-button/link-button.component.ts +24 -5
  24. package/src/app/chatlib/conversation-detail/message/buttons/text-button/text-button.component.html +6 -1
  25. package/src/app/chatlib/conversation-detail/message/buttons/text-button/text-button.component.scss +12 -13
  26. package/src/app/chatlib/conversation-detail/message/buttons/text-button/text-button.component.ts +26 -5
  27. package/src/app/chatlib/conversation-detail/message/frame/frame.component.html +8 -2
  28. package/src/app/chatlib/conversation-detail/message/frame/frame.component.scss +36 -0
  29. package/src/app/chatlib/conversation-detail/message/frame/frame.component.ts +2 -2
  30. package/src/app/chatlib/conversation-detail/message/html/html.component.ts +0 -1
  31. package/src/app/chatlib/conversation-detail/message/image/image.component.html +3 -2
  32. package/src/app/chatlib/conversation-detail/message/image/image.component.scss +17 -5
  33. package/src/app/chatlib/conversation-detail/message/image/image.component.ts +1 -1
  34. package/src/app/chatlib/conversation-detail/message/info-message/info-message.component.scss +3 -2
  35. package/src/app/chatlib/conversation-detail/message/message-attachment/message-attachment.component.html +16 -6
  36. package/src/app/chatlib/conversation-detail/message/message-attachment/message-attachment.component.scss +1 -3
  37. package/src/app/chatlib/conversation-detail/message/message-attachment/message-attachment.component.ts +2 -0
  38. package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.html +78 -52
  39. package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.scss +63 -20
  40. package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.ts +14 -10
  41. package/src/app/components/canned-response/canned-response.component.html +7 -7
  42. package/src/app/components/canned-response/canned-response.component.scss +10 -4
  43. package/src/app/components/canned-response/canned-response.component.ts +1 -1
  44. package/src/app/components/contacts-directory/contacts-directory.component.html +22 -26
  45. package/src/app/components/contacts-directory/contacts-directory.component.scss +8 -6
  46. package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.html +61 -42
  47. package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.scss +98 -61
  48. package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.ts +9 -25
  49. package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component_2.html +116 -0
  50. package/src/app/components/conversation-detail/message-text-area/message-text-area.component.html +8 -6
  51. package/src/app/components/conversation-detail/message-text-area/message-text-area.component.scss +4 -4
  52. package/src/app/components/conversation-detail/message-text-area/message-text-area.component.ts +24 -84
  53. package/src/app/components/conversation-info/info-content/info-content.component.html +2 -1
  54. package/src/app/components/conversation-info/info-content/info-content.component.ts +3 -2
  55. package/src/app/components/conversation-info/info-direct/info-direct.component.html +1 -9
  56. package/src/app/components/conversation-info/info-direct/info-direct.component.ts +0 -2
  57. package/src/app/components/conversation-info/info-group/info-group.component.html +44 -108
  58. package/src/app/components/conversation-info/info-group/info-group.component.scss +101 -61
  59. package/src/app/components/conversation-info/info-group/info-group.component.ts +1 -0
  60. package/src/app/components/{ddp-header/ddp-header.component.html → conversations-list/header-conversations-list/header-conversations-list.component.html} +3 -3
  61. package/src/app/components/{ddp-header/ddp-header.component.scss → conversations-list/header-conversations-list/header-conversations-list.component.scss} +16 -4
  62. package/src/app/components/{conversation-detail/bubble-my-message/bubble-my-message.component.spec.ts → conversations-list/header-conversations-list/header-conversations-list.component.spec.ts} +6 -6
  63. package/src/app/components/{ddp-header/ddp-header.component.ts → conversations-list/header-conversations-list/header-conversations-list.component.ts} +7 -16
  64. package/src/app/components/conversations-list/header-conversations-list-archived/header-conversations-list-archived.component.html +12 -0
  65. package/src/app/components/conversations-list/header-conversations-list-archived/header-conversations-list-archived.component.scss +14 -0
  66. package/src/app/components/{conversation-detail/option-header/option-header.component.spec.ts → conversations-list/header-conversations-list-archived/header-conversations-list-archived.component.spec.ts} +5 -5
  67. package/src/app/components/{conversation-detail/option-header/option-header.component.ts → conversations-list/header-conversations-list-archived/header-conversations-list-archived.component.ts} +5 -4
  68. package/src/app/components/navbar/navbar.component.html +103 -0
  69. package/src/app/components/navbar/navbar.component.scss +249 -0
  70. package/src/app/components/{ddp-header/ddp-header.component.spec.ts → navbar/navbar.component.spec.ts} +6 -6
  71. package/src/app/components/navbar/navbar.component.ts +189 -0
  72. package/src/app/components/project-item/project-item.component.html +98 -149
  73. package/src/app/components/project-item/project-item.component.scss +43 -35
  74. package/src/app/components/project-item/project-item.component.ts +16 -4
  75. package/src/app/components/sidebar-user-details/sidebar-user-details.component.html +3 -3
  76. package/src/app/components/sidebar-user-details/sidebar-user-details.component.scss +1 -1
  77. package/src/app/components/sidebar-user-details/sidebar-user-details.component.ts +2 -7
  78. package/src/app/components/utils/user-presence/user-presence.component.html +7 -2
  79. package/src/app/components/utils/user-presence/user-presence.component.scss +35 -18
  80. package/src/app/components/utils/user-presence/user-presence.component.ts +6 -10
  81. package/src/app/pages/contacts-directory/contacts-directory.page.html +1 -1
  82. package/src/app/pages/contacts-directory/contacts-directory.page.scss +47 -0
  83. package/src/app/pages/contacts-directory/contacts-directory.page.ts +2 -0
  84. package/src/app/pages/conversation-detail/conversation-detail.module.ts +0 -8
  85. package/src/app/pages/conversation-detail/conversation-detail.page.html +41 -23
  86. package/src/app/pages/conversation-detail/conversation-detail.page.scss +40 -250
  87. package/src/app/pages/conversation-detail/conversation-detail.page.ts +182 -110
  88. package/src/app/pages/conversations-list/conversations-list.page.html +11 -8
  89. package/src/app/pages/conversations-list/conversations-list.page.scss +18 -2
  90. package/src/app/pages/conversations-list/conversations-list.page.ts +25 -22
  91. package/src/app/pages/create-canned-response/create-canned-response.page.ts +13 -13
  92. package/src/app/pages/loader-preview/loader-preview.page.html +1 -1
  93. package/src/app/pages/loader-preview/loader-preview.page.scss +4 -0
  94. package/src/app/pages/loader-preview/loader-preview.page.ts +1 -2
  95. package/src/app/pages/profile-info/profile-info.page.html +2 -4
  96. package/src/app/pages/unassigned-conversations/unassigned-conversations.page.html +1 -1
  97. package/src/app/pages/unassigned-conversations/unassigned-conversations.page.scss +42 -0
  98. package/src/app/pages/unassigned-conversations/unassigned-conversations.page.ts +1 -0
  99. package/src/app/services/canned-responses/canned-responses.service.ts +26 -0
  100. package/src/app/services/projects/projects.service.spec.ts +12 -0
  101. package/src/app/services/projects/projects.service.ts +43 -0
  102. package/src/app/services/tiledesk/tiledesk.service.ts +4 -26
  103. package/src/app/shared/shared.module.ts +24 -33
  104. package/src/assets/i18n/ar.json +278 -265
  105. package/src/assets/i18n/az.json +14 -1
  106. package/src/assets/i18n/de.json +15 -2
  107. package/src/assets/i18n/en.json +15 -2
  108. package/src/assets/i18n/es.json +15 -2
  109. package/src/assets/i18n/fr.json +14 -1
  110. package/src/assets/i18n/it.json +14 -1
  111. package/src/assets/i18n/kk.json +15 -2
  112. package/src/assets/i18n/pt.json +15 -2
  113. package/src/assets/i18n/ru.json +14 -1
  114. package/src/assets/i18n/sr.json +277 -264
  115. package/src/assets/i18n/sv.json +15 -2
  116. package/src/assets/i18n/tr.json +15 -2
  117. package/src/assets/i18n/uk.json +15 -2
  118. package/src/assets/i18n/uz.json +14 -1
  119. package/src/assets/js/chat21client.js +176 -149
  120. package/src/assets/sounds/interface-start.mp3 +0 -0
  121. package/src/assets/sounds/wheep-wheep.mp3 +0 -0
  122. package/src/chat-config-native-mqtt.json +3 -0
  123. package/src/chat21-core/models/conversation.ts +0 -1
  124. package/src/chat21-core/models/projects.ts +27 -0
  125. package/src/chat21-core/providers/firebase/firebase-typing.service.ts +7 -9
  126. package/src/chat21-core/utils/constants.ts +6 -1
  127. package/src/chat21-core/utils/convertRequestToConversation.ts +41 -0
  128. package/src/chat21-core/utils/user-typing/user-typing.component.html +8 -5
  129. package/src/chat21-core/utils/user-typing/user-typing.component.scss +87 -17
  130. package/src/chat21-core/utils/user-typing/user-typing.component.ts +12 -94
  131. package/src/chat21-core/utils/utils.ts +38 -10
  132. package/src/global.scss +52 -255
  133. package/src/index.html +0 -9
  134. package/src/variables.scss +30 -10
  135. package/src/app/components/conversation-detail/bubble-day-message/bubble-day-message.component.html +0 -3
  136. package/src/app/components/conversation-detail/bubble-day-message/bubble-day-message.component.scss +0 -21
  137. package/src/app/components/conversation-detail/bubble-day-message/bubble-day-message.component.spec.ts +0 -24
  138. package/src/app/components/conversation-detail/bubble-day-message/bubble-day-message.component.ts +0 -14
  139. package/src/app/components/conversation-detail/bubble-my-message/bubble-my-message.component.html +0 -54
  140. package/src/app/components/conversation-detail/bubble-my-message/bubble-my-message.component.scss +0 -98
  141. package/src/app/components/conversation-detail/bubble-my-message/bubble-my-message.component.ts +0 -84
  142. package/src/app/components/conversation-detail/bubble-others-message/bubble-others-message.component.html +0 -30
  143. package/src/app/components/conversation-detail/bubble-others-message/bubble-others-message.component.scss +0 -83
  144. package/src/app/components/conversation-detail/bubble-others-message/bubble-others-message.component.spec.ts +0 -24
  145. package/src/app/components/conversation-detail/bubble-others-message/bubble-others-message.component.ts +0 -68
  146. package/src/app/components/conversation-detail/bubble-system-message/bubble-system-message.component.html +0 -3
  147. package/src/app/components/conversation-detail/bubble-system-message/bubble-system-message.component.scss +0 -10
  148. package/src/app/components/conversation-detail/bubble-system-message/bubble-system-message.component.spec.ts +0 -24
  149. package/src/app/components/conversation-detail/bubble-system-message/bubble-system-message.component.ts +0 -14
  150. package/src/app/components/conversation-detail/option-header/option-header.component.html +0 -13
  151. package/src/app/components/conversation-detail/option-header/option-header.component.scss +0 -0
@@ -28,5 +28,8 @@
28
28
  "dashboardUrl": "https://console.native.tiledesk.com/dashboard/",
29
29
  "testsiteBaseUrl":"https://console.native.tiledesk.com/widget/assets/twp/index.html",
30
30
  "authPersistence": "LOCAL",
31
+ "supportMode": true,
32
+ "archivedButton": true,
33
+ "writeToButton": true,
31
34
  "wsUrl":"wss://console.native.tiledesk.com/mqws/ws"
32
35
  }
@@ -16,7 +16,6 @@ export class ConversationModel {
16
16
  public sender_fullname: string,
17
17
  public status: string,
18
18
  public timestamp: number,
19
- public time_last_message: string,
20
19
  // public selected: boolean,
21
20
  public color: string,
22
21
  public avatar: string,
@@ -0,0 +1,27 @@
1
+ export interface Project {
2
+ _id: string;
3
+ updatedAt?: any;
4
+ createdAt?: any;
5
+ name?: string;
6
+ activeOperatingHours?: boolean;
7
+ operatingHours?: any
8
+ createdBy?: string;
9
+ id_project?: any;
10
+ widget?: any;
11
+ settings?: any;
12
+ role?: string;
13
+ user_available?: boolean;
14
+ profile_name?: any;
15
+ profile_agents?: any;
16
+ trial_expired?: any;
17
+ trial_days_left?: number;
18
+ trial_days?: number;
19
+ profile_type?: string;
20
+ subscription_is_active?: any;
21
+ profile?: any;
22
+ subscription_end_date?: any;
23
+ subscription_id?: any;
24
+ subscription_creation_date?: any;
25
+ subscription_start_date?: any;
26
+ __v?: any;
27
+ }
@@ -12,11 +12,11 @@ import 'firebase/database';
12
12
  import { TypingService } from '../abstract/typing.service';
13
13
  import { CustomLogger } from '../logger/customLogger';
14
14
  import { LoggerInstance } from '../logger/loggerInstance';
15
+ import { TIME_TYPING_MESSAGE } from 'src/chat21-core/utils/constants';
15
16
 
16
17
 
17
18
  export class TypingModel {
18
19
 
19
-
20
20
  constructor(
21
21
  public uid: string,
22
22
  public timestamp: any,
@@ -35,14 +35,11 @@ export class FirebaseTypingService extends TypingService {
35
35
  BSIsTyping: BehaviorSubject<any> = new BehaviorSubject<any>(null);
36
36
  BSSetTyping: BehaviorSubject<any> = new BehaviorSubject<any>(null);
37
37
 
38
- // public params
39
- // public tenant: string;
40
- private tenant: string;
41
-
42
- // private params
43
38
  private urlNodeTypings: string;
44
39
  private setTimeoutWritingMessages: any;
40
+ private tenant: string;
45
41
  private logger: LoggerService = LoggerInstance.getInstance();
42
+ private ref: firebase.database.Query;
46
43
 
47
44
  constructor() {
48
45
  super();
@@ -64,10 +61,11 @@ export class FirebaseTypingService extends TypingService {
64
61
  urlTyping = this.urlNodeTypings + idCurrentUser + '/' + idConversation;
65
62
  }
66
63
  this.logger.debug('[FIREBASETypingSERVICE] urlTyping: ', urlTyping);
67
- const ref = firebase.database().ref(urlTyping);
68
- ref.on('child_changed', (childSnapshot) => {
64
+ this.ref = firebase.database().ref(urlTyping);
65
+ this.ref.on('child_changed', (childSnapshot) => {
69
66
  const precence: TypingModel = childSnapshot.val();
70
- this.BSIsTyping.next({uid: idConversation, uidUserTypingNow: precence.uid, nameUserTypingNow: precence.name});
67
+ this.logger.debug('[FIREBASETypingSERVICE] child_changed: ', precence);
68
+ this.BSIsTyping.next({uid: idConversation, uidUserTypingNow: precence.uid, nameUserTypingNow: precence.name, waitTime: TIME_TYPING_MESSAGE});
71
69
  });
72
70
  }
73
71
 
@@ -43,8 +43,12 @@ export const CHANNEL_TYPE_GROUP = 'group';
43
43
  // TYPES MESSAGES
44
44
  export const TYPE_MSG_TEXT = 'text';
45
45
  export const TYPE_MSG_IMAGE = 'image';
46
+ export const TYPE_MSG_FILE = 'file';
47
+ export const TYPE_MSG_BUTTON = 'button';
48
+
46
49
  export const MAX_WIDTH_IMAGES = 300;
47
50
  export const MIN_WIDTH_IMAGES = 130;
51
+ export const TIME_TYPING_MESSAGE = 2000;
48
52
  export const TYPE_DIRECT = 'direct';
49
53
  export const TYPE_GROUP = 'group';
50
54
  export const SYSTEM = 'system';
@@ -69,7 +73,8 @@ export const TOUCHING_OPERATOR = "TOUCHING_OPERATOR";
69
73
  // URLS
70
74
  // export const URL_SOUND = 'assets/sounds/pling.mp3';
71
75
  export const URL_SOUND_LIST_CONVERSATION = '/assets/sounds/pling.mp3';
72
- export const URL_SOUND_CONVERSATION_DETAIL = '/assets/sounds/justsaying.mp3';
76
+ export const URL_SOUND_CONVERSATION_ADDED = '/assets/sounds/wheep-wheep.mp3';
77
+ export const URL_SOUND_CONVERSATION_UNASSIGNED = '/assets/sounds/interface-start.mp3'
73
78
  // export const CHAT_SEND_BY_EMAIL_LINK =
74
79
  // 'mailto:?subject=Transcript Chat Conversation&body=Salve,%0D%0A%0D%0Adi
75
80
  // seguito potrà scaricare il transcript della conversazione intercorsa con il nostro servizio di
@@ -0,0 +1,41 @@
1
+ import { TYPE_DIRECT, TYPE_SUPPORT_GROUP } from 'src/chat21-core/utils/constants';
2
+ import { ConversationModel } from 'src/chat21-core/models/conversation';
3
+ import { Inject, Injectable, OnInit } from '@angular/core';
4
+ import { avatarPlaceholder, getColorBck } from './utils-user';
5
+ import moment from 'moment';
6
+
7
+ @Injectable()
8
+ export class ConvertRequestToConversation {
9
+
10
+
11
+
12
+ initialize(){
13
+
14
+ }
15
+
16
+ getConvFromRequest(request: any): ConversationModel{
17
+ return new ConversationModel(
18
+ request.request_id,
19
+ request.attributes,
20
+ request.request_id && (request.request_id.startsWith('group-') || request.request_id.startsWith('support-group'))? TYPE_SUPPORT_GROUP: TYPE_DIRECT,
21
+ request.lead && request.lead.fullname ? request.lead.fullname: null,
22
+ request.requester_id,
23
+ request.lead && request.lead.fullname ? request.lead.fullname: null,
24
+ request.requester_id,
25
+ '',
26
+ true,
27
+ request.first_text,
28
+ request.first_text,
29
+ request.requester_id,
30
+ '',
31
+ request.lead && request.lead.fullname ? request.lead.fullname: null,
32
+ '0',
33
+ moment(request.createdAt).unix(),
34
+ getColorBck(request.lead.fullname),
35
+ avatarPlaceholder(request.lead.fullname),
36
+ false,
37
+ 'text'
38
+ );
39
+ }
40
+
41
+ }
@@ -1,6 +1,9 @@
1
- <div class="tile-typing-now" [class.active]="isTyping">
2
- <span *ngIf="nameUserTypingNow">
3
- {{nameUserTypingNow}}
4
- </span>
5
- {{ translationMap?.get('LABEL_IS_WRITING') }}
1
+ <div class="tile-typing-now" *ngIf="typingLocation === 'header'">
2
+ <span *ngIf="nameUserTypingNow">{{nameUserTypingNow}} </span>
3
+ {{ translationMap?.get('LABEL_WRITING') }}
4
+ </div>
5
+ <div class="spinner" *ngIf="typingLocation === 'content'">
6
+ <div class="bounce1"></div>
7
+ <div class="bounce2"></div>
8
+ <div class="bounce3"></div>
6
9
  </div>
@@ -1,10 +1,24 @@
1
+ :root {
2
+ --themeColor: rgb(240, 242, 247);
3
+ --foregroundColor: black;
4
+ }
5
+
6
+
1
7
  .tile-typing-now {
2
- font-size: 12px;
3
- background-color: #fff;
4
- display: none;
5
- &.active {
6
- display: block;
7
- }
8
+ position: absolute;
9
+ left: 40px;
10
+ right: 40px;
11
+ bottom: 3px;
12
+ width: auto;
13
+ text-align: center;
14
+ margin: 0px;
15
+ padding: 0px;
16
+ font-size: 1.1em;
17
+ color: var(--foregroundColor);
18
+ //display: none;
19
+ // &.active {
20
+ // display: block;
21
+ // }
8
22
  }
9
23
 
10
24
  /* BEGIN LOADING */
@@ -14,49 +28,105 @@
14
28
  left: 0;
15
29
  top: 0;
16
30
  margin: 0;
17
- &.active {
18
- display: inline-block;
19
- width: 30px;
20
- }
31
+ // &.active {
32
+ // display: inline-block;
33
+ // width: 30px;
34
+ // }
21
35
  }
22
36
  #tile-spinner > div {
23
37
  width: 6px;
24
38
  height: 6px;
25
39
  background-color: var(--basic-blue);
26
40
  }
41
+ // .spinner {
42
+ // margin: 100px auto 0;
43
+ // width: 70px;
44
+ // text-align: center;
45
+ // }
46
+ // .spinner > div {
47
+ // width: 18px;
48
+ // height: 18px;
49
+ // background-color: #333;
50
+ // border-radius: 100%;
51
+ // display: inline-block;
52
+ // -webkit-animation: sk-bouncedelay 1.4s infinite ease-in-out both;
53
+ // animation: sk-bouncedelay 1.4s infinite ease-in-out both;
54
+ // }
55
+ // .spinner .bounce1 {
56
+ // -webkit-animation-delay: -0.32s;
57
+ // animation-delay: -0.32s;
58
+ // }
59
+ // .spinner .bounce2 {
60
+ // -webkit-animation-delay: -0.16s;
61
+ // animation-delay: -0.16s;
62
+ // }
63
+ // @-webkit-keyframes sk-bouncedelay {
64
+ // 0%, 80%, 100% { -webkit-transform: scale(0) }
65
+ // 40% { -webkit-transform: scale(1.0) }
66
+ // }
67
+ // @keyframes sk-bouncedelay {
68
+ // 0%, 80%, 100% {
69
+ // -webkit-transform: scale(0);
70
+ // transform: scale(0);
71
+ // } 40% {
72
+ // -webkit-transform: scale(1.0);
73
+ // transform: scale(1.0);
74
+ // }
75
+ // }
76
+ /* END LOADING */
77
+
78
+
79
+ /* ******BOUNCE SPINNER START****** */
27
80
  .spinner {
28
- margin: 100px auto 0;
81
+ margin: 15px 10px; //remove it if activate avatar image
29
82
  width: 70px;
30
- text-align: center;
83
+ // text-align: center;
84
+ min-height: 20px;
85
+ display: block;
31
86
  }
87
+
32
88
  .spinner > div {
33
- width: 18px;
34
- height: 18px;
89
+ width: 9px;
90
+ height: 9px;
35
91
  background-color: #333;
92
+
36
93
  border-radius: 100%;
37
94
  display: inline-block;
38
95
  -webkit-animation: sk-bouncedelay 1.4s infinite ease-in-out both;
39
96
  animation: sk-bouncedelay 1.4s infinite ease-in-out both;
40
97
  }
98
+
41
99
  .spinner .bounce1 {
42
100
  -webkit-animation-delay: -0.32s;
43
101
  animation-delay: -0.32s;
102
+ background-color: var(--themeColor)
44
103
  }
104
+
45
105
  .spinner .bounce2 {
46
106
  -webkit-animation-delay: -0.16s;
47
107
  animation-delay: -0.16s;
108
+ background-color: var(--themeColor);
109
+ opacity: 0.4
48
110
  }
111
+
112
+ .spinner .bounce3 {
113
+ background-color: var(--themeColor);
114
+ opacity: 0.6
115
+ }
116
+
117
+
49
118
  @-webkit-keyframes sk-bouncedelay {
50
119
  0%, 80%, 100% { -webkit-transform: scale(0) }
51
120
  40% { -webkit-transform: scale(1.0) }
52
121
  }
122
+
53
123
  @keyframes sk-bouncedelay {
54
124
  0%, 80%, 100% {
55
- -webkit-transform: scale(0);
56
- transform: scale(0);
125
+ -webkit-transform: scale(0);
126
+ transform: scale(0);
57
127
  } 40% {
58
128
  -webkit-transform: scale(1.0);
59
129
  transform: scale(1.0);
60
130
  }
61
131
  }
62
- /* END LOADING */
132
+ /* ******BOUNCE SPINNER END****** */
@@ -1,113 +1,31 @@
1
- import { Component, OnInit, OnDestroy, Input } from '@angular/core';
2
-
3
- // services
4
- import { TypingService } from '../../providers/abstract/typing.service';
5
-
6
- // Logger
7
- import { LoggerService } from 'src/chat21-core/providers/abstract/logger.service';
8
- import { LoggerInstance } from 'src/chat21-core/providers/logger/loggerInstance';
1
+ import { Component, OnInit, OnDestroy, Input, ElementRef } from '@angular/core';
9
2
 
10
3
  @Component({
11
- selector: 'app-user-typing',
4
+ selector: 'user-typing',
12
5
  templateUrl: './user-typing.component.html',
13
6
  styleUrls: ['./user-typing.component.scss'],
14
7
  })
15
8
  export class UserTypingComponent implements OnInit, OnDestroy {
16
9
 
17
- @Input() idConversation: string;
18
- @Input() idCurrentUser: string;
19
- @Input() isDirect: boolean;
10
+ // @Input() idConversation: string;
11
+ // @Input() idCurrentUser: string;
12
+ // @Input() isDirect: boolean;
13
+ @Input() typingLocation: string = 'content'
20
14
  @Input() translationMap: Map<string, string>;
21
- @Input() color: string;
22
- @Input() membersConversation: [string];
23
-
24
- public status = '';
25
- public isTyping = false;
26
- public nameUserTypingNow: string;
27
-
28
- private setTimeoutWritingMessages: any;
29
- private subscriptions = [];
30
-
31
- private logger: LoggerService = LoggerInstance.getInstance();
15
+ @Input() themeColor: string;
16
+ @Input() idUserTypingNow: string;
17
+ @Input() nameUserTypingNow: string;
18
+ // @Input() membersConversation: [string];
32
19
 
33
- constructor(
34
- public typingService: TypingService
35
- ) { }
20
+ constructor(private elementRef: ElementRef) { }
36
21
 
37
22
  /** */
38
23
  ngOnInit() {
39
- this.logger.log('[USER-TYPING-COMPONENT] - ngOnInit');
40
- this.initialize();
24
+ this.elementRef.nativeElement.style.setProperty('--themeColor', this.themeColor);
41
25
  }
42
26
 
43
27
  /** */
44
28
  ngOnDestroy() {
45
- this.logger.log('UserTypingComponent - ngOnDestroy');
46
- // this.unsubescribeAll();
47
- }
48
-
49
- /** */
50
- initialize() {
51
- this.status = ''; // this.translationMap.get('LABEL_AVAILABLE');
52
- this.logger.log('this.translationMap', this.translationMap);
53
- this.logger.log('this.status', this.status);
54
- this.setSubscriptions();
55
- this.typingService.isTyping(this.idConversation, this.idCurrentUser, this.isDirect);
56
- }
57
-
58
- /** */
59
- private setSubscriptions() {
60
- const that = this;
61
- const conversationSelected = this.subscriptions.find(item => item.key === this.idConversation);
62
- if (!conversationSelected) {
63
- const subscribeBSIsTyping = this.typingService.BSIsTyping.subscribe((data: any) => {
64
- this.logger.log('***** BSIsTyping *****', data);
65
- if (data) {
66
- const isTypingUid = data.uid;
67
- if (this.idConversation === isTypingUid) {
68
- that.subscribeTypings(data);
69
- }
70
- }
71
- });
72
- const subscribe = {key: this.idConversation, value: subscribeBSIsTyping };
73
- this.subscriptions.push(subscribe);
74
- }
75
- }
76
-
77
- /** */
78
- subscribeTypings(data: any) {
79
- const that = this;
80
- try {
81
- const key = data.uidUserTypingNow;
82
- this.nameUserTypingNow = null;
83
- if (data.nameUserTypingNow) {
84
- this.nameUserTypingNow = data.nameUserTypingNow;
85
- }
86
- this.logger.log('subscribeTypings data:', data);
87
- const userTyping = this.membersConversation.includes(key);
88
- if ( !userTyping ) {
89
- this.isTyping = true;
90
- this.logger.log('child_changed key', key);
91
- this.logger.log('child_changed name', this.nameUserTypingNow);
92
- clearTimeout(this.setTimeoutWritingMessages);
93
- this.setTimeoutWritingMessages = setTimeout(() => {
94
- that.isTyping = false;
95
- }, 2000);
96
- }
97
- } catch (error) {
98
- this.logger.log('error: ', error);
99
- }
100
- }
101
-
102
-
103
- /** */
104
- private unsubescribeAll() {
105
- this.logger.log('UserTypingComponent unsubescribeAll: ', this.subscriptions);
106
- this.subscriptions.forEach((subscription: any) => {
107
- this.logger.log('unsubescribe: ', subscription);
108
- subscription.unsubescribe();
109
- });
110
- this.subscriptions = [];
111
29
  }
112
30
 
113
31
 
@@ -590,8 +590,10 @@ export function setConversationAvatar(
590
590
  conversationWith: string,
591
591
  conversationWithFullname: string,
592
592
  conversationChannelType: string,
593
+ projectId?: string,
594
+ project_name?: string,
593
595
  width?: string,
594
- height?: string
596
+ height?: string,
595
597
  ): any {
596
598
  const conversationWidth = (width) ? width : '40px';
597
599
  const conversationHeight = (height) ? height : '40px';
@@ -602,6 +604,8 @@ export function setConversationAvatar(
602
604
  channelType: conversationChannelType,
603
605
  avatar: avatarPlaceholder(conversationWithFullname),
604
606
  color: getColorBck(conversationWithFullname),
607
+ projectId: projectId,
608
+ project_name: project_name,
605
609
  width: conversationWidth,
606
610
  height: conversationHeight
607
611
  };
@@ -694,15 +698,35 @@ export function isURL(str: string) {
694
698
  }
695
699
  }
696
700
 
697
- // export function isHostname() {
698
-
699
-
700
- // if (environment.supportMode === true) {
701
-
702
- // return true
703
- // }
704
- // return false
705
- // }
701
+ export function convertColorToRGBA(color, opacity) {
702
+ let result = color;
703
+ // console.log('convertColorToRGBA' + color, opacity);
704
+ if ( color.indexOf('#') > -1 ) {
705
+ color = color.replace('#', '');
706
+ const r = parseInt(color.substring(0, 2), 16);
707
+ const g = parseInt(color.substring(2, 4), 16);
708
+ const b = parseInt(color.substring(4, 6), 16);
709
+ result = 'rgba(' + r + ',' + g + ',' + b + ',' + opacity / 100 + ')';
710
+ } else if ( color.indexOf('rgba') > -1 ) {
711
+ const rgb = color.split(',');
712
+ const r = rgb[0].substring(5);
713
+ const g = rgb[1];
714
+ const b = rgb[2];
715
+ // const b = rgb[2].substring(1, rgb[2].length - 1);
716
+ result = 'rgba(' + r + ',' + g + ',' + b + ',' + opacity / 100 + ')';
717
+ } else if ( color.indexOf('rgb(') > -1 ) {
718
+ const rgb = color.split(',');
719
+ // console.log(rgb);
720
+ const r = rgb[0].substring(4);
721
+ const g = rgb[1];
722
+ const b = rgb[2].substring(0, rgb[2].length - 1);
723
+ // console.log(b);
724
+ // console.log(rgb[2].length);
725
+ result = 'rgba(' + r + ',' + g + ',' + b + ',' + opacity / 100 + ')';
726
+ }
727
+ // console.log('convertColorToRGBA' + color + result);
728
+ return result;
729
+ }
706
730
 
707
731
  export function getParameterByName(name: string) {
708
732
  var url = window.location.href;
@@ -810,6 +834,10 @@ export function redirect2(router, IDConv, conversationSelected) {
810
834
  /** */
811
835
  export function checkPlatformIsMobile() {
812
836
  // console.log('UTILS - checkPlatformIsMobile:: ', window.innerWidth);
837
+ // if (/Android|iPhone/i.test(window.navigator.userAgent)) {
838
+ // return true
839
+ // }
840
+ // return false
813
841
  if (window.innerWidth < 768) {
814
842
  return true;
815
843
  }