@chat21/chat21-ionic 3.0.59-rc1 → 3.0.59-rc10

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 (88) hide show
  1. package/CHANGELOG.md +46 -0
  2. package/README.md +4 -0
  3. package/config.xml +11 -2
  4. package/env.sample +2 -0
  5. package/package.json +1 -1
  6. package/resources/Android/splash/drawable-land-hdpi-screen.png +0 -0
  7. package/resources/Android/splash/drawable-land-ldpi-screen.png +0 -0
  8. package/resources/Android/splash/drawable-land-mdpi-screen.png +0 -0
  9. package/resources/Android/splash/drawable-land-xhdpi-screen.png +0 -0
  10. package/resources/Android/splash/drawable-land-xxhdpi-screen.png +0 -0
  11. package/resources/Android/splash/drawable-land-xxxhdpi-screen.png +0 -0
  12. package/resources/Android/splash/drawable-port-hdpi-screen.png +0 -0
  13. package/resources/Android/splash/drawable-port-ldpi-screen.png +0 -0
  14. package/resources/Android/splash/drawable-port-mdpi-screen.png +0 -0
  15. package/resources/Android/splash/drawable-port-xhdpi-screen.png +0 -0
  16. package/resources/Android/splash/drawable-port-xxhdpi-screen.png +0 -0
  17. package/resources/Android/splash/drawable-port-xxxhdpi-screen.png +0 -0
  18. package/resources/Android/splash.png +0 -0
  19. package/src/app/app-routing.module.ts +21 -17
  20. package/src/app/app.component.html +6 -3
  21. package/src/app/app.component.ts +242 -51
  22. package/src/app/app.module.ts +16 -8
  23. package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.html +4 -4
  24. package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.scss +8 -2
  25. package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.ts +6 -1
  26. package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.html +1 -1
  27. package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.ts +1 -1
  28. package/src/app/chatlib/conversation-detail/message/image/image.component.html +7 -6
  29. package/src/app/chatlib/conversation-detail/message/image/image.component.ts +20 -1
  30. package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.html +39 -9
  31. package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.scss +8 -144
  32. package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.ts +14 -17
  33. package/src/app/components/authentication/login/login.component.html +2 -2
  34. package/src/app/components/authentication/login/login.component.ts +2 -1
  35. package/src/app/components/conversation-detail/bubble-my-message/bubble-my-message.component.ts +1 -1
  36. package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.html +3 -2
  37. package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.ts +3 -3
  38. package/src/app/components/conversation-detail/message-text-area/message-text-area.component.ts +46 -5
  39. package/src/app/components/ddp-header/ddp-header.component.html +1 -1
  40. package/src/app/components/ddp-header/ddp-header.component.ts +4 -2
  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 +147 -0
  46. package/src/app/components/project-item/project-item.component.scss +669 -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 +316 -0
  49. package/src/app/components/utils/avatar-profile/avatar-profile.component.html +9 -3
  50. package/src/app/components/utils/avatar-profile/avatar-profile.component.ts +6 -4
  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 +87 -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 +22 -0
  60. package/src/app/pages/unassigned-conversations/unassigned-conversations.page.scss +79 -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 +108 -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 +9 -1
  70. package/src/assets/i18n/it.json +9 -1
  71. package/src/assets/js/chat21client.js +141 -67
  72. package/src/assets/transparent.png +0 -0
  73. package/src/chat-config-pre-test.json +3 -1
  74. package/src/chat-config-template.json +3 -1
  75. package/src/chat-config.json +3 -1
  76. package/src/chat21-core/providers/chat-manager.ts +3 -3
  77. package/src/chat21-core/providers/firebase/firebase-archivedconversations-handler.ts +1 -1
  78. package/src/chat21-core/providers/firebase/firebase-auth-service.ts +3 -3
  79. package/src/chat21-core/providers/firebase/firebase-conversation-handler.ts +1 -1
  80. package/src/chat21-core/providers/firebase/firebase-notifications.ts +1 -1
  81. package/src/chat21-core/providers/firebase/firebase-presence.service.ts +2 -2
  82. package/src/chat21-core/providers/firebase/firebase-typing.service.ts +1 -1
  83. package/src/chat21-core/providers/firebase/firebase-upload.service.ts +1 -1
  84. package/src/chat21-core/providers/mqtt/mqtt-auth-service.ts +27 -27
  85. package/src/chat21-core/providers/mqtt/mqtt-conversations-handler.ts +13 -5
  86. package/src/chat21-core/providers/mqtt/mqtt-notifications.ts +101 -11
  87. package/src/chat21-core/providers/tiledesk/tiledesk-auth.service.ts +1 -1
  88. package/src/chat21-core/utils/utils.ts +1 -1
@@ -1,10 +1,6 @@
1
-
2
1
  <ion-header no-border class="ion-no-border">
3
- <app-ddp-header *ngIf="conversationType ==='active'"
4
- [numberOpenConv]="numberOpenConv"
5
- [supportMode]="supportMode"
6
- (openContactsDirectory)=openContactsDirectory($event)
7
- (openProfileInfo)=openProfileInfo($event)>
2
+ <app-ddp-header *ngIf="conversationType ==='active'" [numberOpenConv]="numberOpenConv" [supportMode]="supportMode"
3
+ (openContactsDirectory)=openContactsDirectory($event) (openProfileInfo)=openProfileInfo($event)>
8
4
  </app-ddp-header>
9
5
 
10
6
  <app-option-header *ngIf="conversationType !=='active'" [headerTitle]=headerTitle
@@ -16,36 +12,56 @@
16
12
 
17
13
  <div id="scrollbar2">
18
14
  <ion-list>
19
-
20
15
  <span
21
16
  *ngIf="(conversations.length > 0 && conversationType ==='active') || (archivedConversations.length > 0 && conversationType ==='archived');then contentConversations else contentMessageWelcome">
22
17
  here is ignored
23
18
  </span>
24
19
 
25
20
  <ng-template #contentConversations>
21
+ <!-- -------------------------------------------------------------------------- -->
22
+ <!-- New <ion-spinner class="spinner-middle" style="margin-left: 19px;"></ion-spinner> -->
23
+ <!-- -------------------------------------------------------------------------- -->
24
+ <ion-item *ngIf="isOnline === false" style="padding-left:0px!important ;padding-right:0px!important" button="true" lines="none" class="ion-no-padding waiting-for-connection">
25
+ <div tabindex="0"></div>
26
+ <ion-avatar item-start>
27
+ <div class="sk-fading-circle">
28
+ <div class="sk-circle1 sk-circle"></div>
29
+ <div class="sk-circle2 sk-circle"></div>
30
+ <div class="sk-circle3 sk-circle"></div>
31
+ <div class="sk-circle4 sk-circle"></div>
32
+ <div class="sk-circle5 sk-circle"></div>
33
+ <div class="sk-circle6 sk-circle"></div>
34
+ <div class="sk-circle7 sk-circle"></div>
35
+ <div class="sk-circle8 sk-circle"></div>
36
+ <div class="sk-circle9 sk-circle"></div>
37
+ <div class="sk-circle10 sk-circle"></div>
38
+ <div class="sk-circle11 sk-circle"></div>
39
+ <div class="sk-circle12 sk-circle"></div>
40
+ </div>
41
+ </ion-avatar>
42
+ <ion-label part="message-text" class="waiting-for-network-msg"> Waiting for network</ion-label>
43
+ </ion-item>
44
+
45
+ <ion-item *ngIf="supportMode" class="ion-no-padding open-iframe-item" style="padding-left:0px!important ;padding-right:0px!important; height:55px" button="true"
46
+ (click)="openUnsevedConversationIframe()">
47
+ <div tabindex="0"></div>
48
+ <app-project-item (projectIdEvent)="getLastProjectId($event)"></app-project-item>
49
+ </ion-item>
26
50
  <!-- ---------------------------------- -->
27
51
  <!-- ACTIVE CONVERSATION LIST -->
28
52
  <!-- ---------------------------------- -->
29
- <ion-list-conversations *ngIf="conversationType ==='active'"
30
- [uidConvSelected]="uidConvSelected"
31
- [listConversations]="conversations"
32
- [stylesMap]="stylesMap"
33
- [translationMap]="translationMapConversation"
34
- (onConversationSelected)=onConversationSelected($event)
35
- (onImageLoaded)="onImageLoaded($event)"
36
- (onConversationLoaded)="onConversationLoaded($event)"
37
- (onCloseConversation)="onCloseConversation($event)">
53
+ <ion-list-conversations *ngIf="conversationType ==='active'" [uidConvSelected]="uidConvSelected"
54
+ [listConversations]="conversations" [stylesMap]="stylesMap" [translationMap]="translationMapConversation"
55
+ (onConversationSelected)=onConversationSelected($event) (onImageLoaded)="onImageLoaded($event)"
56
+ (onConversationLoaded)="onConversationLoaded($event)" (onCloseConversation)="onCloseConversation($event)">
38
57
  </ion-list-conversations>
39
58
 
40
59
  <!-- ---------------------------------- -->
41
60
  <!-- ARCHIVED CONVERSATION LIST -->
42
61
  <!-- ---------------------------------- -->
43
- <ion-list-conversations *ngIf="conversationType ==='archived'"
44
- [listConversations]="archivedConversations"
45
- [stylesMap]="stylesMap"
46
- [translationMap]="translationMapConversation"
47
- (onConversationSelected)=onConversationSelected($event)
48
- (onImageLoaded)="onImageLoaded($event)"
62
+ <ion-list-conversations *ngIf="conversationType ==='archived'" [listConversations]="archivedConversations"
63
+ [stylesMap]="stylesMap" [translationMap]="translationMapConversation"
64
+ (onConversationSelected)=onConversationSelected($event) (onImageLoaded)="onImageLoaded($event)"
49
65
  (onConversationLoaded)="onConversationLoaded($event)">
50
66
  </ion-list-conversations>
51
67
  </ng-template>
@@ -84,8 +100,8 @@
84
100
  </ion-label>
85
101
  </ion-item>
86
102
  </div>
87
-
103
+
88
104
  </ng-template>
89
105
  </ion-list>
90
106
  </div>
91
- </ion-content>
107
+ </ion-content>
@@ -135,5 +135,150 @@ ion-list {
135
135
  }
136
136
  }
137
137
 
138
-
139
138
  }
139
+
140
+ .waiting-for-connection {
141
+ --background: #fdd764;
142
+ --min-height: 70px
143
+ }
144
+
145
+ // -------------------------------
146
+ // Spinner
147
+ // -------------------------------
148
+ .sk-fading-circle {
149
+ // margin: 100px auto;
150
+ width: 25px;
151
+ height: 25px;
152
+ position: relative;
153
+ margin-left: 10px;
154
+ margin-top: 13px;
155
+ }
156
+
157
+ .sk-fading-circle .sk-circle {
158
+ width: 100%;
159
+ height: 100%;
160
+ position: absolute;
161
+ left: 0;
162
+ top: 0;
163
+ }
164
+
165
+ .sk-fading-circle .sk-circle:before {
166
+ content: '';
167
+ display: block;
168
+ margin: 0 auto;
169
+ width: 15%;
170
+ height: 15%;
171
+ background-color: #333;
172
+ border-radius: 100%;
173
+ -webkit-animation: sk-circleFadeDelay 1.2s infinite ease-in-out both;
174
+ animation: sk-circleFadeDelay 1.2s infinite ease-in-out both;
175
+ }
176
+ .sk-fading-circle .sk-circle2 {
177
+ -webkit-transform: rotate(30deg);
178
+ -ms-transform: rotate(30deg);
179
+ transform: rotate(30deg);
180
+ }
181
+ .sk-fading-circle .sk-circle3 {
182
+ -webkit-transform: rotate(60deg);
183
+ -ms-transform: rotate(60deg);
184
+ transform: rotate(60deg);
185
+ }
186
+ .sk-fading-circle .sk-circle4 {
187
+ -webkit-transform: rotate(90deg);
188
+ -ms-transform: rotate(90deg);
189
+ transform: rotate(90deg);
190
+ }
191
+ .sk-fading-circle .sk-circle5 {
192
+ -webkit-transform: rotate(120deg);
193
+ -ms-transform: rotate(120deg);
194
+ transform: rotate(120deg);
195
+ }
196
+ .sk-fading-circle .sk-circle6 {
197
+ -webkit-transform: rotate(150deg);
198
+ -ms-transform: rotate(150deg);
199
+ transform: rotate(150deg);
200
+ }
201
+ .sk-fading-circle .sk-circle7 {
202
+ -webkit-transform: rotate(180deg);
203
+ -ms-transform: rotate(180deg);
204
+ transform: rotate(180deg);
205
+ }
206
+ .sk-fading-circle .sk-circle8 {
207
+ -webkit-transform: rotate(210deg);
208
+ -ms-transform: rotate(210deg);
209
+ transform: rotate(210deg);
210
+ }
211
+ .sk-fading-circle .sk-circle9 {
212
+ -webkit-transform: rotate(240deg);
213
+ -ms-transform: rotate(240deg);
214
+ transform: rotate(240deg);
215
+ }
216
+ .sk-fading-circle .sk-circle10 {
217
+ -webkit-transform: rotate(270deg);
218
+ -ms-transform: rotate(270deg);
219
+ transform: rotate(270deg);
220
+ }
221
+ .sk-fading-circle .sk-circle11 {
222
+ -webkit-transform: rotate(300deg);
223
+ -ms-transform: rotate(300deg);
224
+ transform: rotate(300deg);
225
+ }
226
+ .sk-fading-circle .sk-circle12 {
227
+ -webkit-transform: rotate(330deg);
228
+ -ms-transform: rotate(330deg);
229
+ transform: rotate(330deg);
230
+ }
231
+ .sk-fading-circle .sk-circle2:before {
232
+ -webkit-animation-delay: -1.1s;
233
+ animation-delay: -1.1s;
234
+ }
235
+ .sk-fading-circle .sk-circle3:before {
236
+ -webkit-animation-delay: -1s;
237
+ animation-delay: -1s;
238
+ }
239
+ .sk-fading-circle .sk-circle4:before {
240
+ -webkit-animation-delay: -0.9s;
241
+ animation-delay: -0.9s;
242
+ }
243
+ .sk-fading-circle .sk-circle5:before {
244
+ -webkit-animation-delay: -0.8s;
245
+ animation-delay: -0.8s;
246
+ }
247
+ .sk-fading-circle .sk-circle6:before {
248
+ -webkit-animation-delay: -0.7s;
249
+ animation-delay: -0.7s;
250
+ }
251
+ .sk-fading-circle .sk-circle7:before {
252
+ -webkit-animation-delay: -0.6s;
253
+ animation-delay: -0.6s;
254
+ }
255
+ .sk-fading-circle .sk-circle8:before {
256
+ -webkit-animation-delay: -0.5s;
257
+ animation-delay: -0.5s;
258
+ }
259
+ .sk-fading-circle .sk-circle9:before {
260
+ -webkit-animation-delay: -0.4s;
261
+ animation-delay: -0.4s;
262
+ }
263
+ .sk-fading-circle .sk-circle10:before {
264
+ -webkit-animation-delay: -0.3s;
265
+ animation-delay: -0.3s;
266
+ }
267
+ .sk-fading-circle .sk-circle11:before {
268
+ -webkit-animation-delay: -0.2s;
269
+ animation-delay: -0.2s;
270
+ }
271
+ .sk-fading-circle .sk-circle12:before {
272
+ -webkit-animation-delay: -0.1s;
273
+ animation-delay: -0.1s;
274
+ }
275
+
276
+ @-webkit-keyframes sk-circleFadeDelay {
277
+ 0%, 39%, 100% { opacity: 0; }
278
+ 40% { opacity: 1; }
279
+ }
280
+
281
+ @keyframes sk-circleFadeDelay {
282
+ 0%, 39%, 100% { opacity: 0; }
283
+ 40% { opacity: 1; }
284
+ }
@@ -22,16 +22,20 @@ import { NavProxyService } from '../../services/nav-proxy.service';
22
22
  import { TiledeskService } from '../../services/tiledesk/tiledesk.service';
23
23
  import { ConversationDetailPage } from '../conversation-detail/conversation-detail.page';
24
24
  import { ContactsDirectoryPage } from '../contacts-directory/contacts-directory.page';
25
+ import { UnassignedConversationsPage } from '../unassigned-conversations/unassigned-conversations.page';
25
26
  import { ProfileInfoPage } from '../profile-info/profile-info.page';
26
27
  import { MessagingAuthService } from 'src/chat21-core/providers/abstract/messagingAuth.service';
27
28
  import { CustomTranslateService } from 'src/chat21-core/providers/custom-translate.service';
28
29
  import { ImageRepoService } from 'src/chat21-core/providers/abstract/image-repo.service';
29
30
  import { TiledeskAuthService } from 'src/chat21-core/providers/tiledesk/tiledesk-auth.service';
30
31
  import { AppConfigProvider } from '../../services/app-config';
31
-
32
+ import { Subscription } from 'rxjs';
33
+ import { Platform } from '@ionic/angular';
32
34
  // Logger
33
35
  import { LoggerService } from 'src/chat21-core/providers/abstract/logger.service';
34
36
  import { LoggerInstance } from 'src/chat21-core/providers/logger/loggerInstance';
37
+ import { NetworkService } from 'src/app/services/network-service/network.service';
38
+
35
39
 
36
40
  @Component({
37
41
  selector: 'app-conversations-list',
@@ -51,7 +55,7 @@ export class ConversationListPage implements OnInit {
51
55
  public showPlaceholder = true;
52
56
  public numberOpenConv = 0;
53
57
  public loadingIsActive = true;
54
- public supportMode = environment.supportMode;
58
+ public supportMode: boolean;
55
59
 
56
60
  public convertMessage = convertMessage;
57
61
  private isShowMenuPage = false;
@@ -61,8 +65,13 @@ export class ConversationListPage implements OnInit {
61
65
 
62
66
  public conversationType = 'active'
63
67
  headerTitle: string;
68
+ subscription: Subscription;
64
69
 
65
-
70
+ public UNASSIGNED_CONVS_URL: any;
71
+ public hasClickedOpenUnservedConvIframe: boolean = false;
72
+ public lastProjectId: string;
73
+ public isOnline: boolean = true;
74
+ public checkInternet: boolean;
66
75
  constructor(
67
76
  private router: Router,
68
77
  private route: ActivatedRoute,
@@ -78,7 +87,10 @@ export class ConversationListPage implements OnInit {
78
87
  private translateService: CustomTranslateService,
79
88
  public tiledeskService: TiledeskService,
80
89
  public tiledeskAuthService: TiledeskAuthService,
81
- public appConfigProvider: AppConfigProvider
90
+ public appConfigProvider: AppConfigProvider,
91
+ public platform: Platform,
92
+ private networkService: NetworkService,
93
+
82
94
  ) {
83
95
  this.listenToAppCompConvsLengthOnInitConvs();
84
96
  this.listenToLogoutEvent();
@@ -91,16 +103,85 @@ export class ConversationListPage implements OnInit {
91
103
  // @ Lifehooks
92
104
  // -----------------------------------------------
93
105
  ngOnInit() {
106
+ this.watchToConnectionStatus();
107
+ this.getSupportMode();
108
+ }
94
109
 
110
+ getSupportMode() {
111
+ this.supportMode = this.appConfigProvider.getConfig().supportMode;
112
+ // console.log('[ION-LIST-CONVS-COMP] - supportMode ', this.supportMode)
113
+ }
114
+
115
+ watchToConnectionStatus() {
116
+ this.networkService.checkInternetFunc().subscribe(isOnline => {
117
+ this.checkInternet = isOnline
118
+ this.logger.log('[ION-LIST-CONVS-COMP] - watchToConnectionStatus - isOnline', this.checkInternet)
119
+
120
+ // checking internet connection
121
+ if (this.checkInternet == true) {
122
+
123
+ this.isOnline = true;
124
+ } else {
125
+ this.isOnline = false;
126
+ }
127
+ });
95
128
  }
96
129
 
130
+
97
131
  ionViewWillEnter() {
132
+ this.logger.log('Called ionViewDidEnter')
98
133
  this.logger.log('[CONVS-LIST-PAGE] ionViewWillEnter uidConvSelected', this.uidConvSelected);
99
134
  this.listnerStart();
135
+
136
+ // exit from app with hardware back button
137
+ this.subscription = this.platform.backButton.subscribe(() => {
138
+ navigator['app'].exitApp();
139
+ });
140
+ }
141
+
142
+ // unsubscribe backButton.subscribe method to not use from other page
143
+ ionViewWillLeave() {
144
+ this.logger.log('Called ionViewWillLeave')
145
+ this.subscription.unsubscribe();
100
146
  }
101
147
 
102
148
  ionViewDidEnter() { }
103
149
 
150
+ getLastProjectId(projectid: string) {
151
+ this.logger.log('[CONVS-LIST-PAGE] - GET LAST PROJECT ID', projectid);
152
+ this.lastProjectId = projectid;
153
+ }
154
+
155
+ openUnsevedConversationIframe() {
156
+ this.hasClickedOpenUnservedConvIframe = true
157
+ this.logger.log('[CONVS-LIST-PAGE] - HAS CLIKED OPEN UNSERVED REQUEST IFRAME', this.hasClickedOpenUnservedConvIframe);
158
+ const DASHBOARD_BASE_URL = this.appConfigProvider.getConfig().dashboardUrl;
159
+ this.UNASSIGNED_CONVS_URL = DASHBOARD_BASE_URL + '#/project/' + this.lastProjectId + '/unserved-request-for-panel';
160
+ this.logger.log('[CONVS-LIST-PAGE] - HAS CLIKED OPEN UNSERVED REQUEST IFRAME > UNASSIGNED CONVS URL', this.UNASSIGNED_CONVS_URL);
161
+ this.openUnassignedConversations(this.UNASSIGNED_CONVS_URL)
162
+ }
163
+
164
+ // ---------------------------------------------------------
165
+ // Opens the Unassigned Conversations iframe
166
+ // ---------------------------------------------------------
167
+ openUnassignedConversations(UNASSIGNED_CONVS_URL) {
168
+
169
+ if (checkPlatformIsMobile()) {
170
+ presentModal(this.modalController, UnassignedConversationsPage, { unassigned_convs_url: UNASSIGNED_CONVS_URL });
171
+ } else {
172
+ this.navService.push(UnassignedConversationsPage, { unassigned_convs_url: UNASSIGNED_CONVS_URL });
173
+ }
174
+ }
175
+
176
+ _closeContactsDirectory() {
177
+ try {
178
+ closeModal(this.modalController);
179
+ } catch (err) {
180
+ this.logger.error('[CONVS-LIST-PAGE] closeContactsDirectory -> error:', err);
181
+ }
182
+ }
183
+
184
+
104
185
  listenToSwPostMessage() {
105
186
  this.logger.log('[CONVS-LIST-PAGE] listenToNotificationCLick - CALLED: ');
106
187
  const that = this;
@@ -493,8 +574,8 @@ export class ConversationListPage implements OnInit {
493
574
  }
494
575
 
495
576
  onConversationLoaded(conversation: ConversationModel) {
496
- this.logger.log('[CONVS-LIST-PAGE] onConversationLoaded ', conversation)
497
- this.logger.log('[CONVS-LIST-PAGE] onConversationLoaded is new? ', conversation.is_new)
577
+ // this.logger.log('[CONVS-LIST-PAGE] onConversationLoaded ', conversation)
578
+ // this.logger.log('[CONVS-LIST-PAGE] onConversationLoaded is new? ', conversation.is_new)
498
579
  // if (conversation.is_new === false) {
499
580
  // this.ionContentConvList.scrollToTop(0);
500
581
  // }
@@ -0,0 +1,17 @@
1
+ import { NgModule } from '@angular/core';
2
+ import { Routes, RouterModule } from '@angular/router';
3
+
4
+ import { UnassignedConversationsPage } from './unassigned-conversations.page';
5
+
6
+ const routes: Routes = [
7
+ {
8
+ path: '',
9
+ component: UnassignedConversationsPage
10
+ }
11
+ ];
12
+
13
+ @NgModule({
14
+ imports: [RouterModule.forChild(routes)],
15
+ exports: [RouterModule],
16
+ })
17
+ export class UnassignedConversationsPageRoutingModule {}
@@ -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,22 @@
1
+ <ion-header>
2
+ <ion-toolbar>
3
+ <ion-title>{{translationMap?.get('NewConversations') }}</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
+ [ngClass]="{'ion-content-black-background' : isProjectsForPanel === true}">
14
+ <!-- <iframe id="i_frame" style="width:100%; height:99%" frameBorder="0" allowfullscreen [src]="unassigned_convs_url_sanitized"></iframe> -->
15
+ <!-- <div class="stretchspinner-unassigned-convs">
16
+ <div class="rect1"></div>
17
+ <div class="rect2"></div>
18
+ <div class="rect3"></div>
19
+ <div class="rect4"></div>
20
+ <div class="rect5"></div>
21
+ </div> -->
22
+ </ion-content>
@@ -0,0 +1,79 @@
1
+ .ion-content-black-background {
2
+ --background: #2d323e
3
+ }
4
+
5
+ // -------------------------------------------------
6
+ // stretch spinner https://tobiasahlin.com/spinkit/
7
+ // -------------------------------------------------
8
+ .stretchspinner-unassigned-convs {
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
+ .hide-stretchspinner {
78
+ display: none;
79
+ }
@@ -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,108 @@
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
+
24
+ isProjectsForPanel: boolean = false
25
+
26
+ public translationMap: Map<string, string>;
27
+ constructor(
28
+ private modalController: ModalController,
29
+ private navService: NavProxyService,
30
+ private sanitizer: DomSanitizer,
31
+ private translateService: CustomTranslateService,
32
+ ) { }
33
+
34
+ ngOnInit() {
35
+ const keys = ['UnassignedConversations', 'NewConversations'];
36
+ this.translationMap = this.translateService.translateLanguage(keys);
37
+ this.buildIFRAME();
38
+ this.listenToPostMsg();
39
+ }
40
+
41
+ buildIFRAME() {
42
+ this.logger.log('[UNASSIGNED-CONVS-PAGE] - UNASSIGNED CONVS URL (ngOnInit)', this.unassigned_convs_url);
43
+ this.unassigned_convs_url_sanitized = this.sanitizer.sanitize(SecurityContext.URL, this.unassigned_convs_url)
44
+ this.logger.log('[UNASSIGNED-CONVS-PAGE] - UNASSIGNED CONVS URL SANITIZED (ngOnInit)', this.unassigned_convs_url_sanitized);
45
+ // this.has_loaded = false
46
+
47
+ this.ion_content = document.getElementById("iframe-ion-content");
48
+ this.iframe = document.createElement("iframe");
49
+ this.iframe.src = this.unassigned_convs_url_sanitized;
50
+ this.iframe.width = "100%";
51
+ this.iframe.height = "99%";
52
+ this.iframe.id = "unassigned-convs-iframe"
53
+ this.iframe.frameBorder = "0";
54
+ this.iframe.style.border = "none";
55
+ this.iframe.style.background = "white";
56
+ this.ion_content.appendChild(this.iframe);
57
+
58
+ // this.getIframeHaLoaded()
59
+ }
60
+
61
+ getIframeHaLoaded() {
62
+ var self = this;
63
+ var iframe = document.getElementById('unassigned-convs-iframe') as HTMLIFrameElement;;
64
+ this.logger.log('[APP-STORE-INSTALL] GET iframe ', iframe)
65
+ if (iframe) {
66
+ iframe.addEventListener("load", function () {
67
+ self.logger.log("[APP-STORE-INSTALL] GET - Finish");
68
+ let spinnerElem = <HTMLElement>document.querySelector('.stretchspinner-unassigned-convs')
69
+
70
+ self.logger.log('[APP-STORE-INSTALL] GET iframeDoc readyState spinnerElem', spinnerElem)
71
+ spinnerElem.classList.add("hide-stretchspinner")
72
+
73
+ });
74
+ }
75
+ }
76
+
77
+ listenToPostMsg() {
78
+ window.addEventListener("message", (event) => {
79
+ // console.log("[UNASSIGNED-CONVS-PAGE] message event ", event);
80
+
81
+ if (event && event.data) {
82
+ if (event.data === 'onInitProjectsForPanel') {
83
+ this.isProjectsForPanel = true;
84
+ }
85
+ if (event.data === 'onDestroyProjectsForPanel') {
86
+ this.isProjectsForPanel = false;
87
+ }
88
+ }
89
+ });
90
+ }
91
+
92
+
93
+ async onClose() {
94
+ this.logger.log('[UNASSIGNED-CONVS-PAGE] - onClose MODAL')
95
+ this.logger.log('[UNASSIGNED-CONVS-PAGE] - onClose MODAL isModalOpened ', await this.modalController.getTop())
96
+ const isModalOpened = await this.modalController.getTop();
97
+
98
+ if (isModalOpened) {
99
+ this.modalController.dismiss({
100
+
101
+ confirmed: true
102
+ });
103
+ } else {
104
+ this.navService.pop();
105
+ }
106
+ }
107
+
108
+ }