@chat21/chat21-ionic 3.0.62 → 3.0.64
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 +32 -0
- package/README.md +6 -2
- package/deploy_amazon_beta.sh +29 -0
- package/deploy_amazon_prod.sh +25 -0
- package/deploy_pre.sh +6 -78
- package/deploy_prod.sh +6 -57
- package/package.json +2 -1
- package/src/app/app.component.ts +104 -34
- 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/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.html +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 +52 -6
- 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-mqtt-ver-uploaded.json → chat-config-mqtt-localhost.json} +10 -6
- package/src/chat-config-mqtt.json +18 -28
- package/src/chat-config-native-mqtt.json +30 -0
- package/src/chat-config-pre.json +15 -7
- package/src/chat21-core/providers/firebase/firebase-conversation-handler.ts +2 -3
- package/src/chat21-core/providers/firebase/firebase-conversations-handler.ts +20 -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/src/chat-config-pre-test.json +0 -36
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,37 @@
|
|
|
1
1
|
# chat21-ionic ver 3.0
|
|
2
2
|
|
|
3
|
+
### 3.0.64
|
|
4
|
+
- Fixes the bug: in the conversation list, for the direct convesations, the name of the requester changes according to the order of arrival of the conversations
|
|
5
|
+
|
|
6
|
+
### 3.0.63
|
|
7
|
+
- Deploys in production
|
|
8
|
+
|
|
9
|
+
### 3.0.62.4-rc2
|
|
10
|
+
- Fixed bug: in the modal window showing the image preview before download, the image name is missing
|
|
11
|
+
- Add the ability to display the app sidebar in "wide mode"
|
|
12
|
+
- Displays balloon messages with a light orange background for "internal notes" type message
|
|
13
|
+
- Updates the regex that detects if the message contains only one or more emojis
|
|
14
|
+
|
|
15
|
+
### 3.0.62.4-rc1
|
|
16
|
+
- Fixes the bug: when the user profile is updated in the dashboard it is not updated in the chat
|
|
17
|
+
- Fixes the bug: when is sent a message with only emojis, some emojis have the chat balloon background
|
|
18
|
+
- 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
|
|
19
|
+
- Fixes the bug: images that are not in the database cannot be downloaded
|
|
20
|
+
- Adds default chat color to emojis picker tabs
|
|
21
|
+
- Fixes the bug: the selected conversation is undefined
|
|
22
|
+
- Fixes the bug: in the conversation list, the name of the requester changes according to the order of arrival of the conversations
|
|
23
|
+
|
|
24
|
+
### 3.0.62.3
|
|
25
|
+
- Fixes the bug: the method setTyping fired twice after that a message is sent
|
|
26
|
+
- Other minor improvements
|
|
27
|
+
|
|
28
|
+
### 3.0.62.2
|
|
29
|
+
- 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
|
|
30
|
+
- Adds the "Edit Profile" button and a link to the help center in the teammate details drawer
|
|
31
|
+
|
|
32
|
+
### 3.0.62.1
|
|
33
|
+
- Allows agents to use the "Monitor" page
|
|
34
|
+
|
|
3
35
|
### 3.0.62
|
|
4
36
|
- Deploys in production
|
|
5
37
|
|
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 >
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
#npm version prerelease --preid=beta
|
|
2
|
+
version=`node -e 'console.log(require("./package.json").version)'`
|
|
3
|
+
echo "version $version"
|
|
4
|
+
|
|
5
|
+
URL_VER=${version//[.]//}
|
|
6
|
+
echo 'URL_VER: ---->'$URL_VER
|
|
7
|
+
|
|
8
|
+
sed -i -e "s/$URL_VER/g" src/utils/constants.ts
|
|
9
|
+
|
|
10
|
+
# ng build --prod --base-href /$NEW_BUILD/
|
|
11
|
+
#ionic cordova build browser --prod
|
|
12
|
+
|
|
13
|
+
ionic cordova platform add browser --save
|
|
14
|
+
#ionic cordova build browser --prod --release
|
|
15
|
+
ionic cordova build --env=pre browser #--prod --verbose
|
|
16
|
+
|
|
17
|
+
cp -p src/firebase-messaging-sw.js platforms/browser/www/
|
|
18
|
+
cp -p src/manifest.json platforms/browser/www/
|
|
19
|
+
cp -p src/chat-config.json platforms/browser/www/
|
|
20
|
+
|
|
21
|
+
cd platforms/browser/www
|
|
22
|
+
aws s3 sync . s3://tiledesk-dashboard-pre/chat-ionic5/$version/
|
|
23
|
+
aws s3 sync . s3://tiledesk-dashboard-pre/chat-ionic5/
|
|
24
|
+
cd ../../../
|
|
25
|
+
|
|
26
|
+
#aws cloudfront create-invalidation --distribution-id E13L8CUUKUWAJF --paths "/*"
|
|
27
|
+
|
|
28
|
+
echo new version deployed on s3://tiledesk-dashboard-pre/chat-ionic5/$version/
|
|
29
|
+
echo available on https://s3.eu-west-1.amazonaws.com/tiledesk-dashboard-pre/chat-ionic5/$version/index.html
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# npm version patch
|
|
2
|
+
version=`node -e 'console.log(require("./package.json").version)'`
|
|
3
|
+
echo "version $version"
|
|
4
|
+
|
|
5
|
+
URL_VER=${version//[.]//}
|
|
6
|
+
echo 'URL_VER: ---->'$URL_VER
|
|
7
|
+
|
|
8
|
+
# sed -i -e "s/$start$ver.$build/$start$NEW_VER.$NEW_BUILD/g" src/utils/constants.ts
|
|
9
|
+
sed -i -e "s/$URL_VER/g" src/utils/constants.ts
|
|
10
|
+
ionic cordova platform add browser --save
|
|
11
|
+
#ionic cordova build --env=prod browser -- --base-href /www/ --prod
|
|
12
|
+
ionic cordova build --env=prod browser --prod
|
|
13
|
+
cp -p src/firebase-messaging-sw.js platforms/browser/www/
|
|
14
|
+
cp -p src/manifest.json platforms/browser/www/
|
|
15
|
+
cp -p src/chat-config.json platforms/browser/www/
|
|
16
|
+
|
|
17
|
+
cd platforms/browser/www
|
|
18
|
+
aws s3 sync . s3://tiledesk-console/v2/chat/
|
|
19
|
+
# aws s3 sync . s3://tiledesk-console/v2/chat/$version/
|
|
20
|
+
cd ../../../
|
|
21
|
+
# aws cloudfront create-invalidation --distribution-id E36UIP90GOSFPM --paths "/*"
|
|
22
|
+
|
|
23
|
+
# echo new version deployed on s3://tiledesk-dashboard/chat/$NEW_BUILD/
|
|
24
|
+
echo new version deployed on s3://tiledesk-console/v2/chat-ionic5/$version/
|
|
25
|
+
echo available on https://console.tiledesk.com/v2/chat-ionic5/$version/index.html
|
package/deploy_pre.sh
CHANGED
|
@@ -1,83 +1,11 @@
|
|
|
1
|
-
# environment=$(< src/utils/constants.ts)
|
|
2
|
-
# start="CURR_VER_PROD = '0."
|
|
3
|
-
# end="'"
|
|
4
|
-
# one=${environment#*$start}
|
|
5
|
-
# build=${one%%$end*} #two=${one%,*} -> %% prendo la prima istanza; % prendo la seconda
|
|
6
|
-
# NEW_BUILD=$(($build + 1))
|
|
7
|
-
# sed -i -e "s/$start$build/$start$NEW_BUILD/g" src/utils/constants.ts
|
|
8
|
-
|
|
9
1
|
#npm version prerelease --preid=beta
|
|
10
2
|
version=`node -e 'console.log(require("./package.json").version)'`
|
|
11
3
|
echo "version $version"
|
|
12
4
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
# git push --tags
|
|
20
|
-
# npm publish
|
|
21
|
-
# fi
|
|
22
|
-
|
|
23
|
-
sed -i -e "s/$URL_VER/g" src/utils/constants.ts
|
|
24
|
-
|
|
25
|
-
# ng build --prod --base-href /$NEW_BUILD/
|
|
26
|
-
#ionic cordova build browser --prod
|
|
27
|
-
|
|
28
|
-
ionic cordova platform add browser --save
|
|
29
|
-
#ionic cordova build browser --prod --release
|
|
30
|
-
# ionic cordova build --env=pre browser --prod #--verbose
|
|
31
|
-
ionic cordova build -c=pre browser --prod
|
|
32
|
-
cp -p src/firebase-messaging-sw.js platforms/browser/www/
|
|
33
|
-
cp -p src/manifest.json platforms/browser/www/
|
|
34
|
-
cp -p src/chat-config.json platforms/browser/www/
|
|
35
|
-
# cp -p config.xml platforms/browser/www/
|
|
36
|
-
|
|
37
|
-
######### chat-ionic5 - the good one - publish in pre
|
|
38
|
-
cd platforms/browser/www
|
|
39
|
-
aws s3 sync . s3://tiledesk-dashboard-pre/chat-ionic5/$version/
|
|
40
|
-
aws s3 sync . s3://tiledesk-dashboard-pre/chat-ionic5/
|
|
41
|
-
cd ../../../
|
|
42
|
-
|
|
43
|
-
aws cloudfront create-invalidation --distribution-id E2DTAKWHWQ7C3J --paths "/*"
|
|
44
|
-
|
|
45
|
-
echo new version deployed on s3://tiledesk-dashboard-pre/chat-ionic5/$version/
|
|
46
|
-
echo available on https://s3.eu-west-1.amazonaws.com/tiledesk-dashboard-pre/chat-ionic5/$version/index.html
|
|
47
|
-
echo available on https://support-pre.tiledesk.com/chat-ionic5/$version/index.html
|
|
48
|
-
echo available on https://support-pre.tiledesk.com/chat-ionic5/index.html
|
|
49
|
-
|
|
50
|
-
######### chat-ionic5-panel - publish in pre with the projects right panel
|
|
51
|
-
# cd platforms/browser/www
|
|
52
|
-
# aws s3 sync . s3://tiledesk-dashboard-pre/chat-ionic5-panel/$version/
|
|
53
|
-
# aws s3 sync . s3://tiledesk-dashboard-pre/chat-ionic5-panel/
|
|
54
|
-
# cd ../../../
|
|
55
|
-
|
|
56
|
-
# aws cloudfront create-invalidation --distribution-id E2DTAKWHWQ7C3J --paths "/*"
|
|
57
|
-
|
|
58
|
-
# echo new version deployed on s3://tiledesk-dashboard-pre/chat-ionic5-panel/$version/
|
|
59
|
-
# echo available on https://s3.eu-west-1.amazonaws.com/tiledesk-dashboard-pre/chat-ionic5-panel/$version/index.html
|
|
60
|
-
# echo available on https://support-pre.tiledesk.com/chat-ionic5-panel/$version/index.html
|
|
61
|
-
# echo available on https://support-pre.tiledesk.com/chat-ionic5-panel/index.html
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
####### chat ionic MQTT in pre da aggiungere in deploy_pre.sh
|
|
65
|
-
# cd platforms/browser/www
|
|
66
|
-
# aws s3 sync . s3://tiledesk-dashboard-pre/native-mqtt/chat-ionic5/
|
|
67
|
-
# aws s3 sync . s3://tiledesk-dashboard-pre/native-mqtt/chat-ionic5/$version
|
|
68
|
-
# cd ../../../
|
|
69
|
-
# echo new version deployed on s3://tiledesk-dashboard-pre/native-mqtt/chat-ionic5/
|
|
70
|
-
# echo new version deployed on s3://tiledesk-dashboard-pre/native-mqtt/chat-ionic5/$version
|
|
71
|
-
# echo http://tiledesk-dashboard-pre.s3-eu-west-1.amazonaws.com/native-mqtt/chat-ionic5/index.html
|
|
72
|
-
# echo http://tiledesk-dashboard-pre.s3-eu-west-1.amazonaws.com/native-mqtt/chat-ionic5/$version/index.html
|
|
73
|
-
|
|
5
|
+
if [ "$version" != "" ]; then
|
|
6
|
+
git tag -a "v$version" -m "`git log -1 --format=%s`"
|
|
7
|
+
echo "Created a new tag, v$version"
|
|
8
|
+
git push --tags
|
|
9
|
+
npm publish
|
|
10
|
+
fi
|
|
74
11
|
|
|
75
|
-
####### chat ionic FIREBASE in pre da aggiungere in deploy_pre.sh
|
|
76
|
-
# cd platforms/browser/www
|
|
77
|
-
# aws s3 sync . s3://tiledesk-dashboard-pre/chat5/
|
|
78
|
-
# aws s3 sync . s3://tiledesk-dashboard-pre/chat5/$version
|
|
79
|
-
# cd ../../../
|
|
80
|
-
# echo new version deployed on s3://tiledesk-dashboard-pre/chat5/$version
|
|
81
|
-
# echo new version deployed on s3://tiledesk-dashboard-pre/chat5/
|
|
82
|
-
# echo available on http://support-pre.tiledesk.com/chat5/index.html
|
|
83
|
-
# echo available on http://support-pre.tiledesk.com/chat5/$version/index.html
|
package/deploy_prod.sh
CHANGED
|
@@ -2,61 +2,10 @@
|
|
|
2
2
|
version=`node -e 'console.log(require("./package.json").version)'`
|
|
3
3
|
echo "version $version"
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
if [ "$version" != "" ]; then
|
|
6
|
+
git tag -a "$version" -m "`git log -1 --format=%s`"
|
|
7
|
+
echo "Created a new tag, $version"
|
|
8
|
+
git push --tags
|
|
9
|
+
npm publish
|
|
10
|
+
fi
|
|
7
11
|
|
|
8
|
-
# if [ "$version" != "" ]; then
|
|
9
|
-
# git tag -a "$version" -m "`git log -1 --format=%s`"
|
|
10
|
-
# echo "Created a new tag, $version"
|
|
11
|
-
# git push --tags
|
|
12
|
-
# npm publish
|
|
13
|
-
# fi
|
|
14
|
-
|
|
15
|
-
sed -i -e "s/$URL_VER/g" src/utils/constants.ts
|
|
16
|
-
|
|
17
|
-
ionic cordova platform add browser --save
|
|
18
|
-
#ionic cordova build --env=prod browser -- --base-href /www/ --prod
|
|
19
|
-
ionic cordova build --env=prod browser --prod
|
|
20
|
-
cp -p src/firebase-messaging-sw.js platforms/browser/www/
|
|
21
|
-
cp -p src/manifest.json platforms/browser/www/
|
|
22
|
-
cp -p src/chat-config.json platforms/browser/www/
|
|
23
|
-
cp -p config.xml platforms/browser/www/
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
###### CHAT in prod
|
|
27
|
-
cd platforms/browser/www
|
|
28
|
-
aws s3 sync . s3://tiledesk-console/v2/chat/
|
|
29
|
-
aws s3 sync . s3://tiledesk-console/v2/chat/$version/
|
|
30
|
-
cd ../../../
|
|
31
|
-
# aws cloudfront create-invalidation --distribution-id E2DTAKWHWQ7C3J --paths "/*"
|
|
32
|
-
|
|
33
|
-
# echo new version deployed on s3://tiledesk-dashboard/chat/$NEW_BUILD/
|
|
34
|
-
echo new version deployed on s3://tiledesk-console/v2/chat/$version/
|
|
35
|
-
echo new version deployed on s3://tiledesk-console/v2/chat/
|
|
36
|
-
echo available on https://console.tiledesk.com/v2/chat/$version/index.html
|
|
37
|
-
echo available on https://console.tiledesk.com/v2/chat/index.html
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
###### CHAT-IONIC5
|
|
41
|
-
# cd platforms/browser/www
|
|
42
|
-
# #aws s3 sync . s3://tiledesk-dashboard/chat/
|
|
43
|
-
# aws s3 sync . s3://tiledesk-console/v2/chat-ionic5/
|
|
44
|
-
# aws s3 sync . s3://tiledesk-console/v2/chat-ionic5/$version/
|
|
45
|
-
# cd ../../../
|
|
46
|
-
# # aws cloudfront create-invalidation --distribution-id E2DTAKWHWQ7C3J --paths "/*"
|
|
47
|
-
|
|
48
|
-
# # echo new version deployed on s3://tiledesk-dashboard/chat/$NEW_BUILD/
|
|
49
|
-
# echo new version deployed on s3://tiledesk-console/v2/chat-ionic5/$version/
|
|
50
|
-
# echo available on https://console.tiledesk.com/v2/chat-ionic5/$version/index.html
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
####### chat ionic FIREBASE in PROD IN SUBFOLDER
|
|
55
|
-
# cd platforms/browser/www
|
|
56
|
-
# aws s3 sync . s3://tiledesk-console/v2/chat5-dev/
|
|
57
|
-
# aws s3 sync . s3://tiledesk-console/v2/chat5-dev/$version
|
|
58
|
-
# cd ../../../
|
|
59
|
-
# echo new version deployed on s3://console.tiledesk.com/v2/chat5-dev/$version
|
|
60
|
-
# echo new version deployed on s3://console.tiledesk.com/v2/chat5-dev/
|
|
61
|
-
# echo available on http://console.tiledesk.com/v2/chat5-dev/index.html
|
|
62
|
-
# echo available on http://console.tiledesk.com/v2/chat5-dev/$version/index.html
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chat21/chat21-ionic",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.64",
|
|
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
|
|
|
@@ -852,10 +918,8 @@ export class AppComponent implements OnInit {
|
|
|
852
918
|
}
|
|
853
919
|
|
|
854
920
|
this.BSAuthStateChangedSubscriptionRef = this.messagingAuthService.BSAuthStateChanged
|
|
855
|
-
|
|
856
921
|
// .pipe(takeUntil(this.unsubscribe$))
|
|
857
|
-
.pipe(filter((state) => state !== null))
|
|
858
|
-
.subscribe((state: any) => {
|
|
922
|
+
.pipe(filter((state) => state !== null)).subscribe((state: any) => {
|
|
859
923
|
this.logger.log('initialize FROM [APP-COMP] - [APP-COMP] ***** BSAuthStateChanged state', state);
|
|
860
924
|
|
|
861
925
|
if (state && state === AUTH_STATE_ONLINE) {
|
|
@@ -894,14 +958,20 @@ export class AppComponent implements OnInit {
|
|
|
894
958
|
this.conversationsHandlerService.conversationChanged.subscribe((conversation: ConversationModel) => {
|
|
895
959
|
|
|
896
960
|
// console.log('[APP-COMP] ***** subscribeConversationChanged conversation: ', conversation);
|
|
897
|
-
|
|
898
|
-
this.
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
this.logger.log('[APP-COMP] ***** subscribeConversationChanged
|
|
902
|
-
|
|
903
|
-
|
|
961
|
+
let currentUser = null
|
|
962
|
+
const storedCurrentUser = this.appStorageService.getItem('currentUser')
|
|
963
|
+
if (storedCurrentUser && storedCurrentUser !== 'undefined') {
|
|
964
|
+
currentUser = JSON.parse(storedCurrentUser);
|
|
965
|
+
this.logger.log('[APP-COMP] ***** subscribeConversationChanged currentUser: ', currentUser);
|
|
966
|
+
|
|
967
|
+
if (currentUser) {
|
|
968
|
+
this.logger.log('[APP-COMP] ***** subscribeConversationChanged current_user uid: ', currentUser.uid);
|
|
969
|
+
if (conversation && conversation.sender !== currentUser.uid) {
|
|
970
|
+
this.manageTabNotification();
|
|
971
|
+
}
|
|
904
972
|
}
|
|
973
|
+
} else {
|
|
974
|
+
this.logger.error('[APP-COMP] ***** subscribeConversationChanged currentUser nor found in storage ');
|
|
905
975
|
}
|
|
906
976
|
});
|
|
907
977
|
}
|
|
@@ -1007,7 +1077,7 @@ export class AppComponent implements OnInit {
|
|
|
1007
1077
|
let platformIsNow = PLATFORM_DESKTOP;
|
|
1008
1078
|
if (checkPlatformIsMobile()) {
|
|
1009
1079
|
platformIsNow = PLATFORM_MOBILE;
|
|
1010
|
-
this.logger.log('onResize platformIsNow ', platformIsNow)
|
|
1080
|
+
this.logger.log('onResize platformIsNow ', platformIsNow)
|
|
1011
1081
|
}
|
|
1012
1082
|
if (!this.platformIs || this.platformIs === '') {
|
|
1013
1083
|
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>
|