@chat21/chat21-ionic 3.1.0-rc1 → 3.1.0-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 +4 -0
- package/package.json +1 -1
- package/src/app/app.component.ts +3 -3
- package/src/app/components/conversation-info/info-support-group/info-support-group.component.ts +4 -5
- package/src/app/components/navbar/navbar.component.html +1 -1
- package/src/app/pages/unassigned-conversations/unassigned-conversations.page.scss +2 -1
- package/src/app/pages/unassigned-conversations/unassigned-conversations.page.ts +3 -4
- package/src/assets/test.html +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# chat21-ionic ver 3.0
|
|
2
2
|
|
|
3
|
+
### 3.1.0-rc2
|
|
4
|
+
- changed: leadStyle storage property from appStorageService to localstorage 'custom_style' property
|
|
5
|
+
- bug-fixed: projects dropdown don't truncate long project name text
|
|
6
|
+
|
|
3
7
|
### 3.1.0-rc1
|
|
4
8
|
- added: INFO_MESSAGE_TYPE enum added to manage info message keys into message.attributes object
|
|
5
9
|
- changed: route to main page ('/conversation-detail') when a conversation is closed or abandoned
|
package/package.json
CHANGED
package/src/app/app.component.ts
CHANGED
|
@@ -320,7 +320,7 @@ export class AppComponent implements OnInit {
|
|
|
320
320
|
this.loadCustomScript(appconfig)
|
|
321
321
|
this.listenToPostMsgs();
|
|
322
322
|
|
|
323
|
-
this.loadStyle(JSON.parse(
|
|
323
|
+
this.loadStyle(JSON.parse(localStorage.getItem('custom_style')))
|
|
324
324
|
}
|
|
325
325
|
|
|
326
326
|
|
|
@@ -412,7 +412,7 @@ export class AppComponent implements OnInit {
|
|
|
412
412
|
|
|
413
413
|
async loadStyle(data){
|
|
414
414
|
console.log('[APP-COMPO] event: style ...', data)
|
|
415
|
-
|
|
415
|
+
localStorage.setItem('custom_style', JSON.stringify(data))
|
|
416
416
|
if(!data || !data.parameter){
|
|
417
417
|
|
|
418
418
|
/** remove class from chat-IFRAME */
|
|
@@ -458,7 +458,7 @@ export class AppComponent implements OnInit {
|
|
|
458
458
|
|
|
459
459
|
|
|
460
460
|
/** remove style INFO from storage */
|
|
461
|
-
|
|
461
|
+
localStorage.removeItem('custom_style')
|
|
462
462
|
|
|
463
463
|
return;
|
|
464
464
|
}
|
package/src/app/components/conversation-info/info-support-group/info-support-group.component.ts
CHANGED
|
@@ -16,7 +16,6 @@ export class InfoSupportGroupComponent implements OnInit {
|
|
|
16
16
|
|
|
17
17
|
private logger: LoggerService = LoggerInstance.getInstance();
|
|
18
18
|
constructor(
|
|
19
|
-
private appStorageService: AppStorageService,
|
|
20
19
|
private events : EventsService
|
|
21
20
|
) { }
|
|
22
21
|
|
|
@@ -32,15 +31,15 @@ export class InfoSupportGroupComponent implements OnInit {
|
|
|
32
31
|
}
|
|
33
32
|
|
|
34
33
|
onLoad(iframe){
|
|
35
|
-
let styleData =
|
|
36
|
-
this.logger.log('[InfoSupportGroupComponent]
|
|
34
|
+
let styleData = localStorage.getItem('custom_style')
|
|
35
|
+
this.logger.log('[InfoSupportGroupComponent] onLoad style', styleData)
|
|
37
36
|
if(styleData && styleData !== 'undefined'){
|
|
38
37
|
this.loadStyle(JSON.parse(styleData))
|
|
39
38
|
}
|
|
40
39
|
}
|
|
41
40
|
async loadStyle(data){
|
|
42
41
|
var iframeWin = <HTMLIFrameElement>document.getElementById("iframeConsole")
|
|
43
|
-
if(!data.parameter){
|
|
42
|
+
if(!data || !data.parameter){
|
|
44
43
|
let className = iframeWin.contentDocument.body.className.replace(new RegExp(/style-\S*/gm), '')
|
|
45
44
|
iframeWin.contentDocument.body.className = className
|
|
46
45
|
iframeWin.contentWindow.document.body.classList.remove('light')
|
|
@@ -61,7 +60,7 @@ export class InfoSupportGroupComponent implements OnInit {
|
|
|
61
60
|
link.type = 'text/css';
|
|
62
61
|
link.media='all';
|
|
63
62
|
|
|
64
|
-
|
|
63
|
+
this.logger.log('[InfoSupportGroupComponent] loadStyle element', link, iframeWin.contentWindow.document)
|
|
65
64
|
let head = iframeWin.contentWindow.document.getElementsByTagName('head')[0];
|
|
66
65
|
head.appendChild(link);
|
|
67
66
|
iframeWin.contentWindow.document.body.classList.add(data.type) //ADD class to body element as theme type ('light', 'dark', 'custom')
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
<li>
|
|
18
18
|
<button class="btn dropdown-toggle project-dropdown" (click)="openDropdownProjects = !openDropdownProjects">
|
|
19
19
|
<i class="material-icons" style="margin-right: 3px;">keyboard_arrow_down</i>
|
|
20
|
-
<span style="text-transform: none"> {{ project?.id_project?.name }} </span>
|
|
20
|
+
<span class="project-dropdown" style="text-transform: none"> {{ project?.id_project?.name }} </span>
|
|
21
21
|
</button>
|
|
22
22
|
<div class="ripple-container"></div>
|
|
23
23
|
<div id="navbar_dropdown" class="dropdown-menu" [ngClass]="{'open': openDropdownProjects}">
|
|
@@ -36,7 +36,6 @@ export class UnassignedConversationsPage implements OnInit {
|
|
|
36
36
|
private navService: NavProxyService,
|
|
37
37
|
private sanitizer: DomSanitizer,
|
|
38
38
|
private translateService: CustomTranslateService,
|
|
39
|
-
private appStorageService: AppStorageService,
|
|
40
39
|
private events : EventsService
|
|
41
40
|
) { }
|
|
42
41
|
|
|
@@ -119,15 +118,15 @@ export class UnassignedConversationsPage implements OnInit {
|
|
|
119
118
|
}
|
|
120
119
|
|
|
121
120
|
onLoad(iframe){
|
|
122
|
-
let styleData =
|
|
123
|
-
console.log('[UNASSIGNED-CONVS-PAGE] styleeeeee', styleData)
|
|
121
|
+
let styleData = localStorage.getItem('custom_style')
|
|
124
122
|
if(styleData && styleData !== 'undefined'){
|
|
125
123
|
this.loadStyle(JSON.parse(styleData))
|
|
126
124
|
}
|
|
127
125
|
}
|
|
126
|
+
|
|
128
127
|
async loadStyle(data){
|
|
129
128
|
var iframeWin = <HTMLIFrameElement>document.getElementById("unassigned-convs-iframe")
|
|
130
|
-
if(!data.parameter){
|
|
129
|
+
if(!data || !data.parameter){
|
|
131
130
|
let className = iframeWin.contentDocument.body.className.replace(new RegExp(/style-\S*/gm), '')
|
|
132
131
|
iframeWin.contentDocument.body.className = className
|
|
133
132
|
iframeWin.contentWindow.document.body.classList.remove('light')
|
package/src/assets/test.html
CHANGED
|
@@ -20,12 +20,12 @@
|
|
|
20
20
|
</div>
|
|
21
21
|
|
|
22
22
|
<iframe id="myIFrame" frameBorder="0" width="100%" style="display: flex; height: 95vh" onload="onLoad()"
|
|
23
|
-
src="http://localhost:8080/#/conversation-detail?tiledesk_supportMode=
|
|
23
|
+
src="http://localhost:8080/#/conversation-detail?tiledesk_supportMode=true&jwt=JWT eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOiI1ZmQzNGU0MjQ5NjEwZTAwMzQ5ODUwNzgiLCJlbWFpbCI6ImdhYnJpZWxlLnBhbmljb0Bmcm9udGllcmUyMS5pdCIsImZpcnN0bmFtZSI6IkdhYnJpZWxlMiIsImxhc3RuYW1lIjoiUGFuaWNvIC1wcmUiLCJlbWFpbHZlcmlmaWVkIjp0cnVlLCJpYXQiOjE2OTgzMzYyMTMsImF1ZCI6Imh0dHBzOi8vdGlsZWRlc2suY29tIiwiaXNzIjoiaHR0cHM6Ly90aWxlZGVzay5jb20iLCJzdWIiOiJ1c2VyIiwianRpIjoiNjAzZGY3NDQtZWY0OS00Mjg2LWJlMWQtYWM5OGYyYTNkMTJiIn0.bof5QPQP262yCQfpeSjqyoYPkSCttg5NQFkcV8d634xzeq7wJBdhtiO7IJY6hS81a1YyXrAsxlK7RiNS-UZdYiTXR81UXurQd1fnE9jtaggB82tyNL8vmiZEOs6xh4TqO3-kkBzRxQIp74bY53fk_mu5RmNbAjIgUWEufaNDiv8"></iframe>
|
|
24
24
|
|
|
25
25
|
<script>
|
|
26
|
-
window.addEventListener('message', event => {
|
|
27
|
-
|
|
28
|
-
});
|
|
26
|
+
// window.addEventListener('message', event => {
|
|
27
|
+
// console.log('[CHAT-IONIC] test page event::', event)
|
|
28
|
+
// });
|
|
29
29
|
|
|
30
30
|
function onLoad(){
|
|
31
31
|
// var cssLink = document.createElement("style");
|