@chat21/chat21-ionic 3.0.61 → 3.0.63
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 +39 -0
- package/README.md +6 -2
- package/deploy_prod.sh +1 -1
- package/package.json +2 -1
- package/src/app/app.component.ts +103 -31
- package/src/app/chatlib/conversation-detail/conversation-content/conversation-content.component.html +2 -0
- package/src/app/chatlib/conversation-detail/conversation-content/conversation-content.component.ts +2 -1
- package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.html +33 -21
- package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.scss +34 -12
- package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.ts +2 -1
- package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.scss +1 -1
- package/src/app/chatlib/conversation-detail/message/image/image.component.ts +5 -3
- package/src/app/chatlib/conversation-detail/message/return-receipt/return-receipt.component.scss +1 -1
- package/src/app/components/conversation-detail/bubble-my-message/bubble-my-message.component.html +1 -1
- package/src/app/components/conversation-detail/bubble-my-message/bubble-my-message.component.scss +4 -4
- package/src/app/components/conversation-detail/bubble-others-message/bubble-others-message.component.html +1 -1
- package/src/app/components/conversation-detail/bubble-others-message/bubble-others-message.component.scss +3 -3
- package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.html +3 -3
- package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.ts +10 -55
- package/src/app/components/conversation-detail/message-text-area/message-text-area.component.html +8 -2
- package/src/app/components/conversation-detail/message-text-area/message-text-area.component.ts +2 -0
- package/src/app/components/image-viewer/image-viewer.component.ts +28 -10
- package/src/app/components/project-item/project-item.component.ts +6 -30
- package/src/app/components/sidebar/sidebar.component.html +2 -2
- package/src/app/components/sidebar/sidebar.component.ts +49 -83
- package/src/app/components/sidebar-user-details/sidebar-user-details.component.html +17 -1
- package/src/app/components/sidebar-user-details/sidebar-user-details.component.scss +62 -8
- package/src/app/components/sidebar-user-details/sidebar-user-details.component.ts +81 -111
- package/src/app/pages/authentication/login/login.page.ts +20 -1
- package/src/app/pages/conversation-detail/conversation-detail.page.html +40 -19
- package/src/app/pages/conversation-detail/conversation-detail.page.scss +15 -6
- package/src/app/pages/conversation-detail/conversation-detail.page.ts +179 -244
- package/src/app/services/nav-proxy.service.ts +15 -13
- package/src/assets/i18n/de.json +2 -1
- package/src/assets/i18n/en.json +2 -1
- package/src/assets/i18n/es.json +2 -1
- package/src/assets/i18n/fr.json +2 -1
- package/src/assets/i18n/it.json +2 -1
- package/src/assets/i18n/pt.json +2 -1
- package/src/assets/i18n/ru.json +2 -1
- package/src/assets/i18n/sr.json +2 -1
- package/src/assets/i18n/tr.json +2 -1
- package/src/assets/js/chat21client.js +1 -1
- package/src/chat-config-pre-test.json +3 -2
- package/src/chat-config-pre.json +15 -3
- package/src/chat21-core/providers/firebase/firebase-conversation-handler.ts +2 -3
- package/src/chat21-core/providers/logger/customLogger.ts +2 -10
- package/src/chat21-core/providers/tiledesk/tiledesk-auth.service.ts +1 -1
- package/src/chat21-core/utils/utils-message.ts +102 -85
- package/src/variables.scss +4 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,44 @@
|
|
|
1
1
|
# chat21-ionic ver 3.0
|
|
2
2
|
|
|
3
|
+
### 3.0.63
|
|
4
|
+
- Deploys in production
|
|
5
|
+
|
|
6
|
+
### 3.0.62.4-rc2
|
|
7
|
+
- Fixed bug: in the modal window showing the image preview before download, the image name is missing
|
|
8
|
+
- Add the ability to display the app sidebar in "wide mode"
|
|
9
|
+
- Displays balloon messages with a light orange background for "internal notes" type message
|
|
10
|
+
- Updates the regex that detects if the message contains only one or more emojis
|
|
11
|
+
|
|
12
|
+
### 3.0.62.4-rc1
|
|
13
|
+
- Fixes the bug: when the user profile is updated in the dashboard it is not updated in the chat
|
|
14
|
+
- Fixes the bug: when is sent a message with only emojis, some emojis have the chat balloon background
|
|
15
|
+
- Fixes the bug: in the conversation detail header the requester's avatar does not update after the same has filled in the pre-chat form requested by the bot
|
|
16
|
+
- Fixes the bug: images that are not in the database cannot be downloaded
|
|
17
|
+
- Adds default chat color to emojis picker tabs
|
|
18
|
+
- Fixes the bug: the selected conversation is undefined
|
|
19
|
+
- Fixes the bug: in the conversation list, the name of the requester changes according to the order of arrival of the conversations
|
|
20
|
+
|
|
21
|
+
### 3.0.62.3
|
|
22
|
+
- Fixes the bug: the method setTyping fired twice after that a message is sent
|
|
23
|
+
- Other minor improvements
|
|
24
|
+
|
|
25
|
+
### 3.0.62.2
|
|
26
|
+
- Fixed bug: if the teammate has the role of agent when switching from the dashboard to the chat and vice versa, the icons that only owners and admins have access to are displayed briefly in the left sidebar
|
|
27
|
+
- Adds the "Edit Profile" button and a link to the help center in the teammate details drawer
|
|
28
|
+
|
|
29
|
+
### 3.0.62.1
|
|
30
|
+
- Allows agents to use the "Monitor" page
|
|
31
|
+
|
|
32
|
+
### 3.0.62
|
|
33
|
+
- Deploys in production
|
|
34
|
+
|
|
35
|
+
### 3.0.62-rc2
|
|
36
|
+
- Fixed bug: in the teammate drawer if the full name is too long it overlaps the email
|
|
37
|
+
- Fixed bug: in the teammate drawer if the email is too long it exceeds the width of the drawer
|
|
38
|
+
|
|
39
|
+
### 3.0.62-rc1
|
|
40
|
+
- Change the URL of the environment variable "dashboardUrl" from absolute to relative
|
|
41
|
+
|
|
3
42
|
### 3.0.61
|
|
4
43
|
- Deploys in production
|
|
5
44
|
|
package/README.md
CHANGED
|
@@ -67,7 +67,7 @@ Use [Docker Compose Tiledesk installation guide](https://github.com/Tiledesk/til
|
|
|
67
67
|
fileUploadAccept:"*/*",
|
|
68
68
|
logLevel":"<YOUR-PREFERRED-LOG-LEVEL>",
|
|
69
69
|
supportMode: false,
|
|
70
|
-
|
|
70
|
+
writeToButton: false,
|
|
71
71
|
archivedButton: false,
|
|
72
72
|
firebaseConfig: {
|
|
73
73
|
tenant:"tilechat",
|
|
@@ -100,7 +100,11 @@ Use [Docker Compose Tiledesk installation guide](https://github.com/Tiledesk/til
|
|
|
100
100
|
|
|
101
101
|
* `wsUrl`: allows you to know in real time the agent's availability status, the agent's busy status and the number of unassigned conversations for a selected project
|
|
102
102
|
|
|
103
|
-
* `supportMode`: if set to true it
|
|
103
|
+
* `supportMode`: if it is set to true it shows the left sidebar which makes dashboard and chat management smarter
|
|
104
|
+
|
|
105
|
+
* `writeToButton`: if set to true, it makes the button for viewing the contact list visible and makes direct conversations with them possible
|
|
106
|
+
|
|
107
|
+
* `archivedButton`: if set to true, it makes the button for viewing archived conversations visible
|
|
104
108
|
|
|
105
109
|
### Push notification
|
|
106
110
|
* open `/src/firebase-messaging-sw.js` and replace messagingSenderId: with < your messagingSenderId >
|
package/deploy_prod.sh
CHANGED
|
@@ -32,7 +32,7 @@ cd ../../../
|
|
|
32
32
|
|
|
33
33
|
# echo new version deployed on s3://tiledesk-dashboard/chat/$NEW_BUILD/
|
|
34
34
|
echo new version deployed on s3://tiledesk-console/v2/chat/$version/
|
|
35
|
-
echo new version deployed on s3://tiledesk-console/v2/chat/
|
|
35
|
+
# echo new version deployed on s3://tiledesk-console/v2/chat/
|
|
36
36
|
echo available on https://console.tiledesk.com/v2/chat/$version/index.html
|
|
37
37
|
echo available on https://console.tiledesk.com/v2/chat/index.html
|
|
38
38
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chat21/chat21-ionic",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.63",
|
|
4
4
|
"author": "Tiledesk SRL",
|
|
5
5
|
"homepage": "https://tiledesk.com/",
|
|
6
6
|
"scripts": {
|
|
@@ -52,6 +52,7 @@
|
|
|
52
52
|
"cordova-plugin-whitelist": "^1.3.5",
|
|
53
53
|
"cordova-res": "^0.15.1",
|
|
54
54
|
"core-js": "^2.5.4",
|
|
55
|
+
"file-saver": "^2.0.5",
|
|
55
56
|
"firebase": "^8.6.7",
|
|
56
57
|
"marked": "^2.0.1",
|
|
57
58
|
"material-design-icons": "^3.0.1",
|
package/src/app/app.component.ts
CHANGED
|
@@ -269,7 +269,6 @@ export class AppComponent implements OnInit {
|
|
|
269
269
|
|
|
270
270
|
saveInStorageNumberOfOpenedChatTab() {
|
|
271
271
|
// this.logger.log('Calling saveInStorageChatOpenedTab!');
|
|
272
|
-
|
|
273
272
|
// https://jsfiddle.net/jjjs5wd3/3/å
|
|
274
273
|
if (+localStorage.tabCount > 0) {
|
|
275
274
|
this.logger.log('Chat IONIC Already open!');
|
|
@@ -299,7 +298,7 @@ export class AppComponent implements OnInit {
|
|
|
299
298
|
ngOnInit() {
|
|
300
299
|
const appconfig = this.appConfigProvider.getConfig();
|
|
301
300
|
this.logger.log('[APP-COMP] ngOnInit appconfig', appconfig)
|
|
302
|
-
if (appconfig && appconfig.supportMode &&
|
|
301
|
+
if (appconfig && appconfig.supportMode && (appconfig.supportMode === true || appconfig.supportMode === 'true')) {
|
|
303
302
|
this.SUPPORT_MODE = true;
|
|
304
303
|
this.logger.log('[APP-COMP] appconfig > SUPPORT_MODE', this.SUPPORT_MODE)
|
|
305
304
|
} else {
|
|
@@ -564,16 +563,16 @@ export class AppComponent implements OnInit {
|
|
|
564
563
|
} else if (browserLang && stored_preferred_lang) {
|
|
565
564
|
chat_lang = stored_preferred_lang
|
|
566
565
|
}
|
|
567
|
-
|
|
566
|
+
|
|
568
567
|
this.logger.log('[APP-COMP] - chat_lang', chat_lang)
|
|
569
|
-
|
|
568
|
+
|
|
570
569
|
if (tranlatedLanguage.includes(chat_lang)) {
|
|
571
|
-
this.logger.log('[APP-COMP] tranlatedLanguage includes',chat_lang
|
|
570
|
+
this.logger.log('[APP-COMP] tranlatedLanguage includes', chat_lang, ': ', tranlatedLanguage.includes(chat_lang))
|
|
572
571
|
this.translate.setDefaultLang(chat_lang)
|
|
573
572
|
this.translate.use(chat_lang);
|
|
574
573
|
}
|
|
575
574
|
else {
|
|
576
|
-
this.logger.log('[APP-COMP] tranlatedLanguage includes',chat_lang
|
|
575
|
+
this.logger.log('[APP-COMP] tranlatedLanguage includes', chat_lang, ': ', tranlatedLanguage.includes(chat_lang))
|
|
577
576
|
this.translate.setDefaultLang('en');
|
|
578
577
|
this.translate.use('en');
|
|
579
578
|
}
|
|
@@ -659,6 +658,87 @@ export class AppComponent implements OnInit {
|
|
|
659
658
|
}
|
|
660
659
|
|
|
661
660
|
|
|
661
|
+
updateStoredCurrentUser() {
|
|
662
|
+
const storedCurrentUser = this.appStorageService.getItem('currentUser')
|
|
663
|
+
const storedDshbrdUser = localStorage.getItem('user')
|
|
664
|
+
|
|
665
|
+
this.logger.log('[APP-COMP] updateStoredCurrentUser - stored currentUser', storedCurrentUser)
|
|
666
|
+
this.logger.log('[APP-COMP] updateStoredCurrentUser - stored dshbrdUser', storedDshbrdUser)
|
|
667
|
+
if ((storedCurrentUser && storedCurrentUser !== 'undefined') && (storedDshbrdUser && storedDshbrdUser !== 'undefined')) {
|
|
668
|
+
const currentUser = JSON.parse(storedCurrentUser);
|
|
669
|
+
const dshbrdUser = JSON.parse(storedDshbrdUser);
|
|
670
|
+
if (currentUser && dshbrdUser) {
|
|
671
|
+
if (currentUser.color !== dshbrdUser.fillColour) {
|
|
672
|
+
this.logger.log('[APP-COMP] updateStoredCurrentUser - currentUser.color !== dshbrdUser.fillColour')
|
|
673
|
+
this.logger.log('[APP-COMP] updateStoredCurrentUser - currentUser.color ', currentUser.color)
|
|
674
|
+
this.logger.log('[APP-COMP] updateStoredCurrentUser - dshbrdUser.fillColour ', dshbrdUser.fillColour)
|
|
675
|
+
currentUser.color = dshbrdUser.fillColour;
|
|
676
|
+
} else {
|
|
677
|
+
this.logger.log('[APP-COMP] updateStoredCurrentUser - currentUser.color === dshbrdUser.fillColour')
|
|
678
|
+
this.logger.log('[APP-COMP] updateStoredCurrentUser - currentUser.color ', currentUser.color)
|
|
679
|
+
this.logger.log('[APP-COMP] updateStoredCurrentUser - dshbrdUser.fillColour ', dshbrdUser.fillColour)
|
|
680
|
+
}
|
|
681
|
+
|
|
682
|
+
if (currentUser.firstname !== dshbrdUser.firstname) {
|
|
683
|
+
this.logger.log('[APP-COMP] updateStoredCurrentUser - currentUser.firstname !== dshbrdUser.firstname')
|
|
684
|
+
this.logger.log('[APP-COMP] updateStoredCurrentUser - currentUser.firstname ', currentUser.firstname)
|
|
685
|
+
this.logger.log('[APP-COMP] updateStoredCurrentUser - dshbrdUser.firstname ', dshbrdUser.firstname)
|
|
686
|
+
currentUser.firstname = dshbrdUser.firstname;
|
|
687
|
+
} else {
|
|
688
|
+
this.logger.log('[APP-COMP] updateStoredCurrentUser - currentUser.firstname === dshbrdUser.firstname')
|
|
689
|
+
this.logger.log('[APP-COMP] updateStoredCurrentUser - currentUser.firstname ', currentUser.firstname)
|
|
690
|
+
this.logger.log('[APP-COMP] updateStoredCurrentUser - dshbrdUser.firstname ', dshbrdUser.firstname)
|
|
691
|
+
}
|
|
692
|
+
|
|
693
|
+
if (currentUser.lastname !== dshbrdUser.lastname) {
|
|
694
|
+
this.logger.log('[APP-COMP] updateStoredCurrentUser - currentUser.lastname !== dshbrdUser.lastname')
|
|
695
|
+
this.logger.log('[APP-COMP] updateStoredCurrentUser - currentUser.lastname ', currentUser.lastname)
|
|
696
|
+
this.logger.log('[APP-COMP] updateStoredCurrentUser - dshbrdUser.lastname ', dshbrdUser.lastname)
|
|
697
|
+
currentUser.lastname = dshbrdUser.lastname;
|
|
698
|
+
} else {
|
|
699
|
+
this.logger.log('[APP-COMP] updateStoredCurrentUser - currentUser.lastname === dshbrdUser.lastname')
|
|
700
|
+
this.logger.log('[APP-COMP] updateStoredCurrentUser - currentUser.lastname ', currentUser.lastname)
|
|
701
|
+
this.logger.log('[APP-COMP] updateStoredCurrentUser - dshbrdUser.lastname ', dshbrdUser.lastname)
|
|
702
|
+
}
|
|
703
|
+
|
|
704
|
+
if (currentUser.avatar !== dshbrdUser.fullname_initial) {
|
|
705
|
+
this.logger.log('[APP-COMP] updateStoredCurrentUser - currentUser.avatar !== dshbrdUser.fullname_initial')
|
|
706
|
+
this.logger.log('[APP-COMP] updateStoredCurrentUser - currentUser.avatar ', currentUser.avatar)
|
|
707
|
+
this.logger.log('[APP-COMP] updateStoredCurrentUser - dshbrdUser.fullname_initial ', dshbrdUser.fullname_initial)
|
|
708
|
+
currentUser.avatar = dshbrdUser.fullname_initial
|
|
709
|
+
} else {
|
|
710
|
+
this.logger.log('[APP-COMP] updateStoredCurrentUser - currentUser.avatar === dshbrdUser.fullname_initial')
|
|
711
|
+
this.logger.log('[APP-COMP] updateStoredCurrentUser - currentUser.avatar ', currentUser.avatar)
|
|
712
|
+
this.logger.log('[APP-COMP] updateStoredCurrentUser - dshbrdUser.fullname_initial ', dshbrdUser.fullname_initial)
|
|
713
|
+
}
|
|
714
|
+
|
|
715
|
+
let fullname = ""
|
|
716
|
+
if (dshbrdUser.firstname && !dshbrdUser.lastname) {
|
|
717
|
+
fullname = dshbrdUser.firstname
|
|
718
|
+
} else if (dshbrdUser.firstname && dshbrdUser.lastname) {
|
|
719
|
+
fullname = dshbrdUser.firstname + ' ' + dshbrdUser.lastname
|
|
720
|
+
this.logger.log('[APP-COMP] updateStoredCurrentUser - fullname ', fullname)
|
|
721
|
+
}
|
|
722
|
+
|
|
723
|
+
if (fullname !== currentUser.fullname) {
|
|
724
|
+
this.logger.log('[APP-COMP] updateStoredCurrentUser - currentUser.fullname !== dshbrdUser.fullname ')
|
|
725
|
+
this.logger.log('[APP-COMP] updateStoredCurrentUser - currentUser.fullname ', fullname)
|
|
726
|
+
this.logger.log('[APP-COMP] updateStoredCurrentUser - dshbrdUser.fullname ', currentUser.fullname)
|
|
727
|
+
currentUser.fullname = fullname
|
|
728
|
+
} else {
|
|
729
|
+
this.logger.log('[APP-COMP] updateStoredCurrentUser - currentUser.fullname === dshbrdUser.fullname ')
|
|
730
|
+
this.logger.log('[APP-COMP] updateStoredCurrentUser - currentUser.fullname ', fullname)
|
|
731
|
+
this.logger.log('[APP-COMP] updateStoredCurrentUser - dshbrdUser.fullname ', currentUser.fullname)
|
|
732
|
+
}
|
|
733
|
+
|
|
734
|
+
this.appStorageService.setItem('currentUser', JSON.stringify(currentUser));
|
|
735
|
+
this.tiledeskAuthService.setCurrentUser(currentUser);
|
|
736
|
+
}
|
|
737
|
+
} else {
|
|
738
|
+
this.logger.error('[APP-COMP] updateStoredCurrentUser - currentuser or dashboarduser not found in storage')
|
|
739
|
+
}
|
|
740
|
+
}
|
|
741
|
+
|
|
662
742
|
/***************************************************+*/
|
|
663
743
|
/**------- AUTHENTICATION FUNCTIONS --> START <--- +*/
|
|
664
744
|
private initAuthentication() {
|
|
@@ -672,6 +752,9 @@ export class AppComponent implements OnInit {
|
|
|
672
752
|
this.logger.log('[APP-COMP] >>> initAuthentication I LOG IN WITH A TOKEN EXISTING IN THE LOCAL STORAGE OR WITH A TOKEN PASSED IN THE URL PARAMETERS <<<')
|
|
673
753
|
this.tiledeskAuthService.signInWithCustomToken(tiledeskToken).then(user => {
|
|
674
754
|
this.logger.log('[APP-COMP] >>> initAuthentication user ', user)
|
|
755
|
+
|
|
756
|
+
this.updateStoredCurrentUser()
|
|
757
|
+
|
|
675
758
|
this.messagingAuthService.createCustomToken(tiledeskToken)
|
|
676
759
|
}).catch(error => {
|
|
677
760
|
this.logger.error('[APP-COMP] initAuthentication SIGNINWITHCUSTOMTOKEN error::', error)
|
|
@@ -701,24 +784,7 @@ export class AppComponent implements OnInit {
|
|
|
701
784
|
/**------- AUTHENTICATION FUNCTIONS --> END <--- +*/
|
|
702
785
|
/***************************************************+*/
|
|
703
786
|
|
|
704
|
-
|
|
705
|
-
|
|
706
787
|
checkPlatform() {
|
|
707
|
-
// console.log('[APP-COMP] checkPlatform');
|
|
708
|
-
// let pageUrl = '';
|
|
709
|
-
// try {
|
|
710
|
-
// const pathPage = this.route.snapshot.firstChild.routeConfig.path;
|
|
711
|
-
// this.route.snapshot.firstChild.url.forEach(element => {
|
|
712
|
-
// pageUrl += '/' + element.path;
|
|
713
|
-
// });
|
|
714
|
-
// } catch (error) {
|
|
715
|
-
// this.logger.debug('error', error);
|
|
716
|
-
// }
|
|
717
|
-
// this.logger.debug('checkPlatform pathPage: ', pageUrl);
|
|
718
|
-
// if (!pageUrl || pageUrl === '') {
|
|
719
|
-
// pageUrl = '/conversations-list';
|
|
720
|
-
// }
|
|
721
|
-
|
|
722
788
|
if (checkPlatformIsMobile()) {
|
|
723
789
|
this.chatManager.startApp();
|
|
724
790
|
|
|
@@ -894,14 +960,20 @@ export class AppComponent implements OnInit {
|
|
|
894
960
|
this.conversationsHandlerService.conversationChanged.subscribe((conversation: ConversationModel) => {
|
|
895
961
|
|
|
896
962
|
// console.log('[APP-COMP] ***** subscribeConversationChanged conversation: ', conversation);
|
|
897
|
-
|
|
898
|
-
this.
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
this.logger.log('[APP-COMP] ***** subscribeConversationChanged
|
|
902
|
-
|
|
903
|
-
|
|
963
|
+
let currentUser = null
|
|
964
|
+
const storedCurrentUser = this.appStorageService.getItem('currentUser')
|
|
965
|
+
if (storedCurrentUser && storedCurrentUser !== 'undefined') {
|
|
966
|
+
currentUser = JSON.parse(storedCurrentUser);
|
|
967
|
+
this.logger.log('[APP-COMP] ***** subscribeConversationChanged currentUser: ', currentUser);
|
|
968
|
+
|
|
969
|
+
if (currentUser) {
|
|
970
|
+
this.logger.log('[APP-COMP] ***** subscribeConversationChanged current_user uid: ', currentUser.uid);
|
|
971
|
+
if (conversation && conversation.sender !== currentUser.uid) {
|
|
972
|
+
this.manageTabNotification();
|
|
973
|
+
}
|
|
904
974
|
}
|
|
975
|
+
} else {
|
|
976
|
+
this.logger.error('[APP-COMP] ***** subscribeConversationChanged currentUser nor found in storage ');
|
|
905
977
|
}
|
|
906
978
|
});
|
|
907
979
|
}
|
|
@@ -1007,7 +1079,7 @@ export class AppComponent implements OnInit {
|
|
|
1007
1079
|
let platformIsNow = PLATFORM_DESKTOP;
|
|
1008
1080
|
if (checkPlatformIsMobile()) {
|
|
1009
1081
|
platformIsNow = PLATFORM_MOBILE;
|
|
1010
|
-
this.logger.log('onResize platformIsNow ', platformIsNow)
|
|
1082
|
+
this.logger.log('onResize platformIsNow ', platformIsNow)
|
|
1011
1083
|
}
|
|
1012
1084
|
if (!this.platformIs || this.platformIs === '') {
|
|
1013
1085
|
this.platformIs = platformIsNow;
|
package/src/app/chatlib/conversation-detail/conversation-content/conversation-content.component.html
CHANGED
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
<!--backgroundColor non viene ancora usato -->
|
|
29
29
|
<tiledeskwidget-bubble-message class="messages msg_sent slide-in-right"
|
|
30
30
|
[ngClass]="{'button-in-msg' : message?.metadata && message?.metadata?.button}"
|
|
31
|
+
[class.chat-text-emoticon]="isEmojii(message?.text)"
|
|
31
32
|
[message]="message"
|
|
32
33
|
[textColor]="'col-msg-sent'"
|
|
33
34
|
(onBeforeMessageRender)="returnOnBeforeMessageRender($event)"
|
|
@@ -54,6 +55,7 @@
|
|
|
54
55
|
|
|
55
56
|
<!--backgroundColor non viene ancora usato -->
|
|
56
57
|
<tiledeskwidget-bubble-message class="messages msg_receive slide-in-left"
|
|
58
|
+
[class.chat-text-emoticon]="isEmojii(message?.text)"
|
|
57
59
|
[message]="message"
|
|
58
60
|
[textColor]="'black'"
|
|
59
61
|
(onBeforeMessageRender)="returnOnBeforeMessageRender($event)"
|
package/src/app/chatlib/conversation-detail/conversation-content/conversation-content.component.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { MSG_STATUS_SENT, MSG_STATUS_RETURN_RECEIPT, MSG_STATUS_SENT_SERVER, MAX
|
|
|
5
5
|
import { LoggerService } from 'src/chat21-core/providers/abstract/logger.service';
|
|
6
6
|
import { LoggerInstance } from 'src/chat21-core/providers/logger/loggerInstance';
|
|
7
7
|
import { UploadService } from 'src/chat21-core/providers/abstract/upload.service';
|
|
8
|
-
import { isInfo, isMine, messageType } from 'src/chat21-core/utils/utils-message';
|
|
8
|
+
import { isEmojii, isInfo, isMine, messageType } from 'src/chat21-core/utils/utils-message';
|
|
9
9
|
@Component({
|
|
10
10
|
selector: 'tiledeskwidget-conversation-content',
|
|
11
11
|
templateUrl: './conversation-content.component.html',
|
|
@@ -49,6 +49,7 @@ export class ConversationContentComponent implements OnInit {
|
|
|
49
49
|
isMine = isMine;
|
|
50
50
|
isInfo = isInfo;
|
|
51
51
|
messageType = messageType;
|
|
52
|
+
isEmojii = isEmojii;
|
|
52
53
|
|
|
53
54
|
MESSAGE_TYPE_INFO = MESSAGE_TYPE_INFO;
|
|
54
55
|
MESSAGE_TYPE_MINE = MESSAGE_TYPE_MINE;
|
|
@@ -68,9 +68,9 @@
|
|
|
68
68
|
</div>
|
|
69
69
|
</ng-container>
|
|
70
70
|
|
|
71
|
-
<div class="align-center
|
|
72
|
-
class="
|
|
73
|
-
|
|
71
|
+
<div class="align-center ion-text-center msg_info_container" *ngIf="messageType(MESSAGE_TYPE_INFO, message)">
|
|
72
|
+
<chat-info-message class="messages"
|
|
73
|
+
[message]="message">
|
|
74
74
|
</chat-info-message>
|
|
75
75
|
</div>
|
|
76
76
|
|
|
@@ -78,19 +78,25 @@
|
|
|
78
78
|
<div role="messaggio" *ngIf="messageType(MESSAGE_TYPE_MINE, message)" class="msg_container base_sent">
|
|
79
79
|
|
|
80
80
|
<!--backgroundColor non viene ancora usato -->
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
[
|
|
84
|
-
|
|
85
|
-
[message]="message"
|
|
86
|
-
|
|
87
|
-
[addAsCannedResponseTooltipText]="addAsCannedResponseTooltipText"
|
|
81
|
+
<chat-bubble-message class="messages msg_sent" id="message_msg_sent" style="position: relative;"
|
|
82
|
+
[ngClass]="{'has-metadata': (isImage(message) || isFrame(message)), 'privateMsg': (message?.attributes && message?.attributes?.subtype === 'private')}"
|
|
83
|
+
[class.emoticon]="isEmojii(message?.text)"
|
|
84
|
+
[ngClass]="{'button-in-msg' : message.metadata && message.metadata.button}"
|
|
85
|
+
[message]="message"
|
|
86
|
+
[textColor]="'col-msg-sent'"
|
|
87
|
+
[addAsCannedResponseTooltipText]="addAsCannedResponseTooltipText"
|
|
88
|
+
[areVisibleCAR]="areVisibleCAR"
|
|
88
89
|
[support_mode]="support_mode"
|
|
89
|
-
|
|
90
|
+
(onBeforeMessageRender)="returnOnBeforeMessageRender($event)"
|
|
91
|
+
(onAfterMessageRender)="returnOnAfterMessageRender($event)"
|
|
92
|
+
(onImageRendered)="onImageRenderedFN($event)">
|
|
90
93
|
</chat-bubble-message>
|
|
91
94
|
|
|
92
95
|
<!-- icon status message -->
|
|
93
|
-
<chat-return-receipt
|
|
96
|
+
<chat-return-receipt
|
|
97
|
+
[status]="message.status"
|
|
98
|
+
[message]="message"
|
|
99
|
+
[senderId]="senderId">
|
|
94
100
|
</chat-return-receipt>
|
|
95
101
|
|
|
96
102
|
</div>
|
|
@@ -112,21 +118,27 @@
|
|
|
112
118
|
|
|
113
119
|
<!--backgroundColor non viene ancora usato -->
|
|
114
120
|
|
|
115
|
-
<chat-bubble-message style="position: relative;"
|
|
116
|
-
[ngClass]="{'has-metadata': (isImage(message) || isFrame(message))}"
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
[addAsCannedResponseTooltipText]="addAsCannedResponseTooltipText"
|
|
121
|
+
<chat-bubble-message class="messages msg_receive" id="message_msg_receive" style="position: relative;"
|
|
122
|
+
[ngClass]="{'has-metadata': (isImage(message) || isFrame(message))}"
|
|
123
|
+
[class.emoticon]="isEmojii(message?.text)"
|
|
124
|
+
[message]="message"
|
|
125
|
+
[textColor]="'black'"
|
|
126
|
+
[addAsCannedResponseTooltipText]="addAsCannedResponseTooltipText"
|
|
127
|
+
[areVisibleCAR]="areVisibleCAR"
|
|
121
128
|
[support_mode]="support_mode"
|
|
122
|
-
|
|
129
|
+
(onBeforeMessageRender)="returnOnBeforeMessageRender($event)"
|
|
130
|
+
(onAfterMessageRender)="returnOnAfterMessageRender($event)"
|
|
131
|
+
(onImageRendered)="onImageRenderedFN($event)"
|
|
132
|
+
>
|
|
123
133
|
</chat-bubble-message>
|
|
124
134
|
</div>
|
|
125
135
|
|
|
126
136
|
<!-- message type:: button && -->
|
|
127
137
|
<div *ngIf="message?.attributes && message?.attributes?.attachment " class="slide-in-left">
|
|
128
|
-
<chat-message-attachment style="height: 100%; display: block;"
|
|
129
|
-
[
|
|
138
|
+
<chat-message-attachment style="height: 100%; display: block;"
|
|
139
|
+
[message]="message"
|
|
140
|
+
[isLastMessage]="isLastMessage(message?.uid)"
|
|
141
|
+
[stylesMap]="stylesMap"
|
|
130
142
|
(onAttachmentButtonClicked)="returnOnAttachmentButtonClicked($event)">
|
|
131
143
|
</chat-message-attachment>
|
|
132
144
|
</div>
|
|
@@ -59,9 +59,11 @@ ion-item {
|
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
.message_sender_fullname {
|
|
62
|
-
font-size: 0.
|
|
62
|
+
font-size: 0.9em;
|
|
63
63
|
margin: 0 0 1px 10px;
|
|
64
|
-
color: var(--gray);
|
|
64
|
+
// color: var(--gray);
|
|
65
|
+
font-weight: 500;
|
|
66
|
+
color: #080f1a;
|
|
65
67
|
}
|
|
66
68
|
|
|
67
69
|
.messages {
|
|
@@ -82,7 +84,7 @@ ion-item {
|
|
|
82
84
|
// padding: 2px 0px 4px 40px;
|
|
83
85
|
padding: 2px 0px 14px 40px; // edited to display the date at the bottom of the "message bubble"
|
|
84
86
|
.msg_sent {
|
|
85
|
-
background-color: var(--
|
|
87
|
+
background-color: var(--bubble-blue);
|
|
86
88
|
color: var(--col-msg-sent);
|
|
87
89
|
margin-right: 4px;
|
|
88
90
|
margin-left: 4px;
|
|
@@ -90,12 +92,19 @@ ion-item {
|
|
|
90
92
|
min-width: 14px;
|
|
91
93
|
border-top-right-radius: 8px;
|
|
92
94
|
border-bottom-right-radius: 0px;
|
|
95
|
+
|
|
96
|
+
&.privateMsg{
|
|
97
|
+
background-color: var(--bubble-privateMsg);
|
|
98
|
+
color: var(--bubble-privateMsgColor)
|
|
99
|
+
}
|
|
100
|
+
|
|
93
101
|
}
|
|
94
102
|
.emoticon {
|
|
95
103
|
background: unset !important;
|
|
96
104
|
font-size: 4em;
|
|
97
|
-
padding-bottom: 21px;
|
|
105
|
+
// padding-bottom: 21px;
|
|
98
106
|
padding-top: 30px;
|
|
107
|
+
text-align: right;
|
|
99
108
|
}
|
|
100
109
|
.has-metadata {
|
|
101
110
|
max-width: 100% !important;
|
|
@@ -297,13 +306,26 @@ ion-item {
|
|
|
297
306
|
// emoticon
|
|
298
307
|
// ---------------------------------------------------------
|
|
299
308
|
|
|
300
|
-
:host .base_sent .msg_sent ::ng-deep div > div > div > .chat-text-emoticon > p > p {
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
}
|
|
309
|
+
// :host .base_sent .msg_sent ::ng-deep div > div > div > .chat-text-emoticon > p > p {
|
|
310
|
+
// margin-bottom: 6px !important;
|
|
311
|
+
// margin-right: -7px !important;
|
|
312
|
+
// }
|
|
304
313
|
|
|
305
|
-
:host .base_receive .msg_receive ::ng-deep div > div > div > .chat-text-emoticon > p > p {
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
314
|
+
// :host .base_receive .msg_receive ::ng-deep div > div > div > .chat-text-emoticon > p > p {
|
|
315
|
+
// margin-bottom: 41px !important;
|
|
316
|
+
// margin-left: -8px !important;
|
|
317
|
+
// margin-top: 49px !important;
|
|
318
|
+
// }
|
|
319
|
+
|
|
320
|
+
|
|
321
|
+
// :host .base_sent .msg_sent .emoticon ::ng-deep div > div > div > chat-text > p > p {
|
|
322
|
+
// margin-bottom: 38px;
|
|
323
|
+
// }
|
|
324
|
+
|
|
325
|
+
:host .base_sent .emoticon ::ng-deep div > div > div > chat-text > p > p {
|
|
326
|
+
margin-bottom: 38px;
|
|
309
327
|
}
|
|
328
|
+
|
|
329
|
+
:host .base_receive .emoticon ::ng-deep div > div > div > chat-text > p > p {
|
|
330
|
+
margin-bottom: 38px;
|
|
331
|
+
}
|
|
@@ -3,7 +3,7 @@ import { ChangeDetectorRef, Component, Input, OnInit, Output, EventEmitter } fro
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
import { MESSAGE_TYPE_INFO, MESSAGE_TYPE_MINE, MESSAGE_TYPE_OTHERS } from 'src/chat21-core/utils/constants';
|
|
6
|
-
import { isChannelTypeGroup, isFirstMessage, isInfo, isMine, messageType } from 'src/chat21-core/utils/utils-message';
|
|
6
|
+
import { isChannelTypeGroup, isEmojii, isFirstMessage, isInfo, isMine, messageType } from 'src/chat21-core/utils/utils-message';
|
|
7
7
|
import { UploadService } from 'src/chat21-core/providers/abstract/upload.service';
|
|
8
8
|
import { isFile, isFrame, isImage } from 'src/chat21-core/utils/utils-message';
|
|
9
9
|
|
|
@@ -41,6 +41,7 @@ export class IonConversationDetailComponent extends ConversationContentComponent
|
|
|
41
41
|
isFirstMessage = isFirstMessage;
|
|
42
42
|
messageType = messageType;
|
|
43
43
|
isChannelTypeGroup = isChannelTypeGroup;
|
|
44
|
+
isEmojii = isEmojii;
|
|
44
45
|
|
|
45
46
|
MESSAGE_TYPE_INFO = MESSAGE_TYPE_INFO;
|
|
46
47
|
MESSAGE_TYPE_MINE = MESSAGE_TYPE_MINE;
|
|
@@ -66,11 +66,13 @@ export class ImageComponent implements OnInit {
|
|
|
66
66
|
var modalImg = <HTMLImageElement>document.getElementById("image-viewer-img");
|
|
67
67
|
var captionText = document.getElementById("caption");
|
|
68
68
|
modalImg.src = url
|
|
69
|
-
captionText
|
|
69
|
+
if (captionText) {
|
|
70
70
|
|
|
71
|
-
|
|
71
|
+
captionText.innerHTML = fileName ? fileName : decodeURIComponent(decodeURIComponent(url).split('/').pop());
|
|
72
|
+
// console.log('XXXX ', decodeURIComponent(decodeURIComponent(url).split('/').pop()))
|
|
73
|
+
}
|
|
72
74
|
|
|
73
|
-
|
|
75
|
+
}
|
|
74
76
|
|
|
75
77
|
|
|
76
78
|
}
|
package/src/app/components/conversation-detail/bubble-my-message/bubble-my-message.component.scss
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
.message {
|
|
2
|
-
.
|
|
2
|
+
.bubble-message {
|
|
3
3
|
position: relative;
|
|
4
4
|
border-radius: 15px;
|
|
5
5
|
font-size: 15px;
|
|
@@ -57,8 +57,8 @@
|
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
|
|
60
|
-
.
|
|
61
|
-
background-color: var(--
|
|
60
|
+
.bubble-message {
|
|
61
|
+
background-color: var(--bubble-blue);
|
|
62
62
|
color: white;
|
|
63
63
|
margin-right: 24px;
|
|
64
64
|
float: right;
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
}
|
|
68
68
|
&.first-message {
|
|
69
69
|
margin-top: 10px;
|
|
70
|
-
.
|
|
70
|
+
.bubble-message {
|
|
71
71
|
border-top-right-radius: 12px;
|
|
72
72
|
border-bottom-right-radius: 0px;
|
|
73
73
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
<span class="button-info" [ngClass]="message.uid" (click)="presentPopover($event, message)"></span>
|
|
4
4
|
|
|
5
|
-
<div class="
|
|
5
|
+
<div class="bubble-message"
|
|
6
6
|
[class.image]="message.type == 'image'"
|
|
7
7
|
[class.no-text]="!message.text"
|
|
8
8
|
(mouseover)="showButtonInfo()">
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
.message {
|
|
2
|
-
.
|
|
2
|
+
.bubble-message {
|
|
3
3
|
position: relative;
|
|
4
4
|
border-radius: 15px;
|
|
5
5
|
font-size: 15px;
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
.message-other {
|
|
51
51
|
width: 100%;
|
|
52
52
|
margin-top: 4px;
|
|
53
|
-
.
|
|
53
|
+
.bubble-message {
|
|
54
54
|
background-color: var(--light-gray);
|
|
55
55
|
color: var(--black);
|
|
56
56
|
margin-left: 24px;
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
}
|
|
73
73
|
&.first-message {
|
|
74
74
|
margin-top: 10px;
|
|
75
|
-
.
|
|
75
|
+
.bubble-message {
|
|
76
76
|
border-top-left-radius: 12px;
|
|
77
77
|
border-bottom-left-radius: 0px;
|
|
78
78
|
}
|
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
<!-- (click)="onOpenCloseInfoConversation()" -->
|
|
33
33
|
<div *ngIf="conversationAvatar" class="tile-info-with"
|
|
34
34
|
[ngClass]="{ 'tile-info-with-ios': platformName === 'ios' }">
|
|
35
|
-
|
|
36
|
-
<span class="tile-username">{{ conversation_with_fullname }} </span>
|
|
35
|
+
<span class="tile-username">{{ conversationAvatar.conversation_with_fullname }} </span>
|
|
36
|
+
<!-- <span class="tile-username">{{ conversation_with_fullname }} </span> -->
|
|
37
37
|
|
|
38
38
|
</div>
|
|
39
39
|
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
<span style="text-transform: capitalize; margin-left: 5px;"> {{ 'Crea ticket' | translate}} </span>
|
|
51
51
|
</ion-button> -->
|
|
52
52
|
|
|
53
|
-
<ion-button *ngIf="
|
|
53
|
+
<ion-button *ngIf="conversationUid?.startsWith('support-group') && conv_type !== 'archived'" ion-button fill="clear" color="primary" size="small"
|
|
54
54
|
(click)="closeConversation()" [ngClass]="{'resolve-conv-margin-right': !isMobile}" [disabled]="conv_closed === true">
|
|
55
55
|
<!-- <ion-icon slot="icon-only" name="alert-circle-outline"></ion-icon> -->
|
|
56
56
|
<ion-icon name="archive-outline"></ion-icon>
|