@@ -12,6 +12,7 @@ import { endpoints } from '../../../_services/endpoints';
1212import { UpdateWorklistService } from '../../../_messages/update-worklist.service' ;
1313import { NgZone } from '@angular/core' ;
1414import { ServerConfigService } from '../../../_services/server-config.service' ;
15+ import { compareSdkPCoreVersions } from '../../../_helpers/versionHelpers' ;
1516
1617
1718declare global {
@@ -56,7 +57,7 @@ export class TopAppMashupComponent implements OnInit {
5657 props$ : any ;
5758 PCore$ : any ;
5859
59-
60+
6061
6162 storeUnsubscribe : any ;
6263 store : any ;
@@ -81,7 +82,7 @@ export class TopAppMashupComponent implements OnInit {
8182
8283
8384
84- constructor ( private glsservice : GetLoginStatusService ,
85+ constructor ( private glsservice : GetLoginStatusService ,
8586 private cdRef : ChangeDetectorRef ,
8687 private snackBar : MatSnackBar ,
8788 private settingsDialog : MatDialog ,
@@ -90,25 +91,25 @@ export class TopAppMashupComponent implements OnInit {
9091 private uwservice : UpdateWorklistService ,
9192 private ngZone : NgZone ,
9293 private scservice : ServerConfigService
93- ) {
94+ ) {
9495
9596
9697 }
9798
9899 ngOnInit ( ) {
99-
100+
100101 this . scservice . getServerConfig ( ) . then ( ( ) => {
101102 this . initialize ( ) ;
102103 } ) ;
103-
104+
104105 }
105106
106107 ngOnDestroy ( ) {
107108 this . subscription . unsubscribe ( ) ;
108109 this . progressSpinnerSubscription . unsubscribe ( ) ;
109110 this . resetPConnectSubscription . unsubscribe ( ) ;
110111 }
111-
112+
112113
113114 initialize ( ) {
114115 if ( sessionStorage . getItem ( "userFullName" ) && sessionStorage . getItem ( "userPortal" ) ) {
@@ -129,7 +130,7 @@ export class TopAppMashupComponent implements OnInit {
129130 this . bLoggedIn$ = true ;
130131 this . userName$ = sessionStorage . getItem ( "userFullName" ) ;
131132 } ) ;
132-
133+
133134 this . getPConnectAndUpdate ( ) ;
134135
135136 }
@@ -148,7 +149,7 @@ export class TopAppMashupComponent implements OnInit {
148149 setTimeout ( ( ) => {
149150 window . location . reload ( ) ;
150151 } )
151-
152+
152153 }
153154
154155
@@ -157,7 +158,7 @@ export class TopAppMashupComponent implements OnInit {
157158 ) ;
158159
159160 // handle showing and hiding the progress spinner
160- this . progressSpinnerSubscription = this . psservice . getMessage ( ) . subscribe ( message => {
161+ this . progressSpinnerSubscription = this . psservice . getMessage ( ) . subscribe ( message => {
161162 this . progressSpinnerMessage = message ;
162163
163164 this . showHideProgress ( this . progressSpinnerMessage . show ) ;
@@ -183,10 +184,10 @@ export class TopAppMashupComponent implements OnInit {
183184 // // update the worklist
184185 // this.uwservice.sendMessage(true);
185186
186-
187+
187188 // });
188189
189-
190+
190191 // }
191192
192193 } ) ;
@@ -232,7 +233,7 @@ export class TopAppMashupComponent implements OnInit {
232233 // OATH
233234 oHeaders [ "Authorization" ] = sessionStorage . getItem ( "oauthUser" ) ;
234235 }
235-
236+
236237
237238 oConfig [ "additionalHeaders" ] = oHeaders ;
238239
@@ -259,8 +260,10 @@ export class TopAppMashupComponent implements OnInit {
259260 pConnectUpdate ( oConfig : any , bootstrapShell : any ) {
260261 bootstrapShell . bootstrap ( oConfig ) . then ( ( ) => {
261262
262-
263+
263264 window . PCore . onPCoreReady ( ( renderObj ) => {
265+ // Check that we're seeing the PCore version we expect
266+ compareSdkPCoreVersions ( ) ;
264267
265268
266269 // Change to reflect new use of arg in the callback:
@@ -283,24 +286,24 @@ export class TopAppMashupComponent implements OnInit {
283286
284287
285288 this . ngZone . run ( ( ) => {
286-
289+
287290 this . props$ = props ;
288-
291+
289292 this . pConn$ = this . props$ . getPConnect ( ) ;
290-
293+
291294 this . sComponentName$ = this . pConn$ . getComponentName ( ) ;
292-
295+
293296 this . store = window . PCore . getStore ( ) ;
294297 this . PCore$ = window . PCore ;
295-
298+
296299 this . arChildren$ = this . pConn$ . getChildren ( ) ;
297-
298-
300+
301+
299302 this . bPCoreReady$ = true ;
300303
301-
302-
303- } ) ;
304+
305+
306+ } ) ;
304307
305308
306309 } ) ;
@@ -317,15 +320,15 @@ export class TopAppMashupComponent implements OnInit {
317320 ( err ) => {
318321 alert ( "error" ) ;
319322 }
320-
323+
321324 ) ;
322325 }
323-
326+
324327
325328 showHideProgress ( bShow : boolean ) {
326329
327330 return ;
328-
331+
329332 if ( bShow ) {
330333
331334 if ( ! this . isProgress$ ) {
@@ -361,7 +364,7 @@ export class TopAppMashupComponent implements OnInit {
361364 } ) ;
362365 }
363366
364-
367+
365368 }
366369 }
367370
@@ -374,25 +377,27 @@ export class TopAppMashupComponent implements OnInit {
374377 doSubscribe ( ) {
375378
376379
377-
380+
378381 window . PCore . onPCoreReady ( ( renderObj : any ) => {
379-
382+ // Check that we're seeing the PCore version we expect
383+ compareSdkPCoreVersions ( ) ;
384+
380385 // Change to reflect new use of arg in the callback:
381386 const { props /*, domContainerID = null */ } = renderObj ;
382387
383388 this . ngZone . run ( ( ) => {
384389 this . props$ = props ;
385390
386391 this . pConn$ = this . props$ . getPConnect ( ) ;
387-
392+
388393 this . sComponentName$ = this . pConn$ . getComponentName ( ) ;
389-
394+
390395 this . store = window . PCore . getStore ( ) ;
391396 this . PCore$ = window . PCore ;
392-
397+
393398 this . arChildren$ = this . pConn$ . getChildren ( ) ;
394-
395-
399+
400+
396401 this . bPCoreReady$ = true ;
397402
398403 } ) ;
@@ -416,7 +421,7 @@ export class TopAppMashupComponent implements OnInit {
416421 // timer.unsubscribe();
417422
418423 // }
419-
424+
420425 // });
421426
422427 }
0 commit comments