From 3b5123a985d65a675e2e6a59100b5233cbd75f7c Mon Sep 17 00:00:00 2001 From: neuronull <9162534+neuronull@users.noreply.github.com> Date: Mon, 8 Dec 2025 14:09:34 -0700 Subject: [PATCH] Desktop Autotype remove MVP FF --- .../src/app/accounts/settings.component.ts | 7 +-- .../desktop-autotype-policy.service.ts | 57 +++++++------------ .../services/desktop-autotype.service.ts | 11 +--- .../autotype-policy.component.ts | 7 +-- libs/common/src/enums/feature-flag.enum.ts | 2 - 5 files changed, 28 insertions(+), 56 deletions(-) diff --git a/apps/desktop/src/app/accounts/settings.component.ts b/apps/desktop/src/app/accounts/settings.component.ts index e3022428421..bef870274b6 100644 --- a/apps/desktop/src/app/accounts/settings.component.ts +++ b/apps/desktop/src/app/accounts/settings.component.ts @@ -301,12 +301,7 @@ export class SettingsComponent implements OnInit, OnDestroy { // Autotype is for Windows initially const isWindows = this.platformUtilsService.getDevice() === DeviceType.WindowsDesktop; if (isWindows) { - this.configService - .getFeatureFlag$(FeatureFlag.WindowsDesktopAutotype) - .pipe(takeUntil(this.destroy$)) - .subscribe((enabled) => { - this.showEnableAutotype = enabled; - }); + this.showEnableAutotype = true; } this.userHasMasterPassword = await this.userVerificationService.hasMasterPassword(); diff --git a/apps/desktop/src/autofill/services/desktop-autotype-policy.service.ts b/apps/desktop/src/autofill/services/desktop-autotype-policy.service.ts index d3ae67d2c8d..ffa03de079a 100644 --- a/apps/desktop/src/autofill/services/desktop-autotype-policy.service.ts +++ b/apps/desktop/src/autofill/services/desktop-autotype-policy.service.ts @@ -8,8 +8,6 @@ import { AccountService } from "@bitwarden/common/auth/abstractions/account.serv import { AuthService } from "@bitwarden/common/auth/abstractions/auth.service"; import { AuthenticationStatus } from "@bitwarden/common/auth/enums/authentication-status"; import { getUserId } from "@bitwarden/common/auth/services/account.service"; -import { FeatureFlag } from "@bitwarden/common/enums/feature-flag.enum"; -import { ConfigService } from "@bitwarden/common/platform/abstractions/config/config.service"; @Injectable({ providedIn: "root" }) export class DesktopAutotypeDefaultSettingPolicy { @@ -17,47 +15,36 @@ export class DesktopAutotypeDefaultSettingPolicy { private readonly accountService: AccountService, private readonly authService: AuthService, private readonly policyService: InternalPolicyService, - private readonly configService: ConfigService, ) {} /** - * Emits the autotype policy enabled status when account is unlocked and WindowsDesktopAutotype is enabled. + * Emits the autotype policy enabled status when account is unlocked. * - true: autotype policy exists and is enabled * - null: no autotype policy exists for the user's organization */ - readonly autotypeDefaultSetting$: Observable = this.configService - .getFeatureFlag$(FeatureFlag.WindowsDesktopAutotype) - .pipe( - switchMap((autotypeFeatureEnabled) => { - if (!autotypeFeatureEnabled) { - return of(null); - } - - return this.accountService.activeAccount$.pipe( - filter((account) => account != null && account.id != null), - getUserId, + readonly autotypeDefaultSetting$: Observable = + this.accountService.activeAccount$.pipe( + filter((account) => account != null && account.id != null), + getUserId, + distinctUntilChanged(), + switchMap((userId) => { + const isUnlocked$ = this.authService.authStatusFor$(userId).pipe( + map((status) => status === AuthenticationStatus.Unlocked), distinctUntilChanged(), - switchMap((userId) => { - const isUnlocked$ = this.authService.authStatusFor$(userId).pipe( - map((status) => status === AuthenticationStatus.Unlocked), - distinctUntilChanged(), - ); - - const policy$ = this.policyService.policies$(userId).pipe( - map((policies) => { - const autotypePolicy = policies.find( - (policy) => policy.type === PolicyType.AutotypeDefaultSetting && policy.enabled, - ); - return autotypePolicy ? true : null; - }), - distinctUntilChanged(), - shareReplay({ bufferSize: 1, refCount: true }), - ); - - return isUnlocked$.pipe(switchMap((unlocked) => (unlocked ? policy$ : of(null)))); - }), ); + + const policy$ = this.policyService.policies$(userId).pipe( + map((policies) => { + const autotypePolicy = policies.find( + (policy) => policy.type === PolicyType.AutotypeDefaultSetting && policy.enabled, + ); + return autotypePolicy ? true : null; + }), + distinctUntilChanged(), + shareReplay({ bufferSize: 1, refCount: true }), + ); + + return isUnlocked$.pipe(switchMap((unlocked) => (unlocked ? policy$ : of(null)))); }), - shareReplay({ bufferSize: 1, refCount: true }), ); } diff --git a/apps/desktop/src/autofill/services/desktop-autotype.service.ts b/apps/desktop/src/autofill/services/desktop-autotype.service.ts index 7ee889e7b81..c764d985ac6 100644 --- a/apps/desktop/src/autofill/services/desktop-autotype.service.ts +++ b/apps/desktop/src/autofill/services/desktop-autotype.service.ts @@ -5,8 +5,6 @@ import { AuthService } from "@bitwarden/common/auth/abstractions/auth.service"; import { AuthenticationStatus } from "@bitwarden/common/auth/enums/authentication-status"; import { BillingAccountProfileStateService } from "@bitwarden/common/billing/abstractions"; import { DeviceType } from "@bitwarden/common/enums"; -import { FeatureFlag } from "@bitwarden/common/enums/feature-flag.enum"; -import { ConfigService } from "@bitwarden/common/platform/abstractions/config/config.service"; import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service"; import { GlobalStateProvider, @@ -58,7 +56,6 @@ export class DesktopAutotypeService { private accountService: AccountService, private authService: AuthService, private cipherService: CipherService, - private configService: ConfigService, private globalStateProvider: GlobalStateProvider, private platformUtilsService: PlatformUtilsService, private billingAccountProfileStateService: BillingAccountProfileStateService, @@ -106,7 +103,6 @@ export class DesktopAutotypeService { // feature should be on or off. this.resolvedAutotypeEnabled$ = combineLatest([ this.autotypeEnabledState.state$, - this.configService.getFeatureFlag$(FeatureFlag.WindowsDesktopAutotype), this.accountService.activeAccount$.pipe( map((activeAccount) => activeAccount?.id), switchMap((userId) => this.authService.authStatusFor$(userId)), @@ -119,11 +115,8 @@ export class DesktopAutotypeService { ), ]).pipe( map( - ([autotypeEnabled, windowsDesktopAutotypeFeatureFlag, authStatus, hasPremium]) => - autotypeEnabled && - windowsDesktopAutotypeFeatureFlag && - authStatus == AuthenticationStatus.Unlocked && - hasPremium, + ([autotypeEnabled, authStatus, hasPremium]) => + autotypeEnabled && authStatus == AuthenticationStatus.Unlocked && hasPremium, ), ); diff --git a/apps/web/src/app/admin-console/organizations/policies/policy-edit-definitions/autotype-policy.component.ts b/apps/web/src/app/admin-console/organizations/policies/policy-edit-definitions/autotype-policy.component.ts index 809ffd39a64..b0e192bffb7 100644 --- a/apps/web/src/app/admin-console/organizations/policies/policy-edit-definitions/autotype-policy.component.ts +++ b/apps/web/src/app/admin-console/organizations/policies/policy-edit-definitions/autotype-policy.component.ts @@ -1,9 +1,8 @@ import { ChangeDetectionStrategy, Component } from "@angular/core"; +import { of } from "rxjs"; import { PolicyType } from "@bitwarden/common/admin-console/enums"; import { Organization } from "@bitwarden/common/admin-console/models/domain/organization"; -import { FeatureFlag } from "@bitwarden/common/enums/feature-flag.enum"; -import { ConfigService } from "@bitwarden/common/platform/abstractions/config/config.service"; import { SharedModule } from "../../../../shared"; import { BasePolicyEditDefinition, BasePolicyEditComponent } from "../base-policy-edit.component"; @@ -14,8 +13,8 @@ export class DesktopAutotypeDefaultSettingPolicy extends BasePolicyEditDefinitio type = PolicyType.AutotypeDefaultSetting; component = DesktopAutotypeDefaultSettingPolicyComponent; - display$(organization: Organization, configService: ConfigService) { - return configService.getFeatureFlag$(FeatureFlag.WindowsDesktopAutotype); + display$(organization: Organization) { + return of(true); } } @Component({ diff --git a/libs/common/src/enums/feature-flag.enum.ts b/libs/common/src/enums/feature-flag.enum.ts index 371081a89d9..9809e061f7a 100644 --- a/libs/common/src/enums/feature-flag.enum.ts +++ b/libs/common/src/enums/feature-flag.enum.ts @@ -21,7 +21,6 @@ export enum FeatureFlag { /* Autofill */ MacOsNativeCredentialSync = "macos-native-credential-sync", - WindowsDesktopAutotype = "windows-desktop-autotype", /* Billing */ TrialPaymentOptional = "PM-8163-trial-payment", @@ -102,7 +101,6 @@ export const DefaultFeatureFlagValue = { /* Autofill */ [FeatureFlag.MacOsNativeCredentialSync]: FALSE, - [FeatureFlag.WindowsDesktopAutotype]: FALSE, /* Tools */ [FeatureFlag.DesktopSendUIRefresh]: FALSE,