@chat21/chat21-ionic 3.0.59 → 3.0.60-rc8
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 +50 -1
- package/deploy_pre.sh +45 -6
- package/deploy_prod.sh +34 -9
- package/env.sample +1 -1
- package/package.json +1 -1
- package/src/app/app.component.ts +51 -50
- package/src/app/app.module.ts +2 -2
- package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.ts +62 -36
- package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.html +1 -1
- package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.ts +42 -13
- package/src/app/components/conversation-detail/message-text-area/message-text-area.component.html +64 -39
- package/src/app/components/conversation-detail/message-text-area/message-text-area.component.scss +50 -2
- package/src/app/components/conversation-detail/message-text-area/message-text-area.component.ts +80 -94
- package/src/app/components/image-viewer/image-viewer.component.scss +2 -2
- package/src/app/components/project-item/project-item.component.html +140 -118
- package/src/app/components/project-item/project-item.component.scss +145 -83
- package/src/app/components/project-item/project-item.component.ts +67 -26
- package/src/app/pages/conversation-detail/conversation-detail.module.ts +3 -1
- package/src/app/pages/conversation-detail/conversation-detail.page.html +9 -3
- package/src/app/pages/conversation-detail/conversation-detail.page.ts +201 -86
- package/src/app/pages/conversations-list/conversations-list.page.html +11 -5
- package/src/app/pages/conversations-list/conversations-list.page.scss +12 -1
- package/src/app/pages/conversations-list/conversations-list.page.ts +27 -7
- package/src/app/pages/unassigned-conversations/unassigned-conversations.page.html +16 -11
- package/src/app/pages/unassigned-conversations/unassigned-conversations.page.scss +157 -63
- package/src/app/pages/unassigned-conversations/unassigned-conversations.page.ts +51 -16
- package/src/app/services/app-config.ts +14 -14
- package/src/app/services/websocket/websocket-js.ts +7 -4
- package/src/app/services/websocket/websocket.service.ts +1 -1
- package/src/app/shared/shared.module.ts +8 -7
- package/src/assets/i18n/de.json +208 -0
- package/src/assets/i18n/en.json +24 -7
- package/src/assets/i18n/es.json +208 -0
- package/src/assets/i18n/fr.json +208 -0
- package/src/assets/i18n/it.json +42 -33
- package/src/assets/i18n/pt.json +208 -0
- package/src/assets/i18n/ru.json +208 -0
- package/src/assets/i18n/tr.json +208 -0
- package/src/assets/js/chat21client.js +16 -3
- package/src/chat-config-mqtt.json +2 -1
- package/src/chat-config-pre-test.json +2 -0
- package/src/chat-config-template.json +1 -0
- package/src/chat-config.json +1 -0
- package/src/chat21-core/providers/firebase/firebase-conversation-handler.ts +54 -43
- package/src/chat21-core/providers/firebase/firebase-conversations-handler.ts +23 -0
- package/src/chat21-core/providers/mqtt/mqtt-archivedconversations-handler.ts +1 -1
- package/src/chat21-core/utils/constants.ts +2 -0
- package/src/chat21-core/utils/utils.ts +12 -1
- package/src/global.scss +4 -0
|
@@ -36,12 +36,16 @@
|
|
|
36
36
|
</ion-avatar>
|
|
37
37
|
<ion-label part="message-text" class="waiting-for-network-msg"> Waiting for network</ion-label>
|
|
38
38
|
</ion-item>
|
|
39
|
-
|
|
40
|
-
<ion-item *ngIf="supportMode && displayNewConvsItem" class="ion-no-padding open-iframe-item"
|
|
41
|
-
button="true"
|
|
42
|
-
(click)="openUnsevedConversationIframe()">
|
|
39
|
+
<!-- button="true" (click)="openUnsevedConversationIframe()" -->
|
|
40
|
+
<ion-item *ngIf="supportMode && displayNewConvsItem" class="ion-no-padding open-iframe-item">
|
|
43
41
|
<div tabindex="0"></div>
|
|
44
|
-
<
|
|
42
|
+
<!-- <ion-note class="pinned-project">
|
|
43
|
+
{{ 'PINNED_PROJECT' | translate }}
|
|
44
|
+
</ion-note> -->
|
|
45
|
+
|
|
46
|
+
<app-project-item style="width: 100%;"
|
|
47
|
+
(openUnsevedConvsEvent)="openUnsevedConversationIframe($event)"
|
|
48
|
+
(projectIdEvent)="getLastProjectId($event)"></app-project-item>
|
|
45
49
|
</ion-item>
|
|
46
50
|
|
|
47
51
|
<span
|
|
@@ -102,6 +106,8 @@
|
|
|
102
106
|
<ion-item id="no-convs" class="ion-text-center" lines="none">
|
|
103
107
|
<ion-label class="ion-text-wrap" color="medium">
|
|
104
108
|
{{ 'LABEL_MSG_PUSH_START_CHAT' | translate }}
|
|
109
|
+
|
|
110
|
+
|
|
105
111
|
</ion-label>
|
|
106
112
|
</ion-item>
|
|
107
113
|
</div>
|
|
@@ -297,6 +297,17 @@ ion-list {
|
|
|
297
297
|
.open-iframe-item {
|
|
298
298
|
padding-left: 0px !important ;
|
|
299
299
|
padding-right: 0px !important;
|
|
300
|
-
height: 55px !important;
|
|
300
|
+
// height: 55px !important;
|
|
301
301
|
border-bottom: 1px solid rgba(0, 0, 0, 0.05);
|
|
302
|
+
--background-hover: #ffffff;
|
|
303
|
+
cursor:default !important;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
.pinned-project {
|
|
307
|
+
|
|
308
|
+
color: #3880ff;
|
|
309
|
+
position: absolute;
|
|
310
|
+
right: 8px;
|
|
311
|
+
top: 2px;
|
|
312
|
+
// font-size: 12px !important;
|
|
302
313
|
}
|
|
@@ -72,6 +72,8 @@ export class ConversationListPage implements OnInit {
|
|
|
72
72
|
subscription: Subscription;
|
|
73
73
|
|
|
74
74
|
public UNASSIGNED_CONVS_URL: any;
|
|
75
|
+
public PROJECTS_FOR_PANEL_URL: any;
|
|
76
|
+
public IFRAME_URL: any;
|
|
75
77
|
public hasClickedOpenUnservedConvIframe: boolean = false;
|
|
76
78
|
public lastProjectId: string;
|
|
77
79
|
public isOnline: boolean = true;
|
|
@@ -239,24 +241,40 @@ export class ConversationListPage implements OnInit {
|
|
|
239
241
|
this.lastProjectId = projectid;
|
|
240
242
|
}
|
|
241
243
|
|
|
242
|
-
openUnsevedConversationIframe() {
|
|
244
|
+
openUnsevedConversationIframe(event) {
|
|
245
|
+
this.logger.log('[CONVS-LIST-PAGE] openUnsevedConversationIframe ', event)
|
|
243
246
|
this.hasClickedOpenUnservedConvIframe = true
|
|
244
247
|
this.logger.log('[CONVS-LIST-PAGE] - HAS CLIKED OPEN UNSERVED REQUEST IFRAME', this.hasClickedOpenUnservedConvIframe);
|
|
245
248
|
const DASHBOARD_BASE_URL = this.appConfigProvider.getConfig().dashboardUrl;
|
|
249
|
+
// http://localhost:4204/#/projects-for-panel
|
|
250
|
+
this.PROJECTS_FOR_PANEL_URL = DASHBOARD_BASE_URL + '#/projects-for-panel';
|
|
246
251
|
this.UNASSIGNED_CONVS_URL = DASHBOARD_BASE_URL + '#/project/' + this.lastProjectId + '/unserved-request-for-panel';
|
|
252
|
+
|
|
253
|
+
if (event === 'pinbtn') {
|
|
254
|
+
this.IFRAME_URL = this.PROJECTS_FOR_PANEL_URL
|
|
255
|
+
} else {
|
|
256
|
+
this.IFRAME_URL = this.UNASSIGNED_CONVS_URL
|
|
257
|
+
}
|
|
258
|
+
|
|
247
259
|
this.logger.log('[CONVS-LIST-PAGE] - HAS CLIKED OPEN UNSERVED REQUEST IFRAME > UNASSIGNED CONVS URL', this.UNASSIGNED_CONVS_URL);
|
|
248
|
-
this.openUnassignedConversations(this.
|
|
260
|
+
this.openUnassignedConversations(this.IFRAME_URL, event)
|
|
249
261
|
}
|
|
250
262
|
|
|
251
263
|
// ---------------------------------------------------------
|
|
252
264
|
// Opens the Unassigned Conversations iframe
|
|
253
265
|
// ---------------------------------------------------------
|
|
254
|
-
openUnassignedConversations(
|
|
255
|
-
|
|
266
|
+
openUnassignedConversations(IFRAME_URL: string, event) {
|
|
256
267
|
if (checkPlatformIsMobile()) {
|
|
257
|
-
presentModal(this.modalController, UnassignedConversationsPage, {
|
|
268
|
+
presentModal(this.modalController, UnassignedConversationsPage, {
|
|
269
|
+
iframe_URL: IFRAME_URL,
|
|
270
|
+
callerBtn: event
|
|
271
|
+
});
|
|
258
272
|
} else {
|
|
259
|
-
this.navService.push(UnassignedConversationsPage, {
|
|
273
|
+
this.navService.push(UnassignedConversationsPage, {
|
|
274
|
+
iframe_URL: IFRAME_URL,
|
|
275
|
+
callerBtn: event
|
|
276
|
+
|
|
277
|
+
});
|
|
260
278
|
}
|
|
261
279
|
}
|
|
262
280
|
|
|
@@ -597,7 +615,9 @@ export class ConversationListPage implements OnInit {
|
|
|
597
615
|
this.tenant = appconfig.firebaseConfig.tenant;
|
|
598
616
|
this.logger.log('[CONVS-LIST-PAGE] - initialize -> firebaseConfig tenant ', this.tenant);
|
|
599
617
|
|
|
600
|
-
|
|
618
|
+
if (this.tiledeskAuthService.getCurrentUser()) {
|
|
619
|
+
this.loggedUserUid = this.tiledeskAuthService.getCurrentUser().uid;
|
|
620
|
+
}
|
|
601
621
|
this.subscriptions = [];
|
|
602
622
|
this.initConversationsHandler();
|
|
603
623
|
this.initVariables();
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
<ion-header>
|
|
2
2
|
<ion-toolbar>
|
|
3
|
-
<ion-title
|
|
3
|
+
<ion-title *ngIf="callerBtn !== 'pinbtn'" style="font-size: 16px;">
|
|
4
|
+
{{translationMap?.get('UnassignedConversations') }}
|
|
5
|
+
</ion-title>
|
|
6
|
+
<ion-title *ngIf="callerBtn === 'pinbtn'" style="font-size: 16px;">
|
|
7
|
+
{{translationMap?.get('PIN_A_PROJECT') }}
|
|
8
|
+
</ion-title>
|
|
4
9
|
<ion-buttons slot="end">
|
|
5
10
|
<ion-button ion-button fill="clear" (click)="onClose()">
|
|
6
11
|
<ion-icon slot="icon-only" name="close"></ion-icon>
|
|
@@ -9,14 +14,14 @@
|
|
|
9
14
|
</ion-toolbar>
|
|
10
15
|
</ion-header>
|
|
11
16
|
|
|
12
|
-
<ion-content overflow-scroll="true" id="iframe-ion-content"
|
|
13
|
-
[ngClass]="{'ion-content-black-background' : isProjectsForPanel === true}">
|
|
17
|
+
<ion-content overflow-scroll="true" id="iframe-ion-content"
|
|
18
|
+
[ngClass]="{'ion-content-black-background' : isProjectsForPanel === true}">
|
|
14
19
|
<!-- <iframe id="i_frame" style="width:100%; height:99%" frameBorder="0" allowfullscreen [src]="unassigned_convs_url_sanitized"></iframe> -->
|
|
15
|
-
|
|
16
|
-
<div class="
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
</div>
|
|
22
|
-
</ion-content>
|
|
20
|
+
<div class="loader-spinner-wpr">
|
|
21
|
+
<div id="loader" class="loader">
|
|
22
|
+
<svg class="circular" viewBox="25 25 50 50">
|
|
23
|
+
<circle class="path" cx="50" cy="50" r="20" fill="none" stroke-width="2" stroke-miterlimit="10" />
|
|
24
|
+
</svg>
|
|
25
|
+
</div>
|
|
26
|
+
</div>
|
|
27
|
+
</ion-content>
|
|
@@ -1,79 +1,173 @@
|
|
|
1
1
|
.ion-content-black-background {
|
|
2
|
-
--background: #2d323e
|
|
2
|
+
--background: #2d323e;
|
|
3
3
|
}
|
|
4
4
|
|
|
5
5
|
// -------------------------------------------------
|
|
6
6
|
// stretch spinner https://tobiasahlin.com/spinkit/
|
|
7
7
|
// -------------------------------------------------
|
|
8
8
|
.stretchspinner-unassigned-convs {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
9
|
+
// margin: 100px auto;
|
|
10
|
+
width: 50px;
|
|
11
|
+
height: 40px;
|
|
12
|
+
text-align: center;
|
|
13
|
+
font-size: 10px;
|
|
14
|
+
position: absolute;
|
|
15
|
+
margin: auto;
|
|
16
|
+
top: 0;
|
|
17
|
+
left: 0;
|
|
18
|
+
bottom: 0;
|
|
19
|
+
right: 0;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.stretchspinner-unassigned-convs > div {
|
|
23
|
+
background-color: #3ea9f5;
|
|
24
|
+
height: 100%;
|
|
25
|
+
width: 6px;
|
|
26
|
+
display: inline-block;
|
|
27
|
+
|
|
28
|
+
-webkit-animation: sk-stretchdelay 1.2s infinite ease-in-out;
|
|
29
|
+
animation: sk-stretchdelay 1.2s infinite ease-in-out;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.stretchspinner-unassigned-convs .rect2 {
|
|
33
|
+
-webkit-animation-delay: -1.1s;
|
|
34
|
+
animation-delay: -1.1s;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.stretchspinner-unassigned-convs .rect3 {
|
|
38
|
+
-webkit-animation-delay: -1s;
|
|
39
|
+
animation-delay: -1s;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.stretchspinner-unassigned-convs .rect4 {
|
|
43
|
+
-webkit-animation-delay: -0.9s;
|
|
44
|
+
animation-delay: -0.9s;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.stretchspinner-unassigned-convs .rect5 {
|
|
48
|
+
-webkit-animation-delay: -0.8s;
|
|
49
|
+
animation-delay: -0.8s;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
@-webkit-keyframes sk-stretchdelay {
|
|
53
|
+
0%,
|
|
54
|
+
40%,
|
|
55
|
+
100% {
|
|
56
|
+
-webkit-transform: scaleY(0.4);
|
|
57
|
+
}
|
|
58
|
+
20% {
|
|
59
|
+
-webkit-transform: scaleY(1);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
@keyframes sk-stretchdelay {
|
|
64
|
+
0%,
|
|
65
|
+
40%,
|
|
66
|
+
100% {
|
|
67
|
+
transform: scaleY(0.4);
|
|
68
|
+
-webkit-transform: scaleY(0.4);
|
|
69
|
+
}
|
|
70
|
+
20% {
|
|
71
|
+
transform: scaleY(1);
|
|
72
|
+
-webkit-transform: scaleY(1);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// -------------------------------------------------
|
|
77
|
+
// Loader as in dashboard
|
|
78
|
+
// -------------------------------------------------
|
|
79
|
+
.loader {
|
|
80
|
+
margin: 0 auto;
|
|
81
|
+
width: 60px;
|
|
82
|
+
position: absolute;
|
|
83
|
+
display: block;
|
|
84
|
+
left: 0;
|
|
85
|
+
right: 0;
|
|
86
|
+
z-index: 1;
|
|
87
|
+
// @include transform-translate-y(-50%);
|
|
88
|
+
-webkit-transform: translateY(-50%);
|
|
89
|
+
-moz-transform: translateY(-50%);
|
|
90
|
+
-ms-transform: translateY(-50%);
|
|
91
|
+
transform: translateY(-50%);
|
|
92
|
+
text-align: center;
|
|
93
|
+
top: 50%;
|
|
94
|
+
|
|
95
|
+
&:before {
|
|
96
|
+
content: "";
|
|
97
|
+
display: block;
|
|
98
|
+
padding-top: 100%;
|
|
20
99
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.circular {
|
|
103
|
+
animation: rotate 2s linear infinite;
|
|
104
|
+
height: 100%;
|
|
105
|
+
transform-origin: center center;
|
|
106
|
+
width: 100%;
|
|
107
|
+
position: absolute;
|
|
108
|
+
top: 0;
|
|
109
|
+
bottom: 0;
|
|
110
|
+
left: 0;
|
|
111
|
+
right: 0;
|
|
112
|
+
margin: auto;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.path {
|
|
116
|
+
stroke-dasharray: 1, 200;
|
|
117
|
+
stroke-dashoffset: 0;
|
|
118
|
+
animation: dash 1.5s ease-in-out infinite, color 2s ease-in-out infinite;
|
|
119
|
+
stroke-linecap: round;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
@keyframes rotate {
|
|
123
|
+
100% {
|
|
124
|
+
transform: rotate(360deg);
|
|
30
125
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
@keyframes dash {
|
|
129
|
+
0% {
|
|
130
|
+
stroke-dasharray: 1, 200;
|
|
131
|
+
stroke-dashoffset: 0;
|
|
35
132
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
-
|
|
39
|
-
animation-delay: -1s;
|
|
133
|
+
50% {
|
|
134
|
+
stroke-dasharray: 89, 200;
|
|
135
|
+
stroke-dashoffset: -35px;
|
|
40
136
|
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
-
|
|
44
|
-
animation-delay: -0.9s;
|
|
137
|
+
100% {
|
|
138
|
+
stroke-dasharray: 89, 200;
|
|
139
|
+
stroke-dashoffset: -124px;
|
|
45
140
|
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
@keyframes color {
|
|
144
|
+
100%,
|
|
145
|
+
0% {
|
|
146
|
+
stroke: #3ea9f5;
|
|
50
147
|
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
0%,
|
|
54
|
-
40%,
|
|
55
|
-
100% {
|
|
56
|
-
-webkit-transform: scaleY(0.4);
|
|
57
|
-
}
|
|
58
|
-
20% {
|
|
59
|
-
-webkit-transform: scaleY(1);
|
|
60
|
-
}
|
|
148
|
+
50% {
|
|
149
|
+
stroke: #ff5722;
|
|
61
150
|
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
0%,
|
|
65
|
-
40%,
|
|
66
|
-
100% {
|
|
67
|
-
transform: scaleY(0.4);
|
|
68
|
-
-webkit-transform: scaleY(0.4);
|
|
69
|
-
}
|
|
70
|
-
20% {
|
|
71
|
-
transform: scaleY(1);
|
|
72
|
-
-webkit-transform: scaleY(1);
|
|
73
|
-
}
|
|
151
|
+
100% {
|
|
152
|
+
stroke: #3ea9f5;
|
|
74
153
|
}
|
|
75
|
-
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
// -------------------------------------
|
|
157
|
+
// Loader spinner wpr
|
|
158
|
+
// -------------------------------------
|
|
159
|
+
.loader-spinner-wpr {
|
|
160
|
+
text-align: center;
|
|
161
|
+
// font-size: 10px;
|
|
162
|
+
position: absolute;
|
|
163
|
+
margin: auto;
|
|
164
|
+
top: 0;
|
|
165
|
+
left: 0;
|
|
166
|
+
bottom: 0;
|
|
167
|
+
right: 0;
|
|
168
|
+
background: #fff;
|
|
169
|
+
}
|
|
76
170
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
171
|
+
.hide-stretchspinner {
|
|
172
|
+
display: none;
|
|
173
|
+
}
|
|
@@ -14,8 +14,12 @@ import { CustomTranslateService } from 'src/chat21-core/providers/custom-transla
|
|
|
14
14
|
})
|
|
15
15
|
export class UnassignedConversationsPage implements OnInit {
|
|
16
16
|
|
|
17
|
-
@Input()
|
|
18
|
-
|
|
17
|
+
@Input() iframe_URL: any;
|
|
18
|
+
@Input() callerBtn: string;
|
|
19
|
+
// @Input() prjctsxpanel_url: any;
|
|
20
|
+
// @Input() unassigned_convs_url: any;
|
|
21
|
+
|
|
22
|
+
iframe_url_sanitized: any;
|
|
19
23
|
private logger: LoggerService = LoggerInstance.getInstance();
|
|
20
24
|
// has_loaded: boolean;
|
|
21
25
|
ion_content: any;
|
|
@@ -32,7 +36,11 @@ export class UnassignedConversationsPage implements OnInit {
|
|
|
32
36
|
) { }
|
|
33
37
|
|
|
34
38
|
ngOnInit() {
|
|
35
|
-
const keys = [
|
|
39
|
+
const keys = [
|
|
40
|
+
'UnassignedConversations',
|
|
41
|
+
'NewConversations',
|
|
42
|
+
'PIN_A_PROJECT'
|
|
43
|
+
];
|
|
36
44
|
this.translationMap = this.translateService.translateLanguage(keys);
|
|
37
45
|
this.buildIFRAME();
|
|
38
46
|
this.listenToPostMsg();
|
|
@@ -47,14 +55,16 @@ export class UnassignedConversationsPage implements OnInit {
|
|
|
47
55
|
}
|
|
48
56
|
|
|
49
57
|
buildIFRAME() {
|
|
50
|
-
this.logger.log('[UNASSIGNED-CONVS-PAGE] -
|
|
51
|
-
this.
|
|
52
|
-
|
|
58
|
+
this.logger.log('[UNASSIGNED-CONVS-PAGE] - iframe_URL (ngOnInit)', this.iframe_URL);
|
|
59
|
+
this.logger.log('[UNASSIGNED-CONVS-PAGE] - callerBtn (ngOnInit)', this.callerBtn);
|
|
60
|
+
|
|
61
|
+
this.iframe_url_sanitized = this.sanitizer.sanitize(SecurityContext.URL, this.iframe_URL)
|
|
62
|
+
this.logger.log('[UNASSIGNED-CONVS-PAGE] - UNASSIGNED CONVS URL SANITIZED (ngOnInit)', this.iframe_url_sanitized);
|
|
53
63
|
// this.has_loaded = false
|
|
54
64
|
|
|
55
65
|
this.ion_content = document.getElementById("iframe-ion-content");
|
|
56
66
|
this.iframe = document.createElement("iframe");
|
|
57
|
-
this.iframe.src = this.
|
|
67
|
+
this.iframe.src = this.iframe_url_sanitized;
|
|
58
68
|
this.iframe.width = "100%";
|
|
59
69
|
this.iframe.height = "99%";
|
|
60
70
|
this.iframe.id = "unassigned-convs-iframe"
|
|
@@ -63,23 +73,35 @@ export class UnassignedConversationsPage implements OnInit {
|
|
|
63
73
|
this.iframe.style.background = "white";
|
|
64
74
|
this.ion_content.appendChild(this.iframe);
|
|
65
75
|
|
|
66
|
-
|
|
76
|
+
this.getIframeHaLoaded()
|
|
77
|
+
|
|
67
78
|
}
|
|
68
79
|
|
|
69
80
|
getIframeHaLoaded() {
|
|
70
81
|
var self = this;
|
|
71
|
-
var
|
|
72
|
-
this.logger.log('[
|
|
73
|
-
if (
|
|
74
|
-
|
|
75
|
-
self.logger.log("[
|
|
76
|
-
|
|
82
|
+
var iframeWin = document.getElementById('unassigned-convs-iframe') as HTMLIFrameElement;;
|
|
83
|
+
this.logger.log('[UNASSIGNED-CONVS-PAGE] GET iframe ', iframeWin)
|
|
84
|
+
if (iframeWin) {
|
|
85
|
+
iframeWin.addEventListener("load", function () {
|
|
86
|
+
self.logger.log("[UNASSIGNED-CONVS-PAGE] GET - Finish");
|
|
87
|
+
|
|
88
|
+
const isIFrame = (input: HTMLElement | null): input is HTMLIFrameElement =>
|
|
89
|
+
input !== null && input.tagName === 'IFRAME';
|
|
90
|
+
|
|
91
|
+
if (isIFrame(iframeWin) && iframeWin.contentWindow) {
|
|
92
|
+
const msg = { action: "hidewidget", calledBy: 'unassigned-convs' }
|
|
93
|
+
iframeWin.contentWindow.postMessage(msg, '*');
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
let spinnerElem = <HTMLElement>document.querySelector('.loader-spinner-wpr')
|
|
77
98
|
|
|
78
99
|
self.logger.log('[APP-STORE-INSTALL] GET iframeDoc readyState spinnerElem', spinnerElem)
|
|
79
100
|
spinnerElem.classList.add("hide-stretchspinner")
|
|
80
101
|
|
|
81
102
|
});
|
|
82
103
|
}
|
|
104
|
+
|
|
83
105
|
}
|
|
84
106
|
|
|
85
107
|
listenToPostMsg() {
|
|
@@ -94,18 +116,31 @@ export class UnassignedConversationsPage implements OnInit {
|
|
|
94
116
|
this.isProjectsForPanel = false;
|
|
95
117
|
}
|
|
96
118
|
}
|
|
119
|
+
|
|
120
|
+
if (event.data === 'hasChangedProject') {
|
|
121
|
+
this.closemodal()
|
|
122
|
+
}
|
|
97
123
|
});
|
|
98
124
|
}
|
|
99
125
|
|
|
126
|
+
public async closemodal() {
|
|
127
|
+
// const modal = await this.modalController.getTop();
|
|
128
|
+
// modal.dismiss({
|
|
129
|
+
// confirmed: true
|
|
130
|
+
// });
|
|
131
|
+
// await this.modalController.dismiss({ confirmed: true });
|
|
132
|
+
this.onClose()
|
|
133
|
+
|
|
134
|
+
}
|
|
135
|
+
|
|
100
136
|
|
|
101
137
|
async onClose() {
|
|
102
138
|
this.logger.log('[UNASSIGNED-CONVS-PAGE] - onClose MODAL')
|
|
103
139
|
this.logger.log('[UNASSIGNED-CONVS-PAGE] - onClose MODAL isModalOpened ', await this.modalController.getTop())
|
|
104
140
|
const isModalOpened = await this.modalController.getTop();
|
|
105
|
-
|
|
141
|
+
this.logger.log('[UNASSIGNED-CONVS-PAGE] - onClose MODAL isModalOpened ', isModalOpened)
|
|
106
142
|
if (isModalOpened) {
|
|
107
143
|
this.modalController.dismiss({
|
|
108
|
-
|
|
109
144
|
confirmed: true
|
|
110
145
|
});
|
|
111
146
|
} else {
|
|
@@ -29,9 +29,9 @@ export class AppConfigProvider {
|
|
|
29
29
|
|
|
30
30
|
|
|
31
31
|
return this.http.get(this.appConfig.remoteConfigUrl)
|
|
32
|
-
.toPromise().then((data: any
|
|
32
|
+
.toPromise().then((data: any) => {
|
|
33
33
|
// console.log('AppConfigService loadAppConfig data: ', data);
|
|
34
|
-
|
|
34
|
+
|
|
35
35
|
const allconfig = data
|
|
36
36
|
// console.log('[APP-CONFIG-SERVICE] - loadAppConfig allconfig: ', allconfig);
|
|
37
37
|
|
|
@@ -59,22 +59,22 @@ export class AppConfigProvider {
|
|
|
59
59
|
|
|
60
60
|
// // console.log('AppConfigService loadAppConfig allconfig !!!! exist - SERVER_BASE_URL protocol is HTTPS - wsUrl', ws_url);
|
|
61
61
|
// } else {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
// console.log('AppConfigService loadAppConfig allconfig !!!! exist - SERVER_BASE_URL !!! IS RELATIVE - window.location ', window.location);
|
|
65
62
|
|
|
66
|
-
// console.log(window.location)
|
|
67
63
|
|
|
68
|
-
|
|
69
|
-
|
|
64
|
+
// console.log('AppConfigService loadAppConfig allconfig !!!! exist - SERVER_BASE_URL !!! IS RELATIVE - window.location ', window.location);
|
|
65
|
+
|
|
66
|
+
// console.log(window.location)
|
|
70
67
|
|
|
71
|
-
|
|
68
|
+
if (window.location.protocol === 'http:') {
|
|
69
|
+
allconfig.wsUrl = 'ws://' + window.location.hostname + ':' + window.location.port + allconfig.wsUrlRel
|
|
72
70
|
|
|
73
|
-
|
|
74
|
-
} else {
|
|
71
|
+
} else if (window.location.protocol === 'https:') {
|
|
75
72
|
|
|
76
|
-
|
|
77
|
-
|
|
73
|
+
allconfig.wsUrl = 'wss://' + window.location.hostname + ':' + window.location.port + allconfig.wsUrlRel
|
|
74
|
+
} else {
|
|
75
|
+
|
|
76
|
+
allconfig.wsUrl = 'ws://' + window.location.hostname + ':' + window.location.port + allconfig.wsUrlRel
|
|
77
|
+
}
|
|
78
78
|
// }
|
|
79
79
|
|
|
80
80
|
} else {
|
|
@@ -87,7 +87,7 @@ export class AppConfigProvider {
|
|
|
87
87
|
}
|
|
88
88
|
|
|
89
89
|
this.appConfig = allconfig;
|
|
90
|
-
|
|
90
|
+
|
|
91
91
|
|
|
92
92
|
}).catch(err => {
|
|
93
93
|
console.error('error loadAppConfig' + err);
|
|
@@ -88,7 +88,7 @@ export class WebSocketJs {
|
|
|
88
88
|
// this.ws = new WebSocket("wss://tiledesk-server-pre.herokuapp.com/?token=JWT eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOiI1ZGRkMzBiZmYwMTk1ZjAwMTdmNzJjNmQiLCJlbWFpbCI6InByZWdpbm9AZjIxdGVzdC5pdCIsImZpcnN0bmFtZSI6Ikdpbm8iLCJsYXN0bmFtZSI6IlByZSIsImVtYWlsdmVyaWZpZWQiOnRydWUsImlhdCI6MTYwODgwNjY0MCwiYXVkIjoiaHR0cHM6Ly90aWxlZGVzay5jb20iLCJpc3MiOiJodHRwczovL3RpbGVkZXNrLmNvbSIsInN1YiI6InVzZXIiLCJqdGkiOiI1YmVmMDcxYy00ODBlLTQzYzQtOTRhYS05ZjQxYzMyNDcxMGQifQ.wv6uBn2P6H9wGb5WCYQkpPEScMU9PB1pBUzFouhJk20");
|
|
89
89
|
|
|
90
90
|
this.logger.log('[WEBSOCKET-JS] - REF - READY STATE ≠ 1 > OPEN WS AND THEN SUBSCRIBE TO TOPICS');
|
|
91
|
-
|
|
91
|
+
this.logger.log('% »»» WebSocketJs WF *** REF *** WS 2 ', this.ws);
|
|
92
92
|
|
|
93
93
|
var that = this;
|
|
94
94
|
if (this.ws) {
|
|
@@ -96,6 +96,9 @@ export class WebSocketJs {
|
|
|
96
96
|
that.logger.log('[WEBSOCKET-JS] - REF - OPEN EVENT *** ', event);
|
|
97
97
|
that.subscribe(topic);
|
|
98
98
|
});
|
|
99
|
+
} else {
|
|
100
|
+
|
|
101
|
+
|
|
99
102
|
}
|
|
100
103
|
|
|
101
104
|
if (this.topics.indexOf(topic) === -1) {
|
|
@@ -277,7 +280,7 @@ export class WebSocketJs {
|
|
|
277
280
|
// onmessage Ottieni il battito cardiaco restituito per indicare che la connessione è normale
|
|
278
281
|
if (this.ws && this.ws.readyState == 1) {
|
|
279
282
|
|
|
280
|
-
|
|
283
|
+
this.logger.log("[WEBSOCKET-JS] - HEART-START - SEND PING-MSG");
|
|
281
284
|
|
|
282
285
|
this.send(JSON.stringify(this.pingMsg), 'HEART-START')
|
|
283
286
|
|
|
@@ -289,7 +292,7 @@ export class WebSocketJs {
|
|
|
289
292
|
|
|
290
293
|
// Se non viene ripristinato dopo un determinato periodo di tempo, il backend viene attivamente disconnesso
|
|
291
294
|
this.pongTimeoutId = setTimeout(() => {
|
|
292
|
-
|
|
295
|
+
this.logger.log("[WEBSOCKET-JS] - HEART-START - PONG-TIMEOUT-ID - CLOSE WS ");
|
|
293
296
|
// se onclose Si esibirà reconnect,Eseguiamo ws.close() Bene, se lo esegui direttamente reconnect Si innescherà onclose Causa riconnessione due volte
|
|
294
297
|
this.ws.close();
|
|
295
298
|
}, this.pongTimeout);
|
|
@@ -326,7 +329,7 @@ export class WebSocketJs {
|
|
|
326
329
|
// this.sendingMessages = [];//new Map();
|
|
327
330
|
// this.data = [];
|
|
328
331
|
// this.init(this.sendMesagesInSendingArray);
|
|
329
|
-
|
|
332
|
+
this.logger.log("[WEBSOCKET-JS] - CALLING INIT - url ", this.url);
|
|
330
333
|
this.logger.log("[WEBSOCKET-JS] - CALLING INIT - topics ", this.topics);
|
|
331
334
|
this.logger.log("[WEBSOCKET-JS] - CALLING INIT - url ", this.url);
|
|
332
335
|
this.logger.log("[WEBSOCKET-JS] - CALLING INIT - callbacks ", this.callbacks);
|
|
@@ -35,7 +35,7 @@ export class WebsocketService {
|
|
|
35
35
|
subscriptionToWsCurrentProjectUserAvailability(projectid, prjctuserid) {
|
|
36
36
|
var self = this;
|
|
37
37
|
const path = '/' + projectid + '/project_users/' + prjctuserid
|
|
38
|
-
|
|
38
|
+
// console.log('[WS-SERV] - SUBSCR (REF) TO WS CURRENT USERS PATH: ', path);
|
|
39
39
|
|
|
40
40
|
return new Promise(function (resolve, reject) {
|
|
41
41
|
|