@chat21/chat21-ionic 3.0.60 → 3.0.61-rc2
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 +23 -0
- package/README.md +2 -0
- package/angular.json +2 -0
- package/env.sample +3 -1
- package/package.json +5 -1
- package/src/app/app.component.html +11 -2
- package/src/app/app.component.scss +13 -1
- package/src/app/app.component.ts +26 -3
- package/src/app/app.module.ts +2 -1
- package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.html +2 -2
- package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.ts +24 -1
- package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.html +2 -3
- package/src/app/components/conversation-info/info-content/info-content.component.html +2 -2
- package/src/app/components/ddp-header/ddp-header.component.html +14 -7
- package/src/app/components/ddp-header/ddp-header.component.scss +4 -0
- package/src/app/components/ddp-header/ddp-header.component.ts +21 -2
- package/src/app/components/project-item/project-item.component.html +7 -6
- package/src/app/components/project-item/project-item.component.scss +6 -1
- package/src/app/components/project-item/project-item.component.ts +15 -2
- package/src/app/components/sidebar/sidebar.component.html +210 -0
- package/src/app/components/sidebar/sidebar.component.scss +11 -0
- package/src/app/components/sidebar/sidebar.component.spec.ts +24 -0
- package/src/app/components/sidebar/sidebar.component.ts +400 -0
- package/src/app/components/sidebar-user-details/sidebar-user-details.component.html +102 -0
- package/src/app/components/sidebar-user-details/sidebar-user-details.component.scss +310 -0
- package/src/app/components/sidebar-user-details/sidebar-user-details.component.spec.ts +24 -0
- package/src/app/components/sidebar-user-details/sidebar-user-details.component.ts +423 -0
- package/src/app/pages/conversation-detail/conversation-detail.page.ts +21 -20
- package/src/app/pages/conversations-list/conversations-list.page.html +11 -5
- package/src/app/pages/conversations-list/conversations-list.page.ts +33 -8
- package/src/app/pages/profile-info/profile-info.page.html +2 -2
- package/src/app/pages/profile-info/profile-info.page.ts +23 -21
- package/src/app/shared/shared.module.ts +13 -0
- package/src/assets/i18n/de.json +29 -12
- package/src/assets/i18n/en.json +21 -4
- package/src/assets/i18n/es.json +21 -4
- package/src/assets/i18n/fr.json +21 -4
- package/src/assets/i18n/it.json +21 -4
- package/src/assets/i18n/pt.json +21 -4
- package/src/assets/i18n/ru.json +21 -4
- package/src/assets/i18n/tr.json +23 -5
- package/src/assets/images/language_flag/ar.png +0 -0
- package/src/assets/images/language_flag/bg.png +0 -0
- package/src/assets/images/language_flag/ca.png +0 -0
- package/src/assets/images/language_flag/cs.png +0 -0
- package/src/assets/images/language_flag/da.png +0 -0
- package/src/assets/images/language_flag/de.png +0 -0
- package/src/assets/images/language_flag/el.png +0 -0
- package/src/assets/images/language_flag/en.png +0 -0
- package/src/assets/images/language_flag/es.png +0 -0
- package/src/assets/images/language_flag/fa.png +0 -0
- package/src/assets/images/language_flag/fi.png +0 -0
- package/src/assets/images/language_flag/fr.png +0 -0
- package/src/assets/images/language_flag/he.png +0 -0
- package/src/assets/images/language_flag/hi.png +0 -0
- package/src/assets/images/language_flag/hu.png +0 -0
- package/src/assets/images/language_flag/id.png +0 -0
- package/src/assets/images/language_flag/it.png +0 -0
- package/src/assets/images/language_flag/ja.png +0 -0
- package/src/assets/images/language_flag/ko.png +0 -0
- package/src/assets/images/language_flag/ml-IN.png +0 -0
- package/src/assets/images/language_flag/ne-NP.png +0 -0
- package/src/assets/images/language_flag/nl.png +0 -0
- package/src/assets/images/language_flag/no.png +0 -0
- package/src/assets/images/language_flag/pl.png +0 -0
- package/src/assets/images/language_flag/pt-BR.png +0 -0
- package/src/assets/images/language_flag/pt.png +0 -0
- package/src/assets/images/language_flag/ro.png +0 -0
- package/src/assets/images/language_flag/ru.png +0 -0
- package/src/assets/images/language_flag/sk.png +0 -0
- package/src/assets/images/language_flag/sl.png +0 -0
- package/src/assets/images/language_flag/sv-SE.png +0 -0
- package/src/assets/images/language_flag/ta.png +0 -0
- package/src/assets/images/language_flag/th.png +0 -0
- package/src/assets/images/language_flag/tr.png +0 -0
- package/src/assets/images/language_flag/uk.png +0 -0
- package/src/assets/images/language_flag/vi.png +0 -0
- package/src/assets/images/language_flag/zh-CN.png +0 -0
- package/src/assets/images/language_flag/zh-TW.png +0 -0
- package/src/assets/images/no_image_user.png +0 -0
- package/src/assets/tiledesk-solo-logo.png +0 -0
- package/src/chat-config-pre-test.json +3 -1
- package/src/chat-config-template.json +3 -1
- package/src/chat-config.json +4 -2
- package/src/global.scss +451 -3
- package/src/index.html +7 -0
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
<!-- *ngIf="project" -->
|
|
2
|
+
<div class="logo" style="background-color:#1e2129!important; padding-bottom: 5px;min-height: 60px; width: 60px;">
|
|
3
|
+
<a class="logo-img-wpr" [ngClass]="{'small-sidebar-logo-img-wpr' : SIDEBAR_IS_SMALL === true }">
|
|
4
|
+
<div class="logo-img" (click)="goToHome()" style="cursor: pointer;">
|
|
5
|
+
<img class="small-sidebar__logo" src="assets/tiledesk-solo-logo.png" />
|
|
6
|
+
</div>
|
|
7
|
+
</a>
|
|
8
|
+
</div>
|
|
9
|
+
|
|
10
|
+
<div class="sidebar-wrapper">
|
|
11
|
+
<!-- // NK start NEW: AVATAR ON THE SIDEBAR -->
|
|
12
|
+
<div class="user tiledesk-nav-user" [ngClass]="{'small-sidebar-tiledesk-nav-user' : SIDEBAR_IS_SMALL === true }"
|
|
13
|
+
fxlayout="column" style="flex-direction: column; box-sizing: border-box; display: flex;">
|
|
14
|
+
<div class="h3 username" style="font-size: 16px;font-weight: 400;margin-top: 15px; margin-bottom: 5px;"
|
|
15
|
+
[ngClass]="{'small-sidebar-userfullname' : SIDEBAR_IS_SMALL === true }">
|
|
16
|
+
|
|
17
|
+
{{ user?.firstname }} {{ user?.lastname }}
|
|
18
|
+
</div>
|
|
19
|
+
<div class="h5 email hint-text mt-8"
|
|
20
|
+
style="color: rgba(255,255,255,.5)!important;font-size: 13px;margin-top: 0px!important;font-weight: 400;"
|
|
21
|
+
[ngClass]="{'small-sidebar-email' : SIDEBAR_IS_SMALL === true }">
|
|
22
|
+
{{ user?.email }}
|
|
23
|
+
</div>
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
<div id="sidebaravatar-img-wpr" class="avatar-container tiledesk-nav-avatar" (click)="openUserDetailSidePanel()"
|
|
27
|
+
style="cursor: pointer;" [ngClass]="{'small-sidebar-avatar' : SIDEBAR_IS_SMALL === true }">
|
|
28
|
+
|
|
29
|
+
<img id="sidebaravatar-img" class="sidebar-avatar" [src]="photo_profile_URL" onerror="this.src='assets/images/no_image_user.png'" />
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
<!-- matTooltipClass="custom-mat-tooltip" matTooltip="{{ tooltip_text_for_availability_status}}" #tooltip="matTooltip" matTooltipPosition='right' matTooltipHideDelay="100" -->
|
|
33
|
+
<!-- (click)="changeAvailabilityState(IS_AVAILABLE = !IS_AVAILABLE)" -->
|
|
34
|
+
<div id="sidebaravatar-status-icon" class="status-icon"
|
|
35
|
+
[ngClass]="{'is-user-online' : IS_AVAILABLE === true, 'is-user-offline' : IS_AVAILABLE === false, 'small-sidebar-status-icon' : SIDEBAR_IS_SMALL === true }">
|
|
36
|
+
</div>
|
|
37
|
+
|
|
38
|
+
</div>
|
|
39
|
+
<!-- CAMERA ICONS OVER THE AVATAR -->
|
|
40
|
+
<!-- [ngClass]="{'hover-effect' : isOverAvar}" -->
|
|
41
|
+
<!-- <i class="material-icons is-over-camera"
|
|
42
|
+
[ngClass]="{'small-sidebar-camera-icon' : SIDEBAR_IS_SMALL === true, 'is-over-camera-decrease-top':IS_BUSY === true }">
|
|
43
|
+
camera_alt
|
|
44
|
+
</i> -->
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
<!-- matTooltipClass="custom-mat-tooltip" matTooltip="{{ 'Busy' | translate }}" #tooltip="matTooltip" matTooltipPosition='right' matTooltipHideDelay="100" -->
|
|
48
|
+
<div id="sidebaravatar-isbusy-icon-wpr" class="sidebar--isBusy-icon-wpr" *ngIf="IS_BUSY === true" style="cursor:pointer">
|
|
49
|
+
<span id="sidebaravatar-isbusy-icon" class="material-icons sidebar-is-busy-icon">
|
|
50
|
+
access_time
|
|
51
|
+
</span>
|
|
52
|
+
</div>
|
|
53
|
+
</div>
|
|
54
|
+
|
|
55
|
+
<div class="nav-container">
|
|
56
|
+
<!-- [ngClass]="{'is-desktop-menu' : IS_MOBILE_MENU === false, 'is-mobile-menu' : IS_MOBILE_MENU === true }" -->
|
|
57
|
+
<ul style="padding-bottom: 65px;" class="nav">
|
|
58
|
+
|
|
59
|
+
<!-- ------------------------------------------- -->
|
|
60
|
+
<!-- CHAT -->
|
|
61
|
+
<!-- ------------------------------------------- -->
|
|
62
|
+
<li class="item-active" style="cursor: unset;" matTooltipClass="custom-mat-tooltip" matTooltip="Chat"
|
|
63
|
+
#tooltip="matTooltip" matTooltipPosition='right' matTooltipHideDelay="100">
|
|
64
|
+
<a class="customAncor">
|
|
65
|
+
<i class="material-icons sidebar-icons">chat</i>
|
|
66
|
+
</a>
|
|
67
|
+
</li>
|
|
68
|
+
|
|
69
|
+
<!-- ------------------------------------------- -->
|
|
70
|
+
<!-- HOME -->
|
|
71
|
+
<!-- ------------------------------------------- -->
|
|
72
|
+
<li (click)="goToHome()" matTooltip="Home" #tooltip="matTooltip" matTooltipPosition='right'
|
|
73
|
+
matTooltipHideDelay="100" matTooltipClass="custom-mat-tooltip">
|
|
74
|
+
<a class="customAncor">
|
|
75
|
+
<i class="material-icons sidebar-icons">
|
|
76
|
+
home
|
|
77
|
+
</i>
|
|
78
|
+
</a>
|
|
79
|
+
</li>
|
|
80
|
+
|
|
81
|
+
<!-- ------------------------------------------- -->
|
|
82
|
+
<!-- REQUESTS (VISITORS) -->
|
|
83
|
+
<!-- ------------------------------------------- -->
|
|
84
|
+
<li (click)="goToConversations()"
|
|
85
|
+
matTooltipClass="custom-mat-tooltip" matTooltip="{{ conversations_lbl }}" #tooltip="matTooltip" matTooltipPosition='right' matTooltipHideDelay="100">
|
|
86
|
+
<a class="customAncor">
|
|
87
|
+
<i class="material-icons sidebar-icons">forum</i>
|
|
88
|
+
</a>
|
|
89
|
+
</li>
|
|
90
|
+
|
|
91
|
+
<!-- ------------------------------------------- -->
|
|
92
|
+
<!-- CONTACTS (LEADS) -->
|
|
93
|
+
<!-- ------------------------------------------- -->
|
|
94
|
+
<li (click)="goToContacts()"
|
|
95
|
+
matTooltipClass="custom-mat-tooltip" matTooltip="{{ contacts_lbl }}" #tooltip="matTooltip" matTooltipPosition='right' matTooltipHideDelay="100">
|
|
96
|
+
<a class="customAncor">
|
|
97
|
+
<i class="material-icons sidebar-icons">contacts</i>
|
|
98
|
+
</a>
|
|
99
|
+
</li>
|
|
100
|
+
|
|
101
|
+
<!-- ------------------------------------------- -->
|
|
102
|
+
<!-- APPS -->
|
|
103
|
+
<!-- ------------------------------------------- -->
|
|
104
|
+
<ng-container *ngIf="isVisibleAPP && USER_ROLE !== 'agent'">
|
|
105
|
+
<li (click)="goToAppStore()"
|
|
106
|
+
matTooltipClass="custom-mat-tooltip" matTooltip="{{ apps_lbl }}" #tooltip="matTooltip" matTooltipPosition='right' matTooltipHideDelay="100" >
|
|
107
|
+
<a class="customAncor">
|
|
108
|
+
<i class="material-icons sidebar-icons">apps</i>
|
|
109
|
+
</a>
|
|
110
|
+
</li>
|
|
111
|
+
</ng-container>
|
|
112
|
+
|
|
113
|
+
<!-- ------------------------------------------- -->
|
|
114
|
+
<!-- ANALYTICS -->
|
|
115
|
+
<!-- ------------------------------------------- -->
|
|
116
|
+
<ng-container *ngIf="isVisibleANA && USER_ROLE !== 'agent'">
|
|
117
|
+
<li (click)="goToAnalytics()"
|
|
118
|
+
matTooltipClass="custom-mat-tooltip" matTooltip="{{ analytics_lbl }}" #tooltip="matTooltip" matTooltipPosition='right' matTooltipHideDelay="100">
|
|
119
|
+
<a class="customAncor">
|
|
120
|
+
<i class="material-icons sidebar-icons">trending_up</i>
|
|
121
|
+
</a>
|
|
122
|
+
</li>
|
|
123
|
+
</ng-container>
|
|
124
|
+
|
|
125
|
+
<!-- ------------------------------------------- -->
|
|
126
|
+
<!-- ACTIVITIES -->
|
|
127
|
+
<!-- ------------------------------------------- -->
|
|
128
|
+
<ng-container *ngIf="isVisibleACT">
|
|
129
|
+
<li *ngIf="USER_ROLE !== 'agent'" (click)="goToActivities()"
|
|
130
|
+
matTooltipClass="custom-mat-tooltip" matTooltip="{{ activities_lbl }}" #tooltip="matTooltip" matTooltipPosition='right' matTooltipHideDelay="100">
|
|
131
|
+
<a class="customAncor">
|
|
132
|
+
<i class="material-icons sidebar-icons">assignment</i>
|
|
133
|
+
</a>
|
|
134
|
+
</li>
|
|
135
|
+
</ng-container>
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
<!-- ------------------------------------------- -->
|
|
139
|
+
<!-- REQUESTS HISTORY -->
|
|
140
|
+
<!-- ------------------------------------------- -->
|
|
141
|
+
<li (click)="goToHistory()"
|
|
142
|
+
matTooltipClass="custom-mat-tooltip" matTooltip="{{ history_lbl }}" #tooltip="matTooltip" matTooltipPosition='right' matTooltipHideDelay="100">
|
|
143
|
+
<a class="customAncor">
|
|
144
|
+
<i class="material-icons sidebar-icons">history</i>
|
|
145
|
+
</a>
|
|
146
|
+
</li>
|
|
147
|
+
|
|
148
|
+
<!-- ------------------------------------------- -->
|
|
149
|
+
<!-- SETTINGS -->
|
|
150
|
+
<!-- ------------------------------------------- -->
|
|
151
|
+
<li *ngIf="USER_ROLE !== 'agent'" (click)="goToSettings_CannedResponses()"
|
|
152
|
+
matTooltipClass="custom-mat-tooltip" matTooltip="{{ settings_lbl }}" #tooltip="matTooltip" matTooltipPosition='right' matTooltipHideDelay="100">
|
|
153
|
+
<a class="customAncor">
|
|
154
|
+
<i class="material-icons sidebar-icons">settings</i>
|
|
155
|
+
</a>
|
|
156
|
+
</li>
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
<!-- [_prjct_profile_name]="_prjct_profile_name" [plan_subscription_is_active]="plan_subscription_is_active"
|
|
160
|
+
[plan_name]="plan_name"
|
|
161
|
+
[plan_type]="plan_type"
|
|
162
|
+
[isVisiblePAY]="isVisiblePAY"
|
|
163
|
+
[prjct_name]="prjct_name" -->
|
|
164
|
+
<!-- HAS_CLICKED_OPEN_USER_DETAIL {{ HAS_CLICKED_OPEN_USER_DETAIL }} -->
|
|
165
|
+
<!-- [HAS_CLICKED_OPEN_USER_DETAIL]='HAS_CLICKED_OPEN_USER_DETAIL' -->
|
|
166
|
+
<!-- tabindex="-1" style="z-index: 20001;" -->
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
<!-- <app-sidebar-user-details
|
|
170
|
+
(onCloseUserDetailsSidebar)='onCloseUserDetailsSidebar($event)'>
|
|
171
|
+
</app-sidebar-user-details> -->
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
</ul>
|
|
209
|
+
</div>
|
|
210
|
+
</div>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
import { IonicModule } from '@ionic/angular';
|
|
3
|
+
|
|
4
|
+
import { SidebarComponent } from './sidebar.component';
|
|
5
|
+
|
|
6
|
+
describe('SidebarComponent', () => {
|
|
7
|
+
let component: SidebarComponent;
|
|
8
|
+
let fixture: ComponentFixture<SidebarComponent>;
|
|
9
|
+
|
|
10
|
+
beforeEach(async(() => {
|
|
11
|
+
TestBed.configureTestingModule({
|
|
12
|
+
declarations: [ SidebarComponent ],
|
|
13
|
+
imports: [IonicModule.forRoot()]
|
|
14
|
+
}).compileComponents();
|
|
15
|
+
|
|
16
|
+
fixture = TestBed.createComponent(SidebarComponent);
|
|
17
|
+
component = fixture.componentInstance;
|
|
18
|
+
fixture.detectChanges();
|
|
19
|
+
}));
|
|
20
|
+
|
|
21
|
+
it('should create', () => {
|
|
22
|
+
expect(component).toBeTruthy();
|
|
23
|
+
});
|
|
24
|
+
});
|
|
@@ -0,0 +1,400 @@
|
|
|
1
|
+
import { Component, OnInit } from '@angular/core';
|
|
2
|
+
import { Router } from '@angular/router';
|
|
3
|
+
import { AppConfigProvider } from 'src/app/services/app-config';
|
|
4
|
+
import { WebsocketService } from 'src/app/services/websocket/websocket.service';
|
|
5
|
+
import { AppStorageService } from 'src/chat21-core/providers/abstract/app-storage.service';
|
|
6
|
+
import { ImageRepoService } from 'src/chat21-core/providers/abstract/image-repo.service';
|
|
7
|
+
import { MessagingAuthService } from 'src/chat21-core/providers/abstract/messagingAuth.service';
|
|
8
|
+
import { CustomTranslateService } from 'src/chat21-core/providers/custom-translate.service';
|
|
9
|
+
import { LoggerService } from 'src/chat21-core/providers/abstract/logger.service';
|
|
10
|
+
import { LoggerInstance } from 'src/chat21-core/providers/logger/loggerInstance';
|
|
11
|
+
import { TranslateService } from '@ngx-translate/core';
|
|
12
|
+
import { EventsService } from 'src/app/services/events-service';
|
|
13
|
+
|
|
14
|
+
@Component({
|
|
15
|
+
selector: 'app-sidebar',
|
|
16
|
+
templateUrl: './sidebar.component.html',
|
|
17
|
+
styleUrls: ['./sidebar.component.scss'],
|
|
18
|
+
})
|
|
19
|
+
export class SidebarComponent implements OnInit {
|
|
20
|
+
|
|
21
|
+
private logger: LoggerService = LoggerInstance.getInstance();
|
|
22
|
+
|
|
23
|
+
USER_ROLE: string;
|
|
24
|
+
SIDEBAR_IS_SMALL = true
|
|
25
|
+
IS_AVAILABLE: boolean;
|
|
26
|
+
user: any;
|
|
27
|
+
IS_BUSY: boolean;
|
|
28
|
+
|
|
29
|
+
isVisibleAPP: boolean;
|
|
30
|
+
isVisibleANA: boolean;
|
|
31
|
+
isVisibleACT: boolean;
|
|
32
|
+
photo_profile_URL: string;
|
|
33
|
+
project_id: string;
|
|
34
|
+
DASHBOARD_URL: string;
|
|
35
|
+
HAS_CLICKED_OPEN_USER_DETAIL: boolean = false
|
|
36
|
+
public translationMap: Map<string, string>;
|
|
37
|
+
public_Key: any;
|
|
38
|
+
conversations_lbl: string;
|
|
39
|
+
contacts_lbl: string;
|
|
40
|
+
apps_lbl: string;
|
|
41
|
+
analytics_lbl: string;
|
|
42
|
+
activities_lbl: string;
|
|
43
|
+
history_lbl: string;
|
|
44
|
+
settings_lbl: string;
|
|
45
|
+
|
|
46
|
+
constructor(
|
|
47
|
+
public imageRepoService: ImageRepoService,
|
|
48
|
+
public appStorageService: AppStorageService,
|
|
49
|
+
public appConfig: AppConfigProvider,
|
|
50
|
+
private translateService: CustomTranslateService,
|
|
51
|
+
private messagingAuthService: MessagingAuthService,
|
|
52
|
+
public wsService: WebsocketService,
|
|
53
|
+
public appConfigProvider: AppConfigProvider,
|
|
54
|
+
private translate: TranslateService,
|
|
55
|
+
public events: EventsService
|
|
56
|
+
) { }
|
|
57
|
+
|
|
58
|
+
ngOnInit() {
|
|
59
|
+
this.DASHBOARD_URL = this.appConfig.getConfig().dashboardUrl + '#/project/';
|
|
60
|
+
console.log('[SIDEBAR] DASHBOARD_URL ', this.DASHBOARD_URL)
|
|
61
|
+
this.getStoredProjectAndDashboardBaseUrl()
|
|
62
|
+
this.subcribeToAuthStateChanged()
|
|
63
|
+
this.listenTocurrentProjectUserUserAvailability$()
|
|
64
|
+
this.getOSCODE();
|
|
65
|
+
this.getCurrentChatLangAndTranslateLabels();
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
getCurrentChatLangAndTranslateLabels() {
|
|
69
|
+
const browserLang = this.translate.getBrowserLang();
|
|
70
|
+
const currentUser = JSON.parse(this.appStorageService.getItem('currentUser'));
|
|
71
|
+
console.log('[SIDEBAR] - ngOnInit - currentUser ', currentUser)
|
|
72
|
+
console.log('[SIDEBAR] - ngOnInit - browserLang ', browserLang)
|
|
73
|
+
let currentUserId = ''
|
|
74
|
+
if (currentUser) {
|
|
75
|
+
currentUserId = currentUser.uid
|
|
76
|
+
console.log('[SIDEBAR] - ngOnInit - currentUserId ', currentUserId)
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
const stored_preferred_lang = localStorage.getItem(currentUserId + '_lang');
|
|
80
|
+
console.log('[SIDEBAR] stored_preferred_lang: ', stored_preferred_lang);
|
|
81
|
+
|
|
82
|
+
let chat_lang = '';
|
|
83
|
+
if (browserLang && !stored_preferred_lang) {
|
|
84
|
+
chat_lang = browserLang
|
|
85
|
+
console.log('[SIDEBAR] chat_lang: ', chat_lang);
|
|
86
|
+
} else if (browserLang && stored_preferred_lang) {
|
|
87
|
+
chat_lang = stored_preferred_lang
|
|
88
|
+
|
|
89
|
+
console.log('[SIDEBAR] chat_lang: ', chat_lang);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
this.translate.use(chat_lang);
|
|
93
|
+
this.translateLabels()
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
translateLabels() {
|
|
98
|
+
this.getConversationsTranslation();
|
|
99
|
+
this.getContactsTranslation();
|
|
100
|
+
this.getActivitiesTranslation();
|
|
101
|
+
this.getAppsTranslation();
|
|
102
|
+
this.getAnalyticsTranslation();
|
|
103
|
+
this.getHistoryTranslation();
|
|
104
|
+
this.getSettingsTranslation()
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
getConversationsTranslation() {
|
|
108
|
+
this.translate.get('Conversations')
|
|
109
|
+
.subscribe((text: string) => {
|
|
110
|
+
console.log('[SIDEBAR] - translate Conversations', text)
|
|
111
|
+
this.conversations_lbl = text
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
getContactsTranslation() {
|
|
116
|
+
this.translate.get('LABEL_CONTACTS')
|
|
117
|
+
.subscribe((text: string) => {
|
|
118
|
+
console.log('[SIDEBAR] - translate Contacts', text)
|
|
119
|
+
this.contacts_lbl = text
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
getAppsTranslation() {
|
|
124
|
+
this.translate.get('Apps')
|
|
125
|
+
.subscribe((text: string) => {
|
|
126
|
+
console.log('[SIDEBAR] - translate Apps', text)
|
|
127
|
+
this.apps_lbl = text
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
getAnalyticsTranslation() {
|
|
132
|
+
this.translate.get('Analytics')
|
|
133
|
+
.subscribe((text: string) => {
|
|
134
|
+
console.log('[SIDEBAR] - translate Analytics', text)
|
|
135
|
+
this.analytics_lbl = text
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
getActivitiesTranslation() {
|
|
140
|
+
this.translate.get('Activities')
|
|
141
|
+
.subscribe((text: string) => {
|
|
142
|
+
console.log('[SIDEBAR] - translate Activities', text)
|
|
143
|
+
this.activities_lbl = text
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
getHistoryTranslation() {
|
|
148
|
+
this.translate.get('History')
|
|
149
|
+
.subscribe((text: string) => {
|
|
150
|
+
console.log('[SIDEBAR] - translate History', text)
|
|
151
|
+
this.history_lbl = text
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
getSettingsTranslation() {
|
|
156
|
+
this.translate.get('Settings')
|
|
157
|
+
.subscribe((text: string) => {
|
|
158
|
+
console.log('[SIDEBAR] - translate Settings', text)
|
|
159
|
+
this.settings_lbl = text
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
getOSCODE() {
|
|
164
|
+
this.public_Key = this.appConfigProvider.getConfig().t2y12PruGU9wUtEGzBJfolMIgK;
|
|
165
|
+
this.logger.log('[SIDEBAR] AppConfigService getAppConfig public_Key', this.public_Key);
|
|
166
|
+
|
|
167
|
+
if (this.public_Key) {
|
|
168
|
+
let keys = this.public_Key.split("-");
|
|
169
|
+
this.logger.log('[SIDEBAR] PUBLIC-KEY - public_Key keys', keys)
|
|
170
|
+
|
|
171
|
+
keys.forEach(key => {
|
|
172
|
+
|
|
173
|
+
if (key.includes("ANA")) {
|
|
174
|
+
|
|
175
|
+
let ana = key.split(":");
|
|
176
|
+
|
|
177
|
+
if (ana[1] === "F") {
|
|
178
|
+
this.isVisibleANA = false;
|
|
179
|
+
} else {
|
|
180
|
+
this.isVisibleANA = true;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
if (key.includes("ACT")) {
|
|
185
|
+
let act = key.split(":");
|
|
186
|
+
if (act[1] === "F") {
|
|
187
|
+
this.isVisibleACT = false;
|
|
188
|
+
} else {
|
|
189
|
+
this.isVisibleACT = true;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
if (key.includes("APP")) {
|
|
194
|
+
let lbs = key.split(":");
|
|
195
|
+
if (lbs[1] === "F") {
|
|
196
|
+
this.isVisibleAPP = false;
|
|
197
|
+
} else {
|
|
198
|
+
this.isVisibleAPP = true;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
});
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
if (!this.public_Key.includes("ANA")) {
|
|
205
|
+
this.isVisibleANA = false;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
if (!this.public_Key.includes("ACT")) {
|
|
209
|
+
this.isVisibleACT = false;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
if (!this.public_Key.includes("APP")) {
|
|
214
|
+
this.isVisibleAPP = false;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
} else {
|
|
218
|
+
this.isVisibleANA = false;
|
|
219
|
+
this.isVisibleACT = false;
|
|
220
|
+
this.isVisibleAPP = false;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
listenTocurrentProjectUserUserAvailability$() {
|
|
227
|
+
this.wsService.currentProjectUserAvailability$.subscribe((projectUser) => {
|
|
228
|
+
console.log('[SIDEBAR] - $UBSC TO WS USER AVAILABILITY & BUSY STATUS RES ', projectUser);
|
|
229
|
+
|
|
230
|
+
this.IS_AVAILABLE = projectUser['user_available']
|
|
231
|
+
this.IS_BUSY = projectUser['isBusy']
|
|
232
|
+
// if (project.id_project._id === projectUser['id_project']) {
|
|
233
|
+
// project['ws_projct_user_available'] = projectUser['user_available'];
|
|
234
|
+
// project['ws_projct_user_isBusy'] = projectUser['isBusy']
|
|
235
|
+
// if (this.translationMap) {
|
|
236
|
+
// if (projectUser['user_available'] === true) {
|
|
237
|
+
// this.avaialble_status_for_tooltip = this.translationMap.get('CHANGE_TO_YOUR_STATUS_TO_UNAVAILABLE')
|
|
238
|
+
// } else {
|
|
239
|
+
// this.avaialble_status_for_tooltip = this.translationMap.get('CHANGE_TO_YOUR_STATUS_TO_AVAILABLE')
|
|
240
|
+
// }
|
|
241
|
+
// }
|
|
242
|
+
// }
|
|
243
|
+
|
|
244
|
+
}, (error) => {
|
|
245
|
+
this.logger.error('[SIDEBAR] - $UBSC TO WS USER AVAILABILITY & BUSY STATUS error ', error);
|
|
246
|
+
}, () => {
|
|
247
|
+
this.logger.log('[SIDEBAR] - $UBSC TO WS USER AVAILABILITY & BUSY STATUS * COMPLETE *');
|
|
248
|
+
})
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
openUserDetailSidePanel() {
|
|
252
|
+
console.log('[SIDEBAR] OPEN UESER DTLS SIDE PANEL')
|
|
253
|
+
this.HAS_CLICKED_OPEN_USER_DETAIL = true
|
|
254
|
+
console.log('[SIDEBAR] OPEN USER DTLS SIDE PANEL ', this.HAS_CLICKED_OPEN_USER_DETAIL)
|
|
255
|
+
const elSidebarUserDtls = <HTMLElement>document.querySelector('#user-details');
|
|
256
|
+
console.log('[SIDEBAR] OPEN USER DTLS SIDE PANEL elSidebarUserDtls ', elSidebarUserDtls)
|
|
257
|
+
if (elSidebarUserDtls) {
|
|
258
|
+
elSidebarUserDtls.classList.add("active");
|
|
259
|
+
this.events.publish('userdetailsidebar:opened', true);
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
onCloseUserDetailsSidebar($event) {
|
|
265
|
+
console.log('[SIDEBAR] HAS_CLICKED_CLOSE_USER_DETAIL ', $event)
|
|
266
|
+
this.HAS_CLICKED_OPEN_USER_DETAIL = $event
|
|
267
|
+
const elemNavbar = <HTMLElement>document.querySelector('.navbar-absolute');
|
|
268
|
+
console.log('[SIDEBAR] elemNavBar ', elemNavbar)
|
|
269
|
+
if (elemNavbar) {
|
|
270
|
+
elemNavbar.classList.remove("navbar-absolute-custom-class")
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
const elemNavbarBrand = <HTMLElement>document.querySelector('.navbar-brand');
|
|
274
|
+
console.log('[SIDEBAR] elemNavbarBrand ', elemNavbarBrand)
|
|
275
|
+
if (elemNavbarBrand) {
|
|
276
|
+
elemNavbarBrand.classList.remove("navbar-brand-z-index-zero")
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
subcribeToAuthStateChanged() {
|
|
281
|
+
this.messagingAuthService.BSAuthStateChanged.subscribe((state) => {
|
|
282
|
+
console.log('[SIDEBAR] BSAuthStateChanged ', state)
|
|
283
|
+
|
|
284
|
+
if (state === 'online') {
|
|
285
|
+
const currentUser = JSON.parse(this.appStorageService.getItem('currentUser'));
|
|
286
|
+
console.log('[SIDEBAR] currentUser ', currentUser)
|
|
287
|
+
if (currentUser) {
|
|
288
|
+
this.photo_profile_URL = this.imageRepoService.getImagePhotoUrl(currentUser.uid)
|
|
289
|
+
console.log('[SIDEBAR] photo_profile_URL ', this.photo_profile_URL)
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
}
|
|
293
|
+
})
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
|
|
297
|
+
getStoredProjectAndDashboardBaseUrl() {
|
|
298
|
+
const stored_project = localStorage.getItem('last_project')
|
|
299
|
+
// console.log('[SIDEBAR] stored_project ', stored_project)
|
|
300
|
+
if (stored_project) {
|
|
301
|
+
const project = JSON.parse(stored_project)
|
|
302
|
+
console.log('[SIDEBAR] project ', project)
|
|
303
|
+
|
|
304
|
+
this.project_id = project.id_project.id
|
|
305
|
+
console.log('[SIDEBAR] project_id ', this.project_id)
|
|
306
|
+
|
|
307
|
+
this.USER_ROLE = project.role;
|
|
308
|
+
console.log('[SIDEBAR] USER_ROLE ', this.USER_ROLE)
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
goToHome() {
|
|
313
|
+
let url = this.DASHBOARD_URL + this.project_id + '/home'
|
|
314
|
+
const myWindow = window.open(url, '_self');
|
|
315
|
+
myWindow.focus();
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
goToConversations() {
|
|
319
|
+
let url = this.DASHBOARD_URL + this.project_id + '/wsrequests'
|
|
320
|
+
const myWindow = window.open(url, '_self');
|
|
321
|
+
myWindow.focus();
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
goToContacts() {
|
|
325
|
+
let url = this.DASHBOARD_URL + this.project_id + '/contacts'
|
|
326
|
+
const myWindow = window.open(url, '_self');
|
|
327
|
+
myWindow.focus();
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
goToAppStore() {
|
|
331
|
+
let url = this.DASHBOARD_URL + this.project_id + '/app-store'
|
|
332
|
+
const myWindow = window.open(url, '_self');
|
|
333
|
+
myWindow.focus();
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
|
|
337
|
+
goToAnalytics() {
|
|
338
|
+
let url = this.DASHBOARD_URL + this.project_id + '/analytics'
|
|
339
|
+
const myWindow = window.open(url, '_self');
|
|
340
|
+
myWindow.focus();
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
|
|
344
|
+
goToActivities() {
|
|
345
|
+
let url = this.DASHBOARD_URL + this.project_id + '/activities'
|
|
346
|
+
const myWindow = window.open(url, '_self');
|
|
347
|
+
myWindow.focus();
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
goToHistory() {
|
|
351
|
+
let url = this.DASHBOARD_URL + this.project_id + '/history'
|
|
352
|
+
const myWindow = window.open(url, '_self');
|
|
353
|
+
myWindow.focus();
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
goToSettings_CannedResponses() {
|
|
357
|
+
let url = this.DASHBOARD_URL + this.project_id + '/cannedresponses'
|
|
358
|
+
const myWindow = window.open(url, '_self');
|
|
359
|
+
myWindow.focus();
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
public translations() {
|
|
363
|
+
const keys = [
|
|
364
|
+
'Available',
|
|
365
|
+
'Unavailable',
|
|
366
|
+
'Busy',
|
|
367
|
+
'VIEW_ALL_CONVERSATIONS',
|
|
368
|
+
'CONVERSATIONS_IN_QUEUE',
|
|
369
|
+
'CONVERSATION_IN_QUEUE',
|
|
370
|
+
'NO_CONVERSATION_IN_QUEUE',
|
|
371
|
+
'PINNED_PROJECT',
|
|
372
|
+
'CHANGE_PINNED_PROJECT',
|
|
373
|
+
"CHANGE_TO_YOUR_STATUS_TO_AVAILABLE",
|
|
374
|
+
"CHANGE_TO_YOUR_STATUS_TO_UNAVAILABLE"
|
|
375
|
+
];
|
|
376
|
+
this.translationMap = this.translateService.translateLanguage(keys);
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
|
|
380
|
+
changeAvailabilityState(IS_AVAILABLE) {
|
|
381
|
+
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
|
|
385
|
+
|
|
386
|
+
|
|
387
|
+
|
|
388
|
+
|
|
389
|
+
|
|
390
|
+
|
|
391
|
+
|
|
392
|
+
|
|
393
|
+
|
|
394
|
+
|
|
395
|
+
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
|
|
399
|
+
|
|
400
|
+
|