mirror of
https://github.com/bitwarden/browser
synced 2025-12-21 02:33:46 +00:00
[PM-14366] Deprecated active user state from billing state service (#12273)
* Updated billing state provider to not rely on ActiveUserStateProvider * Updated usages * Resolved browser build * Resolved web build * Resolved CLI build * resolved desktop build * Update apps/cli/src/tools/send/commands/create.command.ts Co-authored-by: ✨ Audrey ✨ <ajensen@bitwarden.com> * Move subscription visibility logic from component to service * Resolved unit test failures. Using existing userIds where present * Simplified activeUserId access * Resolved typescript strict errors * Resolved broken unit test * Resolved ts strict error --------- Co-authored-by: ✨ Audrey ✨ <ajensen@bitwarden.com>
This commit is contained in:
@@ -11,27 +11,32 @@ export type BillingAccountProfile = {
|
||||
|
||||
export abstract class BillingAccountProfileStateService {
|
||||
/**
|
||||
* Emits `true` when the active user's account has been granted premium from any of the
|
||||
* Emits `true` when the user's account has been granted premium from any of the
|
||||
* organizations it is a member of. Otherwise, emits `false`
|
||||
*/
|
||||
hasPremiumFromAnyOrganization$: Observable<boolean>;
|
||||
abstract hasPremiumFromAnyOrganization$(userId: UserId): Observable<boolean>;
|
||||
|
||||
/**
|
||||
* Emits `true` when the active user's account has an active premium subscription at the
|
||||
* Emits `true` when the user's account has an active premium subscription at the
|
||||
* individual user level
|
||||
*/
|
||||
hasPremiumPersonally$: Observable<boolean>;
|
||||
abstract hasPremiumPersonally$(userId: UserId): Observable<boolean>;
|
||||
|
||||
/**
|
||||
* Emits `true` when either `hasPremiumPersonally` or `hasPremiumFromAnyOrganization` is `true`
|
||||
*/
|
||||
hasPremiumFromAnySource$: Observable<boolean>;
|
||||
abstract hasPremiumFromAnySource$(userId: UserId): Observable<boolean>;
|
||||
|
||||
/**
|
||||
* Sets the active user's premium status fields upon every full sync, either from their personal
|
||||
* Emits `true` when the subscription menu item should be shown in navigation.
|
||||
* This is hidden for organizations that provide premium, except if the user has premium personally
|
||||
* or has a billing history.
|
||||
*/
|
||||
abstract canViewSubscription$(userId: UserId): Observable<boolean>;
|
||||
|
||||
/**
|
||||
* Sets the user's premium status fields upon every full sync, either from their personal
|
||||
* subscription to premium, or an organization they're a part of that grants them premium.
|
||||
* @param hasPremiumPersonally
|
||||
* @param hasPremiumFromAnyOrganization
|
||||
*/
|
||||
abstract setHasPremium(
|
||||
hasPremiumPersonally: boolean,
|
||||
|
||||
Reference in New Issue
Block a user