1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-12 22:33:35 +00:00

[PM-13347] Web app impacts on the Remove Bitwarden Families policy (#12056)

* Changes for web impact by the policy

* Changes to address PR comments

* refactoring changes from pr comments

* Resolve the complex conditionals comment

* resolve the complex conditionals comment

* Resolve the pr comments on user layout

* revert on wanted change

* Refactor and move logic and template into its own component

* Move to a folder owned by the Billing team
This commit is contained in:
cyprain-okeke
2024-11-28 15:59:05 +01:00
committed by GitHub
parent 59686346d4
commit d76b5b672c
8 changed files with 231 additions and 17 deletions

View File

@@ -1,16 +1,17 @@
import { CommonModule } from "@angular/common";
import { Component, OnInit } from "@angular/core";
import { RouterModule } from "@angular/router";
import { Observable, combineLatest, concatMap } from "rxjs";
import { Observable, concatMap, combineLatest } from "rxjs";
import { JslibModule } from "@bitwarden/angular/jslib.module";
import { ApiService } from "@bitwarden/common/abstractions/api.service";
import { OrganizationService } from "@bitwarden/common/admin-console/abstractions/organization/organization.service.abstraction";
import { BillingAccountProfileStateService } from "@bitwarden/common/billing/abstractions/account/billing-account-profile-state.service";
import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service";
import { SyncService } from "@bitwarden/common/platform/sync";
import { IconModule } from "@bitwarden/components";
import { BillingFreeFamiliesNavItemComponent } from "../billing/shared/billing-free-families-nav-item.component";
import { PasswordManagerLogo } from "./password-manager-logo";
import { WebLayoutModule } from "./web-layout.module";
@@ -18,16 +19,24 @@ import { WebLayoutModule } from "./web-layout.module";
selector: "app-user-layout",
templateUrl: "user-layout.component.html",
standalone: true,
imports: [CommonModule, RouterModule, JslibModule, WebLayoutModule, IconModule],
imports: [
CommonModule,
RouterModule,
JslibModule,
WebLayoutModule,
IconModule,
BillingFreeFamiliesNavItemComponent,
],
})
export class UserLayoutComponent implements OnInit {
protected readonly logo = PasswordManagerLogo;
isFreeFamilyFlagEnabled: boolean;
protected hasFamilySponsorshipAvailable$: Observable<boolean>;
protected showSponsoredFamilies$: Observable<boolean>;
protected showSubscription$: Observable<boolean>;
constructor(
private platformUtilsService: PlatformUtilsService,
private organizationService: OrganizationService,
private apiService: ApiService,
private syncService: SyncService,
private billingAccountProfileStateService: BillingAccountProfileStateService,
@@ -38,8 +47,6 @@ export class UserLayoutComponent implements OnInit {
await this.syncService.fullSync(false);
this.hasFamilySponsorshipAvailable$ = this.organizationService.canManageSponsorships$;
// We want to hide the subscription menu for organizations that provide premium.
// Except if the user has premium personally or has a billing history.
this.showSubscription$ = combineLatest([