1
0
mirror of https://github.com/bitwarden/browser synced 2026-01-28 07:13:29 +00:00

[PM-28749] Desktop Transfer Items (#18410)

* add transfer items prompt to desktop

* add transfer service to vault v3
This commit is contained in:
Nick Krantz
2026-01-22 15:20:53 -06:00
committed by GitHub
parent 1baed4dea8
commit a9d8edc52c
2 changed files with 22 additions and 0 deletions

View File

@@ -79,6 +79,8 @@ import {
VaultFilter,
VaultFilterServiceAbstraction as VaultFilterService,
RoutedVaultFilterBridgeService,
VaultItemsTransferService,
DefaultVaultItemsTransferService,
} from "@bitwarden/vault";
import { SearchBarService } from "../../../app/layout/search/search-bar.service";
@@ -130,6 +132,7 @@ const BroadcasterSubscriptionId = "VaultComponent";
provide: COPY_CLICK_LISTENER,
useExisting: VaultComponent,
},
{ provide: VaultItemsTransferService, useClass: DefaultVaultItemsTransferService },
],
})
export class VaultComponent implements OnInit, OnDestroy, CopyClickListener {
@@ -214,6 +217,7 @@ export class VaultComponent implements OnInit, OnDestroy, CopyClickListener {
private archiveCipherUtilitiesService: ArchiveCipherUtilitiesService,
private routedVaultFilterBridgeService: RoutedVaultFilterBridgeService,
private vaultFilterService: VaultFilterService,
private vaultItemTransferService: VaultItemsTransferService,
) {}
async ngOnInit() {
@@ -266,6 +270,11 @@ export class VaultComponent implements OnInit, OnDestroy, CopyClickListener {
if (this.vaultItemsComponent) {
await this.vaultItemsComponent.refresh().catch(() => {});
}
if (this.activeUserId) {
void this.vaultItemTransferService.enforceOrganizationDataOwnership(
this.activeUserId,
);
}
break;
case "modalShown":
this.showingModal = true;
@@ -372,6 +381,8 @@ export class VaultComponent implements OnInit, OnDestroy, CopyClickListener {
.subscribe((collections) => {
this.filteredCollections = collections;
});
void this.vaultItemTransferService.enforceOrganizationDataOwnership(this.activeUserId);
}
ngOnDestroy() {

View File

@@ -92,6 +92,8 @@ import {
PasswordRepromptService,
CipherFormComponent,
ArchiveCipherUtilitiesService,
VaultItemsTransferService,
DefaultVaultItemsTransferService,
} from "@bitwarden/vault";
import { NavComponent } from "../../../app/layout/nav.component";
@@ -150,6 +152,7 @@ const BroadcasterSubscriptionId = "VaultComponent";
provide: COPY_CLICK_LISTENER,
useExisting: VaultV2Component,
},
{ provide: VaultItemsTransferService, useClass: DefaultVaultItemsTransferService },
],
})
export class VaultV2Component<C extends CipherViewLike>
@@ -264,6 +267,7 @@ export class VaultV2Component<C extends CipherViewLike>
private policyService: PolicyService,
private archiveCipherUtilitiesService: ArchiveCipherUtilitiesService,
private masterPasswordService: MasterPasswordServiceAbstraction,
private vaultItemTransferService: VaultItemsTransferService,
) {}
async ngOnInit() {
@@ -317,6 +321,11 @@ export class VaultV2Component<C extends CipherViewLike>
.catch(() => {});
await this.vaultFilterComponent.reloadOrganizations().catch(() => {});
}
if (this.activeUserId) {
void this.vaultItemTransferService.enforceOrganizationDataOwnership(
this.activeUserId,
);
}
break;
case "modalShown":
this.showingModal = true;
@@ -420,6 +429,8 @@ export class VaultV2Component<C extends CipherViewLike>
.subscribe((collections) => {
this.allCollections = collections;
});
void this.vaultItemTransferService.enforceOrganizationDataOwnership(this.activeUserId);
}
ngOnDestroy() {