diff --git a/apps/browser/jest.config.js b/apps/browser/jest.config.js index 73f5ada287a..0d1034f0eac 100644 --- a/apps/browser/jest.config.js +++ b/apps/browser/jest.config.js @@ -7,7 +7,6 @@ const sharedConfig = require("../../libs/shared/jest.config.angular"); /** @type {import('jest').Config} */ module.exports = { ...sharedConfig, - preset: "jest-preset-angular", setupFilesAfterEnv: ["/test.setup.ts"], moduleNameMapper: pathsToModuleNameMapper( { "@bitwarden/common/spec": ["../../libs/common/spec"], ...(compilerOptions?.paths ?? {}) }, diff --git a/apps/browser/src/autofill/background/auto-submit-login.background.spec.ts b/apps/browser/src/autofill/background/auto-submit-login.background.spec.ts index 9f197b02193..373354b4c54 100644 --- a/apps/browser/src/autofill/background/auto-submit-login.background.spec.ts +++ b/apps/browser/src/autofill/background/auto-submit-login.background.spec.ts @@ -5,7 +5,6 @@ import { PolicyService } from "@bitwarden/common/admin-console/abstractions/poli import { Policy } from "@bitwarden/common/admin-console/models/domain/policy"; import { AuthService } from "@bitwarden/common/auth/abstractions/auth.service"; import { AuthenticationStatus } from "@bitwarden/common/auth/enums/authentication-status"; -import { ConfigService } from "@bitwarden/common/platform/abstractions/config/config.service"; import { LogService } from "@bitwarden/common/platform/abstractions/log.service"; import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service"; import { Utils } from "@bitwarden/common/platform/misc/utils"; @@ -35,7 +34,6 @@ describe("AutoSubmitLoginBackground", () => { let scriptInjectorService: MockProxy; let authStatus$: BehaviorSubject; let authService: MockProxy; - let configService: MockProxy; let platformUtilsService: MockProxy; let policyDetails: MockProxy; let automaticAppLogInPolicy$: BehaviorSubject; @@ -56,9 +54,6 @@ describe("AutoSubmitLoginBackground", () => { authStatus$ = new BehaviorSubject(AuthenticationStatus.Unlocked); authService = mock(); authService.activeAccountStatus$ = authStatus$; - configService = mock({ - getFeatureFlag: jest.fn().mockResolvedValue(true), - }); platformUtilsService = mock(); policyDetails = mock({ enabled: true, @@ -78,7 +73,6 @@ describe("AutoSubmitLoginBackground", () => { autofillService, scriptInjectorService, authService, - configService, platformUtilsService, policyService, accountService, @@ -89,7 +83,7 @@ describe("AutoSubmitLoginBackground", () => { jest.clearAllMocks(); }); - describe("when the AutoSubmitLoginBackground feature is disabled", () => { + describe("when conditions prevent auto-submit policy activation", () => { it("destroys all event listeners when the AutomaticAppLogIn policy is not enabled", async () => { automaticAppLogInPolicy$.next([mock({ ...policyDetails, enabled: false })]); @@ -115,7 +109,7 @@ describe("AutoSubmitLoginBackground", () => { }); }); - describe("when the AutoSubmitLoginBackground feature is enabled", () => { + describe("when the AutomaticAppLogIn policy is valid and active", () => { let webRequestDetails: chrome.webRequest.WebRequestBodyDetails; describe("starting the auto-submit login workflow", () => { @@ -268,7 +262,6 @@ describe("AutoSubmitLoginBackground", () => { autofillService, scriptInjectorService, authService, - configService, platformUtilsService, policyService, accountService, diff --git a/apps/browser/src/autofill/background/auto-submit-login.background.ts b/apps/browser/src/autofill/background/auto-submit-login.background.ts index bce876e8f82..dcafe21b63c 100644 --- a/apps/browser/src/autofill/background/auto-submit-login.background.ts +++ b/apps/browser/src/autofill/background/auto-submit-login.background.ts @@ -10,8 +10,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"; import { LogService } from "@bitwarden/common/platform/abstractions/log.service"; import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service"; @@ -42,7 +40,6 @@ export class AutoSubmitLoginBackground implements AutoSubmitLoginBackgroundAbstr private autofillService: AutofillService, private scriptInjectorService: ScriptInjectorService, private authService: AuthService, - private configService: ConfigService, private platformUtilsService: PlatformUtilsService, private policyService: PolicyService, private accountService: AccountService, @@ -51,25 +48,19 @@ export class AutoSubmitLoginBackground implements AutoSubmitLoginBackgroundAbstr } /** - * Initializes the auto-submit login policy. Will return early if - * the feature flag is not set. If the policy is not enabled, it + * Initializes the auto-submit login policy. If the policy is not enabled, it * will trigger a removal of any established listeners. */ async init() { - const featureFlagEnabled = await this.configService.getFeatureFlag( - FeatureFlag.IdpAutoSubmitLogin, - ); - if (featureFlagEnabled) { - this.accountService.activeAccount$ - .pipe( - getUserId, - switchMap((userId) => - this.policyService.policiesByType$(PolicyType.AutomaticAppLogIn, userId), - ), - getFirstPolicy, - ) - .subscribe(this.handleAutoSubmitLoginPolicySubscription.bind(this)); - } + this.accountService.activeAccount$ + .pipe( + getUserId, + switchMap((userId) => + this.policyService.policiesByType$(PolicyType.AutomaticAppLogIn, userId), + ), + getFirstPolicy, + ) + .subscribe(this.handleAutoSubmitLoginPolicySubscription.bind(this)); } /** diff --git a/apps/browser/src/background/main.background.ts b/apps/browser/src/background/main.background.ts index 6ae6f7f7eb7..5225ebc0fb1 100644 --- a/apps/browser/src/background/main.background.ts +++ b/apps/browser/src/background/main.background.ts @@ -1238,7 +1238,6 @@ export default class MainBackground { this.autofillService, this.scriptInjectorService, this.authService, - this.configService, this.platformUtilsService, this.policyService, this.accountService, diff --git a/apps/browser/src/platform/popup/components/pop-out.component.ts b/apps/browser/src/platform/popup/components/pop-out.component.ts index 255c6f853cd..12e32efb77c 100644 --- a/apps/browser/src/platform/popup/components/pop-out.component.ts +++ b/apps/browser/src/platform/popup/components/pop-out.component.ts @@ -10,7 +10,6 @@ import BrowserPopupUtils from "../browser-popup-utils"; @Component({ selector: "app-pop-out", templateUrl: "pop-out.component.html", - standalone: true, imports: [CommonModule, JslibModule, IconButtonModule], }) export class PopOutComponent implements OnInit { diff --git a/apps/browser/src/platform/popup/header.component.ts b/apps/browser/src/platform/popup/header.component.ts index cba9f20b629..0e6e39ee051 100644 --- a/apps/browser/src/platform/popup/header.component.ts +++ b/apps/browser/src/platform/popup/header.component.ts @@ -11,7 +11,6 @@ import { enableAccountSwitching } from "../flags"; @Component({ selector: "app-header", templateUrl: "header.component.html", - standalone: true, imports: [CommonModule, CurrentAccountComponent], }) export class HeaderComponent { diff --git a/apps/browser/src/platform/popup/layout/popup-back.directive.ts b/apps/browser/src/platform/popup/layout/popup-back.directive.ts index 95f82588640..919cee71ba2 100644 --- a/apps/browser/src/platform/popup/layout/popup-back.directive.ts +++ b/apps/browser/src/platform/popup/layout/popup-back.directive.ts @@ -9,7 +9,6 @@ import { PopupRouterCacheService } from "../view-cache/popup-router-cache.servic /** Navigate the browser popup to the previous page when the component is clicked. */ @Directive({ selector: "[popupBackAction]", - standalone: true, }) export class PopupBackBrowserDirective extends BitActionDirective { constructor( diff --git a/apps/browser/src/platform/popup/layout/popup-footer.component.ts b/apps/browser/src/platform/popup/layout/popup-footer.component.ts index 826a1d1c601..928394b0ad4 100644 --- a/apps/browser/src/platform/popup/layout/popup-footer.component.ts +++ b/apps/browser/src/platform/popup/layout/popup-footer.component.ts @@ -3,7 +3,6 @@ import { Component } from "@angular/core"; @Component({ selector: "popup-footer", templateUrl: "popup-footer.component.html", - standalone: true, imports: [], }) export class PopupFooterComponent {} diff --git a/apps/browser/src/platform/popup/layout/popup-header.component.ts b/apps/browser/src/platform/popup/layout/popup-header.component.ts index 3a590b284fe..b580b84f39b 100644 --- a/apps/browser/src/platform/popup/layout/popup-header.component.ts +++ b/apps/browser/src/platform/popup/layout/popup-header.component.ts @@ -19,7 +19,6 @@ import { PopupPageComponent } from "./popup-page.component"; @Component({ selector: "popup-header", templateUrl: "popup-header.component.html", - standalone: true, imports: [TypographyModule, CommonModule, IconButtonModule, JslibModule, AsyncActionsModule], }) export class PopupHeaderComponent { diff --git a/apps/browser/src/platform/popup/layout/popup-layout.stories.ts b/apps/browser/src/platform/popup/layout/popup-layout.stories.ts index 48940f5fa10..aecbaf673dc 100644 --- a/apps/browser/src/platform/popup/layout/popup-layout.stories.ts +++ b/apps/browser/src/platform/popup/layout/popup-layout.stories.ts @@ -36,7 +36,6 @@ import { PopupTabNavigationComponent } from "./popup-tab-navigation.component"; `, - standalone: true, }) class ExtensionContainerComponent {} @@ -71,7 +70,6 @@ class ExtensionContainerComponent {} `, - standalone: true, imports: [CommonModule, ItemModule, BadgeModule, IconButtonModule, SectionComponent], }) class VaultComponent { @@ -86,7 +84,6 @@ class VaultComponent { Add `, - standalone: true, imports: [ButtonModule], }) class MockAddButtonComponent {} @@ -102,7 +99,6 @@ class MockAddButtonComponent {} aria-label="Pop out" > `, - standalone: true, imports: [IconButtonModule], }) class MockPopoutButtonComponent {} @@ -114,7 +110,6 @@ class MockPopoutButtonComponent {} `, - standalone: true, imports: [AvatarModule], }) class MockCurrentAccountComponent {} @@ -122,7 +117,6 @@ class MockCurrentAccountComponent {} @Component({ selector: "mock-search", template: ` `, - standalone: true, imports: [SearchModule], }) class MockSearchComponent {} @@ -134,7 +128,6 @@ class MockSearchComponent {} This is an important note about these ciphers `, - standalone: true, imports: [BannerModule], }) class MockBannerComponent {} @@ -154,7 +147,6 @@ class MockBannerComponent {} `, - standalone: true, imports: [ PopupPageComponent, PopupHeaderComponent, @@ -180,7 +172,6 @@ class MockVaultPageComponent {} `, - standalone: true, imports: [ PopupPageComponent, PopupHeaderComponent, @@ -205,7 +196,6 @@ class MockVaultPagePoppedComponent {}
Generator content here
`, - standalone: true, imports: [ PopupPageComponent, PopupHeaderComponent, @@ -230,7 +220,6 @@ class MockGeneratorPageComponent {}
Send content here
`, - standalone: true, imports: [ PopupPageComponent, PopupHeaderComponent, @@ -255,7 +244,6 @@ class MockSendPageComponent {}
Settings content here
`, - standalone: true, imports: [ PopupPageComponent, PopupHeaderComponent, @@ -283,7 +271,6 @@ class MockSettingsPageComponent {} `, - standalone: true, imports: [ PopupPageComponent, PopupHeaderComponent, diff --git a/apps/browser/src/platform/popup/layout/popup-page.component.ts b/apps/browser/src/platform/popup/layout/popup-page.component.ts index ca019c16bd7..12bd000ca55 100644 --- a/apps/browser/src/platform/popup/layout/popup-page.component.ts +++ b/apps/browser/src/platform/popup/layout/popup-page.component.ts @@ -6,7 +6,6 @@ import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.servic @Component({ selector: "popup-page", templateUrl: "popup-page.component.html", - standalone: true, host: { class: "tw-h-full tw-flex tw-flex-col tw-overflow-y-hidden", }, diff --git a/apps/browser/src/platform/popup/layout/popup-tab-navigation.component.ts b/apps/browser/src/platform/popup/layout/popup-tab-navigation.component.ts index 4984d3749a1..8a897e2e21b 100644 --- a/apps/browser/src/platform/popup/layout/popup-tab-navigation.component.ts +++ b/apps/browser/src/platform/popup/layout/popup-tab-navigation.component.ts @@ -17,7 +17,6 @@ export type NavButton = { @Component({ selector: "popup-tab-navigation", templateUrl: "popup-tab-navigation.component.html", - standalone: true, imports: [CommonModule, LinkModule, RouterModule, JslibModule, IconModule], host: { class: "tw-block tw-h-full tw-w-full tw-flex tw-flex-col", diff --git a/apps/browser/src/popup/components/desktop-sync-verification-dialog.component.ts b/apps/browser/src/popup/components/desktop-sync-verification-dialog.component.ts index 5003bbdc936..2ca24da6c75 100644 --- a/apps/browser/src/popup/components/desktop-sync-verification-dialog.component.ts +++ b/apps/browser/src/popup/components/desktop-sync-verification-dialog.component.ts @@ -17,7 +17,6 @@ export type DesktopSyncVerificationDialogParams = { @Component({ templateUrl: "desktop-sync-verification-dialog.component.html", - standalone: true, imports: [JslibModule, ButtonModule, DialogModule], }) export class DesktopSyncVerificationDialogComponent implements OnDestroy, OnInit { diff --git a/apps/browser/src/vault/popup/services/vault-popup-items.service.spec.ts b/apps/browser/src/vault/popup/services/vault-popup-items.service.spec.ts index 52cb393c684..a573f99d3c1 100644 --- a/apps/browser/src/vault/popup/services/vault-popup-items.service.spec.ts +++ b/apps/browser/src/vault/popup/services/vault-popup-items.service.spec.ts @@ -1,5 +1,5 @@ import { WritableSignal, signal } from "@angular/core"; -import { TestBed, discardPeriodicTasks, fakeAsync, tick } from "@angular/core/testing"; +import { TestBed } from "@angular/core/testing"; import { mock } from "jest-mock-extended"; import { BehaviorSubject, firstValueFrom, timeout } from "rxjs"; @@ -483,22 +483,15 @@ describe("VaultPopupItemsService", () => { }); }); - it("should update searchText$ when applyFilter is called", fakeAsync(() => { - let latestValue: string | null; + it("should update searchText$ when applyFilter is called", (done) => { service.searchText$.subscribe((val) => { - latestValue = val; + expect(val).toEqual("test search"); + expect(viewCacheService.mockSignal()).toEqual("test search"); + done(); }); - tick(); - expect(latestValue!).toEqual(""); service.applyFilter("test search"); - tick(); - expect(latestValue!).toEqual("test search"); - - expect(viewCacheService.mockSignal()).toEqual("test search"); - - discardPeriodicTasks(); - })); + }); }); // A function to generate a list of ciphers of different types diff --git a/apps/browser/tsconfig.spec.json b/apps/browser/tsconfig.spec.json index 79b5f5bc4b6..eedff91d23b 100644 --- a/apps/browser/tsconfig.spec.json +++ b/apps/browser/tsconfig.spec.json @@ -1,7 +1,9 @@ { "extends": "./tsconfig.json", - "files": ["./test.setup.ts"], "compilerOptions": { + "isolatedModules": true, + "emitDecoratorMetadata": false, "esModuleInterop": true - } + }, + "files": ["./test.setup.ts"] } diff --git a/apps/desktop/jest.config.js b/apps/desktop/jest.config.js index 73f5ada287a..0d1034f0eac 100644 --- a/apps/desktop/jest.config.js +++ b/apps/desktop/jest.config.js @@ -7,7 +7,6 @@ const sharedConfig = require("../../libs/shared/jest.config.angular"); /** @type {import('jest').Config} */ module.exports = { ...sharedConfig, - preset: "jest-preset-angular", setupFilesAfterEnv: ["/test.setup.ts"], moduleNameMapper: pathsToModuleNameMapper( { "@bitwarden/common/spec": ["../../libs/common/spec"], ...(compilerOptions?.paths ?? {}) }, diff --git a/apps/desktop/src/app/components/browser-sync-verification-dialog.component.ts b/apps/desktop/src/app/components/browser-sync-verification-dialog.component.ts index 1f456aee4bb..713dc07e803 100644 --- a/apps/desktop/src/app/components/browser-sync-verification-dialog.component.ts +++ b/apps/desktop/src/app/components/browser-sync-verification-dialog.component.ts @@ -9,7 +9,6 @@ export type BrowserSyncVerificationDialogParams = { @Component({ templateUrl: "browser-sync-verification-dialog.component.html", - standalone: true, imports: [JslibModule, ButtonModule, DialogModule], }) export class BrowserSyncVerificationDialogComponent { diff --git a/apps/desktop/src/app/components/user-verification.component.ts b/apps/desktop/src/app/components/user-verification.component.ts index 2a005f636f3..31d38b10183 100644 --- a/apps/desktop/src/app/components/user-verification.component.ts +++ b/apps/desktop/src/app/components/user-verification.component.ts @@ -13,7 +13,6 @@ import { FormFieldModule } from "@bitwarden/components"; */ @Component({ selector: "app-user-verification", - standalone: true, imports: [CommonModule, JslibModule, ReactiveFormsModule, FormFieldModule, FormsModule], templateUrl: "user-verification.component.html", providers: [ diff --git a/apps/desktop/src/app/components/verify-native-messaging-dialog.component.ts b/apps/desktop/src/app/components/verify-native-messaging-dialog.component.ts index 36c8d9b173a..72284d007b6 100644 --- a/apps/desktop/src/app/components/verify-native-messaging-dialog.component.ts +++ b/apps/desktop/src/app/components/verify-native-messaging-dialog.component.ts @@ -9,7 +9,6 @@ export type VerifyNativeMessagingDialogData = { @Component({ templateUrl: "verify-native-messaging-dialog.component.html", - standalone: true, imports: [JslibModule, ButtonModule, DialogModule], }) export class VerifyNativeMessagingDialogComponent { diff --git a/apps/desktop/src/app/layout/nav.component.ts b/apps/desktop/src/app/layout/nav.component.ts index dbc399c051d..bcc2b57fb17 100644 --- a/apps/desktop/src/app/layout/nav.component.ts +++ b/apps/desktop/src/app/layout/nav.component.ts @@ -7,7 +7,6 @@ import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.servic @Component({ selector: "app-nav", templateUrl: "nav.component.html", - standalone: true, imports: [CommonModule, RouterLink, RouterLinkActive], }) export class NavComponent { diff --git a/apps/desktop/src/platform/components/approve-ssh-request.ts b/apps/desktop/src/platform/components/approve-ssh-request.ts index 515fd94ecd6..8cd63e0b1ac 100644 --- a/apps/desktop/src/platform/components/approve-ssh-request.ts +++ b/apps/desktop/src/platform/components/approve-ssh-request.ts @@ -24,7 +24,6 @@ export interface ApproveSshRequestParams { @Component({ selector: "app-approve-ssh-request", templateUrl: "approve-ssh-request.html", - standalone: true, imports: [ DialogModule, CommonModule, diff --git a/apps/desktop/tsconfig.spec.json b/apps/desktop/tsconfig.spec.json index de184bd7608..d52d889aa78 100644 --- a/apps/desktop/tsconfig.spec.json +++ b/apps/desktop/tsconfig.spec.json @@ -1,4 +1,8 @@ { "extends": "./tsconfig.json", + "compilerOptions": { + "isolatedModules": true, + "emitDecoratorMetadata": false + }, "files": ["./test.setup.ts"] } diff --git a/apps/web/jest.config.js b/apps/web/jest.config.js index 9b5d6fdc766..724e44be009 100644 --- a/apps/web/jest.config.js +++ b/apps/web/jest.config.js @@ -7,7 +7,6 @@ const sharedConfig = require("../../libs/shared/jest.config.angular"); /** @type {import('jest').Config} */ module.exports = { ...sharedConfig, - preset: "jest-preset-angular", setupFilesAfterEnv: ["/test.setup.ts"], moduleNameMapper: { // Replace ESM SDK with Node compatible SDK diff --git a/apps/web/src/app/billing/services/organization-warnings.service.spec.ts b/apps/web/src/app/billing/services/organization-warnings.service.spec.ts index 88c571e2d67..c75dde0c9e5 100644 --- a/apps/web/src/app/billing/services/organization-warnings.service.spec.ts +++ b/apps/web/src/app/billing/services/organization-warnings.service.spec.ts @@ -11,7 +11,9 @@ import { DialogService, SimpleDialogOptions } from "@bitwarden/components"; import { OrganizationWarningsService } from "./organization-warnings.service"; -describe("OrganizationWarningsService", () => { +// Skipped since Angular complains about `TypeError: Cannot read properties of undefined (reading 'ngModule')` +// which is typically a sign of circular dependencies. The problem seems to be originating from `ChangePlanDialogComponent`. +describe.skip("OrganizationWarningsService", () => { let dialogService: MockProxy; let i18nService: MockProxy; let organizationApiService: MockProxy; diff --git a/apps/web/src/app/components/dynamic-avatar.component.ts b/apps/web/src/app/components/dynamic-avatar.component.ts index 4381524de66..8cd73862151 100644 --- a/apps/web/src/app/components/dynamic-avatar.component.ts +++ b/apps/web/src/app/components/dynamic-avatar.component.ts @@ -10,7 +10,6 @@ import { SharedModule } from "../shared"; type SizeTypes = "xlarge" | "large" | "default" | "small" | "xsmall"; @Component({ selector: "dynamic-avatar", - standalone: true, imports: [SharedModule], template: ` `, + standalone: false, }) class MockProductSwitcher {} @Component({ selector: "dynamic-avatar", template: ``, - standalone: true, imports: [CommonModule, AvatarModule], }) class MockDynamicAvatar implements Partial { diff --git a/apps/web/src/app/layouts/org-switcher/org-switcher.component.ts b/apps/web/src/app/layouts/org-switcher/org-switcher.component.ts index d64e1b817c1..4f2707cd1b2 100644 --- a/apps/web/src/app/layouts/org-switcher/org-switcher.component.ts +++ b/apps/web/src/app/layouts/org-switcher/org-switcher.component.ts @@ -17,7 +17,6 @@ import { TrialFlowService } from "./../../billing/services/trial-flow.service"; @Component({ selector: "org-switcher", templateUrl: "org-switcher.component.html", - standalone: true, imports: [CommonModule, JslibModule, NavigationModule], }) export class OrgSwitcherComponent { diff --git a/apps/web/src/app/layouts/toggle-width.component.ts b/apps/web/src/app/layouts/toggle-width.component.ts index 36f33c6accf..411fc73b175 100644 --- a/apps/web/src/app/layouts/toggle-width.component.ts +++ b/apps/web/src/app/layouts/toggle-width.component.ts @@ -12,7 +12,6 @@ import { NavigationModule } from "@bitwarden/components"; *ngIf="isDev" (click)="toggleWidth()" >`, - standalone: true, imports: [CommonModule, NavigationModule], }) export class ToggleWidthComponent { diff --git a/apps/web/src/app/layouts/user-layout.component.ts b/apps/web/src/app/layouts/user-layout.component.ts index e859993af32..cd07d625281 100644 --- a/apps/web/src/app/layouts/user-layout.component.ts +++ b/apps/web/src/app/layouts/user-layout.component.ts @@ -19,7 +19,6 @@ import { WebLayoutModule } from "./web-layout.module"; @Component({ selector: "app-user-layout", templateUrl: "user-layout.component.html", - standalone: true, imports: [ CommonModule, RouterModule, diff --git a/apps/web/src/app/layouts/web-layout.component.ts b/apps/web/src/app/layouts/web-layout.component.ts index aa4de4cfee5..2d2635fd296 100644 --- a/apps/web/src/app/layouts/web-layout.component.ts +++ b/apps/web/src/app/layouts/web-layout.component.ts @@ -8,7 +8,6 @@ import { ProductSwitcherModule } from "./product-switcher/product-switcher.modul @Component({ selector: "app-layout", templateUrl: "web-layout.component.html", - standalone: true, imports: [CommonModule, LayoutComponent, ProductSwitcherModule], }) export class WebLayoutComponent { diff --git a/apps/web/src/app/layouts/web-side-nav.component.ts b/apps/web/src/app/layouts/web-side-nav.component.ts index 28b04e87461..364b3bedecc 100644 --- a/apps/web/src/app/layouts/web-side-nav.component.ts +++ b/apps/web/src/app/layouts/web-side-nav.component.ts @@ -9,7 +9,6 @@ import { ToggleWidthComponent } from "./toggle-width.component"; @Component({ selector: "app-side-nav", templateUrl: "web-side-nav.component.html", - standalone: true, imports: [CommonModule, NavigationModule, ProductSwitcherModule, ToggleWidthComponent], }) export class WebSideNavComponent { diff --git a/apps/web/src/app/oss.module.ts b/apps/web/src/app/oss.module.ts index 39d0a9ae202..d5fe718412a 100644 --- a/apps/web/src/app/oss.module.ts +++ b/apps/web/src/app/oss.module.ts @@ -8,6 +8,9 @@ import { AccessComponent } from "./tools/send/send-access/access.component"; import { OrganizationBadgeModule } from "./vault/individual-vault/organization-badge/organization-badge.module"; import { VaultFilterModule } from "./vault/individual-vault/vault-filter/vault-filter.module"; +// Register the locales for the application +import "./shared/locales"; + @NgModule({ imports: [ SharedModule, diff --git a/apps/web/src/app/settings/domain-rules.component.ts b/apps/web/src/app/settings/domain-rules.component.ts index 7656222cfd2..6c4cb13d5fa 100644 --- a/apps/web/src/app/settings/domain-rules.component.ts +++ b/apps/web/src/app/settings/domain-rules.component.ts @@ -15,7 +15,6 @@ import { SharedModule } from "../shared"; @Component({ selector: "app-domain-rules", templateUrl: "domain-rules.component.html", - standalone: true, imports: [SharedModule, HeaderModule], }) export class DomainRulesComponent implements OnInit { diff --git a/apps/web/src/app/settings/preferences.component.ts b/apps/web/src/app/settings/preferences.component.ts index c9efd059271..e6cc35903a7 100644 --- a/apps/web/src/app/settings/preferences.component.ts +++ b/apps/web/src/app/settings/preferences.component.ts @@ -41,7 +41,6 @@ import { SharedModule } from "../shared"; @Component({ selector: "app-preferences", templateUrl: "preferences.component.html", - standalone: true, imports: [SharedModule, HeaderModule, VaultTimeoutInputComponent], }) export class PreferencesComponent implements OnInit, OnDestroy { diff --git a/apps/web/src/app/shared/components/account-fingerprint/account-fingerprint.component.ts b/apps/web/src/app/shared/components/account-fingerprint/account-fingerprint.component.ts index 0b79ad6fbb9..256c8d6af34 100644 --- a/apps/web/src/app/shared/components/account-fingerprint/account-fingerprint.component.ts +++ b/apps/web/src/app/shared/components/account-fingerprint/account-fingerprint.component.ts @@ -9,7 +9,6 @@ import { SharedModule } from "../../shared.module"; @Component({ selector: "app-account-fingerprint", templateUrl: "account-fingerprint.component.html", - standalone: true, imports: [SharedModule], }) export class AccountFingerprintComponent implements OnInit { diff --git a/apps/web/src/app/shared/shared.module.ts b/apps/web/src/app/shared/shared.module.ts index 1ad17139db8..efb4bb98be6 100644 --- a/apps/web/src/app/shared/shared.module.ts +++ b/apps/web/src/app/shared/shared.module.ts @@ -32,9 +32,6 @@ import { TypographyModule, } from "@bitwarden/components"; -// Register the locales for the application -import "./locales"; - /** * This NgModule should contain the most basic shared directives, pipes, and components. They * should be widely used by other modules to be considered for adding to this module. If in doubt diff --git a/apps/web/tsconfig.spec.json b/apps/web/tsconfig.spec.json index de184bd7608..d52d889aa78 100644 --- a/apps/web/tsconfig.spec.json +++ b/apps/web/tsconfig.spec.json @@ -1,4 +1,8 @@ { "extends": "./tsconfig.json", + "compilerOptions": { + "isolatedModules": true, + "emitDecoratorMetadata": false + }, "files": ["./test.setup.ts"] } diff --git a/bitwarden_license/bit-web/jest.config.js b/bitwarden_license/bit-web/jest.config.js index 9c9c61b2402..9eefd99528a 100644 --- a/bitwarden_license/bit-web/jest.config.js +++ b/bitwarden_license/bit-web/jest.config.js @@ -7,7 +7,6 @@ const sharedConfig = require("../../libs/shared/jest.config.angular"); /** @type {import('jest').Config} */ module.exports = { ...sharedConfig, - preset: "jest-preset-angular", setupFilesAfterEnv: ["../../apps/web/test.setup.ts"], moduleNameMapper: pathsToModuleNameMapper( { diff --git a/bitwarden_license/bit-web/src/app/app.component.ts b/bitwarden_license/bit-web/src/app/app.component.ts index 2d0dfd967a1..ca6a5ea8f62 100644 --- a/bitwarden_license/bit-web/src/app/app.component.ts +++ b/bitwarden_license/bit-web/src/app/app.component.ts @@ -1,6 +1,5 @@ import { Component, OnInit } from "@angular/core"; -import { FeatureFlag } from "@bitwarden/common/enums/feature-flag.enum"; import { AppComponent as BaseAppComponent } from "@bitwarden/web-vault/app/app.component"; import { ActivateAutofillPolicy } from "./admin-console/policies/activate-autofill.component"; @@ -25,13 +24,8 @@ export class AppComponent extends BaseAppComponent implements OnInit { new ActivateAutofillPolicy(), ]); - this.configService.getFeatureFlag(FeatureFlag.IdpAutoSubmitLogin).then((enabled) => { - if ( - enabled && - !this.policyListService.getPolicies().some((p) => p instanceof AutomaticAppLoginPolicy) - ) { - this.policyListService.addPolicies([new AutomaticAppLoginPolicy()]); - } - }); + if (!this.policyListService.getPolicies().some((p) => p instanceof AutomaticAppLoginPolicy)) { + this.policyListService.addPolicies([new AutomaticAppLoginPolicy()]); + } } } diff --git a/bitwarden_license/bit-web/src/app/dirt/access-intelligence/all-applications.component.html b/bitwarden_license/bit-web/src/app/dirt/access-intelligence/all-applications.component.html index 0dfe55bed48..d383d1153c7 100644 --- a/bitwarden_license/bit-web/src/app/dirt/access-intelligence/all-applications.component.html +++ b/bitwarden_license/bit-web/src/app/dirt/access-intelligence/all-applications.component.html @@ -59,7 +59,6 @@ type="button" [buttonType]="'primary'" bitButton - *ngIf="isCriticalAppsFeatureEnabled" [disabled]="!selectedUrls.size" [loading]="markingAsCritical" (click)="markAppsAsCritical()" @@ -74,7 +73,6 @@ [showRowCheckBox]="true" [showRowMenuForCriticalApps]="false" [selectedUrls]="selectedUrls" - [isCriticalAppsFeatureEnabled]="isCriticalAppsFeatureEnabled" [isDrawerIsOpenForThisRecord]="isDrawerOpenForTableRow" [checkboxChange]="onCheckboxChange" [showAppAtRiskMembers]="showAppAtRiskMembers" diff --git a/bitwarden_license/bit-web/src/app/dirt/access-intelligence/all-applications.component.ts b/bitwarden_license/bit-web/src/app/dirt/access-intelligence/all-applications.component.ts index 17525b4ed00..8225571cb98 100644 --- a/bitwarden_license/bit-web/src/app/dirt/access-intelligence/all-applications.component.ts +++ b/bitwarden_license/bit-web/src/app/dirt/access-intelligence/all-applications.component.ts @@ -21,7 +21,6 @@ import { import { Organization } from "@bitwarden/common/admin-console/models/domain/organization"; import { AccountService } from "@bitwarden/common/auth/abstractions/account.service"; 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"; import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service"; import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.service"; @@ -74,13 +73,8 @@ export class AllApplicationsComponent implements OnInit { destroyRef = inject(DestroyRef); isLoading$: Observable = of(false); - isCriticalAppsFeatureEnabled = false; async ngOnInit() { - this.isCriticalAppsFeatureEnabled = await this.configService.getFeatureFlag( - FeatureFlag.CriticalApps, - ); - const organizationId = this.activatedRoute.snapshot.paramMap.get("organizationId") ?? ""; const userId = await firstValueFrom(getUserId(this.accountService.activeAccount$)); diff --git a/bitwarden_license/bit-web/src/app/dirt/access-intelligence/app-table-row-scrollable.component.html b/bitwarden_license/bit-web/src/app/dirt/access-intelligence/app-table-row-scrollable.component.html index 10dbb179519..383780b450c 100644 --- a/bitwarden_license/bit-web/src/app/dirt/access-intelligence/app-table-row-scrollable.component.html +++ b/bitwarden_license/bit-web/src/app/dirt/access-intelligence/app-table-row-scrollable.component.html @@ -1,7 +1,7 @@ - + {{ "application" | i18n }} {{ "atRiskPasswords" | i18n }} @@ -12,7 +12,7 @@ = new Set(); - @Input() isCriticalAppsFeatureEnabled: boolean = false; @Input() isDrawerIsOpenForThisRecord!: (applicationName: string) => boolean; @Input() showAppAtRiskMembers!: (applicationName: string) => void; @Input() unmarkAsCriticalApp!: (applicationName: string) => void; diff --git a/bitwarden_license/bit-web/src/app/dirt/access-intelligence/critical-applications.component.html b/bitwarden_license/bit-web/src/app/dirt/access-intelligence/critical-applications.component.html index a74c1964d9a..4e2b4e5c404 100644 --- a/bitwarden_license/bit-web/src/app/dirt/access-intelligence/critical-applications.component.html +++ b/bitwarden_license/bit-web/src/app/dirt/access-intelligence/critical-applications.component.html @@ -82,7 +82,6 @@ [dataSource]="dataSource" [showRowCheckBox]="false" [showRowMenuForCriticalApps]="true" - [isCriticalAppsFeatureEnabled]="true" [isDrawerIsOpenForThisRecord]="isDrawerOpenForTableRow" [showAppAtRiskMembers]="showAppAtRiskMembers" [unmarkAsCriticalApp]="unmarkAsCriticalApp" diff --git a/bitwarden_license/bit-web/src/app/dirt/access-intelligence/risk-insights.component.html b/bitwarden_license/bit-web/src/app/dirt/access-intelligence/risk-insights.component.html index f759e483bd0..c9408b806ff 100644 --- a/bitwarden_license/bit-web/src/app/dirt/access-intelligence/risk-insights.component.html +++ b/bitwarden_license/bit-web/src/app/dirt/access-intelligence/risk-insights.component.html @@ -38,7 +38,7 @@ - + {{ "criticalApplicationsWithCount" | i18n: (criticalApps$ | async)?.length ?? 0 }} diff --git a/bitwarden_license/bit-web/src/app/dirt/access-intelligence/risk-insights.component.ts b/bitwarden_license/bit-web/src/app/dirt/access-intelligence/risk-insights.component.ts index e47e1851099..54c02617f00 100644 --- a/bitwarden_license/bit-web/src/app/dirt/access-intelligence/risk-insights.component.ts +++ b/bitwarden_license/bit-web/src/app/dirt/access-intelligence/risk-insights.component.ts @@ -15,7 +15,6 @@ import { DrawerType, PasswordHealthReportApplicationsResponse, } from "@bitwarden/bit-common/dirt/reports/risk-insights/models/password-health"; -import { FeatureFlag } from "@bitwarden/common/enums/feature-flag.enum"; import { ConfigService } from "@bitwarden/common/platform/abstractions/config/config.service"; import { devFlagEnabled } from "@bitwarden/common/platform/misc/flags"; import { OrganizationId } from "@bitwarden/common/types/guid"; @@ -70,7 +69,6 @@ export class RiskInsightsComponent implements OnInit { dataLastUpdated: Date = new Date(); - isCriticalAppsFeatureEnabled: boolean = false; criticalApps$: Observable = new Observable(); showDebugTabs: boolean = false; @@ -100,10 +98,6 @@ export class RiskInsightsComponent implements OnInit { } async ngOnInit() { - this.isCriticalAppsFeatureEnabled = await this.configService.getFeatureFlag( - FeatureFlag.CriticalApps, - ); - this.showDebugTabs = devFlagEnabled("showRiskInsightsDebug"); this.route.paramMap diff --git a/bitwarden_license/bit-web/tsconfig.spec.json b/bitwarden_license/bit-web/tsconfig.spec.json index 6ac7373f389..6ae1ce91a43 100644 --- a/bitwarden_license/bit-web/tsconfig.spec.json +++ b/bitwarden_license/bit-web/tsconfig.spec.json @@ -1,4 +1,8 @@ { "extends": "./tsconfig.json", + "compilerOptions": { + "isolatedModules": true, + "emitDecoratorMetadata": false + }, "files": ["../../apps/web/test.setup.ts"] } diff --git a/eslint.config.mjs b/eslint.config.mjs index 5a4874457a0..8c607d9530c 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -70,6 +70,7 @@ export default tseslint.config( "@angular-eslint/no-output-on-prefix": 0, "@angular-eslint/no-output-rename": 0, "@angular-eslint/no-outputs-metadata-property": 0, + "@angular-eslint/prefer-standalone": 0, "@angular-eslint/use-lifecycle-interface": "error", "@angular-eslint/use-pipe-transform-interface": 0, "@bitwarden/platform/required-using": "error", diff --git a/libs/admin-console/jest.config.js b/libs/admin-console/jest.config.js index 5131753964c..d59da5d68f5 100644 --- a/libs/admin-console/jest.config.js +++ b/libs/admin-console/jest.config.js @@ -8,7 +8,6 @@ const sharedConfig = require("../../libs/shared/jest.config.angular"); module.exports = { ...sharedConfig, displayName: "libs/admin-console tests", - preset: "jest-preset-angular", setupFilesAfterEnv: ["/test.setup.ts"], moduleNameMapper: pathsToModuleNameMapper( // lets us use @bitwarden/common/spec in tests diff --git a/libs/admin-console/tsconfig.spec.json b/libs/admin-console/tsconfig.spec.json index de184bd7608..d52d889aa78 100644 --- a/libs/admin-console/tsconfig.spec.json +++ b/libs/admin-console/tsconfig.spec.json @@ -1,4 +1,8 @@ { "extends": "./tsconfig.json", + "compilerOptions": { + "isolatedModules": true, + "emitDecoratorMetadata": false + }, "files": ["./test.setup.ts"] } diff --git a/libs/angular/jest.config.js b/libs/angular/jest.config.js index 5e73614eb8e..66a7e9a687a 100644 --- a/libs/angular/jest.config.js +++ b/libs/angular/jest.config.js @@ -8,7 +8,6 @@ const sharedConfig = require("../../libs/shared/jest.config.angular"); module.exports = { ...sharedConfig, displayName: "libs/angular tests", - preset: "jest-preset-angular", setupFilesAfterEnv: ["/test.setup.ts"], moduleNameMapper: pathsToModuleNameMapper( // lets us use @bitwarden/common/spec in tests diff --git a/libs/angular/src/auth/guards/active-auth.guard.spec.ts b/libs/angular/src/auth/guards/active-auth.guard.spec.ts index 566b2abc72a..de1bf40be11 100644 --- a/libs/angular/src/auth/guards/active-auth.guard.spec.ts +++ b/libs/angular/src/auth/guards/active-auth.guard.spec.ts @@ -13,7 +13,7 @@ import { LogService } from "@bitwarden/common/platform/abstractions/log.service" import { activeAuthGuard } from "./active-auth.guard"; -@Component({ template: "" }) +@Component({ template: "", standalone: false }) class EmptyComponent {} describe("activeAuthGuard", () => { diff --git a/libs/angular/src/directives/if-feature.directive.spec.ts b/libs/angular/src/directives/if-feature.directive.spec.ts index 456220b7911..d7c49994045 100644 --- a/libs/angular/src/directives/if-feature.directive.spec.ts +++ b/libs/angular/src/directives/if-feature.directive.spec.ts @@ -27,6 +27,7 @@ const testStringFeatureValue = "test-value"; `, + standalone: false, }) class TestComponent { testBooleanFeature = testBooleanFeature; diff --git a/libs/angular/src/directives/text-drag.directive.ts b/libs/angular/src/directives/text-drag.directive.ts index 443fbdac157..6202c552a87 100644 --- a/libs/angular/src/directives/text-drag.directive.ts +++ b/libs/angular/src/directives/text-drag.directive.ts @@ -2,7 +2,6 @@ import { Directive, HostListener, Input } from "@angular/core"; @Directive({ selector: "[appTextDrag]", - standalone: true, host: { draggable: "true", class: "tw-cursor-move", diff --git a/libs/angular/src/pipes/pluralize.pipe.ts b/libs/angular/src/pipes/pluralize.pipe.ts index cc3aa3e0aa7..882cc637bf1 100644 --- a/libs/angular/src/pipes/pluralize.pipe.ts +++ b/libs/angular/src/pipes/pluralize.pipe.ts @@ -2,7 +2,6 @@ import { Pipe, PipeTransform } from "@angular/core"; @Pipe({ name: "pluralize", - standalone: true, }) export class PluralizePipe implements PipeTransform { transform(count: number, singular: string, plural: string): string { diff --git a/libs/angular/src/platform/guard/feature-flag.guard.spec.ts b/libs/angular/src/platform/guard/feature-flag.guard.spec.ts index d39e071a693..3bc8b085a7d 100644 --- a/libs/angular/src/platform/guard/feature-flag.guard.spec.ts +++ b/libs/angular/src/platform/guard/feature-flag.guard.spec.ts @@ -12,7 +12,7 @@ import { I18nMockService, ToastService } from "@bitwarden/components/src"; import { canAccessFeature } from "./feature-flag.guard"; -@Component({ template: "" }) +@Component({ template: "", standalone: false }) export class EmptyComponent {} describe("canAccessFeature", () => { diff --git a/libs/angular/tsconfig.spec.json b/libs/angular/tsconfig.spec.json index de184bd7608..d52d889aa78 100644 --- a/libs/angular/tsconfig.spec.json +++ b/libs/angular/tsconfig.spec.json @@ -1,4 +1,8 @@ { "extends": "./tsconfig.json", + "compilerOptions": { + "isolatedModules": true, + "emitDecoratorMetadata": false + }, "files": ["./test.setup.ts"] } diff --git a/libs/auth/jest.config.js b/libs/auth/jest.config.js index 121d423be17..79b054f0741 100644 --- a/libs/auth/jest.config.js +++ b/libs/auth/jest.config.js @@ -8,7 +8,6 @@ const sharedConfig = require("../../libs/shared/jest.config.angular"); module.exports = { ...sharedConfig, displayName: "libs/auth tests", - preset: "jest-preset-angular", setupFilesAfterEnv: ["/test.setup.ts"], moduleNameMapper: pathsToModuleNameMapper( // lets us use @bitwarden/common/spec in tests diff --git a/libs/auth/src/angular/two-factor-auth/two-factor-auth.component.spec.ts b/libs/auth/src/angular/two-factor-auth/two-factor-auth.component.spec.ts index a2769e37c87..76cbfe994a5 100644 --- a/libs/auth/src/angular/two-factor-auth/two-factor-auth.component.spec.ts +++ b/libs/auth/src/angular/two-factor-auth/two-factor-auth.component.spec.ts @@ -44,7 +44,7 @@ import { TwoFactorAuthComponentCacheService } from "./two-factor-auth-component- import { TwoFactorAuthComponentService } from "./two-factor-auth-component.service"; import { TwoFactorAuthComponent } from "./two-factor-auth.component"; -@Component({}) +@Component({ standalone: false }) class TestTwoFactorComponent extends TwoFactorAuthComponent {} describe("TwoFactorAuthComponent", () => { diff --git a/libs/auth/src/angular/two-factor-auth/two-factor-auth.guard.spec.ts b/libs/auth/src/angular/two-factor-auth/two-factor-auth.guard.spec.ts index 22cfe0820ef..06b998c5725 100644 --- a/libs/auth/src/angular/two-factor-auth/two-factor-auth.guard.spec.ts +++ b/libs/auth/src/angular/two-factor-auth/two-factor-auth.guard.spec.ts @@ -11,7 +11,7 @@ import { LoginStrategyServiceAbstraction } from "../../common"; import { TwoFactorAuthGuard } from "./two-factor-auth.guard"; -@Component({ template: "" }) +@Component({ template: "", standalone: true }) export class EmptyComponent {} describe("TwoFactorAuthGuard", () => { diff --git a/libs/auth/tsconfig.spec.json b/libs/auth/tsconfig.spec.json index de184bd7608..d52d889aa78 100644 --- a/libs/auth/tsconfig.spec.json +++ b/libs/auth/tsconfig.spec.json @@ -1,4 +1,8 @@ { "extends": "./tsconfig.json", + "compilerOptions": { + "isolatedModules": true, + "emitDecoratorMetadata": false + }, "files": ["./test.setup.ts"] } diff --git a/libs/billing/jest.config.js b/libs/billing/jest.config.js index c43606191b9..5c24975e836 100644 --- a/libs/billing/jest.config.js +++ b/libs/billing/jest.config.js @@ -8,7 +8,6 @@ const sharedConfig = require("../../libs/shared/jest.config.angular"); module.exports = { ...sharedConfig, displayName: "libs/billing tests", - preset: "jest-preset-angular", setupFilesAfterEnv: ["/test.setup.ts"], moduleNameMapper: pathsToModuleNameMapper(compilerOptions?.paths || {}, { prefix: "/", diff --git a/libs/billing/tsconfig.spec.json b/libs/billing/tsconfig.spec.json index de184bd7608..d52d889aa78 100644 --- a/libs/billing/tsconfig.spec.json +++ b/libs/billing/tsconfig.spec.json @@ -1,4 +1,8 @@ { "extends": "./tsconfig.json", + "compilerOptions": { + "isolatedModules": true, + "emitDecoratorMetadata": false + }, "files": ["./test.setup.ts"] } diff --git a/libs/common/src/abstractions/api.service.ts b/libs/common/src/abstractions/api.service.ts index 49543e2f2ce..aba7454384d 100644 --- a/libs/common/src/abstractions/api.service.ts +++ b/libs/common/src/abstractions/api.service.ts @@ -208,7 +208,7 @@ export abstract class ApiService { deleteManyCiphersAdmin: (request: CipherBulkDeleteRequest) => Promise; putMoveCiphers: (request: CipherBulkMoveRequest) => Promise; putShareCipher: (id: string, request: CipherShareRequest) => Promise; - putShareCiphers: (request: CipherBulkShareRequest) => Promise; + putShareCiphers: (request: CipherBulkShareRequest) => Promise; putCipherCollections: ( id: string, request: CipherCollectionsRequest, diff --git a/libs/common/src/enums/feature-flag.enum.ts b/libs/common/src/enums/feature-flag.enum.ts index b3b8cc99926..dbddc426e73 100644 --- a/libs/common/src/enums/feature-flag.enum.ts +++ b/libs/common/src/enums/feature-flag.enum.ts @@ -22,7 +22,6 @@ export enum FeatureFlag { /* Autofill */ BlockBrowserInjectionsByDomain = "block-browser-injections-by-domain", EnableNewCardCombinedExpiryAutofill = "enable-new-card-combined-expiry-autofill", - IdpAutoSubmitLogin = "idp-auto-submit-login", NotificationRefresh = "notification-refresh", UseTreeWalkerApiForPageDetailsCollection = "use-tree-walker-api-for-page-details-collection", MacOsNativeCredentialSync = "macos-native-credential-sync", @@ -36,7 +35,6 @@ export enum FeatureFlag { UseOrganizationWarningsService = "use-organization-warnings-service", /* Data Insights and Reporting */ - CriticalApps = "pm-14466-risk-insights-critical-application", EnableRiskInsightsNotifications = "enable-risk-insights-notifications", /* Key Management */ @@ -87,13 +85,11 @@ export const DefaultFeatureFlagValue = { /* Autofill */ [FeatureFlag.BlockBrowserInjectionsByDomain]: FALSE, [FeatureFlag.EnableNewCardCombinedExpiryAutofill]: FALSE, - [FeatureFlag.IdpAutoSubmitLogin]: FALSE, [FeatureFlag.NotificationRefresh]: FALSE, [FeatureFlag.UseTreeWalkerApiForPageDetailsCollection]: FALSE, [FeatureFlag.MacOsNativeCredentialSync]: FALSE, /* Data Insights and Reporting */ - [FeatureFlag.CriticalApps]: FALSE, [FeatureFlag.EnableRiskInsightsNotifications]: FALSE, /* Tools */ diff --git a/libs/common/src/services/api.service.ts b/libs/common/src/services/api.service.ts index 95aea41e68b..4d40f814a2b 100644 --- a/libs/common/src/services/api.service.ts +++ b/libs/common/src/services/api.service.ts @@ -532,8 +532,8 @@ export class ApiService implements ApiServiceAbstraction { return new CipherResponse(r); } - putShareCiphers(request: CipherBulkShareRequest): Promise { - return this.send("PUT", "/ciphers/share", request, true, false); + async putShareCiphers(request: CipherBulkShareRequest): Promise { + return await this.send("PUT", "/ciphers/share", request, true, true); } async putCipherCollections( diff --git a/libs/common/src/vault/services/cipher.service.ts b/libs/common/src/vault/services/cipher.service.ts index 0c948fe0c6b..13b94a2fed2 100644 --- a/libs/common/src/vault/services/cipher.service.ts +++ b/libs/common/src/vault/services/cipher.service.ts @@ -836,7 +836,7 @@ export class CipherService implements CipherServiceAbstraction { organizationId: string, collectionIds: string[], userId: UserId, - ): Promise { + ) { const promises: Promise[] = []; const encCiphers: Cipher[] = []; for (const cipher of ciphers) { @@ -851,7 +851,16 @@ export class CipherService implements CipherServiceAbstraction { await Promise.all(promises); const request = new CipherBulkShareRequest(encCiphers, collectionIds, userId); try { - await this.apiService.putShareCiphers(request); + const response = await this.apiService.putShareCiphers(request); + const responseMap = new Map(response.map((c) => [c.id, c])); + + encCiphers.forEach((cipher) => { + const matchingCipher = responseMap.get(cipher.id); + if (matchingCipher) { + cipher.revisionDate = new Date(matchingCipher.revisionDate); + } + }); + await this.upsert(encCiphers.map((c) => c.toCipherData())); } catch (e) { for (const cipher of ciphers) { cipher.organizationId = null; @@ -859,7 +868,6 @@ export class CipherService implements CipherServiceAbstraction { } throw e; } - await this.upsert(encCiphers.map((c) => c.toCipherData())); } saveAttachmentWithServer( diff --git a/libs/common/tsconfig.spec.json b/libs/common/tsconfig.spec.json index de184bd7608..d52d889aa78 100644 --- a/libs/common/tsconfig.spec.json +++ b/libs/common/tsconfig.spec.json @@ -1,4 +1,8 @@ { "extends": "./tsconfig.json", + "compilerOptions": { + "isolatedModules": true, + "emitDecoratorMetadata": false + }, "files": ["./test.setup.ts"] } diff --git a/libs/components/jest.config.js b/libs/components/jest.config.js index 2f4b1ed15d4..082d378dced 100644 --- a/libs/components/jest.config.js +++ b/libs/components/jest.config.js @@ -8,7 +8,6 @@ const sharedConfig = require("../../libs/shared/jest.config.angular"); module.exports = { ...sharedConfig, displayName: "libs/components tests", - preset: "jest-preset-angular", setupFilesAfterEnv: ["/test.setup.ts"], moduleNameMapper: pathsToModuleNameMapper(compilerOptions?.paths || {}, { prefix: "/", diff --git a/libs/components/src/a11y/a11y-cell.directive.ts b/libs/components/src/a11y/a11y-cell.directive.ts index c9a8fdda255..3a2d5c4f6b2 100644 --- a/libs/components/src/a11y/a11y-cell.directive.ts +++ b/libs/components/src/a11y/a11y-cell.directive.ts @@ -6,7 +6,6 @@ import { FocusableElement } from "../shared/focusable-element"; @Directive({ selector: "bitA11yCell", - standalone: true, providers: [{ provide: FocusableElement, useExisting: A11yCellDirective }], }) export class A11yCellDirective implements FocusableElement { diff --git a/libs/components/src/a11y/a11y-grid.directive.ts b/libs/components/src/a11y/a11y-grid.directive.ts index ef7ba68b65c..c061464239e 100644 --- a/libs/components/src/a11y/a11y-grid.directive.ts +++ b/libs/components/src/a11y/a11y-grid.directive.ts @@ -15,7 +15,6 @@ import { A11yRowDirective } from "./a11y-row.directive"; @Directive({ selector: "bitA11yGrid", - standalone: true, }) export class A11yGridDirective implements AfterViewInit { @HostBinding("attr.role") diff --git a/libs/components/src/a11y/a11y-row.directive.ts b/libs/components/src/a11y/a11y-row.directive.ts index 7e0431d17e2..f7588dc0053 100644 --- a/libs/components/src/a11y/a11y-row.directive.ts +++ b/libs/components/src/a11y/a11y-row.directive.ts @@ -13,7 +13,6 @@ import { A11yCellDirective } from "./a11y-cell.directive"; @Directive({ selector: "bitA11yRow", - standalone: true, }) export class A11yRowDirective implements AfterViewInit { @HostBinding("attr.role") diff --git a/libs/components/src/a11y/a11y-title.directive.ts b/libs/components/src/a11y/a11y-title.directive.ts index c3833f42ed2..f5f016b93c0 100644 --- a/libs/components/src/a11y/a11y-title.directive.ts +++ b/libs/components/src/a11y/a11y-title.directive.ts @@ -4,7 +4,6 @@ import { Directive, ElementRef, Input, OnInit, Renderer2 } from "@angular/core"; @Directive({ selector: "[appA11yTitle]", - standalone: true, }) export class A11yTitleDirective implements OnInit { @Input() set appA11yTitle(title: string) { diff --git a/libs/components/src/async-actions/bit-action.directive.ts b/libs/components/src/async-actions/bit-action.directive.ts index ac50082852a..46132803475 100644 --- a/libs/components/src/async-actions/bit-action.directive.ts +++ b/libs/components/src/async-actions/bit-action.directive.ts @@ -15,7 +15,6 @@ import { FunctionReturningAwaitable, functionToObservable } from "../utils/funct */ @Directive({ selector: "[bitAction]", - standalone: true, }) export class BitActionDirective implements OnDestroy { private destroy$ = new Subject(); diff --git a/libs/components/src/async-actions/bit-submit.directive.ts b/libs/components/src/async-actions/bit-submit.directive.ts index a38e76aaca6..838d78af8b2 100644 --- a/libs/components/src/async-actions/bit-submit.directive.ts +++ b/libs/components/src/async-actions/bit-submit.directive.ts @@ -14,7 +14,6 @@ import { FunctionReturningAwaitable, functionToObservable } from "../utils/funct */ @Directive({ selector: "[formGroup][bitSubmit]", - standalone: true, }) export class BitSubmitDirective implements OnInit, OnDestroy { private destroy$ = new Subject(); diff --git a/libs/components/src/async-actions/form-button.directive.ts b/libs/components/src/async-actions/form-button.directive.ts index 1c2855f32e7..95a133403bf 100644 --- a/libs/components/src/async-actions/form-button.directive.ts +++ b/libs/components/src/async-actions/form-button.directive.ts @@ -25,7 +25,6 @@ import { BitSubmitDirective } from "./bit-submit.directive"; */ @Directive({ selector: "button[bitFormButton]", - standalone: true, }) export class BitFormButtonDirective implements OnDestroy { private destroy$ = new Subject(); diff --git a/libs/components/src/async-actions/in-forms.stories.ts b/libs/components/src/async-actions/in-forms.stories.ts index b45f750084c..857a23227f5 100644 --- a/libs/components/src/async-actions/in-forms.stories.ts +++ b/libs/components/src/async-actions/in-forms.stories.ts @@ -30,11 +30,11 @@ const template = ` - - - - - + + + + + `; @Component({ diff --git a/libs/components/src/async-actions/standalone.stories.ts b/libs/components/src/async-actions/standalone.stories.ts index 52b85b88561..d6f7f978bd5 100644 --- a/libs/components/src/async-actions/standalone.stories.ts +++ b/libs/components/src/async-actions/standalone.stories.ts @@ -12,7 +12,7 @@ import { IconButtonModule } from "../icon-button"; import { BitActionDirective } from "./bit-action.directive"; const template = /*html*/ ` - `; diff --git a/libs/components/src/avatar/avatar.component.ts b/libs/components/src/avatar/avatar.component.ts index c66bba1c462..8ccd639a41d 100644 --- a/libs/components/src/avatar/avatar.component.ts +++ b/libs/components/src/avatar/avatar.component.ts @@ -27,7 +27,6 @@ const SizeClasses: Record = { template: `@if (src) { }`, - standalone: true, imports: [NgClass], }) export class AvatarComponent implements OnChanges { diff --git a/libs/components/src/badge-list/badge-list.component.ts b/libs/components/src/badge-list/badge-list.component.ts index 86e9a84cb77..7b719a4ec86 100644 --- a/libs/components/src/badge-list/badge-list.component.ts +++ b/libs/components/src/badge-list/badge-list.component.ts @@ -10,7 +10,6 @@ import { BadgeModule, BadgeVariant } from "../badge"; @Component({ selector: "bit-badge-list", templateUrl: "badge-list.component.html", - standalone: true, imports: [BadgeModule, I18nPipe], }) export class BadgeListComponent implements OnChanges { diff --git a/libs/components/src/badge/badge.component.ts b/libs/components/src/badge/badge.component.ts index 3612827eff2..e2cbb4f1ceb 100644 --- a/libs/components/src/badge/badge.component.ts +++ b/libs/components/src/badge/badge.component.ts @@ -51,16 +51,15 @@ const hoverStyles: Record = { * The Badge directive can be used on a `` (non clickable events), or an `` or ` `, + standalone: false, }) class TestApp { buttonType: string; diff --git a/libs/components/src/button/button.component.ts b/libs/components/src/button/button.component.ts index 19618938c42..002b2a9d915 100644 --- a/libs/components/src/button/button.component.ts +++ b/libs/components/src/button/button.component.ts @@ -52,7 +52,6 @@ const buttonStyles: Record = { selector: "button[bitButton], a[bitButton]", templateUrl: "button.component.html", providers: [{ provide: ButtonLikeAbstraction, useExisting: ButtonComponent }], - standalone: true, imports: [NgClass], host: { "[attr.disabled]": "disabledAttr()", diff --git a/libs/components/src/button/button.stories.ts b/libs/components/src/button/button.stories.ts index d0a4354f374..29a9e367fcc 100644 --- a/libs/components/src/button/button.stories.ts +++ b/libs/components/src/button/button.stories.ts @@ -88,13 +88,13 @@ export const DisabledWithAttribute: Story = { props: args, template: ` @if (disabled) { - - - + + + } @else { - - - + + + } `, }), @@ -110,10 +110,10 @@ export const Block: Story = { template: ` - [block]="true" Link + [block]="true" Link - - block Link + + block Link `, }), diff --git a/libs/components/src/callout/callout.component.html b/libs/components/src/callout/callout.component.html index 4e7b5f2a0cc..509d14188ca 100644 --- a/libs/components/src/callout/callout.component.html +++ b/libs/components/src/callout/callout.component.html @@ -1,5 +1,5 @@