1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-22 11:45:59 +01:00

[EC-282/EC-286] Update queryParams to use new filter object (#2985)

* [EC-282] Update queryParams to use new filter object

* Removed unused properties

* Removed unused method/property for organization vault

* Fixed organization trash filter
This commit is contained in:
Vincent Salucci 2022-06-29 15:12:08 -05:00 committed by GitHub
parent 3ae30d866c
commit a89b745f0b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 18 deletions

View File

@ -57,16 +57,12 @@ export class IndividualVaultComponent implements OnInit, OnDestroy {
@ViewChild("updateKeyTemplate", { read: ViewContainerRef, static: true })
updateKeyModalRef: ViewContainerRef;
favorites = false;
folderId: string = null;
collectionId: string = null;
organizationId: string = null;
myVaultOnly = false;
showVerifyEmail = false;
showBrowserOutdated = false;
showUpdateKey = false;
showPremiumCallout = false;
deleted = false;
trashCleanupWarning: string = null;
activeFilter: VaultFilter = new VaultFilter();
@ -402,11 +398,11 @@ export class IndividualVaultComponent implements OnInit, OnDestroy {
private go(queryParams: any = null) {
if (queryParams == null) {
queryParams = {
favorites: this.favorites ? true : null,
favorites: this.activeFilter.status === "favorites" ? true : null,
type: this.activeFilter.cipherType,
folderId: this.folderId,
collectionId: this.collectionId,
deleted: this.deleted ? true : null,
folderId: this.activeFilter.selectedFolderId,
collectionId: this.activeFilter.selectedCollectionId,
deleted: this.activeFilter.status === "trash" ? true : null,
};
}

View File

@ -54,7 +54,6 @@ export class OrganizationVaultComponent implements OnInit, OnDestroy {
organization: Organization;
collectionId: string = null;
type: CipherType = null;
deleted = false;
trashCleanupWarning: string = null;
activeFilter: VaultFilter = new VaultFilter();
@ -152,6 +151,10 @@ export class OrganizationVaultComponent implements OnInit, OnDestroy {
});
}
get deleted(): boolean {
return this.activeFilter.status === "trash";
}
ngOnDestroy() {
this.broadcasterService.unsubscribe(BroadcasterSubscriptionId);
}
@ -171,7 +174,7 @@ export class OrganizationVaultComponent implements OnInit, OnDestroy {
if (this.activeFilter.status === "favorites" && cipherPassesFilter) {
cipherPassesFilter = cipher.favorite;
}
if (this.activeFilter.status === "trash" && cipherPassesFilter) {
if (this.deleted && cipherPassesFilter) {
cipherPassesFilter = cipher.isDeleted;
}
if (this.activeFilter.cipherType != null && cipherPassesFilter) {
@ -331,17 +334,11 @@ export class OrganizationVaultComponent implements OnInit, OnDestroy {
});
}
private clearFilters() {
this.collectionId = null;
this.type = null;
this.deleted = false;
}
private go(queryParams: any = null) {
if (queryParams == null) {
queryParams = {
type: this.type,
collectionId: this.collectionId,
type: this.activeFilter.cipherType,
collectionId: this.activeFilter.selectedCollectionId,
deleted: this.deleted ? true : null,
};
}