dont show billing page on self host
This commit is contained in:
parent
92b2601ba2
commit
8305b49046
|
@ -10,7 +10,7 @@
|
||||||
<a routerLink="subscription" class="list-group-item" routerLinkActive="active">
|
<a routerLink="subscription" class="list-group-item" routerLinkActive="active">
|
||||||
{{'subscription' | i18n}}
|
{{'subscription' | i18n}}
|
||||||
</a>
|
</a>
|
||||||
<a routerLink="billing" class="list-group-item" routerLinkActive="active">
|
<a routerLink="billing" class="list-group-item" routerLinkActive="active" *ngIf="!selfHosted">
|
||||||
{{'billing' | i18n}}
|
{{'billing' | i18n}}
|
||||||
</a>
|
</a>
|
||||||
<a routerLink="two-factor" class="list-group-item" routerLinkActive="active" *ngIf="access2fa">
|
<a routerLink="two-factor" class="list-group-item" routerLinkActive="active" *ngIf="access2fa">
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import { Component } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
import { ActivatedRoute } from '@angular/router';
|
import { ActivatedRoute } from '@angular/router';
|
||||||
|
|
||||||
|
import { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';
|
||||||
import { UserService } from 'jslib/abstractions/user.service';
|
import { UserService } from 'jslib/abstractions/user.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
|
@ -9,11 +10,14 @@ import { UserService } from 'jslib/abstractions/user.service';
|
||||||
})
|
})
|
||||||
export class SettingsComponent {
|
export class SettingsComponent {
|
||||||
access2fa = false;
|
access2fa = false;
|
||||||
|
selfHosted: boolean;
|
||||||
|
|
||||||
constructor(private route: ActivatedRoute, private userService: UserService) { }
|
constructor(private route: ActivatedRoute, private userService: UserService,
|
||||||
|
private platformUtilsService: PlatformUtilsService) { }
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.route.parent.params.subscribe(async (params) => {
|
this.route.parent.params.subscribe(async (params) => {
|
||||||
|
this.selfHosted = await this.platformUtilsService.isSelfHost();
|
||||||
const organization = await this.userService.getOrganization(params.organizationId);
|
const organization = await this.userService.getOrganization(params.organizationId);
|
||||||
this.access2fa = organization.use2fa;
|
this.access2fa = organization.use2fa;
|
||||||
});
|
});
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
<a routerLink="premium" class="list-group-item" routerLinkActive="active" *ngIf="!premium">
|
<a routerLink="premium" class="list-group-item" routerLinkActive="active" *ngIf="!premium">
|
||||||
{{'goPremium' | i18n}}
|
{{'goPremium' | i18n}}
|
||||||
</a>
|
</a>
|
||||||
<a routerLink="billing" class="list-group-item" routerLinkActive="active">
|
<a routerLink="billing" class="list-group-item" routerLinkActive="active" *ngIf="!selfHosted">
|
||||||
{{'billing' | i18n}}
|
{{'billing' | i18n}}
|
||||||
</a>
|
</a>
|
||||||
<a routerLink="two-factor" class="list-group-item" routerLinkActive="active">
|
<a routerLink="two-factor" class="list-group-item" routerLinkActive="active">
|
||||||
|
|
|
@ -5,6 +5,7 @@ import {
|
||||||
OnInit,
|
OnInit,
|
||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
|
|
||||||
|
import { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';
|
||||||
import { TokenService } from 'jslib/abstractions/token.service';
|
import { TokenService } from 'jslib/abstractions/token.service';
|
||||||
|
|
||||||
import { BroadcasterService } from 'jslib/angular/services/broadcaster.service';
|
import { BroadcasterService } from 'jslib/angular/services/broadcaster.service';
|
||||||
|
@ -17,9 +18,10 @@ const BroadcasterSubscriptionId = 'SettingsComponent';
|
||||||
})
|
})
|
||||||
export class SettingsComponent implements OnInit, OnDestroy {
|
export class SettingsComponent implements OnInit, OnDestroy {
|
||||||
premium: boolean;
|
premium: boolean;
|
||||||
|
selfHosted: boolean;
|
||||||
|
|
||||||
constructor(private tokenService: TokenService, private broadcasterService: BroadcasterService,
|
constructor(private tokenService: TokenService, private broadcasterService: BroadcasterService,
|
||||||
private ngZone: NgZone) { }
|
private ngZone: NgZone, private platformUtilsService: PlatformUtilsService) { }
|
||||||
|
|
||||||
async ngOnInit() {
|
async ngOnInit() {
|
||||||
this.broadcasterService.subscribe(BroadcasterSubscriptionId, async (message: any) => {
|
this.broadcasterService.subscribe(BroadcasterSubscriptionId, async (message: any) => {
|
||||||
|
@ -33,6 +35,7 @@ export class SettingsComponent implements OnInit, OnDestroy {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this.selfHosted = await this.platformUtilsService.isSelfHost();
|
||||||
await this.load();
|
await this.load();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue