mirror of
https://github.com/bitwarden/browser
synced 2025-12-13 06:43:35 +00:00
Migrate autoConfirmFingerPrints to StateProvider (#8337)
* Fix a typo in the `StateDefinition` description * Introduce `OrganizationManagementPreferencesService` * Declare `OrganizationManagementPreferencesService` in DI * Update `autoConfirmFingerPrints` logic in emergency access files * Update `autoConfirmFingerPrints` logic in `people` files * Remove `autoConfirmFingerPrints` from `StateService` and `Account` * Migrate existing client data for `autoConfirmFingerPrints` * Update apps/web/src/app/admin-console/organizations/manage/user-confirm.component.ts Co-authored-by: Matt Gibson <mgibson@bitwarden.com> * Update apps/web/src/app/admin-console/organizations/manage/user-confirm.component.ts Co-authored-by: Matt Gibson <mgibson@bitwarden.com> * Use `set` instead of `update` for function names --------- Co-authored-by: Matt Gibson <mgibson@bitwarden.com>
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
import { Observable } from "rxjs";
|
||||
|
||||
/**
|
||||
* Manages the state of a single organization management preference.
|
||||
* Can be used to subscribe to or update a given property.
|
||||
*/
|
||||
export class OrganizationManagementPreference<T> {
|
||||
state$: Observable<T>;
|
||||
set: (value: T) => Promise<void>;
|
||||
|
||||
constructor(state$: Observable<T>, setFn: (value: T) => Promise<void>) {
|
||||
this.state$ = state$;
|
||||
this.set = setFn;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Publishes state of a given user's personal settings relating to the user experience of managing an organization.
|
||||
*/
|
||||
export abstract class OrganizationManagementPreferencesService {
|
||||
autoConfirmFingerPrints: OrganizationManagementPreference<boolean>;
|
||||
}
|
||||
Reference in New Issue
Block a user