1
0
mirror of https://github.com/bitwarden/browser synced 2026-01-05 01:53:55 +00:00
Files
browser/bitwarden_license/bit-web/src/app/app.component.ts
cyprain-okeke c17f582768 [PM-13345]Add the new policy (#11894)
* Add the new policy

* Add the free family policy behind flag

* Patch build process

* Revert "Patch build process"

This reverts commit 4024e974b1.

* [PM-13346] Email notification impacts (#11967)

* Changes error notification for disabled offer

* Add the feature to the change

* Add the missing dot

* Remove the authenicated endpoint

* Add the changes for error toast

* Resolve the lint issue

* rename file a correctly

* Remove the floating promise comments

* Delete unwanted comments

---------

Co-authored-by: Matt Bishop <mbishop@bitwarden.com>
2024-11-19 17:36:52 +01:00

44 lines
1.7 KiB
TypeScript

import { Component, OnInit } from "@angular/core";
import { FeatureFlag } from "@bitwarden/common/enums/feature-flag.enum";
import { AppComponent as BaseAppComponent } from "@bitwarden/web-vault/app/app.component";
import { ActivateAutofillPolicy } from "./admin-console/policies/activate-autofill.component";
import { AutomaticAppLoginPolicy } from "./admin-console/policies/automatic-app-login.component";
import { DisablePersonalVaultExportPolicy } from "./admin-console/policies/disable-personal-vault-export.component";
import { MaximumVaultTimeoutPolicy } from "./admin-console/policies/maximum-vault-timeout.component";
import { FreeFamiliesSponsorshipPolicy } from "./billing/policies/free-families-sponsorship.component";
@Component({
selector: "app-root",
templateUrl: "../../../../apps/web/src/app/app.component.html",
})
export class AppComponent extends BaseAppComponent implements OnInit {
ngOnInit() {
super.ngOnInit();
this.policyListService.addPolicies([
new MaximumVaultTimeoutPolicy(),
new DisablePersonalVaultExportPolicy(),
]);
this.configService
.getFeatureFlag(FeatureFlag.DisableFreeFamiliesSponsorship)
.then((isFreeFamilyEnabled) => {
if (isFreeFamilyEnabled) {
this.policyListService.addPolicies([new FreeFamiliesSponsorshipPolicy()]);
}
this.policyListService.addPolicies([new ActivateAutofillPolicy()]);
});
this.configService.getFeatureFlag(FeatureFlag.IdpAutoSubmitLogin).then((enabled) => {
if (
enabled &&
!this.policyListService.getPolicies().some((p) => p instanceof AutomaticAppLoginPolicy)
) {
this.policyListService.addPolicies([new AutomaticAppLoginPolicy()]);
}
});
}
}