@chat21/chat21-ionic 3.2.3 → 3.3.0-rc.1
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 +6 -0
- package/package.json +1 -1
- package/src/app/app.component.ts +8 -1
- package/src/app/components/sidebar/sidebar.component.ts +1 -1
- package/src/app/components/sidebar-user-details/sidebar-user-details.component.html +2 -2
- package/src/app/components/sidebar-user-details/sidebar-user-details.component.ts +0 -4
- package/src/app/pages/authentication/login/login.page.html +3 -3
- package/src/app/pages/authentication/login/login.page.ts +3 -6
- package/src/app/services/triggerEvents/triggerEvents.ts +14 -0
- package/src/app/utils/utils-resources.ts +4 -3
- package/src/chat21-core/providers/tiledesk/tiledesk-auth.service.ts +5 -0
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
package/src/app/app.component.ts
CHANGED
|
@@ -293,6 +293,8 @@ export class AppComponent implements OnInit {
|
|
|
293
293
|
this.SUPPORT_MODE = this.g.supportMode
|
|
294
294
|
}
|
|
295
295
|
|
|
296
|
+
this.triggerOnBeforeInit('onBeforeInit')
|
|
297
|
+
|
|
296
298
|
});
|
|
297
299
|
this.globalSettingsService.initParamiters(this.g, this.el);
|
|
298
300
|
|
|
@@ -1669,10 +1671,15 @@ export class AppComponent implements OnInit {
|
|
|
1669
1671
|
|
|
1670
1672
|
|
|
1671
1673
|
private triggerOnAuthStateChanged(event){
|
|
1672
|
-
const detailOBJ = { event: event, isLogged: true, user: this.tiledeskAuthService.getCurrentUser()
|
|
1674
|
+
const detailOBJ = { event: event, isLogged: true, user: this.tiledeskAuthService.getCurrentUser() }
|
|
1673
1675
|
this.triggerEvents.triggerOnAuthStateChanged(detailOBJ)
|
|
1674
1676
|
}
|
|
1675
1677
|
|
|
1678
|
+
private triggerOnBeforeInit(event){
|
|
1679
|
+
const detailOBJ = { event: event, isLogged: true, user: this.tiledeskAuthService.getCurrentUser() }
|
|
1680
|
+
this.triggerEvents.triggerOnBeforeInit(detailOBJ)
|
|
1681
|
+
}
|
|
1682
|
+
|
|
1676
1683
|
|
|
1677
1684
|
// @HostListener('mouseenter', ['$event'])
|
|
1678
1685
|
// onMouseEnter(event: any) {
|
|
@@ -75,7 +75,7 @@ export class SidebarComponent implements OnInit {
|
|
|
75
75
|
) { }
|
|
76
76
|
|
|
77
77
|
ngOnInit() {
|
|
78
|
-
this.tiledesk_url = BRAND_BASE_INFO['COMPANY_SITE_URL']
|
|
78
|
+
this.tiledesk_url = BRAND_BASE_INFO['COMPANY_SITE_URL'] as string
|
|
79
79
|
|
|
80
80
|
this.DASHBOARD_URL = this.appConfig.getConfig().dashboardUrl + '#/project/';
|
|
81
81
|
console.log('[SIDEBAR] DASHBOARD_URL ', this.DASHBOARD_URL, LOGOS_ITEMS)
|
|
@@ -115,7 +115,7 @@
|
|
|
115
115
|
</span>
|
|
116
116
|
</section>
|
|
117
117
|
|
|
118
|
-
<section *ngIf="
|
|
118
|
+
<section *ngIf="BRAND_BASE_INFO['DOCS']" class="user-details-help-center">
|
|
119
119
|
<span class="material-icons user-details-help-center-icon">support</span>
|
|
120
120
|
<span class="user-details-help-center" (click)="goToHelpCenter()"> Help center</span>
|
|
121
121
|
</section>
|
|
@@ -124,7 +124,7 @@
|
|
|
124
124
|
border-top: 1px solid rgba(255, 255,255, 0.2);"> -->
|
|
125
125
|
|
|
126
126
|
|
|
127
|
-
<section class="user-details-footer-section"
|
|
127
|
+
<section class="user-details-footer-section" *ngIf="BRAND_BASE_INFO['LOGOUT_ENABLED']"
|
|
128
128
|
[ngClass]="{'footer-margin-top-pricing-no-visible': isVisiblePAY === false }">
|
|
129
129
|
<div role="button" class="logout-btn-wpr" (click)=onLogout()>
|
|
130
130
|
<i class="material-icons user-details-logout-icon" >
|
|
@@ -81,10 +81,6 @@ export class SidebarUserDetailsComponent implements OnInit, OnChanges {
|
|
|
81
81
|
this.listenTocurrentProjectUserUserAvailability$();
|
|
82
82
|
this.listenToCurrentStoredProject();
|
|
83
83
|
this.getOSCODE();
|
|
84
|
-
if(BRAND_BASE_INFO['DOCS'] === 'false' || !BRAND_BASE_INFO['DOCS']){
|
|
85
|
-
this.docEnabled = false
|
|
86
|
-
}
|
|
87
|
-
// this.listenOpenUserSidebarEvent();
|
|
88
84
|
}
|
|
89
85
|
|
|
90
86
|
ngOnChanges() { }
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<component-login
|
|
2
2
|
[showSpinnerInLoginBtn] = showSpinnerInLoginBtn
|
|
3
3
|
[translationMap] = translationMap
|
|
4
|
-
[companyLogoBlackUrl]=
|
|
5
|
-
[companyName]=
|
|
6
|
-
[companySiteUrl]="
|
|
4
|
+
[companyLogoBlackUrl]="LOGOS_ITEMS['BASE_LOGO'].icon"
|
|
5
|
+
[companyName]="BRAND_BASE_INFO['BRAND_NAME']"
|
|
6
|
+
[companySiteUrl]="BRAND_BASE_INFO['COMPANY_SITE_URL']"
|
|
7
7
|
(onSignInWithEmailAndPassword)="onSignInWithEmailAndPassword($event)">
|
|
8
8
|
</component-login>
|
|
@@ -28,9 +28,9 @@ import { BRAND_BASE_INFO, LOGOS_ITEMS } from 'src/app/utils/utils-resources';
|
|
|
28
28
|
export class LoginPage implements OnInit {
|
|
29
29
|
showSpinnerInLoginBtn = false;
|
|
30
30
|
showErrorSignIn = false;
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
|
|
32
|
+
LOGOS_ITEMS = LOGOS_ITEMS;
|
|
33
|
+
BRAND_BASE_INFO = BRAND_BASE_INFO;
|
|
34
34
|
|
|
35
35
|
public translationMap: Map<string, string>;
|
|
36
36
|
private subscriptions = [];
|
|
@@ -62,9 +62,6 @@ export class LoginPage implements OnInit {
|
|
|
62
62
|
|
|
63
63
|
/** */
|
|
64
64
|
initialize() {
|
|
65
|
-
this.companyLogoBlackUrl = LOGOS_ITEMS['BASE_LOGO'].icon;
|
|
66
|
-
this.companyName = BRAND_BASE_INFO['BRAND_NAME']; // this.chatManager.getTenant();
|
|
67
|
-
this.companySiteUrl = BRAND_BASE_INFO['COMPANY_SITE_URL']
|
|
68
65
|
this.translations();
|
|
69
66
|
this.events.subscribe('sign-in', this.signIn);
|
|
70
67
|
this.setSubscriptions();
|
|
@@ -88,5 +88,19 @@ export class TriggerEvents {
|
|
|
88
88
|
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
+
public triggerOnBeforeInit(detailObj: {}) {
|
|
92
|
+
this.logger.debug(' ---------------- triggerOnBeforeInitEvent ---------------- ', detailObj);
|
|
93
|
+
try {
|
|
94
|
+
const onBeforeInit = new CustomEvent('onBeforeInit', { detail: detailObj });
|
|
95
|
+
const windowContext = this.windowContext;
|
|
96
|
+
if (windowContext){
|
|
97
|
+
// windowContext.document.dispatchEvent(onNewConversation);
|
|
98
|
+
windowContext.postMessage({type: "onBeforeInit", detail: detailObj }, '*')
|
|
99
|
+
}
|
|
100
|
+
} catch (e) {
|
|
101
|
+
this.logger.error('[TRIGGER-HANDLER] > Error:' + e);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
91
105
|
|
|
92
106
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export const BRAND_BASE_INFO: { [key: string] : string} ={
|
|
1
|
+
export const BRAND_BASE_INFO: { [key: string] : string | boolean} ={
|
|
2
2
|
COMPANY_NAME: "Tiledesk",
|
|
3
3
|
BRAND_NAME: "Tiledesk",
|
|
4
4
|
COMPANY_SITE_NAME:"tiledesk.com",
|
|
@@ -6,10 +6,11 @@ export const BRAND_BASE_INFO: { [key: string] : string} ={
|
|
|
6
6
|
CONTACT_US_EMAIL: "support@tiledesk.com",
|
|
7
7
|
FAVICON: "https://tiledesk.com/wp-content/uploads/2022/07/tiledesk_v13-300x300.png",
|
|
8
8
|
META_TITLE:"Tiledesk - Open Source Live Chat",
|
|
9
|
-
DOCS:
|
|
9
|
+
DOCS: true,
|
|
10
|
+
LOGOUT_ENABLED: false
|
|
10
11
|
}
|
|
11
12
|
|
|
12
|
-
export var LOGOS_ITEMS: { [key: string] : { label: string, icon: string }} ={
|
|
13
|
+
export var LOGOS_ITEMS: { [key: string] : { label: string | boolean, icon: string }} ={
|
|
13
14
|
COMPANY_LOGO: {label: BRAND_BASE_INFO.COMPANY_NAME, icon: 'assets/logos/tiledesk_logo.svg'},
|
|
14
15
|
COMPANY_LOGO_NO_TEXT: {label: BRAND_BASE_INFO.COMPANY_NAME, icon: 'assets/logos/tiledesk_logo_no_text.svg'},
|
|
15
16
|
BASE_LOGO: {label: BRAND_BASE_INFO.BRAND_NAME, icon: 'assets/logos/tiledesk_logo.svg'},
|
|
@@ -139,6 +139,7 @@ export class TiledeskAuthService {
|
|
|
139
139
|
localStorage.removeItem('tiledesk_token')
|
|
140
140
|
this.BS_IsONLINE.next(false)
|
|
141
141
|
this.setCurrentUser(null);
|
|
142
|
+
this.setTiledeskToken(null);
|
|
142
143
|
// this.isOnline$.next(false)
|
|
143
144
|
const stored_project = localStorage.getItem('last_project')
|
|
144
145
|
if (stored_project) {
|
|
@@ -218,4 +219,8 @@ export class TiledeskAuthService {
|
|
|
218
219
|
return this.tiledeskToken;
|
|
219
220
|
}
|
|
220
221
|
|
|
222
|
+
setTiledeskToken(token: string) {
|
|
223
|
+
this.tiledeskToken = token
|
|
224
|
+
}
|
|
225
|
+
|
|
221
226
|
}
|