@chat21/chat21-ionic 3.0.97-rc.1 → 3.0.97-rc.3
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 +19 -0
- package/Dockerfile +1 -1
- package/GoogleService-Info.plist +36 -0
- package/config.xml +6 -3
- package/google-services.json +40 -0
- package/package.json +8 -13
- package/resources/ios/icon/icon-1024.png +0 -0
- package/resources/ios/icon/icon-108@2x.png +0 -0
- package/resources/ios/icon/icon-20.png +0 -0
- package/resources/ios/icon/icon-20@2x.png +0 -0
- package/resources/ios/icon/icon-20@3x.png +0 -0
- package/resources/ios/icon/icon-24@2x.png +0 -0
- package/resources/ios/icon/icon-27.5@2x.png +0 -0
- package/resources/ios/icon/icon-29.png +0 -0
- package/resources/ios/icon/icon-29@2x.png +0 -0
- package/resources/ios/icon/icon-29@3x.png +0 -0
- package/resources/ios/icon/icon-40.png +0 -0
- package/resources/ios/icon/icon-40@2x.png +0 -0
- package/resources/ios/icon/icon-40@3x.png +0 -0
- package/resources/ios/icon/icon-44@2x.png +0 -0
- package/resources/ios/icon/icon-50.png +0 -0
- package/resources/ios/icon/icon-50@2x.png +0 -0
- package/resources/ios/icon/icon-60.png +0 -0
- package/resources/ios/icon/icon-60@2x.png +0 -0
- package/resources/ios/icon/icon-60@3x.png +0 -0
- package/resources/ios/icon/icon-72.png +0 -0
- package/resources/ios/icon/icon-72@2x.png +0 -0
- package/resources/ios/icon/icon-76.png +0 -0
- package/resources/ios/icon/icon-76@2x.png +0 -0
- package/resources/ios/icon/icon-83.5@2x.png +0 -0
- package/resources/ios/icon/icon-86@2x.png +0 -0
- package/resources/ios/icon/icon-98@2x.png +0 -0
- package/resources/ios/icon/icon.png +0 -0
- package/resources/ios/icon/icon@2x.png +0 -0
- package/resources/ios/icon.jpg +0 -0
- package/resources/ios/splash/Default-1792h~iphone.png +0 -0
- package/resources/ios/splash/Default-2436h.png +0 -0
- package/resources/ios/splash/Default-2688h~iphone.png +0 -0
- package/resources/ios/splash/Default-568h@2x~iphone.png +0 -0
- package/resources/ios/splash/Default-667h.png +0 -0
- package/resources/ios/splash/Default-736h.png +0 -0
- package/resources/ios/splash/Default-Landscape-1792h~iphone.png +0 -0
- package/resources/ios/splash/Default-Landscape-2436h.png +0 -0
- package/resources/ios/splash/Default-Landscape-2688h~iphone.png +0 -0
- package/resources/ios/splash/Default-Landscape-736h.png +0 -0
- package/resources/ios/splash/Default-Landscape@2x~ipad.png +0 -0
- package/resources/ios/splash/Default-Landscape@~ipadpro.png +0 -0
- package/resources/ios/splash/Default-Landscape~ipad.png +0 -0
- package/resources/ios/splash/Default-Portrait@2x~ipad.png +0 -0
- package/resources/ios/splash/Default-Portrait@~ipadpro.png +0 -0
- package/resources/ios/splash/Default-Portrait~ipad.png +0 -0
- package/resources/ios/splash/Default@2x~iphone.png +0 -0
- package/resources/ios/splash/Default@2x~universal~anyany.png +0 -0
- package/resources/ios/splash/Default~iphone.png +0 -0
- package/src/app/app-routing.module.ts +6 -5
- package/src/app/app.component.html +0 -1
- package/src/app/app.component.ts +58 -26
- package/src/app/app.module.ts +3 -7
- package/src/app/chatlib/conversation-detail/conversation-content/conversation-content.component.spec.ts +0 -4
- package/src/app/chatlib/conversation-detail/conversation-content/conversation-content.component.ts +0 -38
- package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.html +10 -11
- package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.ts +1 -37
- package/src/app/chatlib/conversation-detail/message/image/image.component.html +0 -4
- package/src/app/chatlib/conversation-detail/message/image/image.component.ts +0 -21
- package/src/app/chatlib/conversation-detail/message/info-message/info-message.component.html +3 -3
- package/src/app/chatlib/conversation-detail/message/info-message/info-message.component.ts +0 -10
- package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.html +14 -12
- package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.scss +4 -0
- package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.ts +13 -13
- package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.html +14 -9
- package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.scss +4 -0
- package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.ts +20 -14
- package/src/app/components/conversation-detail/message-text-area/message-text-area.component.html +11 -13
- package/src/app/components/conversation-detail/message-text-area/message-text-area.component.scss +12 -9
- package/src/app/components/conversation-detail/message-text-area/message-text-area.component.ts +3 -24
- package/src/app/components/conversation-info/advanced-info-accordion/advanced-info-accordion.component.html +0 -13
- package/src/app/components/conversation-info/advanced-info-accordion/advanced-info-accordion.component.ts +0 -9
- package/src/app/components/conversation-info/conversation-info.module.ts +0 -2
- package/src/app/components/conversation-info/info-content/info-content.component.ts +0 -1
- package/src/app/components/conversation-info/info-group/info-group.component.ts +0 -11
- package/src/app/components/conversations-list/header-conversations-list/header-conversations-list.component.html +4 -10
- package/src/app/components/conversations-list/header-conversations-list/header-conversations-list.component.ts +1 -9
- package/src/app/components/project-item/project-item.component.html +2 -4
- package/src/app/components/project-item/project-item.component.ts +1 -19
- package/src/app/components/sidebar-user-details/sidebar-user-details.component.html +1 -1
- package/src/app/directives/tooltip.directive.spec.ts +20 -0
- package/src/app/directives/tooltip.directive.ts +134 -0
- package/src/app/pages/authentication/login/login.page.ts +1 -1
- package/src/app/pages/conversation-detail/conversation-detail.module.ts +0 -4
- package/src/app/pages/conversation-detail/conversation-detail.page.html +3 -3
- package/src/app/pages/conversation-detail/conversation-detail.page.ts +63 -33
- package/src/app/pages/conversations-list/conversations-list.page.scss +0 -1
- package/src/app/pages/conversations-list/conversations-list.page.ts +101 -19
- package/src/app/pages/profile-info/profile-info.module.ts +4 -2
- package/src/app/pages/profile-info/profile-info.page.html +76 -16
- package/src/app/pages/profile-info/profile-info.page.scss +71 -0
- package/src/app/pages/profile-info/profile-info.page.ts +89 -18
- package/src/app/shared/shared.module.ts +4 -4
- package/src/assets/chat21-logo.png +0 -0
- package/src/assets/images/channel_icons/chat21.svg +3 -0
- package/src/assets/images/channel_icons/direct.svg +3 -0
- package/src/assets/images/channel_icons/email-logo.svg +9 -0
- package/src/assets/images/channel_icons/form-logo_v2.svg +13 -0
- package/src/assets/images/channel_icons/group.svg +3 -0
- package/src/assets/images/channel_icons/messenger-logo.svg +8 -0
- package/src/assets/images/channel_icons/telegram-logo.svg +7 -0
- package/src/assets/images/channel_icons/whatsapp-logo.svg +12 -0
- package/src/assets/logo.png +0 -0
- package/src/assets/tiledesk-solo-logo.png +0 -0
- package/src/chat21-core/providers/firebase/firebase-auth-service.ts +1 -16
- package/src/chat21-core/providers/mqtt/mqtt-conversation-handler.ts +1 -0
- package/src/chat21-core/providers/mqtt/mqtt-notifications.ts +2 -2
- package/src/chat21-core/utils/constants.ts +7 -0
- package/src/chat21-core/utils/utils.ts +22 -12
- package/src/global.scss +134 -22
- package/src/index.html +1 -2
- package/resources/ios/icon.png +0 -0
- package/src/app/pages/details/details-routing.module.ts +0 -17
- package/src/app/pages/details/details.module.ts +0 -21
- package/src/app/pages/details/details.page.html +0 -28
- package/src/app/pages/details/details.page.scss +0 -23
- package/src/app/pages/details/details.page.spec.ts +0 -24
- package/src/app/pages/details/details.page.ts +0 -65
- package/src/assets/chat21-logo.svg +0 -78
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# chat21-ionic ver 3.0
|
|
2
2
|
|
|
3
|
+
### 3.0.97-rc.3
|
|
4
|
+
- added: channel property to message/conversation and changed attributes.channel to attributes.offline_channel for offline message email
|
|
5
|
+
- added: channel info in conversation-header-detail component
|
|
6
|
+
- updated: tiledesk logo
|
|
7
|
+
- bug-fixed: sort last-messages for mqtt before publish to component
|
|
8
|
+
|
|
9
|
+
### 3.0.97-rc.2
|
|
10
|
+
- added: do not send automatic offline email if conversation is of type 'email' or 'form'
|
|
11
|
+
- added: new tooltip directive
|
|
12
|
+
- added: availability project user status on ProfileInfo page modal
|
|
13
|
+
- added: isOniOSMobileDevice and isOnMobileDevice in utils
|
|
14
|
+
- added: manage css for mobile/desktop modals
|
|
15
|
+
- added: custom tooltip directive
|
|
16
|
+
- changed: lib dependencies
|
|
17
|
+
- bug-fixed: new_message event sounds every time conv.is_new is true or false
|
|
18
|
+
- updated: ios icons
|
|
19
|
+
- removed: ticketing for mobile
|
|
20
|
+
- removed angular2-moment and ng2-tooltip-directive
|
|
21
|
+
|
|
3
22
|
### 3.0.97-rc.1
|
|
4
23
|
- added: if user is offline and message is sent, forward the entire conversation by email
|
|
5
24
|
|
package/Dockerfile
CHANGED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
3
|
+
<plist version="1.0">
|
|
4
|
+
<dict>
|
|
5
|
+
<key>CLIENT_ID</key>
|
|
6
|
+
<string>522823349790-q8m9iherm28n7vl8uo9klqhkt85ohj8g.apps.googleusercontent.com</string>
|
|
7
|
+
<key>REVERSED_CLIENT_ID</key>
|
|
8
|
+
<string>com.googleusercontent.apps.522823349790-q8m9iherm28n7vl8uo9klqhkt85ohj8g</string>
|
|
9
|
+
<key>API_KEY</key>
|
|
10
|
+
<string>AIzaSyAdGeIFqMHnfTSFsThRoEbaAYKjRaYZbnI</string>
|
|
11
|
+
<key>GCM_SENDER_ID</key>
|
|
12
|
+
<string>522823349790</string>
|
|
13
|
+
<key>PLIST_VERSION</key>
|
|
14
|
+
<string>1</string>
|
|
15
|
+
<key>BUNDLE_ID</key>
|
|
16
|
+
<string>it.chat.ionic</string>
|
|
17
|
+
<key>PROJECT_ID</key>
|
|
18
|
+
<string>tiledesk-v3-prod-cf4ff</string>
|
|
19
|
+
<key>STORAGE_BUCKET</key>
|
|
20
|
+
<string>tiledesk-v3-prod-cf4ff.appspot.com</string>
|
|
21
|
+
<key>IS_ADS_ENABLED</key>
|
|
22
|
+
<false></false>
|
|
23
|
+
<key>IS_ANALYTICS_ENABLED</key>
|
|
24
|
+
<false></false>
|
|
25
|
+
<key>IS_APPINVITE_ENABLED</key>
|
|
26
|
+
<true></true>
|
|
27
|
+
<key>IS_GCM_ENABLED</key>
|
|
28
|
+
<true></true>
|
|
29
|
+
<key>IS_SIGNIN_ENABLED</key>
|
|
30
|
+
<true></true>
|
|
31
|
+
<key>GOOGLE_APP_ID</key>
|
|
32
|
+
<string>1:522823349790:ios:7ea6d121437c2a441fa00f</string>
|
|
33
|
+
<key>DATABASE_URL</key>
|
|
34
|
+
<string>https://tiledesk-v3-prod-cf4ff-default-rtdb.europe-west1.firebasedatabase.app</string>
|
|
35
|
+
</dict>
|
|
36
|
+
</plist>
|
package/config.xml
CHANGED
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
<allow-intent href="geo:*" />
|
|
15
15
|
<preference name="ScrollEnabled" value="false" />
|
|
16
16
|
<preference name="android-minSdkVersion" value="22" />
|
|
17
|
+
<preference name="android-targetSdkVersion" value="31" />
|
|
17
18
|
<preference name="BackupWebStorage" value="none" />
|
|
18
19
|
<preference name="SplashMaintainAspectRatio" value="true" />
|
|
19
20
|
<preference name="FadeSplashScreenDuration" value="300" />
|
|
@@ -24,6 +25,9 @@
|
|
|
24
25
|
<edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application" xmlns:android="http://schemas.android.com/apk/res/android">
|
|
25
26
|
<application android:networkSecurityConfig="@xml/network_security_config" />
|
|
26
27
|
</edit-config>
|
|
28
|
+
<edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application/activity" xmlns:android="http://schemas.android.com/apk/res/android">
|
|
29
|
+
<activity android:exported="true" />
|
|
30
|
+
</edit-config>
|
|
27
31
|
<resource-file src="resources/android/xml/network_security_config.xml" target="app/src/main/res/xml/network_security_config.xml" />
|
|
28
32
|
<allow-intent href="market:*" />
|
|
29
33
|
<icon density="ldpi" src="resources/android/icon/drawable-ldpi-icon.png" />
|
|
@@ -48,11 +52,10 @@
|
|
|
48
52
|
<platform name="ios">
|
|
49
53
|
<allow-intent href="itms:*" />
|
|
50
54
|
<allow-intent href="itms-apps:*" />
|
|
55
|
+
<preference name="UseSwiftLanguageVersion" value="5" />
|
|
56
|
+
<preference name="scheme" value="app" />
|
|
51
57
|
<icon height="57" src="resources/ios/icon/icon.png" width="57" />
|
|
52
58
|
<icon height="114" src="resources/ios/icon/icon@2x.png" width="114" />
|
|
53
|
-
<icon height="29" src="resources/ios/icon/icon-small.png" width="29" />
|
|
54
|
-
<icon height="58" src="resources/ios/icon/icon-small@2x.png" width="58" />
|
|
55
|
-
<icon height="87" src="resources/ios/icon/icon-small@3x.png" width="87" />
|
|
56
59
|
<icon height="20" src="resources/ios/icon/icon-20.png" width="20" />
|
|
57
60
|
<icon height="40" src="resources/ios/icon/icon-20@2x.png" width="40" />
|
|
58
61
|
<icon height="60" src="resources/ios/icon/icon-20@3x.png" width="60" />
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"project_info": {
|
|
3
|
+
"project_number": "522823349790",
|
|
4
|
+
"firebase_url": "https://tiledesk-v3-prod-cf4ff-default-rtdb.europe-west1.firebasedatabase.app",
|
|
5
|
+
"project_id": "tiledesk-v3-prod-cf4ff",
|
|
6
|
+
"storage_bucket": "tiledesk-v3-prod-cf4ff.appspot.com"
|
|
7
|
+
},
|
|
8
|
+
"client": [
|
|
9
|
+
{
|
|
10
|
+
"client_info": {
|
|
11
|
+
"mobilesdk_app_id": "1:522823349790:android:54cf45313fbe20101fa00f",
|
|
12
|
+
"android_client_info": {
|
|
13
|
+
"package_name": "chat.ionic"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"oauth_client": [
|
|
17
|
+
{
|
|
18
|
+
"client_id": "522823349790-gsagrbpf0ktecjbm3ec53d4jnunpi4k3.apps.googleusercontent.com",
|
|
19
|
+
"client_type": 3
|
|
20
|
+
}
|
|
21
|
+
],
|
|
22
|
+
"api_key": [
|
|
23
|
+
{
|
|
24
|
+
"current_key": "AIzaSyBI2rc6vHd5VLzptv6ftBya54F-7VNfw6E"
|
|
25
|
+
}
|
|
26
|
+
],
|
|
27
|
+
"services": {
|
|
28
|
+
"appinvite_service": {
|
|
29
|
+
"other_platform_oauth_client": [
|
|
30
|
+
{
|
|
31
|
+
"client_id": "522823349790-gsagrbpf0ktecjbm3ec53d4jnunpi4k3.apps.googleusercontent.com",
|
|
32
|
+
"client_type": 3
|
|
33
|
+
}
|
|
34
|
+
]
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
],
|
|
39
|
+
"configuration_version": "1"
|
|
40
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chat21/chat21-ionic",
|
|
3
3
|
"author": "Tiledesk SRL",
|
|
4
|
-
"version": "3.0.97-rc.
|
|
4
|
+
"version": "3.0.97-rc.3",
|
|
5
5
|
"license": "MIT License",
|
|
6
6
|
"homepage": "https://tiledesk.com/",
|
|
7
7
|
"repository": {
|
|
@@ -23,7 +23,6 @@
|
|
|
23
23
|
"@angular/common": "~8.2.14",
|
|
24
24
|
"@angular/core": "~8.2.14",
|
|
25
25
|
"@angular/forms": "~8.2.14",
|
|
26
|
-
"@angular/http": "^7.2.16",
|
|
27
26
|
"@angular/material": "^8.2.3",
|
|
28
27
|
"@angular/platform-browser": "~8.2.14",
|
|
29
28
|
"@angular/platform-browser-dynamic": "~8.2.14",
|
|
@@ -43,7 +42,6 @@
|
|
|
43
42
|
"@ngx-translate/core": "^12.1.2",
|
|
44
43
|
"@ngx-translate/http-loader": "^4.0.0",
|
|
45
44
|
"@types/marked": "^1.1.0",
|
|
46
|
-
"angular2-moment": "^1.9.0",
|
|
47
45
|
"autolinker": "^3.14.2",
|
|
48
46
|
"cordova-android": "9.1.0",
|
|
49
47
|
"cordova-android-support-gradle-release": "^3.0.1",
|
|
@@ -62,16 +60,13 @@
|
|
|
62
60
|
"firebase": "^8.6.7",
|
|
63
61
|
"marked": "^2.1.3",
|
|
64
62
|
"material-icons": "^1.11.2",
|
|
65
|
-
"moment": "^2.
|
|
63
|
+
"moment": "^2.29.4",
|
|
66
64
|
"moment-timezone": "^0.5.28",
|
|
67
|
-
"ng-connection-service": "^1.0.4",
|
|
68
|
-
"ng2-tooltip-directive": "^2.9.22",
|
|
69
|
-
"ngx-linkifyjs": "^1.3.0",
|
|
70
65
|
"ngx-logger": "^4.2.1",
|
|
71
|
-
"ngx-
|
|
72
|
-
"perfect-scrollbar": "^1.5.0",
|
|
66
|
+
"ngx-moment": "^5.0.0",
|
|
73
67
|
"roboto-fontface": "^0.10.0",
|
|
74
68
|
"rxjs": "~6.5.1",
|
|
69
|
+
"sharp": "^0.32.0",
|
|
75
70
|
"tslib": "^1.9.0",
|
|
76
71
|
"zone.js": "~0.9.1"
|
|
77
72
|
},
|
|
@@ -86,13 +81,13 @@
|
|
|
86
81
|
"@types/jasminewd2": "~2.0.3",
|
|
87
82
|
"codelyzer": "^5.0.0",
|
|
88
83
|
"cordova-plugin-add-swift-support": "^2.0.2",
|
|
89
|
-
"jasmine-core": "~
|
|
84
|
+
"jasmine-core": "~4.4.0",
|
|
90
85
|
"jasmine-spec-reporter": "~4.2.1",
|
|
91
|
-
"karma": "~4.1
|
|
86
|
+
"karma": "~6.4.1",
|
|
92
87
|
"karma-chrome-launcher": "~2.2.0",
|
|
93
88
|
"karma-coverage-istanbul-reporter": "~2.0.1",
|
|
94
|
-
"karma-jasmine": "~
|
|
95
|
-
"karma-jasmine-html-reporter": "^
|
|
89
|
+
"karma-jasmine": "~5.1.0",
|
|
90
|
+
"karma-jasmine-html-reporter": "^2.0.0",
|
|
96
91
|
"protractor": "~5.4.0",
|
|
97
92
|
"ts-node": "~7.0.0",
|
|
98
93
|
"tslint": "~5.15.0",
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -64,11 +64,12 @@ const routes: Routes = [
|
|
|
64
64
|
{
|
|
65
65
|
path: 'send-email',
|
|
66
66
|
loadChildren: () => import('./modals/send-email/send-email.module').then( m => m.SendEmailModalModule)
|
|
67
|
-
},
|
|
68
67
|
{
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
path: 'json-message',
|
|
71
|
+
loadChildren: () => import('./modals/json-message/json-message.module').then( m => m.JsonMessagePageModule)
|
|
72
|
+
}
|
|
73
|
+
|
|
73
74
|
|
|
74
75
|
|
|
75
76
|
|
|
@@ -25,7 +25,6 @@
|
|
|
25
25
|
<!-- our side menu -->
|
|
26
26
|
<!-- <ion-router-outlet id="sidebar" name='sidebar' animated="false" #masterNav> -->
|
|
27
27
|
<!-- <app-conversations-list></app-conversations-list> -->
|
|
28
|
-
<!-- <app-details></app-details> -->
|
|
29
28
|
<!-- </ion-router-outlet> -->
|
|
30
29
|
<!-- the main content -->
|
|
31
30
|
<!-- -->
|
package/src/app/app.component.ts
CHANGED
|
@@ -39,7 +39,7 @@ import { LoginPage } from './pages/authentication/login/login.page';
|
|
|
39
39
|
import { ConversationListPage } from './pages/conversations-list/conversations-list.page';
|
|
40
40
|
|
|
41
41
|
// utils
|
|
42
|
-
import { checkPlatformIsMobile, isGroup, getParameterByName, searchIndexInArrayForUid, compareValues, stripTags } from 'src/chat21-core/utils/utils';
|
|
42
|
+
import { checkPlatformIsMobile, isGroup, getParameterByName, searchIndexInArrayForUid, compareValues, stripTags, isOnMobileDevice } from 'src/chat21-core/utils/utils';
|
|
43
43
|
import { STORAGE_PREFIX, PLATFORM_MOBILE, PLATFORM_DESKTOP, CHAT_ENGINE_FIREBASE, AUTH_STATE_OFFLINE, AUTH_STATE_ONLINE } from 'src/chat21-core/utils/constants';
|
|
44
44
|
import { environment } from '../environments/environment';
|
|
45
45
|
import { UserModel } from '../chat21-core/models/user';
|
|
@@ -61,6 +61,7 @@ import { filter } from 'rxjs/operators'
|
|
|
61
61
|
import { WebSocketJs } from './services/websocket/websocket-js';
|
|
62
62
|
import { Location } from '@angular/common'
|
|
63
63
|
import { ScriptService } from './services/scripts/script.service';
|
|
64
|
+
// import { FCM } from 'cordova-plugin-fcm-with-dependecy-updated/ionic/ngx';
|
|
64
65
|
|
|
65
66
|
// import { filter } from 'rxjs/operators';
|
|
66
67
|
|
|
@@ -112,7 +113,7 @@ export class AppComponent implements OnInit {
|
|
|
112
113
|
private version: string;
|
|
113
114
|
public lang: string;
|
|
114
115
|
IS_ONLINE: boolean;
|
|
115
|
-
IS_ON_MOBILE_DEVICE: boolean
|
|
116
|
+
IS_ON_MOBILE_DEVICE: boolean = true
|
|
116
117
|
SUPPORT_MODE: boolean;
|
|
117
118
|
// private isOnline: boolean = false;
|
|
118
119
|
|
|
@@ -155,25 +156,18 @@ export class AppComponent implements OnInit {
|
|
|
155
156
|
private networkService: NetworkService,
|
|
156
157
|
public webSocketJs: WebSocketJs,
|
|
157
158
|
public scriptService: ScriptService,
|
|
158
|
-
public location: Location
|
|
159
|
+
public location: Location,
|
|
160
|
+
// private fcm: FCM
|
|
159
161
|
) {
|
|
160
162
|
|
|
161
163
|
|
|
162
164
|
this.saveInStorageNumberOfOpenedChatTab();
|
|
163
165
|
this.listenChatAlreadyOpenWithoutParamsInMobileMode()
|
|
164
|
-
this.isOnMobileDevice()
|
|
166
|
+
this.IS_ON_MOBILE_DEVICE = isOnMobileDevice()
|
|
165
167
|
// this.listenToUrlChanges();
|
|
166
168
|
// this.getPageState();
|
|
167
169
|
}
|
|
168
170
|
|
|
169
|
-
isOnMobileDevice() {
|
|
170
|
-
this.IS_ON_MOBILE_DEVICE = false;
|
|
171
|
-
if (/Android|iPhone/i.test(window.navigator.userAgent)) {
|
|
172
|
-
this.IS_ON_MOBILE_DEVICE = true;
|
|
173
|
-
}
|
|
174
|
-
this.logger.log('[APP-COMP] IS_ON_MOBILE_DEVICE', this.IS_ON_MOBILE_DEVICE)
|
|
175
|
-
return this.IS_ON_MOBILE_DEVICE;
|
|
176
|
-
}
|
|
177
171
|
|
|
178
172
|
|
|
179
173
|
|
|
@@ -512,6 +506,20 @@ export class AppComponent implements OnInit {
|
|
|
512
506
|
// Watch to network status
|
|
513
507
|
// ---------------------------------------
|
|
514
508
|
this.watchToConnectionStatus();
|
|
509
|
+
|
|
510
|
+
|
|
511
|
+
// this.fcm.onNotification().subscribe(data => {
|
|
512
|
+
// if (data.wasTapped) {
|
|
513
|
+
// console.log("Received in background");
|
|
514
|
+
// } else {
|
|
515
|
+
// console.log("Received in foreground");
|
|
516
|
+
// };
|
|
517
|
+
// });
|
|
518
|
+
|
|
519
|
+
// this.fcm.onTokenRefresh().subscribe(token => {
|
|
520
|
+
// // Register your new token in your back-end if you want
|
|
521
|
+
// // backend.registerToken(token);
|
|
522
|
+
// });
|
|
515
523
|
});
|
|
516
524
|
}
|
|
517
525
|
|
|
@@ -755,14 +763,23 @@ export class AppComponent implements OnInit {
|
|
|
755
763
|
} else {
|
|
756
764
|
this.logger.warn('[APP-COMP] >>> I AM NOT LOGGED IN <<<')
|
|
757
765
|
this.IS_ONLINE = false;
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
this.
|
|
765
|
-
|
|
766
|
+
|
|
767
|
+
if (!this.hadBeenCalledOpenModal) {
|
|
768
|
+
this.authModal = this.presentModal('initAuthentication');
|
|
769
|
+
this.hadBeenCalledOpenModal = true;
|
|
770
|
+
}
|
|
771
|
+
|
|
772
|
+
if(this.IS_ON_MOBILE_DEVICE){
|
|
773
|
+
clearTimeout(this.timeModalLogin);
|
|
774
|
+
this.timeModalLogin = setTimeout(() => {
|
|
775
|
+
if (!this.hadBeenCalledOpenModal) {
|
|
776
|
+
this.authModal = this.presentModal('initAuthentication');
|
|
777
|
+
this.hadBeenCalledOpenModal = true;
|
|
778
|
+
}
|
|
779
|
+
}, 1000)
|
|
780
|
+
}else{
|
|
781
|
+
this.goToDashboardLogin()
|
|
782
|
+
}
|
|
766
783
|
}
|
|
767
784
|
}
|
|
768
785
|
|
|
@@ -785,11 +802,14 @@ export class AppComponent implements OnInit {
|
|
|
785
802
|
this.logger.log('[APP-COMP] checkPlatformIsMobile', checkPlatformIsMobile());
|
|
786
803
|
this.platformIs = PLATFORM_MOBILE;
|
|
787
804
|
this.logger.log('[APP-COMP] this.platformIs', this.platformIs);
|
|
788
|
-
|
|
805
|
+
let IDConv= null
|
|
806
|
+
if(this.route && this.route.snapshot && this.route.snapshot.firstChild){
|
|
807
|
+
IDConv = this.route.snapshot.firstChild.paramMap.get('IDConv');
|
|
808
|
+
}
|
|
789
809
|
|
|
790
|
-
// console.log('[APP-COMP] platformIs', this.platformIs);
|
|
791
810
|
// console.log('[APP-COMP] PLATFORM', PLATFORM_MOBILE, 'route.snapshot', this.route.snapshot);
|
|
792
811
|
if (!IDConv) {
|
|
812
|
+
this.logger.log('[APP-COMP] navigateByUrl -- conversations-list');
|
|
793
813
|
this.router.navigateByUrl('conversations-list')
|
|
794
814
|
}
|
|
795
815
|
// this.router.navigateByUrl(pageUrl);
|
|
@@ -896,7 +916,7 @@ export class AppComponent implements OnInit {
|
|
|
896
916
|
if(sound_status && sound_status !== 'undefined'){
|
|
897
917
|
this.isSoundEnabled = sound_status === 'enabled'? true: false
|
|
898
918
|
}
|
|
899
|
-
this.logger.debug('[APP-COMP] manageTabNotification can saund?', this.isInitialized, this.isSoundEnabled)
|
|
919
|
+
this.logger.debug('[APP-COMP] manageTabNotification can saund?', this.isInitialized, this.isSoundEnabled, sound_type)
|
|
900
920
|
if(this.isInitialized && this.isSoundEnabled) {
|
|
901
921
|
switch(sound_type){
|
|
902
922
|
case 'conv_added': {
|
|
@@ -1040,9 +1060,11 @@ export class AppComponent implements OnInit {
|
|
|
1040
1060
|
// console.log('[APP-COMP] ***** subscribeConversationChangedDetailed conversation: ', changes);
|
|
1041
1061
|
const currentUser = this.tiledeskAuthService.getCurrentUser()
|
|
1042
1062
|
if (currentUser && currentUser !== null) {
|
|
1043
|
-
this.logger.log('[APP-COMP] ***** subscribeConversationChangedDetailed currentUser: ', currentUser);
|
|
1063
|
+
this.logger.log('[APP-COMP] ***** subscribeConversationChangedDetailed currentUser: ', currentUser, changes);
|
|
1044
1064
|
if (changes.value && changes.value.sender !== currentUser.uid) {
|
|
1045
|
-
|
|
1065
|
+
let checkIfStatusChanged = changes.value.is_new === changes.previousValue.is_new? true: false
|
|
1066
|
+
let checkIfUidChanged = changes.value.uid === changes.previousValue.uid? true: false
|
|
1067
|
+
if(changes.value.is_new && checkIfStatusChanged && checkIfUidChanged){
|
|
1046
1068
|
this.manageTabNotification('new_message');
|
|
1047
1069
|
}
|
|
1048
1070
|
}
|
|
@@ -1128,7 +1150,17 @@ export class AppComponent implements OnInit {
|
|
|
1128
1150
|
this.chatManager.goOffLine();
|
|
1129
1151
|
|
|
1130
1152
|
this.router.navigateByUrl('conversation-detail/'); //redirect to basePage
|
|
1131
|
-
this.
|
|
1153
|
+
if(this.IS_ON_MOBILE_DEVICE){
|
|
1154
|
+
clearTimeout(this.timeModalLogin);
|
|
1155
|
+
this.timeModalLogin = setTimeout(() => {
|
|
1156
|
+
if (!this.hadBeenCalledOpenModal) {
|
|
1157
|
+
this.authModal = this.presentModal('initAuthentication');
|
|
1158
|
+
this.hadBeenCalledOpenModal = true;
|
|
1159
|
+
}
|
|
1160
|
+
}, 1000)
|
|
1161
|
+
}else{
|
|
1162
|
+
this.goToDashboardLogin()
|
|
1163
|
+
}
|
|
1132
1164
|
|
|
1133
1165
|
|
|
1134
1166
|
// if (!this.hadBeenCalledOpenModal) {
|
package/src/app/app.module.ts
CHANGED
|
@@ -14,7 +14,6 @@ import { TranslateLoader, TranslateModule, TranslatePipe } from '@ngx-translate/
|
|
|
14
14
|
import { TranslateHttpLoader } from '@ngx-translate/http-loader';
|
|
15
15
|
import { HttpClient, HttpClientModule } from '@angular/common/http';
|
|
16
16
|
import { Keyboard } from '@ionic-native/keyboard/ngx';
|
|
17
|
-
import { NgxLinkifyjsModule } from 'ngx-linkifyjs';
|
|
18
17
|
import { Chooser } from '@ionic-native/chooser/ngx';
|
|
19
18
|
import { LoggerModule, NGXLogger, NgxLoggerLevel } from "ngx-logger";
|
|
20
19
|
|
|
@@ -103,19 +102,17 @@ import { ConversationInfoModule } from 'src/app/components/conversation-info/con
|
|
|
103
102
|
|
|
104
103
|
import { LoggerInstance } from 'src/chat21-core/providers/logger/loggerInstance';
|
|
105
104
|
import { Network } from '@ionic-native/network/ngx';
|
|
106
|
-
import { ConnectionService } from 'ng-connection-service';
|
|
107
105
|
import { WebSocketJs } from './services/websocket/websocket-js';
|
|
108
106
|
import { UnassignedConversationsPageModule } from './pages/unassigned-conversations/unassigned-conversations.module';
|
|
109
107
|
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
|
110
108
|
|
|
111
|
-
|
|
112
109
|
// FACTORIES
|
|
113
110
|
export function createTranslateLoader(http: HttpClient) {
|
|
114
111
|
return new TranslateHttpLoader(http, './assets/i18n/', '.json');
|
|
115
112
|
|
|
116
113
|
}
|
|
117
114
|
|
|
118
|
-
export function authenticationFactory(http: HttpClient, appConfig: AppConfigProvider, chat21Service: Chat21Service, appSorage: AppStorageService
|
|
115
|
+
export function authenticationFactory(http: HttpClient, appConfig: AppConfigProvider, chat21Service: Chat21Service, appSorage: AppStorageService) {
|
|
119
116
|
const config = appConfig.getConfig()
|
|
120
117
|
if (config.chatEngine === CHAT_ENGINE_MQTT) {
|
|
121
118
|
|
|
@@ -136,7 +133,7 @@ export function authenticationFactory(http: HttpClient, appConfig: AppConfigProv
|
|
|
136
133
|
|
|
137
134
|
FirebaseInitService.initFirebase(config.firebaseConfig)
|
|
138
135
|
// console.log('[APP-MOD] FirebaseInitService config ', config)
|
|
139
|
-
const auth = new FirebaseAuthService(http
|
|
136
|
+
const auth = new FirebaseAuthService(http);
|
|
140
137
|
auth.setBaseUrl(config.apiUrl)
|
|
141
138
|
|
|
142
139
|
return auth
|
|
@@ -292,7 +289,6 @@ const appInitializerFn = (appConfig: AppConfigProvider, logger: NGXLogger) => {
|
|
|
292
289
|
ScrollbarThemeModule,
|
|
293
290
|
SharedModule,
|
|
294
291
|
ConversationInfoModule,
|
|
295
|
-
NgxLinkifyjsModule.forRoot(),
|
|
296
292
|
LoaderPreviewPageModule,
|
|
297
293
|
SendEmailModalModule,
|
|
298
294
|
CreateTicketPageModule,
|
|
@@ -313,7 +309,7 @@ const appInitializerFn = (appConfig: AppConfigProvider, logger: NGXLogger) => {
|
|
|
313
309
|
{
|
|
314
310
|
provide: MessagingAuthService,
|
|
315
311
|
useFactory: authenticationFactory,
|
|
316
|
-
deps: [HttpClient, AppConfigProvider, Chat21Service, AppStorageService
|
|
312
|
+
deps: [HttpClient, AppConfigProvider, Chat21Service, AppStorageService]
|
|
317
313
|
},
|
|
318
314
|
{
|
|
319
315
|
provide: PresenceService,
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
|
2
2
|
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
|
3
3
|
import { By } from '@angular/platform-browser';
|
|
4
|
-
import { MomentModule } from 'angular2-moment';
|
|
5
|
-
import { TooltipModule } from 'ng2-tooltip-directive';
|
|
6
4
|
import { NGXLogger } from 'ngx-logger';
|
|
7
5
|
import { HtmlEntitiesEncodePipe } from 'src/app/directives/html-entities-encode.pipe';
|
|
8
6
|
import { MarkedPipe } from 'src/app/directives/marked.pipe';
|
|
@@ -40,8 +38,6 @@ describe('ConversationContentComponent', () => {
|
|
|
40
38
|
HtmlEntitiesEncodePipe,
|
|
41
39
|
],
|
|
42
40
|
imports: [
|
|
43
|
-
MomentModule,
|
|
44
|
-
TooltipModule
|
|
45
41
|
],
|
|
46
42
|
providers: [
|
|
47
43
|
UploadService,
|