diff --git a/libs/common/src/enums/feature-flag.enum.ts b/libs/common/src/enums/feature-flag.enum.ts index 85e51a7b7ab..3c23402dd5f 100644 --- a/libs/common/src/enums/feature-flag.enum.ts +++ b/libs/common/src/enums/feature-flag.enum.ts @@ -80,7 +80,6 @@ export enum FeatureFlag { PM28190CipherSharingOpsToSdk = "pm-28190-cipher-sharing-ops-to-sdk", PM22134SdkCipherListView = "pm-22134-sdk-cipher-list-view", CipherKeyEncryption = "cipher-key-encryption", - MigrateMyVaultToMyItems = "pm-20558-migrate-myvault-to-myitems", PM27632_SdkCipherCrudOperations = "pm-27632-cipher-crud-operations-to-sdk", PM28191CipherAdminOpsToSdk = "pm-28191-cipher-admin-ops-to-sdk", PM28192_CipherAttachmentOpsToSdk = "pm-28192-cipher-attachment-ops-to-sdk", @@ -164,7 +163,6 @@ export const DefaultFeatureFlagValue = { [FeatureFlag.PM28191CipherAdminOpsToSdk]: FALSE, [FeatureFlag.PM28190CipherSharingOpsToSdk]: FALSE, [FeatureFlag.PM28192_CipherAttachmentOpsToSdk]: FALSE, - [FeatureFlag.MigrateMyVaultToMyItems]: FALSE, [FeatureFlag.PM30521_AutofillButtonViewLoginScreen]: FALSE, [FeatureFlag.PM29438_DialogWithExtensionPromptAccountAge]: 5, [FeatureFlag.PM32180PremiumUpsellAccountAge]: 7, diff --git a/libs/vault/src/services/default-vault-items-transfer.service.spec.ts b/libs/vault/src/services/default-vault-items-transfer.service.spec.ts index 752bbef248c..8429730a65d 100644 --- a/libs/vault/src/services/default-vault-items-transfer.service.spec.ts +++ b/libs/vault/src/services/default-vault-items-transfer.service.spec.ts @@ -10,8 +10,6 @@ import { CollectionView } from "@bitwarden/common/admin-console/models/collectio import { Organization } from "@bitwarden/common/admin-console/models/domain/organization"; import { Policy } from "@bitwarden/common/admin-console/models/domain/policy"; import { EventCollectionService, EventType } from "@bitwarden/common/dirt/event-logs"; -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 { OrganizationId, CollectionId } from "@bitwarden/common/types/guid"; import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.service"; @@ -41,7 +39,6 @@ describe("DefaultVaultItemsTransferService", () => { let mockDialogService: MockProxy; let mockToastService: MockProxy; let mockEventCollectionService: MockProxy; - let mockConfigService: MockProxy; let mockOrganizationUserApiService: MockProxy; let mockSyncService: MockProxy; @@ -78,7 +75,6 @@ describe("DefaultVaultItemsTransferService", () => { mockDialogService = mock(); mockToastService = mock(); mockEventCollectionService = mock(); - mockConfigService = mock(); mockOrganizationUserApiService = mock(); mockSyncService = mock(); @@ -95,7 +91,6 @@ describe("DefaultVaultItemsTransferService", () => { mockDialogService, mockToastService, mockEventCollectionService, - mockConfigService, mockOrganizationUserApiService, mockSyncService, ); @@ -653,13 +648,11 @@ describe("DefaultVaultItemsTransferService", () => { } as Organization; function setupMocksForEnforcementScenario(options: { - featureEnabled?: boolean; policies?: Policy[]; organizations?: Organization[]; ciphers?: CipherView[]; defaultCollection?: CollectionView; }): void { - mockConfigService.getFeatureFlag.mockResolvedValue(options.featureEnabled ?? true); mockPolicyService.policiesByType$.mockReturnValue(of(options.policies ?? [])); mockOrganizationService.organizations$.mockReturnValue(of(options.organizations ?? [])); mockCipherService.cipherViews$.mockReturnValue(of(options.ciphers ?? [])); @@ -668,28 +661,6 @@ describe("DefaultVaultItemsTransferService", () => { mockOrganizationUserApiService.revokeSelf.mockResolvedValue(undefined); } - it("does nothing when feature flag is disabled", async () => { - setupMocksForEnforcementScenario({ - featureEnabled: false, - policies: [policy], - organizations: [organization], - ciphers: [{ id: "cipher-1" } as CipherView], - defaultCollection: { - id: collectionId, - organizationId: organizationId, - isDefaultCollection: true, - } as CollectionView, - }); - - await service.enforceOrganizationDataOwnership(userId); - - expect(mockConfigService.getFeatureFlag).toHaveBeenCalledWith( - FeatureFlag.MigrateMyVaultToMyItems, - ); - expect(mockDialogService.open).not.toHaveBeenCalled(); - expect(mockCipherService.shareManyWithServer).not.toHaveBeenCalled(); - }); - it("does nothing when no migration is required", async () => { setupMocksForEnforcementScenario({ policies: [] }); @@ -965,13 +936,11 @@ describe("DefaultVaultItemsTransferService", () => { } as Organization; function setupMocksForTransferScenario(options: { - featureEnabled?: boolean; policies?: Policy[]; organizations?: Organization[]; ciphers?: CipherView[]; defaultCollection?: CollectionView; }): void { - mockConfigService.getFeatureFlag.mockResolvedValue(options.featureEnabled ?? true); mockPolicyService.policiesByType$.mockReturnValue(of(options.policies ?? [])); mockOrganizationService.organizations$.mockReturnValue(of(options.organizations ?? [])); mockCipherService.cipherViews$.mockReturnValue(of(options.ciphers ?? [])); @@ -1058,7 +1027,6 @@ describe("DefaultVaultItemsTransferService", () => { } as CollectionView; beforeEach(() => { - mockConfigService.getFeatureFlag.mockResolvedValue(true); mockPolicyService.policiesByType$.mockReturnValue(of([policy])); mockOrganizationService.organizations$.mockReturnValue(of([organization])); mockCipherService.cipherViews$.mockReturnValue(of(personalCiphers)); diff --git a/libs/vault/src/services/default-vault-items-transfer.service.ts b/libs/vault/src/services/default-vault-items-transfer.service.ts index a3f38b0b8c5..f8ab8d76daf 100644 --- a/libs/vault/src/services/default-vault-items-transfer.service.ts +++ b/libs/vault/src/services/default-vault-items-transfer.service.ts @@ -16,8 +16,6 @@ import { PolicyService } from "@bitwarden/common/admin-console/abstractions/poli import { OrganizationUserStatusType, PolicyType } from "@bitwarden/common/admin-console/enums"; import { Organization } from "@bitwarden/common/admin-console/models/domain/organization"; import { EventCollectionService, EventType } from "@bitwarden/common/dirt/event-logs"; -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 { getById } from "@bitwarden/common/platform/misc"; import { OrganizationId, CollectionId } from "@bitwarden/common/types/guid"; @@ -52,7 +50,6 @@ export class DefaultVaultItemsTransferService implements VaultItemsTransferServi private dialogService: DialogService, private toastService: ToastService, private eventCollectionService: EventCollectionService, - private configService: ConfigService, private organizationUserApiService: OrganizationUserApiService, private syncService: SyncService, ) {} @@ -148,11 +145,7 @@ export class DefaultVaultItemsTransferService implements VaultItemsTransferServi } async enforceOrganizationDataOwnership(userId: UserId): Promise { - const featureEnabled = await this.configService.getFeatureFlag( - FeatureFlag.MigrateMyVaultToMyItems, - ); - - if (!featureEnabled || this.enforcementInFlight) { + if (this.enforcementInFlight) { return; }