@chat21/chat21-ionic 3.0.107-rc.2 → 3.0.107-rc.5

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.
Files changed (65) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/package.json +1 -1
  3. package/src/app/app.component.ts +75 -31
  4. package/src/app/chatlib/conversation-detail/conversation-content/conversation-content.component.scss +0 -1
  5. package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.scss +9 -9
  6. package/src/app/chatlib/conversation-detail/message/info-message/info-message.component.scss +5 -7
  7. package/src/app/chatlib/conversation-detail/message/options/options.component.scss +2 -2
  8. package/src/app/chatlib/conversation-detail/message/return-receipt/return-receipt.component.scss +1 -1
  9. package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.html +1 -1
  10. package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.scss +22 -55
  11. package/src/app/components/canned-response/canned-response.component.scss +9 -2
  12. package/src/app/components/contacts-directory/contacts-directory.component.scss +4 -56
  13. package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.scss +5 -6
  14. package/src/app/components/conversation-detail/message-text-area/message-text-area.component.scss +16 -5
  15. package/src/app/components/conversation-detail/message-text-area/message-text-area.component.ts +5 -0
  16. package/src/app/components/conversation-info/advanced-info-accordion/advanced-info-accordion.component.html +11 -19
  17. package/src/app/components/conversation-info/advanced-info-accordion/advanced-info-accordion.component.scss +15 -19
  18. package/src/app/components/conversation-info/info-direct/info-direct.component.scss +6 -5
  19. package/src/app/components/conversation-info/info-group/info-group.component.html +2 -2
  20. package/src/app/components/conversation-info/info-group/info-group.component.scss +11 -2
  21. package/src/app/components/conversation-info/info-support-group/info-support-group.component.html +2 -1
  22. package/src/app/components/conversation-info/info-support-group/info-support-group.component.ts +44 -1
  23. package/src/app/components/conversations-list/header-conversations-list/header-conversations-list.component.html +2 -1
  24. package/src/app/components/conversations-list/header-conversations-list/header-conversations-list.component.scss +3 -2
  25. package/src/app/components/conversations-list/header-conversations-list-archived/header-conversations-list-archived.component.scss +5 -3
  26. package/src/app/components/conversations-list/header-conversations-list-unassigned/header-conversations-list-unassigned.component.scss +5 -3
  27. package/src/app/components/navbar/navbar.component.html +10 -14
  28. package/src/app/components/navbar/navbar.component.scss +33 -17
  29. package/src/app/components/sidebar/sidebar.component.html +49 -67
  30. package/src/app/components/sidebar/sidebar.component.scss +44 -29
  31. package/src/app/components/sidebar-user-details/sidebar-user-details.component.html +5 -5
  32. package/src/app/components/sidebar-user-details/sidebar-user-details.component.scss +47 -93
  33. package/src/app/components/sidebar-user-details/sidebar-user-details.component.ts +11 -13
  34. package/src/app/modals/create-canned-response/create-canned-response.page.html +2 -20
  35. package/src/app/modals/create-canned-response/create-canned-response.page.scss +44 -27
  36. package/src/app/modals/create-ticket/create-ticket.page.html +4 -4
  37. package/src/app/modals/create-ticket/create-ticket.page.scss +34 -1
  38. package/src/app/modals/json-message/json-message.page.scss +15 -1
  39. package/src/app/modals/loader-preview/loader-preview.page.html +1 -1
  40. package/src/app/modals/loader-preview/loader-preview.page.scss +19 -1
  41. package/src/app/modals/maps/maps.page.scss +18 -0
  42. package/src/app/modals/send-email/send-email.page.scss +30 -7
  43. package/src/app/modals/send-whatsapp-template/send-whatsapp-template.page.html +1 -1
  44. package/src/app/modals/send-whatsapp-template/send-whatsapp-template.page.scss +18 -0
  45. package/src/app/pages/contacts-directory/contacts-directory.page.html +9 -10
  46. package/src/app/pages/contacts-directory/contacts-directory.page.scss +5 -3
  47. package/src/app/pages/contacts-directory/contacts-directory.page.ts +0 -15
  48. package/src/app/pages/conversation-detail/conversation-detail.page.scss +5 -5
  49. package/src/app/pages/conversation-detail/conversation-detail.page.ts +10 -10
  50. package/src/app/pages/conversations-list/conversations-list.page.html +0 -1
  51. package/src/app/pages/conversations-list/conversations-list.page.scss +6 -17
  52. package/src/app/pages/conversations-list/conversations-list.page.ts +9 -18
  53. package/src/app/pages/profile-info/profile-info.page.html +4 -4
  54. package/src/app/pages/profile-info/profile-info.page.scss +43 -25
  55. package/src/app/pages/profile-info/profile-info.page.ts +2 -1
  56. package/src/app/pages/unassigned-conversations/unassigned-conversations.page.html +5 -5
  57. package/src/app/pages/unassigned-conversations/unassigned-conversations.page.scss +2 -2
  58. package/src/app/services/scripts/script.service.ts +1 -0
  59. package/src/assets/customStyle.css +18 -0
  60. package/src/assets/test.html +37 -4
  61. package/src/chat21-core/providers/tiledesk/tiledesk-auth.service.ts +21 -7
  62. package/src/global.scss +52 -137
  63. package/src/index.html +1 -1
  64. package/src/theme/variables.scss +276 -149
  65. package/src/variables.scss +115 -21
@@ -43,6 +43,12 @@ ion-content {
43
43
  }
44
44
  }
45
45
 
46
+ app-project-item{
47
+ width: 100%;
48
+ margin: 0px 8px;
49
+ border-bottom: 1px dashed var(--border-color-base);
50
+ }
51
+
46
52
  ion-list {
47
53
  display: block;
48
54
  margin-block-start: 1em;
@@ -119,23 +125,6 @@ ion-list {
119
125
  font-family: Helvetica, Helvetica, Arial, sans-serif;
120
126
  line-height: 1.28;
121
127
  text-rendering: optimizeLegibility;
122
- .conversation_with {
123
- color: rgba(0, 0, 0, 1);
124
- font-size: 15px;
125
- font-weight: 400;
126
- line-height: 1.4;
127
- }
128
- .conversation_message {
129
- p {
130
- color: rgba(153, 153, 153, 1);
131
- font-size: 13px;
132
- font-weight: 400;
133
- height: 18px;
134
- &.not-read {
135
- font-weight: bold;
136
- }
137
- }
138
- }
139
128
  }
140
129
  ion-note {
141
130
  position: absolute;
@@ -52,6 +52,7 @@ import { WebsocketService } from 'src/app/services/websocket/websocket.service';
52
52
  import { Globals } from 'src/app/utils/globals';
53
53
  import { TriggerEvents } from 'src/app/services/triggerEvents/triggerEvents';
54
54
  import { MessageModel } from 'src/chat21-core/models/message';
55
+ import { Project } from 'src/chat21-core/models/projects';
55
56
 
56
57
  @Component({
57
58
  selector: 'app-conversations-list',
@@ -102,7 +103,7 @@ export class ConversationListPage implements OnInit {
102
103
  public isInitialized: boolean = false;
103
104
 
104
105
  // PROJECT AVAILABILITY INFO: start
105
- project: { _id: string, name: string, type: string, isActiveSubscription: boolean, plan_name: string}
106
+ project: Project
106
107
  profile_name_translated: string;
107
108
  selectedStatus: any;
108
109
  teammateStatus = [
@@ -475,35 +476,25 @@ export class ConversationListPage implements OnInit {
475
476
  this.project = {
476
477
  _id: projectObjct['id_project']['_id'],
477
478
  name: projectObjct['id_project']['name'],
478
- type: projectObjct['id_project']['profile']['type'],
479
+ profile: projectObjct['id_project']['profile'],
479
480
  isActiveSubscription: projectObjct['id_project']['isActiveSubscription'],
480
- plan_name: projectObjct['id_project']['profile']['name']
481
+ trialExpired: projectObjct['id_project']['trialExpired']
481
482
  }
482
483
 
483
- const trial_expired = projectObjct['id_project']['trialExpired']
484
- const profile_name = projectObjct['id_project']['profile']['name'];
485
-
486
- if (this.project.type === 'free') {
484
+ if (this.project.profile.type === 'free') {
487
485
 
488
- if (trial_expired === false) {
486
+ if (this.project.trialExpired === false) {
489
487
  this.profile_name_translated = this.translationMapHeader.get('ProPlanTrial');
490
- } else if (trial_expired === true) {
488
+ } else if (this.project.trialExpired === true) {
491
489
  this.profile_name_translated = this.translationMapHeader.get('FreePlan');
492
490
  }
493
- } else if (this.project.type === 'payment' && profile_name === 'pro') {
491
+ } else if (this.project.profile.type === 'payment' && this.project.profile.name === 'pro') {
494
492
  this.profile_name_translated = this.translationMapHeader.get('PaydPlanNamePro');
495
- } else if (this.project.type === 'payment' && profile_name === 'enterprise') {
493
+ } else if (this.project.profile.type === 'payment' && this.project.profile.name === 'enterprise') {
496
494
  this.profile_name_translated = this.translationMapHeader.get('PaydPlanNameEnterprise');
497
495
  }
498
496
  }
499
497
  })
500
-
501
- try {
502
- // this.tiledeskToken = this.appStorageService.getItem('tiledeskToken');
503
- // console.log('[SIDEBAR-USER-DETAILS] - GET STORED TOKEN ', this.tiledeskToken)
504
- } catch (err) {
505
- this.logger.error('[CONVS-LIST-PAGE] - GET STORED TOKEN ', err)
506
- }
507
498
  }
508
499
 
509
500
  listenTocurrentProjectUserUserAvailability$() {
@@ -108,17 +108,17 @@
108
108
  <span class="material-icons user-details-plan-icon">apps</span>
109
109
  <span>
110
110
  <div> {{project?.name}} </div>
111
- <div style="display: inline-block; margin-left: 26px;"> {{ profile_name_translated }} </div>
111
+ <div style="margin-left: 26px;"> {{ profile_name_translated }} </div>
112
112
 
113
- <div *ngIf="project?.type === 'payment' && project?.isActiveSubscription === false"
113
+ <div *ngIf="project?.profile?.type === 'payment' && project?.isActiveSubscription === false"
114
114
  style="color:#f44336; position:relative; top: -1px;display: inline-block;">
115
- <i *ngIf="project?.plan_name !== 'enterprise'" class="material-icons" style="vertical-align: middle; color:#f44336; cursor:pointer;
115
+ <i *ngIf="project?.profile?.name !== 'enterprise'" class="material-icons" style="vertical-align: middle; color:#f44336; cursor:pointer;
116
116
  font-size: 16px;" matTooltipClass="custom-mat-tooltip"
117
117
  matTooltip="{{ translationsMap.get('SubscriptionPaymentProblem') }}" #tooltip="matTooltip" matTooltipPosition='right'
118
118
  matTooltipHideDelay="100">
119
119
  error_outline
120
120
  </i>
121
- <i *ngIf="project?.plan_name === 'enterprise'" class="material-icons" style="vertical-align: middle; color:#f44336; cursor:pointer;
121
+ <i *ngIf="project?.profile?.name === 'enterprise'" class="material-icons" style="vertical-align: middle; color:#f44336; cursor:pointer;
122
122
  font-size: 16px;" matTooltipClass="custom-mat-tooltip" matTooltip="{{ translationsMap.get('ThePlanHasExpired') }}"
123
123
  #tooltip="matTooltip" matTooltipPosition='right' matTooltipHideDelay="100">
124
124
  error_outline
@@ -71,13 +71,20 @@
71
71
  ion-toolbar{
72
72
  position: absolute;
73
73
  z-index: 2;
74
- --ion-toolbar-background: transparent;
74
+ --background: transparent;
75
+
76
+ ion-icon{
77
+ color: var(--sidebar-icon-color);
78
+ &:hover {
79
+ opacity: 0.8 !important;
80
+ }
81
+ }
75
82
  }
76
83
 
77
84
  .availability-section {
78
85
  // top: 320px;
79
86
  text-align: center;
80
- background-color: #2d323e;
87
+ background-color: var(--user-detail-select-background);
81
88
  padding: 4px 0px;
82
89
  width: 192px;
83
90
  border-radius: 4px;
@@ -91,14 +98,14 @@ ion-toolbar{
91
98
  .first-divider {
92
99
  // margin-top: 365px;
93
100
  border: 0;
94
- border-top: 1px solid rgba(255, 255, 255, 0.2);
101
+ border-top: 1px solid var(--border-color-base);
95
102
  margin-bottom: 20px;
96
103
  }
97
104
 
98
105
  .user-details-plan-info {
99
106
  font-size: 13px;
100
107
  text-transform: capitalize;
101
- color: #a9afbb;
108
+ color: var(--sidebar-user-detail-color);
102
109
  font-weight: 500;
103
110
  line-height: 21px;
104
111
  }
@@ -125,12 +132,15 @@ ion-toolbar{
125
132
  z-index: 1;
126
133
  // bottom: 50px;
127
134
  // bottom: 55px;
135
+ :hover .user-details-logout-icon,
136
+ :hover .user-details-logout-text{
137
+ color: var(--sidebar-hover-icon-color);
138
+ }
128
139
 
129
140
  }
130
141
 
131
142
  .logout-btn-wpr {
132
143
  cursor: pointer;
133
- color: #fff;
134
144
  }
135
145
 
136
146
  .footer-margin-top-pricing-no-visible {
@@ -138,13 +148,16 @@ ion-toolbar{
138
148
  }
139
149
 
140
150
  .user-details-logout-icon {
141
- color: #a9afbb;
151
+ color: var(--sidebar-icon-color);
142
152
  font-size: 30px;
143
153
  // margin-top: 30px;
144
154
  }
145
155
 
146
156
  .user-details-logout-icon:hover {
147
- color: #fff;
157
+ color: var(--sidebar-icon-color);
158
+ }
159
+ .user-details-logout-text{
160
+ color: var(--sidebar-icon-color);
148
161
  }
149
162
 
150
163
 
@@ -152,7 +165,7 @@ ion-toolbar{
152
165
  width: 100%;
153
166
  height: 100%;
154
167
  font-family: "Poppins";
155
- --ion-background-color:#2d323e;
168
+ --ion-background-color:var(--sidebar-background-color);
156
169
 
157
170
  .buttons-header{
158
171
  position: absolute;
@@ -161,7 +174,6 @@ ion-toolbar{
161
174
  }
162
175
 
163
176
  .content-user-profile {
164
- background-color: #2d323e;
165
177
  width: 100%;
166
178
  height: 230px;
167
179
  .user {
@@ -173,23 +185,31 @@ ion-toolbar{
173
185
  min-height: 160px;
174
186
  max-height: 160px;
175
187
  display: block;
176
- background-color: #1e2129;
177
- color: #fff;
188
+ background-color: var(--sidebar-header-background);
189
+ color: var(--sidebar-color);
178
190
  padding-top: 40px;
179
191
  }
180
192
  .email {
181
- color: rgba(255,255,255,.5);
182
- font-size: 13px;
193
+ font-size: 14px;
183
194
  margin-top: 5px;
184
- font-weight: bold;
185
- line-height: 1.4em;
186
- margin-bottom: 15px;
195
+ font-family: "Poppins";
196
+ font-weight: 400;
197
+ line-height: 19px;
198
+ white-space: nowrap;
199
+ white-space: nowrap;
200
+ overflow: hidden;
201
+ text-overflow: ellipsis;
187
202
  }
188
203
  .username {
189
204
  font-size: 16px;
190
- font-weight: bold;
205
+ font-family: "Poppins";
206
+ font-weight: 500;
207
+ line-height: 24px;
208
+ white-space: nowrap;
191
209
  margin-top: 15px;
192
210
  margin-bottom: 5px;
211
+ overflow: hidden;
212
+ text-overflow: ellipsis;
193
213
  }
194
214
 
195
215
  // ion-toolbar {
@@ -203,8 +223,8 @@ ion-toolbar{
203
223
  }
204
224
 
205
225
  .avatar-container {
206
- background-color: #2d323e;
207
- color: #fff;
226
+ background-color: var(--sidebar-header-background);
227
+ color: var(--sidebar-color);
208
228
  text-align: center;
209
229
  position: absolute;
210
230
  top: 110px;
@@ -215,9 +235,7 @@ ion-toolbar{
215
235
  left: 50%;
216
236
  min-width: 100px;
217
237
  min-height: 100px;
218
- border-color: #2d323e;
219
- border-style: solid;
220
- border-width: 2px;
238
+ border: 2px solid var(--sidebar-header-background);
221
239
  line-height: 100px;
222
240
  font-size: 32px;
223
241
  }
@@ -333,11 +351,11 @@ ion-toolbar{
333
351
 
334
352
  }
335
353
  ion-footer{
336
- --ion-background-color: #1e2129;
354
+ background-color: var(--sidebar-background-color);
337
355
  .content-chat-version {
338
- color: white;
356
+ color: var(--sidebar-color);;
339
357
  padding: 20px;
340
- background-color: #1e2129;
358
+ text-align: center;
341
359
  }
342
360
  .chat-title{
343
361
  font-size: 14px;
@@ -22,6 +22,7 @@ import { LoggerService } from 'src/chat21-core/providers/abstract/logger.service
22
22
  import { LoggerInstance } from 'src/chat21-core/providers/logger/loggerInstance';
23
23
  import { WebsocketService } from 'src/app/services/websocket/websocket.service';
24
24
  import { checkPlatformIsMobile, setLastDateWithLabels } from 'src/chat21-core/utils/utils';
25
+ import { Project } from 'src/chat21-core/models/projects';
25
26
 
26
27
  @Component({
27
28
  selector: 'app-profile-info',
@@ -45,7 +46,7 @@ export class ProfileInfoPage implements OnInit {
45
46
  @Input() selectedStatus: number;
46
47
  @Input() profile_name_translated: string;
47
48
  @Input() token: string;
48
- @Input() project: { _id: string, name: string, type: string, isActiveSubscription: boolean, plan_name: string}
49
+ @Input() project: Project;
49
50
 
50
51
  isVisiblePAY: boolean;
51
52
  teammateStatus = [
@@ -1,16 +1,16 @@
1
1
  <ion-header>
2
2
  <ion-toolbar [class.mobile]="isMobile">
3
+ <ion-buttons slot="start">
4
+ <ion-button ion-button fill="clear" (click)="onClose()">
5
+ <ion-icon slot="icon-only" name="close"></ion-icon>
6
+ </ion-button>
7
+ </ion-buttons>
3
8
  <ion-title *ngIf="callerBtn !== 'pinbtn'" style="font-size: 16px;">
4
9
  {{translationMap?.get('UnassignedConversations') }}
5
10
  </ion-title>
6
11
  <ion-title *ngIf="callerBtn === 'pinbtn'" style="font-size: 16px;">
7
12
  {{translationMap?.get('PIN_A_PROJECT') }}
8
13
  </ion-title>
9
- <ion-buttons slot="end">
10
- <ion-button ion-button fill="clear" (click)="onClose()">
11
- <ion-icon slot="icon-only" name="close"></ion-icon>
12
- </ion-button>
13
- </ion-buttons>
14
14
  </ion-toolbar>
15
15
  </ion-header>
16
16
 
@@ -9,7 +9,7 @@ ion-toolbar {
9
9
  }
10
10
 
11
11
  ion-button{
12
- --color: var(--basic-blue);
12
+ --color: var(--icon-color);
13
13
  }
14
14
  }
15
15
 
@@ -18,7 +18,7 @@ ion-content {
18
18
  --overflow: hidden;
19
19
  overflow: scroll;
20
20
  &:not(.mobile){
21
- background: var(--list-bkg-color);
21
+ --background: var(--list-bkg-color);
22
22
  }
23
23
 
24
24
  &::-webkit-scrollbar {
@@ -55,6 +55,7 @@ export class ScriptService {
55
55
  let script = document.createElement('script')
56
56
  script.type = 'text/javascript';
57
57
  script.src = currentScript.src;
58
+ script.async = true
58
59
  script.onload = () => {
59
60
  currentScript.loaded = true;
60
61
  resolve({ script: name, loaded: true, status: 'Loaded' });
@@ -0,0 +1,18 @@
1
+ body.custom{
2
+ background-color: red;
3
+ --list-bkg-color: red;
4
+ }
5
+
6
+ body.light{
7
+ background-color: green;
8
+ --list-bkg-color: green;
9
+ }
10
+
11
+ body.dark{
12
+ background-color: blue;
13
+ --list-bkg-color: blue;
14
+ }
15
+
16
+ body.light .navbar{
17
+ background-color: red;
18
+ }
@@ -10,14 +10,47 @@
10
10
  <body style="height: 100%;">
11
11
  <div id="titolo">CHAT IONIC TEST PAGE</div>
12
12
 
13
+ <div class="event-wrp" id="onThemeColor">
14
+ <span class="badge">EVENT</span>
15
+ <label>themeColor </label>
16
+ <label class="switch">
17
+ <input type="checkbox" name="themeColor" onclick="onCLickThemeColor(this)">
18
+ <span class="slider round"></span>
19
+ </label>
20
+ </div>
21
+
22
+ <iframe id="myIFrame" frameBorder="0" width="100%" style="display: flex; height: 95vh" onload="onLoad()"
23
+ src="http://localhost:8080/#/conversation-detail?tiledesk_supportMode=false&jwt=JWT eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOiI1ZmQzNGU0MjQ5NjEwZTAwMzQ5ODUwNzgiLCJlbWFpbCI6ImdhYnJpZWxlLnBhbmljb0Bmcm9udGllcmUyMS5pdCIsImZpcnN0bmFtZSI6IkdhYnJpZWxlMiIsImxhc3RuYW1lIjoiUGFuaWNvIC1wcmUiLCJlbWFpbHZlcmlmaWVkIjp0cnVlLCJpYXQiOjE2OTgzMzYyMTMsImF1ZCI6Imh0dHBzOi8vdGlsZWRlc2suY29tIiwiaXNzIjoiaHR0cHM6Ly90aWxlZGVzay5jb20iLCJzdWIiOiJ1c2VyIiwianRpIjoiNjAzZGY3NDQtZWY0OS00Mjg2LWJlMWQtYWM5OGYyYTNkMTJiIn0.bof5QPQP262yCQfpeSjqyoYPkSCttg5NQFkcV8d634xzeq7wJBdhtiO7IJY6hS81a1YyXrAsxlK7RiNS-UZdYiTXR81UXurQd1fnE9jtaggB82tyNL8vmiZEOs6xh4TqO3-kkBzRxQIp74bY53fk_mu5RmNbAjIgUWEufaNDiv8"></iframe>
24
+
13
25
  <script>
14
26
  window.addEventListener('message', event => {
15
27
  console.log('[CHAT-IONIC] test page event::', event)
16
- })
17
- </script>
28
+ });
29
+
30
+ function onLoad(){
31
+ // var cssLink = document.createElement("style");
32
+ // cssLink.src = "./assets/style.css";
33
+ // // cssLink.rel = "stylesheet";
34
+ // cssLink.type = "text/css";
35
+ // console.log('framessss', frames['myIFrame'])
36
+ // frames['myIFrame'].contentWindow.document.body.appendChild(cssLink);
37
+ let msg= { action: "style", type: 'light', parameter: 'http://localhost:8080/assets/customStyle.css'}
38
+ frames['myIFrame'].contentWindow.postMessage(msg, '*');
39
+ }
18
40
 
19
- <iframe id="myIFrame" frameBorder="0" width="100%" style="display: flex; height: 95vh"
20
- src="http://localhost:8080/#/conversation-detail?jwt=JWT eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOiI1ZmQzNGU0MjQ5NjEwZTAwMzQ5ODUwNzgiLCJlbWFpbCI6ImdhYnJpZWxlLnBhbmljb0Bmcm9udGllcmUyMS5pdCIsImZpcnN0bmFtZSI6IkdhYnJpZWxlMiIsImxhc3RuYW1lIjoiUGFuaWNvIC1wcmUiLCJlbWFpbHZlcmlmaWVkIjp0cnVlLCJpYXQiOjE2OTgzMzYyMTMsImF1ZCI6Imh0dHBzOi8vdGlsZWRlc2suY29tIiwiaXNzIjoiaHR0cHM6Ly90aWxlZGVzay5jb20iLCJzdWIiOiJ1c2VyIiwianRpIjoiNjAzZGY3NDQtZWY0OS00Mjg2LWJlMWQtYWM5OGYyYTNkMTJiIn0.bof5QPQP262yCQfpeSjqyoYPkSCttg5NQFkcV8d634xzeq7wJBdhtiO7IJY6hS81a1YyXrAsxlK7RiNS-UZdYiTXR81UXurQd1fnE9jtaggB82tyNL8vmiZEOs6xh4TqO3-kkBzRxQIp74bY53fk_mu5RmNbAjIgUWEufaNDiv8"></iframe>
41
+
42
+ function onCLickThemeColor(event){
43
+ console.log('onCLickThemeColor: status-->',event.checked);
44
+ if(event.checked){
45
+ let msg= { action: "style", type: 'light', parameter: 'http://localhost:8080/assets/customStyle.css'}
46
+ frames['myIFrame'].contentWindow.postMessage(msg, '*');
47
+ }else{
48
+ let msg= { action: "style", parameter: ''}
49
+ frames['myIFrame'].contentWindow.postMessage(msg, '*');
50
+ }
51
+ }
52
+
53
+ </script>
21
54
  </body>
22
55
 
23
56
  </html>
@@ -5,6 +5,7 @@ import { UserModel } from 'src/chat21-core/models/user';
5
5
  import { avatarPlaceholder, getColorBck } from 'src/chat21-core/utils/utils-user';
6
6
  import { AppStorageService } from '../abstract/app-storage.service';
7
7
  import { LoggerInstance } from '../logger/loggerInstance';
8
+ import { BehaviorSubject } from 'rxjs';
8
9
  // import { BehaviorSubject } from 'rxjs';
9
10
  // import { EventsService } from 'src/app/services/events-service';
10
11
 
@@ -26,6 +27,8 @@ export class TiledeskAuthService {
26
27
  private currentUser: UserModel;
27
28
  private logger: LoggerService = LoggerInstance.getInstance()
28
29
 
30
+ private BS_IsONLINE: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(false)
31
+
29
32
  constructor(
30
33
  public http: HttpClient,
31
34
  public appStorage: AppStorageService,
@@ -63,8 +66,8 @@ export class TiledeskAuthService {
63
66
  if (data['success'] && data['token']) {
64
67
  that.tiledeskToken = data['token'];
65
68
  that.createCompleteUser(data['user']);
66
- // that.appStorage.setItem('tiledeskToken', that.tiledeskToken);
67
69
  this.checkAndSetInStorageTiledeskToken(that.tiledeskToken)
70
+ this.BS_IsONLINE.next(true)
68
71
  resolve(that.tiledeskToken)
69
72
  }
70
73
  }, (error) => {
@@ -93,8 +96,8 @@ export class TiledeskAuthService {
93
96
  if (data['success'] && data['token']) {
94
97
  that.tiledeskToken = data['token'];
95
98
  that.createCompleteUser(data['user']);
96
- // that.appStorage.setItem('tiledeskToken', that.tiledeskToken);
97
99
  this.checkAndSetInStorageTiledeskToken(that.tiledeskToken)
100
+ this.BS_IsONLINE.next(true)
98
101
  resolve(that.tiledeskToken)
99
102
  }
100
103
  }, (error) => {
@@ -119,9 +122,9 @@ export class TiledeskAuthService {
119
122
  if (data['success'] && data['token']) {
120
123
  that.tiledeskToken = data['token'];
121
124
  that.createCompleteUser(data['user']);
122
- // that.appStorage.setItem('tiledeskToken', that.tiledeskToken); // salvarlo esternamente nell'app.component
123
125
  this.checkAndSetInStorageTiledeskToken(that.tiledeskToken)
124
- resolve(this.currentUser)
126
+ this.BS_IsONLINE.next(true)
127
+ resolve(data)
125
128
  }
126
129
  }, (error) => {
127
130
  reject(error)
@@ -133,6 +136,8 @@ export class TiledeskAuthService {
133
136
  this.logger.log('[TILEDESK-AUTH] - LOGOUT')
134
137
  this.appStorage.removeItem('tiledeskToken')
135
138
  this.appStorage.removeItem('currentUser')
139
+ localStorage.removeItem('tiledesk_token')
140
+ this.BS_IsONLINE.next(false)
136
141
  this.setCurrentUser(null);
137
142
  // this.isOnline$.next(false)
138
143
  const stored_project = localStorage.getItem('last_project')
@@ -180,19 +185,28 @@ export class TiledeskAuthService {
180
185
 
181
186
  private checkAndSetInStorageTiledeskToken(tiledeskToken) {
182
187
  this.logger.log('[TILEDESK-AUTH] - checkAndSetInStorageTiledeskToken tiledeskToken from request', tiledeskToken)
183
- const storedTiledeskToken = this.appStorage.getItem('tiledeskToken');
188
+ const storedTiledeskToken = localStorage.getItem('tiledesk_token');
184
189
  this.logger.log('[TILEDESK-AUTH] - checkAndSetInStorageTiledeskToken storedTiledeskToken ', storedTiledeskToken)
185
190
  if (!storedTiledeskToken) {
186
191
  this.logger.log('[TILEDESK-AUTH] - checkAndSetInStorageTiledeskToken TOKEN DOES NOT EXIST - RUN SET ')
187
- this.appStorage.setItem('tiledeskToken', tiledeskToken);
192
+ localStorage.setItem('tiledesk_token', tiledeskToken)
188
193
  } else if (storedTiledeskToken && storedTiledeskToken !== tiledeskToken) {
189
194
  this.logger.log('[TILEDESK-AUTH] - checkAndSetInStorageTiledeskToken STORED-TOKEN EXIST BUT IS != FROM TOKEN - RUN SET ')
190
- this.appStorage.setItem('tiledeskToken', tiledeskToken);
195
+ localStorage.setItem('tiledesk_token', tiledeskToken)
191
196
  } else if (storedTiledeskToken && storedTiledeskToken === tiledeskToken) {
192
197
  this.logger.log('[TILEDESK-AUTH] - checkAndSetInStorageTiledeskToken STORED-TOKEN EXIST AND IS = TO TOKEN ')
193
198
  }
199
+ this.appStorage.setItem('tiledeskToken', tiledeskToken)
194
200
  }
195
201
 
202
+ isLoggedIn(): Promise<boolean>{
203
+ return new Promise<boolean>((resolve, reject)=> {
204
+ this.BS_IsONLINE.subscribe((status)=> {
205
+ if(status)
206
+ resolve(true)
207
+ })
208
+ })
209
+ }
196
210
 
197
211
  getCurrentUser(): UserModel {
198
212
  return this.currentUser;