[SG-300] Adding an Item defaults owner to selected vault (#2697)

This commit is contained in:
Robyn MacCallum 2022-05-17 17:03:57 -04:00 committed by GitHub
parent 7af2e9aa31
commit 58611fdd00
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 16 additions and 3 deletions

View File

@ -95,6 +95,9 @@ export class AddEditComponent extends BaseAddEditComponent {
if (params.cloneMode != null) {
this.cloneMode = params.cloneMode === "true";
}
if (params.selectedVault) {
this.organizationId = params.selectedVault;
}
await this.load();
if (!this.editMode || this.cloneMode) {

View File

@ -234,6 +234,7 @@ export class CiphersComponent extends BaseCiphersComponent implements OnInit, On
folderId: this.folderId,
type: this.type,
collectionId: this.collectionId,
selectedVault: this.vaultFilter.selectedOrganizationId,
},
});
}

View File

@ -118,7 +118,13 @@ export class CurrentTabComponent implements OnInit, OnDestroy {
}
addCipher() {
this.router.navigate(["/add-cipher"], { queryParams: { name: this.hostname, uri: this.url } });
this.router.navigate(["/add-cipher"], {
queryParams: {
name: this.hostname,
uri: this.url,
selectedVault: this.vaultFilterService.getVaultFilter().selectedOrganizationId,
},
});
}
viewCipher(cipher: CipherView) {

View File

@ -22,7 +22,7 @@
</button>
</div>
</header>
<main tabindex="-1">
<main tabindex="-1" cdk-scrollable>
<app-vault-select (onVaultSelectionChanged)="vaultFilterChanged()"></app-vault-select>
<div class="no-items" *ngIf="(!ciphers || !ciphers.length) && !showSearching()">
<i class="bwi bwi-spinner bwi-spin bwi-3x" *ngIf="!loaded"></i>

View File

@ -266,7 +266,9 @@ export class VaultFilterComponent implements OnInit, OnDestroy {
}
async addCipher() {
this.router.navigate(["/add-cipher"]);
this.router.navigate(["/add-cipher"], {
queryParams: { selectedVault: this.vaultFilter.selectedOrganizationId },
});
}
async vaultFilterChanged() {

View File

@ -145,6 +145,7 @@ export class VaultSelectComponent implements OnInit {
positionStrategy,
maxHeight: viewPortHeight - 160,
backdropClass: "cdk-overlay-transparent-backdrop",
scrollStrategy: this.overlay.scrollStrategies.close(),
});
const templatePortal = new TemplatePortal(this.templateRef, this.viewContainerRef);