mirror of
https://github.com/bitwarden/browser
synced 2025-12-12 14:23:32 +00:00
[PM-5560] Implement Autofill Settings state provider (#7767)
* Begin migration of autofill settings Co-authored-by: Cesar Gonzalez <cagonzalezcs@users.noreply.github.com> Co-authored-by: Thomas Avery <Thomas-Avery@users.noreply.github.com> Co-authored-by: Jonathan Prusik <jprusik@users.noreply.github.com> Co-authored-by: Colton Hurst <coltonhurst@users.noreply.github.com> * add browser dependency for AutofillSettingsService Co-authored-by: Matt Gibson <mgibson@bitwarden.com> * update autofill settings service * replace usages of stateService get/set autofillOnPageLoad with autofillSettingsService * replace usages of stateService get/set autofillOnPageLoadDefault with autofillSettingsService * replace usages of stateService get/set autoCopyTotp with autofillSettingsService * replace usages of stateService get/set autoFillOnPageLoadCalloutIsDismissed with autofillSettingsService * replace usages of stateService get/set activateAutoFillOnPageLoadFromPolicy with autofillSettingsService * replace usages of get/set autoFillOverlayVisibility with autofillSettingsService * inlineMenuVisibility should use global state * add the AutofillSettingsService to background scripts * fix typing * replace additional usages of get/set autoFillOverlayVisibility and disableAutoTotpCopy with autofillSettingsService equivalents * replace additional usages of get/set autofillOnPageLoadDefault with autofillSettingsService equivalent * replace additional usages of get/set activateAutoFillOnPageLoadFromPolicy with autofillSettingsService equivalent * remove additional deprecated and unused state service calls * improve naming conventions and consistency * fix missing mock for policy service test * replace missing overlay background tests * cleanup * fix double inversion * fix reference to wrong setter * move handleActivateAutofillPolicy out of BrowserPolicyService * create state migration script * resolve linting issues * remove migrated setting properties * add AutofillSettingsSErvice to jslib-services * handle conditional content script loading via autofillOnPageLoad check * add deprecated note to getFromLocalStorage * add jsdoc decorators to new autofill service methods * handle undefined globalState * move autofill settings out of BrowserPolicyService * Move autofill settings code out of policyService * fix tests * fix typo in state definition --------- Co-authored-by: Matt Gibson <mgibson@bitwarden.com> Co-authored-by: Cesar Gonzalez <cagonzalezcs@users.noreply.github.com> Co-authored-by: Thomas Avery <Thomas-Avery@users.noreply.github.com> Co-authored-by: Colton Hurst <coltonhurst@users.noreply.github.com> Co-authored-by: Thomas Rittson <trittson@bitwarden.com>
This commit is contained in:
@@ -82,6 +82,10 @@ import { UserVerificationService } from "@bitwarden/common/auth/services/user-ve
|
||||
import { WebAuthnLoginApiService } from "@bitwarden/common/auth/services/webauthn-login/webauthn-login-api.service";
|
||||
import { WebAuthnLoginPrfCryptoService } from "@bitwarden/common/auth/services/webauthn-login/webauthn-login-prf-crypto.service";
|
||||
import { WebAuthnLoginService } from "@bitwarden/common/auth/services/webauthn-login/webauthn-login.service";
|
||||
import {
|
||||
AutofillSettingsServiceAbstraction,
|
||||
AutofillSettingsService,
|
||||
} from "@bitwarden/common/autofill/services/autofill-settings.service";
|
||||
import { BillingApiServiceAbstraction } from "@bitwarden/common/billing/abstractions/billilng-api.service.abstraction";
|
||||
import { BillingBannerServiceAbstraction } from "@bitwarden/common/billing/abstractions/billing-banner.service.abstraction";
|
||||
import { OrganizationBillingServiceAbstraction } from "@bitwarden/common/billing/abstractions/organization-billing.service";
|
||||
@@ -334,6 +338,7 @@ import { ModalService } from "./modal.service";
|
||||
i18nService: I18nServiceAbstraction,
|
||||
searchService: SearchServiceAbstraction,
|
||||
stateService: StateServiceAbstraction,
|
||||
autofillSettingsService: AutofillSettingsServiceAbstraction,
|
||||
encryptService: EncryptService,
|
||||
fileUploadService: CipherFileUploadServiceAbstraction,
|
||||
configService: ConfigServiceAbstraction,
|
||||
@@ -345,6 +350,7 @@ import { ModalService } from "./modal.service";
|
||||
i18nService,
|
||||
searchService,
|
||||
stateService,
|
||||
autofillSettingsService,
|
||||
encryptService,
|
||||
fileUploadService,
|
||||
configService,
|
||||
@@ -356,6 +362,7 @@ import { ModalService } from "./modal.service";
|
||||
I18nServiceAbstraction,
|
||||
SearchServiceAbstraction,
|
||||
StateServiceAbstraction,
|
||||
AutofillSettingsServiceAbstraction,
|
||||
EncryptService,
|
||||
CipherFileUploadServiceAbstraction,
|
||||
ConfigServiceAbstraction,
|
||||
@@ -908,6 +915,11 @@ import { ModalService } from "./modal.service";
|
||||
OrganizationApiServiceAbstraction,
|
||||
],
|
||||
},
|
||||
{
|
||||
provide: AutofillSettingsServiceAbstraction,
|
||||
useClass: AutofillSettingsService,
|
||||
deps: [StateProvider, PolicyServiceAbstraction],
|
||||
},
|
||||
{
|
||||
provide: BiometricStateService,
|
||||
useClass: DefaultBiometricStateService,
|
||||
|
||||
Reference in New Issue
Block a user