 Thomas Kaul
					
					2 years ago
						Thomas Kaul
					
					2 years ago
					
						
							committed by
							
								 GitHub
								GitHub
							
						 
					
				 
				
			 
		 
		
			
				
					
					No known key found for this signature in database
					
						
							GPG Key ID: B5690EEEBB952194
						
					
				
			
		
		
		
	
		
			
				 4 changed files with 
34 additions and 
6 deletions
			 
			
		 
		
			
				- 
					
					
					 
					apps/api/src/app/user/user.service.ts
				
- 
					
					
					 
					apps/client/src/app/components/header/header.component.html
				
- 
					
					
					 
					apps/client/src/app/components/header/header.module.ts
				
- 
					
					
					 
					apps/client/src/app/components/user-account-membership/user-account-membership.html
				
				
				
					
						
							
								
									
	
		
			
				
					|  |  | @ -219,18 +219,18 @@ export class UserService { | 
			
		
	
		
			
				
					|  |  |  |           new Date(), | 
			
		
	
		
			
				
					|  |  |  |           user.createdAt | 
			
		
	
		
			
				
					|  |  |  |         ); | 
			
		
	
		
			
				
					|  |  |  |         let frequency = 15; | 
			
		
	
		
			
				
					|  |  |  |         let frequency = 10; | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |         if (daysSinceRegistration > 365) { | 
			
		
	
		
			
				
					|  |  |  |           frequency = 2; | 
			
		
	
		
			
				
					|  |  |  |         } else if (daysSinceRegistration > 180) { | 
			
		
	
		
			
				
					|  |  |  |           frequency = 3; | 
			
		
	
		
			
				
					|  |  |  |         } else if (daysSinceRegistration > 60) { | 
			
		
	
		
			
				
					|  |  |  |           frequency = 5; | 
			
		
	
		
			
				
					|  |  |  |           frequency = 4; | 
			
		
	
		
			
				
					|  |  |  |         } else if (daysSinceRegistration > 30) { | 
			
		
	
		
			
				
					|  |  |  |           frequency = 8; | 
			
		
	
		
			
				
					|  |  |  |           frequency = 6; | 
			
		
	
		
			
				
					|  |  |  |         } else if (daysSinceRegistration > 15) { | 
			
		
	
		
			
				
					|  |  |  |           frequency = 12; | 
			
		
	
		
			
				
					|  |  |  |           frequency = 8; | 
			
		
	
		
			
				
					|  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |         if (Analytics?.activityCount % frequency === 1) { | 
			
		
	
	
		
			
				
					|  |  | 
 | 
			
		
	
								
							
						
					 
					
				 
			 
		
			
			
			
			
			
			
				
				
					
						
							
								
									
	
		
			
				
					|  |  | @ -165,6 +165,32 @@ | 
			
		
	
		
			
				
					|  |  |  |           /> | 
			
		
	
		
			
				
					|  |  |  |         </button> | 
			
		
	
		
			
				
					|  |  |  |         <mat-menu #accountMenu="matMenu" xPosition="before"> | 
			
		
	
		
			
				
					|  |  |  |           <ng-container | 
			
		
	
		
			
				
					|  |  |  |             *ngIf=" | 
			
		
	
		
			
				
					|  |  |  |               hasPermissionForSubscription && | 
			
		
	
		
			
				
					|  |  |  |               user?.subscription?.type === 'Basic' | 
			
		
	
		
			
				
					|  |  |  |             " | 
			
		
	
		
			
				
					|  |  |  |           > | 
			
		
	
		
			
				
					|  |  |  |             <a class="d-flex" mat-menu-item [routerLink]="routerLinkPricing" | 
			
		
	
		
			
				
					|  |  |  |               ><span class="align-items-center d-flex" | 
			
		
	
		
			
				
					|  |  |  |                 ><span | 
			
		
	
		
			
				
					|  |  |  |                   ><ng-container | 
			
		
	
		
			
				
					|  |  |  |                     *ngIf="user.subscription.offer === 'default'" | 
			
		
	
		
			
				
					|  |  |  |                     i18n | 
			
		
	
		
			
				
					|  |  |  |                     >Upgrade Plan</ng-container | 
			
		
	
		
			
				
					|  |  |  |                   > | 
			
		
	
		
			
				
					|  |  |  |                   <ng-container | 
			
		
	
		
			
				
					|  |  |  |                     *ngIf="user.subscription.offer === 'renewal'" | 
			
		
	
		
			
				
					|  |  |  |                     i18n | 
			
		
	
		
			
				
					|  |  |  |                     >Renew Plan</ng-container | 
			
		
	
		
			
				
					|  |  |  |                   ></span | 
			
		
	
		
			
				
					|  |  |  |                 > | 
			
		
	
		
			
				
					|  |  |  |                 <gf-premium-indicator | 
			
		
	
		
			
				
					|  |  |  |                   class="d-inline-block ml-1" | 
			
		
	
		
			
				
					|  |  |  |                   [enableLink]="false" /></span | 
			
		
	
		
			
				
					|  |  |  |             ></a> | 
			
		
	
		
			
				
					|  |  |  |             <hr class="m-0" /> | 
			
		
	
		
			
				
					|  |  |  |           </ng-container> | 
			
		
	
		
			
				
					|  |  |  |           <ng-container *ngIf="user?.access?.length > 0"> | 
			
		
	
		
			
				
					|  |  |  |             <button mat-menu-item (click)="impersonateAccount(null)"> | 
			
		
	
		
			
				
					|  |  |  |               <span class="align-items-center d-flex"> | 
			
		
	
	
		
			
				
					|  |  | 
 | 
			
		
	
								
							
						
					 
					
				 
			 
		
			
			
			
			
			
			
				
				
					
						
							
								
									
	
		
			
				
					|  |  | @ -7,6 +7,7 @@ import { RouterModule } from '@angular/router'; | 
			
		
	
		
			
				
					|  |  |  | import { LoginWithAccessTokenDialogModule } from '@ghostfolio/client/components/login-with-access-token-dialog/login-with-access-token-dialog.module'; | 
			
		
	
		
			
				
					|  |  |  | import { GfAssistantModule } from '@ghostfolio/ui/assistant'; | 
			
		
	
		
			
				
					|  |  |  | import { GfLogoModule } from '@ghostfolio/ui/logo'; | 
			
		
	
		
			
				
					|  |  |  | import { GfPremiumIndicatorModule } from '@ghostfolio/ui/premium-indicator'; | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  | import { HeaderComponent } from './header.component'; | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
	
		
			
				
					|  |  | @ -17,6 +18,7 @@ import { HeaderComponent } from './header.component'; | 
			
		
	
		
			
				
					|  |  |  |     CommonModule, | 
			
		
	
		
			
				
					|  |  |  |     GfAssistantModule, | 
			
		
	
		
			
				
					|  |  |  |     GfLogoModule, | 
			
		
	
		
			
				
					|  |  |  |     GfPremiumIndicatorModule, | 
			
		
	
		
			
				
					|  |  |  |     LoginWithAccessTokenDialogModule, | 
			
		
	
		
			
				
					|  |  |  |     MatButtonModule, | 
			
		
	
		
			
				
					|  |  |  |     MatMenuModule, | 
			
		
	
	
		
			
				
					|  |  | 
 | 
			
		
	
								
							
						
					 
					
				 
			 
		
			
			
			
			
			
			
				
				
					
						
							
								
									
	
		
			
				
					|  |  | @ -15,10 +15,10 @@ | 
			
		
	
		
			
				
					|  |  |  |           > | 
			
		
	
		
			
				
					|  |  |  |             <button color="primary" mat-flat-button (click)="onCheckout()"> | 
			
		
	
		
			
				
					|  |  |  |               <ng-container *ngIf="user.subscription.offer === 'default'" i18n | 
			
		
	
		
			
				
					|  |  |  |                 >Upgrade</ng-container | 
			
		
	
		
			
				
					|  |  |  |                 >Upgrade Plan</ng-container | 
			
		
	
		
			
				
					|  |  |  |               > | 
			
		
	
		
			
				
					|  |  |  |               <ng-container *ngIf="user.subscription.offer === 'renewal'" i18n | 
			
		
	
		
			
				
					|  |  |  |                 >Renew</ng-container | 
			
		
	
		
			
				
					|  |  |  |                 >Renew Plan</ng-container | 
			
		
	
		
			
				
					|  |  |  |               > | 
			
		
	
		
			
				
					|  |  |  |             </button> | 
			
		
	
		
			
				
					|  |  |  |             <div *ngIf="price" class="mt-1 text-center"> | 
			
		
	
	
		
			
				
					|  |  | 
 |