@chat21/chat21-ionic 3.0.58 → 3.0.59-rc4

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 (80) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/README.md +4 -0
  3. package/package.json +1 -1
  4. package/resources/Android/splash/drawable-land-hdpi-screen.png +0 -0
  5. package/resources/Android/splash/drawable-land-ldpi-screen.png +0 -0
  6. package/resources/Android/splash/drawable-land-mdpi-screen.png +0 -0
  7. package/resources/Android/splash/drawable-land-xhdpi-screen.png +0 -0
  8. package/resources/Android/splash/drawable-land-xxhdpi-screen.png +0 -0
  9. package/resources/Android/splash/drawable-land-xxxhdpi-screen.png +0 -0
  10. package/resources/Android/splash/drawable-port-hdpi-screen.png +0 -0
  11. package/resources/Android/splash/drawable-port-ldpi-screen.png +0 -0
  12. package/resources/Android/splash/drawable-port-mdpi-screen.png +0 -0
  13. package/resources/Android/splash/drawable-port-xhdpi-screen.png +0 -0
  14. package/resources/Android/splash/drawable-port-xxhdpi-screen.png +0 -0
  15. package/resources/Android/splash/drawable-port-xxxhdpi-screen.png +0 -0
  16. package/resources/Android/splash.png +0 -0
  17. package/src/app/app-routing.module.ts +21 -17
  18. package/src/app/app.component.html +6 -3
  19. package/src/app/app.component.ts +195 -41
  20. package/src/app/app.module.ts +4 -1
  21. package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.html +4 -4
  22. package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.scss +8 -2
  23. package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.ts +6 -1
  24. package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.html +7 -2
  25. package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.ts +47 -2
  26. package/src/app/chatlib/conversation-detail/message/image/image.component.html +7 -6
  27. package/src/app/chatlib/conversation-detail/message/image/image.component.ts +20 -1
  28. package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.html +34 -5
  29. package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.scss +8 -144
  30. package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.ts +14 -18
  31. package/src/app/components/authentication/login/login.component.html +2 -2
  32. package/src/app/components/authentication/login/login.component.ts +2 -1
  33. package/src/app/components/conversation-detail/bubble-my-message/bubble-my-message.component.ts +1 -1
  34. package/src/app/components/conversation-detail/bubble-others-message/bubble-others-message.component.ts +1 -1
  35. package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.html +17 -12
  36. package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.scss +12 -0
  37. package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.ts +21 -5
  38. package/src/app/components/conversation-detail/message-text-area/message-text-area.component.html +3 -2
  39. package/src/app/components/conversation-detail/message-text-area/message-text-area.component.scss +22 -17
  40. package/src/app/components/conversation-detail/message-text-area/message-text-area.component.ts +46 -5
  41. package/src/app/components/image-viewer/image-viewer.component.html +23 -0
  42. package/src/app/components/image-viewer/image-viewer.component.scss +107 -0
  43. package/src/app/components/image-viewer/image-viewer.component.spec.ts +24 -0
  44. package/src/app/components/image-viewer/image-viewer.component.ts +38 -0
  45. package/src/app/components/project-item/project-item.component.html +102 -0
  46. package/src/app/components/project-item/project-item.component.scss +542 -0
  47. package/src/app/components/project-item/project-item.component.spec.ts +24 -0
  48. package/src/app/components/project-item/project-item.component.ts +308 -0
  49. package/src/app/components/utils/avatar-profile/avatar-profile.component.html +7 -0
  50. package/src/app/components/utils/avatar-profile/avatar-profile.component.ts +22 -5
  51. package/src/app/pages/authentication/login/login.page.ts +1 -1
  52. package/src/app/pages/conversation-detail/conversation-detail.page.html +5 -3
  53. package/src/app/pages/conversation-detail/conversation-detail.page.ts +122 -30
  54. package/src/app/pages/conversations-list/conversations-list.page.html +40 -24
  55. package/src/app/pages/conversations-list/conversations-list.page.scss +146 -1
  56. package/src/app/pages/conversations-list/conversations-list.page.ts +80 -6
  57. package/src/app/pages/unassigned-conversations/unassigned-conversations-routing.module.ts +17 -0
  58. package/src/app/pages/unassigned-conversations/unassigned-conversations.module.ts +22 -0
  59. package/src/app/pages/unassigned-conversations/unassigned-conversations.page.html +14 -0
  60. package/src/app/pages/unassigned-conversations/unassigned-conversations.page.scss +0 -0
  61. package/src/app/pages/unassigned-conversations/unassigned-conversations.page.spec.ts +24 -0
  62. package/src/app/pages/unassigned-conversations/unassigned-conversations.page.ts +105 -0
  63. package/src/app/services/nav-proxy.service.ts +1 -1
  64. package/src/app/services/tiledesk/tiledesk.service.ts +22 -1
  65. package/src/app/services/websocket/websocket-js.ts +559 -0
  66. package/src/app/services/websocket/websocket.service.spec.ts +12 -0
  67. package/src/app/services/websocket/websocket.service.ts +274 -0
  68. package/src/app/shared/shared.module.ts +7 -1
  69. package/src/assets/i18n/en.json +8 -1
  70. package/src/assets/i18n/it.json +8 -1
  71. package/src/chat21-core/providers/chat-manager.ts +3 -3
  72. package/src/chat21-core/providers/firebase/firebase-archivedconversations-handler.ts +1 -1
  73. package/src/chat21-core/providers/firebase/firebase-auth-service.ts +6 -6
  74. package/src/chat21-core/providers/firebase/firebase-conversation-handler.ts +1 -1
  75. package/src/chat21-core/providers/firebase/firebase-notifications.ts +1 -1
  76. package/src/chat21-core/providers/firebase/firebase-presence.service.ts +2 -2
  77. package/src/chat21-core/providers/firebase/firebase-typing.service.ts +1 -1
  78. package/src/chat21-core/providers/firebase/firebase-upload.service.ts +1 -1
  79. package/src/chat21-core/providers/tiledesk/tiledesk-auth.service.ts +1 -1
  80. package/src/chat21-core/utils/utils.ts +1 -1
@@ -0,0 +1,22 @@
1
+ import { NgModule } from '@angular/core';
2
+ import { CommonModule } from '@angular/common';
3
+ import { FormsModule } from '@angular/forms';
4
+
5
+ import { IonicModule } from '@ionic/angular';
6
+
7
+ import { UnassignedConversationsPageRoutingModule } from './unassigned-conversations-routing.module';
8
+
9
+ import { UnassignedConversationsPage } from './unassigned-conversations.page';
10
+
11
+ @NgModule({
12
+ imports: [
13
+ CommonModule,
14
+ FormsModule,
15
+ IonicModule,
16
+ UnassignedConversationsPageRoutingModule
17
+ ],
18
+ declarations: [
19
+ UnassignedConversationsPage,
20
+ ]
21
+ })
22
+ export class UnassignedConversationsPageModule {}
@@ -0,0 +1,14 @@
1
+ <ion-header>
2
+ <ion-toolbar>
3
+ <ion-title>{{translationMap.get('UnassignedConversations') }}</ion-title>
4
+ <ion-buttons slot="end">
5
+ <ion-button ion-button fill="clear" (click)="onClose()">
6
+ <ion-icon slot="icon-only" name="close"></ion-icon>
7
+ </ion-button>
8
+ </ion-buttons>
9
+ </ion-toolbar>
10
+ </ion-header>
11
+
12
+ <ion-content overflow-scroll="true" id="iframe-ion-content">
13
+ <!-- <iframe id="i_frame" style="width:100%; height:99%" frameBorder="0" allowfullscreen [src]="unassigned_convs_url_sanitized"></iframe> -->
14
+ </ion-content>
@@ -0,0 +1,24 @@
1
+ import { async, ComponentFixture, TestBed } from '@angular/core/testing';
2
+ import { IonicModule } from '@ionic/angular';
3
+
4
+ import { UnassignedConversationsPage } from './unassigned-conversations.page';
5
+
6
+ describe('UnassignedConversationsPage', () => {
7
+ let component: UnassignedConversationsPage;
8
+ let fixture: ComponentFixture<UnassignedConversationsPage>;
9
+
10
+ beforeEach(async(() => {
11
+ TestBed.configureTestingModule({
12
+ declarations: [ UnassignedConversationsPage ],
13
+ imports: [IonicModule.forRoot()]
14
+ }).compileComponents();
15
+
16
+ fixture = TestBed.createComponent(UnassignedConversationsPage);
17
+ component = fixture.componentInstance;
18
+ fixture.detectChanges();
19
+ }));
20
+
21
+ it('should create', () => {
22
+ expect(component).toBeTruthy();
23
+ });
24
+ });
@@ -0,0 +1,105 @@
1
+ import { Component, Input, OnInit, SecurityContext } from '@angular/core';
2
+ import { ModalController } from '@ionic/angular';
3
+ import { NavProxyService } from 'src/app/services/nav-proxy.service';
4
+ import { LoggerService } from 'src/chat21-core/providers/abstract/logger.service';
5
+ import { LoggerInstance } from 'src/chat21-core/providers/logger/loggerInstance';
6
+ import { DomSanitizer } from '@angular/platform-browser'
7
+ import { CustomTranslateService } from 'src/chat21-core/providers/custom-translate.service';
8
+
9
+
10
+ @Component({
11
+ selector: 'app-unassigned-conversations',
12
+ templateUrl: './unassigned-conversations.page.html',
13
+ styleUrls: ['./unassigned-conversations.page.scss'],
14
+ })
15
+ export class UnassignedConversationsPage implements OnInit {
16
+
17
+ @Input() unassigned_convs_url: any;
18
+ unassigned_convs_url_sanitized: any;
19
+ private logger: LoggerService = LoggerInstance.getInstance();
20
+ has_loaded: boolean;
21
+ ion_content: any;
22
+ iframe: any;
23
+ public translationMap: Map<string, string>;
24
+ constructor(
25
+ private modalController: ModalController,
26
+ private navService: NavProxyService,
27
+ private sanitizer: DomSanitizer,
28
+ private translateService: CustomTranslateService,
29
+ ) { }
30
+
31
+ ngOnInit() {
32
+ const keys = ['UnassignedConversations'];
33
+ this.translationMap = this.translateService.translateLanguage(keys);
34
+
35
+ this.logger.log('[UNASSIGNED-CONVS-PAGE] - UNASSIGNED CONVS URL (ngOnInit)', this.unassigned_convs_url);
36
+ // this.unassigned_convs_url_sanitized = this.sanitizer.bypassSecurityTrustResourceUrl(this.unassigned_convs_url);
37
+ // this.unassigned_convs_url_sanitized = this.sanitizer.bypassSecurityTrustHtml(this.unassigned_convs_url);
38
+ this.unassigned_convs_url_sanitized = this.sanitizer.sanitize(SecurityContext.URL, this.unassigned_convs_url)
39
+ this.logger.log('[UNASSIGNED-CONVS-PAGE] - UNASSIGNED CONVS URL SANITIZED (ngOnInit)', this.unassigned_convs_url_sanitized);
40
+ this.has_loaded = false
41
+
42
+ this.ion_content = document.getElementById("iframe-ion-content");
43
+ this.iframe = document.createElement("iframe");
44
+ this.iframe.src = this.unassigned_convs_url_sanitized;
45
+ this.iframe.width = "100%";
46
+ this.iframe.height = "99.6%";
47
+ this.iframe.id = "unassigned-convs-iframe"
48
+ this.iframe.frameBorder = "0";
49
+ this.iframe.style.border = "none";
50
+ this.iframe.style.background = "white";
51
+ this.ion_content.appendChild(this.iframe);
52
+
53
+ // }
54
+
55
+ // window.addEventListener("message", (event) => {
56
+ // console.log("[UNASSIGNED-CONVS-PAGE] message event ", event);
57
+
58
+ // if (event && event.data) {
59
+ // if (event.data === 'finished') {
60
+ // this.has_loaded = true
61
+
62
+ // }
63
+ // }
64
+ // });
65
+
66
+ }
67
+
68
+
69
+
70
+ // getIframeHaLoaded() {
71
+ // var self = this;
72
+ // var iframe = document.getElementById('i_frame') as HTMLIFrameElement;;
73
+ // if (iframe) {
74
+ // iframe.addEventListener("load", function () {
75
+ // console.log("[UNASSIGNED-CONVS-PAGE] GET - Finish");
76
+ // self.has_loaded = true
77
+
78
+
79
+ // });
80
+ // }
81
+ // }
82
+
83
+ // loadDeferredIframe(unassigned_convs_url_sanitized) {
84
+ // // this function will load the Google homepage into the iframe
85
+ // var iframe = document.getElementById("my-deferred-iframe");
86
+ // iframe.src = "./" // here goes your url
87
+ // };
88
+
89
+
90
+ async onClose() {
91
+ this.logger.log('[UNASSIGNED-CONVS-PAGE] - onClose MODAL')
92
+ this.logger.log('[UNASSIGNED-CONVS-PAGE] - onClose MODAL isModalOpened ', await this.modalController.getTop())
93
+ const isModalOpened = await this.modalController.getTop();
94
+
95
+ if (isModalOpened) {
96
+ this.modalController.dismiss({
97
+
98
+ confirmed: true
99
+ });
100
+ } else {
101
+ this.navService.pop();
102
+ }
103
+ }
104
+
105
+ }
@@ -25,7 +25,7 @@ export class NavProxyService {
25
25
 
26
26
  this.sidebarNav = sidebarNav;
27
27
  this.detailNav = detailNav;
28
- this.logger.info('[NAV-SERV] initialize sidebarNav', sidebarNav, ' detailNav', detailNav);
28
+ this.logger.log('[NAV-SERV] initialize sidebarNav', sidebarNav, ' detailNav', detailNav);
29
29
  }
30
30
 
31
31
  setRoot(page: any, navExtra: any) {
@@ -21,6 +21,8 @@ export class TiledeskService {
21
21
  public appConfigProvider: AppConfigProvider
22
22
  ) {
23
23
  this.apiUrl = appConfigProvider.getConfig().apiUrl;
24
+ // const projectUrl = this.apiUrl + 'projects/'
25
+ // console.log('[TILEDESK-SERVICE] projectUrl' ,projectUrl )
24
26
  }
25
27
 
26
28
 
@@ -51,7 +53,7 @@ export class TiledeskService {
51
53
 
52
54
  // http://tiledesk-server-pre.herokuapp.com/requests_util/lookup/id_project/support-group-60ffe291f725db00347661ef-b4cb6875785c4a23b27244fe498eecf44
53
55
  public getProjectIdByConvRecipient(token: string ,conversationWith: string ) {
54
- const lookupUrl =this.apiUrl + 'requests_util/lookup/id_project/' + conversationWith;
56
+ const lookupUrl = this.apiUrl + 'requests_util/lookup/id_project/' + conversationWith;
55
57
 
56
58
  this.logger.log('[TILEDESK-SERVICE] GET PROJECTID BY CONV RECIPIENT - URL ', lookupUrl);
57
59
 
@@ -70,6 +72,25 @@ export class TiledeskService {
70
72
  }))
71
73
  }
72
74
 
75
+ public getProjects(token: string) {
76
+ const url = this.apiUrl + 'projects/';
77
+ this.logger.log('[TILEDESK-SERVICE] - GET PROJECTS URL', url);
78
+
79
+ const httpOptions = {
80
+ headers: new HttpHeaders({
81
+ 'Content-Type': 'application/json',
82
+ Authorization: token
83
+ })
84
+ };
85
+
86
+ return this.http
87
+ .get(url, httpOptions)
88
+ .pipe(map((res: any) => {
89
+ this.logger.log('[TILEDESK-SERVICE] GET PROJECTS - RES ', res);
90
+ return res
91
+ }))
92
+ }
93
+
73
94
 
74
95
 
75
96