@chat21/chat21-ionic 3.0.85 → 3.0.86-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 (171) hide show
  1. package/CHANGELOG.md +121 -4
  2. package/README.md +2 -2
  3. package/package.json +4 -3
  4. package/src/app/app-routing.module.ts +7 -2
  5. package/src/app/app.component.html +7 -1
  6. package/src/app/app.component.scss +20 -2
  7. package/src/app/app.component.ts +131 -20
  8. package/src/app/app.module.ts +8 -3
  9. package/src/app/chatlib/conversation-detail/conversation-content/conversation-content.component.ts +11 -4
  10. package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.html +86 -23
  11. package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.scss +188 -88
  12. package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.ts +42 -3
  13. package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.html +11 -24
  14. package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.scss +6 -10
  15. package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.spec.ts +2 -2
  16. package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.ts +16 -26
  17. package/src/app/chatlib/conversation-detail/message/buttons/action-button/action-button.component.html +5 -1
  18. package/src/app/chatlib/conversation-detail/message/buttons/action-button/action-button.component.scss +22 -15
  19. package/src/app/chatlib/conversation-detail/message/buttons/action-button/action-button.component.ts +25 -5
  20. package/src/app/chatlib/conversation-detail/message/buttons/link-button/link-button.component.html +2 -1
  21. package/src/app/chatlib/conversation-detail/message/buttons/link-button/link-button.component.scss +14 -15
  22. package/src/app/chatlib/conversation-detail/message/buttons/link-button/link-button.component.ts +24 -5
  23. package/src/app/chatlib/conversation-detail/message/buttons/text-button/text-button.component.html +6 -1
  24. package/src/app/chatlib/conversation-detail/message/buttons/text-button/text-button.component.scss +12 -13
  25. package/src/app/chatlib/conversation-detail/message/buttons/text-button/text-button.component.ts +26 -5
  26. package/src/app/chatlib/conversation-detail/message/frame/frame.component.html +8 -2
  27. package/src/app/chatlib/conversation-detail/message/frame/frame.component.scss +36 -0
  28. package/src/app/chatlib/conversation-detail/message/frame/frame.component.ts +2 -2
  29. package/src/app/chatlib/conversation-detail/message/html/html.component.ts +0 -1
  30. package/src/app/chatlib/conversation-detail/message/image/image.component.html +3 -2
  31. package/src/app/chatlib/conversation-detail/message/image/image.component.scss +17 -5
  32. package/src/app/chatlib/conversation-detail/message/image/image.component.ts +1 -1
  33. package/src/app/chatlib/conversation-detail/message/info-message/info-message.component.scss +3 -2
  34. package/src/app/chatlib/conversation-detail/message/message-attachment/message-attachment.component.html +16 -6
  35. package/src/app/chatlib/conversation-detail/message/message-attachment/message-attachment.component.scss +1 -3
  36. package/src/app/chatlib/conversation-detail/message/message-attachment/message-attachment.component.ts +2 -0
  37. package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.html +78 -52
  38. package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.scss +63 -20
  39. package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.ts +14 -10
  40. package/src/app/components/canned-response/canned-response.component.html +9 -9
  41. package/src/app/components/canned-response/canned-response.component.scss +14 -7
  42. package/src/app/components/canned-response/canned-response.component.ts +5 -4
  43. package/src/app/components/contacts-directory/contacts-directory.component.html +22 -26
  44. package/src/app/components/contacts-directory/contacts-directory.component.scss +8 -6
  45. package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.html +64 -47
  46. package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.scss +98 -61
  47. package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.ts +24 -44
  48. package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component_2.html +116 -0
  49. package/src/app/components/conversation-detail/message-text-area/message-text-area.component.html +39 -42
  50. package/src/app/components/conversation-detail/message-text-area/message-text-area.component.scss +67 -4
  51. package/src/app/components/conversation-detail/message-text-area/message-text-area.component.ts +82 -154
  52. package/src/app/components/conversation-info/info-content/info-content.component.html +23 -2
  53. package/src/app/components/conversation-info/info-content/info-content.component.ts +5 -6
  54. package/src/app/components/conversation-info/info-direct/info-direct.component.html +7 -14
  55. package/src/app/components/conversation-info/info-direct/info-direct.component.scss +23 -0
  56. package/src/app/components/conversation-info/info-direct/info-direct.component.ts +1 -6
  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/conversation-info/info-support-group/info-support-group.component.html +2 -1
  61. package/src/app/components/conversation-info/info-support-group/info-support-group.component.ts +0 -1
  62. package/src/app/components/{ddp-header/ddp-header.component.html → conversations-list/header-conversations-list/header-conversations-list.component.html} +3 -3
  63. package/src/app/components/{ddp-header/ddp-header.component.scss → conversations-list/header-conversations-list/header-conversations-list.component.scss} +16 -4
  64. 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
  65. package/src/app/components/{ddp-header/ddp-header.component.ts → conversations-list/header-conversations-list/header-conversations-list.component.ts} +7 -16
  66. package/src/app/components/conversations-list/header-conversations-list-archived/header-conversations-list-archived.component.html +12 -0
  67. package/src/app/components/conversations-list/header-conversations-list-archived/header-conversations-list-archived.component.scss +14 -0
  68. 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
  69. 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
  70. package/src/app/components/navbar/navbar.component.html +103 -0
  71. package/src/app/components/navbar/navbar.component.scss +249 -0
  72. package/src/app/components/{ddp-header/ddp-header.component.spec.ts → navbar/navbar.component.spec.ts} +6 -6
  73. package/src/app/components/navbar/navbar.component.ts +195 -0
  74. package/src/app/components/project-item/project-item.component.html +98 -149
  75. package/src/app/components/project-item/project-item.component.scss +43 -35
  76. package/src/app/components/project-item/project-item.component.ts +16 -4
  77. package/src/app/components/sidebar-user-details/sidebar-user-details.component.html +5 -5
  78. package/src/app/components/sidebar-user-details/sidebar-user-details.component.ts +24 -13
  79. package/src/app/components/utils/user-presence/user-presence.component.html +7 -2
  80. package/src/app/components/utils/user-presence/user-presence.component.scss +35 -18
  81. package/src/app/components/utils/user-presence/user-presence.component.ts +6 -10
  82. package/src/app/{pages → modals}/create-canned-response/create-canned-response-routing.module.ts +0 -0
  83. package/src/app/{pages → modals}/create-canned-response/create-canned-response.module.ts +0 -0
  84. package/src/app/{pages → modals}/create-canned-response/create-canned-response.page.html +0 -0
  85. package/src/app/{pages → modals}/create-canned-response/create-canned-response.page.scss +0 -0
  86. package/src/app/{pages → modals}/create-canned-response/create-canned-response.page.spec.ts +0 -0
  87. package/src/app/{pages → modals}/create-canned-response/create-canned-response.page.ts +13 -13
  88. package/src/app/{pages → modals}/loader-preview/loader-preview-routing.module.ts +0 -0
  89. package/src/app/{pages → modals}/loader-preview/loader-preview.module.ts +0 -0
  90. package/src/app/{pages → modals}/loader-preview/loader-preview.page.html +1 -1
  91. package/src/app/{pages → modals}/loader-preview/loader-preview.page.scss +4 -0
  92. package/src/app/{pages → modals}/loader-preview/loader-preview.page.spec.ts +0 -0
  93. package/src/app/{pages → modals}/loader-preview/loader-preview.page.ts +1 -2
  94. package/src/app/modals/send-email/send-email-routing.module.ts +17 -0
  95. package/src/app/modals/send-email/send-email.module.ts +31 -0
  96. package/src/app/modals/send-email/send-email.page.html +46 -0
  97. package/src/app/modals/send-email/send-email.page.scss +161 -0
  98. package/src/app/modals/send-email/send-email.page.spec.ts +24 -0
  99. package/src/app/modals/send-email/send-email.page.ts +89 -0
  100. package/src/app/pages/contacts-directory/contacts-directory.page.html +1 -1
  101. package/src/app/pages/contacts-directory/contacts-directory.page.scss +47 -0
  102. package/src/app/pages/contacts-directory/contacts-directory.page.ts +2 -0
  103. package/src/app/pages/conversation-detail/conversation-detail.module.ts +0 -8
  104. package/src/app/pages/conversation-detail/conversation-detail.page.html +48 -27
  105. package/src/app/pages/conversation-detail/conversation-detail.page.scss +45 -254
  106. package/src/app/pages/conversation-detail/conversation-detail.page.ts +330 -138
  107. package/src/app/pages/conversations-list/conversations-list.page.html +11 -8
  108. package/src/app/pages/conversations-list/conversations-list.page.scss +18 -2
  109. package/src/app/pages/conversations-list/conversations-list.page.ts +26 -24
  110. package/src/app/pages/profile-info/profile-info.page.html +2 -4
  111. package/src/app/pages/unassigned-conversations/unassigned-conversations.page.html +1 -1
  112. package/src/app/pages/unassigned-conversations/unassigned-conversations.page.scss +42 -0
  113. package/src/app/pages/unassigned-conversations/unassigned-conversations.page.ts +1 -0
  114. package/src/app/services/canned-responses/canned-responses.service.ts +26 -0
  115. package/src/app/services/projects/projects.service.spec.ts +12 -0
  116. package/src/app/services/projects/projects.service.ts +43 -0
  117. package/src/app/services/tiledesk/tiledesk.service.ts +33 -17
  118. package/src/app/shared/shared.module.ts +24 -33
  119. package/src/app/utils/toast.spec.ts +7 -0
  120. package/src/app/utils/toast.ts +48 -0
  121. package/src/assets/i18n/ar.json +288 -265
  122. package/src/assets/i18n/az.json +24 -1
  123. package/src/assets/i18n/de.json +25 -2
  124. package/src/assets/i18n/en.json +25 -2
  125. package/src/assets/i18n/es.json +26 -3
  126. package/src/assets/i18n/fr.json +24 -1
  127. package/src/assets/i18n/it.json +24 -1
  128. package/src/assets/i18n/kk.json +25 -2
  129. package/src/assets/i18n/pt.json +25 -2
  130. package/src/assets/i18n/ru.json +24 -1
  131. package/src/assets/i18n/sr.json +287 -264
  132. package/src/assets/i18n/sv.json +25 -2
  133. package/src/assets/i18n/tr.json +25 -2
  134. package/src/assets/i18n/uk.json +25 -2
  135. package/src/assets/i18n/uz.json +24 -1
  136. package/src/assets/js/chat21client.js +1 -1
  137. package/src/assets/sounds/interface-start.mp3 +0 -0
  138. package/src/assets/sounds/wheep-wheep.mp3 +0 -0
  139. package/src/chat-config-mqtt-localhost.json +2 -2
  140. package/src/chat-config-native-mqtt.json +3 -0
  141. package/src/chat21-core/models/conversation.ts +0 -1
  142. package/src/chat21-core/models/projects.ts +27 -0
  143. package/src/chat21-core/providers/firebase/firebase-typing.service.ts +7 -9
  144. package/src/chat21-core/providers/logger/customLogger.ts +1 -1
  145. package/src/chat21-core/providers/mqtt/mqtt-auth-service.ts +7 -8
  146. package/src/chat21-core/utils/constants.ts +7 -1
  147. package/src/chat21-core/utils/convertRequestToConversation.ts +41 -0
  148. package/src/chat21-core/utils/user-typing/user-typing.component.html +8 -5
  149. package/src/chat21-core/utils/user-typing/user-typing.component.scss +87 -17
  150. package/src/chat21-core/utils/user-typing/user-typing.component.ts +12 -94
  151. package/src/chat21-core/utils/utils.ts +41 -11
  152. package/src/global.scss +59 -255
  153. package/src/index.html +0 -9
  154. package/src/variables.scss +30 -10
  155. package/src/app/components/conversation-detail/bubble-day-message/bubble-day-message.component.html +0 -3
  156. package/src/app/components/conversation-detail/bubble-day-message/bubble-day-message.component.scss +0 -21
  157. package/src/app/components/conversation-detail/bubble-day-message/bubble-day-message.component.spec.ts +0 -24
  158. package/src/app/components/conversation-detail/bubble-day-message/bubble-day-message.component.ts +0 -14
  159. package/src/app/components/conversation-detail/bubble-my-message/bubble-my-message.component.html +0 -54
  160. package/src/app/components/conversation-detail/bubble-my-message/bubble-my-message.component.scss +0 -98
  161. package/src/app/components/conversation-detail/bubble-my-message/bubble-my-message.component.ts +0 -84
  162. package/src/app/components/conversation-detail/bubble-others-message/bubble-others-message.component.html +0 -30
  163. package/src/app/components/conversation-detail/bubble-others-message/bubble-others-message.component.scss +0 -83
  164. package/src/app/components/conversation-detail/bubble-others-message/bubble-others-message.component.spec.ts +0 -24
  165. package/src/app/components/conversation-detail/bubble-others-message/bubble-others-message.component.ts +0 -68
  166. package/src/app/components/conversation-detail/bubble-system-message/bubble-system-message.component.html +0 -3
  167. package/src/app/components/conversation-detail/bubble-system-message/bubble-system-message.component.scss +0 -10
  168. package/src/app/components/conversation-detail/bubble-system-message/bubble-system-message.component.spec.ts +0 -24
  169. package/src/app/components/conversation-detail/bubble-system-message/bubble-system-message.component.ts +0 -14
  170. package/src/app/components/conversation-detail/option-header/option-header.component.html +0 -13
  171. package/src/app/components/conversation-detail/option-header/option-header.component.scss +0 -0
@@ -1,24 +1,41 @@
1
- .status-icon {
2
- position: absolute;
3
- width: 14px;
4
- height: 14px;
5
- top: 0px;
6
- left: 0;
7
- border: 2px solid #ffffff;
1
+ #presence-container{
2
+ display: flex;
3
+ }
4
+
5
+ .status-icon-container{
6
+ position: fixed;
7
+ top: 22px;
8
+ left: 30px;
9
+ background-color: white;
10
+ height: 17px;
11
+ width: 17px;
8
12
  border-radius: 50%;
9
- background-color: #f44336;
10
- &.online {
11
- background-color: #4caf50;
13
+ display: flex;
14
+ align-items: center;
15
+ justify-content: center;
16
+
17
+ &.mobile{
18
+ top: 36px;
19
+ left: 50px;
20
+ }
21
+
22
+ svg{
23
+ fill: #f44336;
24
+
25
+ &.online{
26
+ fill: #4caf50;
27
+ }
12
28
  }
13
29
 
14
30
  }
31
+
15
32
  .online-point {
16
- position: absolute;
17
- display: inline-block;
18
- top: 0;
19
- left: 20px;
20
- color: rgba(255, 255, 255, 0.5);
21
- font-size: 12px;
22
- line-height: 14px;
23
- text-align: left;
33
+ display: inline-flex;
34
+ align-items: center;
35
+ line-height: 1.2rem;
36
+ font-weight: 500;
37
+ color: #779bbb;
38
+ font-size: 10px;
39
+ max-width: 90%;
40
+ margin-right: 5px;
24
41
  }
@@ -17,11 +17,10 @@ import { LoggerInstance } from 'src/chat21-core/providers/logger/loggerInstance'
17
17
  })
18
18
 
19
19
  export class UserPresenceComponent implements OnInit, OnDestroy {
20
+
20
21
  @Input() idUser: string;
22
+ @Input() isMobile: boolean;
21
23
  @Input() translationMap: Map<string, string>;
22
- @Input() fontColor: string;
23
- @Input() borderColor: string;
24
-
25
24
 
26
25
  public online = true;
27
26
  public status = '';
@@ -47,9 +46,6 @@ export class UserPresenceComponent implements OnInit, OnDestroy {
47
46
 
48
47
  /** */
49
48
  initialize() {
50
- if (this.translationMap) {
51
- this.status = this.translationMap.get('LABEL_ACTIVE_NOW');
52
- }
53
49
  this.logger.log('[USER-PRESENCE-COMP] - initialize - this.translationMap', this.translationMap);
54
50
  this.logger.log('[USER-PRESENCE-COMP] - initialize - this.status', this.status);
55
51
  this.logger.log('[USER-PRESENCE-COMP] - initialize - idUser ->', this.idUser);
@@ -122,11 +118,11 @@ export class UserPresenceComponent implements OnInit, OnDestroy {
122
118
  this.logger.log('[USER-PRESENCE-COMP] userIsOnLine - userId: ', userId, ' - isOnline: ', isOnline);
123
119
  this.online = isOnline;
124
120
  if (isOnline) {
125
- this.status = this.translationMap.get('LABEL_AVAILABLE');
121
+ this.status = this.translationMap.get('LABEL_ONLINE');
126
122
  } else {
127
- this.status = this.translationMap.get('LABEL_NOT_AVAILABLE');
123
+ this.status = this.translationMap.get('LABEL_OFFLINE');
128
124
  if (this.lastConnectionDate && this.lastConnectionDate.trim() !== '') {
129
- this.status = this.lastConnectionDate;
125
+ this.status = this.status + ' (' + this.lastConnectionDate + ')'
130
126
  }
131
127
  }
132
128
  }
@@ -141,7 +137,7 @@ export class UserPresenceComponent implements OnInit, OnDestroy {
141
137
  this.logger.log('[USER-PRESENCE-COMP] userLastConnection - lastConnectionDate', lastConnectionDate);
142
138
  this.lastConnectionDate = lastConnectionDate;
143
139
  if (this.online === false) {
144
- this.status = this.lastConnectionDate;
140
+ this.status = this.translationMap.get('LABEL_OFFLINE') + ' (' + this.lastConnectionDate + ')'
145
141
  }
146
142
  }
147
143
  }
@@ -1,3 +1,4 @@
1
+ import { CannedResponsesService } from 'src/app/services/canned-responses/canned-responses.service';
1
2
  import { Component, Input, OnInit } from '@angular/core';
2
3
  import { ModalController } from '@ionic/angular';
3
4
  import { Validators, FormBuilder, FormGroup, FormControl } from '@angular/forms';
@@ -38,6 +39,7 @@ export class CreateCannedResponsePage implements OnInit {
38
39
  private translate: TranslateService,
39
40
  public tiledeskAuthService: TiledeskAuthService,
40
41
  public tiledeskService: TiledeskService,
42
+ public cannedResponsesService: CannedResponsesService,
41
43
  private menu: MenuController,
42
44
  public events: EventsService,
43
45
  private route: ActivatedRoute,
@@ -181,19 +183,17 @@ export class CreateCannedResponsePage implements OnInit {
181
183
  this.logger.log('[CREATE-CANNED-RES] - CREATE CANNED RESP - MSG ', canned_response_message);
182
184
  this.logger.log('[CREATE-CANNED-RES] - CREATE CANNED RESP - TITLE ', canned_response_title);
183
185
 
184
- this.tiledeskService.createCannedResponse(canned_response_message.trim(), canned_response_title.trim(), this.prjctID, this.tiledeskToken)
185
- .subscribe((responses: any) => {
186
- this.logger.log('[CREATE-CANNED-RES] - CREATE CANNED RESP - RES ', responses);
187
-
188
- }, (error) => {
189
- this.logger.error('[CREATE-CANNED-RES]- CREATE CANNED RESP - ERROR ', error);
190
- this.showSpinnerCreateCannedResponse = false;
191
- }, () => {
192
- this.logger.log('[CREATE-CANNED-RES] - CREATE CANNED RESP * COMPLETE *');
193
- this.showSpinnerCreateCannedResponse = false;
194
- this.closeModalCreateCannedResponseModal()
195
- this.events.publish('newcannedresponse:created', true);
196
- });
186
+ this.cannedResponsesService.add(this.tiledeskToken, this.prjctID, canned_response_title.trim(), canned_response_message.trim()).subscribe((responses: any) => {
187
+ this.logger.log('[CREATE-CANNED-RES] - CREATE CANNED RESP - RES ', responses);
188
+ }, (error) => {
189
+ this.logger.error('[CREATE-CANNED-RES]- CREATE CANNED RESP - ERROR ', error);
190
+ this.showSpinnerCreateCannedResponse = false;
191
+ }, () => {
192
+ this.logger.log('[CREATE-CANNED-RES] - CREATE CANNED RESP * COMPLETE *');
193
+ this.showSpinnerCreateCannedResponse = false;
194
+ this.closeModalCreateCannedResponseModal()
195
+ this.events.publish('newcannedresponse:created', true);
196
+ });
197
197
  }
198
198
 
199
199
  openAddPersonalisationMenu() {
@@ -55,7 +55,7 @@
55
55
 
56
56
  <!-- fab placed to the (vertical) center and end -->
57
57
  <ion-fab vertical="end" horizontal="end" slot="fixed" class="sendButton">
58
- <ion-fab-button color="primary" (click)="onSendMessage()">
58
+ <ion-fab-button (click)="onSendMessage()">
59
59
  <ion-icon name="send"></ion-icon>
60
60
  </ion-fab-button>
61
61
  </ion-fab>
@@ -11,6 +11,10 @@
11
11
  transform: translateX(-50%);
12
12
  }
13
13
 
14
+ ion-fab-button{
15
+ --background: var(--basic-blue);
16
+ }
17
+
14
18
  .previewSelected {
15
19
  width: 100%;
16
20
  height: auto;
@@ -1,5 +1,4 @@
1
- import {
2
- Component, OnInit, Input, ViewChild, ElementRef, HostListener, AfterViewInit} from '@angular/core'
1
+ import {Component, OnInit, Input, ViewChild, ElementRef, HostListener, AfterViewInit} from '@angular/core'
3
2
  import { TYPE_MSG_IMAGE } from 'src/chat21-core/utils/constants'
4
3
  import { ModalController } from '@ionic/angular'
5
4
  import { DomSanitizer, SafeResourceUrl } from '@angular/platform-browser'
@@ -0,0 +1,17 @@
1
+ import { NgModule } from '@angular/core';
2
+ import { Routes, RouterModule } from '@angular/router';
3
+
4
+ import { SendEmailModal } from './send-email.page';
5
+
6
+ const routes: Routes = [
7
+ {
8
+ path: '',
9
+ component: SendEmailModal
10
+ }
11
+ ];
12
+
13
+ @NgModule({
14
+ imports: [RouterModule.forChild(routes)],
15
+ exports: [RouterModule],
16
+ })
17
+ export class SendEmailPageRoutingModule {}
@@ -0,0 +1,31 @@
1
+ import { NgModule } from '@angular/core';
2
+ import { CommonModule } from '@angular/common';
3
+ import { FormsModule, ReactiveFormsModule } from '@angular/forms';
4
+
5
+ import { IonicModule } from '@ionic/angular';
6
+
7
+ import { SendEmailPageRoutingModule } from './send-email-routing.module';
8
+
9
+ import { SendEmailModal } from './send-email.page';
10
+ import { TranslateModule } from '@ngx-translate/core';
11
+ import { createTranslateLoader } from 'src/chat21-core/utils/utils';
12
+ import { HttpClient } from '@angular/common/http';
13
+
14
+ @NgModule({
15
+ imports: [
16
+ CommonModule,
17
+ FormsModule,
18
+ IonicModule,
19
+ SendEmailPageRoutingModule,
20
+ TranslateModule.forChild({
21
+ loader: {
22
+ provide: TranslateModule,
23
+ useFactory: (createTranslateLoader),
24
+ deps: [HttpClient]
25
+ }
26
+ }),
27
+ ReactiveFormsModule
28
+ ],
29
+ declarations: [SendEmailModal]
30
+ })
31
+ export class SendEmailModalModule {}
@@ -0,0 +1,46 @@
1
+ <ion-header>
2
+ <ion-toolbar>
3
+ <ion-title>{{'LABEL_EMAIL' | translate}}</ion-title>
4
+ <ion-buttons slot="end">
5
+ <ion-button ion-button fill="clear" (click)="onClose()">
6
+ <ion-icon slot="icon-only" name="close"></ion-icon>
7
+ </ion-button>
8
+ </ion-buttons>
9
+ </ion-toolbar>
10
+ </ion-header>
11
+
12
+ <ion-content>
13
+ <div class="content-container">
14
+ <form [formGroup]="emailFormGroup" (ngSubmit)="onSubmit()">
15
+ <!-- <div class="form-group row">
16
+ <ion-item lines="none">
17
+ <ion-label position="floating">Oggetto</ion-label>
18
+ <ion-input type="text" formControlName="topic"></ion-input>
19
+ </ion-item>
20
+ </div> -->
21
+ <div class="field-wrapper" id="div_input_topic" #div_input_topic>
22
+ <input type="text" formControlName="subject" >
23
+ <div class="field-placeholder"><span>{{translationMap?.get('SUBJECT')}}</span></div>
24
+ </div>
25
+
26
+ <ion-label class="message-placeholder">{{translationMap?.get('MESSAGE')}}</ion-label>
27
+ <div class="field-wrapper-email">
28
+ <ion-textarea
29
+ formControlName="text"
30
+ autosize="false"
31
+ auto-grow="true"
32
+ autofocus="true"
33
+ placeholder="{{translationMap?.get('MESSAGE_PLACEHOLDER')}}">
34
+ </ion-textarea>
35
+ <div class="info-wrapper">
36
+ <ion-label>Powered by</ion-label>
37
+ <img src="https://support-pre.tiledesk.com/dashboard/assets/img/logos/tiledesk-logo_new_gray.svg">
38
+ </div>
39
+ </div>
40
+
41
+ <div class="field-wrapper-submit">
42
+ <ion-button [disabled]="emailFormGroup.invalid" ion-button fill="clear" type="submit">{{translationMap?.get('LABEL_SEND')}}</ion-button>
43
+ </div>
44
+ </form>
45
+ </div>
46
+ </ion-content>
@@ -0,0 +1,161 @@
1
+ ion-content{
2
+ }
3
+
4
+ .content-container{
5
+ padding-top: 40px;
6
+ padding-left: 64px;
7
+ padding-right: 64px;
8
+ }
9
+
10
+ ion-label + ion-input:focus {
11
+ color: rgb(5, 102, 255);
12
+ font-weight: bold;
13
+ }
14
+ ion-input{
15
+ --padding-top: 20px;
16
+ --padding-bottom: 10px;
17
+ // display: block;
18
+ // width: 100%;
19
+ // font-size: 16px;
20
+ // line-height: 20px;
21
+ // letter-spacing: -0.01em;
22
+ // height: 51px;
23
+ // color: rgb(8, 15, 26);
24
+ border-style: solid;
25
+ border-width: 2px;
26
+ border-color: rgb(211, 219, 229);
27
+ border-radius: 4px;
28
+ // padding: 16px 14px;
29
+ // outline: none;
30
+ }
31
+
32
+ ion-input:focus{
33
+ // border-color: rgb(5, 102, 255);
34
+ }
35
+
36
+ // ion-label{
37
+ // align-self: flex-start;
38
+ // display: inline-block;
39
+ // font-size: 12px;
40
+ // line-height: 16px;
41
+ // letter-spacing: -0.01em;
42
+ // padding: 0px 8px 2px;
43
+ // margin-left: 8px;
44
+ // background-color: rgb(255, 255, 255);
45
+ // position: absolute;
46
+ // top: 0px;
47
+ // transform: translateY(-7px);
48
+ // transition: transform 0.1s ease 0s;
49
+ // border-radius: 4px;
50
+ // }
51
+
52
+ .field-wrapper{
53
+ position: relative;
54
+ margin-bottom: 15px;
55
+ }
56
+
57
+ .field-wrapper input{
58
+ border-style: solid;
59
+ border-width: 2px;
60
+ border-color: rgb(211, 219, 229);
61
+ color: rgb(98, 112, 139);
62
+ border-radius: 4px;
63
+ padding: 15px;
64
+ border-radius: 4px;
65
+ width: 100%;
66
+ }
67
+
68
+ .field-wrapper .field-placeholder{
69
+ font-size: 16px;
70
+ position: absolute;
71
+ /* background: #fff; */
72
+ bottom: 17px;
73
+ -webkit-box-sizing: border-box;
74
+ box-sizing: border-box;
75
+ color: #80868b;
76
+ left: 8px;
77
+ padding: 0 8px;
78
+ -webkit-transition: transform 150ms cubic-bezier(0.4,0,0.2,1),opacity 150ms cubic-bezier(0.4,0,0.2,1);
79
+ transition: transform 150ms cubic-bezier(0.4,0,0.2,1),opacity 150ms cubic-bezier(0.4,0,0.2,1);
80
+ z-index: 1;
81
+
82
+ text-align: left;
83
+ width: 100%;
84
+ }
85
+
86
+ .field-wrapper .field-placeholder span{
87
+ background: #ffffff;
88
+ padding: 0px 8px;
89
+ }
90
+
91
+ .field-wrapper input:not([disabled]):focus~.field-placeholder,
92
+ .field-wrapper.hasValue input:not([disabled])~.field-placeholder{
93
+ -webkit-transform: scale(.75) translateY(-35px) translateX(-75px);
94
+ transform: scale(.75) translateY(-35px) translateX(-75px);
95
+ color:#1A73E8;
96
+ font-weight: bold;
97
+ }
98
+
99
+ .field-wrapper-email{
100
+ background-color: #f1f4f7;
101
+ border: 0;
102
+ border-radius: 6px;
103
+ padding: 34px;
104
+ font-size: 16px;
105
+ overflow: hidden;
106
+
107
+ ion-textarea{
108
+ border-radius: 6px; // NK edited
109
+ padding: 0;
110
+ margin: 0;
111
+ height: auto;
112
+ overflow: auto;
113
+ background-color: white;
114
+ --padding-top: 12px;
115
+ --padding-bottom: 12px;
116
+ --padding-start:12px;
117
+ --padding-end: 12px;
118
+ min-height: 184px;
119
+ max-height: 184px;
120
+ color: rgb(98, 112, 139);
121
+ }
122
+ }
123
+
124
+ ion-label.message-placeholder{
125
+ display: inline-block;
126
+ font-weight: 400;
127
+ max-width: 100%
128
+ }
129
+
130
+ .info-wrapper{
131
+ display: flex;
132
+ flex-direction: column;
133
+ -webkit-box-align: center;
134
+ align-items: center;
135
+ margin-top: 20px;
136
+ // padding-bottom: 30px;
137
+ position: relative;
138
+ text-align: center;
139
+ color: rgb(98, 112, 139);
140
+ font-size: 13px;
141
+
142
+ img{
143
+ max-width: 35%;
144
+ }
145
+ }
146
+
147
+ .field-wrapper-submit{
148
+ margin-top: 20px;
149
+ display: flex;
150
+ justify-content: center;
151
+
152
+ ion-button{
153
+ background-color: #f1f4f7;
154
+ color: rgb(98, 112, 139);
155
+ border-radius: 4px;
156
+ font-size: 18px;
157
+ height: 46px;
158
+ line-height: 23px;
159
+ min-width: 160px;
160
+ }
161
+ }
@@ -0,0 +1,24 @@
1
+ import { async, ComponentFixture, TestBed } from '@angular/core/testing';
2
+ import { IonicModule } from '@ionic/angular';
3
+
4
+ import { SendEmailModal } from './send-email.page';
5
+
6
+ describe('SendEmailPage', () => {
7
+ let component: SendEmailModal;
8
+ let fixture: ComponentFixture<SendEmailModal>;
9
+
10
+ beforeEach(async(() => {
11
+ TestBed.configureTestingModule({
12
+ declarations: [ SendEmailModal ],
13
+ imports: [IonicModule.forRoot()]
14
+ }).compileComponents();
15
+
16
+ fixture = TestBed.createComponent(SendEmailModal);
17
+ component = fixture.componentInstance;
18
+ fixture.detectChanges();
19
+ }));
20
+
21
+ it('should create', () => {
22
+ expect(component).toBeTruthy();
23
+ });
24
+ });
@@ -0,0 +1,89 @@
1
+ import { TiledeskAuthService } from 'src/chat21-core/providers/tiledesk/tiledesk-auth.service';
2
+ import { TiledeskService } from 'src/app/services/tiledesk/tiledesk.service';
3
+ import { Component, ElementRef, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core';
4
+ import { FormArray, FormBuilder, FormGroup, Validators } from '@angular/forms';
5
+ import { ModalController, ToastController } from '@ionic/angular';
6
+ import { LoggerService } from 'src/chat21-core/providers/abstract/logger.service';
7
+ import { LoggerInstance } from 'src/chat21-core/providers/logger/loggerInstance';
8
+ import { UserModel } from 'src/chat21-core/models/user';
9
+
10
+ @Component({
11
+ selector: 'send-email-modal',
12
+ templateUrl: './send-email.page.html',
13
+ styleUrls: ['./send-email.page.scss'],
14
+ })
15
+ export class SendEmailModal implements OnInit {
16
+
17
+ @Input() enableBackdropDismiss: any
18
+ @Input() conversationWith: string;
19
+ @Input() msg: string;
20
+ @Input() email: string;
21
+ @Input() projectId: string;
22
+ @Input() translationMap: Map<string, string>;
23
+ @Output() onSubmitForm = new EventEmitter<{}>();
24
+
25
+ @ViewChild('div_input_topic', {static: true}) input_topic: ElementRef;
26
+
27
+ emailFormGroup: FormGroup;
28
+ private logger: LoggerService = LoggerInstance.getInstance()
29
+
30
+ constructor(
31
+ public viewCtrl: ModalController,
32
+ private formBuilder: FormBuilder,
33
+ private tiledeskService: TiledeskService,
34
+ private tiledeskAuthService: TiledeskAuthService,
35
+ private toastController: ToastController
36
+ ) { }
37
+
38
+ ngOnInit() {
39
+ this.logger.log('[SEND-EMAIL-MODAL] Hello!')
40
+ this.emailFormGroup = this.buildFormGroup();
41
+ this.emailFormGroup.valueChanges.subscribe((value)=> {
42
+ value.subject !== ''? this.input_topic.nativeElement.classList.add('hasValue') : this.input_topic.nativeElement.classList.remove('hasValue')
43
+ })
44
+ if(this.msg && (this.msg !== '' || this.msg !== null)){
45
+ this.emailFormGroup.patchValue({ message: this.msg})
46
+ }
47
+ }
48
+
49
+ buildFormGroup(): FormGroup{
50
+ return this.formBuilder.group({
51
+ subject: ['', [Validators.required]],
52
+ text: ['', Validators.required],
53
+ to: this.email,
54
+ request_id: this.conversationWith
55
+ })
56
+ }
57
+ async onClose() {
58
+ this.viewCtrl.dismiss()
59
+ }
60
+
61
+ onSubmit(){
62
+ this.logger.log('[SEND-EMAIL-MODAL] onSubmit -->',this.emailFormGroup)
63
+ const tiledeskToken = this.tiledeskAuthService.getTiledeskToken()
64
+ this.tiledeskService.sendEmail(tiledeskToken, this.projectId, this.emailFormGroup.value).subscribe((res)=> {
65
+ console.log('[SEND-EMAIL-MODAL] subscribe to sendEmail API response -->', res)
66
+ if(res && res.queued){
67
+ this.viewCtrl.dismiss({form: this.emailFormGroup.value})
68
+ this.presentToast(this.translationMap.get('SEND_EMAIL_SUCCESS'), 'success')
69
+ }
70
+ },(error)=> {
71
+ this.logger.error('[SEND-EMAIL-MODAL] subscribe to sendEmail API CALL - ERROR ', error)
72
+ this.presentToast(this.translationMap.get('SEND_EMAIL_ERROR'), 'danger')
73
+ }, ()=> {
74
+ this.logger.log('[SEND-EMAIL-MODAL] subscribe to sendEmail API CALL /* COMPLETE */')
75
+ })
76
+
77
+ }
78
+
79
+ async presentToast(text, color) {
80
+ const toast = await this.toastController.create({
81
+ message: text,
82
+ duration: 2000,
83
+ color: color,
84
+ // position: 'bottom'
85
+ });
86
+ toast.present();
87
+ }
88
+
89
+ }
@@ -1,5 +1,5 @@
1
1
  <ion-header>
2
- <ion-toolbar>
2
+ <ion-toolbar [class.mobile]="isMobile">
3
3
  <ion-title>{{ 'LABEL_NEW_CHAT' | translate }}</ion-title>
4
4
 
5
5
  <ion-buttons slot="end">
@@ -0,0 +1,47 @@
1
+ ion-toolbar {
2
+ height: var(--header-height);
3
+ &:not(.mobile){
4
+ --background: var(--list-bkg-color);
5
+ border: none;
6
+ }
7
+ &.mobile{
8
+ border-bottom: 1px solid rgba(0, 0, 0, 0.05);
9
+ }
10
+
11
+ ion-button{
12
+ --color: var(--basic-blue);
13
+ }
14
+ }
15
+
16
+ ion-content {
17
+ // overwrite inline styles
18
+ --offset-bottom: auto!important;
19
+ --overflow: hidden;
20
+ overflow: scroll;
21
+
22
+ /* For Firefox */
23
+ @-moz-document url-prefix() {
24
+ scrollbar-width: none;
25
+ }
26
+
27
+ &:not(.mobile){
28
+ background: var(--list-bkg-color);
29
+ }
30
+
31
+ &::-webkit-scrollbar {
32
+ width: 6px;
33
+ height: 8px;
34
+ display: none;
35
+ }
36
+
37
+ &::-webkit-scrollbar-track {
38
+ background: #f9f9f9;
39
+ }
40
+ &::-webkit-scrollbar-thumb {
41
+ background-color: #b9b9b9;
42
+ border-radius: 0px;
43
+ }
44
+ &::-webkit-scrollbar-thumb:hover {
45
+ background-color: #727272;
46
+ }
47
+ }
@@ -17,7 +17,9 @@ import { LoggerInstance } from 'src/chat21-core/providers/logger/loggerInstance'
17
17
  styleUrls: ['./contacts-directory.page.scss'],
18
18
  })
19
19
  export class ContactsDirectoryPage implements OnInit {
20
+
20
21
  @Input() token: string;
22
+ @Input() isMobile: boolean;
21
23
  // @Input() user: string;
22
24
 
23
25
  public contacts: Array<UserModel>;
@@ -21,10 +21,6 @@ import { ConversationDetailPage } from './conversation-detail.page';
21
21
  // tslint:disable-next-line: max-line-length
22
22
  import { HeaderConversationDetailComponent } from '../../components/conversation-detail/header-conversation-detail/header-conversation-detail.component';
23
23
  import { MessageTextAreaComponent } from '../../components/conversation-detail/message-text-area/message-text-area.component';
24
- import { BubbleDayMessageComponent } from '../../components/conversation-detail/bubble-day-message/bubble-day-message.component';
25
- import { BubbleSystemMessageComponent } from '../../components/conversation-detail/bubble-system-message/bubble-system-message.component';
26
- import { BubbleMyMessageComponent } from '../../components/conversation-detail/bubble-my-message/bubble-my-message.component';
27
- import { BubbleOthersMessageComponent } from '../../components/conversation-detail/bubble-others-message/bubble-others-message.component';
28
24
  // import { InfoContentComponent } from '../../components/conversation-info/info-content/info-content.component';
29
25
  // import { InfoDirectComponent } from '../../components/conversation-info/info-direct/info-direct.component';
30
26
  import { InfoContentComponent } from 'src/app/components/conversation-info/info-content/info-content.component';
@@ -65,10 +61,6 @@ import { PickerModule } from '@ctrl/ngx-emoji-mart';
65
61
  HeaderConversationDetailComponent,
66
62
  MessageTextAreaComponent,
67
63
  CannedResponseComponent,
68
- // BubbleDayMessageComponent,
69
- // BubbleSystemMessageComponent,
70
- // BubbleMyMessageComponent,
71
- // BubbleOthersMessageComponent,
72
64
  // InfoContentComponent,
73
65
  // InfoSupportGroupComponent,
74
66
  // InfoDirectComponent,