@chat21/chat21-ionic 3.0.107-rc.5 → 3.0.107-rc.8
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 +11 -1
- package/package.json +1 -1
- package/src/app/app.component.ts +29 -3
- package/src/app/components/conversation-info/info-support-group/info-support-group.component.ts +6 -6
- package/src/app/pages/conversation-detail/conversation-detail.page.ts +0 -1
- package/src/app/pages/unassigned-conversations/unassigned-conversations.page.ts +48 -1
- package/src/assets/customStyle.css +22 -1
- package/src/assets/images/channel_icons/form-logo_v2.svg +1 -6
- package/src/assets/test.html +5 -4
- package/src/chat21-core/providers/firebase/firebase-conversations-handler.ts +1 -0
- package/src/chat21-core/providers/mqtt/mqtt-conversations-handler.ts +2 -1
- package/src/chat21-core/providers/native/native-upload-service.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,22 @@
|
|
|
1
1
|
# chat21-ionic ver 3.0
|
|
2
2
|
|
|
3
|
+
### 3.0.107.rc.8
|
|
4
|
+
- bug-fixed: form icon into conversation-list and header conversation-detail not change color
|
|
5
|
+
|
|
6
|
+
### 3.0.107.rc.7
|
|
7
|
+
- bug-fixed: unassigned-convs not laoded custom external style via postMessage or event.subscribe methods
|
|
8
|
+
- bug-fixed: delete all old css class style while uploading (via postMessge) a new class
|
|
9
|
+
- bug-fixed: customStyle removed if refresh page or window.resize event is handled --> restore saved style from storage
|
|
10
|
+
|
|
11
|
+
### 3.0.107.rc.6
|
|
12
|
+
- bug-fixed: set is_new=false before archive an active conversation (not show not-read blu pointer and bold recipient fullname and last text)
|
|
13
|
+
|
|
3
14
|
### 3.0.107.rc.5
|
|
4
15
|
- bug-fixed: user info is not updated in sidebar-user-detail with SSO
|
|
5
16
|
|
|
6
17
|
### 3.0.107.rc.4
|
|
7
18
|
- bug-fixed: SSO, createCustomToken pass old token to authenticate chat engine module
|
|
8
19
|
|
|
9
|
-
|
|
10
20
|
### 3.0.107.rc.3
|
|
11
21
|
- bug-fixed: update tiledek_token after signInWithCustomToken
|
|
12
22
|
|
package/package.json
CHANGED
package/src/app/app.component.ts
CHANGED
|
@@ -319,6 +319,8 @@ export class AppComponent implements OnInit {
|
|
|
319
319
|
this.initializeApp('oninit');
|
|
320
320
|
this.loadCustomScript(appconfig)
|
|
321
321
|
this.listenToPostMsgs();
|
|
322
|
+
|
|
323
|
+
this.loadStyle(JSON.parse(this.appStorageService.getItem('style')))
|
|
322
324
|
}
|
|
323
325
|
|
|
324
326
|
|
|
@@ -411,9 +413,11 @@ export class AppComponent implements OnInit {
|
|
|
411
413
|
async loadStyle(data){
|
|
412
414
|
console.log('[APP-COMPO] event: style ...', data)
|
|
413
415
|
this.appStorageService.setItem('style', JSON.stringify(data))
|
|
414
|
-
if(!data.parameter){
|
|
416
|
+
if(!data || !data.parameter){
|
|
415
417
|
|
|
416
418
|
/** remove class from chat-IFRAME */
|
|
419
|
+
let className = document.body.className.replace(new RegExp(/style-\S*/gm), '')
|
|
420
|
+
document.body.className = className
|
|
417
421
|
document.body.classList.remove('light')
|
|
418
422
|
document.body.classList.remove('dark')
|
|
419
423
|
document.body.classList.remove('custom')
|
|
@@ -425,15 +429,34 @@ export class AppComponent implements OnInit {
|
|
|
425
429
|
/** remove class from dashoard-IFRAME */
|
|
426
430
|
var iframeWin = <HTMLIFrameElement>document.getElementById("iframeConsole")
|
|
427
431
|
if(iframeWin){
|
|
432
|
+
let className = iframeWin.contentDocument.body.className.replace(new RegExp(/style-\S*/gm), '')
|
|
433
|
+
iframeWin.contentDocument.body.className = className
|
|
428
434
|
iframeWin.contentDocument.body.classList.remove('light')
|
|
429
435
|
iframeWin.contentDocument.body.classList.remove('dark')
|
|
430
436
|
iframeWin.contentDocument.body.classList.remove('custom')
|
|
437
|
+
|
|
431
438
|
let link = iframeWin.contentDocument.getElementById('themeCustom');
|
|
432
439
|
if(link){
|
|
433
440
|
link.remove();
|
|
434
441
|
}
|
|
435
442
|
}
|
|
436
443
|
|
|
444
|
+
/** remove class from dashoard-IFRAME-unsassigned-convs */
|
|
445
|
+
var iframeWinUnassigned = <HTMLIFrameElement>document.getElementById("unassigned-convs-iframe")
|
|
446
|
+
if(iframeWinUnassigned){
|
|
447
|
+
let className = iframeWin.contentDocument.body.className.replace(new RegExp(/style-\S*/gm), '')
|
|
448
|
+
iframeWinUnassigned.contentDocument.body.className = className
|
|
449
|
+
iframeWinUnassigned.contentDocument.body.classList.remove('light')
|
|
450
|
+
iframeWinUnassigned.contentDocument.body.classList.remove('dark')
|
|
451
|
+
iframeWinUnassigned.contentDocument.body.classList.remove('custom')
|
|
452
|
+
|
|
453
|
+
let link = iframeWinUnassigned.contentDocument.getElementById('themeCustom');
|
|
454
|
+
if(link){
|
|
455
|
+
link.remove();
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
|
|
437
460
|
/** remove style INFO from storage */
|
|
438
461
|
this.appStorageService.removeItem('style')
|
|
439
462
|
|
|
@@ -447,14 +470,17 @@ export class AppComponent implements OnInit {
|
|
|
447
470
|
link.rel = 'stylesheet';
|
|
448
471
|
link.type = 'text/css';
|
|
449
472
|
link.media='all';
|
|
450
|
-
|
|
451
473
|
this.logger.log('[APP-COMP] create link element...', link)
|
|
452
474
|
let head = document.getElementsByTagName('head')[0];
|
|
453
475
|
head.appendChild(link);
|
|
476
|
+
|
|
454
477
|
/** add class to body element as theme type ('light', 'dark', 'custom') */
|
|
455
478
|
document.body.classList.add(data.type)
|
|
456
479
|
|
|
457
|
-
/** publish event to
|
|
480
|
+
/** publish event to
|
|
481
|
+
* - info-support-group component
|
|
482
|
+
* - unassigned-conversations component
|
|
483
|
+
*/
|
|
458
484
|
this.events.publish('style', data)
|
|
459
485
|
|
|
460
486
|
// var iframeWin = <HTMLIFrameElement>document.getElementById("iframeConsole")
|
package/src/app/components/conversation-info/info-support-group/info-support-group.component.ts
CHANGED
|
@@ -21,28 +21,28 @@ export class InfoSupportGroupComponent implements OnInit {
|
|
|
21
21
|
) { }
|
|
22
22
|
|
|
23
23
|
ngOnInit() {
|
|
24
|
-
this.logger.log('InfoSupportGroupComponent - urlConversationSupportGroup: ', this.urlConversationSupportGroup);
|
|
25
|
-
this.events.subscribe('style', (data)=>this.loadStyle(data)
|
|
24
|
+
this.logger.log('[InfoSupportGroupComponent] - urlConversationSupportGroup: ', this.urlConversationSupportGroup);
|
|
25
|
+
this.events.subscribe('style', (data)=>this.loadStyle(data))
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
ngOnDestroy() {
|
|
29
29
|
// this.logger.log('ngOnDestroy ConversationDetailPage: ');
|
|
30
|
-
this.logger.log('InfoSupportGroupComponent - ngOnDestroy ');
|
|
30
|
+
this.logger.log('[InfoSupportGroupComponent] - ngOnDestroy ');
|
|
31
31
|
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
onLoad(iframe){
|
|
35
35
|
let styleData = this.appStorageService.getItem('style')
|
|
36
|
-
console.log('styleeeeee', styleData)
|
|
36
|
+
console.log('[InfoSupportGroupComponent] styleeeeee', styleData)
|
|
37
37
|
if(styleData && styleData !== 'undefined'){
|
|
38
38
|
this.loadStyle(JSON.parse(styleData))
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
|
-
|
|
42
|
-
|
|
43
41
|
async loadStyle(data){
|
|
44
42
|
var iframeWin = <HTMLIFrameElement>document.getElementById("iframeConsole")
|
|
45
43
|
if(!data.parameter){
|
|
44
|
+
let className = iframeWin.contentDocument.body.className.replace(new RegExp(/style-\S*/gm), '')
|
|
45
|
+
iframeWin.contentDocument.body.className = className
|
|
46
46
|
iframeWin.contentWindow.document.body.classList.remove('light')
|
|
47
47
|
iframeWin.contentWindow.document.body.classList.remove('dark')
|
|
48
48
|
iframeWin.contentWindow.document.body.classList.remove('custom')
|
|
@@ -531,7 +531,6 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
|
|
|
531
531
|
this.addEventsKeyboard()
|
|
532
532
|
this.updateConversationBadge() // AGGIORNO STATO DELLA CONVERSAZIONE A 'LETTA' (is_new = false)
|
|
533
533
|
|
|
534
|
-
|
|
535
534
|
}
|
|
536
535
|
|
|
537
536
|
_getProjectIdByConversationWith(conversationWith: string) {
|
|
@@ -5,6 +5,8 @@ import { LoggerService } from 'src/chat21-core/providers/abstract/logger.service
|
|
|
5
5
|
import { LoggerInstance } from 'src/chat21-core/providers/logger/loggerInstance';
|
|
6
6
|
import { DomSanitizer } from '@angular/platform-browser'
|
|
7
7
|
import { CustomTranslateService } from 'src/chat21-core/providers/custom-translate.service';
|
|
8
|
+
import { AppStorageService } from 'src/chat21-core/providers/abstract/app-storage.service';
|
|
9
|
+
import { EventsService } from 'src/app/services/events-service';
|
|
8
10
|
|
|
9
11
|
|
|
10
12
|
@Component({
|
|
@@ -34,6 +36,8 @@ export class UnassignedConversationsPage implements OnInit {
|
|
|
34
36
|
private navService: NavProxyService,
|
|
35
37
|
private sanitizer: DomSanitizer,
|
|
36
38
|
private translateService: CustomTranslateService,
|
|
39
|
+
private appStorageService: AppStorageService,
|
|
40
|
+
private events : EventsService
|
|
37
41
|
) { }
|
|
38
42
|
|
|
39
43
|
ngOnInit() {
|
|
@@ -46,6 +50,7 @@ export class UnassignedConversationsPage implements OnInit {
|
|
|
46
50
|
this.buildIFRAME();
|
|
47
51
|
this.listenToPostMsg();
|
|
48
52
|
this.hideHotjarFeedbackBtn();
|
|
53
|
+
this.events.subscribe('style', (data)=>this.loadStyle(data))
|
|
49
54
|
}
|
|
50
55
|
|
|
51
56
|
ngOnDestroy(){
|
|
@@ -89,7 +94,8 @@ export class UnassignedConversationsPage implements OnInit {
|
|
|
89
94
|
if (iframeWin) {
|
|
90
95
|
iframeWin.addEventListener("load", function () {
|
|
91
96
|
self.logger.log("[UNASSIGNED-CONVS-PAGE] GET - Finish");
|
|
92
|
-
|
|
97
|
+
self.onLoad(iframeWin)
|
|
98
|
+
|
|
93
99
|
const isIFrame = (input: HTMLElement | null): input is HTMLIFrameElement =>
|
|
94
100
|
input !== null && input.tagName === 'IFRAME';
|
|
95
101
|
|
|
@@ -98,17 +104,58 @@ export class UnassignedConversationsPage implements OnInit {
|
|
|
98
104
|
iframeWin.contentWindow.postMessage(msg, '*');
|
|
99
105
|
}
|
|
100
106
|
|
|
107
|
+
|
|
101
108
|
|
|
102
109
|
let spinnerElem = <HTMLElement>document.querySelector('.loader-spinner-wpr')
|
|
103
110
|
|
|
104
111
|
self.logger.log('[APP-STORE-INSTALL] GET iframeDoc readyState spinnerElem', spinnerElem)
|
|
105
112
|
spinnerElem.classList.add("hide-stretchspinner")
|
|
106
113
|
|
|
114
|
+
|
|
115
|
+
|
|
107
116
|
});
|
|
108
117
|
}
|
|
109
118
|
|
|
110
119
|
}
|
|
111
120
|
|
|
121
|
+
onLoad(iframe){
|
|
122
|
+
let styleData = this.appStorageService.getItem('style')
|
|
123
|
+
console.log('[UNASSIGNED-CONVS-PAGE] styleeeeee', styleData)
|
|
124
|
+
if(styleData && styleData !== 'undefined'){
|
|
125
|
+
this.loadStyle(JSON.parse(styleData))
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
async loadStyle(data){
|
|
129
|
+
var iframeWin = <HTMLIFrameElement>document.getElementById("unassigned-convs-iframe")
|
|
130
|
+
if(!data.parameter){
|
|
131
|
+
let className = iframeWin.contentDocument.body.className.replace(new RegExp(/style-\S*/gm), '')
|
|
132
|
+
iframeWin.contentDocument.body.className = className
|
|
133
|
+
iframeWin.contentWindow.document.body.classList.remove('light')
|
|
134
|
+
iframeWin.contentWindow.document.body.classList.remove('dark')
|
|
135
|
+
iframeWin.contentWindow.document.body.classList.remove('custom')
|
|
136
|
+
let link = iframeWin.contentWindow.document.getElementById('themeCustom');
|
|
137
|
+
if(link){
|
|
138
|
+
link.remove();
|
|
139
|
+
}
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
// Create link
|
|
144
|
+
let link = iframeWin.contentWindow.document.createElement('link');
|
|
145
|
+
link.id= 'themeCustom'
|
|
146
|
+
link.href = data.parameter;
|
|
147
|
+
link.rel = 'stylesheet';
|
|
148
|
+
link.type = 'text/css';
|
|
149
|
+
link.media='all';
|
|
150
|
+
|
|
151
|
+
console.log('linkkkk', link, iframeWin.contentWindow.document)
|
|
152
|
+
let head = iframeWin.contentWindow.document.getElementsByTagName('head')[0];
|
|
153
|
+
head.appendChild(link);
|
|
154
|
+
iframeWin.contentWindow.document.body.classList.add(data.type) //ADD class to body element as theme type ('light', 'dark', 'custom')
|
|
155
|
+
return;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
|
|
112
159
|
listenToPostMsg() {
|
|
113
160
|
window.addEventListener("message", (event) => {
|
|
114
161
|
// console.log("[UNASSIGNED-CONVS-PAGE] message event ", event);
|
|
@@ -8,11 +8,32 @@ body.light{
|
|
|
8
8
|
--list-bkg-color: green;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
body.
|
|
11
|
+
body.style-1{
|
|
12
12
|
background-color: blue;
|
|
13
13
|
--list-bkg-color: blue;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
body.light .navbar{
|
|
17
17
|
background-color: red;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
body.light ion-button .button-native {
|
|
21
|
+
background-color: red;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
body.light ion-button {
|
|
25
|
+
background-color: red;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
body.style-1 ion-button .button-native {
|
|
29
|
+
background-color: red;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/* body.dark :host(.button-native) {
|
|
33
|
+
border: 1px solid red;
|
|
34
|
+
} */
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
body.style-1 ion-col div.buttons-left {
|
|
38
|
+
background-color: blue;
|
|
18
39
|
}
|
|
@@ -1,13 +1,8 @@
|
|
|
1
1
|
<svg focusable="false"
|
|
2
2
|
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 448 512" height="15" width="15"
|
|
3
3
|
style="enable-background:new 0 0 448 512;" xml:space="preserve">
|
|
4
|
-
<path fill="#
|
|
4
|
+
<path fill="#000000" d="M450,432V80c0-26.5-21.5-48-48-48H50C23.5,32,2,53.5,2,80v352c0,26.5,21.5,48,48,48h352
|
|
5
5
|
C428.5,480,450,458.5,450,432z M114,192c-8.8,0-16-7.2-16-16v-32c0-8.8,7.2-16,16-16h226c8.8,0,16,7.2,16,16l1,32
|
|
6
6
|
c0,8.8-8.2,16-17,16H114z M114,288c-8.8,0-16-7.2-16-16v-32c0-8.8,7.2-16,16-16h155c8.8,0,16,7.2,16,16v32c0,8.8-7.2,16-16,16H114z
|
|
7
7
|
M114,384c-8.8,0-16-7.2-16-16v-32c0-8.8,7.2-16,16-16h111c8.8,0,16,7.2,16,16v32c0,8.8-7.2,16-16,16H114z"/>
|
|
8
|
-
<g>
|
|
9
|
-
<polygon fill="#779bbb" points="405.1,237.6 365,204.1 262.4,336.1 262.3,378.6 302.4,369.6 "/>
|
|
10
|
-
<path fill="#779bbb" d="M427.8,197L398,172.1c-2.8-2.4-7-1.9-9.2,1L371.8,195l40.1,33.5l17.1-21.9C431.1,203.7,430.7,199.4,427.8,197z
|
|
11
|
-
"/>
|
|
12
|
-
</g>
|
|
13
8
|
</svg>
|
package/src/assets/test.html
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
|
|
13
13
|
<div class="event-wrp" id="onThemeColor">
|
|
14
14
|
<span class="badge">EVENT</span>
|
|
15
|
-
<label>themeColor </label>
|
|
15
|
+
<label>themeColor LIGHT</label>
|
|
16
16
|
<label class="switch">
|
|
17
17
|
<input type="checkbox" name="themeColor" onclick="onCLickThemeColor(this)">
|
|
18
18
|
<span class="slider round"></span>
|
|
@@ -34,15 +34,16 @@
|
|
|
34
34
|
// cssLink.type = "text/css";
|
|
35
35
|
// console.log('framessss', frames['myIFrame'])
|
|
36
36
|
// frames['myIFrame'].contentWindow.document.body.appendChild(cssLink);
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
|
|
38
|
+
// let msg= { action: "style", type: 'light', parameter: 'http://localhost:8080/assets/customStyle.css'}
|
|
39
|
+
// frames['myIFrame'].contentWindow.postMessage(msg, '*');
|
|
39
40
|
}
|
|
40
41
|
|
|
41
42
|
|
|
42
43
|
function onCLickThemeColor(event){
|
|
43
44
|
console.log('onCLickThemeColor: status-->',event.checked);
|
|
44
45
|
if(event.checked){
|
|
45
|
-
let msg= { action: "style", type: '
|
|
46
|
+
let msg= { action: "style", type: 'style-1', parameter: 'http://localhost:8080/assets/customStyle.css'}
|
|
46
47
|
frames['myIFrame'].contentWindow.postMessage(msg, '*');
|
|
47
48
|
}else{
|
|
48
49
|
let msg= { action: "style", parameter: ''}
|
|
@@ -272,6 +272,7 @@ export class FirebaseConversationsHandler extends ConversationsHandlerService {
|
|
|
272
272
|
archiveConversation(conversationId: string) {
|
|
273
273
|
const that = this
|
|
274
274
|
this.setClosingConversation(conversationId, true);
|
|
275
|
+
this.setConversationRead(conversationId)
|
|
275
276
|
const index = searchIndexInArrayForUid(this.conversations, conversationId);
|
|
276
277
|
// if (index > -1) {
|
|
277
278
|
// this.conversations.splice(index, 1);
|
|
@@ -374,7 +374,8 @@ export class MQTTConversationsHandler extends ConversationsHandlerService {
|
|
|
374
374
|
this.isConversationClosingMap.delete(conversationId);
|
|
375
375
|
}
|
|
376
376
|
|
|
377
|
-
archiveConversation(conversationId: string) {
|
|
377
|
+
archiveConversation(conversationId: string) {
|
|
378
|
+
this.setConversationRead(conversationId)
|
|
378
379
|
this.chat21Service.chatClient.archiveConversation(conversationId);
|
|
379
380
|
}
|
|
380
381
|
|
|
@@ -112,7 +112,7 @@ export class NativeUploadService extends UploadService {
|
|
|
112
112
|
|
|
113
113
|
//USE IMAGE API
|
|
114
114
|
const that = this;
|
|
115
|
-
const url = this.URL_TILEDESK_IMAGES + '/users' + '?path=' + path
|
|
115
|
+
const url = this.URL_TILEDESK_IMAGES + '/users' + '?path=' + path.split('path=')[1]
|
|
116
116
|
return new Promise((resolve, reject) => {
|
|
117
117
|
that.http.delete(url, requestOptions).subscribe(data => {
|
|
118
118
|
// const downloadURL = this.URL_TILEDESK_IMAGES + '?path=' + data['filename'];
|