@chat21/chat21-ionic 3.0.85 → 3.0.86-rc.1

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 (173) hide show
  1. package/CHANGELOG.md +116 -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 +4 -3
  6. package/src/app/app-routing.module.ts +7 -2
  7. package/src/app/app.component.html +7 -1
  8. package/src/app/app.component.scss +20 -2
  9. package/src/app/app.component.ts +130 -19
  10. package/src/app/app.module.ts +8 -3
  11. package/src/app/chatlib/conversation-detail/conversation-content/conversation-content.component.ts +8 -1
  12. package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.html +86 -23
  13. package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.scss +188 -88
  14. package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.ts +42 -3
  15. package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.html +11 -24
  16. package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.scss +6 -10
  17. package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.spec.ts +2 -2
  18. package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.ts +16 -26
  19. package/src/app/chatlib/conversation-detail/message/buttons/action-button/action-button.component.html +5 -1
  20. package/src/app/chatlib/conversation-detail/message/buttons/action-button/action-button.component.scss +22 -15
  21. package/src/app/chatlib/conversation-detail/message/buttons/action-button/action-button.component.ts +25 -5
  22. package/src/app/chatlib/conversation-detail/message/buttons/link-button/link-button.component.html +2 -1
  23. package/src/app/chatlib/conversation-detail/message/buttons/link-button/link-button.component.scss +14 -15
  24. package/src/app/chatlib/conversation-detail/message/buttons/link-button/link-button.component.ts +24 -5
  25. package/src/app/chatlib/conversation-detail/message/buttons/text-button/text-button.component.html +6 -1
  26. package/src/app/chatlib/conversation-detail/message/buttons/text-button/text-button.component.scss +12 -13
  27. package/src/app/chatlib/conversation-detail/message/buttons/text-button/text-button.component.ts +26 -5
  28. package/src/app/chatlib/conversation-detail/message/frame/frame.component.html +8 -2
  29. package/src/app/chatlib/conversation-detail/message/frame/frame.component.scss +36 -0
  30. package/src/app/chatlib/conversation-detail/message/frame/frame.component.ts +2 -2
  31. package/src/app/chatlib/conversation-detail/message/html/html.component.ts +0 -1
  32. package/src/app/chatlib/conversation-detail/message/image/image.component.html +3 -2
  33. package/src/app/chatlib/conversation-detail/message/image/image.component.scss +17 -5
  34. package/src/app/chatlib/conversation-detail/message/image/image.component.ts +1 -1
  35. package/src/app/chatlib/conversation-detail/message/info-message/info-message.component.scss +3 -2
  36. package/src/app/chatlib/conversation-detail/message/message-attachment/message-attachment.component.html +16 -6
  37. package/src/app/chatlib/conversation-detail/message/message-attachment/message-attachment.component.scss +1 -3
  38. package/src/app/chatlib/conversation-detail/message/message-attachment/message-attachment.component.ts +2 -0
  39. package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.html +78 -52
  40. package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.scss +63 -20
  41. package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.ts +14 -10
  42. package/src/app/components/canned-response/canned-response.component.html +9 -9
  43. package/src/app/components/canned-response/canned-response.component.scss +14 -7
  44. package/src/app/components/canned-response/canned-response.component.ts +5 -4
  45. package/src/app/components/contacts-directory/contacts-directory.component.html +22 -26
  46. package/src/app/components/contacts-directory/contacts-directory.component.scss +8 -6
  47. package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.html +64 -47
  48. package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.scss +98 -61
  49. package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.ts +24 -40
  50. package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component_2.html +116 -0
  51. package/src/app/components/conversation-detail/message-text-area/message-text-area.component.html +39 -42
  52. package/src/app/components/conversation-detail/message-text-area/message-text-area.component.scss +67 -4
  53. package/src/app/components/conversation-detail/message-text-area/message-text-area.component.ts +82 -152
  54. package/src/app/components/conversation-info/info-content/info-content.component.html +23 -2
  55. package/src/app/components/conversation-info/info-content/info-content.component.ts +5 -6
  56. package/src/app/components/conversation-info/info-direct/info-direct.component.html +7 -14
  57. package/src/app/components/conversation-info/info-direct/info-direct.component.scss +23 -0
  58. package/src/app/components/conversation-info/info-direct/info-direct.component.ts +1 -6
  59. package/src/app/components/conversation-info/info-group/info-group.component.html +44 -108
  60. package/src/app/components/conversation-info/info-group/info-group.component.scss +101 -61
  61. package/src/app/components/conversation-info/info-group/info-group.component.ts +1 -0
  62. package/src/app/components/conversation-info/info-support-group/info-support-group.component.html +2 -1
  63. package/src/app/components/conversation-info/info-support-group/info-support-group.component.ts +0 -1
  64. package/src/app/components/{ddp-header/ddp-header.component.html → conversations-list/header-conversations-list/header-conversations-list.component.html} +3 -3
  65. package/src/app/components/{ddp-header/ddp-header.component.scss → conversations-list/header-conversations-list/header-conversations-list.component.scss} +16 -4
  66. 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
  67. package/src/app/components/{ddp-header/ddp-header.component.ts → conversations-list/header-conversations-list/header-conversations-list.component.ts} +7 -16
  68. package/src/app/components/conversations-list/header-conversations-list-archived/header-conversations-list-archived.component.html +12 -0
  69. package/src/app/components/conversations-list/header-conversations-list-archived/header-conversations-list-archived.component.scss +14 -0
  70. 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
  71. 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
  72. package/src/app/components/navbar/navbar.component.html +103 -0
  73. package/src/app/components/navbar/navbar.component.scss +249 -0
  74. package/src/app/components/{ddp-header/ddp-header.component.spec.ts → navbar/navbar.component.spec.ts} +6 -6
  75. package/src/app/components/navbar/navbar.component.ts +190 -0
  76. package/src/app/components/project-item/project-item.component.html +98 -149
  77. package/src/app/components/project-item/project-item.component.scss +43 -35
  78. package/src/app/components/project-item/project-item.component.ts +16 -4
  79. package/src/app/components/sidebar-user-details/sidebar-user-details.component.html +5 -5
  80. package/src/app/components/sidebar-user-details/sidebar-user-details.component.ts +24 -13
  81. package/src/app/components/utils/user-presence/user-presence.component.html +7 -2
  82. package/src/app/components/utils/user-presence/user-presence.component.scss +35 -18
  83. package/src/app/components/utils/user-presence/user-presence.component.ts +6 -10
  84. package/src/app/{pages → modals}/create-canned-response/create-canned-response-routing.module.ts +0 -0
  85. package/src/app/{pages → modals}/create-canned-response/create-canned-response.module.ts +0 -0
  86. package/src/app/{pages → modals}/create-canned-response/create-canned-response.page.html +0 -0
  87. package/src/app/{pages → modals}/create-canned-response/create-canned-response.page.scss +0 -0
  88. package/src/app/{pages → modals}/create-canned-response/create-canned-response.page.spec.ts +0 -0
  89. package/src/app/{pages → modals}/create-canned-response/create-canned-response.page.ts +13 -13
  90. package/src/app/{pages → modals}/loader-preview/loader-preview-routing.module.ts +0 -0
  91. package/src/app/{pages → modals}/loader-preview/loader-preview.module.ts +0 -0
  92. package/src/app/{pages → modals}/loader-preview/loader-preview.page.html +1 -1
  93. package/src/app/{pages → modals}/loader-preview/loader-preview.page.scss +4 -0
  94. package/src/app/{pages → modals}/loader-preview/loader-preview.page.spec.ts +0 -0
  95. package/src/app/{pages → modals}/loader-preview/loader-preview.page.ts +1 -2
  96. package/src/app/modals/send-email/send-email-routing.module.ts +17 -0
  97. package/src/app/modals/send-email/send-email.module.ts +31 -0
  98. package/src/app/modals/send-email/send-email.page.html +46 -0
  99. package/src/app/modals/send-email/send-email.page.scss +161 -0
  100. package/src/app/modals/send-email/send-email.page.spec.ts +24 -0
  101. package/src/app/modals/send-email/send-email.page.ts +89 -0
  102. package/src/app/pages/contacts-directory/contacts-directory.page.html +1 -1
  103. package/src/app/pages/contacts-directory/contacts-directory.page.scss +47 -0
  104. package/src/app/pages/contacts-directory/contacts-directory.page.ts +2 -0
  105. package/src/app/pages/conversation-detail/conversation-detail.module.ts +0 -8
  106. package/src/app/pages/conversation-detail/conversation-detail.page.html +48 -27
  107. package/src/app/pages/conversation-detail/conversation-detail.page.scss +45 -254
  108. package/src/app/pages/conversation-detail/conversation-detail.page.ts +325 -135
  109. package/src/app/pages/conversations-list/conversations-list.page.html +11 -8
  110. package/src/app/pages/conversations-list/conversations-list.page.scss +18 -2
  111. package/src/app/pages/conversations-list/conversations-list.page.ts +26 -24
  112. package/src/app/pages/profile-info/profile-info.page.html +2 -4
  113. package/src/app/pages/unassigned-conversations/unassigned-conversations.page.html +1 -1
  114. package/src/app/pages/unassigned-conversations/unassigned-conversations.page.scss +42 -0
  115. package/src/app/pages/unassigned-conversations/unassigned-conversations.page.ts +1 -0
  116. package/src/app/services/canned-responses/canned-responses.service.ts +26 -0
  117. package/src/app/services/projects/projects.service.spec.ts +12 -0
  118. package/src/app/services/projects/projects.service.ts +43 -0
  119. package/src/app/services/tiledesk/tiledesk.service.ts +33 -17
  120. package/src/app/services/websocket/websocket.service.ts +1 -1
  121. package/src/app/shared/shared.module.ts +24 -33
  122. package/src/app/utils/toast.spec.ts +7 -0
  123. package/src/app/utils/toast.ts +48 -0
  124. package/src/assets/i18n/ar.json +288 -265
  125. package/src/assets/i18n/az.json +24 -1
  126. package/src/assets/i18n/de.json +25 -2
  127. package/src/assets/i18n/en.json +25 -2
  128. package/src/assets/i18n/es.json +26 -3
  129. package/src/assets/i18n/fr.json +24 -1
  130. package/src/assets/i18n/it.json +24 -1
  131. package/src/assets/i18n/kk.json +25 -2
  132. package/src/assets/i18n/pt.json +25 -2
  133. package/src/assets/i18n/ru.json +24 -1
  134. package/src/assets/i18n/sr.json +287 -264
  135. package/src/assets/i18n/sv.json +25 -2
  136. package/src/assets/i18n/tr.json +25 -2
  137. package/src/assets/i18n/uk.json +25 -2
  138. package/src/assets/i18n/uz.json +24 -1
  139. package/src/assets/js/chat21client.js +1 -1
  140. package/src/assets/sounds/interface-start.mp3 +0 -0
  141. package/src/assets/sounds/wheep-wheep.mp3 +0 -0
  142. package/src/chat-config-mqtt-localhost.json +2 -2
  143. package/src/chat-config-native-mqtt.json +3 -0
  144. package/src/chat21-core/models/conversation.ts +0 -1
  145. package/src/chat21-core/models/projects.ts +27 -0
  146. package/src/chat21-core/providers/firebase/firebase-typing.service.ts +7 -9
  147. package/src/chat21-core/providers/mqtt/mqtt-auth-service.ts +7 -8
  148. package/src/chat21-core/utils/constants.ts +7 -1
  149. package/src/chat21-core/utils/convertRequestToConversation.ts +41 -0
  150. package/src/chat21-core/utils/user-typing/user-typing.component.html +8 -5
  151. package/src/chat21-core/utils/user-typing/user-typing.component.scss +87 -17
  152. package/src/chat21-core/utils/user-typing/user-typing.component.ts +12 -94
  153. package/src/chat21-core/utils/utils.ts +41 -11
  154. package/src/global.scss +59 -255
  155. package/src/index.html +0 -9
  156. package/src/variables.scss +30 -10
  157. package/src/app/components/conversation-detail/bubble-day-message/bubble-day-message.component.html +0 -3
  158. package/src/app/components/conversation-detail/bubble-day-message/bubble-day-message.component.scss +0 -21
  159. package/src/app/components/conversation-detail/bubble-day-message/bubble-day-message.component.spec.ts +0 -24
  160. package/src/app/components/conversation-detail/bubble-day-message/bubble-day-message.component.ts +0 -14
  161. package/src/app/components/conversation-detail/bubble-my-message/bubble-my-message.component.html +0 -54
  162. package/src/app/components/conversation-detail/bubble-my-message/bubble-my-message.component.scss +0 -98
  163. package/src/app/components/conversation-detail/bubble-my-message/bubble-my-message.component.ts +0 -84
  164. package/src/app/components/conversation-detail/bubble-others-message/bubble-others-message.component.html +0 -30
  165. package/src/app/components/conversation-detail/bubble-others-message/bubble-others-message.component.scss +0 -83
  166. package/src/app/components/conversation-detail/bubble-others-message/bubble-others-message.component.spec.ts +0 -24
  167. package/src/app/components/conversation-detail/bubble-others-message/bubble-others-message.component.ts +0 -68
  168. package/src/app/components/conversation-detail/bubble-system-message/bubble-system-message.component.html +0 -3
  169. package/src/app/components/conversation-detail/bubble-system-message/bubble-system-message.component.scss +0 -10
  170. package/src/app/components/conversation-detail/bubble-system-message/bubble-system-message.component.spec.ts +0 -24
  171. package/src/app/components/conversation-detail/bubble-system-message/bubble-system-message.component.ts +0 -14
  172. package/src/app/components/conversation-detail/option-header/option-header.component.html +0 -13
  173. package/src/app/components/conversation-detail/option-header/option-header.component.scss +0 -0
@@ -1,8 +1,9 @@
1
+ import { MessageModel } from 'src/chat21-core/models/message';
1
2
  import { ConversationContentComponent } from '../conversation-content/conversation-content.component';
2
- import { ChangeDetectorRef, Component, Input, OnInit, Output, EventEmitter } from '@angular/core';
3
+ import { ChangeDetectorRef, Component, Input, OnInit, Output, EventEmitter, SimpleChange, SimpleChanges } from '@angular/core';
3
4
 
4
5
 
5
- import { MESSAGE_TYPE_INFO, MESSAGE_TYPE_MINE, MESSAGE_TYPE_OTHERS } from 'src/chat21-core/utils/constants';
6
+ import { MESSAGE_TYPE_INFO, MESSAGE_TYPE_MINE, MESSAGE_TYPE_OTHERS, TYPE_MSG_EMAIL } from 'src/chat21-core/utils/constants';
6
7
  import { isChannelTypeGroup, isEmojii, isFirstMessage, isInfo, isMine, messageType } from 'src/chat21-core/utils/utils-message';
7
8
  import { UploadService } from 'src/chat21-core/providers/abstract/upload.service';
8
9
  import { isFile, isFrame, isImage } from 'src/chat21-core/utils/utils-message';
@@ -13,6 +14,8 @@ import { TiledeskAuthService } from 'src/chat21-core/providers/tiledesk/tiledesk
13
14
  import { TranslateService } from '@ngx-translate/core';
14
15
  import * as moment from 'moment';
15
16
  import { AppConfigProvider } from 'src/app/services/app-config';
17
+ import { ModalController } from '@ionic/angular';
18
+ import { CreateCannedResponsePage } from 'src/app/modals/create-canned-response/create-canned-response.page';
16
19
  @Component({
17
20
  selector: 'ion-conversation-detail',
18
21
  templateUrl: './ion-conversation-detail.component.html',
@@ -24,14 +27,18 @@ export class IonConversationDetailComponent extends ConversationContentComponent
24
27
  @Input() channelType: string;
25
28
  @Input() areVisibleCAR: boolean;
26
29
  @Input() supportMode: boolean;
30
+ @Input() isMobile: boolean;
31
+ @Input() openInfoConversation: boolean;
27
32
  @Output() onElementRendered = new EventEmitter<{element: string, status: boolean}>();
28
33
  @Output() onAddUploadingBubble = new EventEmitter<boolean>();
29
-
34
+ @Output() onOpenCloseInfoConversation = new EventEmitter<boolean>();
35
+
30
36
  public public_Key: any
31
37
  public uploadProgress: number = 100
32
38
  public fileType: any
33
39
  public browserLang: string;
34
40
  public addAsCannedResponseTooltipText: string;
41
+ // public openInfoConversation: boolean = true;
35
42
  isImage = isImage;
36
43
  isFile = isFile;
37
44
  isFrame = isFrame;
@@ -46,6 +53,7 @@ export class IonConversationDetailComponent extends ConversationContentComponent
46
53
  MESSAGE_TYPE_INFO = MESSAGE_TYPE_INFO;
47
54
  MESSAGE_TYPE_MINE = MESSAGE_TYPE_MINE;
48
55
  MESSAGE_TYPE_OTHERS = MESSAGE_TYPE_OTHERS;
56
+ TYPE_MSG_EMAIL = TYPE_MSG_EMAIL;
49
57
  logger: LoggerService = LoggerInstance.getInstance()
50
58
  /**
51
59
  * Constructor
@@ -58,6 +66,7 @@ export class IonConversationDetailComponent extends ConversationContentComponent
58
66
  public tiledeskAuthService: TiledeskAuthService,
59
67
  private translate: TranslateService,
60
68
  public appConfigProvider: AppConfigProvider,
69
+ public modalController: ModalController,
61
70
  ) {
62
71
  super(cdref, uploadService)
63
72
 
@@ -66,6 +75,11 @@ export class IonConversationDetailComponent extends ConversationContentComponent
66
75
  ngOnInit() {
67
76
  this.listenToUploadFileProgress();
68
77
  this.setMomentLocaleAndGetTranslation();
78
+
79
+ }
80
+
81
+ ngOnChanges(changes: SimpleChanges){
82
+ this.isMobile? this.openInfoConversation = false: null;
69
83
  }
70
84
 
71
85
 
@@ -136,6 +150,11 @@ export class IonConversationDetailComponent extends ConversationContentComponent
136
150
  this.onElementRendered.emit(event)
137
151
  }
138
152
 
153
+ onOpenCloseInfoConversationFN(){
154
+ this.openInfoConversation = !this.openInfoConversation
155
+ this.onOpenCloseInfoConversation.emit(this.openInfoConversation)
156
+ }
157
+
139
158
  /**
140
159
  * Track by function for ngFor loops
141
160
  *
@@ -147,4 +166,24 @@ export class IonConversationDetailComponent extends ConversationContentComponent
147
166
  // console.log('[CONVS-DETAIL][ION-CONVS-DETAIL] - trackByFn item', item)
148
167
  return item.uid || index;
149
168
  }
169
+
170
+
171
+ async presentCreateCannedResponseModal(message: MessageModel): Promise<any> {
172
+ this.logger.log('[BUBBLE-MESSAGE] PRESENT CREATE CANNED RESPONSE MODAL ')
173
+ const attributes = {
174
+ message: message,
175
+ }
176
+ const modal: HTMLIonModalElement = await this.modalController.create({
177
+ component: CreateCannedResponsePage,
178
+ componentProps: attributes,
179
+ swipeToClose: false,
180
+ backdropDismiss: false,
181
+ })
182
+ modal.onDidDismiss().then((dataReturned: any) => {
183
+ //
184
+ this.logger.log('[BUBBLE-MESSAGE] ', dataReturned.data)
185
+ })
186
+
187
+ return await modal.present()
188
+ }
150
189
  }
@@ -1,12 +1,17 @@
1
1
  <!-- [ngClass]="{'button-in-msg' : message.metadata && message.metadata.button}" -->
2
2
  <!-- [ngStyle]="{'padding': (isImage(message) || isFrame(message))?'0px':'0 8px'}" -->
3
3
  <!-- isImage >{{isImage(message) }} message.metadata.width {{message?.metadata?.width }} -->
4
- <div id="bubble-message"
5
- [ngStyle]="{'padding': (isImage(message) || isFrame(message))?'0px':'0 8px', 'width': (isImage(message) || isFrame(message))? sizeImage?.width + 'px' : null }"
6
- class="messages primary-color">
4
+ <!-- 'width': (isImage(message) || isFrame(message))? sizeImage?.width : null -->
5
+ <div id="bubble-message" [ngStyle]="{'padding': (isImage(message) || isFrame(message))?'0px':'0 8px' }" class="messages primary-color">
7
6
 
8
7
 
9
8
  <div>
9
+
10
+ <div *ngIf="messageType(MESSAGE_TYPE_OTHERS, message) && !isSameSender"
11
+ [style.color]="convertColorToRGBA(fontColor, 65)"
12
+ [ngStyle]="{'margin': (isImage(message) || isFrame(message))? '10px 16px 8px 16px': '10px 8px 0px 8px'}" class="message_sender_fullname">
13
+ {{message?.sender_fullname}}
14
+ </div>
10
15
  <!-- message type:: image -->
11
16
  <!-- <div *ngIf="message.type == 'image' && message.metadata" [ngStyle] = "{ 'max-width': getSizeImg(message).width, 'max-height': getSizeImg(message).height }">
12
17
  <img class="message-contentX message-content-imageX" [src]="message.metadata.src" />
@@ -29,8 +34,8 @@
29
34
  <!-- [height]="getMetadataSize(message.metadata).height"> -->
30
35
  <chat-frame *ngIf="isFrame(message)"
31
36
  [metadata]="message.metadata"
32
- [width]="message.metadata.width"
33
- [height]="message.metadata.height"
37
+ [width]="sizeImage?.width"
38
+ [height]="sizeImage?.width"
34
39
  (onElementRendered)="onElementRenderedFN($event)">
35
40
  </chat-frame>
36
41
 
@@ -43,14 +48,10 @@
43
48
 
44
49
  <!-- [tooltip]="timeTooltipLeft" [options]="tooltipOptions" placement="left" content-type="template" (click)="handleTooltipEvents($event)" -->
45
50
  <div *ngIf="message?.text">
46
- <span class="message-date"> {{message.timestamp | date:'HH:mm' }} </span>
47
- <!-- <ng-template #timeTooltipLeft>
48
- <span> {{message.timestamp | amCalendar }} </span>
49
- </ng-template> -->
50
51
 
51
52
  <chat-text *ngIf="message?.type !=='html'"
52
53
  [text]="message?.text"
53
- [color]="textColor"
54
+ [color]="fontColor"
54
55
  [message]="message"
55
56
  (onBeforeMessageRender)="returnOnBeforeMessageRender($event)"
56
57
  (onAfterMessageRender)="returnOnAfterMessageRender($event)">
@@ -60,20 +61,6 @@
60
61
  [htmlText]="message?.text">
61
62
  </chat-html>
62
63
 
63
- <ng-container *ngIf="areVisibleCAR && supportMode">
64
- <ion-button shape="round" size="small" class="btn-add-msg canned" ion-button fill="clear"
65
- (click)="presentCreateCannedResponseModal()" tooltip="{{addAsCannedResponseTooltipText}}"
66
- [options]="tooltipOptions" placement="bottom">
67
- <ion-icon slot="icon-only" name="flash-outline" style="font-size: 1em;"> </ion-icon>
68
- </ion-button>
69
- </ng-container>
70
- <!-- <ng-container *ngIf="supportMode">
71
- <ion-button shape="round" size="small" class="btn-add-msg emoji" ion-button fill="clear"
72
- (click)="presentEmojiiModal()" tooltip="{{addAsCannedResponseTooltipText}}"
73
- [options]="tooltipOptions" placement="bottom">
74
- <ion-icon slot="icon-only" name="happy-outline" style="font-size: 1em;"> </ion-icon>
75
- </ion-button>
76
- </ng-container> -->
77
64
  </div>
78
65
  </div>
79
66
 
@@ -11,6 +11,11 @@
11
11
  // -webkit-animation: heartbeat 1.5s ease-in-out both;
12
12
  // animation: heartbeat 1.5s ease-in-out both;
13
13
 
14
+ .message_sender_fullname{
15
+ font-size: 12px;
16
+ font-weight: 600;
17
+ }
18
+
14
19
  p {
15
20
  font-size: 1.4em;
16
21
  margin: 0;
@@ -48,16 +53,7 @@
48
53
 
49
54
  }
50
55
  // > .button-native
51
- .btn-add-msg {
52
- border-radius: 50%;
53
- --padding-end: 7px;
54
- --padding-start: 7px;
55
- box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.6);
56
-
57
- ion-icon{
58
- font-size: 1.2em;
59
- }
60
- }
56
+
61
57
 
62
58
 
63
59
 
@@ -50,7 +50,7 @@ describe('BubbleMessageComponent', () => {
50
50
  isSender: false
51
51
  }
52
52
  component.message = messages
53
- component.textColor = 'black'
53
+ component.fontColor = 'black'
54
54
  fixture.detectChanges()
55
55
  const textChild = fixture.debugElement.query(By.css('chat-text'))
56
56
  textChild.properties.text
@@ -76,7 +76,7 @@ describe('BubbleMessageComponent', () => {
76
76
  isSender: false
77
77
  }
78
78
  component.message = messages
79
- component.textColor = 'black'
79
+ component.fontColor = 'black'
80
80
  fixture.detectChanges()
81
81
  const textChild = fixture.debugElement.query(By.css('chat-text'))
82
82
  expect(textChild.properties.text).toEqual(messages.text)
@@ -1,15 +1,15 @@
1
1
  import { Component, ElementRef, EventEmitter, Input, OnChanges, OnInit, Output } from '@angular/core';
2
2
  import { DomSanitizer } from '@angular/platform-browser';
3
3
  import { MessageModel } from 'src/chat21-core/models/message';
4
- import { MAX_WIDTH_IMAGES, MIN_WIDTH_IMAGES } from 'src/chat21-core/utils/constants';
4
+ import { MAX_WIDTH_IMAGES, MESSAGE_TYPE_MINE, MESSAGE_TYPE_OTHERS, MIN_WIDTH_IMAGES } from 'src/chat21-core/utils/constants';
5
5
  import { LoggerService } from 'src/chat21-core/providers/abstract/logger.service';
6
- import { isFile, isFrame, isImage } from 'src/chat21-core/utils/utils-message';
6
+ import { isFile, isFrame, isImage, messageType } from 'src/chat21-core/utils/utils-message';
7
7
  import { LoggerInstance } from 'src/chat21-core/providers/logger/loggerInstance';
8
8
  import { TranslateService } from '@ngx-translate/core';
9
9
  import { TiledeskAuthService } from 'src/chat21-core/providers/tiledesk/tiledesk-auth.service';
10
10
  import * as moment from 'moment';
11
- import { CreateCannedResponsePage } from 'src/app/pages/create-canned-response/create-canned-response.page'
12
11
  import { ModalController } from '@ionic/angular';
12
+ import { convertColorToRGBA } from 'src/chat21-core/utils/utils';
13
13
  @Component({
14
14
  selector: 'chat-bubble-message',
15
15
  templateUrl: './bubble-message.component.html',
@@ -18,16 +18,25 @@ import { ModalController } from '@ionic/angular';
18
18
  export class BubbleMessageComponent implements OnInit, OnChanges {
19
19
 
20
20
  @Input() message: MessageModel;
21
- @Input() textColor: string;
22
- @Input() areVisibleCAR: boolean;
23
- @Input() supportMode: boolean;
21
+ @Input() isSameSender: boolean;
22
+ @Input() fontColor: string;
23
+ @Input() fontSize: string;
24
+ @Input() fontFamily: string;
24
25
  @Output() onBeforeMessageRender = new EventEmitter();
25
26
  @Output() onAfterMessageRender = new EventEmitter();
26
27
  @Output() onElementRendered = new EventEmitter<{element: string, status: boolean}>();
27
28
  isImage = isImage;
28
29
  isFile = isFile;
29
30
  isFrame = isFrame;
30
- @Input() addAsCannedResponseTooltipText : string;
31
+ convertColorToRGBA = convertColorToRGBA
32
+
33
+ // ========== begin:: check message type functions ======= //
34
+ messageType = messageType;
35
+
36
+ MESSAGE_TYPE_MINE = MESSAGE_TYPE_MINE;
37
+ MESSAGE_TYPE_OTHERS = MESSAGE_TYPE_OTHERS;
38
+ // ========== end:: check message type functions ======= //
39
+
31
40
  public browserLang: string;
32
41
 
33
42
  tooltipOptions = {
@@ -194,25 +203,6 @@ export class BubbleMessageComponent implements OnInit, OnChanges {
194
203
  this.onElementRendered.emit({element: event.element, status: event.status})
195
204
  }
196
205
 
197
- async presentCreateCannedResponseModal(): Promise<any> {
198
- this.logger.log('[BUBBLE-MESSAGE] PRESENT CREATE CANNED RESPONSE MODAL ')
199
- const attributes = {
200
- message: this.message,
201
- }
202
- const modal: HTMLIonModalElement = await this.modalController.create({
203
- component: CreateCannedResponsePage,
204
- componentProps: attributes,
205
- swipeToClose: false,
206
- backdropDismiss: false,
207
- })
208
- modal.onDidDismiss().then((dataReturned: any) => {
209
- //
210
- this.logger.log('[BUBBLE-MESSAGE] ', dataReturned.data)
211
- })
212
-
213
- return await modal.present()
214
- }
215
-
216
206
 
217
207
  // printMessage(message, messageEl, component) {
218
208
  // const messageOBJ = { message: message, sanitizer: this.sanitizer, messageEl: messageEl, component: component}
@@ -1,3 +1,7 @@
1
- <div #actionButton id="actionButton" class="button-in-msg action" (click)="actionButtonAction()" title="{{button?.value}}">
1
+ <div #actionButton id="actionButton" class="button-in-msg action"
2
+ title="{{button?.value}}"
3
+ (click)="actionButtonAction()"
4
+ (mouseover)="onMouseOver($event)"
5
+ (mouseout)="onMouseOut($event)">
2
6
  {{button.value}}
3
7
  </div>
@@ -1,12 +1,11 @@
1
1
  // @import '../../../../../sass/variables';
2
2
 
3
3
  div {
4
- --bck-msg-sent: #62a8ea;
5
- --col-msg-sent:#ffffff;
6
- --light-white: #f7f7f7;
7
- --black: #1a1a1a;
8
- --gray: #aaaaaa;
9
- --blue: rgb(42, 106, 193);
4
+ --backgroundColor: --basic-blue;
5
+ --textColor: --bck-msg-sent;
6
+ --hoverBackgroundColor: --bck-msg-sent;
7
+ --hoverTextColor: --basic-blue;
8
+ --buttonFontSize: --button-in-msg-font-size;
10
9
  }
11
10
 
12
11
  .button-in-msg {
@@ -15,32 +14,32 @@ div {
15
14
  max-width: 300px;
16
15
  min-width: inherit;
17
16
  cursor: pointer;
18
- border: 1px solid var(--blue);
17
+ border: 1px solid var(--textColor);
19
18
  border-radius: 20px;
20
19
  margin: 3px;
21
- background: transparent;
20
+ background: var(--backgroundColor);
22
21
  overflow: hidden;
23
22
  font-family: 'Muli', sans-serif;
24
- font-size: 15px;
23
+ font-size: var(--buttonFontSize);
25
24
  -o-text-overflow: ellipsis;
26
25
  text-overflow: ellipsis;
27
26
  white-space: nowrap;
28
27
  letter-spacing: -0.24px;
29
28
  -webkit-font-smoothing: antialiased;
30
- color: var(--blue);
29
+ color: var(--textColor);
31
30
  line-height: 16px;
32
31
  }
33
32
 
34
33
  .action {
35
- background: white;
34
+ background: var(--backgroundColor);
36
35
  transition: background-color .6s ease;
37
36
  &:focus,
38
37
  &:hover {
39
- color: white;
40
- background: var(--blue);
38
+ color: var(--hoverTextColor);
39
+ background: var(--hoverBackgroundColor);
41
40
  .icon-button-action {
42
41
  svg {
43
- fill: white;
42
+ fill: var(--hoverTextColor);
44
43
  }
45
44
  }
46
45
  }
@@ -80,4 +79,12 @@ div {
80
79
  // height: 200px;
81
80
  // }
82
81
  // }
83
- }
82
+ }
83
+
84
+
85
+ .disabled {
86
+ // border: 1px solid #999999;
87
+ // background-color: #cccccc;
88
+ // color: #666666;
89
+ pointer-events: none;
90
+ }
@@ -1,4 +1,4 @@
1
- import { Component, ElementRef, EventEmitter, Input, OnInit, Output } from '@angular/core';
1
+ import { Component, ElementRef, EventEmitter, Input, OnInit, Output, SimpleChanges } from '@angular/core';
2
2
 
3
3
  @Component({
4
4
  selector: 'chat-action-button-attachment',
@@ -8,16 +8,36 @@ import { Component, ElementRef, EventEmitter, Input, OnInit, Output } from '@ang
8
8
  export class ActionButtonComponent implements OnInit {
9
9
 
10
10
  @Input() button: any;
11
- @Input() themeColor: string;
12
- @Input() foregroundColor: string;
11
+ @Input() fontSize: string;
12
+ @Input() backgroundColor: string;
13
+ @Input() textColor: string;
14
+ @Input() hoverBackgroundColor: string;
15
+ @Input() hoverTextColor: string;
13
16
  @Output() onButtonClicked = new EventEmitter();
17
+
14
18
  public type: string = "action"
15
19
  constructor(private elementRef: ElementRef) { }
16
20
 
17
21
  ngOnInit() {
22
+ }
23
+
24
+ ngOnChanges(changes: SimpleChanges){
18
25
  //decomment if element should have same color of themeColor and fregroundColor
19
- // this.elementRef.nativeElement.style.setProperty('--themeColor', this.themeColor);
20
- // this.elementRef.nativeElement.style.setProperty('--foregroundColor', this.foregroundColor);
26
+ if(this.fontSize) this.elementRef.nativeElement.querySelector('.action').style.setProperty('--buttonFontSize', this.fontSize);
27
+ if(this.backgroundColor) this.elementRef.nativeElement.querySelector('.action').style.setProperty('--backgroundColor', this.backgroundColor);
28
+ if(this.textColor) this.elementRef.nativeElement.querySelector('.action').style.setProperty('--textColor', this.textColor);
29
+ if(this.hoverBackgroundColor) this.elementRef.nativeElement.querySelector('.action').style.setProperty('--hoverBackgroundColor', this.hoverBackgroundColor);
30
+ if(this.hoverTextColor) this.elementRef.nativeElement.querySelector('.action').style.setProperty('--hoverTextColor', this.hoverTextColor);
31
+ }
32
+
33
+ onMouseOver(event){
34
+ // if(this.themeColor) this.elementRef.nativeElement.querySelector('.action').style.background = this.themeColor
35
+ // if(this.foregroundColor) this.elementRef.nativeElement.querySelector('.action').style.color = this.foregroundColor
36
+ }
37
+
38
+ onMouseOut(event){
39
+ // this.elementRef.nativeElement.querySelector('.action').style.color = '';
40
+ // this.elementRef.nativeElement.querySelector('.action').style.background = ''
21
41
  }
22
42
 
23
43
  actionButtonAction(){
@@ -1,4 +1,5 @@
1
- <div class="button-in-msg url" (click)="actionButtonUrl()" title="{{button?.value}}">
1
+ <div class="button-in-msg url" (click)="actionButtonUrl()" title="{{button?.value}}"
2
+ (mouseover)="onMouseOver($event)" (mouseout)="onMouseOut($event)">
2
3
  <span *ngIf="button?.target !== 'self'" class="icon-button-action">
3
4
  <!-- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="black" width="12px" height="12px">
4
5
  <path d="M0 0h24v24H0z" fill="none"/>
@@ -1,12 +1,11 @@
1
1
  // @import '../../../../../sass/variables';
2
2
 
3
3
  div {
4
- --bck-msg-sent: #62a8ea;
5
- --col-msg-sent:#ffffff;
6
- --light-white: #f7f7f7;
7
- --black: #1a1a1a;
8
- --gray: #aaaaaa;
9
- --blue: rgb(42, 106, 193);
4
+ --backgroundColor: --basic-blue;
5
+ --textColor: --bck-msg-sent;
6
+ --hoverBackgroundColor: --bck-msg-sent;
7
+ --hoverTextColor: --basic-blue;
8
+ --buttonFontSize: --button-in-msg-font-size;
10
9
  }
11
10
 
12
11
  .button-in-msg {
@@ -15,19 +14,19 @@ div {
15
14
  max-width: 300px;
16
15
  min-width: inherit;
17
16
  cursor: pointer;
18
- border: 1px solid var(--blue);
17
+ border: 1px solid var(--textColor);
19
18
  border-radius: 20px;
20
19
  margin: 3px;
21
- background: transparent;
20
+ background: var(--backgroundColor);
22
21
  overflow: hidden;
23
22
  font-family: 'Muli', sans-serif;
24
- font-size: 15px;
23
+ font-size: var(--buttonFontSize);
25
24
  -o-text-overflow: ellipsis;
26
25
  text-overflow: ellipsis;
27
26
  white-space: nowrap;
28
27
  letter-spacing: -0.24px;
29
28
  -webkit-font-smoothing: antialiased;
30
- color: var(--blue);
29
+ color: var(--textColor);
31
30
  line-height: 16px;
32
31
  }
33
32
 
@@ -38,23 +37,23 @@ div {
38
37
  top: -1px;
39
38
  right: 1px;
40
39
  svg {
41
- fill: var(--blue);
40
+ fill: var(--textColor);
42
41
  }
43
42
  }
44
43
  .icon-button-action-self{
45
44
  position: absolute;
46
45
  right: 1px;
47
46
  svg {
48
- fill: var(--blue);
47
+ fill: var(--textColor);
49
48
  }
50
49
  }
51
50
  &:focus,
52
51
  &:hover {
53
- color: white;
54
- background: var(--blue);
52
+ color: var(--hoverTextColor);
53
+ background: var(--hoverBackgroundColor);
55
54
  .icon-button-action, .icon-button-action-self {
56
55
  svg {
57
- fill: white;
56
+ fill: var(--hoverTextColor);
58
57
  }
59
58
  }
60
59
  }
@@ -1,4 +1,4 @@
1
- import { Component, ElementRef, EventEmitter, Input, OnInit, Output } from '@angular/core';
1
+ import { Component, ElementRef, EventEmitter, Input, OnInit, Output, SimpleChanges } from '@angular/core';
2
2
 
3
3
  @Component({
4
4
  selector: 'chat-link-button-attachment',
@@ -8,16 +8,35 @@ import { Component, ElementRef, EventEmitter, Input, OnInit, Output } from '@ang
8
8
  export class LinkButtonComponent implements OnInit {
9
9
 
10
10
  @Input() button: any;
11
- @Input() themeColor: string;
12
- @Input() foregroundColor: string;
11
+ @Input() fontSize: string;
12
+ @Input() backgroundColor: string;
13
+ @Input() textColor: string;
14
+ @Input() hoverBackgroundColor: string;
15
+ @Input() hoverTextColor: string;
13
16
  @Output() onButtonClicked = new EventEmitter();
14
17
  public type: string = "url"
15
18
  constructor(private elementRef: ElementRef) { }
16
19
 
17
20
  ngOnInit() {
21
+ }
22
+
23
+ ngOnChanges(changes: SimpleChanges){
18
24
  //decomment if element should have same color of themeColor and fregroundColor
19
- // this.elementRef.nativeElement.style.setProperty('--themeColor', this.themeColor);
20
- // this.elementRef.nativeElement.style.setProperty('--foregroundColor', this.foregroundColor);
25
+ if(this.fontSize) this.elementRef.nativeElement.querySelector('.url').style.setProperty('--buttonFontSize', this.fontSize);
26
+ if(this.backgroundColor) this.elementRef.nativeElement.querySelector('.url').style.setProperty('--backgroundColor', this.backgroundColor);
27
+ if(this.textColor) this.elementRef.nativeElement.querySelector('.url').style.setProperty('--textColor', this.textColor);
28
+ if(this.hoverBackgroundColor) this.elementRef.nativeElement.querySelector('.url').style.setProperty('--hoverBackgroundColor', this.hoverBackgroundColor);
29
+ if(this.hoverTextColor) this.elementRef.nativeElement.querySelector('.url').style.setProperty('--hoverTextColor', this.hoverTextColor);
30
+ }
31
+
32
+ onMouseOver(event){
33
+ // if(this.themeColor) this.elementRef.nativeElement.querySelector('.url').style.background = this.themeColor
34
+ // if(this.foregroundColor) this.elementRef.nativeElement.querySelector('.url').style.color = this.foregroundColor
35
+ }
36
+
37
+ onMouseOut(event){
38
+ // this.elementRef.nativeElement.querySelector('.url').style.color = '';
39
+ // this.elementRef.nativeElement.querySelector('.url').style.background = ''
21
40
  }
22
41
 
23
42
  actionButtonUrl(){
@@ -1,3 +1,8 @@
1
- <div class="button-in-msg text" (click)="actionButtonText()" title="{{button?.value}}">
1
+ <div class="button-in-msg text"
2
+ [ngClass]="{'disabled': isConversationArchived}"
3
+ title="{{button?.value}}"
4
+ (click)="actionButtonText()"
5
+ (mouseover)="onMouseOver($event)"
6
+ (mouseout)="onMouseOut($event)">
2
7
  {{button?.value}}
3
8
  </div>
@@ -1,11 +1,10 @@
1
1
  // @import '../../../../../sass/variables';
2
2
  div {
3
- --bck-msg-sent: #62a8ea;
4
- --col-msg-sent:#ffffff;
5
- --light-white: #f7f7f7;
6
- --black: #1a1a1a;
7
- --gray: #aaaaaa;
8
- --blue: rgb(42, 106, 193);
3
+ --backgroundColor: --basic-blue;
4
+ --textColor: --bck-msg-sent;
5
+ --hoverBackgroundColor: --bck-msg-sent;
6
+ --hoverTextColor: --basic-blue;
7
+ --buttonFontSize: --button-in-msg-font-size;
9
8
  }
10
9
 
11
10
 
@@ -15,19 +14,19 @@ div {
15
14
  max-width: 300px;
16
15
  min-width: inherit;
17
16
  cursor: pointer;
18
- border: 1px solid var(--blue);
17
+ border: 1px solid var(--textColor); //$blue
19
18
  border-radius: 20px;
20
19
  margin: 3px;
21
- background: transparent;
20
+ background: var(--backgroundColor);
22
21
  overflow: hidden;
23
22
  font-family: 'Muli', sans-serif;
24
- font-size: 15px;
23
+ font-size: var(--buttonFontSize);
25
24
  -o-text-overflow: ellipsis;
26
25
  text-overflow: ellipsis;
27
26
  white-space: nowrap;
28
27
  letter-spacing: -0.24px;
29
28
  -webkit-font-smoothing: antialiased;
30
- color: var(--blue);
29
+ color: var(--textColor); //$blue
31
30
  line-height: 16px;
32
31
  }
33
32
 
@@ -36,11 +35,11 @@ div {
36
35
  transition: background-color .6s ease;
37
36
  &:focus,
38
37
  &:hover {
39
- color: white;
40
- background: var(--blue);
38
+ color: var(--hoverTextColor);
39
+ background: var(--hoverBackgroundColor);
41
40
  .icon-button-action {
42
41
  svg {
43
- fill: var(--black);
42
+ fill: --black;
44
43
  }
45
44
  }
46
45
  }