premium access already notice

This commit is contained in:
Kyle Spearrin 2018-08-31 17:42:19 -04:00
parent 1d941baff1
commit 0c9f122719
3 changed files with 13 additions and 1 deletions

View File

@ -1,6 +1,9 @@
<div class="page-header">
<h1>{{'goPremium' | i18n}}</h1>
</div>
<app-callout type="info" *ngIf="canAccessPremium" title="{{'youHavePremiumAccess' | i18n}}" icon="fa-star">
{{'alreadyPremiumFromOrg' | i18n}}
</app-callout>
<app-callout type="success">
<p>{{'premiumUpgradeUnlockFeatures' | i18n}}</p>
<ul class="fa-ul">

View File

@ -14,6 +14,7 @@ import { MessagingService } from 'jslib/abstractions/messaging.service';
import { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';
import { SyncService } from 'jslib/abstractions/sync.service';
import { TokenService } from 'jslib/abstractions/token.service';
import { UserService } from 'jslib/abstractions/user.service';
import { PaymentComponent } from './payment.component';
@ -24,6 +25,7 @@ import { PaymentComponent } from './payment.component';
export class PremiumComponent implements OnInit {
@ViewChild(PaymentComponent) paymentComponent: PaymentComponent;
canAccessPremium = false;
selfHosted = false;
premiumPrice = 10;
storageGbPrice = 4;
@ -35,11 +37,12 @@ export class PremiumComponent implements OnInit {
private analytics: Angulartics2, private toasterService: ToasterService,
platformUtilsService: PlatformUtilsService, private tokenService: TokenService,
private router: Router, private messagingService: MessagingService,
private syncService: SyncService) {
private syncService: SyncService, private userService: UserService) {
this.selfHosted = platformUtilsService.isSelfHost();
}
async ngOnInit() {
this.canAccessPremium = await this.userService.canAccessPremium();
const premium = await this.tokenService.getPremium();
if (premium) {
this.router.navigate(['/settings/billing']);

View File

@ -1078,6 +1078,12 @@
"premiumRequiredDesc": {
"message": "A premium membership is required to use this feature."
},
"youHavePremiumAccess": {
"message": "You have premium access"
},
"alreadyPremiumFromOrg": {
"message": "You already have access to premium features because of an organization you are a member of."
},
"manage": {
"message": "Manage"
},