From 0b9a2775f0f6285f72cb478a05fe11c58697bfc2 Mon Sep 17 00:00:00 2001 From: Cesar Gonzalez Date: Thu, 30 Nov 2023 13:59:33 -0600 Subject: [PATCH] [PM-5043] Update ownership of code to autofill team (#7017) * [PM-5043] Update owernship of code belonging to autofill team * [PM-5043] Updating location of webRequest.background.ts file to belong to autofill team * [PM-5043] Updating location of autofill component settings within the popup --- .github/whitelist-capital-letters.txt | 8 -------- .../background/context-menus.background.ts | 2 +- .../autofill/background/notification.background.ts | 14 +++++++------- .../src/autofill/background/overlay.background.ts | 2 +- .../background/web-request.background.ts} | 2 +- .../browser/context-menu-clicked-handler.ts | 2 +- .../src/autofill/content/notification-bar.ts | 4 ++-- .../models/add-change-password-queue-message.ts} | 4 ++-- .../models/add-login-queue-message.ts} | 4 ++-- .../models/add-login-runtime-message.ts} | 0 .../models/add-unlock-vault-queue-message.ts | 6 ++++++ .../models/change-password-runtime-message.ts} | 0 .../locked-vault-pending-notifications-item.ts} | 0 .../models/notification-queue-message-type.ts} | 0 .../models/notification-queue-message.ts} | 2 +- .../popup/settings/autofill.component.html | 0 .../popup/settings/autofill.component.ts | 6 +++--- apps/browser/src/background/commands.background.ts | 2 +- apps/browser/src/background/main.background.ts | 2 +- .../models/add-unlock-vault-queue-message.ts | 6 ------ apps/browser/src/background/runtime.background.ts | 2 +- apps/browser/src/popup/app-routing.module.ts | 2 +- apps/browser/src/popup/app.module.ts | 2 +- 23 files changed, 32 insertions(+), 40 deletions(-) rename apps/browser/src/{background/webRequest.background.ts => autofill/background/web-request.background.ts} (97%) rename apps/browser/src/{background/models/addChangePasswordQueueMessage.ts => autofill/notification/models/add-change-password-queue-message.ts} (55%) rename apps/browser/src/{background/models/addLoginQueueMessage.ts => autofill/notification/models/add-login-queue-message.ts} (88%) rename apps/browser/src/{background/models/addLoginRuntimeMessage.ts => autofill/notification/models/add-login-runtime-message.ts} (100%) create mode 100644 apps/browser/src/autofill/notification/models/add-unlock-vault-queue-message.ts rename apps/browser/src/{background/models/changePasswordRuntimeMessage.ts => autofill/notification/models/change-password-runtime-message.ts} (100%) rename apps/browser/src/{background/models/lockedVaultPendingNotificationsItem.ts => autofill/notification/models/locked-vault-pending-notifications-item.ts} (100%) rename apps/browser/src/{background/models/notificationQueueMessageType.ts => autofill/notification/models/notification-queue-message-type.ts} (100%) rename apps/browser/src/{background/models/notificationQueueMessage.ts => autofill/notification/models/notification-queue-message.ts} (68%) rename apps/browser/src/{ => autofill}/popup/settings/autofill.component.html (100%) rename apps/browser/src/{ => autofill}/popup/settings/autofill.component.ts (97%) delete mode 100644 apps/browser/src/background/models/add-unlock-vault-queue-message.ts diff --git a/.github/whitelist-capital-letters.txt b/.github/whitelist-capital-letters.txt index dcabbd2226..9637f95431 100644 --- a/.github/whitelist-capital-letters.txt +++ b/.github/whitelist-capital-letters.txt @@ -40,14 +40,6 @@ ./apps/browser/README.md ./apps/browser/store/windows/AppxManifest.xml ./apps/browser/src/background/nativeMessaging.background.ts -./apps/browser/src/background/models/addLoginRuntimeMessage.ts -./apps/browser/src/background/models/addChangePasswordQueueMessage.ts -./apps/browser/src/background/models/addLoginQueueMessage.ts -./apps/browser/src/background/models/changePasswordRuntimeMessage.ts -./apps/browser/src/background/models/notificationQueueMessage.ts -./apps/browser/src/background/models/notificationQueueMessageType.ts -./apps/browser/src/background/models/lockedVaultPendingNotificationsItem.ts -./apps/browser/src/background/webRequest.background.ts ./apps/browser/src/popup/services/debounceNavigationService.ts ./apps/browser/src/models/browserComponentState.ts ./apps/browser/src/models/browserSendComponentState.ts diff --git a/apps/browser/src/autofill/background/context-menus.background.ts b/apps/browser/src/autofill/background/context-menus.background.ts index 719f39a78d..af43c2500d 100644 --- a/apps/browser/src/autofill/background/context-menus.background.ts +++ b/apps/browser/src/autofill/background/context-menus.background.ts @@ -1,6 +1,6 @@ -import LockedVaultPendingNotificationsItem from "../../background/models/lockedVaultPendingNotificationsItem"; import { BrowserApi } from "../../platform/browser/browser-api"; import { ContextMenuClickedHandler } from "../browser/context-menu-clicked-handler"; +import LockedVaultPendingNotificationsItem from "../notification/models/locked-vault-pending-notifications-item"; export default class ContextMenusBackground { private contextMenus: typeof chrome.contextMenus; diff --git a/apps/browser/src/autofill/background/notification.background.ts b/apps/browser/src/autofill/background/notification.background.ts index f45abf4bc9..5f6522f59f 100644 --- a/apps/browser/src/autofill/background/notification.background.ts +++ b/apps/browser/src/autofill/background/notification.background.ts @@ -13,17 +13,17 @@ import { CipherType } from "@bitwarden/common/vault/enums"; import { CipherView } from "@bitwarden/common/vault/models/view/cipher.view"; import { openUnlockPopout } from "../../auth/popup/utils/auth-popout-window"; -import AddUnlockVaultQueueMessage from "../../background/models/add-unlock-vault-queue-message"; -import AddChangePasswordQueueMessage from "../../background/models/addChangePasswordQueueMessage"; -import AddLoginQueueMessage from "../../background/models/addLoginQueueMessage"; -import AddLoginRuntimeMessage from "../../background/models/addLoginRuntimeMessage"; -import ChangePasswordRuntimeMessage from "../../background/models/changePasswordRuntimeMessage"; -import LockedVaultPendingNotificationsItem from "../../background/models/lockedVaultPendingNotificationsItem"; -import { NotificationQueueMessageType } from "../../background/models/notificationQueueMessageType"; import { BrowserApi } from "../../platform/browser/browser-api"; import { BrowserStateService } from "../../platform/services/abstractions/browser-state.service"; import { openAddEditVaultItemPopout } from "../../vault/popup/utils/vault-popout-window"; import { NOTIFICATION_BAR_LIFESPAN_MS } from "../constants"; +import AddChangePasswordQueueMessage from "../notification/models/add-change-password-queue-message"; +import AddLoginQueueMessage from "../notification/models/add-login-queue-message"; +import AddLoginRuntimeMessage from "../notification/models/add-login-runtime-message"; +import AddUnlockVaultQueueMessage from "../notification/models/add-unlock-vault-queue-message"; +import ChangePasswordRuntimeMessage from "../notification/models/change-password-runtime-message"; +import LockedVaultPendingNotificationsItem from "../notification/models/locked-vault-pending-notifications-item"; +import { NotificationQueueMessageType } from "../notification/models/notification-queue-message-type"; import { AutofillService } from "../services/abstractions/autofill.service"; export default class NotificationBackground { diff --git a/apps/browser/src/autofill/background/overlay.background.ts b/apps/browser/src/autofill/background/overlay.background.ts index 7187d5ad13..7d07fb150b 100644 --- a/apps/browser/src/autofill/background/overlay.background.ts +++ b/apps/browser/src/autofill/background/overlay.background.ts @@ -14,13 +14,13 @@ import { LoginUriView } from "@bitwarden/common/vault/models/view/login-uri.view import { LoginView } from "@bitwarden/common/vault/models/view/login.view"; import { openUnlockPopout } from "../../auth/popup/utils/auth-popout-window"; -import LockedVaultPendingNotificationsItem from "../../background/models/lockedVaultPendingNotificationsItem"; import { BrowserApi } from "../../platform/browser/browser-api"; import { openViewVaultItemPopout, openAddEditVaultItemPopout, } from "../../vault/popup/utils/vault-popout-window"; import { SHOW_AUTOFILL_BUTTON } from "../constants"; +import LockedVaultPendingNotificationsItem from "../notification/models/locked-vault-pending-notifications-item"; import { AutofillService, PageDetail } from "../services/abstractions/autofill.service"; import { AutofillOverlayElement, AutofillOverlayPort } from "../utils/autofill-overlay.enum"; diff --git a/apps/browser/src/background/webRequest.background.ts b/apps/browser/src/autofill/background/web-request.background.ts similarity index 97% rename from apps/browser/src/background/webRequest.background.ts rename to apps/browser/src/autofill/background/web-request.background.ts index 2fbb3d948b..7bb3e679c7 100644 --- a/apps/browser/src/background/webRequest.background.ts +++ b/apps/browser/src/autofill/background/web-request.background.ts @@ -4,7 +4,7 @@ import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/pl import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.service"; import { UriMatchType } from "@bitwarden/common/vault/enums"; -import { BrowserApi } from "../platform/browser/browser-api"; +import { BrowserApi } from "../../platform/browser/browser-api"; export default class WebRequestBackground { private pendingAuthRequests: any[] = []; diff --git a/apps/browser/src/autofill/browser/context-menu-clicked-handler.ts b/apps/browser/src/autofill/browser/context-menu-clicked-handler.ts index f3c979744c..0de2009bbe 100644 --- a/apps/browser/src/autofill/browser/context-menu-clicked-handler.ts +++ b/apps/browser/src/autofill/browser/context-menu-clicked-handler.ts @@ -18,7 +18,6 @@ import { } from "../../auth/background/service-factories/auth-service.factory"; import { userVerificationServiceFactory } from "../../auth/background/service-factories/user-verification-service.factory"; import { openUnlockPopout } from "../../auth/popup/utils/auth-popout-window"; -import LockedVaultPendingNotificationsItem from "../../background/models/lockedVaultPendingNotificationsItem"; import { eventCollectionServiceFactory } from "../../background/service-factories/event-collection-service.factory"; import { Account } from "../../models/account"; import { CachedServices } from "../../platform/background/service-factories/factory-options"; @@ -51,6 +50,7 @@ import { GENERATE_PASSWORD_ID, NOOP_COMMAND_SUFFIX, } from "../constants"; +import LockedVaultPendingNotificationsItem from "../notification/models/locked-vault-pending-notifications-item"; import { AutofillCipherTypeId } from "../types"; export type CopyToClipboardOptions = { text: string; tab: chrome.tabs.Tab }; diff --git a/apps/browser/src/autofill/content/notification-bar.ts b/apps/browser/src/autofill/content/notification-bar.ts index 264d64741b..92e8f59938 100644 --- a/apps/browser/src/autofill/content/notification-bar.ts +++ b/apps/browser/src/autofill/content/notification-bar.ts @@ -1,7 +1,7 @@ -import AddLoginRuntimeMessage from "../../background/models/addLoginRuntimeMessage"; -import ChangePasswordRuntimeMessage from "../../background/models/changePasswordRuntimeMessage"; import AutofillField from "../models/autofill-field"; import { WatchedForm } from "../models/watched-form"; +import AddLoginRuntimeMessage from "../notification/models/add-login-runtime-message"; +import ChangePasswordRuntimeMessage from "../notification/models/change-password-runtime-message"; import { FormData } from "../services/abstractions/autofill.service"; import { GlobalSettings, UserSettings } from "../types"; diff --git a/apps/browser/src/background/models/addChangePasswordQueueMessage.ts b/apps/browser/src/autofill/notification/models/add-change-password-queue-message.ts similarity index 55% rename from apps/browser/src/background/models/addChangePasswordQueueMessage.ts rename to apps/browser/src/autofill/notification/models/add-change-password-queue-message.ts index 16491032e9..f1d5bebdc9 100644 --- a/apps/browser/src/background/models/addChangePasswordQueueMessage.ts +++ b/apps/browser/src/autofill/notification/models/add-change-password-queue-message.ts @@ -1,5 +1,5 @@ -import NotificationQueueMessage from "./notificationQueueMessage"; -import { NotificationQueueMessageType } from "./notificationQueueMessageType"; +import NotificationQueueMessage from "./notification-queue-message"; +import { NotificationQueueMessageType } from "./notification-queue-message-type"; export default class AddChangePasswordQueueMessage extends NotificationQueueMessage { type: NotificationQueueMessageType.ChangePassword; diff --git a/apps/browser/src/background/models/addLoginQueueMessage.ts b/apps/browser/src/autofill/notification/models/add-login-queue-message.ts similarity index 88% rename from apps/browser/src/background/models/addLoginQueueMessage.ts rename to apps/browser/src/autofill/notification/models/add-login-queue-message.ts index 1f727f40a5..0d4a23f76f 100644 --- a/apps/browser/src/background/models/addLoginQueueMessage.ts +++ b/apps/browser/src/autofill/notification/models/add-login-queue-message.ts @@ -4,8 +4,8 @@ import { CipherView } from "@bitwarden/common/vault/models/view/cipher.view"; import { LoginUriView } from "@bitwarden/common/vault/models/view/login-uri.view"; import { LoginView } from "@bitwarden/common/vault/models/view/login.view"; -import NotificationQueueMessage from "./notificationQueueMessage"; -import { NotificationQueueMessageType } from "./notificationQueueMessageType"; +import NotificationQueueMessage from "./notification-queue-message"; +import { NotificationQueueMessageType } from "./notification-queue-message-type"; export default class AddLoginQueueMessage extends NotificationQueueMessage { type: NotificationQueueMessageType.AddLogin; diff --git a/apps/browser/src/background/models/addLoginRuntimeMessage.ts b/apps/browser/src/autofill/notification/models/add-login-runtime-message.ts similarity index 100% rename from apps/browser/src/background/models/addLoginRuntimeMessage.ts rename to apps/browser/src/autofill/notification/models/add-login-runtime-message.ts diff --git a/apps/browser/src/autofill/notification/models/add-unlock-vault-queue-message.ts b/apps/browser/src/autofill/notification/models/add-unlock-vault-queue-message.ts new file mode 100644 index 0000000000..602e9f6c44 --- /dev/null +++ b/apps/browser/src/autofill/notification/models/add-unlock-vault-queue-message.ts @@ -0,0 +1,6 @@ +import NotificationQueueMessage from "./notification-queue-message"; +import { NotificationQueueMessageType } from "./notification-queue-message-type"; + +export default class AddUnlockVaultQueueMessage extends NotificationQueueMessage { + type: NotificationQueueMessageType.UnlockVault; +} diff --git a/apps/browser/src/background/models/changePasswordRuntimeMessage.ts b/apps/browser/src/autofill/notification/models/change-password-runtime-message.ts similarity index 100% rename from apps/browser/src/background/models/changePasswordRuntimeMessage.ts rename to apps/browser/src/autofill/notification/models/change-password-runtime-message.ts diff --git a/apps/browser/src/background/models/lockedVaultPendingNotificationsItem.ts b/apps/browser/src/autofill/notification/models/locked-vault-pending-notifications-item.ts similarity index 100% rename from apps/browser/src/background/models/lockedVaultPendingNotificationsItem.ts rename to apps/browser/src/autofill/notification/models/locked-vault-pending-notifications-item.ts diff --git a/apps/browser/src/background/models/notificationQueueMessageType.ts b/apps/browser/src/autofill/notification/models/notification-queue-message-type.ts similarity index 100% rename from apps/browser/src/background/models/notificationQueueMessageType.ts rename to apps/browser/src/autofill/notification/models/notification-queue-message-type.ts diff --git a/apps/browser/src/background/models/notificationQueueMessage.ts b/apps/browser/src/autofill/notification/models/notification-queue-message.ts similarity index 68% rename from apps/browser/src/background/models/notificationQueueMessage.ts rename to apps/browser/src/autofill/notification/models/notification-queue-message.ts index 3c6a582ee5..b5e5c3b2e4 100644 --- a/apps/browser/src/background/models/notificationQueueMessage.ts +++ b/apps/browser/src/autofill/notification/models/notification-queue-message.ts @@ -1,4 +1,4 @@ -import { NotificationQueueMessageType } from "./notificationQueueMessageType"; +import { NotificationQueueMessageType } from "./notification-queue-message-type"; export default class NotificationQueueMessage { type: NotificationQueueMessageType; diff --git a/apps/browser/src/popup/settings/autofill.component.html b/apps/browser/src/autofill/popup/settings/autofill.component.html similarity index 100% rename from apps/browser/src/popup/settings/autofill.component.html rename to apps/browser/src/autofill/popup/settings/autofill.component.html diff --git a/apps/browser/src/popup/settings/autofill.component.ts b/apps/browser/src/autofill/popup/settings/autofill.component.ts similarity index 97% rename from apps/browser/src/popup/settings/autofill.component.ts rename to apps/browser/src/autofill/popup/settings/autofill.component.ts index 37dc691c9b..341f5b9d63 100644 --- a/apps/browser/src/popup/settings/autofill.component.ts +++ b/apps/browser/src/autofill/popup/settings/autofill.component.ts @@ -9,9 +9,9 @@ import { StateService } from "@bitwarden/common/platform/abstractions/state.serv import { UriMatchType } from "@bitwarden/common/vault/enums"; import { DialogService } from "@bitwarden/components"; -import { AutofillOverlayVisibility } from "../../autofill/utils/autofill-overlay.enum"; -import { BrowserApi } from "../../platform/browser/browser-api"; -import { flagEnabled } from "../../platform/flags"; +import { BrowserApi } from "../../../platform/browser/browser-api"; +import { flagEnabled } from "../../../platform/flags"; +import { AutofillOverlayVisibility } from "../../utils/autofill-overlay.enum"; @Component({ selector: "app-autofill", diff --git a/apps/browser/src/background/commands.background.ts b/apps/browser/src/background/commands.background.ts index 0ea662048c..a37717baa0 100644 --- a/apps/browser/src/background/commands.background.ts +++ b/apps/browser/src/background/commands.background.ts @@ -5,10 +5,10 @@ import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/pl import { PasswordGenerationServiceAbstraction } from "@bitwarden/common/tools/generator/password"; import { openUnlockPopout } from "../auth/popup/utils/auth-popout-window"; +import LockedVaultPendingNotificationsItem from "../autofill/notification/models/locked-vault-pending-notifications-item"; import { BrowserApi } from "../platform/browser/browser-api"; import MainBackground from "./main.background"; -import LockedVaultPendingNotificationsItem from "./models/lockedVaultPendingNotificationsItem"; export default class CommandsBackground { private isSafari: boolean; diff --git a/apps/browser/src/background/main.background.ts b/apps/browser/src/background/main.background.ts index 2b7b2b3f09..611147c54c 100644 --- a/apps/browser/src/background/main.background.ts +++ b/apps/browser/src/background/main.background.ts @@ -128,6 +128,7 @@ import ContextMenusBackground from "../autofill/background/context-menus.backgro import NotificationBackground from "../autofill/background/notification.background"; import OverlayBackground from "../autofill/background/overlay.background"; import TabsBackground from "../autofill/background/tabs.background"; +import WebRequestBackground from "../autofill/background/web-request.background"; import { CipherContextMenuHandler } from "../autofill/browser/cipher-context-menu-handler"; import { ContextMenuClickedHandler } from "../autofill/browser/context-menu-clicked-handler"; import { MainContextMenuHandler } from "../autofill/browser/main-context-menu-handler"; @@ -162,7 +163,6 @@ import CommandsBackground from "./commands.background"; import IdleBackground from "./idle.background"; import { NativeMessagingBackground } from "./nativeMessaging.background"; import RuntimeBackground from "./runtime.background"; -import WebRequestBackground from "./webRequest.background"; export default class MainBackground { messagingService: MessagingServiceAbstraction; diff --git a/apps/browser/src/background/models/add-unlock-vault-queue-message.ts b/apps/browser/src/background/models/add-unlock-vault-queue-message.ts deleted file mode 100644 index 9ddde27100..0000000000 --- a/apps/browser/src/background/models/add-unlock-vault-queue-message.ts +++ /dev/null @@ -1,6 +0,0 @@ -import NotificationQueueMessage from "./notificationQueueMessage"; -import { NotificationQueueMessageType } from "./notificationQueueMessageType"; - -export default class AddUnlockVaultQueueMessage extends NotificationQueueMessage { - type: NotificationQueueMessageType.UnlockVault; -} diff --git a/apps/browser/src/background/runtime.background.ts b/apps/browser/src/background/runtime.background.ts index b1fddf3eab..434fd07834 100644 --- a/apps/browser/src/background/runtime.background.ts +++ b/apps/browser/src/background/runtime.background.ts @@ -13,6 +13,7 @@ import { openSsoAuthResultPopout, openTwoFactorAuthPopout, } from "../auth/popup/utils/auth-popout-window"; +import LockedVaultPendingNotificationsItem from "../autofill/notification/models/locked-vault-pending-notifications-item"; import { AutofillService } from "../autofill/services/abstractions/autofill.service"; import { BrowserApi } from "../platform/browser/browser-api"; import { BrowserStateService } from "../platform/services/abstractions/browser-state.service"; @@ -21,7 +22,6 @@ import BrowserPlatformUtilsService from "../platform/services/browser-platform-u import { AbortManager } from "../vault/background/abort-manager"; import MainBackground from "./main.background"; -import LockedVaultPendingNotificationsItem from "./models/lockedVaultPendingNotificationsItem"; export default class RuntimeBackground { private autofillTimeout: any; diff --git a/apps/browser/src/popup/app-routing.module.ts b/apps/browser/src/popup/app-routing.module.ts index 68a7a6316d..6dd41320c7 100644 --- a/apps/browser/src/popup/app-routing.module.ts +++ b/apps/browser/src/popup/app-routing.module.ts @@ -27,6 +27,7 @@ import { SsoComponent } from "../auth/popup/sso.component"; import { TwoFactorOptionsComponent } from "../auth/popup/two-factor-options.component"; import { TwoFactorComponent } from "../auth/popup/two-factor.component"; import { UpdateTempPasswordComponent } from "../auth/popup/update-temp-password.component"; +import { AutofillComponent } from "../autofill/popup/settings/autofill.component"; import { GeneratorComponent } from "../tools/popup/generator/generator.component"; import { PasswordGeneratorHistoryComponent } from "../tools/popup/generator/password-generator-history.component"; import { SendAddEditComponent } from "../tools/popup/send/send-add-edit.component"; @@ -47,7 +48,6 @@ import { ViewComponent } from "../vault/popup/components/vault/view.component"; import { FolderAddEditComponent } from "../vault/popup/settings/folder-add-edit.component"; import { DebounceNavigationService } from "./services/debounceNavigationService"; -import { AutofillComponent } from "./settings/autofill.component"; import { ExcludedDomainsComponent } from "./settings/excluded-domains.component"; import { FoldersComponent } from "./settings/folders.component"; import { HelpAndFeedbackComponent } from "./settings/help-and-feedback.component"; diff --git a/apps/browser/src/popup/app.module.ts b/apps/browser/src/popup/app.module.ts index 3aff12b4e3..155e02e4fa 100644 --- a/apps/browser/src/popup/app.module.ts +++ b/apps/browser/src/popup/app.module.ts @@ -34,6 +34,7 @@ import { SsoComponent } from "../auth/popup/sso.component"; import { TwoFactorOptionsComponent } from "../auth/popup/two-factor-options.component"; import { TwoFactorComponent } from "../auth/popup/two-factor.component"; import { UpdateTempPasswordComponent } from "../auth/popup/update-temp-password.component"; +import { AutofillComponent } from "../autofill/popup/settings/autofill.component"; import { HeaderComponent } from "../platform/popup/header.component"; import { FilePopoutCalloutComponent } from "../tools/popup/components/file-popout-callout.component"; import { GeneratorComponent } from "../tools/popup/generator/generator.component"; @@ -68,7 +69,6 @@ import { PopOutComponent } from "./components/pop-out.component"; import { PrivateModeWarningComponent } from "./components/private-mode-warning.component"; import { UserVerificationComponent } from "./components/user-verification.component"; import { ServicesModule } from "./services/services.module"; -import { AutofillComponent } from "./settings/autofill.component"; import { ExcludedDomainsComponent } from "./settings/excluded-domains.component"; import { FoldersComponent } from "./settings/folders.component"; import { HelpAndFeedbackComponent } from "./settings/help-and-feedback.component";