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