2018-07-16 18:42:49 +02:00
|
|
|
import { Component } from '@angular/core';
|
2018-07-18 23:10:26 +02:00
|
|
|
import { ActivatedRoute } from '@angular/router';
|
|
|
|
|
2019-02-18 22:10:32 +01:00
|
|
|
import { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';
|
2018-07-18 23:10:26 +02:00
|
|
|
import { UserService } from 'jslib/abstractions/user.service';
|
2018-07-16 18:42:49 +02:00
|
|
|
|
|
|
|
@Component({
|
|
|
|
selector: 'app-org-settings',
|
|
|
|
templateUrl: 'settings.component.html',
|
|
|
|
})
|
2018-07-18 23:10:26 +02:00
|
|
|
export class SettingsComponent {
|
|
|
|
access2fa = false;
|
2019-02-18 22:10:32 +01:00
|
|
|
selfHosted: boolean;
|
2018-07-18 23:10:26 +02:00
|
|
|
|
2019-02-18 22:10:32 +01:00
|
|
|
constructor(private route: ActivatedRoute, private userService: UserService,
|
|
|
|
private platformUtilsService: PlatformUtilsService) { }
|
2018-07-18 23:10:26 +02:00
|
|
|
|
|
|
|
ngOnInit() {
|
|
|
|
this.route.parent.params.subscribe(async (params) => {
|
2019-02-18 22:10:32 +01:00
|
|
|
this.selfHosted = await this.platformUtilsService.isSelfHost();
|
2018-07-18 23:10:26 +02:00
|
|
|
const organization = await this.userService.getOrganization(params.organizationId);
|
|
|
|
this.access2fa = organization.use2fa;
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|