@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.
- package/CHANGELOG.md +121 -4
- package/README.md +2 -2
- package/package.json +4 -3
- package/src/app/app-routing.module.ts +7 -2
- package/src/app/app.component.html +7 -1
- package/src/app/app.component.scss +20 -2
- package/src/app/app.component.ts +131 -20
- package/src/app/app.module.ts +8 -3
- package/src/app/chatlib/conversation-detail/conversation-content/conversation-content.component.ts +11 -4
- package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.html +86 -23
- package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.scss +188 -88
- package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.ts +42 -3
- package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.html +11 -24
- package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.scss +6 -10
- package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.spec.ts +2 -2
- package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.ts +16 -26
- package/src/app/chatlib/conversation-detail/message/buttons/action-button/action-button.component.html +5 -1
- package/src/app/chatlib/conversation-detail/message/buttons/action-button/action-button.component.scss +22 -15
- package/src/app/chatlib/conversation-detail/message/buttons/action-button/action-button.component.ts +25 -5
- package/src/app/chatlib/conversation-detail/message/buttons/link-button/link-button.component.html +2 -1
- package/src/app/chatlib/conversation-detail/message/buttons/link-button/link-button.component.scss +14 -15
- package/src/app/chatlib/conversation-detail/message/buttons/link-button/link-button.component.ts +24 -5
- package/src/app/chatlib/conversation-detail/message/buttons/text-button/text-button.component.html +6 -1
- package/src/app/chatlib/conversation-detail/message/buttons/text-button/text-button.component.scss +12 -13
- package/src/app/chatlib/conversation-detail/message/buttons/text-button/text-button.component.ts +26 -5
- package/src/app/chatlib/conversation-detail/message/frame/frame.component.html +8 -2
- package/src/app/chatlib/conversation-detail/message/frame/frame.component.scss +36 -0
- package/src/app/chatlib/conversation-detail/message/frame/frame.component.ts +2 -2
- package/src/app/chatlib/conversation-detail/message/html/html.component.ts +0 -1
- package/src/app/chatlib/conversation-detail/message/image/image.component.html +3 -2
- package/src/app/chatlib/conversation-detail/message/image/image.component.scss +17 -5
- package/src/app/chatlib/conversation-detail/message/image/image.component.ts +1 -1
- package/src/app/chatlib/conversation-detail/message/info-message/info-message.component.scss +3 -2
- package/src/app/chatlib/conversation-detail/message/message-attachment/message-attachment.component.html +16 -6
- package/src/app/chatlib/conversation-detail/message/message-attachment/message-attachment.component.scss +1 -3
- package/src/app/chatlib/conversation-detail/message/message-attachment/message-attachment.component.ts +2 -0
- package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.html +78 -52
- package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.scss +63 -20
- package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.ts +14 -10
- package/src/app/components/canned-response/canned-response.component.html +9 -9
- package/src/app/components/canned-response/canned-response.component.scss +14 -7
- package/src/app/components/canned-response/canned-response.component.ts +5 -4
- package/src/app/components/contacts-directory/contacts-directory.component.html +22 -26
- package/src/app/components/contacts-directory/contacts-directory.component.scss +8 -6
- package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.html +64 -47
- package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.scss +98 -61
- package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.ts +24 -44
- package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component_2.html +116 -0
- package/src/app/components/conversation-detail/message-text-area/message-text-area.component.html +39 -42
- package/src/app/components/conversation-detail/message-text-area/message-text-area.component.scss +67 -4
- package/src/app/components/conversation-detail/message-text-area/message-text-area.component.ts +82 -154
- package/src/app/components/conversation-info/info-content/info-content.component.html +23 -2
- package/src/app/components/conversation-info/info-content/info-content.component.ts +5 -6
- package/src/app/components/conversation-info/info-direct/info-direct.component.html +7 -14
- package/src/app/components/conversation-info/info-direct/info-direct.component.scss +23 -0
- package/src/app/components/conversation-info/info-direct/info-direct.component.ts +1 -6
- package/src/app/components/conversation-info/info-group/info-group.component.html +44 -108
- package/src/app/components/conversation-info/info-group/info-group.component.scss +101 -61
- package/src/app/components/conversation-info/info-group/info-group.component.ts +1 -0
- package/src/app/components/conversation-info/info-support-group/info-support-group.component.html +2 -1
- package/src/app/components/conversation-info/info-support-group/info-support-group.component.ts +0 -1
- package/src/app/components/{ddp-header/ddp-header.component.html → conversations-list/header-conversations-list/header-conversations-list.component.html} +3 -3
- package/src/app/components/{ddp-header/ddp-header.component.scss → conversations-list/header-conversations-list/header-conversations-list.component.scss} +16 -4
- 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
- package/src/app/components/{ddp-header/ddp-header.component.ts → conversations-list/header-conversations-list/header-conversations-list.component.ts} +7 -16
- package/src/app/components/conversations-list/header-conversations-list-archived/header-conversations-list-archived.component.html +12 -0
- package/src/app/components/conversations-list/header-conversations-list-archived/header-conversations-list-archived.component.scss +14 -0
- 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
- 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
- package/src/app/components/navbar/navbar.component.html +103 -0
- package/src/app/components/navbar/navbar.component.scss +249 -0
- package/src/app/components/{ddp-header/ddp-header.component.spec.ts → navbar/navbar.component.spec.ts} +6 -6
- package/src/app/components/navbar/navbar.component.ts +195 -0
- package/src/app/components/project-item/project-item.component.html +98 -149
- package/src/app/components/project-item/project-item.component.scss +43 -35
- package/src/app/components/project-item/project-item.component.ts +16 -4
- package/src/app/components/sidebar-user-details/sidebar-user-details.component.html +5 -5
- package/src/app/components/sidebar-user-details/sidebar-user-details.component.ts +24 -13
- package/src/app/components/utils/user-presence/user-presence.component.html +7 -2
- package/src/app/components/utils/user-presence/user-presence.component.scss +35 -18
- package/src/app/components/utils/user-presence/user-presence.component.ts +6 -10
- package/src/app/{pages → modals}/create-canned-response/create-canned-response-routing.module.ts +0 -0
- package/src/app/{pages → modals}/create-canned-response/create-canned-response.module.ts +0 -0
- package/src/app/{pages → modals}/create-canned-response/create-canned-response.page.html +0 -0
- package/src/app/{pages → modals}/create-canned-response/create-canned-response.page.scss +0 -0
- package/src/app/{pages → modals}/create-canned-response/create-canned-response.page.spec.ts +0 -0
- package/src/app/{pages → modals}/create-canned-response/create-canned-response.page.ts +13 -13
- package/src/app/{pages → modals}/loader-preview/loader-preview-routing.module.ts +0 -0
- package/src/app/{pages → modals}/loader-preview/loader-preview.module.ts +0 -0
- package/src/app/{pages → modals}/loader-preview/loader-preview.page.html +1 -1
- package/src/app/{pages → modals}/loader-preview/loader-preview.page.scss +4 -0
- package/src/app/{pages → modals}/loader-preview/loader-preview.page.spec.ts +0 -0
- package/src/app/{pages → modals}/loader-preview/loader-preview.page.ts +1 -2
- package/src/app/modals/send-email/send-email-routing.module.ts +17 -0
- package/src/app/modals/send-email/send-email.module.ts +31 -0
- package/src/app/modals/send-email/send-email.page.html +46 -0
- package/src/app/modals/send-email/send-email.page.scss +161 -0
- package/src/app/modals/send-email/send-email.page.spec.ts +24 -0
- package/src/app/modals/send-email/send-email.page.ts +89 -0
- package/src/app/pages/contacts-directory/contacts-directory.page.html +1 -1
- package/src/app/pages/contacts-directory/contacts-directory.page.scss +47 -0
- package/src/app/pages/contacts-directory/contacts-directory.page.ts +2 -0
- package/src/app/pages/conversation-detail/conversation-detail.module.ts +0 -8
- package/src/app/pages/conversation-detail/conversation-detail.page.html +48 -27
- package/src/app/pages/conversation-detail/conversation-detail.page.scss +45 -254
- package/src/app/pages/conversation-detail/conversation-detail.page.ts +330 -138
- package/src/app/pages/conversations-list/conversations-list.page.html +11 -8
- package/src/app/pages/conversations-list/conversations-list.page.scss +18 -2
- package/src/app/pages/conversations-list/conversations-list.page.ts +26 -24
- package/src/app/pages/profile-info/profile-info.page.html +2 -4
- package/src/app/pages/unassigned-conversations/unassigned-conversations.page.html +1 -1
- package/src/app/pages/unassigned-conversations/unassigned-conversations.page.scss +42 -0
- package/src/app/pages/unassigned-conversations/unassigned-conversations.page.ts +1 -0
- package/src/app/services/canned-responses/canned-responses.service.ts +26 -0
- package/src/app/services/projects/projects.service.spec.ts +12 -0
- package/src/app/services/projects/projects.service.ts +43 -0
- package/src/app/services/tiledesk/tiledesk.service.ts +33 -17
- package/src/app/shared/shared.module.ts +24 -33
- package/src/app/utils/toast.spec.ts +7 -0
- package/src/app/utils/toast.ts +48 -0
- package/src/assets/i18n/ar.json +288 -265
- package/src/assets/i18n/az.json +24 -1
- package/src/assets/i18n/de.json +25 -2
- package/src/assets/i18n/en.json +25 -2
- package/src/assets/i18n/es.json +26 -3
- package/src/assets/i18n/fr.json +24 -1
- package/src/assets/i18n/it.json +24 -1
- package/src/assets/i18n/kk.json +25 -2
- package/src/assets/i18n/pt.json +25 -2
- package/src/assets/i18n/ru.json +24 -1
- package/src/assets/i18n/sr.json +287 -264
- package/src/assets/i18n/sv.json +25 -2
- package/src/assets/i18n/tr.json +25 -2
- package/src/assets/i18n/uk.json +25 -2
- package/src/assets/i18n/uz.json +24 -1
- package/src/assets/js/chat21client.js +1 -1
- package/src/assets/sounds/interface-start.mp3 +0 -0
- package/src/assets/sounds/wheep-wheep.mp3 +0 -0
- package/src/chat-config-mqtt-localhost.json +2 -2
- package/src/chat-config-native-mqtt.json +3 -0
- package/src/chat21-core/models/conversation.ts +0 -1
- package/src/chat21-core/models/projects.ts +27 -0
- package/src/chat21-core/providers/firebase/firebase-typing.service.ts +7 -9
- package/src/chat21-core/providers/logger/customLogger.ts +1 -1
- package/src/chat21-core/providers/mqtt/mqtt-auth-service.ts +7 -8
- package/src/chat21-core/utils/constants.ts +7 -1
- package/src/chat21-core/utils/convertRequestToConversation.ts +41 -0
- package/src/chat21-core/utils/user-typing/user-typing.component.html +8 -5
- package/src/chat21-core/utils/user-typing/user-typing.component.scss +87 -17
- package/src/chat21-core/utils/user-typing/user-typing.component.ts +12 -94
- package/src/chat21-core/utils/utils.ts +41 -11
- package/src/global.scss +59 -255
- package/src/index.html +0 -9
- package/src/variables.scss +30 -10
- package/src/app/components/conversation-detail/bubble-day-message/bubble-day-message.component.html +0 -3
- package/src/app/components/conversation-detail/bubble-day-message/bubble-day-message.component.scss +0 -21
- package/src/app/components/conversation-detail/bubble-day-message/bubble-day-message.component.spec.ts +0 -24
- package/src/app/components/conversation-detail/bubble-day-message/bubble-day-message.component.ts +0 -14
- package/src/app/components/conversation-detail/bubble-my-message/bubble-my-message.component.html +0 -54
- package/src/app/components/conversation-detail/bubble-my-message/bubble-my-message.component.scss +0 -98
- package/src/app/components/conversation-detail/bubble-my-message/bubble-my-message.component.ts +0 -84
- package/src/app/components/conversation-detail/bubble-others-message/bubble-others-message.component.html +0 -30
- package/src/app/components/conversation-detail/bubble-others-message/bubble-others-message.component.scss +0 -83
- package/src/app/components/conversation-detail/bubble-others-message/bubble-others-message.component.spec.ts +0 -24
- package/src/app/components/conversation-detail/bubble-others-message/bubble-others-message.component.ts +0 -68
- package/src/app/components/conversation-detail/bubble-system-message/bubble-system-message.component.html +0 -3
- package/src/app/components/conversation-detail/bubble-system-message/bubble-system-message.component.scss +0 -10
- package/src/app/components/conversation-detail/bubble-system-message/bubble-system-message.component.spec.ts +0 -24
- package/src/app/components/conversation-detail/bubble-system-message/bubble-system-message.component.ts +0 -14
- package/src/app/components/conversation-detail/option-header/option-header.component.html +0 -13
- package/src/app/components/conversation-detail/option-header/option-header.component.scss +0 -0
|
@@ -1,24 +1,41 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
color:
|
|
21
|
-
font-size:
|
|
22
|
-
|
|
23
|
-
|
|
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('
|
|
121
|
+
this.status = this.translationMap.get('LABEL_ONLINE');
|
|
126
122
|
} else {
|
|
127
|
-
this.status = this.translationMap.get('
|
|
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
|
}
|
package/src/app/{pages → modals}/create-canned-response/create-canned-response-routing.module.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -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.
|
|
185
|
-
.
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
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() {
|
|
File without changes
|
|
File without changes
|
|
@@ -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
|
|
58
|
+
<ion-fab-button (click)="onSendMessage()">
|
|
59
59
|
<ion-icon name="send"></ion-icon>
|
|
60
60
|
</ion-fab-button>
|
|
61
61
|
</ion-fab>
|
|
File without changes
|
|
@@ -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
|
+
}
|
|
@@ -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,
|