|  | @ -28,6 +28,7 @@ import { takeUntil } from 'rxjs/operators'; | 
			
		
	
		
		
			
				
					|  |  | export class HomeHoldingsComponent implements OnDestroy, OnInit { |  |  | export class HomeHoldingsComponent implements OnDestroy, OnInit { | 
			
		
	
		
		
			
				
					|  |  |   public deviceType: string; |  |  |   public deviceType: string; | 
			
		
	
		
		
			
				
					|  |  |   public hasImpersonationId: boolean; |  |  |   public hasImpersonationId: boolean; | 
			
		
	
		
		
			
				
					|  |  |  |  |  |   public hasPermissionToAccessHoldingsChart: boolean; | 
			
		
	
		
		
			
				
					|  |  |   public hasPermissionToCreateOrder: boolean; |  |  |   public hasPermissionToCreateOrder: boolean; | 
			
		
	
		
		
			
				
					|  |  |   public holdings: PortfolioPosition[]; |  |  |   public holdings: PortfolioPosition[]; | 
			
		
	
		
		
			
				
					|  |  |   public holdingType: HoldingType = 'ACTIVE'; |  |  |   public holdingType: HoldingType = 'ACTIVE'; | 
			
		
	
	
		
		
			
				
					|  | @ -65,20 +66,17 @@ export class HomeHoldingsComponent implements OnDestroy, OnInit { | 
			
		
	
		
		
			
				
					|  |  |         if (state?.user) { |  |  |         if (state?.user) { | 
			
		
	
		
		
			
				
					|  |  |           this.user = state.user; |  |  |           this.user = state.user; | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |  |  |  |           this.hasPermissionToAccessHoldingsChart = hasPermission( | 
			
		
	
		
		
			
				
					|  |  |  |  |  |             this.user.permissions, | 
			
		
	
		
		
			
				
					|  |  |  |  |  |             permissions.accessHoldingsChart | 
			
		
	
		
		
			
				
					|  |  |  |  |  |           ); | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |           this.hasPermissionToCreateOrder = hasPermission( |  |  |           this.hasPermissionToCreateOrder = hasPermission( | 
			
		
	
		
		
			
				
					|  |  |             this.user.permissions, |  |  |             this.user.permissions, | 
			
		
	
		
		
			
				
					|  |  |             permissions.createOrder |  |  |             permissions.createOrder | 
			
		
	
		
		
			
				
					|  |  |           ); |  |  |           ); | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |           this.holdings = undefined; |  |  |           this.initialize(); | 
			
				
				
			
		
	
		
		
			
				
					|  |  | 
 |  |  |  | 
			
		
	
		
		
			
				
					|  |  |           this.fetchHoldings() |  |  |  | 
			
		
	
		
		
			
				
					|  |  |             .pipe(takeUntil(this.unsubscribeSubject)) |  |  |  | 
			
		
	
		
		
			
				
					|  |  |             .subscribe(({ holdings }) => { |  |  |  | 
			
		
	
		
		
			
				
					|  |  |               this.holdings = holdings; |  |  |  | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  |  | 
			
		
	
		
		
			
				
					|  |  |               this.changeDetectorRef.markForCheck(); |  |  |  | 
			
		
	
		
		
			
				
					|  |  |             }); |  |  |  | 
			
		
	
		
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |           this.changeDetectorRef.markForCheck(); |  |  |           this.changeDetectorRef.markForCheck(); | 
			
		
	
		
		
			
				
					|  |  |         } |  |  |         } | 
			
		
	
	
		
		
			
				
					|  | @ -88,22 +86,7 @@ export class HomeHoldingsComponent implements OnDestroy, OnInit { | 
			
		
	
		
		
			
				
					|  |  |   public onChangeHoldingType(aHoldingType: HoldingType) { |  |  |   public onChangeHoldingType(aHoldingType: HoldingType) { | 
			
		
	
		
		
			
				
					|  |  |     this.holdingType = aHoldingType; |  |  |     this.holdingType = aHoldingType; | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |     if (this.holdingType === 'ACTIVE') { |  |  |     this.initialize(); | 
			
				
				
			
		
	
		
		
			
				
					|  |  |       this.viewModeFormControl.enable(); |  |  |  | 
			
		
	
		
		
			
				
					|  |  |     } else if (this.holdingType === 'CLOSED') { |  |  |  | 
			
		
	
		
		
			
				
					|  |  |       this.viewModeFormControl.disable(); |  |  |  | 
			
		
	
		
		
			
				
					|  |  |       this.viewModeFormControl.setValue('TABLE'); |  |  |  | 
			
		
	
		
		
			
				
					|  |  |     } |  |  |  | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  |  | 
			
		
	
		
		
			
				
					|  |  |     this.holdings = undefined; |  |  |  | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  |  | 
			
		
	
		
		
			
				
					|  |  |     this.fetchHoldings() |  |  |  | 
			
		
	
		
		
			
				
					|  |  |       .pipe(takeUntil(this.unsubscribeSubject)) |  |  |  | 
			
		
	
		
		
			
				
					|  |  |       .subscribe(({ holdings }) => { |  |  |  | 
			
		
	
		
		
			
				
					|  |  |         this.holdings = holdings; |  |  |  | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  |  | 
			
		
	
		
		
			
				
					|  |  |         this.changeDetectorRef.markForCheck(); |  |  |  | 
			
		
	
		
		
			
				
					|  |  |       }); |  |  |  | 
			
		
	
		
		
	
		
		
			
				
					|  |  |   } |  |  |   } | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |   public onSymbolClicked({ dataSource, symbol }: UniqueAsset) { |  |  |   public onSymbolClicked({ dataSource, symbol }: UniqueAsset) { | 
			
		
	
	
		
		
			
				
					|  | @ -131,4 +114,27 @@ export class HomeHoldingsComponent implements OnDestroy, OnInit { | 
			
		
	
		
		
			
				
					|  |  |       range: this.user?.settings?.dateRange |  |  |       range: this.user?.settings?.dateRange | 
			
		
	
		
		
			
				
					|  |  |     }); |  |  |     }); | 
			
		
	
		
		
			
				
					|  |  |   } |  |  |   } | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |  |  |  |   private initialize() { | 
			
		
	
		
		
			
				
					|  |  |  |  |  |     this.viewModeFormControl.disable(); | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |  |  |  |     if ( | 
			
		
	
		
		
			
				
					|  |  |  |  |  |       this.hasPermissionToAccessHoldingsChart && | 
			
		
	
		
		
			
				
					|  |  |  |  |  |       this.holdingType === 'ACTIVE' | 
			
		
	
		
		
			
				
					|  |  |  |  |  |     ) { | 
			
		
	
		
		
			
				
					|  |  |  |  |  |       this.viewModeFormControl.enable(); | 
			
		
	
		
		
			
				
					|  |  |  |  |  |     } else if (this.holdingType === 'CLOSED') { | 
			
		
	
		
		
			
				
					|  |  |  |  |  |       this.viewModeFormControl.setValue('TABLE'); | 
			
		
	
		
		
			
				
					|  |  |  |  |  |     } | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |  |  |  |     this.holdings = undefined; | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |  |  |  |     this.fetchHoldings() | 
			
		
	
		
		
			
				
					|  |  |  |  |  |       .pipe(takeUntil(this.unsubscribeSubject)) | 
			
		
	
		
		
			
				
					|  |  |  |  |  |       .subscribe(({ holdings }) => { | 
			
		
	
		
		
			
				
					|  |  |  |  |  |         this.holdings = holdings; | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |  |  |  |         this.changeDetectorRef.markForCheck(); | 
			
		
	
		
		
			
				
					|  |  |  |  |  |       }); | 
			
		
	
		
		
			
				
					|  |  |  |  |  |   } | 
			
		
	
		
		
			
				
					|  |  | } |  |  | } | 
			
		
	
	
		
		
			
				
					|  | 
 |